From ac7f7859d10fb7d7a9f2dc0eed33204f14e13c25 Mon Sep 17 00:00:00 2001 From: lihongjie0209 Date: Fri, 16 Aug 2024 11:03:57 +0800 Subject: [PATCH] cleanup --- .../empSalary/service/EmpSalaryService.java | 71 ------------------- 1 file changed, 71 deletions(-) diff --git a/src/main/java/cn/lihongjie/coal/empSalary/service/EmpSalaryService.java b/src/main/java/cn/lihongjie/coal/empSalary/service/EmpSalaryService.java index de9530e2..4c4f7ee8 100644 --- a/src/main/java/cn/lihongjie/coal/empSalary/service/EmpSalaryService.java +++ b/src/main/java/cn/lihongjie/coal/empSalary/service/EmpSalaryService.java @@ -5,24 +5,20 @@ import cn.lihongjie.coal.base.dto.IdRequest; import cn.lihongjie.coal.base.entity.OrgCommonEntity; import cn.lihongjie.coal.base.service.BaseService; import cn.lihongjie.coal.common.ExcelUtils; -import cn.lihongjie.coal.common.GroovyScriptUtils; import cn.lihongjie.coal.common.MapUtils; import cn.lihongjie.coal.common.ReflectUtils; -import cn.lihongjie.coal.empMonthAttendance.dto.EmpMonthAttendanceDto; import cn.lihongjie.coal.empMonthAttendance.entity.EmpMonthAttendanceEntity; import cn.lihongjie.coal.empMonthAttendance.mapper.EmpMonthAttendanceMapper; import cn.lihongjie.coal.empSalary.dto.*; import cn.lihongjie.coal.empSalary.entity.EmpSalaryEntity; import cn.lihongjie.coal.empSalary.mapper.EmpSalaryMapper; import cn.lihongjie.coal.empSalary.repository.EmpSalaryRepository; -import cn.lihongjie.coal.empSalaryBatch.dto.EmpSalaryBatchDto; import cn.lihongjie.coal.empSalaryBatch.entity.EmpSalaryBatchEntity; import cn.lihongjie.coal.empSalaryBatch.mapper.EmpSalaryBatchMapper; import cn.lihongjie.coal.empSalaryBatch.service.EmpSalaryBatchService; import cn.lihongjie.coal.empSalaryItem.entity.EmpSalaryItemEntity; import cn.lihongjie.coal.empSalaryItem.service.EmpSalaryItemService; import cn.lihongjie.coal.employee.dto.EmployeeCalculateDto; -import cn.lihongjie.coal.employee.dto.EmployeeDto; import cn.lihongjie.coal.employee.entity.EmployeeEntity; import cn.lihongjie.coal.employee.mapper.EmployeeMapper; import cn.lihongjie.coal.employee.service.EmployeeService; @@ -46,7 +42,6 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; -import org.codehaus.groovy.control.CompilerConfiguration; import org.jetbrains.annotations.NotNull; import org.redisson.api.RLock; import org.redisson.api.RedissonClient; @@ -744,15 +739,6 @@ public class EmpSalaryService extends BaseService employees) { List exists = em.createQuery( @@ -801,63 +787,6 @@ select id from tmp1 where rk = 1 .getResultList(); } - /** - * 构建计算上下文 - * - * @return - */ - public Map buildCtx( - EmpSalaryBatchEntity batchEntity, - EmployeeDto employee, - EmpMonthAttendanceEntity attendanceEntity, - EmpSalaryEntity salaryEntity) { - - EmpSalaryBatchDto batch = empSalaryBatchMapper.toDto(batchEntity); - - EmpMonthAttendanceDto attendance = empMonthAttendanceMapper.toDto(attendanceEntity); - - EmpSalaryDto salary = empSalaryMapper.toDto(salaryEntity); - - // if (batch!=null )em.detach(batch); - // em.detach(employee); - // if (attendance!=null )em.detach(attendance); - // if (salary!=null )em.detach(salary); - - Map empMap = - employee == null ? new HashMap<>() : ReflectUtils.toMap(employee); - - if (employee != null) { - - empMap.put("empName", employee.getName()); - empMap.put("empCode", employee.getCode()); - - Try.run(() -> empMap.put("departmentId", employee.getDepartment().getId())); - Try.run(() -> empMap.put("departmentCode", employee.getDepartment().getCode())); - Try.run(() -> empMap.put("departmentName", employee.getDepartment().getName())); - Try.run(() -> empMap.put("jobPostId", employee.getJobPost().getId())); - Try.run(() -> empMap.put("jobPostCode", employee.getJobPost().getCode())); - Try.run(() -> empMap.put("jobPostName", employee.getJobPost().getName())); - } - - Map batchMap = batch == null ? new HashMap<>() : ReflectUtils.toMap(batch); - Map attendanceMap = - attendance == null ? new HashMap<>() : ReflectUtils.toMap(attendance); - Map salaryMap = - ReflectUtils.toMap(salary == null ? new EmpSalaryEntity() : salary); - - Map ctx = new HashMap<>(); - ctx.putAll(salaryMap); - ctx.putAll(empMap); - ctx.putAll(batchMap); - ctx.putAll(attendanceMap); - - // 移除通用字段 - - removeCommonField(ctx); - - return ctx; - } - public void deleteByBatchId(IdRequest request) { Integer cnt = this.repository.deleteByBatchId(request.getIds());