From 6e5abeb9e71f056c16b7f6e96eb5085bef75c4bb Mon Sep 17 00:00:00 2001 From: lihongjie0209 Date: Wed, 28 Aug 2024 08:56:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0=E8=AE=A1=E7=AE=97=E5=85=B3?= =?UTF-8?q?=E8=81=94=E8=80=83=E5=8B=A4=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../empSalary/service/EmpSalaryService.java | 80 +++++++++++-------- 1 file changed, 47 insertions(+), 33 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 ec31fbb1..8db0a9e6 100644 --- a/src/main/java/cn/lihongjie/coal/empSalary/service/EmpSalaryService.java +++ b/src/main/java/cn/lihongjie/coal/empSalary/service/EmpSalaryService.java @@ -86,15 +86,10 @@ public class EmpSalaryService extends BaseService()); } - - - - - String sql = FreeMakerUtils.render( """ @@ -107,7 +102,7 @@ public class EmpSalaryService extends BaseService , ${underScore(field)} as ${underScore(field)} - + <#if field == 'employeeId'>, max(emp_name) as emp_name, max(emp_code) as emp_code <#if field == 'd8epartmentId'>, max(department_name) as department_name, max(department_code) as department_code <#if field == 'jobPostId'>, max(job_post_name) as job_post_name, max(job_post_code) as job_post_code @@ -143,7 +138,7 @@ public class EmpSalaryService extends BaseService and department_id in :departmentIds <#if jobPostIds??> and job_post_id in :jobPostIds - + <#if nations??> and nation in :nations <#if marriages??> and marriage in :marriages <#if educations??> and education in :educations @@ -158,7 +153,7 @@ public class EmpSalaryService extends BaseService and id_card like :idCard <#if phone??> and phone like :phone - + group by 1, date_trunc('${timeDimension}', batch_year_month) @@ -185,11 +180,11 @@ public class EmpSalaryService extends BaseService ((Map) x) .entrySet().stream() - .collect( - Collectors.toMap( - (Map.Entry e) -> - CaseFormat - .LOWER_UNDERSCORE - .to( - CaseFormat - .LOWER_CAMEL, - e.getKey() - .toString()), - e -> - ObjectUtils - .defaultIfNull( - e - .getValue(), - "")))) + .collect( + Collectors.toMap( + (Map.Entry e) -> + CaseFormat + .LOWER_UNDERSCORE + .to( + CaseFormat + .LOWER_CAMEL, + e.getKey() + .toString()), + e -> + ObjectUtils + .defaultIfNull( + e + .getValue(), + "")))) .toList(); return new PageImpl<>(ans, PageRequest.of(0, request.getPageSize()), count); @@ -442,6 +437,24 @@ public class EmpSalaryService extends BaseService 0) { + + log.info("更新了 {} 条数据的考勤数据", update); + } + List salaries = em.createQuery( """ @@ -953,14 +966,15 @@ select id from tmp1 where rk = 1 if (header.equals("身份证号") || header.equals("身份证")) { object.put("idCard", value); - } else if (StringUtils.equalsAny(header,"姓名", "员工", "部门", "岗位")) { + } else if (StringUtils.equalsAny(header, "姓名", "员工", "部门", "岗位")) { // 忽略这些字段 } else if (itemMap.containsKey(header)) { - - if (value == null || (value instanceof String && StringUtils.isBlank((String) value))){ + if (value == null + || (value instanceof String + && StringUtils.isBlank((String) value))) { return; }