Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

zhoudw 7 years ago
parent
commit
9c06922b54

+ 1 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java

@@ -44,6 +44,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
     SALEOUT_ALL_TURNIN(72003, "该出货单已全部转退货,无法转销售退货单"),
     SALEOUT_POSTSTATUS_ERROR(72004,"当前单据状态无法进行此操作。"),
     SALEOUT_POST_ERROR(72005,""),
+    SALEOUT_UNAUDIT_ERROR(72006,"销售订单已出货,无法反审核"),
     //资金
 
     //库存

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaleMapper.java

@@ -37,4 +37,6 @@ public interface SaleMapper {
     void updateTotalAndNetPrice(Long id);
 
     void updateNetTotal(Long id);
+
+    Integer checkSendStatus(Long id);
 }

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

@@ -276,6 +276,11 @@ public class SaleServiceImpl implements SaleService{
         if (null != code) {
             throw new BizException(BizExceptionCode.SALE_NULL_BILL);
         }
+        //检测出货状态为未出货
+        Integer num = saleMapper.checkSendStatus(id);
+        if (num == 0) {
+            throw new BizException(BizExceptionCode.SALEOUT_UNAUDIT_ERROR);
+        }
         singleUnAudit(id);
     }
 

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

@@ -383,4 +383,9 @@
     update saledetail a set sd_nettotal=round(ifnull(sd_netprice,0)*ifnull(sd_qty,0),2)
     where sd_said=#{id}
   </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>
 </mapper>

+ 2 - 1
frontend/saas-web/app/view/sale/sale/FormPanel.js

@@ -111,7 +111,8 @@ Ext.define('saas.view.sale.sale.FormPanel', {
 				}
             }, {
                 text : "数量", 
-                dataIndex : "sd_qty", 
+                dataIndex : "sd_qty",
+                allowBlank:false, 
                 editor : {
                     xtype : "numberfield",
                     decimalPrecision: 8,