Commit d83a50ee25852d2587e38f2a52f65ed083f92598
1 parent
89b6bb5c
feature(*): 查询修改
查询修改
Showing
3 changed files
with
23 additions
and
27 deletions
fw-morax-service/src/main/java/cn/fw/morax/service/biz/eval/EvalCalculateService.java
... | ... | @@ -236,7 +236,7 @@ public class EvalCalculateService { |
236 | 236 | .eq(EvalGroupUser::getYn, Boolean.TRUE) |
237 | 237 | ); |
238 | 238 | |
239 | - Map<Long, EvalUserPool> userPoolMap = evalPoolCommonService.inspectionUserPoolMap(evalGroup, users); | |
239 | + Map<Long, EvalUserPool> userPoolMap = evalPoolCommonService.inspectionUserPoolMap(evalGroup, users, localDate); | |
240 | 240 | for (EvalGroupUser user : users) { |
241 | 241 | if (Boolean.TRUE.equals(user.getIgnored())) { |
242 | 242 | continue; | ... | ... |
fw-morax-service/src/main/java/cn/fw/morax/service/biz/eval/EvalIndicatorReportService.java
... | ... | @@ -79,8 +79,8 @@ public class EvalIndicatorReportService { |
79 | 79 | * @return |
80 | 80 | */ |
81 | 81 | public AppPage<EvalIndicatorImportRecordVO> importPage(EvalIndicatorImportQueryDTO dto) { |
82 | - LocalDateTime startTime = LocalDateTime.of(dto.getStartTime(), LocalTime.MIN); | |
83 | - LocalDateTime endTime = LocalDateTime.of(dto.getStartTime(), LocalTime.MAX); | |
82 | + LocalDateTime startTime = (PublicUtil.isNotEmpty(dto.getStartTime())) ? LocalDateTime.of(dto.getStartTime(), LocalTime.MIN) : null; | |
83 | + LocalDateTime endTime = (PublicUtil.isNotEmpty(dto.getEndTime())) ? LocalDateTime.of(dto.getEndTime(), LocalTime.MAX) : null; | |
84 | 84 | PageData<EvalIndicatorImportRecord> pageData = evalIndicatorImportRecordService.page(new PageData<>(dto.getCurrent(), dto.getPageSize()), |
85 | 85 | Wrappers.<EvalIndicatorImportRecord>lambdaQuery() |
86 | 86 | .eq(PublicUtil.isNotEmpty(dto.getUserId()), EvalIndicatorImportRecord::getImportUserId, dto.getUserId()) | ... | ... |
fw-morax-service/src/main/java/cn/fw/morax/service/biz/eval/EvalPoolCommonService.java
... | ... | @@ -48,13 +48,14 @@ public class EvalPoolCommonService { |
48 | 48 | private EhrRpcService ehrRpcService; |
49 | 49 | private OopRpcService oopRpcService; |
50 | 50 | |
51 | - public Map<Long, EvalUserPool> inspectionUserPoolMap(EvalGroup evalGroup, List<EvalGroupUser> users) { | |
51 | + public Map<Long, EvalUserPool> inspectionUserPoolMap(EvalGroup evalGroup, List<EvalGroupUser> users, LocalDate localDate) { | |
52 | 52 | if (PublicUtil.isEmpty(users)) { |
53 | 53 | return new HashMap<>(); |
54 | 54 | } |
55 | 55 | Set<Long> userIds = users.stream().map(EvalGroupUser::getUserId).collect(Collectors.toSet()); |
56 | 56 | List<EvalUserPool> pools = evalUserPoolService.list(Wrappers.<EvalUserPool>lambdaQuery() |
57 | 57 | .eq(EvalUserPool::getEvalGroupId, evalGroup.getId()) |
58 | + .eq(EvalUserPool::getMonthly, YearMonth.from(localDate)) | |
58 | 59 | .in(EvalUserPool::getUserId, userIds) |
59 | 60 | .eq(EvalUserPool::getYn, Boolean.TRUE) |
60 | 61 | ); |
... | ... | @@ -129,30 +130,25 @@ public class EvalPoolCommonService { |
129 | 130 | .eq(EvalUserPool::getMonthly, YearMonth.from(user.getDataDate())) |
130 | 131 | .eq(EvalUserPool::getYn, Boolean.TRUE) |
131 | 132 | , Boolean.FALSE); |
132 | - if (PublicUtil.isEmpty(evalUserPool)) { | |
133 | - evalUserPool = this.createUserPoolData(user); | |
133 | + if (PublicUtil.isNotEmpty(evalUserPool)) { | |
134 | + return evalUserPool; | |
134 | 135 | } |
135 | -// //先按照薪酬组查询,查不到通过门店、岗位查(调岗,同岗位、同门店不算绩效组变动,不生成新绩效池数据) | |
136 | -// if (Objects.isNull(evalUserPool)) { | |
137 | -// evalUserPool = evalUserPoolService.getOne(Wrappers.<EvalUserPool>lambdaQuery() | |
138 | -// .eq(EvalUserPool::getUserId, user.getUserId()) | |
139 | -// .eq(EvalUserPool::getPostId, user.getPostId()) | |
140 | -// .eq(EvalUserPool::getShopId, user.getShopId()) | |
141 | -// .eq(EvalUserPool::getMonthly, YearMonth.from(user.getDataDate())) | |
142 | -// .eq(EvalUserPool::getYn, Boolean.TRUE) | |
143 | -// , Boolean.FALSE); | |
144 | -// if (Objects.isNull(evalUserPool)) { | |
145 | -// evalUserPool = this.createUserPoolData(user); | |
146 | -// } else { | |
147 | -// evalUserPool = this.modifyPoolData(evalUserPool, user); | |
148 | -// } | |
149 | -// } else if ((!evalUserPool.getShopId().equals(user.getShopId())) || | |
150 | -// (!evalUserPool.getEvalGroupId().equals(user.getEvalGroupId()))) { | |
151 | -// //若门店信息与员工在职门店不匹配,说明员工是调门店,绩效组没变 | |
152 | -// //若绩效组id不匹配,说明绩效组编辑生成了新绩效组,对应绩效池中的绩效组id修改 | |
153 | -// evalUserPool = this.modifyPoolData(evalUserPool, user); | |
154 | -// } | |
155 | - return evalUserPool; | |
136 | + evalUserPool = evalUserPoolService.getOne(Wrappers.<EvalUserPool>lambdaQuery() | |
137 | + .eq(EvalUserPool::getEgc, user.getEgc()) | |
138 | + .eq(EvalUserPool::getUserId, user.getUserId()) | |
139 | + .eq(EvalUserPool::getMonthly, YearMonth.from(user.getDataDate()).minusMonths(1)) | |
140 | + .eq(EvalUserPool::getYn, Boolean.TRUE) | |
141 | + , Boolean.FALSE); | |
142 | + if (PublicUtil.isNotEmpty(evalUserPool)) { | |
143 | + evalUserPoolService.update(Wrappers.<EvalUserPool>lambdaUpdate() | |
144 | + .eq(EvalUserPool::getId, evalUserPool.getId()) | |
145 | + .set(EvalUserPool::getMonthly, YearMonth.from(user.getDataDate())) | |
146 | + .set(EvalUserPool::getUpdateTime, new Date()) | |
147 | + ); | |
148 | + evalUserPool.setMonthly(YearMonth.from(user.getDataDate())); | |
149 | + return evalUserPool; | |
150 | + } | |
151 | + return this.createUserPoolData(user); | |
156 | 152 | } |
157 | 153 | |
158 | 154 | /** | ... | ... |