Commit eff721ca034fff241508547ce0ef2a4651efe136
1 parent
e4d974f6
增加结算收款单
Showing
17 changed files
with
186 additions
and
52 deletions
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/demarcate/AbstractBaseBillHandler.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/demarcate/AbstractBaseHandler.java
@@ -4,10 +4,7 @@ import com.diligrp.etrade.thirdparty.domain.dto.BusinessDetailDto; | @@ -4,10 +4,7 @@ import com.diligrp.etrade.thirdparty.domain.dto.BusinessDetailDto; | ||
4 | import com.diligrp.etrade.thirdparty.domain.dto.BusinessDto; | 4 | import com.diligrp.etrade.thirdparty.domain.dto.BusinessDto; |
5 | import com.diligrp.etrade.thirdparty.domain.dto.ClientDto; | 5 | import com.diligrp.etrade.thirdparty.domain.dto.ClientDto; |
6 | import com.diligrp.etrade.thirdparty.mapper.TransMapper; | 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; | 7 | +import com.diligrp.etrade.thirdparty.type.*; |
11 | import com.kingdee.bos.webapi.entity.IdentifyInfo; | 8 | import com.kingdee.bos.webapi.entity.IdentifyInfo; |
12 | import jakarta.annotation.Resource; | 9 | import jakarta.annotation.Resource; |
13 | import org.springframework.util.ObjectUtils; | 10 | import org.springframework.util.ObjectUtils; |
@@ -22,11 +19,14 @@ import java.util.Map; | @@ -22,11 +19,14 @@ import java.util.Map; | ||
22 | * @CreateTime: 2024-11-28 09:18 | 19 | * @CreateTime: 2024-11-28 09:18 |
23 | * @Version: todo | 20 | * @Version: todo |
24 | */ | 21 | */ |
25 | -public abstract class AbstractBaseBillHandler { | 22 | +public abstract class AbstractBaseHandler { |
26 | 23 | ||
27 | @Resource | 24 | @Resource |
28 | protected TransMapper transMapper; | 25 | protected TransMapper transMapper; |
29 | 26 | ||
27 | + | ||
28 | + protected abstract BillType getDocumentType(); | ||
29 | + | ||
30 | /** | 30 | /** |
31 | * 获取动态数据 | 31 | * 获取动态数据 |
32 | * | 32 | * |
@@ -42,7 +42,7 @@ public abstract class AbstractBaseBillHandler { | @@ -42,7 +42,7 @@ public abstract class AbstractBaseBillHandler { | ||
42 | BasicEnum.FINANCIAL_CHANNEL_TYPE_TO_LOWER.code, | 42 | BasicEnum.FINANCIAL_CHANNEL_TYPE_TO_LOWER.code, |
43 | BasicEnum.FINANCIAL_BUSINESS_TYPE_TO_LOWER.code | 43 | BasicEnum.FINANCIAL_BUSINESS_TYPE_TO_LOWER.code |
44 | }; | 44 | }; |
45 | - var dynamicParam = transMapper.getFixedWithQueryArrays(systemCode, dynamicType.code, marketId, SelectType.FIXED.getCode(), queryArrays); | 45 | + var dynamicParam = transMapper.getFixedWithQueryArrays(getDocumentType().sign,systemCode, dynamicType.code, marketId, SelectType.FIXED.getCode(), queryArrays); |
46 | Map<String, BusinessDetailDto> map = new HashMap<>(); | 46 | Map<String, BusinessDetailDto> map = new HashMap<>(); |
47 | if (!ObjectUtils.isEmpty(dynamicParam)) { | 47 | if (!ObjectUtils.isEmpty(dynamicParam)) { |
48 | dynamicParam.forEach(e -> map.computeIfAbsent(e.getCode(), k -> e)); | 48 | dynamicParam.forEach(e -> map.computeIfAbsent(e.getCode(), k -> e)); |
@@ -61,7 +61,7 @@ public abstract class AbstractBaseBillHandler { | @@ -61,7 +61,7 @@ public abstract class AbstractBaseBillHandler { | ||
61 | */ | 61 | */ |
62 | protected Map<String, List<BusinessDetailDto>> getFilteredDynamicDataMulti(DynamicType dynamicType, Long marketId, String systemCode) { | 62 | protected Map<String, List<BusinessDetailDto>> getFilteredDynamicDataMulti(DynamicType dynamicType, Long marketId, String systemCode) { |
63 | var queryArrays = new String[]{BasicEnum.CHARGE_ITEM_TO_LOWER.code}; | 63 | var queryArrays = new String[]{BasicEnum.CHARGE_ITEM_TO_LOWER.code}; |
64 | - var dynamicParam = transMapper.getFixedWithQueryArrays(systemCode, dynamicType.code, marketId, SelectType.FIXED.getCode(), queryArrays); | 64 | + var dynamicParam = transMapper.getFixedWithQueryArrays(getDocumentType().sign,systemCode, dynamicType.code, marketId, SelectType.FIXED.getCode(), queryArrays); |
65 | Map<String, List<BusinessDetailDto>> map = new HashMap<>(); | 65 | Map<String, List<BusinessDetailDto>> map = new HashMap<>(); |
66 | if (!ObjectUtils.isEmpty(dynamicParam)) { | 66 | if (!ObjectUtils.isEmpty(dynamicParam)) { |
67 | dynamicParam.forEach(e -> map.computeIfAbsent(e.getCode(), k -> new ArrayList<>()).add(e)); | 67 | dynamicParam.forEach(e -> map.computeIfAbsent(e.getCode(), k -> new ArrayList<>()).add(e)); |
@@ -86,19 +86,6 @@ public abstract class AbstractBaseBillHandler { | @@ -86,19 +86,6 @@ public abstract class AbstractBaseBillHandler { | ||
86 | } | 86 | } |
87 | 87 | ||
88 | /** | 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 | * 获取身份信息 | 89 | * 获取身份信息 |
103 | * | 90 | * |
104 | * @param marketId 市场 ID | 91 | * @param marketId 市场 ID |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/demarcate/AbstractBillHandler.java
@@ -24,10 +24,7 @@ import java.util.stream.Collectors; | @@ -24,10 +24,7 @@ import java.util.stream.Collectors; | ||
24 | * @author zhangmeiyang | 24 | * @author zhangmeiyang |
25 | * @date 2024/09/26 | 25 | * @date 2024/09/26 |
26 | */ | 26 | */ |
27 | -public abstract class AbstractBillHandler<T extends BaseBillCo> extends AbstractBaseBillHandler implements Handler { | ||
28 | - | ||
29 | - @Resource | ||
30 | - protected BillTrans billTrans; | 27 | +public abstract class AbstractBillHandler<T extends BaseBillCo> extends AbstractBaseHandler implements Handler { |
31 | 28 | ||
32 | protected static final Map<String, TransferFunctionSingle<BaseBillCo>> TRANSFER_FUNCTION_SINGLE_MAP = new HashMap<>(); | 29 | protected static final Map<String, TransferFunctionSingle<BaseBillCo>> TRANSFER_FUNCTION_SINGLE_MAP = new HashMap<>(); |
33 | protected static final Map<String, TransferFunctionMulti<BaseBillCo>> TRANSFER_FUNCTION_MULTI_MAP = new HashMap<>(); | 30 | protected static final Map<String, TransferFunctionMulti<BaseBillCo>> TRANSFER_FUNCTION_MULTI_MAP = new HashMap<>(); |
@@ -45,6 +42,14 @@ public abstract class AbstractBillHandler<T extends BaseBillCo> extends Abstract | @@ -45,6 +42,14 @@ public abstract class AbstractBillHandler<T extends BaseBillCo> extends Abstract | ||
45 | TRANSFER_FUNCTION_MULTI_MAP.put(BasicEnum.CHARGE_ITEM_TO_LOWER.code, CHARGE_ITEM); | 42 | TRANSFER_FUNCTION_MULTI_MAP.put(BasicEnum.CHARGE_ITEM_TO_LOWER.code, CHARGE_ITEM); |
46 | } | 43 | } |
47 | 44 | ||
45 | + @Resource | ||
46 | + protected BillTrans billTrans; | ||
47 | + | ||
48 | + @Override | ||
49 | + protected BillType getDocumentType() { | ||
50 | + return BillType.RECEIVABLES; | ||
51 | + } | ||
52 | + | ||
48 | /** | 53 | /** |
49 | * 转移动态结算类型 | 54 | * 转移动态结算类型 |
50 | * | 55 | * |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/demarcate/AbstractRecHandler.java
@@ -21,7 +21,7 @@ import java.util.stream.Collectors; | @@ -21,7 +21,7 @@ import java.util.stream.Collectors; | ||
21 | * @CreateTime: 2024-11-25 12:53 | 21 | * @CreateTime: 2024-11-25 12:53 |
22 | * @Version: todo | 22 | * @Version: todo |
23 | */ | 23 | */ |
24 | -public abstract class AbstractRecHandler<T extends BaseRecCo> extends AbstractBaseBillHandler implements Handler { | 24 | +public abstract class AbstractRecHandler<T extends BaseRecCo> extends AbstractBaseHandler implements Handler { |
25 | 25 | ||
26 | protected static final Map<String, TransferFunctionSingle<BaseRecCo>> TRANSFER_FUNCTION_SINGLE_MAP = new HashMap<>(); | 26 | protected static final Map<String, TransferFunctionSingle<BaseRecCo>> TRANSFER_FUNCTION_SINGLE_MAP = new HashMap<>(); |
27 | protected static final Map<String, TransferFunctionMulti<BaseRecCo>> TRANSFER_FUNCTION_MULTI_MAP = new HashMap<>(); | 27 | protected static final Map<String, TransferFunctionMulti<BaseRecCo>> TRANSFER_FUNCTION_MULTI_MAP = new HashMap<>(); |
@@ -43,6 +43,11 @@ public abstract class AbstractRecHandler<T extends BaseRecCo> extends AbstractBa | @@ -43,6 +43,11 @@ public abstract class AbstractRecHandler<T extends BaseRecCo> extends AbstractBa | ||
43 | protected RecTrans recTrans; | 43 | protected RecTrans recTrans; |
44 | 44 | ||
45 | 45 | ||
46 | + @Override | ||
47 | + protected BillType getDocumentType() { | ||
48 | + return BillType.RECEIPTS; | ||
49 | + } | ||
50 | + | ||
46 | /** | 51 | /** |
47 | * 转换动态配置部门 | 52 | * 转换动态配置部门 |
48 | * | 53 | * |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/demarcate/AbstractRefundHandler.java
@@ -21,7 +21,7 @@ import java.util.stream.Collectors; | @@ -21,7 +21,7 @@ import java.util.stream.Collectors; | ||
21 | * @CreateTime: 2024-11-28 09:30 | 21 | * @CreateTime: 2024-11-28 09:30 |
22 | * @Version: todo | 22 | * @Version: todo |
23 | */ | 23 | */ |
24 | -public abstract class AbstractRefundHandler<T extends BaseRefundCo> extends AbstractBaseBillHandler implements Handler { | 24 | +public abstract class AbstractRefundHandler<T extends BaseRefundCo> extends AbstractBaseHandler implements Handler { |
25 | 25 | ||
26 | protected static final Map<String, TransferFunctionSingle<BaseRefundCo>> TRANSFER_FUNCTION_SINGLE_MAP = new HashMap<>(); | 26 | protected static final Map<String, TransferFunctionSingle<BaseRefundCo>> TRANSFER_FUNCTION_SINGLE_MAP = new HashMap<>(); |
27 | protected static final Map<String, TransferFunctionMulti<BaseRefundCo>> TRANSFER_FUNCTION_MULTI_MAP = new HashMap<>(); | 27 | protected static final Map<String, TransferFunctionMulti<BaseRefundCo>> TRANSFER_FUNCTION_MULTI_MAP = new HashMap<>(); |
@@ -42,6 +42,11 @@ public abstract class AbstractRefundHandler<T extends BaseRefundCo> extends Abst | @@ -42,6 +42,11 @@ public abstract class AbstractRefundHandler<T extends BaseRefundCo> extends Abst | ||
42 | @Resource | 42 | @Resource |
43 | protected RefundTrans refundTrans; | 43 | protected RefundTrans refundTrans; |
44 | 44 | ||
45 | + @Override | ||
46 | + protected BillType getDocumentType() { | ||
47 | + return BillType.RECEIPT_AND_REFUND_FORM; | ||
48 | + } | ||
49 | + | ||
45 | /** | 50 | /** |
46 | * 转换动态配置部门 | 51 | * 转换动态配置部门 |
47 | * | 52 | * |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/rec/DepositBillCo.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/rec/CardRecCo.java
@@ -5,6 +5,6 @@ package com.diligrp.etrade.thirdparty.domain.co.business.rec; | @@ -5,6 +5,6 @@ package com.diligrp.etrade.thirdparty.domain.co.business.rec; | ||
5 | * @CreateTime: 2024-11-25 09:35 | 5 | * @CreateTime: 2024-11-25 09:35 |
6 | * @Version: todo | 6 | * @Version: todo |
7 | */ | 7 | */ |
8 | -public class DepositBillCo extends BaseRecCo { | 8 | +public class CardRecCo extends BaseRecCo { |
9 | 9 | ||
10 | } | 10 | } |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/rec/DepositRecCo.java
0 → 100644
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/rec/RefrigeratorRecCo.java
0 → 100644
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/rec/SettleRecCo.java
0 → 100644
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/refund/RefundBillCo.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/refund/CardRefundCo.java
@@ -5,5 +5,5 @@ package com.diligrp.etrade.thirdparty.domain.co.business.refund; | @@ -5,5 +5,5 @@ package com.diligrp.etrade.thirdparty.domain.co.business.refund; | ||
5 | * @CreateTime: 2024-11-28 09:13 | 5 | * @CreateTime: 2024-11-28 09:13 |
6 | * @Version: todo | 6 | * @Version: todo |
7 | */ | 7 | */ |
8 | -public class RefundBillCo extends BaseRefundCo{ | 8 | +public class CardRefundCo extends BaseRefundCo{ |
9 | } | 9 | } |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/rec/CardRecHandler.java
0 → 100644
1 | +package com.diligrp.etrade.thirdparty.handler.business.rec; | ||
2 | + | ||
3 | +import com.diligrp.etrade.core.util.JsonUtils; | ||
4 | +import com.diligrp.etrade.thirdparty.demarcate.AbstractRecHandler; | ||
5 | +import com.diligrp.etrade.thirdparty.domain.co.business.rec.CardRecCo; | ||
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-25 09:34 | ||
15 | + * @Version: todo | ||
16 | + */ | ||
17 | +@Component | ||
18 | +public class CardRecHandler extends AbstractRecHandler<CardRecCo> { | ||
19 | + | ||
20 | + @Override | ||
21 | + public void handle(String json, Long marketId, String systemCode) throws Exception { | ||
22 | + List<CardRecCo> cardRecCos = JsonUtils.fromJsonString(json, new TypeReference<>() {}); | ||
23 | + transferDataListWithOutFeeItem(cardRecCos, marketId, systemCode); | ||
24 | + sendPurchaseOrder(cardRecCos, marketId, systemCode); | ||
25 | + } | ||
26 | + | ||
27 | + @Override | ||
28 | + public BusinessEnum getType() { | ||
29 | + return BusinessEnum.REC_CARD; | ||
30 | + } | ||
31 | +} |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/rec/DepositRecHandler.java
@@ -2,7 +2,7 @@ package com.diligrp.etrade.thirdparty.handler.business.rec; | @@ -2,7 +2,7 @@ package com.diligrp.etrade.thirdparty.handler.business.rec; | ||
2 | 2 | ||
3 | import com.diligrp.etrade.core.util.JsonUtils; | 3 | import com.diligrp.etrade.core.util.JsonUtils; |
4 | import com.diligrp.etrade.thirdparty.demarcate.AbstractRecHandler; | 4 | import com.diligrp.etrade.thirdparty.demarcate.AbstractRecHandler; |
5 | -import com.diligrp.etrade.thirdparty.domain.co.business.rec.DepositBillCo; | 5 | +import com.diligrp.etrade.thirdparty.domain.co.business.rec.DepositRecCo; |
6 | import com.diligrp.etrade.thirdparty.type.BusinessEnum; | 6 | import com.diligrp.etrade.thirdparty.type.BusinessEnum; |
7 | import com.fasterxml.jackson.core.type.TypeReference; | 7 | import com.fasterxml.jackson.core.type.TypeReference; |
8 | import org.springframework.stereotype.Component; | 8 | import org.springframework.stereotype.Component; |
@@ -11,21 +11,20 @@ import java.util.List; | @@ -11,21 +11,20 @@ import java.util.List; | ||
11 | 11 | ||
12 | /** | 12 | /** |
13 | * @Author: zhangmeiyang | 13 | * @Author: zhangmeiyang |
14 | - * @CreateTime: 2024-11-25 09:34 | 14 | + * @CreateTime: 2024-11-29 16:30 |
15 | * @Version: todo | 15 | * @Version: todo |
16 | */ | 16 | */ |
17 | @Component | 17 | @Component |
18 | -public class DepositRecHandler extends AbstractRecHandler<DepositBillCo> { | ||
19 | - | 18 | +public class DepositRecHandler extends AbstractRecHandler<DepositRecCo> { |
20 | @Override | 19 | @Override |
21 | public void handle(String json, Long marketId, String systemCode) throws Exception { | 20 | public void handle(String json, Long marketId, String systemCode) throws Exception { |
22 | - List<DepositBillCo> depositBillCos = JsonUtils.fromJsonString(json, new TypeReference<>() {}); | ||
23 | - transferDataListWithOutFeeItem(depositBillCos, marketId, systemCode); | ||
24 | - sendPurchaseOrder(depositBillCos, marketId, systemCode); | 21 | + List<DepositRecCo> depositRecCos = JsonUtils.fromJsonString(json, new TypeReference<>() {}); |
22 | + transferDataListWithOutFeeItem(depositRecCos, marketId, systemCode); | ||
23 | + sendPurchaseOrder(depositRecCos, marketId, systemCode); | ||
25 | } | 24 | } |
26 | 25 | ||
27 | @Override | 26 | @Override |
28 | public BusinessEnum getType() { | 27 | public BusinessEnum getType() { |
29 | - return BusinessEnum.REC_DEPOSIT_AND_WITHDRAW; | 28 | + return BusinessEnum.REC_DEPOSIT; |
30 | } | 29 | } |
31 | } | 30 | } |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/rec/RefrigeratorRecHandler.java
0 → 100644
1 | +package com.diligrp.etrade.thirdparty.handler.business.rec; | ||
2 | + | ||
3 | +import com.diligrp.etrade.core.util.JsonUtils; | ||
4 | +import com.diligrp.etrade.thirdparty.demarcate.AbstractRecHandler; | ||
5 | +import com.diligrp.etrade.thirdparty.domain.co.business.rec.RefrigeratorRecCo; | ||
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-29 16:30 | ||
15 | + * @Version: todo | ||
16 | + */ | ||
17 | +@Component | ||
18 | +public class RefrigeratorRecHandler extends AbstractRecHandler<RefrigeratorRecCo> { | ||
19 | + @Override | ||
20 | + public void handle(String json, Long marketId, String systemCode) throws Exception { | ||
21 | + List<RefrigeratorRecCo> refrigeratorRecCos = JsonUtils.fromJsonString(json, new TypeReference<>() {}); | ||
22 | + transferDataListWithFeeItem(refrigeratorRecCos, marketId, systemCode); | ||
23 | + sendPurchaseOrder(refrigeratorRecCos, marketId, systemCode); | ||
24 | + } | ||
25 | + | ||
26 | + @Override | ||
27 | + public BusinessEnum getType() { | ||
28 | + return BusinessEnum.REC_REFRIGERATOR; | ||
29 | + } | ||
30 | +} |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/rec/SettleRecHandler.java
0 → 100644
1 | +package com.diligrp.etrade.thirdparty.handler.business.rec; | ||
2 | + | ||
3 | +import com.diligrp.etrade.core.util.JsonUtils; | ||
4 | +import com.diligrp.etrade.thirdparty.demarcate.AbstractRecHandler; | ||
5 | +import com.diligrp.etrade.thirdparty.domain.co.business.rec.SettleRecCo; | ||
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-29 16:30 | ||
15 | + * @Version: todo | ||
16 | + */ | ||
17 | +@Component | ||
18 | +public class SettleRecHandler extends AbstractRecHandler<SettleRecCo> { | ||
19 | + @Override | ||
20 | + public void handle(String json, Long marketId, String systemCode) throws Exception { | ||
21 | + List<SettleRecCo> settleRecCos = JsonUtils.fromJsonString(json, new TypeReference<>() {}); | ||
22 | + transferDataListWithFeeItem(settleRecCos, marketId, systemCode); | ||
23 | + sendPurchaseOrder(settleRecCos, marketId, systemCode); | ||
24 | + } | ||
25 | + | ||
26 | + @Override | ||
27 | + public BusinessEnum getType() { | ||
28 | + return BusinessEnum.REC_SETTLE; | ||
29 | + } | ||
30 | +} |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/refund/PayoutsRefundHandler.java renamed to etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/refund/CardRefundHandler.java
@@ -2,7 +2,7 @@ package com.diligrp.etrade.thirdparty.handler.business.refund; | @@ -2,7 +2,7 @@ package com.diligrp.etrade.thirdparty.handler.business.refund; | ||
2 | 2 | ||
3 | import com.diligrp.etrade.core.util.JsonUtils; | 3 | import com.diligrp.etrade.core.util.JsonUtils; |
4 | import com.diligrp.etrade.thirdparty.demarcate.AbstractRefundHandler; | 4 | import com.diligrp.etrade.thirdparty.demarcate.AbstractRefundHandler; |
5 | -import com.diligrp.etrade.thirdparty.domain.co.business.refund.RefundBillCo; | 5 | +import com.diligrp.etrade.thirdparty.domain.co.business.refund.CardRefundCo; |
6 | import com.diligrp.etrade.thirdparty.type.BusinessEnum; | 6 | import com.diligrp.etrade.thirdparty.type.BusinessEnum; |
7 | import com.fasterxml.jackson.core.type.TypeReference; | 7 | import com.fasterxml.jackson.core.type.TypeReference; |
8 | import org.springframework.stereotype.Component; | 8 | import org.springframework.stereotype.Component; |
@@ -15,18 +15,18 @@ import java.util.List; | @@ -15,18 +15,18 @@ import java.util.List; | ||
15 | * @Version: todo | 15 | * @Version: todo |
16 | */ | 16 | */ |
17 | @Component | 17 | @Component |
18 | -public class PayoutsRefundHandler extends AbstractRefundHandler<RefundBillCo> { | 18 | +public class CardRefundHandler extends AbstractRefundHandler<CardRefundCo> { |
19 | private static final String DEFAULT_REASON = "卡务退款"; | 19 | private static final String DEFAULT_REASON = "卡务退款"; |
20 | @Override | 20 | @Override |
21 | public void handle(String json, Long marketId, String systemCode) throws Exception { | 21 | public void handle(String json, Long marketId, String systemCode) throws Exception { |
22 | - List<RefundBillCo> refundBillCos = JsonUtils.fromJsonString(json, new TypeReference<>() {}); | ||
23 | - refundBillCos.forEach(e->e.getFREFUNDBILLENTRY().forEach(f->f.setFNOTE(DEFAULT_REASON))); | ||
24 | - transferDataListWithOutFeeItem(refundBillCos, marketId, systemCode); | ||
25 | - sendPurchaseOrder(refundBillCos, marketId, systemCode); | 22 | + List<CardRefundCo> cardRefundCos = JsonUtils.fromJsonString(json, new TypeReference<>() {}); |
23 | + cardRefundCos.forEach(e->e.getFREFUNDBILLENTRY().forEach(f->f.setFNOTE(DEFAULT_REASON))); | ||
24 | + transferDataListWithOutFeeItem(cardRefundCos, marketId, systemCode); | ||
25 | + sendPurchaseOrder(cardRefundCos, marketId, systemCode); | ||
26 | } | 26 | } |
27 | 27 | ||
28 | @Override | 28 | @Override |
29 | public BusinessEnum getType() { | 29 | public BusinessEnum getType() { |
30 | - return BusinessEnum.REF_PAYOUTS; | 30 | + return BusinessEnum.REF_CARD; |
31 | } | 31 | } |
32 | } | 32 | } |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/mapper/TransMapper.java
@@ -36,7 +36,7 @@ public interface TransMapper extends MybatisMapperSupport { | @@ -36,7 +36,7 @@ public interface TransMapper extends MybatisMapperSupport { | ||
36 | * @return {@link BusinessDetailDto} | 36 | * @return {@link BusinessDetailDto} |
37 | */ | 37 | */ |
38 | @DataSource(DataSourceConstants.DS_KEY_SLAVE) | 38 | @DataSource(DataSourceConstants.DS_KEY_SLAVE) |
39 | - List<BusinessDetailDto> getFixedWithQueryArrays(@Param("systemCode")String systemCode, @Param("code") String code, @Param("marketId")Long marketId,@Param("selectType") Integer selectType,@Param("basicCodes")String[] basicCodes); | 39 | + List<BusinessDetailDto> getFixedWithQueryArrays(@Param("documentType") String documentType,@Param("systemCode")String systemCode, @Param("code") String code, @Param("marketId")Long marketId,@Param("selectType") Integer selectType,@Param("basicCodes")String[] basicCodes); |
40 | 40 | ||
41 | 41 | ||
42 | /** | 42 | /** |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/type/BillType.java
@@ -4,15 +4,17 @@ import com.diligrp.etrade.thirdparty.error.ThirdPartyException; | @@ -4,15 +4,17 @@ import com.diligrp.etrade.thirdparty.error.ThirdPartyException; | ||
4 | 4 | ||
5 | public enum BillType { | 5 | public enum BillType { |
6 | 6 | ||
7 | - RECEIVABLES("AR_receivable"), | ||
8 | - RECEIPTS("AR_RECEIVEBILL"), | ||
9 | - RECEIPT_AND_REFUND_FORM("AR_REFUNDBILL"), | 7 | + RECEIVABLES("AR_receivable","bill"), |
8 | + RECEIPTS("AR_RECEIVEBILL","rec"), | ||
9 | + RECEIPT_AND_REFUND_FORM("AR_REFUNDBILL","ref"), | ||
10 | ; | 10 | ; |
11 | 11 | ||
12 | public final String value; | 12 | public final String value; |
13 | + public final String sign; | ||
13 | 14 | ||
14 | - BillType(String value) { | 15 | + BillType(String value,String sign) { |
15 | this.value = value; | 16 | this.value = value; |
17 | + this.sign = sign; | ||
16 | } | 18 | } |
17 | 19 | ||
18 | public static BillType getBillType(String value) { | 20 | public static BillType getBillType(String value) { |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/type/BusinessEnum.java
@@ -15,9 +15,22 @@ public enum BusinessEnum { | @@ -15,9 +15,22 @@ public enum BusinessEnum { | ||
15 | BILL_BILL("BILL"), | 15 | BILL_BILL("BILL"), |
16 | BILL_DEPOSIT("DEPOSIT"), | 16 | BILL_DEPOSIT("DEPOSIT"), |
17 | //---------------------------------------------------------------------------------------- | 17 | //---------------------------------------------------------------------------------------- |
18 | - REC_DEPOSIT_AND_WITHDRAW("DEPOSIT_AND_WITHDRAW"), | 18 | + REC_SETTLE("REC_SETTLE"), |
19 | + REC_ENTRANCE_FEE("REC_ENTRANCE_FEE"), | ||
20 | + REC_REFRIGERATOR("REC_REFRIGERATOR"), | ||
21 | + REC_CARD("REC_CARD"), | ||
22 | + REC_WEIGHING("REC_WEIGHING"), | ||
23 | + REC_BILL("REC_BILL"), | ||
24 | + REC_DEPOSIT("REC_DEPOSIT"), | ||
19 | //---------------------------------------------------------------------------------------- | 25 | //---------------------------------------------------------------------------------------- |
20 | - REF_PAYOUTS("PAYOUTS"); | 26 | + REF_SETTLE("REF_SETTLE"), |
27 | + REF_ENTRANCE_FEE("REF_ENTRANCE_FEE"), | ||
28 | + REF_REFRIGERATOR("REF_REFRIGERATOR"), | ||
29 | + REF_CARD("REF_CARD"), | ||
30 | + REF_WEIGHING("REF_WEIGHING"), | ||
31 | + REF_BILL("REF_BILL"), | ||
32 | + REF_DEPOSIT("REF_DEPOSIT"), | ||
33 | + ; | ||
21 | public final String code; | 34 | public final String code; |
22 | 35 | ||
23 | BusinessEnum(String code) { | 36 | BusinessEnum(String code) { |
@@ -25,8 +38,8 @@ public enum BusinessEnum { | @@ -25,8 +38,8 @@ public enum BusinessEnum { | ||
25 | } | 38 | } |
26 | 39 | ||
27 | public static BusinessEnum fromCode(String code) { | 40 | public static BusinessEnum fromCode(String code) { |
28 | - for (BusinessEnum e : values()){ | ||
29 | - if (e.code.equals(code)){ | 41 | + for (BusinessEnum e : values()) { |
42 | + if (e.code.equals(code)) { | ||
30 | return e; | 43 | return e; |
31 | } | 44 | } |
32 | } | 45 | } |