浏览代码

任务完成回调
bug修复

andy 3 年之前
父节点
当前提交
10833aa9a3
共有 21 个文件被更改,包括 390 次插入195 次删除
  1. 22 17
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/WcsTaskController.java
  2. 7 4
      ruoyi-admin/src/test/java/com/ruoyi/admin/test/base/WarehouseTest.java
  3. 7 0
      ruoyi-ui/src/api/ams/wcsTask.js
  4. 22 28
      ruoyi-ui/src/views/ams/inv/locationView/index.vue
  5. 15 1
      ruoyi-ui/src/views/ams/locationPriority/index.vue
  6. 12 4
      ruoyi-ui/src/views/ams/task/index.vue
  7. 26 7
      ruoyi-ui/src/views/base/locationZone/index.vue
  8. 2 5
      warewms-ams/src/main/java/com/ruoyi/ams/business/BusinessServiceImpl.java
  9. 5 0
      warewms-ams/src/main/java/com/ruoyi/ams/business/IBusinessService.java
  10. 97 76
      warewms-ams/src/main/java/com/ruoyi/ams/config/domain/AsnSoStrategy.java
  11. 14 5
      warewms-ams/src/main/java/com/ruoyi/ams/config/service/LocationAllocationStrategy.java
  12. 8 0
      warewms-ams/src/main/java/com/ruoyi/ams/inv/mapper/InvLotLocIdMapper.java
  13. 11 2
      warewms-ams/src/main/java/com/ruoyi/ams/inv/service/IInvLotLocIdService.java
  14. 5 0
      warewms-ams/src/main/java/com/ruoyi/ams/inv/service/impl/InvLotLocIdServiceImpl.java
  15. 28 15
      warewms-ams/src/main/java/com/ruoyi/ams/task/service/IWcsTaskService.java
  16. 61 24
      warewms-ams/src/main/java/com/ruoyi/ams/task/service/impl/WcsTaskServiceImpl.java
  17. 3 1
      warewms-ams/src/main/resources/mapper/ams/AsnSoStrategyMapper.xml
  18. 3 0
      warewms-ams/src/main/resources/mapper/ams/InvLotLocIdMapper.xml
  19. 1 0
      warewms-ams/src/main/resources/mapper/ams/WcsTaskMapper.xml
  20. 1 1
      warewms-base/src/main/java/com/ruoyi/base/mapper/BaseLocationInfoMapper.java
  21. 40 5
      warewms-base/src/main/resources/mapper/base/BaseLocationInfoMapper.xml

+ 22 - 17
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/WcsTaskController.java

@@ -2,6 +2,7 @@ package com.ruoyi.web.controller.warewms.ams;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -23,14 +24,13 @@ import com.ruoyi.common.core.page.TableDataInfo;
 
 /**
  * AGV任务Controller
- * 
+ *
  * @author andy
  * @date 2022-03-10
  */
 @RestController
 @RequestMapping("/ams/wcsTask")
-public class WcsTaskController extends BaseController
-{
+public class WcsTaskController extends BaseController {
     @Autowired
     private IWcsTaskService wcsTaskService;
 
@@ -39,8 +39,7 @@ public class WcsTaskController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('ams:wcsTask:list')")
     @GetMapping("/list")
-    public TableDataInfo list(WcsTask wcsTask)
-    {
+    public TableDataInfo list(WcsTask wcsTask) {
         startPage();
         List<WcsTask> list = wcsTaskService.selectWcsTaskList(wcsTask);
         return getDataTable(list);
@@ -52,8 +51,7 @@ public class WcsTaskController extends BaseController
     @PreAuthorize("@ss.hasPermi('ams:wcsTask:export')")
     @Log(title = "AGV任务", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, WcsTask wcsTask)
-    {
+    public void export(HttpServletResponse response, WcsTask wcsTask) {
         List<WcsTask> list = wcsTaskService.selectWcsTaskList(wcsTask);
         ExcelUtil<WcsTask> util = new ExcelUtil<WcsTask>(WcsTask.class);
         util.exportExcel(response, list, "AGV任务数据");
@@ -64,8 +62,7 @@ public class WcsTaskController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('ams:wcsTask:query')")
     @GetMapping(value = "/{taskNo}")
-    public AjaxResult getInfo(@PathVariable("taskNo") String taskNo)
-    {
+    public AjaxResult getInfo(@PathVariable("taskNo") String taskNo) {
         return AjaxResult.success(wcsTaskService.selectWcsTaskByTaskNo(taskNo));
     }
 
@@ -74,9 +71,8 @@ public class WcsTaskController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('ams:wcsTask:add')")
     @Log(title = "AGV任务", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody WcsTask wcsTask)
-    {
+    @PostMapping("add")
+    public AjaxResult add(@RequestBody WcsTask wcsTask) {
         return toAjax(wcsTaskService.insertWcsTask(wcsTask));
     }
 
@@ -86,8 +82,7 @@ public class WcsTaskController extends BaseController
     @PreAuthorize("@ss.hasPermi('ams:wcsTask:edit')")
     @Log(title = "AGV任务", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody WcsTask wcsTask)
-    {
+    public AjaxResult edit(@RequestBody WcsTask wcsTask) {
         return toAjax(wcsTaskService.updateWcsTask(wcsTask));
     }
 
@@ -96,9 +91,19 @@ public class WcsTaskController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('ams:wcsTask:remove')")
     @Log(title = "AGV任务", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{taskNos}")
-    public AjaxResult remove(@PathVariable String[] taskNos)
-    {
+    @DeleteMapping("/{taskNos}")
+    public AjaxResult remove(@PathVariable String[] taskNos) {
         return toAjax(wcsTaskService.deleteWcsTaskByTaskNos(taskNos));
     }
+
+    @Log(title = "任务完成", businessType = BusinessType.INSERT)
+    @PutMapping(value = "/taskComplete/{taskNo}")
+    public AjaxResult taskComplete(@PathVariable("taskNo") String taskNo) {
+        WcsTask wcsTask = wcsTaskService.selectWcsTaskByTaskNo(taskNo);
+        if (wcsTask == null) {
+            AjaxResult.error("任务回调失败");
+        }
+        wcsTaskService.callBackTaskComplete(wcsTask);
+        return AjaxResult.success("任务回调完成");
+    }
 }

+ 7 - 4
ruoyi-admin/src/test/java/com/ruoyi/admin/test/base/WarehouseTest.java

@@ -84,9 +84,9 @@ public class WarehouseTest {
     @Test
     public void testAllocation() {
         LotattDTO lotattDTO = new LotattDTO();
-        lotattDTO.setLotatt01("A");
+        lotattDTO.setLotatt01("1000");
         OutWarehouseDTO outWarehouseDTO = new OutWarehouseDTO();
-        outWarehouseDTO.setSku("A");
+        outWarehouseDTO.setSku("test1");
         outWarehouseDTO.setWarehouseId(1L);
         outWarehouseDTO.setLotattDTO(lotattDTO);
         BaseLocationInfo locationInfo = businessService.outInvAllocation(outWarehouseDTO);
@@ -109,8 +109,11 @@ public class WarehouseTest {
         baseLocationInfo.setZoneId(2L);
         baseLocationInfo.setWarehouseId(1L);
         List<BaseLocationLotattVO> lotattVOS = baseLocationInfoMapper.selectSortedLocationLotattListByZoneId(baseLocationInfo);*/
-        LotattVO vo = baseLocationInfoMapper.selectInvLotattById(101L);
-        System.out.println(JSON.toJSONString(vo));
+        LotattDTO lotattDTO = new LotattDTO();
+        List<Long> zoneList = new ArrayList<>();
+        zoneList.add(2L);
+        List<BaseLocationLotattVO> baseLocationLotattVOS = baseLocationInfoMapper.selectSortedLocationLotattListByZoneIdList(zoneList,1L,lotattDTO.getAttr());
+        System.out.println(JSON.toJSONString(baseLocationLotattVOS));
     }
 
     @Test

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

@@ -42,3 +42,10 @@ export function delWcsTask(taskNo) {
     method: 'delete'
   })
 }
+
+export function completeWcsTask(taskNo) {
+  return request({
+    url: '/ams/wcsTask/taskComplete/' + taskNo,
+    method: 'put'
+  })
+}

+ 22 - 28
ruoyi-ui/src/views/ams/inv/locationView/index.vue

@@ -168,18 +168,6 @@
           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;
           })
@@ -193,14 +181,17 @@
         this.handleQuery();
       },
       lockLoc() {
-        lockLocRequest(this.currentSelect).then(response => {
-          if (response.code === 200) {
-            this.$modal.msgSuccess(response.msg);
-            this.search();
-            this.open = false
-          } else {
-            this.$modal.msgError(response.msg);
-          }
+        let that = this
+        this.$modal.confirm('是否确认要锁定').then(function() {
+          lockLocRequest(that.currentSelect).then(response => {
+            if (response.code === 200) {
+              that.$modal.msgSuccess(response.msg);
+              that.search();
+              that.open = false
+            } else {
+              that.$modal.msgError(response.msg);
+            }
+          });
         });
       },
       occupyLoc() {
@@ -215,14 +206,17 @@
         });
       },
       clearLoc() {
-        clearLocRequest(this.currentSelect).then(response => {
-          if (response.code === 200) {
-            this.$modal.msgSuccess(response.msg);
-            this.search();
-            this.open = false
-          } else {
-            this.$modal.msgError(response.msg);
-          }
+        let that = this
+        this.$modal.confirm('是否确认要清空').then(function() {
+          clearLocRequest(that.currentSelect).then(response => {
+            if (response.code === 200) {
+              that.$modal.msgSuccess(response.msg);
+              that.search();
+              that.open = false
+            } else {
+              that.$modal.msgError(response.msg);
+            }
+          });
         });
       }
     }

+ 15 - 1
ruoyi-ui/src/views/ams/locationPriority/index.vue

@@ -62,6 +62,14 @@
             <el-form :model="form" ref="asnForm" :inline="true" label-width="130px">
               <el-form-item label="近效期优先:" prop="periodFlag">
                 <el-radio v-for="dict in selectDict1" v-model="form.soPeriodFlag" :label="dict.value">{{dict.label}}</el-radio>
+                <el-select v-model="form.soPeriodLotatt" placeholder="请选择" clearable size="small">
+                  <el-option
+                    v-for="dict in lotattDict"
+                    :key="dict.lotattId"
+                    :label="dict.lotattName"
+                    :value="dict.lotattId"
+                  />
+                </el-select>
               </el-form-item>
               <el-form-item label="同属性优先:" prop="sameLotattFlag">
                 <el-radio v-for="dict in selectDict2" v-model="form.soSameLotatt1Flag" :label="dict.value">{{dict.label}}</el-radio>
@@ -126,7 +134,8 @@
           soSameLotatt1Flag: 'ignore',
           soSameLotatt1Value: '',
           soOuterFlag: 'optimization',
-          soLocationAverage: 'optimization'
+          soLocationAverage: 'optimization',
+          soPeriodLotatt: ''
         },
         selectDict1: [
           {label : '强制', value : 'force'},
@@ -164,6 +173,7 @@
           this.form.soSameLotatt1Value = response.data.soSameLotatt1Value
           this.form.soLocationAverage = response.data.soLocationAverage
           this.form.soOuterFlag = response.data.soOuterFlag
+          this.form.soPeriodLotatt = response.data.soPeriodLotatt
         })
       },
       formSub() {
@@ -179,6 +189,10 @@
           this.$modal.msgError('请选择需要优化的批次属性');
           return;
         }
+        if (this.form.soPeriodFlag === 'optimization' && this.form.soPeriodLotatt === '') {
+          this.$modal.msgError('请选择效期的批次属性');
+          return;
+        }
         asnSoStrategySubmit(this.form).then(response => {
           if (response.code === 200) {
             this.$modal.msgSuccess("执行成功");

+ 12 - 4
ruoyi-ui/src/views/ams/task/index.vue

@@ -180,12 +180,11 @@
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
+            v-if="scope.row.state !== 7 && scope.row.state !== 2"
             size="mini"
             type="text"
             icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['ams:wcsTask:edit']"
-          >修改</el-button>
+            @click="handleComplete(scope.row)">完成</el-button>
           <el-button
             size="mini"
             type="text"
@@ -313,7 +312,7 @@
 </template>
 
 <script>
-import { listWcsTask, getWcsTask, delWcsTask, addWcsTask, updateWcsTask } from "@/api/ams/wcsTask";
+import { listWcsTask, getWcsTask, delWcsTask, addWcsTask, updateWcsTask, completeWcsTask } from "@/api/ams/wcsTask";
 
 export default {
   name: "WcsTask",
@@ -491,6 +490,15 @@ export default {
       this.download('ams/wcsTask/export', {
         ...this.queryParams
       }, `wcsTask_${new Date().getTime()}.xlsx`)
+    },
+    handleComplete (row) {
+      const taskNos = row.taskNo
+      this.$modal.confirm('是否确认要完成"' + taskNos + '"的数据项?').then(function() {
+        return completeWcsTask(taskNos);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("执行成功");
+      }).catch(() => {});
     }
   }
 };

+ 26 - 7
ruoyi-ui/src/views/base/locationZone/index.vue

@@ -82,8 +82,13 @@
           <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
         </template>
       </el-table-column>
-      <!--<el-table-column label="自定义字段1" align="center" prop="userdefine1" />
-      <el-table-column label="自定义字段2" align="center" prop="userdefine2" />
+      <el-table-column label="库区类型" align="center" prop="userdefine1" >
+        <template slot-scope="scope">
+          <div v-if="scope.row.userdefine1 === 'INV'">存储区</div>
+          <div v-if="scope.row.userdefine1 === 'OTHER'">非存储区</div>
+        </template>
+      </el-table-column>
+      <!--<el-table-column label="自定义字段2" align="center" prop="userdefine2" />
       <el-table-column label="自定义字段3" align="center" prop="userdefine3" />
       <el-table-column label="自定义字段4" align="center" prop="userdefine4" />
       <el-table-column label="自定义字段5" align="center" prop="userdefine5" />-->
@@ -132,6 +137,16 @@
         <el-form-item label="库区名称" prop="zoneName">
           <el-input v-model="form.zoneName" placeholder="请输入库区名称" />
         </el-form-item>
+        <el-form-item label="库区类型" prop="userdefine1">
+          <el-select v-model="form.userdefine1" placeholder="请选择库区类型" clearable size="small" style="width: 100%">
+            <el-option
+              v-for="dict in this.zoneTypeCombo"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            />
+          </el-select>
+        </el-form-item>
         <el-form-item label="状态">
           <el-radio-group v-model="form.status">
             <el-radio
@@ -141,10 +156,7 @@
             >{{dict.label}}</el-radio>
           </el-radio-group>
         </el-form-item>
-        <!--<el-form-item label="自定义字段1" prop="userdefine1">
-          <el-input v-model="form.userdefine1" placeholder="请输入自定义字段1" />
-        </el-form-item>
-        <el-form-item label="自定义字段2" prop="userdefine2">
+        <!--<el-form-item label="自定义字段2" prop="userdefine2">
           <el-input v-model="form.userdefine2" placeholder="请输入自定义字段2" />
         </el-form-item>
         <el-form-item label="自定义字段3" prop="userdefine3">
@@ -213,8 +225,15 @@ export default {
         warehouseId: [
           { required: true, message: "所属仓库不能为空", trigger: "change" }
         ],
+        userdefine1: [
+          { required: true, message: "库区类型不能为空", trigger: "change" }
+        ]
       },
-      warehouseCombo: []
+      warehouseCombo: [],
+      zoneTypeCombo:[
+        {label: '存储区', value: 'INV'},
+        {label: '非存储区', value: 'OTHER'},
+      ]
     };
   },
   created() {

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

@@ -218,11 +218,8 @@ public class BusinessServiceImpl implements IBusinessService {
                     zoneIdList.add(vo.getZoneId());
                 }
             }
-            //TODO 查询条件
-            BaseLocationInfo query = new BaseLocationInfo();
-            //query.setWarehouseId();
-            //query.setZoneId();
-            List<BaseLocationLotattVO> locationInfoList = baseLocationInfoMapper.selectSortedLocationLotattListByZoneId(query);
+            LotattDTO lotattDTO = outWarehouseDTO.getLotattDTO();
+            List<BaseLocationLotattVO> locationInfoList = baseLocationInfoMapper.selectSortedLocationLotattListByZoneIdList(zoneIdList, outWarehouseDTO.getWarehouseId(), lotattDTO.getAttr());
             AsnSoStrategy asnSoStrategy = asnSoStrategyMapper.selectAsnSoStrategy();
             return locationAllocationStrategy.filterLockInv(locationInfoList, outWarehouseDTO, asnSoStrategy);
         }

+ 5 - 0
warewms-ams/src/main/java/com/ruoyi/ams/business/IBusinessService.java

@@ -43,5 +43,10 @@ public interface IBusinessService {
      */
     AjaxResult addTask(WcsTask wcsTask);
 
+    /**
+     * 下发任务
+     * @param wcsTask
+     * @return
+     */
     AjaxResult sendTask(WcsTask wcsTask);
 }

+ 97 - 76
warewms-ams/src/main/java/com/ruoyi/ams/config/domain/AsnSoStrategy.java

@@ -7,186 +7,207 @@ import com.ruoyi.common.core.domain.BaseEntity;
 
 /**
  * 出入库策略对象 asn_so_strategy
- * 
+ *
  * @author andy
  * @date 2022-03-22
  */
-public class AsnSoStrategy extends BaseEntity
-{
+public class AsnSoStrategy extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 同物料编码靠近 */
+    /**
+     * 同物料编码靠近
+     */
     @Excel(name = "同物料编码靠近")
     private String asnSameSku;
 
-    /** 同物料种类靠近 */
+    /**
+     * 同物料种类靠近
+     */
     @Excel(name = "同物料种类靠近")
     private String asnSameSkuType;
 
-    /** 同批次属性靠近1 */
+    /**
+     * 同批次属性靠近1
+     */
     @Excel(name = "同批次属性靠近1")
     private String asnSameLotatt1Flag;
 
-    /** 同批次属性靠近1值 */
+    /**
+     * 同批次属性靠近1值
+     */
     @Excel(name = "同批次属性靠近1值")
     private String asnSameLotatt1Value;
 
-    /** 同批次属性靠近2 */
+    /**
+     * 同批次属性靠近2
+     */
     @Excel(name = "同批次属性靠近2")
     private String asnSameLotatt2Flag;
 
-    /** 同批次属性靠近2值 */
+    /**
+     * 同批次属性靠近2值
+     */
     @Excel(name = "同批次属性靠近2值")
     private String asnSameLotatt2Value;
 
-    /** 入库库位(平均分散)平铺 */
+    /**
+     * 入库库位(平均分散)平铺
+     */
     @Excel(name = "入库库位(平均分散)平铺")
     private String asnLocationAverage;
 
-    /** 近效期优先 */
+    /**
+     * 近效期优先
+     */
     @Excel(name = "近效期优先")
     private String soPeriodFlag;
 
-    /** 同属性优先 */
+    /**
+     * 同属性优先
+     */
     @Excel(name = "同属性优先")
     private String soSameLotatt1Flag;
 
-    /** 同属性优先值 */
+    /**
+     * 同属性优先值
+     */
     @Excel(name = "同属性优先值")
     private String soSameLotatt1Value;
 
-    /** 外围优先 */
+    /**
+     * 外围优先
+     */
     @Excel(name = "外围优先")
     private String soOuterFlag;
 
-    /** 取货(平均分散)平铺 */
+    /**
+     * 取货(平均分散)平铺
+     */
     @Excel(name = "取货(平均分散)平铺")
     private String soLocationAverage;
 
-    public void setAsnSameSku(String asnSameSku) 
-    {
+    private String soPeriodLotatt;
+
+    public void setAsnSameSku(String asnSameSku) {
         this.asnSameSku = asnSameSku;
     }
 
-    public String getAsnSameSku() 
-    {
+    public String getAsnSameSku() {
         return asnSameSku;
     }
-    public void setAsnSameSkuType(String asnSameSkuType) 
-    {
+
+    public void setAsnSameSkuType(String asnSameSkuType) {
         this.asnSameSkuType = asnSameSkuType;
     }
 
-    public String getAsnSameSkuType() 
-    {
+    public String getAsnSameSkuType() {
         return asnSameSkuType;
     }
-    public void setAsnSameLotatt1Flag(String asnSameLotatt1Flag) 
-    {
+
+    public void setAsnSameLotatt1Flag(String asnSameLotatt1Flag) {
         this.asnSameLotatt1Flag = asnSameLotatt1Flag;
     }
 
-    public String getAsnSameLotatt1Flag() 
-    {
+    public String getAsnSameLotatt1Flag() {
         return asnSameLotatt1Flag;
     }
-    public void setAsnSameLotatt1Value(String asnSameLotatt1Value) 
-    {
+
+    public void setAsnSameLotatt1Value(String asnSameLotatt1Value) {
         this.asnSameLotatt1Value = asnSameLotatt1Value;
     }
 
-    public String getAsnSameLotatt1Value() 
-    {
+    public String getAsnSameLotatt1Value() {
         return asnSameLotatt1Value;
     }
-    public void setAsnSameLotatt2Flag(String asnSameLotatt2Flag) 
-    {
+
+    public void setAsnSameLotatt2Flag(String asnSameLotatt2Flag) {
         this.asnSameLotatt2Flag = asnSameLotatt2Flag;
     }
 
-    public String getAsnSameLotatt2Flag() 
-    {
+    public String getAsnSameLotatt2Flag() {
         return asnSameLotatt2Flag;
     }
-    public void setAsnSameLotatt2Value(String asnSameLotatt2Value) 
-    {
+
+    public void setAsnSameLotatt2Value(String asnSameLotatt2Value) {
         this.asnSameLotatt2Value = asnSameLotatt2Value;
     }
 
-    public String getAsnSameLotatt2Value() 
-    {
+    public String getAsnSameLotatt2Value() {
         return asnSameLotatt2Value;
     }
-    public void setAsnLocationAverage(String asnLocationAverage) 
-    {
+
+    public void setAsnLocationAverage(String asnLocationAverage) {
         this.asnLocationAverage = asnLocationAverage;
     }
 
-    public String getAsnLocationAverage() 
-    {
+    public String getAsnLocationAverage() {
         return asnLocationAverage;
     }
-    public void setSoPeriodFlag(String soPeriodFlag) 
-    {
+
+    public void setSoPeriodFlag(String soPeriodFlag) {
         this.soPeriodFlag = soPeriodFlag;
     }
 
-    public String getSoPeriodFlag() 
-    {
+    public String getSoPeriodFlag() {
         return soPeriodFlag;
     }
-    public void setSoSameLotatt1Flag(String soSameLotatt1Flag) 
-    {
+
+    public void setSoSameLotatt1Flag(String soSameLotatt1Flag) {
         this.soSameLotatt1Flag = soSameLotatt1Flag;
     }
 
-    public String getSoSameLotatt1Flag() 
-    {
+    public String getSoSameLotatt1Flag() {
         return soSameLotatt1Flag;
     }
-    public void setSoSameLotatt1Value(String soSameLotatt1Value) 
-    {
+
+    public void setSoSameLotatt1Value(String soSameLotatt1Value) {
         this.soSameLotatt1Value = soSameLotatt1Value;
     }
 
-    public String getSoSameLotatt1Value() 
-    {
+    public String getSoSameLotatt1Value() {
         return soSameLotatt1Value;
     }
-    public void setSoOuterFlag(String soOuterFlag) 
-    {
+
+    public void setSoOuterFlag(String soOuterFlag) {
         this.soOuterFlag = soOuterFlag;
     }
 
-    public String getSoOuterFlag() 
-    {
+    public String getSoOuterFlag() {
         return soOuterFlag;
     }
-    public void setSoLocationAverage(String soLocationAverage) 
-    {
+
+    public void setSoLocationAverage(String soLocationAverage) {
         this.soLocationAverage = soLocationAverage;
     }
 
-    public String getSoLocationAverage() 
-    {
+    public String getSoLocationAverage() {
         return soLocationAverage;
     }
 
+    public String getSoPeriodLotatt() {
+        return soPeriodLotatt;
+    }
+
+    public void setSoPeriodLotatt(String soPeriodLotatt) {
+        this.soPeriodLotatt = soPeriodLotatt;
+    }
+
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("asnSameSku", getAsnSameSku())
-            .append("asnSameSkuType", getAsnSameSkuType())
-            .append("asnSameLotatt1Flag", getAsnSameLotatt1Flag())
-            .append("asnSameLotatt1Value", getAsnSameLotatt1Value())
-            .append("asnSameLotatt2Flag", getAsnSameLotatt2Flag())
-            .append("asnSameLotatt2Value", getAsnSameLotatt2Value())
-            .append("asnLocationAverage", getAsnLocationAverage())
-            .append("soPeriodFlag", getSoPeriodFlag())
-            .append("soSameLotatt1Flag", getSoSameLotatt1Flag())
-            .append("soSameLotatt1Value", getSoSameLotatt1Value())
-            .append("soOuterFlag", getSoOuterFlag())
-            .append("soLocationAverage", getSoLocationAverage())
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("asnSameSku", getAsnSameSku())
+                .append("asnSameSkuType", getAsnSameSkuType())
+                .append("asnSameLotatt1Flag", getAsnSameLotatt1Flag())
+                .append("asnSameLotatt1Value", getAsnSameLotatt1Value())
+                .append("asnSameLotatt2Flag", getAsnSameLotatt2Flag())
+                .append("asnSameLotatt2Value", getAsnSameLotatt2Value())
+                .append("asnLocationAverage", getAsnLocationAverage())
+                .append("soPeriodFlag", getSoPeriodFlag())
+                .append("soSameLotatt1Flag", getSoSameLotatt1Flag())
+                .append("soSameLotatt1Value", getSoSameLotatt1Value())
+                .append("soOuterFlag", getSoOuterFlag())
+                .append("soLocationAverage", getSoLocationAverage())
+                .append("soPeriodLotatt", getSoPeriodLotatt())
             .toString();
     }
 }

+ 14 - 5
warewms-ams/src/main/java/com/ruoyi/ams/config/service/LocationAllocationStrategy.java

@@ -184,7 +184,12 @@ public class LocationAllocationStrategy {
             }
             infoList.add(info);
             map.put(info.getColNo(), infoList);
-            LocationSortDTO sortDTO = new LocationSortDTO(info.getColNo(), info.getLotattVO().getLotatt04());
+            String period = "";
+            if (asnSoStrategy.getSoPeriodFlag().equals("Y")) {
+                info.initLotatt();
+                period = info.getAttMap().get(asnSoStrategy.getSoPeriodLotatt());
+            }
+            LocationSortDTO sortDTO = new LocationSortDTO(info.getColNo(), period);
             list.add(sortDTO);
 
             if (asnSoStrategy.getSoSameLotatt1Flag().equals("Y")) {
@@ -255,8 +260,10 @@ public class LocationAllocationStrategy {
                 }
                 if (currentLocation != null) {
                     String lotatt = asnSoStrategy.getSoSameLotatt1Value();
-                    String lotattValue = currentLocationLotatt.getAttMap().get(lotatt);
-                    redisTemplate.opsForValue().set(lotatt, lotattValue);
+                    if (!StringUtils.isEmpty(lotatt)) {
+                        String lotattValue = currentLocationLotatt.getAttMap().get(lotatt);
+                        redisTemplate.opsForValue().set(lotatt, lotattValue);
+                    }
                     break;
                 }
             }
@@ -283,8 +290,10 @@ public class LocationAllocationStrategy {
                 if (currentLocation != null) {
                     //记录出库数据的批次属性
                     String lotatt = asnSoStrategy.getSoSameLotatt1Value();
-                    String lotattValue = currentLocationLotatt.getAttMap().get(lotatt);
-                    redisTemplate.opsForValue().set(lotatt, lotattValue);
+                    if (!StringUtils.isEmpty(lotatt)) {
+                        String lotattValue = currentLocationLotatt.getAttMap().get(lotatt);
+                        redisTemplate.opsForValue().set(lotatt, lotattValue);
+                    }
                     break;
                 }
             }

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

@@ -106,4 +106,12 @@ public interface InvLotLocIdMapper
      * @return 结果
      */
     int deleteInvLotLocIdByLocationId(Long locationId);
+
+    /**
+     * 更新起始库位库存至目标库位
+     * @param locationFrom
+     * @param locationTo
+     * @return
+     */
+    int updateInvLotLocIdLocationId(@Param("locationFrom") Long locationFrom,@Param("locationTo") Long locationTo);
 }

+ 11 - 2
warewms-ams/src/main/java/com/ruoyi/ams/inv/service/IInvLotLocIdService.java

@@ -35,6 +35,7 @@ public interface IInvLotLocIdService {
 
     /**
      * 查询物料批次信息列表
+     *
      * @param invLocIdSearchFrom
      * @return
      */
@@ -85,12 +86,20 @@ public interface IInvLotLocIdService {
      *
      * @param
      */
-    void initInv(String locationFrom,String sku,String customerId, Double qty, LotattDTO lotattDTO);
+    void initInv(String locationFrom, String sku, String customerId, Double qty, LotattDTO lotattDTO);
 
     /**
-     *
+     * 根据库位id查询库位库存包含批次属性
      * @param locationId
      * @return
      */
     List<InvLotLocIdLotattVO> selectInvLocIdLotattByLocationId(Long locationId);
+
+    /**
+     * 库存转移
+     * @param locationFrom 起始点位
+     * @param locationTo 目标点位
+     * @return
+     */
+    int stockTransfer(Long locationFrom,Long locationTo);
 }

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

@@ -172,4 +172,9 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
     public List<InvLotLocIdLotattVO> selectInvLocIdLotattByLocationId(Long locationId) {
         return invLotLocIdMapper.selectInvLocIdLotattByLocationId(locationId);
     }
+
+    @Override
+    public int stockTransfer(Long locationFrom, Long locationTo) {
+        return invLotLocIdMapper.updateInvLotLocIdLocationId(locationFrom, locationTo);
+    }
 }

+ 28 - 15
warewms-ams/src/main/java/com/ruoyi/ams/task/service/IWcsTaskService.java

@@ -1,31 +1,31 @@
 package com.ruoyi.ams.task.service;
 
 import java.util.List;
+
 import com.ruoyi.ams.task.domain.WcsTask;
 
 /**
  * AGV任务Service接口
- * 
+ *
  * @author andy
  * @date 2022-03-10
  */
-public interface IWcsTaskService 
-{
+public interface IWcsTaskService {
     /**
      * 查询AGV任务
-     * 
+     *
      * @param taskNo AGV任务主键
      * @return AGV任务
      */
-     WcsTask selectWcsTaskByTaskNo(String taskNo);
+    WcsTask selectWcsTaskByTaskNo(String taskNo);
 
     /**
      * 查询AGV任务列表
-     * 
+     *
      * @param wcsTask AGV任务
      * @return AGV任务集合
      */
-     List<WcsTask> selectWcsTaskList(WcsTask wcsTask);
+    List<WcsTask> selectWcsTaskList(WcsTask wcsTask);
 
     /**
      * 查询AGV任务
@@ -37,33 +37,46 @@ public interface IWcsTaskService
 
     /**
      * 新增AGV任务
-     * 
+     *
      * @param wcsTask AGV任务
      * @return 结果
      */
-     int insertWcsTask(WcsTask wcsTask);
+    int insertWcsTask(WcsTask wcsTask);
 
     /**
      * 修改AGV任务
-     * 
+     *
      * @param wcsTask AGV任务
      * @return 结果
      */
-     int updateWcsTask(WcsTask wcsTask);
+    int updateWcsTask(WcsTask wcsTask);
 
     /**
      * 批量删除AGV任务
-     * 
+     *
      * @param taskNos 需要删除的AGV任务主键集合
      * @return 结果
      */
-     int deleteWcsTaskByTaskNos(String[] taskNos);
+    int deleteWcsTaskByTaskNos(String[] taskNos);
 
     /**
      * 删除AGV任务信息
-     * 
+     *
      * @param taskNo AGV任务主键
      * @return 结果
      */
-     int deleteWcsTaskByTaskNo(String taskNo);
+    int deleteWcsTaskByTaskNo(String taskNo);
+
+    /**
+     * 取货完成回调
+     *
+     * @param wcsTask
+     */
+    void callBackPickup(WcsTask wcsTask);
+
+    /**
+     * 任务完成回调
+     * @param wcsTask
+     */
+    void callBackTaskComplete(WcsTask wcsTask);
 }

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

@@ -1,45 +1,53 @@
 package com.ruoyi.ams.task.service.impl;
 
 import java.util.List;
+
+import com.ruoyi.ams.inv.mapper.InvLotLocIdMapper;
+import com.ruoyi.base.domain.BaseLocationInfo;
+import com.ruoyi.base.service.IBaseLocationInfoService;
+import com.ruoyi.common.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.ams.task.mapper.WcsTaskMapper;
 import com.ruoyi.ams.task.domain.WcsTask;
 import com.ruoyi.ams.task.service.IWcsTaskService;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * AGV任务Service业务层处理
- * 
+ *
  * @author andy
  * @date 2022-03-10
  */
 @Service
-public class WcsTaskServiceImpl implements IWcsTaskService 
-{
+public class WcsTaskServiceImpl implements IWcsTaskService {
+
     @Autowired
     private WcsTaskMapper wcsTaskMapper;
+    @Autowired
+    private IBaseLocationInfoService baseLocationInfoService;
+    @Autowired
+    private InvLotLocIdMapper invLotLocIdMapper;
 
     /**
      * 查询AGV任务
-     * 
+     *
      * @param taskNo AGV任务主键
      * @return AGV任务
      */
     @Override
-    public WcsTask selectWcsTaskByTaskNo(String taskNo)
-    {
+    public WcsTask selectWcsTaskByTaskNo(String taskNo) {
         return wcsTaskMapper.selectWcsTaskByTaskNo(taskNo);
     }
 
     /**
      * 查询AGV任务列表
-     * 
+     *
      * @param wcsTask AGV任务
      * @return AGV任务
      */
     @Override
-    public List<WcsTask> selectWcsTaskList(WcsTask wcsTask)
-    {
+    public List<WcsTask> selectWcsTaskList(WcsTask wcsTask) {
         return wcsTaskMapper.selectWcsTaskListVO(wcsTask);
     }
 
@@ -50,10 +58,9 @@ public class WcsTaskServiceImpl implements IWcsTaskService
      * @return AGV任务
      */
     @Override
-    public WcsTask selectWcsTaskByModel(WcsTask wcsTask)
-    {
+    public WcsTask selectWcsTaskByModel(WcsTask wcsTask) {
         List<WcsTask> list = wcsTaskMapper.selectWcsTaskList(wcsTask);
-        if (list!=null && list.size()>0) {
+        if (list != null && list.size() > 0) {
             return list.get(0);
         } else {
             return null;
@@ -62,49 +69,79 @@ public class WcsTaskServiceImpl implements IWcsTaskService
 
     /**
      * 新增AGV任务
-     * 
+     *
      * @param wcsTask AGV任务
      * @return 结果
      */
     @Override
-    public int insertWcsTask(WcsTask wcsTask)
-    {
+    public int insertWcsTask(WcsTask wcsTask) {
         return wcsTaskMapper.insertWcsTask(wcsTask);
     }
 
     /**
      * 修改AGV任务
-     * 
+     *
      * @param wcsTask AGV任务
      * @return 结果
      */
     @Override
-    public int updateWcsTask(WcsTask wcsTask)
-    {
+    public int updateWcsTask(WcsTask wcsTask) {
         return wcsTaskMapper.updateWcsTask(wcsTask);
     }
 
     /**
      * 批量删除AGV任务
-     * 
+     *
      * @param taskNos 需要删除的AGV任务主键
      * @return 结果
      */
     @Override
-    public int deleteWcsTaskByTaskNos(String[] taskNos)
-    {
+    public int deleteWcsTaskByTaskNos(String[] taskNos) {
         return wcsTaskMapper.deleteWcsTaskByTaskNos(taskNos);
     }
 
     /**
      * 删除AGV任务信息
-     * 
+     *
      * @param taskNo AGV任务主键
      * @return 结果
      */
     @Override
-    public int deleteWcsTaskByTaskNo(String taskNo)
-    {
+    public int deleteWcsTaskByTaskNo(String taskNo) {
         return wcsTaskMapper.deleteWcsTaskByTaskNo(taskNo);
     }
+
+    @Override
+    public void callBackPickup(WcsTask wcsTask) {
+
+    }
+
+    @Transactional
+    @Override
+    public void callBackTaskComplete(WcsTask wcsTask) {
+        BaseLocationInfo bt = null;
+
+        //设置目标库位为占用状态
+        if (!StringUtils.isEmpty(wcsTask.getLocationTo())) {
+            bt = baseLocationInfoService.selectBaseLocationInfoById(Long.parseLong(wcsTask.getLocationTo()));
+            if (bt != null) {
+                bt.setIsEmpty("N");
+                bt.setStockStatus("00");
+                baseLocationInfoService.updateBaseLocationInfo(bt);
+            }
+        }
+
+        if (!StringUtils.isEmpty(wcsTask.getLocationFrom()) && !StringUtils.isEmpty(wcsTask.getLocationTo())) {
+            invLotLocIdMapper.updateInvLotLocIdLocationId(Long.parseLong(wcsTask.getLocationFrom()), Long.parseLong(wcsTask.getLocationTo()));
+        }
+
+        //修改任务状态
+        wcsTask.setState(2L);
+        wcsTaskMapper.updateWcsTask(wcsTask);
+
+        // 释放起始库位
+        if (!StringUtils.isEmpty(wcsTask.getLocationFrom())) {
+            baseLocationInfoService.updateLocationStockStatus(Long.parseLong(wcsTask.getLocationFrom()), "00");
+        }
+    }
 }

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

@@ -17,10 +17,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="soSameLotatt1Value"    column="so_same_lotatt1_value"    />
         <result property="soOuterFlag"    column="so_outer_flag"    />
         <result property="soLocationAverage"    column="so_location_average"    />
+        <result property="soPeriodLotatt"    column="so_period_lotatt"    />
     </resultMap>
 
     <sql id="selectAsnSoStrategyVo">
-        select asn_same_sku, asn_same_sku_type, asn_same_lotatt1_flag, asn_same_lotatt1_value, asn_same_lotatt2_flag, asn_same_lotatt2_value, asn_location_average, so_period_flag, so_same_lotatt1_flag, so_same_lotatt1_value, so_outer_flag, so_location_average from asn_so_strategy
+        select asn_same_sku, asn_same_sku_type, asn_same_lotatt1_flag, asn_same_lotatt1_value, asn_same_lotatt2_flag, asn_same_lotatt2_value, asn_location_average, so_period_flag, so_same_lotatt1_flag, so_same_lotatt1_value, so_outer_flag, so_location_average, so_period_lotatt
+        from asn_so_strategy
     </sql>
 
     <select id="selectAsnSoStrategyList" parameterType="AsnSoStrategy" resultMap="AsnSoStrategyResult">

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

@@ -300,4 +300,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         delete from inv_lot_loc_id where location_id = #{locationId}
     </delete>
 
+    <update id="updateInvLotLocIdLocationId">
+        update inv_lot_loc_id set location_id = #{locationTo} where location_id = #{locationFrom}
+    </update>
 </mapper>

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

@@ -92,6 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="parentTask != null  and parentTask != ''"> and t.parent_task = #{parentTask}</if>
             <if test="agvNo != null  and agvNo != ''"> and t.agv_no like concat('%', #{agvNo}, '%')</if>
         </where>
+        order by t.create_date desc
     </select>
     
     <select id="selectWcsTaskByTaskNo" parameterType="String" resultMap="WcsTaskResult">

+ 1 - 1
warewms-base/src/main/java/com/ruoyi/base/mapper/BaseLocationInfoMapper.java

@@ -95,7 +95,7 @@ public interface BaseLocationInfoMapper {
      * @param lotatt
      * @return
      */
-    List<BaseLocationLotattVO> selectSortedLocationLotattListByZoneIdList(@Param("zoneId") List<Long> zoneId,@Param("lotatt") Map<String, String> lotatt);
+    List<BaseLocationLotattVO> selectSortedLocationLotattListByZoneIdList(@Param("zoneId") List<Long> zoneId,@Param("warehouseId")Long warehouseId,@Param("lotatt") Map<String, String> lotatt);
 
     LotattVO selectInvLotattById(@Param("id") Long id);
 

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

@@ -78,10 +78,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="remark"    column="remark"    />
         <result property="sku"    column="sku"    />
         <result property="qty"    column="qty"    />
-    </resultMap>
-
-    <resultMap id="BaseLocationLotattVOLotattResult" type="baseLocationLotattVO" extends="BaseLocationInfoLotattResult">
-        <collection property="lotattVO" notNullColumn="sub_id" javaType="java.util.List" resultMap="LotattResult" />
+        <result property="lotattVO.lotatt01"    column="lotatt01"    />
+        <result property="lotattVO.lotatt02"    column="lotatt02"    />
+        <result property="lotattVO.lotatt03"    column="lotatt03"    />
+        <result property="lotattVO.lotatt04"    column="lotatt04"    />
+        <result property="lotattVO.lotatt05"    column="lotatt05"    />
+        <result property="lotattVO.lotatt06"    column="lotatt06"    />
+        <result property="lotattVO.lotatt07"    column="lotatt07"    />
+        <result property="lotattVO.lotatt08"    column="lotatt09"    />
+        <result property="lotattVO.lotatt09"    column="lotatt09"    />
+        <result property="lotattVO.lotatt10"    column="lotatt10"    />
+        <result property="lotattVO.lotatt11"    column="lotatt11"    />
+        <result property="lotattVO.lotatt12"    column="lotatt12"    />
+        <result property="lotattVO.lotatt13"    column="lotatt13"    />
+        <result property="lotattVO.lotatt14"    column="lotatt14"    />
+        <result property="lotattVO.lotatt15"    column="lotatt15"    />
+        <result property="lotattVO.lotatt16"    column="lotatt16"    />
+        <result property="lotattVO.lotatt17"    column="lotatt17"    />
+        <result property="lotattVO.lotatt18"    column="lotatt18"    />
     </resultMap>
 
     <resultMap type="lotattVO" id="LotattResult">
@@ -385,7 +399,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         b.userdefine9, b.userdefine10, b.create_by, b.create_time,  b.update_by,  b.update_time,  b.remark, inv.sku, inv.qty, att.*
         from base_location_info b left join inv_lot_loc_id inv on b.id = inv.location_id
         left join inv_lot_att att on inv.lotnum = att.lotnum
-        where warehouse_id = #{warehouseId} and zone_id = #{zoneId}
+        where warehouse_id = #{warehouseId} and inv.sku is not null and zone_id in
+        <foreach item="item" collection="zoneId" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        <if test="lotatt.lotatt01 != null and lotatt.lotatt01 != ''"> and att.lotatt01 = #{lotatt.lotatt01}</if>
+        <if test="lotatt.lotatt02 != null and lotatt.lotatt02 != ''"> and att.lotatt02 = #{lotatt.lotatt02}</if>
+        <if test="lotatt.lotatt03 != null and lotatt.lotatt03 != ''"> and att.lotatt03 = #{lotatt.lotatt03}</if>
+        <if test="lotatt.lotatt04 != null and lotatt.lotatt04 != ''"> and att.lotatt04 = #{lotatt.lotatt04}</if>
+        <if test="lotatt.lotatt05 != null and lotatt.lotatt05 != ''"> and att.lotatt05 = #{lotatt.lotatt05}</if>
+        <if test="lotatt.lotatt06 != null and lotatt.lotatt06 != ''"> and att.lotatt06 = #{lotatt.lotatt06}</if>
+        <if test="lotatt.lotatt07 != null and lotatt.lotatt07 != ''"> and att.lotatt07 = #{lotatt.lotatt07}</if>
+        <if test="lotatt.lotatt08 != null and lotatt.lotatt08 != ''"> and att.lotatt08 = #{lotatt.lotatt08}</if>
+        <if test="lotatt.lotatt09 != null and lotatt.lotatt09 != ''"> and att.lotatt09 = #{lotatt.lotatt09}</if>
+        <if test="lotatt.lotatt10 != null and lotatt.lotatt10 != ''"> and att.lotatt10 = #{lotatt.lotatt10}</if>
+        <if test="lotatt.lotatt11 != null and lotatt.lotatt11 != ''"> and att.lotatt11 = #{lotatt.lotatt11}</if>
+        <if test="lotatt.lotatt12 != null and lotatt.lotatt12 != ''"> and att.lotatt12 = #{lotatt.lotatt12}</if>
+        <if test="lotatt.lotatt13 != null and lotatt.lotatt13 != ''"> and att.lotatt13 = #{lotatt.lotatt13}</if>
+        <if test="lotatt.lotatt14 != null and lotatt.lotatt14 != ''"> and att.lotatt14 = #{lotatt.lotatt14}</if>
+        <if test="lotatt.lotatt15 != null and lotatt.lotatt15 != ''"> and att.lotatt15 = #{lotatt.lotatt15}</if>
+        <if test="lotatt.lotatt16 != null and lotatt.lotatt16 != ''"> and att.lotatt16 = #{lotatt.lotatt16}</if>
+        <if test="lotatt.lotatt17 != null and lotatt.lotatt17 != ''"> and att.lotatt17 = #{lotatt.lotatt17}</if>
+        <if test="lotatt.lotatt18 != null and lotatt.lotatt18 != ''"> and att.lotatt18 = #{lotatt.lotatt18}</if>
         order by lpad(row_no, 11, '0'),row_index,lpad(shift_no, 11, '0'),shift_index,lpad(col_no, 11, '0'),col_index
     </select>
 </mapper>