Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

24282 2 лет назад
Родитель
Сommit
721dea602b
100 измененных файлов с 1905 добавлено и 95 удалено
  1. 17 0
      code/src/test/java/purchaseDataSource.java
  2. 2 2
      hx-account/src/main/java/com/fjhx/account/entity/account/enums/PaymentStatusEnum.java
  3. 1 1
      hx-account/src/main/java/com/fjhx/account/entity/account/po/AccountPayment.java
  4. 5 0
      hx-account/src/main/java/com/fjhx/account/entity/account/po/AccountRequestFundsDetail.java
  5. 6 0
      hx-account/src/main/java/com/fjhx/account/entity/account/po/AccountRunningWater.java
  6. 4 0
      hx-account/src/main/java/com/fjhx/account/entity/account/vo/AccountRequestFundsDetailVo.java
  7. 2 2
      hx-account/src/main/java/com/fjhx/account/flow/AccountRequestFundsFlow.java
  8. 8 0
      hx-account/src/main/java/com/fjhx/account/mapper/account/AccountRequestFundsDetailMapper.java
  9. 9 0
      hx-account/src/main/java/com/fjhx/account/service/account/AccountRequestFundsDetailService.java
  10. 2 0
      hx-account/src/main/java/com/fjhx/account/service/account/impl/AccountPaymentServiceImpl.java
  11. 12 0
      hx-account/src/main/java/com/fjhx/account/service/account/impl/AccountRequestFundsDetailServiceImpl.java
  12. 1 1
      hx-account/src/main/java/com/fjhx/account/service/account/impl/AccountRunningWaterServiceImpl.java
  13. 1 26
      hx-account/src/main/resources/mapper/account/AccountPaymentMapper.xml
  14. 12 0
      hx-account/src/main/resources/mapper/account/AccountRequestFundsDetailMapper.xml
  15. 0 10
      hx-common/src/main/java/com/fjhx/common/enums/CodingRuleEnum.java
  16. 1 1
      hx-common/src/main/java/com/fjhx/common/utils/Assert.java
  17. 4 0
      hx-item/src/main/java/com/fjhx/item/entity/product/vo/ProductInfoVo.java
  18. 5 1
      hx-item/src/main/java/com/fjhx/item/mapper/product/ProductInfoMapper.java
  19. 1 1
      hx-item/src/main/java/com/fjhx/item/service/product/ProductInfoService.java
  20. 7 7
      hx-item/src/main/java/com/fjhx/item/service/product/impl/ProductInfoServiceImpl.java
  21. 7 0
      hx-item/src/main/resources/mapper/product/ProductInfoMapper.xml
  22. 60 0
      hx-jxst/src/main/java/com/fjhx/jxst/controller/after/AfterSalesRecordController.java
  23. 19 0
      hx-jxst/src/main/java/com/fjhx/jxst/controller/after/AfterSalesRecordDetailController.java
  24. 23 0
      hx-jxst/src/main/java/com/fjhx/jxst/entity/after/dto/AfterSalesRecordDetailDto.java
  25. 17 0
      hx-jxst/src/main/java/com/fjhx/jxst/entity/after/dto/AfterSalesRecordDetailSelectDto.java
  26. 25 0
      hx-jxst/src/main/java/com/fjhx/jxst/entity/after/dto/AfterSalesRecordDto.java
  27. 17 0
      hx-jxst/src/main/java/com/fjhx/jxst/entity/after/dto/AfterSalesRecordSelectDto.java
  28. 51 0
      hx-jxst/src/main/java/com/fjhx/jxst/entity/after/po/AfterSalesRecord.java
  29. 45 0
      hx-jxst/src/main/java/com/fjhx/jxst/entity/after/po/AfterSalesRecordDetail.java
  30. 17 0
      hx-jxst/src/main/java/com/fjhx/jxst/entity/after/vo/AfterSalesRecordDetailVo.java
  31. 34 0
      hx-jxst/src/main/java/com/fjhx/jxst/entity/after/vo/AfterSalesRecordVo.java
  32. 5 0
      hx-jxst/src/main/java/com/fjhx/jxst/entity/sales/po/SalesContract.java
  33. 17 0
      hx-jxst/src/main/java/com/fjhx/jxst/mapper/after/AfterSalesRecordDetailMapper.java
  34. 26 0
      hx-jxst/src/main/java/com/fjhx/jxst/mapper/after/AfterSalesRecordMapper.java
  35. 17 0
      hx-jxst/src/main/java/com/fjhx/jxst/service/after/AfterSalesRecordDetailService.java
  36. 41 0
      hx-jxst/src/main/java/com/fjhx/jxst/service/after/AfterSalesRecordService.java
  37. 21 0
      hx-jxst/src/main/java/com/fjhx/jxst/service/after/impl/AfterSalesRecordDetailServiceImpl.java
  38. 160 0
      hx-jxst/src/main/java/com/fjhx/jxst/service/after/impl/AfterSalesRecordServiceImpl.java
  39. 2 0
      hx-jxst/src/main/java/com/fjhx/jxst/service/sales/impl/SalesContractServiceImpl.java
  40. 103 0
      hx-jxst/src/main/java/com/fjhx/jxst/utils/CodeEnum.java
  41. 4 0
      hx-jxst/src/main/resources/mapper/after/AfterSalesRecordDetailMapper.xml
  42. 21 0
      hx-jxst/src/main/resources/mapper/after/AfterSalesRecordMapper.xml
  43. 8 0
      hx-mes/src/main/java/com/fjhx/mes/controller/production/ProductionTaskDetailController.java
  44. 4 1
      hx-mes/src/main/java/com/fjhx/mes/entity/bom/vo/BomDetailVo.java
  45. 9 0
      hx-mes/src/main/java/com/fjhx/mes/entity/production/vo/ProductionTaskDetailVo.java
  46. 2 1
      hx-mes/src/main/java/com/fjhx/mes/mapper/production/ProductionTaskDetailMapper.java
  47. 4 0
      hx-mes/src/main/java/com/fjhx/mes/service/assembly/impl/AssemblyLineServiceImpl.java
  48. 2 0
      hx-mes/src/main/java/com/fjhx/mes/service/production/ProductionTaskDetailService.java
  49. 8 2
      hx-mes/src/main/java/com/fjhx/mes/service/production/impl/ProductionProcessesServiceImpl.java
  50. 12 0
      hx-mes/src/main/java/com/fjhx/mes/service/production/impl/ProductionTaskDetailServiceImpl.java
  51. 15 0
      hx-mes/src/main/resources/mapper/production/ProductionTaskDetailMapper.xml
  52. 1 1
      hx-purchase/src/main/java/com/fjhx/purchase/controller/arrival/ArrivalController.java
  53. 1 2
      hx-purchase/src/main/java/com/fjhx/purchase/controller/purchase/PurchaseController.java
  54. 32 0
      hx-purchase/src/main/java/com/fjhx/purchase/controller/purchase/PurchasePayRecordController.java
  55. 45 0
      hx-purchase/src/main/java/com/fjhx/purchase/controller/purchase/PurchasePayRecordDetailController.java
  56. 5 3
      hx-purchase/src/main/java/com/fjhx/purchase/controller/subscribe/SubscribeController.java
  57. 10 1
      hx-purchase/src/main/java/com/fjhx/purchase/controller/subscribe/SubscribeDetailController.java
  58. 5 1
      hx-purchase/src/main/java/com/fjhx/purchase/entity/arrival/dto/ArrivalDto.java
  59. 3 1
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchaseDto.java
  60. 17 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchasePayRecordDetailDto.java
  61. 22 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchasePayRecordDetailSelectDto.java
  62. 25 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchasePayRecordDto.java
  63. 17 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchasePayRecordSelectDto.java
  64. 33 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/po/PurchasePayRecord.java
  65. 48 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/po/PurchasePayRecordDetail.java
  66. 11 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/vo/PurchaseDetailVo.java
  67. 22 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/vo/PurchasePayRecordDetailVo.java
  68. 17 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/vo/PurchasePayRecordVo.java
  69. 6 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/vo/PurchaseVo.java
  70. 21 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/subscribe/dto/SubscribeDetailSelectDto.java
  71. 20 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/subscribe/vo/SubscribeDetailVo.java
  72. 26 0
      hx-purchase/src/main/java/com/fjhx/purchase/mapper/purchase/PurchasePayRecordDetailMapper.java
  73. 17 0
      hx-purchase/src/main/java/com/fjhx/purchase/mapper/purchase/PurchasePayRecordMapper.java
  74. 4 1
      hx-purchase/src/main/java/com/fjhx/purchase/mapper/subscribe/SubscribeDetailMapper.java
  75. 1 1
      hx-purchase/src/main/java/com/fjhx/purchase/service/arrival/ArrivalService.java
  76. 27 13
      hx-purchase/src/main/java/com/fjhx/purchase/service/arrival/impl/ArrivalServiceImpl.java
  77. 29 0
      hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/PurchasePayRecordDetailService.java
  78. 23 0
      hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/PurchasePayRecordService.java
  79. 3 0
      hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/PurchaseService.java
  80. 77 0
      hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/impl/PurchasePayRecordDetailServiceImpl.java
  81. 97 0
      hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/impl/PurchasePayRecordServiceImpl.java
  82. 28 1
      hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/impl/PurchaseServiceImpl.java
  83. 2 1
      hx-purchase/src/main/java/com/fjhx/purchase/service/refund/impl/RefundServiceImpl.java
  84. 5 0
      hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/SubscribeDetailService.java
  85. 4 1
      hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/SubscribeService.java
  86. 87 5
      hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/impl/SubscribeDetailServiceImpl.java
  87. 10 3
      hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/impl/SubscribeServiceImpl.java
  88. 18 0
      hx-purchase/src/main/resources/mapper/purchase/PurchasePayRecordDetailMapper.xml
  89. 4 0
      hx-purchase/src/main/resources/mapper/purchase/PurchasePayRecordMapper.xml
  90. 11 0
      hx-purchase/src/main/resources/mapper/subscribe/SubscribeDetailMapper.xml
  91. 13 1
      hx-sale/src/main/java/com/fjhx/sale/controller/claim/ClaimController.java
  92. 9 0
      hx-sale/src/main/java/com/fjhx/sale/controller/contract/ContractController.java
  93. 68 0
      hx-sale/src/main/java/com/fjhx/sale/controller/quality/EhsdQualityMarkingDetailController.java
  94. 1 0
      hx-sale/src/main/java/com/fjhx/sale/entity/claim/po/Claim.java
  95. 5 0
      hx-sale/src/main/java/com/fjhx/sale/entity/claim/po/ClaimContract.java
  96. 11 1
      hx-sale/src/main/java/com/fjhx/sale/entity/claim/vo/ClaimContractVo.java
  97. 7 2
      hx-sale/src/main/java/com/fjhx/sale/entity/claim/vo/ClaimVo.java
  98. 5 0
      hx-sale/src/main/java/com/fjhx/sale/entity/contract/dto/ContractSelectDto.java
  99. 9 0
      hx-sale/src/main/java/com/fjhx/sale/entity/contract/po/Contract.java
  100. 47 0
      hx-sale/src/main/java/com/fjhx/sale/entity/contract/vo/ContractBudgetVo.java

+ 17 - 0
code/src/test/java/purchaseDataSource.java

@@ -0,0 +1,17 @@
+import fly.generator.GeneratorApplication;
+
+public class purchaseDataSource {
+
+    public static void main(String[] args) {
+        GeneratorApplication.builder()
+                .url("jdbc:mysql://36.134.91.96:17330/bytesailing_purchase?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true")
+                .username("fjhx2012mysql")
+                .password("3PN-Mzn#vnP&q6d")
+                .port(9989)
+                .module("hx-purchase")
+                .parent("com.fjhx.purchase")
+                .superServiceClass("com.ruoyi.common.core.service.BaseService")
+                .build();
+    }
+
+}

+ 2 - 2
hx-account/src/main/java/com/fjhx/account/entity/account/enums/PaymentStatusEnum.java

@@ -7,8 +7,8 @@ import java.util.Map;
 
 //打款状态
 public enum PaymentStatusEnum {
-    UNDER_REVIEW("10", "未打款"),
-    REJECT("20", "已打款"),
+    UNDER_REVIEW("20", "未打款"),
+    REJECT("10", "已打款"),
     ;
     private String key;
 

+ 1 - 1
hx-account/src/main/java/com/fjhx/account/entity/account/po/AccountPayment.java

@@ -61,7 +61,7 @@ public class AccountPayment extends BasePo {
     private BigDecimal amount;
 
     /**
-     * 打款状态(字典(payment_status)
+     * 打款状态(10已打款 20 未打款)
      */
     private String status;
 

+ 5 - 0
hx-account/src/main/java/com/fjhx/account/entity/account/po/AccountRequestFundsDetail.java

@@ -39,4 +39,9 @@ public class AccountRequestFundsDetail extends BasePo {
      */
     private String remarks;
 
+    /**
+     * 合同ID
+     */
+    private Long contractId;
+
 }

+ 6 - 0
hx-account/src/main/java/com/fjhx/account/entity/account/po/AccountRunningWater.java

@@ -33,6 +33,12 @@ public class AccountRunningWater extends BasePo {
      */
     private Long businessId;
 
+
+    /**
+     * 流水类型。10:打款
+     */
+    private String type;
+
     /**
      * 收支类型:10 收入,20支出
      */

+ 4 - 0
hx-account/src/main/java/com/fjhx/account/entity/account/vo/AccountRequestFundsDetailVo.java

@@ -14,4 +14,8 @@ import lombok.Setter;
 @Setter
 public class AccountRequestFundsDetailVo extends AccountRequestFundsDetail {
 
+    /**
+     * 币种
+     */
+    private String currency;
 }

+ 2 - 2
hx-account/src/main/java/com/fjhx/account/flow/AccountRequestFundsFlow.java

@@ -105,14 +105,14 @@ public class AccountRequestFundsFlow extends FlowDelegate {
 
         accountPayment.setDepartmentId(accountRequestFundsDto.getDepartmentId());
         accountPayment.setCorporationId(accountRequestFundsDto.getCorporationId());
-
+        accountPayment.setBusinessId(accountPayment.getId());
         accountPayment.setPaymentMethod(accountRequestFundsDto.getPaymentMethod());
         accountPayment.setIncomeAmount(accountRequestFundsDto.getTotal());
         accountPayment.setAmount(accountRequestFundsDto.getTotal());
         accountPayment.setName(accountRequestFundsDto.getName());
         accountPayment.setBusinessManagementId(accountRequestFundsDto.getAccountManagementId());
         accountPayment.setOpeningBank(accountRequestFundsDto.getOpeningBank());
-        accountPayment.setBusinessCurrency(accountPayment.getCurrency());
+        accountPayment.setCurrency(accountPayment.getCurrency());
         accountPayment.setAccountOpening(accountRequestFundsDto.getAccountOpening());
         accountPayment.setInterbankNumber(accountPayment.getInterbankNumber());
         accountPaymentService.save(accountPayment);

+ 8 - 0
hx-account/src/main/java/com/fjhx/account/mapper/account/AccountRequestFundsDetailMapper.java

@@ -7,6 +7,8 @@ import com.fjhx.account.entity.account.vo.AccountRequestFundsDetailVo;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 
 /**
  * <p>
@@ -23,4 +25,10 @@ public interface AccountRequestFundsDetailMapper extends BaseMapper<AccountReque
      */
     Page<AccountRequestFundsDetailVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<AccountRequestFundsDetail> wrapper);
 
+    /**
+     * 获取列表根据合同ID
+     * @param contractId
+     * @return
+     */
+    List<AccountRequestFundsDetailVo> getListByContractId(Long contractId);
 }

+ 9 - 0
hx-account/src/main/java/com/fjhx/account/service/account/AccountRequestFundsDetailService.java

@@ -7,6 +7,8 @@ import com.fjhx.account.entity.account.vo.AccountRequestFundsDetailVo;
 import com.fjhx.account.entity.account.dto.AccountRequestFundsDetailSelectDto;
 import com.fjhx.account.entity.account.dto.AccountRequestFundsDetailDto;
 
+import java.util.List;
+
 
 /**
  * <p>
@@ -43,4 +45,11 @@ public interface AccountRequestFundsDetailService extends BaseService<AccountReq
      */
     void delete(Long id);
 
+    /**
+     * 根据合同ID获取列表
+     * @param contractId
+     * @return
+     */
+    List<AccountRequestFundsDetailVo> getListByContractId(Long contractId);
+
 }

+ 2 - 0
hx-account/src/main/java/com/fjhx/account/service/account/impl/AccountPaymentServiceImpl.java

@@ -200,6 +200,8 @@ public class AccountPaymentServiceImpl extends ServiceImpl<AccountPaymentMapper,
         accountRunningWater.setTransactionTime(accountPaymentDto.getExpensesTime());
         accountRunningWater.setRemarks(accountPaymentDto.getRemark());
         accountRunningWater.setBusinessId(accountPaymentDto.getId());
+        //添加流水类型
+        accountRunningWater.setType("10");
         accountRunningWaterService.save(accountRunningWater);
 
     }

+ 12 - 0
hx-account/src/main/java/com/fjhx/account/service/account/impl/AccountRequestFundsDetailServiceImpl.java

@@ -12,6 +12,8 @@ import com.ruoyi.common.utils.wrapper.IWrapper;
 import com.fjhx.account.entity.account.dto.AccountRequestFundsDetailDto;
 import cn.hutool.core.bean.BeanUtil;
 
+import java.util.List;
+
 
 /**
  * <p>
@@ -54,4 +56,14 @@ public class AccountRequestFundsDetailServiceImpl extends ServiceImpl<AccountReq
         this.removeById(id);
     }
 
+    /**
+     * 获取列表根据合同ID
+     * @param contractId
+     * @return
+     */
+    @Override
+    public List<AccountRequestFundsDetailVo> getListByContractId(Long contractId) {
+        return baseMapper.getListByContractId(contractId);
+    }
+
 }

+ 1 - 1
hx-account/src/main/java/com/fjhx/account/service/account/impl/AccountRunningWaterServiceImpl.java

@@ -69,7 +69,7 @@ public class AccountRunningWaterServiceImpl extends ServiceImpl<AccountRunningWa
         }
         if(ObjectUtil.isNotEmpty(dto.getDataType())&&dto.getDataType()==1){//到账认领数据
             wrapper.eq("arw.received",10);
-            wrapper.orderByDesc("arw.is_claim","arw.create_time");
+            wrapper.orderByAsc("arw.is_claim","arw.create_time");
         }
         Page<AccountRunningWaterVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
         return page;

+ 1 - 26
hx-account/src/main/resources/mapper/account/AccountPaymentMapper.xml

@@ -3,32 +3,7 @@
 <mapper namespace="com.fjhx.account.mapper.account.AccountPaymentMapper">
     <select id="getPage" resultType="com.fjhx.account.entity.account.vo.AccountPaymentVo">
         select
-            ap.id,
-            ap.tenant_id,
-            ap.account_management_id,
-            ap.department_id,
-            ap.corporation_id,
-            ap.business_id,
-            ap.expenses_time,
-            ap.currency,
-            ap.payment_time,
-            ap.amount,
-            ap.status,
-            ap.type,
-            ap.remark,
-            ap.create_user,
-            ap.create_time,
-            ap.update_user,
-            ap.payment_remark,
-            ap.update_time,
-            ap.payment_method,
-            ap.income_amount,
-            ap.name,
-            ap.business_management_id,
-            ap.opening_bank,
-            ap.business_currency,
-            ap.account_opening,
-            ap.interbank_number
+            *
         from account_payment ap
             ${ew.customSqlSegment}
     </select>

+ 12 - 0
hx-account/src/main/resources/mapper/account/AccountRequestFundsDetailMapper.xml

@@ -16,4 +16,16 @@
             ${ew.customSqlSegment}
     </select>
 
+    <select id="getListByContractId" resultType="com.fjhx.account.entity.account.vo.AccountRequestFundsDetailVo">
+        SELECT
+            t2.currency,
+            t1.*
+        FROM
+            account_request_funds_detail t1
+        LEFT JOIN account_request_funds t2 ON t1.account_request_funds_id = t2.id
+        LEFT JOIN account_payment t3 ON t2.id = t3.business_id
+        WHERE
+            t1.contract_id = #{contractId}
+          AND t3.`status` = 20
+    </select>
 </mapper>

+ 0 - 10
hx-common/src/main/java/com/fjhx/common/enums/CodingRuleEnum.java

@@ -17,16 +17,6 @@ import java.util.stream.Collectors;
 public enum CodingRuleEnum {
 
     /**
-     * 测试方法
-     */
-    test("test", "aaa", Arrays.asList(
-            getDefaultRule(RuleTypeEnum.CUSTOMIZE, "TEST"),
-            getDefaultRule(RuleTypeEnum.DATE_FORMAT, "yyyyMM"),
-            getDefaultRule(RuleTypeEnum.COUNTRY_CODE),
-            getDefaultRule(RuleTypeEnum.CUSTOMER_CODE),
-            getDefaultRule(RuleTypeEnum.AUTOINCREMENT, "5")
-    )),
-    /**
      * 外销合同
      */
     CONTRACT("contract", "外销合同", Arrays.asList(

+ 1 - 1
hx-victoriatourist/src/main/java/com/fjhx/victoriatourist/utils/Assert.java → hx-common/src/main/java/com/fjhx/common/utils/Assert.java

@@ -1,4 +1,4 @@
-package com.fjhx.victoriatourist.utils;
+package com.fjhx.common.utils;
 
 
 import cn.hutool.core.util.ObjectUtil;

+ 4 - 0
hx-item/src/main/java/com/fjhx/item/entity/product/vo/ProductInfoVo.java

@@ -51,4 +51,8 @@ public class ProductInfoVo extends ProductInfo {
      */
     private String createUserName;
 
+    /**
+     * 产品分类列表树
+     */
+    private String productClassifyNames;
 }

+ 5 - 1
hx-item/src/main/java/com/fjhx/item/mapper/product/ProductInfoMapper.java

@@ -38,7 +38,11 @@ public interface ProductInfoMapper extends BaseMapper<ProductInfo> {
      *
      * @return
      */
-    List<ProductInfoVo> getListByProductType(@Param("productType") Integer productType, @Param("definition") Integer definition);
+    List<ProductInfoVo> getListByProductType(@Param("productType") Integer productType,
+                                             @Param("definition") Integer definition,
+                                             @Param("productName") String productName,
+                                             @Param("productCode") String productCode
+    );
 
     /**
      * 产品类型排行(数据看板-产品分析页面)

+ 1 - 1
hx-item/src/main/java/com/fjhx/item/service/product/ProductInfoService.java

@@ -107,7 +107,7 @@ public interface ProductInfoService extends BaseService<ProductInfo> {
      *
      * @return
      */
-    List<ProductInfoVo> getListByProductType(Integer productType, Integer definition);
+    List<ProductInfoVo> getListByProductType(Integer productType, Integer definition,String productName,String productCode);
 
     /**
      * excel导入

+ 7 - 7
hx-item/src/main/java/com/fjhx/item/service/product/impl/ProductInfoServiceImpl.java

@@ -93,11 +93,11 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
         wrapper.like("pi", ProductInfo::getBarCode, dto.getBarCode());
         wrapper.like("json_unquote(standard_json->'$.englishName')", dto.getEnglishName());
         wrapper.like("json_unquote(standard_json->'$.customsCode')", dto.getCustomsCode());
-        //        wrapper.keyword(dto,
-        //                new SqlField("pi", ProductInfo::getName),
-        //                new SqlField("pi", ProductInfo::getCode),
-        //                new SqlField("pi", ProductInfo::getCustomCode)
-//        );
+        wrapper.keyword(dto,
+                new SqlField("pi", ProductInfo::getName),
+                new SqlField("pi", ProductInfo::getCode),
+                new SqlField("pi", ProductInfo::getCustomCode)
+        );
         //计算并根据生命周期过滤
         wrapper.eq("IF(DATEDIFF(now(),pi.create_time)> json_unquote( victoriatourist_json -> '$.growUpDay' ),3,IF( DATEDIFF(now(),pi.create_time)> json_unquote( victoriatourist_json -> '$.newProductsDay' ), 2, 1 ))", dto.getLifeCycle());
         wrapper.eq("json_unquote( victoriatourist_json -> '$.combination' )", dto.getCombination());
@@ -537,8 +537,8 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
      * @return
      */
     @Override
-    public List<ProductInfoVo> getListByProductType(Integer productType, Integer definition) {
-        return baseMapper.getListByProductType(productType, definition);
+    public List<ProductInfoVo> getListByProductType(Integer productType, Integer definition,String productName,String productCode) {
+        return baseMapper.getListByProductType(productType, definition,productName,productCode);
     }
 
     @Override

+ 7 - 0
hx-item/src/main/resources/mapper/product/ProductInfoMapper.xml

@@ -57,6 +57,13 @@
             <if test="definition neq null">
                 and t1.definition = #{definition}
             </if>
+
+            <if test="productName neq null and productName neq '' ">
+                and t1.name = #{productName}
+            </if>
+            <if test="productCode neq null and productName neq ''">
+                and t1.code = #{productCode}
+            </if>
         </where>
     </select>
     <select id="productTypeRanking" resultType="com.fjhx.item.entity.product.vo.ProductInfoVo">

+ 60 - 0
hx-jxst/src/main/java/com/fjhx/jxst/controller/after/AfterSalesRecordController.java

@@ -0,0 +1,60 @@
+package com.fjhx.jxst.controller.after;
+
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.jxst.entity.after.vo.AfterSalesRecordVo;
+import com.fjhx.jxst.entity.after.dto.AfterSalesRecordSelectDto;
+import com.fjhx.jxst.entity.after.dto.AfterSalesRecordDto;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import com.fjhx.jxst.service.after.AfterSalesRecordService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+
+/**
+ * <p>
+ * 售后记录 前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-25
+ */
+@RestController
+@RequestMapping("/afterSalesRecord")
+public class AfterSalesRecordController {
+
+    @Autowired
+    private AfterSalesRecordService afterSalesRecordService;
+
+    /**
+     * 售后记录分页
+     */
+    @PostMapping("/page")
+    public Page<AfterSalesRecordVo> page(@RequestBody AfterSalesRecordSelectDto dto) {
+        return afterSalesRecordService.getPage(dto);
+    }
+
+    /**
+     * 售后记录明细
+     */
+    @PostMapping("/detail")
+    public AfterSalesRecordVo detail(@RequestBody BaseSelectDto dto) {
+        return afterSalesRecordService.detail(dto.getId());
+    }
+
+    /**
+     * 售后记录新增
+     */
+    @PostMapping("/add")
+    public void add(@RequestBody AfterSalesRecordDto afterSalesRecordDto) {
+        afterSalesRecordService.add(afterSalesRecordDto);
+    }
+    /**
+     * 售后记录提交
+     */
+    @PostMapping("/afterSales")
+    public void afterSales(@RequestBody AfterSalesRecordDto afterSalesRecordDto) {
+        afterSalesRecordService.afterSales(afterSalesRecordDto);
+    }
+
+
+}

+ 19 - 0
hx-jxst/src/main/java/com/fjhx/jxst/controller/after/AfterSalesRecordDetailController.java

@@ -0,0 +1,19 @@
+package com.fjhx.jxst.controller.after;
+
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * <p>
+ * 售后记录明细 前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-25
+ */
+@RestController
+@RequestMapping("/afterSalesRecordDetail")
+public class AfterSalesRecordDetailController {
+
+
+}

+ 23 - 0
hx-jxst/src/main/java/com/fjhx/jxst/entity/after/dto/AfterSalesRecordDetailDto.java

@@ -0,0 +1,23 @@
+package com.fjhx.jxst.entity.after.dto;
+
+import com.fjhx.file.entity.ObsFile;
+import com.fjhx.jxst.entity.after.po.AfterSalesRecordDetail;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * 售后记录明细新增编辑入参实体
+ *
+ * @author 
+ * @since 2023-05-25
+ */
+@Getter
+@Setter
+public class AfterSalesRecordDetailDto extends AfterSalesRecordDetail {
+    /**
+     * 现场照片列表
+     */
+    private List<ObsFile> fileList;
+}

+ 17 - 0
hx-jxst/src/main/java/com/fjhx/jxst/entity/after/dto/AfterSalesRecordDetailSelectDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.jxst.entity.after.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 售后记录明细列表查询入参实体
+ *
+ * @author 
+ * @since 2023-05-25
+ */
+@Getter
+@Setter
+public class AfterSalesRecordDetailSelectDto extends BaseSelectDto {
+
+}

+ 25 - 0
hx-jxst/src/main/java/com/fjhx/jxst/entity/after/dto/AfterSalesRecordDto.java

@@ -0,0 +1,25 @@
+package com.fjhx.jxst.entity.after.dto;
+
+import com.fjhx.jxst.entity.after.po.AfterSalesRecord;
+import com.fjhx.jxst.entity.after.po.AfterSalesRecordDetail;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * 售后记录新增编辑入参实体
+ *
+ * @author 
+ * @since 2023-05-25
+ */
+@Getter
+@Setter
+public class AfterSalesRecordDto extends AfterSalesRecord {
+
+    /**
+     * 售后明细列表
+     */
+    private List<AfterSalesRecordDetailDto> afterSalesRecordDetailList;
+
+}

+ 17 - 0
hx-jxst/src/main/java/com/fjhx/jxst/entity/after/dto/AfterSalesRecordSelectDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.jxst.entity.after.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 售后记录列表查询入参实体
+ *
+ * @author 
+ * @since 2023-05-25
+ */
+@Getter
+@Setter
+public class AfterSalesRecordSelectDto extends BaseSelectDto {
+
+}

+ 51 - 0
hx-jxst/src/main/java/com/fjhx/jxst/entity/after/po/AfterSalesRecord.java

@@ -0,0 +1,51 @@
+package com.fjhx.jxst.entity.after.po;
+
+import com.ruoyi.common.core.domain.BasePo;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 售后记录
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-25
+ */
+@Getter
+@Setter
+@TableName("after_sales_record")
+public class AfterSalesRecord extends BasePo {
+
+    /**
+     * 产品sn
+     */
+    private String productSn;
+
+    /**
+     * 售后人id
+     */
+    private Long afterSalesPersonId;
+
+    /**
+     * 售后原因
+     */
+    private String remark;
+
+    /**
+     * 产品编号
+     */
+    private String code;
+
+    /**
+     * 销售状态
+     */
+    private int status;
+    /**
+     * 产品id
+     */
+    private Long productId;
+
+}

+ 45 - 0
hx-jxst/src/main/java/com/fjhx/jxst/entity/after/po/AfterSalesRecordDetail.java

@@ -0,0 +1,45 @@
+package com.fjhx.jxst.entity.after.po;
+
+import com.ruoyi.common.core.domain.BasePo;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotEmpty;
+
+/**
+ * <p>
+ * 售后记录明细
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-25
+ */
+@Getter
+@Setter
+@TableName("after_sales_record_detail")
+public class AfterSalesRecordDetail extends BasePo {
+
+    /**
+     * 售后记录id
+     */
+    private Long afterSalesRecordId;
+
+    /**
+     * 配件id
+     */
+    @NotEmpty(message = "配件id不能为空")
+    private Long accessoriesId;
+
+    /**
+     * 售后数量 备用字段
+     */
+    private Long quantity;
+
+    /**
+     * 售后记录
+     */
+    private String remark;
+
+}

+ 17 - 0
hx-jxst/src/main/java/com/fjhx/jxst/entity/after/vo/AfterSalesRecordDetailVo.java

@@ -0,0 +1,17 @@
+package com.fjhx.jxst.entity.after.vo;
+
+import com.fjhx.jxst.entity.after.po.AfterSalesRecordDetail;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 售后记录明细列表查询返回值实体
+ *
+ * @author 
+ * @since 2023-05-25
+ */
+@Getter
+@Setter
+public class AfterSalesRecordDetailVo extends AfterSalesRecordDetail {
+
+}

+ 34 - 0
hx-jxst/src/main/java/com/fjhx/jxst/entity/after/vo/AfterSalesRecordVo.java

@@ -0,0 +1,34 @@
+package com.fjhx.jxst.entity.after.vo;
+
+import com.fjhx.jxst.entity.after.po.AfterSalesRecord;
+import com.fjhx.mes.entity.bom.vo.BomDetailVo;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * 售后记录列表查询返回值实体
+ *
+ * @author 
+ * @since 2023-05-25
+ */
+@Getter
+@Setter
+public class AfterSalesRecordVo extends AfterSalesRecord {
+
+    /**
+     * 产品名称
+     */
+    private String productName;
+
+    /**
+     * bomInfoId
+     */
+    private Long bomInfoId;
+
+    /**
+     * bom明细列表
+     */
+    List<BomDetailVo> bomDetailList;
+}

+ 5 - 0
hx-jxst/src/main/java/com/fjhx/jxst/entity/sales/po/SalesContract.java

@@ -61,4 +61,9 @@ public class SalesContract extends BasePo {
      */
     private BigDecimal contractAmount;
 
+    /**
+     * 合同编号
+     */
+    private String code;
+
 }

+ 17 - 0
hx-jxst/src/main/java/com/fjhx/jxst/mapper/after/AfterSalesRecordDetailMapper.java

@@ -0,0 +1,17 @@
+package com.fjhx.jxst.mapper.after;
+
+import com.fjhx.jxst.entity.after.po.AfterSalesRecordDetail;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+
+/**
+ * <p>
+ * 售后记录明细 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-25
+ */
+public interface AfterSalesRecordDetailMapper extends BaseMapper<AfterSalesRecordDetail> {
+
+}

+ 26 - 0
hx-jxst/src/main/java/com/fjhx/jxst/mapper/after/AfterSalesRecordMapper.java

@@ -0,0 +1,26 @@
+package com.fjhx.jxst.mapper.after;
+
+import com.fjhx.jxst.entity.after.po.AfterSalesRecord;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.jxst.entity.after.vo.AfterSalesRecordVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+
+/**
+ * <p>
+ * 售后记录 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-25
+ */
+public interface AfterSalesRecordMapper extends BaseMapper<AfterSalesRecord> {
+
+    /**
+     * 售后记录分页
+     */
+    Page<AfterSalesRecordVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<AfterSalesRecord> wrapper);
+
+}

+ 17 - 0
hx-jxst/src/main/java/com/fjhx/jxst/service/after/AfterSalesRecordDetailService.java

@@ -0,0 +1,17 @@
+package com.fjhx.jxst.service.after;
+
+import com.fjhx.jxst.entity.after.po.AfterSalesRecordDetail;
+import com.ruoyi.common.core.service.BaseService;
+
+
+/**
+ * <p>
+ * 售后记录明细 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-25
+ */
+public interface AfterSalesRecordDetailService extends BaseService<AfterSalesRecordDetail> {
+
+}

+ 41 - 0
hx-jxst/src/main/java/com/fjhx/jxst/service/after/AfterSalesRecordService.java

@@ -0,0 +1,41 @@
+package com.fjhx.jxst.service.after;
+
+import com.baomidou.dynamic.datasource.annotation.DSTransactional;
+import com.fjhx.jxst.entity.after.po.AfterSalesRecord;
+import com.ruoyi.common.core.service.BaseService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.jxst.entity.after.vo.AfterSalesRecordVo;
+import com.fjhx.jxst.entity.after.dto.AfterSalesRecordSelectDto;
+import com.fjhx.jxst.entity.after.dto.AfterSalesRecordDto;
+
+
+/**
+ * <p>
+ * 售后记录 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-25
+ */
+public interface AfterSalesRecordService extends BaseService<AfterSalesRecord> {
+
+    /**
+     * 售后记录分页
+     */
+    Page<AfterSalesRecordVo> getPage(AfterSalesRecordSelectDto dto);
+
+    /**
+     * 售后记录明细
+     */
+    AfterSalesRecordVo detail(Long id);
+
+    /**
+     * 售后记录新增
+     */
+    void add(AfterSalesRecordDto afterSalesRecordDto);
+
+    /**
+     * 售后提交
+     */
+    void afterSales(AfterSalesRecordDto afterSalesRecordDto);
+}

+ 21 - 0
hx-jxst/src/main/java/com/fjhx/jxst/service/after/impl/AfterSalesRecordDetailServiceImpl.java

@@ -0,0 +1,21 @@
+package com.fjhx.jxst.service.after.impl;
+
+import com.fjhx.jxst.entity.after.po.AfterSalesRecordDetail;
+import com.fjhx.jxst.mapper.after.AfterSalesRecordDetailMapper;
+import com.fjhx.jxst.service.after.AfterSalesRecordDetailService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * <p>
+ * 售后记录明细 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-25
+ */
+@Service
+public class AfterSalesRecordDetailServiceImpl extends ServiceImpl<AfterSalesRecordDetailMapper, AfterSalesRecordDetail> implements AfterSalesRecordDetailService {
+
+}

+ 160 - 0
hx-jxst/src/main/java/com/fjhx/jxst/service/after/impl/AfterSalesRecordServiceImpl.java

@@ -0,0 +1,160 @@
+package com.fjhx.jxst.service.after.impl;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.dynamic.datasource.annotation.DSTransactional;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
+import com.fjhx.common.utils.Assert;
+import com.fjhx.file.utils.ObsFileUtil;
+import com.fjhx.item.service.product.ProductInfoService;
+import com.fjhx.jxst.entity.after.dto.AfterSalesRecordDetailDto;
+import com.fjhx.jxst.entity.after.po.AfterSalesRecord;
+import com.fjhx.jxst.entity.after.po.AfterSalesRecordDetail;
+import com.fjhx.jxst.mapper.after.AfterSalesRecordMapper;
+import com.fjhx.jxst.service.after.AfterSalesRecordDetailService;
+import com.fjhx.jxst.service.after.AfterSalesRecordService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.jxst.utils.CodeEnum;
+import com.fjhx.mes.entity.bom.po.BomDetail;
+import com.fjhx.mes.entity.bom.po.BomInfo;
+import com.fjhx.mes.entity.bom.vo.BomDetailVo;
+import com.fjhx.mes.entity.production.vo.ProductionTaskDetailVo;
+import com.fjhx.mes.entity.work.po.WorkOrder;
+import com.fjhx.mes.entity.work.po.WorkOrderBom;
+import com.fjhx.mes.service.bom.BomDetailService;
+import com.fjhx.mes.service.bom.BomInfoService;
+import com.fjhx.mes.service.production.ProductionTaskDetailService;
+import com.fjhx.mes.service.work.WorkOrderBomService;
+import com.fjhx.mes.service.work.WorkOrderService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.jxst.entity.after.vo.AfterSalesRecordVo;
+import com.fjhx.jxst.entity.after.dto.AfterSalesRecordSelectDto;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.fjhx.jxst.entity.after.dto.AfterSalesRecordDto;
+import cn.hutool.core.bean.BeanUtil;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * <p>
+ * 售后记录 服务实现类
+ * </p>
+ *
+ * @author
+ * @since 2023-05-25
+ */
+@Service
+public class AfterSalesRecordServiceImpl extends ServiceImpl<AfterSalesRecordMapper, AfterSalesRecord> implements AfterSalesRecordService {
+
+    @Autowired
+    private ProductionTaskDetailService productionTaskDetailService;
+    @Autowired
+    private WorkOrderService workOrderService;
+    @Autowired
+    private ProductInfoService productInfoService;
+    @Autowired
+    private WorkOrderBomService workOrderBomService;
+    @Autowired
+    private BomInfoService bomInfoService;
+    @Autowired
+    private BomDetailService bomDetailService;
+    @Autowired
+    private AfterSalesRecordDetailService afterSalesRecordDetailService;
+
+    @Override
+    public Page<AfterSalesRecordVo> getPage(AfterSalesRecordSelectDto dto) {
+        IWrapper<AfterSalesRecord> wrapper = getWrapper();
+        wrapper.orderByDesc("asr", AfterSalesRecord::getId);
+        Page<AfterSalesRecordVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        List<AfterSalesRecordVo> records = page.getRecords();
+        //赋值产品信息
+        productInfoService.attributeAssign(records, AfterSalesRecordVo::getProductId, (item, productInfo) -> {
+            item.setProductName(productInfo.getName());
+        });
+        return page;
+    }
+
+    @Override
+    public AfterSalesRecordVo detail(Long id) {
+        AfterSalesRecord AfterSalesRecord = this.getById(id);
+        AfterSalesRecordVo result = BeanUtil.toBean(AfterSalesRecord, AfterSalesRecordVo.class);
+
+        //赋值产品信息
+        productInfoService.attributeAssign(Arrays.asList(result), AfterSalesRecordVo::getProductId, (item, productInfo) -> {
+            item.setProductName(productInfo.getName());
+        });
+
+        ProductionTaskDetailVo productionTaskDetailVo = productionTaskDetailService.snInfo(result.getProductSn());
+        if (ObjectUtil.isEmpty(productionTaskDetailVo)){
+            return result;
+        }
+        //获取工单信息
+        WorkOrder workOrder = workOrderService.getById(productionTaskDetailVo.getWorkOrderId());
+        //查询BOM信息
+        BomInfo bomInfo = bomInfoService.getOne(q -> q.eq(BomInfo::getProductId, workOrder.getProductId()).eq(BomInfo::getCurrentVersion,1));
+        Assert.notEmpty(bomInfo,"查询不到产品的BOM信息");
+        result.setBomInfoId(bomInfo.getId());
+
+        List<BomDetailVo> bomDetailList = new ArrayList<>();
+        //判断是否定制
+        if("1".equals(workOrder.getIsCustomized())){
+            //是定制
+            List<WorkOrderBom> list = workOrderBomService.list(q -> q.eq(WorkOrderBom::getWorkOrderId, workOrder.getId()));
+            bomDetailList = BeanUtil.copyToList(list, BomDetailVo.class);
+        }else{
+            //不是定制
+            List<BomDetail> list = bomDetailService.list(q -> q.eq(BomDetail::getBomInfoId, bomInfo.getId()));
+            bomDetailList = BeanUtil.copyToList(list, BomDetailVo.class);
+        }
+        Assert.notEmpty(bomDetailList,"查询不到产品的BOM明细");
+        //给bom明细赋值产品名称
+        productInfoService.attributeAssign(bomDetailList, BomDetailVo::getProductId, (item, productInfo) -> {
+            item.setProductName(productInfo.getName());
+        });
+
+        //赋值售后明细
+        Map<Long, AfterSalesRecordDetail> afterSalesRecordDetailMap = afterSalesRecordDetailService.mapKEntity(AfterSalesRecordDetail::getAccessoriesId,
+                q -> q.eq(AfterSalesRecordDetail::getAfterSalesRecordId, id));
+        for (BomDetailVo bomDetailVo : bomDetailList) {
+            AfterSalesRecordDetail afterSalesRecordDetail = afterSalesRecordDetailMap.get(bomDetailVo.getProductId());
+            bomDetailVo.setAfterSalesRecordDetail(afterSalesRecordDetail);
+        }
+
+        result.setBomDetailList(bomDetailList);
+        return result;
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void add(AfterSalesRecordDto afterSalesRecordDto) {
+        Assert.notEmpty(afterSalesRecordDto.getProductId(),"产品id不能为空");
+        Assert.notEmpty(afterSalesRecordDto.getProductSn(),"产品sn不能为空");
+        afterSalesRecordDto.setCode(CodeEnum.AFTER_SALES.getCode());
+        this.save(afterSalesRecordDto);
+    }
+
+    @DSTransactional
+    @Override
+    public void afterSales(AfterSalesRecordDto afterSalesRecordDto) {
+        Assert.notEmpty(afterSalesRecordDto.getId(),"售后id不能为空");
+        Assert.notEmpty(afterSalesRecordDto.getAfterSalesRecordDetailList(),"售后明细列表不能为空");
+        afterSalesRecordDto.setStatus(1);//修改为售后完成
+        this.updateById(afterSalesRecordDto);
+        List<AfterSalesRecordDetailDto> afterSalesRecordDetailList = afterSalesRecordDto.getAfterSalesRecordDetailList();
+        for (AfterSalesRecordDetailDto afterSalesRecordDetailDto : afterSalesRecordDetailList) {
+            long id = IdWorker.getId();
+            afterSalesRecordDetailDto.setId(id);
+            afterSalesRecordDetailDto.setAfterSalesRecordId(afterSalesRecordDto.getId());
+            ObsFileUtil.saveFile(afterSalesRecordDetailDto.getFileList(),id);
+        }
+        List<AfterSalesRecordDetail> afterSalesRecordDetails = BeanUtil.copyToList(afterSalesRecordDetailList, AfterSalesRecordDetail.class);
+        afterSalesRecordDetailService.saveBatch(afterSalesRecordDetails);
+    }
+
+}

+ 2 - 0
hx-jxst/src/main/java/com/fjhx/jxst/service/sales/impl/SalesContractServiceImpl.java

@@ -16,6 +16,7 @@ import com.fjhx.jxst.entity.sales.vo.SalesContractVo;
 import com.fjhx.jxst.mapper.sales.SalesContractMapper;
 import com.fjhx.jxst.service.sales.SalesContractDetailsService;
 import com.fjhx.jxst.service.sales.SalesContractService;
+import com.fjhx.jxst.utils.CodeEnum;
 import com.fjhx.wms.entity.stock.vo.StockVo;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -95,6 +96,7 @@ public class SalesContractServiceImpl extends ServiceImpl<SalesContractMapper, S
             count.add(salesContractDetails.getUnitPrice().multiply(salesContractDetails.getQuantity()));
         }
         salesContractDto.setContractAmount(count);
+        salesContractDto.setCode(CodeEnum.SALES_CONTRACT.getCode());
         this.save(salesContractDto);
         for (SalesContractDetails salesContractDetails : salesContractDetailsList) {
             salesContractDetails.setSalesContractId(salesContractDto.getId());

+ 103 - 0
hx-jxst/src/main/java/com/fjhx/jxst/utils/CodeEnum.java

@@ -0,0 +1,103 @@
+package com.fjhx.jxst.utils;
+
+import cn.hutool.core.convert.Convert;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.text.CharSequenceUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.extra.spring.SpringUtil;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fjhx.jxst.service.sales.SalesContractService;
+import com.fjhx.mes.service.production.ProductionPlanService;
+import com.fjhx.mes.service.production.ProductionTaskService;
+import com.fjhx.mes.service.work.WorkOrderService;
+import com.obs.services.internal.ServiceException;
+import lombok.Getter;
+
+import java.util.Date;
+import java.util.Map;
+
+@Getter
+public enum CodeEnum {
+
+    // 销售合同
+    SALES_CONTRACT("SC", "yyMM-", "code", 3, SalesContractService.class),
+    // 销售合同
+    AFTER_SALES("SB", "yyMM-", "code", 3, SalesContractService.class);
+
+    CodeEnum(String prefix, String dateFormat, String codeFieldName, Integer length, Class<? extends IService<?>> serviceCls) {
+        this.prefix = prefix;
+        this.dateFormat = dateFormat;
+        this.length = length;
+        this.codeFieldName = codeFieldName;
+        this.service = SpringUtil.getBean(serviceCls);
+    }
+
+    // 编码前缀
+    private final String prefix;
+    // 编码加日期规则
+    private final String dateFormat;
+    // 长度
+    private final Integer length;
+    // 编码字段名
+    private final String codeFieldName;
+    // service
+    private final IService<?> service;
+
+    /**
+     * 获取键值对
+     */
+    public String getCode() {
+        String itemPrefix;
+
+        if (ObjectUtil.isNotEmpty(dateFormat)) {
+            Date date = new Date();
+            String format = DateUtil.format(date, dateFormat);
+            itemPrefix = prefix + format;
+        } else {
+            itemPrefix = prefix;
+        }
+
+        Object obj = service.query()
+                .likeRight(codeFieldName, itemPrefix)
+                .orderByDesc(codeFieldName)
+                .last("limit 1")
+                .one();
+
+        if (obj == null) {
+            return itemPrefix + autoGenericCode(length, 0);
+        }
+
+        Map<String, Object> map = Convert.toMap(String.class, Object.class, obj);
+
+        String code = Convert.toStr(map.get(CharSequenceUtil.toCamelCase(codeFieldName)));
+        Integer codeNum = Convert.toInt(code.substring(itemPrefix.length()));
+        if (ObjectUtil.isEmpty(codeNum)) {
+            throw new ServiceException("自定义编码与系统编码生成规则冲突,暂时无法生成编码,请联系管理员");
+        }
+
+        return itemPrefix + autoGenericCode(length, codeNum);
+    }
+
+    /**
+     * 获取键值对
+     */
+    public String getCode(String code) {
+        if (ObjectUtil.isNotEmpty(code)) {
+            Long count = service.query().eq(codeFieldName, code).count();
+            if (count != 0) {
+                throw new ServiceException("编码已存在");
+            }
+            return code;
+        } else {
+            return getCode();
+        }
+    }
+
+    /**
+     * 不够位数的在前面补0,保留num的长度位数字
+     */
+    private static String autoGenericCode(int length, Integer codeNum) {
+        return String.format("%0" + length + "d", codeNum + 1);
+    }
+
+}

+ 4 - 0
hx-jxst/src/main/resources/mapper/after/AfterSalesRecordDetailMapper.xml

@@ -0,0 +1,4 @@
+<?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="com.fjhx.jxst.mapper.after.AfterSalesRecordDetailMapper">
+</mapper>

+ 21 - 0
hx-jxst/src/main/resources/mapper/after/AfterSalesRecordMapper.xml

@@ -0,0 +1,21 @@
+<?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="com.fjhx.jxst.mapper.after.AfterSalesRecordMapper">
+    <select id="getPage" resultType="com.fjhx.jxst.entity.after.vo.AfterSalesRecordVo">
+        select
+            asr.id,
+            asr.product_sn,
+            asr.after_sales_person_id,
+            asr.remark,
+            asr.code,
+            asr.product_id,
+            asr.status,
+            asr.create_user,
+            asr.create_time,
+            asr.update_user,
+            asr.update_time
+        from after_sales_record asr
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>

+ 8 - 0
hx-mes/src/main/java/com/fjhx/mes/controller/production/ProductionTaskDetailController.java

@@ -82,4 +82,12 @@ public class ProductionTaskDetailController {
         productionTaskDetailService.rejection(productionTaskDetailDto);
     }
 
+    /**
+     * 获取sn信息
+     */
+    @PostMapping("/snInfo")
+    public ProductionTaskDetailVo snInfo(@RequestBody ProductionTaskDetailDto productionTaskDetailDto) {
+        return productionTaskDetailService.snInfo(productionTaskDetailDto.getProductSn());
+    }
+
 }

+ 4 - 1
hx-mes/src/main/java/com/fjhx/mes/entity/bom/vo/BomDetailVo.java

@@ -29,5 +29,8 @@ public class BomDetailVo extends BomDetail {
      */
     private String productUnit;
 
-
+    /**
+     * 售后明细
+     */
+    private Object afterSalesRecordDetail;
 }

+ 9 - 0
hx-mes/src/main/java/com/fjhx/mes/entity/production/vo/ProductionTaskDetailVo.java

@@ -38,4 +38,13 @@ public class ProductionTaskDetailVo extends ProductionTaskDetail {
      */
     private String circulationUserName;
 
+    /**
+     * 产品编号
+     */
+    private String code;
+
+    /**
+     * 工单id
+     */
+    private Long workOrderId;
 }

+ 2 - 1
hx-mes/src/main/java/com/fjhx/mes/mapper/production/ProductionTaskDetailMapper.java

@@ -4,7 +4,6 @@ import com.fjhx.mes.entity.production.po.ProductionTaskDetail;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fjhx.mes.entity.production.vo.ProductionTaskDetailVo;
-import com.fjhx.mes.entity.work.po.WorkOrder;
 import com.fjhx.mes.entity.work.vo.WorkOrderVo;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import org.apache.ibatis.annotations.Param;
@@ -29,4 +28,6 @@ public interface ProductionTaskDetailMapper extends BaseMapper<ProductionTaskDet
 
     List<WorkOrderVo> getWorkOrderByProductionTask(@Param("ew") IWrapper<ProductionTaskDetail> wrapper);
 
+    ProductionTaskDetailVo snInfo(@Param("sn") String sn);
+
 }

+ 4 - 0
hx-mes/src/main/java/com/fjhx/mes/service/assembly/impl/AssemblyLineServiceImpl.java

@@ -14,6 +14,8 @@ import com.ruoyi.common.utils.wrapper.IWrapper;
 import com.fjhx.mes.entity.assembly.dto.AssemblyLineDto;
 import cn.hutool.core.bean.BeanUtil;
 
+import java.util.Arrays;
+
 
 /**
  * <p>
@@ -47,6 +49,8 @@ public class AssemblyLineServiceImpl extends ServiceImpl<AssemblyLineMapper, Ass
     public AssemblyLineVo detail(Long id) {
         AssemblyLine AssemblyLine = this.getById(id);
         AssemblyLineVo result = BeanUtil.toBean(AssemblyLine, AssemblyLineVo.class);
+        //根据id赋值操作人名称
+        UserUtil.assignmentNickName(Arrays.asList(result), AssemblyLineVo::getPersonLiableId, AssemblyLineVo::setPersonLiableName);
         return result;
     }
 

+ 2 - 0
hx-mes/src/main/java/com/fjhx/mes/service/production/ProductionTaskDetailService.java

@@ -52,4 +52,6 @@ public interface ProductionTaskDetailService extends BaseService<ProductionTaskD
      * 生产任务拒绝接收
      */
     void rejection(ProductionTaskDetailDto productionTaskDetailDto);
+
+    ProductionTaskDetailVo snInfo(String sn);
 }

+ 8 - 2
hx-mes/src/main/java/com/fjhx/mes/service/production/impl/ProductionProcessesServiceImpl.java

@@ -1,6 +1,7 @@
 package com.fjhx.mes.service.production.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.dynamic.datasource.annotation.DSTransactional;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -17,6 +18,8 @@ import com.ruoyi.common.utils.wrapper.IWrapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 
 /**
  * <p>
@@ -51,8 +54,11 @@ public class ProductionProcessesServiceImpl extends ServiceImpl<ProductionProces
     @DSTransactional
     @Override
     public void add(ProductionProcessesDto productionProcessesDto) {
-        ObsFile obsFile = productionProcessesDto.getFileList().get(0);
-        productionProcessesDto.setFileName(obsFile.getFileName());
+        List<ObsFile> fileList = productionProcessesDto.getFileList();
+        if(ObjectUtil.isNotEmpty(fileList)){
+            ObsFile obsFile = productionProcessesDto.getFileList().get(0);
+            productionProcessesDto.setFileName(obsFile.getFileName());
+        }
         this.save(productionProcessesDto);
         ObsFileUtil.saveFile(productionProcessesDto.getFileList(), productionProcessesDto.getId());
     }

+ 12 - 0
hx-mes/src/main/java/com/fjhx/mes/service/production/impl/ProductionTaskDetailServiceImpl.java

@@ -3,6 +3,7 @@ package com.fjhx.mes.service.production.impl;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.common.utils.Assert;
 import com.fjhx.item.entity.product.po.ProductInfo;
 import com.fjhx.item.service.product.ProductInfoService;
 import com.fjhx.mes.entity.applicable.po.ApplicableProducts;
@@ -299,4 +300,15 @@ public class ProductionTaskDetailServiceImpl extends ServiceImpl<ProductionTaskD
     }
 
 
+    @Override
+    public ProductionTaskDetailVo snInfo(String sn){
+        Assert.notEmpty(sn, "sn不能为空");
+        ProductionTaskDetailVo productionTaskDetailVo = baseMapper.snInfo(sn);
+        Assert.notEmpty(productionTaskDetailVo, "查询不到sn信息");
+        ProductInfo productInfo = productInfoService.getById(productionTaskDetailVo.getProductId());
+        Assert.notEmpty(productInfo, "查询不到产品信息");
+        productionTaskDetailVo.setProductName(productInfo.getName());
+        return productionTaskDetailVo;
+    }
+
 }

+ 15 - 0
hx-mes/src/main/resources/mapper/production/ProductionTaskDetailMapper.xml

@@ -31,5 +31,20 @@
                 LEFT JOIN production_task pt ON pt.production_plan_id = pp.id
             ${ew.customSqlSegment}
     </select>
+    <select id="snInfo" resultType="com.fjhx.mes.entity.production.vo.ProductionTaskDetailVo">
+        SELECT
+            ptd.product_id,
+            ptd.product_sn,
+            sc.`code`,
+            wo.id workOrderId
+        FROM
+            production_task_detail ptd
+                JOIN production_task pt ON ptd.production_task_id = pt.id
+                JOIN production_plan pp ON pt.production_plan_id = pp.id
+                JOIN work_order wo ON pp.work_order_id = wo.id
+                JOIN bytesailing_jxst.sales_contract sc ON wo.source_id = sc.id
+        WHERE
+            ptd.product_sn = #{sn}
+    </select>
 
 </mapper>

+ 1 - 1
hx-purchase/src/main/java/com/fjhx/purchase/controller/arrival/ArrivalController.java

@@ -57,7 +57,7 @@ public class ArrivalController {
      * 到货新增 维多利亚
      */
     @PostMapping("/addByWdly")
-    public void addByWdly(@RequestBody Arrival arrival) {
+    public void addByWdly(@RequestBody ArrivalDto arrival) {
         arrivalService.addByWdly(arrival);
     }
 

+ 1 - 2
hx-purchase/src/main/java/com/fjhx/purchase/controller/purchase/PurchaseController.java

@@ -2,6 +2,7 @@ package com.fjhx.purchase.controller.purchase;
 
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.fjhx.common.constant.SourceConstant;
+import com.fjhx.purchase.entity.purchase.dto.PurchasePayRecordDto;
 import com.fjhx.purchase.entity.purchase.po.Purchase;
 import org.springframework.web.bind.annotation.*;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -95,6 +96,4 @@ public class PurchaseController {
         return purchaseService.paymentBill(purchaseDto);
     }
 
-
-
 }

+ 32 - 0
hx-purchase/src/main/java/com/fjhx/purchase/controller/purchase/PurchasePayRecordController.java

@@ -0,0 +1,32 @@
+package com.fjhx.purchase.controller.purchase;
+
+import org.springframework.web.bind.annotation.*;
+import com.fjhx.purchase.entity.purchase.dto.PurchasePayRecordDto;
+import com.fjhx.purchase.service.purchase.PurchasePayRecordService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+
+/**
+ * <p>
+ * 采购付款记录 前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-24
+ */
+@RestController
+@RequestMapping("/purchasePayRecord")
+public class PurchasePayRecordController {
+
+    @Autowired
+    private PurchasePayRecordService purchasePayRecordService;
+
+    /**
+     * 采购付款记录新增
+     */
+    @PostMapping("/add")
+    public void add(@RequestBody PurchasePayRecordDto purchasePayRecordDto) {
+        purchasePayRecordService.add(purchasePayRecordDto);
+    }
+
+}

+ 45 - 0
hx-purchase/src/main/java/com/fjhx/purchase/controller/purchase/PurchasePayRecordDetailController.java

@@ -0,0 +1,45 @@
+package com.fjhx.purchase.controller.purchase;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.purchase.entity.purchase.dto.PurchasePayRecordDetailSelectDto;
+import com.fjhx.purchase.entity.purchase.vo.PurchasePayRecordDetailVo;
+import com.fjhx.purchase.service.purchase.PurchasePayRecordDetailService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * <p>
+ * 采购付款记录 前端控制器
+ * </p>
+ *
+ * @author
+ * @since 2023-05-23
+ */
+@RestController
+@RequestMapping("/purchasePayRecordDetail")
+public class PurchasePayRecordDetailController {
+
+    @Autowired
+    private PurchasePayRecordDetailService purchasePayRecordDetailService;
+
+    /**
+     * 采购付款记录分页
+     */
+    @PostMapping("/page")
+    public Page<PurchasePayRecordDetailVo> page(@RequestBody PurchasePayRecordDetailSelectDto dto) {
+        return purchasePayRecordDetailService.getPage(dto);
+    }
+
+    /**
+     * 采购付款记录清空
+     */
+    @PostMapping("/empty")
+    public void empty(@RequestBody PurchasePayRecordDetailSelectDto dto) {
+        purchasePayRecordDetailService.empty(dto);
+    }
+
+}

+ 5 - 3
hx-purchase/src/main/java/com/fjhx/purchase/controller/subscribe/SubscribeController.java

@@ -2,6 +2,8 @@ package com.fjhx.purchase.controller.subscribe;
 
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.fjhx.common.constant.SourceConstant;
+import com.fjhx.purchase.entity.subscribe.dto.SubscribeDetailDto;
+import com.fjhx.purchase.entity.subscribe.dto.SubscribeDetailSelectDto;
 import com.fjhx.purchase.entity.subscribe.po.Subscribe;
 import com.ruoyi.common.core.domain.entity.SysDept;
 import org.springframework.web.bind.annotation.*;
@@ -80,9 +82,9 @@ public class SubscribeController {
         subscribeService.delete(dto.getId());
     }
 
-    @GetMapping("/getDepts")
-    public List<SysDept> getDepts() {
-        return subscribeService.getDepts();
+    @PostMapping("/getDepts")
+    public List<SysDept> getDepts(@RequestBody SubscribeDetailSelectDto subscribeDetailSelectDto) {
+        return subscribeService.getDepts(subscribeDetailSelectDto);
     }
 
 }

+ 10 - 1
hx-purchase/src/main/java/com/fjhx/purchase/controller/subscribe/SubscribeDetailController.java

@@ -12,6 +12,7 @@ import com.fjhx.purchase.service.subscribe.SubscribeDetailService;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import java.util.List;
+import java.util.Map;
 
 
 /**
@@ -19,7 +20,7 @@ import java.util.List;
  * 申购单 前端控制器
  * </p>
  *
- * @author 
+ * @author
  * @since 2023-04-03
  */
 @DS(SourceConstant.PURCHASE)
@@ -39,6 +40,14 @@ public class SubscribeDetailController {
     }
 
     /**
+     * 申购统计(申购单分页)
+     */
+    @PostMapping("/subscribeStatistics")
+    public Map<String,Object> subscribeStatistics(@RequestBody SubscribeDetailSelectDto dto) {
+        return subscribeDetailService.subscribeStatistics(dto);
+    }
+
+    /**
      * 待采购 维多利亚
      */
     @PostMapping("/pageByWdly")

+ 5 - 1
hx-purchase/src/main/java/com/fjhx/purchase/entity/arrival/dto/ArrivalDto.java

@@ -7,11 +7,15 @@ import lombok.Setter;
 /**
  * 到货新增编辑入参实体
  *
- * @author 
+ * @author
  * @since 2023-04-07
  */
 @Getter
 @Setter
 public class ArrivalDto extends Arrival {
 
+    /**
+     * 发货id
+     */
+    private Long deliverGoodsId;
 }

+ 3 - 1
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchaseDto.java

@@ -1,10 +1,13 @@
 package com.fjhx.purchase.entity.purchase.dto;
 
 import com.fjhx.purchase.entity.purchase.po.Purchase;
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecordDetail;
 import lombok.Getter;
 import lombok.Setter;
 
 import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
 
 /**
  * 采购新增编辑入参实体
@@ -47,5 +50,4 @@ public class PurchaseDto extends Purchase {
      */
     private String paidCurrency;
 
-
 }

+ 17 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchasePayRecordDetailDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.purchase.entity.purchase.dto;
+
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecordDetail;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 采购付款记录新增编辑入参实体
+ *
+ * @author
+ * @since 2023-05-23
+ */
+@Getter
+@Setter
+public class PurchasePayRecordDetailDto extends PurchasePayRecordDetail {
+
+}

+ 22 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchasePayRecordDetailSelectDto.java

@@ -0,0 +1,22 @@
+package com.fjhx.purchase.entity.purchase.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 采购付款记录列表查询入参实体
+ *
+ * @author 
+ * @since 2023-05-23
+ */
+@Getter
+@Setter
+public class PurchasePayRecordDetailSelectDto extends BaseSelectDto {
+
+    /**
+     * 采购id
+     */
+    private Long purchaseId;
+
+}

+ 25 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchasePayRecordDto.java

@@ -0,0 +1,25 @@
+package com.fjhx.purchase.entity.purchase.dto;
+
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecord;
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecordDetail;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * 采购付款记录新增编辑入参实体
+ *
+ * @author 
+ * @since 2023-05-24
+ */
+@Getter
+@Setter
+public class PurchasePayRecordDto extends PurchasePayRecord {
+
+    /**
+     * 采购付款记录明细
+     */
+    List<PurchasePayRecordDetail> purchasePayRecordDetailList;
+
+}

+ 17 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/dto/PurchasePayRecordSelectDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.purchase.entity.purchase.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 采购付款记录列表查询入参实体
+ *
+ * @author 
+ * @since 2023-05-24
+ */
+@Getter
+@Setter
+public class PurchasePayRecordSelectDto extends BaseSelectDto {
+
+}

+ 33 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/po/PurchasePayRecord.java

@@ -0,0 +1,33 @@
+package com.fjhx.purchase.entity.purchase.po;
+
+import com.ruoyi.common.core.domain.BasePo;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.math.BigDecimal;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 采购付款记录
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-24
+ */
+@Getter
+@Setter
+@TableName("purchase_pay_record")
+public class PurchasePayRecord extends BasePo {
+
+    /**
+     * 付款金额
+     */
+    private BigDecimal amount;
+
+    /**
+     * 付款时间
+     */
+    private Date payDate;
+
+}

+ 48 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/po/PurchasePayRecordDetail.java

@@ -0,0 +1,48 @@
+package com.fjhx.purchase.entity.purchase.po;
+
+import com.ruoyi.common.core.domain.BasePo;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.math.BigDecimal;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
+
+/**
+ * <p>
+ * 采购付款记录
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-23
+ */
+@Getter
+@Setter
+@TableName("purchase_pay_record_detail")
+public class PurchasePayRecordDetail extends BasePo {
+
+    /**
+     * 采购id
+     */
+    @NotEmpty(message = "采购id不能为空")
+    private Long purchaseId;
+
+    /**
+     * 付款金额
+     */
+    @NotEmpty(message = "付款金额不能为空")
+    private BigDecimal amount;
+
+    /**
+     * 付款时间
+     */
+    private Date payDate;
+
+    /**
+     * 付款id 预留字段
+     */
+    private Long purchasePayRecordId;
+
+}

+ 11 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/vo/PurchaseDetailVo.java

@@ -4,6 +4,8 @@ import com.fjhx.purchase.entity.arrival.vo.ArrivalDetailVo;
 import com.fjhx.purchase.entity.deliver.DeliverGoodsDetailsPo;
 import com.fjhx.purchase.entity.purchase.po.PurchaseDetail;
 import com.fjhx.purchase.entity.quality.po.QualityDetail;
+import com.fjhx.wms.entity.stock.po.StockJournalDetails;
+import com.fjhx.wms.entity.stock.vo.StockJournalDetailsVo;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -86,4 +88,13 @@ public class PurchaseDetailVo extends PurchaseDetail {
      * 质检数量
      */
     private BigDecimal qualityQuantity;
+
+    /**
+     * 入库数量
+     */
+    private BigDecimal receiptQuantity;
+    /**
+     * 入库列表
+     */
+    private List<StockJournalDetailsVo> receiptList;
 }

+ 22 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/vo/PurchasePayRecordDetailVo.java

@@ -0,0 +1,22 @@
+package com.fjhx.purchase.entity.purchase.vo;
+
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecordDetail;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 采购付款记录列表查询返回值实体
+ *
+ * @author
+ * @since 2023-05-23
+ */
+@Getter
+@Setter
+public class PurchasePayRecordDetailVo extends PurchasePayRecordDetail {
+
+    /**
+     * 付款人名称
+     */
+    private String payUserName;
+
+}

+ 17 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/vo/PurchasePayRecordVo.java

@@ -0,0 +1,17 @@
+package com.fjhx.purchase.entity.purchase.vo;
+
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecord;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 采购付款记录列表查询返回值实体
+ *
+ * @author 
+ * @since 2023-05-24
+ */
+@Getter
+@Setter
+public class PurchasePayRecordVo extends PurchasePayRecord {
+
+}

+ 6 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/vo/PurchaseVo.java

@@ -4,6 +4,7 @@ import com.fjhx.purchase.entity.purchase.po.Purchase;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -32,4 +33,9 @@ public class PurchaseVo extends Purchase {
      * 申购编号
      */
     private String subscribeCode;
+
+    /**
+     * 已付款金额
+     */
+    private BigDecimal paidAmount;
 }

+ 21 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/subscribe/dto/SubscribeDetailSelectDto.java

@@ -22,6 +22,11 @@ public class SubscribeDetailSelectDto extends BaseSelectDto {
     private Integer productType;
 
     /**
+     * 产品编码
+     */
+    private String productCode;
+
+    /**
      * 状态
      */
     private String status;
@@ -53,4 +58,20 @@ public class SubscribeDetailSelectDto extends BaseSelectDto {
      */
     private String neStatus;
 
+    /**
+     * 产品名称
+     */
+    private String productName;
+
+
+
+    /**
+     * 申购编码
+     */
+    private String code;
+
+    /**
+     * 申购状态 0草稿 10、审批中;20、驳回  30、通过
+     */
+    private Integer subscribeStatus;
 }

+ 20 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/subscribe/vo/SubscribeDetailVo.java

@@ -76,4 +76,24 @@ public class SubscribeDetailVo extends SubscribeDetail {
      * 流程id
      */
     private Long flowId;
+
+    /**
+     * 产品类型
+     */
+    private String productType;
+
+    /**
+     * 个数
+     */
+    private Integer counts;
+
+    /**
+     * 货品种类个数
+     */
+    private Integer typeCount;
+
+    /**
+     * 产品类型
+     */
+    private String type;
 }

+ 26 - 0
hx-purchase/src/main/java/com/fjhx/purchase/mapper/purchase/PurchasePayRecordDetailMapper.java

@@ -0,0 +1,26 @@
+package com.fjhx.purchase.mapper.purchase;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecordDetail;
+import com.fjhx.purchase.entity.purchase.vo.PurchasePayRecordDetailVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+
+/**
+ * <p>
+ * 采购付款记录 Mapper 接口
+ * </p>
+ *
+ * @author
+ * @since 2023-05-23
+ */
+public interface PurchasePayRecordDetailMapper extends BaseMapper<PurchasePayRecordDetail> {
+
+    /**
+     * 采购付款记录分页
+     */
+    Page<PurchasePayRecordDetailVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<PurchasePayRecordDetail> wrapper);
+
+}

+ 17 - 0
hx-purchase/src/main/java/com/fjhx/purchase/mapper/purchase/PurchasePayRecordMapper.java

@@ -0,0 +1,17 @@
+package com.fjhx.purchase.mapper.purchase;
+
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecord;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+
+/**
+ * <p>
+ * 采购付款记录 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-24
+ */
+public interface PurchasePayRecordMapper extends BaseMapper<PurchasePayRecord> {
+
+}

+ 4 - 1
hx-purchase/src/main/java/com/fjhx/purchase/mapper/subscribe/SubscribeDetailMapper.java

@@ -1,5 +1,6 @@
 package com.fjhx.purchase.mapper.subscribe;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.fjhx.purchase.entity.subscribe.po.SubscribeDetail;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -16,7 +17,7 @@ import java.util.List;
  * 申购单 Mapper 接口
  * </p>
  *
- * @author 
+ * @author
  * @since 2023-04-03
  */
 public interface SubscribeDetailMapper extends BaseMapper<SubscribeDetail> {
@@ -32,4 +33,6 @@ public interface SubscribeDetailMapper extends BaseMapper<SubscribeDetail> {
      * @return
      */
     List<SubscribeDetailVo> getDetail(@Param("ids")List<Long> ids);
+
+    List<SubscribeDetailVo> subscribeStatistics(@Param("ew") QueryWrapper<Object> query);
 }

+ 1 - 1
hx-purchase/src/main/java/com/fjhx/purchase/service/arrival/ArrivalService.java

@@ -36,7 +36,7 @@ public interface ArrivalService extends BaseService<Arrival> {
     /**
      * 到货新增 维多利亚
      */
-    void addByWdly(Arrival arrival);
+    void addByWdly(ArrivalDto arrival);
 
     /**
      * 到货编辑

+ 27 - 13
hx-purchase/src/main/java/com/fjhx/purchase/service/arrival/impl/ArrivalServiceImpl.java

@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fjhx.common.constant.SourceConstant;
 import com.fjhx.common.enums.CodingRuleEnum;
 import com.fjhx.common.service.coding.CodingRuleService;
+import com.fjhx.common.utils.Assert;
 import com.fjhx.item.service.product.ProductInfoService;
 import com.fjhx.kd100.entity.company.po.CompanyInfo;
 import com.fjhx.kd100.service.company.CompanyInfoService;
@@ -24,8 +25,6 @@ import com.fjhx.purchase.entity.deliver.DeliverGoodsDetailsPo;
 import com.fjhx.purchase.entity.deliver.DeliverGoodsPo;
 import com.fjhx.purchase.entity.purchase.po.Purchase;
 import com.fjhx.purchase.entity.purchase.po.PurchaseDetail;
-import com.fjhx.purchase.entity.purchase.vo.PurchaseDetailVo;
-import com.fjhx.purchase.entity.purchase.vo.PurchaseVo;
 import com.fjhx.purchase.entity.subscribe.po.Subscribe;
 import com.fjhx.purchase.entity.subscribe.po.SubscribeDetail;
 import com.fjhx.purchase.mapper.arrival.ArrivalMapper;
@@ -36,13 +35,10 @@ import com.fjhx.purchase.service.purchase.PurchaseDetailService;
 import com.fjhx.purchase.service.purchase.PurchaseService;
 import com.fjhx.purchase.service.subscribe.SubscribeDetailService;
 import com.fjhx.purchase.service.subscribe.SubscribeService;
-import com.fjhx.purchase.util.code.CodeEnum;
-import com.fjhx.supply.entity.supplier.po.SupplierInfo;
 import com.fjhx.supply.service.supplier.SupplierInfoService;
 import com.fjhx.wms.entity.stock.emums.StockWaitType;
 import com.fjhx.wms.entity.stock.po.StockWait;
 import com.fjhx.wms.entity.stock.po.StockWaitDetails;
-import com.fjhx.wms.entity.stock.vo.StockVo;
 import com.fjhx.wms.service.stock.StockWaitDetailsService;
 import com.fjhx.wms.service.stock.StockWaitService;
 import com.obs.services.internal.ServiceException;
@@ -126,7 +122,7 @@ public class ArrivalServiceImpl extends ServiceImpl<ArrivalMapper, Arrival> impl
     @DSTransactional
     @Override
     public void add(Arrival arrival) {
-        arrival.setCode(codingRuleService.createCode(CodingRuleEnum.ARRIVAL.getKey(),null));
+        arrival.setCode(codingRuleService.createCode(CodingRuleEnum.ARRIVAL.getKey(), null));
 //        arrival.setCode(CodeEnum.ARRIVAL.getCode());
         this.save(arrival);
         //修改采购状态
@@ -174,8 +170,27 @@ public class ArrivalServiceImpl extends ServiceImpl<ArrivalMapper, Arrival> impl
      */
     @DSTransactional
     @Override
-    public void addByWdly(Arrival arrival) {
-        arrival.setCode(codingRuleService.createCode(CodingRuleEnum.ARRIVAL.getKey(),null));
+    public void addByWdly(ArrivalDto arrival) {
+        //获取维多利亚json中的发货id
+        String victoriatouristJson = arrival.getVictoriatouristJson();
+        JSONObject json = ObjectUtil.isNotEmpty(victoriatouristJson) ? JSONObject.parseObject(victoriatouristJson) : new JSONObject();
+        if (ObjectUtil.isEmpty(arrival.getDeliverGoodsId())) {
+            arrival.setDeliverGoodsId(json.getLong("deliverGoodsId"));
+        }
+        //根据发货id查采购信息
+        if (ObjectUtil.isNotEmpty(arrival.getDeliverGoodsId())) {
+            DeliverGoodsPo deliverGoodsInfo = wdlyService.getDeliverGoodsInfo(arrival.getDeliverGoodsId());
+            Assert.notEmpty(deliverGoodsInfo, "查询不到发货信息");
+            arrival.setPurchaseId(deliverGoodsInfo.getPurchaseId());
+        }
+
+        if (ObjectUtil.isEmpty(arrival.getPurchaseId())) {
+            throw new ServiceException("采购id不能为空");
+        }
+        Purchase purchase0 = purchaseService.getById(arrival.getPurchaseId());
+        Assert.notEmpty(purchase0, "无法获取到采购信息");
+        arrival.setSupplyId(purchase0.getSupplyId());
+        arrival.setCode(codingRuleService.createCode(CodingRuleEnum.ARRIVAL.getKey(), null));
 //        arrival.setCode(CodeEnum.ARRIVAL.getCode());
         arrival.setStatus(1);//设置到货
         this.save(arrival);
@@ -187,8 +202,8 @@ public class ArrivalServiceImpl extends ServiceImpl<ArrivalMapper, Arrival> impl
 //        purchaseService.updateById(purchase);
 
         //创建待入库记录
-        String victoriatouristJson = arrival.getVictoriatouristJson();
-        JSONObject json = JSONObject.parseObject(victoriatouristJson);
+//        String victoriatouristJson = arrival.getVictoriatouristJson();
+//        JSONObject json = ObjectUtil.isNotEmpty(victoriatouristJson) ? JSONObject.parseObject(victoriatouristJson) : new JSONObject();
         Long deliverGoodsId = json.getLong("deliverGoodsId");
 
         if (ObjectUtil.isEmpty(deliverGoodsId)) {
@@ -227,7 +242,7 @@ public class ArrivalServiceImpl extends ServiceImpl<ArrivalMapper, Arrival> impl
         //将业务信息设置成采购id和采购编码
         stockWait.setBusinessId(purchase.getId());
         String victoriatouristJson2 = purchase.getVictoriatouristJson();
-        JSONObject json2 = ObjectUtil.isNotEmpty(victoriatouristJson2) ? JSONObject.parseObject(victoriatouristJson2):new JSONObject();
+        JSONObject json2 = ObjectUtil.isNotEmpty(victoriatouristJson2) ? JSONObject.parseObject(victoriatouristJson2) : new JSONObject();
 //        stockWait.setBusinessCode(purchase.getCode());
         stockWait.setBusinessCode(json2.getString("contractCode"));
 
@@ -303,7 +318,7 @@ public class ArrivalServiceImpl extends ServiceImpl<ArrivalMapper, Arrival> impl
                     BigDecimal count = arrivalDetails.stream()
                             .map(ArrivalDetail::getCount)
                             .reduce(BigDecimal.ZERO, BigDecimal::add);
-                    if (purchaseDetail.getCount().compareTo(count) == 0) {
+                    if (count.compareTo(purchaseDetail.getCount()) >= 0) {
                         flag++;
                     }
                 }
@@ -330,5 +345,4 @@ public class ArrivalServiceImpl extends ServiceImpl<ArrivalMapper, Arrival> impl
     }
 
 
-
 }

+ 29 - 0
hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/PurchasePayRecordDetailService.java

@@ -0,0 +1,29 @@
+package com.fjhx.purchase.service.purchase;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.purchase.entity.purchase.dto.PurchasePayRecordDetailSelectDto;
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecordDetail;
+import com.fjhx.purchase.entity.purchase.vo.PurchasePayRecordDetailVo;
+import com.ruoyi.common.core.service.BaseService;
+
+
+/**
+ * <p>
+ * 采购付款记录 服务类
+ * </p>
+ *
+ * @author
+ * @since 2023-05-23
+ */
+public interface PurchasePayRecordDetailService extends BaseService<PurchasePayRecordDetail> {
+
+    /**
+     * 采购付款记录分页
+     */
+    Page<PurchasePayRecordDetailVo> getPage(PurchasePayRecordDetailSelectDto dto);
+
+    /**
+     * 清空付款记录
+     */
+    void empty(PurchasePayRecordDetailSelectDto dto);
+}

+ 23 - 0
hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/PurchasePayRecordService.java

@@ -0,0 +1,23 @@
+package com.fjhx.purchase.service.purchase;
+
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecord;
+import com.ruoyi.common.core.service.BaseService;
+import com.fjhx.purchase.entity.purchase.dto.PurchasePayRecordDto;
+
+
+/**
+ * <p>
+ * 采购付款记录 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-24
+ */
+public interface PurchasePayRecordService extends BaseService<PurchasePayRecord> {
+
+    /**
+     * 采购付款记录新增
+     */
+    void add(PurchasePayRecordDto purchasePayRecordDto);
+
+}

+ 3 - 0
hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/PurchaseService.java

@@ -2,10 +2,12 @@ package com.fjhx.purchase.service.purchase;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fjhx.purchase.entity.purchase.dto.PurchaseDto;
+import com.fjhx.purchase.entity.purchase.dto.PurchasePayRecordDto;
 import com.fjhx.purchase.entity.purchase.dto.PurchaseSelectDto;
 import com.fjhx.purchase.entity.purchase.po.Purchase;
 import com.fjhx.purchase.entity.purchase.vo.PurchaseVo;
 import com.ruoyi.common.core.service.BaseService;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 
@@ -62,4 +64,5 @@ public interface PurchaseService extends BaseService<Purchase> {
      * 货款账单
      */
     Page<PurchaseDto> paymentBill(PurchaseSelectDto purchaseDto);
+
 }

+ 77 - 0
hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/impl/PurchasePayRecordDetailServiceImpl.java

@@ -0,0 +1,77 @@
+package com.fjhx.purchase.service.purchase.impl;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson2.JSONObject;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.common.utils.Assert;
+import com.fjhx.purchase.entity.purchase.dto.PurchasePayRecordDetailSelectDto;
+import com.fjhx.purchase.entity.purchase.po.Purchase;
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecordDetail;
+import com.fjhx.purchase.entity.purchase.vo.PurchasePayRecordDetailVo;
+import com.fjhx.purchase.mapper.purchase.PurchasePayRecordDetailMapper;
+import com.fjhx.purchase.service.purchase.PurchasePayRecordDetailService;
+import com.fjhx.purchase.service.purchase.PurchasePayRecordService;
+import com.fjhx.purchase.service.purchase.PurchaseService;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.ruoyi.system.utils.UserUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.stream.Collectors;
+
+
+/**
+ * <p>
+ * 采购付款记录 服务实现类
+ * </p>
+ *
+ * @author
+ * @since 2023-05-23
+ */
+@Service
+public class PurchasePayRecordDetailServiceImpl extends ServiceImpl<PurchasePayRecordDetailMapper, PurchasePayRecordDetail> implements PurchasePayRecordDetailService {
+
+    @Autowired
+    private PurchaseService purchaseService;
+    @Autowired
+    private PurchasePayRecordService purchasePayRecordService;
+
+    @Override
+    public Page<PurchasePayRecordDetailVo> getPage(PurchasePayRecordDetailSelectDto dto) {
+        IWrapper<PurchasePayRecordDetail> wrapper = getWrapper();
+        wrapper.eq(PurchasePayRecordDetail::getPurchaseId, dto.getPurchaseId());
+        wrapper.orderByDesc("pprd", PurchasePayRecordDetail::getId);
+        Page<PurchasePayRecordDetailVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        UserUtil.assignmentNickName(page.getRecords(), PurchasePayRecordDetailVo::getCreateUser, PurchasePayRecordDetailVo::setPayUserName);
+        return page;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void empty(PurchasePayRecordDetailSelectDto dto) {
+        Assert.notEmpty(dto.getPurchaseId(), "采购id不能为空");
+        //修改付款状态未未付款
+        Purchase purchase = purchaseService.getById(dto.getPurchaseId());
+        purchase.setPayStatus(0);
+        String victoriatouristJson = purchase.getVictoriatouristJson();
+        JSONObject json = ObjectUtil.isEmpty(victoriatouristJson) ? new JSONObject() : JSONObject.parseObject(victoriatouristJson);
+        json.put("paidAmount", BigDecimal.ZERO);
+        purchase.setVictoriatouristJson(json.toJSONString());
+        purchaseService.updateById(purchase);
+
+        //清空付款记录记录信息
+        List<PurchasePayRecordDetail> list = this.list(q -> q.eq(PurchasePayRecordDetail::getPurchaseId, dto.getPurchaseId()));
+        if (ObjectUtils.isNotEmpty(list)) {
+            List<Long> purchasePayRecordIds = list.stream().map(PurchasePayRecordDetail::getPurchasePayRecordId).collect(Collectors.toList());
+            purchasePayRecordService.removeBatchByIds(purchasePayRecordIds);
+        }
+        //清空付款明细信息
+        this.remove(q -> q.eq(PurchasePayRecordDetail::getPurchaseId, dto.getPurchaseId()));
+    }
+
+}

+ 97 - 0
hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/impl/PurchasePayRecordServiceImpl.java

@@ -0,0 +1,97 @@
+package com.fjhx.purchase.service.purchase.impl;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson2.JSONObject;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.common.utils.Assert;
+import com.fjhx.purchase.entity.purchase.dto.PurchasePayRecordDto;
+import com.fjhx.purchase.entity.purchase.po.Purchase;
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecord;
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecordDetail;
+import com.fjhx.purchase.mapper.purchase.PurchasePayRecordMapper;
+import com.fjhx.purchase.service.purchase.PurchasePayRecordDetailService;
+import com.fjhx.purchase.service.purchase.PurchasePayRecordService;
+import com.fjhx.purchase.service.purchase.PurchaseService;
+import com.obs.services.internal.ServiceException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+
+/**
+ * <p>
+ * 采购付款记录 服务实现类
+ * </p>
+ *
+ * @author
+ * @since 2023-05-24
+ */
+@Service
+public class PurchasePayRecordServiceImpl extends ServiceImpl<PurchasePayRecordMapper, PurchasePayRecord> implements PurchasePayRecordService {
+
+    @Autowired
+    private PurchaseService purchaseService;
+    @Autowired
+    private PurchasePayRecordDetailService purchasePayRecordDetailService;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void add(PurchasePayRecordDto purchasePayRecordDto) {
+        //保存付款记录
+        this.save(purchasePayRecordDto);
+
+        //创建付款记录
+        List<PurchasePayRecordDetail> purchasePayRecordList = purchasePayRecordDto.getPurchasePayRecordDetailList();
+        Assert.notEmpty(purchasePayRecordList, "付款列表为空");
+        List<Long> purchaseIds = purchasePayRecordList.stream().map(PurchasePayRecordDetail::getPurchaseId).collect(Collectors.toList());
+        ;
+
+        Map<Long, Purchase> purchaseMap = purchaseService.mapKEntity(Purchase::getId, q -> q.in(Purchase::getId, purchaseIds));
+        Map<Long, List<PurchasePayRecordDetail>> PayRecordMap = purchasePayRecordDetailService.mapKGroup(PurchasePayRecordDetail::getPurchaseId,
+                q -> q.in(PurchasePayRecordDetail::getPurchaseId, purchaseIds));
+
+
+        //创建付款明细
+        for (PurchasePayRecordDetail payRecord : purchasePayRecordList) {
+            //检查付款金额+已付款金额是否大于采购金额
+            Purchase purchase = purchaseMap.get(payRecord.getPurchaseId());
+            List<PurchasePayRecordDetail> oldPurchasePayRecords = PayRecordMap.get(payRecord.getPurchaseId());
+            //求和已付款
+            BigDecimal paidAmount = BigDecimal.ZERO;
+            if(ObjectUtil.isNotEmpty(oldPurchasePayRecords)){
+                paidAmount = oldPurchasePayRecords.stream().map(PurchasePayRecordDetail::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+            }
+            BigDecimal add = paidAmount.add(payRecord.getAmount());
+
+            if (purchase.getAmount().compareTo(add) < 0) {
+                throw new ServiceException("付款金额不能大于采购金额");
+            }
+            if (purchase.getAmount().compareTo(add) > 0) {
+                //部分付款
+                purchase.setPayStatus(10);
+            } else {
+                //完全付款
+                purchase.setPayStatus(20);
+            }
+
+            //赋值已付款金额
+            String victoriatouristJson = purchase.getVictoriatouristJson();
+            JSONObject json = ObjectUtil.isEmpty(victoriatouristJson) ? new JSONObject() : JSONObject.parseObject(victoriatouristJson);
+            json.put("paidAmount", add);
+            purchase.setVictoriatouristJson(json.toJSONString());
+
+            purchaseService.updateById(purchase);
+
+            //获取付款记录并赋值付款时间
+            payRecord.setPayDate(purchasePayRecordDto.getPayDate());
+            payRecord.setPurchasePayRecordId(purchasePayRecordDto.getId());
+        }
+        purchasePayRecordDetailService.saveBatch(purchasePayRecordList);
+    }
+
+}

+ 28 - 1
hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/impl/PurchaseServiceImpl.java

@@ -27,6 +27,7 @@ import com.fjhx.purchase.entity.purchase.dto.PurchaseSelectDto;
 import com.fjhx.purchase.entity.purchase.enums.PurchaseStatusEnum;
 import com.fjhx.purchase.entity.purchase.po.Purchase;
 import com.fjhx.purchase.entity.purchase.po.PurchaseDetail;
+import com.fjhx.purchase.entity.purchase.po.PurchasePayRecordDetail;
 import com.fjhx.purchase.entity.purchase.vo.PurchaseDocumentaryVo;
 import com.fjhx.purchase.entity.purchase.vo.PurchaseVo;
 import com.fjhx.purchase.entity.subscribe.po.Subscribe;
@@ -37,6 +38,8 @@ import com.fjhx.purchase.service.arrival.ArrivalService;
 import com.fjhx.purchase.service.invoice.InvoiceDetailsService;
 import com.fjhx.purchase.service.pay.PayDetailService;
 import com.fjhx.purchase.service.purchase.PurchaseDetailService;
+import com.fjhx.purchase.service.purchase.PurchasePayRecordDetailService;
+import com.fjhx.purchase.service.purchase.PurchasePayRecordService;
 import com.fjhx.purchase.service.purchase.PurchaseService;
 import com.fjhx.purchase.service.subscribe.SubscribeDetailService;
 import com.fjhx.purchase.service.subscribe.SubscribeService;
@@ -107,6 +110,10 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase>
 
     @Autowired
     private CodingRuleService codingRuleService;
+    @Autowired
+    private PurchasePayRecordDetailService purchasePayRecordDetailService;
+    @Autowired
+    private PurchasePayRecordService purchasePayRecordService;
 
     /**
      * 列表
@@ -194,6 +201,10 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase>
 
         Page<PurchaseVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
         List<PurchaseVo> list = page.getRecords();
+        if (ObjectUtils.isEmpty(list)) {
+            return page;
+        }
+
         if (CollectionUtils.isNotEmpty(list)) {
             List<Long> supplyIds = list.stream().map(PurchaseVo::getSupplyId).collect(Collectors.toList());
             List<SupplierInfo> supplierInfoList = supplierInfoService.list(Wrappers.<SupplierInfo>query().lambda().in(SupplierInfo::getId, supplyIds));
@@ -253,6 +264,21 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase>
 //                }
 //            }
         }
+        //赋值已付款金额
+        List<Long> purchaseIds = list.stream().map(PurchaseVo::getId).collect(Collectors.toList());
+        Map<Long, List<PurchasePayRecordDetail>> PayRecordMap = purchasePayRecordDetailService.mapKGroup(PurchasePayRecordDetail::getPurchaseId,
+                q -> q.in(PurchasePayRecordDetail::getPurchaseId, purchaseIds));
+        for (PurchaseVo purchaseVo : list) {
+            List<PurchasePayRecordDetail> purchasePayRecords = PayRecordMap.get(purchaseVo.getId());
+            if (ObjectUtils.isEmpty(purchasePayRecords)) {
+                purchaseVo.setPaidAmount(BigDecimal.ZERO);
+                continue;
+            }
+            //求和已付款
+            BigDecimal paidAmount = purchasePayRecords.stream().map(PurchasePayRecordDetail::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+            purchaseVo.setPaidAmount(paidAmount);
+        }
+
         return page;
     }
 
@@ -437,7 +463,8 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase>
     }
 
     @Override
-    public Page<? extends DocumentaryData> getDocumentaryPage(JSONObject selectData, BaseSelectDto dto, List<Long> excludeBusinessId) {
+    public Page<? extends DocumentaryData> getDocumentaryPage(JSONObject selectData, BaseSelectDto
+            dto, List<Long> excludeBusinessId) {
         PurchaseDocumentaryBo bo = selectData.toJavaObject(PurchaseDocumentaryBo.class);
 
         IWrapper<Purchase> wrapper = IWrapper.getWrapper();

+ 2 - 1
hx-purchase/src/main/java/com/fjhx/purchase/service/refund/impl/RefundServiceImpl.java

@@ -43,7 +43,7 @@ import java.util.stream.Collectors;
  * 退款管理 服务实现类
  * </p>
  *
- * @author 
+ * @author
  * @since 2023-04-13
  */
 @Service
@@ -159,6 +159,7 @@ public class RefundServiceImpl extends ServiceImpl<RefundMapper, Refund> impleme
         accountRunningWater.setName(refundDto.getReceiptName());
         accountRunningWater.setOpeningBank(refundDto.getReceiptOpeningBank());
         accountRunningWater.setAccountOpening(refundDto.getReceiptAccountOpening());
+        accountRunningWater.setType("20"); //添加流水类型 10 打款  20 到款登记
         accountRunningWaterService.save(accountRunningWater);
     }
 

+ 5 - 0
hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/SubscribeDetailService.java

@@ -8,6 +8,7 @@ import com.fjhx.purchase.entity.subscribe.dto.SubscribeDetailSelectDto;
 import com.fjhx.purchase.entity.subscribe.dto.SubscribeDetailDto;
 
 import java.util.List;
+import java.util.Map;
 
 
 /**
@@ -50,4 +51,8 @@ public interface SubscribeDetailService extends BaseService<SubscribeDetail> {
      */
     void delete(Long id);
 
+    /**
+     * 申购统计(申购单分页)
+     */
+    Map<String, Object> subscribeStatistics(SubscribeDetailSelectDto dto);
 }

+ 4 - 1
hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/SubscribeService.java

@@ -1,5 +1,7 @@
 package com.fjhx.purchase.service.subscribe;
 
+import com.fjhx.purchase.entity.subscribe.dto.SubscribeDetailDto;
+import com.fjhx.purchase.entity.subscribe.dto.SubscribeDetailSelectDto;
 import com.fjhx.purchase.entity.subscribe.po.Subscribe;
 import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.service.BaseService;
@@ -54,5 +56,6 @@ public interface SubscribeService extends BaseService<Subscribe> {
      * 获取待采购所有产品的部门列表
      * @return
      */
-    List<SysDept> getDepts();
+    List<SysDept> getDepts(SubscribeDetailSelectDto subscribeDetailDto);
+
 }

+ 87 - 5
hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/impl/SubscribeDetailServiceImpl.java

@@ -3,7 +3,10 @@ package com.fjhx.purchase.service.subscribe.impl;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fjhx.common.constant.SourceConstant;
@@ -18,19 +21,22 @@ import com.fjhx.purchase.entity.subscribe.vo.SubscribeDetailVo;
 import com.fjhx.purchase.mapper.subscribe.SubscribeDetailMapper;
 import com.fjhx.purchase.service.purchase.PurchaseDetailService;
 import com.fjhx.purchase.service.subscribe.SubscribeDetailService;
+import com.fjhx.tenant.entity.dict.dto.DictTenantDataSelectDto;
+import com.fjhx.tenant.entity.dict.vo.DictTenantDataVo;
+import com.fjhx.tenant.service.dict.DictTenantDataService;
 import com.fjhx.wms.entity.warehouse.po.Warehouse;
 import com.fjhx.wms.service.warehouse.WarehouseService;
 import com.obs.services.internal.ServiceException;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import org.apache.commons.collections4.MapUtils;
+import org.apache.poi.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
@@ -54,6 +60,9 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
     @Autowired
     PurchaseDetailService purchaseDetailService;
 
+    @Autowired
+    private DictTenantDataService dictTenantDataService;
+
     /**
      * 分页
      *
@@ -63,12 +72,24 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
     @Override
     public Page<SubscribeDetailVo> getPage(SubscribeDetailSelectDto dto) {
         IWrapper<SubscribeDetail> wrapper = getWrapper();
+        //申购单号
+        wrapper.like(StringUtils.isEmpty(dto.getCode()),"t2.code",dto.getCode());
+
+        //申购时间
+        wrapper.ge(ObjectUtil.isNotEmpty(dto.getBeginTime()),"t2.create_time",dto.getBeginTime());
+        wrapper.ge(ObjectUtil.isNotEmpty(dto.getEndTime()),"t2.create_time",dto.getEndTime());
+        wrapper.ge(ObjectUtil.isNotEmpty(dto.getSubscribeStatus()),"t2.subcribe_status",dto.getSubscribeStatus());
+
         if (ObjectUtil.isNotEmpty(dto.getStatus())) {
             wrapper.in("t1", SubscribeDetail::getStatus, Arrays.asList(dto.getStatus().split(",")));
         }
 
         // 如果类型存在带入类型查询
-        List<ProductInfoVo> productList = productInfoService.getListByProductType(dto.getProductType(), dto.getDefinition());
+        List<ProductInfoVo> productList = productInfoService.getListByProductType(dto.getProductType(),
+                                                                dto.getDefinition(),
+                                                                dto.getProductName(),
+                                                                dto.getProductCode()
+        );
         if (ObjectUtil.isEmpty(productList)) {
             return new Page<>();
         }
@@ -228,4 +249,65 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
         this.removeById(id);
     }
 
+    /**
+     * 申购统计(申购单分页)
+     */
+    @Override
+    public Map<String, Object> subscribeStatistics(SubscribeDetailSelectDto dto) {
+        //存放申购统计数据
+        Map<String, Object> map = new HashMap<>();
+
+        //存放申购统计详情数据
+        List<Map<String,Object>> list = new ArrayList<>();
+
+        QueryWrapper<Object> query = Wrappers.query();
+        query.groupBy("pi.type");
+        //查询申购统计(产品类型分组)
+        List<SubscribeDetailVo> subscribeDetailVos = baseMapper.subscribeStatistics(query);
+        Map<String, List<SubscribeDetailVo>> subscribeDetailVoMap = subscribeDetailVos.stream()
+                .collect(Collectors.groupingBy(SubscribeDetailVo::getType));
+
+        //计算申购笔合计数据
+        Integer amount = subscribeDetailVos.stream().map(SubscribeDetailVo::getCounts).reduce(Integer::sum).orElse(0);
+        map.put("amount",amount);
+        //计算申购货品种类合计数据
+        Integer typeAmount = subscribeDetailVos.stream().map(SubscribeDetailVo::getTypeCount).reduce(Integer::sum).orElse(0);
+        map.put("typeAmount",typeAmount);
+        //切换数据源
+        DynamicDataSourceContextHolder.push(SourceConstant.BASE);
+        //获取产品类型字典数据
+        List<DictTenantDataVo> dictTenantDataVoList = getDict("product_type");
+        DynamicDataSourceContextHolder.poll();
+
+        if (ObjectUtil.isEmpty(dictTenantDataVoList)){
+            throw  new ServiceException("数据有误:产品没有配置产品类型字典,请先添加产品类型字典");
+        }
+
+        //赋值笔数、货品种类数据
+        for (DictTenantDataVo dictTenantDataVo : dictTenantDataVoList) {
+            //设置初始值
+            Map<String,Object> typeMap = new HashMap<>();
+            typeMap.put("type",dictTenantDataVo.getDictValue());
+            typeMap.put("count",0);
+            typeMap.put("typeCount",0);
+
+            //赋值
+            List<SubscribeDetailVo> subscribeDetailVoList = subscribeDetailVoMap.get(dictTenantDataVo.getDictKey());
+            if (ObjectUtil.isNotEmpty(subscribeDetailVoList)){
+                typeMap.put("count",subscribeDetailVoList.get(0).getCounts());
+                typeMap.put("typeCount",subscribeDetailVoList.get(0).getTypeCount());
+            }
+            list.add(typeMap);
+        }
+        map.put("productTypeList",list);
+        return map;
+    }
+
+    //根据字典编码获取字典的数据
+    private List<DictTenantDataVo> getDict(String code){
+        DictTenantDataSelectDto dto = new DictTenantDataSelectDto();
+        dto.setDictCode(code);
+        return dictTenantDataService.getList(dto);
+    }
+
 }

+ 10 - 3
hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/impl/SubscribeServiceImpl.java

@@ -16,6 +16,7 @@ import com.fjhx.common.service.coding.CodingRuleService;
 import com.fjhx.item.entity.product.po.ProductInfo;
 import com.fjhx.item.entity.product.vo.ProductInfoVo;
 import com.fjhx.item.service.product.ProductInfoService;
+import com.fjhx.purchase.entity.subscribe.dto.SubscribeDetailSelectDto;
 import com.fjhx.purchase.entity.subscribe.dto.SubscribeDto;
 import com.fjhx.purchase.entity.subscribe.dto.SubscribeSelectDto;
 import com.fjhx.purchase.entity.subscribe.po.Subscribe;
@@ -24,7 +25,6 @@ import com.fjhx.purchase.entity.subscribe.vo.SubscribeVo;
 import com.fjhx.purchase.mapper.subscribe.SubscribeMapper;
 import com.fjhx.purchase.service.subscribe.SubscribeDetailService;
 import com.fjhx.purchase.service.subscribe.SubscribeService;
-import com.fjhx.purchase.util.code.CodeEnum;
 import com.fjhx.wms.entity.warehouse.po.Warehouse;
 import com.fjhx.wms.service.warehouse.WarehouseService;
 import com.obs.services.internal.ServiceException;
@@ -167,9 +167,16 @@ public class SubscribeServiceImpl extends ServiceImpl<SubscribeMapper, Subscribe
     }
 
     @Override
-    public List<SysDept> getDepts() {
+    public List<SysDept> getDepts(SubscribeDetailSelectDto subscribeDetailDto) {
         List<Long> deptIds = new ArrayList<>();
-        List<SubscribeDetail> list = subscribeDetailService.list();
+        List<SubscribeDetail> list;
+        String status = subscribeDetailDto.getStatus();
+        if(ObjectUtils.isEmpty(status)){
+            list = subscribeDetailService.list();
+        }else {
+            String[] split = status.split(",");
+            list = subscribeDetailService.list(q -> q.in(SubscribeDetail::getStatus, split));
+        }
         if(ObjectUtils.isEmpty(list)){
             return new ArrayList<>();
         }

+ 18 - 0
hx-purchase/src/main/resources/mapper/purchase/PurchasePayRecordDetailMapper.xml

@@ -0,0 +1,18 @@
+<?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="com.fjhx.purchase.mapper.purchase.PurchasePayRecordDetailMapper">
+    <select id="getPage" resultType="com.fjhx.purchase.entity.purchase.vo.PurchasePayRecordDetailVo">
+        select
+            pprd.id,
+            pprd.purchase_id,
+            pprd.amount,
+            pprd.pay_date,
+            pprd.create_user,
+            pprd.create_time,
+            pprd.update_user,
+            pprd.update_time
+        from purchase_pay_record_detail pprd
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>

+ 4 - 0
hx-purchase/src/main/resources/mapper/purchase/PurchasePayRecordMapper.xml

@@ -0,0 +1,4 @@
+<?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="com.fjhx.purchase.mapper.purchase.PurchasePayRecordMapper">
+</mapper>

+ 11 - 0
hx-purchase/src/main/resources/mapper/subscribe/SubscribeDetailMapper.xml

@@ -37,4 +37,15 @@
         GROUP BY
             t1.id
     </select>
+    <select id="subscribeStatistics" resultType="com.fjhx.purchase.entity.subscribe.vo.SubscribeDetailVo">
+        SELECT
+            count(DISTINCT(pi.id)) typeCount,
+            count(DISTINCT(su.id)) counts,
+	        ifnull(pi.type,-1) type
+        FROM
+            subscribe su
+            LEFT JOIN subscribe_detail sd ON su.id = sd.subscribe_id
+            LEFT JOIN bytesailing_item.product_info pi ON sd.bussiness_id = pi.id
+        ${ew.customSqlSegment}
+    </select>
 </mapper>

+ 13 - 1
hx-sale/src/main/java/com/fjhx/sale/controller/claim/ClaimController.java

@@ -1,6 +1,8 @@
 package com.fjhx.sale.controller.claim;
 
 import com.fjhx.sale.entity.claim.po.Claim;
+import com.fjhx.sale.entity.claim.po.ClaimContract;
+import com.fjhx.sale.entity.claim.vo.ClaimContractVo;
 import org.springframework.web.bind.annotation.*;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fjhx.sale.entity.claim.vo.ClaimVo;
@@ -11,6 +13,7 @@ import com.fjhx.sale.service.claim.ClaimService;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import java.math.BigDecimal;
+import java.util.List;
 
 
 /**
@@ -18,7 +21,7 @@ import java.math.BigDecimal;
  * 到账认领 前端控制器
  * </p>
  *
- * @author 
+ * @author
  * @since 2023-04-18
  */
 @RestController
@@ -76,4 +79,13 @@ public class ClaimController {
         return claimService.sumClaimMoney(businessId);
     }
 
+
+    /**
+     * 查询认领记录
+     */
+    @PostMapping("/claimRecord")
+    public List<ClaimContractVo> claimRecord(@RequestBody Claim claim) {
+        return claimService.claimRecord(claim.getBusinessId());
+    }
+
 }

+ 9 - 0
hx-sale/src/main/java/com/fjhx/sale/controller/contract/ContractController.java

@@ -179,4 +179,13 @@ public class ContractController {
     public  Page<ContractBudgetVo> getProfitBudgetPage(@RequestBody ContractSelectDto dto){
         return  contractService.getProfitBudgetPage(dto);
     }
+
+    /**
+     * 利润结算
+     */
+    @PostMapping("/getProfitClearingPage")
+    public  Page<ContractBudgetVo> getProfitClearingPage(@RequestBody ContractSelectDto dto){
+        return  contractService.getProfitClearingPage(dto);
+    }
+
 }

+ 68 - 0
hx-sale/src/main/java/com/fjhx/sale/controller/quality/EhsdQualityMarkingDetailController.java

@@ -0,0 +1,68 @@
+package com.fjhx.sale.controller.quality;
+
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.sale.entity.quality.vo.EhsdQualityMarkingDetailVo;
+import com.fjhx.sale.entity.quality.dto.EhsdQualityMarkingDetailSelectDto;
+import com.fjhx.sale.entity.quality.dto.EhsdQualityMarkingDetailDto;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import com.fjhx.sale.service.quality.EhsdQualityMarkingDetailService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+
+/**
+ * <p>
+ * 质检打标明细表 前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-25
+ */
+@RestController
+@RequestMapping("/ehsdQualityMarkingDetail")
+public class EhsdQualityMarkingDetailController {
+
+    @Autowired
+    private EhsdQualityMarkingDetailService ehsdQualityMarkingDetailService;
+
+    /**
+     * 质检打标明细表分页
+     */
+    @PostMapping("/page")
+    public Page<EhsdQualityMarkingDetailVo> page(@RequestBody EhsdQualityMarkingDetailSelectDto dto) {
+        return ehsdQualityMarkingDetailService.getPage(dto);
+    }
+
+    /**
+     * 质检打标明细表明细
+     */
+    @PostMapping("/detail")
+    public EhsdQualityMarkingDetailVo detail(@RequestBody BaseSelectDto dto) {
+        return ehsdQualityMarkingDetailService.detail(dto.getId());
+    }
+
+    /**
+     * 质检打标明细表新增
+     */
+    @PostMapping("/add")
+    public void add(@RequestBody EhsdQualityMarkingDetailDto ehsdQualityMarkingDetailDto) {
+        ehsdQualityMarkingDetailService.add(ehsdQualityMarkingDetailDto);
+    }
+
+    /**
+     * 质检打标明细表编辑
+     */
+    @PostMapping("/edit")
+    public void edit(@RequestBody EhsdQualityMarkingDetailDto ehsdQualityMarkingDetailDto) {
+        ehsdQualityMarkingDetailService.edit(ehsdQualityMarkingDetailDto);
+    }
+
+    /**
+     * 质检打标明细表删除
+     */
+    @PostMapping("/delete")
+    public void delete(@RequestBody BaseSelectDto dto) {
+        ehsdQualityMarkingDetailService.delete(dto.getId());
+    }
+
+}

+ 1 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/claim/po/Claim.java

@@ -79,5 +79,6 @@ public class Claim extends BasePo {
     /**
      * 总金额
      */
+    @TableField(exist = false)
     private BigDecimal sumAmount;
 }

+ 5 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/claim/po/ClaimContract.java

@@ -39,4 +39,9 @@ public class ClaimContract extends BasePo {
      */
     private String contractCode;
 
+    /**
+     * 币种
+     */
+    private String currency;
+
 }

+ 11 - 1
hx-sale/src/main/java/com/fjhx/sale/entity/claim/vo/ClaimContractVo.java

@@ -7,11 +7,21 @@ import lombok.Setter;
 /**
  * 到账认领-合同关联表列表查询返回值实体
  *
- * @author 
+ * @author
  * @since 2023-04-18
  */
 @Getter
 @Setter
 public class ClaimContractVo extends ClaimContract {
 
+
+    /**
+     * 认领人ID
+     */
+    private  Long claimUserId;
+
+    /**
+     * 认领人名称
+     */
+    private  String claimUserName;
 }

+ 7 - 2
hx-sale/src/main/java/com/fjhx/sale/entity/claim/vo/ClaimVo.java

@@ -1,20 +1,25 @@
 package com.fjhx.sale.entity.claim.vo;
 
 import com.fjhx.sale.entity.claim.po.Claim;
+import com.fjhx.sale.entity.claim.po.ClaimContract;
 import lombok.Getter;
 import lombok.Setter;
 
 import java.math.BigDecimal;
+import java.util.List;
 
 /**
  * 到账认领列表查询返回值实体
  *
- * @author 
+ * @author
  * @since 2023-04-18
  */
 @Getter
 @Setter
 public class ClaimVo extends Claim {
 
-
+    /**
+     * 认领合同列表
+     */
+    List<ClaimContract> claimContracts;
 }

+ 5 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/contract/dto/ContractSelectDto.java

@@ -39,4 +39,9 @@ public class ContractSelectDto extends BaseSelectDto {
      */
     private String userId;
 
+    /**
+     * 到款状态
+     */
+    private String refundStatusNew;
+
 }

+ 9 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/contract/po/Contract.java

@@ -279,6 +279,15 @@ public class Contract extends BasePo {
     private String budgetRemark;
 
     /**
+     * 利润结算表代理费
+     */
+    private BigDecimal profitAgencyFee;
+
+    /**
+     * 利润结算表备注
+     */
+    private String profitClearingRemark;
+    /**
      * 版本号
      */
     @TableField(fill = FieldFill.INSERT)

+ 47 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/contract/vo/ContractBudgetVo.java

@@ -23,6 +23,27 @@ public class ContractBudgetVo extends Contract {
      * 合同产品IDS
      */
     private String contractProductIds;
+
+    /**
+     * 检验费
+     */
+    private BigDecimal checkout;
+
+    /**
+     * 验货费
+     */
+    private BigDecimal inspectionCharge;
+
+    /**
+     * 运费
+     */
+    private BigDecimal freight;
+
+    /**
+     * 产地证费
+     */
+    private BigDecimal certificateOfOrigin;
+
     /**
      * 拖车费币种
      */
@@ -132,4 +153,30 @@ public class ContractBudgetVo extends Contract {
      * 应退税金额
      */
     private BigDecimal RefundableAmount;
+
+    /**
+     * 人民币合同金额
+     */
+    private BigDecimal rmbContractAmount;
+
+    /**
+     * 到账金额
+     */
+    private BigDecimal sumClaimMoney;
+
+    /**
+     * 采购合同总金额
+     */
+    private BigDecimal sumPurchaseContractMoney;
+
+    /**
+     * 其他收入
+     */
+    private BigDecimal otherIncomeAmount;
+
+    /**
+     * 已付货款
+     */
+    private BigDecimal accountPaid;
+
 }

Некоторые файлы не были показаны из-за большого количества измененных файлов