:feat: HCS定时推送后按原单回写合同/项目变更单同步状态

This commit is contained in:
刘泉佳
2026-10-28 14:16:33 +08:00
parent b3b299edcc
commit dc75a8eacd
@@ -42,6 +42,8 @@ import org.springblade.transport.pojo.entity.InvoiceApplication;
import org.springblade.transport.pojo.entity.InvoiceReceipt; import org.springblade.transport.pojo.entity.InvoiceReceipt;
import org.springblade.transport.pojo.entity.PaymentApplication; import org.springblade.transport.pojo.entity.PaymentApplication;
import org.springblade.transport.pojo.entity.ProjectApply; import org.springblade.transport.pojo.entity.ProjectApply;
import org.springblade.transport.service.IContractChangeService;
import org.springblade.transport.service.IProjectChangeService;
import org.springblade.transport.support.hcs.HcsContractSpecSyncSupport; import org.springblade.transport.support.hcs.HcsContractSpecSyncSupport;
import org.springblade.transport.support.hcs.HcsContractSyncSupport; import org.springblade.transport.support.hcs.HcsContractSyncSupport;
import org.springblade.transport.support.hcs.HcsInvoiceRegSyncSupport; import org.springblade.transport.support.hcs.HcsInvoiceRegSyncSupport;
@@ -108,6 +110,8 @@ public class HcsPushTask {
private final HcsPaymentSyncSupport hcsPaymentSyncSupport; private final HcsPaymentSyncSupport hcsPaymentSyncSupport;
private final HcsInvoiceRegSyncSupport hcsInvoiceRegSyncSupport; private final HcsInvoiceRegSyncSupport hcsInvoiceRegSyncSupport;
private final HcsReceiptBillSyncSupport hcsReceiptBillSyncSupport; private final HcsReceiptBillSyncSupport hcsReceiptBillSyncSupport;
private final IContractChangeService contractChangeService;
private final IProjectChangeService projectChangeService;
private final BladeRedis bladeRedis; private final BladeRedis bladeRedis;
/** /**
@@ -211,10 +215,13 @@ public class HcsPushTask {
for (ProjectApply projectApply : projectList) { for (ProjectApply projectApply : projectList) {
try { try {
hcsProjectSyncSupport.pushProject(projectApply); hcsProjectSyncSupport.pushProject(projectApply);
// 推送成功回写原项目最近一条待同步变更单,闭合变更单同步状态(C102-1 首推或 C102-2 更新均覆盖)
projectChangeService.writeBackSyncStatus(projectApply.getId(), HcsSyncConstant.HCS_STATUS_SYNCED);
successCount++; successCount++;
} catch (Exception exception) { } catch (Exception exception) {
String message = StringUtil.isBlank(exception.getMessage()) ? "推送异常" : exception.getMessage(); String message = StringUtil.isBlank(exception.getMessage()) ? "推送异常" : exception.getMessage();
hcsProjectSyncSupport.markFailed(projectApply, message); hcsProjectSyncSupport.markFailed(projectApply, message);
projectChangeService.writeBackSyncStatus(projectApply.getId(), HcsSyncConstant.HCS_STATUS_FAILED);
failCount++; failCount++;
} }
} }
@@ -242,10 +249,13 @@ public class HcsPushTask {
for (ContractManage contractManage : contractList) { for (ContractManage contractManage : contractList) {
try { try {
hcsContractSyncSupport.pushContract(contractManage); hcsContractSyncSupport.pushContract(contractManage);
// 推送成功回写原合同最近一条待同步变更单,闭合变更单同步状态(C103-1 首推或 C103-11 更新均覆盖)
contractChangeService.writeBackSyncStatus(contractManage.getId(), HcsSyncConstant.HCS_STATUS_SYNCED);
successCount++; successCount++;
} catch (Exception exception) { } catch (Exception exception) {
String message = StringUtil.isBlank(exception.getMessage()) ? "推送异常" : exception.getMessage(); String message = StringUtil.isBlank(exception.getMessage()) ? "推送异常" : exception.getMessage();
hcsContractSyncSupport.markFailed(contractManage, message); hcsContractSyncSupport.markFailed(contractManage, message);
contractChangeService.writeBackSyncStatus(contractManage.getId(), HcsSyncConstant.HCS_STATUS_FAILED);
failCount++; failCount++;
} }
} }