Browse Source

完善代码

yuansh 2 tháng trước cách đây
mục cha
commit
c3c79d2e29

+ 8 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleOrderController.java

@@ -230,6 +230,14 @@ public class SaleOrderController {
     public Result<String> edit(@RequestBody SaleOrderPage saleOrderPage) {
         SaleOrder saleOrder = new SaleOrder();
         BeanUtils.copyProperties(saleOrderPage, saleOrder);
+
+        String getSourceCode = saleOrder.getSourceCode();
+        String getSourceCode2 = saleOrder.getSourceCode2();
+
+        if(StringUtils.isBlank(getSourceCode) && StringUtils.isBlank(getSourceCode2)){
+            return Result.error("网络异常,请刷新后重试 !");
+        }
+
         SaleOrder saleOrderEntity = saleOrderService.getById(saleOrder.getId());
         if (saleOrderEntity == null) {
             return Result.error("未找到对应数据");

+ 13 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleQuotationController.java

@@ -226,6 +226,12 @@ public class SaleQuotationController {
     public Result<String> edit(@RequestBody SaleQuotationPage saleQuotationPage) {
         SaleQuotation saleQuotation = new SaleQuotation();
         BeanUtils.copyProperties(saleQuotationPage, saleQuotation);
+
+        String getSourceCode = saleQuotation.getSourceCode();
+
+        if(StringUtils.isBlank(getSourceCode)){
+            return Result.error("网络异常,请刷新后重试 !");
+        }
         SaleQuotation saleQuotationEntity = saleQuotationService.getById(saleQuotation.getId());
         if (saleQuotationEntity == null) {
             return Result.error("未找到对应数据");
@@ -247,6 +253,13 @@ public class SaleQuotationController {
     public Result<String> editHis(@RequestBody SaleQuotationPage saleQuotationPage) {
         SaleQuotation saleQuotation = new SaleQuotation();
         BeanUtils.copyProperties(saleQuotationPage, saleQuotation);
+
+        String getSourceCode = saleQuotation.getSourceCode();
+
+        if(StringUtils.isBlank(getSourceCode)){
+            return Result.error("网络异常,请刷新后重试 !");
+        }
+
         SaleQuotation saleQuotationEntity = saleQuotationService.getById(saleQuotation.getId());
         if (saleQuotationEntity == null) {
             return Result.error("未找到对应数据");