浏览代码

完善代码

yuansh 1 月之前
父节点
当前提交
ddf2158c24
共有 27 个文件被更改,包括 193 次插入87 次删除
  1. 7 1
      srm-module-code/src/main/java/org/jeecg/modules/platCode/controller/PlatCommissionContractController.java
  2. 7 1
      srm-module-code/src/main/java/org/jeecg/modules/platCode/controller/PlatCommissionOrderController.java
  3. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/platCode/entity/PlatCommissionContract.java
  4. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/platCode/entity/PlatCommissionOrder.java
  5. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/platCode/vo/PlatCommissionContractPage.java
  6. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/platCode/vo/PlatCommissionOrderPage.java
  7. 7 1
      srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurDeliveryNoteController.java
  8. 7 1
      srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurOrderController.java
  9. 7 1
      srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurShippingFeeController.java
  10. 3 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurDeliveryNote.java
  11. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurOrder.java
  12. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurShippingFee.java
  13. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurDeliveryNotePage.java
  14. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurOrderPage.java
  15. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurShippingFeePage.java
  16. 9 3
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleContractController.java
  17. 98 77
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleDeliveryController.java
  18. 7 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleInvoiceController.java
  19. 7 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleOrderController.java
  20. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleContract.java
  21. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleDelivery.java
  22. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleInvoice.java
  23. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleOrder.java
  24. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleContractPage.java
  25. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleDeliveryPage.java
  26. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleInvoicePage.java
  27. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleOrderPage.java

+ 7 - 1
srm-module-code/src/main/java/org/jeecg/modules/platCode/controller/PlatCommissionContractController.java

@@ -325,7 +325,7 @@ public class PlatCommissionContractController {
     @AutoLog(value = "佣金合同-批量关闭")
     @ApiOperation(value = "佣金合同-批量关闭", notes = "佣金合同-批量关闭")
     @GetMapping(value = "/submitClose")
-    public Result<String> submitClose(@RequestParam(name = "ids", required = true) String ids) {
+    public Result<String> submitClose(@RequestParam(name = "ids", required = true) String ids,String closeReason) {
 
         QueryWrapper<PlatCommissionContract> queryWrapper = new QueryWrapper<>();
         queryWrapper.in("id", Arrays.asList(ids.split(",")));
@@ -342,11 +342,16 @@ public class PlatCommissionContractController {
             String code = o.getBillCode();
             //关闭(close)1是0否
             String getClose = o.getClose();
+            String submit = o.getSubmit();//提交(submit)1是0否
 
             if (StringUtils.isNotBlank(getClose) && !getClose.equals("0")) {
                 sb.append("单号" + code).append("已关闭,无需再次关闭;");
                 continue;
             }
+            if (StringUtils.isBlank(submit) || submit.equals("0")) {
+                sb.append("单据编码" + code).append("还未提交,无需关闭;");
+                continue;
+            }
         }
 
         if (StringUtils.isNotBlank(sb.toString())) {
@@ -356,6 +361,7 @@ public class PlatCommissionContractController {
 
         PlatCommissionContract ent = new PlatCommissionContract();
         ent.setClose("1");
+        ent.setCloseReason(closeReason);
         platCommissionContractService.update(ent, queryWrapper);
 
         return Result.OK("关闭成功!");

+ 7 - 1
srm-module-code/src/main/java/org/jeecg/modules/platCode/controller/PlatCommissionOrderController.java

@@ -319,7 +319,7 @@ public class PlatCommissionOrderController {
 	 @AutoLog(value = "佣金订单-批量关闭")
 	 @ApiOperation(value = "佣金订单-批量关闭", notes = "佣金订单-批量关闭")
 	 @GetMapping(value = "/submitClose")
-	 public Result<String> submitClose(@RequestParam(name = "ids", required = true) String ids) {
+	 public Result<String> submitClose(@RequestParam(name = "ids", required = true) String ids,String closeReason) {
 
 		 QueryWrapper<PlatCommissionOrder> queryWrapper = new QueryWrapper<>();
 		 queryWrapper.in("id", Arrays.asList(ids.split(",")));
@@ -336,11 +336,16 @@ public class PlatCommissionOrderController {
 			 String code = o.getBillCode();
 			 //关闭(close)1是0否
 			 String getClose = o.getClose();
+			 String submit = o.getSubmit();//提交(submit)1是0否
 
 			 if (StringUtils.isNotBlank(getClose) && !getClose.equals("0")) {
 				 sb.append("单号" + code).append("已关闭,无需再次关闭;");
 				 continue;
 			 }
+			 if (StringUtils.isBlank(submit) || submit.equals("0")) {
+				 sb.append("单据编码" + code).append("还未提交,无需关闭;");
+				 continue;
+			 }
 		 }
 
 		 if (StringUtils.isNotBlank(sb.toString())) {
@@ -350,6 +355,7 @@ public class PlatCommissionOrderController {
 
 		 PlatCommissionOrder ent = new PlatCommissionOrder();
 		 ent.setClose("1");
+		 ent.setCloseReason(closeReason);
 		 platCommissionOrderService.update(ent, queryWrapper);
 
 		 return Result.OK("关闭成功!");

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/platCode/entity/PlatCommissionContract.java

@@ -37,6 +37,8 @@ public class PlatCommissionContract implements Serializable {
     @ApiModelProperty(value = "创建人")
     private String createBy;
     private String sysOrgCode;
+    //关闭原因
+    private String closeReason;
 	/**创建时间*/
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/platCode/entity/PlatCommissionOrder.java

@@ -37,6 +37,8 @@ public class PlatCommissionOrder implements Serializable {
     @ApiModelProperty(value = "创建人")
     private String createBy;
     private String sysOrgCode;
+    //关闭原因
+    private String closeReason;
 	/**创建时间*/
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/platCode/vo/PlatCommissionContractPage.java

@@ -33,6 +33,8 @@ public class PlatCommissionContractPage {
 	@ApiModelProperty(value = "创建人")
     private String createBy;
 	private String sysOrgCode;
+	//关闭原因
+	private String closeReason;
 	/**创建时间*/
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/platCode/vo/PlatCommissionOrderPage.java

@@ -33,6 +33,8 @@ public class PlatCommissionOrderPage {
 	@ApiModelProperty(value = "创建人")
     private String createBy;
 	private String sysOrgCode;
+	//关闭原因
+	private String closeReason;
 	/**创建时间*/
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")

+ 7 - 1
srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurDeliveryNoteController.java

@@ -359,7 +359,7 @@ public class PurDeliveryNoteController {
 	 @AutoLog(value = "到货单-批量关闭")
 	 @ApiOperation(value = "到货单-批量关闭", notes = "到货单-批量关闭")
 	 @GetMapping(value = "/submitClose")
-	 public Result<String> submitClose(@RequestParam(name = "ids", required = true) String ids) {
+	 public Result<String> submitClose(@RequestParam(name = "ids", required = true) String ids,String closeReason) {
 
 		 QueryWrapper<PurDeliveryNote> queryWrapper = new QueryWrapper<>();
 		 queryWrapper.in("id", Arrays.asList(ids.split(",")));
@@ -373,6 +373,7 @@ public class PurDeliveryNoteController {
 		 for (PurDeliveryNote o : list) {
 
 			 String code = o.getBillCode();
+			 String submit = o.getSubmit();//提交(submit)1是0否
 
 			 //关闭(close)1是0否
 			 String getClose = o.getClose();
@@ -381,6 +382,10 @@ public class PurDeliveryNoteController {
 				 sb.append("单号" + code).append("已关闭,无需再次关闭;");
 				 continue;
 			 }
+			 if (StringUtils.isBlank(submit) || submit.equals("0")) {
+				 sb.append("单据编码" + code).append("还未提交,无需关闭;");
+				 continue;
+			 }
 		 }
 
 		 if (StringUtils.isNotBlank(sb.toString())) {
@@ -390,6 +395,7 @@ public class PurDeliveryNoteController {
 
 		 PurDeliveryNote ent = new PurDeliveryNote();
 		 ent.setClose("1");
+		 ent.setCloseReason(closeReason);
 		 purDeliveryNoteService.update(ent, queryWrapper);
 
 		 return Result.OK("关闭成功!");

+ 7 - 1
srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurOrderController.java

@@ -621,7 +621,7 @@ public class PurOrderController {
     @AutoLog(value = "采购订单-批量关闭")
     @ApiOperation(value = "采购订单-批量关闭", notes = "采购订单-批量关闭")
     @GetMapping(value = "/submitClose")
-    public Result<String> submitClose(@RequestParam(name = "ids", required = true) String ids) {
+    public Result<String> submitClose(@RequestParam(name = "ids", required = true) String ids,String closeReason) {
 
         QueryWrapper<PurOrder> queryWrapper = new QueryWrapper<>();
         queryWrapper.in("id", Arrays.asList(ids.split(",")));
@@ -638,11 +638,16 @@ public class PurOrderController {
 
             //关闭(close)1是0否
             String getClose = o.getClose();
+            String submit = o.getSubmit();//提交(submit)1是0否
 
             if (StringUtils.isNotBlank(getClose) && !getClose.equals("0")) {
                 sb.append("单号" + code).append("已关闭,无需再次关闭;");
                 continue;
             }
+            if (StringUtils.isBlank(submit) || submit.equals("0")) {
+                sb.append("单据编码" + code).append("还未提交,无需关闭;");
+                continue;
+            }
         }
 
         if (StringUtils.isNotBlank(sb.toString())) {
@@ -652,6 +657,7 @@ public class PurOrderController {
 
         PurOrder ent = new PurOrder();
         ent.setClose("1");
+        ent.setCloseReason(closeReason);
         purOrderService.update(ent, queryWrapper);
 
         return Result.OK("关闭成功!");

+ 7 - 1
srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurShippingFeeController.java

@@ -441,7 +441,7 @@ public class PurShippingFeeController {
 	 @AutoLog(value = "运费采购订单-批量关闭")
 	 @ApiOperation(value = "运费采购订单-批量关闭", notes = "运费采购订单-批量关闭")
 	 @GetMapping(value = "/submitClose")
-	 public Result<String> submitClose(@RequestParam(name = "ids", required = true) String ids) {
+	 public Result<String> submitClose(@RequestParam(name = "ids", required = true) String ids,String closeReason) {
 
 		 QueryWrapper<PurShippingFee> queryWrapper = new QueryWrapper<>();
 		 queryWrapper.in("id", Arrays.asList(ids.split(",")));
@@ -455,6 +455,7 @@ public class PurShippingFeeController {
 		 for (PurShippingFee o : list) {
 
 			 String code = o.getBillCode();
+			 String submit = o.getSubmit();//提交(submit)1是0否
 
 			 //关闭(close)1是0否
 			 String getClose = o.getClose();
@@ -463,6 +464,10 @@ public class PurShippingFeeController {
 				 sb.append("单号" + code).append("已关闭,无需再次关闭;");
 				 continue;
 			 }
+			 if (StringUtils.isBlank(submit) || submit.equals("0")) {
+				 sb.append("单据编码" + code).append("还未提交,无需关闭;");
+				 continue;
+			 }
 		 }
 
 		 if (StringUtils.isNotBlank(sb.toString())) {
@@ -472,6 +477,7 @@ public class PurShippingFeeController {
 
 		 PurShippingFee ent = new PurShippingFee();
 		 ent.setClose("1");
+		 ent.setCloseReason(closeReason);
 		 purShippingFeeService.update(ent, queryWrapper);
 
 		 return Result.OK("关闭成功!");

+ 3 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurDeliveryNote.java

@@ -38,6 +38,9 @@ public class PurDeliveryNote implements Serializable {
     private String createBy;
     private String sysOrgCode;
 
+    //关闭原因
+    private String closeReason;
+
 	/**创建时间*/
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurOrder.java

@@ -48,6 +48,8 @@ public class PurOrder implements Serializable {
     @ApiModelProperty(value = "创建人")
     private String createBy;
     private String sysOrgCode;
+    //关闭原因
+    private String closeReason;
     //组织  上海/香港
     private String organize;
     //协议条款

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurShippingFee.java

@@ -45,6 +45,8 @@ public class PurShippingFee implements Serializable {
     @ApiModelProperty(value = "创建人")
     private String createBy;
     private String sysOrgCode;
+    //关闭原因
+    private String closeReason;
 
 	/**创建时间*/
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurDeliveryNotePage.java

@@ -37,6 +37,8 @@ public class PurDeliveryNotePage {
     private String createBy;
     private String sysOrgCode;
 
+	//关闭原因
+	private String closeReason;
 	/**创建时间*/
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurOrderPage.java

@@ -46,6 +46,8 @@ public class PurOrderPage {
 	@ApiModelProperty(value = "创建人")
     private String createBy;
     private String sysOrgCode;
+	//关闭原因
+	private String closeReason;
 	//组织  上海/香港
 	private String organize;
 	//协议条款

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurShippingFeePage.java

@@ -42,6 +42,8 @@ public class PurShippingFeePage {
 	@ApiModelProperty(value = "创建人")
     private String createBy;
     private String sysOrgCode;
+	//关闭原因
+	private String closeReason;
 
 	/**创建时间*/
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")

+ 9 - 3
srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleContractController.java

@@ -314,7 +314,7 @@ public class SaleContractController {
     @AutoLog(value = "销售合同-批量关闭")
     @ApiOperation(value = "销售合同-批量关闭", notes = "销售合同-批量关闭")
     @GetMapping(value = "/closeBatch")
-    public Result<String> closeBatch(@RequestParam(name = "ids", required = true) String ids) {
+    public Result<String> closeBatch(@RequestParam(name = "ids", required = true) String ids,String closeReason) {
 
         QueryWrapper<SaleContract> queryWrapper = new QueryWrapper<>();
         queryWrapper.in("id", Arrays.asList(ids.split(",")));
@@ -327,13 +327,18 @@ public class SaleContractController {
         StringBuffer sb = new StringBuffer();
         for (SaleContract o : list) {
             // 1-已关闭,0-未关闭
-            Integer submit = o.getIsClose();
+            Integer getIsClose = o.getIsClose();
             String code = o.getBillCode();
+            Integer status = o.getStatus();//状态(1-已提交,0-未提交)
 
-            if (submit != null && submit.equals(1)) {
+            if (getIsClose != null && getIsClose.equals(1)) {
                 sb.append("单据编码" + code).append("已关闭,请勿再次关闭;");
                 continue;
             }
+            if (status == null || status == 0) {
+                sb.append("单据编码" + code).append("还未提交,无需关闭;");
+                continue;
+            }
         }
 
         if (StringUtils.isNotBlank(sb.toString())) {
@@ -343,6 +348,7 @@ public class SaleContractController {
 
         SaleContract ent = new SaleContract();
         ent.setIsClose(1);
+        ent.setCloseReason(closeReason);
         saleContractService.update(ent, queryWrapper);
 
         return Result.OK("提交关闭!");

+ 98 - 77
srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleDeliveryController.java

@@ -128,7 +128,7 @@ public class SaleDeliveryController {
     //@AutoLog(value = "发货通知单(delivery notice)-分页列表查询")
     @ApiOperation(value = "发货通知单(delivery notice)-分页列表查询", notes = "发货通知单(delivery notice)-分页列表查询")
     @GetMapping(value = "/list")
-    @PermissionData(pageComponent="saleCode/deliveryNotice/deliveryNoticeList")
+    @PermissionData(pageComponent = "saleCode/deliveryNotice/deliveryNoticeList")
     public Result<IPage<SaleDelivery>> queryPageList(SaleDelivery saleDelivery,
                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
@@ -151,19 +151,37 @@ public class SaleDeliveryController {
     //@AutoLog(value = "发货通知单(delivery notice)-分页列表查询")
     @ApiOperation(value = "发货通知单(delivery notice)-分页列表查询", notes = "发货通知单(delivery notice)-分页列表查询")
     @GetMapping(value = "/listAlert")
-    @PermissionData(pageComponent="saleCode/deliveryNotice/deliveryNoticeList")
+    @PermissionData(pageComponent = "saleCode/deliveryNotice/deliveryNoticeList")
     public Result<IPage<SaleDelivery>> queryPageListAlert(SaleDelivery saleDelivery,
-                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                     HttpServletRequest req) {
+                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                          HttpServletRequest req) {
         QueryWrapper<SaleDelivery> queryWrapper = QueryGenerator.initQueryWrapper(saleDelivery, req.getParameterMap());
         Page<SaleDelivery> page = new Page<SaleDelivery>(pageNo, pageSize);
-        IPage<SaleDelivery> pageList = saleDeliveryService.page(page, queryWrapper);
+
+        Page<SaleDeliveryAlert> page2 = new Page<SaleDeliveryAlert>(-1, -1);
+        QueryWrapper<SaleDeliveryAlert> queryWrapper1 = new QueryWrapper<>();
+        queryWrapper1.apply("quantity > IFNULL(delivery_quantity, 0)");
+        if (saleDelivery != null && StringUtils.isNotBlank(saleDelivery.getProject())) {
+            queryWrapper1.eq("project", saleDelivery.getProject());
+        }
+        IPage<SaleDelivery> pageList = new Page<>();
+
+        IPage<SaleDeliveryAlert> pageList2 = saleDeliveryDetailsService.selectSaleDeliveryAlert(page2, queryWrapper1);
+        if (pageList2.getRecords().size() > 0) {
+            List<String> codeList = pageList2.getRecords().stream().map(SaleDeliveryAlert::getHeadId).collect(Collectors.toList());
+            queryWrapper.in("id", codeList);
+        } else {
+            return Result.OK(pageList);
+        }
+
+        pageList = saleDeliveryService.page(page, queryWrapper);
         return Result.OK(pageList);
     }
 
     /**
      * 不在使用
+     *
      * @param saleInquiryForm
      * @param pageNo
      * @param pageSize
@@ -172,7 +190,7 @@ public class SaleDeliveryController {
      */
     @ApiOperation(value = "发货通知单弹框明细-销售出库单使用", notes = "发货通知单弹框明细-销售出库单使用")
     @GetMapping(value = "/selectSaleDeliveryAlert")
-    @PermissionData(pageComponent="saleCode/deliveryNotice/deliveryNoticeList")
+    @PermissionData(pageComponent = "saleCode/deliveryNotice/deliveryNoticeList")
     public Result<IPage<SaleDeliveryAlert>> selectSaleDeliveryAlert(SaleDeliveryAlert saleInquiryForm,
                                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
@@ -187,6 +205,7 @@ public class SaleDeliveryController {
 
     /**
      * 销售发票使用
+     *
      * @param saleInquiryForm
      * @param pageNo
      * @param pageSize
@@ -195,11 +214,11 @@ public class SaleDeliveryController {
      */
     @ApiOperation(value = "发货通知单弹框明细-销售发票使用", notes = "发货通知单弹框明细-销售发票使用")
     @GetMapping(value = "/selectSaleDeliveryAlertInvoice")
-    @PermissionData(pageComponent="saleCode/deliveryNotice/deliveryNoticeList")
+    @PermissionData(pageComponent = "saleCode/deliveryNotice/deliveryNoticeList")
     public Result<IPage<SaleDeliveryAlert>> selectSaleDeliveryAlertInvoice(SaleDeliveryAlert saleInquiryForm,
-                                                                    @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                                    HttpServletRequest req) {
+                                                                           @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                           @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                           HttpServletRequest req) {
 
         QueryWrapper<SaleDeliveryAlert> queryWrapper = QueryGenerator.initQueryWrapper(saleInquiryForm, req.getParameterMap());
         Page<SaleDeliveryAlert> page = new Page<SaleDeliveryAlert>(pageNo, pageSize);
@@ -211,9 +230,9 @@ public class SaleDeliveryController {
     @ApiOperation(value = "发货通知单弹框明细(运费采购订单) 无用,运费改成整单选择", notes = "发货通知单弹框明细")
     @GetMapping(value = "/selectSaleDeliveryAlertFee")
     public Result<IPage<SaleDeliveryAlert>> selectSaleDeliveryAlertFee(SaleDeliveryAlert saleInquiryForm,
-                                                                    @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                                    HttpServletRequest req) {
+                                                                       @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                       @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                       HttpServletRequest req) {
 
         saleInquiryForm.setOtherFee("是");
         saleInquiryForm.setCarriageUsed("否");
@@ -348,7 +367,7 @@ public class SaleDeliveryController {
     @AutoLog(value = "发货通知单-批量关闭")
     @ApiOperation(value = "发货通知单-批量关闭", notes = "发货通知单-批量关闭")
     @GetMapping(value = "/closeBatch")
-    public Result<String> closeBatch(@RequestParam(name = "ids", required = true) String ids) {
+    public Result<String> closeBatch(@RequestParam(name = "ids", required = true) String ids,String closeReason) {
 
         QueryWrapper<SaleDelivery> queryWrapper = new QueryWrapper<>();
         queryWrapper.in("id", Arrays.asList(ids.split(",")));
@@ -363,11 +382,16 @@ public class SaleDeliveryController {
             // 1-已关闭,0-未关闭
             String close = o.getClose();
             String code = o.getBillCode();
+            String submit = o.getSubmit();//提交(submit)1是0否
 
             if (close != null && close != "" && close.equals("1")) {
                 sb.append("单据编码" + code).append("已关闭,请勿再次关闭;");
                 continue;
             }
+            if (StringUtils.isBlank(submit) || submit.equals("0")) {
+                sb.append("单据编码" + code).append("还未提交,无需关闭;");
+                continue;
+            }
         }
 
         if (StringUtils.isNotBlank(sb.toString())) {
@@ -377,6 +401,7 @@ public class SaleDeliveryController {
 
         SaleDelivery ent = new SaleDelivery();
         ent.setClose("1");
+        ent.setCloseReason(closeReason);
         saleDeliveryService.update(ent, queryWrapper);
 
         return Result.OK("提交关闭!");
@@ -472,10 +497,10 @@ public class SaleDeliveryController {
             querySaleInvoice.eq("del_flag", "0");
 
             List<SaleInvoice> listSaleInvoice = saleInvoiceService.list(querySaleInvoice);
-            if(listSaleInvoice.size() > 0){
+            if (listSaleInvoice.size() > 0) {
                 List<String> codeList = listSaleInvoice.stream().map(SaleInvoice::getInvoiceCode).collect(Collectors.toList());
                 String codes = StringUtils.join(codeList.toArray(), ",");
-                sb.append("单号" + code).append("已被销售发票使用,请勿取消提交"+codes+";");
+                sb.append("单号" + code).append("已被销售发票使用,请勿取消提交" + codes + ";");
                 continue;
             }
 
@@ -484,10 +509,10 @@ public class SaleDeliveryController {
             queryStoreSaleOut.eq("del_flag", "0");
 
             List<StoreSaleOut> listStoreSaleOut = storeSaleOutService.list(queryStoreSaleOut);
-            if(listStoreSaleOut.size() > 0){
+            if (listStoreSaleOut.size() > 0) {
                 List<String> codeList = listStoreSaleOut.stream().map(StoreSaleOut::getBillCode).collect(Collectors.toList());
                 String codes = StringUtils.join(codeList.toArray(), ",");
-                sb.append("单号" + code).append("已被销售出库使用,请勿取消提交"+codes+";");
+                sb.append("单号" + code).append("已被销售出库使用,请勿取消提交" + codes + ";");
                 continue;
             }
 
@@ -635,9 +660,9 @@ public class SaleDeliveryController {
         }
         return Result.OK("文件导入失败!");
     }
+
     /**
      * 导出箱单
-     *
      */
     @RequestMapping(value = "/exportDeliverBillXls")
     public void exportDeliverBillXls(HttpServletResponse response, SaleDelivery saleDelivery) throws Exception {
@@ -646,7 +671,6 @@ public class SaleDeliveryController {
 
     /**
      * 导出随货发票
-     *
      */
     @RequestMapping(value = "/exportInvoiceBillXls")
     public void exportInvoiceBillXls(HttpServletResponse response, SaleDelivery saleDelivery) throws Exception {
@@ -655,7 +679,6 @@ public class SaleDeliveryController {
 
     /**
      * 导出签单
-     *
      */
     @RequestMapping(value = "/exportSignBillXls")
     public void exportSignBillXls(HttpServletResponse response, SaleDelivery saleDelivery) throws Exception {
@@ -664,13 +687,12 @@ public class SaleDeliveryController {
 
     /**
      * 导出唛头
-     *
      */
     @RequestMapping(value = "/exportShippingBillXls")
     public void exportShippingBillXls(HttpServletResponse response, SaleDelivery saleDelivery1) throws Exception {
 
         String templateName = "唛头";
-        String id=saleDelivery1.getId();
+        String id = saleDelivery1.getId();
 
         BaseTemplates templates = baseTemplatesService.getByTemplateType(templateName);
         SaleDelivery saleDelivery = saleDeliveryService.getById(id);
@@ -707,24 +729,24 @@ public class SaleDeliveryController {
                 }
                 // 获取计产品档案
                 List<BaseProductArchive> productArchiveList = new ArrayList<>();
-                if (oConvertUtils.listIsNotEmpty(deliveryDetailsList)){
+                if (oConvertUtils.listIsNotEmpty(deliveryDetailsList)) {
                     LambdaQueryWrapper<BaseProductArchive> productWrapper = new LambdaQueryWrapper<>();
                     productWrapper.in(BaseProductArchive::getId, deliveryDetailsList.stream().map(SaleDeliveryDetails::getProductId).collect(Collectors.toList()));
                     productArchiveList = baseProductArchiveService.list(productWrapper);
                 }
                 // 获取销售订单行
                 List<SaleOrderProduct> saleOrderProductList = new ArrayList<>();
-                if (oConvertUtils.listIsNotEmpty(deliveryDetailsList)){
+                if (oConvertUtils.listIsNotEmpty(deliveryDetailsList)) {
                     LambdaQueryWrapper<SaleOrderProduct> productWrapper = new LambdaQueryWrapper<>();
                     productWrapper.in(SaleOrderProduct::getId, deliveryDetailsList.stream().map(SaleDeliveryDetails::getSourceId).collect(Collectors.toList()));
                     saleOrderProductList = saleOrderProductService.list(productWrapper);
                 }
                 // 获取销售订单
-                if (oConvertUtils.isNotEmpty(saleDelivery.getSourceCode())){
+                if (oConvertUtils.isNotEmpty(saleDelivery.getSourceCode())) {
                     LambdaQueryWrapper<SaleOrder> orderLambdaQueryWrapper = new LambdaQueryWrapper<>();
                     orderLambdaQueryWrapper.eq(SaleOrder::getBillCode, saleDelivery.getSourceCode());
                     SaleOrder saleOrder = saleOrderService.getOne(orderLambdaQueryWrapper);
-                    if (saleOrder != null){
+                    if (saleOrder != null) {
                         saleDelivery.setPaymentTerms(saleOrder.getPaymentTerms());
                         saleDelivery.setOrderNumber(saleOrder.getCustomerOrder());
                         saleDelivery.setAgreementTerms(saleOrder.getAgreementTerms());
@@ -740,28 +762,28 @@ public class SaleDeliveryController {
                 // 产品设置
                 int rowNum = 1;
                 BigDecimal deliverMoney = BigDecimal.ZERO;
-                for(SaleDeliveryDetails o:deliveryDetailsList){
-                    BigDecimal amount = o.getMoney() == null ? BigDecimal.ZERO: o.getMoney();
+                for (SaleDeliveryDetails o : deliveryDetailsList) {
+                    BigDecimal amount = o.getMoney() == null ? BigDecimal.ZERO : o.getMoney();
                     deliverMoney = deliverMoney.add(amount);
                     o.setRowNumber(rowNum++);
-                    if (o.getDeliveryTime() != null){
+                    if (o.getDeliveryTime() != null) {
                         o.setDeliverDateText(DateUtils.date2Str(o.getDeliveryTime(), DateUtils.date_sdf.get()));
                     }
 
-                    BaseProductArchive findProduct = productArchiveList.stream().filter(e->e.getId().equals(o.getProductId())).findFirst().orElse(null);
-                    if (findProduct != null){
+                    BaseProductArchive findProduct = productArchiveList.stream().filter(e -> e.getId().equals(o.getProductId())).findFirst().orElse(null);
+                    if (findProduct != null) {
                         o.setUnit(findProduct.getMeasurementUnit());
-                        if (findProduct.getMeasurementUnit() != null){
-                            DictModel findDict = unitDictList.stream().filter(d->d.getValue().equals(findProduct.getMeasurementUnit())).findFirst().orElse(null);
-                            if (findDict != null){
+                        if (findProduct.getMeasurementUnit() != null) {
+                            DictModel findDict = unitDictList.stream().filter(d -> d.getValue().equals(findProduct.getMeasurementUnit())).findFirst().orElse(null);
+                            if (findDict != null) {
                                 o.setUnit(findDict.getText());
                             }
                         }
                     }
-                    SaleOrderProduct saleOrderProduct = saleOrderProductList.stream().filter(e->e.getId().equals(o.getSourceId())).findFirst().orElse(null);
-                    if (saleOrderProduct != null){
-                        if (oConvertUtils.isNotEmpty(saleOrderProduct.getDiscount()) && saleOrderProduct.getDiscount().intValue() != 0){
-                            o.setDiscountText(saleOrderProduct.getDiscount().intValue()+"%");
+                    SaleOrderProduct saleOrderProduct = saleOrderProductList.stream().filter(e -> e.getId().equals(o.getSourceId())).findFirst().orElse(null);
+                    if (saleOrderProduct != null) {
+                        if (oConvertUtils.isNotEmpty(saleOrderProduct.getDiscount()) && saleOrderProduct.getDiscount().intValue() != 0) {
+                            o.setDiscountText(saleOrderProduct.getDiscount().intValue() + "%");
                         }
                     }
                 }
@@ -771,30 +793,30 @@ public class SaleDeliveryController {
                 String shipname = "";
                 String imo = "";
 
-                if(oConvertUtils.listIsNotEmpty(deliveryShipList)){
+                if (oConvertUtils.listIsNotEmpty(deliveryShipList)) {
 
                     shipname = deliveryShipList.stream().map(SaleDeliveryShip::getShipName).distinct().collect(Collectors.joining());
 
                     LambdaQueryWrapper<BaseShipArchive> shipArchiveLambdaQueryWrapper = new LambdaQueryWrapper<>();
-                    shipArchiveLambdaQueryWrapper.in(BaseShipArchive::getId,deliveryShipList.stream().map(SaleDeliveryShip::getShipId).collect(Collectors.joining()));
+                    shipArchiveLambdaQueryWrapper.in(BaseShipArchive::getId, deliveryShipList.stream().map(SaleDeliveryShip::getShipId).collect(Collectors.joining()));
                     List<BaseShipArchive> baseShipArchiveList = baseShipArchiveService.list(shipArchiveLambdaQueryWrapper);
 
-                    if(oConvertUtils.listIsNotEmpty(baseShipArchiveList)){
+                    if (oConvertUtils.listIsNotEmpty(baseShipArchiveList)) {
                         imo = baseShipArchiveList.stream().map(BaseShipArchive::getImo).distinct().collect(Collectors.joining());
                     }
                 }
                 saleDelivery.setShipName(shipname);
                 saleDelivery.setImo(imo);
                 // 项目名称
-                if (saleDelivery.getProject() != null){
+                if (saleDelivery.getProject() != null) {
                     BaseProjectArchive projectArchive = baseProjectArchiveService.getById(saleDelivery.getProject());
-                    if (projectArchive != null){
+                    if (projectArchive != null) {
                         saleDelivery.setContactsNo(projectArchive.getName());
                     }
 
                 }
 
-                if(deliveryDetailsList.size() > 0){
+                if (deliveryDetailsList.size() > 0) {
 
                     saleDelivery.setQualityGrade(deliveryDetailsList.get(0).getQualityGrade());
                 }
@@ -819,7 +841,7 @@ public class SaleDeliveryController {
         }
     }
 
-    private void exportByDeliver(String templateName, String id, HttpServletResponse response){
+    private void exportByDeliver(String templateName, String id, HttpServletResponse response) {
         BaseTemplates templates = baseTemplatesService.getByTemplateType(templateName);
         SaleDelivery saleDelivery = saleDeliveryService.getById(id);
         List<SaleDeliveryDetails> deliveryDetailsList = saleDeliveryDetailsService.selectByMainId(id);
@@ -850,24 +872,24 @@ public class SaleDeliveryController {
                 }
                 // 获取计产品档案
                 List<BaseProductArchive> productArchiveList = new ArrayList<>();
-                if (oConvertUtils.listIsNotEmpty(deliveryDetailsList)){
+                if (oConvertUtils.listIsNotEmpty(deliveryDetailsList)) {
                     LambdaQueryWrapper<BaseProductArchive> productWrapper = new LambdaQueryWrapper<>();
                     productWrapper.in(BaseProductArchive::getId, deliveryDetailsList.stream().map(SaleDeliveryDetails::getProductId).collect(Collectors.toList()));
                     productArchiveList = baseProductArchiveService.list(productWrapper);
                 }
                 // 获取销售订单行
                 List<SaleOrderProduct> saleOrderProductList = new ArrayList<>();
-                if (oConvertUtils.listIsNotEmpty(deliveryDetailsList)){
+                if (oConvertUtils.listIsNotEmpty(deliveryDetailsList)) {
                     LambdaQueryWrapper<SaleOrderProduct> productWrapper = new LambdaQueryWrapper<>();
                     productWrapper.in(SaleOrderProduct::getId, deliveryDetailsList.stream().map(SaleDeliveryDetails::getSourceId).collect(Collectors.toList()));
                     saleOrderProductList = saleOrderProductService.list(productWrapper);
                 }
                 // 获取销售订单
-                if (oConvertUtils.isNotEmpty(saleDelivery.getSourceCode())){
+                if (oConvertUtils.isNotEmpty(saleDelivery.getSourceCode())) {
                     LambdaQueryWrapper<SaleOrder> orderLambdaQueryWrapper = new LambdaQueryWrapper<>();
                     orderLambdaQueryWrapper.eq(SaleOrder::getBillCode, saleDelivery.getSourceCode());
                     SaleOrder saleOrder = saleOrderService.getOne(orderLambdaQueryWrapper);
-                    if (saleOrder != null){
+                    if (saleOrder != null) {
                         saleDelivery.setPaymentTerms(saleOrder.getPaymentTerms());
                         saleDelivery.setOrderNumber(saleOrder.getCustomerOrder());
                         saleDelivery.setAgreementTerms(saleOrder.getAgreementTerms());
@@ -883,28 +905,28 @@ public class SaleDeliveryController {
                 // 产品设置
                 int rowNum = 1;
                 BigDecimal deliverMoney = BigDecimal.ZERO;
-                for(SaleDeliveryDetails o:deliveryDetailsList){
-                    BigDecimal amount = o.getMoney() == null ? BigDecimal.ZERO: o.getMoney();
+                for (SaleDeliveryDetails o : deliveryDetailsList) {
+                    BigDecimal amount = o.getMoney() == null ? BigDecimal.ZERO : o.getMoney();
                     deliverMoney = deliverMoney.add(amount);
                     o.setRowNumber(rowNum++);
-                    if (o.getDeliveryTime() != null){
+                    if (o.getDeliveryTime() != null) {
                         o.setDeliverDateText(DateUtils.date2Str(o.getDeliveryTime(), DateUtils.date_sdf.get()));
                     }
 
-                    BaseProductArchive findProduct = productArchiveList.stream().filter(e->e.getId().equals(o.getProductId())).findFirst().orElse(null);
-                    if (findProduct != null){
+                    BaseProductArchive findProduct = productArchiveList.stream().filter(e -> e.getId().equals(o.getProductId())).findFirst().orElse(null);
+                    if (findProduct != null) {
                         o.setUnit(findProduct.getMeasurementUnit());
-                        if (findProduct.getMeasurementUnit() != null){
-                            DictModel findDict = unitDictList.stream().filter(d->d.getValue().equals(findProduct.getMeasurementUnit())).findFirst().orElse(null);
-                            if (findDict != null){
+                        if (findProduct.getMeasurementUnit() != null) {
+                            DictModel findDict = unitDictList.stream().filter(d -> d.getValue().equals(findProduct.getMeasurementUnit())).findFirst().orElse(null);
+                            if (findDict != null) {
                                 o.setUnit(findDict.getText());
                             }
                         }
                     }
-                    SaleOrderProduct saleOrderProduct = saleOrderProductList.stream().filter(e->e.getId().equals(o.getSourceId())).findFirst().orElse(null);
-                    if (saleOrderProduct != null){
-                        if (oConvertUtils.isNotEmpty(saleOrderProduct.getDiscount()) && saleOrderProduct.getDiscount().intValue() != 0){
-                            o.setDiscountText(saleOrderProduct.getDiscount().intValue()+"%");
+                    SaleOrderProduct saleOrderProduct = saleOrderProductList.stream().filter(e -> e.getId().equals(o.getSourceId())).findFirst().orElse(null);
+                    if (saleOrderProduct != null) {
+                        if (oConvertUtils.isNotEmpty(saleOrderProduct.getDiscount()) && saleOrderProduct.getDiscount().intValue() != 0) {
+                            o.setDiscountText(saleOrderProduct.getDiscount().intValue() + "%");
                         }
                     }
                 }
@@ -914,30 +936,30 @@ public class SaleDeliveryController {
                 String shipname = "";
                 String imo = "";
 
-                if(oConvertUtils.listIsNotEmpty(deliveryShipList)){
+                if (oConvertUtils.listIsNotEmpty(deliveryShipList)) {
 
                     shipname = deliveryShipList.stream().map(SaleDeliveryShip::getShipName).distinct().collect(Collectors.joining());
 
                     LambdaQueryWrapper<BaseShipArchive> shipArchiveLambdaQueryWrapper = new LambdaQueryWrapper<>();
-                    shipArchiveLambdaQueryWrapper.in(BaseShipArchive::getId,deliveryShipList.stream().map(SaleDeliveryShip::getShipId).collect(Collectors.joining()));
+                    shipArchiveLambdaQueryWrapper.in(BaseShipArchive::getId, deliveryShipList.stream().map(SaleDeliveryShip::getShipId).collect(Collectors.joining()));
                     List<BaseShipArchive> baseShipArchiveList = baseShipArchiveService.list(shipArchiveLambdaQueryWrapper);
 
-                    if(oConvertUtils.listIsNotEmpty(baseShipArchiveList)){
+                    if (oConvertUtils.listIsNotEmpty(baseShipArchiveList)) {
                         imo = baseShipArchiveList.stream().map(BaseShipArchive::getImo).distinct().collect(Collectors.joining());
                     }
                 }
                 saleDelivery.setShipName(shipname);
                 saleDelivery.setImo(imo);
                 // 项目名称
-                if (saleDelivery.getProject() != null){
+                if (saleDelivery.getProject() != null) {
                     BaseProjectArchive projectArchive = baseProjectArchiveService.getById(saleDelivery.getProject());
-                    if (projectArchive != null){
+                    if (projectArchive != null) {
                         saleDelivery.setContactsNo(projectArchive.getName());
                     }
 
                 }
 
-                if(deliveryDetailsList.size() > 0){
+                if (deliveryDetailsList.size() > 0) {
 
                     saleDelivery.setQualityGrade(deliveryDetailsList.get(0).getQualityGrade());
                 }
@@ -946,10 +968,10 @@ public class SaleDeliveryController {
 
                 // 账期
                 saleDelivery.setDueDateText(saleDelivery.getBillDateText());
-                if (oConvertUtils.isNotEmpty(paymentTermsText)){
-                    if (paymentTermsText.indexOf(" ")>-1){
+                if (oConvertUtils.isNotEmpty(paymentTermsText)) {
+                    if (paymentTermsText.indexOf(" ") > -1) {
                         String[] split = paymentTermsText.split(" ");
-                        if (oConvertUtils.getInt(split[0], 0)>0) {
+                        if (oConvertUtils.getInt(split[0], 0) > 0) {
                             saleDelivery.setDueDateText(DateUtils.date2Str(DateUtils.dateAdd(saleDelivery.getDeliveryDate(), Calendar.DATE, Integer.parseInt(split[0])), DateUtils.date_sdf.get()));
                         }
                     }
@@ -960,7 +982,7 @@ public class SaleDeliveryController {
                 saleDelivery.setSalesEmail(sysUser.getEmail());
 
                 String templateFilePath = uploadpath + templates.getTemplateFile();
-                String tempFilePath = uploadpath + "/"+ UUIDGenerator.generate()+".xlsx";
+                String tempFilePath = uploadpath + "/" + UUIDGenerator.generate() + ".xlsx";
 
                 try (ExcelWriter excelWriter = EasyExcel.write(tempFilePath).withTemplate(templateFilePath).build()) {
                     WriteSheet writeSheet = EasyExcel.writerSheet().build();
@@ -969,17 +991,16 @@ public class SaleDeliveryController {
                     excelWriter.fill(saleDelivery, writeSheet);
                 }
                 List<String> noteList = new ArrayList<>();
-                deliveryDetailsList.forEach(p->noteList.add(p.getNotes()));
+                deliveryDetailsList.forEach(p -> noteList.add(p.getNotes()));
 
                 int startIndex = 18;
-                if ("随货发票".equals(templateName)){
+                if ("随货发票".equals(templateName)) {
                     startIndex = 19;
                 }
-                ExcelExportUtils.excelInsertRowNotes(getOutputStream(saleDelivery.getBillCode()+".xlsx", response),
+                ExcelExportUtils.excelInsertRowNotes(getOutputStream(saleDelivery.getBillCode() + ".xlsx", response),
                         tempFilePath, startIndex, noteList, 2, 4);
 
 
-
             } catch (Exception ex) {
                 ex.printStackTrace();
             }

+ 7 - 1
srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleInvoiceController.java

@@ -282,7 +282,7 @@ public class SaleInvoiceController {
     @AutoLog(value = "销售发票-批量作废")
     @ApiOperation(value = "销售发票-批量作废", notes = "销售发票-批量作废")
     @GetMapping(value = "/closeBatch")
-    public Result<String> closeBatch(@RequestParam(name = "ids", required = true) String ids) {
+    public Result<String> closeBatch(@RequestParam(name = "ids", required = true) String ids,String closeReason) {
 
         QueryWrapper<SaleInvoice> queryWrapper = new QueryWrapper<>();
         queryWrapper.in("id", Arrays.asList(ids.split(",")));
@@ -297,11 +297,16 @@ public class SaleInvoiceController {
             // 1-已作废,0-未作废
             String close = o.getClose();
             String code = o.getInvoiceCode();
+            String submit = o.getSubmit();//提交(submit)1是0否
 
             if (close != null && close != "" && close.equals("1")) {
                 sb.append("单据编码" + code).append("已作废,请勿再次作废;");
                 continue;
             }
+            if (StringUtils.isBlank(submit) || submit.equals("0")) {
+                sb.append("单据编码" + code).append("还未提交,无需作废;");
+                continue;
+            }
         }
 
         if (StringUtils.isNotBlank(sb.toString())) {
@@ -311,6 +316,7 @@ public class SaleInvoiceController {
 
         SaleInvoice ent = new SaleInvoice();
         ent.setClose("1");
+        ent.setCloseReason(closeReason);
         saleInvoiceService.update(ent, queryWrapper);
 
         return Result.OK("提交作废!");

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

@@ -742,7 +742,7 @@ public class SaleOrderController {
     @AutoLog(value = "销售订单-批量关闭")
     @ApiOperation(value = "销售订单-批量关闭", notes = "销售订单-批量关闭")
     @GetMapping(value = "/submitClose")
-    public Result<String> submitClose(@RequestParam(name = "ids", required = true) String ids) {
+    public Result<String> submitClose(@RequestParam(name = "ids", required = true) String ids,String closeReason) {
 
         QueryWrapper<SaleOrder> queryWrapper = new QueryWrapper<>();
         queryWrapper.in("id", Arrays.asList(ids.split(",")));
@@ -755,6 +755,7 @@ public class SaleOrderController {
         StringBuffer sb = new StringBuffer();
         for (SaleOrder o : list) {
 
+            String submit = o.getSubmit();//提交(submit)1是0否
             String code = o.getBillCode();
 
             //关闭(close)1是0否
@@ -764,6 +765,10 @@ public class SaleOrderController {
                 sb.append("单号" + code).append("已关闭,无需再次关闭;");
                 continue;
             }
+            if (StringUtils.isBlank(submit) || submit.equals("0")) {
+                sb.append("单据编码" + code).append("还未提交,无需关闭;");
+                continue;
+            }
         }
 
         if (StringUtils.isNotBlank(sb.toString())) {
@@ -773,6 +778,7 @@ public class SaleOrderController {
 
         SaleOrder ent = new SaleOrder();
         ent.setClose("1");
+        ent.setCloseReason(closeReason);
         saleOrderService.update(ent, queryWrapper);
 
         return Result.OK("关闭成功!");

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleContract.java

@@ -37,6 +37,8 @@ public class SaleContract implements Serializable {
     @ApiModelProperty(value = "创建人")
     private String createBy;
     private String sysOrgCode;
+    //关闭原因
+    private String closeReason;
 
 	/**创建时间*/
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleDelivery.java

@@ -36,6 +36,8 @@ public class SaleDelivery implements Serializable {
     @ApiModelProperty(value = "创建人")
     private String createBy;
     private String sysOrgCode;
+    //关闭原因
+    private String closeReason;
 
 	/**创建时间*/
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleInvoice.java

@@ -36,6 +36,8 @@ public class SaleInvoice implements Serializable {
     @ApiModelProperty(value = "创建人")
     private String createBy;
     private String sysOrgCode;
+    //关闭原因
+    private String closeReason;
 
 	/**创建时间*/
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleOrder.java

@@ -48,6 +48,8 @@ public class SaleOrder implements Serializable {
     @ApiModelProperty(value = "创建人")
     private String createBy;
     private String sysOrgCode;
+    //关闭原因
+    private String closeReason;
     //组织  上海/香港
     private String organize;
 

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleContractPage.java

@@ -34,6 +34,8 @@ public class SaleContractPage {
 	@ApiModelProperty(value = "创建人")
     private String createBy;
     private String sysOrgCode;
+	//关闭原因
+	private String closeReason;
 
 	/**创建时间*/
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleDeliveryPage.java

@@ -34,6 +34,8 @@ public class SaleDeliveryPage {
 	@ApiModelProperty(value = "创建人")
     private String createBy;
     private String sysOrgCode;
+	//关闭原因
+	private String closeReason;
 
 	/**创建时间*/
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleInvoicePage.java

@@ -35,6 +35,8 @@ public class SaleInvoicePage {
 	@ApiModelProperty(value = "创建人")
     private String createBy;
     private String sysOrgCode;
+	//关闭原因
+	private String closeReason;
 
 	/**创建时间*/
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleOrderPage.java

@@ -47,6 +47,8 @@ public class SaleOrderPage {
 	@ApiModelProperty(value = "创建人")
     private String createBy;
     private String sysOrgCode;
+	//关闭原因
+	private String closeReason;
 	//组织  上海/香港
 	private String organize;
 	//协议条款