Commit 98c94e395e438ac7782812f3a5e25c6f85143720

Authored by zhangmeiyang
1 parent 15be941a

金蝶对接pt9

etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/component/TransferComponent.java
... ... @@ -36,7 +36,7 @@ public class TransferComponent {
36 36 * @param systemCode 系统代码
37 37 */
38 38 public void transBaseCo(BaseBillCo co, Long marketId, String systemCode) {
39   - co.setFBillNo(ObjectUtils.isEmpty(co.getF_ZDB_Text())?null:co.getF_ZDB_Text());
  39 + co.setF_ZDB_Text1(ObjectUtils.isEmpty(co.getF_ZDB_Text())?null:co.getF_ZDB_Text());
40 40 co.setF_PZCW_Text(null);
41 41 co.setF_PZCW_Text1(null);
42 42 co.setF_ZDB_Text(null);
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/demarcate/AbstractBillHandler.java
... ... @@ -68,13 +68,13 @@ public abstract class AbstractBillHandler<T extends BaseBillCo> implements TypeM
68 68 * @param data 数据
69 69 */
70 70 protected static <T extends BaseBillCo> void transferDynamicCustomer(T t, BusinessDetailDto data) {
71   - if (!ObjectUtils.isEmpty(t.getFORDERID())){
  71 + if (!ObjectUtils.isEmpty(t.getFORDERID())) {
72 72 t.getFORDERID().setFNumber(data.getItemValue());
73 73 }
74   - if (!ObjectUtils.isEmpty(t.getFTRANSFERID())){
  74 + if (!ObjectUtils.isEmpty(t.getFTRANSFERID())) {
75 75 t.getFTRANSFERID().setFNumber(data.getItemValue());
76 76 }
77   - if (!ObjectUtils.isEmpty(t.getFCUSTOMERID())){
  77 + if (!ObjectUtils.isEmpty(t.getFCUSTOMERID())) {
78 78 t.getFCUSTOMERID().setFNumber(data.getItemValue());
79 79 }
80 80 }
... ... @@ -144,7 +144,6 @@ public abstract class AbstractBillHandler&lt;T extends BaseBillCo&gt; implements TypeM
144 144 }
145 145  
146 146 /**
147   - *
148 147 * 是否同步
149 148 *
150 149 * @param marketId 市场 ID
... ... @@ -185,7 +184,7 @@ public abstract class AbstractBillHandler&lt;T extends BaseBillCo&gt; implements TypeM
185 184 };
186 185 var dynamicParam = transMapper.getFixedWithQueryArrays(systemCode, dynamicType.code, marketId, SelectType.FIXED.getCode(), queryArrays);
187 186 Map<String, BusinessDetailDto> map = new HashMap<>();
188   - if (!ObjectUtils.isEmpty(dynamicParam)){
  187 + if (!ObjectUtils.isEmpty(dynamicParam)) {
189 188 dynamicParam.forEach(e -> map.computeIfAbsent(e.getCode(), k -> e));
190 189 }
191 190 return map;
... ... @@ -203,7 +202,7 @@ public abstract class AbstractBillHandler&lt;T extends BaseBillCo&gt; implements TypeM
203 202 var queryArrays = new String[]{BasicEnum.CHARGE_ITEM_TO_LOWER.code};
204 203 var dynamicParam = transMapper.getFixedWithQueryArrays(systemCode, dynamicType.code, marketId, SelectType.FIXED.getCode(), queryArrays);
205 204 Map<String, List<BusinessDetailDto>> map = new HashMap<>();
206   - if (!ObjectUtils.isEmpty(dynamicParam)){
  205 + if (!ObjectUtils.isEmpty(dynamicParam)) {
207 206 dynamicParam.forEach(e -> map.computeIfAbsent(e.getCode(), k -> new ArrayList<>()).add(e));
208 207 }
209 208 return map;
... ... @@ -229,11 +228,12 @@ public abstract class AbstractBillHandler&lt;T extends BaseBillCo&gt; implements TypeM
229 228 for (T e : ts) {
230 229 var billId = e.getFBillTypeID().getFNUMBER();
231 230 String documentType = getDocumentType(marketId, systemCode, billId);
232   - if (ObjectUtils.isEmpty(documentType)){
  231 + if (ObjectUtils.isEmpty(documentType)) {
233 232 throw new ThirdPartyException("未配置业务映射");
234 233 }
235   -// e.getFBillTypeID().setFNUMBER("YSD01_SYS");//TODO TEST
236   - util.createOnePurchaseOrder(JsonUtils.toJsonString(e), documentType);
  234 + if (util.getPurchaseOrder(e.getFBillTypeID().getFNUMBER(), e.getF_ZDB_Text1())) {
  235 + util.createOnePurchaseOrder(JsonUtils.toJsonString(e), documentType);
  236 + }
237 237 }
238 238 }
239 239  
... ... @@ -246,8 +246,8 @@ public abstract class AbstractBillHandler&lt;T extends BaseBillCo&gt; implements TypeM
246 246 * @return {@link String}
247 247 */
248 248 protected String getDocumentType(Long marketId, String systemCode, String billTypeId) {
249   - var res = transMapper.getMappingDict(BasicEnum.FINANCIAL_BUSINESS_TYPE_TO_LOWER.code,systemCode, marketId, billTypeId);
250   - return ObjectUtils.isEmpty(res)?null:res.getMapType();
  249 + var res = transMapper.getMappingDict(BasicEnum.FINANCIAL_BUSINESS_TYPE_TO_LOWER.code, systemCode, marketId, billTypeId);
  250 + return ObjectUtils.isEmpty(res) ? null : res.getMapType();
251 251 }
252 252  
253 253  
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/co/business/BaseBillCo.java
... ... @@ -31,7 +31,7 @@ public class BaseBillCo implements Serializable {
31 31 private FSettleTypeID FSettleTypeID;
32 32 private List<FEntityDetail> FEntityDetail;
33 33 private String F_ZDB_Text;
34   - private String FBillNo;
  34 + private String F_ZDB_Text1;
35 35  
36 36 @JsonProperty("systemDynamicCode")
37 37 public String getSystemDynamicCode() {
... ... @@ -51,6 +51,15 @@ public class BaseBillCo implements Serializable {
51 51 F_ZDB_Text = f_ZDB_Text;
52 52 }
53 53  
  54 + @JsonProperty("F_ZDB_Text1")
  55 + public String getF_ZDB_Text1() {
  56 + return F_ZDB_Text1;
  57 + }
  58 +
  59 + public void setF_ZDB_Text1(String f_ZDB_Text1) {
  60 + F_ZDB_Text1 = f_ZDB_Text1;
  61 + }
  62 +
54 63 @JsonProperty("FAR_Remark")
55 64 public String getFAR_Remark() {
56 65 return FAR_Remark;
... ... @@ -203,13 +212,4 @@ public class BaseBillCo implements Serializable {
203 212 public void setFEntityDetail(List<FEntityDetail> FEntityDetail) {
204 213 this.FEntityDetail = FEntityDetail;
205 214 }
206   -
207   - @JsonProperty("FBillNo")
208   - public String getFBillNo() {
209   - return FBillNo;
210   - }
211   -
212   - public void setFBillNo(String FBillNo) {
213   - this.FBillNo = FBillNo;
214   - }
215 215 }
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/message/GeneralQueryMessage.java 0 → 100644
  1 +package com.diligrp.etrade.thirdparty.message;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonProperty;
  4 +
  5 +/**
  6 + * 常规查询消息
  7 + *
  8 + * @author zhangmeiyang
  9 + * @Author: zhangmeiyang
  10 + * @CreateTime: 2024-11-06 18:53
  11 + * @Version: todo
  12 + * @date 2024/11/06
  13 + */
  14 +public class GeneralQueryMessage {
  15 + private String FormId;
  16 + private String FilterString;
  17 + private String FieldKeys;
  18 +
  19 + @JsonProperty("FormId")
  20 + public String getFormId() {
  21 + return FormId;
  22 + }
  23 +
  24 + public void setFormId(String formId) {
  25 + FormId = formId;
  26 + }
  27 +
  28 + @JsonProperty("FilterString")
  29 + public String getFilterString() {
  30 + return FilterString;
  31 + }
  32 +
  33 + public void setFilterString(String filterString) {
  34 + FilterString = filterString;
  35 + }
  36 +
  37 + @JsonProperty("FieldKeys")
  38 + public String getFieldKeys() {
  39 + return FieldKeys;
  40 + }
  41 +
  42 + public void setFieldKeys(String fieldKeys) {
  43 + FieldKeys = fieldKeys;
  44 + }
  45 +}
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/utils/PurchaseOrderApiUtils.java
1 1 package com.diligrp.etrade.thirdparty.utils;
2 2  
  3 +import com.diligrp.etrade.core.util.JsonUtils;
  4 +import com.diligrp.etrade.thirdparty.message.GeneralQueryMessage;
3 5 import com.kingdee.bos.webapi.entity.IdentifyInfo;
4 6 import org.slf4j.Logger;
5 7 import org.slf4j.LoggerFactory;
6 8  
  9 +import java.util.List;
  10 +
7 11 /**
8 12 * 采购订单 API 实用程序
9 13 *
... ... @@ -20,12 +24,25 @@ public class PurchaseOrderApiUtils extends BaseApiUtils {
20 24 super(identifyInfo);
21 25 }
22 26  
  27 + public boolean getPurchaseOrder(String FBillTypeID, String F_ZDB_text1) throws Exception {
  28 + String FilterString = """
  29 + FBillTypeID.FNumber = '%s' and F_ZDB_text1 ='%s'
  30 + """.formatted(FBillTypeID, F_ZDB_text1);
  31 + var query = new GeneralQueryMessage();
  32 + query.setFilterString(FilterString);
  33 + query.setFieldKeys("FID");
  34 + query.setFormId("AR_receivable");
  35 + List<List<Object>> res = api.executeBillQuery(JsonUtils.toJsonString(query));
  36 + log.info("采购订单接口查回数据,json数据:{}", res);
  37 + return res.isEmpty();
  38 + }
  39 +
23 40  
24   - public void createOnePurchaseOrder(String json,String formId) throws Exception {
25   - save(createSendMessageWithAudit(json),formId);
  41 + public void createOnePurchaseOrder(String json, String formId) throws Exception {
  42 + save(createSendMessageWithAudit(json), formId);
26 43 }
27 44  
28   - private void save(String json,String formId) throws Exception {
  45 + private void save(String json, String formId) throws Exception {
29 46 log.info("采购订单接口json数据:{}", json);
30 47 String res = api.save(formId, json);
31 48 var repoRet = getRepoRet(res);
... ...