修复同步用户数据的bug

This commit is contained in:
lulz1 2024-03-15 02:41:44 +08:00
parent 4e6dfea6b3
commit 28f214fe6e
4 changed files with 37 additions and 28 deletions

View File

@ -5,26 +5,26 @@ import static com.chint.infrastructure.constant.OrderConstant.*;
public class LYOrderUtil {
public static Integer mapTrainStatus(String status) {
return switch (status) {
case "N" -> ORDER_EVENT_ORDERED; //
case "D" -> ORDER_EVENT_ORDERED; //
case "S" -> ORDER_EVENT_ORDERED; //
case "G" -> ORDER_EVENT_ORDERED; //
case "H" -> ORDER_EVENT_PREPARE; //
case "B" -> ORDER_EVENT_ORDERED; //
case "A" -> ORDER_EVENT_ORDERED; //
case "O" -> ORDER_EVENT_ORDERED; //
case "E" -> ORDER_EVENT_ORDERED; //
case "K" -> ORDER_EVENT_PREPARE; //
case "M" -> ORDER_EVENT_ORDERED; //
case "U" -> ORDER_EVENT_PREPARE; //
case "J" -> ORDER_EVENT_PREPARE; //
case "C" -> ORDER_EVENT_PREPARE; //
case "F" -> ORDER_EVENT_ORDERED; //
case "T" -> ORDER_EVENT_REFUND; //
case "Q" -> ORDER_EVENT_CHANGE; //
case "X" -> ORDER_EVENT_CHANGE; //
case "Y" -> ORDER_EVENT_REFUND; //
default -> ORDER_EVENT_UNKNOWN;
case "N" -> ORDER_EVENT_ORDERED; //占座中
case "D" -> ORDER_EVENT_ORDERED; //待提交
case "S" -> ORDER_EVENT_ORDERED; //待审批
case "G" -> ORDER_EVENT_ORDERED; //审批中
case "H" -> ORDER_EVENT_CANCEL; //审批不通过
case "B" -> ORDER_EVENT_CANCEL; //购票失败
case "A" -> ORDER_EVENT_ORDERED; //待支付
case "O" -> ORDER_EVENT_CANCEL; //订单已过期
case "E" -> ORDER_EVENT_ORDERED; //已申请出票
case "K" -> ORDER_EVENT_PREPARE; //抢票中
case "M" -> ORDER_EVENT_ORDERED; //已付款
case "U" -> ORDER_EVENT_REFUND; //申请出差失败
case "J" -> ORDER_EVENT_CANCEL; //申请抢票失败
case "C" -> ORDER_EVENT_CANCEL; //订单已取消
case "F" -> ORDER_EVENT_ORDERED; //出票成功
case "T" -> ORDER_EVENT_REFUND; //出票失败
case "Q" -> ORDER_EVENT_REFUND; //已全部退票
case "X" -> ORDER_EVENT_CHANGE; //已全部改签
case "Y" -> ORDER_EVENT_CHANGE; //部分改签
default -> ORDER_EVENT_UNKNOWN;//部分退票
};
}
@ -66,7 +66,7 @@ public class LYOrderUtil {
case "3" -> ORDER_EVENT_ORDERED; //待提交
case "4" -> ORDER_EVENT_ORDERED; //待审批
case "10" -> ORDER_EVENT_PREPARE; //超时未支付
case "11" -> ORDER_EVENT_ORDERED; //客户申请取消
case "11" -> ORDER_EVENT_CANCEL; //客户申请取消
case "12" -> ORDER_EVENT_PREPARE; //确认无房
case "13" -> ORDER_EVENT_ORDERED; //审核不通过取消
case "14" -> ORDER_EVENT_ORDERED; //超时未审批
@ -74,8 +74,8 @@ public class LYOrderUtil {
case "16" -> ORDER_EVENT_ORDERED; //确认后用户申请取消
case "17" -> ORDER_EVENT_ORDERED; //确认后客服取消
case "18" -> ORDER_EVENT_CANCEL; //下单失败取消
case "22" -> ORDER_EVENT_CHANGE; //已付款确认中
case "23" -> ORDER_EVENT_CHANGE; //已确认
case "22" -> ORDER_EVENT_ORDERED; //已付款确认中
case "23" -> ORDER_EVENT_ORDERED; //已确认
case "40" -> ORDER_EVENT_ORDERED; //已入住
case "41" -> ORDER_EVENT_ORDERED; //已离店
case "42" -> ORDER_EVENT_UNKNOWN; //Noshow

View File

@ -97,11 +97,20 @@ public class PushUser {
map.put("start", start);
map.put("pageSize", pageSize);
DataCenterResult result = dataCenterService.post(USER_DATA_PATH, map);
if (!result.getSuccess()) {
log.error("Get user error. statusCode={}", result.getCode());
continue;
}
Type type = new TypeToken<List<UserDataDTO>>() {
}.getType();
List<UserDataDTO> userDataDTOs = gson.fromJson(result.getData().toString(), type);
List<User> users = userDataDTOs.stream().filter(it -> jtCompanyDomainService.ifCompanyInJT(null, it.getCompany())
List<User> users = userDataDTOs.stream()
.filter(it -> it.getLoginUsername() != null)
.filter(it -> it.getCompany() != null)
.filter(it -> jtCompanyDomainService.ifCompanyInJT(null, it.getCompany())
|| it.getCompany().equals("A70000056"))
.map(userData -> {
User user = new User();

View File

@ -20,10 +20,10 @@ chint:
logging:
level:
org.springframework.jdbc.core.JdbcTemplate: trace
org.springframework.jdbc.core.StatementCreatorUtils: trace
org.springframework.jdbc.core.JdbcTemplate: info
org.springframework.jdbc.core.StatementCreatorUtils: info
root: info
org.springframework.cache: trace
org.springframework.cache: info
#测试
#ly:

View File

@ -35,7 +35,7 @@ logging:
org.springframework.jdbc.core.JdbcTemplate: info
org.springframework.jdbc.core.StatementCreatorUtils: info
root: info
org.springframework.cache: trace
org.springframework.cache: info
#测试
#ly: