Parcourir la source

客户采购单BUG处理

guq il y a 7 ans
Parent
commit
9f213b0f81

+ 20 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/SaleDownDetail.java

@@ -52,6 +52,26 @@ public class SaleDownDetail extends CommonBaseEntity{
 
     private String sd_remark;
 
+    private String sd_proddetail;
+
+    private String sd_prodbrand;
+
+    public String getSd_proddetail() {
+        return sd_proddetail;
+    }
+
+    public void setSd_proddetail(String sd_proddetail) {
+        this.sd_proddetail = sd_proddetail;
+    }
+
+    public String getSd_prodbrand() {
+        return sd_prodbrand;
+    }
+
+    public void setSd_prodbrand(String sd_prodbrand) {
+        this.sd_prodbrand = sd_prodbrand;
+    }
+
     public Long getSd_said() {
         return sd_said;
     }

+ 7 - 2
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleDownServiceImpl.java

@@ -49,7 +49,6 @@ public class SaleDownServiceImpl implements SaleDownService{
         PageHelper.startPage(page.getNumber(), page.getSize());
         //查询数据
         Long companyId = BaseContextHolder.getCompanyId();
-        companyId = 334l;
         String con = req.getFinalCondition();
         if (null == con) {
             con = "1=1";
@@ -82,7 +81,7 @@ public class SaleDownServiceImpl implements SaleDownService{
         Long sa_id = main.getId();
         String sa_code = main.getSa_code();
         //更新操作
-        saledownMapper.updateByPrimaryKeySelective(main);
+        //saledownMapper.updateByPrimaryKeySelective(main);
         //添加从表传输对象
         for (SaleDownDetail detail : items) {
             detail.setSd_said(sa_id);
@@ -118,6 +117,12 @@ public class SaleDownServiceImpl implements SaleDownService{
         SaleDown main = saledownMapper.selectByPrimaryKey(id);
         //查询从表
         List<SaleDownDetail> items = saledownMapper.selectByFK(id);
+        //检测料号是否存在
+        for (SaleDownDetail  item : items) {
+            if (StringUtils.isEmpty(item.getSd_prodcode())) {
+                throw new BizException(789876, "序号:" + item.getSd_detno() + " 物料编号不存在,不允许转销售订单");
+            }
+        }
         if (Status.CLOSE.getDisplay().equals(main.getSa_status())) {
             throw new BizException(BizExceptionCode.SALEDOWN_CLOSE);
         }

+ 3 - 0
applications/sale/sale-server/src/main/resources/config/application-dev.yml

@@ -10,3 +10,6 @@ eureka:
     registryFetchIntervalSeconds: 5
     serviceUrl:
       defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/
+  logging:
+    level:
+      com.usoftchina.saas.sale: DEBUG

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

@@ -352,7 +352,7 @@
         updaterId = #{updaterId,jdbcType=INTEGER},
       </if>
     </set>
-    where sa_id = #{sa_id,jdbcType=INTEGER}
+    where sa_id = #{id,jdbcType=INTEGER}
   </update>
 
   <insert id="batchInsert" parameterType="java.util.List" >
@@ -425,6 +425,8 @@
     <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
     <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
     <result column="creatorName" property="creatorName" jdbcType="VARCHAR" />
+    <result column="sd_proddetail" property="sd_proddetail" jdbcType="VARCHAR" />
+    <result column="sd_proddetail" property="sd_proddetail" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Detail_Column_List" >
     sd_id, sd_said, sd_code, sd_detno, b2b_pd_id, sd_prodid, sd_prodcode, sd_prodspec,
@@ -434,7 +436,7 @@
   </sql>
 
   <select id="selectByFK" parameterType="long" resultMap="detailMap">
-    select * from saledowndetail where sd_said=#{id}
+    select saledowndetail.*, pr_detail sd_proddetail, pr_brand sd_prodbrand from saledowndetail left join product on sd_prodid = pr_id where sd_said=#{id}
   </select>
 
   <select id="selectListByCon" resultMap="BaseResultMap">
@@ -453,31 +455,12 @@
 
   <update id="batchUpdate" parameterType="com.usoftchina.saas.sale.po.SaleDownDetail">
     <foreach collection="list" item="item" index="index" open="" close="" separator=";">
-      update saledetail <set>
-      sd_said = #{item.sd_said},
-      sd_detno = #{item.sd_detno},
+      update saledowndetail <set>
       sd_prodid = #{item.sd_prodid},
       sd_prodcode = #{item.sd_prodcode},
-      sd_qty = #{item.sd_qty,jdbcType=DOUBLE},
-      sd_price = #{item.sd_price,jdbcType=DOUBLE},
-      sd_total = #{item.sd_total,jdbcType=DOUBLE},
-      sd_taxrate = #{item.sd_taxrate,jdbcType=DOUBLE},
-      sd_netprice = #{item.sd_netprice,jdbcType=DOUBLE},
-      sd_nettotal = #{item.sd_nettotal,jdbcType=DOUBLE},
-      sd_delivery = #{item.sd_delivery,jdbcType=TIMESTAMP},
-      sd_sendqty = #{item.sd_sendqty,jdbcType=DOUBLE},
-      sd_pdqty = #{item.sd_pdqty,jdbcType=DOUBLE},
       sd_remark = #{item.sd_remark,jdbcType=VARCHAR},
       companyId = #{item.companyId,jdbcType=INTEGER},
-      updaterId = #{item.updaterId,jdbcType=INTEGER},
-      updateTime = #{item.updateTime,jdbcType=TIMESTAMP},
-      sd_text1 = #{item.sd_text1,jdbcType=VARCHAR},
-      sd_text2 = #{item.sd_text2,jdbcType=VARCHAR},
-      sd_text3 = #{item.sd_text3,jdbcType=VARCHAR},
-      sd_text4 = #{item.sd_text4,jdbcType=VARCHAR},
-      sd_text5 = #{item.sd_text5,jdbcType=VARCHAR},
-      sd_yqty = #{item.sd_yqty,jdbcType=DOUBLE},
-      sd_code = #{item.sd_code,jdbcType=VARCHAR}
+      updateTime = now()
     </set>
       where sd_id = #{item.id,jdbcType=INTEGER}
     </foreach>