yuansh 2 ماه پیش
والد
کامیت
abe6111fa7
61فایلهای تغییر یافته به همراه3509 افزوده شده و 197 حذف شده
  1. 10 0
      jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java
  2. 8 3
      srm-module-code/src/main/java/org/jeecg/modules/b2bCode/entity/PurOrderB2b.java
  3. 7 13
      srm-module-code/src/main/java/org/jeecg/modules/b2bCode/entity/PurOrderProductB2b.java
  4. 0 3
      srm-module-code/src/main/java/org/jeecg/modules/b2bCode/entity/PurOrderShipB2b.java
  5. 5 0
      srm-module-code/src/main/java/org/jeecg/modules/b2bCode/entity/SaleOrderB2b.java
  6. 4 13
      srm-module-code/src/main/java/org/jeecg/modules/b2bCode/entity/SaleOrderProductB2b.java
  7. 0 3
      srm-module-code/src/main/java/org/jeecg/modules/b2bCode/entity/SaleOrderShipB2b.java
  8. 9 17
      srm-module-code/src/main/java/org/jeecg/modules/b2bCode/vo/PurOrderB2bPage.java
  9. 12 22
      srm-module-code/src/main/java/org/jeecg/modules/b2bCode/vo/SaleOrderB2bPage.java
  10. 332 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurAdvanceCommissionController.java
  11. 320 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurAdvancePaymentController.java
  12. 77 56
      srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurOrderController.java
  13. 132 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurAdvanceCommission.java
  14. 138 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurAdvancePayment.java
  15. 119 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurAdvancePaymentDetails.java
  16. 0 5
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurCommissionRequestDetails.java
  17. 3 5
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurPaymentRequest.java
  18. 0 6
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurPaymentRequestDetails.java
  19. 17 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/mapper/PurAdvanceCommissionMapper.java
  20. 31 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/mapper/PurAdvancePaymentDetailsMapper.java
  21. 17 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/mapper/PurAdvancePaymentMapper.java
  22. 5 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/mapper/xml/PurAdvanceCommissionMapper.xml
  23. 16 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/mapper/xml/PurAdvancePaymentDetailsMapper.xml
  24. 5 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/mapper/xml/PurAdvancePaymentMapper.xml
  25. 14 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/service/IPurAdvanceCommissionService.java
  26. 22 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/service/IPurAdvancePaymentDetailsService.java
  27. 48 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/service/IPurAdvancePaymentService.java
  28. 19 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/service/impl/PurAdvanceCommissionServiceImpl.java
  29. 27 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/service/impl/PurAdvancePaymentDetailsServiceImpl.java
  30. 77 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/service/impl/PurAdvancePaymentServiceImpl.java
  31. 23 2
      srm-module-code/src/main/java/org/jeecg/modules/purCode/service/impl/PurPaymentRequestServiceImpl.java
  32. 134 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurAdvancePaymentPage.java
  33. 4 6
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurCommissionRequestPage.java
  34. 4 6
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurPaymentRequestPage.java
  35. 25 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleInquiryFormController.java
  36. 444 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleInterfaceSyncController.java
  37. 8 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleInvoiceController.java
  38. 3 3
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleOrderController.java
  39. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleQuotationController.java
  40. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleInquiryForm.java
  41. 120 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleInterfaceItem.java
  42. 219 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleInterfaceSync.java
  43. 1 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleOrder.java
  44. 1 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotation.java
  45. 0 4
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotationProduct.java
  46. 0 3
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotationShip.java
  47. 31 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/SaleInterfaceItemMapper.java
  48. 17 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/SaleInterfaceSyncMapper.java
  49. 16 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleInterfaceItemMapper.xml
  50. 5 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleInterfaceSyncMapper.xml
  51. 22 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/ISaleInterfaceItemService.java
  52. 57 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/ISaleInterfaceSyncService.java
  53. 27 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleInterfaceItemServiceImpl.java
  54. 266 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleInterfaceSyncServiceImpl.java
  55. 11 5
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleInvoiceServiceImpl.java
  56. 268 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/util/HttpUtils.java
  57. 218 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleInterfaceSyncPage.java
  58. 3 8
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleQuotationPage.java
  59. 15 0
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/controller/StorePurchaseInController.java
  60. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/IStorePurchaseInService.java
  61. 89 11
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/impl/StorePurchaseInServiceImpl.java

+ 10 - 0
jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -581,6 +581,16 @@ public class DateUtils extends PropertyEditorSupport {
 
     }
 
+    /**
+     * 获取过去的分钟
+     * @param date
+     * @return
+     */
+    public static long pastMinutes(Date date) {
+        long t = new Date().getTime()-date.getTime();
+        return t/(60*1000);
+    }
+
     /**
      * 根据指定的格式将字符串转换成Date 如输入:2003-11-19 11:20:20将按照这个转成时间
      *

+ 8 - 3
srm-module-code/src/main/java/org/jeecg/modules/b2bCode/entity/PurOrderB2b.java

@@ -52,14 +52,17 @@ public class    PurOrderB2b implements Serializable {
     /**客户确认(1-已确认,0-未确认)*/
     @Excel(name = "客户确认(1-已确认,0-未确认)", width = 15)
     @ApiModelProperty(value = "客户确认(1-已确认,0-未确认)")
+    @Dict(dicCode = "customer_confirm")
     private java.lang.Integer status;
     /**提交(submit)1是0否*/
     @Excel(name = "提交(submit)1是0否", width = 15)
     @ApiModelProperty(value = "提交(submit)1是0否")
+    @Dict(dicCode = "yes_or_no")
     private java.lang.String submit;
     /**关闭(close)1是0否*/
     @Excel(name = "关闭(close)1是0否", width = 15)
     @ApiModelProperty(value = "关闭(close)1是0否")
+    @Dict(dicCode = "yes_or_no")
     private java.lang.String close;
     /**删除状态(0-正常,1-已删除)*/
     @Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
@@ -67,9 +70,9 @@ public class    PurOrderB2b implements Serializable {
     @TableLogic
     private java.lang.Integer delFlag;
     /**单据日期*/
-    @Excel(name = "单据日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "单据日期", width = 20, format = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
     @ApiModelProperty(value = "单据日期")
     private java.util.Date billDate;
     /**单据编码*/
@@ -99,10 +102,12 @@ public class    PurOrderB2b implements Serializable {
     /**优先级(priority)*/
     @Excel(name = "优先级(priority)", width = 15)
     @ApiModelProperty(value = "优先级(priority)")
+    @Dict(dicCode = "priority")
     private java.lang.String priority;
     /**产品分类(production class)*/
     @Excel(name = "产品分类(production class)", width = 15)
     @ApiModelProperty(value = "产品分类(production class)")
+    @Dict(dictTable = "base_product_class", dicCode = "id", dicText = "name")
     private java.lang.String productionClass;
     /**机型(model)*/
     @Excel(name = "机型(model)", width = 15)

+ 7 - 13
srm-module-code/src/main/java/org/jeecg/modules/b2bCode/entity/PurOrderProductB2b.java

@@ -50,38 +50,34 @@ public class PurOrderProductB2b implements Serializable {
     @ApiModelProperty(value = "更新时间")
     private java.util.Date updateTime;
     /**状态(1-启用,0-停用)*/
-    @Excel(name = "状态(1-启用,0-停用)", width = 15)
     @ApiModelProperty(value = "状态(1-启用,0-停用)")
     private java.lang.Integer status;
     /**删除状态(0-正常,1-已删除)*/
-    @Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
     @ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
     @TableLogic
     private java.lang.Integer delFlag;
     /**表头主键(销售订单)*/
-    @Excel(name = "表头主键(销售订单)", width = 15)
     @ApiModelProperty(value = "表头主键(销售订单)")
     private java.lang.String headId;
     /**交期*/
-    @Excel(name = "交期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "交期", width = 20, format = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "交期")
     private java.util.Date deliveryTime;
     /**最早发货日期(earliest delivery date)*/
-    @Excel(name = "最早发货日期(earliest delivery date)", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "最早发货日期(earliest delivery date)", width = 20, format = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "最早发货日期(earliest delivery date)")
     private java.util.Date earliestDeliveryDate;
     /**最晚发货日期(latest delivery date)*/
-    @Excel(name = "最晚发货日期(latest delivery date)", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "最晚发货日期(latest delivery date)", width = 20, format = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "最晚发货日期(latest delivery date)")
     private java.util.Date latestDeliveryDate;
     /**产品id*/
-    @Excel(name = "产品id", width = 15)
     @ApiModelProperty(value = "产品id")
     private java.lang.String productId;
     /**产品中文名(chinese name)*/
@@ -131,7 +127,7 @@ public class PurOrderProductB2b implements Serializable {
     /**数量*/
     @Excel(name = "数量", width = 15)
     @ApiModelProperty(value = "数量")
-    private java.lang.Double quantity;
+    private java.math.BigDecimal quantity;
     /**含税单价(tax price)*/
     @Excel(name = "含税单价(tax price)", width = 15)
     @ApiModelProperty(value = "含税单价(tax price)")
@@ -145,11 +141,9 @@ public class PurOrderProductB2b implements Serializable {
     @ApiModelProperty(value = "备注(notes)")
     private java.lang.String notes;
     /**参照来源id*/
-    @Excel(name = "参照来源id", width = 15)
     @ApiModelProperty(value = "参照来源id")
     private java.lang.String sourceId;
     /**参照来源*/
-    @Excel(name = "参照来源", width = 15)
     @ApiModelProperty(value = "参照来源")
     private java.lang.String sourceType;
     /**产品编码*/

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

@@ -49,11 +49,9 @@ public class PurOrderShipB2b implements Serializable {
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
 	/**状态(1-启用,0-停用)*/
-	@Excel(name = "状态(1-启用,0-停用)", width = 15)
     @ApiModelProperty(value = "状态(1-启用,0-停用)")
     private Integer status;
 	/**删除状态(0-正常,1-已删除)*/
-	@Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
     @ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
     @TableLogic
     private Integer delFlag;
@@ -61,7 +59,6 @@ public class PurOrderShipB2b implements Serializable {
     @ApiModelProperty(value = "表头主键(采购订单)")
     private String headId;
 	/**船id*/
-	@Excel(name = "船id", width = 15)
     @ApiModelProperty(value = "船id")
     private String shipId;
 	/**船名*/

+ 5 - 0
srm-module-code/src/main/java/org/jeecg/modules/b2bCode/entity/SaleOrderB2b.java

@@ -51,14 +51,17 @@ public class SaleOrderB2b implements Serializable {
     /**客户确认(1-已确认,0-未确认)*/
     @Excel(name = "客户确认(1-已确认,0-未确认)", width = 15)
     @ApiModelProperty(value = "客户确认(1-已确认,0-未确认)")
+    @Dict(dicCode = "yes_or_no")
     private java.lang.Integer status;
     /**提交(submit)1是0否*/
     @Excel(name = "提交(submit)1是0否", width = 15)
     @ApiModelProperty(value = "提交(submit)1是0否")
+    @Dict(dicCode = "yes_or_no")
     private java.lang.String submit;
     /**关闭(close)1是0否*/
     @Excel(name = "关闭(close)1是0否", width = 15)
     @ApiModelProperty(value = "关闭(close)1是0否")
+    @Dict(dicCode = "yes_or_no")
     private java.lang.String close;
     /**删除状态(0-正常,1-已删除)*/
     @Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
@@ -106,10 +109,12 @@ public class SaleOrderB2b implements Serializable {
     /**优先级(priority)*/
     @Excel(name = "优先级(priority)", width = 15)
     @ApiModelProperty(value = "优先级(priority)")
+    @Dict(dicCode = "priority")
     private java.lang.String priority;
     /**产品分类(production class)*/
     @Excel(name = "产品分类(production class)", width = 15)
     @ApiModelProperty(value = "产品分类(production class)")
+    @Dict(dictTable = "base_product_class", dicCode = "id", dicText = "name")
     private java.lang.String productionClass;
     /**机型(model)*/
     @Excel(name = "机型(model)", width = 15)

+ 4 - 13
srm-module-code/src/main/java/org/jeecg/modules/b2bCode/entity/SaleOrderProductB2b.java

@@ -49,26 +49,22 @@ public class SaleOrderProductB2b implements Serializable {
     @ApiModelProperty(value = "更新时间")
     private java.util.Date updateTime;
     /**状态(1-启用,0-停用)*/
-    @Excel(name = "状态(1-启用,0-停用)", width = 15)
     @ApiModelProperty(value = "状态(1-启用,0-停用)")
     private java.lang.Integer status;
     /**删除状态(0-正常,1-已删除)*/
-    @Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
     @ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
     @TableLogic
     private java.lang.Integer delFlag;
     /**表头主键(销售订单)*/
-    @Excel(name = "表头主键(销售订单)", width = 15)
     @ApiModelProperty(value = "表头主键(销售订单)")
     private java.lang.String headId;
     /**交期*/
-    @Excel(name = "交期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "交期", width = 20, format = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
     @ApiModelProperty(value = "交期")
     private java.util.Date deliveryTime;
     /**产品id*/
-    @Excel(name = "产品id", width = 15)
     @ApiModelProperty(value = "产品id")
     private java.lang.String productId;
     /**产品分类*/
@@ -118,7 +114,7 @@ public class SaleOrderProductB2b implements Serializable {
     /**数量*/
     @Excel(name = "数量", width = 15)
     @ApiModelProperty(value = "数量")
-    private java.lang.Double quantity;
+    private java.math.BigDecimal quantity;
     /**税率(tax rate)*/
     @Excel(name = "税率(tax rate)", width = 15)
     @ApiModelProperty(value = "税率(tax rate)")
@@ -148,15 +144,12 @@ public class SaleOrderProductB2b implements Serializable {
     @ApiModelProperty(value = "备注(notes)")
     private java.lang.String notes;
     /**参照来源id*/
-    @Excel(name = "参照来源id", width = 15)
     @ApiModelProperty(value = "参照来源id")
     private java.lang.String sourceId;
     /**参照来源*/
-    @Excel(name = "参照来源", width = 15)
     @ApiModelProperty(value = "参照来源")
     private java.lang.String sourceType;
     /**来源单据供应商*/
-    @Excel(name = "来源单据供应商", width = 15)
     @ApiModelProperty(value = "来源单据供应商")
     private java.lang.String supplierId;
     /**供应商名称*/
@@ -183,11 +176,9 @@ public class SaleOrderProductB2b implements Serializable {
     @ApiModelProperty(value = "所属部门")
     private java.lang.String sysOrgCode;
     /**已发货数量(发货单参照数量)*/
-    @Excel(name = "已发货数量(发货单参照数量)", width = 15)
     @ApiModelProperty(value = "已发货数量(发货单参照数量)")
     private java.math.BigDecimal deliveryQuantity;
     /**已采购数量(采购单参照数量)*/
-    @Excel(name = "已采购数量(采购单参照数量)", width = 15)
     @ApiModelProperty(value = "已采购数量(采购单参照数量)")
     private java.math.BigDecimal purchaseQuantity;
     /**采购金额*/

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

@@ -49,11 +49,9 @@ public class SaleOrderShipB2b implements Serializable {
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
 	/**状态(1-启用,0-停用)*/
-	@Excel(name = "状态(1-启用,0-停用)", width = 15)
     @ApiModelProperty(value = "状态(1-启用,0-停用)")
     private Integer status;
 	/**删除状态(0-正常,1-已删除)*/
-	@Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
     @ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
     @TableLogic
     private Integer delFlag;
@@ -61,7 +59,6 @@ public class SaleOrderShipB2b implements Serializable {
     @ApiModelProperty(value = "表头主键(销售订单)")
     private String headId;
 	/**船id*/
-	@Excel(name = "船id", width = 15)
     @ApiModelProperty(value = "船id")
     private String shipId;
 	/**船名*/

+ 9 - 17
srm-module-code/src/main/java/org/jeecg/modules/b2bCode/vo/PurOrderB2bPage.java

@@ -46,25 +46,25 @@ public class PurOrderB2bPage {
 	@ApiModelProperty(value = "更新时间")
 	private java.util.Date updateTime;
 	/**客户确认(1-已确认,0-未确认)*/
-	@Excel(name = "客户确认(1-已确认,0-未确认)", width = 15)
+	@Excel(name = "客户确认", width = 15,dicCode = "yes_or_no")
 	@ApiModelProperty(value = "客户确认(1-已确认,0-未确认)")
 	private java.lang.Integer status;
 	/**提交(submit)1是0否*/
-	@Excel(name = "提交(submit)1是0否", width = 15)
+	@Excel(name = "提交(submit)", width = 15,dicCode = "yes_or_no")
 	@ApiModelProperty(value = "提交(submit)1是0否")
 	private java.lang.String submit;
 	/**关闭(close)1是0否*/
-	@Excel(name = "关闭(close)1是0否", width = 15)
+	@Excel(name = "关闭(close)", width = 15,dicCode = "yes_or_no")
 	@ApiModelProperty(value = "关闭(close)1是0否")
 	private java.lang.String close;
 	/**删除状态(0-正常,1-已删除)*/
-	@Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
+//	@Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
 	@ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
 	private java.lang.Integer delFlag;
 	/**单据日期*/
-	@Excel(name = "单据日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	@Excel(name = "单据日期", width = 20, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern="yyyy-MM-dd")
 	@ApiModelProperty(value = "单据日期")
 	private java.util.Date billDate;
 	/**单据编码*/
@@ -72,7 +72,6 @@ public class PurOrderB2bPage {
 	@ApiModelProperty(value = "单据编码")
 	private java.lang.String billCode;
 	/**项目(project)*/
-	@Excel(name = "项目(project)", width = 15)
 	@ApiModelProperty(value = "项目(project)")
 	private java.lang.String project;
 	/**项目名称*/
@@ -80,7 +79,6 @@ public class PurOrderB2bPage {
 	@ApiModelProperty(value = "项目名称")
 	private java.lang.String projectName;
 	/**供应商(supplier)*/
-	@Excel(name = "供应商(supplier)", width = 15)
 	@ApiModelProperty(value = "供应商(supplier)")
 	private java.lang.String supplier;
 	/**供应商名称*/
@@ -92,11 +90,11 @@ public class PurOrderB2bPage {
 	@ApiModelProperty(value = "业务类型(busyness type)")
 	private java.lang.String busynessType;
 	/**优先级(priority)*/
-	@Excel(name = "优先级(priority)", width = 15)
+	@Excel(name = "优先级(priority)", width = 15, dicCode = "priority")
 	@ApiModelProperty(value = "优先级(priority)")
 	private java.lang.String priority;
 	/**产品分类(production class)*/
-	@Excel(name = "产品分类(production class)", width = 15)
+	@Excel(name = "产品分类(production class)", width = 15,dictTable = "base_product_class", dicCode = "id", dicText = "name")
 	@ApiModelProperty(value = "产品分类(production class)")
 	private java.lang.String productionClass;
 	/**机型(model)*/
@@ -156,11 +154,9 @@ public class PurOrderB2bPage {
 	@ApiModelProperty(value = "汇率(exchange rate)")
 	private java.math.BigDecimal exchangeRate;
 	/**采购员(purchaseman)*/
-	@Excel(name = "采购员(purchaseman)", width = 15)
 	@ApiModelProperty(value = "采购员(purchaseman)")
 	private java.lang.String purchaseman;
 	/**采购部门(purchase department)*/
-	@Excel(name = "采购部门(purchase department)", width = 15)
 	@ApiModelProperty(value = "采购部门(purchase department)")
 	private java.lang.String purchaseDepartment;
 	/**币种(currency)*/
@@ -172,11 +168,9 @@ public class PurOrderB2bPage {
 	@ApiModelProperty(value = "备注(notes)")
 	private java.lang.String notes;
 	/**附件(attachs)*/
-	@Excel(name = "附件(attachs)", width = 15)
 	@ApiModelProperty(value = "附件(attachs)")
 	private java.lang.String attachs;
 	/**版本号*/
-	@Excel(name = "版本号", width = 15)
 	@ApiModelProperty(value = "版本号")
 	private java.lang.String version;
 	/**来源*/
@@ -221,11 +215,9 @@ public class PurOrderB2bPage {
 	@ApiModelProperty(value = "订单总金额")
 	private java.math.BigDecimal totalAmount;
 	/**订单总金额(已被付款申请参照金额)*/
-	@Excel(name = "订单总金额(已被付款申请参照金额)", width = 15)
 	@ApiModelProperty(value = "订单总金额(已被付款申请参照金额)")
 	private java.math.BigDecimal totalAmountUsed;
 	/**1是 0否*/
-	@Excel(name = "1是 0否", width = 15)
 	@ApiModelProperty(value = "1是 0否")
 	private java.lang.Integer b2b;
 	/**整单折扣*/

+ 12 - 22
srm-module-code/src/main/java/org/jeecg/modules/b2bCode/vo/SaleOrderB2bPage.java

@@ -47,25 +47,24 @@ public class SaleOrderB2bPage {
 	@ApiModelProperty(value = "更新时间")
 	private java.util.Date updateTime;
 	/**客户确认(1-已确认,0-未确认)*/
-	@Excel(name = "客户确认(1-已确认,0-未确认)", width = 15)
+	@Excel(name = "客户确认", width = 15,dicCode = "yes_or_no")
 	@ApiModelProperty(value = "客户确认(1-已确认,0-未确认)")
 	private java.lang.Integer status;
 	/**提交(submit)1是0否*/
-	@Excel(name = "提交(submit)1是0否", width = 15)
+	@Excel(name = "提交(submit)", width = 15,dicCode = "yes_or_no")
 	@ApiModelProperty(value = "提交(submit)1是0否")
 	private java.lang.String submit;
 	/**关闭(close)1是0否*/
-	@Excel(name = "关闭(close)1是0否", width = 15)
+	@Excel(name = "关闭(close)", width = 15,dicCode = "yes_or_no")
 	@ApiModelProperty(value = "关闭(close)1是0否")
 	private java.lang.String close;
 	/**删除状态(0-正常,1-已删除)*/
-	@Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
 	@ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
 	private java.lang.Integer delFlag;
 	/**单据日期*/
-	@Excel(name = "单据日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	@Excel(name = "单据日期", width = 20, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern="yyyy-MM-dd")
 	@ApiModelProperty(value = "单据日期")
 	private java.util.Date billDate;
 	/**单据编码*/
@@ -73,7 +72,6 @@ public class SaleOrderB2bPage {
 	@ApiModelProperty(value = "单据编码")
 	private java.lang.String billCode;
 	/**项目(project)*/
-	@Excel(name = "项目(project)", width = 15)
 	@ApiModelProperty(value = "项目(project)")
 	private java.lang.String project;
 	/**项目名称*/
@@ -81,7 +79,6 @@ public class SaleOrderB2bPage {
 	@ApiModelProperty(value = "项目名称")
 	private java.lang.String projectName;
 	/**客户(customer)*/
-	@Excel(name = "客户(customer)", width = 15)
 	@ApiModelProperty(value = "客户(customer)")
 	private java.lang.String customer;
 	/**客户名称*/
@@ -93,7 +90,6 @@ public class SaleOrderB2bPage {
 	@ApiModelProperty(value = "业务类型(busyness type)")
 	private java.lang.String busynessType;
 	/**中间人(intermediator)*/
-	@Excel(name = "中间人(intermediator)", width = 15)
 	@ApiModelProperty(value = "中间人(intermediator)")
 	private java.lang.String intermediator;
 	/**中间人名称*/
@@ -101,11 +97,11 @@ public class SaleOrderB2bPage {
 	@ApiModelProperty(value = "中间人名称")
 	private java.lang.String intermediatorName;
 	/**优先级(priority)*/
-	@Excel(name = "优先级(priority)", width = 15)
+	@Excel(name = "优先级(priority)", width = 15, dicCode = "priority")
 	@ApiModelProperty(value = "优先级(priority)")
 	private java.lang.String priority;
 	/**产品分类(production class)*/
-	@Excel(name = "产品分类(production class)", width = 15)
+	@Excel(name = "产品分类(production class)", width = 15,dictTable = "base_product_class", dicCode = "id", dicText = "name")
 	@ApiModelProperty(value = "产品分类(production class)")
 	private java.lang.String productionClass;
 	/**机型(model)*/
@@ -133,9 +129,9 @@ public class SaleOrderB2bPage {
 	@ApiModelProperty(value = "付款条件(payment terms)")
 	private java.lang.String paymentTerms;
 	/**交期(delivery time)*/
-	@Excel(name = "交期(delivery time)", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	@Excel(name = "交期(delivery time)", width = 20, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern="yyyy-MM-dd")
 	@ApiModelProperty(value = "交期(delivery time)")
 	private java.util.Date deliveryTime;
 	/**发货方式(delivery)*/
@@ -159,7 +155,7 @@ public class SaleOrderB2bPage {
 	@ApiModelProperty(value = "质保期(warranty period)")
 	private java.lang.String warrantyPeriod;
 	/**是否出口(export) 1是0否*/
-	@Excel(name = "是否出口(export) 1是0否", width = 15)
+	@Excel(name = "是否出口(export)", width = 15,dicCode = "yes_or_no")
 	@ApiModelProperty(value = "是否出口(export) 1是0否")
 	private java.lang.String isExport;
 	/**包装要求(packageb requirement)*/
@@ -167,11 +163,9 @@ public class SaleOrderB2bPage {
 	@ApiModelProperty(value = "包装要求(packageb requirement)")
 	private java.lang.String packagebRequirement;
 	/**销售部门(sale department)*/
-	@Excel(name = "销售部门(sale department)", width = 15)
 	@ApiModelProperty(value = "销售部门(sale department)")
 	private java.lang.String saleDepartment;
 	/**业务员(salesman)*/
-	@Excel(name = "业务员(salesman)", width = 15)
 	@ApiModelProperty(value = "业务员(salesman)")
 	private java.lang.String salesman;
 	/**销售部门(sale department)名称*/
@@ -183,7 +177,6 @@ public class SaleOrderB2bPage {
 	@ApiModelProperty(value = "业务员(salesman)名称")
 	private java.lang.String salesmanName;
 	/**附件(attachs)*/
-	@Excel(name = "附件(attachs)", width = 15)
 	@ApiModelProperty(value = "附件(attachs)")
 	private java.lang.String attachs;
 	/**备注(notes)*/
@@ -211,7 +204,6 @@ public class SaleOrderB2bPage {
 	@ApiModelProperty(value = "预付比例(advance ratio)")
 	private java.lang.String advanceRatio;
 	/**版本号*/
-	@Excel(name = "版本号", width = 15)
 	@ApiModelProperty(value = "版本号")
 	private java.lang.String version;
 	/**订单金额(order money)*/
@@ -264,7 +256,6 @@ public class SaleOrderB2bPage {
 	@ApiModelProperty(value = "协议条款")
 	private java.lang.String agreementTerms;
 	/**1是 0否*/
-	@Excel(name = "1是 0否", width = 15)
 	@ApiModelProperty(value = "1是 0否")
 	private java.lang.Integer b2b;
 	/**船名*/
@@ -276,7 +267,6 @@ public class SaleOrderB2bPage {
 	@ApiModelProperty(value = "imo")
 	private java.lang.String imo;
 	/**联系人主键*/
-	@Excel(name = "联系人主键", width = 15)
 	@ApiModelProperty(value = "联系人主键")
 	private java.lang.String liaisonId;
 	/**联系人信息*/

+ 332 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurAdvanceCommissionController.java

@@ -0,0 +1,332 @@
+package org.jeecg.modules.purCode.controller;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang.StringUtils;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.query.QueryRuleEnum;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.baseCode.service.ISerialPatternService;
+import org.jeecg.modules.purCode.entity.PurAdvanceCommission;
+import org.jeecg.modules.purCode.entity.PurDeliveryNote;
+import org.jeecg.modules.purCode.entity.PurAdvanceCommission;
+import org.jeecg.modules.purCode.entity.PurPaymentRequest;
+import org.jeecg.modules.purCode.service.IPurAdvanceCommissionService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+
+ /**
+ * @Description: 佣金预付款
+ * @Author: jeecg-boot
+ * @Date:   2025-04-24
+ * @Version: V1.0
+ */
+@Api(tags="佣金预付款")
+@RestController
+@RequestMapping("/purCode/purAdvanceCommission")
+@Slf4j
+public class PurAdvanceCommissionController extends JeecgController<PurAdvanceCommission, IPurAdvanceCommissionService> {
+	@Autowired
+	private IPurAdvanceCommissionService purAdvanceCommissionService;
+	 @Autowired
+	 private ISerialPatternService serialPatternService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param purAdvanceCommission
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "佣金预付款-分页列表查询")
+	@ApiOperation(value="佣金预付款-分页列表查询", notes="佣金预付款-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<PurAdvanceCommission>> queryPageList(PurAdvanceCommission purAdvanceCommission,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+        // 自定义查询规则
+        Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
+        // 自定义多选的查询规则为:LIKE_WITH_OR
+        customeRuleMap.put("commissionType", QueryRuleEnum.LIKE_WITH_OR);
+        QueryWrapper<PurAdvanceCommission> queryWrapper = QueryGenerator.initQueryWrapper(purAdvanceCommission, req.getParameterMap(),customeRuleMap);
+		Page<PurAdvanceCommission> page = new Page<PurAdvanceCommission>(pageNo, pageSize);
+		IPage<PurAdvanceCommission> pageList = purAdvanceCommissionService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param purAdvanceCommission
+	 * @return
+	 */
+	@AutoLog(value = "佣金预付款-添加")
+	@ApiOperation(value="佣金预付款-添加", notes="佣金预付款-添加")
+	@RequiresPermissions("purCode:pur_advance_commission:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody PurAdvanceCommission purAdvanceCommission) {
+
+		String code = purAdvanceCommission.getBillCode();
+		if (StringUtils.isNotBlank(code)) {
+
+			QueryWrapper<PurAdvanceCommission> queryWrapper = new QueryWrapper();
+			queryWrapper.eq("bill_code", code);
+			queryWrapper.eq("del_flag", "0");
+
+			List<PurAdvanceCommission> list = purAdvanceCommissionService.list(queryWrapper);
+			if (list.size() != 0) {
+				return Result.error("佣金预付款编码重复,请修改!");
+			}
+		} else {
+
+			Result<String> result = serialPatternService.getNextSerial("pur_advance_commission", "bill_code");
+			if (!result.isSuccess()) {
+				return result;
+			}
+			purAdvanceCommission.setBillCode(result.getMessage());
+		}
+
+		purAdvanceCommissionService.save(purAdvanceCommission);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param purAdvanceCommission
+	 * @return
+	 */
+	@AutoLog(value = "佣金预付款-编辑")
+	@ApiOperation(value="佣金预付款-编辑", notes="佣金预付款-编辑")
+	@RequiresPermissions("purCode:pur_advance_commission:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody PurAdvanceCommission purAdvanceCommission) {
+		purAdvanceCommissionService.updateById(purAdvanceCommission);
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "佣金预付款-通过id删除")
+	@ApiOperation(value="佣金预付款-通过id删除", notes="佣金预付款-通过id删除")
+	@RequiresPermissions("purCode:pur_advance_commission:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+
+		PurAdvanceCommission order = purAdvanceCommissionService.getById(id);
+		if (order == null) {
+			return Result.error("未找到对应数据");
+		}
+		String submit = order.getSubmit();
+		if (StringUtils.isNotBlank(submit) && submit.equals("1")) {
+			return Result.error("已提交的数据无法删除");
+		}
+
+		purAdvanceCommissionService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "佣金预付款-批量删除")
+	@ApiOperation(value="佣金预付款-批量删除", notes="佣金预付款-批量删除")
+	@RequiresPermissions("purCode:pur_advance_commission:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+
+		for (String o : ids.split(",")) {
+			PurAdvanceCommission order = purAdvanceCommissionService.getById(o);
+			if (order == null) {
+				return Result.error("未找到对应数据");
+			}
+			String submit = order.getSubmit();
+			if (StringUtils.isNotBlank(submit) && submit.equals("1")) {
+				return Result.error("单号" + order.getBillCode() + "已提交,无法删除");
+			}
+		}
+
+		this.purAdvanceCommissionService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+
+	 /**
+	  * 批量提交
+	  *
+	  * @param ids
+	  * @return
+	  */
+	 @AutoLog(value = "佣金预付款-批量提交")
+	 @ApiOperation(value = "佣金预付款-批量提交", notes = "佣金预付款-批量提交")
+	 @GetMapping(value = "/submitBatch")
+	 public Result<String> submitBatch(@RequestParam(name = "ids", required = true) String ids) {
+
+		 QueryWrapper<PurAdvanceCommission> queryWrapper = new QueryWrapper<>();
+		 queryWrapper.in("id", Arrays.asList(ids.split(",")));
+
+		 List<PurAdvanceCommission> list = purAdvanceCommissionService.list(queryWrapper);
+		 if (list.size() == 0) {
+			 return Result.error("数据为空!");
+		 }
+
+		 StringBuffer sb = new StringBuffer();
+		 for (PurAdvanceCommission o : list) {
+			 // 1-已提交,0-未提交
+			 String submit = o.getSubmit();
+			 String code = o.getBillCode();
+
+			 if (submit != null && submit != "" && submit.equals("1")) {
+				 sb.append("单据编码" + code).append("已提交,请勿再次提交;");
+				 continue;
+			 }
+		 }
+
+		 if (StringUtils.isNotBlank(sb.toString())) {
+
+			 return Result.error(sb.toString());
+		 }
+
+		 PurAdvanceCommission ent = new PurAdvanceCommission();
+		 ent.setSubmit("1");
+		 purAdvanceCommissionService.update(ent, queryWrapper);
+
+		 return Result.OK("提交成功!");
+	 }
+
+	 /**
+	  * 批量取消提交
+	  *
+	  * @param ids
+	  * @return
+	  */
+	 @AutoLog(value = "佣金预付款-批量取消提交")
+	 @ApiOperation(value = "佣金预付款-批量取消提交", notes = "佣金预付款-批量取消提交")
+	 @GetMapping(value = "/returnSubmitBatch")
+	 public Result<String> returnSubmitBatch(@RequestParam(name = "ids", required = true) String ids) {
+
+		 QueryWrapper<PurAdvanceCommission> queryWrapper = new QueryWrapper<>();
+		 queryWrapper.in("id", Arrays.asList(ids.split(",")));
+
+		 List<PurAdvanceCommission> list = purAdvanceCommissionService.list(queryWrapper);
+		 if (list.size() == 0) {
+			 return Result.error("数据为空!");
+		 }
+
+		 StringBuffer sb = new StringBuffer();
+		 for (PurAdvanceCommission o : list) {
+			 //提交(1-是 ,0-否)
+			 String submit = o.getSubmit();
+			 String code = o.getBillCode();
+			 //付款(payment)1是0否
+			 String payment = o.getPayment();
+			 //审批(approve)(1-是,0-否)
+			 String approve = o.getApprove();
+			 if (submit == null || submit == "" || submit.equals("0")) {
+				 sb.append("单号" + code).append("已取消提交,请勿再次取消提交;");
+				 continue;
+			 }
+			 if (payment == null || payment == "" || payment.equals("1")) {
+				 sb.append("单号" + code).append("已付款,请勿取消提交;");
+				 continue;
+			 }
+			 if (approve == null || approve == "" || approve.equals("1")) {
+				 sb.append("单号" + code).append("已审批,请勿取消提交;");
+				 continue;
+			 }
+
+		 }
+
+		 if (StringUtils.isNotBlank(sb.toString())) {
+
+			 return Result.error(sb.toString());
+		 }
+
+		 PurAdvanceCommission ent = new PurAdvanceCommission();
+		 ent.setSubmit("0");
+		 purAdvanceCommissionService.update(ent, queryWrapper);
+
+		 return Result.OK("取消提交成功!");
+	 }
+	 /**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "佣金预付款-通过id查询")
+	@ApiOperation(value="佣金预付款-通过id查询", notes="佣金预付款-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<PurAdvanceCommission> queryById(@RequestParam(name="id",required=true) String id) {
+		PurAdvanceCommission purAdvanceCommission = purAdvanceCommissionService.getById(id);
+		if(purAdvanceCommission==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(purAdvanceCommission);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param purAdvanceCommission
+    */
+    @RequiresPermissions("purCode:pur_advance_commission:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, PurAdvanceCommission purAdvanceCommission) {
+        return super.exportXls(request, purAdvanceCommission, PurAdvanceCommission.class, "佣金预付款");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    @RequiresPermissions("purCode:pur_advance_commission:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, PurAdvanceCommission.class);
+    }
+
+}

+ 320 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurAdvancePaymentController.java

@@ -0,0 +1,320 @@
+package org.jeecg.modules.purCode.controller;
+
+import java.io.UnsupportedEncodingException;
+import java.io.IOException;
+import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.HashMap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang.StringUtils;
+import org.jeecg.modules.baseCode.service.ISerialPatternService;
+import org.jeecg.modules.purCode.entity.PurAdvanceCommission;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.vo.LoginUser;
+import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.query.QueryRuleEnum;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.purCode.entity.PurAdvancePaymentDetails;
+import org.jeecg.modules.purCode.entity.PurAdvancePayment;
+import org.jeecg.modules.purCode.vo.PurAdvancePaymentPage;
+import org.jeecg.modules.purCode.service.IPurAdvancePaymentService;
+import org.jeecg.modules.purCode.service.IPurAdvancePaymentDetailsService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+
+
+ /**
+ * @Description: 采购预付款
+ * @Author: jeecg-boot
+ * @Date:   2025-04-24
+ * @Version: V1.0
+ */
+@Api(tags="采购预付款")
+@RestController
+@RequestMapping("/purCode/purAdvancePayment")
+@Slf4j
+public class PurAdvancePaymentController {
+	@Autowired
+	private IPurAdvancePaymentService purAdvancePaymentService;
+	@Autowired
+	private IPurAdvancePaymentDetailsService purAdvancePaymentDetailsService;
+	 @Autowired
+	 private ISerialPatternService serialPatternService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param purAdvancePayment
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "采购预付款-分页列表查询")
+	@ApiOperation(value="采购预付款-分页列表查询", notes="采购预付款-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<PurAdvancePayment>> queryPageList(PurAdvancePayment purAdvancePayment,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+        // 自定义查询规则
+        Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
+        // 自定义多选的查询规则为:LIKE_WITH_OR
+        customeRuleMap.put("approve", QueryRuleEnum.LIKE_WITH_OR);
+        customeRuleMap.put("submit", QueryRuleEnum.LIKE_WITH_OR);
+        customeRuleMap.put("payment", QueryRuleEnum.LIKE_WITH_OR);
+        QueryWrapper<PurAdvancePayment> queryWrapper = QueryGenerator.initQueryWrapper(purAdvancePayment, req.getParameterMap(),customeRuleMap);
+		Page<PurAdvancePayment> page = new Page<PurAdvancePayment>(pageNo, pageSize);
+		IPage<PurAdvancePayment> pageList = purAdvancePaymentService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param purAdvancePaymentPage
+	 * @return
+	 */
+	@AutoLog(value = "采购预付款-添加")
+	@ApiOperation(value="采购预付款-添加", notes="采购预付款-添加")
+    @RequiresPermissions("purCode:pur_advance_payment:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody PurAdvancePaymentPage purAdvancePaymentPage) {
+		PurAdvancePayment purAdvancePayment = new PurAdvancePayment();
+		BeanUtils.copyProperties(purAdvancePaymentPage, purAdvancePayment);
+
+		String code = purAdvancePayment.getBillCode();
+		if (StringUtils.isNotBlank(code)) {
+
+			QueryWrapper<PurAdvancePayment> queryWrapper = new QueryWrapper();
+			queryWrapper.eq("bill_code", code);
+			queryWrapper.eq("del_flag", "0");
+
+			List<PurAdvancePayment> list = purAdvancePaymentService.list(queryWrapper);
+			if (list.size() != 0) {
+				return Result.error("采购预付款编码重复,请修改!");
+			}
+		} else {
+
+			Result<String> result = serialPatternService.getNextSerial("pur_advance_payment", "bill_code");
+			if (!result.isSuccess()) {
+				return result;
+			}
+			purAdvancePayment.setBillCode(result.getMessage());
+		}
+
+		purAdvancePaymentService.saveMain(purAdvancePayment, purAdvancePaymentPage.getPurAdvancePaymentDetailsList());
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param purAdvancePaymentPage
+	 * @return
+	 */
+	@AutoLog(value = "采购预付款-编辑")
+	@ApiOperation(value="采购预付款-编辑", notes="采购预付款-编辑")
+    @RequiresPermissions("purCode:pur_advance_payment:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody PurAdvancePaymentPage purAdvancePaymentPage) {
+		PurAdvancePayment purAdvancePayment = new PurAdvancePayment();
+		BeanUtils.copyProperties(purAdvancePaymentPage, purAdvancePayment);
+		PurAdvancePayment purAdvancePaymentEntity = purAdvancePaymentService.getById(purAdvancePayment.getId());
+		if(purAdvancePaymentEntity==null) {
+			return Result.error("未找到对应数据");
+		}
+		purAdvancePaymentService.updateMain(purAdvancePayment, purAdvancePaymentPage.getPurAdvancePaymentDetailsList());
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "采购预付款-通过id删除")
+	@ApiOperation(value="采购预付款-通过id删除", notes="采购预付款-通过id删除")
+    @RequiresPermissions("purCode:pur_advance_payment:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+
+		PurAdvancePayment order = purAdvancePaymentService.getById(id);
+		if (order == null) {
+			return Result.error("未找到对应数据");
+		}
+		String submit = order.getSubmit();
+		if (StringUtils.isNotBlank(submit) && submit.equals("1")) {
+			return Result.error("已提交的数据无法删除");
+		}
+		purAdvancePaymentService.delMain(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "采购预付款-批量删除")
+	@ApiOperation(value="采购预付款-批量删除", notes="采购预付款-批量删除")
+    @RequiresPermissions("purCode:pur_advance_payment:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		for (String o : ids.split(",")) {
+			PurAdvancePayment order = purAdvancePaymentService.getById(o);
+			if (order == null) {
+				return Result.error("未找到对应数据");
+			}
+			String submit = order.getSubmit();
+			if (StringUtils.isNotBlank(submit) && submit.equals("1")) {
+				return Result.error("单号" + order.getBillCode() + "已提交,无法删除");
+			}
+		}
+		this.purAdvancePaymentService.delBatchMain(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "采购预付款-通过id查询")
+	@ApiOperation(value="采购预付款-通过id查询", notes="采购预付款-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<PurAdvancePayment> queryById(@RequestParam(name="id",required=true) String id) {
+		PurAdvancePayment purAdvancePayment = purAdvancePaymentService.getById(id);
+		if(purAdvancePayment==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(purAdvancePayment);
+
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "采购预付款-子表通过主表ID查询")
+	@ApiOperation(value="采购预付款-子表主表ID查询", notes="采购预付款-子表-通主表ID查询")
+	@GetMapping(value = "/queryPurAdvancePaymentDetailsByMainId")
+	public Result<List<PurAdvancePaymentDetails>> queryPurAdvancePaymentDetailsListByMainId(@RequestParam(name="id",required=true) String id) {
+		List<PurAdvancePaymentDetails> purAdvancePaymentDetailsList = purAdvancePaymentDetailsService.selectByMainId(id);
+		return Result.OK(purAdvancePaymentDetailsList);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param purAdvancePayment
+    */
+    @RequiresPermissions("purCode:pur_advance_payment:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, PurAdvancePayment purAdvancePayment) {
+      // Step.1 组装查询条件查询数据
+      QueryWrapper<PurAdvancePayment> queryWrapper = QueryGenerator.initQueryWrapper(purAdvancePayment, request.getParameterMap());
+      LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+
+      //配置选中数据查询条件
+      String selections = request.getParameter("selections");
+      if(oConvertUtils.isNotEmpty(selections)) {
+         List<String> selectionList = Arrays.asList(selections.split(","));
+         queryWrapper.in("id",selectionList);
+      }
+      //Step.2 获取导出数据
+      List<PurAdvancePayment> purAdvancePaymentList = purAdvancePaymentService.list(queryWrapper);
+
+      // Step.3 组装pageList
+      List<PurAdvancePaymentPage> pageList = new ArrayList<PurAdvancePaymentPage>();
+      for (PurAdvancePayment main : purAdvancePaymentList) {
+          PurAdvancePaymentPage vo = new PurAdvancePaymentPage();
+          BeanUtils.copyProperties(main, vo);
+          List<PurAdvancePaymentDetails> purAdvancePaymentDetailsList = purAdvancePaymentDetailsService.selectByMainId(main.getId());
+          vo.setPurAdvancePaymentDetailsList(purAdvancePaymentDetailsList);
+          pageList.add(vo);
+      }
+
+      // Step.4 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      mv.addObject(NormalExcelConstants.FILE_NAME, "采购预付款列表");
+      mv.addObject(NormalExcelConstants.CLASS, PurAdvancePaymentPage.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("采购预付款数据", "导出人:"+sysUser.getRealname(), "采购预付款"));
+      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+      return mv;
+    }
+
+    /**
+    * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    @RequiresPermissions("purCode:pur_advance_payment:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          // 获取上传文件对象
+          MultipartFile file = entity.getValue();
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<PurAdvancePaymentPage> list = ExcelImportUtil.importExcel(file.getInputStream(), PurAdvancePaymentPage.class, params);
+              for (PurAdvancePaymentPage page : list) {
+                  PurAdvancePayment po = new PurAdvancePayment();
+                  BeanUtils.copyProperties(page, po);
+                  purAdvancePaymentService.saveMain(po, page.getPurAdvancePaymentDetailsList());
+              }
+              return Result.OK("文件导入成功!数据行数:" + list.size());
+          } catch (Exception e) {
+              log.error(e.getMessage(),e);
+              return Result.error("文件导入失败:"+e.getMessage());
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.OK("文件导入失败!");
+    }
+
+}

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

@@ -135,7 +135,7 @@ public class PurOrderController {
     //@AutoLog(value = "采购订单-分页列表查询")
     @ApiOperation(value = "采购订单-分页列表查询", notes = "采购订单-分页列表查询")
     @GetMapping(value = "/list")
-    @PermissionData(pageComponent="purchase/purchaseOrder/PurchaseOrderFormList")
+    @PermissionData(pageComponent = "purchase/purchaseOrder/PurchaseOrderFormList")
     public Result<IPage<PurOrder>> queryPageList(PurOrder purOrder,
                                                  @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                  @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
@@ -160,6 +160,20 @@ public class PurOrderController {
         return Result.OK(pageList);
     }
 
+    @ApiOperation(value = "采购订单-分页列表查询(采购预付款申请使用)", notes = "采购订单-分页列表查询(采购预付款使用)")
+    @GetMapping(value = "/listAlertAdvance")
+    @PermissionData(pageComponent = "purchase/purchaseOrder/PurchaseOrderFormList")
+    public Result<IPage<PurOrder>> listAlertAdvance(PurOrder purOrder,
+                                             @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                             @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                             HttpServletRequest req) {
+        QueryWrapper<PurOrder> queryWrapper = QueryGenerator.initQueryWrapper(purOrder, req.getParameterMap());
+        Page<PurOrder> page = new Page<PurOrder>(pageNo, pageSize);
+//        queryWrapper.apply("discount_amount > IFNULL(total_amount_used, 0)");
+        IPage<PurOrder> pageList = purOrderService.page(page, queryWrapper);
+        return Result.OK(pageList);
+    }
+
     /**
      * 采购订单弹框明细(到货单使用)
      *
@@ -171,7 +185,7 @@ public class PurOrderController {
      */
     @ApiOperation(value = "采购订单弹框明细", notes = "采购订单弹框明细")
     @GetMapping(value = "/selectPurOrderDetailAlert")
-    @PermissionData(pageComponent="purchase/purchaseOrder/PurchaseOrderFormList")
+    @PermissionData(pageComponent = "purchase/purchaseOrder/PurchaseOrderFormList")
     public Result<IPage<PurOrderAlert>> selectContractDetailAlert(PurOrderAlert saleInquiryForm,
                                                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
@@ -281,7 +295,7 @@ public class PurOrderController {
 
         List<PurOrderShip> purOrderShipListOld = purOrderShipService.selectByMainId(purOrder.getId());
         List<PurOrderShipHis> purOrderShipHisList = new ArrayList<>();
-        if (purOrderShipListOld !=null && purOrderShipListOld.size() > 0) {
+        if (purOrderShipListOld != null && purOrderShipListOld.size() > 0) {
             for (PurOrderShip o : purOrderShipListOld) {
                 PurOrderShipHis his = new PurOrderShipHis();
                 BeanUtils.copyProperties(o, his);
@@ -294,7 +308,7 @@ public class PurOrderController {
 
         List<PurOrderProduct> purOrderProductListOld = purOrderProductService.selectByMainId(purOrder.getId());
         List<PurOrderProductHis> purOrderProductList = new ArrayList<>();
-        if (purOrderProductListOld !=null && purOrderProductListOld.size() > 0) {
+        if (purOrderProductListOld != null && purOrderProductListOld.size() > 0) {
 
             for (PurOrderProduct o : purOrderProductListOld) {
                 PurOrderProductHis his = new PurOrderProductHis();
@@ -364,7 +378,7 @@ public class PurOrderController {
                 return Result.error("单号" + order.getBillCode() + "已提交,无法删除");
             }
         }
-        
+
         this.purOrderService.delBatchMain(Arrays.asList(ids.split(",")));
         return Result.OK("批量删除成功!");
     }
@@ -475,10 +489,10 @@ public class PurOrderController {
             queryPurDeliveryNote.eq("del_flag", "0");
 
             List<PurDeliveryNote> listPurDeliveryNote = purDeliveryNoteService.list(queryPurDeliveryNote);
-            if(listPurDeliveryNote.size() > 0){
+            if (listPurDeliveryNote.size() > 0) {
                 List<String> codeList = listPurDeliveryNote.stream().map(PurDeliveryNote::getBillCode).collect(Collectors.toList());
                 String codes = StringUtils.join(codeList.toArray(), ",");
-                sb.append("单号" + code).append("已被到货单使用,请勿取消提交"+codes+";");
+                sb.append("单号" + code).append("已被到货单使用,请勿取消提交" + codes + ";");
                 continue;
             }
             QueryWrapper<PurPaymentRequest> queryPurPaymentRequest = new QueryWrapper();
@@ -486,10 +500,10 @@ public class PurOrderController {
             queryPurPaymentRequest.eq("del_flag", "0");
 
             List<PurPaymentRequest> listPurPaymentRequest = purPaymentRequestService.list(queryPurPaymentRequest);
-            if(listPurPaymentRequest.size() > 0){
+            if (listPurPaymentRequest.size() > 0) {
                 List<String> codeList = listPurPaymentRequest.stream().map(PurPaymentRequest::getBillCode).collect(Collectors.toList());
                 String codes = StringUtils.join(codeList.toArray(), ",");
-                sb.append("单号" + code).append("已被采购付款申请使用,请勿取消提交"+codes+";");
+                sb.append("单号" + code).append("已被采购付款申请使用,请勿取消提交" + codes + ";");
                 continue;
             }
         }
@@ -559,7 +573,7 @@ public class PurOrderController {
 
         PurOrder ent = new PurOrder();
         ent.setStatus(1);
-        LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         ent.setConfirmBy(sysUser.getUsername());
         ent.setConfirmTime(new Date());
         purOrderService.update(ent, queryWrapper);
@@ -633,7 +647,7 @@ public class PurOrderController {
     @AutoLog(value = "采购订单-批量关闭")
     @ApiOperation(value = "采购订单-批量关闭", notes = "采购订单-批量关闭")
     @GetMapping(value = "/submitClose")
-    public Result<String> submitClose(@RequestParam(name = "ids", required = true) String ids,String closeReason) {
+    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(",")));
@@ -766,32 +780,32 @@ public class PurOrderController {
         List<PurOrderProduct> purOrderProductList = purOrderProductService.selectByMainId(id);
 
         //对于历史数据没有折扣和折前单价的数据,执行此方法获取折扣和折前单价
-        if(purOrderProductList.size()>0 && purOrderProductList.get(0).getTaxPriceOriginal()==null
+        if (purOrderProductList.size() > 0 && purOrderProductList.get(0).getTaxPriceOriginal() == null
                 && StringUtils.isNotBlank(purOrderProductList.get(0).getSourceId())
-        ){
+        ) {
             // 获取销售订单行
             List<SaleOrderProduct> saleOrderProductList = new ArrayList<>();
-            if (oConvertUtils.listIsNotEmpty(purOrderProductList)){
+            if (oConvertUtils.listIsNotEmpty(purOrderProductList)) {
                 LambdaQueryWrapper<SaleOrderProduct> productWrapper = new LambdaQueryWrapper<>();
                 productWrapper.in(SaleOrderProduct::getId, purOrderProductList.stream().map(PurOrderProduct::getSourceId).collect(Collectors.toList()));
                 saleOrderProductList = saleOrderProductService.list(productWrapper);
             }
             // 获取报价单行
             List<SaleQuotationProduct> saleQuotationProductList = new ArrayList<>();
-            if (oConvertUtils.listIsNotEmpty(saleOrderProductList)){
+            if (oConvertUtils.listIsNotEmpty(saleOrderProductList)) {
                 LambdaQueryWrapper<SaleQuotationProduct> productWrapper = new LambdaQueryWrapper<>();
                 productWrapper.in(SaleQuotationProduct::getId, saleOrderProductList.stream().map(SaleOrderProduct::getSourceId).collect(Collectors.toList()));
                 saleQuotationProductList = saleQuotationProductService.list(productWrapper);
             }
             // 获取报价选定单行
             List<PurQuotationSelectionProduct> purQuotationSelectionProductList = new ArrayList<>();
-            if (oConvertUtils.listIsNotEmpty(saleQuotationProductList)){
+            if (oConvertUtils.listIsNotEmpty(saleQuotationProductList)) {
                 LambdaQueryWrapper<PurQuotationSelectionProduct> productWrapper = new LambdaQueryWrapper<>();
                 productWrapper.in(PurQuotationSelectionProduct::getId, saleQuotationProductList.stream().map(SaleQuotationProduct::getSourceId).collect(Collectors.toList()));
                 purQuotationSelectionProductList = purQuotationSelectionProductService.list(productWrapper);
             }
 
-            for (PurOrderProduct product : purOrderProductList){
+            for (PurOrderProduct product : purOrderProductList) {
 
                 product.setDiscount(new BigDecimal("0"));
                 product.setTaxPriceOriginal(product.getTaxPrice());
@@ -803,7 +817,7 @@ public class PurOrderController {
                     if (saleOrderProduct != null) {
                         PurQuotationSelectionProduct quotationSelectionProduct = purQuotationSelectionProductList.stream().filter(e -> e.getId().equals(saleQuotationProduct.getSourceId())).findFirst().orElse(null);
 
-                        if(quotationSelectionProduct!=null){
+                        if (quotationSelectionProduct != null) {
                             if (oConvertUtils.isNotEmpty(quotationSelectionProduct.getDiscount())) {
                                 product.setDiscount(quotationSelectionProduct.getDiscount());
                                 BigDecimal dic = product.getDiscount() == null ? BigDecimal.ZERO : product.getDiscount();
@@ -924,7 +938,7 @@ public class PurOrderController {
         PurOrder purOrder = purOrderService.getById(id);
         List<PurOrderProduct> productList = purOrderProductService.selectByMainWithOrgPrice(id);
         BaseTemplates templates = null;
-        if (purOrder.getDiscountHead() == null || purOrder.getDiscountHead().doubleValue()==0) {
+        if (purOrder.getDiscountHead() == null || purOrder.getDiscountHead().doubleValue() == 0) {
             templates = templatesN;
         } else {
             templates = templatesZ;
@@ -935,17 +949,17 @@ public class PurOrderController {
             try {
                 // 折上折
                 if (oConvertUtils.isNotEmpty(purOrder.getDiscountHead())) {
-                    purOrder.setDiscountHeadText((100-purOrder.getDiscountHead().doubleValue()) + "%");
+                    purOrder.setDiscountHeadText((100 - purOrder.getDiscountHead().doubleValue()) + "%");
                     BigDecimal discountAmount = purOrder.getTotalAmount().subtract(purOrder.getDiscountAmount());
                     purOrder.setDiscountHeadMoney(discountAmount.setScale(2));
                 }
 
                 String agreementTerms = purOrder.getAgreementTerms();
                 if (StringUtils.isNotBlank(agreementTerms)) {
-                   String info = sysDictService.queryAgreementTermsByName(agreementTerms);
-                   if(StringUtils.isNotBlank(info)){
-                       purOrder.setAgreementTerms(info);
-                   }
+                    String info = sysDictService.queryAgreementTermsByName(agreementTerms);
+                    if (StringUtils.isNotBlank(info)) {
+                        purOrder.setAgreementTerms(info);
+                    }
                 }
 
                 String productionClass = purOrder.getProductionClass();
@@ -976,7 +990,7 @@ public class PurOrderController {
                 purOrder.setPurchaseEmail(sysUser.getEmail());
                 // 获取计产品档案
                 List<BaseProductArchive> productArchiveList = new ArrayList<>();
-                if (oConvertUtils.listIsNotEmpty(productList)){
+                if (oConvertUtils.listIsNotEmpty(productList)) {
                     LambdaQueryWrapper<BaseProductArchive> productWrapper = new LambdaQueryWrapper<>();
                     productWrapper.in(BaseProductArchive::getId, productList.stream().map(PurOrderProduct::getProductId).collect(Collectors.toList()));
                     productArchiveList = baseProductArchiveService.list(productWrapper);
@@ -984,21 +998,21 @@ public class PurOrderController {
 
                 // 获取销售订单行
                 List<SaleOrderProduct> saleOrderProductList = new ArrayList<>();
-                if (oConvertUtils.listIsNotEmpty(productList)){
+                if (oConvertUtils.listIsNotEmpty(productList)) {
                     LambdaQueryWrapper<SaleOrderProduct> productWrapper = new LambdaQueryWrapper<>();
                     productWrapper.in(SaleOrderProduct::getId, productList.stream().map(PurOrderProduct::getSourceId).collect(Collectors.toList()));
                     saleOrderProductList = saleOrderProductService.list(productWrapper);
                 }
                 // 获取报价单行
                 List<SaleQuotationProduct> saleQuotationProductList = new ArrayList<>();
-                if (oConvertUtils.listIsNotEmpty(saleOrderProductList)){
+                if (oConvertUtils.listIsNotEmpty(saleOrderProductList)) {
                     LambdaQueryWrapper<SaleQuotationProduct> productWrapper = new LambdaQueryWrapper<>();
                     productWrapper.in(SaleQuotationProduct::getId, saleOrderProductList.stream().map(SaleOrderProduct::getSourceId).collect(Collectors.toList()));
                     saleQuotationProductList = saleQuotationProductService.list(productWrapper);
                 }
                 // 获取报价选定单行
                 List<PurQuotationSelectionProduct> purQuotationSelectionProductList = new ArrayList<>();
-                if (oConvertUtils.listIsNotEmpty(saleQuotationProductList)){
+                if (oConvertUtils.listIsNotEmpty(saleQuotationProductList)) {
                     LambdaQueryWrapper<PurQuotationSelectionProduct> productWrapper = new LambdaQueryWrapper<>();
                     productWrapper.in(PurQuotationSelectionProduct::getId, saleQuotationProductList.stream().map(SaleQuotationProduct::getSourceId).collect(Collectors.toList()));
                     purQuotationSelectionProductList = purQuotationSelectionProductService.list(productWrapper);
@@ -1013,63 +1027,70 @@ public class PurOrderController {
                 // 产品设置
                 int rowNum = 1;
                 BigDecimal orderMoney = BigDecimal.ZERO;
-                for (PurOrderProduct product : productList){
+                for (PurOrderProduct product : productList) {
                     product.setRowNumber(rowNum++);
-                    BigDecimal amount = product.getTaxAmount() == null ? BigDecimal.ZERO: product.getTaxAmount();
+                    BigDecimal amount = product.getTaxAmount() == null ? BigDecimal.ZERO : product.getTaxAmount();
                     orderMoney = orderMoney.add(amount);
-                    if (product.getDeliveryTime() != null){
+                    if (product.getDeliveryTime() != null) {
                         product.setDeliverDateText(DateUtils.date2Str(product.getDeliveryTime(), DateUtils.date_sdf.get()));
                     }
-                    BaseProductArchive findProduct = productArchiveList.stream().filter(e->e.getId().equals(product.getProductId())).findFirst().orElse(null);
-                    if (findProduct != null){
+                    BaseProductArchive findProduct = productArchiveList.stream().filter(e -> e.getId().equals(product.getProductId())).findFirst().orElse(null);
+                    if (findProduct != null) {
                         product.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) {
                                 product.setUnit(findDict.getText());
                             }
                         }
                     }
+                    if (product.getTaxPriceOriginal() != null && product.getDiscount() != null) {
 
-                    SaleOrderProduct saleOrderProduct = saleOrderProductList.stream().filter(e -> e.getId().equals(product.getSourceId())).findFirst().orElse(null);
-                    if (saleOrderProduct != null) {
+                        product.setTaxPrice(product.getTaxPriceOriginal());
+                        product.setDiscountText(product.getDiscount().intValue() + "%");
 
-                        SaleQuotationProduct saleQuotationProduct = saleQuotationProductList.stream().filter(e -> e.getId().equals(saleOrderProduct.getSourceId())).findFirst().orElse(null);
-                        if (saleQuotationProduct != null) {
-                            PurQuotationSelectionProduct quotationSelectionProduct = purQuotationSelectionProductList.stream().filter(e -> e.getId().equals(saleQuotationProduct.getSourceId())).findFirst().orElse(null);
+                    } else {
 
-                            if (quotationSelectionProduct !=null && oConvertUtils.isNotEmpty(quotationSelectionProduct.getDiscount())) {
-                                product.setDiscountText(quotationSelectionProduct.getDiscount().intValue() + "%");
-                            }
+                        SaleOrderProduct saleOrderProduct = saleOrderProductList.stream().filter(e -> e.getId().equals(product.getSourceId())).findFirst().orElse(null);
+                        if (saleOrderProduct != null) {
 
-                            BigDecimal dic = quotationSelectionProduct==null || quotationSelectionProduct.getDiscount() ==null?BigDecimal.ZERO:quotationSelectionProduct.getDiscount();
-                            BigDecimal dis = (new BigDecimal("100").subtract(dic)).divide(new BigDecimal("100"));
+                            SaleQuotationProduct saleQuotationProduct = saleQuotationProductList.stream().filter(e -> e.getId().equals(saleOrderProduct.getSourceId())).findFirst().orElse(null);
+                            if (saleQuotationProduct != null) {
+                                PurQuotationSelectionProduct quotationSelectionProduct = purQuotationSelectionProductList.stream().filter(e -> e.getId().equals(saleQuotationProduct.getSourceId())).findFirst().orElse(null);
+
+                                if (quotationSelectionProduct != null && oConvertUtils.isNotEmpty(quotationSelectionProduct.getDiscount())) {
+                                    product.setDiscountText(quotationSelectionProduct.getDiscount().intValue() + "%");
+                                }
+
+                                BigDecimal dic = quotationSelectionProduct == null || quotationSelectionProduct.getDiscount() == null ? BigDecimal.ZERO : quotationSelectionProduct.getDiscount();
+                                BigDecimal dis = (new BigDecimal("100").subtract(dic)).divide(new BigDecimal("100"));
 
-                            BigDecimal getSalePrice = product.getTaxPrice() == null ? BigDecimal.ZERO : product.getTaxPrice();
-                            BigDecimal setTaxPrice = getSalePrice.divide(dis, 2, BigDecimal.ROUND_HALF_UP);//折前价
+                                BigDecimal getSalePrice = product.getTaxPrice() == null ? BigDecimal.ZERO : product.getTaxPrice();
+                                BigDecimal setTaxPrice = getSalePrice.divide(dis, 2, BigDecimal.ROUND_HALF_UP);//折前价
 //                            BigDecimal quantity = product.getQuantity() == null ? BigDecimal.ZERO : product.getQuantity();
 
-                            product.setTaxPrice(setTaxPrice);
+                                product.setTaxPrice(setTaxPrice);
 
 //                            if (oConvertUtils.isNotEmpty(quotationSelectionProduct.getTaxPriceOriginal())) {
 //                                product.setTaxPrice(quotationSelectionProduct.getTaxPriceOriginal());
 //                            }
+                            }
+
                         }
 
                     }
-
                 }
-                if(productList.size() > 0){
+
+                if (productList.size() > 0) {
 
                     purOrder.setQualityGrade(productList.get(0).getQualityGrade());
                 }
-                orderMoney  = orderMoney.setScale(2);
+                orderMoney = orderMoney.setScale(2);
                 purOrder.setOrderMoney(orderMoney);
 
 
-
                 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();
@@ -1078,9 +1099,9 @@ public class PurOrderController {
                     excelWriter.fill(purOrder, writeSheet);
                 }
                 List<String> noteList = new ArrayList<>();
-                productList.forEach(p->noteList.add(p.getNotes()));
+                productList.forEach(p -> noteList.add(p.getNotes()));
 
-                ExcelExportUtils.excelInsertRowNotes(getOutputStream(purOrder.getBillCode()+".xlsx", response),
+                ExcelExportUtils.excelInsertRowNotes(getOutputStream(purOrder.getBillCode() + ".xlsx", response),
                         tempFilePath, 19, noteList, 1, 4);
 
             } catch (Exception ex) {

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

@@ -0,0 +1,132 @@
+package org.jeecg.modules.purCode.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import org.jeecg.common.constant.ProvinceCityArea;
+import org.jeecg.common.util.SpringContextUtils;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: 佣金预付款
+ * @Author: jeecg-boot
+ * @Date:   2025-04-24
+ * @Version: V1.0
+ */
+@Data
+@TableName("pur_advance_commission")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="pur_advance_commission对象", description="佣金预付款")
+public class PurAdvanceCommission implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键id*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键id")
+    private String id;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+	/**创建时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+	/**更新时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+	/**审批(approve)(1-是,0-否)*/
+	@Excel(name = "审批(approve)", width = 15,dicCode = "yes_or_no")
+    @ApiModelProperty(value = "审批(approve)(1-是,0-否)")
+    @Dict(dicCode = "yes_or_no")
+    private String approve;
+	/**提交(submit)1是0否*/
+	@Excel(name = "提交(submit)", width = 15,dicCode = "yes_or_no")
+    @ApiModelProperty(value = "提交(submit)1是0否")
+    @Dict(dicCode = "yes_or_no")
+    private String submit;
+	/**付款(payment)1是0否*/
+	@Excel(name = "付款(payment)", width = 15,dicCode = "yes_or_no")
+    @ApiModelProperty(value = "付款(payment)1是0否")
+    @Dict(dicCode = "yes_or_no")
+    private String payment;
+	/**删除状态(0-正常,1-已删除)*/
+	@Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
+    @ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
+    @TableLogic
+    private Integer delFlag;
+	/**单据日期*/
+	@Excel(name = "单据日期", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "单据日期")
+    private Date billDate;
+	/**预付款编号*/
+	@Excel(name = "预付款编号", width = 15)
+    @ApiModelProperty(value = "预付款编号")
+    private String billCode;
+	/**返佣类型(commission type)*/
+	@Excel(name = "返佣类型(commission type)", width = 15)
+    @ApiModelProperty(value = "返佣类型(commission type)")
+    private String commissionType;
+	/**预计付款日期(Expected payment date)*/
+	@Excel(name = "预计付款日期(Expected payment date)", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "预计付款日期(Expected payment date)")
+    private Date expectedPaymentDate;
+	/**收款人(payee)*/
+	@Excel(name = "收款人(payee)", width = 15)
+    @ApiModelProperty(value = "收款人(payee)")
+    private String payee;
+	/**开户行(opening bank)*/
+	@Excel(name = "开户行(opening bank)", width = 15)
+    @ApiModelProperty(value = "开户行(opening bank)")
+    private String openingBank;
+	/**银行帐号(bank account)*/
+	@Excel(name = "银行帐号(bank account)", width = 15)
+    @ApiModelProperty(value = "银行帐号(bank account)")
+    private String bankAccount;
+	/**银行代码(swift code)*/
+	@Excel(name = "银行代码(swift code)", width = 15)
+    @ApiModelProperty(value = "银行代码(swift code)")
+    private String swiftCode;
+	/**币种(currency)*/
+	@Excel(name = "币种(currency)", width = 15)
+    @ApiModelProperty(value = "币种(currency)")
+    private String currency;
+	/**备注(notes)*/
+	@Excel(name = "备注(notes)", width = 15)
+    @ApiModelProperty(value = "备注(notes)")
+    private String notes;
+	/**申请金额(approve money)*/
+	@Excel(name = "申请金额(approve money)", width = 15)
+    @ApiModelProperty(value = "申请金额(approve money)")
+    private BigDecimal approveMoney;
+	/**所属部门*/
+    @ApiModelProperty(value = "所属部门")
+    private String sysOrgCode;
+	/**sourceCode*/
+	@Excel(name = "sourceCode", width = 15)
+    @ApiModelProperty(value = "sourceCode")
+    private String sourceCode;
+}

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

@@ -0,0 +1,138 @@
+package org.jeecg.modules.purCode.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import org.jeecg.common.constant.ProvinceCityArea;
+import org.jeecg.common.util.SpringContextUtils;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Description: 采购预付款
+ * @Author: jeecg-boot
+ * @Date:   2025-04-24
+ * @Version: V1.0
+ */
+@ApiModel(value="pur_advance_payment对象", description="采购预付款")
+@Data
+@TableName("pur_advance_payment")
+public class PurAdvancePayment implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键id*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键id")
+    private String id;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+	/**创建时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+	/**更新时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+	/**审批(approve)(1-是,0-否)*/
+	@Excel(name = "审批(approve)(1-是,0-否)", width = 15)
+    @ApiModelProperty(value = "审批(approve)(1-是,0-否)")
+    @Dict(dicCode = "yes_or_no")
+    private String approve;
+	/**提交(submit)1是0否*/
+	@Excel(name = "提交(submit)1是0否", width = 15)
+    @ApiModelProperty(value = "提交(submit)1是0否")
+    @Dict(dicCode = "yes_or_no")
+    private String submit;
+	/**付款(payment)1是0否*/
+	@Excel(name = "付款(payment)1是0否", width = 15)
+    @ApiModelProperty(value = "付款(payment)1是0否")
+    @Dict(dicCode = "yes_or_no")
+    private String payment;
+	/**删除状态(0-正常,1-已删除)*/
+    @ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
+    @TableLogic
+    private Integer delFlag;
+	/**单据日期*/
+	@Excel(name = "单据日期", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "单据日期")
+    private Date billDate;
+	/**单据编码*/
+	@Excel(name = "单据编码", width = 15)
+    @ApiModelProperty(value = "单据编码")
+    private String billCode;
+	/**供应商(supplier)*/
+	@Excel(name = "供应商(supplier)", width = 15)
+    @ApiModelProperty(value = "供应商(supplier)")
+    private String supplier;
+	/**供应商(supplier)*/
+	@Excel(name = "供应商(supplier)", width = 15)
+    @ApiModelProperty(value = "供应商(supplier)")
+    private String supplierName;
+	/**预计付款日期(Expected payment date)*/
+	@Excel(name = "预计付款日期(Expected payment date)", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "预计付款日期(Expected payment date)")
+    private Date expectedPaymentDate;
+	/**收款人(payee)*/
+	@Excel(name = "收款人(payee)", width = 15)
+    @ApiModelProperty(value = "收款人(payee)")
+    private String payee;
+	/**开户行(opening bank)*/
+	@Excel(name = "开户行(opening bank)", width = 15)
+    @ApiModelProperty(value = "开户行(opening bank)")
+    private String openingBank;
+	/**银行帐号(bank account)*/
+	@Excel(name = "银行帐号(bank account)", width = 15)
+    @ApiModelProperty(value = "银行帐号(bank account)")
+    private String bankAccount;
+	/**银行代码(swift code)*/
+	@Excel(name = "银行代码(swift code)", width = 15)
+    @ApiModelProperty(value = "银行代码(swift code)")
+    private String swiftCode;
+	/**币种(currency)*/
+	@Excel(name = "币种(currency)", width = 15)
+    @ApiModelProperty(value = "币种(currency)")
+    private String currency;
+	/**委托收款证明(Entrusted Collection Certificate)*/
+	@Excel(name = "委托收款证明(Entrusted Collection Certificate)", width = 15)
+    @ApiModelProperty(value = "委托收款证明(Entrusted Collection Certificate)")
+    private String collectionCertificate;
+	/**备注(notes)*/
+	@Excel(name = "备注(notes)", width = 15)
+    @ApiModelProperty(value = "备注(notes)")
+    private String notes;
+	/**申请金额(approve money)*/
+	@Excel(name = "申请金额(approve money)", width = 15)
+    @ApiModelProperty(value = "申请金额(approve money)")
+    private java.math.BigDecimal approveMoney;
+	/**来源*/
+	@Excel(name = "来源", width = 15)
+    @ApiModelProperty(value = "来源")
+    private String sourceCode;
+	/**所属部门*/
+    @ApiModelProperty(value = "所属部门")
+    private String sysOrgCode;
+	/**预付款比例*/
+	@Excel(name = "预付款比例", width = 15)
+    @ApiModelProperty(value = "预付款比例")
+    private java.math.BigDecimal prepaymentRatio;
+}

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

@@ -0,0 +1,119 @@
+package org.jeecg.modules.purCode.entity;
+
+import java.io.Serializable;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import org.jeecg.common.constant.ProvinceCityArea;
+import org.jeecg.common.util.SpringContextUtils;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import java.util.Date;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.UnsupportedEncodingException;
+
+/**
+ * @Description: 采购预付款-子表
+ * @Author: jeecg-boot
+ * @Date:   2025-04-24
+ * @Version: V1.0
+ */
+@ApiModel(value="pur_advance_payment_details对象", description="采购预付款-子表")
+@Data
+@TableName("pur_advance_payment_details")
+public class PurAdvancePaymentDetails implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键id*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键id")
+    private String id;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+	/**创建时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+	/**更新时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+	/**状态(1-启用,0-停用)*/
+    @ApiModelProperty(value = "状态(1-启用,0-停用)")
+    private Integer status;
+	/**删除状态(0-正常,1-已删除)*/
+    @ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
+    @TableLogic
+    private Integer delFlag;
+	/**表头主键(采购付款申请)*/
+    @ApiModelProperty(value = "表头主键(采购付款申请)")
+    private String headId;
+	/**项目(project)*/
+    @ApiModelProperty(value = "项目(project)")
+    private String project;
+	/**项目名称*/
+	@Excel(name = "项目名称", width = 15)
+    @ApiModelProperty(value = "项目名称")
+    private String projectName;
+	/**业务类型(busyness type)*/
+	@Excel(name = "业务类型(busyness type)", width = 15)
+    @ApiModelProperty(value = "业务类型(busyness type)")
+    private String busynessType;
+	/**采购订单号(purchase code)*/
+	@Excel(name = "采购订单号(purchase code)", width = 15)
+    @ApiModelProperty(value = "采购订单号(purchase code)")
+    private String purchaseCode;
+	/**采购订单id*/
+    @ApiModelProperty(value = "采购订单id")
+    private String purchaseId;
+	/**订单金额(order money)*/
+	@Excel(name = "订单金额(order money)", width = 15)
+    @ApiModelProperty(value = "订单金额(order money)")
+    private java.math.BigDecimal orderMoney;
+	/**回款金额(collection amount)*/
+	@Excel(name = "回款金额(collection amount)", width = 15)
+    @ApiModelProperty(value = "回款金额(collection amount)")
+    private java.math.BigDecimal collectionAmount;
+	/**回款比例(collection rate)*/
+	@Excel(name = "回款比例(collection rate)", width = 15)
+    @ApiModelProperty(value = "回款比例(collection rate)")
+    private java.math.BigDecimal collectionRate;
+	/**已申请金额(applyed money*/
+	@Excel(name = "已申请金额(applyed money", width = 15)
+    @ApiModelProperty(value = "已申请金额(applyed money")
+    private java.math.BigDecimal applyedMoney;
+	/**本次申请金额(apply money)*/
+	@Excel(name = "本次申请金额(apply money)", width = 15)
+    @ApiModelProperty(value = "本次申请金额(apply money)")
+    private java.math.BigDecimal applyMoney;
+	/**发票(invoice)*/
+    @ApiModelProperty(value = "发票(invoice)")
+    private String invoice;
+	/**发票id*/
+    @ApiModelProperty(value = "发票id")
+    private String invoiceId;
+	/**备注(notes)*/
+	@Excel(name = "备注(notes)", width = 15)
+    @ApiModelProperty(value = "备注(notes)")
+    private String notes;
+	/**所属部门*/
+    @ApiModelProperty(value = "所属部门")
+    private String sysOrgCode;
+	/**来源*/
+    @ApiModelProperty(value = "来源")
+    private String sourceId;
+	/**预付款比例(prepayment ratio)*/
+	@Excel(name = "预付款比例(prepayment ratio)", width = 15)
+    @ApiModelProperty(value = "预付款比例(prepayment ratio)")
+    private java.math.BigDecimal prepaymentRatio;
+}

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

@@ -51,11 +51,9 @@ public class PurCommissionRequestDetails implements Serializable {
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
 	/**状态(1-启用,0-停用)*/
-	@Excel(name = "状态(1-启用,0-停用)", width = 15)
     @ApiModelProperty(value = "状态(1-启用,0-停用)")
     private Integer status;
 	/**删除状态(0-正常,1-已删除)*/
-	@Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
     @ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
     @TableLogic
     private Integer delFlag;
@@ -63,7 +61,6 @@ public class PurCommissionRequestDetails implements Serializable {
     @ApiModelProperty(value = "表头主键(佣金付款申请)")
     private String headId;
 	/**项目(project)*/
-	@Excel(name = "项目(project)", width = 15)
     @ApiModelProperty(value = "项目(project)")
     private String project;
 	/**项目名称*/
@@ -79,7 +76,6 @@ public class PurCommissionRequestDetails implements Serializable {
     @ApiModelProperty(value = "销售订单(sale code)")
     private String saleCode;
 	/**销售订单*/
-	@Excel(name = "销售订单", width = 15)
     @ApiModelProperty(value = "销售订单")
     private String saleId;
 	/**订单金额(order money)*/
@@ -103,7 +99,6 @@ public class PurCommissionRequestDetails implements Serializable {
     @ApiModelProperty(value = "本次申请金额(apply money)")
     private java.math.BigDecimal applyMoney;
 	/**发票(invoice)*/
-	@Excel(name = "发票(invoice)", width = 15)
     @ApiModelProperty(value = "发票(invoice)")
     private String invoice;
 	/**备注(notes)*/

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

@@ -52,22 +52,21 @@ public class PurPaymentRequest implements Serializable {
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
 	/**审批(approve)(1-是,0-否)*/
-	@Excel(name = "审批(approve)(1-是,0-否)", width = 15)
+	@Excel(name = "审批(approve)", width = 15,dicCode = "yes_or_no")
     @ApiModelProperty(value = "审批(approve)(1-是,0-否)")
     @Dict(dicCode = "yes_or_no")
     private String approve;
 	/**提交(submit)1是0否*/
-	@Excel(name = "提交(submit)1是0否", width = 15)
+	@Excel(name = "提交(submit)", width = 15,dicCode = "yes_or_no")
     @ApiModelProperty(value = "提交(submit)1是0否")
     @Dict(dicCode = "yes_or_no")
     private String submit;
 	/**付款(payment)1是0否*/
-	@Excel(name = "付款(payment)1是0否", width = 15)
+	@Excel(name = "付款(payment)", width = 15,dicCode = "yes_or_no")
     @ApiModelProperty(value = "付款(payment)1是0否")
     @Dict(dicCode = "yes_or_no")
     private String payment;
 	/**删除状态(0-正常,1-已删除)*/
-	@Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
     @ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
     @TableLogic
     private Integer delFlag;
@@ -82,7 +81,6 @@ public class PurPaymentRequest implements Serializable {
     @ApiModelProperty(value = "单据编码")
     private String billCode;
 	/**供应商(supplier)*/
-	@Excel(name = "供应商(supplier)", width = 15)
     @ApiModelProperty(value = "供应商(supplier)")
     private String supplier;
 	/**供应商(supplier)*/

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

@@ -51,11 +51,9 @@ public class PurPaymentRequestDetails implements Serializable {
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
 	/**状态(1-启用,0-停用)*/
-	@Excel(name = "状态(1-启用,0-停用)", width = 15)
     @ApiModelProperty(value = "状态(1-启用,0-停用)")
     private Integer status;
 	/**删除状态(0-正常,1-已删除)*/
-	@Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
     @ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
     @TableLogic
     private Integer delFlag;
@@ -63,7 +61,6 @@ public class PurPaymentRequestDetails implements Serializable {
     @ApiModelProperty(value = "表头主键(采购付款申请)")
     private String headId;
 	/**项目(project)*/
-	@Excel(name = "项目(project)", width = 15)
     @ApiModelProperty(value = "项目(project)")
     private String project;
 	/**项目名称*/
@@ -79,7 +76,6 @@ public class PurPaymentRequestDetails implements Serializable {
     @ApiModelProperty(value = "采购订单号(purchase code)")
     private String purchaseCode;
 	/**采购订单id*/
-	@Excel(name = "采购订单id", width = 15)
     @ApiModelProperty(value = "采购订单id")
     private String purchaseId;
 	/**订单金额(order money)*/
@@ -103,11 +99,9 @@ public class PurPaymentRequestDetails implements Serializable {
     @ApiModelProperty(value = "本次申请金额(apply money)")
     private java.math.BigDecimal applyMoney;
 	/**发票(invoice)*/
-	@Excel(name = "发票(invoice)", width = 15)
     @ApiModelProperty(value = "发票(invoice)")
     private String invoice;
 	/**发票id*/
-	@Excel(name = "发票id", width = 15)
     @ApiModelProperty(value = "发票id")
     private String invoiceId;
 	/**备注(notes)*/

+ 17 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/mapper/PurAdvanceCommissionMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.purCode.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.purCode.entity.PurAdvanceCommission;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 佣金预付款
+ * @Author: jeecg-boot
+ * @Date:   2025-04-24
+ * @Version: V1.0
+ */
+public interface PurAdvanceCommissionMapper extends BaseMapper<PurAdvanceCommission> {
+
+}

+ 31 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/mapper/PurAdvancePaymentDetailsMapper.java

@@ -0,0 +1,31 @@
+package org.jeecg.modules.purCode.mapper;
+
+import java.util.List;
+import org.jeecg.modules.purCode.entity.PurAdvancePaymentDetails;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @Description: 采购预付款-子表
+ * @Author: jeecg-boot
+ * @Date:   2025-04-24
+ * @Version: V1.0
+ */
+public interface PurAdvancePaymentDetailsMapper extends BaseMapper<PurAdvancePaymentDetails> {
+
+	/**
+	 * 通过主表id删除子表数据
+	 *
+	 * @param mainId 主表id
+	 * @return boolean
+	 */
+	public boolean deleteByMainId(@Param("mainId") String mainId);
+
+  /**
+   * 通过主表id查询子表数据
+   *
+   * @param mainId 主表id
+   * @return List<PurAdvancePaymentDetails>
+   */
+	public List<PurAdvancePaymentDetails> selectByMainId(@Param("mainId") String mainId);
+}

+ 17 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/mapper/PurAdvancePaymentMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.purCode.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.purCode.entity.PurAdvancePayment;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 采购预付款
+ * @Author: jeecg-boot
+ * @Date:   2025-04-24
+ * @Version: V1.0
+ */
+public interface PurAdvancePaymentMapper extends BaseMapper<PurAdvancePayment> {
+
+}

+ 5 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/mapper/xml/PurAdvanceCommissionMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.purCode.mapper.PurAdvanceCommissionMapper">
+
+</mapper>

+ 16 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/mapper/xml/PurAdvancePaymentDetailsMapper.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.purCode.mapper.PurAdvancePaymentDetailsMapper">
+
+	<delete id="deleteByMainId" parameterType="java.lang.String">
+		DELETE 
+		FROM  pur_advance_payment_details 
+		WHERE
+			 head_id = #{mainId} 	</delete>
+	
+	<select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.purCode.entity.PurAdvancePaymentDetails">
+		SELECT * 
+		FROM  pur_advance_payment_details
+		WHERE
+			 head_id = #{mainId} 	</select>
+</mapper>

+ 5 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/mapper/xml/PurAdvancePaymentMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.purCode.mapper.PurAdvancePaymentMapper">
+
+</mapper>

+ 14 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/service/IPurAdvanceCommissionService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.purCode.service;
+
+import org.jeecg.modules.purCode.entity.PurAdvanceCommission;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 佣金预付款
+ * @Author: jeecg-boot
+ * @Date:   2025-04-24
+ * @Version: V1.0
+ */
+public interface IPurAdvanceCommissionService extends IService<PurAdvanceCommission> {
+
+}

+ 22 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/service/IPurAdvancePaymentDetailsService.java

@@ -0,0 +1,22 @@
+package org.jeecg.modules.purCode.service;
+
+import org.jeecg.modules.purCode.entity.PurAdvancePaymentDetails;
+import com.baomidou.mybatisplus.extension.service.IService;
+import java.util.List;
+
+/**
+ * @Description: 采购预付款-子表
+ * @Author: jeecg-boot
+ * @Date:   2025-04-24
+ * @Version: V1.0
+ */
+public interface IPurAdvancePaymentDetailsService extends IService<PurAdvancePaymentDetails> {
+
+	/**
+	 * 通过主表id查询子表数据
+	 *
+	 * @param mainId 主表id
+	 * @return List<PurAdvancePaymentDetails>
+	 */
+	public List<PurAdvancePaymentDetails> selectByMainId(String mainId);
+}

+ 48 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/service/IPurAdvancePaymentService.java

@@ -0,0 +1,48 @@
+package org.jeecg.modules.purCode.service;
+
+import org.jeecg.modules.purCode.entity.PurAdvancePaymentDetails;
+import org.jeecg.modules.purCode.entity.PurAdvancePayment;
+import com.baomidou.mybatisplus.extension.service.IService;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @Description: 采购预付款
+ * @Author: jeecg-boot
+ * @Date:   2025-04-24
+ * @Version: V1.0
+ */
+public interface IPurAdvancePaymentService extends IService<PurAdvancePayment> {
+
+	/**
+	 * 添加一对多
+	 *
+	 * @param purAdvancePayment
+	 * @param purAdvancePaymentDetailsList
+	 */
+	public void saveMain(PurAdvancePayment purAdvancePayment,List<PurAdvancePaymentDetails> purAdvancePaymentDetailsList) ;
+	
+	/**
+	 * 修改一对多
+	 *
+   * @param purAdvancePayment
+   * @param purAdvancePaymentDetailsList
+	 */
+	public void updateMain(PurAdvancePayment purAdvancePayment,List<PurAdvancePaymentDetails> purAdvancePaymentDetailsList);
+	
+	/**
+	 * 删除一对多
+	 *
+	 * @param id
+	 */
+	public void delMain (String id);
+	
+	/**
+	 * 批量删除一对多
+	 *
+	 * @param idList
+	 */
+	public void delBatchMain (Collection<? extends Serializable> idList);
+	
+}

+ 19 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/service/impl/PurAdvanceCommissionServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.purCode.service.impl;
+
+import org.jeecg.modules.purCode.entity.PurAdvanceCommission;
+import org.jeecg.modules.purCode.mapper.PurAdvanceCommissionMapper;
+import org.jeecg.modules.purCode.service.IPurAdvanceCommissionService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 佣金预付款
+ * @Author: jeecg-boot
+ * @Date:   2025-04-24
+ * @Version: V1.0
+ */
+@Service
+public class PurAdvanceCommissionServiceImpl extends ServiceImpl<PurAdvanceCommissionMapper, PurAdvanceCommission> implements IPurAdvanceCommissionService {
+
+}

+ 27 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/service/impl/PurAdvancePaymentDetailsServiceImpl.java

@@ -0,0 +1,27 @@
+package org.jeecg.modules.purCode.service.impl;
+
+import org.jeecg.modules.purCode.entity.PurAdvancePaymentDetails;
+import org.jeecg.modules.purCode.mapper.PurAdvancePaymentDetailsMapper;
+import org.jeecg.modules.purCode.service.IPurAdvancePaymentDetailsService;
+import org.springframework.stereotype.Service;
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * @Description: 采购预付款-子表
+ * @Author: jeecg-boot
+ * @Date:   2025-04-24
+ * @Version: V1.0
+ */
+@Service
+public class PurAdvancePaymentDetailsServiceImpl extends ServiceImpl<PurAdvancePaymentDetailsMapper, PurAdvancePaymentDetails> implements IPurAdvancePaymentDetailsService {
+	
+	@Autowired
+	private PurAdvancePaymentDetailsMapper purAdvancePaymentDetailsMapper;
+	
+	@Override
+	public List<PurAdvancePaymentDetails> selectByMainId(String mainId) {
+		return purAdvancePaymentDetailsMapper.selectByMainId(mainId);
+	}
+}

+ 77 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/service/impl/PurAdvancePaymentServiceImpl.java

@@ -0,0 +1,77 @@
+package org.jeecg.modules.purCode.service.impl;
+
+import org.jeecg.modules.purCode.entity.PurAdvancePayment;
+import org.jeecg.modules.purCode.entity.PurAdvancePaymentDetails;
+import org.jeecg.modules.purCode.mapper.PurAdvancePaymentDetailsMapper;
+import org.jeecg.modules.purCode.mapper.PurAdvancePaymentMapper;
+import org.jeecg.modules.purCode.service.IPurAdvancePaymentService;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import java.io.Serializable;
+import java.util.List;
+import java.util.Collection;
+
+/**
+ * @Description: 采购预付款
+ * @Author: jeecg-boot
+ * @Date:   2025-04-24
+ * @Version: V1.0
+ */
+@Service
+public class PurAdvancePaymentServiceImpl extends ServiceImpl<PurAdvancePaymentMapper, PurAdvancePayment> implements IPurAdvancePaymentService {
+
+	@Autowired
+	private PurAdvancePaymentMapper purAdvancePaymentMapper;
+	@Autowired
+	private PurAdvancePaymentDetailsMapper purAdvancePaymentDetailsMapper;
+	
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void saveMain(PurAdvancePayment purAdvancePayment, List<PurAdvancePaymentDetails> purAdvancePaymentDetailsList) {
+		purAdvancePaymentMapper.insert(purAdvancePayment);
+		if(purAdvancePaymentDetailsList!=null && purAdvancePaymentDetailsList.size()>0) {
+			for(PurAdvancePaymentDetails entity:purAdvancePaymentDetailsList) {
+				//外键设置
+				entity.setHeadId(purAdvancePayment.getId());
+				purAdvancePaymentDetailsMapper.insert(entity);
+			}
+		}
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void updateMain(PurAdvancePayment purAdvancePayment,List<PurAdvancePaymentDetails> purAdvancePaymentDetailsList) {
+		purAdvancePaymentMapper.updateById(purAdvancePayment);
+		
+		//1.先删除子表数据
+		purAdvancePaymentDetailsMapper.deleteByMainId(purAdvancePayment.getId());
+		
+		//2.子表数据重新插入
+		if(purAdvancePaymentDetailsList!=null && purAdvancePaymentDetailsList.size()>0) {
+			for(PurAdvancePaymentDetails entity:purAdvancePaymentDetailsList) {
+				//外键设置
+				entity.setHeadId(purAdvancePayment.getId());
+				purAdvancePaymentDetailsMapper.insert(entity);
+			}
+		}
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void delMain(String id) {
+		purAdvancePaymentDetailsMapper.deleteByMainId(id);
+		purAdvancePaymentMapper.deleteById(id);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void delBatchMain(Collection<? extends Serializable> idList) {
+		for(Serializable id:idList) {
+			purAdvancePaymentDetailsMapper.deleteByMainId(id.toString());
+			purAdvancePaymentMapper.deleteById(id);
+		}
+	}
+	
+}

+ 23 - 2
srm-module-code/src/main/java/org/jeecg/modules/purCode/service/impl/PurPaymentRequestServiceImpl.java

@@ -81,7 +81,11 @@ public class PurPaymentRequestServiceImpl extends ServiceImpl<PurPaymentRequestM
 					totalAmountUsed = applyMoney.add(totalAmountUsed);
 
 					if(totalAmount.compareTo(totalAmountUsed) < 0){
-						throw new RuntimeException(order.getBillCode()+"金额不足(剩余:"+totalAmount.subtract(order.getTotalAmountUsed() == null ? BigDecimal.ZERO : order.getTotalAmountUsed())+"),请重新填写申请金额!");
+
+						if(totalAmount.subtract(totalAmountUsed).abs().compareTo(BigDecimal.ONE) > 0){
+							throw new RuntimeException(order.getBillCode()+"金额不足(剩余:"+totalAmount.subtract(order.getTotalAmountUsed() == null ? BigDecimal.ZERO : order.getTotalAmountUsed())+"),请重新填写申请金额!");
+						}
+//						throw new RuntimeException(order.getBillCode()+"金额不足(剩余:"+totalAmount.subtract(order.getTotalAmountUsed() == null ? BigDecimal.ZERO : order.getTotalAmountUsed())+"),请重新填写申请金额!");
 					}
 
 					order.setTotalAmountUsed(totalAmountUsed);
@@ -94,6 +98,19 @@ public class PurPaymentRequestServiceImpl extends ServiceImpl<PurPaymentRequestM
 
 	}
 
+
+	public static void main(String[] args) {
+
+		BigDecimal totalAmount = new BigDecimal("1230002");
+		BigDecimal totalAmountUsed = new BigDecimal("123000");
+		if(totalAmount.subtract(totalAmountUsed).abs().compareTo(BigDecimal.ONE) > 0){
+			System.out.println(11111);
+		}else{
+			System.out.println(22222);
+		}
+
+	}
+
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void updateMain(PurPaymentRequest purPaymentRequest,List<PurPaymentRequestDetails> purPaymentRequestDetailsList) {
@@ -172,7 +189,11 @@ public class PurPaymentRequestServiceImpl extends ServiceImpl<PurPaymentRequestM
 					totalAmountUsed = applyMoney.add(totalAmountUsed);
 
 					if(totalAmount.compareTo(totalAmountUsed) < 0){
-						throw new RuntimeException(order.getBillCode()+"金额不足(剩余:"+totalAmount.subtract(order.getTotalAmountUsed() == null ? BigDecimal.ZERO : order.getTotalAmountUsed())+"),请重新填写申请金额!");
+
+						if(totalAmount.subtract(totalAmountUsed).abs().compareTo(BigDecimal.ONE) > 0){
+							throw new RuntimeException(order.getBillCode()+"金额不足(剩余:"+totalAmount.subtract(order.getTotalAmountUsed() == null ? BigDecimal.ZERO : order.getTotalAmountUsed())+"),请重新填写申请金额!");
+						}
+//						throw new RuntimeException(order.getBillCode()+"金额不足(剩余:"+totalAmount.subtract(order.getTotalAmountUsed() == null ? BigDecimal.ZERO : order.getTotalAmountUsed())+"),请重新填写申请金额!");
 					}
 
 					order.setTotalAmountUsed(totalAmountUsed);

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

@@ -0,0 +1,134 @@
+package org.jeecg.modules.purCode.vo;
+
+import java.util.List;
+import org.jeecg.modules.purCode.entity.PurAdvancePayment;
+import org.jeecg.modules.purCode.entity.PurAdvancePaymentDetails;
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecgframework.poi.excel.annotation.ExcelEntity;
+import org.jeecgframework.poi.excel.annotation.ExcelCollection;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.util.Date;
+import org.jeecg.common.aspect.annotation.Dict;
+import org.jeecg.common.constant.ProvinceCityArea;
+import org.jeecg.common.util.SpringContextUtils;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Description: 采购预付款
+ * @Author: jeecg-boot
+ * @Date:   2025-04-24
+ * @Version: V1.0
+ */
+@Data
+@ApiModel(value="pur_advance_paymentPage对象", description="采购预付款")
+public class PurAdvancePaymentPage {
+
+	/**主键id*/
+	@ApiModelProperty(value = "主键id")
+    private String id;
+	/**创建人*/
+	@ApiModelProperty(value = "创建人")
+    private String createBy;
+	/**创建时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	@ApiModelProperty(value = "创建时间")
+    private Date createTime;
+	/**更新人*/
+	@ApiModelProperty(value = "更新人")
+    private String updateBy;
+	/**更新时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	@ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+	/**审批(approve)(1-是,0-否)*/
+	@Excel(name = "审批(approve)", width = 15,dicCode = "yes_or_no")
+	@ApiModelProperty(value = "审批(approve)(1-是,0-否)")
+    private String approve;
+	/**提交(submit)1是0否*/
+	@Excel(name = "提交(submit)", width = 15,dicCode = "yes_or_no")
+	@ApiModelProperty(value = "提交(submit)1是0否")
+    private String submit;
+	/**付款(payment)1是0否*/
+	@Excel(name = "付款(payment)", width = 15,dicCode = "yes_or_no")
+	@ApiModelProperty(value = "付款(payment)1是0否")
+    private String payment;
+	/**删除状态(0-正常,1-已删除)*/
+	@ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
+    private Integer delFlag;
+	/**单据日期*/
+	@Excel(name = "单据日期", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+	@ApiModelProperty(value = "单据日期")
+    private Date billDate;
+	/**单据编码*/
+	@Excel(name = "单据编码", width = 15)
+	@ApiModelProperty(value = "单据编码")
+    private String billCode;
+	/**供应商(supplier)*/
+	@ApiModelProperty(value = "供应商(supplier)")
+    private String supplier;
+	/**供应商(supplier)*/
+	@Excel(name = "供应商(supplier)", width = 15)
+	@ApiModelProperty(value = "供应商(supplier)")
+    private String supplierName;
+	/**预计付款日期(Expected payment date)*/
+	@Excel(name = "预计付款日期(Expected payment date)", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+	@ApiModelProperty(value = "预计付款日期(Expected payment date)")
+    private Date expectedPaymentDate;
+	/**收款人(payee)*/
+	@Excel(name = "收款人(payee)", width = 15)
+	@ApiModelProperty(value = "收款人(payee)")
+    private String payee;
+	/**开户行(opening bank)*/
+	@Excel(name = "开户行(opening bank)", width = 15)
+	@ApiModelProperty(value = "开户行(opening bank)")
+    private String openingBank;
+	/**银行帐号(bank account)*/
+	@Excel(name = "银行帐号(bank account)", width = 15)
+	@ApiModelProperty(value = "银行帐号(bank account)")
+    private String bankAccount;
+	/**银行代码(swift code)*/
+	@Excel(name = "银行代码(swift code)", width = 15)
+	@ApiModelProperty(value = "银行代码(swift code)")
+    private String swiftCode;
+	/**币种(currency)*/
+	@Excel(name = "币种(currency)", width = 15,dicCode = "currency")
+	@ApiModelProperty(value = "币种(currency)")
+    private String currency;
+	/**委托收款证明(Entrusted Collection Certificate)*/
+	@Excel(name = "委托收款证明(Entrusted Collection Certificate)", width = 15)
+	@ApiModelProperty(value = "委托收款证明(Entrusted Collection Certificate)")
+    private String collectionCertificate;
+	/**备注(notes)*/
+	@Excel(name = "备注(notes)", width = 15)
+	@ApiModelProperty(value = "备注(notes)")
+    private String notes;
+	/**申请金额(approve money)*/
+	@Excel(name = "申请金额(approve money)", width = 15)
+	@ApiModelProperty(value = "申请金额(approve money)")
+    private java.math.BigDecimal approveMoney;
+	/**来源*/
+	@Excel(name = "来源", width = 15)
+	@ApiModelProperty(value = "来源")
+    private String sourceCode;
+	/**所属部门*/
+	@ApiModelProperty(value = "所属部门")
+    private String sysOrgCode;
+	/**预付款比例*/
+	@Excel(name = "预付款比例", width = 15)
+	@ApiModelProperty(value = "预付款比例")
+    private java.math.BigDecimal prepaymentRatio;
+
+	@ExcelCollection(name="采购预付款-子表")
+	@ApiModelProperty(value = "采购预付款-子表")
+	private List<PurAdvancePaymentDetails> purAdvancePaymentDetailsList;
+
+}

+ 4 - 6
srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurCommissionRequestPage.java

@@ -48,19 +48,18 @@ public class PurCommissionRequestPage {
 	@ApiModelProperty(value = "更新时间")
     private Date updateTime;
 	/**审批(approve)(1-是,0-否)*/
-	@Excel(name = "审批(approve)(1-是,0-否)", width = 15)
+	@Excel(name = "审批(approve)", width = 15,dicCode = "yes_or_no")
 	@ApiModelProperty(value = "审批(approve)(1-是,0-否)")
     private String approve;
 	/**提交(submit)1是0否*/
-	@Excel(name = "提交(submit)1是0否", width = 15)
+	@Excel(name = "提交(submit)", width = 15,dicCode = "yes_or_no")
 	@ApiModelProperty(value = "提交(submit)1是0否")
     private String submit;
 	/**付款(payment)1是0否*/
-	@Excel(name = "付款(payment)1是0否", width = 15)
+	@Excel(name = "付款(payment)", width = 15,dicCode = "yes_or_no")
 	@ApiModelProperty(value = "付款(payment)1是0否")
     private String payment;
 	/**删除状态(0-正常,1-已删除)*/
-	@Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
 	@ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
     private Integer delFlag;
 	/**申请日期(bill date)*/
@@ -88,11 +87,10 @@ public class PurCommissionRequestPage {
 	@ApiModelProperty(value = "预计付款日期(Expected payment date)")
     private Date expectedPaymentDate;
 	/**供应商(supplier)*/
-	@Excel(name = "供应商(supplier)", width = 15)
 	@ApiModelProperty(value = "供应商(supplier)")
     private String supplierName;
 	/**币种(currency)*/
-	@Excel(name = "币种(currency)", width = 15)
+	@Excel(name = "币种(currency)", width = 15,dicCode = "currency")
 	@ApiModelProperty(value = "币种(currency)")
     private String currency;
 	/**开户行(opening bank)*/

+ 4 - 6
srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurPaymentRequestPage.java

@@ -48,19 +48,18 @@ public class PurPaymentRequestPage {
 	@ApiModelProperty(value = "更新时间")
     private Date updateTime;
 	/**审批(approve)(1-是,0-否)*/
-	@Excel(name = "审批(approve)(1-是,0-否)", width = 15)
+	@Excel(name = "审批(approve)", width = 15,dicCode = "yes_or_no")
 	@ApiModelProperty(value = "审批(approve)(1-是,0-否)")
     private String approve;
 	/**提交(submit)1是0否*/
-	@Excel(name = "提交(submit)1是0否", width = 15)
+	@Excel(name = "提交(submit)", width = 15,dicCode = "yes_or_no")
 	@ApiModelProperty(value = "提交(submit)1是0否")
     private String submit;
 	/**付款(payment)1是0否*/
-	@Excel(name = "付款(payment)1是0否", width = 15)
+	@Excel(name = "付款(payment)", width = 15,dicCode = "yes_or_no")
 	@ApiModelProperty(value = "付款(payment)1是0否")
     private String payment;
 	/**删除状态(0-正常,1-已删除)*/
-	@Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
 	@ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
     private Integer delFlag;
 	/**单据日期*/
@@ -74,7 +73,6 @@ public class PurPaymentRequestPage {
 	@ApiModelProperty(value = "单据编码")
     private String billCode;
 	/**供应商(supplier)*/
-	@Excel(name = "供应商(supplier)", width = 15)
 	@ApiModelProperty(value = "供应商(supplier)")
     private String supplier;
 	/**供应商(supplier)*/
@@ -104,7 +102,7 @@ public class PurPaymentRequestPage {
 	@ApiModelProperty(value = "银行代码(swift code)")
     private String swiftCode;
 	/**币种(currency)*/
-	@Excel(name = "币种(currency)", width = 15)
+	@Excel(name = "币种(currency)", width = 15,dicCode = "currency")
 	@ApiModelProperty(value = "币种(currency)")
     private String currency;
 	/**委托收款证明(Entrusted Collection Certificate)*/

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

@@ -403,6 +403,31 @@ public class SaleInquiryFormController {
     }
 
 
+    /**
+     * 通过code查询
+     *
+     * @return
+     */
+    @ApiOperation(value = "销售询价单-通过project查询", notes = "销售询价单-通过project查询")
+    @GetMapping(value = "/queryByProject")
+        public Result<SaleInquiryForm> queryByCode(@RequestParam(name = "project", required = true) String project) {
+
+        QueryWrapper<SaleInquiryForm> queryWrapper = new QueryWrapper();
+        queryWrapper.eq("inquiry_project", project);
+        queryWrapper.eq("del_flag", "0");
+        List<SaleInquiryForm> list = saleInquiryFormService.list(queryWrapper);
+        if (list.size() != 0) {
+            SaleInquiryForm saleInquiryForm = list.get(0);
+            if (saleInquiryForm == null) {
+                return Result.error("未找到对应数据");
+            }
+            return Result.OK(saleInquiryForm);
+        }
+
+        return Result.OK(new SaleInquiryForm());
+
+    }
+
     /**
      * 通过id查询
      *

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

@@ -0,0 +1,444 @@
+package org.jeecg.modules.saleCode.controller;
+
+import java.io.UnsupportedEncodingException;
+import java.io.IOException;
+import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.HashMap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang.StringUtils;
+import org.jeecg.modules.saleCode.entity.SaleInterfaceSync;
+import org.jeecg.modules.saleCode.entity.SaleOrder;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.vo.LoginUser;
+import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.query.QueryRuleEnum;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.saleCode.entity.SaleInterfaceItem;
+import org.jeecg.modules.saleCode.entity.SaleInterfaceSync;
+import org.jeecg.modules.saleCode.vo.SaleInterfaceSyncPage;
+import org.jeecg.modules.saleCode.service.ISaleInterfaceSyncService;
+import org.jeecg.modules.saleCode.service.ISaleInterfaceItemService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+
+
+ /**
+ * @Description: 询价单-接口同步表
+ * @Author: jeecg-boot
+ * @Date:   2025-04-17
+ * @Version: V1.0
+ */
+@Api(tags="询价单-接口同步表")
+@RestController
+@RequestMapping("/saleCode/saleInterfaceSync")
+@Slf4j
+public class SaleInterfaceSyncController {
+	@Autowired
+	private ISaleInterfaceSyncService saleInterfaceSyncService;
+	@Autowired
+	private ISaleInterfaceItemService saleInterfaceItemService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param saleInterfaceSync
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "询价单-接口同步表-分页列表查询")
+	@ApiOperation(value="询价单-接口同步表-分页列表查询", notes="询价单-接口同步表-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<SaleInterfaceSync>> queryPageList(SaleInterfaceSync saleInterfaceSync,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+        QueryWrapper<SaleInterfaceSync> queryWrapper = QueryGenerator.initQueryWrapper(saleInterfaceSync, req.getParameterMap());
+		Page<SaleInterfaceSync> page = new Page<SaleInterfaceSync>(pageNo, pageSize);
+		IPage<SaleInterfaceSync> pageList = saleInterfaceSyncService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+
+	/**
+	 * 同步接口数据
+	 *
+	 * @param saleInterfaceSync
+	 * @return
+	 */
+	//@AutoLog(value = "询价单-接口同步表-同步接口数据")
+	@ApiOperation(value="询价单-接口同步表-同步接口数据", notes="询价单-接口同步表-同步接口数据")
+	@GetMapping(value = "/listSync")
+	public Result<String> listSync(SaleInterfaceSync saleInterfaceSync) throws Exception {
+
+		return this.saleInterfaceSyncService.getSyncData(saleInterfaceSync);
+	}
+
+	 /**
+	  *  同步订单 至 询价单
+	  *
+	  * @param ids
+	  * @return
+	  */
+	 @AutoLog(value = "询价单-接口同步表-同步订单")
+	 @ApiOperation(value="询价单-接口同步表-同步订单", notes="询价单-接口同步表-同步订单")
+	 @GetMapping(value = "/actionSyncOrder")
+	 public Result<String> actionSyncOrder(@RequestParam(name="ids",required=true) String ids) {
+		 this.saleInterfaceSyncService.actionSyncOrder(Arrays.asList(ids.split(",")));
+		 return Result.OK("同步订单成功!");
+	 }
+
+
+	 /**
+	  * 关闭
+	  *
+	  * @param ids
+	  * @return
+	  */
+	 @AutoLog(value = "接口同步表-关闭")
+	 @ApiOperation(value = "接口同步表-关闭", notes = "接口同步表-关闭")
+	 @GetMapping(value = "/submitClose")
+	 public Result<String> submitClose(@RequestParam(name = "ids", required = true) String ids,
+									   @RequestParam(name = "closeInfo", required = true) String closeInfo) {
+
+		 QueryWrapper<SaleInterfaceSync> queryWrapper = new QueryWrapper<>();
+		 queryWrapper.in("id", Arrays.asList(ids.split(",")));
+
+		 List<SaleInterfaceSync> list = saleInterfaceSyncService.list(queryWrapper);
+		 if (list.size() == 0) {
+			 return Result.error("数据为空!");
+		 }
+
+		 StringBuffer sb = new StringBuffer();
+		 for (SaleInterfaceSync o : list) {
+			 // 1-已关闭,0-未关闭
+			 Integer close = o.getClose();
+			 String code = o.getReferenceNumber();
+
+			 if (close != null && close.equals(1)) {
+				 sb.append("编号" + code).append("已关闭,请勿再次关闭;");
+				 continue;
+			 }
+		 }
+
+		 if (StringUtils.isNotBlank(sb.toString())) {
+
+			 return Result.error(sb.toString());
+		 }
+
+		 SaleInterfaceSync ent = new SaleInterfaceSync();
+		 ent.setClose(1);
+		 ent.setCloseInfo(closeInfo);
+		 saleInterfaceSyncService.update(ent, queryWrapper);
+
+		 return Result.OK("关闭成功!");
+	 }
+
+
+	 /**
+	  * 批量提交
+	  *
+	  * @param ids
+	  * @return
+	  */
+	 @AutoLog(value = "接口同步表-批量提交")
+	 @ApiOperation(value = "接口同步表-批量提交", notes = "接口同步表-批量提交")
+	 @GetMapping(value = "/submitBatch")
+	 public Result<String> submitBatch(@RequestParam(name = "ids", required = true) String ids) {
+
+		 QueryWrapper<SaleInterfaceSync> queryWrapper = new QueryWrapper<>();
+		 queryWrapper.in("id", Arrays.asList(ids.split(",")));
+
+		 List<SaleInterfaceSync> list = saleInterfaceSyncService.list(queryWrapper);
+		 if (list.size() == 0) {
+			 return Result.error("数据为空!");
+		 }
+
+		 StringBuffer sb = new StringBuffer();
+		 for (SaleInterfaceSync o : list) {
+			 // 1-已提交,0-未提交
+			 Integer submit = o.getSubmit();
+			 String code = o.getReferenceNumber();
+
+			 if (submit != null && submit.equals(1)) {
+				 sb.append("编号" + code).append("已提交,请勿再次提交;");
+				 continue;
+			 }
+		 }
+
+		 if (StringUtils.isNotBlank(sb.toString())) {
+
+			 return Result.error(sb.toString());
+		 }
+
+		 SaleInterfaceSync ent = new SaleInterfaceSync();
+		 ent.setSubmit(1);
+		 saleInterfaceSyncService.update(ent, queryWrapper);
+
+		 return Result.OK("提交成功!");
+	 }
+
+	 /**
+	  * 批量取消提交
+	  *
+	  * @param ids
+	  * @return
+	  */
+	 @AutoLog(value = "接口同步表-批量取消提交")
+	 @ApiOperation(value = "接口同步表-批量取消提交", notes = "接口同步表-批量取消提交")
+	 @GetMapping(value = "/returnSubmitBatch")
+	 public Result<String> returnSubmitBatch(@RequestParam(name = "ids", required = true) String ids) {
+
+		 QueryWrapper<SaleInterfaceSync> queryWrapper = new QueryWrapper<>();
+		 queryWrapper.in("id", Arrays.asList(ids.split(",")));
+
+		 List<SaleInterfaceSync> list = saleInterfaceSyncService.list(queryWrapper);
+		 if (list.size() == 0) {
+			 return Result.error("数据为空!");
+		 }
+
+		 StringBuffer sb = new StringBuffer();
+		 for (SaleInterfaceSync o : list) {
+			 //提交(1-是 ,0-否)
+			 Integer submit = o.getSubmit();
+			 String code = o.getReferenceNumber();
+
+			 if (submit == null || submit.equals(0)) {
+				 sb.append("单号" + code).append("已取消提交,请勿再次取消提交;");
+				 continue;
+			 }
+
+//			 QueryWrapper<SaleOrder> querySaleOrder = new QueryWrapper();
+//			 querySaleOrder.eq("source_code2", code);
+//			 querySaleOrder.eq("del_flag", "0");
+//
+//			 List<SaleOrder> listSaleOrder = saleOrderService.list(querySaleOrder);
+//			 if(listSaleOrder.size() > 0){
+//				 List<String> codeList = listSaleOrder.stream().map(SaleOrder::getBillCode).collect(Collectors.toList());
+//				 String codes = StringUtils.join(codeList.toArray(), ",");
+//				 sb.append("单号" + code).append("已被销售订单使用,请勿取消提交"+codes+";");
+//				 continue;
+//			 }
+		 }
+		 if (StringUtils.isNotBlank(sb.toString())) {
+
+			 return Result.error(sb.toString());
+		 }
+
+		 SaleInterfaceSync ent = new SaleInterfaceSync();
+		 ent.setSubmit(0);
+		 saleInterfaceSyncService.update(ent, queryWrapper);
+
+		 return Result.OK("取消提交成功!");
+	 }
+
+	 /**
+	 *   添加
+	 *
+	 * @param saleInterfaceSyncPage
+	 * @return
+	 */
+	@AutoLog(value = "询价单-接口同步表-添加")
+	@ApiOperation(value="询价单-接口同步表-添加", notes="询价单-接口同步表-添加")
+    @RequiresPermissions("saleCode:sale_interface_sync:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody SaleInterfaceSyncPage saleInterfaceSyncPage) {
+		SaleInterfaceSync saleInterfaceSync = new SaleInterfaceSync();
+		BeanUtils.copyProperties(saleInterfaceSyncPage, saleInterfaceSync);
+		saleInterfaceSyncService.saveMain(saleInterfaceSync, saleInterfaceSyncPage.getSaleInterfaceItemList());
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param saleInterfaceSyncPage
+	 * @return
+	 */
+	@AutoLog(value = "询价单-接口同步表-编辑")
+	@ApiOperation(value="询价单-接口同步表-编辑", notes="询价单-接口同步表-编辑")
+    @RequiresPermissions("saleCode:sale_interface_sync:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody SaleInterfaceSyncPage saleInterfaceSyncPage) {
+		SaleInterfaceSync saleInterfaceSync = new SaleInterfaceSync();
+		BeanUtils.copyProperties(saleInterfaceSyncPage, saleInterfaceSync);
+		SaleInterfaceSync saleInterfaceSyncEntity = saleInterfaceSyncService.getById(saleInterfaceSync.getId());
+		if(saleInterfaceSyncEntity==null) {
+			return Result.error("未找到对应数据");
+		}
+		saleInterfaceSyncService.updateMain(saleInterfaceSync, saleInterfaceSyncPage.getSaleInterfaceItemList());
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "询价单-接口同步表-通过id删除")
+	@ApiOperation(value="询价单-接口同步表-通过id删除", notes="询价单-接口同步表-通过id删除")
+    @RequiresPermissions("saleCode:sale_interface_sync:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		saleInterfaceSyncService.delMain(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "询价单-接口同步表-批量删除")
+	@ApiOperation(value="询价单-接口同步表-批量删除", notes="询价单-接口同步表-批量删除")
+    @RequiresPermissions("saleCode:sale_interface_sync:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.saleInterfaceSyncService.delBatchMain(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "询价单-接口同步表-通过id查询")
+	@ApiOperation(value="询价单-接口同步表-通过id查询", notes="询价单-接口同步表-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<SaleInterfaceSync> queryById(@RequestParam(name="id",required=true) String id) {
+		SaleInterfaceSync saleInterfaceSync = saleInterfaceSyncService.getById(id);
+		if(saleInterfaceSync==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(saleInterfaceSync);
+
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "询价单-接口同步-子表通过主表ID查询")
+	@ApiOperation(value="询价单-接口同步-子表主表ID查询", notes="询价单-接口同步-子表-通主表ID查询")
+	@GetMapping(value = "/querySaleInterfaceItemByMainId")
+	public Result<List<SaleInterfaceItem>> querySaleInterfaceItemListByMainId(@RequestParam(name="id",required=true) String id) {
+		List<SaleInterfaceItem> saleInterfaceItemList = saleInterfaceItemService.selectByMainId(id);
+		return Result.OK(saleInterfaceItemList);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param saleInterfaceSync
+    */
+    @RequiresPermissions("saleCode:sale_interface_sync:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, SaleInterfaceSync saleInterfaceSync) {
+      // Step.1 组装查询条件查询数据
+      QueryWrapper<SaleInterfaceSync> queryWrapper = QueryGenerator.initQueryWrapper(saleInterfaceSync, request.getParameterMap());
+      LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+
+      //配置选中数据查询条件
+      String selections = request.getParameter("selections");
+      if(oConvertUtils.isNotEmpty(selections)) {
+         List<String> selectionList = Arrays.asList(selections.split(","));
+         queryWrapper.in("id",selectionList);
+      }
+      //Step.2 获取导出数据
+      List<SaleInterfaceSync> saleInterfaceSyncList = saleInterfaceSyncService.list(queryWrapper);
+
+      // Step.3 组装pageList
+      List<SaleInterfaceSyncPage> pageList = new ArrayList<SaleInterfaceSyncPage>();
+      for (SaleInterfaceSync main : saleInterfaceSyncList) {
+          SaleInterfaceSyncPage vo = new SaleInterfaceSyncPage();
+          BeanUtils.copyProperties(main, vo);
+          List<SaleInterfaceItem> saleInterfaceItemList = saleInterfaceItemService.selectByMainId(main.getId());
+          vo.setSaleInterfaceItemList(saleInterfaceItemList);
+          pageList.add(vo);
+      }
+
+      // Step.4 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      mv.addObject(NormalExcelConstants.FILE_NAME, "询价单-接口同步表列表");
+      mv.addObject(NormalExcelConstants.CLASS, SaleInterfaceSyncPage.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("询价单-接口同步表数据", "导出人:"+sysUser.getRealname(), "询价单-接口同步表"));
+      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+      return mv;
+    }
+
+    /**
+    * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    @RequiresPermissions("saleCode:sale_interface_sync:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          // 获取上传文件对象
+          MultipartFile file = entity.getValue();
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<SaleInterfaceSyncPage> list = ExcelImportUtil.importExcel(file.getInputStream(), SaleInterfaceSyncPage.class, params);
+              for (SaleInterfaceSyncPage page : list) {
+                  SaleInterfaceSync po = new SaleInterfaceSync();
+                  BeanUtils.copyProperties(page, po);
+                  saleInterfaceSyncService.saveMain(po, page.getSaleInterfaceItemList());
+              }
+              return Result.OK("文件导入成功!数据行数:" + list.size());
+          } catch (Exception e) {
+              log.error(e.getMessage(),e);
+              return Result.error("文件导入失败:"+e.getMessage());
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.OK("文件导入失败!");
+    }
+
+}

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

@@ -764,6 +764,10 @@ public class SaleInvoiceController {
         BaseTemplates templatesZ = baseTemplatesService.getByTemplateType("销售发票有折上折");
 
         SaleInvoice saleInvoice = saleInvoiceService.getById(id);
+
+        String sourceCode = saleInvoice.getSourceCode();//发货通知单
+        String sourceCode2 = saleInvoice.getSourceCode2();//佣金订单
+
         SaleDelivery saleDelivery = saleDeliveryService.getByBillCode(saleInvoice.getSourceCode());
         SaleOrder saleOrder = saleOrderService.getByBillCode(saleDelivery.getSourceCode());
         String saleCreateBy = "";
@@ -823,11 +827,13 @@ public class SaleInvoiceController {
 //                }
 
 
+                String paymentTerms = null;
                 String customerId = saleInvoice.getCustomer();
                 if (StringUtils.isNotBlank(customerId)) {
 
                     CuspCustomerProfile classEnt = cuspCustomerProfileService.getById(customerId);
                     if (classEnt != null) {
+                        paymentTerms = classEnt.getPaymentTerms();
 
                         saleInvoice.setContacts(classEnt.getContacts());
                         saleInvoice.setPhone(classEnt.getPhone());
@@ -864,7 +870,8 @@ public class SaleInvoiceController {
                     saleQuotationProductList = saleQuotationProductService.list(productWrapper);
                 }
                 // 获取销售订单
-                saleInvoice.setPaymentTerms(saleOrder.getPaymentTerms());
+//                saleInvoice.setPaymentTerms(saleOrder.getPaymentTerms());
+                saleInvoice.setPaymentTerms(paymentTerms);
                 // 客户订单号
                 saleInvoice.setContactsNo(saleOrder.getCustomerOrder());
                 // 查询数据字典

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

@@ -252,13 +252,13 @@ public class SaleOrderController {
             SaleQuotationProduct saleQuotationProduct = saleQuotationProductList.stream().filter(e -> e.getId().equals(product.getSourceId())).findFirst().orElse(null);
             if (saleQuotationProduct != null) {
                 PurQuotationSelectionProduct quotationSelectionProduct = purQuotationSelectionProductList.stream().filter(e -> e.getId().equals(saleQuotationProduct.getSourceId())).findFirst().orElse(null);
-                if (oConvertUtils.isNotEmpty(quotationSelectionProduct.getDiscount())) {
+                if (quotationSelectionProduct !=null && oConvertUtils.isNotEmpty(quotationSelectionProduct.getDiscount())) {
                     product.setDiscount(quotationSelectionProduct.getDiscount());
                 }else{
                     product.setDiscount(new BigDecimal("0"));
                     product.setTaxPriceOriginal(product.getTaxPriceGys());
                 }
-                if (oConvertUtils.isNotEmpty(quotationSelectionProduct.getTaxPriceOriginal())) {
+                if (quotationSelectionProduct !=null && oConvertUtils.isNotEmpty(quotationSelectionProduct.getTaxPriceOriginal())) {
                     product.setTaxPriceOriginal(quotationSelectionProduct.getTaxPriceOriginal());
                 }
             }
@@ -1124,7 +1124,7 @@ public class SaleOrderController {
                             String saleId = a.getId();
                             if (StringUtils.isNotBlank(o.getSourceId()) && o.getSourceId().equals(saleId)) {
                                 if (a.getDiscount() != null) {
-                                    o.setDiscountText(a.getDiscount().setScale(2).toString());
+                                    o.setDiscountText(a.getDiscount().setScale(2).toString()+"%");
                                 }
                                 if (a.getSalePrice() != null) {
 

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

@@ -664,7 +664,7 @@ public class SaleQuotationController {
                         o.setUnit(findProduct.getMeasurementUnit());
                     }
                     if (o.getDiscount() != null && o.getDiscount().intValue() != 0){
-                        o.setDiscountText(String.valueOf(o.getDiscount()));
+                        o.setDiscountText(String.valueOf(o.getDiscount())+"%");
                     }
 
                     BigDecimal dic = o.getDiscount() ==null?BigDecimal.ZERO:o.getDiscount();

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleInquiryForm.java

@@ -90,7 +90,7 @@ public class SaleInquiryForm implements Serializable {
 	/**询价客户(inquiry customer)*/
 	@Excel(name = "询价客户(inquiry customer)", width = 15)
     @ApiModelProperty(value = "询价客户(inquiry customer)")
-    @Dict(dictTable = "cusp_customer_profile", dicCode = "id", dicText = "name")
+    @Dict(dictTable = "cusp_customer_profile", dicCode = "id", dicText = "abbreviation")
     private String inquiryCustomer;
 
     private String projectName;

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

@@ -0,0 +1,120 @@
+package org.jeecg.modules.saleCode.entity;
+
+import java.io.Serializable;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import org.jeecg.common.constant.ProvinceCityArea;
+import org.jeecg.common.util.SpringContextUtils;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import java.util.Date;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.UnsupportedEncodingException;
+
+/**
+ * @Description: 询价单-接口同步-子表
+ * @Author: jeecg-boot
+ * @Date:   2025-04-17
+ * @Version: V1.0
+ */
+@ApiModel(value="sale_interface_item对象", description="询价单-接口同步-子表")
+@Data
+@TableName("sale_interface_item")
+public class SaleInterfaceItem implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**id*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "id")
+    private String id;
+	/**headId*/
+    @ApiModelProperty(value = "headId")
+    private String headId;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+	/**创建日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建日期")
+    private Date createTime;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+	/**更新日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新日期")
+    private Date updateTime;
+	/**所属部门*/
+    @ApiModelProperty(value = "所属部门")
+    private String sysOrgCode;
+	/**删除状态*/
+	@Excel(name = "删除状态", width = 15)
+    @ApiModelProperty(value = "删除状态")
+    @TableLogic
+    private Integer delFlag;
+	/**同步状态(0-未同步,1-同步成功,2-同步失败)*/
+	@Excel(name = "同步状态(0-未同步,1-同步成功,2-同步失败)", width = 15)
+    @ApiModelProperty(value = "同步状态(0-未同步,1-同步成功,2-同步失败)")
+    private Integer sync;
+	/**同步信息*/
+	@Excel(name = "同步信息", width = 15)
+    @ApiModelProperty(value = "同步信息")
+    private String syncInfo;
+	/**同步人*/
+	@Excel(name = "同步人", width = 15)
+    @ApiModelProperty(value = "同步人")
+    private String syncBy;
+	/**同步时间*/
+	@Excel(name = "同步时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "同步时间")
+    private Date syncTime;
+	/**同步单号*/
+	@Excel(name = "同步单号", width = 15)
+    @ApiModelProperty(value = "同步单号")
+    private String syncCode;
+	/**同步后的产品编码*/
+	@Excel(name = "同步后的产品编码", width = 15)
+    @ApiModelProperty(value = "同步后的产品编码")
+    private String syncItemCode;
+	/**内容*/
+	@Excel(name = "内容", width = 15)
+    @ApiModelProperty(value = "内容")
+    private String content;
+	/**number*/
+	@Excel(name = "number", width = 15)
+    @ApiModelProperty(value = "number")
+    private Integer number;
+	/**description*/
+	@Excel(name = "description", width = 15)
+    @ApiModelProperty(value = "description")
+    private String description;
+	/**supplierPartNumber*/
+	@Excel(name = "supplierPartNumber", width = 15)
+    @ApiModelProperty(value = "supplierPartNumber")
+    private String supplierPartNumber;
+	/**quantity*/
+	@Excel(name = "quantity", width = 15)
+    @ApiModelProperty(value = "quantity")
+    private String quantity;
+	/**unitOfMeasure*/
+	@Excel(name = "unitOfMeasure", width = 15)
+    @ApiModelProperty(value = "unitOfMeasure")
+    private String unitOfMeasure;
+	/**unitPrice*/
+	@Excel(name = "unitPrice", width = 15)
+    @ApiModelProperty(value = "unitPrice")
+    private java.math.BigDecimal unitPrice;
+	/**comment*/
+	@Excel(name = "comment", width = 15)
+    @ApiModelProperty(value = "comment")
+    private String comment;
+}

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

@@ -0,0 +1,219 @@
+package org.jeecg.modules.saleCode.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import org.jeecg.common.constant.ProvinceCityArea;
+import org.jeecg.common.util.SpringContextUtils;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Description: 询价单-接口同步表
+ * @Author: jeecg-boot
+ * @Date:   2025-04-17
+ * @Version: V1.0
+ */
+@ApiModel(value="sale_interface_sync对象", description="询价单-接口同步表")
+@Data
+@TableName("sale_interface_sync")
+public class SaleInterfaceSync implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**id*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "id")
+    private String id;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+	/**创建日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建日期")
+    private Date createTime;
+	/**接口传来的日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建日期")
+    private Date createdDate;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+	/**更新日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新日期")
+    private Date updateTime;
+	/**所属部门*/
+    @ApiModelProperty(value = "所属部门")
+    private String sysOrgCode;
+	/**交易编号*/
+	@Excel(name = "交易编号", width = 15)
+    @ApiModelProperty(value = "交易编号")
+    private String transactionId;
+	/**客户号*/
+	@Excel(name = "客户号", width = 15)
+    @ApiModelProperty(value = "客户号")
+    private String buyerTnId;
+	/**客户名称*/
+	@Excel(name = "客户名称", width = 15)
+    @ApiModelProperty(value = "客户名称")
+    private String buyerName;
+	/**供应商号*/
+	@Excel(name = "供应商号", width = 15)
+    @ApiModelProperty(value = "供应商号")
+    private String supplierTnId;
+	/**供应商名称*/
+	@Excel(name = "供应商名称", width = 15)
+    @ApiModelProperty(value = "供应商名称")
+    private String supplierName;
+	/**优先级*/
+	@Excel(name = "优先级", width = 15)
+    @ApiModelProperty(value = "优先级")
+    private String priority;
+	/**币种*/
+	@Excel(name = "币种", width = 15)
+    @ApiModelProperty(value = "币种")
+    private String currencyCode;
+	/**编号*/
+	@Excel(name = "编号", width = 15)
+    @ApiModelProperty(value = "编号")
+    private String referenceNumber;
+	/**请求交货日期*/
+	@Excel(name = "请求交货日期", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "请求交货日期")
+    private Date requestedDeliveryDate;
+	/**建议截止日期*/
+	@Excel(name = "建议截止日期", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "建议截止日期")
+    private Date adviseBeforeDate;
+	/**提交日期*/
+	@Excel(name = "提交日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "提交日期")
+    private Date submittedDate;
+	/**内容*/
+	@Excel(name = "内容", width = 15)
+    @ApiModelProperty(value = "内容")
+    private String content;
+	/**同步状态(0-未同步,1-同步成功,2-同步失败)*/
+	@Excel(name = "同步状态(0-未同步,1-同步成功,2-同步失败)", width = 15)
+    @ApiModelProperty(value = "同步状态(0-未同步,1-同步成功,2-同步失败)")
+    private Integer sync;
+	@Excel(name = "提交(0否,1是)", width = 15)
+    @ApiModelProperty(value = "提交(0否,1是)")
+    private Integer submit;
+	@Excel(name = "关闭(0否,1是)", width = 15)
+    @ApiModelProperty(value = "关闭(0否,1是)")
+    private Integer close;
+	/**关闭信息*/
+	@Excel(name = "关闭信息", width = 15)
+    @ApiModelProperty(value = "关闭信息")
+    private String closeInfo;
+	/**同步信息*/
+	@Excel(name = "同步信息", width = 15)
+    @ApiModelProperty(value = "同步信息")
+    private String syncInfo;
+	/**同步人*/
+	@Excel(name = "同步人", width = 15)
+    @ApiModelProperty(value = "同步人")
+    private String syncBy;
+	/**同步时间*/
+	@Excel(name = "同步时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "同步时间")
+    private Date syncTime;
+	/**同步单号*/
+	@Excel(name = "同步单号", width = 15)
+    @ApiModelProperty(value = "同步单号")
+    private String syncCode;
+	/**删除状态*/
+	@Excel(name = "删除状态", width = 15)
+    @ApiModelProperty(value = "删除状态")
+//    @TableLogic
+    private Integer delFlag;
+	/**subject*/
+	@Excel(name = "subject", width = 15)
+    @ApiModelProperty(value = "subject")
+    private String subject;
+	/**comment*/
+	@Excel(name = "comment", width = 15)
+    @ApiModelProperty(value = "comment")
+    private String comment;
+	/**requisitionId*/
+	@Excel(name = "requisitionId", width = 15)
+    @ApiModelProperty(value = "requisitionId")
+    private String requisitionId;
+	/**requestForQuoteId*/
+	@Excel(name = "requestForQuoteId", width = 15)
+    @ApiModelProperty(value = "requestForQuoteId")
+    private String requestForQuoteId;
+	/**quoteId*/
+	@Excel(name = "quoteId", width = 15)
+    @ApiModelProperty(value = "quoteId")
+    private String quoteId;
+	/**offeredQuality*/
+	@Excel(name = "offeredQuality", width = 15)
+    @ApiModelProperty(value = "offeredQuality")
+    private String offeredQuality;
+	/**taxStatus*/
+	@Excel(name = "taxStatus", width = 15)
+    @ApiModelProperty(value = "taxStatus")
+    private String taxStatus;
+	/**paymentTerms*/
+	@Excel(name = "paymentTerms", width = 15)
+    @ApiModelProperty(value = "paymentTerms")
+    private String paymentTerms;
+	/**vesselCode*/
+	@Excel(name = "vesselCode", width = 15)
+    @ApiModelProperty(value = "vesselCode")
+    private String vesselCode;
+	/**vesselImo*/
+	@Excel(name = "vesselImo", width = 15)
+    @ApiModelProperty(value = "vesselImo")
+    private String vesselImo;
+	/**buyerContactName*/
+	@Excel(name = "buyerContactName", width = 15)
+    @ApiModelProperty(value = "buyerContactName")
+    private String buyerContactName;
+	/**buyerContactJob*/
+	@Excel(name = "buyerContactJob", width = 15)
+    @ApiModelProperty(value = "buyerContactJob")
+    private String buyerContactJob;
+	/**buyerTelephone*/
+	@Excel(name = "buyerTelephone", width = 15)
+    @ApiModelProperty(value = "buyerTelephone")
+    private String buyerTelephone;
+	/**buyerFax*/
+	@Excel(name = "buyerFax", width = 15)
+    @ApiModelProperty(value = "buyerFax")
+    private String buyerFax;
+	/**buyerEmail*/
+	@Excel(name = "buyerEmail", width = 15)
+    @ApiModelProperty(value = "buyerEmail")
+    private String buyerEmail;
+	/**status*/
+	@Excel(name = "status", width = 15)
+    @ApiModelProperty(value = "status")
+    private String status;
+	/**exported*/
+	@Excel(name = "exported", width = 15)
+    @ApiModelProperty(value = "exported")
+    private String exported;
+}

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

@@ -107,6 +107,7 @@ public class SaleOrder implements Serializable {
 	/**客户(customer)*/
 	@Excel(name = "客户(customer)", width = 15)
     @ApiModelProperty(value = "客户(customer)")
+    @Dict(dictTable = "cusp_customer_profile", dicCode = "id", dicText = "abbreviation")
     private String customer;
 	/**客户名称*/
 	@Excel(name = "客户名称", width = 15)

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

@@ -90,6 +90,7 @@ public class SaleQuotation implements Serializable {
 	/**报价客户*/
 	@Excel(name = "报价客户", width = 15)
     @ApiModelProperty(value = "报价客户")
+    @Dict(dictTable = "cusp_customer_profile", dicCode = "id", dicText = "abbreviation")
     private String quotationCustomer;
 	/**报价客户名称*/
 	@Excel(name = "报价客户名称", width = 15)

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

@@ -51,11 +51,9 @@ public class SaleQuotationProduct implements Serializable {
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
 	/**状态(1-启用,0-停用)*/
-	@Excel(name = "状态(1-启用,0-停用)", width = 15)
     @ApiModelProperty(value = "状态(1-启用,0-停用)")
     private Integer status;
 	/**删除状态(0-正常,1-已删除)*/
-	@Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
     @ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
     @TableLogic
     private Integer delFlag;
@@ -69,7 +67,6 @@ public class SaleQuotationProduct implements Serializable {
     @ApiModelProperty(value = "交期")
     private Date deliveryTime;
 	/**产品id*/
-	@Excel(name = "产品id", width = 15)
     @ApiModelProperty(value = "产品id")
     private String productId;
 	/**产品分类*/
@@ -163,7 +160,6 @@ public class SaleQuotationProduct implements Serializable {
 	//折扣前价格
     private java.math.BigDecimal taxPriceOriginal;
 	/**上一次报价(last price)*/
-	@Excel(name = "上一次报价(last price)", width = 15)
     @ApiModelProperty(value = "上一次报价(last price)")
     private java.math.BigDecimal lastPrice;
 	/**含税金额(tax amount)*/

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

@@ -51,11 +51,9 @@ public class SaleQuotationShip implements Serializable {
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
 	/**状态(1-启用,0-停用)*/
-	@Excel(name = "状态(1-启用,0-停用)", width = 15)
     @ApiModelProperty(value = "状态(1-启用,0-停用)")
     private Integer status;
 	/**删除状态(0-正常,1-已删除)*/
-	@Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
     @ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
     @TableLogic
     private Integer delFlag;
@@ -63,7 +61,6 @@ public class SaleQuotationShip implements Serializable {
     @ApiModelProperty(value = "表头主键(销售报价单)")
     private String headId;
 	/**船id*/
-	@Excel(name = "船id", width = 15)
     @ApiModelProperty(value = "船id")
     private String shipId;
 	/**船名*/

+ 31 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/SaleInterfaceItemMapper.java

@@ -0,0 +1,31 @@
+package org.jeecg.modules.saleCode.mapper;
+
+import java.util.List;
+import org.jeecg.modules.saleCode.entity.SaleInterfaceItem;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @Description: 询价单-接口同步-子表
+ * @Author: jeecg-boot
+ * @Date:   2025-04-17
+ * @Version: V1.0
+ */
+public interface SaleInterfaceItemMapper extends BaseMapper<SaleInterfaceItem> {
+
+	/**
+	 * 通过主表id删除子表数据
+	 *
+	 * @param mainId 主表id
+	 * @return boolean
+	 */
+	public boolean deleteByMainId(@Param("mainId") String mainId);
+
+  /**
+   * 通过主表id查询子表数据
+   *
+   * @param mainId 主表id
+   * @return List<SaleInterfaceItem>
+   */
+	public List<SaleInterfaceItem> selectByMainId(@Param("mainId") String mainId);
+}

+ 17 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/SaleInterfaceSyncMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.saleCode.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.saleCode.entity.SaleInterfaceSync;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 询价单-接口同步表
+ * @Author: jeecg-boot
+ * @Date:   2025-04-17
+ * @Version: V1.0
+ */
+public interface SaleInterfaceSyncMapper extends BaseMapper<SaleInterfaceSync> {
+
+}

+ 16 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleInterfaceItemMapper.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.saleCode.mapper.SaleInterfaceItemMapper">
+
+	<delete id="deleteByMainId" parameterType="java.lang.String">
+		DELETE 
+		FROM  sale_interface_item 
+		WHERE
+			 head_id = #{mainId} 	</delete>
+	
+	<select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.saleCode.entity.SaleInterfaceItem">
+		SELECT * 
+		FROM  sale_interface_item
+		WHERE
+			 head_id = #{mainId} 	</select>
+</mapper>

+ 5 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleInterfaceSyncMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.saleCode.mapper.SaleInterfaceSyncMapper">
+
+</mapper>

+ 22 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/ISaleInterfaceItemService.java

@@ -0,0 +1,22 @@
+package org.jeecg.modules.saleCode.service;
+
+import org.jeecg.modules.saleCode.entity.SaleInterfaceItem;
+import com.baomidou.mybatisplus.extension.service.IService;
+import java.util.List;
+
+/**
+ * @Description: 询价单-接口同步-子表
+ * @Author: jeecg-boot
+ * @Date:   2025-04-17
+ * @Version: V1.0
+ */
+public interface ISaleInterfaceItemService extends IService<SaleInterfaceItem> {
+
+	/**
+	 * 通过主表id查询子表数据
+	 *
+	 * @param mainId 主表id
+	 * @return List<SaleInterfaceItem>
+	 */
+	public List<SaleInterfaceItem> selectByMainId(String mainId);
+}

+ 57 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/ISaleInterfaceSyncService.java

@@ -0,0 +1,57 @@
+package org.jeecg.modules.saleCode.service;
+
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.saleCode.entity.SaleInterfaceItem;
+import org.jeecg.modules.saleCode.entity.SaleInterfaceSync;
+import com.baomidou.mybatisplus.extension.service.IService;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @Description: 询价单-接口同步表
+ * @Author: jeecg-boot
+ * @Date:   2025-04-17
+ * @Version: V1.0
+ */
+public interface ISaleInterfaceSyncService extends IService<SaleInterfaceSync> {
+
+	public Result<String> getSyncData(SaleInterfaceSync saleInterfaceSync) throws Exception;
+	/**
+	 * 添加一对多
+	 *
+	 * @param saleInterfaceSync
+	 * @param saleInterfaceItemList
+	 */
+	public void saveMain(SaleInterfaceSync saleInterfaceSync,List<SaleInterfaceItem> saleInterfaceItemList) ;
+	
+	/**
+	 * 修改一对多
+	 *
+   * @param saleInterfaceSync
+   * @param saleInterfaceItemList
+	 */
+	public void updateMain(SaleInterfaceSync saleInterfaceSync,List<SaleInterfaceItem> saleInterfaceItemList);
+	
+	/**
+	 * 删除一对多
+	 *
+	 * @param id
+	 */
+	public void delMain (String id);
+	
+	/**
+	 * 批量删除一对多
+	 *
+	 * @param idList
+	 */
+	public void delBatchMain (Collection<? extends Serializable> idList);
+
+	/**
+	 *
+	 *
+	 * @param idList
+	 */
+	public void actionSyncOrder (Collection<? extends Serializable> idList);
+
+}

+ 27 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleInterfaceItemServiceImpl.java

@@ -0,0 +1,27 @@
+package org.jeecg.modules.saleCode.service.impl;
+
+import org.jeecg.modules.saleCode.entity.SaleInterfaceItem;
+import org.jeecg.modules.saleCode.mapper.SaleInterfaceItemMapper;
+import org.jeecg.modules.saleCode.service.ISaleInterfaceItemService;
+import org.springframework.stereotype.Service;
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * @Description: 询价单-接口同步-子表
+ * @Author: jeecg-boot
+ * @Date:   2025-04-17
+ * @Version: V1.0
+ */
+@Service
+public class SaleInterfaceItemServiceImpl extends ServiceImpl<SaleInterfaceItemMapper, SaleInterfaceItem> implements ISaleInterfaceItemService {
+	
+	@Autowired
+	private SaleInterfaceItemMapper saleInterfaceItemMapper;
+	
+	@Override
+	public List<SaleInterfaceItem> selectByMainId(String mainId) {
+		return saleInterfaceItemMapper.selectByMainId(mainId);
+	}
+}

+ 266 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleInterfaceSyncServiceImpl.java

@@ -0,0 +1,266 @@
+package org.jeecg.modules.saleCode.service.impl;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import io.micrometer.core.instrument.util.StringUtils;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.saleCode.entity.SaleInterfaceSync;
+import org.jeecg.modules.saleCode.entity.SaleInterfaceItem;
+import org.jeecg.modules.saleCode.mapper.SaleInterfaceItemMapper;
+import org.jeecg.modules.saleCode.mapper.SaleInterfaceSyncMapper;
+import org.jeecg.modules.saleCode.service.ISaleInterfaceSyncService;
+import org.jeecg.modules.saleCode.util.HttpUtils;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.io.Serializable;
+import java.time.Instant;
+import java.util.*;
+
+/**
+ * @Description: 询价单-接口同步表
+ * @Author: jeecg-boot
+ * @Date: 2025-04-17
+ * @Version: V1.0
+ */
+@Service
+public class SaleInterfaceSyncServiceImpl extends ServiceImpl<SaleInterfaceSyncMapper, SaleInterfaceSync> implements ISaleInterfaceSyncService {
+
+    @Autowired
+    private SaleInterfaceSyncMapper saleInterfaceSyncMapper;
+    @Autowired
+    private SaleInterfaceItemMapper saleInterfaceItemMapper;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Result<String> getSyncData(SaleInterfaceSync saleInterfaceSync) {
+
+        try {
+
+            JsonNode jsonNode = HttpUtils.getDateListByUrl(null);
+            String content = jsonNode.get("content").toPrettyString();
+
+			String numberOfElements = jsonNode.get("numberOfElements").toPrettyString();
+			String totalElements = jsonNode.get("totalElements").toPrettyString();
+			String totalPages = jsonNode.get("totalPages").toPrettyString();
+            ObjectMapper mapper = new ObjectMapper();
+            Map<String, String> aa = new HashMap<>();
+            aa.put("id","7781d549-2c06-4c95-8bf8-05b31a4b2f8a");
+//            List<Map<String, String>> list =new ArrayList<>();
+//            list.add(aa);
+            List<Map<String, String>> list = mapper.readValue(content, new TypeReference<List<Map<String, String>>>() {
+            });
+            if(list.size() == 0){
+                list.add(aa);
+            }
+            for (Map<String, String> m : list) {
+
+                String id = m.get("id");
+                SaleInterfaceSync headEntry = this.getById(id);
+                if (headEntry != null) {
+                    continue;
+                }
+
+                JsonNode jsonNodeAll = HttpUtils.getDateByUrl(id, null);
+//                Map<String, Object> jsonNodeAll = mapper.convertValue(jsonNodeAll1, Map.class);
+                String buyer = jsonNodeAll.get("buyer").toPrettyString();
+                Map<String, Object> buyerMap = mapper.readValue(buyer, new TypeReference<Map<String, Object>>() {
+                });
+                String buyerTnId = buyerMap.get("tnId") == null ? "" : buyerMap.get("tnId").toString();
+                String buyerName = buyerMap.get("name") == null ? "" : buyerMap.get("name").toString();
+
+                String priority = jsonNodeAll.get("priority") == null ? "" : jsonNodeAll.get("priority").asText();
+
+                String currency = jsonNodeAll.get("currency").toPrettyString();
+                Map<String, Object> currencyMap = mapper.readValue(currency, new TypeReference<Map<String, Object>>() {
+                });
+                String currencyCode = currencyMap.get("code") == null ? "" : currencyMap.get("code").toString();
+
+                String referenceNumber = jsonNodeAll.get("referenceNumber") == null ? "" : jsonNodeAll.get("referenceNumber").asText();
+                String requestedDeliveryDate = jsonNodeAll.get("requestedDeliveryDate") == null ? "" : jsonNodeAll.get("requestedDeliveryDate").asText();
+                String adviseBeforeDate = jsonNodeAll.get("adviseBeforeDate") == null ? "" : jsonNodeAll.get("adviseBeforeDate").asText();
+                String submittedDate = jsonNodeAll.get("submittedDate") == null ? "" : jsonNodeAll.get("submittedDate").asText();
+                String createdDate = jsonNodeAll.get("createdDate") == null ? "" : jsonNodeAll.get("createdDate").asText();
+
+                String subject = jsonNodeAll.get("subject") == null ? "" : jsonNodeAll.get("subject").asText();
+                String comment = jsonNodeAll.get("comment") == null ? "" : jsonNodeAll.get("comment").asText();
+                String taxStatus = jsonNodeAll.get("taxStatus") == null ? "" : jsonNodeAll.get("taxStatus").asText();
+                String paymentTerms = jsonNodeAll.get("paymentTerms") == null ? "" : jsonNodeAll.get("paymentTerms").asText();
+
+                String vessel = jsonNodeAll.get("vessel") == null ? "" : jsonNodeAll.get("vessel").toPrettyString();
+                Map<String, Object> vesselMap = mapper.readValue(vessel, new TypeReference<Map<String, Object>>() {
+                });
+                String vesselName = vesselMap.get("name") == null ? "" : vesselMap.get("name").toString();
+                String vesselImoNumber = vesselMap.get("imoNumber") == null ? "" : vesselMap.get("imoNumber").toString();
+
+                String buyerContact = jsonNodeAll.get("buyerContact").toPrettyString();
+                JsonNode buyerContactMap = mapper.readTree(buyerContact);
+
+                String buyerContact2 = buyerContactMap.get("contact") == null ? "" : buyerContactMap.get("contact").toPrettyString();
+                JsonNode buyerContact2Map = mapper.readTree(buyerContact2);
+
+                String buyerContactName = buyerContact2Map.get("name") == null ? "" : buyerContact2Map.get("name").asText();
+                String buyerContactJobTitle = buyerContact2Map.get("jobTitle") == null ? "" : buyerContact2Map.get("jobTitle").asText();
+                String buyerContactTelephone = buyerContact2Map.get("telephone") == null ? "" : buyerContact2Map.get("telephone").asText();
+                String buyerContactFax = buyerContact2Map.get("fax") == null ? "" : buyerContact2Map.get("fax").asText();
+                String buyerContactEmail = buyerContact2Map.get("email") == null ? "" : buyerContact2Map.get("email").asText();
+
+                String status = jsonNodeAll.get("status") == null ? "" : jsonNodeAll.get("status").asText();
+                String exported = jsonNodeAll.get("exported") == null ? "" : jsonNodeAll.get("exported").asText();
+
+                String lineItems = jsonNodeAll.get("lineItems").toPrettyString();
+                List<Map<String, Object>> lineItemsMap = mapper.readValue(lineItems, new TypeReference<List<Map<String, Object>>>() {
+                });
+
+                List<SaleInterfaceItem> saleInterfaceItemList = new ArrayList<>();
+                for(Map<String, Object> line:lineItemsMap){
+
+                    SaleInterfaceItem item = new SaleInterfaceItem();
+
+                    String number = line.get("number") == null ? "" : line.get("number").toString();
+                    String description = line.get("description") == null ? "" : line.get("description").toString();
+                    String quantity = line.get("quantity") == null ? "" : line.get("quantity").toString();
+                    String unitOfMeasure = line.get("unitOfMeasure") == null ? "" : line.get("unitOfMeasure").toString();
+//                    String unitPrice = line.get("unitPrice");
+                    String commentLine = line.get("comment") == null ? "" : line.get("comment").toString();
+
+                    item.setHeadId(id);
+                    item.setContent(line.toString());
+                    item.setNumber(Integer.valueOf(number));
+                    item.setDescription(description);
+                    item.setQuantity(quantity);
+                    item.setUnitOfMeasure(unitOfMeasure);
+//                    item.setUnitPrice();
+                    item.setComment(commentLine);
+                    saleInterfaceItemList.add(item);
+                }
+
+                headEntry = new SaleInterfaceSync();
+
+                headEntry.setId(m.get("id"));
+                headEntry.setBuyerTnId(buyerTnId);
+                headEntry.setBuyerName(buyerName);
+                headEntry.setPriority(priority);
+                headEntry.setCurrencyCode(currencyCode);
+                headEntry.setReferenceNumber(referenceNumber);
+
+                if(StringUtils.isNotBlank(requestedDeliveryDate)){
+                    Instant instant = Instant.parse(requestedDeliveryDate);
+                    headEntry.setRequestedDeliveryDate(Date.from(instant));
+                }
+                if(StringUtils.isNotBlank(adviseBeforeDate)){
+                    Instant instant = Instant.parse(adviseBeforeDate);
+                    headEntry.setAdviseBeforeDate(Date.from(instant));
+                }
+                if(StringUtils.isNotBlank(submittedDate)){
+                    Instant instant = Instant.parse(submittedDate);
+                    headEntry.setSubmittedDate(Date.from(instant));
+                }
+                if(StringUtils.isNotBlank(createdDate)){
+                    Instant instant = Instant.parse(createdDate);
+                    headEntry.setCreatedDate(Date.from(instant));
+                }
+
+                headEntry.setContent(jsonNodeAll.toString());
+                headEntry.setSubject(subject);
+                headEntry.setComment(comment);
+                headEntry.setTaxStatus(taxStatus);
+                headEntry.setPaymentTerms(paymentTerms);
+                headEntry.setVesselCode(vesselName);
+                headEntry.setVesselImo(vesselImoNumber);
+
+                headEntry.setBuyerContactName(buyerContactName);
+                headEntry.setBuyerContactJob(buyerContactJobTitle);
+                headEntry.setBuyerTelephone(buyerContactTelephone);
+                headEntry.setBuyerFax(buyerContactFax);
+                headEntry.setBuyerEmail(buyerContactEmail);
+                headEntry.setStatus(status);
+                headEntry.setExported(exported);
+
+                try {
+                    saveMain(headEntry,saleInterfaceItemList);
+                }catch (Exception e){
+                    System.out.println("===========重复数据=========");
+                }
+
+            }
+
+        } catch (Exception e) {
+            System.out.println("====================================");
+            throw new RuntimeException(e.getMessage());
+        }
+        return Result.OK("执行成功");
+    }
+    public static void main(String[] args) {
+        String dateStr = "2025-04-11T08:33:50.963Z";
+
+        Instant instant = Instant.parse(dateStr);
+        Date date = Date.from(instant);
+
+        System.out.println(date);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void actionSyncOrder(Collection<? extends Serializable> idList) {
+
+        for (Serializable id : idList) {
+
+        }
+    }
+
+
+
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void saveMain(SaleInterfaceSync saleInterfaceSync, List<SaleInterfaceItem> saleInterfaceItemList) {
+        saleInterfaceSyncMapper.insert(saleInterfaceSync);
+        if (saleInterfaceItemList != null && saleInterfaceItemList.size() > 0) {
+            for (SaleInterfaceItem entity : saleInterfaceItemList) {
+                //外键设置
+                entity.setHeadId(saleInterfaceSync.getId());
+                saleInterfaceItemMapper.insert(entity);
+            }
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void updateMain(SaleInterfaceSync saleInterfaceSync, List<SaleInterfaceItem> saleInterfaceItemList) {
+        saleInterfaceSyncMapper.updateById(saleInterfaceSync);
+
+        //1.先删除子表数据
+        saleInterfaceItemMapper.deleteByMainId(saleInterfaceSync.getId());
+
+        //2.子表数据重新插入
+        if (saleInterfaceItemList != null && saleInterfaceItemList.size() > 0) {
+            for (SaleInterfaceItem entity : saleInterfaceItemList) {
+                //外键设置
+                entity.setHeadId(saleInterfaceSync.getId());
+                saleInterfaceItemMapper.insert(entity);
+            }
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void delMain(String id) {
+        saleInterfaceItemMapper.deleteByMainId(id);
+        saleInterfaceSyncMapper.deleteById(id);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void delBatchMain(Collection<? extends Serializable> idList) {
+        for (Serializable id : idList) {
+            saleInterfaceItemMapper.deleteByMainId(id.toString());
+            saleInterfaceSyncMapper.deleteById(id);
+        }
+    }
+
+}

+ 11 - 5
srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleInvoiceServiceImpl.java

@@ -77,7 +77,8 @@ public class SaleInvoiceServiceImpl extends ServiceImpl<SaleInvoiceMapper, SaleI
 		}
 		if(StringUtils.isNotBlank(sourceCode2)){
 			QueryWrapper<PlatCommissionOrder> qu = new QueryWrapper<>();
-			qu.eq("bill_code", sourceCode2);
+			String[] code = saleInvoice.getSourceCode2().split(",");
+			qu.in("bill_code", code);
 			PlatCommissionOrder en = new PlatCommissionOrder();
 			en.setInvoiceCode(saleInvoice.getInvoiceCode());
 			platCommissionOrderMapper.update(en,qu);
@@ -204,13 +205,16 @@ public class SaleInvoiceServiceImpl extends ServiceImpl<SaleInvoiceMapper, SaleI
 		}
 		if(StringUtils.isNotBlank(sourceCode2) && !sourceCode2.equals(sourceCode2New)){
 
+			String[] code = sourceCode2.split(",");
+			String[] code2 = sourceCode2New.split(",");
+
 			UpdateWrapper<PlatCommissionOrder> updateWrapper = new UpdateWrapper<>();
-			updateWrapper.eq("bill_code", sourceCode2); 	// 设置主键
+			updateWrapper.in("bill_code", code); 	// 设置主键
 			updateWrapper.set("invoice_code", null);  			// 设置 invoice_code 为 null
 			platCommissionOrderMapper.update(new PlatCommissionOrder(), updateWrapper); 		// 调用更新
 
 			QueryWrapper<PlatCommissionOrder> qu = new QueryWrapper<>();
-			qu.eq("bill_code", sourceCode2);
+			qu.in("bill_code", code2);
 			PlatCommissionOrder en = new PlatCommissionOrder();
 			en.setInvoiceCode(saleInvoice.getInvoiceCode());
 			platCommissionOrderMapper.update(en,qu);
@@ -259,8 +263,9 @@ public class SaleInvoiceServiceImpl extends ServiceImpl<SaleInvoiceMapper, SaleI
 		}
 		if(StringUtils.isNotBlank(sourceCode2)){
 
+			String[] code = sourceCode2.split(",");
 			UpdateWrapper<PlatCommissionOrder> updateWrapper = new UpdateWrapper<>();
-			updateWrapper.eq("bill_code", sourceCode2); 	// 设置主键
+			updateWrapper.in("bill_code", code); 	// 设置主键
 			updateWrapper.set("invoice_code", null);  			// 设置 invoice_code 为 null
 			platCommissionOrderMapper.update(new PlatCommissionOrder(), updateWrapper); 		// 调用更新
 
@@ -291,8 +296,9 @@ public class SaleInvoiceServiceImpl extends ServiceImpl<SaleInvoiceMapper, SaleI
 			}
 			if(StringUtils.isNotBlank(sourceCode2)){
 
+				String[] code = sourceCode2.split(",");
 				UpdateWrapper<PlatCommissionOrder> updateWrapper = new UpdateWrapper<>();
-				updateWrapper.eq("bill_code", sourceCode2); 	// 设置主键
+				updateWrapper.in("bill_code", code); 	// 设置主键
 				updateWrapper.set("invoice_code", null);  			// 设置 invoice_code 为 null
 				platCommissionOrderMapper.update(new PlatCommissionOrder(), updateWrapper); 		// 调用更新
 

+ 268 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/util/HttpUtils.java

@@ -0,0 +1,268 @@
+package org.jeecg.modules.saleCode.util;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import io.micrometer.core.instrument.util.StringUtils;
+import org.apache.http.HttpStatus;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.utils.URIBuilder;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.client.methods.HttpGet;
+import org.jeecg.common.util.DateUtils;
+import org.jeecg.modules.saleCode.entity.SaleInterfaceSync;
+
+import java.io.IOException;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class HttpUtils {
+
+    // 从ShipServ平台获取的凭证(正式环境)
+//    private static final String username = "brianh@gmscn.com";
+//    private static final String password = "Nov&1stGms";
+//    private static final String CLIENT_ID = "";
+//    private static final String CLIENT_SECRET = "";
+//    private static final String TOKEN_ENDPOINT_URL = "https://api.shipserv.com/authentication/oauth2/token";
+//    private static final String API_URL_LIST = "https://api.shipserv.com/order-management/documents";
+//    private static final String API_URL_DATE = "https://api.shipserv.com/order-management/documents/";
+
+//    测试环境
+    private static final String CLIENT_ID = "7uvnlwQFIYYGJrgI150QCbqHIdzZU7d8";
+    private static final String CLIENT_SECRET = "Y2COseS3YdEwuZLT5S5m4gZe4udyMWCS";
+    private static final String TOKEN_ENDPOINT_URL = "https://api-stg.shipservlabs.com/authentication/oauth2/token";
+    private static final String API_URL_LIST = "https://api-stg.shipservlabs.com/order-management/documents";
+    private static final String API_URL_DATE = "https://api-stg.shipservlabs.com/order-management/documents/";
+
+    //存储token
+    private static Map<String,String> mapToken = new HashMap<>();
+    /**
+     * 获取OAuth 2.0访问令牌(客户端凭证模式)
+     */
+    public static String getAccessToken() throws Exception {
+
+        String tokenValue = getValidity("token");
+        if(StringUtils.isNotBlank(tokenValue)){
+            return tokenValue;
+        }
+
+        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
+            // 构建Token请求
+            HttpPost httpPost = new HttpPost(TOKEN_ENDPOINT_URL);
+            httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
+
+            // 构建请求体(表单格式)
+            String requestBody = String.format(
+                    "grant_type=client_credentials&client_id=%s&client_secret=%s",
+                    CLIENT_ID, CLIENT_SECRET
+            );
+
+            httpPost.setEntity(new StringEntity(requestBody));
+
+            // 发送请求
+            try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
+                int statusCode = response.getStatusLine().getStatusCode();
+                String responseBody = EntityUtils.toString(response.getEntity());
+
+                // 处理错误响应
+                if (statusCode != HttpStatus.SC_OK) {
+                    throw new RuntimeException("Token request failed: "
+                            + statusCode + " - " + responseBody);
+                }
+
+                // 解析JSON响应
+                ObjectMapper mapper = new ObjectMapper();
+                JsonNode jsonNode = mapper.readTree(responseBody);
+
+                if (!jsonNode.has("access_token")) {
+                    throw new RuntimeException("Missing access_token in response: " + responseBody);
+                }
+                String token = jsonNode.get("access_token").asText();
+                mapToken.put("token",token+";;"+DateUtils.getDate("yyyy-MM-dd HH:mm:ss"));
+
+                return token;
+            }
+        }
+    }
+
+    /**
+     * 获取token是否还在有效期(2小时过期)
+     * @param par
+     * @return
+     */
+    public static String getValidity(String par){
+
+        try {
+
+            if(!mapToken.containsKey(par)){
+                return null;
+            }
+
+            String mapValue = mapToken.get(par);
+            String[] mapValueArr = mapValue.split(";;");
+            if(mapValueArr.length != 2){
+                return null;
+            }
+            Date lastDate = DateUtils.parseDate(mapValueArr[1],"yyyy-MM-dd HH:mm:ss");
+            long minutes = DateUtils.pastMinutes(lastDate);
+
+            //限制3小时后过期
+            if(minutes > 100){
+                mapToken.put(par,null);
+                return null;
+            }
+
+            return mapValueArr[0];
+
+        }catch (Exception e){
+            return null;
+        }
+
+    }
+    public static void main(String[] args) throws Exception {
+//        String token = getAccessToken();
+//        System.out.println("======="+token);
+        String ACCESS_TOKEN="rc9DierDRsIUt7ZeDuG9VWF7bRlJ2eFp";
+        JsonNode jsonNode = getDateListByUrl(ACCESS_TOKEN);
+////        ObjectMapper mapper = new ObjectMapper();
+//////
+//////
+//       JsonNode jsonNodeAll = getDateByUrl("7781d549-2c06-4c95-8bf8-05b31a4b2f8a",ACCESS_TOKEN);
+////////
+        System.out.println("================1===--------------");
+       System.out.println(jsonNode.toString());
+////
+//        String buyerContact = jsonNodeAll.get("lineItems").toPrettyString();
+////
+////
+//////        JsonNode jsonNodeAll2 = mapper.readTree(buyerContact);
+//        System.out.println("==============111--------------");
+//        System.out.println(buyerContact);
+////        Map<String, Object> buyerContact2Map = mapper.readValue(buyerContact, new TypeReference<Map<String, Object>>() {
+////                });
+//        List<Map<String, Object>> result = mapper.readValue(buyerContact, new TypeReference<List<Map<String, Object>>>() {});
+////        List<Map<String, String>> list = mapper.readValue(buyerContact, new TypeReference<List<Map<String, String>>>(){});
+//        System.out.println("==============222--------------");
+//        System.out.println(result);
+
+
+//        String buyerContact2 = jsonNodeAll2.get("contact") == null ? "" : jsonNodeAll2.get("contact").toString();
+//
+//
+//        System.out.println("================1===--------------");
+//        System.out.println(buyerContact2);
+//                Map<String, Object> buyerContact2Map = mapper.readValue(buyerContact2, new TypeReference<Map<String, Object>>() {
+//                });
+//                String buyerContactName = buyerContact2Map.get("name") == null ? "" : buyerContact2Map.get("name").toString();
+//                String buyerContactJobTitle = buyerContact2Map.get("jobTitle") == null ? "" : buyerContact2Map.get("jobTitle").toString();
+//                String buyerContactTelephone = buyerContact2Map.get("telephone") == null ? "" : buyerContact2Map.get("telephone").toString();
+//                String buyerContactFax = buyerContact2Map.get("fax") == null ? "" : buyerContact2Map.get("fax").toString();
+//                String buyerContactEmail = buyerContact2Map.get("email") == null ? "" : buyerContact2Map.get("email").toString();
+
+
+
+//        String content = jsonNode.get("content").toPrettyString();
+//        try {
+//            ObjectMapper mapper = new ObjectMapper();
+//            List<Map<String, String>> list = mapper.readValue(content, new TypeReference<List<Map<String, String>>>(){});
+//
+//            System.out.println(list); // 输出: 7781d549-2c06-4c95-8bf8-05b31a4b2f8a
+//            System.out.println(list.get(0).get("id")); // 输出: 7781d549-2c06-4c95-8bf8-05b31a4b2f8a
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//
+//
+//
+//        String numberOfElements = jsonNode.get("numberOfElements").toPrettyString();
+//        String totalElements = jsonNode.get("totalElements").toPrettyString();
+//        String totalPages = jsonNode.get("totalPages").toPrettyString();
+//        System.out.println(numberOfElements);
+//        System.out.println(totalElements);
+//        System.out.println(totalPages);
+    }
+
+    public static JsonNode getDateListByUrl(String ACCESS_TOKEN ) throws Exception {
+
+        if(StringUtils.isBlank(ACCESS_TOKEN)){
+            ACCESS_TOKEN = getAccessToken();
+        }
+
+        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
+
+            URIBuilder uriBuilder = new URIBuilder(API_URL_LIST)
+                    .addParameter("pageNumber", "1")   // 页码参数
+                    .addParameter("pageSize", "50");              // 每页数量
+
+
+            HttpGet httpGet = new HttpGet(uriBuilder.build());
+            httpGet.setHeader("Authorization", "Bearer " + ACCESS_TOKEN);
+
+            try (CloseableHttpResponse response = httpClient.execute(httpGet)) {
+                int statusCode = response.getStatusLine().getStatusCode();
+                HttpEntity entity = response.getEntity();
+
+                if (statusCode == 200 && entity != null) {
+                    String responseBody = EntityUtils.toString(entity);
+                    JsonNode jsonNode = parseJson(responseBody);
+                    // 在这里处理jsonNode,例如遍历或提取数据
+//                    System.out.println("=========格式化输出JSON==========="); // 格式化输出JSON
+//                    System.out.println(jsonNode.toPrettyString()); // 格式化输出JSON
+                    return jsonNode;
+                } else {
+                    System.err.println("API请求失败: 状态码=" + statusCode);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static JsonNode getDateByUrl(String ID,String ACCESS_TOKEN) throws Exception {
+
+        String URL = API_URL_DATE+ID;
+
+        if(StringUtils.isBlank(ACCESS_TOKEN)){
+            ACCESS_TOKEN = getAccessToken();
+        }
+        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
+
+            URIBuilder uriBuilder = new URIBuilder(URL);
+
+            HttpGet httpGet = new HttpGet(uriBuilder.build());
+            httpGet.setHeader("Authorization", "Bearer " + ACCESS_TOKEN);
+
+            try (CloseableHttpResponse response = httpClient.execute(httpGet)) {
+                int statusCode = response.getStatusLine().getStatusCode();
+                HttpEntity entity = response.getEntity();
+
+                if (statusCode == 200 && entity != null) {
+                    String responseBody = EntityUtils.toString(entity);
+                    JsonNode jsonNode = parseJson(responseBody);
+                    // 在这里处理jsonNode,例如遍历或提取数据
+                    System.out.println("=========格式化输出JSON==========="); // 格式化输出JSON
+                    System.out.println(jsonNode.toPrettyString()); // 格式化输出JSON
+                    return jsonNode;
+                } else {
+                    System.err.println("API请求失败: 状态码=" + statusCode);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+    private static JsonNode parseJson(String jsonString) throws IOException {
+        ObjectMapper objectMapper = new ObjectMapper();
+        return objectMapper.readTree(jsonString);
+    }
+}

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

@@ -0,0 +1,218 @@
+package org.jeecg.modules.saleCode.vo;
+
+import java.util.List;
+import org.jeecg.modules.saleCode.entity.SaleInterfaceSync;
+import org.jeecg.modules.saleCode.entity.SaleInterfaceItem;
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecgframework.poi.excel.annotation.ExcelEntity;
+import org.jeecgframework.poi.excel.annotation.ExcelCollection;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.util.Date;
+import org.jeecg.common.aspect.annotation.Dict;
+import org.jeecg.common.constant.ProvinceCityArea;
+import org.jeecg.common.util.SpringContextUtils;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Description: 询价单-接口同步表
+ * @Author: jeecg-boot
+ * @Date:   2025-04-17
+ * @Version: V1.0
+ */
+@Data
+@ApiModel(value="sale_interface_syncPage对象", description="询价单-接口同步表")
+public class SaleInterfaceSyncPage {
+
+	/**id*/
+	@ApiModelProperty(value = "id")
+    private java.lang.String id;
+	/**创建人*/
+	@ApiModelProperty(value = "创建人")
+    private java.lang.String createBy;
+	/**创建日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	@ApiModelProperty(value = "创建日期")
+    private java.util.Date createTime;
+	/**更新人*/
+	@ApiModelProperty(value = "更新人")
+    private java.lang.String updateBy;
+	/**更新日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	@ApiModelProperty(value = "更新日期")
+    private java.util.Date updateTime;
+	/**所属部门*/
+	@ApiModelProperty(value = "所属部门")
+    private java.lang.String sysOrgCode;
+	/**交易编号*/
+	@Excel(name = "交易编号", width = 15)
+	@ApiModelProperty(value = "交易编号")
+    private java.lang.String transactionId;
+	/**客户号*/
+	@Excel(name = "客户号", width = 15)
+	@ApiModelProperty(value = "客户号")
+    private java.lang.String buyerTnId;
+	/**客户名称*/
+	@Excel(name = "客户名称", width = 15)
+	@ApiModelProperty(value = "客户名称")
+    private java.lang.String buyerName;
+	/**供应商号*/
+	@Excel(name = "供应商号", width = 15)
+	@ApiModelProperty(value = "供应商号")
+    private java.lang.String supplierTnId;
+	/**供应商名称*/
+	@Excel(name = "供应商名称", width = 15)
+	@ApiModelProperty(value = "供应商名称")
+    private java.lang.String supplierName;
+	/**优先级*/
+	@Excel(name = "优先级", width = 15)
+	@ApiModelProperty(value = "优先级")
+    private java.lang.String priority;
+	/**币种*/
+	@Excel(name = "币种", width = 15)
+	@ApiModelProperty(value = "币种")
+    private java.lang.String currencyCode;
+	/**编号*/
+	@Excel(name = "编号", width = 15)
+	@ApiModelProperty(value = "编号")
+    private java.lang.String referenceNumber;
+	/**请求交货日期*/
+	@Excel(name = "请求交货日期", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+	@ApiModelProperty(value = "请求交货日期")
+    private java.util.Date requestedDeliveryDate;
+	/**建议截止日期*/
+	@Excel(name = "建议截止日期", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+	@ApiModelProperty(value = "建议截止日期")
+    private java.util.Date adviseBeforeDate;
+	/**提交日期*/
+	@Excel(name = "提交日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	@ApiModelProperty(value = "提交日期")
+    private java.util.Date submittedDate;
+	/**接口传来的日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	@ApiModelProperty(value = "创建日期")
+	private Date createdDate;
+	/**内容*/
+	@Excel(name = "内容", width = 15)
+	@ApiModelProperty(value = "内容")
+    private java.lang.String content;
+	@Excel(name = "提交(0否,1是)", width = 15)
+	@ApiModelProperty(value = "提交(0否,1是)")
+	private Integer submit;
+	@Excel(name = "关闭(0否,1是)", width = 15)
+	@ApiModelProperty(value = "关闭(0否,1是)")
+	private Integer close;
+	/**关闭信息*/
+	@Excel(name = "关闭信息", width = 15)
+	@ApiModelProperty(value = "关闭信息")
+	private String closeInfo;
+
+	/**同步状态(0-未同步,1-同步成功,2-同步失败)*/
+	@Excel(name = "同步状态(0-未同步,1-同步成功,2-同步失败)", width = 15)
+	@ApiModelProperty(value = "同步状态(0-未同步,1-同步成功,2-同步失败)")
+    private java.lang.Integer sync;
+	/**同步信息*/
+	@Excel(name = "同步信息", width = 15)
+	@ApiModelProperty(value = "同步信息")
+    private java.lang.String syncInfo;
+	/**同步人*/
+	@Excel(name = "同步人", width = 15)
+	@ApiModelProperty(value = "同步人")
+    private java.lang.String syncBy;
+	/**同步时间*/
+	@Excel(name = "同步时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	@ApiModelProperty(value = "同步时间")
+    private java.util.Date syncTime;
+	/**同步单号*/
+	@Excel(name = "同步单号", width = 15)
+	@ApiModelProperty(value = "同步单号")
+    private java.lang.String syncCode;
+	/**删除状态*/
+	@Excel(name = "删除状态", width = 15)
+	@ApiModelProperty(value = "删除状态")
+    private java.lang.Integer delFlag;
+	/**subject*/
+	@Excel(name = "subject", width = 15)
+	@ApiModelProperty(value = "subject")
+    private java.lang.String subject;
+	/**comment*/
+	@Excel(name = "comment", width = 15)
+	@ApiModelProperty(value = "comment")
+    private java.lang.String comment;
+	/**requisitionId*/
+	@Excel(name = "requisitionId", width = 15)
+	@ApiModelProperty(value = "requisitionId")
+    private java.lang.String requisitionId;
+	/**requestForQuoteId*/
+	@Excel(name = "requestForQuoteId", width = 15)
+	@ApiModelProperty(value = "requestForQuoteId")
+    private java.lang.String requestForQuoteId;
+	/**quoteId*/
+	@Excel(name = "quoteId", width = 15)
+	@ApiModelProperty(value = "quoteId")
+    private java.lang.String quoteId;
+	/**offeredQuality*/
+	@Excel(name = "offeredQuality", width = 15)
+	@ApiModelProperty(value = "offeredQuality")
+    private java.lang.String offeredQuality;
+	/**taxStatus*/
+	@Excel(name = "taxStatus", width = 15)
+	@ApiModelProperty(value = "taxStatus")
+    private java.lang.String taxStatus;
+	/**paymentTerms*/
+	@Excel(name = "paymentTerms", width = 15)
+	@ApiModelProperty(value = "paymentTerms")
+    private java.lang.String paymentTerms;
+	/**vesselCode*/
+	@Excel(name = "vesselCode", width = 15)
+	@ApiModelProperty(value = "vesselCode")
+    private java.lang.String vesselCode;
+	/**vesselImo*/
+	@Excel(name = "vesselImo", width = 15)
+	@ApiModelProperty(value = "vesselImo")
+    private java.lang.String vesselImo;
+	/**buyerContactName*/
+	@Excel(name = "buyerContactName", width = 15)
+	@ApiModelProperty(value = "buyerContactName")
+    private java.lang.String buyerContactName;
+	/**buyerContactJob*/
+	@Excel(name = "buyerContactJob", width = 15)
+	@ApiModelProperty(value = "buyerContactJob")
+    private java.lang.String buyerContactJob;
+	/**buyerTelephone*/
+	@Excel(name = "buyerTelephone", width = 15)
+	@ApiModelProperty(value = "buyerTelephone")
+    private java.lang.String buyerTelephone;
+	/**buyerFax*/
+	@Excel(name = "buyerFax", width = 15)
+	@ApiModelProperty(value = "buyerFax")
+    private java.lang.String buyerFax;
+	/**buyerEmail*/
+	@Excel(name = "buyerEmail", width = 15)
+	@ApiModelProperty(value = "buyerEmail")
+    private java.lang.String buyerEmail;
+	/**status*/
+	@Excel(name = "status", width = 15)
+	@ApiModelProperty(value = "status")
+    private java.lang.String status;
+	@ApiModelProperty(value = "exported")
+	private String exported;
+
+	@ExcelCollection(name="询价单-接口同步-子表")
+	@ApiModelProperty(value = "询价单-接口同步-子表")
+	private List<SaleInterfaceItem> saleInterfaceItemList;
+
+}

+ 3 - 8
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleQuotationPage.java

@@ -81,15 +81,13 @@ public class SaleQuotationPage {
 	@ApiModelProperty(value = "单据编码")
     private String billCode;
 	/**报价项目*/
-	@Excel(name = "报价项目", width = 15)
 	@ApiModelProperty(value = "报价项目")
     private String quotationProject;
 	/**报价项目名称*/
-	@Excel(name = "报价项目名称", width = 15)
+	@Excel(name = "报价项目", width = 15)
 	@ApiModelProperty(value = "报价项目名称")
     private String quotationProjectName;
 	/**报价客户*/
-	@Excel(name = "报价客户", width = 15)
 	@ApiModelProperty(value = "报价客户")
     private String quotationCustomer;
 	/**报价客户名称*/
@@ -159,25 +157,23 @@ public class SaleQuotationPage {
 	@ApiModelProperty(value = "包装方式(packaging method)")
     private String packagingMethod;
 	/**销售部门(sale department)*/
-	@Excel(name = "销售部门(sale department)", width = 15)
 	@ApiModelProperty(value = "销售部门(sale department)")
     private String saleDepartment;
+	@Excel(name = "销售部门(sale department)", width = 15)
     private String saleDepartmentName;
 	/**业务员(salesman)*/
-	@Excel(name = "业务员(salesman)", width = 15)
 	@ApiModelProperty(value = "业务员(salesman)")
     private String salesman;
+	@Excel(name = "业务员(salesman)", width = 15)
     private String salesmanName;
 	/**报价备注(quotation notes)*/
 	@Excel(name = "报价备注(quotation notes)", width = 15)
 	@ApiModelProperty(value = "报价备注(quotation notes)")
     private String quotationNotes;
 	/**附件(attachs)*/
-	@Excel(name = "附件(attachs)", width = 15)
 	@ApiModelProperty(value = "附件(attachs)")
     private String attachs;
 	/**供应商技术资料(supplier quotation attachs)*/
-	@Excel(name = "供应商技术资料(supplier quotation attachs)", width = 15)
 	@ApiModelProperty(value = "供应商技术资料(supplier quotation attachs)")
     private String supplierAttachs;
 	/**版本号*/
@@ -185,7 +181,6 @@ public class SaleQuotationPage {
 	@ApiModelProperty(value = "版本号")
     private String version;
 	/**邮箱发送*/
-	@Excel(name = "邮箱发送", width = 15)
 	@ApiModelProperty(value = "邮箱发送")
     private String send;
 	@Excel(name = "汇率(exchangeRate)", width = 15)

+ 15 - 0
srm-module-code/src/main/java/org/jeecg/modules/storeCode/controller/StorePurchaseInController.java

@@ -242,6 +242,21 @@ public class StorePurchaseInController {
         return storePurchaseInService.hasDeal(ids);
     }
 
+    /**
+     * 临时执行b2b
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "采购入库单-临时执行b2b")
+    @ApiOperation(value = "采购入库单-临时执行b2b", notes = "采购入库单-临时执行b2b")
+    @GetMapping(value = "/batchB2BAction")
+    public Result<String> batchB2BAction(@RequestParam(name = "ids", required = true) String ids) {
+
+        return storePurchaseInService.batchB2BAction(ids);
+    }
+
+
     /**
      * 批量提交
      *

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/IStorePurchaseInService.java

@@ -66,6 +66,8 @@ public interface IStorePurchaseInService extends IService<StorePurchaseIn> {
      */
     public Result<String> submitBatch(String ids);
 
+    public Result<String> batchB2BAction(String ids);
+
     /**
      * 批量提交
      *

+ 89 - 11
srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/impl/StorePurchaseInServiceImpl.java

@@ -511,6 +511,24 @@ public class StorePurchaseInServiceImpl extends ServiceImpl<StorePurchaseInMappe
     }
 
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Result<String> batchB2BAction(String ids) {
+
+        QueryWrapper<StorePurchaseIn> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("del_flag","0");
+        queryWrapper.eq("submit","1");
+
+        List<StorePurchaseIn> list = this.list(queryWrapper);
+        if (list.size() == 0) {
+            return Result.error("数据为空!");
+        }
+
+        actionB2BInfo(list);
+
+        return Result.error("执行结束!");
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Result<String> returnSubmitBatch(String ids) {
@@ -559,6 +577,13 @@ public class StorePurchaseInServiceImpl extends ServiceImpl<StorePurchaseInMappe
 
 //                return Result.error(result);
             }
+
+            try {
+                actionB2BDelete(list);
+            }catch (Exception e){
+
+            }
+
         } catch (Exception e) {
             throw new JeecgBootException(e.getMessage());
 
@@ -570,6 +595,44 @@ public class StorePurchaseInServiceImpl extends ServiceImpl<StorePurchaseInMappe
     }
 
 
+
+
+
+    /**
+     * 删除 b2b 订单
+     * @param storePurchaseInList
+     * @return
+     */
+    public String actionB2BDelete(List<StorePurchaseIn> storePurchaseInList){
+
+        for(StorePurchaseIn o:storePurchaseInList){
+
+            String code = o.getBillCode();//采购单入库单
+
+            QueryWrapper<SaleOrderB2b> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("source_b2b", code);
+            List<SaleOrderB2b> list = saleOrderB2bService.list(queryWrapper);
+
+            if(list.size() > 0){
+                String id = list.get(0).getId();
+                saleOrderB2bService.delMain(id);
+            }
+
+            QueryWrapper<PurOrderB2b> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper.eq("source_b2b", code);
+            List<PurOrderB2b> list2 = purOrderB2bService.list(queryWrapper2);
+
+            if(list2.size() > 0){
+                String id = list2.get(0).getId();
+                purOrderB2bService.delMain(id);
+            }
+        }
+
+        return "true";
+    }
+
+
+
     /**
      * 生成 b2b 订单
      * @param storePurchaseInList
@@ -579,7 +642,7 @@ public class StorePurchaseInServiceImpl extends ServiceImpl<StorePurchaseInMappe
 
         for(StorePurchaseIn storePurchaseIn:storePurchaseInList){
 
-            String code = storePurchaseIn.getBillCode();//采购单
+            String code = storePurchaseIn.getBillCode();//采购单入库单
             String sourceCodeDhd = storePurchaseIn.getSourceCode();//到货单
             if(StringUtils.isBlank(sourceCodeDhd)){
                 continue;
@@ -622,19 +685,19 @@ public class StorePurchaseInServiceImpl extends ServiceImpl<StorePurchaseInMappe
 
             //组织  上海/香港
 //            String organizeXS = saleOrder.getOrganize();
-            String organizeCG = o.getOrganize();
-//            if(StringUtils.isBlank(organizeXS)){
+//            String organizeCG = o.getOrganize();
+////            if(StringUtils.isBlank(organizeXS)){
+////                continue;
+////            }
+//            if(StringUtils.isBlank(organizeCG)){
 //                continue;
 //            }
-            if(StringUtils.isBlank(organizeCG)){
-                continue;
-            }
 //            if(organizeXS.equals(organizeCG)){
 //                continue;
 //            }
 
-            List<StorePurchaseInDetails> storePurchaseInDetailsList = storePurchaseInDetailsMapper.selectByMainId(storePurchaseIn.getId());
-            List<StorePurchaseInShip> storePurchaseInShipList = storePurchaseInShipMapper.selectByMainId(storePurchaseIn.getId());
+//            List<StorePurchaseInDetails> storePurchaseInDetailsList = storePurchaseInDetailsMapper.selectByMainId(storePurchaseIn.getId());
+//            List<StorePurchaseInShip> storePurchaseInShipList = storePurchaseInShipMapper.selectByMainId(storePurchaseIn.getId());
 
             String id = o.getId();
             //组织  上海/香港
@@ -648,7 +711,7 @@ public class StorePurchaseInServiceImpl extends ServiceImpl<StorePurchaseInMappe
             QueryWrapper<SaleOrder> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("bill_code", sourceCode2);
             SaleOrder saleOrder = saleOrderMapper.selectOne(queryWrapper);
-            if(saleOrder == null || organize.equals(saleOrder.getOrganize())){
+            if(saleOrder == null || StringUtils.isBlank(saleOrder.getOrganize()) || organize.equals(saleOrder.getOrganize())){
                 continue;
             }
 
@@ -728,12 +791,15 @@ public class StorePurchaseInServiceImpl extends ServiceImpl<StorePurchaseInMappe
                 saleOrder.setUpdateBy(null);
                 saleOrder.setConfirmBy(null);
                 saleOrder.setConfirmTime(null);
+                saleOrder.setStatus(0);//客户确认(1-已确认,0-未确认)
+                saleOrder.setSubmit("0");//提交(submit)1是0否
+                saleOrder.setClose("0");//关闭(close)1是0否
 
                 saleOrder.setCustomer("1895383259874287618");
                 saleOrder.setCustomerName("上海哥宝海事工程有限公司");
 
 
-                saleOrder.setSourceCode(o.getBillCode());
+//                saleOrder.setSourceCode(o.getBillCode());
 
                 Result<String> result = serialPatternService.getNextSerial("sale_order_b2b", "bill_code");
                 if (!result.isSuccess()) {
@@ -780,10 +846,15 @@ public class StorePurchaseInServiceImpl extends ServiceImpl<StorePurchaseInMappe
                 o.setConfirmTime(null);
                 o.setUpdateTime(null);
                 o.setUpdateBy(null);
+
+                o.setStatus(0);//客户确认(1-已确认,0-未确认)
+                o.setSubmit("0");//提交(submit)1是0否
+                o.setClose("0");//关闭(close)1是0否
+
                 o.setSupplier("1895384031777218562");
                 o.setSupplierName("上海哥宝海事工程有限公司");
 
-                o.setSourceCode(o.getBillCode());
+//                o.setSourceCode(o.getBillCode());
                 o.setB2b(1);
 
                 Result<String> result2 = serialPatternService.getNextSerial("pur_order_b2b", "bill_code");
@@ -890,6 +961,9 @@ public class StorePurchaseInServiceImpl extends ServiceImpl<StorePurchaseInMappe
                 saleOrder.setUpdateBy(null);
                 saleOrder.setConfirmBy(null);
                 saleOrder.setConfirmTime(null);
+                saleOrder.setStatus(0);//客户确认(1-已确认,0-未确认)
+                saleOrder.setSubmit("0");//提交(submit)1是0否
+                saleOrder.setClose("0");//关闭(close)1是0否
 
                 saleOrder.setCustomer("1895383259874287618");
                 saleOrder.setCustomerName("上海哥宝海事工程有限公司");
@@ -942,6 +1016,10 @@ public class StorePurchaseInServiceImpl extends ServiceImpl<StorePurchaseInMappe
                 o.setSupplier("1895384031777218562");
                 o.setSupplierName("上海哥宝海事工程有限公司");
 
+                o.setStatus(0);//客户确认(1-已确认,0-未确认)
+                o.setSubmit("0");//提交(submit)1是0否
+                o.setClose("0");//关闭(close)1是0否
+
                 o.setB2b(1);
                 Result<String> result2 = serialPatternService.getNextSerial("pur_order_b2b", "bill_code");
                 if (!result2.isSuccess()) {