diff --git a/src/main/java/com/chint/domain/value_object/UserLoginParam.java b/src/main/java/com/chint/domain/value_object/UserLoginParam.java index ec4aaa14..ae2d17a8 100644 --- a/src/main/java/com/chint/domain/value_object/UserLoginParam.java +++ b/src/main/java/com/chint/domain/value_object/UserLoginParam.java @@ -5,10 +5,15 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; +import java.io.Serial; +import java.io.Serializable; + @Data @NoArgsConstructor @AllArgsConstructor -public class UserLoginParam { +public class UserLoginParam implements Serializable { + @Serial + private static final long serialVersionUID = 987611378322125656L; private String sfno; diff --git a/src/main/java/com/chint/infrastructure/repository/StaffRankRepositoryImpl.java b/src/main/java/com/chint/infrastructure/repository/StaffRankRepositoryImpl.java index 716ba766..0666c4c1 100644 --- a/src/main/java/com/chint/infrastructure/repository/StaffRankRepositoryImpl.java +++ b/src/main/java/com/chint/infrastructure/repository/StaffRankRepositoryImpl.java @@ -41,6 +41,7 @@ public class StaffRankRepositoryImpl implements StaffRankRepository { return byEmployeeNoAndTag.get(0).getEmployeeLevel(); } + @Cacheable(value = "Ranks::StaffRank", key = "#employeeNo + '-' + #companyCode") @Override public Optional> findRankNameByEmployNoAndJTCompany(String employeeNo, String companyCode) { if (jtCompanyDomainService.ifCompanyInJT(null, companyCode, 1L)) { diff --git a/src/main/java/com/chint/interfaces/rest/data_center/user/UserHttpRequestImpl.java b/src/main/java/com/chint/interfaces/rest/data_center/user/UserHttpRequestImpl.java index 5b71e1e3..062405bb 100644 --- a/src/main/java/com/chint/interfaces/rest/data_center/user/UserHttpRequestImpl.java +++ b/src/main/java/com/chint/interfaces/rest/data_center/user/UserHttpRequestImpl.java @@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.util.*; +import java.util.stream.Collectors; import static com.chint.infrastructure.constant.CommonMessageConstant.EMPLOYEE_NO_NOT_EXIST; import static com.chint.infrastructure.constant.RankConstant.DEFAULT_RANK_NAME; @@ -121,7 +122,7 @@ public class UserHttpRequestImpl implements UserHttpRequest { //如果存在自定义职级,那么就开始比较职级大小 //这里执行rank排序规则 Optional max = ranksOrderRepository - .findByRankNameIn(Set.of(rankName, staffRank.get().getEmployeeLevel())) + .findByRankNameIn(new HashSet<>(List.of(rankName, staffRank.get().getEmployeeLevel()))) .stream() .filter(Objects::nonNull) .max(Comparator.comparing(RanksOrder::getRankOrderValue)); diff --git a/src/test/java/com/chint/RouteApplicationTests.java b/src/test/java/com/chint/RouteApplicationTests.java index 4e160877..9396b214 100644 --- a/src/test/java/com/chint/RouteApplicationTests.java +++ b/src/test/java/com/chint/RouteApplicationTests.java @@ -314,9 +314,9 @@ class RouteApplicationTests { @Test void loginSign() { - String sfno = "220506072"; + String sfno = "230615020"; String syscode = "FSSC"; - String billcode = "CLSQ240225000099"; + String billcode = "CLSQ240225000100"; String companycode = "正泰集团股份有限公司"; String timespan = "1708908662738"; String s = Digest.md5(sfno + syscode + billcode + companycode + LOGIN_SECRET_KEY + timespan); @@ -327,7 +327,7 @@ class RouteApplicationTests { void loginSignProd() { String sfno = "240102037"; String syscode = "FSSC"; - String billcode = "CLSQ240225000099"; + String billcode = "CLSQ240225000100"; String companycode = "正泰集团股份有限公司"; String timespan = "1708908662738"; String key = "ZhengTaiRoute";