Commit ade50705be5a4f2cec37d0516e24da0243d25c0f
1 parent
fb12eddc
金蝶对接pt3
Showing
21 changed files
with
332 additions
and
103 deletions
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/component/TransferComponent.java
... | ... | @@ -6,12 +6,14 @@ import com.diligrp.etrade.thirdparty.domain.co.basic.BaseSourceCo; |
6 | 6 | import com.diligrp.etrade.thirdparty.domain.co.business.BaseBillCo; |
7 | 7 | import com.diligrp.etrade.thirdparty.domain.model.*; |
8 | 8 | import com.diligrp.etrade.thirdparty.mapper.TransMapper; |
9 | +import com.diligrp.etrade.thirdparty.type.OperateType; | |
9 | 10 | import jakarta.annotation.Resource; |
10 | 11 | import org.springframework.stereotype.Component; |
11 | 12 | import org.springframework.util.ObjectUtils; |
12 | 13 | |
13 | 14 | import java.time.LocalDateTime; |
14 | 15 | import java.time.format.DateTimeFormatter; |
16 | +import java.util.Objects; | |
15 | 17 | |
16 | 18 | /** |
17 | 19 | * Transfer Component (传输组件) |
... | ... | @@ -36,22 +38,23 @@ public class TransferComponent { |
36 | 38 | * @param systemCode 系统代码 |
37 | 39 | */ |
38 | 40 | public void transBaseCo(BaseBillCo co, Long marketId, String systemCode) { |
41 | + co.setF_PZCW_Text(Objects.requireNonNull(OperateType.getOperateType(Integer.parseInt(co.getF_PZCW_Text()))).getName()); | |
39 | 42 | co.setFDATE(LocalDateTime.now().format(DateTimeFormatter.ofPattern(Constants.DATE_TIME_FORMAT))); |
40 | 43 | co.setFCURRENCYID(new FCURRENCYID()); |
41 | 44 | co.setFMAINBOOKSTDCURRID(new FMAINBOOKSTDCURRID()); |
42 | 45 | co.setFPAYORGID(new FPAYORGID()); |
43 | 46 | co.setFSALEORGID(new FSALEORGID()); |
44 | 47 | co.setFSETTLEORGID(new FSETTLEORGID()); |
45 | - if (!ObjectUtils.isEmpty(co.getFORDERID())){ | |
48 | + if (!ObjectUtils.isEmpty(co.getFORDERID())) { | |
46 | 49 | this.transOrderId(co.getFORDERID()); |
47 | 50 | } |
48 | - if (!ObjectUtils.isEmpty(co.getFCUSTOMERID())){ | |
51 | + if (!ObjectUtils.isEmpty(co.getFCUSTOMERID())) { | |
49 | 52 | this.transCustomer(co.getFCUSTOMERID()); |
50 | 53 | } |
51 | - if (!ObjectUtils.isEmpty(co.getFSALEDEPTID())){ | |
54 | + if (!ObjectUtils.isEmpty(co.getFSALEDEPTID())) { | |
52 | 55 | this.transDepId(co.getFSALEDEPTID()); |
53 | 56 | } |
54 | - if (!ObjectUtils.isEmpty(co.getFTRANSFERID())){ | |
57 | + if (!ObjectUtils.isEmpty(co.getFTRANSFERID())) { | |
55 | 58 | this.transTransferId(co.getFTRANSFERID()); |
56 | 59 | } |
57 | 60 | this.transPayOrgId(co.getFPAYORGID(), marketId, systemCode); |
... | ... | @@ -61,7 +64,7 @@ public class TransferComponent { |
61 | 64 | this.transMainBookCurrency(co.getFMAINBOOKSTDCURRID(), marketId, systemCode); |
62 | 65 | } |
63 | 66 | |
64 | - public void transBasicCo(BaseSourceCo co, Long marketId, String systemCode){ | |
67 | + public void transBasicCo(BaseSourceCo co, Long marketId, String systemCode) { | |
65 | 68 | co.setFUseOrgId(new FUseOrgId()); |
66 | 69 | co.setFCreateOrgId(new FCreateOrgId()); |
67 | 70 | this.transFUseOrgId(co.getFUseOrgId(), marketId, systemCode); |
... | ... | @@ -75,7 +78,7 @@ public class TransferComponent { |
75 | 78 | * @param marketId 市场 ID |
76 | 79 | * @param systemCode 系统代码 |
77 | 80 | */ |
78 | - public void transCurrency(FCURRENCYID fcurrencyid, Long marketId, String systemCode){ | |
81 | + public void transCurrency(FCURRENCYID fcurrencyid, Long marketId, String systemCode) { | |
79 | 82 | fcurrencyid.setFNumber(transMapper.getBaseConfig(systemCode, marketId).getCurrency()); |
80 | 83 | } |
81 | 84 | |
... | ... | @@ -86,7 +89,7 @@ public class TransferComponent { |
86 | 89 | * @param marketId 市场 ID |
87 | 90 | * @param systemCode 系统代码 |
88 | 91 | */ |
89 | - public void transMainBookCurrency(FMAINBOOKSTDCURRID fmainbookstdcurrid, Long marketId, String systemCode){ | |
92 | + public void transMainBookCurrency(FMAINBOOKSTDCURRID fmainbookstdcurrid, Long marketId, String systemCode) { | |
90 | 93 | fmainbookstdcurrid.setFNumber(transMapper.getBaseConfig(systemCode, marketId).getCurrency()); |
91 | 94 | } |
92 | 95 | |
... | ... | @@ -95,8 +98,8 @@ public class TransferComponent { |
95 | 98 | * |
96 | 99 | * @param fcustomerid fcustomerid |
97 | 100 | */ |
98 | - public void transCustomer(FCUSTOMERID fcustomerid){ | |
99 | - if (ObjectUtils.isEmpty(fcustomerid.getFNumber())){ | |
101 | + public void transCustomer(FCUSTOMERID fcustomerid) { | |
102 | + if (ObjectUtils.isEmpty(fcustomerid.getFNumber())) { | |
100 | 103 | return; |
101 | 104 | } |
102 | 105 | fcustomerid.setFNumber(transMapper.getCustomer(Long.valueOf(fcustomerid.getFNumber())).getCode()); |
... | ... | @@ -107,8 +110,8 @@ public class TransferComponent { |
107 | 110 | * |
108 | 111 | * @param forderid forderid |
109 | 112 | */ |
110 | - public void transOrderId(FORDERID forderid){ | |
111 | - if (ObjectUtils.isEmpty(forderid.getFNumber())){ | |
113 | + public void transOrderId(FORDERID forderid) { | |
114 | + if (ObjectUtils.isEmpty(forderid.getFNumber())) { | |
112 | 115 | return; |
113 | 116 | } |
114 | 117 | forderid.setFNumber(transMapper.getCustomer(Long.valueOf(forderid.getFNumber())).getCode()); |
... | ... | @@ -119,8 +122,8 @@ public class TransferComponent { |
119 | 122 | * |
120 | 123 | * @param ftransferid ftransferid |
121 | 124 | */ |
122 | - public void transTransferId(FTRANSFERID ftransferid){ | |
123 | - if (ObjectUtils.isEmpty(ftransferid.getFNumber())){ | |
125 | + public void transTransferId(FTRANSFERID ftransferid) { | |
126 | + if (ObjectUtils.isEmpty(ftransferid.getFNumber())) { | |
124 | 127 | return; |
125 | 128 | } |
126 | 129 | ftransferid.setFNumber(transMapper.getCustomer(Long.valueOf(ftransferid.getFNumber())).getCode()); |
... | ... | @@ -133,8 +136,8 @@ public class TransferComponent { |
133 | 136 | * @param systemCode 系统代码 |
134 | 137 | * @param fUseOrgId f 使用组织 ID |
135 | 138 | */ |
136 | - public void transFUseOrgId(FUseOrgId fUseOrgId, Long marketId, String systemCode){ | |
137 | - fUseOrgId.setFNumber(transMapper.getClientParam(systemCode,marketId).getOrganization()); | |
139 | + public void transFUseOrgId(FUseOrgId fUseOrgId, Long marketId, String systemCode) { | |
140 | + fUseOrgId.setFNumber(transMapper.getClientParam(systemCode, marketId).getOrganization()); | |
138 | 141 | } |
139 | 142 | |
140 | 143 | /** |
... | ... | @@ -144,8 +147,8 @@ public class TransferComponent { |
144 | 147 | * @param systemCode 系统代码 |
145 | 148 | * @param fCreateOrgId f 创建组织 ID |
146 | 149 | */ |
147 | - public void transFCreateOrgId(FCreateOrgId fCreateOrgId, Long marketId, String systemCode){ | |
148 | - fCreateOrgId.setFNumber(transMapper.getClientParam(systemCode,marketId).getOrganization()); | |
150 | + public void transFCreateOrgId(FCreateOrgId fCreateOrgId, Long marketId, String systemCode) { | |
151 | + fCreateOrgId.setFNumber(transMapper.getClientParam(systemCode, marketId).getOrganization()); | |
149 | 152 | } |
150 | 153 | |
151 | 154 | /** |
... | ... | @@ -155,8 +158,8 @@ public class TransferComponent { |
155 | 158 | * @param marketId 市场 ID |
156 | 159 | * @param systemCode 系统代码 |
157 | 160 | */ |
158 | - public void transPayOrgId(FPAYORGID fpayorgid, Long marketId, String systemCode){ | |
159 | - fpayorgid.setFNumber(transMapper.getClientParam(systemCode,marketId).getOrganization()); | |
161 | + public void transPayOrgId(FPAYORGID fpayorgid, Long marketId, String systemCode) { | |
162 | + fpayorgid.setFNumber(transMapper.getClientParam(systemCode, marketId).getOrganization()); | |
160 | 163 | } |
161 | 164 | |
162 | 165 | /** |
... | ... | @@ -166,8 +169,8 @@ public class TransferComponent { |
166 | 169 | * @param marketId 市场 ID |
167 | 170 | * @param systemCode 系统代码 |
168 | 171 | */ |
169 | - public void transSaleOrgId(FSALEORGID fsaleorgid, Long marketId, String systemCode){ | |
170 | - fsaleorgid.setFNumber(transMapper.getClientParam(systemCode,marketId).getOrganization()); | |
172 | + public void transSaleOrgId(FSALEORGID fsaleorgid, Long marketId, String systemCode) { | |
173 | + fsaleorgid.setFNumber(transMapper.getClientParam(systemCode, marketId).getOrganization()); | |
171 | 174 | } |
172 | 175 | |
173 | 176 | /** |
... | ... | @@ -177,8 +180,8 @@ public class TransferComponent { |
177 | 180 | * @param marketId 市场 ID |
178 | 181 | * @param systemCode 系统代码 |
179 | 182 | */ |
180 | - public void transSettleOrgId(FSETTLEORGID fsettleorgid, Long marketId, String systemCode){ | |
181 | - fsettleorgid.setFNumber(transMapper.getClientParam(systemCode,marketId).getOrganization()); | |
183 | + public void transSettleOrgId(FSETTLEORGID fsettleorgid, Long marketId, String systemCode) { | |
184 | + fsettleorgid.setFNumber(transMapper.getClientParam(systemCode, marketId).getOrganization()); | |
182 | 185 | } |
183 | 186 | |
184 | 187 | /** |
... | ... | @@ -186,8 +189,8 @@ public class TransferComponent { |
186 | 189 | * |
187 | 190 | * @param fsaledeptid fsaledeptid |
188 | 191 | */ |
189 | - public void transDepId(FSALEDEPTID fsaledeptid){ | |
190 | - if (ObjectUtils.isEmpty(fsaledeptid.getFNumber())){ | |
192 | + public void transDepId(FSALEDEPTID fsaledeptid) { | |
193 | + if (ObjectUtils.isEmpty(fsaledeptid.getFNumber())) { | |
191 | 194 | return; |
192 | 195 | } |
193 | 196 | fsaledeptid.setFNumber(transMapper.getDepartment(Long.valueOf(fsaledeptid.getFNumber())).getDepartmentCode()); | ... | ... |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/demarcate/AbstractBillHandler.java
... | ... | @@ -135,9 +135,10 @@ public abstract class AbstractBillHandler<T extends BaseBillCo> implements TypeM |
135 | 135 | |
136 | 136 | protected void transferDataList(List<T> ts, Long marketId, String systemCode){ |
137 | 137 | ts.forEach(e -> { |
138 | + DynamicType dynamicType = DynamicType.fromCode(e.getSystemDynamicCode()); | |
138 | 139 | transfer(e, marketId, systemCode); |
139 | - getFilteredDynamicDataSingle(DynamicType.fromCode(e.getF_PZCW_Text()), marketId, systemCode).forEach((k, v) -> TRANSFER_FUNCTION_SINGLE_MAP.get(k).transferDynamic(e, v)); | |
140 | - getFilteredDynamicDataMulti(DynamicType.fromCode(e.getF_PZCW_Text()), marketId, systemCode).forEach((k, v) -> TRANSFER_FUNCTION_MULTI_MAP.get(k).transferDynamic(e, v)); | |
140 | + getFilteredDynamicDataSingle(dynamicType, marketId, systemCode).forEach((k, v) -> TRANSFER_FUNCTION_SINGLE_MAP.get(k).transferDynamic(e, v)); | |
141 | + getFilteredDynamicDataMulti(dynamicType, marketId, systemCode).forEach((k, v) -> TRANSFER_FUNCTION_MULTI_MAP.get(k).transferDynamic(e, v)); | |
141 | 142 | }); |
142 | 143 | } |
143 | 144 | |
... | ... | @@ -187,8 +188,8 @@ public abstract class AbstractBillHandler<T extends BaseBillCo> implements TypeM |
187 | 188 | * @throws Exception 例外 |
188 | 189 | */ |
189 | 190 | protected void sendPurchaseOrder(List<T> ts,Long marketId, String systemCode) throws Exception { |
190 | - ClientDto clientParam = transMapper.getClientParam(systemCode, marketId); | |
191 | 191 | var identifyInfo = new IdentifyInfo(); |
192 | + ClientDto clientParam = transMapper.getClientParam(systemCode, marketId); | |
192 | 193 | identifyInfo.setAppId(clientParam.getApplyId()); |
193 | 194 | identifyInfo.setUserName(clientParam.getUsername()); |
194 | 195 | identifyInfo.setServerUrl(clientParam.getServiceAddress()); |
... | ... | @@ -196,7 +197,8 @@ public abstract class AbstractBillHandler<T extends BaseBillCo> implements TypeM |
196 | 197 | identifyInfo.setdCID(clientParam.getDataCentreId()); |
197 | 198 | var util = new PurchaseOrderApiUtils(identifyInfo); |
198 | 199 | for (T e : ts) { |
199 | - util.createOnePurchaseOrder(JsonUtils.toJsonString(e), getDocumentType(marketId, systemCode, e.getFBillTypeID().getFNUMBER())); | |
200 | + e.getFBillTypeID().setFNUMBER("YSD01_SYS");//TODO TEST | |
201 | + util.createOnePurchaseOrder(JsonUtils.toJsonString(e), "AR_receivable"); | |
200 | 202 | } |
201 | 203 | } |
202 | 204 | ... | ... |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/BaseBillCo.java
... | ... | @@ -12,6 +12,7 @@ import java.util.List; |
12 | 12 | * @Version: todo |
13 | 13 | */ |
14 | 14 | public class BaseBillCo implements Serializable { |
15 | + private String systemDynamicCode; | |
15 | 16 | private String FAR_Remark; |
16 | 17 | private String F_PZCW_Text; |
17 | 18 | private String FDATE; |
... | ... | @@ -28,6 +29,25 @@ public class BaseBillCo implements Serializable { |
28 | 29 | private FChargeId FChargeId; |
29 | 30 | private FSettleTypeID FSettleTypeID; |
30 | 31 | private List<FEntityDetail> FEntityDetail; |
32 | + private String F_ZDB_Text; | |
33 | + | |
34 | + @JsonProperty("systemDynamicCode") | |
35 | + public String getSystemDynamicCode() { | |
36 | + return systemDynamicCode; | |
37 | + } | |
38 | + | |
39 | + public void setSystemDynamicCode(String systemDynamicCode) { | |
40 | + this.systemDynamicCode = systemDynamicCode; | |
41 | + } | |
42 | + | |
43 | + @JsonProperty("F_ZDB_Text") | |
44 | + public String getF_ZDB_Text() { | |
45 | + return F_ZDB_Text; | |
46 | + } | |
47 | + | |
48 | + public void setF_ZDB_Text(String f_ZDB_Text) { | |
49 | + F_ZDB_Text = f_ZDB_Text; | |
50 | + } | |
31 | 51 | |
32 | 52 | @JsonProperty("FAR_Remark") |
33 | 53 | public String getFAR_Remark() { | ... | ... |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/CardBillCo.java
1 | 1 | package com.diligrp.etrade.thirdparty.domain.co.business; |
2 | 2 | |
3 | -import com.fasterxml.jackson.annotation.JsonProperty; | |
4 | - | |
5 | 3 | /** |
6 | 4 | * @Author: zhangmeiyang |
7 | 5 | * @CreateTime: 2024-10-10 14:23 |
8 | 6 | * @Version: todo |
9 | 7 | */ |
10 | 8 | public class CardBillCo extends BaseBillCo { |
11 | - private String F_ZDB_Text; | |
12 | - | |
13 | - @JsonProperty("F_ZDB_Text") | |
14 | - public String getF_ZDB_Text() { | |
15 | - return F_ZDB_Text; | |
16 | - } | |
17 | 9 | |
18 | - public void setF_ZDB_Text(String f_ZDB_Text) { | |
19 | - F_ZDB_Text = f_ZDB_Text; | |
20 | - } | |
21 | 10 | } |
22 | 11 | |
23 | 12 | ... | ... |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/SettleBillCo.java
1 | 1 | package com.diligrp.etrade.thirdparty.domain.co.business; |
2 | 2 | |
3 | -import com.fasterxml.jackson.annotation.JsonProperty; | |
4 | - | |
5 | 3 | /** |
6 | 4 | * @Author: zhangmeiyang |
7 | 5 | * @CreateTime: 2024-10-10 14:23 |
8 | 6 | * @Version: todo |
9 | 7 | */ |
10 | 8 | public class SettleBillCo extends BaseBillCo { |
11 | - private String F_ZDB_Text; | |
12 | - | |
13 | - @JsonProperty("F_ZDB_Text") | |
14 | - public String getF_ZDB_Text() { | |
15 | - return F_ZDB_Text; | |
16 | - } | |
17 | - | |
18 | - public void setF_ZDB_Text(String f_ZDB_Text) { | |
19 | - F_ZDB_Text = f_ZDB_Text; | |
20 | - } | |
21 | 9 | |
22 | 10 | } |
23 | 11 | ... | ... |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/WeighingBillCo.java
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/model/FT_BD_CUSTLOCATION.java
... | ... | @@ -10,10 +10,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; |
10 | 10 | */ |
11 | 11 | public class FT_BD_CUSTLOCATION { |
12 | 12 | private FContactId FContactId; |
13 | - private String FNumber; | |
14 | 13 | private String FName; |
15 | - private String FMobile; | |
14 | + private String FMOBILEPHONE; | |
16 | 15 | private String FBizAddress; |
16 | + private String FCompanyType; | |
17 | 17 | |
18 | 18 | @JsonProperty("FContactId") |
19 | 19 | public FContactId getFContactId() { |
... | ... | @@ -24,15 +24,6 @@ public class FT_BD_CUSTLOCATION { |
24 | 24 | this.FContactId = FContactId; |
25 | 25 | } |
26 | 26 | |
27 | - @JsonProperty("FNumber") | |
28 | - public String getFNumber() { | |
29 | - return FNumber; | |
30 | - } | |
31 | - | |
32 | - public void setFNumber(String FNumber) { | |
33 | - this.FNumber = FNumber; | |
34 | - } | |
35 | - | |
36 | 27 | @JsonProperty("FName") |
37 | 28 | public String getFName() { |
38 | 29 | return FName; |
... | ... | @@ -42,13 +33,13 @@ public class FT_BD_CUSTLOCATION { |
42 | 33 | this.FName = FName; |
43 | 34 | } |
44 | 35 | |
45 | - @JsonProperty("FMobile") | |
46 | - public String getFMobile() { | |
47 | - return FMobile; | |
36 | + @JsonProperty("FMOBILEPHONE") | |
37 | + public String getFMOBILEPHONE() { | |
38 | + return FMOBILEPHONE; | |
48 | 39 | } |
49 | 40 | |
50 | - public void setFMobile(String FMobile) { | |
51 | - this.FMobile = FMobile; | |
41 | + public void setFMOBILEPHONE(String FMOBILEPHONE) { | |
42 | + this.FMOBILEPHONE = FMOBILEPHONE; | |
52 | 43 | } |
53 | 44 | |
54 | 45 | @JsonProperty("FBizAddress") |
... | ... | @@ -59,4 +50,13 @@ public class FT_BD_CUSTLOCATION { |
59 | 50 | public void setFBizAddress(String FBizAddress) { |
60 | 51 | this.FBizAddress = FBizAddress; |
61 | 52 | } |
53 | + | |
54 | + @JsonProperty("FCompanyType") | |
55 | + public String getFCompanyType() { | |
56 | + return FCompanyType; | |
57 | + } | |
58 | + | |
59 | + public void setFCompanyType(String FCompanyType) { | |
60 | + this.FCompanyType = FCompanyType; | |
61 | + } | |
62 | 62 | } | ... | ... |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/exec/basic/BasicReceiver.java
... | ... | @@ -40,34 +40,34 @@ public class BasicReceiver extends AbstractReceiver { |
40 | 40 | @RabbitListener(bindings = @QueueBinding(value = @Queue(value = ZR_BASIC_NORMAL_QUEUE, autoDelete = "false"), exchange = @Exchange(value = ZR_BASIC_NORMAL_EXCHANGE), key = ZR_BASIC_NORMAL_ROUTING), ackMode = "MANUAL") |
41 | 41 | public void receiveMessage(Channel channel, Message message) throws IOException { |
42 | 42 | var content = new String(message.getBody(), StandardCharsets.UTF_8); |
43 | - LOG.info("business receive message:{}", content); | |
43 | + LOG.info("基础数据队列收到消息:{}", content); | |
44 | 44 | GeneralMessage msg = JsonUtils.fromJsonString(content, GeneralMessage.class); |
45 | 45 | try { |
46 | 46 | Holder.BASIC_CONTEXT.get(msg.getBasic()).handle(msg.getData(), msg.getMarketId(), msg.getSystemCode()); |
47 | 47 | channel.basicAck(message.getMessageProperties().getDeliveryTag(), false); |
48 | - LOG.info("business handle success:{}", content); | |
48 | + LOG.info("基础数据队列消息处理成功:{}", content); | |
49 | 49 | } catch (Exception e) { |
50 | 50 | channel.basicAck(message.getMessageProperties().getDeliveryTag(), false); |
51 | 51 | msg.setRetryCount(msg.getRetryCount() + 1); |
52 | 52 | sendDelayMsg(DELAY, JsonUtils.toJsonString(msg)); |
53 | - LOG.error("business exception:", e); | |
53 | + LOG.error("基础数据队列消息处理失败:", e); | |
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
57 | 57 | @RabbitListener(queues = ZR_BASIC_DEAD_QUEUE, ackMode = "MANUAL") |
58 | 58 | public void handleCustomDelayMsg(Channel channel, Message message) throws IOException { |
59 | 59 | var content = new String(message.getBody(), StandardCharsets.UTF_8); |
60 | - LOG.info("business receive retry message:{}", content); | |
60 | + LOG.info("基础数据重试队列收到消息:{}", content); | |
61 | 61 | GeneralMessage msg = JsonUtils.fromJsonString(content, GeneralMessage.class); |
62 | 62 | try { |
63 | 63 | Holder.BASIC_CONTEXT.get(msg.getBasic()).handle(msg.getData(), msg.getMarketId(), msg.getSystemCode()); |
64 | 64 | channel.basicAck(message.getMessageProperties().getDeliveryTag(), false); |
65 | - LOG.info("business retry message success:{}", content); | |
65 | + LOG.info("基础数据重试队列消息处理成功:{}", content); | |
66 | 66 | } catch (Exception e) { |
67 | 67 | channel.basicAck(message.getMessageProperties().getDeliveryTag(), false); |
68 | 68 | if (msg.getRetryCount() > 3) { |
69 | 69 | super.handleError(e.fillInStackTrace().getMessage(), msg.getData(), msg.getBasic().code, msg.getSystemCode(), msg.getMarketId()); |
70 | - LOG.error("retry business exception:", e); | |
70 | + LOG.error("基础数据重试队列消息处理失败:", e); | |
71 | 71 | } else { |
72 | 72 | msg.setRetryCount(msg.getRetryCount() + 1); |
73 | 73 | sendDelayMsg(DELAY, JsonUtils.toJsonString(msg)); | ... | ... |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/exec/business/BusinessReceiver.java
... | ... | @@ -38,34 +38,34 @@ public class BusinessReceiver extends AbstractReceiver { |
38 | 38 | @RabbitListener(bindings = @QueueBinding(value = @Queue(value = ZR_BUSINESS_NORMAL_QUEUE, autoDelete = "false"), exchange = @Exchange(value = ZR_BUSINESS_NORMAL_EXCHANGE), key = ZR_BUSINESS_NORMAL_ROUTING), ackMode = "MANUAL") |
39 | 39 | public void receiveMessage(Channel channel, Message message) throws IOException { |
40 | 40 | var content = new String(message.getBody(), StandardCharsets.UTF_8); |
41 | - LOG.info("basic receive message:{}",content); | |
41 | + LOG.info("业务队列收到消息:{}",content); | |
42 | 42 | GeneralMessage msg = JsonUtils.fromJsonString(content, GeneralMessage.class); |
43 | 43 | try { |
44 | 44 | Holder.BUSINESS_CONTEXT.get(msg.getBusiness()).handle(msg.getData(), msg.getMarketId(), msg.getSystemCode()); |
45 | 45 | channel.basicAck(message.getMessageProperties().getDeliveryTag(), false); |
46 | - LOG.info("basic handle success:{}",content); | |
46 | + LOG.info("业务队列消息处理成功:{}",content); | |
47 | 47 | } catch (Exception e) { |
48 | 48 | channel.basicAck(message.getMessageProperties().getDeliveryTag(), false); |
49 | 49 | msg.setRetryCount(msg.getRetryCount()+1); |
50 | 50 | sendDelayMsg(DELAY, JsonUtils.toJsonString(msg)); |
51 | - LOG.error("basic exception:",e); | |
51 | + LOG.error("业务队列消息处理失败:",e); | |
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
55 | 55 | @RabbitListener(queues = ZR_BUSINESS_DEAD_QUEUE, ackMode = "MANUAL") |
56 | 56 | public void handleCustomDelayMsg(Channel channel, Message message) throws IOException { |
57 | 57 | var content = new String(message.getBody(), StandardCharsets.UTF_8); |
58 | - LOG.info("basic receive retry message:{}",content); | |
58 | + LOG.info("业务重试队列收到消息:{}",content); | |
59 | 59 | GeneralMessage msg = JsonUtils.fromJsonString(content, GeneralMessage.class); |
60 | 60 | try { |
61 | 61 | Holder.BUSINESS_CONTEXT.get(msg.getBusiness()).handle(msg.getData(), msg.getMarketId(), msg.getSystemCode()); |
62 | 62 | channel.basicAck(message.getMessageProperties().getDeliveryTag(), false); |
63 | - LOG.info("basic retry message success:{}",content); | |
63 | + LOG.info("业务重试队列消息处理成功:{}",content); | |
64 | 64 | } catch (Exception e) { |
65 | 65 | channel.basicAck(message.getMessageProperties().getDeliveryTag(), false); |
66 | 66 | if (msg.getRetryCount() > 3) { |
67 | 67 | super.handleError(e.fillInStackTrace().getMessage(), msg.getData(), msg.getBusiness().code, msg.getSystemCode(),msg.getMarketId()); |
68 | - LOG.error("retry basic exception:",e); | |
68 | + LOG.error("业务重试队列消息处理失败:",e); | |
69 | 69 | }else{ |
70 | 70 | msg.setRetryCount(msg.getRetryCount() + 1); |
71 | 71 | sendDelayMsg(DELAY, JsonUtils.toJsonString(msg)); | ... | ... |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/basic/CustomerBasicHandler.java
... | ... | @@ -13,6 +13,7 @@ import com.fasterxml.jackson.core.type.TypeReference; |
13 | 13 | import org.springframework.stereotype.Component; |
14 | 14 | import org.springframework.util.ObjectUtils; |
15 | 15 | |
16 | +import java.util.ArrayList; | |
16 | 17 | import java.util.List; |
17 | 18 | |
18 | 19 | /** |
... | ... | @@ -22,6 +23,7 @@ import java.util.List; |
22 | 23 | */ |
23 | 24 | @Component |
24 | 25 | public class CustomerBasicHandler extends AbstractBasicHandler<CustomerCo> { |
26 | + private static final String F_COMPANY_TYPE = "BD_Customer"; | |
25 | 27 | |
26 | 28 | @Override |
27 | 29 | public void handleInside(String json, Long marketId, String systemCode) throws Exception { |
... | ... | @@ -32,14 +34,19 @@ public class CustomerBasicHandler extends AbstractBasicHandler<CustomerCo> { |
32 | 34 | super.transfer(e, marketId, systemCode); |
33 | 35 | MappingDto mappingData = super.getMappingData(marketId, systemCode, e.getSystemDataId()); |
34 | 36 | List<FT_BD_CUSTLOCATION> ftBdCustlocation = e.getFT_BD_CUSTLOCATION(); |
37 | + var list = new ArrayList<FT_BD_CUSTLOCATION>(); | |
35 | 38 | if (!ObjectUtils.isEmpty(ftBdCustlocation)){ |
36 | 39 | for (FT_BD_CUSTLOCATION ftBdCustLocation : ftBdCustlocation) { |
40 | + ftBdCustLocation.setFCompanyType(F_COMPANY_TYPE); | |
37 | 41 | String contact = contactUtils.createContact(JsonUtils.toJsonString(ftBdCustLocation)); |
38 | 42 | FContactId fContactId = new FContactId(); |
39 | 43 | fContactId.setFNUMBER(contact); |
40 | - ftBdCustLocation.setFContactId(fContactId); | |
44 | + var item = new FT_BD_CUSTLOCATION(); | |
45 | + item.setFContactId(fContactId); | |
46 | + list.add(item); | |
41 | 47 | } |
42 | 48 | } |
49 | + e.setFT_BD_CUSTLOCATION(list); | |
43 | 50 | e.setFCUSTID(ObjectUtils.isEmpty(mappingData) ? null : mappingData.getThirdPartyDataId()); |
44 | 51 | if (!ObjectUtils.isEmpty(mappingData)){ |
45 | 52 | customerUtils.updateCustomer(String.valueOf(mappingData.getThirdPartyDataId()),JsonUtils.toJsonString(e)); | ... | ... |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/message/GeneralMessage.java
... | ... | @@ -9,6 +9,7 @@ import com.diligrp.etrade.thirdparty.type.BusinessEnum; |
9 | 9 | * @Version: todo |
10 | 10 | */ |
11 | 11 | public class GeneralMessage { |
12 | + private static final String SYSTEM_CODE = "kingdee"; | |
12 | 13 | private BusinessEnum business; |
13 | 14 | private BasicEnum basic; |
14 | 15 | private String data; |
... | ... | @@ -18,8 +19,9 @@ public class GeneralMessage { |
18 | 19 | |
19 | 20 | public GeneralMessage() { |
20 | 21 | this.retryCount = 0; |
21 | - this.systemCode = "kingdee"; | |
22 | + this.systemCode = SYSTEM_CODE; | |
22 | 23 | } |
24 | + | |
23 | 25 | public BasicEnum getBasic() { |
24 | 26 | return basic; |
25 | 27 | } | ... | ... |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/message/GeneralSendMessage.java
1 | 1 | package com.diligrp.etrade.thirdparty.message; |
2 | 2 | |
3 | +import com.fasterxml.jackson.annotation.JsonProperty; | |
4 | + | |
3 | 5 | import java.util.Map; |
4 | 6 | |
5 | 7 | /** |
... | ... | @@ -11,6 +13,7 @@ public class GeneralSendMessage { |
11 | 13 | private Map<String,Object> Model; |
12 | 14 | private Boolean IsAutoSubmitAndAudit; |
13 | 15 | |
16 | + @JsonProperty("Model") | |
14 | 17 | public Map<String, Object> getModel() { |
15 | 18 | return Model; |
16 | 19 | } |
... | ... | @@ -19,6 +22,7 @@ public class GeneralSendMessage { |
19 | 22 | Model = model; |
20 | 23 | } |
21 | 24 | |
25 | + @JsonProperty("IsAutoSubmitAndAudit") | |
22 | 26 | public Boolean getAutoSubmitAndAudit() { |
23 | 27 | return IsAutoSubmitAndAudit; |
24 | 28 | } | ... | ... |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/type/OperateType.java
0 → 100644
1 | +package com.diligrp.etrade.thirdparty.type; | |
2 | + | |
3 | +import java.util.ArrayList; | |
4 | +import java.util.Arrays; | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @description: | |
9 | + * 柜台操作记录类型 | |
10 | + * @author :WangBo | |
11 | + * @time :2020年6月17日下午5:15:19 | |
12 | + */ | |
13 | +public enum OperateType { | |
14 | + ACCOUNT_TRANSACT("办卡", 1010), | |
15 | + ACCOUNT_CHARGE("存款", 1011), | |
16 | + ACCOUNT_WITHDRAW("取款", 1012), | |
17 | + BANK_ACCOUNT_CHARGE("银行存款", 2011), | |
18 | + CHANGE("换卡", 1013), | |
19 | + LOSS_CARD("挂失", 1014), | |
20 | + LOSS_REMOVE("解挂", 1015), | |
21 | + PWD_CHANGE("修改密码", 1016), | |
22 | + RESET_PWD("重置密码", 1017), | |
23 | + REFUND_CARD("退卡", 1018), | |
24 | + LIFT_LOCKED("卡片解锁", 1019), | |
25 | + FLAT_COST("缴费", 1020), | |
26 | + BANKCARD_BIND("银行卡绑定", 1021), | |
27 | + BANKCARD_REMOVE("银行卡解绑", 1022), | |
28 | + BANK_TRANSFER("转账", 1023), | |
29 | + PERMISSION_SET("权限设置", 1024), | |
30 | + BANK_ACCOUNT_WITHDRAW("银行取款", 2012), | |
31 | + PAYEE("领款", 1025), | |
32 | + PAYER("交款", 1026), | |
33 | + FROZEN_FUND("冻结资金", 1027), | |
34 | + UNFROZEN_FUND("解冻资金", 1028), | |
35 | + FROZEN_ACCOUNT("冻结账户", 1029), | |
36 | + UNFROZEN_ACCOUNT("解冻账户", 1030), | |
37 | + FUND_REVERSE("冲正", 1031), | |
38 | + FIRM_WITHDRAW("市场圈提", 1032), | |
39 | + ETC_BIND("ETC绑定", 1033), | |
40 | + ETC_PAY("ETC缴费", 1034), | |
41 | + SCAN_ACCOUNT_CHARGE("扫码存款", 1035), | |
42 | + // CYCLE_SURPLUS("账期调账",1035), | |
43 | +// CYCLE_LOSS("账期罚款",1036), | |
44 | + DAILY_SETTLE("日扎处理", 1036), | |
45 | + TRANSFER_OUT("柜员转出", 1037), | |
46 | + TRANSFER_IN("柜员转入", 1038), | |
47 | + PERMISSION_SET_BUSINESS("卡账户权限设置", 24),//业务日志的业务类型 | |
48 | + | |
49 | + CAIWU_PAYEE("从财务领款", 2025), | |
50 | + | |
51 | + CAIWU_PAYER("向财务交款", 2026), | |
52 | + | |
53 | + BOOTH_LEASE("摊位租赁", 1), | |
54 | + EARNEST("定金", 2), | |
55 | + DEPOSIT_ORDER("保证金", 3), | |
56 | + LOCATION_LEASE("冷库租赁", 4), | |
57 | + LODGING_LEASE("公寓租赁", 5), | |
58 | + BOUTIQUE_ENTRANCE("精品停车费", 6), | |
59 | + PASSPORT("通行证", 7), | |
60 | + STOCKIN("冷库入库", 8), | |
61 | + STOCKOUT("冷库出库", 9), | |
62 | + OTHER_FEE("其它收费", 10), | |
63 | + LABOR_VEST("劳务马甲", 11), | |
64 | + MESSAGEFEE("信息费", 14), | |
65 | + WATER("水费", 15), | |
66 | + ELECTRICITY("电费", 16), | |
67 | + UTILITY_BILLS_PRE_STORAGE("水电预存", 17), | |
68 | + ENTRANCE_CARD("车辆进门办卡", 301), | |
69 | + SCALES("磅秤租赁", 18), | |
70 | + LINGKUAN("领款", 67), | |
71 | + SETTLE_PAY("结算缴费", 510), | |
72 | + SETTLE_REFUND("结算退款", 511), | |
73 | + SETTLE_PAY_CANCEL("结算缴费撤销", 512), | |
74 | + APPROACH("报备进场", 501), | |
75 | + TRADE("交易", 502), | |
76 | + ETRADE_TRADE("交易", 5502), | |
77 | + ETRADE_RETURN("赊销回款", 5503), | |
78 | + DETECT("检测", 503), | |
79 | + PUT("上下架", 504), | |
80 | + TRANSFER("转离场", 505), | |
81 | + Cold_IN_ORDER("冷库入库", 506), | |
82 | + LOAN("客户借款", 507), | |
83 | + RENT("磅秤租赁", 508), | |
84 | + SETTLE("批号结算", 509), | |
85 | + CASH_LOAN("现金借款", 519), | |
86 | + CASH_BACK("现金还款", 514), | |
87 | + CARD_LOAN("园区卡借款", 516), | |
88 | + CARD_BACK("园区卡还款", 515), | |
89 | + QT_LOAN("其他借款", 518), | |
90 | + QT_BACK("其他还款", 517), | |
91 | + STOP_CAR_TRADE_AERE("停车交易区", 523), | |
92 | + CARD_METER("卡表收费", 525), | |
93 | + QUERY_FEE("查询费", 513), | |
94 | + RUZHU("入住", 601), | |
95 | + BUJIAO("补缴", 602), | |
96 | + TUIFANG("退房", 603), | |
97 | + HONGCHONG("红冲", 604), | |
98 | + /** 本地配送费 */ | |
99 | + LOCAL_DELIVERY_FEE("本地配送费",8816), | |
100 | + /** 车辆进场费 */ | |
101 | + CAR_ENTRANCE_FEE("车辆进场费",8817), | |
102 | + /** 车辆出场费 */ | |
103 | + CAR_OUT_FEE("车辆出场费",8818), | |
104 | + /** 称重服务费 */ | |
105 | + WEIGH_SERVICE_FEE("称重服务费",8819), | |
106 | + /** 车辆转场费 */ | |
107 | + TRANSFER_FEE("车辆转场费",8820), | |
108 | + /** 车辆离场费 */ | |
109 | + LEAVE_FEE("车辆离场费",8821), | |
110 | + | |
111 | + /** 通行证管理费 */ | |
112 | + PASSPORT_MANAGE_FEE("通行证管理费",8824), | |
113 | + | |
114 | + /** 进门冻结 */ | |
115 | + ENTRANCE_FREEZE_FEE("进门冻结",8831), | |
116 | + ENTRANCE_UNFREEZE_FEE("进门解冻",8832), | |
117 | + ENTRANCE_HANDLING_FEE("装卸费",8833), | |
118 | + ENTRANCE_CAR_CARD_FEE("办卡费",8834), | |
119 | + ENTRANCE_FEEDBACK_FEE("返点",8835), | |
120 | + ENTRANCE_LAND_FEE("占地费",8836), | |
121 | + /** 称重服务费 没有用了*/ | |
122 | + SELF_WEIGH_SERVICE_FEE("自助称重费",88101), | |
123 | + /** 称重服务费 */ | |
124 | + SELF_WEIGH_SERVICE_FEE_1("自助称重费",8901), | |
125 | + /**资金复核*/ | |
126 | + FUND_REVIEW("资金复核",10001), | |
127 | + ACCOUNT_TRANSFER_IN("转账-入", 3011), | |
128 | + ACCOUNT_TRANSFER_OUT("转账-出", 3012), | |
129 | + ; | |
130 | + | |
131 | + private String name; | |
132 | + private int code; | |
133 | + | |
134 | + OperateType(String name, int code) { | |
135 | + this.name = name; | |
136 | + this.code = code; | |
137 | + } | |
138 | + | |
139 | + /** | |
140 | + * 是否是可以冲正的业务(只有充值和提款) | |
141 | + * @author miaoguoxin | |
142 | + * @date 2020/11/25 | |
143 | + */ | |
144 | + public static boolean canReverseType(Integer code) { | |
145 | + if (code == null) { | |
146 | + return false; | |
147 | + } | |
148 | + return OperateType.ACCOUNT_CHARGE.getCode() == code || OperateType.ACCOUNT_WITHDRAW.getCode() == code; | |
149 | + } | |
150 | + | |
151 | + public static OperateType getOperateType(int code) { | |
152 | + for (OperateType type : OperateType.values()) { | |
153 | + if (type.getCode() == code) { | |
154 | + return type; | |
155 | + } | |
156 | + } | |
157 | + return null; | |
158 | + } | |
159 | + | |
160 | + public static String getName(int code) { | |
161 | + for (OperateType type : OperateType.values()) { | |
162 | + if (type.getCode() == code) { | |
163 | + return type.name; | |
164 | + } | |
165 | + } | |
166 | + return null; | |
167 | + } | |
168 | + | |
169 | + /** | |
170 | + * 获取用于当前账期补打操作列表 | |
171 | + * @return | |
172 | + */ | |
173 | + public static List<Integer> createReprintList() { | |
174 | + List<Integer> typeList = new ArrayList<>(); | |
175 | + typeList.add(ACCOUNT_TRANSACT.getCode()); | |
176 | + typeList.add(ACCOUNT_CHARGE.getCode()); | |
177 | + typeList.add(ACCOUNT_WITHDRAW.getCode()); | |
178 | + typeList.add(CHANGE.getCode()); | |
179 | + typeList.add(REFUND_CARD.getCode()); | |
180 | + typeList.add(RESET_PWD.getCode()); | |
181 | + typeList.add(PWD_CHANGE.getCode()); | |
182 | + typeList.add(LOSS_CARD.getCode()); | |
183 | + typeList.add(LOSS_REMOVE.getCode()); | |
184 | + typeList.add(LIFT_LOCKED.getCode()); | |
185 | + typeList.add(PERMISSION_SET.getCode()); | |
186 | + return typeList; | |
187 | + } | |
188 | + | |
189 | + public static List<OperateType> getAll() { | |
190 | + return new ArrayList<>(Arrays.asList(OperateType.values())); | |
191 | + } | |
192 | + | |
193 | + public String getName() { | |
194 | + return name; | |
195 | + } | |
196 | + | |
197 | + public void setName(String name) { | |
198 | + this.name = name; | |
199 | + } | |
200 | + | |
201 | + public int getCode() { | |
202 | + return code; | |
203 | + } | |
204 | + | |
205 | + public void setCode(int code) { | |
206 | + this.code = code; | |
207 | + } | |
208 | +} | ... | ... |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/utils/BillTypeApiUtils.java
... | ... | @@ -5,6 +5,7 @@ import com.diligrp.etrade.thirdparty.error.ThirdPartyException; |
5 | 5 | import com.diligrp.etrade.thirdparty.message.GeneralSendMessage; |
6 | 6 | import com.diligrp.etrade.thirdparty.type.ThirdPartyErrorCodeEnum; |
7 | 7 | import com.fasterxml.jackson.core.type.TypeReference; |
8 | +import com.google.gson.Gson; | |
8 | 9 | import com.kingdee.bos.webapi.entity.IdentifyInfo; |
9 | 10 | import com.kingdee.bos.webapi.entity.OperateParam; |
10 | 11 | import com.kingdee.bos.webapi.entity.OperatorResult; |
... | ... | @@ -52,8 +53,8 @@ public class BillTypeApiUtils extends BaseApiUtils { |
52 | 53 | |
53 | 54 | private String save(String json) throws Exception { |
54 | 55 | String res = api.save("BOS_BillType", json); |
55 | - RepoRet repoRet = JsonUtils.fromJsonString(res, new TypeReference<>() { | |
56 | - }); | |
56 | + Gson gson = new Gson(); | |
57 | + RepoRet<?> repoRet = gson.fromJson(res, RepoRet.class); | |
57 | 58 | if (!repoRet.getResult().getResponseStatus().isIsSuccess()) { |
58 | 59 | ThirdPartyErrorCodeEnum errorCodeEnum = ThirdPartyErrorCodeEnum.getByCode(repoRet.getResult().getResponseStatus().getErrorCode()); |
59 | 60 | throw new ThirdPartyException(errorCodeEnum.desc); | ... | ... |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/utils/ContactApiUtils.java
... | ... | @@ -5,6 +5,7 @@ import com.diligrp.etrade.thirdparty.error.ThirdPartyException; |
5 | 5 | import com.diligrp.etrade.thirdparty.message.GeneralSendMessage; |
6 | 6 | import com.diligrp.etrade.thirdparty.type.ThirdPartyErrorCodeEnum; |
7 | 7 | import com.fasterxml.jackson.core.type.TypeReference; |
8 | +import com.google.gson.Gson; | |
8 | 9 | import com.kingdee.bos.webapi.entity.IdentifyInfo; |
9 | 10 | import com.kingdee.bos.webapi.entity.OperateParam; |
10 | 11 | import com.kingdee.bos.webapi.entity.OperatorResult; |
... | ... | @@ -35,7 +36,6 @@ public class ContactApiUtils extends BaseApiUtils { |
35 | 36 | Map<String, Object> map = JsonUtils.fromJsonString(json, new TypeReference<>() {}); |
36 | 37 | var message = new GeneralSendMessage(); |
37 | 38 | message.setModel(map); |
38 | - message.setAutoSubmitAndAudit(true); | |
39 | 39 | return save(JsonUtils.toJsonString(message)); |
40 | 40 | } |
41 | 41 | |
... | ... | @@ -45,20 +45,19 @@ public class ContactApiUtils extends BaseApiUtils { |
45 | 45 | }); |
46 | 46 | var message = new GeneralSendMessage(); |
47 | 47 | message.setModel(map); |
48 | - message.setAutoSubmitAndAudit(true); | |
49 | 48 | save(JsonUtils.toJsonString(message)); |
50 | 49 | } |
51 | 50 | |
52 | 51 | private String save(String json) throws Exception { |
53 | 52 | String res = api.save("BD_CommonContact", json); |
54 | - RepoRet repoRet = JsonUtils.fromJsonString(res, new TypeReference<>() { | |
55 | - }); | |
53 | + Gson gson = new Gson(); | |
54 | + RepoRet<?> repoRet = gson.fromJson(res, RepoRet.class); | |
56 | 55 | if (!repoRet.getResult().getResponseStatus().isIsSuccess()) { |
57 | 56 | ThirdPartyErrorCodeEnum errorCodeEnum = ThirdPartyErrorCodeEnum.getByCode(repoRet.getResult().getResponseStatus().getErrorCode()); |
58 | 57 | throw new ThirdPartyException(errorCodeEnum.desc); |
59 | 58 | } |
60 | 59 | log.info("联系人保存接口已完成,{}", res); |
61 | - return repoRet.getResult().getResponseStatus().getSuccessEntitys().get(0).getId(); | |
60 | + return repoRet.getResult().getResponseStatus().getSuccessEntitys().get(0).getNumber(); | |
62 | 61 | } |
63 | 62 | |
64 | 63 | private void unAudit(String FNumber) throws Exception { | ... | ... |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/utils/CustomerApiUtils.java
... | ... | @@ -5,6 +5,7 @@ import com.diligrp.etrade.thirdparty.error.ThirdPartyException; |
5 | 5 | import com.diligrp.etrade.thirdparty.message.GeneralSendMessage; |
6 | 6 | import com.diligrp.etrade.thirdparty.type.ThirdPartyErrorCodeEnum; |
7 | 7 | import com.fasterxml.jackson.core.type.TypeReference; |
8 | +import com.google.gson.Gson; | |
8 | 9 | import com.kingdee.bos.webapi.entity.IdentifyInfo; |
9 | 10 | import com.kingdee.bos.webapi.entity.OperateParam; |
10 | 11 | import com.kingdee.bos.webapi.entity.OperatorResult; |
... | ... | @@ -51,8 +52,8 @@ public class CustomerApiUtils extends BaseApiUtils { |
51 | 52 | |
52 | 53 | private String save(String json) throws Exception { |
53 | 54 | String res = api.save("BD_Customer", json); |
54 | - RepoRet repoRet = JsonUtils.fromJsonString(res, new TypeReference<>() { | |
55 | - }); | |
55 | + Gson gson = new Gson(); | |
56 | + RepoRet<?> repoRet = gson.fromJson(res, RepoRet.class); | |
56 | 57 | if (!repoRet.getResult().getResponseStatus().isIsSuccess()) { |
57 | 58 | ThirdPartyErrorCodeEnum errorCodeEnum = ThirdPartyErrorCodeEnum.getByCode(repoRet.getResult().getResponseStatus().getErrorCode()); |
58 | 59 | throw new ThirdPartyException(errorCodeEnum.desc); | ... | ... |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/utils/DepartmentApiUtils.java
... | ... | @@ -5,6 +5,7 @@ import com.diligrp.etrade.thirdparty.error.ThirdPartyException; |
5 | 5 | import com.diligrp.etrade.thirdparty.message.GeneralSendMessage; |
6 | 6 | import com.diligrp.etrade.thirdparty.type.ThirdPartyErrorCodeEnum; |
7 | 7 | import com.fasterxml.jackson.core.type.TypeReference; |
8 | +import com.google.gson.Gson; | |
8 | 9 | import com.kingdee.bos.webapi.entity.IdentifyInfo; |
9 | 10 | import com.kingdee.bos.webapi.entity.OperateParam; |
10 | 11 | import com.kingdee.bos.webapi.entity.OperatorResult; |
... | ... | @@ -52,7 +53,8 @@ public class DepartmentApiUtils extends BaseApiUtils { |
52 | 53 | |
53 | 54 | private String save(String json) throws Exception { |
54 | 55 | String res = api.save("BD_Department", json); |
55 | - RepoRet repoRet = JsonUtils.fromJsonString(res, new TypeReference<>() {}); | |
56 | + Gson gson = new Gson(); | |
57 | + RepoRet<?> repoRet = gson.fromJson(res, RepoRet.class); | |
56 | 58 | if (!repoRet.getResult().getResponseStatus().isIsSuccess()) { |
57 | 59 | ThirdPartyErrorCodeEnum errorCodeEnum = ThirdPartyErrorCodeEnum.getByCode(repoRet.getResult().getResponseStatus().getErrorCode()); |
58 | 60 | throw new ThirdPartyException(errorCodeEnum.desc); | ... | ... |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/utils/FeeApiUtils.java
... | ... | @@ -5,6 +5,7 @@ import com.diligrp.etrade.thirdparty.error.ThirdPartyException; |
5 | 5 | import com.diligrp.etrade.thirdparty.message.GeneralSendMessage; |
6 | 6 | import com.diligrp.etrade.thirdparty.type.ThirdPartyErrorCodeEnum; |
7 | 7 | import com.fasterxml.jackson.core.type.TypeReference; |
8 | +import com.google.gson.Gson; | |
8 | 9 | import com.kingdee.bos.webapi.entity.IdentifyInfo; |
9 | 10 | import com.kingdee.bos.webapi.entity.OperateParam; |
10 | 11 | import com.kingdee.bos.webapi.entity.OperatorResult; |
... | ... | @@ -53,8 +54,8 @@ public class FeeApiUtils extends BaseApiUtils { |
53 | 54 | |
54 | 55 | private String save(String json) throws Exception { |
55 | 56 | String res = api.save("BD_Expense", json); |
56 | - RepoRet repoRet = JsonUtils.fromJsonString(res, new TypeReference<>() { | |
57 | - }); | |
57 | + Gson gson = new Gson(); | |
58 | + RepoRet<?> repoRet = gson.fromJson(res, RepoRet.class); | |
58 | 59 | if (!repoRet.getResult().getResponseStatus().isIsSuccess()) { |
59 | 60 | ThirdPartyErrorCodeEnum errorCodeEnum = ThirdPartyErrorCodeEnum.getByCode(repoRet.getResult().getResponseStatus().getErrorCode()); |
60 | 61 | throw new ThirdPartyException(errorCodeEnum.desc); | ... | ... |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/utils/FeeGroupApiUtils.java
... | ... | @@ -5,6 +5,7 @@ import com.diligrp.etrade.thirdparty.error.ThirdPartyException; |
5 | 5 | import com.diligrp.etrade.thirdparty.message.GeneralSendMessage; |
6 | 6 | import com.diligrp.etrade.thirdparty.type.ThirdPartyErrorCodeEnum; |
7 | 7 | import com.fasterxml.jackson.core.type.TypeReference; |
8 | +import com.google.gson.Gson; | |
8 | 9 | import com.kingdee.bos.webapi.entity.IdentifyInfo; |
9 | 10 | import com.kingdee.bos.webapi.entity.RepoRet; |
10 | 11 | import org.slf4j.Logger; |
... | ... | @@ -47,8 +48,8 @@ public class FeeGroupApiUtils extends BaseApiUtils { |
47 | 48 | |
48 | 49 | private String save(String json) throws Exception { |
49 | 50 | String res = api.groupSave("BD_Expense", json); |
50 | - RepoRet repoRet = JsonUtils.fromJsonString(res, new TypeReference<>() { | |
51 | - }); | |
51 | + Gson gson = new Gson(); | |
52 | + RepoRet<?> repoRet = gson.fromJson(res, RepoRet.class); | |
52 | 53 | if (!repoRet.getResult().getResponseStatus().isIsSuccess()) { |
53 | 54 | ThirdPartyErrorCodeEnum errorCodeEnum = ThirdPartyErrorCodeEnum.getByCode(repoRet.getResult().getResponseStatus().getErrorCode()); |
54 | 55 | throw new ThirdPartyException(errorCodeEnum.desc); | ... | ... |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/utils/PurchaseOrderApiUtils.java
... | ... | @@ -5,6 +5,7 @@ import com.diligrp.etrade.thirdparty.error.ThirdPartyException; |
5 | 5 | import com.diligrp.etrade.thirdparty.message.GeneralSendMessage; |
6 | 6 | import com.diligrp.etrade.thirdparty.type.ThirdPartyErrorCodeEnum; |
7 | 7 | import com.fasterxml.jackson.core.type.TypeReference; |
8 | +import com.google.gson.Gson; | |
8 | 9 | import com.kingdee.bos.webapi.entity.IdentifyInfo; |
9 | 10 | import com.kingdee.bos.webapi.entity.RepoRet; |
10 | 11 | import org.slf4j.Logger; |
... | ... | @@ -30,18 +31,18 @@ public class PurchaseOrderApiUtils extends BaseApiUtils { |
30 | 31 | |
31 | 32 | |
32 | 33 | public void createOnePurchaseOrder(String json,String formId) throws Exception { |
33 | - Map<String, Object> map = JsonUtils.fromJsonString(json, new TypeReference<>() { | |
34 | - }); | |
34 | + Map<String, Object> map = JsonUtils.fromJsonString(json, new TypeReference<>() {}); | |
35 | 35 | var message = new GeneralSendMessage(); |
36 | 36 | message.setModel(map); |
37 | 37 | message.setAutoSubmitAndAudit(true); |
38 | -// save(JsonUtils.toJsonString(message)); | |
38 | + save(JsonUtils.toJsonString(message),formId); | |
39 | 39 | System.out.println(JsonUtils.toJsonString(message)); |
40 | 40 | } |
41 | 41 | |
42 | 42 | private void save(String json,String formId) throws Exception { |
43 | 43 | String res = api.save(formId, json); |
44 | - RepoRet repoRet = JsonUtils.fromJsonString(res, new TypeReference<>() {}); | |
44 | + Gson gson = new Gson(); | |
45 | + RepoRet<?> repoRet = gson.fromJson(res, RepoRet.class); | |
45 | 46 | if (!repoRet.getResult().getResponseStatus().isIsSuccess()) { |
46 | 47 | ThirdPartyErrorCodeEnum errorCodeEnum = ThirdPartyErrorCodeEnum.getByCode(repoRet.getResult().getResponseStatus().getErrorCode()); |
47 | 48 | throw new ThirdPartyException(errorCodeEnum.desc); | ... | ... |
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/utils/SettleTypeApiUtils.java
... | ... | @@ -5,6 +5,7 @@ import com.diligrp.etrade.thirdparty.error.ThirdPartyException; |
5 | 5 | import com.diligrp.etrade.thirdparty.message.GeneralSendMessage; |
6 | 6 | import com.diligrp.etrade.thirdparty.type.ThirdPartyErrorCodeEnum; |
7 | 7 | import com.fasterxml.jackson.core.type.TypeReference; |
8 | +import com.google.gson.Gson; | |
8 | 9 | import com.kingdee.bos.webapi.entity.IdentifyInfo; |
9 | 10 | import com.kingdee.bos.webapi.entity.OperateParam; |
10 | 11 | import com.kingdee.bos.webapi.entity.OperatorResult; |
... | ... | @@ -52,8 +53,8 @@ public class SettleTypeApiUtils extends BaseApiUtils { |
52 | 53 | |
53 | 54 | private String save(String json) throws Exception { |
54 | 55 | String res = api.save("BD_SETTLETYPE", json); |
55 | - RepoRet repoRet = JsonUtils.fromJsonString(res, new TypeReference<>() { | |
56 | - }); | |
56 | + Gson gson = new Gson(); | |
57 | + RepoRet<?> repoRet = gson.fromJson(res, RepoRet.class); | |
57 | 58 | if (!repoRet.getResult().getResponseStatus().isIsSuccess()) { |
58 | 59 | ThirdPartyErrorCodeEnum errorCodeEnum = ThirdPartyErrorCodeEnum.getByCode(repoRet.getResult().getResponseStatus().getErrorCode()); |
59 | 60 | throw new ThirdPartyException(errorCodeEnum.desc); | ... | ... |