完成离职人员关卡
This commit is contained in:
parent
df11789f6c
commit
8d83e92a85
|
@ -7,7 +7,7 @@ import org.springframework.stereotype.Repository;
|
|||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface JdbcUserRepository extends CrudRepository<User, String> {
|
||||
public interface JdbcUserRepository extends CrudRepository<User, Long> {
|
||||
User findByEmployeeNo(String employeeNo);
|
||||
|
||||
List<User> findByStatus(Integer status);
|
||||
|
|
|
@ -85,9 +85,11 @@ public class BatchUserWorker {
|
|||
List<User> userList = userRepository.findByStatus(1);
|
||||
List<User> byStatusIsNull = userRepository.findByStatusIsNull();
|
||||
userList.addAll(byStatusIsNull);
|
||||
List<User> userStatusChangeList = new ArrayList<>();
|
||||
for (User user : userList) {
|
||||
List<UserDataDTO> userSFDataFromOpenApi = userSFRequest.getUserSFDataFromOpenApi(user);
|
||||
if (userSFDataFromOpenApi == null) {
|
||||
continue;
|
||||
}
|
||||
for (UserDataDTO userDataDTO : userSFDataFromOpenApi) {
|
||||
user.addDeptInfo(userDataDTO);
|
||||
}
|
||||
|
@ -99,12 +101,12 @@ public class BatchUserWorker {
|
|||
//如果这里不存在状态为A的SF数据,说明他已经处于离职状态
|
||||
user.setStatus(0);
|
||||
user.loadInfoFromDept();
|
||||
log.info("开始关闭用户:{} 的商旅账户", user.getEmployeeNo());
|
||||
Command.of(UserDisabledCommand.class).user(user).sendToQueue();
|
||||
userStatusChangeList.add(user);
|
||||
} else {
|
||||
user.setStatus(1);
|
||||
}
|
||||
}
|
||||
if (!userStatusChangeList.isEmpty()) {
|
||||
userRepository.saveAll(userStatusChangeList);
|
||||
userRepository.save(user);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -246,7 +246,7 @@ public class CTripTest {
|
|||
@Test
|
||||
void search() {
|
||||
BaseContext.setCurrentUser(user);
|
||||
SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("30701490985");
|
||||
SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("30807150200");
|
||||
System.out.println(response);
|
||||
}
|
||||
|
||||
|
|
|
@ -270,7 +270,7 @@ class RouteApplicationTests {
|
|||
|
||||
@Test
|
||||
void loginSign() {
|
||||
String sfno = "240305077";
|
||||
String sfno = "240402087";
|
||||
String syscode = "FSSC";
|
||||
String billcode = "CLSQ240225000099";
|
||||
String companycode = "正泰集团股份有限公司";
|
||||
|
@ -285,7 +285,7 @@ class RouteApplicationTests {
|
|||
|
||||
@Test
|
||||
void loginSignProd() {
|
||||
String sfno = "220301581";
|
||||
String sfno = "240402087";
|
||||
String syscode = "FSSC";
|
||||
String billcode = "CLSQ240225000099";
|
||||
String companycode = "正泰集团股份有限公司";
|
||||
|
|
Loading…
Reference in New Issue