订单明细回推 修改redis消息队列

This commit is contained in:
lulz1 2024-04-23 13:26:31 +08:00
parent d6e6746f11
commit b264c5d986
7 changed files with 55 additions and 37 deletions

View File

@ -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);

View File

@ -85,7 +85,6 @@ public class CTripNoteController {
public Result<String> statusEvent(@RequestBody CTripStatusNotification cTripStatusNotification) {
String json = gson.toJson(cTripStatusNotification);
log.info(json);
//创建回推日志
String productType = cTripStatusNotification.getProductType();
@ -139,7 +138,6 @@ public class CTripNoteController {
return;
}
}
}

View File

@ -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<String,String> redisTemplate;
public RedisTemplate<String, String> redisTemplate;
@Value("${ly.baseUrl}")
private String lyBaseUrl;
@ -98,22 +99,22 @@ 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);
// String msg = JSON.toJSONString(object);
Notification notification = gson.fromJson(String.valueOf(object), Notification.class);
int notifyType = notification.getNotifyType();
switch (notifyType) {
//进行订单数据回推
@ -121,14 +122,14 @@ public class CommonController {
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;
}
}
}
/**

View File

@ -248,7 +248,11 @@ public class UserHttpRequestImpl implements UserHttpRequest {
user.setName(userData.getUname());
user.setPhoneNumber(userData.getMobilePhone());
user.setCompanyName(userData.getCompany_cn());
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;

View File

@ -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 # 连接超时时间(毫秒)

View File

@ -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);

View File

@ -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<String> 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);
}
}