同步代码
This commit is contained in:
parent
126953bd85
commit
626968a7f0
|
@ -91,7 +91,7 @@ public class PailaLoginStrategy implements LoginStrategy {
|
||||||
UserDTO userDTO = JSON.parseObject(userInfoResBody, UserDTO.class);
|
UserDTO userDTO = JSON.parseObject(userInfoResBody, UserDTO.class);
|
||||||
User user;
|
User user;
|
||||||
if (userDTO != null) {
|
if (userDTO != null) {
|
||||||
user = userRepository.findByUserEmployeeNo(Long.parseLong(userDTO.getUid()));
|
user = userRepository.findByUserEmployeeNo(userDTO.getUid());
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
user = userFactory.create(userDTO.getUid());
|
user = userFactory.create(userDTO.getUid());
|
||||||
userHttpRequest.loadUserInfo(user);
|
userHttpRequest.loadUserInfo(user);
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class RouteOrder extends BaseEntity {
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private LocalDateTime bookingTime;
|
private LocalDateTime bookingTime;
|
||||||
private Long userId;
|
private String userId;
|
||||||
private String supplierName;
|
private String supplierName;
|
||||||
//差标等级
|
//差标等级
|
||||||
private String standardLevel;
|
private String standardLevel;
|
||||||
|
|
|
@ -20,7 +20,7 @@ import java.util.Map;
|
||||||
public class User {
|
public class User {
|
||||||
@Id
|
@Id
|
||||||
private Long userId;
|
private Long userId;
|
||||||
private Long employeeNo;
|
private String employeeNo;
|
||||||
private Integer employeeLevel;
|
private Integer employeeLevel;
|
||||||
private String name;
|
private String name;
|
||||||
private String email;
|
private String email;
|
||||||
|
@ -43,11 +43,11 @@ public class User {
|
||||||
private UserLoginParam userLoginParam;
|
private UserLoginParam userLoginParam;
|
||||||
|
|
||||||
|
|
||||||
public User(Long employeeNo) {
|
public User(String employeeNo) {
|
||||||
this.employeeNo = 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.userId = userId;
|
||||||
this.employeeNo = employeeNo;
|
this.employeeNo = employeeNo;
|
||||||
this.employeeLevel = employeeLevel;
|
this.employeeLevel = employeeLevel;
|
||||||
|
@ -58,7 +58,7 @@ public class User {
|
||||||
this.userLoginParam = userLoginParam;
|
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.userId = userId;
|
||||||
this.employeeNo = employeeNo;
|
this.employeeNo = employeeNo;
|
||||||
this.employeeLevel = employeeLevel;
|
this.employeeLevel = employeeLevel;
|
||||||
|
@ -67,7 +67,7 @@ public class User {
|
||||||
this.phoneNumber = phoneNumber;
|
this.phoneNumber = phoneNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static User withEmployeeNo(Long employeeNo) {
|
public static User withEmployeeNo(String employeeNo) {
|
||||||
return new User(employeeNo);
|
return new User(employeeNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ public class User {
|
||||||
Claim loginParam = claims.get(AuthMessageConstant.USER_LOGIN_PARAM);
|
Claim loginParam = claims.get(AuthMessageConstant.USER_LOGIN_PARAM);
|
||||||
Claim standardLevel = claims.get(AuthMessageConstant.USER_STANDARD_LEVEL);
|
Claim standardLevel = claims.get(AuthMessageConstant.USER_STANDARD_LEVEL);
|
||||||
return new User(userId.asLong(),
|
return new User(userId.asLong(),
|
||||||
employeeNo.asLong(),
|
employeeNo.asString(),
|
||||||
employeeLevel.asInt(),
|
employeeLevel.asInt(),
|
||||||
name.asString(),
|
name.asString(),
|
||||||
email.asString(),
|
email.asString(),
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class RouteOrderFactory implements OrderFactory {
|
||||||
RouteOrder routeOrder = new RouteOrder();
|
RouteOrder routeOrder = new RouteOrder();
|
||||||
routeOrder.setRouteOrderNo(OrderNo.generate());
|
routeOrder.setRouteOrderNo(OrderNo.generate());
|
||||||
//根据项目需求,需要保存假审批订单号,真审批订单号 ,创建的时候保存假审批订单号
|
//根据项目需求,需要保存假审批订单号,真审批订单号 ,创建的时候保存假审批订单号
|
||||||
routeOrder.setUserId(currentUser.getUserId());
|
routeOrder.setUserId(currentUser.getEmployeeNo());
|
||||||
ApproveOrderNo approveOrderNo = new ApproveOrderNo();
|
ApproveOrderNo approveOrderNo = new ApproveOrderNo();
|
||||||
approveOrderNo.setFakeOrderNo(currentUser.getUserLoginParam().getBillcode());
|
approveOrderNo.setFakeOrderNo(currentUser.getUserLoginParam().getBillcode());
|
||||||
routeOrder.setApproveOrderNo(approveOrderNo);
|
routeOrder.setApproveOrderNo(approveOrderNo);
|
||||||
|
@ -50,7 +50,7 @@ public class RouteOrderFactory implements OrderFactory {
|
||||||
RouteOrder routeOrder = new RouteOrder();
|
RouteOrder routeOrder = new RouteOrder();
|
||||||
routeOrder.setRouteOrderNo(OrderNo.generate());
|
routeOrder.setRouteOrderNo(OrderNo.generate());
|
||||||
//根据项目需求,需要保存假审批订单号,真审批订单号 ,创建的时候保存假审批订单号
|
//根据项目需求,需要保存假审批订单号,真审批订单号 ,创建的时候保存假审批订单号
|
||||||
routeOrder.setUserId(Long.valueOf(loginParam.getSfno()));
|
routeOrder.setUserId(loginParam.getSfno());
|
||||||
ApproveOrderNo approveOrderNo = new ApproveOrderNo();
|
ApproveOrderNo approveOrderNo = new ApproveOrderNo();
|
||||||
approveOrderNo.setSysCode(loginParam.getSyscode());
|
approveOrderNo.setSysCode(loginParam.getSyscode());
|
||||||
approveOrderNo.setFakeOrderNo(loginParam.getBillcode());
|
approveOrderNo.setFakeOrderNo(loginParam.getBillcode());
|
||||||
|
|
|
@ -78,9 +78,9 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
||||||
.filter(it -> first.get().getLegId().equals(it.getLegId()))
|
.filter(it -> first.get().getLegId().equals(it.getLegId()))
|
||||||
.findFirst()).ifPresent(it ->
|
.findFirst()).ifPresent(it ->
|
||||||
flightOrderDetail.setScheduleNum(it.getLegNo()));
|
flightOrderDetail.setScheduleNum(it.getLegNo()));
|
||||||
Long EmployeeNo = routeOrder.getUserId();
|
String EmployeeNo = routeOrder.getUserId();
|
||||||
User user = userRepository.findByUserEmployeeNo(EmployeeNo);
|
User user = userRepository.findByUserEmployeeNo(EmployeeNo);
|
||||||
flightOrderDetail.setBookingUserCode(String.valueOf(user.getEmployeeNo()));
|
flightOrderDetail.setBookingUserCode(user.getEmployeeNo());
|
||||||
flightOrderDetail.setBookingName(user.getName());
|
flightOrderDetail.setBookingName(user.getName());
|
||||||
flightOrderDetail.setBookingUserPhone(user.getPhoneNumber());
|
flightOrderDetail.setBookingUserPhone(user.getPhoneNumber());
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
||||||
.findFirst()).ifPresent(it ->
|
.findFirst()).ifPresent(it ->
|
||||||
hotelOrderDetail.setScheduleNum(it.getLegNo()));
|
hotelOrderDetail.setScheduleNum(it.getLegNo()));
|
||||||
|
|
||||||
Long EmployeeNo = routeOrder.getUserId();
|
String EmployeeNo = routeOrder.getUserId();
|
||||||
User user = userRepository.findByUserEmployeeNo(EmployeeNo);
|
User user = userRepository.findByUserEmployeeNo(EmployeeNo);
|
||||||
String cityName = hotelOrderInfoEntity.getCityName();
|
String cityName = hotelOrderInfoEntity.getCityName();
|
||||||
hotelOrderDetail.setBookingUserCode(String.valueOf(user.getEmployeeNo()));
|
hotelOrderDetail.setBookingUserCode(String.valueOf(user.getEmployeeNo()));
|
||||||
|
|
|
@ -8,7 +8,7 @@ public class UserFactoryImpl implements UserFactory {
|
||||||
@Override
|
@Override
|
||||||
public User create(String employeeNo) {
|
public User create(String employeeNo) {
|
||||||
User user = new User();
|
User user = new User();
|
||||||
user.setEmployeeNo(Long.valueOf(employeeNo));
|
user.setEmployeeNo(employeeNo);
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,6 @@ import com.chint.domain.aggregates.user.User;
|
||||||
|
|
||||||
public interface UserRepository {
|
public interface UserRepository {
|
||||||
User findById(Long id);
|
User findById(Long id);
|
||||||
User findByUserEmployeeNo(Long employeeNo);
|
User findByUserEmployeeNo(String employeeNo);
|
||||||
User save(User user);
|
User save(User user);
|
||||||
}
|
}
|
|
@ -40,7 +40,7 @@ public class AuthenticateServiceImpl implements AuthenticateService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UserLoginResult authenticateEmployeeNo(UserLoginParam userLoginParam) {
|
public UserLoginResult authenticateEmployeeNo(UserLoginParam userLoginParam) {
|
||||||
User user = userRepository.findByUserEmployeeNo(Long.parseLong(userLoginParam.getSfno()));
|
User user = userRepository.findByUserEmployeeNo(userLoginParam.getSfno());
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
// 部分数据需要通过查询外部的http来获取
|
// 部分数据需要通过查询外部的http来获取
|
||||||
BaseContext.setCurrentUser(user);
|
BaseContext.setCurrentUser(user);
|
||||||
|
|
|
@ -141,7 +141,7 @@ public class LegEventHandler implements LegEventService {
|
||||||
String orderNo = data.getSelfOrderNo();
|
String orderNo = data.getSelfOrderNo();
|
||||||
RouteOrder routeOrder = routeRepository.findByOrderNo(orderNo);
|
RouteOrder routeOrder = routeRepository.findByOrderNo(orderNo);
|
||||||
//获取行程规划单创建者作为该订单
|
//获取行程规划单创建者作为该订单
|
||||||
Long employeeNo = routeOrder.getUserId();
|
String employeeNo = routeOrder.getUserId();
|
||||||
User byUserEmployeeNo = userRepository.findByUserEmployeeNo(employeeNo);
|
User byUserEmployeeNo = userRepository.findByUserEmployeeNo(employeeNo);
|
||||||
BaseContext.setCurrentUser(byUserEmployeeNo);
|
BaseContext.setCurrentUser(byUserEmployeeNo);
|
||||||
OrderDetail orderDetail;
|
OrderDetail orderDetail;
|
||||||
|
|
|
@ -18,7 +18,7 @@ public class UserRepositoryImpl implements UserRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public User findByUserEmployeeNo(Long employeeNo) {
|
public User findByUserEmployeeNo(String employeeNo) {
|
||||||
return jdbcUserRepository.findByEmployeeNo(employeeNo);
|
return jdbcUserRepository.findByEmployeeNo(employeeNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import org.springframework.data.repository.CrudRepository;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public interface JdbcUserRepository extends CrudRepository<User, Long> {
|
public interface JdbcUserRepository extends CrudRepository<User, String> {
|
||||||
User findByEmployeeNo(Long employeeNo);
|
User findByEmployeeNo(String employeeNo);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class CTripTest {
|
||||||
@Autowired
|
@Autowired
|
||||||
private CTripNoteController cTripNoteController;
|
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
|
//@Test
|
||||||
void locationCountry() {
|
void locationCountry() {
|
||||||
|
|
|
@ -75,8 +75,8 @@ public class LYTest {
|
||||||
|
|
||||||
private final String ExceedStandardUrl = "http://10.207.0.245:8012/Portal/Webservices/ExternalStartService.asmx/StartWorkflowByEntityTransJson";
|
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 user = new User(1L, "230615020", 1, "卢麟哲", "1033719135@qq.com", "15857193365");
|
||||||
private User hxh = new User(1L, 231116009L, 1, "黄小恒", "1628870217@qq.com", "18296007063");
|
private User hxh = new User(1L, "231116009", 1, "黄小恒", "1628870217@qq.com", "18296007063");
|
||||||
|
|
||||||
|
|
||||||
//机票订单最新价格校验
|
//机票订单最新价格校验
|
||||||
|
|
|
@ -38,7 +38,7 @@ class RouteApplicationTests {
|
||||||
@Autowired
|
@Autowired
|
||||||
private PailaLoginStrategy pailaLoginStrategy;
|
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
|
// @Test
|
||||||
|
@ -71,7 +71,7 @@ class RouteApplicationTests {
|
||||||
|
|
||||||
// @Test
|
// @Test
|
||||||
void queryUserInfo() {
|
void queryUserInfo() {
|
||||||
User user2 = User.withEmployeeNo(180101001L);
|
User user2 = User.withEmployeeNo("180101001");
|
||||||
user2.setCompanyCode("A10000001");
|
user2.setCompanyCode("A10000001");
|
||||||
User user1 = userHttpRequest.loadUserInfo(user2);
|
User user1 = userHttpRequest.loadUserInfo(user2);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue