diff --git a/src/main/java/com/chint/domain/aggregates/approval/platform/ApprovalPlatformAN.java b/src/main/java/com/chint/domain/aggregates/approval/platform/ApprovalPlatformAN.java index 2a7efea4..6f9116d5 100644 --- a/src/main/java/com/chint/domain/aggregates/approval/platform/ApprovalPlatformAN.java +++ b/src/main/java/com/chint/domain/aggregates/approval/platform/ApprovalPlatformAN.java @@ -102,8 +102,11 @@ public class ApprovalPlatformAN implements ApprovalPlatform { .ifPresent(url -> { ApprovalScheduleParam approvalScheduleParam = createApprovalScheduleParam(approvalData); System.out.println(Json.gson().toJson(approvalScheduleParam)); - CompletableFuture.runAsync(() -> DelayDispatch.attemptToSend(() -> postRequest.post(url, approvalScheduleParam, ANResponse.class) - .getSuccess(), 0)); + postRequest.post(url, approvalScheduleParam, ANResponse.class); + if(false){ + CompletableFuture.runAsync(() -> DelayDispatch.attemptToSend(() -> postRequest.post(url, approvalScheduleParam, ANResponse.class) + .getSuccess(), 6)); + } }); } 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 index 45eeb063..a953f7bf 100644 --- a/src/main/java/com/chint/domain/aggregates/approval/platform/ApprovalPlatformCommon.java +++ b/src/main/java/com/chint/domain/aggregates/approval/platform/ApprovalPlatformCommon.java @@ -13,31 +13,31 @@ 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; +// @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); - }); +// 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) { diff --git a/src/main/java/com/chint/domain/service/order_sync/SupplierOrderSync.java b/src/main/java/com/chint/domain/service/order_sync/SupplierOrderSync.java index 98680b1f..59de7d1c 100644 --- a/src/main/java/com/chint/domain/service/order_sync/SupplierOrderSync.java +++ b/src/main/java/com/chint/domain/service/order_sync/SupplierOrderSync.java @@ -73,7 +73,7 @@ public interface SupplierOrderSync extends SupplierAdapter { boolean isValid = true; // Process each leg - for (Leg leg : legList) { + for (Leg leg : needSyncLegs) { // Perform product check based on leg type and update the isValid flag switch (leg.getLegType()) { case LEG_TYPE_TRAIN -> diff --git a/src/main/java/com/chint/interfaces/rest/base/PostRequest.java b/src/main/java/com/chint/interfaces/rest/base/PostRequest.java index 86f8f519..b8706ced 100644 --- a/src/main/java/com/chint/interfaces/rest/base/PostRequest.java +++ b/src/main/java/com/chint/interfaces/rest/base/PostRequest.java @@ -53,6 +53,7 @@ public class PostRequest { public T post(String url, Object jsonRequest, Class responseType) { HttpPost post = new HttpPost(url); String json = gson.toJson(jsonRequest); + log.info(url); log.info(json); post.setEntity(new StringEntity(json, ContentType.APPLICATION_JSON)); return post(post, responseType); @@ -60,6 +61,7 @@ public class PostRequest { public T post(String url, String json, Class responseType) { HttpPost post = new HttpPost(url); + log.info(url); log.info(json); post.setEntity(new StringEntity(json, ContentType.APPLICATION_JSON)); return post(post, responseType);