Commit c799bf7e7378e85548fa5b9ec08c3329387fa954
Merge branch 'main-fix' into 'main'
审批修改、配置修改 审批修改、配置修改 See merge request !64
Showing
1 changed file
with
20 additions
and
19 deletions
fw-morax-service/src/main/java/cn/fw/morax/service/biz/ApprovalBizService.java
... | ... | @@ -38,6 +38,8 @@ import java.time.format.DateTimeFormatter; |
38 | 38 | import java.util.*; |
39 | 39 | import java.util.stream.Collectors; |
40 | 40 | |
41 | +import static cn.fw.common.businessvalidator.Validator.BV; | |
42 | + | |
41 | 43 | @Slf4j |
42 | 44 | @RequiredArgsConstructor |
43 | 45 | @Service |
... | ... | @@ -392,26 +394,20 @@ public class ApprovalBizService { |
392 | 394 | public void applyApproveEvalDraft(EvalDTO eval, List<EvalGroupDTO> evalGroups, SettingDraft settingDraft, LoginAuthBean user) { |
393 | 395 | Date expTime = PublicUtil.getExpTimeOfMonth(LocalDate.now()); |
394 | 396 | |
395 | - Set<Long> postIds = new HashSet<>(); | |
396 | - Set<Long> shopIds = new HashSet<>(); | |
397 | - for (EvalGroupDTO evalGroupDTO : evalGroups) { | |
398 | - postIds.add(evalGroupDTO.getPostId()); | |
399 | - shopIds.addAll(evalGroupDTO.getShopIds()); | |
400 | - } | |
401 | - | |
397 | + //员工基础信息 | |
398 | + StaffBaseInfoDTO staffInfo = ehrRpcService.queryStaffBaseInfo(user.getUserId()); | |
399 | + BV.notNull(staffInfo, "人员信息查询失败,请重试"); | |
402 | 400 | //提交审批 |
403 | 401 | List<InitiateApprovalParam.Condition> conditions = Lists.newArrayList(); |
404 | - | |
405 | -// InitiateApprovalParam.Condition postCondition = new InitiateApprovalParam.Condition(); | |
406 | -// postCondition.setParamName("postId"); | |
407 | -// postCondition.setValue(StringUtils.join(",", postIds)); | |
408 | -// conditions.add(postCondition); | |
409 | - | |
402 | + InitiateApprovalParam.Condition postCondition = new InitiateApprovalParam.Condition(); | |
403 | + postCondition.setParamName("postId"); | |
404 | + postCondition.setValue(staffInfo.getPostId().toString()); | |
405 | + conditions.add(postCondition); | |
410 | 406 | InitiateApprovalParam.Condition shopCondition = new InitiateApprovalParam.Condition(); |
411 | 407 | shopCondition.setParamName("shopId"); |
412 | - shopCondition.setValue(String.join(",", shopIds.stream().map(String::valueOf).collect(Collectors.toList()))); | |
413 | - | |
408 | + shopCondition.setValue(staffInfo.getShopId().toString()); | |
414 | 409 | conditions.add(shopCondition); |
410 | + | |
415 | 411 | Map extDataMap = new HashMap<String, Object>() {{ |
416 | 412 | put("id", settingDraft.getId().toString()); |
417 | 413 | }}; |
... | ... | @@ -431,7 +427,7 @@ public class ApprovalBizService { |
431 | 427 | )) |
432 | 428 | .initiatorId(user.getUserId()) |
433 | 429 | .expTime(expTime) |
434 | - .shopIds(new ArrayList<>(shopIds)) | |
430 | + .shopIds(new ArrayList<Long>(){{add(staffInfo.getShopId());}}) | |
435 | 431 | .conditions(conditions) |
436 | 432 | .extData(extDataMap) |
437 | 433 | .build(); |
... | ... | @@ -453,13 +449,18 @@ public class ApprovalBizService { |
453 | 449 | @Transactional(rollbackFor = Exception.class) |
454 | 450 | public void applyApproveDistReward(EvalRewardDist rewardDist, LoginAuthBean user) { |
455 | 451 | Date expTime = DateUtil.localDateTime2Date(LocalDate.now().atTime(23, 59, 59).plusDays(3)); |
452 | + //员工基础信息 | |
453 | + StaffBaseInfoDTO staffInfo = ehrRpcService.queryStaffBaseInfo(user.getUserId()); | |
454 | + BV.notNull(staffInfo, "人员信息查询失败,请重试"); | |
456 | 455 | //提交审批 |
457 | 456 | List<InitiateApprovalParam.Condition> conditions = Lists.newArrayList(); |
457 | + InitiateApprovalParam.Condition postCondition = new InitiateApprovalParam.Condition(); | |
458 | + postCondition.setParamName("postId"); | |
459 | + postCondition.setValue(staffInfo.getPostId().toString()); | |
460 | + conditions.add(postCondition); | |
458 | 461 | InitiateApprovalParam.Condition shopCondition = new InitiateApprovalParam.Condition(); |
459 | 462 | shopCondition.setParamName("shopId"); |
460 | - List<String> shopIdsStr = rewardDist.getShopIds().stream().map(s -> s.toString()).collect(Collectors.toList()); | |
461 | - shopCondition.setValue(String.join(",", shopIdsStr)); | |
462 | - conditions.add(shopCondition); | |
463 | + shopCondition.setValue(staffInfo.getShopId().toString()); | |
463 | 464 | Map extDataMap = new HashMap<String, Object>() {{ |
464 | 465 | put("id", rewardDist.getId().toString()); |
465 | 466 | }}; | ... | ... |