andy 3 anni fa
parent
commit
729030940c
19 ha cambiato i file con 353 aggiunte e 50 eliminazioni
  1. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/FlowConfigHeaderController.java
  2. 6 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/InvLotLocIdController.java
  3. 30 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/InvLotattController.java
  4. 23 2
      ruoyi-admin/src/main/java/com/ruoyi/web/test/Test.java
  5. 2 0
      ruoyi-admin/src/test/java/com/ruoyi/admin/test/base/WarehouseTest.java
  6. 7 0
      ruoyi-ui/src/api/ams/invLotLocId.js
  7. 68 4
      ruoyi-ui/src/views/ams/inv/locationView/index.vue
  8. 16 1
      warewms-ams/src/main/java/com/ruoyi/ams/business/BusinessServiceImpl.java
  9. 39 0
      warewms-ams/src/main/java/com/ruoyi/ams/business/domain/LocationSortComparator.java
  10. 38 0
      warewms-ams/src/main/java/com/ruoyi/ams/business/domain/LocationSortDTO.java
  11. 1 0
      warewms-ams/src/main/java/com/ruoyi/ams/config/domain/form/FlowConfigForm.java
  12. 3 2
      warewms-ams/src/main/java/com/ruoyi/ams/config/service/IFlowConfigHeaderService.java
  13. 53 37
      warewms-ams/src/main/java/com/ruoyi/ams/config/service/LocationAllocationStrategy.java
  14. 12 2
      warewms-ams/src/main/java/com/ruoyi/ams/config/service/impl/FlowConfigHeaderServiceImpl.java
  15. 7 0
      warewms-ams/src/main/java/com/ruoyi/ams/inv/mapper/InvLotLocIdMapper.java
  16. 7 0
      warewms-ams/src/main/java/com/ruoyi/ams/inv/service/IInvLotLocIdService.java
  17. 5 0
      warewms-ams/src/main/java/com/ruoyi/ams/inv/service/impl/InvLotLocIdServiceImpl.java
  18. 22 0
      warewms-ams/src/main/java/com/ruoyi/ams/task/service/TaskDispatchService.java
  19. 12 0
      warewms-ams/src/main/resources/mapper/ams/InvLotLocIdMapper.xml

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/FlowConfigHeaderController.java

@@ -90,7 +90,7 @@ public class FlowConfigHeaderController extends BaseController {
     @PostMapping
     public AjaxResult add(@RequestBody FlowConfigForm flowConfigForm) {
         //return toAjax(flowConfigHeaderService.insertFlowConfigHeader(flowConfigHeader));
-        return flowConfigHeaderService.addFlowConfig(flowConfigForm);
+        return flowConfigHeaderService.addFlowConfig(flowConfigForm, getLoginUser());
     }
 
     /**
@@ -100,7 +100,7 @@ public class FlowConfigHeaderController extends BaseController {
     @Log(title = "流程配置头", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody FlowConfigForm flowConfigForm) {
-        return flowConfigHeaderService.updateFlowConfigHeader(flowConfigForm);
+        return flowConfigHeaderService.updateFlowConfigHeader(flowConfigForm, getLoginUser());
     }
 
     /**

+ 6 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/InvLotLocIdController.java

@@ -98,4 +98,10 @@ public class InvLotLocIdController extends BaseController {
     public AjaxResult remove(@PathVariable String[] lotnums) {
         return toAjax(invLotLocIdService.deleteInvLotLocIdByLotnums(lotnums));
     }
+
+    @GetMapping(value = "/locationLotatt/{locationId}")
+    public AjaxResult locationLotatt(@PathVariable("locationId") Long locationId) {
+        List<InvLotLocIdLotattVO> invLotLocIdLotattVOS = invLotLocIdService.selectInvLocIdLotattByLocationId(locationId);
+        return AjaxResult.success(invLotLocIdLotattVOS);
+    }
 }

+ 30 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/InvLotattController.java

@@ -0,0 +1,30 @@
+package com.ruoyi.web.controller.warewms.ams;
+
+import com.ruoyi.ams.inv.domain.InvLotAtt;
+import com.ruoyi.ams.inv.service.IInvLotAttService;
+import com.ruoyi.ams.inv.service.IInvLotLocIdService;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy.qu
+ * Date: 2022/3/21
+ */
+@RestController
+@RequestMapping("/ams/invLotatt")
+public class InvLotattController extends BaseController {
+
+    @Autowired
+    private IInvLotAttService invLotAttService;
+
+    @GetMapping(value = "/info/{locationId}")
+    public AjaxResult getInfo(@PathVariable("locationId") Long locationId) {
+        return null;
+    }
+}

+ 23 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/test/Test.java

@@ -1,5 +1,12 @@
 package com.ruoyi.web.test;
 
+import com.alibaba.fastjson.JSON;
+import com.ruoyi.ams.business.domain.LocationSortComparator;
+import com.ruoyi.ams.business.domain.LocationSortDTO;
+import org.apache.commons.compress.utils.Lists;
+
+import java.util.ArrayList;
+
 /**
  * Created by IntelliJ IDEA.
  * User: andy.qu
@@ -8,7 +15,21 @@ package com.ruoyi.web.test;
 public class Test {
 
     public static void main(String[] args) {
-        String[] strings = new String[] {"1","2"};
-        System.out.println(String.join(",", strings));
+//        String[] strings = new String[] {"1","2"};
+//        System.out.println(String.join(",", strings));
+        LocationSortDTO sortDTO1 = new LocationSortDTO("A","2021-01-01");
+        LocationSortDTO sortDTO2 = new LocationSortDTO("A","2021-01-02");
+        LocationSortDTO sortDTO3 = new LocationSortDTO("A","2021-01-03");
+        LocationSortDTO sortDTO4 = new LocationSortDTO("A1","2021-02-01");
+        LocationSortDTO sortDTO5 = new LocationSortDTO("A2",null);
+        ArrayList<LocationSortDTO> list = new ArrayList<>();
+        list.add(sortDTO3);
+        list.add(sortDTO4);
+        list.add(sortDTO5);
+        list.add(sortDTO1);
+        list.add(sortDTO2);
+
+        list.sort(new LocationSortComparator());
+        System.out.println(JSON.toJSONString(list));
     }
 }

+ 2 - 0
ruoyi-admin/src/test/java/com/ruoyi/admin/test/base/WarehouseTest.java

@@ -113,4 +113,6 @@ public class WarehouseTest {
         LocationViewVO locationViewVO = locationViewService.locationView(form);
         System.out.println(JSON.toJSONString(locationViewVO));
     }
+
+
 }

+ 7 - 0
ruoyi-ui/src/api/ams/invLotLocId.js

@@ -42,3 +42,10 @@ export function delInvLotLocId(lotnum) {
     method: 'delete'
   })
 }
+
+export function lotattInfo(id) {
+  return request({
+    url: '/ams/invLotLocId/locationLotatt/'+id,
+    method: 'get'
+  })
+}

+ 68 - 4
ruoyi-ui/src/views/ams/inv/locationView/index.vue

@@ -48,7 +48,7 @@
         </li>
       </ul>
     </div>
-    <el-dialog title="操作" :visible.sync="open" width="500px" append-to-body>
+    <el-dialog title="操作" :visible.sync="open" width="800px" append-to-body>
       <el-form>
         <el-form-item>
           <el-button type="primary" @click="lockLoc()">锁定/解锁</el-button>
@@ -57,6 +57,23 @@
           <!--<el-button type="primary" @click="submitForm">初始化一个空托盘</el-button>-->
         </el-form-item>
       </el-form>
+      <el-divider content-position="center">批次属性信息</el-divider>
+      <el-table v-loading="loading" :data="form.lotattList">
+        <el-table-column label="物料" align="center" prop="sku" width="200"/>
+        <el-table-column label="物料名称" align="center" prop="skuName" width="200"/>
+        <el-table-column label="库位" align="center" prop="locationNo" width="200"/>
+        <el-table-column label="库存数量" align="center" prop="qty"/>
+        <el-table-column label="已分配数量" align="center" prop="qtyallocated" width="200"/>
+        <el-table-column
+          v-for="(item, index) in itemOption"
+          :key="index"
+          :label="item.label"
+          align="center" :prop="item.prop" width="200">
+        </el-table-column>
+      </el-table>
+      <!--<el-descriptions title="批次属性" :column="2" border>
+        <el-descriptions-item v-for="(item, index) in itemOption" :label="item.label">{{form[`${item.prop}`]}}</el-descriptions-item>
+      </el-descriptions>-->
     </el-dialog>
   </div>
 </template>
@@ -65,6 +82,8 @@
   import { locationView, lockLocRequest, occupyLocRequest, clearLocRequest } from "@/api/ams/locationView";
   import { queryLocationZoneDict } from "@/api/base/locationZone";
   import { queryWarehouseDict } from "@/api/base/warehouse";
+  import { lotattConfigList } from "@/api/ams/config";
+  import { lotattInfo } from "@/api/ams/invLotLocId";
 
   export default {
     name: "LocationView",
@@ -81,7 +100,27 @@
           warehouseId: 1
         },
         // 表单参数
-        form: {},
+        form: {
+          lotatt01: '',
+          lotatt02: '',
+          lotatt03: '',
+          lotatt04: '',
+          lotatt05: '',
+          lotatt06: '',
+          lotatt07: '',
+          lotatt08: '',
+          lotatt09: '',
+          lotatt10: '',
+          lotatt11: '',
+          lotatt12: '',
+          lotatt13: '',
+          lotatt14: '',
+          lotatt15: '',
+          lotatt16: '',
+          lotatt17: '',
+          lotatt18: '',
+          lotattList: null
+        },
         // 表单校验
         rules: {},
         tableAttr: {
@@ -90,7 +129,8 @@
         },
         currentSelect: null,
         locationZoneCombo: [],
-        warehouseCombo: []
+        warehouseCombo: [],
+        itemOption: []
       };
     },
     created() {
@@ -105,6 +145,15 @@
         queryLocationZoneDict().then(response => {
           this.locationZoneCombo = response.data
         });
+        lotattConfigList().then(response => {
+          let data = response.data
+          for(let i=0;i<data.length;i++) {
+            let obj = new Object();
+            obj.label = data[i].lotattName
+            obj.prop = data[i].lotattId
+            this.itemOption.push(obj)
+          }
+        })
       },
       search() {
         locationView(this.queryParams).then(response => {
@@ -115,10 +164,25 @@
         })
       },
       selected(item) {
-        console.log(item)
         if (item.locationNo) {
           this.currentSelect = parseInt(item.id)
           this.open = true;
+          lotattInfo(this.currentSelect).then(response => {
+            // this.form.lotatt01 = response.data.lotatt01
+            // this.form.lotatt02 = response.data.lotatt02
+            // this.form.lotatt03 = response.data.lotatt03
+            // this.form.lotatt04 = response.data.lotatt04
+            // this.form.lotatt05 = response.data.lotatt05
+            // this.form.lotatt06 = response.data.lotatt06
+            // this.form.lotatt07 = response.data.lotatt07
+            // this.form.lotatt08 = response.data.lotatt08
+            // this.form.lotatt09 = response.data.lotatt09
+            // this.form.lotatt10 = response.data.lotatt10
+            // this.form.lotatt11 = response.data.lotatt11
+            // this.form.lotatt01 = response.data.lotatt01
+            this.form.lotattList = response.data
+            this.loading = false;
+          })
         }
       },
       handleQuery() {

+ 16 - 1
warewms-ams/src/main/java/com/ruoyi/ams/business/BusinessServiceImpl.java

@@ -113,10 +113,25 @@ public class BusinessServiceImpl implements IBusinessService {
                 wcsTask.setTaskType("");
                 return businessService.addTask(wcsTask);
             } else if (!StringUtils.isEmpty(agvCallDTO.getLocationFrom()) && !StringUtils.isEmpty(agvCallDTO.getLocationTo())) {
+                BaseLocationInfo locationFrom = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(agvCallDTO.getLocationFrom(), agvCallDTO.getWarehouseId());
+                BaseLocationInfo locationTo = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(agvCallDTO.getLocationTo(), agvCallDTO.getWarehouseId());
                 //如果都不为空则表示指定任务
+                String taskNo = System.currentTimeMillis() + "";
+                WcsTask wcsTask = new WcsTask();
+                wcsTask.setTaskNo(taskNo);
+                wcsTask.setAreaFrom(locationFrom.getZoneId().toString());
+                wcsTask.setLocationFrom(locationFrom.getId().toString());
+                wcsTask.setAreaTo(locationTo.getZoneId() + "");
+                wcsTask.setLocationTo(locationTo.getId().toString());
+                wcsTask.setState(9L);
+                wcsTask.setPriority(1L);
+                wcsTask.setCreateDate(new Date());
+                wcsTask.setBusinessType("01");
+                wcsTask.setTaskType("");
+                return businessService.addTask(wcsTask);
             }
         }
-        return null;
+        return AjaxResult.error("无效的指令");
     }
 
     @Transactional

+ 39 - 0
warewms-ams/src/main/java/com/ruoyi/ams/business/domain/LocationSortComparator.java

@@ -0,0 +1,39 @@
+package com.ruoyi.ams.business.domain;
+
+import com.ruoyi.common.utils.StringUtils;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Comparator;
+import java.util.Date;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy.qu
+ * Date: 2022/3/21
+ */
+public class LocationSortComparator implements Comparator<LocationSortDTO> {
+
+    @Override
+    public int compare(LocationSortDTO o1, LocationSortDTO o2) {
+        SimpleDateFormat sdft = new SimpleDateFormat("yyyy-MM-dd");
+        int mark = 1;
+        try {
+            if (!StringUtils.isEmpty(o1.getLotatt04()) && !StringUtils.isEmpty(o2.getLotatt04())) {
+                Date date1 = sdft.parse(o1.getLotatt04());
+                Date date2 = sdft.parse(o2.getLotatt04());
+                if (date1.getTime() < date2.getTime()) {
+                    mark = -1;//调整顺序,-1为不需要调整顺序;
+                }
+                if (date1.equals(date2)) {
+                    mark = 0;
+                }
+            } else {
+                return -1;
+            }
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return mark;
+    }
+}

+ 38 - 0
warewms-ams/src/main/java/com/ruoyi/ams/business/domain/LocationSortDTO.java

@@ -0,0 +1,38 @@
+package com.ruoyi.ams.business.domain;
+
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy.qu
+ * Date: 2022/3/21
+ */
+public class LocationSortDTO {
+
+    private String colNo;
+    private String lotatt04;
+
+    public LocationSortDTO() {
+    }
+
+    public LocationSortDTO(String colNo, String lotatt04) {
+        this.colNo = colNo;
+        this.lotatt04 = lotatt04;
+    }
+
+    public String getColNo() {
+        return colNo;
+    }
+
+    public void setColNo(String colNo) {
+        this.colNo = colNo;
+    }
+
+    public String getLotatt04() {
+        return lotatt04;
+    }
+
+    public void setLotatt04(String lotatt04) {
+        this.lotatt04 = lotatt04;
+    }
+
+}

+ 1 - 0
warewms-ams/src/main/java/com/ruoyi/ams/config/domain/form/FlowConfigForm.java

@@ -1,6 +1,7 @@
 package com.ruoyi.ams.config.domain.form;
 
 import com.ruoyi.ams.config.domain.FlowConfigDetails;
+import com.ruoyi.common.core.domain.model.LoginUser;
 
 import java.util.List;
 

+ 3 - 2
warewms-ams/src/main/java/com/ruoyi/ams/config/service/IFlowConfigHeaderService.java

@@ -6,6 +6,7 @@ import com.ruoyi.ams.config.domain.form.FlowConfigForm;
 import com.ruoyi.ams.config.domain.vo.FlowConfigHeaderVO;
 import com.ruoyi.ams.config.domain.vo.FlowConfigLotattVO;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.model.LoginUser;
 
 /**
  * 流程配置头Service接口
@@ -45,7 +46,7 @@ public interface IFlowConfigHeaderService
      * @param flowConfigForm 流程配置头
      * @return 结果
      */
-    AjaxResult updateFlowConfigHeader(FlowConfigForm flowConfigForm);
+    AjaxResult updateFlowConfigHeader(FlowConfigForm flowConfigForm, LoginUser loginUser);
 
     /**
      * 批量删除流程配置头
@@ -68,7 +69,7 @@ public interface IFlowConfigHeaderService
      * @param flowConfigForm
      * @return
      */
-     AjaxResult addFlowConfig(FlowConfigForm flowConfigForm);
+     AjaxResult addFlowConfig(FlowConfigForm flowConfigForm, LoginUser loginUser);
 
     /**
      * 查询流程配置的批次属性列表

+ 53 - 37
warewms-ams/src/main/java/com/ruoyi/ams/config/service/LocationAllocationStrategy.java

@@ -1,5 +1,7 @@
 package com.ruoyi.ams.config.service;
 
+import com.ruoyi.ams.business.domain.LocationSortComparator;
+import com.ruoyi.ams.business.domain.LocationSortDTO;
 import com.ruoyi.ams.config.domain.dto.InWarehouseDTO;
 import com.ruoyi.ams.config.domain.dto.LotattDTO;
 import com.ruoyi.ams.config.domain.dto.OutWarehouseDTO;
@@ -15,10 +17,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * Created by IntelliJ IDEA.
@@ -220,9 +219,9 @@ public class LocationAllocationStrategy {
         }
 
         //将同一列的库位排序好
-        Integer parallelCount = 0;
         LinkedHashMap<String, Boolean> taskingFlag = new LinkedHashMap<>();
         LinkedHashMap<String, List<BaseLocationLotattVO>> map = new LinkedHashMap<>();
+        List<LocationSortDTO> list = new ArrayList<>();
         for (BaseLocationLotattVO info : locationLotattVOList) {
             List<BaseLocationLotattVO> infoList;
             if (map.containsKey(info.getColNo())) {
@@ -232,7 +231,6 @@ public class LocationAllocationStrategy {
             }
             if (info.getStockStatus().equals("10")) {
                 taskingFlag.put(info.getColNo(), true);
-                parallelCount++;
             } else {
                 if (taskingFlag.get(info.getColNo()) == null || taskingFlag.get(info.getColNo()).booleanValue() == false) {
                     taskingFlag.put(info.getColNo(), false);
@@ -240,48 +238,66 @@ public class LocationAllocationStrategy {
             }
             infoList.add(info);
             map.put(info.getColNo(), infoList);
+            LocationSortDTO sortDTO = new LocationSortDTO(info.getColNo(), info.getLotattVO().getLotatt04());
+            list.add(sortDTO);
         }
-        //TODO 近效期
+
         //过滤出每列可以用的库位并进行分配
         BaseLocationInfo currentLocation = null;
-        for (Map.Entry<String, List<BaseLocationLotattVO>> entry : map.entrySet()) {
-            List<BaseLocationLotattVO> locationInfoList = entry.getValue();
-            for (BaseLocationLotattVO b : locationInfoList) {
-                if (locationPriorityHeaderVO.getSameLotattFlag().equals("N")) {
-                    //如果外围优先则跳过当前出
-                    if (locationPriorityHeaderVO.getOuterFlag().equals("Y")) {
-                        if (taskingFlag.get(b.getColNo())) {
+        if (locationPriorityHeaderVO.getPeriodFlag().equals("Y")) { //近效期
+            list.sort(new LocationSortComparator());
+            for (LocationSortDTO locationSortDTO : list) {
+                List<BaseLocationLotattVO> locationInfoList = map.get(locationSortDTO.getColNo());
+                for (BaseLocationLotattVO b : locationInfoList) {
+                    if (currentLocation == null) {
+                        if (b.getIsEmpty().equals("N") && b.getStockStatus().equals("00")) {
+                            BaseLocationInfo locationInfo = new BaseLocationInfo();
+                            BeanUtils.copyProperties(b, locationInfo);
+                            currentLocation = locationInfo;
+                        }
+                    } else {
+                        //如果前面的库位已阻挡则之前的库位不可用
+                        if (!b.getIsEmpty().equals("Y") || !b.getStockStatus().equals("00")) {
+                            currentLocation = null;
+                        } else {
                             continue;
                         }
                     }
                 }
-                /*if (locationPriorityHeaderVO.getParallelFlag().equals("Y")) {
-                    //如果达到并行数量,则当前区域不再进行分配
-                    if (parallelCount + 1 > locationPriorityHeaderVO.getParallelCount()) {
-                        return null;
-                    }
-                    if (taskingFlag.get(b.getColNo())) {
-                        continue;
-                    }
-                }*/
-
-                if (currentLocation == null) {
-                    if (b.getIsEmpty().equals("N") && b.getStockStatus().equals("00")) {
-                        BaseLocationInfo locationInfo = new BaseLocationInfo();
-                        BeanUtils.copyProperties(b, locationInfo);
-                        currentLocation = locationInfo;
+                if (currentLocation != null) {
+                    break;
+                }
+            }
+        } else {
+            for (Map.Entry<String, List<BaseLocationLotattVO>> entry : map.entrySet()) {
+                List<BaseLocationLotattVO> locationInfoList = entry.getValue();
+                for (BaseLocationLotattVO b : locationInfoList) {
+                    if (locationPriorityHeaderVO.getSameLotattFlag().equals("N")) {
+                        //如果外围优先则跳过当前出
+                        if (locationPriorityHeaderVO.getOuterFlag().equals("Y")) {
+                            if (taskingFlag.get(b.getColNo())) {
+                                continue;
+                            }
+                        }
                     }
-                } else {
-                    //如果前面的库位已阻挡则之前的库位不可用
-                    if (!b.getIsEmpty().equals("Y") || !b.getStockStatus().equals("00")) {
-                        currentLocation = null;
+                    if (currentLocation == null) {
+                        if (b.getIsEmpty().equals("N") && b.getStockStatus().equals("00")) {
+                            BaseLocationInfo locationInfo = new BaseLocationInfo();
+                            BeanUtils.copyProperties(b, locationInfo);
+                            currentLocation = locationInfo;
+                        }
                     } else {
-                        continue;
+                        //如果前面的库位已阻挡则之前的库位不可用
+                        if (!b.getIsEmpty().equals("Y") || !b.getStockStatus().equals("00")) {
+                            currentLocation = null;
+                        } else {
+                            continue;
+                        }
                     }
                 }
-            }
-            if (currentLocation != null) {
-                break;
+                if (currentLocation != null) {
+                    break;
+                }
             }
         }
         return currentLocation;

+ 12 - 2
warewms-ams/src/main/java/com/ruoyi/ams/config/service/impl/FlowConfigHeaderServiceImpl.java

@@ -1,12 +1,14 @@
 package com.ruoyi.ams.config.service.impl;
 
 import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
 
 import com.ruoyi.ams.config.domain.form.FlowConfigForm;
 import com.ruoyi.ams.config.domain.vo.FlowConfigHeaderVO;
 import com.ruoyi.ams.config.domain.vo.FlowConfigLotattVO;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.utils.DateUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -78,7 +80,7 @@ public class FlowConfigHeaderServiceImpl implements IFlowConfigHeaderService {
      */
     @Transactional
     @Override
-    public AjaxResult updateFlowConfigHeader(FlowConfigForm flowConfigForm) {
+    public AjaxResult updateFlowConfigHeader(FlowConfigForm flowConfigForm, LoginUser loginUser) {
         FlowConfigHeaderVO flowConfigHeaderVO = flowConfigHeaderMapper.selectFlowConfigHeaderById(flowConfigForm.getId());
         FlowConfigHeader flowConfigHeader = new FlowConfigHeader();
         BeanUtils.copyProperties(flowConfigForm, flowConfigHeader);
@@ -133,6 +135,8 @@ public class FlowConfigHeaderServiceImpl implements IFlowConfigHeaderService {
                 }
             }
         }
+        flowConfigHeader.setUpdateBy(loginUser.getUsername());
+        flowConfigHeader.setUpdateTime(new Date());
         flowConfigHeaderMapper.updateFlowConfigHeader(flowConfigHeader);
         flowConfigHeaderMapper.deleteFlowConfigDetailsByHeaderId(flowConfigHeader.getId());
         insertFlowConfigDetails(flowConfigHeader);
@@ -168,12 +172,13 @@ public class FlowConfigHeaderServiceImpl implements IFlowConfigHeaderService {
 
     /**
      * 新增流程配置
+     *
      * @param flowConfigForm
      * @return
      */
     @Transactional(rollbackFor = Exception.class)
     @Override
-    public AjaxResult addFlowConfig(FlowConfigForm flowConfigForm) {
+    public AjaxResult addFlowConfig(FlowConfigForm flowConfigForm, LoginUser loginUser) {
         FlowConfigHeader flowConfigHeader = new FlowConfigHeader();
         BeanUtils.copyProperties(flowConfigForm, flowConfigHeader);
         if (flowConfigForm.getSkuType() != null) {
@@ -219,6 +224,8 @@ public class FlowConfigHeaderServiceImpl implements IFlowConfigHeaderService {
                 return AjaxResult.error("目标区域不能重复");
             }
         }
+        flowConfigHeader.setCreateBy(loginUser.getUsername());
+        flowConfigHeader.setCreateTime(new Date());
         flowConfigHeaderMapper.insertFlowConfigHeader(flowConfigHeader);
         insertFlowConfigDetails(flowConfigHeader);
         return AjaxResult.success("保存成功");
@@ -236,6 +243,8 @@ public class FlowConfigHeaderServiceImpl implements IFlowConfigHeaderService {
             List<FlowConfigDetails> list = new ArrayList<FlowConfigDetails>();
             for (FlowConfigDetails flowConfigDetails : flowConfigDetailsList) {
                 flowConfigDetails.setHeaderId(id);
+                flowConfigDetails.setCreateBy(flowConfigHeader.getCreateBy());
+                flowConfigDetails.setCreateTime(new Date());
                 list.add(flowConfigDetails);
             }
             if (list.size() > 0) {
@@ -246,6 +255,7 @@ public class FlowConfigHeaderServiceImpl implements IFlowConfigHeaderService {
 
     /**
      * 加载流程配置定义的批次属性,关联批次属性配置表配置的控件选项以及名称
+     *
      * @param id
      * @return
      */

+ 7 - 0
warewms-ams/src/main/java/com/ruoyi/ams/inv/mapper/InvLotLocIdMapper.java

@@ -92,6 +92,13 @@ public interface InvLotLocIdMapper
      */
      List<InvLotLocIdLotattVO> selectInvLocIdLotattList(InvLocIdSearchFrom invLocIdSearchFrom);
 
+    /**
+     *
+     * @param locationId
+     * @return
+     */
+     List<InvLotLocIdLotattVO> selectInvLocIdLotattByLocationId(Long locationId);
+
     /**
      * 删除库位库存信息
      *

+ 7 - 0
warewms-ams/src/main/java/com/ruoyi/ams/inv/service/IInvLotLocIdService.java

@@ -86,4 +86,11 @@ public interface IInvLotLocIdService {
      * @param
      */
     void initInv(String locationFrom,String sku,String customerId, Double qty, LotattDTO lotattDTO);
+
+    /**
+     *
+     * @param locationId
+     * @return
+     */
+    List<InvLotLocIdLotattVO> selectInvLocIdLotattByLocationId(Long locationId);
 }

+ 5 - 0
warewms-ams/src/main/java/com/ruoyi/ams/inv/service/impl/InvLotLocIdServiceImpl.java

@@ -167,4 +167,9 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
         baseLocationInfoService.updateBaseLocationInfo(baseLocationInfo);
 
     }
+
+    @Override
+    public List<InvLotLocIdLotattVO> selectInvLocIdLotattByLocationId(Long locationId) {
+        return invLotLocIdMapper.selectInvLocIdLotattByLocationId(locationId);
+    }
 }

+ 22 - 0
warewms-ams/src/main/java/com/ruoyi/ams/task/service/TaskDispatchService.java

@@ -0,0 +1,22 @@
+package com.ruoyi.ams.task.service;
+
+import com.ruoyi.ams.task.domain.WcsTask;
+import org.springframework.stereotype.Component;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy.qu
+ * Date: 2022/3/21
+ */
+@Component
+public class TaskDispatchService {
+
+    /**
+     * 任务调度策略
+     * @param wcsTask
+     * @return
+     */
+    public boolean taskDispatchStack(WcsTask wcsTask) {
+        return false;
+    }
+}

+ 12 - 0
warewms-ams/src/main/resources/mapper/ams/InvLotLocIdMapper.xml

@@ -282,6 +282,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         order by lpad(b.row_no, 11, '0'),b.row_index,lpad(b.shift_no, 11, '0'),b.shift_index,lpad(b.col_no, 11, '0'),b.col_index desc
     </select>
 
+    <select id="selectInvLocIdLotattByLocationId" resultMap="InvLotLocIdLotattResult">
+        select
+            inv.location_id,sk.sku,sk.desc1 sku_name,b.location_no,inv.qty,inv.qtyallocated
+            ,att.lotnum, att.customer_id, lotatt01, lotatt02, lotatt03, lotatt04, lotatt05, lotatt06, lotatt07, lotatt08, lotatt09, lotatt10, lotatt11, lotatt12, lotatt13, lotatt14, lotatt15, lotatt16, lotatt17, lotatt18
+        from inv_lot_loc_id inv
+        left join inv_lot_att att on inv.lotnum = att.lotnum
+        left join base_location_info b on inv.location_id = b.id
+        left join base_sku sk on inv.sku = sk.sku
+        left join base_sku_type skt on sk.sku_type = skt.item_code
+        where inv.location_id = #{locationId}
+    </select>
+
     <delete id="deleteInvLotLocIdByLocationId" parameterType="Long">
         delete from inv_lot_loc_id where location_id = #{locationId}
     </delete>