浏览代码

优化修改

k 2 年之前
父节点
当前提交
d05574128b

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

@@ -405,7 +405,7 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
 //                        attQuery.setLotatt07(stockForm.getPalletNo());
                         attQuery.setLotatt02(codeSkuRelationshipVO.getSn());
                         attQuery.setLotatt08(details.getAsnNo());
-                        attQuery.setLotatt14(stockForm.getOrderNo());
+//                        attQuery.setLotatt14(stockForm.getOrderNo());
                         List<InvLotLocIdLotattVO> samePalletInvList = invLotLocIdMapper.queryInvLotattByInvLotatt(attQuery);
                         if (samePalletInvList != null && samePalletInvList.size() > 0) {
                             for (InvLotLocIdLotattVO locIdLotattVO : samePalletInvList) {
@@ -611,8 +611,11 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
             detailsQuery.setAsnNo(asnNo);
             detailsQuery.setSku(qtt.getSku());
             List<WmsDocAsnDetails> details = wmsDocAsnDetailsMapper.selectWmsDocAsnDetailsList(detailsQuery);
+            // todo qty可能大于某条明细数量
+            BigDecimal qty = inv.getQty();
             for (WmsDocAsnDetails d : details) {
-                wmsDocAsnDetailsMapper.updateWmsReceivedQty(d.getAsnNo(), d.getAsnLineNo().intValue(), BigDecimal.valueOf(-1 * inv.getQty().doubleValue()), "30");
+                wmsDocAsnDetailsMapper.updateWmsReceivedQty(d.getAsnNo(), d.getAsnLineNo().intValue()
+                        , BigDecimal.valueOf(-1 * inv.getQty().doubleValue()), "30");
             }
             //删除库存 todo 物料增加库存的时候如果改成根据相同库存和批次可以累加数量,这边就需要减库存,而不是直接删除
             invLotLocIdMapper.deleteInvLotLocIdBy(inv.getLotnum(), inv.getSku(), inv.getLocationId(), inv.getCustomerId());

+ 3 - 14
warewms-ams/src/main/java/com/ruoyi/ams/order/service/impl/ActAllocationDetailsServiceImpl.java

@@ -235,16 +235,6 @@ public class ActAllocationDetailsServiceImpl implements IActAllocationDetailsSer
 
     @Override
     public AjaxResult modifyAssignmentTaskStatus(String orderNo,Long locationId,String palletNo) {
-        WmsDocOrderHeader header = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(orderNo);
-        // 备货单完全备货之前单和库内理货不需要改
-        if (header != null
-                && header.getOrderType().equals(Constant.ORDER_TYP.BH.getValue())
-                && !header.getOrderStatus().equals(Constant.ORDER_STS.STS23.getValue())) {
-            return AjaxResult.success();
-        }
-        if (header != null && header.getOrderType().equals(Constant.ORDER_TYP.LH.getValue())) {
-            return AjaxResult.success();
-        }
         ActAllocationDetailsFrom actAllocationQuery = new ActAllocationDetailsFrom();
         actAllocationQuery.setOrderNo(orderNo);
         actAllocationQuery.setLocationId(locationId);
@@ -263,15 +253,14 @@ public class ActAllocationDetailsServiceImpl implements IActAllocationDetailsSer
     @Override
     public AjaxResult modifyAssignmentStockTaskStatus(String orderNo, Long locationId, String palletNo) {
         WmsDocOrderHeader header = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(orderNo);
-        // 备货单备货之前单分配明细可以改为拣货完成
+        // 备货单分配明细可以改为拣货完成
         if (header != null
-                && header.getOrderType().equals(Constant.ORDER_TYP.BH.getValue())
-                && !header.getOrderStatus().equals(Constant.ORDER_STS.STS23.getValue())) {
+                && header.getOrderType().equals(Constant.ORDER_TYP.BH.getValue())) {
             ActAllocationDetailsFrom actAllocationQuery = new ActAllocationDetailsFrom();
             actAllocationQuery.setOrderNo(orderNo);
             actAllocationQuery.setLocationId(locationId);
             actAllocationQuery.setLotatt07(palletNo);
-            actAllocationQuery.setStatus(Constant.ORDER_STS.STS20.getValue());
+            actAllocationQuery.setStatus(Constant.ORDER_STS.STS21.getValue());
             List<ActAllocationDetailsFrom> actAllocationDetailsFromList = this.selectActAllocationDetailsInvLotAttList(actAllocationQuery);
             for (ActAllocationDetailsFrom allocationDetails : actAllocationDetailsFromList) {
                 ActAllocationDetails allocationDetailsUpdate = new ActAllocationDetails();

+ 12 - 10
warewms-ams/src/main/java/com/ruoyi/ams/order/service/impl/WmsDocOrderHeaderServiceImpl.java

@@ -569,8 +569,10 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
             invLocIdSearchFrom.setLotattDTO(lotattDTO);
             List<InvLotLocIdLotattVO> invLotLocIdLotattVOList = invLotLocIdService.selectInvLocIdLotattList(invLocIdSearchFrom);
             for (InvLotLocIdLotattVO locIdLotattVO : invLotLocIdLotattVOList) {
+                String lotatt15 = locIdLotattVO.getLotatt15();
+                WmsDocOrderHeader wmsDocOrderHeader = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(lotatt15);
                 PickingListVO pickingListVO = new PickingListVO();
-                pickingListVO.setOrderNo("");
+                pickingListVO.setOrderNo(wmsDocOrderHeader.getSoReference1()); // ERP单号
                 pickingListVO.setSku(locIdLotattVO.getSku());
                 pickingListVO.setPickQty(BigDecimal.ZERO.doubleValue());
                 pickingListVO.setToBePickQty(locIdLotattVO.getQty());
@@ -643,7 +645,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
             endActAllocation = EqualAllocationList.get(0);
         }
         if (endActAllocation == null) {
-            return AjaxResult.error("没有可以拣货的分配明细!");
+            return AjaxResult.error("没有可以拣货的分配明细!可能拣货数量大于单条分配明细未拣货数量!");
         }
         // 更新库存数量
         String lotnum = endActAllocation.getLotnum();
@@ -708,7 +710,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         String palletNo = check.getPalletNo();
         //生成任务呼叫到接驳位
         BaseLocationInfo baseLocationInfo = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(check.getLocationNo(), Constant.WAREHOUSE_ID);
-        FlowConfigHeaderVO flowConfigHeaderVO = flowConfigHeaderService.selectFlowConfigHeaderById(6L);
+        FlowConfigHeaderVO flowConfigHeaderVO = flowConfigHeaderService.selectFlowConfigHeaderById((long)Constant.FLOW_ID_SO);
         AgvCallDTO agvCallDTO = new AgvCallDTO();
         agvCallDTO.setId(flowConfigHeaderVO.getId());
         agvCallDTO.setLocationFrom(baseLocationInfo.getId().toString());
@@ -802,13 +804,13 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         }
         // 验证出库单
         if (StringUtils.isNotEmpty(orderNo)) {
-            WmsDocOrderHeader header = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(orderNo);
-            if (header != null
-                    && !header.getOrderStatus().equals(Constant.ORDER_STS.STS10.getValue())
-                    && !header.getOrderStatus().equals(Constant.ORDER_STS.STS20.getValue())
-                    && !header.getOrderStatus().equals(Constant.ORDER_STS.STS21.getValue())) {
-                return AjaxResult.error("出库单状态不可组盘!");
-            }
+//            WmsDocOrderHeader header = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(orderNo);
+//            if (header != null
+//                    && !header.getOrderStatus().equals(Constant.ORDER_STS.STS10.getValue())
+//                    && !header.getOrderStatus().equals(Constant.ORDER_STS.STS20.getValue())
+//                    && !header.getOrderStatus().equals(Constant.ORDER_STS.STS21.getValue())) {
+//                return AjaxResult.error("出库单状态不可组盘!");
+//            }
         }
         // 根据条码获取物料号
         CodeSkuRelationshipVO codeSkuRelationshipVO = codeSkuRelationshipService.checkIsProduct(sn);

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

@@ -203,7 +203,7 @@ public class WcsTaskServiceImpl implements IWcsTaskService {
         if (StringUtils.isEmpty(wcsTask.getExt5())) {
             wcsTask.setExt5("9999");
         }
-        switch (wcsTask.getExt4()) {
+        switch (wcsTask.getExt7()) {
             // 入库 (托盘)
             case "5":
                 // 修改
@@ -214,10 +214,10 @@ public class WcsTaskServiceImpl implements IWcsTaskService {
                 // 修改分配明细为任务完成
                 actAllocationDetailsService.modifyAssignmentTaskStatus(wcsTask.getExt6()
                         ,Long.valueOf(wcsTask.getLocationFrom()), wcsTask.getExt5());
-                // 修改分配明细为拣货完成,备货(没有备货完成)
+                // 修改备货单(1)分配明细为拣货完成
                 actAllocationDetailsService.modifyAssignmentStockTaskStatus(wcsTask.getExt6()
                         ,Long.valueOf(wcsTask.getLocationFrom()), wcsTask.getExt5());
-                // 修改库内理货为拣货完成
+                // 修改库内理货(1)分配明细为拣货完成(2)出库单状态为完成
                 wmsDocOrderHeaderService.modifyTheTallyStatusInTheWarehouse(wcsTask.getExt6()
                         ,Long.valueOf(wcsTask.getLocationFrom()), wcsTask.getExt5());
                 break;

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

@@ -306,7 +306,9 @@
     </delete>
 
     <update id="updateWmsReceivedQty">
-        update wms_doc_asn_details set received_qty = received_qty + #{qty},received_qty_each = received_qty_each + #{qty},line_status = #{asnStatus} where asn_no = #{asnNo} and asn_line_no = #{asnLineNo}
+        update wms_doc_asn_details
+        set received_qty = received_qty + #{qty},received_qty_each = received_qty_each + #{qty},line_status = #{asnStatus}
+        where asn_no = #{asnNo} and asn_line_no = #{asnLineNo}
     </update>
 
     <select id="selectDetailsListByAsnNos" resultMap="WmsDocAsnDetailsResult">
@@ -329,4 +331,4 @@
         order by asn_no,update_time desc
     </select>
 
-</mapper>
+</mapper>