Compare commits

...

2 Commits

Author SHA1 Message Date
YXY c129c09624 同步job修改唯一键信息
continuous-integration/drone/push Build is passing Details
1 year ago
YXY 6c4fd44463 同步job修改唯一键等信息
1 year ago

@ -65,7 +65,7 @@ public interface ErpLarkRelationMapper
public List<ErpLarkRelation> queryListByKeyList(@Param("keyList") List<String> keyList,@Param("method") String method); public List<ErpLarkRelation> queryListByKeyList(@Param("keyList") List<String> keyList,@Param("method") String method);
public List<ErpLarkRelation> queryListByKeyListAndRemark(@Param("keyList") List<String> keyList,@Param("method") String method,@Param("remark") String remark); public List<ErpLarkRelation> queryListByKeyListAndRemark(@Param("keyList") List<String> keyList,@Param("method") String method,@Param("remark") String remark,@Param("tableId") String tableId);
public List<String> queryWaitDeleteRecordList(@Param("currentDay") String currentDay,@Param("method") String method,@Param("remark") String remark); public List<String> queryWaitDeleteRecordList(@Param("currentDay") String currentDay,@Param("method") String method,@Param("remark") String remark);
public void deleteRecordList(@Param("currentDay") String currentDay,@Param("method") String method,@Param("remark") String remark); public void deleteRecordList(@Param("currentDay") String currentDay,@Param("method") String method,@Param("remark") String remark);
/** /**

@ -37,6 +37,7 @@ import java.util.stream.Collectors;
/** /**
* *
*
* @author yuxiangyong * @author yuxiangyong
* @create 2023-10-11 19:54 * @create 2023-10-11 19:54
*/ */
@ -95,7 +96,7 @@ public abstract class CJTOperateCallBackAbstract {
} }
Date date = new Date(); Date date = new Date();
ErpLarkTempRelation erpLarkTempRelation = new ErpLarkTempRelation(); ErpLarkTempRelation erpLarkTempRelation = new ErpLarkTempRelation();
erpLarkTempRelation.setKey(req.getBody().getString("voucherID")); erpLarkTempRelation.setKey(req.getVoucherId());
erpLarkTempRelation.setMethod(req.getMsgType()); erpLarkTempRelation.setMethod(req.getMsgType());
erpLarkTempRelation.setLarkKey(req.getAppId()); erpLarkTempRelation.setLarkKey(req.getAppId());
erpLarkTempRelation.setCreateBy("System"); erpLarkTempRelation.setCreateBy("System");
@ -129,6 +130,7 @@ public abstract class CJTOperateCallBackAbstract {
/** /**
* *
*
* @param req * @param req
*/ */
protected abstract void syncRecord(CJTEdiCallbackRequestVo req, JSONObject returnBody); protected abstract void syncRecord(CJTEdiCallbackRequestVo req, JSONObject returnBody);
@ -198,9 +200,6 @@ public abstract class CJTOperateCallBackAbstract {
} }
protected void addRecord(CJTEdiCallbackRequestVo req, JSONObject header) { protected void addRecord(CJTEdiCallbackRequestVo req, JSONObject header) {
//多维表格id //多维表格id
String toTableId = req.getLarkToTableId(); String toTableId = req.getLarkToTableId();
@ -247,27 +246,18 @@ public abstract class CJTOperateCallBackAbstract {
LarkTableRequest request = this.buildLarkTableRequest(req); LarkTableRequest request = this.buildLarkTableRequest(req);
CjtAccountEnum cjtAccountEnum = req.getCjtAccountEnum(); CjtAccountEnum cjtAccountEnum = req.getCjtAccountEnum();
//获取已经存在的明细 //获取已经存在的明细
Map<String, ErpLarkRelation> existMap = getExistRecords(req).stream().collect(Collectors.toMap(ErpLarkRelation::getKey, Function.identity(), (K1, k2) -> K1)); List<ErpLarkRelation> existRecords = getExistRecords(req);
if (existMap != null && existMap.size() > 0){ if (CollectionUtils.isNotEmpty(existRecords)) {
List<ErpLarkRelation> collect = existMap.values().stream().collect(Collectors.toList()); toTableId = existRecords.get(0).getLarkTable();
toTableId = collect.get(0).getLarkTable();
} }
//因为可能存在修改的情况,所以这里全部删除重新创建
operateDelete(req, existRecords);
List<String> errorList = new ArrayList<>(); List<String> errorList = new ArrayList<>();
for (int i = 0; i < details.size(); i++) { for (int i = 0; i < details.size(); i++) {
JSONObject detail = details.getJSONObject(i); JSONObject detail = details.getJSONObject(i);
String uniqueKey = buildUniqueKey(toTableId, header, detail, cjtAccountEnum); String uniqueKey = buildUniqueKey(toTableId, header, detail, cjtAccountEnum);
Map<String, Object> larkBody = buildLarkBody(header, detail, cjtAccountEnum); Map<String, Object> larkBody = buildLarkBody(header, detail, cjtAccountEnum);
request.setBody(larkBody); request.setBody(larkBody);
if (existMap.containsKey(uniqueKey)){
try {
ErpLarkRelation erpLarkRelation = existMap.get(uniqueKey);
request.setRecord(erpLarkRelation.getLarkKey());
request.setAppTable(erpLarkRelation.getLarkTable());
larkTableHelper.updateTableRecord(request);
}catch (Exception e){
errorList.add(e.getMessage());
}
}else {
try { try {
request.setRecord(null); request.setRecord(null);
request.setAppTable(toTableId); request.setAppTable(toTableId);
@ -278,10 +268,10 @@ public abstract class CJTOperateCallBackAbstract {
errorList.add(e.getMessage()); errorList.add(e.getMessage());
} }
} }
}
if (CollectionUtils.isEmpty(errorList)) { if (CollectionUtils.isEmpty(errorList)) {
req.setRetry(Boolean.FALSE); req.setRetry(Boolean.FALSE);
} }
if (!org.springframework.util.CollectionUtils.isEmpty(waitCreateRelationList)) { if (!org.springframework.util.CollectionUtils.isEmpty(waitCreateRelationList)) {
erpLarkRelationMapper.batchInsert(waitCreateRelationList); erpLarkRelationMapper.batchInsert(waitCreateRelationList);
} }
@ -290,16 +280,19 @@ public abstract class CJTOperateCallBackAbstract {
} }
} }
protected abstract String getDetailName(); protected abstract String getDetailName();
/** /**
* key * key
*
* @return * @return
*/ */
protected abstract String buildUniqueKey(String toTableId, JSONObject header, JSONObject detail, CjtAccountEnum cjtAccountEnum); protected abstract String buildUniqueKey(String toTableId, JSONObject header, JSONObject detail, CjtAccountEnum cjtAccountEnum);
/** /**
* body * body
*
* @return * @return
*/ */
protected abstract Map<String, Object> buildLarkBody(JSONObject header, JSONObject detail, CjtAccountEnum cjtAccountEnum); protected abstract Map<String, Object> buildLarkBody(JSONObject header, JSONObject detail, CjtAccountEnum cjtAccountEnum);
@ -333,12 +326,18 @@ public abstract class CJTOperateCallBackAbstract {
/** /**
* *
*
* @param req * @param req
*/ */
protected void deleteRecord(CJTEdiCallbackRequestVo req) { protected void deleteRecord(CJTEdiCallbackRequestVo req) {
List<ErpLarkRelation> relationList = getExistRecords(req);
operateDelete(req, relationList);
}
private void operateDelete(CJTEdiCallbackRequestVo req, List<ErpLarkRelation> relationList) {
LarkTableRequest request = new LarkTableRequest(req.getLarkAppId(), req.getLarkAppSecret(), req.getLarkToAppToken(), null); LarkTableRequest request = new LarkTableRequest(req.getLarkAppId(), req.getLarkAppSecret(), req.getLarkToAppToken(), null);
Map<String, List<String>> waitDeleteLarkMap = new HashMap<>(); Map<String, List<String>> waitDeleteLarkMap = new HashMap<>();
List<ErpLarkRelation> relationList = getExistRecords(req);
List<Long> waitDeleteIdList = new ArrayList<>(); List<Long> waitDeleteIdList = new ArrayList<>();
for (ErpLarkRelation record : relationList) { for (ErpLarkRelation record : relationList) {
String appTable = record.getLarkTable(); String appTable = record.getLarkTable();
@ -360,6 +359,7 @@ public abstract class CJTOperateCallBackAbstract {
} }
} }
protected List<ErpLarkRelation> getExistRecords(CJTEdiCallbackRequestVo req) { protected List<ErpLarkRelation> getExistRecords(CJTEdiCallbackRequestVo req) {
CjtAccountEnum cjtAccountEnum = req.getCjtAccountEnum(); CjtAccountEnum cjtAccountEnum = req.getCjtAccountEnum();
ErpLarkRelation erpLarkRelation = new ErpLarkRelation(); ErpLarkRelation erpLarkRelation = new ErpLarkRelation();
@ -392,7 +392,6 @@ public abstract class CJTOperateCallBackAbstract {
// String ticket = (String) redisCache.getCacheObject(ticketCacheKey); // String ticket = (String) redisCache.getCacheObject(ticketCacheKey);
// req.setTicket(ticket); // req.setTicket(ticket);
// } // }
private String buildCacheUniqueKey(String key, String appKey) { private String buildCacheUniqueKey(String key, String appKey) {
return String.format("%s:%s", key, appKey); return String.format("%s:%s", key, appKey);
} }
@ -424,6 +423,7 @@ public abstract class CJTOperateCallBackAbstract {
} }
return responseBody.getData(); return responseBody.getData();
} }
protected String buildErrorBody(LarkCJTRequest req, String errorMessage) { protected String buildErrorBody(LarkCJTRequest req, String errorMessage) {
JSONObject errorInfo = new JSONObject(); JSONObject errorInfo = new JSONObject();
errorInfo.put("url", req.getUrl()); errorInfo.put("url", req.getUrl());

@ -43,8 +43,8 @@ public class ManufactureOrderSyncCallOperate extends CJTOperateCallBackAbstract
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
if (cjtAccountEnum.getCode().equals(CjtAccountEnum.TWO.getCode())){ if (cjtAccountEnum.getCode().equals(CjtAccountEnum.TWO.getCode())){
sb.append(detail.get("Quantity")).append("_"); sb.append(detail.get("Quantity")).append("_");
sb.append(getSpecialKey(detail, "pubuserdefnvc3")).append("_"); sb.append(getSpecialKey(detail, "pubuserdefnvc2")).append("_");
sb.append(getSpecialKey(detail, "pubuserdefnvc3")).append("_"); sb.append(getSpecialKey(detail, "priuserdefnvc1")).append("_");
}else { }else {
sb.append(detail.get("SourceVoucherCode")).append("_"); sb.append(detail.get("SourceVoucherCode")).append("_");
sb.append(header.get("Code")).append("_"); sb.append(header.get("Code")).append("_");

@ -54,7 +54,7 @@
<select id="queryListByKeyListAndRemark" resultMap="ErpLarkRelationResult"> <select id="queryListByKeyListAndRemark" resultMap="ErpLarkRelationResult">
select `key`, `method`,lark_key select `key`, `method`,lark_key
from erp_lark_relation from erp_lark_relation
where `method` = #{method} and remark = #{remark} and `key` in where `method` = #{method} and lark_table = #{tableId} and remark = #{remark} and `key` in
<foreach collection="keyList" open="(" separator="," close=")" item="item"> <foreach collection="keyList" open="(" separator="," close=")" item="item">
#{item} #{item}
</foreach> </foreach>

@ -66,6 +66,7 @@ public class ManufactureOrderSyncJob extends SyncAccountsJobAbstract {
@Override @Override
protected List<String> getQueryFields() { protected List<String> getQueryFields() {
return Arrays.asList( return Arrays.asList(
"ManufactureOrder.ID",
"ManufactureOrder.VoucherDate", "ManufactureOrder.VoucherDate",
"ManufactureOrder.ManufactureOrderDetails.SourceVoucherCode", "ManufactureOrder.ManufactureOrderDetails.SourceVoucherCode",
"ManufactureOrder.Code", "ManufactureOrder.Code",

@ -63,6 +63,7 @@ public class PurchaseArrivalOpenSyncJob extends SyncAccountsJobAbstract{
@Override @Override
protected List<String> getQueryFields() { protected List<String> getQueryFields() {
return Arrays.asList( return Arrays.asList(
"PurchaseArrival.ID",
"PurchaseArrival.PurchaseOrderCode", "PurchaseArrival.PurchaseOrderCode",
"PurchaseArrival.Details.Inventory.Code", "PurchaseArrival.Details.Inventory.Code",
"PurchaseArrival.Details.Inventory.Name", "PurchaseArrival.Details.Inventory.Name",

@ -53,6 +53,7 @@ public class PurchaseOrderSyncJob extends SyncAccountsJobAbstract{
@Override @Override
protected List<String> getQueryFields() { protected List<String> getQueryFields() {
return Arrays.asList( return Arrays.asList(
"PurchaseOrder.ID",
"PurchaseOrder.VoucherDate", "PurchaseOrder.VoucherDate",
"PurchaseOrder.Code", "PurchaseOrder.Code",
"PurchaseOrder.Partner.Name", "PurchaseOrder.Partner.Name",

@ -69,6 +69,7 @@ public class SaleDeliverySyncJob extends SyncAccountsJobAbstract {
@Override @Override
protected List<String> getQueryFields() { protected List<String> getQueryFields() {
return Arrays.asList( return Arrays.asList(
"SaleDelivery.ID",
"SaleDelivery.Code", "SaleDelivery.Code",
"SaleDelivery.Customer.Name", "SaleDelivery.Customer.Name",
"SaleDelivery.BusinessType.Name", "SaleDelivery.BusinessType.Name",

@ -60,6 +60,7 @@ public class SaleDispatchSyncJob extends SyncAccountsJobAbstract{
@Override @Override
protected List<String> getQueryFields() { protected List<String> getQueryFields() {
return Arrays.asList( return Arrays.asList(
"RDRecord.Id",
"RDRecord.RDRecordDetails.SourceVoucherCode", "RDRecord.RDRecordDetails.SourceVoucherCode",
"RDRecord.VoucherDate", "RDRecord.VoucherDate",
"RDRecord.Code", "RDRecord.Code",

@ -67,6 +67,7 @@ public class SaleOrderSyncJob extends SyncAccountsJobAbstract{
@Override @Override
protected List<String> getQueryFields() { protected List<String> getQueryFields() {
return Arrays.asList( return Arrays.asList(
"SaleOrder.ID",
"SaleOrder.voucherdate", "SaleOrder.voucherdate",
"SaleOrder.code", "SaleOrder.code",
"SaleOrder.createdtime", "SaleOrder.createdtime",

@ -15,6 +15,7 @@ import com.ruoyi.flyingbook.domain.LarkCompanyRelation;
import com.ruoyi.flyingbook.domain.LarkTableRelation; import com.ruoyi.flyingbook.domain.LarkTableRelation;
import com.ruoyi.flyingbook.domain.lark.LarkTableRequest; import com.ruoyi.flyingbook.domain.lark.LarkTableRequest;
import com.ruoyi.flyingbook.mapper.ErpLarkRelationMainMapper; import com.ruoyi.flyingbook.mapper.ErpLarkRelationMainMapper;
import com.ruoyi.flyingbook.mapper.ErpLarkRelationMapper;
import com.ruoyi.flyingbook.mapper.LarkCompanyRelationMapper; import com.ruoyi.flyingbook.mapper.LarkCompanyRelationMapper;
import com.ruoyi.flyingbook.mapper.LarkTableRelationMapper; import com.ruoyi.flyingbook.mapper.LarkTableRelationMapper;
import com.ruoyi.quartz.domain.*; import com.ruoyi.quartz.domain.*;
@ -48,7 +49,7 @@ public abstract class SyncAccountsJobAbstract {
@Autowired @Autowired
private RedisCache redisCache; private RedisCache redisCache;
@Autowired @Autowired
protected ErpLarkRelationMainMapper erpLarkRelationMapper; protected ErpLarkRelationMapper erpLarkRelationMapper;
@Autowired @Autowired
private LarkCompanyRelationMapper larkCompanyRelationMapper; private LarkCompanyRelationMapper larkCompanyRelationMapper;
@Autowired @Autowired
@ -92,25 +93,26 @@ public abstract class SyncAccountsJobAbstract {
private static final String REQUEST_GENERATE_TOKEN_PATH = REQUEST_ROOT_PATH + "/v1/common/auth/selfBuiltApp/generateToken"; private static final String REQUEST_GENERATE_TOKEN_PATH = REQUEST_ROOT_PATH + "/v1/common/auth/selfBuiltApp/generateToken";
private Boolean asynchronousCheck(LocalDateTime now, String cjt) { private Boolean asynchronousCheck(LocalDateTime now, String cjt) {
int hour = now.getHour();
if ((hour == 1 && CjtAccountEnum.ONE.getCode().equals(cjt))
|| (hour == 3 && CjtAccountEnum.TWO.getCode().equals(cjt))) {
//目前只给畅捷通账号二加工单开补偿
// if ((AppType.SYNC_CJT_MANUFACTURE_ORDER_DATA_TO_MULTI_TABLE.getCode().equals(syncLarkAppType().getCode())
// && CjtAccountEnum.TWO.getCode().equals(cjt)) || (AppType.SYNC_CJT_SALE_DISPATCH_DATA_TO_MULTI_TABLE.getCode().equals(syncLarkAppType().getCode())
// && CjtAccountEnum.ONE.getCode().equals(cjt))) {
String asynchronous = getAsynchronousKey(cjt);
Object cacheObject = redisCache.getCacheObject(asynchronous);
if (cacheObject != null) {
return Boolean.FALSE;
}
redisCache.setCacheObject(asynchronous, asynchronous, 2, TimeUnit.HOURS);
return Boolean.TRUE;
// } else {
// return false;
// }
}
return false; return false;
// int hour = now.getHour();
// if ((hour == 1 && CjtAccountEnum.ONE.getCode().equals(cjt))
// || (hour == 3 && CjtAccountEnum.TWO.getCode().equals(cjt))) {
// //目前只给畅捷通账号二加工单开补偿
//// if ((AppType.SYNC_CJT_MANUFACTURE_ORDER_DATA_TO_MULTI_TABLE.getCode().equals(syncLarkAppType().getCode())
//// && CjtAccountEnum.TWO.getCode().equals(cjt)) || (AppType.SYNC_CJT_SALE_DISPATCH_DATA_TO_MULTI_TABLE.getCode().equals(syncLarkAppType().getCode())
//// && CjtAccountEnum.ONE.getCode().equals(cjt))) {
// String asynchronous = getAsynchronousKey(cjt);
// Object cacheObject = redisCache.getCacheObject(asynchronous);
// if (cacheObject != null) {
// return Boolean.FALSE;
// }
// redisCache.setCacheObject(asynchronous, asynchronous, 2, TimeUnit.HOURS);
// return Boolean.TRUE;
//// } else {
//// return false;
//// }
// }
// return false;
} }
private String getAsynchronousKey(String cjt) { private String getAsynchronousKey(String cjt) {
@ -366,7 +368,6 @@ public abstract class SyncAccountsJobAbstract {
List<List<String>> rows = new ArrayList<>(); List<List<String>> rows = new ArrayList<>();
do { do {
try { try {
TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition);
//初始化数据 //初始化数据
if (cjtRequestBody == null) { if (cjtRequestBody == null) {
cjtRequestBody = new CJTRequestBody(page, PAGE_SIZE, getQueryFields(), getQueryCondition(context)); cjtRequestBody = new CJTRequestBody(page, PAGE_SIZE, getQueryFields(), getQueryCondition(context));
@ -390,7 +391,6 @@ public abstract class SyncAccountsJobAbstract {
throw new RuntimeException(String.format("存在同步失败的记录 %s", errorKey)); throw new RuntimeException(String.format("存在同步失败的记录 %s", errorKey));
} }
} }
dataSourceTransactionManager.commit(transactionStatus);
} catch (Exception e) { } catch (Exception e) {
log.error("{} exception", this.getClassName(), e); log.error("{} exception", this.getClassName(), e);
errorMessage = buildErrorBody(cjtRequest, e.getMessage()); errorMessage = buildErrorBody(cjtRequest, e.getMessage());
@ -415,7 +415,7 @@ public abstract class SyncAccountsJobAbstract {
midList.add(row.get(i)); midList.add(row.get(i));
} }
} }
String uniqueKey = String.join("_", midList).toUpperCase() + "_" + addRecordRequest.getAppTable(); String uniqueKey = String.join("_", midList).toUpperCase();
result.add(uniqueKey); result.add(uniqueKey);
} }
} }
@ -433,7 +433,8 @@ public abstract class SyncAccountsJobAbstract {
if (CollectionUtils.isEmpty(uniqueKeyList)) { if (CollectionUtils.isEmpty(uniqueKeyList)) {
return new HashMap<>(); return new HashMap<>();
} }
return erpLarkRelationMapper.queryListByKeyListAndRemark(uniqueKeyList, getRequestUrl(), cjt) //todo yxy 这里记得加上表id
return erpLarkRelationMapper.queryListByKeyListAndRemark(uniqueKeyList, getRequestUrl(), cjt,addRecordRequest.getAppTable())
.stream().collect(Collectors.toMap(ErpLarkRelation::getKey, ErpLarkRelation::getLarkKey, (k1, k2) -> k1)); .stream().collect(Collectors.toMap(ErpLarkRelation::getKey, ErpLarkRelation::getLarkKey, (k1, k2) -> k1));
} }
@ -474,6 +475,7 @@ public abstract class SyncAccountsJobAbstract {
createTimeKey = "createdtime"; createTimeKey = "createdtime";
} }
String createTime = null; String createTime = null;
String voucherId = null;
for (List<String> row : rows) { for (List<String> row : rows) {
String uniqueKey = null; String uniqueKey = null;
try { try {
@ -482,20 +484,28 @@ public abstract class SyncAccountsJobAbstract {
for (int i = 0; i < row.size(); i++) { for (int i = 0; i < row.size(); i++) {
String rowKey = keyList.get(i); String rowKey = keyList.get(i);
String value = row.get(i); String value = row.get(i);
if (createTimeKey.equals(rowKey.toLowerCase())){ String lowerCaseRowKey = rowKey.toLowerCase();
if (createTimeKey.equals(lowerCaseRowKey)){
createTime = value; createTime = value;
} }
if ("id".equals(lowerCaseRowKey)){
voucherId = value;
}
CJTSyncTypeRelation cjtSyncTypeRelation = queryFieldsMap.get(rowKey);
if (uniqueFields.contains(rowKey)) { if (uniqueFields.contains(rowKey)) {
if (cjtSyncTypeRelation != null && TableFieldTypeEnum.NUMBER.equals(cjtSyncTypeRelation.getType())){
uniqueKeyList.add(Double.valueOf(value) + "0");
}else {
uniqueKeyList.add(value); uniqueKeyList.add(value);
} }
CJTSyncTypeRelation cjtSyncTypeRelation = queryFieldsMap.get(rowKey); }
if (cjtSyncTypeRelation == null) { if (cjtSyncTypeRelation == null) {
continue; continue;
} }
String larkLabel = cjtSyncTypeRelation.getLarkFileName(); String larkLabel = cjtSyncTypeRelation.getLarkFileName();
body.put(larkLabel, this.changeValueType(value, cjtSyncTypeRelation)); body.put(larkLabel, this.changeValueType(value, cjtSyncTypeRelation));
} }
uniqueKey = String.join("_", uniqueKeyList).toUpperCase() + "_" + addRecordRequest.getAppTable(); uniqueKey = String.join("_", uniqueKeyList).toUpperCase();
Boolean existFlag = redisCache.setCacheObjectIfAbsent("CJT_JOB_CACHE:"+uniqueKey, "1", 2L, TimeUnit.HOURS); Boolean existFlag = redisCache.setCacheObjectIfAbsent("CJT_JOB_CACHE:"+uniqueKey, "1", 2L, TimeUnit.HOURS);
if (repeatMap.containsKey(uniqueKey) || !existFlag) { if (repeatMap.containsKey(uniqueKey) || !existFlag) {
continue; continue;
@ -507,7 +517,7 @@ public abstract class SyncAccountsJobAbstract {
//在飞书创建一行并根据创建返回的行id在本地保留一条映射纪律 //在飞书创建一行并根据创建返回的行id在本地保留一条映射纪律
CreateAppTableRecordRespBody respBody = larkTableHelper.addTableRecord(addRecordRequest); CreateAppTableRecordRespBody respBody = larkTableHelper.addTableRecord(addRecordRequest);
larkKey = respBody.getRecord().getRecordId(); larkKey = respBody.getRecord().getRecordId();
relationList.add(buildErpLarkRelation(uniqueKey, larkKey, cjt, asynchronous,createTime)); relationList.add(buildErpLarkRelation(uniqueKey, larkKey, cjt, asynchronous,createTime,voucherId,addRecordRequest.getAppTable()));
} else { } else {
if (!AppType.SYNC_CJT_SALE_DISPATCH_DATA_TO_MULTI_TABLE.equals(syncLarkAppType())) { if (!AppType.SYNC_CJT_SALE_DISPATCH_DATA_TO_MULTI_TABLE.equals(syncLarkAppType())) {
//根据本地保留映射确认飞书的更新行更新后防止影响后续更新需要将行id进行置空 //根据本地保留映射确认飞书的更新行更新后防止影响后续更新需要将行id进行置空
@ -542,9 +552,11 @@ public abstract class SyncAccountsJobAbstract {
} }
//构建飞书行与cjt唯一键的对应关系对象 //构建飞书行与cjt唯一键的对应关系对象
private ErpLarkRelation buildErpLarkRelation(String key, String larkKey, String cjt, Boolean asynchronous,String createTime) { private ErpLarkRelation buildErpLarkRelation(String key, String larkKey, String cjt, Boolean asynchronous,String createTime,String voucherID,String tableId) {
ErpLarkRelation erpLarkRelation = new ErpLarkRelation(); ErpLarkRelation erpLarkRelation = new ErpLarkRelation();
erpLarkRelation.setKey(key); erpLarkRelation.setKey(key);
erpLarkRelation.setCjtId(voucherID);
erpLarkRelation.setLarkTable(tableId);
erpLarkRelation.setLarkKey(larkKey); erpLarkRelation.setLarkKey(larkKey);
erpLarkRelation.setMethod(getRequestUrl()); erpLarkRelation.setMethod(getRequestUrl());
erpLarkRelation.setFlag(FlagStatus.OK.getCode()); erpLarkRelation.setFlag(FlagStatus.OK.getCode());

Loading…
Cancel
Save