Explorar el Código

入库码盘、分配

andy hace 2 años
padre
commit
9561bbb389

+ 1 - 0
pom.xml

@@ -34,6 +34,7 @@
         <poi.version>4.1.2</poi.version>
         <velocity.version>2.3</velocity.version>
         <jwt.version>0.9.1</jwt.version>
+        <skipTests>true</skipTests>
     </properties>
 	
     <!-- 依赖声明 -->

+ 1 - 1
warewms-ams/src/main/java/com/ruoyi/ams/asn/mapper/WmsDocAsnHeaderMapper.java

@@ -104,5 +104,5 @@ public interface WmsDocAsnHeaderMapper {
      * @param qty
      * @return
      */
-    int updateWmsReceivedQty(@Param("asnNo") String asnNo, @Param("asnLineNo") int asnLineNo, @Param("qty") BigDecimal qty);
+    int updateWmsReceivedQty(@Param("asnNo") String asnNo, @Param("asnLineNo") int asnLineNo, @Param("qty") BigDecimal qty, @Param("asnStatus") String asnStatus);
 }

+ 10 - 6
warewms-ams/src/main/java/com/ruoyi/ams/asn/service/impl/WmsDocAsnHeaderServiceImpl.java

@@ -167,6 +167,7 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
 
     /**
      * 入库码盘
+     *
      * @param stockForm
      * @return
      */
@@ -194,17 +195,20 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
         }
         List<StockInfoForm> stockInfoForms = stockForm.getStockInfoFormList();
         for (StockInfoForm s : stockInfoForms) {
-            BigDecimal count = asnDetailsQtyMap.get(s.getSku());
-            BigDecimal current = currentMap.get(s.getSku());
-            WmsDocAsnDetails ad = asnDetailsMap.get(s.getSku());
-            if (current != null && current.compareTo(count) == 1) {
-                throw new ServiceException(String.format("物料:%s码盘已超出入库单数量", s.getSku()));
+            for (WmsDocAsnDetails w : asnDetails) {
+                if (w.getSku().equals(s.getSku())) {
+                    if (w.getReceivedQty().add(new BigDecimal(s.getQty())).compareTo(w.getExpectedQty()) < 1) {
+
+                    } else {
+                        throw new ServiceException(String.format("物料:%s接收数已超出订单数量",w.getSku()));
+                    }
+                }
             }
             LotattDTO lotattDTO = new LotattDTO();
             lotattDTO.setLotatt07(stockForm.getPalletNo());
             invLotLocIdService.initInv(STAGE01, s.getSku(), Constant.CUSTOMER_ID, new BigDecimal(s.getQty()).doubleValue(), lotattDTO);
 
-            wmsDocAsnHeaderMapper.updateWmsReceivedQty(ad.getAsnNo(), ad.getAsnLineNo().intValue(), new BigDecimal(s.getQty()));
+            //wmsDocAsnHeaderMapper.updateWmsReceivedQty(ad.getAsnNo(), ad.getAsnLineNo().intValue(), new BigDecimal(s.getQty()));
         }
         return null;
     }

+ 28 - 82
warewms-ams/src/main/java/com/ruoyi/ams/order/domain/ActAllocationDetails.java

@@ -1,8 +1,6 @@
 package com.ruoyi.ams.order.domain;
 
 import java.math.BigDecimal;
-import java.util.Date;
-import com.fasterxml.jackson.annotation.JsonFormat;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
@@ -12,17 +10,17 @@ import com.ruoyi.common.core.domain.BaseEntity;
  * 分配查询对象 act_allocation_details
  * 
  * @author ruoyi
- * @date 2022-10-28
+ * @date 2022-10-31
  */
 public class ActAllocationDetails extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
 
-    /** 主键 */
+    /**  */
     private String allocationId;
 
-    /** 出库单号 */
-    @Excel(name = "出库单号")
+    /** 单号 */
+    @Excel(name = "单号")
     private String orderNo;
 
     /** 行号 */
@@ -45,12 +43,12 @@ public class ActAllocationDetails extends BaseEntity
     @Excel(name = "状态")
     private String status;
 
-    /** lotnum */
-    @Excel(name = "lotnum")
+    /** 批次号 */
+    @Excel(name = "批次号")
     private String lotnum;
 
-    /** 拣货数量 */
-    @Excel(name = "拣货数量")
+    /** 分配数量 */
+    @Excel(name = "分配数量")
     private BigDecimal qty;
 
     /** 拣货事务id */
@@ -61,42 +59,26 @@ public class ActAllocationDetails extends BaseEntity
     @Excel(name = "拣货库位")
     private String pickToLocation;
 
-    /** $column.columnComment */
-    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
-    private String createUserId;
-
-    /** $column.columnComment */
-    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
-    private Date createDate;
-
-    /** $column.columnComment */
-    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
-    private String editUserId;
-
-    /** $column.columnComment */
-    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
-    private Date editDate;
+    /** 拣货数量 */
+    @Excel(name = "拣货数量")
+    private BigDecimal pickQty;
 
-    /** $column.columnComment */
-    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    /**  */
+    @Excel(name = "")
     private String userdefine1;
 
-    /** $column.columnComment */
-    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    /**  */
+    @Excel(name = "")
     private String userdefine2;
 
-    /** $column.columnComment */
-    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    /**  */
+    @Excel(name = "")
     private String userdefine3;
 
-    /** $column.columnComment */
-    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    /**  */
+    @Excel(name = "")
     private String userdefine4;
 
-    /** 拣货数量 */
-    @Excel(name = "拣货数量")
-    private BigDecimal pickQty;
-
     public void setAllocationId(String allocationId) 
     {
         this.allocationId = allocationId;
@@ -196,41 +178,14 @@ public class ActAllocationDetails extends BaseEntity
     {
         return pickToLocation;
     }
-    public void setCreateUserId(String createUserId) 
-    {
-        this.createUserId = createUserId;
-    }
-
-    public String getCreateUserId() 
-    {
-        return createUserId;
-    }
-    public void setCreateDate(Date createDate) 
-    {
-        this.createDate = createDate;
-    }
-
-    public Date getCreateDate() 
-    {
-        return createDate;
-    }
-    public void setEditUserId(String editUserId) 
-    {
-        this.editUserId = editUserId;
-    }
-
-    public String getEditUserId() 
-    {
-        return editUserId;
-    }
-    public void setEditDate(Date editDate) 
+    public void setPickQty(BigDecimal pickQty) 
     {
-        this.editDate = editDate;
+        this.pickQty = pickQty;
     }
 
-    public Date getEditDate() 
+    public BigDecimal getPickQty() 
     {
-        return editDate;
+        return pickQty;
     }
     public void setUserdefine1(String userdefine1) 
     {
@@ -268,15 +223,6 @@ public class ActAllocationDetails extends BaseEntity
     {
         return userdefine4;
     }
-    public void setPickQty(BigDecimal pickQty) 
-    {
-        this.pickQty = pickQty;
-    }
-
-    public BigDecimal getPickQty() 
-    {
-        return pickQty;
-    }
 
     @Override
     public String toString() {
@@ -292,15 +238,15 @@ public class ActAllocationDetails extends BaseEntity
             .append("qty", getQty())
             .append("pickTransactionId", getPickTransactionId())
             .append("pickToLocation", getPickToLocation())
-            .append("createUserId", getCreateUserId())
-            .append("createDate", getCreateDate())
-            .append("editUserId", getEditUserId())
-            .append("editDate", getEditDate())
+            .append("pickQty", getPickQty())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
             .append("userdefine1", getUserdefine1())
             .append("userdefine2", getUserdefine2())
             .append("userdefine3", getUserdefine3())
             .append("userdefine4", getUserdefine4())
-            .append("pickQty", getPickQty())
             .toString();
     }
 }

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

@@ -363,6 +363,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <update id="updateWmsReceivedQty">
-        update wms_doc_asn_details set received_qty += #{qty} where asn_no = #{asnNo} and asn_line_no = #{asnLineNo}
+        update wms_doc_asn_details set received_qty += #{qty},asn_status = #{asnStatus} where asn_no = #{asnNo} and asn_line_no = #{asnLineNo}
     </update>
 </mapper>

+ 30 - 39
warewms-ams/src/main/resources/mapper/docOrder/ActAllocationDetailsMapper.xml

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.ams.order.mapper.ActAllocationDetailsMapper">
-    
+
     <resultMap type="ActAllocationDetails" id="ActAllocationDetailsResult">
         <result property="allocationId"    column="allocation_id"    />
         <result property="orderNo"    column="order_no"    />
@@ -16,41 +16,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="qty"    column="qty"    />
         <result property="pickTransactionId"    column="pick_transaction_id"    />
         <result property="pickToLocation"    column="pick_to_location"    />
-        <result property="createUserId"    column="create_user_id"    />
-        <result property="createDate"    column="create_date"    />
-        <result property="editUserId"    column="edit_user_id"    />
-        <result property="editDate"    column="edit_date"    />
+        <result property="pickQty"    column="pick_qty"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
         <result property="userdefine1"    column="userdefine1"    />
         <result property="userdefine2"    column="userdefine2"    />
         <result property="userdefine3"    column="userdefine3"    />
         <result property="userdefine4"    column="userdefine4"    />
-        <result property="pickQty"    column="pick_qty"    />
     </resultMap>
 
     <sql id="selectActAllocationDetailsVo">
-        select allocation_id, order_no, line_no, material, location_id, call_transaction_id, status, lotnum, qty, pick_transaction_id, pick_to_location, create_user_id, create_date, edit_user_id, edit_date, userdefine1, userdefine2, userdefine3, userdefine4, pick_qty from act_allocation_details
+        select allocation_id, order_no, line_no, material, location_id, call_transaction_id, status, lotnum, qty, pick_transaction_id, pick_to_location, pick_qty, create_by, create_time, update_by, update_time, userdefine1, userdefine2, userdefine3, userdefine4 from act_allocation_details
     </sql>
 
     <select id="selectActAllocationDetailsList" parameterType="ActAllocationDetails" resultMap="ActAllocationDetailsResult">
         <include refid="selectActAllocationDetailsVo"/>
-        <where>  
-            <if test="allocationId != null  and allocationId != ''"> and allocation_id = #{allocationId}</if>
-            <if test="orderNo != null  and orderNo != ''"> and order_no like concat('%', #{orderNo}, '%')</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
-            <if test="params.beginTime != null and params.beginTime != ''">
-                AND date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
-            </if>
-            <if test="params.endTime != null and params.endTime != ''">
-                AND date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
-            </if>
+        <where>
         </where>
     </select>
-    
+
     <select id="selectActAllocationDetailsByAllocationId" parameterType="String" resultMap="ActAllocationDetailsResult">
         <include refid="selectActAllocationDetailsVo"/>
         where allocation_id = #{allocationId}
     </select>
-        
+
     <insert id="insertActAllocationDetails" parameterType="ActAllocationDetails">
         insert into act_allocation_details
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -65,16 +56,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="qty != null">qty,</if>
             <if test="pickTransactionId != null">pick_transaction_id,</if>
             <if test="pickToLocation != null">pick_to_location,</if>
-            <if test="createUserId != null">create_user_id,</if>
-            <if test="createDate != null">create_date,</if>
-            <if test="editUserId != null">edit_user_id,</if>
-            <if test="editDate != null">edit_date,</if>
+            <if test="pickQty != null">pick_qty,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
             <if test="userdefine1 != null">userdefine1,</if>
             <if test="userdefine2 != null">userdefine2,</if>
             <if test="userdefine3 != null">userdefine3,</if>
             <if test="userdefine4 != null">userdefine4,</if>
-            <if test="pickQty != null">pick_qty,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="allocationId != null">#{allocationId},</if>
             <if test="orderNo != null and orderNo != ''">#{orderNo},</if>
@@ -87,16 +78,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="qty != null">#{qty},</if>
             <if test="pickTransactionId != null">#{pickTransactionId},</if>
             <if test="pickToLocation != null">#{pickToLocation},</if>
-            <if test="createUserId != null">#{createUserId},</if>
-            <if test="createDate != null">#{createDate},</if>
-            <if test="editUserId != null">#{editUserId},</if>
-            <if test="editDate != null">#{editDate},</if>
+            <if test="pickQty != null">#{pickQty},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
             <if test="userdefine1 != null">#{userdefine1},</if>
             <if test="userdefine2 != null">#{userdefine2},</if>
             <if test="userdefine3 != null">#{userdefine3},</if>
             <if test="userdefine4 != null">#{userdefine4},</if>
-            <if test="pickQty != null">#{pickQty},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateActAllocationDetails" parameterType="ActAllocationDetails">
@@ -112,15 +103,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="qty != null">qty = #{qty},</if>
             <if test="pickTransactionId != null">pick_transaction_id = #{pickTransactionId},</if>
             <if test="pickToLocation != null">pick_to_location = #{pickToLocation},</if>
-            <if test="createUserId != null">create_user_id = #{createUserId},</if>
-            <if test="createDate != null">create_date = #{createDate},</if>
-            <if test="editUserId != null">edit_user_id = #{editUserId},</if>
-            <if test="editDate != null">edit_date = #{editDate},</if>
+            <if test="pickQty != null">pick_qty = #{pickQty},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="userdefine1 != null">userdefine1 = #{userdefine1},</if>
             <if test="userdefine2 != null">userdefine2 = #{userdefine2},</if>
             <if test="userdefine3 != null">userdefine3 = #{userdefine3},</if>
             <if test="userdefine4 != null">userdefine4 = #{userdefine4},</if>
-            <if test="pickQty != null">pick_qty = #{pickQty},</if>
         </trim>
         where allocation_id = #{allocationId}
     </update>
@@ -130,7 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteActAllocationDetailsByAllocationIds" parameterType="String">
-        delete from act_allocation_details where allocation_id in 
+        delete from act_allocation_details where allocation_id in
         <foreach item="allocationId" collection="array" open="(" separator="," close=")">
             #{allocationId}
         </foreach>