Browse Source

测试修改

k 2 years ago
parent
commit
106a8143f3

+ 40 - 31
warewms-ams/src/main/java/com/ruoyi/ams/inv/domain/InvLotLocId.java

@@ -8,7 +8,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
 
 /**
  * 库位库存信息对象 inv_lot_loc_id
- * 
+ *
  * @author andy
  * @date 2022-03-03
  */
@@ -18,6 +18,7 @@ public class InvLotLocId extends BaseEntity
 
     /** 批次号 */
     private String lotnum;
+    private String lotnumTo;
 
     /** 库位 */
     private String locationId;
@@ -72,138 +73,146 @@ public class InvLotLocId extends BaseEntity
     @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
     private BigDecimal qtyonhold;
 
-    public void setLotnum(String lotnum) 
+    public void setLotnum(String lotnum)
     {
         this.lotnum = lotnum;
     }
 
-    public String getLotnum() 
+    public String getLotnum()
     {
         return lotnum;
     }
-    public void setLocationId(String locationId) 
+    public void setLocationId(String locationId)
     {
         this.locationId = locationId;
     }
 
-    public String getLocationId() 
+    public String getLotnumTo() {
+        return lotnumTo;
+    }
+
+    public void setLotnumTo(String lotnumTo) {
+        this.lotnumTo = lotnumTo;
+    }
+
+    public String getLocationId()
     {
         return locationId;
     }
-    public void setTraceid(String traceid) 
+    public void setTraceid(String traceid)
     {
         this.traceid = traceid;
     }
 
-    public String getTraceid() 
+    public String getTraceid()
     {
         return traceid;
     }
-    public void setCustomerId(String customerId) 
+    public void setCustomerId(String customerId)
     {
         this.customerId = customerId;
     }
 
-    public String getCustomerId() 
+    public String getCustomerId()
     {
         return customerId;
     }
-    public void setSku(String sku) 
+    public void setSku(String sku)
     {
         this.sku = sku;
     }
 
-    public String getSku() 
+    public String getSku()
     {
         return sku;
     }
-    public void setQty(BigDecimal qty) 
+    public void setQty(BigDecimal qty)
     {
         this.qty = qty;
     }
 
-    public BigDecimal getQty() 
+    public BigDecimal getQty()
     {
         return qty;
     }
-    public void setQtyEach(BigDecimal qtyEach) 
+    public void setQtyEach(BigDecimal qtyEach)
     {
         this.qtyEach = qtyEach;
     }
 
-    public BigDecimal getQtyEach() 
+    public BigDecimal getQtyEach()
     {
         return qtyEach;
     }
-    public void setQtyallocated(BigDecimal qtyallocated) 
+    public void setQtyallocated(BigDecimal qtyallocated)
     {
         this.qtyallocated = qtyallocated;
     }
 
-    public BigDecimal getQtyallocated() 
+    public BigDecimal getQtyallocated()
     {
         return qtyallocated;
     }
-    public void setQtyallocatedEach(BigDecimal qtyallocatedEach) 
+    public void setQtyallocatedEach(BigDecimal qtyallocatedEach)
     {
         this.qtyallocatedEach = qtyallocatedEach;
     }
 
-    public BigDecimal getQtyallocatedEach() 
+    public BigDecimal getQtyallocatedEach()
     {
         return qtyallocatedEach;
     }
-    public void setQtypa(BigDecimal qtypa) 
+    public void setQtypa(BigDecimal qtypa)
     {
         this.qtypa = qtypa;
     }
 
-    public BigDecimal getQtypa() 
+    public BigDecimal getQtypa()
     {
         return qtypa;
     }
-    public void setQtyrpin(BigDecimal qtyrpin) 
+    public void setQtyrpin(BigDecimal qtyrpin)
     {
         this.qtyrpin = qtyrpin;
     }
 
-    public BigDecimal getQtyrpin() 
+    public BigDecimal getQtyrpin()
     {
         return qtyrpin;
     }
-    public void setQtyrpout(BigDecimal qtyrpout) 
+    public void setQtyrpout(BigDecimal qtyrpout)
     {
         this.qtyrpout = qtyrpout;
     }
 
-    public BigDecimal getQtyrpout() 
+    public BigDecimal getQtyrpout()
     {
         return qtyrpout;
     }
-    public void setQtymvin(BigDecimal qtymvin) 
+    public void setQtymvin(BigDecimal qtymvin)
     {
         this.qtymvin = qtymvin;
     }
 
-    public BigDecimal getQtymvin() 
+    public BigDecimal getQtymvin()
     {
         return qtymvin;
     }
-    public void setQtymvout(BigDecimal qtymvout) 
+    public void setQtymvout(BigDecimal qtymvout)
     {
         this.qtymvout = qtymvout;
     }
 
-    public BigDecimal getQtymvout() 
+    public BigDecimal getQtymvout()
     {
         return qtymvout;
     }
-    public void setQtyonhold(BigDecimal qtyonhold) 
+    public void setQtyonhold(BigDecimal qtyonhold)
     {
         this.qtyonhold = qtyonhold;
     }
 
-    public BigDecimal getQtyonhold() 
+    public BigDecimal getQtyonhold()
     {
         return qtyonhold;
     }

+ 0 - 1
warewms-ams/src/main/java/com/ruoyi/ams/inv/domain/form/InvLotLocIdForm.java

@@ -30,5 +30,4 @@ public class InvLotLocIdForm extends InvLotLocId {
     private String lotatt17;
     private String lotatt18;
 
-    private String lotnumTo;
 }

+ 2 - 1
warewms-ams/src/main/java/com/ruoyi/ams/inv/mapper/InvLotLocIdMapper.java

@@ -150,7 +150,8 @@ public interface InvLotLocIdMapper {
      * @param lotnum
      * @return
      */
-    int deleteInvLotLocIdByPrimaryKey(String locationId, String customerId, String sku, String lotnum);
+    int deleteInvLotLocIdByPrimaryKey(@Param("locationId")String locationId, @Param("customerId")String customerId
+            , @Param("sku")String sku, @Param("lotnum")String lotnum);
 
     /**
      * 更新起始库位库存至目标库位

+ 7 - 2
warewms-ams/src/main/java/com/ruoyi/ams/inv/service/impl/InvLotLocIdServiceImpl.java

@@ -743,11 +743,16 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
             deleteInvLotLocIdById(baseLocationInfo.getId());
         }
 
+        adjLocationIsEmpty(locationFrom, Constant.WAREHOUSE_ID, updateBy);
+
         //修改托盘库位绑定关系
         WmsBoxInfo wmsBoxInfo = iWmsBoxInfoService.selectByLocationId(String.valueOf(baseLocationInfo.getId()));
-        iWmsBoxInfoService.updateLocationBind(baseLocationInfo.getId(), Constant.LOC_SORTATION_CACHE, wmsBoxInfo.getIsFull());
+        if(wmsBoxInfo!=null) {
+            iWmsBoxInfoService.updateLocationBind(baseLocationInfo.getId(), Constant.LOC_SORTATION_CACHE
+                    , wmsBoxInfo.getIsFull() == null?"":wmsBoxInfo.getIsFull());
+        }
 
         //释放库位状态
-        return adjLocationIsEmpty(locationFrom, Constant.WAREHOUSE_ID, updateBy);
+        return AjaxResult.success("操作成功");
     }
 }

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

@@ -12,5 +12,5 @@ public class PickForm {
     @NotEmpty(message = "条码不能为空")
     private String sn;
     @NotEmpty(message = "数量不能为空")
-    private Double qty;
+    private String qty;
 }

+ 20 - 0
warewms-ams/src/main/java/com/ruoyi/ams/order/service/impl/ActAllocationDetailsServiceImpl.java

@@ -7,6 +7,8 @@ import com.ruoyi.ams.box.domain.WmsBoxInfo;
 import com.ruoyi.ams.box.service.IWmsBoxInfoService;
 import com.ruoyi.ams.order.domain.WmsDocOrderDetails;
 import com.ruoyi.ams.order.form.ActAllocationDetailsFrom;
+import com.ruoyi.ams.qc.domain.DocQcDetails;
+import com.ruoyi.base.constant.Constant;
 import com.ruoyi.base.domain.BaseLocationInfo;
 import com.ruoyi.base.service.IBaseLocationInfoService;
 import com.ruoyi.base.utils.IdSequenceUtils;
@@ -149,6 +151,24 @@ public class ActAllocationDetailsServiceImpl implements IActAllocationDetailsSer
     @Override
     public AjaxResult addActAllocationDetails(String lotnum, String locationId, BigDecimal qty, WmsDocOrderDetails orderDetails, String status) {
         WmsBoxInfo wmsBoxInfo = wmsBoxInfoService.selectByLocationId(locationId);
+        // 查询分配明细 有就修改 没有新增
+        ActAllocationDetailsFrom actAllocationDetailsFrom = new ActAllocationDetailsFrom();
+        actAllocationDetailsFrom.setLotnum(lotnum);
+        actAllocationDetailsFrom.setOrderNo(orderDetails.getOrderNo());
+        actAllocationDetailsFrom.setLineNo(orderDetails.getOrderLineNo().longValue());
+        actAllocationDetailsFrom.setLocationId(Long.parseLong(locationId));
+        actAllocationDetailsFrom.setMaterial(orderDetails.getSku());
+        List<ActAllocationDetailsFrom> allocationDetailsFromList = actAllocationDetailsMapper.selectActAllocationDetailsInvLotAttList(actAllocationDetailsFrom);
+        if (allocationDetailsFromList.size() > 0) {
+            for (ActAllocationDetailsFrom allocationDetailsFrom : allocationDetailsFromList) {
+                ActAllocationDetails allocationDetailsUpdate = new ActAllocationDetails();
+                allocationDetailsUpdate.setAllocationId(allocationDetailsFrom.getAllocationId());
+                allocationDetailsUpdate.setStatus(Constant.ORDER_STS.STS20.getValue());
+                actAllocationDetailsMapper.updateActAllocationDetails(allocationDetailsUpdate);
+            }
+            return AjaxResult.success("分配明细生成成功");
+        }
+
         String allocationId = idSequenceUtils.generateId("ANO");
         ActAllocationDetails actAllocationDetails = new ActAllocationDetails();
         actAllocationDetails.setAllocationId(allocationId);

+ 9 - 4
warewms-ams/src/main/java/com/ruoyi/ams/order/service/impl/WmsDocOrderHeaderServiceImpl.java

@@ -559,6 +559,9 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         // 二次组盘查询不到
         if (pickingListVOS.size() == 0) {
             InvLocIdSearchFrom invLocIdSearchFrom = new InvLocIdSearchFrom();
+            LotattDTO lotattDTO = new LotattDTO();
+            lotattDTO.setLotatt07(palletNo);
+            invLocIdSearchFrom.setLotattDTO(lotattDTO);
             List<InvLotLocIdLotattVO> invLotLocIdLotattVOList = invLotLocIdService.selectInvLocIdLotattList(invLocIdSearchFrom);
             for (InvLotLocIdLotattVO locIdLotattVO : invLotLocIdLotattVOList) {
                 PickingListVO pickingListVO = new PickingListVO();
@@ -586,7 +589,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         ActAllocationDetailsFrom actAllocationQuery = new ActAllocationDetailsFrom();
         actAllocationQuery.setOrderNo(orderNo);
         actAllocationQuery.setLotatt02(sn);
-        actAllocationQuery.setStatus(Constant.ORDER_STS.STS20.getValue());
+        actAllocationQuery.setStatus(Constant.ORDER_STS.STS21.getValue());
         actAllocationDetailsFromList = actAllocationDetailsService.selectActAllocationDetailsInvLotAttList(actAllocationQuery);
         if (actAllocationDetailsFromList.size() == 0) {
             actAllocationQuery.setStatus(Constant.ORDER_STS.STS30.getValue());
@@ -602,7 +605,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
                 .stream()
                 .filter(v -> {
                     BigDecimal canPickNum = v.getQty().subtract(v.getPickQty());
-                    return canPickNum.compareTo(qty) == 1;
+                    return canPickNum.compareTo(qty) == 0;
                 }).collect(Collectors.toList());
         // 大于拣货数量的明细
         List<ActAllocationDetailsFrom> greaterAllocationList = new ArrayList<>();
@@ -611,7 +614,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
                     .stream()
                     .filter(v -> {
                         BigDecimal canPickNum = v.getQty().subtract(v.getPickQty());
-                        return canPickNum.compareTo(qty) == 0;
+                        return canPickNum.compareTo(qty) == 1;
                     }).collect(Collectors.toList());
             if (greaterAllocationList.size() > 0) {
                 endActAllocation = greaterAllocationList.get(0);
@@ -633,7 +636,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         actAllocationDetailsService.updateActAllocationDetails(allocationUpdate);
         // 更新库存数量
         String lotnum = endActAllocation.getLotnum();
-        Long locationId = endActAllocation.getLocationId();
+        Long locationId = Constant.LOC_SORTATION_CACHE;
         String sku = endActAllocation.getMaterial();
         String customerId = Constant.CUSTOMER_ID;
         InvLotLocId invLotLocId = invLotLocIdService.selectInvLotLocIdById(locationId.toString(), customerId, sku, lotnum);
@@ -653,6 +656,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
             wmsDocOrderDetails.setLineStatus(Constant.ORDER_STS.STS40.getValue());
         }
         wmsDocOrderDetailsMapper.updateWmsDocOrderDetails(wmsDocOrderDetails);
+        // todo 更新头单
         return AjaxResult.success("拣货成功");
     }
 
@@ -708,6 +712,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
                 wmsDocOrderDetails.setLineStatus(Constant.ORDER_STS.STS99.getValue());
                 wmsDocOrderDetailsMapper.updateWmsDocOrderDetails(wmsDocOrderDetails);
             }
+            // todo 分配明细为拣货完成
         }
         // 备货 修改出库单为备货状态
 //            if (header != null && header.getOrderType().equals(Constant.ORDER_TYP.BH.getValue())) {

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

@@ -378,7 +378,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         delete from inv_lot_loc_id where location_id = #{locationId}
     </delete>
 
-    <delete id="deleteInvLotLocIdByPrimaryKey" parameterType="Long">
+    <delete id="deleteInvLotLocIdByPrimaryKey" parameterType="object">
         delete from inv_lot_loc_id
         where lotnum = #{lotnum}
           and location_id = #{locationId}

+ 7 - 4
warewms-ams/src/main/resources/mapper/docOrder/ActAllocationDetailsMapper.xml

@@ -141,9 +141,11 @@
         left join inv_lot_att t2 ON t2.lotnum = t1.lotnum
         <where>
             <if test="allocationId != null  and allocationId != ''"> and allocation_id = #{allocationId}</if>
+            <if test="locationId != null  and locationId != ''"> and location_id = #{locationId}</if>
             <if test="orderNo != null  and orderNo != ''"> and order_no = #{orderNo}</if>
+            <if test="lineNo != null  and lineNo != ''"> and line_no = #{lineNo}</if>
             <if test="material != null  and material != ''"> and material = #{material}</if>
-            <if test="lotnum != null  and lotnum != ''"> and lotnum = #{lotnum}</if>
+            <if test="lotnum != null  and lotnum != ''"> and t1.lotnum = #{lotnum}</if>
             <if test="userdefine1 != null  and userdefine1 != ''"> and userdefine1 = #{userdefine1}</if>
             <if test="status != null  and status != ''"> and status = #{status}</if>
             <if test="lotatt01 != null  and lotatt01 != ''"> and lotatt01 = #{lotatt01}</if>
@@ -255,9 +257,10 @@
     </select>
 
     <select id="queryAllocationDetailsToPickByPalletNo" parameterType="String" resultMap="ActAllocationDetailsResult">
-        select al.*
-        from act_allocation_details al
-        where al.userdefine1 = #{palletNo} and status = '21'
+        select t1.*
+        from act_allocation_details t1
+        left join inv_lot_att t2 on t2.lotnum = t1.lotnum
+        where t2.lotatt07 = #{palletNo} and t1.`status` = '21'
     </select>
 
     <select id="queryAllocationDetailsByOrderNo" parameterType="String" resultMap="ActAllocationDetailsResult">