Browse Source

自动下发任务修改

andy 2 years ago
parent
commit
2233b518e2
19 changed files with 333 additions and 51 deletions
  1. 28 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/WcsTaskController.java
  2. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/base/BaseLocationInfoController.java
  3. 1 1
      ruoyi-admin/src/main/resources/application.yml
  4. 26 0
      ruoyi-admin/src/test/java/com/ruoyi/admin/test/base/WarehouseTest.java
  5. 9 0
      ruoyi-ui/src/api/ams/wcsTask.js
  6. 104 31
      ruoyi-ui/src/views/ams/task/index.vue
  7. 1 1
      ruoyi-ui/src/views/wms/docAsn/docAsnDetails.vue
  8. 1 1
      warewms-ams/src/main/java/com/ruoyi/ams/agv/ndc/AciService.java
  9. 71 0
      warewms-ams/src/main/java/com/ruoyi/ams/agv/ndc/common/CRC16Util.java
  10. 29 1
      warewms-ams/src/main/java/com/ruoyi/ams/agv/ndc/domain/AmsTask.java
  11. 1 1
      warewms-ams/src/main/java/com/ruoyi/ams/agv/ndc/service/impl/AmsHexdefineDetailServiceImpl.java
  12. 2 0
      warewms-ams/src/main/java/com/ruoyi/ams/asn/service/impl/WmsDocAsnHeaderServiceImpl.java
  13. 27 2
      warewms-ams/src/main/java/com/ruoyi/ams/business/BusinessServiceImpl.java
  14. 19 0
      warewms-ams/src/main/java/com/ruoyi/ams/task/form/AddTaskForm.java
  15. 1 1
      warewms-ams/src/main/java/com/ruoyi/ams/task/service/impl/WcsTaskServiceImpl.java
  16. 1 1
      warewms-ams/src/main/resources/mapper/ams/AmsTaskMapper.xml
  17. 3 3
      warewms-ams/src/main/resources/mapper/ams/WcsTaskMapper.xml
  18. 3 2
      warewms-ams/src/main/resources/mapper/ams/WmsDocAsnDetailsMapper.xml
  19. 5 5
      warewms-base/src/main/resources/mapper/base/BaseLocationInfoMapper.xml

+ 28 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/WcsTaskController.java

@@ -1,11 +1,17 @@
 package com.ruoyi.web.controller.warewms.ams;
 
+import java.util.Date;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
 import com.ruoyi.ams.task.domain.form.TaskDispositionForm;
+import com.ruoyi.ams.task.form.AddTaskForm;
+import com.ruoyi.base.constant.Constant;
+import com.ruoyi.base.utils.IdSequenceUtils;
+import com.ruoyi.common.core.domain.model.LoginUser;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
@@ -128,4 +134,26 @@ public class WcsTaskController extends BaseController {
         wcsTaskService.invDisposition(wcsTask, taskDispositionForm.getResult());
         return AjaxResult.success("处置完成");
     }
+
+    @Log(title = "添加测试任务", businessType = BusinessType.INSERT)
+    @PostMapping(value = "/addTestTask")
+    public AjaxResult addTestTask(@Validated @RequestBody AddTaskForm addTaskForm) {
+        if (addTaskForm.getLocationFrom().equals(addTaskForm.getLocationTo())) {
+            return AjaxResult.error("起始库位与目标库位不能相同");
+        }
+        LoginUser loginUser = this.getLoginUser();
+        WcsTask wcsTask = new WcsTask();
+        wcsTask.setTaskNo(System.currentTimeMillis() + "");
+        wcsTask.setState(9L);
+        wcsTask.setBusinessType(addTaskForm.getBusinessType());
+        wcsTask.setAreaFrom(addTaskForm.getAreaFrom());
+        wcsTask.setLocationFrom(addTaskForm.getLocationFrom());
+        wcsTask.setAreaTo(addTaskForm.getAreaTo());
+        wcsTask.setLocationTo(addTaskForm.getLocationTo());
+        wcsTask.setCreateTime(new Date());
+        wcsTask.setCreateBy(loginUser.getUsername());
+        wcsTask.setShopId(Constant.WAREHOUSE_ID.toString());
+        wcsTask.setPriority(10L);
+        return toAjax(wcsTaskService.insertWcsTask(wcsTask));
+    }
 }

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/base/BaseLocationInfoController.java

@@ -105,7 +105,7 @@ public class BaseLocationInfoController extends BaseController {
     }
 
     /**
-     * 获取库位信息详细信息
+     * 获取库位字典
      */
     @GetMapping("/queryDict/{zoneId}")
     public AjaxResult queryDict(@PathVariable("zoneId") Long zoneId) {

+ 1 - 1
ruoyi-admin/src/main/resources/application.yml

@@ -121,5 +121,5 @@ xss:
 
 # 是否开启服务
 testtag:
-  autosend: true
+  autosend: false
   aciservice: false

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

@@ -2,6 +2,10 @@ package com.ruoyi.admin.test.base;
 
 import com.alibaba.fastjson.JSON;
 import com.ruoyi.RuoYiApplication;
+import com.ruoyi.ams.agv.ndc.domain.AmsHexdefineDetail;
+import com.ruoyi.ams.agv.ndc.domain.AmsTask;
+import com.ruoyi.ams.agv.ndc.service.IAmsHexdefineDetailService;
+import com.ruoyi.ams.agv.ndc.service.IAmsTaskService;
 import com.ruoyi.ams.asn.domain.WmsDocAsnDetails;
 import com.ruoyi.ams.asn.domain.WmsDocAsnHeader;
 import com.ruoyi.ams.asn.service.IWmsDocAsnHeaderService;
@@ -25,6 +29,7 @@ import com.ruoyi.ams.order.domain.WmsDocOrderHeader;
 import com.ruoyi.ams.order.mapper.WmsDocOrderDetailsMapper;
 import com.ruoyi.ams.order.service.IWmsDocOrderHeaderService;
 import com.ruoyi.ams.order.vo.StockOrderVO;
+import com.ruoyi.ams.task.service.IWcsTaskService;
 import com.ruoyi.base.constant.Constant;
 import com.ruoyi.base.domain.BaseLocationInfo;
 import com.ruoyi.base.domain.BaseWarehouse;
@@ -86,6 +91,12 @@ public class WarehouseTest {
     private IWmsDocAsnHeaderService wmsDocAsnHeaderService;
     @Autowired
     private IWmsDocOrderHeaderService wmsDocOrderHeaderService;
+    @Autowired
+    private IWcsTaskService wcsTaskService;
+    @Autowired
+    private IAmsHexdefineDetailService amsHexdefineDetailService;
+    @Autowired
+    private IAmsTaskService amsTaskService;
 
     @Test
     public void test() {
@@ -290,6 +301,21 @@ public class WarehouseTest {
 
     @Test
     public void testAmsTask() {
+        businessService.autoSend();
+    }
+
+    @Test
+    public void testAms() {
+        List<AmsHexdefineDetail> basTask = amsHexdefineDetailService.selectAmsHexdefineDetailByBusinessType("01");
+        try {
+            AmsTask amsTask = amsTaskService.selectAmsTaskById(3L);
+            amsTask.init();
+            String order = amsHexdefineDetailService.concatOrder(amsTask, basTask);
+            System.out.println("-------------------------->");
+            System.out.println(order);
+        }catch (Exception e) {
+            e.printStackTrace();
+        }
 
     }
 

+ 9 - 0
ruoyi-ui/src/api/ams/wcsTask.js

@@ -71,4 +71,13 @@ export function invDisposition(taskNo, result) {
   })
 }
 
+//添加测试任务
+export function addTestTask(data) {
+  return request({
+    url: '/ams/wcsTask/addTestTask',
+    method: 'post',
+    data: data
+  })
+}
+
 

+ 104 - 31
ruoyi-ui/src/views/ams/task/index.vue

@@ -95,7 +95,7 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-      <!--<el-col :span="1.5">
+      <el-col :span="1.5">
         <el-button
           type="primary"
           plain
@@ -105,7 +105,7 @@
           v-hasPermi="['ams:wcsTask:add']"
         >新增</el-button>
       </el-col>
-      <el-col :span="1.5">
+      <!--<el-col :span="1.5">
         <el-button
           type="success"
           plain
@@ -210,6 +210,68 @@
     <!-- 添加或修改AGV任务对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="任务类型" prop="businessType">
+          <el-select v-model="form.businessType" placeholder="请选择任务类型" clearable size="small" style="width: 100%">
+            <el-option
+              v-for="dict in businessTypeCombo"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="起始区域" prop="areaFrom">
+          <el-select v-model="form.areaFrom" @change="locationZoneFromChange" placeholder="请选择库区" clearable
+                     size="small" style="width: 100%">
+            <el-option
+              v-for="dict in this.locationZoneCombo"
+              :key="dict.zoneId"
+              :label="dict.zoneName"
+              :value="dict.zoneId"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="起始点位" prop="locationFrom">
+          <el-select v-model="form.locationFrom" placeholder="请选择库位" clearable size="small" style="width: 100%">
+            <el-option
+              v-for="dict in locationFromCombo"
+              :key="dict.id"
+              :label="dict.locationNo"
+              :value="dict.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="目标区域" prop="areaTo">
+          <el-select v-model="form.areaTo" @change="locationZoneToChange" placeholder="请选择库区" clearable
+                     size="small" style="width: 100%">
+            <el-option
+              v-for="dict in this.locationZoneCombo"
+              :key="dict.zoneId"
+              :label="dict.zoneName"
+              :value="dict.zoneId"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="终点点位" prop="locationTo">
+          <el-select v-model="form.locationTo" placeholder="请选择库位" clearable size="small" style="width: 100%">
+            <el-option
+              v-for="dict in locationToCombo"
+              :key="dict.id"
+              :label="dict.locationNo"
+              :value="dict.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <!--
+        <el-form-item label="优先级" prop="priority">
+          <el-input v-model="form.priority" placeholder="请输入优先级" />
+        </el-form-item>
+        <el-form-item label="起始区域" prop="areaFrom">
+          <el-input v-model="form.areaFrom" placeholder="请输入起始区域" />
+        </el-form-item>
+        <el-form-item label="终点区域" prop="areaTo">
+          <el-input v-model="form.areaTo" placeholder="请输入终点区域" />
+        </el-form-item>
         <el-form-item label="任务关联单号类型1" prop="whTypeFrom">
           <el-input v-model="form.whTypeFrom" placeholder="请输入任务关联单号类型1" />
         </el-form-item>
@@ -234,21 +296,6 @@
         <el-form-item label="批号2" prop="batchOrderNo">
           <el-input v-model="form.batchOrderNo" placeholder="请输入批号2" />
         </el-form-item>
-        <el-form-item label="起始点位" prop="locationFrom">
-          <el-input v-model="form.locationFrom" placeholder="请输入起始点位" />
-        </el-form-item>
-        <el-form-item label="起始区域" prop="areaFrom">
-          <el-input v-model="form.areaFrom" placeholder="请输入起始区域" />
-        </el-form-item>
-        <el-form-item label="终点点位" prop="locationTo">
-          <el-input v-model="form.locationTo" placeholder="请输入终点点位" />
-        </el-form-item>
-        <el-form-item label="终点区域" prop="areaTo">
-          <el-input v-model="form.areaTo" placeholder="请输入终点区域" />
-        </el-form-item>
-        <el-form-item label="优先级" prop="priority">
-          <el-input v-model="form.priority" placeholder="请输入优先级" />
-        </el-form-item>
         <el-form-item label="ִ状态9:(队列等待) 0:(下达AMS成功)" prop="state">
           <el-input v-model="form.state" placeholder="请输入ִ状态9:(队列等待) 0:(下达AMS成功)" />
         </el-form-item>
@@ -304,7 +351,7 @@
         </el-form-item>
         <el-form-item label="是否有前置任务,有必须等待前置任务完成" prop="beforeTask">
           <el-input v-model="form.beforeTask" placeholder="请输入是否有前置任务,有必须等待前置任务完成" />
-        </el-form-item>
+        </el-form-item>-->
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -315,7 +362,9 @@
 </template>
 
 <script>
-import { listWcsTask, getWcsTask, delWcsTask, addWcsTask, updateWcsTask, completeWcsTask, taskCancel, invDisposition } from "@/api/ams/wcsTask";
+import { listWcsTask, getWcsTask, delWcsTask, addWcsTask, updateWcsTask, addTestTask , completeWcsTask, taskCancel, invDisposition } from "@/api/ams/wcsTask";
+import { queryLocationDict } from "@/api/base/locationInfo";
+import { queryLocationZoneDict } from "@/api/base/locationZone"
 
 export default {
   name: "WcsTask",
@@ -362,13 +411,25 @@ export default {
       form: {},
       // 表单校验
       rules: {
-      }
+      },
+      businessTypeCombo: [
+        {'label':'普通任务','value':'01'}
+      ],
+      locationFromCombo: [],
+      locationToCombo: [],
+      locationZoneCombo: []
     };
   },
   created() {
+    this.initData();
     this.getList();
   },
   methods: {
+    initData() {
+      queryLocationZoneDict().then(response => {
+        this.locationZoneCombo = response.data
+      })
+    },
     /** 查询AGV任务列表 */
     getList() {
       this.loading = true;
@@ -462,19 +523,13 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          if (this.form.taskNo != null) {
-            updateWcsTask(this.form).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
+          addTestTask(this.form).then(
+            response => {
               this.getList();
-            });
-          } else {
-            addWcsTask(this.form).then(response => {
-              this.$modal.msgSuccess("新增成功");
+              this.$modal.msgSuccess("添加成功");
               this.open = false;
-              this.getList();
-            });
-          }
+            }
+          );
         }
       });
     },
@@ -528,6 +583,24 @@ export default {
         this.getList();
         this.$modal.msgSuccess("执行成功");
       }).catch(() => {});
+    },
+    locationZoneFromChange: function (value) {
+      let param = 0
+      if (value != '') {
+        param = value
+      }
+      queryLocationDict(param).then(response => {
+        this.locationFromCombo = response.data
+      })
+    },
+    locationZoneToChange: function (value) {
+      let param = 0
+      if (value != '') {
+        param = value
+      }
+      queryLocationDict(param).then(response => {
+        this.locationToCombo = response.data
+      })
     }
   }
 };

+ 1 - 1
ruoyi-ui/src/views/wms/docAsn/docAsnDetails.vue

@@ -150,7 +150,7 @@
           if(this.dataListSelections.length >0 ){
             this.$refs.addOrUpdate.init(this.dataListSelections[0].asnNo,this.dataListSelections[0].asnLineNo)
           } else {
-            this.$refs.addOrUpdate.init()
+            this.$refs.addOrUpdate.init(this.queryParams.asnNo)
           }
         })
       },

+ 1 - 1
warewms-ams/src/main/java/com/ruoyi/ams/agv/ndc/AciService.java

@@ -127,7 +127,7 @@ public class AciService {
                 if (taskBeans != null && taskBeans.size() > 0) {
 
                     for (AmsTask t : taskBeans) {
-
+                        t.init();
                         List<AmsHexdefineDetail> basTask = amsHexdefineDetailService.selectAmsHexdefineDetailByBusinessType(t.getBusinessType());
                         if (basTask == null || basTask.size() == 0) {
                             t.setIsDelete(1);

File diff suppressed because it is too large
+ 71 - 0
warewms-ams/src/main/java/com/ruoyi/ams/agv/ndc/common/CRC16Util.java


+ 29 - 1
warewms-ams/src/main/java/com/ruoyi/ams/agv/ndc/domain/AmsTask.java

@@ -23,7 +23,7 @@ public class AmsTask extends BaseEntity {
     public AmsTask() {
         attr.put("id", getId());
         attr.put("task_no", getTaskNo());
-        attr.put("ikey", getIkey());
+        attr.put("iKey", getIkey());
         attr.put("aci_index", getAciIndex());
         attr.put("st_from", getStFrom());
         attr.put("st_to", getStTo());
@@ -423,4 +423,32 @@ public class AmsTask extends BaseEntity {
         }
     }
 
+    public void init(){
+        attr.put("id", getId());
+        attr.put("task_no", getTaskNo());
+        attr.put("iKey", getIkey());
+        attr.put("aci_index", getAciIndex());
+        attr.put("st_from", getStFrom());
+        attr.put("st_to", getStTo());
+        attr.put("priority", getPriority());
+        attr.put("system_status", getSystemStatus());
+        attr.put("event", getEvent());
+        attr.put("server_ack", getServerAck());
+        attr.put("aci_accept", getAciAccept());
+        attr.put("is_delete", getIsDelete());
+        attr.put("callBackUrl", getCallbackurl());
+        attr.put("addtime", getAddtime());
+        attr.put("addwho", getAddwho());
+        attr.put("sys_name", getSysName());
+        attr.put("device_name", getDeviceName());
+        attr.put("business_type", getBusinessType());
+        attr.put("ext1", getExt1());
+        attr.put("ext2", getExt2());
+        attr.put("ext3", getExt3());
+        attr.put("height_level", getHeightLevel());
+        attr.put("remark", getRemark());
+        attr.put("roadway", getRoadway());
+        attr.put("tier", getTier());
+    }
+
 }

+ 1 - 1
warewms-ams/src/main/java/com/ruoyi/ams/agv/ndc/service/impl/AmsHexdefineDetailServiceImpl.java

@@ -122,7 +122,7 @@ public class AmsHexdefineDetailServiceImpl implements IAmsHexdefineDetailService
     public String concatOrder(AmsTask amsTask, List<AmsHexdefineDetail> amsHexdefineDetails) {
         StringBuffer sb = new StringBuffer();
         for (AmsHexdefineDetail basTask : amsHexdefineDetails) {
-
+            //System.out.println(basTask.getColName());
             //字符串直接取数据库保存值
             if (basTask.getColType() == ValType.TEXT.getCode()) {
                 //如果是数字需要进行转换

+ 2 - 0
warewms-ams/src/main/java/com/ruoyi/ams/asn/service/impl/WmsDocAsnHeaderServiceImpl.java

@@ -346,6 +346,7 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
         }
 
         if (codeSkuRelationshipVO.isProduct()) {
+            //TODO 数量没有起效果
             stockForm.setQty("1");
 
             InvLotAtt queryAtt = new InvLotAtt();
@@ -490,6 +491,7 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
         moveForm.setLocationTo(paForm.getLocationTo());
         moveForm.setIsCallCar("N");
 
+        //TODO 添加过滤条件sku
         WmsDocAsnDetails query = new WmsDocAsnDetails();
         query.setAsnNo(lotatt08);
         List<WmsDocAsnDetails> detailsList = wmsDocAsnDetailsMapper.selectWmsDocAsnDetailsList(query);

+ 27 - 2
warewms-ams/src/main/java/com/ruoyi/ams/business/BusinessServiceImpl.java

@@ -1,5 +1,7 @@
 package com.ruoyi.ams.business;
 
+import com.ruoyi.ams.agv.ndc.common.ByteUtil;
+import com.ruoyi.ams.agv.ndc.common.CRC16Util;
 import com.ruoyi.ams.agv.ndc.domain.AmsTask;
 import com.ruoyi.ams.agv.ndc.service.IAmsTaskService;
 import com.ruoyi.ams.box.domain.WmsBoxInfo;
@@ -70,6 +72,17 @@ public class BusinessServiceImpl implements IBusinessService {
     @Autowired
     private IAmsTaskService amsTaskService;
 
+    private int geniKey(String taskNo){
+        int res = CRC16Util.calcCrc16(ByteUtil.string2byteArray(taskNo));
+        if(res == 0){
+            BigDecimal t = new BigDecimal(taskNo);
+            t = t.add(BigDecimal.ONE);
+            return geniKey(t.toString());
+        }else {
+            return res;
+        }
+    }
+
     @Transactional
     @Override
     public AjaxResult agvCall(FlowConfigHeaderVO flowConfigHeaderVO, List<AgvCallDTO> agvCallDTOList) {
@@ -453,6 +466,7 @@ public class BusinessServiceImpl implements IBusinessService {
             wcsTask.setLocationTo(locationTo.getId().toString());
             wcsTask.setState(9L);
             wcsTask.setPriority(1L);
+            wcsTask.setShopId(Constant.WAREHOUSE_ID.toString());
             wcsTask.setCreateDate(new Date());
             wcsTask.setBusinessType("01");
             wcsTask.setTaskType("");
@@ -587,6 +601,9 @@ public class BusinessServiceImpl implements IBusinessService {
         } else {
             amsTask.setBusinessType(wcsTask.getBusinessType());
         }
+        amsTask.setIsDelete(null);
+        amsTask.setAciAccept(null);
+        amsTask.setIkey((long)geniKey(amsTask.getTaskNo()));
         amsTask.setPriority(wcsTask.getPriority().intValue());
         amsTask.setStFrom(locFrom.getId().intValue());
         amsTask.setStTo(locTo.getId().intValue());
@@ -620,6 +637,7 @@ public class BusinessServiceImpl implements IBusinessService {
         return null;
     }
 
+    @Transactional
     @Override
     public void autoSend() {
         List<WcsTask> wcsTaskList = wcsTaskService.selectWcsUnallocated(Constant.WAREHOUSE_ID);
@@ -635,11 +653,18 @@ public class BusinessServiceImpl implements IBusinessService {
                     break;
                 }
 
-
+                try {
+                    //任务下发判断
+                    businessService.taskDispatchStack(wcsTask);
+                    Thread.sleep(500);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
             }
         }
     }
 
+    @Transactional
     @Override
     public boolean taskDispatchStack(WcsTask wcsTask) {
         /* boolean isSplit = taskService.taskSplit(wcsTask);
@@ -770,7 +795,7 @@ public class BusinessServiceImpl implements IBusinessService {
         currentTask.setRemark("");
         if (wcsTaskService.updateWcsTask(currentTask) > 0) {
             AjaxResult result = businessService.sendTask(currentTask);
-            if ((int) result.get(AjaxResult.CODE_TAG) != 500) {
+            if ((int) result.get(AjaxResult.CODE_TAG) == 500) {
                 throw new ServiceException("自动下发任务失败:" + result.get("msg"));
             }
             return true;

+ 19 - 0
warewms-ams/src/main/java/com/ruoyi/ams/task/form/AddTaskForm.java

@@ -0,0 +1,19 @@
+package com.ruoyi.ams.task.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+@Data
+public class AddTaskForm {
+    @NotBlank(message = "起始区域不能为空")
+    private String areaFrom;
+    @NotBlank(message = "起始库位不能为空")
+    private String locationFrom;
+    @NotBlank(message = "目标区域不能为空")
+    private String areaTo;
+    @NotBlank(message = "目标库位不能为空")
+    private String locationTo;
+    @NotBlank(message = "任务类型不能为空")
+    private String businessType;
+}

+ 1 - 1
warewms-ams/src/main/java/com/ruoyi/ams/task/service/impl/WcsTaskServiceImpl.java

@@ -68,7 +68,7 @@ public class WcsTaskServiceImpl implements IWcsTaskService {
 
     @Override
     public List<WcsTask> selectWcsUnallocated(Long warehouseId) {
-        return null;
+        return wcsTaskMapper.selectWcsUnallocated(warehouseId);
     }
 
     /**

+ 1 - 1
warewms-ams/src/main/resources/mapper/ams/AmsTaskMapper.xml

@@ -34,7 +34,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <sql id="selectAmsTaskVo">
         select id, task_no, iKey, aci_index, st_from, st_to, priority, system_status, event, server_ack, aci_accept, is_delete, callBackUrl, addtime, addwho, sys_name, device_name, business_type, ext1, ext2, ext3, height_level, remark, roadway, tier from ams_task
-        order by addtime desc
     </sql>
 
     <select id="selectAmsTaskList" parameterType="AmsTask" resultMap="AmsTaskResult">
@@ -64,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="roadway != null  and roadway != ''"> and roadway = #{roadway}</if>
             <if test="tier != null  and tier != ''"> and tier = #{tier}</if>
         </where>
+        order by addtime desc
     </select>
     
     <select id="selectAmsTaskById" parameterType="Long" resultMap="AmsTaskResult">

+ 3 - 3
warewms-ams/src/main/resources/mapper/ams/WcsTaskMapper.xml

@@ -281,12 +281,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select IFNULL(min(priority),0) priority from wcs_task where state = 9
      </select>
 
-    <select id="selectWcsUnallocated" resultType="java.lang.Integer" parameterType="Long">
+    <select id="selectWcsUnallocated" resultMap="WcsTaskResult" parameterType="Long">
         select * from wcs_task where state = 9
     </select>
 
     <select id="selectTaskByColNo" resultMap="WcsTaskDTOResult">
-        select w.*,i.col_no,i.col_index from wcs_task w left join bas_location_info i on w.location_to = i.id
+        select w.*,i.col_no,i.col_index from wcs_task w left join base_location_info i on w.location_to = i.id
         where w.state = 9
         <if test="colNo != null  and colNo != ''">
             and i.col_no = #{colNo}
@@ -305,7 +305,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="selectTaskByColNoAfter" resultMap="WcsTaskDTOResult">
-        select w.*,i.col_no,i.col_index from wcs_task w left join bas_location_info i on w.location_to = i.id
+        select w.*,i.col_no,i.col_index from wcs_task w left join base_location_info i on w.location_to = i.id
         where w.state = 9
         <if test="colNo != null  and colNo != ''">
             and i.col_no = #{colNo}

+ 3 - 2
warewms-ams/src/main/resources/mapper/ams/WmsDocAsnDetailsMapper.xml

@@ -65,6 +65,8 @@
     <select id="selectWmsDocAsnDetailsList" parameterType="WmsDocAsnDetails" resultMap="WmsDocAsnDetailsResult">
         <include refid="selectWmsDocAsnDetailsVo"/>
         <where>
+            <if test="asnLineNo != null and asnLineNo != ''"> and asn_line_no = #{asnLineNo}</if>
+            <if test="asnNo != null and asnNo != ''"> and asn_no = #{asnNo} </if>
             <if test="sku != null  and sku != ''"> and sku = #{sku}</if>
             <if test="expectedQty != null "> and expected_qty = #{expectedQty}</if>
             <if test="expectedQtyEach != null "> and expected_qty_each = #{expectedQtyEach}</if>
@@ -235,7 +237,6 @@
     <update id="updateWmsDocAsnDetails" parameterType="WmsDocAsnDetails">
         update wms_doc_asn_details
         <trim prefix="SET" suffixOverrides=",">
-            <if test="asnNo != null">asn_no = #{asnNo},</if>
             <if test="sku != null and sku != ''">sku = #{sku},</if>
             <if test="expectedQty != null">expected_qty = #{expectedQty},</if>
             <if test="expectedQtyEach != null">expected_qty_each = #{expectedQtyEach},</if>
@@ -286,7 +287,7 @@
             <if test="dEdi14 != null">d_edi_14 = #{dEdi14},</if>
             <if test="dEdi15 != null">d_edi_15 = #{dEdi15},</if>
         </trim>
-        where asn_line_no = #{asnLineNo}
+        where asn_line_no = #{asnLineNo} and asn_no = #{asnNo}
     </update>
 
     <delete id="deleteWmsDocAsnDetailsByAsnLineNo" parameterType="Long">

+ 5 - 5
warewms-base/src/main/resources/mapper/base/BaseLocationInfoMapper.xml

@@ -502,17 +502,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectSameColCanToLoc" resultMap="BaseLocationInfoSameColDTOResult">
         select * from (
-            select *,false as isOb from bas_location_info where col_no = #{colNo} and is_empty='Y' and stock_status='00'
+            select *,false as isOb from base_location_info where col_no = #{colNo} and is_empty='Y' and stock_status='00'
             union all
-            select *,false as isOb from bas_location_info where col_no = #{colNo} and stock_status='10' and is_empty='N'
+            select *,false as isOb from base_location_info where col_no = #{colNo} and stock_status='10' and is_empty='N'
             and id in (select location_from from wcs_task where STATE in (1,4))
             union all
-            select *,true as isOb from bas_location_info where col_no = #{colNo} and is_empty='N' and stock_status='00'
+            select *,true as isOb from base_location_info where col_no = #{colNo} and is_empty='N' and stock_status='00'
             union all
-            select b.*,true as isOb from bas_location_info b left join wcs_task w on b.id = w.location_from and w.state not in(2,7,8)
+            select b.*,true as isOb from base_location_info b left join wcs_task w on b.id = w.location_from and w.state not in(2,7,8)
             where col_no = #{colNo} and stock_status='10' and is_empty='N' and w.task_no is null
         ) t
-        where t.col_index <![CDATA[ < ]]> #para(colIndex)
+        where t.col_index <![CDATA[ < ]]> #{colIndex}
         order by col_index desc
     </select>
 </mapper>