| | |
| | | // 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;
|
| | | }
|
| | |
| | | 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);
|
| | |
| | |
|
| | | // 获取用户级别保险
|
| | | 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);
|