Commit 42b94549174e96e30118d2c6a46f10d5277ace4a

Authored by 姜超
2 parents 5973dbe9 36743fa6

Merge branch 'main' into test

# Conflicts:
#	fw-morax-domain/src/main/java/cn/fw/morax/domain/vo/salary/SalaryGroupProjectPreconditionVO.java
#	fw-morax-service/src/main/java/cn/fw/morax/service/biz/salary/SalaryConfirmBizService.java
fw-morax-domain/src/main/java/cn/fw/morax/domain/vo/kpi/KpiIndicatorRankStaffVO.java
... ... @@ -65,9 +65,11 @@ public class KpiIndicatorRankStaffVO implements Comparable<KpiIndicatorRankStaff
65 65 */
66 66 public void convertReportValueToPercent(DataTypeEnum dataType){
67 67 if (PublicUtil.isNotEmpty(dataType) && DataTypeEnum.RATIO.equals(dataType)) {
68   - this.setReachValue(this.getReachValue().multiply(Constant.ONE_HUNDRED));
69 68 this.setOriginValue(this.getOriginValue().multiply(Constant.ONE_HUNDRED));
70 69 }
  70 + if (PublicUtil.isNotEmpty(this.getReachValue())) {
  71 + this.setReachValue(this.getReachValue().multiply(Constant.ONE_HUNDRED));
  72 + }
71 73 }
72 74  
73 75 /**
... ...
fw-morax-domain/src/main/java/cn/fw/morax/domain/vo/salary/SalaryGroupProjectPreconditionVO.java
... ... @@ -10,6 +10,7 @@ import lombok.EqualsAndHashCode;
10 10 import lombok.experimental.Accessors;
11 11  
12 12 import java.math.BigDecimal;
  13 +import java.util.Optional;
13 14  
14 15 /**
15 16 * <p>
... ... @@ -123,15 +124,16 @@ public class SalaryGroupProjectPreconditionVO {
123 124 }
124 125 }
125 126  
  127 +
126 128 /**
127 129 * 检查是否命中
128 130 */
129 131 public void checkHit() {
130 132 if (TargetTypeEnum.NO.equals(this.getTargetType())) {
131   - this.setHit(this.getIndicatorValue().compareTo(this.getCondValue()) >= 0);
  133 + this.setHit(Optional.ofNullable(this.getIndicatorValue()).orElse(BigDecimal.ZERO).compareTo(this.getCondValue()) >= 0);
132 134 return;
133 135 }
134   - this.setHit(this.getReachValue().compareTo(this.getCondValue()) >= 0);
  136 + this.setHit(Optional.ofNullable(this.getReachValue()).orElse(BigDecimal.ZERO).compareTo(this.getCondValue()) >= 0);
135 137 }
136 138  
137 139 }
... ...
fw-morax-server/src/main/java/cn/fw/morax/server/consumer/OopAlterShopConsumer.java
... ... @@ -54,7 +54,7 @@ public class OopAlterShopConsumer implements RocketMQListener&lt;AlterShopEvent&gt; {
54 54 log.info("门店名称变更MQ消息:{}", JSONObject.toJSONString(message));
55 55  
56 56 Long shopId = message.getShopId();
57   - String newShopName = message.getShopName();
  57 + String newShopShortName = message.getShortName();
58 58 // List<SettingStatusEnum> status = new ArrayList<SettingStatusEnum>(){{
59 59 // add(SettingStatusEnum.EFFECTIVE);
60 60 // add(SettingStatusEnum.BE_EFFECTIVE);
... ... @@ -67,7 +67,7 @@ public class OopAlterShopConsumer implements RocketMQListener&lt;AlterShopEvent&gt; {
67 67 if (PublicUtil.isNotEmpty(salaryGroups)) {
68 68 for (SalaryGroup salaryGroup : salaryGroups) {
69 69 List<ShopDTO> shopDTOS = oopRpcService.queryShops(salaryGroup.getShopIds());
70   - salaryGroup.setShopNames(shopDTOS.stream().map(ShopDTO::getShopName).collect(Collectors.toList()));
  70 + salaryGroup.setShopNames(shopDTOS.stream().map(ShopDTO::getShortName).collect(Collectors.toList()));
71 71 }
72 72 salaryGroupService.updateBatchById(salaryGroups);
73 73 }
... ... @@ -80,26 +80,26 @@ public class OopAlterShopConsumer implements RocketMQListener&lt;AlterShopEvent&gt; {
80 80 if (PublicUtil.isNotEmpty(kpiGroups)) {
81 81 for (KpiGroup kpiGroup : kpiGroups) {
82 82 List<ShopDTO> shopDTOS = oopRpcService.queryShops(kpiGroup.getShopIds());
83   - kpiGroup.setShopNames(shopDTOS.stream().map(ShopDTO::getShopName).collect(Collectors.toList()));
  83 + kpiGroup.setShopNames(shopDTOS.stream().map(ShopDTO::getShortName).collect(Collectors.toList()));
84 84 }
85 85 kpiGroupService.updateBatchById(kpiGroups);
86 86 }
87 87  
88 88  
89 89 salaryGroupUserService.update(Wrappers.<SalaryGroupUser>lambdaUpdate()
90   - .set(SalaryGroupUser::getShopName, newShopName)
  90 + .set(SalaryGroupUser::getShopName, newShopShortName)
91 91 .eq(SalaryGroupUser::getShopId, shopId)
92 92 );
93 93 salaryPoolService.update(Wrappers.<SalaryPool>lambdaUpdate()
94   - .set(SalaryPool::getShopName, newShopName)
  94 + .set(SalaryPool::getShopName, newShopShortName)
95 95 .eq(SalaryPool::getShopId, shopId)
96 96 );
97 97 kpiGroupUserService.update(Wrappers.<KpiGroupUser>lambdaUpdate()
98   - .set(KpiGroupUser::getShopName, newShopName)
  98 + .set(KpiGroupUser::getShopName, newShopShortName)
99 99 .eq(KpiGroupUser::getShopId, shopId)
100 100 );
101 101 kpiPoolService.update(Wrappers.<KpiPool>lambdaUpdate()
102   - .set(KpiPool::getShopName, newShopName)
  102 + .set(KpiPool::getShopName, newShopShortName)
103 103 .eq(KpiPool::getShopId, shopId)
104 104 );
105 105  
... ...
fw-morax-service/src/main/java/cn/fw/morax/service/biz/salary/SalaryConfirmBizService.java
... ... @@ -80,8 +80,8 @@ public class SalaryConfirmBizService {
80 80 public void confirmSalary(Long id, String fid) {
81 81 SalaryConfirm confirm = salaryConfirmService.getById(id);
82 82 BV.notNull(confirm, () -> "数据异常,请刷新重试");
83   - boolean flag = SalaryConfirmStatusEnum.NEED_CONFIRM.equals(confirm.getConfirmedStatus()) && Objects.isNull(confirm.getConfirmTime());
84   - BV.isTrue(flag, () -> "该数据以及确认,请勿重复确认");
  83 +// boolean flag = SalaryConfirmStatusEnum.NEED_CONFIRM.equals(confirm.getConfirmedStatus()) && Objects.isNull(confirm.getConfirmTime());
  84 +// BV.isTrue(flag, () -> "该数据已确认,请勿重复确认");
85 85 SalaryPool pool = salaryPoolService.getById(confirm.getSalaryPoolId());
86 86 BV.notNull(pool, () -> "薪酬数据异常,请刷新重试");
87 87 confirm.setConfirmTime(LocalDateTime.now());
... ... @@ -95,12 +95,13 @@ public class SalaryConfirmBizService {
95 95 salaryConfirmService.updateById(confirm);
96 96 salaryPoolService.updateById(pool);
97 97  
98   - EventBusUtil.asyncPost(PaySalaryEvent.builder()
99   - .monthly(pool.getMonthly())
100   - .groupId(pool.getGroupId())
101   - .shopId(pool.getShopId())
102   - .shopName(pool.getShopName())
103   - .build());
  98 + //todo 暂时不推送工资支付待办
  99 +// EventBusUtil.asyncPost(PaySalaryEvent.builder()
  100 +// .monthly(pool.getMonthly())
  101 +// .groupId(pool.getGroupId())
  102 +// .shopId(pool.getShopId())
  103 +// .shopName(pool.getShopName())
  104 +// .build());
104 105 }
105 106  
106 107  
... ... @@ -155,7 +156,9 @@ public class SalaryConfirmBizService {
155 156 cancelSalaryConfirmTodo(pool.getId(), user.getUserId());
156 157 final LocalDateTime deadline = YearMonth.now().atDay(payoffDay).minusDays(1L).atTime(23, 59, 59);
157 158 SalaryConfirm confirm = createConfirm(pool, LocalDateTime.now(), deadline);
158   - salaryConfirmService.save(confirm);
  159 + if (Objects.nonNull(confirm)) {
  160 + salaryConfirmService.save(confirm);
  161 + }
159 162 }
160 163  
161 164 /**
... ... @@ -194,9 +197,10 @@ public class SalaryConfirmBizService {
194 197 }
195 198 for (SalaryConfirm salaryConfirm : list) {
196 199 BackLogItemDTO dto = new BackLogItemDTO(userId, salaryConfirm.getTodoCode(), String.valueOf(salaryConfirm.getId()), new Date(), null);
197   - boolean complete = todoRpcService.cancel(dto);
198   - BV.isTrue(complete, () -> "取消待办失败");
  200 + todoRpcService.cancel(dto);
  201 + salaryConfirm.setConfirmedStatus(SalaryConfirmStatusEnum.CANCELED);
199 202 }
  203 + salaryConfirmService.updateBatchById(list);
200 204 }
201 205  
202 206 private void createConfirms(final LocalDateTime planTime, final LocalDateTime deadline, final Long groupId) {
... ... @@ -225,7 +229,7 @@ public class SalaryConfirmBizService {
225 229 private SalaryConfirm createConfirm(SalaryPool pool, final LocalDateTime planTime, final LocalDateTime deadline) {
226 230 int count = salaryConfirmService.count(Wrappers.<SalaryConfirm>lambdaQuery()
227 231 .eq(SalaryConfirm::getSalaryPoolId, pool.getId())
228   - .eq(SalaryConfirm::getConfirmedStatus, SalaryConfirmStatusEnum.NEED_CONFIRM)
  232 + .in(SalaryConfirm::getConfirmedStatus, SalaryConfirmStatusEnum.NEED_CONFIRM, SalaryConfirmStatusEnum.CONFIRMED)
229 233 .eq(SalaryConfirm::getYn, Boolean.TRUE)
230 234 );
231 235 if (count > 0) {
... ...
fw-morax-service/src/main/java/cn/fw/morax/service/biz/salary/SalaryPoolCommonService.java
... ... @@ -151,7 +151,7 @@ public class SalaryPoolCommonService {
151 151 );
152 152 if (count > 0) {
153 153 int lengthOfMonth = YearMonth.from(date).lengthOfMonth();
154   - workDayProportion = new BigDecimal(count).divide(new BigDecimal(lengthOfMonth), 2, RoundingMode.HALF_UP);
  154 + workDayProportion = new BigDecimal(count).divide(new BigDecimal(lengthOfMonth), 4, RoundingMode.DOWN);
155 155 log.info("上班天数【" + count + "】总天数【" + lengthOfMonth + "】比例为:" + workDayProportion);
156 156 }
157 157 return workDayProportion;
... ...