From 443fa819e2dacba484fee22276b6a62cb3f2cb00 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Tue, 16 Jul 2024 16:25:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=94=A8=E6=88=B7=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=97=B6=E5=9B=A0=E6=97=A0=E6=B3=95=E5=BA=8F?= =?UTF-8?q?=E5=88=97=E5=8C=96=E5=AF=BC=E8=87=B4=E6=97=A0=E6=B3=95=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/chint/domain/value_object/UserLoginParam.java | 7 ++++++- .../infrastructure/repository/StaffRankRepositoryImpl.java | 1 + .../rest/data_center/user/UserHttpRequestImpl.java | 3 ++- src/test/java/com/chint/RouteApplicationTests.java | 6 +++--- 4 files changed, 12 insertions(+), 5 deletions(-) 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";