diff --git a/src/main/java/com/chint/domain/aggregates/approval/platform/ApprovalPlatformCommon.java b/src/main/java/com/chint/domain/aggregates/approval/platform/ApprovalPlatformCommon.java new file mode 100644 index 00000000..45eeb063 --- /dev/null +++ b/src/main/java/com/chint/domain/aggregates/approval/platform/ApprovalPlatformCommon.java @@ -0,0 +1,91 @@ +package com.chint.domain.aggregates.approval.platform; + +import com.chint.domain.aggregates.approval.ApprovalData; +import com.chint.domain.aggregates.approval.ApprovalResultData; +import com.chint.domain.repository.ApprovalPlatformInfoRepository; +import com.chint.domain.repository.SupplierRepository; +import com.chint.interfaces.rest.base.PostRequest; +import jakarta.annotation.PostConstruct; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; + +import java.util.concurrent.TimeUnit; + + +@Component +public class ApprovalPlatformCommon implements ApprovalPlatform { + + @Autowired + private SupplierRepository supplierRepository; + + @Autowired + private ApprovalPlatformInfoRepository approvalPlatformInfoRepository; + + @Autowired + private PostRequest postRequest; + + @Autowired + private RedisTemplate redisTemplate; + + public static final String platformMark = "COMMON"; + + @PostConstruct + void init() { + approvalPlatformInfoRepository.findByPlatformMark(platformMark) + .ifPresent(approvalPlatformInfo -> { + String cacheKey = getCacheKey(approvalPlatformInfo.getPlatformName(), + approvalPlatformInfo.getPlatformMark()); + redisTemplate.opsForValue().set(cacheKey, approvalPlatformInfo, 1L, TimeUnit.DAYS); + }); + } + + private String getCacheKey(String platformName, String platformMark) { + return "ApprovalPlatform::" + platformName + "::" + platformMark; + } + + @Override + public void submitApproval(ApprovalData approvalData) { + + } + + @Override + public String getApprovalPlatformName() { + return ""; + } + + @Override + public void submitLegAddApproval(ApprovalData approvalData) { + + } + + @Override + public void submitLegChangeApproval(ApprovalData approvalData) { + + } + + @Override + public void submitOrderExpenseApproval(ApprovalData approvalData) { + + } + + @Override + public void submitOrderChangeApproval(ApprovalData approvalData) { + + } + + @Override + public void submitOrderRefundApproval(ApprovalData approvalData) { + + } + + @Override + public void submitLegAddOrChangeApproval(ApprovalData approvalData) { + + } + + @Override + public void receiveApprovalResultCustom(ApprovalResultData resultData) { + + } +} diff --git a/src/main/java/com/chint/domain/service/LegDomainService.java b/src/main/java/com/chint/domain/service/LegDomainService.java index 7b64c270..1dfe745e 100644 --- a/src/main/java/com/chint/domain/service/LegDomainService.java +++ b/src/main/java/com/chint/domain/service/LegDomainService.java @@ -269,7 +269,7 @@ public class LegDomainService { // 根据供应商名称查找供应商并进行处理 return supplierRepository.findBySupplierName(supplierName) .map(supplier -> { - List syncAbleLegItems = ifCanSync(legs, routeOrder, supplier); + List syncAbleLegItems = ifCanSync(filteredLegItems, routeOrder, supplier); syncAbleLegItems.forEach(Leg::reloadStatus); return syncAbleLegItems; }) diff --git a/src/test/java/com/chint/RouteApplicationTests.java b/src/test/java/com/chint/RouteApplicationTests.java index 9396b214..ca1ad2b7 100644 --- a/src/test/java/com/chint/RouteApplicationTests.java +++ b/src/test/java/com/chint/RouteApplicationTests.java @@ -314,7 +314,7 @@ class RouteApplicationTests { @Test void loginSign() { - String sfno = "230615020"; + String sfno = "231213086"; String syscode = "FSSC"; String billcode = "CLSQ240225000100"; String companycode = "正泰集团股份有限公司";