Просмотр исходного кода

销售单反审核增加逻辑限制

guq 7 лет назад
Родитель
Сommit
ed1829efc8

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

@@ -278,7 +278,7 @@ public class SaleServiceImpl implements SaleService{
         }
         //检测出货状态为未出货
         Integer num = saleMapper.checkSendStatus(id);
-        if (num == 0) {
+        if (num > 0) {
             throw new BizException(BizExceptionCode.SALEOUT_UNAUDIT_ERROR);
         }
         singleUnAudit(id);
@@ -478,7 +478,6 @@ public class SaleServiceImpl implements SaleService{
             //更新已转数
             saleDetail.setSd_yqty(saleDetail.getSd_qty());
             saledetailMapper.updateByPrimaryKeySelective(saleDetail);
-
         }
         //更新存在字段
         saleMapper.updateByPrimaryKeySelective(sale);

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

@@ -385,7 +385,7 @@
   </update>
 
   <select id="checkSendStatus" parameterType="long" resultType="java.lang.Integer">
-    select count(1) from sale where sa_id = #{id}
-    and ifnull(sa_sendstatuscode,'UNTURNOUT') = 'UNTURNOUT';
+    select count(1) from saledetail where sd_said = #{id}
+    and ifnull(sd_yqty, 0) > 0;
   </select>
 </mapper>

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

@@ -254,6 +254,9 @@
       <if test="sd_qty != null" >
         sd_qty = #{sd_qty,jdbcType=DOUBLE},
       </if>
+      <if test="sd_yqty != null" >
+        sd_yqty = #{sd_yqty,jdbcType=DOUBLE},
+      </if>
       <if test="sd_price != null" >
         sd_price = #{sd_price,jdbcType=DOUBLE},
       </if>