Commit d58fb003775e1e0ccb3c48e45c00952abf71178f

Authored by zhangmeiyang
1 parent 3c96df78

金蝶问题修复

etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/component/TransferComponent.java
@@ -55,12 +55,17 @@ public class TransferComponent { @@ -55,12 +55,17 @@ public class TransferComponent {
55 if (!ObjectUtils.isEmpty(co.getFCUSTOMERID())) { 55 if (!ObjectUtils.isEmpty(co.getFCUSTOMERID())) {
56 this.transCustomer(co.getFCUSTOMERID()); 56 this.transCustomer(co.getFCUSTOMERID());
57 } 57 }
58 - if (!ObjectUtils.isEmpty(co.getFSALEDEPTID())) {  
59 - this.transDepId(co.getFSALEDEPTID());  
60 - }  
61 if (!ObjectUtils.isEmpty(co.getFTRANSFERID())) { 58 if (!ObjectUtils.isEmpty(co.getFTRANSFERID())) {
62 this.transTransferId(co.getFTRANSFERID()); 59 this.transTransferId(co.getFTRANSFERID());
63 } 60 }
  61 + if (!ObjectUtils.isEmpty(co.getFSALEDEPTID())) {
  62 + var fNumber = this.transDepId(co.getFSALEDEPTID());
  63 + if (!ObjectUtils.isEmpty(fNumber)){
  64 + FCOSTDEPARTMENTID fCOSTDEPARTMENTID = new FCOSTDEPARTMENTID();
  65 + fCOSTDEPARTMENTID.setFNUMBER(fNumber);
  66 + co.setFCOSTDEPARTMENTID(fCOSTDEPARTMENTID);
  67 + }
  68 + }
64 this.transPayOrgId(co.getFPAYORGID(), marketId, systemCode); 69 this.transPayOrgId(co.getFPAYORGID(), marketId, systemCode);
65 this.transSaleOrgId(co.getFSALEORGID(), marketId, systemCode); 70 this.transSaleOrgId(co.getFSALEORGID(), marketId, systemCode);
66 this.transSettleOrgId(co.getFSETTLEORGID(), marketId, systemCode); 71 this.transSettleOrgId(co.getFSETTLEORGID(), marketId, systemCode);
@@ -101,6 +106,17 @@ public class TransferComponent { @@ -101,6 +106,17 @@ public class TransferComponent {
101 } 106 }
102 107
103 /** 108 /**
  109 + * 交易货币
  110 + *
  111 + * @param marketId 市场 ID
  112 + * @param systemCode 系统代码
  113 + * @param fGroup F 组
  114 + */
  115 + public void transCustomerGroup(FGroup fGroup, Long marketId, String systemCode) {
  116 + fGroup.setFNumber(transMapper.getBaseConfig(systemCode, marketId).getCustomerGroup());
  117 + }
  118 +
  119 + /**
104 * Trans Main Book 货币 120 * Trans Main Book 货币
105 * 121 *
106 * @param fmainbookstdcurrid fmainbookstdcurrid 122 * @param fmainbookstdcurrid fmainbookstdcurrid
@@ -207,11 +223,12 @@ public class TransferComponent { @@ -207,11 +223,12 @@ public class TransferComponent {
207 * 223 *
208 * @param fsaledeptid fsaledeptid 224 * @param fsaledeptid fsaledeptid
209 */ 225 */
210 - public void transDepId(FSALEDEPTID fsaledeptid) { 226 + public String transDepId(FSALEDEPTID fsaledeptid) {
211 if (ObjectUtils.isEmpty(fsaledeptid.getFNumber())) { 227 if (ObjectUtils.isEmpty(fsaledeptid.getFNumber())) {
212 - return; 228 + return null;
213 } 229 }
214 fsaledeptid.setFNumber(transMapper.getDepartment(Long.valueOf(fsaledeptid.getFNumber())).getDepartmentCode()); 230 fsaledeptid.setFNumber(transMapper.getDepartment(Long.valueOf(fsaledeptid.getFNumber())).getDepartmentCode());
  231 + return fsaledeptid.getFNumber();
215 } 232 }
216 233
217 } 234 }
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/demarcate/AbstractBasicHandler.java
@@ -5,6 +5,7 @@ import com.diligrp.etrade.thirdparty.domain.co.basic.BaseSourceCo; @@ -5,6 +5,7 @@ import com.diligrp.etrade.thirdparty.domain.co.basic.BaseSourceCo;
5 import com.diligrp.etrade.thirdparty.domain.dto.BaseConfigDto; 5 import com.diligrp.etrade.thirdparty.domain.dto.BaseConfigDto;
6 import com.diligrp.etrade.thirdparty.domain.dto.ClientDto; 6 import com.diligrp.etrade.thirdparty.domain.dto.ClientDto;
7 import com.diligrp.etrade.thirdparty.domain.dto.MappingDto; 7 import com.diligrp.etrade.thirdparty.domain.dto.MappingDto;
  8 +import com.diligrp.etrade.thirdparty.domain.model.FGroup;
8 import com.diligrp.etrade.thirdparty.mapper.RecordMapper; 9 import com.diligrp.etrade.thirdparty.mapper.RecordMapper;
9 import com.diligrp.etrade.thirdparty.mapper.TransMapper; 10 import com.diligrp.etrade.thirdparty.mapper.TransMapper;
10 import com.diligrp.etrade.thirdparty.type.BasicEnum; 11 import com.diligrp.etrade.thirdparty.type.BasicEnum;
@@ -115,6 +116,17 @@ public abstract class AbstractBasicHandler<T extends BaseSourceCo> implements Ty @@ -115,6 +116,17 @@ public abstract class AbstractBasicHandler<T extends BaseSourceCo> implements Ty
115 } 116 }
116 117
117 /** 118 /**
  119 + * 固定转换
  120 + *
  121 + * @param marketId 市场 ID
  122 + * @param systemCode 系统代码
  123 + * @param fGroup F 组
  124 + */
  125 + protected void transferCustomerGroup(FGroup fGroup, Long marketId, String systemCode) {
  126 + transferComponent.transCustomerGroup(fGroup, marketId, systemCode);
  127 + }
  128 +
  129 + /**
118 * 处理 130 * 处理
119 * 131 *
120 * @param json JSON 格式 132 * @param json JSON 格式
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/demarcate/AbstractBillHandler.java
@@ -159,7 +159,7 @@ public abstract class AbstractBillHandler<T extends BaseBillCo> implements TypeM @@ -159,7 +159,7 @@ public abstract class AbstractBillHandler<T extends BaseBillCo> implements TypeM
159 * @param data 数据 159 * @param data 数据
160 */ 160 */
161 protected static <T extends BaseBillCo> void transferDynamicBusinessType(T t, BusinessDetailDto data) { 161 protected static <T extends BaseBillCo> void transferDynamicBusinessType(T t, BusinessDetailDto data) {
162 - t.setF_PZCW_Text(data.getItemValue()); 162 + t.setFixedBusinessType(data.getItemValue());
163 } 163 }
164 164
165 /** 165 /**
@@ -261,17 +261,17 @@ public abstract class AbstractBillHandler&lt;T extends BaseBillCo&gt; implements TypeM @@ -261,17 +261,17 @@ public abstract class AbstractBillHandler&lt;T extends BaseBillCo&gt; implements TypeM
261 * @throws Exception 例外 261 * @throws Exception 例外
262 */ 262 */
263 protected void sendPurchaseOrder(List<T> ts, Long marketId, String systemCode) throws Exception { 263 protected void sendPurchaseOrder(List<T> ts, Long marketId, String systemCode) throws Exception {
264 - var identifyInfo = new IdentifyInfo();  
265 - ClientDto clientParam = transMapper.getClientParam(systemCode, marketId);  
266 - identifyInfo.setAppId(clientParam.getApplyId());  
267 - identifyInfo.setUserName(clientParam.getUsername());  
268 - identifyInfo.setServerUrl(clientParam.getServiceAddress());  
269 - identifyInfo.setAppSecret(clientParam.getSecurityKey());  
270 - identifyInfo.setdCID(clientParam.getDataCentreId()); 264 + var identifyInfo = getIdentifyInfo(marketId, systemCode);
271 var util = new PurchaseOrderApiUtils(identifyInfo); 265 var util = new PurchaseOrderApiUtils(identifyInfo);
272 for (T e : ts) { 266 for (T e : ts) {
273 var billId = e.getFBillTypeID().getFNUMBER(); 267 var billId = e.getFBillTypeID().getFNUMBER();
  268 + //获取单据类型
274 String documentType = getDocumentType(marketId, systemCode, billId); 269 String documentType = getDocumentType(marketId, systemCode, billId);
  270 + var fixedBusinessType = e.getFixedBusinessType();
  271 + //业务类型固定的情况下
  272 + if (!ObjectUtils.isEmpty(fixedBusinessType)){
  273 + e.getFBillTypeID().setFNUMBER(fixedBusinessType);
  274 + }
275 if (ObjectUtils.isEmpty(documentType)) { 275 if (ObjectUtils.isEmpty(documentType)) {
276 throw new ThirdPartyException("未配置业务映射"); 276 throw new ThirdPartyException("未配置业务映射");
277 } 277 }
@@ -281,6 +281,17 @@ public abstract class AbstractBillHandler&lt;T extends BaseBillCo&gt; implements TypeM @@ -281,6 +281,17 @@ public abstract class AbstractBillHandler&lt;T extends BaseBillCo&gt; implements TypeM
281 } 281 }
282 } 282 }
283 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;
  293 + }
  294 +
284 /** 295 /**
285 * 获取 所有金额 296 * 获取 所有金额
286 * 297 *
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/BaseBillCo.java
@@ -13,6 +13,7 @@ import java.util.List; @@ -13,6 +13,7 @@ import java.util.List;
13 */ 13 */
14 public class BaseBillCo implements Serializable { 14 public class BaseBillCo implements Serializable {
15 private String systemDynamicCode; 15 private String systemDynamicCode;
  16 + private String fixedBusinessType;
16 private String FAR_Remark; 17 private String FAR_Remark;
17 private String F_PZCW_Text; 18 private String F_PZCW_Text;
18 private String F_PZCW_Text1; 19 private String F_PZCW_Text1;
@@ -23,6 +24,7 @@ public class BaseBillCo implements Serializable { @@ -23,6 +24,7 @@ public class BaseBillCo implements Serializable {
23 private FCUSTOMERID FCUSTOMERID; 24 private FCUSTOMERID FCUSTOMERID;
24 private FSALEORGID FSALEORGID; 25 private FSALEORGID FSALEORGID;
25 private FSALEDEPTID FSALEDEPTID; 26 private FSALEDEPTID FSALEDEPTID;
  27 + private FCOSTDEPARTMENTID FCOSTDEPARTMENTID;
26 private FPAYORGID FPAYORGID; 28 private FPAYORGID FPAYORGID;
27 private FTRANSFERID FTRANSFERID; 29 private FTRANSFERID FTRANSFERID;
28 private FORDERID FORDERID; 30 private FORDERID FORDERID;
@@ -43,6 +45,15 @@ public class BaseBillCo implements Serializable { @@ -43,6 +45,15 @@ public class BaseBillCo implements Serializable {
43 this.systemDynamicCode = systemDynamicCode; 45 this.systemDynamicCode = systemDynamicCode;
44 } 46 }
45 47
  48 + @JsonProperty("fixedBusinessType")
  49 + public String getFixedBusinessType() {
  50 + return fixedBusinessType;
  51 + }
  52 +
  53 + public void setFixedBusinessType(String fixedBusinessType) {
  54 + this.fixedBusinessType = fixedBusinessType;
  55 + }
  56 +
46 @JsonProperty("F_ZDB_Text") 57 @JsonProperty("F_ZDB_Text")
47 public String getF_ZDB_Text() { 58 public String getF_ZDB_Text() {
48 return F_ZDB_Text; 59 return F_ZDB_Text;
@@ -151,6 +162,15 @@ public class BaseBillCo implements Serializable { @@ -151,6 +162,15 @@ public class BaseBillCo implements Serializable {
151 this.FSALEDEPTID = FSALEDEPTID; 162 this.FSALEDEPTID = FSALEDEPTID;
152 } 163 }
153 164
  165 + @JsonProperty("FCOSTDEPARTMENTID")
  166 + public FCOSTDEPARTMENTID getFCOSTDEPARTMENTID() {
  167 + return FCOSTDEPARTMENTID;
  168 + }
  169 +
  170 + public void setFCOSTDEPARTMENTID(FCOSTDEPARTMENTID FCOSTDEPARTMENTID) {
  171 + this.FCOSTDEPARTMENTID = FCOSTDEPARTMENTID;
  172 + }
  173 +
154 @JsonProperty("FPAYORGID") 174 @JsonProperty("FPAYORGID")
155 public FPAYORGID getFPAYORGID() { 175 public FPAYORGID getFPAYORGID() {
156 return FPAYORGID; 176 return FPAYORGID;
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/dto/BaseConfigDto.java
@@ -8,6 +8,7 @@ package com.diligrp.etrade.thirdparty.domain.dto; @@ -8,6 +8,7 @@ package com.diligrp.etrade.thirdparty.domain.dto;
8 public class BaseConfigDto { 8 public class BaseConfigDto {
9 private String currency; 9 private String currency;
10 private String syncItem; 10 private String syncItem;
  11 + private String customerGroup;
11 12
12 public String getCurrency() { 13 public String getCurrency() {
13 return currency; 14 return currency;
@@ -24,4 +25,12 @@ public class BaseConfigDto { @@ -24,4 +25,12 @@ public class BaseConfigDto {
24 public void setSyncItem(String syncItem) { 25 public void setSyncItem(String syncItem) {
25 this.syncItem = syncItem; 26 this.syncItem = syncItem;
26 } 27 }
  28 +
  29 + public String getCustomerGroup() {
  30 + return customerGroup;
  31 + }
  32 +
  33 + public void setCustomerGroup(String customerGroup) {
  34 + this.customerGroup = customerGroup;
  35 + }
27 } 36 }
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/model/FCOSTDEPARTMENTID.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 FCOSTDEPARTMENTID {
  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/handler/basic/CustomerBasicHandler.java
@@ -5,6 +5,7 @@ import com.diligrp.etrade.thirdparty.demarcate.AbstractBasicHandler; @@ -5,6 +5,7 @@ import com.diligrp.etrade.thirdparty.demarcate.AbstractBasicHandler;
5 import com.diligrp.etrade.thirdparty.domain.co.basic.CustomerCo; 5 import com.diligrp.etrade.thirdparty.domain.co.basic.CustomerCo;
6 import com.diligrp.etrade.thirdparty.domain.dto.MappingDto; 6 import com.diligrp.etrade.thirdparty.domain.dto.MappingDto;
7 import com.diligrp.etrade.thirdparty.domain.model.FContactId; 7 import com.diligrp.etrade.thirdparty.domain.model.FContactId;
  8 +import com.diligrp.etrade.thirdparty.domain.model.FGroup;
8 import com.diligrp.etrade.thirdparty.domain.model.FT_BD_CUSTLOCATION; 9 import com.diligrp.etrade.thirdparty.domain.model.FT_BD_CUSTLOCATION;
9 import com.diligrp.etrade.thirdparty.type.BasicEnum; 10 import com.diligrp.etrade.thirdparty.type.BasicEnum;
10 import com.diligrp.etrade.thirdparty.utils.ContactApiUtils; 11 import com.diligrp.etrade.thirdparty.utils.ContactApiUtils;
@@ -30,8 +31,11 @@ public class CustomerBasicHandler extends AbstractBasicHandler&lt;CustomerCo&gt; { @@ -30,8 +31,11 @@ public class CustomerBasicHandler extends AbstractBasicHandler&lt;CustomerCo&gt; {
30 List<CustomerCo> customerCos = JsonUtils.fromJsonString(json, new TypeReference<>() {}); 31 List<CustomerCo> customerCos = JsonUtils.fromJsonString(json, new TypeReference<>() {});
31 var customerUtils = new CustomerApiUtils(getIdentifyInfo(marketId, systemCode)); 32 var customerUtils = new CustomerApiUtils(getIdentifyInfo(marketId, systemCode));
32 var contactUtils = new ContactApiUtils(getIdentifyInfo(marketId, systemCode)); 33 var contactUtils = new ContactApiUtils(getIdentifyInfo(marketId, systemCode));
  34 + FGroup fGroup = new FGroup();
  35 + transferCustomerGroup(fGroup, marketId, systemCode);
33 for (CustomerCo e : customerCos) { 36 for (CustomerCo e : customerCos) {
34 super.transfer(e, marketId, systemCode); 37 super.transfer(e, marketId, systemCode);
  38 + e.setFGroup(fGroup);
35 MappingDto mappingData = super.getMappingData(marketId, systemCode, e.getSystemDataId()); 39 MappingDto mappingData = super.getMappingData(marketId, systemCode, e.getSystemDataId());
36 List<FT_BD_CUSTLOCATION> ftBdCustlocation = e.getFT_BD_CUSTLOCATION(); 40 List<FT_BD_CUSTLOCATION> ftBdCustlocation = e.getFT_BD_CUSTLOCATION();
37 var list = new ArrayList<FT_BD_CUSTLOCATION>(); 41 var list = new ArrayList<FT_BD_CUSTLOCATION>();