From c5dfc09145e4e10f99dbf388a4a1433b5c2973e5 Mon Sep 17 00:00:00 2001
From: BAOLH <baolh@yhzhg.cn>
Date: Tue, 10 Nov 2026 01:40:38 +0000
Subject: [PATCH] 适应高版本Nodejs对应修改(二)
---
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/treatment/service/impl/UserLevelWageServiceImpl.java | 28 ++++++++++++++++------------
1 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/treatment/service/impl/UserLevelWageServiceImpl.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/treatment/service/impl/UserLevelWageServiceImpl.java
index 14cadfe..3d228e1 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/treatment/service/impl/UserLevelWageServiceImpl.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/treatment/service/impl/UserLevelWageServiceImpl.java
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.treatment.service.impl;
+import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.modules.attendance.domain.AttendanceBusinessTravel;
@@ -165,7 +166,7 @@
}
@Override
- public Double queryTravelAllowance(UserLevelWageQueryCriteria criteria) {
+ public Double queryTravelAllowance(UserLevelWageQueryCriteria criteria, JSONObject jsonObject) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime dateTime = LocalDateTime.parse(criteria.getTargetYearMonth(), formatter);
@@ -190,17 +191,20 @@
)).values().stream().collect(Collectors.toList());
Map<String, Double> attendanceBusinessTravelMap = calcAttendanceBusinessTravelList.stream().collect(Collectors.groupingBy(AttendanceBusinessTravel::getCategory, Collectors.summingDouble(AttendanceBusinessTravel::getTravelDuration)));
- BigDecimal travelSubsidy = new BigDecimal(0.0);
- for (Map.Entry<String, Double> entry : attendanceBusinessTravelMap.entrySet()) {
- if (entry.getKey().equals(Constant.ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_TRAVEL)) {
- // 出差补助金
- SysConfigProportion sysConfigProportion = sysConfigProportionRepository.findByTitle("出差补助金额");
- travelSubsidy = travelSubsidy.add(BigDecimal.valueOf(entry.getValue() * sysConfigProportion.getProportion()));
- } else if (entry.getKey().equals(Constant.ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_SAME_PLACE)) {
- // 客户现场补助金
-// SysConfigProportion sysConfigProportion = sysConfigProportionRepository.findByTitle("客户现场补助金额");
- travelSubsidy = travelSubsidy.add(BigDecimal.valueOf(entry.getValue() * 30)); // 按30元/天计算 TODO 待调整
- }
+ // 出差时长
+ Double travelHours = attendanceBusinessTravelMap.entrySet().stream().filter(entry -> entry.getKey().equals(Constant.ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_TRAVEL))
+ .map(Map.Entry::getValue).collect(Collectors.summingDouble(Double::doubleValue));
+ // 客户现场时长
+ Double customerSiteHours = attendanceBusinessTravelMap.entrySet().stream().filter(entry -> entry.getKey().equals(Constant.ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_SAME_PLACE))
+ .map(Map.Entry::getValue).collect(Collectors.summingDouble(Double::doubleValue));
+ // 合计
+ BigDecimal travelMoney = new BigDecimal(sysConfigProportionRepository.findByTitle("出差补助金额").getProportion());
+ BigDecimal customerSiteMoney = new BigDecimal(30);
+ BigDecimal travelSubsidy = BigDecimal.valueOf(travelHours).multiply(travelMoney).add(BigDecimal.valueOf(customerSiteHours).multiply(customerSiteMoney));
+
+ // 记录计算公式
+ if (jsonObject != null) {
+ jsonObject.put("travelWage", String.format("【(出差时长H * 出差补助) + (客户现场时长H * 客户现场补助)】:(%.2f * %.2f) + (%.2f * %.2f)", BigDecimal.valueOf(travelHours), travelMoney, BigDecimal.valueOf(customerSiteHours), customerSiteMoney));
}
// // 出差补助金
// attendanceBusinessTravelMap.forEach((key, value) -> {
--
Gitblit v1.9.3