Commit 572b779cc41f2796f7a0ebf08a762b8ba3d4f3ab

Authored by zhangmeiyang
1 parent 14b6e83e

金蝶收款退款单对接

Showing 37 changed files with 1018 additions and 304 deletions
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/component/BillTrans.java
1 1 package com.diligrp.etrade.thirdparty.component;
2 2  
3 3 import com.diligrp.etrade.core.Constants;
4   -import com.diligrp.etrade.thirdparty.domain.co.business.BaseBillCo;
  4 +import com.diligrp.etrade.thirdparty.domain.co.business.bill.BaseBillCo;
5 5 import com.diligrp.etrade.thirdparty.domain.model.*;
6 6 import com.diligrp.etrade.thirdparty.type.ProcessType;
7 7 import jakarta.annotation.Resource;
... ... @@ -23,7 +23,11 @@ public class BillTrans {
23 23 @Resource
24 24 private TransferComponent transferComponent;
25 25  
26   -
  26 + /**
  27 + * 交易费项目
  28 + *
  29 + * @param fEntityDetail F 实体详细信息
  30 + */
27 31 public void transFeeItem(List<FEntityDetail> fEntityDetail) {
28 32 fEntityDetail.forEach(e -> {
29 33 if (!ObjectUtils.isEmpty(e.getFCOSTID())) {
... ... @@ -49,6 +53,13 @@ public class BillTrans {
49 53 afterSet(co, marketId, systemCode);
50 54 }
51 55  
  56 + /**
  57 + * 设置后
  58 + *
  59 + * @param co CO
  60 + * @param marketId 市场 ID
  61 + * @param systemCode 系统代码
  62 + */
52 63 private void afterSet(BaseBillCo co, Long marketId, String systemCode) {
53 64 transferComponent.transPayOrgId(co.getFPAYORGID(), marketId, systemCode);
54 65 transferComponent.transSaleOrgId(co.getFSALEORGID(), marketId, systemCode);
... ... @@ -57,6 +68,11 @@ public class BillTrans {
57 68 transferComponent.transMainBookCurrency(co.getFMAINBOOKSTDCURRID(), marketId, systemCode);
58 69 }
59 70  
  71 + /**
  72 + * 设置部门
  73 + *
  74 + * @param co CO
  75 + */
60 76 private void setDept(BaseBillCo co) {
61 77 if (!ObjectUtils.isEmpty(co.getFSALEDEPTID())) {
62 78 var fNumber = transferComponent.transDepId(co.getFSALEDEPTID());
... ... @@ -71,6 +87,11 @@ public class BillTrans {
71 87 }
72 88 }
73 89  
  90 + /**
  91 + * 设置传输 ID
  92 + *
  93 + * @param co CO
  94 + */
74 95 private void setTransferId(BaseBillCo co) {
75 96 if (!ObjectUtils.isEmpty(co.getFTRANSFERID())) {
76 97 transferComponent.transTransferId(co.getFTRANSFERID());
... ... @@ -79,6 +100,11 @@ public class BillTrans {
79 100 }
80 101 }
81 102  
  103 + /**
  104 + * 设置客户 ID
  105 + *
  106 + * @param co CO
  107 + */
82 108 private void setCustomerId(BaseBillCo co) {
83 109 if (!ObjectUtils.isEmpty(co.getFCUSTOMERID())) {
84 110 transferComponent.transCustomer(co.getFCUSTOMERID());
... ... @@ -87,6 +113,11 @@ public class BillTrans {
87 113 }
88 114 }
89 115  
  116 + /**
  117 + * 设置订单 ID
  118 + *
  119 + * @param co CO
  120 + */
90 121 private void setOrderId(BaseBillCo co) {
91 122 if (!ObjectUtils.isEmpty(co.getFORDERID())) {
92 123 transferComponent.transOrderId(co.getFORDERID());
... ... @@ -95,6 +126,11 @@ public class BillTrans {
95 126 }
96 127 }
97 128  
  129 + /**
  130 + * 设置 Settle Type
  131 + *
  132 + * @param co CO
  133 + */
98 134 private void setSettleType(BaseBillCo co) {
99 135 if (!ObjectUtils.isEmpty(co.getFSettleTypeID())) {
100 136 co.getFEntityDetail().forEach(e -> e.setFSettleTypeID(co.getFSettleTypeID()));
... ... @@ -104,6 +140,11 @@ public class BillTrans {
104 140 }
105 141 }
106 142  
  143 + /**
  144 + * Init Bill 公司
  145 + *
  146 + * @param co CO
  147 + */
107 148 private void initBillCo(BaseBillCo co) {
108 149 co.setF_ZDB_Text1(ObjectUtils.isEmpty(co.getF_ZDB_Text()) ? null : co.getF_ZDB_Text());
109 150 co.setF_PZCW_Text(null);
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/component/RecTrans.java
1 1 package com.diligrp.etrade.thirdparty.component;
2 2  
3 3 import com.diligrp.etrade.core.Constants;
4   -import com.diligrp.etrade.thirdparty.domain.co.rec.BaseRecCo;
  4 +import com.diligrp.etrade.thirdparty.domain.co.business.rec.BaseRecCo;
5 5 import com.diligrp.etrade.thirdparty.domain.model.*;
6 6 import jakarta.annotation.Resource;
7 7 import org.springframework.stereotype.Component;
... ... @@ -9,6 +9,7 @@ import org.springframework.util.ObjectUtils;
9 9  
10 10 import java.time.LocalDateTime;
11 11 import java.time.format.DateTimeFormatter;
  12 +import java.util.List;
12 13  
13 14 /**
14 15 * @Author: zhangmeiyang
... ... @@ -21,6 +22,23 @@ public class RecTrans {
21 22 @Resource
22 23 private TransferComponent transferComponent;
23 24  
  25 + private static final String CONTACT_TYPE = "BD_Customer";
  26 +
  27 +
  28 + /**
  29 + * 交易费项目
  30 + *
  31 + * @param freceivebillentry fReceiveBillEntry
  32 + */
  33 + public void transFeeItem(List<FRECEIVEBILLENTRY> freceivebillentry) {
  34 + freceivebillentry.forEach(e -> {
  35 + if (!ObjectUtils.isEmpty(e.getFCOSTID())) {
  36 + transferComponent.transFCOSTID(e.getFCOSTID());
  37 + }
  38 + });
  39 + }
  40 +
  41 +
24 42 /**
25 43 * 转换数据recCo
26 44 *
... ... @@ -36,6 +54,13 @@ public class RecTrans {
36 54 afterSet(co, marketId, systemCode);
37 55 }
38 56  
  57 + /**
  58 + * 设置后
  59 + *
  60 + * @param co CO
  61 + * @param marketId 市场 ID
  62 + * @param systemCode 系统代码
  63 + */
39 64 private void afterSet(BaseRecCo co, Long marketId, String systemCode) {
40 65 transferComponent.transPayOrgId(co.getFPAYORGID(), marketId, systemCode);
41 66 transferComponent.transSaleOrgId(co.getFSALEORGID(), marketId, systemCode);
... ... @@ -44,6 +69,11 @@ public class RecTrans {
44 69 transferComponent.transSettleMainBookCurrency(co.getFSETTLEMAINBOOKID(), marketId, systemCode);
45 70 }
46 71  
  72 + /**
  73 + * 设置部门
  74 + *
  75 + * @param co CO
  76 + */
47 77 private void setDept(BaseRecCo co) {
48 78 if (!ObjectUtils.isEmpty(co.getFSALEDEPTID())) {
49 79 var fNumber = transferComponent.transDepId(co.getFSALEDEPTID());
... ... @@ -58,7 +88,13 @@ public class RecTrans {
58 88 }
59 89 }
60 90  
  91 + /**
  92 + * 设置支付单位
  93 + *
  94 + * @param co CO
  95 + */
61 96 private void setPayUnit(BaseRecCo co) {
  97 + co.setFPAYUNITTYPE(CONTACT_TYPE);
62 98 if (!ObjectUtils.isEmpty(co.getFPAYUNIT())) {
63 99 transferComponent.transFPAYUNIT(co.getFPAYUNIT());
64 100 } else {
... ... @@ -66,7 +102,13 @@ public class RecTrans {
66 102 }
67 103 }
68 104  
  105 + /**
  106 + * 设置触点单位
  107 + *
  108 + * @param co CO
  109 + */
69 110 private void setContactUnit(BaseRecCo co) {
  111 + co.setFCONTACTUNITTYPE(CONTACT_TYPE);
70 112 if (!ObjectUtils.isEmpty(co.getFCONTACTUNIT())) {
71 113 transferComponent.transFCONTACTUNIT(co.getFCONTACTUNIT());
72 114 } else {
... ... @@ -74,6 +116,11 @@ public class RecTrans {
74 116 }
75 117 }
76 118  
  119 + /**
  120 + * Init Rec 公司
  121 + *
  122 + * @param co CO
  123 + */
77 124 private void initRecCo(BaseRecCo co) {
78 125 co.setFDATE(LocalDateTime.now().format(DateTimeFormatter.ofPattern(Constants.DATE_TIME_FORMAT)));
79 126 co.setFCURRENCYID(new FCURRENCYID());
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/component/RefundTrans.java 0 → 100644
  1 +package com.diligrp.etrade.thirdparty.component;
  2 +
  3 +import com.diligrp.etrade.core.Constants;
  4 +import com.diligrp.etrade.thirdparty.domain.co.business.refund.BaseRefundCo;
  5 +import com.diligrp.etrade.thirdparty.domain.model.*;
  6 +import jakarta.annotation.Resource;
  7 +import org.springframework.stereotype.Component;
  8 +import org.springframework.util.ObjectUtils;
  9 +
  10 +import java.time.LocalDateTime;
  11 +import java.time.format.DateTimeFormatter;
  12 +import java.util.List;
  13 +
  14 +/**
  15 + * @Author: zhangmeiyang
  16 + * @CreateTime: 2024-11-28 09:42
  17 + * @Version: todo
  18 + */
  19 +@Component
  20 +public class RefundTrans {
  21 +
  22 + private static final String CONTACT_TYPE = "BD_Customer";
  23 + @Resource
  24 + private TransferComponent transferComponent;
  25 +
  26 + public void transFeeItem(List<FREFUNDBILLENTRY> frefundbillentry) {
  27 + frefundbillentry.forEach(e -> {
  28 + if (!ObjectUtils.isEmpty(e.getFCOSTID())) {
  29 + transferComponent.transFCOSTID(e.getFCOSTID());
  30 + }
  31 + });
  32 + }
  33 +
  34 +
  35 + public void transRefundCo(BaseRefundCo co, Long marketId, String systemCode) {
  36 + initRefundCo(co);
  37 + setDept(co);
  38 + setContactUnit(co);
  39 + setRecUnit(co);
  40 + afterSet(co, marketId, systemCode);
  41 + }
  42 +
  43 + private void initRefundCo(BaseRefundCo co) {
  44 + co.setFDATE(LocalDateTime.now().format(DateTimeFormatter.ofPattern(Constants.DATE_TIME_FORMAT)));
  45 + co.setFCURRENCYID(new FCURRENCYID());
  46 + co.setFPAYORGID(new FPAYORGID());
  47 + co.setFSETTLECUR(new FSETTLECUR());
  48 + }
  49 +
  50 + /**
  51 + * 设置部门
  52 + *
  53 + * @param co CO
  54 + */
  55 + private void setDept(BaseRefundCo co) {
  56 + if (!ObjectUtils.isEmpty(co.getFSALEDEPTID())) {
  57 + var fNumber = transferComponent.transDepId(co.getFSALEDEPTID());
  58 + if (!ObjectUtils.isEmpty(fNumber)) {
  59 + FCOSTDEPARTMENTID fCOSTDEPARTMENTID = new FCOSTDEPARTMENTID();
  60 + fCOSTDEPARTMENTID.setFNUMBER(fNumber);
  61 + co.getFREFUNDBILLENTRY().forEach(e -> e.setFCOSTDEPARTMENTID(fCOSTDEPARTMENTID));
  62 + }
  63 + } else {
  64 + co.setFSALEDEPTID(new FSALEDEPTID());
  65 + co.getFREFUNDBILLENTRY().forEach(e -> e.setFCOSTDEPARTMENTID(new FCOSTDEPARTMENTID()));
  66 + }
  67 + }
  68 +
  69 + /**
  70 + * 设置触点单位
  71 + *
  72 + * @param co CO
  73 + */
  74 + private void setContactUnit(BaseRefundCo co) {
  75 + co.setFCONTACTUNITTYPE(CONTACT_TYPE);
  76 + if (!ObjectUtils.isEmpty(co.getFCONTACTUNIT())) {
  77 + transferComponent.transFCONTACTUNIT(co.getFCONTACTUNIT());
  78 + } else {
  79 + co.setFCONTACTUNIT(new FCONTACTUNIT());
  80 + }
  81 + }
  82 +
  83 + /**
  84 + * 设置支付单位
  85 + *
  86 + * @param co CO
  87 + */
  88 + private void setRecUnit(BaseRefundCo co) {
  89 + co.setFRECTUNITTYPE(CONTACT_TYPE);
  90 + if (!ObjectUtils.isEmpty(co.getFRECTUNIT())) {
  91 + transferComponent.transFRECTUNIT(co.getFRECTUNIT());
  92 + } else {
  93 + co.setFRECTUNIT(new FRECTUNIT());
  94 + }
  95 + }
  96 +
  97 + /**
  98 + * 设置后
  99 + *
  100 + * @param co CO
  101 + * @param marketId 市场 ID
  102 + * @param systemCode 系统代码
  103 + */
  104 + private void afterSet(BaseRefundCo co, Long marketId, String systemCode) {
  105 + transferComponent.transPayOrgId(co.getFPAYORGID(), marketId, systemCode);
  106 + transferComponent.transSaleOrgId(co.getFSALEORGID(), marketId, systemCode);
  107 + transferComponent.transSettleOrgId(co.getFSETTLEORGID(), marketId, systemCode);
  108 + transferComponent.transCurrency(co.getFCURRENCYID(), marketId, systemCode);
  109 + transferComponent.transSettleCur(co.getFSETTLECUR(), marketId, systemCode);
  110 + }
  111 +}
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/component/TransferComponent.java
... ... @@ -50,6 +50,17 @@ public class TransferComponent {
50 50 /**
51 51 * 交易货币
52 52 *
  53 + * @param fsettlecur fsettlecur
  54 + * @param marketId 市场 ID
  55 + * @param systemCode 系统代码
  56 + */
  57 + public void transSettleCur(FSETTLECUR fsettlecur, Long marketId, String systemCode) {
  58 + fsettlecur.setFNUMBER(transMapper.getBaseConfig(systemCode, marketId).getCurrency());
  59 + }
  60 +
  61 + /**
  62 + * 交易货币
  63 + *
53 64 * @param marketId 市场 ID
54 65 * @param systemCode 系统代码
55 66 * @param fGroup F 组
... ... @@ -81,7 +92,7 @@ public class TransferComponent {
81 92 }
82 93  
83 94 /**
84   - * 跨性别客户
  95 + * 转换客户
85 96 *
86 97 * @param fcustomerid fcustomerid
87 98 */
... ... @@ -93,7 +104,7 @@ public class TransferComponent {
93 104 }
94 105  
95 106 /**
96   - * 跨性别客户
  107 + * 转换客户
97 108 *
98 109 * @param fcontactunit fcontactunit
99 110 */
... ... @@ -105,7 +116,7 @@ public class TransferComponent {
105 116 }
106 117  
107 118 /**
108   - * 跨性别客户
  119 + * 转换客户
109 120 *
110 121 * @param fpayunit fpayunit
111 122 */
... ... @@ -117,6 +128,18 @@ public class TransferComponent {
117 128 }
118 129  
119 130 /**
  131 + * 转换客户
  132 + *
  133 + * @param frectunit frect单位
  134 + */
  135 + public void transFRECTUNIT(FRECTUNIT frectunit) {
  136 + if (ObjectUtils.isEmpty(frectunit.getFNumber())) {
  137 + return;
  138 + }
  139 + frectunit.setFNumber(transMapper.getCustomer(Long.valueOf(frectunit.getFNumber())).getCode());
  140 + }
  141 +
  142 + /**
120 143 * 交易订单 ID
121 144 *
122 145 * @param forderid forderid
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/demarcate/AbstractBaseBillHandler.java 0 → 100644
  1 +package com.diligrp.etrade.thirdparty.demarcate;
  2 +
  3 +import com.diligrp.etrade.thirdparty.domain.dto.BusinessDetailDto;
  4 +import com.diligrp.etrade.thirdparty.domain.dto.BusinessDto;
  5 +import com.diligrp.etrade.thirdparty.domain.dto.ClientDto;
  6 +import com.diligrp.etrade.thirdparty.mapper.TransMapper;
  7 +import com.diligrp.etrade.thirdparty.type.BasicEnum;
  8 +import com.diligrp.etrade.thirdparty.type.DynamicType;
  9 +import com.diligrp.etrade.thirdparty.type.SelectType;
  10 +import com.diligrp.etrade.thirdparty.type.SyncType;
  11 +import com.kingdee.bos.webapi.entity.IdentifyInfo;
  12 +import jakarta.annotation.Resource;
  13 +import org.springframework.util.ObjectUtils;
  14 +
  15 +import java.util.ArrayList;
  16 +import java.util.HashMap;
  17 +import java.util.List;
  18 +import java.util.Map;
  19 +
  20 +/**
  21 + * @Author: zhangmeiyang
  22 + * @CreateTime: 2024-11-28 09:18
  23 + * @Version: todo
  24 + */
  25 +public abstract class AbstractBaseBillHandler {
  26 +
  27 + @Resource
  28 + protected TransMapper transMapper;
  29 +
  30 + /**
  31 + * 获取动态数据
  32 + *
  33 + * @param marketId 市场 ID
  34 + * @param systemCode 系统代码
  35 + * @param dynamicType 动态型
  36 + * @return {@link Map}<{@link String}, {@link BusinessDetailDto}>
  37 + */
  38 + protected Map<String, BusinessDetailDto> getFilteredDynamicDataSingle(DynamicType dynamicType, Long marketId, String systemCode) {
  39 + var queryArrays = new String[]{
  40 + BasicEnum.DEPARTMENT_TO_LOWER.code,
  41 + BasicEnum.CUSTOMER_TO_LOWER.code,
  42 + BasicEnum.FINANCIAL_CHANNEL_TYPE_TO_LOWER.code,
  43 + BasicEnum.FINANCIAL_BUSINESS_TYPE_TO_LOWER.code
  44 + };
  45 + var dynamicParam = transMapper.getFixedWithQueryArrays(systemCode, dynamicType.code, marketId, SelectType.FIXED.getCode(), queryArrays);
  46 + Map<String, BusinessDetailDto> map = new HashMap<>();
  47 + if (!ObjectUtils.isEmpty(dynamicParam)) {
  48 + dynamicParam.forEach(e -> map.computeIfAbsent(e.getCode(), k -> e));
  49 + }
  50 + return map;
  51 + }
  52 +
  53 +
  54 + /**
  55 + * 获取动态数据
  56 + *
  57 + * @param marketId 市场 ID
  58 + * @param systemCode 系统代码
  59 + * @param dynamicType 动态型
  60 + * @return {@link Map}<{@link String}, {@link BusinessDetailDto}>
  61 + */
  62 + protected Map<String, List<BusinessDetailDto>> getFilteredDynamicDataMulti(DynamicType dynamicType, Long marketId, String systemCode) {
  63 + var queryArrays = new String[]{BasicEnum.CHARGE_ITEM_TO_LOWER.code};
  64 + var dynamicParam = transMapper.getFixedWithQueryArrays(systemCode, dynamicType.code, marketId, SelectType.FIXED.getCode(), queryArrays);
  65 + Map<String, List<BusinessDetailDto>> map = new HashMap<>();
  66 + if (!ObjectUtils.isEmpty(dynamicParam)) {
  67 + dynamicParam.forEach(e -> map.computeIfAbsent(e.getCode(), k -> new ArrayList<>()).add(e));
  68 + }
  69 + return map;
  70 + }
  71 +
  72 +
  73 + /**
  74 + * 是否同步
  75 + *
  76 + * @param marketId 市场 ID
  77 + * @param systemCode 系统代码
  78 + * @return boolean
  79 + */
  80 + protected boolean isSync(Long marketId, String systemCode, DynamicType dynamicType) {
  81 + BusinessDto businessConfig = transMapper.getBusinessConfig(systemCode, marketId, dynamicType.code);
  82 + if (ObjectUtils.isEmpty(businessConfig)) {
  83 + return false;
  84 + }
  85 + return ObjectUtils.nullSafeEquals(businessConfig.getSyncType(), SyncType.SYNC.code);
  86 + }
  87 +
  88 + /**
  89 + * 获取文档类型
  90 + *
  91 + * @param marketId 市场 ID
  92 + * @param systemCode 系统代码
  93 + * @param billTypeId 账单类型 ID
  94 + * @return {@link String}
  95 + */
  96 + protected String getDocumentType(Long marketId, String systemCode, String billTypeId) {
  97 + var res = transMapper.getMappingDict(BasicEnum.FINANCIAL_BUSINESS_TYPE_TO_LOWER.code, systemCode, marketId, billTypeId);
  98 + return ObjectUtils.isEmpty(res) ? null : res.getMapType();
  99 + }
  100 +
  101 + /**
  102 + * 获取身份信息
  103 + *
  104 + * @param marketId 市场 ID
  105 + * @param systemCode 系统代码
  106 + * @return {@link IdentifyInfo }
  107 + */
  108 + protected IdentifyInfo getIdentifyInfo(Long marketId, String systemCode) {
  109 + var identifyInfo = new IdentifyInfo();
  110 + ClientDto clientParam = transMapper.getClientParam(systemCode, marketId);
  111 + identifyInfo.setAppId(clientParam.getApplyId());
  112 + identifyInfo.setUserName(clientParam.getUsername());
  113 + identifyInfo.setServerUrl(clientParam.getServiceAddress());
  114 + identifyInfo.setAppSecret(clientParam.getSecurityKey());
  115 + identifyInfo.setdCID(clientParam.getDataCentreId());
  116 + return identifyInfo;
  117 + }
  118 +
  119 +}
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/demarcate/AbstractBillHandler.java
... ... @@ -2,21 +2,18 @@ package com.diligrp.etrade.thirdparty.demarcate;
2 2  
3 3 import com.diligrp.etrade.core.util.JsonUtils;
4 4 import com.diligrp.etrade.thirdparty.component.BillTrans;
5   -import com.diligrp.etrade.thirdparty.domain.co.business.BaseBillCo;
  5 +import com.diligrp.etrade.thirdparty.domain.co.business.bill.BaseBillCo;
6 6 import com.diligrp.etrade.thirdparty.domain.dto.BusinessDetailDto;
7   -import com.diligrp.etrade.thirdparty.domain.dto.BusinessDto;
8   -import com.diligrp.etrade.thirdparty.domain.dto.ClientDto;
9 7 import com.diligrp.etrade.thirdparty.domain.model.FEntityDetail;
10 8 import com.diligrp.etrade.thirdparty.error.ThirdPartyException;
11   -import com.diligrp.etrade.thirdparty.mapper.TransMapper;
12   -import com.diligrp.etrade.thirdparty.type.*;
  9 +import com.diligrp.etrade.thirdparty.type.BasicEnum;
  10 +import com.diligrp.etrade.thirdparty.type.BillType;
  11 +import com.diligrp.etrade.thirdparty.type.DynamicType;
13 12 import com.diligrp.etrade.thirdparty.utils.PurchaseOrderApiUtils;
14   -import com.kingdee.bos.webapi.entity.IdentifyInfo;
15 13 import jakarta.annotation.Resource;
16 14 import org.springframework.util.ObjectUtils;
17 15  
18 16 import java.math.BigDecimal;
19   -import java.util.ArrayList;
20 17 import java.util.HashMap;
21 18 import java.util.List;
22 19 import java.util.Map;
... ... @@ -28,13 +25,10 @@ import java.util.stream.Collectors;
28 25 * @author zhangmeiyang
29 26 * @date 2024/09/26
30 27 */
31   -public abstract class AbstractBillHandler<T extends BaseBillCo> implements Handler {
  28 +public abstract class AbstractBillHandler<T extends BaseBillCo> extends AbstractBaseBillHandler implements Handler {
32 29  
33 30 @Resource
34   - protected BillTrans trans;
35   -
36   - @Resource
37   - protected TransMapper transMapper;
  31 + protected BillTrans billTrans;
38 32  
39 33 protected static final Map<String, TransferFunctionSingle<BaseBillCo>> TRANSFER_FUNCTION_SINGLE_MAP = new HashMap<>();
40 34 protected static final Map<String, TransferFunctionMulti<BaseBillCo>> TRANSFER_FUNCTION_MULTI_MAP = new HashMap<>();
... ... @@ -53,29 +47,6 @@ public abstract class AbstractBillHandler&lt;T extends BaseBillCo&gt; implements Handl
53 47 }
54 48  
55 49 /**
56   - * 获取动态数据
57   - *
58   - * @param marketId 市场 ID
59   - * @param systemCode 系统代码
60   - * @param dynamicType 动态型
61   - * @return {@link Map}<{@link String}, {@link BusinessDetailDto}>
62   - */
63   - protected Map<String, BusinessDetailDto> getFilteredDynamicDataSingle(DynamicType dynamicType, Long marketId, String systemCode) {
64   - var queryArrays = new String[]{
65   - BasicEnum.DEPARTMENT_TO_LOWER.code,
66   - BasicEnum.CUSTOMER_TO_LOWER.code,
67   - BasicEnum.FINANCIAL_CHANNEL_TYPE_TO_LOWER.code,
68   - BasicEnum.FINANCIAL_BUSINESS_TYPE_TO_LOWER.code
69   - };
70   - var dynamicParam = transMapper.getFixedWithQueryArrays(systemCode, dynamicType.code, marketId, SelectType.FIXED.getCode(), queryArrays);
71   - Map<String, BusinessDetailDto> map = new HashMap<>();
72   - if (!ObjectUtils.isEmpty(dynamicParam)) {
73   - dynamicParam.forEach(e -> map.computeIfAbsent(e.getCode(), k -> e));
74   - }
75   - return map;
76   - }
77   -
78   - /**
79 50 * 转移动态结算类型
80 51 *
81 52 * @param t t
... ... @@ -93,7 +64,7 @@ public abstract class AbstractBillHandler&lt;T extends BaseBillCo&gt; implements Handl
93 64 */
94 65 protected static <T extends BaseBillCo> void transferDynamicDept(T t, BusinessDetailDto data) {
95 66 t.getFSALEDEPTID().setFNumber(data.getItemValue());
96   - t.getFEntityDetail().forEach(e-> e.getFCOSTDEPARTMENTID().setFNUMBER(data.getItemValue()));
  67 + t.getFEntityDetail().forEach(e -> e.getFCOSTDEPARTMENTID().setFNUMBER(data.getItemValue()));
97 68 }
98 69  
99 70 /**
... ... @@ -163,39 +134,6 @@ public abstract class AbstractBillHandler&lt;T extends BaseBillCo&gt; implements Handl
163 134 }
164 135  
165 136 /**
166   - * 是否同步
167   - *
168   - * @param marketId 市场 ID
169   - * @param systemCode 系统代码
170   - * @return boolean
171   - */
172   - protected boolean isSync(Long marketId, String systemCode, DynamicType dynamicType) {
173   - BusinessDto businessConfig = transMapper.getBusinessConfig(systemCode, marketId, dynamicType.code);
174   - if (ObjectUtils.isEmpty(businessConfig)) {
175   - return false;
176   - }
177   - return ObjectUtils.nullSafeEquals(businessConfig.getSyncType(), SyncType.SYNC.code);
178   - }
179   -
180   - /**
181   - * 获取动态数据
182   - *
183   - * @param marketId 市场 ID
184   - * @param systemCode 系统代码
185   - * @param dynamicType 动态型
186   - * @return {@link Map}<{@link String}, {@link BusinessDetailDto}>
187   - */
188   - protected Map<String, List<BusinessDetailDto>> getFilteredDynamicDataMulti(DynamicType dynamicType, Long marketId, String systemCode) {
189   - var queryArrays = new String[]{BasicEnum.CHARGE_ITEM_TO_LOWER.code};
190   - var dynamicParam = transMapper.getFixedWithQueryArrays(systemCode, dynamicType.code, marketId, SelectType.FIXED.getCode(), queryArrays);
191   - Map<String, List<BusinessDetailDto>> map = new HashMap<>();
192   - if (!ObjectUtils.isEmpty(dynamicParam)) {
193   - dynamicParam.forEach(e -> map.computeIfAbsent(e.getCode(), k -> new ArrayList<>()).add(e));
194   - }
195   - return map;
196   - }
197   -
198   - /**
199 137 * 有效数据同步
200 138 *
201 139 * @param ts 茨
... ... @@ -204,7 +142,11 @@ public abstract class AbstractBillHandler&lt;T extends BaseBillCo&gt; implements Handl
204 142 * @return {@link List}<{@link T}>
205 143 */
206 144 protected <T extends BaseBillCo> List<T> validDataSync(List<T> ts, Long marketId, String systemCode) {
207   - return ts.stream().filter(t -> isSync(marketId, systemCode, DynamicType.fromCode(t.getSystemDynamicCode()))).collect(Collectors.toList());
  145 + return ts.stream()
  146 + .filter(
  147 + t -> isSync(marketId, systemCode, DynamicType.fromCode(t.getSystemDynamicCode())
  148 + )
  149 + ).collect(Collectors.toList());
208 150 }
209 151  
210 152 /**
... ... @@ -217,25 +159,20 @@ public abstract class AbstractBillHandler&lt;T extends BaseBillCo&gt; implements Handl
217 159 protected void transferDataListWithFeeItem(List<T> ts, Long marketId, String systemCode) {
218 160 ts.forEach(e -> {
219 161 DynamicType dynamicType = DynamicType.fromCode(e.getSystemDynamicCode());
220   - transfer(e, marketId, systemCode);
221   - transferFeeItem(e);
222   - getFilteredDynamicDataSingle(dynamicType, marketId, systemCode).forEach((k, v) -> TRANSFER_FUNCTION_SINGLE_MAP.get(k).transferDynamic(e, v));
223   - getFilteredDynamicDataMulti(dynamicType, marketId, systemCode).forEach((k, v) -> TRANSFER_FUNCTION_MULTI_MAP.get(k).transferDynamic(e, v));
  162 + billTrans.transBillCo(e, marketId, systemCode);
  163 + billTrans.transFeeItem(e.getFEntityDetail());
  164 + getFilteredDynamicDataSingle(dynamicType, marketId, systemCode)
  165 + .forEach((k, v) ->
  166 + TRANSFER_FUNCTION_SINGLE_MAP.get(k).transferDynamic(e, v)
  167 + );
  168 + getFilteredDynamicDataMulti(dynamicType, marketId, systemCode)
  169 + .forEach((k, v) ->
  170 + TRANSFER_FUNCTION_MULTI_MAP.get(k).transferDynamic(e, v)
  171 + );
224 172 });
225 173 }
226 174  
227 175 /**
228   - * 固定转换
229   - *
230   - * @param t t
231   - * @param marketId 市场 ID
232   - * @param systemCode 系统代码
233   - */
234   - protected void transfer(T t, Long marketId, String systemCode) {
235   - trans.transBillCo(t, marketId, systemCode);
236   - }
237   -
238   - /**
239 176 * 传输数据列表
240 177 *
241 178 * @param ts 茨
... ... @@ -245,9 +182,15 @@ public abstract class AbstractBillHandler&lt;T extends BaseBillCo&gt; implements Handl
245 182 protected void transferDataListWithOutFeeItem(List<T> ts, Long marketId, String systemCode) {
246 183 ts.forEach(e -> {
247 184 DynamicType dynamicType = DynamicType.fromCode(e.getSystemDynamicCode());
248   - transfer(e, marketId, systemCode);
249   - getFilteredDynamicDataSingle(dynamicType, marketId, systemCode).forEach((k, v) -> TRANSFER_FUNCTION_SINGLE_MAP.get(k).transferDynamic(e, v));
250   - getFilteredDynamicDataMulti(dynamicType, marketId, systemCode).forEach((k, v) -> TRANSFER_FUNCTION_MULTI_MAP.get(k).transferDynamic(e, v));
  185 + billTrans.transBillCo(e, marketId, systemCode);
  186 + getFilteredDynamicDataSingle(dynamicType, marketId, systemCode)
  187 + .forEach((k, v) ->
  188 + TRANSFER_FUNCTION_SINGLE_MAP.get(k).transferDynamic(e, v)
  189 + );
  190 + getFilteredDynamicDataMulti(dynamicType, marketId, systemCode)
  191 + .forEach((k, v) ->
  192 + TRANSFER_FUNCTION_MULTI_MAP.get(k).transferDynamic(e, v)
  193 + );
251 194 });
252 195 }
253 196  
... ... @@ -280,48 +223,4 @@ public abstract class AbstractBillHandler&lt;T extends BaseBillCo&gt; implements Handl
280 223 }
281 224 }
282 225 }
283   -
284   -
285   - /**
286   - * 获取文档类型
287   - *
288   - * @param marketId 市场 ID
289   - * @param systemCode 系统代码
290   - * @param billTypeId 账单类型 ID
291   - * @return {@link String}
292   - */
293   - private String getDocumentType(Long marketId, String systemCode, String billTypeId) {
294   - var res = transMapper.getMappingDict(BasicEnum.FINANCIAL_BUSINESS_TYPE_TO_LOWER.code, systemCode, marketId, billTypeId);
295   - return ObjectUtils.isEmpty(res) ? null : res.getMapType();
296   - }
297   -
298   - /**
299   - * 转账手续费项目
300   - *
301   - * @param t t
302   - */
303   - protected void transferFeeItem(T t) {
304   - trans.transFeeItem(t.getFEntityDetail());
305   - }
306   -
307   - /**
308   - * 传递函数 Single
309   - *
310   - * @author zhangmeiyang
311   - * @date 2024/11/20
312   - */
313   -
314   -
315   - private IdentifyInfo getIdentifyInfo(Long marketId, String systemCode) {
316   - var identifyInfo = new IdentifyInfo();
317   - ClientDto clientParam = transMapper.getClientParam(systemCode, marketId);
318   - identifyInfo.setAppId(clientParam.getApplyId());
319   - identifyInfo.setUserName(clientParam.getUsername());
320   - identifyInfo.setServerUrl(clientParam.getServiceAddress());
321   - identifyInfo.setAppSecret(clientParam.getSecurityKey());
322   - identifyInfo.setdCID(clientParam.getDataCentreId());
323   - return identifyInfo;
324   - }
325   -
326   -
327 226 }
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/demarcate/AbstractRecHandler.java
... ... @@ -2,22 +2,16 @@ package com.diligrp.etrade.thirdparty.demarcate;
2 2  
3 3 import com.diligrp.etrade.core.util.JsonUtils;
4 4 import com.diligrp.etrade.thirdparty.component.RecTrans;
5   -import com.diligrp.etrade.thirdparty.domain.co.business.BaseBillCo;
6   -import com.diligrp.etrade.thirdparty.domain.co.rec.BaseRecCo;
  5 +import com.diligrp.etrade.thirdparty.domain.co.business.rec.BaseRecCo;
7 6 import com.diligrp.etrade.thirdparty.domain.dto.BusinessDetailDto;
8   -import com.diligrp.etrade.thirdparty.domain.dto.BusinessDto;
9   -import com.diligrp.etrade.thirdparty.domain.dto.ClientDto;
10   -import com.diligrp.etrade.thirdparty.domain.model.FRECEIVEBILLENTRY;
11 7 import com.diligrp.etrade.thirdparty.error.ThirdPartyException;
12   -import com.diligrp.etrade.thirdparty.mapper.TransMapper;
13   -import com.diligrp.etrade.thirdparty.type.*;
  8 +import com.diligrp.etrade.thirdparty.type.BasicEnum;
  9 +import com.diligrp.etrade.thirdparty.type.BillType;
  10 +import com.diligrp.etrade.thirdparty.type.DynamicType;
14 11 import com.diligrp.etrade.thirdparty.utils.ReceiptsOrderApiUtils;
15   -import com.kingdee.bos.webapi.entity.IdentifyInfo;
16 12 import jakarta.annotation.Resource;
17 13 import org.springframework.util.ObjectUtils;
18 14  
19   -import java.math.BigDecimal;
20   -import java.util.ArrayList;
21 15 import java.util.HashMap;
22 16 import java.util.List;
23 17 import java.util.Map;
... ... @@ -28,7 +22,7 @@ import java.util.stream.Collectors;
28 22 * @CreateTime: 2024-11-25 12:53
29 23 * @Version: todo
30 24 */
31   -public abstract class AbstractRecHandler<T extends BaseRecCo> implements Handler {
  25 +public abstract class AbstractRecHandler<T extends BaseRecCo> extends AbstractBaseBillHandler implements Handler {
32 26  
33 27 protected static final Map<String, TransferFunctionSingle<BaseRecCo>> TRANSFER_FUNCTION_SINGLE_MAP = new HashMap<>();
34 28 protected static final Map<String, TransferFunctionMulti<BaseRecCo>> TRANSFER_FUNCTION_MULTI_MAP = new HashMap<>();
... ... @@ -48,8 +42,7 @@ public abstract class AbstractRecHandler&lt;T extends BaseRecCo&gt; implements Handler
48 42  
49 43 @Resource
50 44 protected RecTrans recTrans;
51   - @Resource
52   - protected TransMapper transMapper;
  45 +
53 46  
54 47 /**
55 48 * 转换动态配置部门
... ... @@ -59,7 +52,7 @@ public abstract class AbstractRecHandler&lt;T extends BaseRecCo&gt; implements Handler
59 52 */
60 53 protected static <T extends BaseRecCo> void transferDynamicDept(T t, BusinessDetailDto data) {
61 54 t.getFSALEDEPTID().setFNumber(data.getItemValue());
62   - t.getFRECEIVEBILLENTRY().forEach(e-> e.getFCOSTDEPARTMENTID().setFNUMBER(data.getItemValue()));
  55 + t.getFRECEIVEBILLENTRY().forEach(e -> e.getFCOSTDEPARTMENTID().setFNUMBER(data.getItemValue()));
63 56 }
64 57  
65 58 /**
... ... @@ -126,69 +119,11 @@ public abstract class AbstractRecHandler&lt;T extends BaseRecCo&gt; implements Handler
126 119 t.setFixedBusinessType(data.getItemValue());
127 120 }
128 121  
129   - private static <T extends BaseRecCo> String getAllAmountFor(T e) {
130   - var allAmountFor = BigDecimal.ZERO;
131   - for (FRECEIVEBILLENTRY f : e.getFRECEIVEBILLENTRY()) {
132   - BigDecimal single = f.getFRECTOTALAMOUNTFOR().multiply(f.getFRECTOTALAMOUNTFOR());
133   - allAmountFor = allAmountFor.add(single);
134   - }
135   - return allAmountFor.toString();
136   - }
137   -
138   - /**
139   - * 获取动态数据
140   - *
141   - * @param marketId 市场 ID
142   - * @param systemCode 系统代码
143   - * @param dynamicType 动态型
144   - * @return {@link Map}<{@link String}, {@link BusinessDetailDto}>
145   - */
146   - protected Map<String, BusinessDetailDto> getFilteredDynamicDataSingle(DynamicType dynamicType, Long marketId, String systemCode) {
147   - var queryArrays = new String[]{
148   - BasicEnum.DEPARTMENT_TO_LOWER.code,
149   - BasicEnum.CUSTOMER_TO_LOWER.code,
150   - BasicEnum.FINANCIAL_CHANNEL_TYPE_TO_LOWER.code,
151   - BasicEnum.FINANCIAL_BUSINESS_TYPE_TO_LOWER.code
152   - };
153   - var dynamicParam = transMapper.getFixedWithQueryArrays(systemCode, dynamicType.code, marketId, SelectType.FIXED.getCode(), queryArrays);
154   - Map<String, BusinessDetailDto> map = new HashMap<>();
155   - if (!ObjectUtils.isEmpty(dynamicParam)) {
156   - dynamicParam.forEach(e -> map.computeIfAbsent(e.getCode(), k -> e));
157   - }
158   - return map;
159   - }
160   -
161 122 /**
162   - * 获取动态数据
163   - *
164   - * @param marketId 市场 ID
165   - * @param systemCode 系统代码
166   - * @param dynamicType 动态型
167   - * @return {@link Map}<{@link String}, {@link BusinessDetailDto}>
  123 + * 设置预付款
168 124 */
169   - protected Map<String, List<BusinessDetailDto>> getFilteredDynamicDataMulti(DynamicType dynamicType, Long marketId, String systemCode) {
170   - var queryArrays = new String[]{BasicEnum.CHARGE_ITEM_TO_LOWER.code};
171   - var dynamicParam = transMapper.getFixedWithQueryArrays(systemCode, dynamicType.code, marketId, SelectType.FIXED.getCode(), queryArrays);
172   - Map<String, List<BusinessDetailDto>> map = new HashMap<>();
173   - if (!ObjectUtils.isEmpty(dynamicParam)) {
174   - dynamicParam.forEach(e -> map.computeIfAbsent(e.getCode(), k -> new ArrayList<>()).add(e));
175   - }
176   - return map;
177   - }
178   -
179   - /**
180   - * 是否同步
181   - *
182   - * @param marketId 市场 ID
183   - * @param systemCode 系统代码
184   - * @return boolean
185   - */
186   - protected boolean isSync(Long marketId, String systemCode, DynamicType dynamicType) {
187   - BusinessDto businessConfig = transMapper.getBusinessConfig(systemCode, marketId, dynamicType.code);
188   - if (ObjectUtils.isEmpty(businessConfig)) {
189   - return false;
190   - }
191   - return ObjectUtils.nullSafeEquals(businessConfig.getSyncType(), SyncType.SYNC.code);
  125 + protected static <T extends BaseRecCo> void setUpThePrepayment(List<T> ts) {
  126 + ts.forEach(e-> e.getFRECEIVEBILLENTRY().forEach(f-> f.getFPURPOSEID().setFNumber("SFKYT02_SYS")));
192 127 }
193 128  
194 129 /**
... ... @@ -199,19 +134,12 @@ public abstract class AbstractRecHandler&lt;T extends BaseRecCo&gt; implements Handler
199 134 * @param systemCode 系统代码
200 135 * @return {@link List}<{@link T}>
201 136 */
202   - protected <T extends BaseBillCo> List<T> validDataSync(List<T> ts, Long marketId, String systemCode) {
203   - return ts.stream().filter(t -> isSync(marketId, systemCode, DynamicType.fromCode(t.getSystemDynamicCode()))).collect(Collectors.toList());
204   - }
205   -
206   - /**
207   - * 固定转换
208   - *
209   - * @param t t
210   - * @param marketId 市场 ID
211   - * @param systemCode 系统代码
212   - */
213   - protected void transfer(T t, Long marketId, String systemCode) {
214   - recTrans.transRecCo(t, marketId, systemCode);
  137 + protected <T extends BaseRecCo> List<T> validDataSync(List<T> ts, Long marketId, String systemCode) {
  138 + return ts.stream()
  139 + .filter(
  140 + t -> isSync(marketId, systemCode, DynamicType.fromCode(t.getSystemDynamicCode())
  141 + )
  142 + ).collect(Collectors.toList());
215 143 }
216 144  
217 145 /**
... ... @@ -221,12 +149,19 @@ public abstract class AbstractRecHandler&lt;T extends BaseRecCo&gt; implements Handler
221 149 * @param marketId 市场 ID
222 150 * @param systemCode 系统代码
223 151 */
224   - protected void transferDataListWithOutFeeItem(List<T> ts, Long marketId, String systemCode) {
  152 + protected void transferDataListWithFeeItem(List<T> ts, Long marketId, String systemCode) {
225 153 ts.forEach(e -> {
226 154 DynamicType dynamicType = DynamicType.fromCode(e.getSystemDynamicCode());
227   - transfer(e, marketId, systemCode);
228   - getFilteredDynamicDataSingle(dynamicType, marketId, systemCode).forEach((k, v) -> TRANSFER_FUNCTION_SINGLE_MAP.get(k).transferDynamic(e, v));
229   - getFilteredDynamicDataMulti(dynamicType, marketId, systemCode).forEach((k, v) -> TRANSFER_FUNCTION_MULTI_MAP.get(k).transferDynamic(e, v));
  155 + recTrans.transRecCo(e, marketId, systemCode);
  156 + recTrans.transFeeItem(e.getFRECEIVEBILLENTRY());
  157 + getFilteredDynamicDataSingle(dynamicType, marketId, systemCode)
  158 + .forEach((k, v) ->
  159 + TRANSFER_FUNCTION_SINGLE_MAP.get(k).transferDynamic(e, v)
  160 + );
  161 + getFilteredDynamicDataMulti(dynamicType, marketId, systemCode)
  162 + .forEach((k, v) ->
  163 + TRANSFER_FUNCTION_MULTI_MAP.get(k).transferDynamic(e, v)
  164 + );
230 165 });
231 166 }
232 167  
... ... @@ -261,35 +196,24 @@ public abstract class AbstractRecHandler&lt;T extends BaseRecCo&gt; implements Handler
261 196 }
262 197  
263 198 /**
264   - * 获取文档类型
  199 + * 传输数据列表
265 200 *
  201 + * @param ts 茨
266 202 * @param marketId 市场 ID
267 203 * @param systemCode 系统代码
268   - * @param billTypeId 账单类型 ID
269   - * @return {@link String}
270 204 */
271   - private String getDocumentType(Long marketId, String systemCode, String billTypeId) {
272   - var res = transMapper.getMappingDict(BasicEnum.FINANCIAL_BUSINESS_TYPE_TO_LOWER.code, systemCode, marketId, billTypeId);
273   - return ObjectUtils.isEmpty(res) ? null : res.getMapType();
274   - }
275   -
276   - /**
277   - * 传递函数 Single
278   - *
279   - * @author zhangmeiyang
280   - * @date 2024/11/20
281   - */
282   -
283   -
284   - private IdentifyInfo getIdentifyInfo(Long marketId, String systemCode) {
285   - var identifyInfo = new IdentifyInfo();
286   - ClientDto clientParam = transMapper.getClientParam(systemCode, marketId);
287   - identifyInfo.setAppId(clientParam.getApplyId());
288   - identifyInfo.setUserName(clientParam.getUsername());
289   - identifyInfo.setServerUrl(clientParam.getServiceAddress());
290   - identifyInfo.setAppSecret(clientParam.getSecurityKey());
291   - identifyInfo.setdCID(clientParam.getDataCentreId());
292   - return identifyInfo;
  205 + protected void transferDataListWithOutFeeItem(List<T> ts, Long marketId, String systemCode) {
  206 + ts.forEach(e -> {
  207 + DynamicType dynamicType = DynamicType.fromCode(e.getSystemDynamicCode());
  208 + recTrans.transRecCo(e, marketId, systemCode);
  209 + getFilteredDynamicDataSingle(dynamicType, marketId, systemCode)
  210 + .forEach((k, v) ->
  211 + TRANSFER_FUNCTION_SINGLE_MAP.get(k).transferDynamic(e, v)
  212 + );
  213 + getFilteredDynamicDataMulti(dynamicType, marketId, systemCode)
  214 + .forEach((k, v) ->
  215 + TRANSFER_FUNCTION_MULTI_MAP.get(k).transferDynamic(e, v)
  216 + );
  217 + });
293 218 }
294   -
295 219 }
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/demarcate/AbstractRefundHandler.java 0 → 100644
  1 +package com.diligrp.etrade.thirdparty.demarcate;
  2 +
  3 +import com.diligrp.etrade.core.util.JsonUtils;
  4 +import com.diligrp.etrade.thirdparty.component.RefundTrans;
  5 +import com.diligrp.etrade.thirdparty.domain.co.business.refund.BaseRefundCo;
  6 +import com.diligrp.etrade.thirdparty.domain.dto.BusinessDetailDto;
  7 +import com.diligrp.etrade.thirdparty.error.ThirdPartyException;
  8 +import com.diligrp.etrade.thirdparty.type.BasicEnum;
  9 +import com.diligrp.etrade.thirdparty.type.BillType;
  10 +import com.diligrp.etrade.thirdparty.type.DynamicType;
  11 +import com.diligrp.etrade.thirdparty.utils.ReceiptsOrderApiUtils;
  12 +import jakarta.annotation.Resource;
  13 +import org.springframework.util.ObjectUtils;
  14 +
  15 +import java.util.HashMap;
  16 +import java.util.List;
  17 +import java.util.Map;
  18 +import java.util.stream.Collectors;
  19 +
  20 +/**
  21 + * @Author: zhangmeiyang
  22 + * @CreateTime: 2024-11-28 09:30
  23 + * @Version: todo
  24 + */
  25 +public abstract class AbstractRefundHandler<T extends BaseRefundCo> extends AbstractBaseBillHandler implements Handler {
  26 +
  27 + protected static final Map<String, TransferFunctionSingle<BaseRefundCo>> TRANSFER_FUNCTION_SINGLE_MAP = new HashMap<>();
  28 + protected static final Map<String, TransferFunctionMulti<BaseRefundCo>> TRANSFER_FUNCTION_MULTI_MAP = new HashMap<>();
  29 + protected static final TransferFunctionSingle<BaseRefundCo> DEPT = AbstractRefundHandler::transferDynamicDept;
  30 + protected static final TransferFunctionSingle<BaseRefundCo> CUSTOMER = AbstractRefundHandler::transferDynamicCustomer;
  31 + protected static final TransferFunctionSingle<BaseRefundCo> SETTLE_TYPE = AbstractRefundHandler::transferDynamicSettleType;
  32 + protected static final TransferFunctionSingle<BaseRefundCo> BUSINESS_TYPE = AbstractRefundHandler::transferDynamicBusinessType;
  33 + protected static final TransferFunctionMulti<BaseRefundCo> CHARGE_ITEM = AbstractRefundHandler::transferDynamicChargeItem;
  34 +
  35 + static {
  36 + TRANSFER_FUNCTION_SINGLE_MAP.put(BasicEnum.DEPARTMENT_TO_LOWER.code, DEPT);
  37 + TRANSFER_FUNCTION_SINGLE_MAP.put(BasicEnum.CUSTOMER_TO_LOWER.code, CUSTOMER);
  38 + TRANSFER_FUNCTION_SINGLE_MAP.put(BasicEnum.FINANCIAL_CHANNEL_TYPE_TO_LOWER.code, SETTLE_TYPE);
  39 + TRANSFER_FUNCTION_SINGLE_MAP.put(BasicEnum.FINANCIAL_BUSINESS_TYPE_TO_LOWER.code, BUSINESS_TYPE);
  40 + TRANSFER_FUNCTION_MULTI_MAP.put(BasicEnum.CHARGE_ITEM_TO_LOWER.code, CHARGE_ITEM);
  41 + }
  42 +
  43 + @Resource
  44 + protected RefundTrans refundTrans;
  45 +
  46 + /**
  47 + * 转换动态配置部门
  48 + *
  49 + * @param t t
  50 + * @param data 数据
  51 + */
  52 + protected static <T extends BaseRefundCo> void transferDynamicDept(T t, BusinessDetailDto data) {
  53 + t.getFSALEDEPTID().setFNumber(data.getItemValue());
  54 + t.getFREFUNDBILLENTRY().forEach(e-> e.getFCOSTDEPARTMENTID().setFNUMBER(data.getItemValue()));
  55 + }
  56 +
  57 + /**
  58 + * Transfer Dynamic 客户
  59 + *
  60 + * @param t t
  61 + * @param data 数据
  62 + */
  63 + protected static <T extends BaseRefundCo> void transferDynamicCustomer(T t, BusinessDetailDto data) {
  64 + if (!ObjectUtils.isEmpty(t.getFCONTACTUNIT())) {
  65 + t.getFCONTACTUNIT().setFNumber(data.getItemValue());
  66 + }
  67 + if (!ObjectUtils.isEmpty(t.getFRECTUNIT())) {
  68 + t.getFRECTUNIT().setFNumber(data.getItemValue());
  69 + }
  70 + }
  71 +
  72 + /**
  73 + * 转移动态结算类型
  74 + *
  75 + * @param t t
  76 + * @param data 数据
  77 + */
  78 + protected static <T extends BaseRefundCo> void transferDynamicSettleType(T t, BusinessDetailDto data) {
  79 + t.getFREFUNDBILLENTRY().forEach(e -> e.getFSETTLETYPEID().setFNumber(data.getItemValue()));
  80 + }
  81 +
  82 + /**
  83 + * Transfer Dynamic Charge 项目
  84 + *
  85 + * @param data 数据
  86 + * @param entity 实体
  87 + */
  88 + protected static <T extends BaseRefundCo> void transferDynamicChargeItem(T entity, List<BusinessDetailDto> data) {
  89 + Map<String, String> relationMap = new HashMap<>();
  90 + Map<String, String> codeMap = new HashMap<>();
  91 + for (BusinessDetailDto dto : data) {
  92 + if (!ObjectUtils.isEmpty(dto.getItemRelationId())) {
  93 + relationMap.put(String.valueOf(dto.getItemRelationId()), dto.getItemValue());
  94 + }
  95 + if (!ObjectUtils.isEmpty(dto.getItemCode())) {
  96 + codeMap.put(dto.getItemCode(), dto.getItemValue());
  97 + }
  98 + }
  99 + entity.getFREFUNDBILLENTRY().forEach(e -> {
  100 + if (!ObjectUtils.isEmpty(e.getFCOSTID())) {
  101 + var costId = e.getFCOSTID().getFNUMBER();
  102 + if (relationMap.containsKey(costId)) {
  103 + e.getFCOSTID().setFNUMBER(relationMap.get(costId));
  104 + } else if (codeMap.containsKey(costId)) {
  105 + e.getFCOSTID().setFNUMBER(codeMap.get(costId));
  106 + }
  107 + }
  108 + });
  109 + }
  110 +
  111 + /**
  112 + * Transfer Dynamic 业务类型
  113 + *
  114 + * @param t t
  115 + * @param data 数据
  116 + */
  117 + protected static <T extends BaseRefundCo> void transferDynamicBusinessType(T t, BusinessDetailDto data) {
  118 + t.setFixedBusinessType(data.getItemValue());
  119 + }
  120 +
  121 + /**
  122 + * 设置预付款
  123 + */
  124 + protected static <T extends BaseRefundCo> void setUpThePrepayment(List<T> ts) {
  125 + ts.forEach(e-> e.getFREFUNDBILLENTRY().forEach(f-> f.getFPURPOSEID().setFNumber("SFKYT02_SYS")));
  126 + }
  127 +
  128 + /**
  129 + * 有效数据同步
  130 + *
  131 + * @param ts 茨
  132 + * @param marketId 市场 ID
  133 + * @param systemCode 系统代码
  134 + * @return {@link List}<{@link T}>
  135 + */
  136 + protected <T extends BaseRefundCo> List<T> validDataSync(List<T> ts, Long marketId, String systemCode) {
  137 + return ts.stream()
  138 + .filter(
  139 + t -> isSync(marketId, systemCode, DynamicType.fromCode(t.getSystemDynamicCode())
  140 + )
  141 + ).collect(Collectors.toList());
  142 + }
  143 +
  144 + /**
  145 + * 传输数据列表
  146 + *
  147 + * @param ts 茨
  148 + * @param marketId 市场 ID
  149 + * @param systemCode 系统代码
  150 + */
  151 + protected void transferDataListWithFeeItem(List<T> ts, Long marketId, String systemCode) {
  152 + ts.forEach(e -> {
  153 + DynamicType dynamicType = DynamicType.fromCode(e.getSystemDynamicCode());
  154 + refundTrans.transRefundCo(e, marketId, systemCode);
  155 + refundTrans.transFeeItem(e.getFREFUNDBILLENTRY());
  156 + getFilteredDynamicDataSingle(dynamicType, marketId, systemCode)
  157 + .forEach((k, v) ->
  158 + TRANSFER_FUNCTION_SINGLE_MAP.get(k).transferDynamic(e, v)
  159 + );
  160 + getFilteredDynamicDataMulti(dynamicType, marketId, systemCode)
  161 + .forEach((k, v) ->
  162 + TRANSFER_FUNCTION_MULTI_MAP.get(k).transferDynamic(e, v)
  163 + );
  164 + });
  165 + }
  166 +
  167 + /**
  168 + * 传输数据列表
  169 + *
  170 + * @param ts 茨
  171 + * @param marketId 市场 ID
  172 + * @param systemCode 系统代码
  173 + */
  174 + protected void transferDataListWithOutFeeItem(List<T> ts, Long marketId, String systemCode) {
  175 + ts.forEach(e -> {
  176 + DynamicType dynamicType = DynamicType.fromCode(e.getSystemDynamicCode());
  177 + refundTrans.transRefundCo(e, marketId, systemCode);
  178 + getFilteredDynamicDataSingle(dynamicType, marketId, systemCode)
  179 + .forEach((k, v) ->
  180 + TRANSFER_FUNCTION_SINGLE_MAP.get(k).transferDynamic(e, v)
  181 + );
  182 + getFilteredDynamicDataMulti(dynamicType, marketId, systemCode)
  183 + .forEach((k, v) ->
  184 + TRANSFER_FUNCTION_MULTI_MAP.get(k).transferDynamic(e, v)
  185 + );
  186 + });
  187 + }
  188 +
  189 + /**
  190 + * 发送采购订单
  191 + *
  192 + * @param marketId 市场 ID
  193 + * @param systemCode 系统代码
  194 + * @param ts 茨
  195 + * @throws Exception 例外
  196 + */
  197 + protected void sendPurchaseOrder(List<T> ts, Long marketId, String systemCode) throws Exception {
  198 + var identifyInfo = getIdentifyInfo(marketId, systemCode);
  199 + for (T e : ts) {
  200 + var billId = e.getFBillTypeID().getFNUMBER();
  201 + //获取单据类型
  202 + String documentType = getDocumentType(marketId, systemCode, billId);
  203 + if (ObjectUtils.isEmpty(documentType)) {
  204 + throw new ThirdPartyException("未配置业务映射");
  205 + }
  206 + var fixedBusinessType = e.getFixedBusinessType();
  207 + //业务类型固定的情况下
  208 + if (!ObjectUtils.isEmpty(fixedBusinessType)) {
  209 + e.getFBillTypeID().setFNUMBER(fixedBusinessType);
  210 + }
  211 + var util = new ReceiptsOrderApiUtils(identifyInfo);
  212 + boolean purchaseOrder = util.getReceiptsOrder(e.getFBillTypeID().getFNUMBER(), e.getFREMARK());
  213 + if (purchaseOrder) {
  214 + util.createOnePurchaseOrder(JsonUtils.toJsonString(e), BillType.RECEIPTS.value);
  215 + }
  216 + }
  217 + }
  218 +
  219 +
  220 +}
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/BaseBillCo.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/bill/BaseBillCo.java
1   -package com.diligrp.etrade.thirdparty.domain.co.business;
  1 +package com.diligrp.etrade.thirdparty.domain.co.business.bill;
2 2  
3 3 import com.diligrp.etrade.thirdparty.domain.model.*;
4 4 import com.fasterxml.jackson.annotation.JsonProperty;
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/BusinessBillCo.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/bill/BusinessBillCo.java
1   -package com.diligrp.etrade.thirdparty.domain.co.business;
  1 +package com.diligrp.etrade.thirdparty.domain.co.business.bill;
2 2  
3 3 /**
4 4 * @Author: zhangmeiyang
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/CardBillCo.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/bill/CardBillCo.java
1   -package com.diligrp.etrade.thirdparty.domain.co.business;
  1 +package com.diligrp.etrade.thirdparty.domain.co.business.bill;
2 2  
3 3 /**
4 4 * @Author: zhangmeiyang
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/DepositBillCo.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/bill/DepositBillCo.java
1   -package com.diligrp.etrade.thirdparty.domain.co.business;
  1 +package com.diligrp.etrade.thirdparty.domain.co.business.bill;
2 2  
3 3 /**
4 4 * @Author: zhangmeiyang
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/EntranceFeeBillCo.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/bill/EntranceFeeBillCo.java
1   -package com.diligrp.etrade.thirdparty.domain.co.business;
  1 +package com.diligrp.etrade.thirdparty.domain.co.business.bill;
2 2  
3 3 /**
4 4 * @Author: zhangmeiyang
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/RefrigeratorBillCo.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/bill/RefrigeratorBillCo.java
1   -package com.diligrp.etrade.thirdparty.domain.co.business;
  1 +package com.diligrp.etrade.thirdparty.domain.co.business.bill;
2 2  
3 3 /**
4 4 * @Author: zhangmeiyang
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/SettleBillCo.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/bill/SettleBillCo.java
1   -package com.diligrp.etrade.thirdparty.domain.co.business;
  1 +package com.diligrp.etrade.thirdparty.domain.co.business.bill;
2 2  
3 3 /**
4 4 * @Author: zhangmeiyang
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/WeighingBillCo.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/bill/WeighingBillCo.java
1   -package com.diligrp.etrade.thirdparty.domain.co.business;
  1 +package com.diligrp.etrade.thirdparty.domain.co.business.bill;
2 2  
3 3 /**
4 4 * @Author: zhangmeiyang
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/rec/BaseRecCo.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/rec/BaseRecCo.java
1   -package com.diligrp.etrade.thirdparty.domain.co.rec;
  1 +package com.diligrp.etrade.thirdparty.domain.co.business.rec;
2 2  
3 3 import com.diligrp.etrade.thirdparty.domain.model.*;
4 4 import com.fasterxml.jackson.annotation.JsonProperty;
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/rec/DepositAndWithdrawBillCo.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/rec/DepositBillCo.java
1   -package com.diligrp.etrade.thirdparty.domain.co.rec;
  1 +package com.diligrp.etrade.thirdparty.domain.co.business.rec;
2 2  
3 3 /**
4 4 * @Author: zhangmeiyang
5 5 * @CreateTime: 2024-11-25 09:35
6 6 * @Version: todo
7 7 */
8   -public class DepositAndWithdrawBillCo extends BaseRecCo {
  8 +public class DepositBillCo extends BaseRecCo {
9 9  
10 10 }
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/refund/BaseRefundCo.java 0 → 100644
  1 +package com.diligrp.etrade.thirdparty.domain.co.business.refund;
  2 +
  3 +import com.diligrp.etrade.thirdparty.domain.model.*;
  4 +import com.fasterxml.jackson.annotation.JsonProperty;
  5 +
  6 +import java.io.Serializable;
  7 +import java.util.List;
  8 +
  9 +/**
  10 + * @Author: zhangmeiyang
  11 + * @CreateTime: 2024-11-28 09:11
  12 + * @Version: todo
  13 + */
  14 +public class BaseRefundCo implements Serializable {
  15 + private String systemDynamicCode;
  16 + private String fixedBusinessType;
  17 + private String FREMARK;
  18 + private String FDATE;
  19 + private FSETTLEORGID FSETTLEORGID;
  20 + private FSALEORGID FSALEORGID;
  21 + private FBillTypeID FBillTypeID;
  22 + private FCURRENCYID FCURRENCYID;
  23 + private FSALEDEPTID FSALEDEPTID;
  24 + private FPAYORGID FPAYORGID;
  25 + private FSETTLECUR FSETTLECUR;
  26 + private String FRECTUNITTYPE;
  27 + private FRECTUNIT FRECTUNIT;
  28 + private String FCONTACTUNITTYPE;
  29 + private FCONTACTUNIT FCONTACTUNIT;
  30 + private List<FREFUNDBILLENTRY> FREFUNDBILLENTRY;
  31 +
  32 + @JsonProperty("systemDynamicCode")
  33 + public String getSystemDynamicCode() {
  34 + return systemDynamicCode;
  35 + }
  36 +
  37 + public void setSystemDynamicCode(String systemDynamicCode) {
  38 + this.systemDynamicCode = systemDynamicCode;
  39 + }
  40 +
  41 + @JsonProperty("fixedBusinessType")
  42 + public String getFixedBusinessType() {
  43 + return fixedBusinessType;
  44 + }
  45 +
  46 + public void setFixedBusinessType(String fixedBusinessType) {
  47 + this.fixedBusinessType = fixedBusinessType;
  48 + }
  49 + @JsonProperty("FREMARK")
  50 + public String getFREMARK() {
  51 + return FREMARK;
  52 + }
  53 +
  54 + public void setFREMARK(String FREMARK) {
  55 + this.FREMARK = FREMARK;
  56 + }
  57 + @JsonProperty("FDATE")
  58 + public String getFDATE() {
  59 + return FDATE;
  60 + }
  61 +
  62 + public void setFDATE(String FDATE) {
  63 + this.FDATE = FDATE;
  64 + }
  65 +
  66 + @JsonProperty("FSETTLEORGID")
  67 + public FSETTLEORGID getFSETTLEORGID() {
  68 + return FSETTLEORGID;
  69 + }
  70 +
  71 + public void setFSETTLEORGID(FSETTLEORGID FSETTLEORGID) {
  72 + this.FSETTLEORGID = FSETTLEORGID;
  73 + }
  74 +
  75 + @JsonProperty("FSALEORGID")
  76 + public FSALEORGID getFSALEORGID() {
  77 + return FSALEORGID;
  78 + }
  79 +
  80 + public void setFSALEORGID(FSALEORGID FSALEORGID) {
  81 + this.FSALEORGID = FSALEORGID;
  82 + }
  83 +
  84 + @JsonProperty("FBillTypeID")
  85 + public FBillTypeID getFBillTypeID() {
  86 + return FBillTypeID;
  87 + }
  88 +
  89 + public void setFBillTypeID(FBillTypeID FBillTypeID) {
  90 + this.FBillTypeID = FBillTypeID;
  91 + }
  92 +
  93 + @JsonProperty("FCURRENCYID")
  94 + public FCURRENCYID getFCURRENCYID() {
  95 + return FCURRENCYID;
  96 + }
  97 +
  98 + public void setFCURRENCYID(FCURRENCYID FCURRENCYID) {
  99 + this.FCURRENCYID = FCURRENCYID;
  100 + }
  101 +
  102 + @JsonProperty("FSALEDEPTID")
  103 + public FSALEDEPTID getFSALEDEPTID() {
  104 + return FSALEDEPTID;
  105 + }
  106 +
  107 + public void setFSALEDEPTID(FSALEDEPTID FSALEDEPTID) {
  108 + this.FSALEDEPTID = FSALEDEPTID;
  109 + }
  110 +
  111 + @JsonProperty("FPAYORGID")
  112 + public FPAYORGID getFPAYORGID() {
  113 + return FPAYORGID;
  114 + }
  115 +
  116 + public void setFPAYORGID(FPAYORGID FPAYORGID) {
  117 + this.FPAYORGID = FPAYORGID;
  118 + }
  119 +
  120 + @JsonProperty("FSETTLECUR")
  121 + public FSETTLECUR getFSETTLECUR() {
  122 + return FSETTLECUR;
  123 + }
  124 +
  125 + public void setFSETTLECUR(FSETTLECUR FSETTLECUR) {
  126 + this.FSETTLECUR = FSETTLECUR;
  127 + }
  128 +
  129 + @JsonProperty("FRECTUNITTYPE")
  130 + public String getFRECTUNITTYPE() {
  131 + return FRECTUNITTYPE;
  132 + }
  133 +
  134 + public void setFRECTUNITTYPE(String FRECTUNITTYPE) {
  135 + this.FRECTUNITTYPE = FRECTUNITTYPE;
  136 + }
  137 +
  138 + @JsonProperty("FRECTUNIT")
  139 + public FRECTUNIT getFRECTUNIT() {
  140 + return FRECTUNIT;
  141 + }
  142 +
  143 + public void setFRECTUNIT(FRECTUNIT FRECTUNIT) {
  144 + this.FRECTUNIT = FRECTUNIT;
  145 + }
  146 +
  147 + @JsonProperty("FCONTACTUNITTYPE")
  148 + public String getFCONTACTUNITTYPE() {
  149 + return FCONTACTUNITTYPE;
  150 + }
  151 +
  152 + public void setFCONTACTUNITTYPE(String FCONTACTUNITTYPE) {
  153 + this.FCONTACTUNITTYPE = FCONTACTUNITTYPE;
  154 + }
  155 +
  156 + @JsonProperty("FCONTACTUNIT")
  157 + public FCONTACTUNIT getFCONTACTUNIT() {
  158 + return FCONTACTUNIT;
  159 + }
  160 +
  161 + public void setFCONTACTUNIT(FCONTACTUNIT FCONTACTUNIT) {
  162 + this.FCONTACTUNIT = FCONTACTUNIT;
  163 + }
  164 +
  165 + @JsonProperty("FREFUNDBILLENTRY")
  166 + public List<FREFUNDBILLENTRY> getFREFUNDBILLENTRY() {
  167 + return FREFUNDBILLENTRY;
  168 + }
  169 +
  170 + public void setFREFUNDBILLENTRY(List<FREFUNDBILLENTRY> FREFUNDBILLENTRY) {
  171 + this.FREFUNDBILLENTRY = FREFUNDBILLENTRY;
  172 + }
  173 +}
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/refund/RefundBillCo.java 0 → 100644
  1 +package com.diligrp.etrade.thirdparty.domain.co.business.refund;
  2 +
  3 +/**
  4 + * @Author: zhangmeiyang
  5 + * @CreateTime: 2024-11-28 09:13
  6 + * @Version: todo
  7 + */
  8 +public class RefundBillCo extends BaseRefundCo{
  9 +}
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/model/FRECTUNIT.java 0 → 100644
  1 +package com.diligrp.etrade.thirdparty.domain.model;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonProperty;
  4 +
  5 +/**
  6 + * @Author: zhangmeiyang
  7 + * @CreateTime: 2024-11-25 15:27
  8 + * @Version: todo
  9 + */
  10 +public class FRECTUNIT {
  11 +
  12 + private String FNumber;
  13 +
  14 + @JsonProperty("FNumber")
  15 + public String getFNumber() {
  16 + return FNumber;
  17 + }
  18 +
  19 + public void setFNumber(String FNumber) {
  20 + this.FNumber = FNumber;
  21 + }
  22 +}
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/model/FREFUNDBILLENTRY.java 0 → 100644
  1 +package com.diligrp.etrade.thirdparty.domain.model;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonProperty;
  4 +
  5 +import java.math.BigDecimal;
  6 +
  7 +/**
  8 + * @Author: zhangmeiyang
  9 + * @CreateTime: 2024-11-28 09:13
  10 + * @Version: todo
  11 + */
  12 +public class FREFUNDBILLENTRY {
  13 + private FCOSTID FCOSTID;
  14 + private FSETTLETYPE FSETTLETYPEID;
  15 + private BigDecimal FREFUNDAMOUNTFOR;
  16 + private String FNOTE;
  17 + private FPURPOSEID FPURPOSEID;
  18 + private FACCOUNTID FACCOUNTID;
  19 + private FCOSTDEPARTMENTID FCOSTDEPARTMENTID;
  20 +
  21 + @JsonProperty("FCOSTID")
  22 + public FCOSTID getFCOSTID() {
  23 + return FCOSTID;
  24 + }
  25 +
  26 + public void setFCOSTID(FCOSTID FCOSTID) {
  27 + this.FCOSTID = FCOSTID;
  28 + }
  29 +
  30 + @JsonProperty("FSETTLETYPEID")
  31 + public FSETTLETYPE getFSETTLETYPEID() {
  32 + return FSETTLETYPEID;
  33 + }
  34 +
  35 + public void setFSETTLETYPEID(FSETTLETYPE FSETTLETYPEID) {
  36 + this.FSETTLETYPEID = FSETTLETYPEID;
  37 + }
  38 +
  39 + @JsonProperty("FREFUNDAMOUNTFOR")
  40 + public BigDecimal getFREFUNDAMOUNTFOR() {
  41 + return FREFUNDAMOUNTFOR;
  42 + }
  43 +
  44 + public void setFREFUNDAMOUNTFOR(BigDecimal FREFUNDAMOUNTFOR) {
  45 + this.FREFUNDAMOUNTFOR = FREFUNDAMOUNTFOR;
  46 + }
  47 +
  48 + @JsonProperty("getFNOTE")
  49 + public String getFNOTE() {
  50 + return FNOTE;
  51 + }
  52 +
  53 + public void setFNOTE(String FNOTE) {
  54 + this.FNOTE = FNOTE;
  55 + }
  56 +
  57 + @JsonProperty("FPURPOSEID")
  58 + public FPURPOSEID getFPURPOSEID() {
  59 + return FPURPOSEID;
  60 + }
  61 +
  62 + public void setFPURPOSEID(FPURPOSEID FPURPOSEID) {
  63 + this.FPURPOSEID = FPURPOSEID;
  64 + }
  65 +
  66 + @JsonProperty("FACCOUNTID")
  67 + public FACCOUNTID getFACCOUNTID() {
  68 + return FACCOUNTID;
  69 + }
  70 +
  71 + public void setFACCOUNTID(FACCOUNTID FACCOUNTID) {
  72 + this.FACCOUNTID = FACCOUNTID;
  73 + }
  74 +
  75 + @JsonProperty("FCOSTDEPARTMENTID")
  76 + public FCOSTDEPARTMENTID getFCOSTDEPARTMENTID() {
  77 + return FCOSTDEPARTMENTID;
  78 + }
  79 +
  80 + public void setFCOSTDEPARTMENTID(FCOSTDEPARTMENTID FCOSTDEPARTMENTID) {
  81 + this.FCOSTDEPARTMENTID = FCOSTDEPARTMENTID;
  82 + }
  83 +}
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/model/FSETTLECUR.java 0 → 100644
  1 +package com.diligrp.etrade.thirdparty.domain.model;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonProperty;
  4 +
  5 +/**
  6 + * @Author: zhangmeiyang
  7 + * @CreateTime: 2024-10-10 10:04
  8 + * @Version: todo
  9 + */
  10 +public class FSETTLECUR {
  11 + private String FNUMBER;
  12 +
  13 + @JsonProperty("FNUMBER")
  14 + public String getFNUMBER() {
  15 + return FNUMBER;
  16 + }
  17 +
  18 + public void setFNUMBER(String FNUMBER) {
  19 + this.FNUMBER = FNUMBER;
  20 + }
  21 +}
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/demarcate/AbstractReceiver.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/exec/AbstractReceiver.java
1   -package com.diligrp.etrade.thirdparty.demarcate;
  1 +package com.diligrp.etrade.thirdparty.exec;
2 2  
3 3 import com.diligrp.etrade.thirdparty.error.ErrorCo;
4 4 import com.diligrp.etrade.thirdparty.mapper.RecordMapper;
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/exec/basic/BasicReceiver.java
1 1 package com.diligrp.etrade.thirdparty.exec.basic;
2 2  
3 3 import com.diligrp.etrade.core.util.JsonUtils;
4   -import com.diligrp.etrade.thirdparty.demarcate.AbstractReceiver;
  4 +import com.diligrp.etrade.thirdparty.exec.AbstractReceiver;
5 5 import com.diligrp.etrade.thirdparty.exec.Holder;
6 6 import com.diligrp.etrade.thirdparty.message.GeneralMessage;
7 7 import com.rabbitmq.client.Channel;
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/exec/business/BusinessReceiver.java
1 1 package com.diligrp.etrade.thirdparty.exec.business;
2 2  
3 3 import com.diligrp.etrade.core.util.JsonUtils;
4   -import com.diligrp.etrade.thirdparty.demarcate.AbstractReceiver;
  4 +import com.diligrp.etrade.thirdparty.exec.AbstractReceiver;
5 5 import com.diligrp.etrade.thirdparty.exec.Holder;
6 6 import com.diligrp.etrade.thirdparty.message.GeneralMessage;
7 7 import com.rabbitmq.client.Channel;
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/BusinessBillHandler.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/bill/BusinessBillHandler.java
1   -package com.diligrp.etrade.thirdparty.handler.business;
  1 +package com.diligrp.etrade.thirdparty.handler.business.bill;
2 2  
3 3 import com.diligrp.etrade.core.util.JsonUtils;
4 4 import com.diligrp.etrade.thirdparty.demarcate.AbstractBillHandler;
5   -import com.diligrp.etrade.thirdparty.domain.co.business.BusinessBillCo;
  5 +import com.diligrp.etrade.thirdparty.domain.co.business.bill.BusinessBillCo;
6 6 import com.diligrp.etrade.thirdparty.type.BusinessEnum;
7 7 import com.fasterxml.jackson.core.type.TypeReference;
8 8 import org.springframework.stereotype.Component;
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/CardBillHandler.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/bill/CardBillHandler.java
1   -package com.diligrp.etrade.thirdparty.handler.business;
  1 +package com.diligrp.etrade.thirdparty.handler.business.bill;
2 2  
3 3 import com.diligrp.etrade.core.util.JsonUtils;
4 4 import com.diligrp.etrade.thirdparty.demarcate.AbstractBillHandler;
5   -import com.diligrp.etrade.thirdparty.domain.co.business.CardBillCo;
  5 +import com.diligrp.etrade.thirdparty.domain.co.business.bill.CardBillCo;
6 6 import com.diligrp.etrade.thirdparty.type.BusinessEnum;
7 7 import com.diligrp.etrade.thirdparty.type.ProcessType;
8 8 import com.fasterxml.jackson.core.type.TypeReference;
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/DepositBillHandler.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/bill/DepositBillHandler.java
1   -package com.diligrp.etrade.thirdparty.handler.business;
  1 +package com.diligrp.etrade.thirdparty.handler.business.bill;
2 2  
3 3 import com.diligrp.etrade.core.util.JsonUtils;
4 4 import com.diligrp.etrade.thirdparty.demarcate.AbstractBillHandler;
5   -import com.diligrp.etrade.thirdparty.domain.co.business.DepositBillCo;
  5 +import com.diligrp.etrade.thirdparty.domain.co.business.bill.DepositBillCo;
6 6 import com.diligrp.etrade.thirdparty.type.BusinessEnum;
7 7 import com.fasterxml.jackson.core.type.TypeReference;
8 8 import org.springframework.stereotype.Component;
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/EntranceFeeBillHandler.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/bill/EntranceFeeBillHandler.java
1   -package com.diligrp.etrade.thirdparty.handler.business;
  1 +package com.diligrp.etrade.thirdparty.handler.business.bill;
2 2  
3 3 import com.diligrp.etrade.core.util.JsonUtils;
4 4 import com.diligrp.etrade.thirdparty.demarcate.AbstractBillHandler;
5   -import com.diligrp.etrade.thirdparty.domain.co.business.EntranceFeeBillCo;
  5 +import com.diligrp.etrade.thirdparty.domain.co.business.bill.EntranceFeeBillCo;
6 6 import com.diligrp.etrade.thirdparty.type.BusinessEnum;
7 7 import com.fasterxml.jackson.core.type.TypeReference;
8 8 import org.springframework.stereotype.Component;
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/RefrigeratorBillHandler.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/bill/RefrigeratorBillHandler.java
1   -package com.diligrp.etrade.thirdparty.handler.business;
  1 +package com.diligrp.etrade.thirdparty.handler.business.bill;
2 2  
3 3 import com.diligrp.etrade.core.util.JsonUtils;
4 4 import com.diligrp.etrade.thirdparty.demarcate.AbstractBillHandler;
5   -import com.diligrp.etrade.thirdparty.domain.co.business.RefrigeratorBillCo;
  5 +import com.diligrp.etrade.thirdparty.domain.co.business.bill.RefrigeratorBillCo;
6 6 import com.diligrp.etrade.thirdparty.type.BusinessEnum;
7 7 import com.fasterxml.jackson.core.type.TypeReference;
8 8 import org.springframework.stereotype.Component;
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/SettleBillHandler.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/bill/SettleBillHandler.java
1   -package com.diligrp.etrade.thirdparty.handler.business;
  1 +package com.diligrp.etrade.thirdparty.handler.business.bill;
2 2  
3 3 import com.diligrp.etrade.core.util.JsonUtils;
4 4 import com.diligrp.etrade.thirdparty.demarcate.AbstractBillHandler;
5   -import com.diligrp.etrade.thirdparty.domain.co.business.SettleBillCo;
  5 +import com.diligrp.etrade.thirdparty.domain.co.business.bill.SettleBillCo;
6 6 import com.diligrp.etrade.thirdparty.type.BusinessEnum;
7 7 import com.fasterxml.jackson.core.type.TypeReference;
8 8 import org.springframework.stereotype.Component;
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/WeighingBillHandler.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/bill/WeighingBillHandler.java
1   -package com.diligrp.etrade.thirdparty.handler.business;
  1 +package com.diligrp.etrade.thirdparty.handler.business.bill;
2 2  
3 3 import com.diligrp.etrade.core.util.JsonUtils;
4 4 import com.diligrp.etrade.thirdparty.demarcate.AbstractBillHandler;
5   -import com.diligrp.etrade.thirdparty.domain.co.business.WeighingBillCo;
  5 +import com.diligrp.etrade.thirdparty.domain.co.business.bill.WeighingBillCo;
6 6 import com.diligrp.etrade.thirdparty.type.BusinessEnum;
7 7 import com.fasterxml.jackson.core.type.TypeReference;
8 8 import org.springframework.stereotype.Component;
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/rec/DepositAndWithdrawRecHandler.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/rec/DepositRecHandler.java
1   -package com.diligrp.etrade.thirdparty.handler.rec;
  1 +package com.diligrp.etrade.thirdparty.handler.business.rec;
2 2  
3 3 import com.diligrp.etrade.core.util.JsonUtils;
4 4 import com.diligrp.etrade.thirdparty.demarcate.AbstractRecHandler;
5   -import com.diligrp.etrade.thirdparty.domain.co.rec.DepositAndWithdrawBillCo;
  5 +import com.diligrp.etrade.thirdparty.domain.co.business.rec.DepositBillCo;
6 6 import com.diligrp.etrade.thirdparty.type.BusinessEnum;
7 7 import com.fasterxml.jackson.core.type.TypeReference;
8 8 import org.springframework.stereotype.Component;
... ... @@ -15,23 +15,14 @@ import java.util.List;
15 15 * @Version: todo
16 16 */
17 17 @Component
18   -public class DepositAndWithdrawRecHandler extends AbstractRecHandler<DepositAndWithdrawBillCo> {
19   - private static void defaultSettings(List<DepositAndWithdrawBillCo> depositAndWithdrawBillCos) {
20   - depositAndWithdrawBillCos.forEach(e->{
21   - e.setFCONTACTUNITTYPE("BD_Customer");
22   - e.setFPAYUNITTYPE("BD_Customer");
23   - e.getFRECEIVEBILLENTRY().forEach(f->{
24   - f.getFPURPOSEID().setFNumber("SFKYT02_SYS");
25   - });
26   - });
27   - }
  18 +public class DepositRecHandler extends AbstractRecHandler<DepositBillCo> {
28 19  
29 20 @Override
30 21 public void handle(String json, Long marketId, String systemCode) throws Exception {
31   - List<DepositAndWithdrawBillCo> depositAndWithdrawBillCos = JsonUtils.fromJsonString(json, new TypeReference<>() {});
32   - transferDataListWithOutFeeItem(depositAndWithdrawBillCos, marketId, systemCode);
33   - defaultSettings(depositAndWithdrawBillCos);
34   - sendPurchaseOrder(depositAndWithdrawBillCos, marketId, systemCode);
  22 + List<DepositBillCo> depositBillCos = JsonUtils.fromJsonString(json, new TypeReference<>() {});
  23 + transferDataListWithOutFeeItem(depositBillCos, marketId, systemCode);
  24 + setUpThePrepayment(depositBillCos);
  25 + sendPurchaseOrder(depositBillCos, marketId, systemCode);
35 26 }
36 27  
37 28 @Override
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/refund/PayoutsRefundHandler.java 0 → 100644
  1 +package com.diligrp.etrade.thirdparty.handler.business.refund;
  2 +
  3 +import com.diligrp.etrade.core.util.JsonUtils;
  4 +import com.diligrp.etrade.thirdparty.demarcate.AbstractRefundHandler;
  5 +import com.diligrp.etrade.thirdparty.domain.co.business.refund.RefundBillCo;
  6 +import com.diligrp.etrade.thirdparty.type.BusinessEnum;
  7 +import com.fasterxml.jackson.core.type.TypeReference;
  8 +import org.springframework.stereotype.Component;
  9 +
  10 +import java.util.List;
  11 +
  12 +/**
  13 + * @Author: zhangmeiyang
  14 + * @CreateTime: 2024-11-28 09:32
  15 + * @Version: todo
  16 + */
  17 +@Component
  18 +public class PayoutsRefundHandler extends AbstractRefundHandler<RefundBillCo> {
  19 + @Override
  20 + public void handle(String json, Long marketId, String systemCode) throws Exception {
  21 + List<RefundBillCo> refundBillCos = JsonUtils.fromJsonString(json, new TypeReference<>() {});
  22 + transferDataListWithOutFeeItem(refundBillCos, marketId, systemCode);
  23 + sendPurchaseOrder(refundBillCos, marketId, systemCode);
  24 + }
  25 +
  26 + @Override
  27 + public BusinessEnum getType() {
  28 + return BusinessEnum.PAYOUTS;
  29 + }
  30 +}
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/type/BusinessEnum.java
... ... @@ -14,7 +14,8 @@ public enum BusinessEnum {
14 14 WEIGHING("WEIGHING"),
15 15 BILL("BILL"),
16 16 DEPOSIT("DEPOSIT"),
17   - DEPOSIT_AND_WITHDRAW("DEPOSIT_AND_WITHDRAW");
  17 + DEPOSIT_AND_WITHDRAW("DEPOSIT_AND_WITHDRAW"),
  18 + PAYOUTS("PAYOUTS");
18 19 public final String code;
19 20  
20 21 BusinessEnum(String code) {
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/utils/ReceiptsRefundOrderApiUtils.java
... ... @@ -24,10 +24,10 @@ public class ReceiptsRefundOrderApiUtils extends BaseApiUtils {
24 24 super(identifyInfo);
25 25 }
26 26  
27   - public boolean getReceiptsRefundOrder(String FBillTypeID, String F_ZDB_text1,String allAmountFor,String F_ZDB_Text667 ) throws Exception {
  27 + public boolean getReceiptsRefundOrder(String FBillTypeID,String remark) throws Exception {
28 28 String FilterString = """
29   - FBillTypeID.FNumber = '%s' and F_ZDB_text1 ='%s' and FALLAMOUNTFOR = '%s' and F_ZDB_Text667 = '%s'
30   - """.formatted(FBillTypeID, F_ZDB_text1,allAmountFor,F_ZDB_Text667);
  29 + FBillTypeID.FNumber = '%s' FREMARK = '%s';
  30 + """.formatted(FBillTypeID,remark);
31 31 var query = new GeneralQueryMessage();
32 32 query.setFilterString(FilterString);
33 33 query.setFieldKeys("FID");
... ...