Browse Source

【BUG编号无】【采购验收转验退转单报错问题,销售出货、退货收款状态默认赋值】

rainco 7 years ago
parent
commit
6fa5bcb0c2

+ 5 - 5
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java

@@ -425,14 +425,14 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     public Result turnProdOut(Long id) {
         ProdInOut sourcePi = getMapper().selectByPrimaryKey(id);
         Integer count=0;
-        double pdInqty=0, pdYqty=0;
+        double pdInqty=0.0, pdYqty=0.0;
         Long userId = BaseContextHolder.getUserId();
         String userName = BaseContextHolder.getUserName();
         List<ProdIODetail> sourcePids =prodIODetailMapper.selectByFK(id);
         //检查从表
         for (ProdIODetail prodIODetail : sourcePids) {
-            pdInqty = prodIODetail.getPd_inqty();
-            pdYqty = prodIODetail.getPd_yqty();
+            pdInqty = prodIODetail.getPd_inqty() == null ? 0.0 : prodIODetail.getPd_inqty();
+            pdYqty = prodIODetail.getPd_yqty() == null ? 0.0 : prodIODetail.getPd_yqty();
             if (pdInqty-pdYqty>0){
                 count++;
             }
@@ -458,8 +458,8 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         targetPi.setPi_ioid(sourcePi.getId());
         targetPi.setPi_iocode(sourcePi.getPi_inoutno());
         //设置付款状态
-        targetPi.setPi_prstatus(Status.RECNONE.getDisplay());
-        targetPi.setPi_prstatuscode(Status.RECNONE.name());
+        targetPi.setPi_prstatus(Status.PAYNONE.getDisplay());
+        targetPi.setPi_prstatuscode(Status.PAYNONE.name());
         //设置公司id
         targetPi.setCompanyId(sourcePi.getCompanyId());
         targetPi.setCreateTime(new Date());

+ 1 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java

@@ -475,6 +475,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                 prodIODetail.setUpdaterId(userId);
                 prodIODetail.setUpdateTime(new Date());
                 prodIODetail.setUpdaterName(userName);
+                prodIODetail.setPd_yqty(0.0);
                 //本次转单数
                 prodIODetail.setPd_inqty(pdQty-pdYqty);
                 prodIODetailMapper.insertSelective(prodIODetail);

+ 4 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdInOutDTO.java

@@ -72,4 +72,8 @@ public class ProdInOutDTO extends CommonBaseDTO implements Serializable {
     private String pi_auditman;
 
     private Date pi_auditdate;
+
+    private String pi_prstatuscode;
+
+    private String pi_prstatus;
 }

+ 4 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/ProdInOutListDTO.java

@@ -132,4 +132,8 @@ public class ProdInOutListDTO extends CommonBaseDTO implements Serializable {
     private String pd_remark;
 
     private String pi_remark;
+
+    private String pi_prstatus;
+
+    private String pi_prstatuscode;
 }

+ 6 - 1
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java

@@ -109,8 +109,10 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         prodInOut.setPi_class(main.getPi_class());
         prodInOut.setPi_said(main.getPi_said());
         prodInOut.setPi_sacode(main.getPi_sacode());
-
         prodInOut.setPi_remark(main.getPi_remark());
+
+        prodInOut.setPi_prstatus(prodInOut.getPi_prstatus()==null?Status.RECNONE.getDisplay():prodInOut.getPi_prstatus() );
+        prodInOut.setPi_prstatuscode(prodInOut.getPi_printstatuscode()==null?Status.RECNONE.name():prodInOut.getPi_printstatuscode());
         //判断更新与保存动作
         if (StringUtils.isEmpty(pi_id) || "0".equals(pi_id.toString())){
             //插入操作
@@ -476,6 +478,9 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         targetPi.setPi_said(sourcePi.getPi_said());
         targetPi.setPi_sacode(sourcePi.getPi_sacode());
         targetPi.setPi_address(sourcePi.getPi_address());
+        //收款状态
+        targetPi.setPi_prstatus(Status.PAYNONE.getDisplay());
+        targetPi.setPi_prstatuscode(Status.PAYNONE.name());
         //保存数据
         getMapper().insertSelective(targetPi);
         //插入销售退货单从表

+ 4 - 1
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java

@@ -163,6 +163,7 @@ public class SaleServiceImpl implements SaleService{
                 detail.setCreatorId(userId);
                 detail.setCreatorName(BaseContextHolder.getUserName());
                 detail.setCreateTime(new Date());
+                detail.setSd_yqty(0.0);
                 insertDetails.add(detail);
             } else {
                 updateDetails.add(detail);
@@ -432,7 +433,7 @@ public class SaleServiceImpl implements SaleService{
 
         //检查从表
         for (SaleDetail detail : details) {
-            pdQty = detail.getSd_qty();
+            pdQty = detail.getSd_qty()==null?0.0:detail.getSd_qty();
             pdYqty = detail.getSd_yqty() == null ? 0 : detail.getSd_yqty();
             if (pdQty - pdYqty > 0){
                 count++;
@@ -463,6 +464,8 @@ public class SaleServiceImpl implements SaleService{
         prodInOut.setCompanyId(companyId);
         prodInOut.setPi_address(sale.getSa_toplace());
 
+        prodInOut.setPi_prstatus(Status.RECNONE.getDisplay());
+        prodInOut.setPi_prstatuscode(Status.RECNONE.name());
         prodInOutMapper.insertSelective(prodInOut);
         //插入出货单从表
         long pi_id = prodInOut.getId();

+ 2 - 0
applications/sale/sale-server/src/main/resources/mapper/ProdInOutListMapper.xml

@@ -103,6 +103,8 @@
     <result column="pi_auditman" jdbcType="VARCHAR" property="pi_auditman" />
     <result column="pi_address" jdbcType="VARCHAR" property="pi_address" />
     <result column="pi_remark" jdbcType="VARCHAR" property="pi_remark" />
+    <result column="pi_prstatus" jdbcType="VARCHAR" property="pi_prstatus" />
+    <result column="pi_prstatuscode" jdbcType="VARCHAR" property="pi_prstatuscode" />
     <result column="pd_piid" jdbcType="INTEGER" property="pd_piid" />
     <result column="pd_inoutno" jdbcType="VARCHAR" property="pd_inoutno" />
     <result column="pd_piclass" jdbcType="VARCHAR" property="pd_piclass" />

+ 29 - 5
applications/sale/sale-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -35,6 +35,8 @@
     <result column="pi_remark" jdbcType="VARCHAR" property="pi_remark" />
     <result column="pi_iocode" jdbcType="VARCHAR" property="pi_iocode" />
       <result column="pi_ioid" jdbcType="INTEGER" property="pi_ioid" />
+    <result column="pi_prstatus" jdbcType="VARCHAR" property="pi_prstatus" />
+    <result column="pi_prstatuscode" jdbcType="VARCHAR" property="pi_prstatuscode" />
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.usoftchina.saas.storage.po.ProdInOut">
     <result column="pi_address" jdbcType="LONGVARCHAR" property="pi_address" />
@@ -100,7 +102,7 @@
   <sql id="Base_Column_List">
     pi_id, pi_inoutno, pi_class, pi_date, pi_vendid, pi_vendcode, pi_vendname, pi_custid, 
     pi_custcode, pi_custname, pi_puid, pi_pucode, pi_said, pi_sacode, pi_total, pi_status, pi_statuscode, pi_printstatus, pi_printstatuscode,
-    companyid, updaterid, updatetime, pi_text1, pi_text2, pi_text3, pi_text4, pi_text5
+    companyid, updaterid, updatetime, pi_text1, pi_text2, pi_text3, pi_text4, pi_text5,pi_prstatus,pi_prstatuscode
   </sql>
   <sql id="Blob_Column_List">
     pi_address,pi_remark
@@ -125,7 +127,7 @@
       pi_printstatuscode, companyid, updaterid, 
       updatetime, pi_text1, pi_text2, 
       pi_text3, pi_text4, pi_text5,
-      pi_address,pi_remark)
+      pi_address,pi_remark,pi_prstatus,pi_prstatuscode)
     values (#{pi_id,jdbcType=INTEGER}, #{pi_inoutno,jdbcType=VARCHAR}, #{pi_class,jdbcType=VARCHAR}, 
       #{pi_date,jdbcType=TIMESTAMP}, #{pi_vendid,jdbcType=INTEGER}, #{pi_vendcode,jdbcType=VARCHAR}, 
       #{pi_vendname,jdbcType=VARCHAR}, #{pi_custid,jdbcType=INTEGER}, #{pi_custcode,jdbcType=VARCHAR}, 
@@ -136,7 +138,7 @@
       #{updatetime,jdbcType=TIMESTAMP}, #{pi_text1,jdbcType=VARCHAR}, #{pi_text2,jdbcType=VARCHAR}, 
       #{pi_text3,jdbcType=VARCHAR}, #{pi_text4,jdbcType=VARCHAR}, #{pi_text5,jdbcType=VARCHAR}, 
       #{pi_address,jdbcType=LONGVARCHAR},
-      #{pi_remark,jdbcType=LONGVARCHAR})
+      #{pi_remark,jdbcType=LONGVARCHAR}, #{pi_prstatus,jdbcType=VARCHAR}, #{pi_prstatuscode,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.storage.po.ProdInOut">
     <selectKey resultType="java.lang.Long" keyProperty="id">
@@ -235,6 +237,12 @@
         <if test="pi_ioid != null">
             pi_ioid,
         </if>
+      <if test="pi_prstatus!=null">
+        pi_prstatus,
+      </if>
+      <if test="pi_prstatuscode!=null">
+        pi_prstatuscode,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
 
@@ -328,6 +336,12 @@
         <if test="pi_ioid != null">
             #{pi_ioid},
         </if>
+      <if test="pi_prstatus!=null">
+        #{pi_prstatus,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_prstatuscode!=null">
+        #{pi_prstatuscode,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.storage.po.ProdInOut">
@@ -417,6 +431,12 @@
       <if test="pi_remark != null">
         pi_remark = #{pi_remark,jdbcType=LONGVARCHAR},
       </if>
+      <if test="pi_prstatus!=null">
+        pi_prstatus = #{pi_prstatus,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_prstatuscode!=null">
+        pi_prstatuscode = #{pi_prstatuscode,jdbcType=VARCHAR},
+      </if>
     </set>
     where pi_id = #{id,jdbcType=INTEGER}
   </update>
@@ -449,7 +469,9 @@
       pi_text4 = #{pi_text4,jdbcType=VARCHAR},
       pi_text5 = #{pi_text5,jdbcType=VARCHAR},
       pi_address = #{pi_address,jdbcType=LONGVARCHAR},
-      pi_remark = #{pi_remark,jdbcType=LONGVARCHAR}
+      pi_remark = #{pi_remark,jdbcType=LONGVARCHAR},
+      pi_prstatus= #{pi_prstatus,jdbcType=VARCHAR},
+      pi_prstatuscode= #{pi_prstatuscode,jdbcType=VARCHAR}
     where pi_id = #{pi_id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.storage.po.ProdInOut">
@@ -481,7 +503,9 @@
       pi_text4 = #{pi_text4,jdbcType=VARCHAR},
       pi_text5 = #{pi_text5,jdbcType=VARCHAR},
       pi_address = #{pi_address,jdbcType=LONGVARCHAR},
-      pi_remark = #{pi_remark,jdbcType=LONGVARCHAR}
+      pi_remark = #{pi_remark,jdbcType=LONGVARCHAR},
+      pi_prstatus= #{pi_prstatus,jdbcType=VARCHAR},
+      pi_prstatuscode= #{pi_prstatuscode,jdbcType=VARCHAR}
     where pi_id = #{id,jdbcType=INTEGER}
   </update>
   <select id="selectCodeById" resultType="string" parameterType="long">

+ 6 - 6
applications/sale/sale-server/src/main/resources/mapper/SaledetailMapper.xml

@@ -309,27 +309,27 @@
     where sd_id = #{id,jdbcType=INTEGER}
   </update>
   <insert id="batchInsert" parameterType="java.util.List" >
-    insert into saledetail (sd_said, sd_detno,
+    insert into saledetail (sd_said, sd_detno,sd_code,
     sd_prodid, sd_prodcode, sd_qty,
     sd_price, sd_total, sd_taxrate,
     sd_netprice, sd_nettotal, sd_delivery,
-    sd_sendqty, sd_pdqty, sd_remark,
+    sd_sendqty, sd_pdqty, sd_yqty,sd_remark,
     companyId, updaterId, updateTime,
     sd_text1, sd_text2, sd_text3,
     sd_text4, sd_text5,
-    creatorId,createTime,creatorName, sd_yqty)
+    creatorId,createTime,creatorName)
     values
     <foreach collection="list" item="item" index="index" open="" close="" separator=",">
       (
-      #{item.sd_said,jdbcType=INTEGER}, #{item.sd_detno,jdbcType=INTEGER},
+      #{item.sd_said,jdbcType=INTEGER}, #{item.sd_detno,jdbcType=INTEGER},#{item.sd_code,jdbcType=VARCHAR},
       #{item.sd_prodid,jdbcType=INTEGER}, #{item.sd_prodcode,jdbcType=VARCHAR}, #{item.sd_qty,jdbcType=DOUBLE},
       #{item.sd_price,jdbcType=DOUBLE}, #{item.sd_total,jdbcType=DOUBLE}, #{item.sd_taxrate,jdbcType=DOUBLE},
       #{item.sd_netprice,jdbcType=DOUBLE}, #{item.sd_nettotal,jdbcType=DOUBLE}, #{item.sd_delivery,jdbcType=TIMESTAMP},
-      #{item.sd_sendqty,jdbcType=DOUBLE}, #{item.sd_pdqty,jdbcType=DOUBLE}, #{item.sd_remark,jdbcType=VARCHAR},
+      #{item.sd_sendqty,jdbcType=DOUBLE}, #{item.sd_pdqty,jdbcType=DOUBLE}, #{item.sd_yqty,jdbcType=DOUBLE}, #{item.sd_remark,jdbcType=VARCHAR},
       #{item.companyId,jdbcType=INTEGER}, #{item.updaterId,jdbcType=INTEGER}, #{item.updateTime,jdbcType=TIMESTAMP},
       #{item.sd_text1,jdbcType=VARCHAR}, #{item.sd_text2,jdbcType=VARCHAR}, #{item.sd_text3,jdbcType=VARCHAR},
       #{item.sd_text4,jdbcType=VARCHAR}, #{item.sd_text5,jdbcType=VARCHAR},
-      #{item.creatorId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.creatorName,jdbcType=VARCHAR},#{item.sd_yqty,jdbcType=DOUBLE}
+      #{item.creatorId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.creatorName,jdbcType=VARCHAR}
       )
     </foreach>
   </insert>

+ 4 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdInOut.java

@@ -72,4 +72,8 @@ public class ProdInOut extends CommonBaseEntity implements Serializable {
     private Long pi_maid;
 
     private String pi_iocode;
+
+    private String pi_prstatuscode;
+
+    private String pi_prstatus;
 }