diff --git a/src/main/java/com/chint/application/out/LoginController.java b/src/main/java/com/chint/application/out/LoginController.java index 7e5dc478..cdd853fb 100644 --- a/src/main/java/com/chint/application/out/LoginController.java +++ b/src/main/java/com/chint/application/out/LoginController.java @@ -104,15 +104,10 @@ public class LoginController { //发送创建行程订单命令 Command.of(OrderCreateCommand.class).of(currentUser).sendToQueue(); } - - syncUserInfoToSupplier(currentUser); - //清除职级信息 userLoginResult.getUser().setProfLevel(null); userLoginResult.getUser().setManaLevel(null); - - //登录成功之后对该用户的行程规划单进行缓存 cacheUserRouteOrder(currentUser.getEmployeeNo()); return Result.Success(CommonMessageConstant.SUCCESS, userLoginResult); diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/in/CTripNoteController.java b/src/main/java/com/chint/interfaces/rest/ctrip/in/CTripNoteController.java index e0fdcb2d..cc650120 100644 --- a/src/main/java/com/chint/interfaces/rest/ctrip/in/CTripNoteController.java +++ b/src/main/java/com/chint/interfaces/rest/ctrip/in/CTripNoteController.java @@ -85,7 +85,6 @@ public class CTripNoteController { public Result statusEvent(@RequestBody CTripStatusNotification cTripStatusNotification) { String json = gson.toJson(cTripStatusNotification); log.info(json); - //创建回推日志 String productType = cTripStatusNotification.getProductType(); @@ -139,7 +138,6 @@ public class CTripNoteController { return; } } - } diff --git a/src/main/java/com/chint/interfaces/rest/ly/in/CommonController.java b/src/main/java/com/chint/interfaces/rest/ly/in/CommonController.java index 4b9dd52f..c083defe 100644 --- a/src/main/java/com/chint/interfaces/rest/ly/in/CommonController.java +++ b/src/main/java/com/chint/interfaces/rest/ly/in/CommonController.java @@ -34,7 +34,8 @@ import org.springframework.web.bind.annotation.RestController; import java.util.List; import java.util.Objects; -import java.util.concurrent.*; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; @Slf4j @RestController @@ -61,7 +62,7 @@ public class CommonController { private PostRequest basePostRequest; @Autowired - public RedisTemplate redisTemplate; + public RedisTemplate redisTemplate; @Value("${ly.baseUrl}") private String lyBaseUrl; @@ -98,37 +99,37 @@ public class CommonController { } String json = gson.toJson(notification); - log.info("存入Redis{}",json); - redisTemplate.opsForList().leftPush(CommonMessageConstant.COMMON_BACK,json); + log.info("存入Redis{}", json); + redisTemplate.opsForList().leftPush(CommonMessageConstant.COMMON_BACK, json); return new LYNoteResponse("100", "OK"); } - @Scheduled(cron="0/10 * * * * ?") + @Scheduled(cron = "0/10 * * * * ?") @Async public void scanPendingMsg() { - int i=0; + int i = 0; while (true) { Object object = redisTemplate.opsForList().rightPop(CommonMessageConstant.COMMON_BACK, 1, TimeUnit.SECONDS); - if (null == object) { - return; - } - String msg = JSON.toJSONString(object); - Notification notification=gson.fromJson(msg,Notification.class); - int notifyType = notification.getNotifyType(); - switch (notifyType) { - //进行订单数据回推 - case 1 -> getOrderFlight(notification); - case 3 -> getOrderHotel(notification); - case 5 -> getOrderTrain(notification); - case 6 -> getOrderCar(notification); - }; + if (null == object) { + return; + } +// String msg = JSON.toJSONString(object); + Notification notification = gson.fromJson(String.valueOf(object), Notification.class); + int notifyType = notification.getNotifyType(); + switch (notifyType) { + //进行订单数据回推 + case 1 -> getOrderFlight(notification); + case 3 -> getOrderHotel(notification); + case 5 -> getOrderTrain(notification); + case 6 -> getOrderCar(notification); + default -> LYNoteResponse.success(); + }; i++; - if (i>5){ + if (i > 5) { log.info("CommonBack处理结束"); return; } } - } /** diff --git a/src/main/java/com/chint/interfaces/rest/user/UserHttpRequestImpl.java b/src/main/java/com/chint/interfaces/rest/user/UserHttpRequestImpl.java index d906f512..8795760e 100644 --- a/src/main/java/com/chint/interfaces/rest/user/UserHttpRequestImpl.java +++ b/src/main/java/com/chint/interfaces/rest/user/UserHttpRequestImpl.java @@ -248,7 +248,11 @@ public class UserHttpRequestImpl implements UserHttpRequest { user.setName(userData.getUname()); user.setPhoneNumber(userData.getMobilePhone()); user.setCompanyName(userData.getCompany_cn()); - user.setManaLevel(userData.getCust_manaLevel()); + if (userData.getCust_manaLevel() != null) { + user.setManaLevel(userData.getCust_manaLevel()); + } else { + user.setManaLevel(userData.getCust_manaLevelF()); + } user.setProfLevel(userData.getCust_profLevel()); user.setQualityLevel(userData.getCust_qualityLevel()); return user; diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index a8247b5e..9325ffc5 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -7,8 +7,8 @@ spring: username: ${chint.datasource.username} password: ${chint.datasource.password} hikari: - minimum-idle: 10 - maximum-pool-size: 30 # 连接池最大连接数 + minimum-idle: 20 + maximum-pool-size: 50 # 连接池最大连接数 idle-timeout: 300000 # 空闲连接超时时间(毫秒) max-lifetime: 1800000 # 连接的最长生命周期(毫秒) connection-timeout: 60000 # 连接超时时间(毫秒) diff --git a/src/test/java/com/chint/LYTest.java b/src/test/java/com/chint/LYTest.java index 9dcab656..2e83c23e 100644 --- a/src/test/java/com/chint/LYTest.java +++ b/src/test/java/com/chint/LYTest.java @@ -854,7 +854,7 @@ public class LYTest { } - // @Test + @Test void search() { // FlightOrderResponse t1 = lySearchRequest // .getFlightOrderDetail("DF24031466751565416"); @@ -863,7 +863,7 @@ public class LYTest { // System.out.println(json); - TrainDetailResponse trainDetailResponse = lySearchRequest.getTrainOrderDetail(" DTC24031767013846252"); + TrainDetailResponse trainDetailResponse = lySearchRequest.getTrainOrderDetail("DT24041069650132424"); Gson gson = new Gson(); String json = gson.toJson(trainDetailResponse); System.out.println(json); diff --git a/src/test/java/com/chint/RouteApplicationTests.java b/src/test/java/com/chint/RouteApplicationTests.java index bd6bf278..13bcf76e 100644 --- a/src/test/java/com/chint/RouteApplicationTests.java +++ b/src/test/java/com/chint/RouteApplicationTests.java @@ -56,6 +56,7 @@ import java.util.*; import java.util.stream.Collectors; import static com.chint.infrastructure.constant.LocationConstant.*; +import static com.chint.infrastructure.constant.RankConstant.DEFAULT_RANK_NAME; import static com.chint.infrastructure.util.DateTimeUtil.lastMonthStr; @Slf4j @@ -285,7 +286,7 @@ class RouteApplicationTests { @Test void loginSignProd() { - String sfno = "240305077"; + String sfno = "220607056"; String syscode = "FSSC"; String billcode = "CLSQ240225000099"; String companycode = "正泰集团股份有限公司"; @@ -1009,10 +1010,11 @@ class RouteApplicationTests { pushUser.getUserSFDataFromOpenApiBatch(); } -// @Test + @Test void deleteByOrderId() { - orderDetailRepository.deleteById(2988L); - orderDetailRepository.deleteById(2990L); + orderDetailRepository.deleteById(1440L); + orderDetailRepository.deleteById(1441L); + orderDetailRepository.deleteById(1448L); } // @Test @@ -1274,4 +1276,22 @@ class RouteApplicationTests { Optional s = systemDomainService.companyNameByAccountId(null); s.ifPresent(System.out::println); } + +// @Test + void testRankSearch(){ +// user.setManaLevel("M5"); + user.setProfLevel("P5"); + String rankName; + //如果表里没有维护他的职级 , 那么取是sf号的职级 + if (user.getManaLevel() != null) { + rankName = user.getManaLevel(); + } else if (user.getProfLevel() != null) { + rankName = user.getProfLevel(); + } else if (user.getQualityLevel() != null) { + rankName = user.getQualityLevel(); + } else { + rankName = DEFAULT_RANK_NAME; + } + System.out.println(rankName); + } }