Browse Source

库内理货,pda接口

andy 2 years ago
parent
commit
01c1765f47
25 changed files with 397 additions and 33 deletions
  1. 15 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/wms/order/WmsDocOrderHeaderController.java
  2. 8 0
      ruoyi-ui/src/api/docOrder/docOrder.js
  3. 62 6
      ruoyi-ui/src/views/ams/inv/invLotLocId/index.vue
  4. 4 4
      ruoyi-ui/src/views/index.vue
  5. 2 0
      ruoyi-ui/src/views/wms/docOrder/index.vue
  6. 30 2
      warewms-ams/src/main/java/com/ruoyi/ams/asn/service/impl/WmsDocAsnHeaderServiceImpl.java
  7. 12 0
      warewms-ams/src/main/java/com/ruoyi/ams/asn/vo/StockingListVO.java
  8. 11 0
      warewms-ams/src/main/java/com/ruoyi/ams/box/service/IWmsBoxInfoService.java
  9. 5 0
      warewms-ams/src/main/java/com/ruoyi/ams/box/service/impl/WmsBoxInfoServiceImpl.java
  10. 20 0
      warewms-ams/src/main/java/com/ruoyi/ams/inv/domain/form/InvLocIdSearchFrom.java
  11. 36 2
      warewms-ams/src/main/java/com/ruoyi/ams/inv/domain/vo/InvLotLocIdLotattVO.java
  12. 12 0
      warewms-ams/src/main/java/com/ruoyi/ams/inv/mapper/InvLotLocIdMapper.java
  13. 2 0
      warewms-ams/src/main/java/com/ruoyi/ams/inv/service/IInvLotLocIdService.java
  14. 5 1
      warewms-ams/src/main/java/com/ruoyi/ams/inv/service/impl/InvLotLocIdServiceImpl.java
  15. 2 1
      warewms-ams/src/main/java/com/ruoyi/ams/lineCall/domain/form/LineCallForm.java
  16. 2 1
      warewms-ams/src/main/java/com/ruoyi/ams/lineCall/domain/form/LineCallListFrom.java
  17. 11 0
      warewms-ams/src/main/java/com/ruoyi/ams/order/form/InvTallyForm.java
  18. 1 0
      warewms-ams/src/main/java/com/ruoyi/ams/order/form/PickInfoForm.java
  19. 11 1
      warewms-ams/src/main/java/com/ruoyi/ams/order/service/IWmsDocOrderHeaderService.java
  20. 102 8
      warewms-ams/src/main/java/com/ruoyi/ams/order/service/impl/WmsDocOrderHeaderServiceImpl.java
  21. 6 1
      warewms-ams/src/main/java/com/ruoyi/ams/task/service/impl/WcsTaskServiceImpl.java
  22. 35 2
      warewms-ams/src/main/resources/mapper/ams/InvLotLocIdMapper.xml
  23. 1 1
      warewms-ams/src/main/resources/mapper/ams/WmsDocAsnDetailsMapper.xml
  24. 1 1
      warewms-ams/src/main/resources/mapper/box/WmsBoxInfoMapper.xml
  25. 1 0
      warewms-ams/src/main/resources/mapper/docOrder/WmsDocOrderHeaderMapper.xml

+ 15 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/wms/order/WmsDocOrderHeaderController.java

@@ -4,8 +4,10 @@ import java.util.Date;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.ruoyi.ams.inv.domain.vo.InvLotLocIdLotattVO;
 import com.ruoyi.ams.order.domain.WmsDocOrderDetails;
 import com.ruoyi.ams.order.form.AllocationForm;
+import com.ruoyi.ams.order.form.InvTallyForm;
 import com.ruoyi.base.service.IBaseIdsequenceService;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -153,13 +155,24 @@ public class WmsDocOrderHeaderController extends BaseController {
     /**
      * 新增出库单明细
      */
-    @PreAuthorize("@ss.hasPermi('docAsn:docAsn:add')")
+    @PreAuthorize("@ss.hasPermi('docOrder:docOrder:add')")
     @Log(title = "出库明细", businessType = BusinessType.INSERT)
-    @PostMapping("addDocOrderDetails")
+    @PostMapping("/addDocOrderDetails")
     public AjaxResult addDocOrderDetails(@RequestBody WmsDocOrderDetails wmsDocOrderDetails) {
         LoginUser loginUser = getLoginUser();
         wmsDocOrderDetails.setCreateBy(loginUser.getUsername());
         wmsDocOrderDetails.setCreateTime(new Date());
         return toAjax(wmsDocOrderHeaderService.insertWmsDocOrderDetails(wmsDocOrderDetails));
     }
+
+    @PreAuthorize("@ss.hasPermi('docOrder:docOrder:add')")
+    @Log(title = "库内理货", businessType = BusinessType.INSERT)
+    @PostMapping("/invTally")
+    public AjaxResult invTally(@RequestBody InvTallyForm invTallyForm) {
+        List<InvLotLocIdLotattVO> invLotLocIdLotattVOS = invTallyForm.getInvLotLocIdLotattVOS();
+        if (invLotLocIdLotattVOS == null || invLotLocIdLotattVOS.size() == 0) {
+            return AjaxResult.error("请选择需要理货的库存");
+        }
+        return wmsDocOrderHeaderService.invTally(invTallyForm);
+    }
 }

+ 8 - 0
ruoyi-ui/src/api/docOrder/docOrder.js

@@ -96,3 +96,11 @@ export function addDocOrderDetails(data) {
     data: data
   })
 }
+
+export function addInvTally(data) {
+  return request({
+    url: '/docOrder/docOrder/invTally',
+    method: 'post',
+    data: data
+  })
+}

+ 62 - 6
ruoyi-ui/src/views/ams/inv/invLotLocId/index.vue

@@ -10,6 +10,16 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="库区" prop="zoneId">
+        <el-select v-model="queryParams.zoneId" placeholder="请选择库区" clearable>
+          <el-option
+            v-for="dict in locationZoneCombo"
+            :key="dict.zoneId"
+            :label="dict.zoneName"
+            :value="dict.zoneId"
+          ></el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item label="库位" prop="locationNo">
         <el-input
           v-model="queryParams.locationNo"
@@ -20,7 +30,7 @@
         />
       </el-form-item>
       <el-form-item label="是否满拖" prop="isFull">
-        <el-select v-model="form.isFull" placeholder="请选择是否满拖">
+        <el-select v-model="queryParams.isFull" placeholder="请选择是否满拖" clearable>
           <el-option
             v-for="dict in dict.type.sys_yes_no"
             :key="dict.value"
@@ -124,7 +134,11 @@
       <el-table-column type="selection" />
       <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="skuTypeName"/>
+      <el-table-column label="托盘号" align="center" prop="palletNo"/>
+      <el-table-column label="是否满拖" align="center" prop="isFull"/>
+      <el-table-column label="库区" align="center" prop="zoneName"/>
+      <el-table-column label="库位" align="center" prop="locationNo"/>
       <el-table-column label="库存数量" align="center" prop="qty"/>
       <el-table-column label="已分配数量" align="center" prop="qtyallocated" width="200"/>
       <el-table-column
@@ -215,6 +229,8 @@
 
 <script>
 import { listInvLotLocId, getInvLotLocId, adjInvLotLocId, moveInvLotLocId, delInvLotLocId, addInvLotLocId, updateInvLotLocId } from "@/api/ams/invLotLocId";
+import { addInvTally } from "@/api/docOrder/docOrder";
+import { queryLocationZoneDict } from "@/api/base/locationZone";
 import { lotattConfigList } from "@/api/ams/config";
 import adjDialog from "@/views/ams/inv/invLotLocId/adjDialog";
 
@@ -252,22 +268,24 @@ export default {
         pageSize: 10,
         sku: null,
         locationNo: null,
-        isFull: null
+        isFull: null,
+        zoneId: null
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {
       },
-      tableOption: []
+      tableOption: [],
+      locationZoneCombo: []
     };
   },
   created() {
-    this.initLotatt();
+    this.initData();
     this.getList();
   },
   methods: {
-    initLotatt() {
+    initData() {
       lotattConfigList().then(response => {
         let data = response.data
         for(let i=0;i<data.length;i++) {
@@ -277,6 +295,10 @@ export default {
           this.tableOption.push(obj)
         }
       })
+
+      queryLocationZoneDict().then(response => {
+        this.locationZoneCombo = response.data
+      })
     },
     /** 查询库位库存信息列表 */
     getList() {
@@ -409,7 +431,41 @@ export default {
     },
     /** 库内理货*/
     handleTally() {
+      if(this.tableSelection.length === 0) {
+        this.$modal.msgError("请选择需要操作的库存");
+        return
+      }
+      //判断是否都是相同类型
+      let preSkuType = ''
+      for(let i = 0;i<this.tableSelection.length;i++) {
+        if(preSkuType === '') {
+          preSkuType = this.tableSelection[i].skuTypeName
+        } else {
+          if(preSkuType !== this.tableSelection[i].skuTypeName) {
+            this.$modal.msgError("只能整理同类型的库存");
+            return
+          }
+        }
 
+        if(this.tableSelection[i].qtyallocated !== 0) {
+          this.$modal.msgError("请选择未分配的库存");
+          return
+        }
+
+        if(this.tableSelection[i].qtyallocated === this.tableSelection[i].qty) {
+          this.$modal.msgError("没有可以分配的库存");
+          return
+        }
+
+        if(this.tableSelection[i].isFull !== 'N') {
+          this.$modal.msgError("请选择未满拖的库存");
+          return
+        }
+      }
+      addInvTally({"invLotLocIdLotattVOS": this.tableSelection}).then(response => {
+        this.$modal.msgSuccess(response.msg);
+        this.getList();
+      });
     }
   }
 };

+ 4 - 4
ruoyi-ui/src/views/index.vue

@@ -15,7 +15,7 @@
       </el-col>
 
       <el-col :sm="24" :lg="12" style="padding-left: 50px">
-        <el-row>
+        <!--<el-row>
           <el-col :span="12">
             <h2>技术选型</h2>
           </el-col>
@@ -45,11 +45,11 @@
               <li>...</li>
             </ul>
           </el-col>
-        </el-row>
+        </el-row>-->
       </el-col>
     </el-row>
     <el-divider />
-    <el-row :gutter="20">
+    <!--<el-row :gutter="20">
       <el-col :xs="24" :sm="24" :md="12" :lg="8">
         <el-card class="update-log">
           <div slot="header" class="clearfix">
@@ -84,7 +84,7 @@
           </div>
         </el-card>
       </el-col>
-    </el-row>
+    </el-row>-->
   </div>
 </template>
 

+ 2 - 0
ruoyi-ui/src/views/wms/docOrder/index.vue

@@ -119,6 +119,8 @@
       <el-table-column label="客户单号1" align="center" prop="soReference1" />
       <el-table-column label="客户单号2" align="center" prop="soReference2" />
       <el-table-column label="客户单号3" align="center" prop="soReference3" />
+      <el-table-column label="创建时间" align="center" prop="createTime" />
+      <el-table-column label="创建人" align="center" prop="createBy" />
       <!--<el-table-column label="单据操作优先级" align="center" prop="priority" />-->
       <!--<el-table-column label="收货单位名称" align="center" prop="consigneeName" />-->
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">

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

@@ -10,10 +10,15 @@ import com.ruoyi.ams.asn.mapper.WmsDocAsnDetailsMapper;
 import com.ruoyi.ams.asn.vo.SearchStockVO;
 import com.ruoyi.ams.box.domain.WmsBoxInfo;
 import com.ruoyi.ams.box.service.IWmsBoxInfoService;
+import com.ruoyi.ams.business.IBusinessService;
+import com.ruoyi.ams.config.domain.dto.AgvCallDTO;
 import com.ruoyi.ams.config.domain.dto.LotattDTO;
+import com.ruoyi.ams.config.domain.vo.FlowConfigHeaderVO;
+import com.ruoyi.ams.config.service.IFlowConfigHeaderService;
 import com.ruoyi.ams.inv.domain.ActTransactionLog;
 import com.ruoyi.ams.inv.domain.InvLotAtt;
 import com.ruoyi.ams.inv.domain.InvLotLocId;
+import com.ruoyi.ams.inv.domain.form.InvLocIdSearchFrom;
 import com.ruoyi.ams.inv.domain.form.InvLotLocIdMoveForm;
 import com.ruoyi.ams.inv.mapper.InvLotLocIdMapper;
 import com.ruoyi.ams.inv.service.IActTransactionLogService;
@@ -28,8 +33,10 @@ import com.ruoyi.ams.order.service.IActAllocationDetailsService;
 import com.ruoyi.ams.order.service.IWmsDocOrderDetailsService;
 import com.ruoyi.ams.order.service.IWmsDocOrderHeaderService;
 import com.ruoyi.base.constant.Constant;
+import com.ruoyi.base.domain.BaseLocationInfo;
 import com.ruoyi.base.domain.BaseSku;
 import com.ruoyi.base.domain.vo.CodeSkuRelationshipVO;
+import com.ruoyi.base.service.IBaseLocationInfoService;
 import com.ruoyi.base.service.IBaseSkuService;
 import com.ruoyi.base.service.ICodeSkuRelationshipService;
 import com.ruoyi.base.utils.IdSequenceUtils;
@@ -85,6 +92,12 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
     private IActAllocationDetailsService actAllocationDetailsService;
     @Autowired
     private ICodeSkuRelationshipService codeSkuRelationshipService;
+    @Autowired
+    private IFlowConfigHeaderService flowConfigHeaderService;
+    @Autowired
+    private IBusinessService businessService;
+    @Autowired
+    private IBaseLocationInfoService baseLocationInfoService;
 
     /**
      * 查询入库单
@@ -262,6 +275,7 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
             wmsBoxInfo.setBoxNo(stockForm.getPalletNo());
             wmsBoxInfo.setBoxState(1);
             wmsBoxInfo.setBoxType("pallet");
+            wmsBoxInfo.setIsEmpty("N");
             wmsBoxInfo.setIsFull(stockForm.getFullTag());
             wmsBoxInfo.setCreateBy(loginUser.getUsername());
             wmsBoxInfo.setCreateTime(new Date());
@@ -278,6 +292,7 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
             wmsBoxInfo.setLocationId(Long.parseLong(STAGE01));
             wmsBoxInfo.setUpdateBy(loginUser.getUsername());
             wmsBoxInfo.setUpdateTime(new Date());
+            wmsBoxInfo.setIsEmpty("N");
             boxInfoService.updateWmsBoxInfo(wmsBoxInfo);
         }
 
@@ -409,7 +424,7 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
                             lotattDTO.setLotatt05("90");
                             lotattDTO.setLotatt07(stockForm.getPalletNo());
                             lotattDTO.setLotatt08(details.getAsnNo());
-                            lotattDTO.setLotatt12("Y");
+                            lotattDTO.setLotatt12("N");
                             lotattDTO.setLotatt13(DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD));
                             lotattDTO.setLotatt14(stockForm.getOrderNo());
                             String lotnum = invLotLocIdService.initInv(STAGE01, codeSkuRelationshipVO.getSku(), Constant.CUSTOMER_ID, current.doubleValue(), lotattDTO, BigDecimal.ZERO);
@@ -436,13 +451,21 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
         if (wmsBoxInfo == null) {
             throw new ServiceException("托盘不存在");
         }
+        BaseLocationInfo locationTo = baseLocationInfoService.selectBaseLocationInfoById(Long.parseLong(paForm.getLocationTo()));
+        if (locationTo != null) {
+            locationTo.setIsEmpty("N");
+            baseLocationInfoService.updateBaseLocationInfo(locationTo);
+        }
+
         //获取库存当前的托盘位置
         List<InvLotLocId> invLotLocIdList = invLotLocIdService.queryInvByInvLotatt(null, palletNo);
         for (InvLotLocId inv : invLotLocIdList) {
             if (lotatt08.equals("")) {
                 InvLotAtt invLotAtt = invLotAttService.selectInvLotAttByLotnum(inv.getLotnum());
+                invLotAtt.setLotatt12("Y");
                 lotatt08 = invLotAtt.getLotatt08();
             }
+            //更新库位状态
             //更新托盘库存到起始库位
             //invLotLocIdMapper.updateInvLotLocIdLocationId(Long.parseLong(inv.getLocationId()), Long.parseLong(paForm.getLocationTo()));
             invLotLocIdMapper.updateInvLotLocIdToByLotnum(inv.getLotnum(), Long.parseLong(paForm.getLocationTo()));
@@ -477,6 +500,12 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
         updateStatus.setAsnNo(lotatt08);
         wmsDocAsnHeaderMapper.updateWmsDocAsnHeader(updateStatus);
 
+        //生成入库上架任务
+        /*FlowConfigHeaderVO flowConfigHeaderVO = flowConfigHeaderService.selectFlowConfigHeaderById(5L);
+        AgvCallDTO agvCallDTO = new AgvCallDTO();
+
+        businessService.agvCall(flowConfigHeaderVO, agvCallDTO);*/
+        return AjaxResult.success("操作成功");
         //TODO 事务日志
         /*String tracNo = idSequenceUtils.generateId("TRANSACTIONID");
         ActTransactionLog paLog = new ActTransactionLog();
@@ -484,7 +513,6 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
         paLog.setTransactionType(Constant.Transaction_TYPE.PA.getValue());
         //paLog.setDocNo();
         actTransactionLogService.insertActTransactionLog(paLog);*/
-        return AjaxResult.success("操作成功");
     }
 
     @Override

+ 12 - 0
warewms-ams/src/main/java/com/ruoyi/ams/asn/vo/StockingListVO.java

@@ -0,0 +1,12 @@
+package com.ruoyi.ams.asn.vo;
+
+import lombok.Data;
+
+@Data
+public class StockingListVO {
+    private String sn;
+    private String sku;
+    private String skuName;
+    private String model;
+    private String qty;
+}

+ 11 - 0
warewms-ams/src/main/java/com/ruoyi/ams/box/service/IWmsBoxInfoService.java

@@ -79,6 +79,7 @@ public interface IWmsBoxInfoService {
 
     /**
      * 初始化一个托盘
+     *
      * @param addBoxForm
      * @return
      */
@@ -86,8 +87,18 @@ public interface IWmsBoxInfoService {
 
     /**
      * 根据库位id查询托盘
+     *
      * @param locationId
      * @return
      */
     WmsBoxInfo selectByLocationId(String locationId);
+
+    /**
+     * 更新托盘绑定关系
+     * @param locationFrom
+     * @param locationTo
+     * @param isFull 传null不更新
+     * @return
+     */
+    int updateLocationBind(Long locationFrom,Long locationTo,String isFull);
 }

+ 5 - 0
warewms-ams/src/main/java/com/ruoyi/ams/box/service/impl/WmsBoxInfoServiceImpl.java

@@ -150,4 +150,9 @@ public class WmsBoxInfoServiceImpl implements IWmsBoxInfoService {
         WmsBoxInfo wmsBoxInfo = wmsBoxInfoMapper.selectByLocationId(locationId);
         return wmsBoxInfo;
     }
+
+    @Override
+    public int updateLocationBind(Long locationFrom, Long locationTo, String isFull) {
+        return wmsBoxInfoMapper.updateLocationBind(locationFrom, locationTo, isFull);
+    }
 }

+ 20 - 0
warewms-ams/src/main/java/com/ruoyi/ams/inv/domain/form/InvLocIdSearchFrom.java

@@ -1,5 +1,7 @@
 package com.ruoyi.ams.inv.domain.form;
 
+import com.ruoyi.ams.config.domain.dto.LotattDTO;
+
 /**
  * Created by IntelliJ IDEA.
  * User: andy.qu
@@ -10,6 +12,8 @@ public class InvLocIdSearchFrom {
     private String zoneId;
     private String locationNo;
     private String isFull;
+    private LotattDTO lotattDTO;
+    private String palletNo;
 
     public String getSku() {
         return sku;
@@ -42,4 +46,20 @@ public class InvLocIdSearchFrom {
     public void setIsFull(String isFull) {
         this.isFull = isFull;
     }
+
+    public LotattDTO getLotattDTO() {
+        return lotattDTO;
+    }
+
+    public void setLotattDTO(LotattDTO lotattDTO) {
+        this.lotattDTO = lotattDTO;
+    }
+
+    public String getPalletNo() {
+        return palletNo;
+    }
+
+    public void setPalletNo(String palletNo) {
+        this.palletNo = palletNo;
+    }
 }

+ 36 - 2
warewms-ams/src/main/java/com/ruoyi/ams/inv/domain/vo/InvLotLocIdLotattVO.java

@@ -1,7 +1,5 @@
 package com.ruoyi.ams.inv.domain.vo;
 
-import com.ruoyi.ams.inv.domain.InvLotLocId;
-
 /**
  * Created by IntelliJ IDEA.
  * User: andy.qu
@@ -13,9 +11,13 @@ public class InvLotLocIdLotattVO {
     private String customerId;
     private String sku;
     private String skuName;
+    private String skuTypeName;
     private String locationNo;
+    private String zoneName;
     private Double qty;
     private Double qtyallocated;
+    private String palletNo;
+    private String isFull;
     private String lotatt01;
     private String lotatt02;
     private String lotatt03;
@@ -242,4 +244,36 @@ public class InvLotLocIdLotattVO {
     public void setSkuName(String skuName) {
         this.skuName = skuName;
     }
+
+    public String getSkuTypeName() {
+        return skuTypeName;
+    }
+
+    public void setSkuTypeName(String skuTypeName) {
+        this.skuTypeName = skuTypeName;
+    }
+
+    public String getPalletNo() {
+        return palletNo;
+    }
+
+    public void setPalletNo(String palletNo) {
+        this.palletNo = palletNo;
+    }
+
+    public String getIsFull() {
+        return isFull;
+    }
+
+    public void setIsFull(String isFull) {
+        this.isFull = isFull;
+    }
+
+    public String getZoneName() {
+        return zoneName;
+    }
+
+    public void setZoneName(String zoneName) {
+        this.zoneName = zoneName;
+    }
 }

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

@@ -1,7 +1,9 @@
 package com.ruoyi.ams.inv.mapper;
 
+import java.math.BigDecimal;
 import java.util.List;
 
+import com.ruoyi.ams.asn.vo.StockingListVO;
 import com.ruoyi.ams.config.domain.dto.LotattDTO;
 import com.ruoyi.ams.inv.domain.InvLotAtt;
 import com.ruoyi.ams.inv.domain.InvLotLocId;
@@ -252,4 +254,14 @@ public interface InvLotLocIdMapper {
      * @return
      */
     List<InvLotLocId> selectInvLotLocIdBySkuLocationSort(@Param("sku") String sku, @Param("locationId") Long locationId);
+
+    /**
+     * 根据条件更新已分配数
+     *
+     * @param lotnum
+     * @param locationId
+     * @param qty
+     * @return
+     */
+    int updateAllocationBy(@Param("lotnum") String lotnum, @Param("locationId") Long locationId, @Param("qty") BigDecimal qty);
 }

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

@@ -3,6 +3,7 @@ package com.ruoyi.ams.inv.service;
 import java.math.BigDecimal;
 import java.util.List;
 
+import com.ruoyi.ams.asn.vo.StockingListVO;
 import com.ruoyi.ams.config.domain.dto.LotattDTO;
 import com.ruoyi.ams.inv.domain.InvLotAtt;
 import com.ruoyi.ams.inv.domain.InvLotLocId;
@@ -253,6 +254,7 @@ public interface IInvLotLocIdService {
 
     /**
      * 保存或者更新
+     *
      * @param invLotLocId
      * @return
      */

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

@@ -1,8 +1,10 @@
 package com.ruoyi.ams.inv.service.impl;
 
+import com.ruoyi.ams.asn.vo.StockingListVO;
 import com.ruoyi.ams.box.domain.WmsBoxInfo;
 import com.ruoyi.ams.box.service.IWmsBoxInfoService;
 import com.ruoyi.ams.config.domain.dto.LotattDTO;
+import com.ruoyi.ams.inv.domain.ActTransactionLog;
 import com.ruoyi.ams.inv.domain.InvLotAtt;
 import com.ruoyi.ams.inv.domain.InvLotLocId;
 import com.ruoyi.ams.inv.domain.form.InvLocIdSearchFrom;
@@ -20,6 +22,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.uuid.SnowflakeIdWorker;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -27,6 +30,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -519,7 +523,6 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
         List<InvLotLocId> invLotLocIds = invLotLocIdMapper.selectInvLotLocIdByLotnum(lotnum);
         if (invLotLocIds != null && invLotLocIds.size() > 0) {
             for (InvLotLocId inv : invLotLocIds) {
-                //TODO 多次拣货更新
                 BigDecimal invallqty = inv.getQtyallocated();
                 InvLotLocId copy = new InvLotLocId();
                 BeanUtils.copyProperties(inv, copy);
@@ -528,6 +531,7 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
                 copy.setQtyEach(qty);
                 copy.setQtyallocated(qty);
                 copy.setQtyallocatedEach(qty);
+                copy.setRemark(boxNo);
                 invLotLocIdService.saveOrUpdate(copy);
 
                 BigDecimal invqty = inv.getQty();

+ 2 - 1
warewms-ams/src/main/java/com/ruoyi/ams/lineCall/domain/form/LineCallForm.java

@@ -1,5 +1,6 @@
 package com.ruoyi.ams.lineCall.domain.form;
 
+import java.io.Serializable;
 import java.util.List;
 
 /**
@@ -7,7 +8,7 @@ import java.util.List;
  * User: andy.qu
  * Date: 2022/3/9
  */
-public class LineCallForm {
+public class LineCallForm implements Serializable {
     private Long flowId;
     private List<LineCallListFrom> lineCallList;
 

+ 2 - 1
warewms-ams/src/main/java/com/ruoyi/ams/lineCall/domain/form/LineCallListFrom.java

@@ -1,8 +1,9 @@
 package com.ruoyi.ams.lineCall.domain.form;
 
+import java.io.Serializable;
 import java.util.List;
 
-public class LineCallListFrom {
+public class LineCallListFrom implements Serializable {
     //编号
     private Long id;
     //物料

+ 11 - 0
warewms-ams/src/main/java/com/ruoyi/ams/order/form/InvTallyForm.java

@@ -0,0 +1,11 @@
+package com.ruoyi.ams.order.form;
+
+import com.ruoyi.ams.inv.domain.vo.InvLotLocIdLotattVO;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class InvTallyForm {
+    List<InvLotLocIdLotattVO> invLotLocIdLotattVOS;
+}

+ 1 - 0
warewms-ams/src/main/java/com/ruoyi/ams/order/form/PickInfoForm.java

@@ -5,5 +5,6 @@ import lombok.Data;
 @Data
 public class PickInfoForm {
     private String allocationId;
+    private String palletNo;
     private String locationTo;
 }

+ 11 - 1
warewms-ams/src/main/java/com/ruoyi/ams/order/service/IWmsDocOrderHeaderService.java

@@ -6,6 +6,7 @@ import com.ruoyi.ams.order.domain.WmsDocOrderDetails;
 import com.ruoyi.ams.order.domain.WmsDocOrderHeader;
 import com.ruoyi.ams.order.form.ArrangeStockForm;
 import com.ruoyi.ams.order.form.CheckOutInfoForm;
+import com.ruoyi.ams.order.form.InvTallyForm;
 import com.ruoyi.ams.order.form.PickForm;
 import com.ruoyi.ams.order.vo.StockOrderVO;
 import com.ruoyi.common.core.domain.AjaxResult;
@@ -157,15 +158,24 @@ public interface IWmsDocOrderHeaderService {
 
     /**
      * 检查关单
-     * @param asnNo
      *
+     * @param asnNo
      */
     void checkStatusClose(String asnNo, String status);
 
     /**
      * 理货
+     *
      * @param arrangeStockForm
      * @return
      */
     AjaxResult arrangeStock(ArrangeStockForm arrangeStockForm);
+
+    /**
+     * 库内理货单生成
+     *
+     * @param invTallyForm
+     * @return
+     */
+    AjaxResult invTally(InvTallyForm invTallyForm);
 }

+ 102 - 8
warewms-ams/src/main/java/com/ruoyi/ams/order/service/impl/WmsDocOrderHeaderServiceImpl.java

@@ -1,9 +1,7 @@
 package com.ruoyi.ams.order.service.impl;
 
 import java.math.BigDecimal;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 import com.ruoyi.ams.box.domain.WmsBoxInfo;
 import com.ruoyi.ams.box.mapper.WmsBoxInfoMapper;
@@ -13,17 +11,17 @@ import com.ruoyi.ams.config.domain.FlowConfigHeader;
 import com.ruoyi.ams.config.domain.dto.AgvCallDTO;
 import com.ruoyi.ams.config.domain.vo.FlowConfigHeaderVO;
 import com.ruoyi.ams.config.service.IFlowConfigHeaderService;
+import com.ruoyi.ams.inv.domain.ActTransactionLog;
 import com.ruoyi.ams.inv.domain.InvLotAtt;
 import com.ruoyi.ams.inv.domain.InvLotLocId;
+import com.ruoyi.ams.inv.domain.vo.InvLotLocIdLotattVO;
 import com.ruoyi.ams.inv.mapper.InvLotAttMapper;
 import com.ruoyi.ams.inv.mapper.InvLotLocIdMapper;
+import com.ruoyi.ams.inv.service.IActTransactionLogService;
 import com.ruoyi.ams.inv.service.IInvLotLocIdService;
 import com.ruoyi.ams.order.domain.ActAllocationDetails;
 import com.ruoyi.ams.order.domain.WmsDocOrderDetails;
-import com.ruoyi.ams.order.form.ArrangeStockForm;
-import com.ruoyi.ams.order.form.CheckOutInfoForm;
-import com.ruoyi.ams.order.form.PickForm;
-import com.ruoyi.ams.order.form.PickInfoForm;
+import com.ruoyi.ams.order.form.*;
 import com.ruoyi.ams.order.mapper.WmsDocOrderDetailsMapper;
 import com.ruoyi.ams.order.service.IActAllocationDetailsService;
 import com.ruoyi.ams.order.vo.StockOrderVO;
@@ -34,11 +32,13 @@ import com.ruoyi.base.domain.BaseLocationInfo;
 import com.ruoyi.base.domain.vo.CodeSkuRelationshipVO;
 import com.ruoyi.base.service.IBaseLocationInfoService;
 import com.ruoyi.base.service.ICodeSkuRelationshipService;
+import com.ruoyi.base.utils.IdSequenceUtils;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.uuid.SnowflakeIdWorker;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.ams.order.mapper.WmsDocOrderHeaderMapper;
@@ -80,6 +80,10 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
     private IFlowConfigHeaderService flowConfigHeaderService;
     @Autowired
     private ICodeSkuRelationshipService codeSkuRelationshipService;
+    @Autowired
+    private IActTransactionLogService actTransactionLogService;
+    @Autowired
+    private IdSequenceUtils idSequenceUtils;
 
     /**
      * 查询出库单头
@@ -330,6 +334,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         for (PickInfoForm p : pickInfoFormList) {
             String locationTo = p.getLocationTo();
             //TODO 任务完成后更新 查询对应的分配明细表
+            //TODO 改成按托盘号进行呼叫
             ActAllocationDetails actAllocationDetails = actAllocationDetailsService.selectActAllocationDetailsByAllocationId(p.getAllocationId());
             String location = actAllocationDetails.getLocationId().toString();
             //qty = actAllocationDetails.getPickQty();
@@ -352,7 +357,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
             //库存进行移动
             invLotLocIdService.stockTransfer(actAllocationDetails.getLocationId(), Long.parseLong(locationTo));
             //托盘进行绑定修改
-            wmsBoxInfoMapper.updateLocationBind(actAllocationDetails.getLocationId(), Long.parseLong(locationTo), null);
+            wmsBoxInfoMapper.updateLocationBind(Long.parseLong(location), Long.parseLong(locationTo), null);
             if (!exitsMap.containsKey(location)) {
                 exitsMap.put(location, location);
                 //生成任务退回
@@ -449,6 +454,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
     @Transactional
     @Override
     public AjaxResult arrangeStock(ArrangeStockForm arrangeStockForm) {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
         //查询托盘
         WmsBoxInfo wmsBoxInfo = wmsBoxInfoService.selectWmsBoxInfoByBoxNo(arrangeStockForm.getPalletNoTo());
         //物料绑定关系
@@ -475,6 +481,30 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
             wmsBoxInfoService.updateWmsBoxInfo(wmsBoxInfo);
             //库存进行移动
             invLotLocIdService.stockTransferPick(actAllocationDetails.getLocationId(), wmsBoxInfo.getLocationId(), actAllocationDetails.getLotnum(), new BigDecimal(arrangeStockForm.getQty()), arrangeStockForm.getBoxNo());
+
+            //记录事务日志
+            //记录日志
+            ActTransactionLog actTransactionLog = new ActTransactionLog();
+            actTransactionLog.setTransactionId(SnowflakeIdWorker.generateId().toString());
+            actTransactionLog.setTransactionType("PK");
+            actTransactionLog.setDocNo(arrangeStockForm.getOrderNo());
+            actTransactionLog.setDocType("SO");
+            actTransactionLog.setDocLineNo(actAllocationDetails.getLineNo());
+            actTransactionLog.setFmLocation(actAllocationDetails.getLocationId().toString());
+            actTransactionLog.setFmSku(actAllocationDetails.getMaterial());
+            actTransactionLog.setFmQty(new BigDecimal(arrangeStockForm.getQty()));
+            actTransactionLog.setFmLotnum(actAllocationDetails.getLotnum());
+            actTransactionLog.setToLocaltion(wmsBoxInfo.getLocationId().toString());
+            actTransactionLog.setToSku(actAllocationDetails.getMaterial());
+            actTransactionLog.setToQty(new BigDecimal(arrangeStockForm.getQty()));
+            actTransactionLog.setToLotnum(actAllocationDetails.getLotnum());
+            actTransactionLog.setUserdefine1(arrangeStockForm.getBoxNo());
+            actTransactionLog.setCreateDate(new Date());
+            actTransactionLog.setCreateBy(loginUser.getUsername());
+            actTransactionLog.setUpdateBy(loginUser.getUsername());
+            actTransactionLog.setUpdateTime(new Date());
+            actTransactionLogService.insertActTransactionLog(actTransactionLog);
+
         }
         return AjaxResult.success("操作成功");
         //ActAllocationDetails actAllocationDetails = actAllocationDetailsService.selectActAllocationDetailsByAllocationId(arrangeStockForm.getAllocationId());
@@ -487,4 +517,68 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         agvCallDTO.setWarehouseId(Constant.WAREHOUSE_ID);
         return businessService.agvCall(flowConfigHeader, agvCallDTO);*/
     }
+
+    @Transactional
+    @Override
+    public AjaxResult invTally(InvTallyForm invTallyForm) {
+        //生成出库单
+        //生成出库明细
+        //生成分配
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        List<InvLotLocIdLotattVO> invList = invTallyForm.getInvLotLocIdLotattVOS();
+        String orderNo = idSequenceUtils.generateId("ORDERNO");
+        WmsDocOrderHeader header = new WmsDocOrderHeader();
+        header.setOrderNo(orderNo);
+        header.setCustomerId(Constant.CUSTOMER_ID);
+        header.setOrderType("LH");
+        header.setOrderStatus("20");
+        header.setCreateBy(loginUser.getUsername());
+        header.setCreateTime(new Date());
+        Map<String, WmsDocOrderDetails> mapOrder = new HashMap<>();
+        for (InvLotLocIdLotattVO inv : invList) {
+            BigDecimal current = BigDecimal.valueOf(inv.getQty()).subtract(BigDecimal.valueOf(inv.getQtyallocated()));
+            WmsDocOrderDetails de;
+            if (mapOrder.get(inv.getSku()) == null) {
+                de = new WmsDocOrderDetails();
+                de.setOrderNo(orderNo);
+                de.setOrderLineNo(BigDecimal.valueOf(mapOrder.size()));
+                de.setLineStatus("20");
+                de.setSku(inv.getSku());
+                de.setQtyOrdered(BigDecimal.ZERO);
+                de.setQtyOrderedEach(BigDecimal.ZERO);
+                de.setQtyAllocated(BigDecimal.ZERO);
+                de.setQtyAllocatedEach(BigDecimal.ZERO);
+                de.setQtyPicked(BigDecimal.ZERO);
+                de.setQtyPickedEach(BigDecimal.ZERO);
+                de.setQtyShipped(BigDecimal.ZERO);
+                de.setQtyShippedEach(BigDecimal.ZERO);
+                de.setCustomerId(inv.getCustomerId());
+                de.setLotnum(inv.getLotnum());
+                mapOrder.put(inv.getSku(), de);
+            } else {
+                de = mapOrder.get(inv.getSku());
+            }
+            de.setQtyOrdered(de.getQtyOrdered().add(current));
+            de.setQtyOrderedEach(de.getQtyOrdered());
+            de.setQtyAllocated(de.getQtyAllocated().add(current));
+            de.setQtyAllocatedEach(de.getQtyAllocated());
+            de.setCreateBy(loginUser.getUsername());
+            de.setCreateTime(new Date());
+
+            //更新已分配
+            invLotLocIdMapper.updateAllocationBy(inv.getLotnum(),inv.getLocationId(),current);
+
+            //生成分配表
+            actAllocationDetailsService.addActAllocationDetails(inv.getLotnum(), inv.getLocationId().toString(), BigDecimal.valueOf(inv.getQty()), de);
+        }
+        for (WmsDocOrderDetails de : mapOrder.values()) {
+            wmsDocOrderHeaderService.insertWmsDocOrderDetails(de);
+        }
+        int result = wmsDocOrderHeaderService.insertWmsDocOrderHeader(header);
+        if (result > 0) {
+            return AjaxResult.success("操作成功");
+        } else {
+            return AjaxResult.error("操作失败");
+        }
+    }
 }

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

@@ -2,6 +2,8 @@ package com.ruoyi.ams.task.service.impl;
 
 import java.util.List;
 
+import com.ruoyi.ams.box.domain.WmsBoxInfo;
+import com.ruoyi.ams.box.service.IWmsBoxInfoService;
 import com.ruoyi.ams.inv.mapper.InvLotLocIdMapper;
 import com.ruoyi.base.domain.BaseLocationInfo;
 import com.ruoyi.base.service.IBaseLocationInfoService;
@@ -32,6 +34,8 @@ public class WcsTaskServiceImpl implements IWcsTaskService {
     private InvLotLocIdMapper invLotLocIdMapper;
     @Autowired
     private RedisCache redisCache;
+    @Autowired
+    private IWmsBoxInfoService wmsBoxInfoService;
 
     /**
      * 查询AGV任务
@@ -155,12 +159,13 @@ public class WcsTaskServiceImpl implements IWcsTaskService {
 
         if (!StringUtils.isEmpty(wcsTask.getLocationFrom()) && !StringUtils.isEmpty(wcsTask.getLocationTo())) {
             invLotLocIdMapper.updateInvLotLocIdLocationId(Long.parseLong(wcsTask.getLocationFrom()), Long.parseLong(wcsTask.getLocationTo()));
+            //更新托盘绑定关系
+            wmsBoxInfoService.updateLocationBind(Long.parseLong(wcsTask.getLocationFrom()), Long.parseLong(wcsTask.getLocationTo()), null);
         }
 
         //修改任务状态
         wcsTask.setState(2L);
         wcsTaskMapper.updateWcsTask(wcsTask);
-
     }
 
     @Transactional

+ 35 - 2
warewms-ams/src/main/resources/mapper/ams/InvLotLocIdMapper.xml

@@ -31,11 +31,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="lotnum"    column="lotnum"    />
         <result property="locationNo"    column="location_no"    />
         <result property="locationId"    column="location_id"    />
+        <result property="zoneName"    column="zone_name"    />
         <result property="customerId"    column="customer_id"    />
         <result property="sku"    column="sku"    />
         <result property="skuName"    column="sku_name"    />
+        <result property="skuTypeName"    column="sku_type_name"    />
         <result property="qty"    column="qty"    />
         <result property="qtyallocated"    column="qtyallocated"    />
+        <result property="palletNo"    column="box_no"    />
+        <result property="isFull"    column="is_full"    />
         <result property="lotnum"    column="lotnum"    />
         <result property="lotatt01"    column="lotatt01"    />
         <result property="lotatt02"    column="lotatt02"    />
@@ -292,11 +296,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectInvLocIdLotattList" 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,lot05_dict.dict_label lotatt05, supp.supplier_name lotatt06, lotatt07, lotatt08, lotatt09, lotatt10, lotatt11, lotatt12, lotatt13, lotatt14, lotatt15, lotatt16, lotatt17, lotatt18
+        inv.location_id,sk.sku,sk.desc1 sku_name,skt.item_name sku_type_name,b.location_no,inv.qty,inv.qtyallocated
+        ,att.lotnum, att.customer_id,w.box_no,w.is_full,z.zone_name
+        ,lotatt01, lotatt02, lotatt03, lotatt04,lot05_dict.dict_label lotatt05, supp.supplier_name 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_location_zone z on b.zone_id = z.zone_id
         left join base_sku sk on inv.sku = sk.sku
         left join base_sku_type skt on sk.sku_type = skt.item_code
         left join (select dict_label,dict_value from sys_dict_data where dict_type = 'ams_inv_quality') lot05_dict on att.lotatt05 = lot05_dict.dict_value
@@ -307,6 +315,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="sku != null  and sku != ''"> and (sk.sku like concat('%', #{sku}, '%') or sk.desc1 like concat('%', #{sku}, '%'))</if>
             <if test="locationNo != null  and locationNo != ''"> and b.location_no like concat('%', #{locationNo}, '%')</if>
             <if test="isFull != null  and isFull != ''"> and w.is_full = #{isFull}</if>
+            <if test="lotattDTO != null">
+                <if test="lotattDTO.lotatt01 != null  and lotattDTO.lotatt01 != ''"> and att.lotatt01 = #{lotattDTO.lotatt01}</if>
+                <if test="lotattDTO.lotatt02 != null  and lotattDTO.lotatt02 != ''"> and att.lotatt02 = #{lotattDTO.lotatt02}</if>
+                <if test="lotattDTO.lotatt03 != null  and lotattDTO.lotatt03 != ''"> and att.lotatt03 = #{lotattDTO.lotatt03}</if>
+                <if test="lotattDTO.lotatt04 != null  and lotattDTO.lotatt04 != ''"> and att.lotatt04 = #{lotattDTO.lotatt04}</if>
+                <if test="lotattDTO.lotatt05 != null  and lotattDTO.lotatt05 != ''"> and att.lotatt05 = #{lotattDTO.lotatt05}</if>
+                <if test="lotattDTO.lotatt06 != null  and lotattDTO.lotatt06 != ''"> and att.lotatt06 = #{lotattDTO.lotatt06}</if>
+                <if test="lotattDTO.lotatt07 != null  and lotattDTO.lotatt07 != ''"> and att.lotatt07 = #{lotattDTO.lotatt07}</if>
+                <if test="lotattDTO.lotatt08 != null  and lotattDTO.lotatt08 != ''"> and att.lotatt08 = #{lotattDTO.lotatt08}</if>
+                <if test="lotattDTO.lotatt09 != null  and lotattDTO.lotatt09 != ''"> and att.lotatt09 = #{lotattDTO.lotatt09}</if>
+                <if test="lotattDTO.lotatt10 != null  and lotattDTO.lotatt10 != ''"> and att.lotatt10 = #{lotattDTO.lotatt10}</if>
+                <if test="lotattDTO.lotatt11 != null  and lotattDTO.lotatt11 != ''"> and att.lotatt11 = #{lotattDTO.lotatt11}</if>
+                <if test="lotattDTO.lotatt12 != null  and lotattDTO.lotatt12 != ''"> and att.lotatt12 = #{lotattDTO.lotatt12}</if>
+                <if test="lotattDTO.lotatt13 != null  and lotattDTO.lotatt13 != ''"> and att.lotatt13 = #{lotattDTO.lotatt13}</if>
+                <if test="lotattDTO.lotatt14 != null  and lotattDTO.lotatt14 != ''"> and att.lotatt14 = #{lotattDTO.lotatt14}</if>
+                <if test="lotattDTO.lotatt15 != null  and lotattDTO.lotatt15 != ''"> and att.lotatt15 = #{lotattDTO.lotatt15}</if>
+                <if test="lotattDTO.lotatt16 != null  and lotattDTO.lotatt16 != ''"> and att.lotatt16 = #{lotattDTO.lotatt16}</if>
+                <if test="lotattDTO.lotatt17 != null  and lotattDTO.lotatt17 != ''"> and att.lotatt17 = #{lotattDTO.lotatt17}</if>
+                <if test="lotattDTO.lotatt18 != null  and lotattDTO.lotatt18 != ''"> and att.lotatt18 = #{lotattDTO.lotatt18}</if>
+            </if>
         </where>
         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>
@@ -496,6 +524,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           AND t1.lotnum IN ( SELECT lotnum FROM inv_lot_loc_id )
     </update>
 
+    <update id="updateAllocationBy">
+        update inv_lot_loc_id set qtyallocated = qtyallocated + #{qty},qtyallocated_each = qtyallocated_each + #{qty}
+        where lotnum = #{lotnum} and location_id = #{locationId}
+    </update>
+
     <select id="querySameTypeByPalletNo" resultMap="InvLotLocIdResult">
         select inv.*
         from inv_lot_loc_id inv

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

@@ -324,7 +324,7 @@
         <foreach item="asnNos" collection="asnNos" open="(" separator="," close=")">
             #{asnNos}
         </foreach>
-        and line_status <![CDATA[ <> '00' ]]>
+        <!--and line_status <![CDATA[ <> '00' ]]>-->
         order by asn_no,update_time desc
     </select>
 

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

@@ -113,7 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <update id="unbindBox">
-        update wms_box_info set location_id = '',is_full = 'N'
+        update wms_box_info set location_id = '',is_full = 'N',is_empty='Y'
         where location_id = #{locationId}
     </update>
 

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

@@ -150,6 +150,7 @@
             <if test="consigneeName != null  and consigneeName != ''"> and consignee_name like concat('%', #{consigneeName}, '%')</if>
             <if test="carrierName != null  and carrierName != ''"> and carrier_name like concat('%', #{carrierName}, '%')</if>
         </where>
+        order by create_time desc
     </select>
 
     <select id="selectWmsDocOrderHeaderByOrderNo" parameterType="String" resultMap="WmsDocOrderHeaderWmsDocOrderDetailsResult">