فهرست منبع

PDA托盘出库测试修改

k 2 سال پیش
والد
کامیت
d57fe3af13

+ 23 - 13
warewms-ams/src/main/java/com/ruoyi/ams/order/service/impl/WmsDocOrderHeaderServiceImpl.java

@@ -284,7 +284,8 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
             return AjaxResult.error("没有查询到订单");
         }
         if (!orderHeader.getOrderStatus().equals(Constant.ORDER_STS.STS00.getValue())
-                && !orderHeader.getOrderStatus().equals(Constant.ORDER_STS.STS10.getValue())){
+                && !orderHeader.getOrderStatus().equals(Constant.ORDER_STS.STS10.getValue())
+                && !orderHeader.getOrderStatus().equals(Constant.ORDER_STS.STS22.getValue())){
             return AjaxResult.success("出库单状态不可分配!");
         }
 
@@ -374,7 +375,9 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         // 筛选出没有被分配过的库存
         List<InvLotLocIdForm> invList = invListAll.stream().filter(v -> {
             if (StringUtils.isEmpty(v.getLotatt15()) || orderNo.equals(v.getLotatt15())) {
-                return true;
+                if (StringUtils.isEmpty(v.getLotatt14())) {
+                    return true;
+                }
             }
             return false;
         }).collect(Collectors.toList());
@@ -403,7 +406,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
                         //可以分配的库存
                         BigDecimal allocatedQty = inv.getQty().subtract(inv.getQtyallocated());
                         inv.setQtyallocated(inv.getQtyallocated().add(allocatedQty));
-                        inv.setQtyallocatedEach(inv.getQtyallocatedEach().add(allocatedQty));
+                        inv.setQtyallocatedEach(inv.getQtyallocated());
                         if (invLotLocIdService.updateInvLotLocId(inv) > 0) {
                             orderQty = orderQty.subtract(allocatedQty);
                             //修改出库单状态
@@ -424,7 +427,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
                         //可以分配的库存
                         BigDecimal allocatedQty = inv.getQty().subtract(inv.getQtyallocated());
                         inv.setQtyallocated(inv.getQtyallocated().add(allocatedQty));
-                        inv.setQtyallocatedEach(inv.getQtyallocatedEach().add(allocatedQty));
+                        inv.setQtyallocatedEach(inv.getQtyallocated());
                         if (invLotLocIdService.updateInvLotLocId(inv) > 0) {
                             orderQty = orderQty.subtract(allocatedQty);
                             //修改出库单状态
@@ -445,7 +448,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
                     } else {
                         BigDecimal currentQty = orderQty;
                         inv.setQtyallocated(inv.getQtyallocated().add(currentQty));
-                        inv.setQtyallocatedEach(inv.getQtyallocatedEach().add(currentQty));
+                        inv.setQtyallocatedEach(inv.getQtyallocated());
                         if (invLotLocIdService.updateInvLotLocId(inv) > 0) {
                             //修改出库单状态
                             details.setLineStatus(Constant.ORDER_STS.STS20.getValue());
@@ -492,7 +495,9 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         // 筛选出没有被分配过的库存
         List<InvLotLocIdForm> invList = invListAll.stream().filter(v -> {
             if (StringUtils.isEmpty(v.getLotatt15()) || orderNo.equals(v.getLotatt15())) {
-                return true;
+                if (StringUtils.isEmpty(v.getLotatt14())) {
+                    return true;
+                }
             }
             return false;
         }).collect(Collectors.toList());
@@ -522,7 +527,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
                         //可以分配的库存
                         BigDecimal allocatedQty = inv.getQty().subtract(inv.getQtyallocated());
                         inv.setQtyallocated(inv.getQtyallocated().add(allocatedQty));
-                        inv.setQtyallocatedEach(inv.getQtyallocatedEach().add(allocatedQty));
+                        inv.setQtyallocatedEach(inv.getQtyallocated());
                         if (invLotLocIdService.updateInvLotLocId(inv) > 0) {
                             orderQty = orderQty.subtract(allocatedQty);
                             //修改出库单状态
@@ -543,7 +548,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
                         //可以分配的库存
                         BigDecimal allocatedQty = inv.getQty().subtract(inv.getQtyallocated());
                         inv.setQtyallocated(inv.getQtyallocated().add(allocatedQty));
-                        inv.setQtyallocatedEach(inv.getQtyallocatedEach().add(allocatedQty));
+                        inv.setQtyallocatedEach(inv.getQtyallocated());
                         if (invLotLocIdService.updateInvLotLocId(inv) > 0) {
                             orderQty = orderQty.subtract(allocatedQty);
                             //修改出库单状态
@@ -564,7 +569,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
                     } else {
                         BigDecimal currentQty = orderQty;
                         inv.setQtyallocated(inv.getQtyallocated().add(currentQty));
-                        inv.setQtyallocatedEach(inv.getQtyallocatedEach().add(currentQty));
+                        inv.setQtyallocatedEach(inv.getQtyallocated());
                         if (invLotLocIdService.updateInvLotLocId(inv) > 0) {
                             //修改出库单状态
                             details.setLineStatus(Constant.ORDER_STS.STS20.getValue());
@@ -762,10 +767,10 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
                 invLocIdSearchFrom.setLotatt15(orderNo);
             }
             List<InvLotLocIdLotattVO> invLotLocIdLotattVOS = invLotLocIdService.selectInvLocIdLotattList(invLocIdSearchFrom);
-            invLotLocIdLotattVOS.forEach(v->{
+            for (InvLotLocIdLotattVO v : invLotLocIdLotattVOS) {
                 if (v.getStockStatus().equals(Constant.STOCK_STATUS.STOCK00.getValue())
                         && v.getIsEmpty().equals(Constant.IS_YES.N.name())
-                        &&v.getZoneId().equals(Constant.ZONE_TYPE.ZONE_INV.getValue())) {
+                        &&v.getZoneId().equals(Constant.ZONE_TYPE.ZONE_INV.getValue().toString())) {
                     if (!locationSet.contains(v.getLocationNo())) {
                         CheckOutVO checkOutVO = new CheckOutVO();
                         checkOutVO.setOrderNo(wmsDocOrderHeader.getSoReference1());
@@ -775,7 +780,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
                         locationSet.add(v.getLocationNo());
                     }
                 }
-            });
+            }
         }
         return endCheckOutVOList;
 //        return wmsDocOrderHeaderMapper.selectCheckOutList(orderNoList);
@@ -786,6 +791,11 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
     public AjaxResult doCheckout(CheckOutInfoForm check) {
         String orderNo = check.getOrderNo();
         String palletNo = check.getPalletNo();
+        // 验证出库单号
+        WmsDocOrderHeader wmsDocOrderHeader = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByErpNo(orderNo);
+        if (wmsDocOrderHeader == null) {
+            return AjaxResult.error("对应出库单号不存在!");
+        }
         //生成任务呼叫到接驳位
         BaseLocationInfo baseLocationInfo = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(check.getLocationNo(), Constant.WAREHOUSE_ID);
         FlowConfigHeaderVO flowConfigHeaderVO = flowConfigHeaderService.selectFlowConfigHeaderById((long)Constant.FLOW_ID_SO);
@@ -797,7 +807,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         agvCallDTO.setWarehouseId(Constant.WAREHOUSE_ID);
         // 参数内容过长无法添加
         agvCallDTO.setExtParam("");
-        agvCallDTO.setOrderNo(orderNo);
+        agvCallDTO.setOrderNo(wmsDocOrderHeader.getOrderNo());
         agvCallDTO.setTaskType(Constant.FLOW_ID_SO + "");
         AjaxResult result = businessService.agvCall(flowConfigHeaderVO, agvCallDTO);
         if ((int) result.get(AjaxResult.CODE_TAG) == 500) {

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

@@ -513,8 +513,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="queryInvOrderBy" parameterType="object" resultType="invLotLocIdForm">
-        select inv.*
-             ,att.lotatt01,att.lotatt02,att.lotatt03,att.lotatt04,att.lotatt05,att.lotatt06,att.lotatt07,att.lotatt08,att.lotatt09
+        select inv.lotnum, inv.location_id locationId, inv.traceid, inv.customer_id customerId
+             , inv.sku, inv.qty, inv.qty_each qtyEach, inv.qtyallocated, inv.qtyallocated_each qtyallocatedEach
+            ,att.lotatt01,att.lotatt02,att.lotatt03,att.lotatt04,att.lotatt05,att.lotatt06,att.lotatt07,att.lotatt08,att.lotatt09
              ,att.lotatt10,att.lotatt11,att.lotatt12,att.lotatt13,att.lotatt14,att.lotatt15,att.lotatt16,att.lotatt17,att.lotatt18
         from inv_lot_loc_id inv
         left join base_location_info b on inv.location_id = b.id
@@ -546,7 +547,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </if>
             and b.stock_status = '00' and b.zone_id = '2'
         </where>
-        order by inv.qty,att.create_time,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
+        order by att.create_time,lpad(b.row_no, 11, '0'),b.row_index,lpad(b.shift_no, 11, '0'),b.shift_index,lpad(b.col_no, 11, '0'),b.col_index desc
     </select>
 
     <select id="queryInvByInvLotatt" resultMap="InvLotLocIdResult">