fix:新能无法跳转差旅申请单,携程开卡的bug问题,登录bug
This commit is contained in:
parent
a7836aeb53
commit
8f9bc441ed
|
@ -84,11 +84,16 @@ public class User implements Serializable {
|
||||||
//如果发现 用户的 部门信息为空, 那么直接调用 sf查询
|
//如果发现 用户的 部门信息为空, 那么直接调用 sf查询
|
||||||
Command.of(UserSFCommand.class).user(this).sendToQueue();
|
Command.of(UserSFCommand.class).user(this).sendToQueue();
|
||||||
} else {
|
} else {
|
||||||
|
boolean res = false;
|
||||||
for (UserDepartmentInfo userDepartmentInfo : userDepartmentInfoList) {
|
for (UserDepartmentInfo userDepartmentInfo : userDepartmentInfoList) {
|
||||||
if (userDepartmentInfo.getUname() == null) {
|
if (userDepartmentInfo.getUname() == null) {
|
||||||
Command.of(UserSFCommand.class).user(this).sendToQueue();
|
res = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (res) {
|
||||||
|
Command.of(UserSFCommand.class).user(this).sendToQueue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (userDepartmentInfoList == null) {
|
if (userDepartmentInfoList == null) {
|
||||||
throw new NotFoundException(SF_DATA_NOT_EXIST);
|
throw new NotFoundException(SF_DATA_NOT_EXIST);
|
||||||
|
|
|
@ -7,5 +7,7 @@ import java.util.List;
|
||||||
public interface JTCompanyRepository {
|
public interface JTCompanyRepository {
|
||||||
List<JTCompany> findAll();
|
List<JTCompany> findAll();
|
||||||
|
|
||||||
|
List<JTCompany> findByCompanyNameOrCompanyCode(String companyName, String companyCode);
|
||||||
|
|
||||||
JTCompany findByCompanyCode(String companyCode);
|
JTCompany findByCompanyCode(String companyCode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,14 +30,42 @@ public class JTCompanyDomainService {
|
||||||
jtCompanyRepository.findAll();
|
jtCompanyRepository.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean ifCompanyInJT(String companyName, String companyCode) {
|
public boolean ifCompanyInJT(String companyName, String companyCode) {
|
||||||
List<JTCompany> all = jtCompanyRepository.findAll();
|
List<JTCompany> all = jtCompanyRepository.findAll();
|
||||||
if (companyName != null) {
|
if (companyName != null) {
|
||||||
return all.stream().map(JTCompany::getCompanyName).toList().contains(companyName);
|
return all.stream()
|
||||||
|
.map(JTCompany::getCompanyName)
|
||||||
|
.toList()
|
||||||
|
.contains(companyName);
|
||||||
}
|
}
|
||||||
if (companyCode != null) {
|
if (companyCode != null) {
|
||||||
return all.stream().map(JTCompany::getCompanyCode).toList().contains(companyCode);
|
return all.stream()
|
||||||
|
.map(JTCompany::getCompanyCode)
|
||||||
|
.toList()
|
||||||
|
.contains(companyCode);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// public JTCompany findByCompanyNameOrCompanyCode(String companyName, String companyCode){
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
public boolean ifCompanyInJT(String companyName, String companyCode, Long systemCodeId) {
|
||||||
|
List<JTCompany> all = jtCompanyRepository.findAll();
|
||||||
|
if (companyName != null) {
|
||||||
|
return all.stream()
|
||||||
|
.filter(it -> it.getSystemCodeId().equals(systemCodeId))
|
||||||
|
.map(JTCompany::getCompanyName)
|
||||||
|
.toList()
|
||||||
|
.contains(companyName);
|
||||||
|
}
|
||||||
|
if (companyCode != null) {
|
||||||
|
return all.stream()
|
||||||
|
.filter(it -> it.getSystemCodeId().equals(systemCodeId))
|
||||||
|
.map(JTCompany::getCompanyCode)
|
||||||
|
.toList()
|
||||||
|
.contains(companyCode);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
|
@ -21,7 +20,13 @@ public class JTCompanyRepositoryImpl implements JTCompanyRepository {
|
||||||
return jdbcJTCompanyRepository.findBySystemCodeId(1L);
|
return jdbcJTCompanyRepository.findBySystemCodeId(1L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Cacheable(value = "JTCompanyByCompanyCode" , key = "#companyCode")
|
@Cacheable(value = "JTCompany", key = "#companyName + '-' + companyCode")
|
||||||
|
@Override
|
||||||
|
public List<JTCompany> findByCompanyNameOrCompanyCode(String companyName, String companyCode) {
|
||||||
|
return jdbcJTCompanyRepository.findByCompanyNameOrCompanyCode(companyName, companyCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Cacheable(value = "JTCompanyByCompanyCode", key = "#companyCode")
|
||||||
@Override
|
@Override
|
||||||
public JTCompany findByCompanyCode(String companyCode) {
|
public JTCompany findByCompanyCode(String companyCode) {
|
||||||
return jdbcJTCompanyRepository.findByCompanyCode(companyCode);
|
return jdbcJTCompanyRepository.findByCompanyCode(companyCode);
|
||||||
|
|
|
@ -43,10 +43,9 @@ public class StaffRankRepositoryImpl implements StaffRankRepository {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<List<StaffRank>> findRankNameByEmployNoAndJTCompany(String employName, String companyCode) {
|
public Optional<List<StaffRank>> findRankNameByEmployNoAndJTCompany(String employName, String companyCode) {
|
||||||
String tag;
|
if (jtCompanyDomainService.ifCompanyInJT(null, companyCode, 1L)) {
|
||||||
if (jtCompanyDomainService.ifCompanyInJT(null, companyCode)) {
|
|
||||||
return Optional.ofNullable(jdbcStaffRankRepository.findByEmployeeNoAndTag(employName, "1"));
|
return Optional.ofNullable(jdbcStaffRankRepository.findByEmployeeNoAndTag(employName, "1"));
|
||||||
} else if (companyCode.equals(XN_COMPANY_CODE)) {
|
} else if (jtCompanyDomainService.ifCompanyInJT(null, companyCode, 1L)) {
|
||||||
return Optional.ofNullable(jdbcStaffRankRepository.findByEmployeeNoAndTag(employName, "2"));
|
return Optional.ofNullable(jdbcStaffRankRepository.findByEmployeeNoAndTag(employName, "2"));
|
||||||
} else {
|
} else {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
|
|
|
@ -11,6 +11,10 @@ public interface JdbcJTCompanyRepositoryImpl extends CrudRepository<JTCompany, L
|
||||||
|
|
||||||
JTCompany findByCompanyCode(String companyCode);
|
JTCompany findByCompanyCode(String companyCode);
|
||||||
|
|
||||||
|
List<JTCompany> findByCompanyNameOrCompanyCode(String companyName, String companyCode);
|
||||||
|
|
||||||
List<JTCompany> findBySystemCodeId(Long systemCodeId);
|
List<JTCompany> findBySystemCodeId(Long systemCodeId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ public class CTripUserSaveRequest implements UserSync {
|
||||||
userNameRepository.findByEmployeeNo(user.getEmployeeNo()).ifPresentOrElse(it -> authenticationEntity.setName(it.getIdName()),
|
userNameRepository.findByEmployeeNo(user.getEmployeeNo()).ifPresentOrElse(it -> authenticationEntity.setName(it.getIdName()),
|
||||||
() -> authenticationEntity.setName(user.getName()));
|
() -> authenticationEntity.setName(user.getName()));
|
||||||
authenticationEntity.setEmployeeID(user.getEmployeeNo());
|
authenticationEntity.setEmployeeID(user.getEmployeeNo());
|
||||||
authenticationEntity.setValid(user.getWorkStatus() == null ? 'A' : 'I');
|
authenticationEntity.setValid('A');
|
||||||
authenticationEntity.setSubAccountName(subAccountName);
|
authenticationEntity.setSubAccountName(subAccountName);
|
||||||
return authenticationEntity;
|
return authenticationEntity;
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,11 +78,7 @@ public class UserHttpRequestImpl implements UserHttpRequest {
|
||||||
//这个方法 逻辑进行修改 , 首先通过查询 表的方式 , 如果部分数据为空 , 那么就要查询 sf信息获取
|
//这个方法 逻辑进行修改 , 首先通过查询 表的方式 , 如果部分数据为空 , 那么就要查询 sf信息获取
|
||||||
user.loadInfoFromDept();
|
user.loadInfoFromDept();
|
||||||
//根据员工的登录信息,来创建fssc基础跳转信息
|
//根据员工的登录信息,来创建fssc基础跳转信息
|
||||||
List<UserDepartmentInfo> userDepartmentInfoList = user.getUserDepartmentInfoList()
|
for (UserDepartmentInfo userDepartmentInfo : user.getUserDepartmentInfoList()) {
|
||||||
.stream()
|
|
||||||
.filter(it -> jtCompanyDomainService.ifCompanyInJT(null, it.getCompanyCode()))
|
|
||||||
.toList();
|
|
||||||
for (UserDepartmentInfo userDepartmentInfo : userDepartmentInfoList) {
|
|
||||||
String sysCode = jtCompanyDomainService.findSystemCodeByCompanyCode(userDepartmentInfo.getCompanyCode());
|
String sysCode = jtCompanyDomainService.findSystemCodeByCompanyCode(userDepartmentInfo.getCompanyCode());
|
||||||
user.addFssc(userDepartmentInfo.getCompanyName(), sysCode);
|
user.addFssc(userDepartmentInfo.getCompanyName(), sysCode);
|
||||||
}
|
}
|
||||||
|
@ -139,18 +135,22 @@ public class UserHttpRequestImpl implements UserHttpRequest {
|
||||||
}
|
}
|
||||||
List<UserDataDTO> userSFDataFromOpenApi = userSFRequest
|
List<UserDataDTO> userSFDataFromOpenApi = userSFRequest
|
||||||
.getUserSFDataFromOpenApi(user);
|
.getUserSFDataFromOpenApi(user);
|
||||||
|
|
||||||
if (userSFDataFromOpenApi == null) {
|
if (userSFDataFromOpenApi == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!userSFDataFromOpenApi.isEmpty()){
|
||||||
|
for (UserDataDTO userDataDTO : userSFDataFromOpenApi) {
|
||||||
|
user.addDeptInfo(userDataDTO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<UserDataDTO> fromJson = userSFDataFromOpenApi
|
List<UserDataDTO> fromJson = userSFDataFromOpenApi
|
||||||
.stream()
|
.stream()
|
||||||
.filter(userDataDTO -> userDataDTO.getStatus().equals("A"))
|
.filter(userDataDTO -> userDataDTO.getStatus().equals("A"))
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
for (UserDataDTO userDataDTO : fromJson) {
|
|
||||||
user.addDeptInfo(userDataDTO);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(fromJson.isEmpty()){
|
if(fromJson.isEmpty()){
|
||||||
user.setStatus(0);
|
user.setStatus(0);
|
||||||
user.loadInfoFromDept();
|
user.loadInfoFromDept();
|
||||||
|
|
|
@ -270,22 +270,18 @@ class RouteApplicationTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void loginSign() {
|
void loginSign() {
|
||||||
String sfno = "240402087";
|
String sfno = "191202027";
|
||||||
String syscode = "FSSC";
|
String syscode = "FSSC";
|
||||||
String billcode = "CLSQ240225000099";
|
String billcode = "CLSQ240225000099";
|
||||||
String companycode = "正泰集团股份有限公司";
|
String companycode = "正泰集团股份有限公司";
|
||||||
String timespan = "1708908662738";
|
String timespan = "1708908662738";
|
||||||
String s = Digest.md5(sfno + syscode + billcode + companycode + LOGIN_SECRET_KEY + timespan);
|
String s = Digest.md5(sfno + syscode + billcode + companycode + LOGIN_SECRET_KEY + timespan);
|
||||||
System.out.println(s);
|
System.out.println(s);
|
||||||
// log.info("info");
|
|
||||||
// log.trace("trace");
|
|
||||||
// log.trace("trace");
|
|
||||||
// log.trace("trace");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void loginSignProd() {
|
void loginSignProd() {
|
||||||
String sfno = "240402087";
|
String sfno = "200308003";
|
||||||
String syscode = "FSSC";
|
String syscode = "FSSC";
|
||||||
String billcode = "CLSQ240225000099";
|
String billcode = "CLSQ240225000099";
|
||||||
String companycode = "正泰集团股份有限公司";
|
String companycode = "正泰集团股份有限公司";
|
||||||
|
|
Loading…
Reference in New Issue