BAOLH
2026-10-26 8cbebf21ce5fe478f12d6c7a30b7010dc208d086
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/salary/service/impl/NewSalaryServiceImpl.java
@@ -541,10 +541,8 @@
//            newSalary = getCompletedWork(userId, targetYearMonth, newSalary);
            // 获取用户级别保险
            newSalary = getUserLevelInsurance(userId, targetYearMonth, newSalary);
        } catch (BadRequestException | ParseException e) {
            errors.add(e.getMessage());
            return;
        } catch (Exception e) {
            errors.add(String.format("%s【注:用户ID--- %d】", e.getMessage(), userId));
            e.printStackTrace();
            return;
        }
@@ -687,17 +685,8 @@
        userLevelWageQueryCriteria.setUserId(userId);
        userLevelWageQueryCriteria.setTargetYearMonth(targetYearMonth);
        try {
            // 倍率(区分正式员工和实习生使用)
            Double coefficient = 1.0;
            UserDto userDto = userService.findById(userId);
            LocalDate createDate = userDto.getCreateTime().toLocalDateTime().toLocalDate();
            if (userDto.getInternshipTime() != null) {
                LocalDate localDate1 = createDate.plusMonths(userDto.getInternshipTime()).withDayOfMonth(1);
                LocalDate localDate2 = LocalDate.parse(targetYearMonth, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
                if (localDate1.isAfter(localDate2)) {
                    coefficient = 0.8;
                }
            }
            // 查询指定年月用户级别工资
            UserLevelWageDto userLevelWageDto = userLevelWageService.queryTargetYearMonth(userLevelWageQueryCriteria);
@@ -760,18 +749,6 @@
    // 获取用户级别保险
    private NewSalary getUserLevelInsurance(Long userId, String targetYearMonth, NewSalary newSalary) throws ParseException {
        UserDto userDto = userService.findById(userId);
        LocalDate createDate = userDto.getCreateTime().toLocalDateTime().toLocalDate();
        if (userDto.getInternshipTime() != null) {
            LocalDate localDate1 = createDate.plusMonths(userDto.getInternshipTime()).withDayOfMonth(1);
            LocalDate localDate2 = LocalDate.parse(targetYearMonth, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
            if (localDate1.isAfter(localDate2)) {
                // 税前工资累计
                newSalary.setAfterTaxAmount(newSalary.getPreTaxAmount());
                return newSalary;
            }
        }
        // 用户级别保险查询类
        UserInsuranceQueryCriteria criteria = new UserInsuranceQueryCriteria();
        criteria.setUserId(userId);