Преглед изворни кода

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

guq пре 7 година
родитељ
комит
47286d76bc

+ 3 - 2
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java

@@ -75,13 +75,14 @@ public enum BizExceptionCode implements BaseExceptionCode {
     SALE_NULL_BILL(72002, "单据不存在或者明细为空"),
     SALEOUT_ALL_TURNIN(72003, "该出货单已全部转退货,无法转销售退货单"),
     SALEOUT_POSTSTATUS_ERROR(72004,"当前单据状态无法进行此操作。"),
-    SALEOUT_POST_ERROR(72005,""),
+    SALEOUT_POST_ERROR(72005,"编号:<u>%s</u>处理失败,%s"),
     SALEOUT_UNAUDIT_ERROR(72006,"销售订单已转出货单,无法反审核"),
     SALE_ORDER_HASAUDIT(72003, "存在已审核单据,单据编号:%s"),
     SALE_EXISTS_PURCHASE(72004, "存在已转的采购单据,单据编号:%s"),
     SALE_ALREADY_UNAUDIT(72007, "单据状态为未审核,无法反审核"),
     SALE_CUST_CLOSE(72008, "客户已关闭,无法审核"),
-
+    SALE_ORDER_ISUNAUDIT(72009, "存在未审核单据,单据编号:%s"),
+    SALE_ORDER_ISCOLSED(72010, "存在已关闭单据,单据编号:%s"),
     //资金
     PAYBALANCE_OUTNOWBALANCE(74001,"本次核销金额不能大于未核销金额"),
     PAYBALANCE_UNIQUESOURCECODE(74002, "保存失败!不能选择重复的源单"),

+ 1 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/report/PurchaseReportDetail.java

@@ -119,6 +119,7 @@ public class PurchaseReportDetail extends CommonBaseEntity implements Serializab
 
     private Double pd_accepttotal;
 
+    private String pd_remark;
     //private ProductDTO productDTO;
     private Long pr_id;
     private String pr_code;

+ 1 - 0
applications/purchase/purchase-server/src/main/resources/mapper/PurchaseReportMapper.xml

@@ -70,6 +70,7 @@
     <result column="pd_text4" property="pd_text4" jdbcType="VARCHAR" />
     <result column="pd_text5" property="pd_text5" jdbcType="VARCHAR" />
     <result column="pd_yqty" property="pd_yqty" jdbcType="DOUBLE" />
+    <result column="pd_remark" property="pd_remark" jdbcType="VARCHAR" />
     <result column="pr_id" property="pr_id"/>
     <result column="pr_code" property="pr_code"/>
     <result column="pr_detail" property="pr_detail"/>

+ 12 - 1
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/SaleApplication.java

@@ -6,6 +6,8 @@ import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
 import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
 
 
 /**
@@ -17,9 +19,18 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
 @EnableEurekaClient
 @EnableFeignClients("com.usoftchina.saas")
 @EnableAuthClient
-public class SaleApplication  {
+public class SaleApplication extends WebMvcConfigurerAdapter {
     public static void main(String[] args) {
         SpringApplication.run(SaleApplication.class, args);
     }
+    @Override
+    public void addCorsMappings(CorsRegistry registry) {
+
+        registry.addMapping("/**")
+                .allowCredentials(true)
+                .allowedHeaders("*")
+                .allowedOrigins("*")
+                .allowedMethods("*");
+    }
 
 }

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

@@ -34,6 +34,8 @@ public interface ProdInOutMapper extends CommonBaseMapper<ProdInOut> {
 
     String validateAudit(List<DocBaseDTO> baseDTOs);
 
+    String validateClose(List<DocBaseDTO> baseDTOs);
+
     String validateBatchUnAudit(List<DocBaseDTO> baseDTOs);
 
     String validateBatchClose(List<DocBaseDTO> baseDTOs);

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

@@ -56,4 +56,6 @@ public interface SaleMapper extends CommonBaseMapper<Sale> {
     Integer checkCustomer(Long id);
 
     String validateCustAudit(List<DocBaseDTO> baseDTOs);
+
+    String validateClose(List<DocBaseDTO> baseDTOs);
 }

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

@@ -283,6 +283,20 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
                 baseDTOs.getBaseDTOs().size() == 0) {
             return "没有可审核单据。";
         }
+        //存在已审核单据,单据编号:XXXX
+        String msg = prodInOutMapper.validateAudit(baseDTOs.getBaseDTOs());
+        if (null != msg) {
+            String message = BizExceptionCode.SALE_ORDER_HASAUDIT.getMessage();
+            int code = BizExceptionCode.SALE_ORDER_HASAUDIT.getCode();
+            throw new BizException(code, String.format(message, msg));
+        }
+        //存在已关闭单据,单据编号:XXXX
+        msg = prodInOutMapper.validateClose(baseDTOs.getBaseDTOs());
+        if (null != msg) {
+            String message = BizExceptionCode.SALE_ORDER_ISCOLSED.getMessage();
+            int code = BizExceptionCode.SALE_ORDER_ISCOLSED.getCode();
+            throw new BizException(code, String.format(message, msg));
+        }
         StringBuffer errorMsg = new StringBuffer();
         for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
             try{
@@ -291,7 +305,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
                 ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut,ProdInOutDTO.class);
                 singleAudit(prodInOutDTO);
             }catch (Exception e){
-                String msg = BizExceptionCode.DEAL_FAILED.getMessage();
+                msg = BizExceptionCode.DEAL_FAILED.getMessage();
                 errorMsg.append(String.format(msg, base.getCode(), e.getMessage()));
             }
         }
@@ -337,6 +351,20 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
                 baseDTOs.getBaseDTOs().size() == 0) {
             return "无可反审核单据。";
         }
+        //存在未审核单据,单据编号:XXXX
+        String msg = prodInOutMapper.validateBatchUnAudit(baseDTOs.getBaseDTOs());
+        if (null != msg) {
+            String message = BizExceptionCode.SALE_ORDER_ISUNAUDIT.getMessage();
+            int code = BizExceptionCode.SALE_ORDER_ISUNAUDIT.getCode();
+            throw new BizException(code, String.format(message, msg));
+        }
+        //存在已关闭单据,单据编号:XXXX
+        msg = prodInOutMapper.validateClose(baseDTOs.getBaseDTOs());
+        if (null != msg) {
+            String message = BizExceptionCode.SALE_ORDER_ISCOLSED.getMessage();
+            int code = BizExceptionCode.SALE_ORDER_ISCOLSED.getCode();
+            throw new BizException(code, String.format(message, msg));
+        }
         StringBuffer errorMsg = new StringBuffer();
         for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
             try {
@@ -345,7 +373,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
                 ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut,ProdInOutDTO.class);
                 singleUnAudit(prodInOutDTO);
             }catch (Exception e){
-                String msg = BizExceptionCode.DEAL_FAILED.getMessage();
+                msg = BizExceptionCode.DEAL_FAILED.getMessage();
                 errorMsg.append(String.format(msg, base.getCode(), e.getMessage()));
             }
         }

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

@@ -328,13 +328,21 @@ public class SaleServiceImpl implements SaleService{
                 baseDTOs.getBaseDTOs().size() == 0) {
             return;
         }
-      /*  String msg = saleMapper.validateBatchUnAudit(baseDTOs.getBaseDTOs());
+        //存在未审核单据,单据编号:XXXX
+        String msg = saleMapper.validateBatchUnAudit(baseDTOs.getBaseDTOs());
         if (null != msg) {
-            String message = BizExceptionCode.SALE_ORDER_HASAUDIT.getMessage();
-            int code = BizExceptionCode.SALE_ORDER_HASAUDIT.getCode();
+            String message = BizExceptionCode.SALE_ORDER_ISUNAUDIT.getMessage();
+            int code = BizExceptionCode.SALE_ORDER_ISUNAUDIT.getCode();
+            throw new BizException(code, String.format(message, msg));
+        }
+        //存在已关闭单据,单据编号:XXXX
+        msg = saleMapper.validateClose(baseDTOs.getBaseDTOs());
+        if (null != msg) {
+            String message = BizExceptionCode.SALE_ORDER_ISCOLSED.getMessage();
+            int code = BizExceptionCode.SALE_ORDER_ISCOLSED.getCode();
             throw new BizException(code, String.format(message, msg));
         }
-        saleMapper.BatchcheckSendStatus();*/
+        //saleMapper.BatchcheckSendStatus();
         for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
             unAudit(base.getId());
         }

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

@@ -494,31 +494,36 @@
     select count(1) from prodinout where pi_inoutno = #{code} and pi_id != #{id}
   </select>
   <select id="validateUnAudit" parameterType="long" resultType="java.lang.String">
-    select pi_inoutno from prodinout where pi_id = #{id} and IFNULL(pi_statuscode,'UNAUDITED')!='AUDITED'
+    select pi_inoutno from prodinout where pi_id = #{id} and IFNULL(pi_statuscode,' ')!='AUDITED'
   </select>
   <select id="validateAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
-    select GROUP_CONCAT(pi_inoutno) from prodinout where pi_statuscode='AUDITED' and pi_id in
+    select GROUP_CONCAT(pi_inoutno) from prodinout where IFNULL(pi_statuscode,' ')='AUDITED' and pi_id in
+    <foreach collection="list" item="item" open="(" close=")" separator=",">
+      #{item.id}
+    </foreach>
+  </select>
+  <select id="validateClose" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
+    select GROUP_CONCAT(pi_inoutno) from prodinout where IFNULL(pi_statuscode,' ')='CLOSE' and pi_id in
     <foreach collection="list" item="item" open="(" close=")" separator=",">
       #{item.id}
     </foreach>
   </select>
-
   <select id="validateBatchUnAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
-    select GROUP_CONCAT(pi_inoutno) from prodinout where pi_statuscode='UNAUDITED' and pi_id in
+    select GROUP_CONCAT(pi_inoutno) from prodinout where IFNULL(pi_statuscode,' ')='UNAUDITED' and pi_id in
     <foreach collection="list" item="item" open="(" close=")" separator=",">
       #{item.id}
     </foreach>
   </select>
 
   <select id="validateBatchClose" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
-    select GROUP_CONCAT(pi_inoutno) from prodinout where pi_statuscode!='AUDITED' and pi_id in
+    select GROUP_CONCAT(pi_inoutno) from prodinout where IFNULL(pi_statuscode,' ')!='AUDITED' and pi_id in
     <foreach collection="list" item="item" open="(" close=")" separator=",">
       #{item.id}
     </foreach>
   </select>
 
   <select id="validateBatchOpen" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
-    select GROUP_CONCAT(pi_inoutno) from prodinout where pi_statuscode!='CLOSE' and pi_id in
+    select GROUP_CONCAT(pi_inoutno) from prodinout where IFNULL(pi_statuscode,' ')!='CLOSE' and pi_id in
     <foreach collection="list" item="item" open="(" close=")" separator=",">
       #{item.id}
     </foreach>

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

@@ -356,7 +356,12 @@
       #{item.id}
     </foreach>
   </select>
-
+  <select id="validateClose" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
+      select GROUP_CONCAT(sa_code) from sale where IFNULL(sa_sendstatuscode,' ')='CLOSE' and sa_id in
+    <foreach collection="list" item="item" open="(" close=")" separator=",">
+      #{item.id}
+    </foreach>
+  </select>
   <select id="validateCustAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
     select GROUP_CONCAT(sa_code) from sale left join customer on cu_id=sa_custid  where sa_statuscode='AUDITED' and sa_id in
     <foreach collection="list" item="item" open="(" close=")" separator=",">
@@ -364,7 +369,7 @@
     </foreach>
   </select>
   <select id="validateBatchUnAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
-    select GROUP_CONCAT(sa_code) from sale where sa_statuscode='UNAUDITED' and sa_id in
+    select GROUP_CONCAT(sa_code) from sale where IFNULL(sa_statuscode,'UNAUDITED') = 'UNAUDITED' and sa_id in
     <foreach collection="list" item="item" open="(" close=")" separator=",">
       #{item.id}
     </foreach>

+ 12 - 0
frontend/saas-web/app/view/core/dbfind/DbfindGridPanel.js

@@ -27,6 +27,18 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
                         type: 'json',
                         rootProperty: 'data.list',
                         totalProperty: 'data.total',
+                    },
+                    listeners: {
+                        exception: function(proxy, response, operation, eOpts) {
+                            if(operation.success) {
+                                if(response.timedout) {
+                                    saas.util.BaseUtil.showErrorToast('请求超时');
+                                }
+                            }else {
+                                console.error('exception: ', response.responseJson);
+                                saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
+                            }
+                        }
                     }
                 },
                 listeners: {

+ 12 - 0
frontend/saas-web/app/view/core/dbfind/MultiDbfindGridPanel.js

@@ -66,6 +66,18 @@ Ext.define('saas.view.core.dbfind.MultiDbfindGridPanel', {
                         type: 'json',
                         rootProperty: 'data.list',
                         totalProperty: 'data.total',
+                    },
+                    listeners: {
+                        exception: function(proxy, response, operation, eOpts) {
+                            if(operation.success) {
+                                if(response.timedout) {
+                                    saas.util.BaseUtil.showErrorToast('请求超时');
+                                }
+                            }else {
+                                console.error('exception: ', response.responseJson);
+                                saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
+                            }
+                        }
                     }
                 },
                 listeners: {