同步代码

This commit is contained in:
lulz1 2024-02-28 09:06:48 +08:00
parent 126953bd85
commit 626968a7f0
14 changed files with 25 additions and 25 deletions

View File

@ -91,7 +91,7 @@ public class PailaLoginStrategy implements LoginStrategy {
UserDTO userDTO = JSON.parseObject(userInfoResBody, UserDTO.class);
User user;
if (userDTO != null) {
user = userRepository.findByUserEmployeeNo(Long.parseLong(userDTO.getUid()));
user = userRepository.findByUserEmployeeNo(userDTO.getUid());
if (user == null) {
user = userFactory.create(userDTO.getUid());
userHttpRequest.loadUserInfo(user);

View File

@ -45,7 +45,7 @@ public class RouteOrder extends BaseEntity {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime bookingTime;
private Long userId;
private String userId;
private String supplierName;
//差标等级
private String standardLevel;

View File

@ -20,7 +20,7 @@ import java.util.Map;
public class User {
@Id
private Long userId;
private Long employeeNo;
private String employeeNo;
private Integer employeeLevel;
private String name;
private String email;
@ -43,11 +43,11 @@ public class User {
private UserLoginParam userLoginParam;
public User(Long employeeNo) {
public User(String employeeNo) {
this.employeeNo = employeeNo;
}
public User(Long userId, Long employeeNo, Integer employeeLevel, String name, String email, String phoneNumber, UserLoginParam userLoginParam, String standardLevel) {
public User(Long userId, String employeeNo, Integer employeeLevel, String name, String email, String phoneNumber, UserLoginParam userLoginParam, String standardLevel) {
this.userId = userId;
this.employeeNo = employeeNo;
this.employeeLevel = employeeLevel;
@ -58,7 +58,7 @@ public class User {
this.userLoginParam = userLoginParam;
}
public User(Long userId, Long employeeNo, Integer employeeLevel, String name, String email, String phoneNumber) {
public User(Long userId, String employeeNo, Integer employeeLevel, String name, String email, String phoneNumber) {
this.userId = userId;
this.employeeNo = employeeNo;
this.employeeLevel = employeeLevel;
@ -67,7 +67,7 @@ public class User {
this.phoneNumber = phoneNumber;
}
public static User withEmployeeNo(Long employeeNo) {
public static User withEmployeeNo(String employeeNo) {
return new User(employeeNo);
}
@ -82,7 +82,7 @@ public class User {
Claim loginParam = claims.get(AuthMessageConstant.USER_LOGIN_PARAM);
Claim standardLevel = claims.get(AuthMessageConstant.USER_STANDARD_LEVEL);
return new User(userId.asLong(),
employeeNo.asLong(),
employeeNo.asString(),
employeeLevel.asInt(),
name.asString(),
email.asString(),

View File

@ -32,7 +32,7 @@ public class RouteOrderFactory implements OrderFactory {
RouteOrder routeOrder = new RouteOrder();
routeOrder.setRouteOrderNo(OrderNo.generate());
//根据项目需求需要保存假审批订单号真审批订单号 创建的时候保存假审批订单号
routeOrder.setUserId(currentUser.getUserId());
routeOrder.setUserId(currentUser.getEmployeeNo());
ApproveOrderNo approveOrderNo = new ApproveOrderNo();
approveOrderNo.setFakeOrderNo(currentUser.getUserLoginParam().getBillcode());
routeOrder.setApproveOrderNo(approveOrderNo);
@ -50,7 +50,7 @@ public class RouteOrderFactory implements OrderFactory {
RouteOrder routeOrder = new RouteOrder();
routeOrder.setRouteOrderNo(OrderNo.generate());
//根据项目需求需要保存假审批订单号真审批订单号 创建的时候保存假审批订单号
routeOrder.setUserId(Long.valueOf(loginParam.getSfno()));
routeOrder.setUserId(loginParam.getSfno());
ApproveOrderNo approveOrderNo = new ApproveOrderNo();
approveOrderNo.setSysCode(loginParam.getSyscode());
approveOrderNo.setFakeOrderNo(loginParam.getBillcode());

View File

@ -78,9 +78,9 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
.filter(it -> first.get().getLegId().equals(it.getLegId()))
.findFirst()).ifPresent(it ->
flightOrderDetail.setScheduleNum(it.getLegNo()));
Long EmployeeNo = routeOrder.getUserId();
String EmployeeNo = routeOrder.getUserId();
User user = userRepository.findByUserEmployeeNo(EmployeeNo);
flightOrderDetail.setBookingUserCode(String.valueOf(user.getEmployeeNo()));
flightOrderDetail.setBookingUserCode(user.getEmployeeNo());
flightOrderDetail.setBookingName(user.getName());
flightOrderDetail.setBookingUserPhone(user.getPhoneNumber());
@ -134,7 +134,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
.findFirst()).ifPresent(it ->
hotelOrderDetail.setScheduleNum(it.getLegNo()));
Long EmployeeNo = routeOrder.getUserId();
String EmployeeNo = routeOrder.getUserId();
User user = userRepository.findByUserEmployeeNo(EmployeeNo);
String cityName = hotelOrderInfoEntity.getCityName();
hotelOrderDetail.setBookingUserCode(String.valueOf(user.getEmployeeNo()));

View File

@ -8,7 +8,7 @@ public class UserFactoryImpl implements UserFactory {
@Override
public User create(String employeeNo) {
User user = new User();
user.setEmployeeNo(Long.valueOf(employeeNo));
user.setEmployeeNo(employeeNo);
return user;
}
}

View File

@ -4,6 +4,6 @@ import com.chint.domain.aggregates.user.User;
public interface UserRepository {
User findById(Long id);
User findByUserEmployeeNo(Long employeeNo);
User findByUserEmployeeNo(String employeeNo);
User save(User user);
}

View File

@ -40,7 +40,7 @@ public class AuthenticateServiceImpl implements AuthenticateService {
@Override
public UserLoginResult authenticateEmployeeNo(UserLoginParam userLoginParam) {
User user = userRepository.findByUserEmployeeNo(Long.parseLong(userLoginParam.getSfno()));
User user = userRepository.findByUserEmployeeNo(userLoginParam.getSfno());
if (user != null) {
// 部分数据需要通过查询外部的http来获取
BaseContext.setCurrentUser(user);

View File

@ -141,7 +141,7 @@ public class LegEventHandler implements LegEventService {
String orderNo = data.getSelfOrderNo();
RouteOrder routeOrder = routeRepository.findByOrderNo(orderNo);
//获取行程规划单创建者作为该订单
Long employeeNo = routeOrder.getUserId();
String employeeNo = routeOrder.getUserId();
User byUserEmployeeNo = userRepository.findByUserEmployeeNo(employeeNo);
BaseContext.setCurrentUser(byUserEmployeeNo);
OrderDetail orderDetail;

View File

@ -18,7 +18,7 @@ public class UserRepositoryImpl implements UserRepository {
}
@Override
public User findByUserEmployeeNo(Long employeeNo) {
public User findByUserEmployeeNo(String employeeNo) {
return jdbcUserRepository.findByEmployeeNo(employeeNo);
}

View File

@ -5,7 +5,7 @@ import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface JdbcUserRepository extends CrudRepository<User, Long> {
User findByEmployeeNo(Long employeeNo);
public interface JdbcUserRepository extends CrudRepository<User, String> {
User findByEmployeeNo(String employeeNo);
}

View File

@ -54,7 +54,7 @@ public class CTripTest {
@Autowired
private CTripNoteController cTripNoteController;
private User user = new User(1L, 230615020L, 1, "卢麟哲", "1033719135@qq.com", "15857193365");
private User user = new User(1L, "230615020", 1, "卢麟哲", "1033719135@qq.com", "15857193365");
//@Test
void locationCountry() {

View File

@ -75,8 +75,8 @@ public class LYTest {
private final String ExceedStandardUrl = "http://10.207.0.245:8012/Portal/Webservices/ExternalStartService.asmx/StartWorkflowByEntityTransJson";
private User user = new User(1L, 230615020L, 1, "卢麟哲", "1033719135@qq.com", "15857193365");
private User hxh = new User(1L, 231116009L, 1, "黄小恒", "1628870217@qq.com", "18296007063");
private User user = new User(1L, "230615020", 1, "卢麟哲", "1033719135@qq.com", "15857193365");
private User hxh = new User(1L, "231116009", 1, "黄小恒", "1628870217@qq.com", "18296007063");
//机票订单最新价格校验

View File

@ -38,7 +38,7 @@ class RouteApplicationTests {
@Autowired
private PailaLoginStrategy pailaLoginStrategy;
private User user = new User(1L, 230615020L, 1, "卢麟哲", "1033719135@qq.com", "15857193365");
private User user = new User(1L, "230615020", 1, "卢麟哲", "1033719135@qq.com", "15857193365");
// @Test
@ -71,7 +71,7 @@ class RouteApplicationTests {
// @Test
void queryUserInfo() {
User user2 = User.withEmployeeNo(180101001L);
User user2 = User.withEmployeeNo("180101001");
user2.setCompanyCode("A10000001");
User user1 = userHttpRequest.loadUserInfo(user2);