From 1568b1e03df23ff2287a8ad14ab4e7be90d55e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 1 Mar 2023 09:05:03 +0800 Subject: [PATCH 01/86] =?UTF-8?q?=E5=A4=96=E9=83=A8=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/api/salary/web/ExtEmpController.java | 8 + .../entity/extemp/param/ExtEmpQueryParam.java | 27 + .../salary/entity/extemp/po/ExtEmpPO.java | 123 +++++ .../mapper/extemp/ExternalEmployeeMapper.java | 64 +++ .../mapper/extemp/ExternalEmployeeMapper.xml | 468 ++++++++++++++++++ .../engine/salary/service/ExtEmpService.java | 19 + .../service/impl/ExtEmpServiceImpl.java | 51 ++ .../engine/salary/web/ExtEmpController.java | 15 + .../engine/salary/wrapper/ExtEmpWrapper.java | 48 ++ 9 files changed, 823 insertions(+) create mode 100644 src/com/api/salary/web/ExtEmpController.java create mode 100644 src/com/engine/salary/entity/extemp/param/ExtEmpQueryParam.java create mode 100644 src/com/engine/salary/entity/extemp/po/ExtEmpPO.java create mode 100644 src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java create mode 100644 src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml create mode 100644 src/com/engine/salary/service/ExtEmpService.java create mode 100644 src/com/engine/salary/service/impl/ExtEmpServiceImpl.java create mode 100644 src/com/engine/salary/web/ExtEmpController.java create mode 100644 src/com/engine/salary/wrapper/ExtEmpWrapper.java diff --git a/src/com/api/salary/web/ExtEmpController.java b/src/com/api/salary/web/ExtEmpController.java new file mode 100644 index 000000000..9b349b2ef --- /dev/null +++ b/src/com/api/salary/web/ExtEmpController.java @@ -0,0 +1,8 @@ +package com.api.salary.web; + +import javax.ws.rs.Path; + +@Path("/bs/hrmsalary/extEmp") +public class ExtEmpController extends com.engine.salary.web.ExtEmpController{ + +} diff --git a/src/com/engine/salary/entity/extemp/param/ExtEmpQueryParam.java b/src/com/engine/salary/entity/extemp/param/ExtEmpQueryParam.java new file mode 100644 index 000000000..ac68f247f --- /dev/null +++ b/src/com/engine/salary/entity/extemp/param/ExtEmpQueryParam.java @@ -0,0 +1,27 @@ +package com.engine.salary.entity.extemp.param; + +import com.engine.salary.common.BaseQueryParam; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 数据采集-累计专项附加扣除查询参数 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ExtEmpQueryParam extends BaseQueryParam { + + //姓名 + private String username; + + +} diff --git a/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java b/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java new file mode 100644 index 000000000..82a24937a --- /dev/null +++ b/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java @@ -0,0 +1,123 @@ +package com.engine.salary.entity.extemp.po; + + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 外部人员 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_external_employee +public class ExtEmpPO { + + private Long id; + /** + * 姓名 + */ + private String username; + /** + * 部门 + */ + private String departmentName; + /** + * 部门ID + */ + private Long departmentId; + /** + * 分部 + */ + private String subcompanyName; + /** + * 分部ID + */ + private Long subcompanyId; + /** + * 岗位 + */ + private String jobtitleName; + /** + * 岗位ID + */ + private Long jobtitleId; + /** + * 入职日期 + */ + private String companystartdate; + /** + * 手机 + */ + private String mobile; + /** + * 状态编码 + */ + private String status; + /** + * 工号 + */ + private String workcode; + /** + * 性别 + */ + private String sex; + /** + * 邮件 + */ + private String email; + /** + * 电话 + */ + private String telephone; + /** + * 职称 + */ + private String jobcall; + /** + * 出生日期 + */ + private String birthday; + /** + * 身份证号码 + */ + private String idNo; + /** + * 本人开户的银行卡卡号 + */ + private String bankCardNum; + /** + * 本人开户的银行卡开户支行全称 + */ + private String bankName; + /** + * 是否已删除。0:未删除、1:已删除 + */ + private Integer deleteType; + /** + * 创建人 + */ + private Long creator; + /** + * 修改人 + */ + private Long modifier; + /** + * 创建时间 + */ + private Date createTime; + /** + * 修改时间 + */ + private Date updateTime; + /** + * 租户ID + */ + private String tenantKey; + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java new file mode 100644 index 000000000..5f052651c --- /dev/null +++ b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java @@ -0,0 +1,64 @@ +package com.engine.salary.mapper.extemp; + +import com.engine.salary.entity.extemp.po.ExtEmpPO; + +import java.util.List; + +public interface ExternalEmployeeMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + ExtEmpPO getById(Integer id); + + /** + * 新增,插入所有字段 + * + * @param externalEmployee 新增的记录 + * @return 返回影响行数 + */ + int insert(ExtEmpPO externalEmployee); + + /** + * 新增,忽略null字段 + * + * @param externalEmployee 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(ExtEmpPO externalEmployee); + + /** + * 修改,修改所有字段 + * + * @param externalEmployee 修改的记录 + * @return 返回影响行数 + */ + int update(ExtEmpPO externalEmployee); + + /** + * 修改,忽略null字段 + * + * @param externalEmployee 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(ExtEmpPO externalEmployee); + + /** + * 删除记录 + * + * @return 返回影响行数 + */ + int delete(Long id); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml new file mode 100644 index 000000000..aff4029da --- /dev/null +++ b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml @@ -0,0 +1,468 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t + . + id + , t.username + , t.department_name + , t.department_id + , t.subcompany_name + , t.subcompany_id + , t.jobtitle_name + , t.jobtitle_id + , t.companystartdate + , t.mobile + , t.status + , t.workcode + , t.sex + , t.email + , t.telephone + , t.jobcall + , t.birthday + , t.id_no + , t.bank_card_num + , t.bank_name + , t.delete_type + , t.creator + , t.modifier + , t.create_time + , t.update_time + , t.tenant_key + + + + + + + + + + + + + + + INSERT INTO hrsa_external_employee + + + + id, + + + username, + + + department_name, + + + department_id, + + + subcompany_name, + + + subcompany_id, + + + jobtitle_name, + + + jobtitle_id, + + + companystartdate, + + + mobile, + + + status, + + + workcode, + + + sex, + + + email, + + + telephone, + + + jobcall, + + + birthday, + + + id_no, + + + bank_card_num, + + + bank_name, + + + delete_type, + + + creator, + + + modifier, + + + create_time, + + + update_time, + + + tenant_key, + + + + + #{id}, + + + #{username}, + + + #{departmentName}, + + + #{departmentId}, + + + #{subcompanyName}, + + + #{subcompanyId}, + + + #{jobtitleName}, + + + #{jobtitleId}, + + + #{companystartdate}, + + + #{mobile}, + + + #{status}, + + + #{workcode}, + + + #{sex}, + + + #{email}, + + + #{telephone}, + + + #{jobcall}, + + + #{birthday}, + + + #{idNo}, + + + #{bankCardNum}, + + + #{bankName}, + + + #{deleteType}, + + + #{creator}, + + + #{modifier}, + + + #{createTime}, + + + #{updateTime}, + + + #{tenantKey}, + + + + + + + UPDATE hrsa_external_employee + + username=#{username}, + department_name=#{departmentName}, + department_id=#{departmentId}, + subcompany_name=#{subcompanyName}, + subcompany_id=#{subcompanyId}, + jobtitle_name=#{jobtitleName}, + jobtitle_id=#{jobtitleId}, + companystartdate=#{companystartdate}, + mobile=#{mobile}, + status=#{status}, + workcode=#{workcode}, + sex=#{sex}, + email=#{email}, + telephone=#{telephone}, + jobcall=#{jobcall}, + birthday=#{birthday}, + id_no=#{idNo}, + bank_card_num=#{bankCardNum}, + bank_name=#{bankName}, + delete_type=#{deleteType}, + creator=#{creator}, + modifier=#{modifier}, + create_time=#{createTime}, + update_time=#{updateTime}, + tenant_key=#{tenantKey}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_external_employee + + + username=#{username}, + + + department_name=#{departmentName}, + + + department_id=#{departmentId}, + + + subcompany_name=#{subcompanyName}, + + + subcompany_id=#{subcompanyId}, + + + jobtitle_name=#{jobtitleName}, + + + jobtitle_id=#{jobtitleId}, + + + companystartdate=#{companystartdate}, + + + mobile=#{mobile}, + + + status=#{status}, + + + workcode=#{workcode}, + + + sex=#{sex}, + + + email=#{email}, + + + telephone=#{telephone}, + + + jobcall=#{jobcall}, + + + birthday=#{birthday}, + + + id_no=#{idNo}, + + + bank_card_num=#{bankCardNum}, + + + bank_name=#{bankName}, + + + delete_type=#{deleteType}, + + + creator=#{creator}, + + + modifier=#{modifier}, + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + tenant_key=#{tenantKey}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_external_employee + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/ExtEmpService.java b/src/com/engine/salary/service/ExtEmpService.java new file mode 100644 index 000000000..04a388f67 --- /dev/null +++ b/src/com/engine/salary/service/ExtEmpService.java @@ -0,0 +1,19 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; +import com.engine.salary.entity.extemp.po.ExtEmpPO; + +import java.util.Collection; +import java.util.List; + +public interface ExtEmpService { + + List list(ExtEmpQueryParam param); + + void save(ExtEmpPO po); + + void update(ExtEmpPO po); + + void delete(Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java new file mode 100644 index 000000000..b61665f6b --- /dev/null +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -0,0 +1,51 @@ +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.mapper.extemp.ExternalEmployeeMapper; +import com.engine.salary.service.ExtEmpService; +import com.engine.salary.util.db.MapperProxyFactory; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.Collection; +import java.util.List; + +/** + * 累计专项 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class ExtEmpServiceImpl extends Service implements ExtEmpService { + + + private ExternalEmployeeMapper getExternalEmployeeMapper() { + return MapperProxyFactory.getProxy(ExternalEmployeeMapper.class); + } + + + @Override + public List list(ExtEmpQueryParam param) { + return null; + } + + @Override + public void save(ExtEmpPO po) { + getExternalEmployeeMapper().insertIgnoreNull(po); + } + + @Override + public void update(ExtEmpPO po) { + getExternalEmployeeMapper().updateIgnoreNull(po); + } + + @Override + public void delete(Collection ids) { + if (CollectionUtils.isNotEmpty(ids)) { + ids.forEach(getExternalEmployeeMapper()::delete); + } + } +} diff --git a/src/com/engine/salary/web/ExtEmpController.java b/src/com/engine/salary/web/ExtEmpController.java new file mode 100644 index 000000000..f918ec31d --- /dev/null +++ b/src/com/engine/salary/web/ExtEmpController.java @@ -0,0 +1,15 @@ +package com.engine.salary.web; + +/** + * 流程相关 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class ExtEmpController { + + + +} diff --git a/src/com/engine/salary/wrapper/ExtEmpWrapper.java b/src/com/engine/salary/wrapper/ExtEmpWrapper.java new file mode 100644 index 000000000..70bb6a54b --- /dev/null +++ b/src/com/engine/salary/wrapper/ExtEmpWrapper.java @@ -0,0 +1,48 @@ +package com.engine.salary.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.service.ExtEmpService; +import com.engine.salary.service.impl.ExtEmpServiceImpl; +import weaver.hrm.User; + +import java.util.Collection; +import java.util.List; + +/** + * 累计专项 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class ExtEmpWrapper extends Service implements ExtEmpService { + + private ExtEmpService getExtEmpService(User user) { + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); + } + + + @Override + public List list(ExtEmpQueryParam param) { + return null; + } + + @Override + public void save(ExtEmpPO po) { + getExtEmpService(user).save(po); + } + + @Override + public void update(ExtEmpPO po) { + getExtEmpService(user).update(po); + } + + @Override + public void delete(Collection ids) { + getExtEmpService(user).delete(ids); + } +} From 79a29df0dee587deb446c43d35b4a2c7dc0dc50f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 3 Mar 2023 14:40:17 +0800 Subject: [PATCH 02/86] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sql/还原.sql | 138 ++++++++++++++++++ .../entity/extemp/param/ExtEmpSaveParam.java | 102 +++++++++++++ .../engine/salary/web/ExtEmpController.java | 57 +++++++- .../engine/salary/wrapper/ExtEmpWrapper.java | 20 ++- 4 files changed, 308 insertions(+), 9 deletions(-) create mode 100644 resource/sql/还原.sql create mode 100644 src/com/engine/salary/entity/extemp/param/ExtEmpSaveParam.java diff --git a/resource/sql/还原.sql b/resource/sql/还原.sql new file mode 100644 index 000000000..fc70ed7b0 --- /dev/null +++ b/resource/sql/还原.sql @@ -0,0 +1,138 @@ +delete from hrsa_acct_result_temp where 1=1 +; +delete from hrsa_add_up_deduction where 1=1 +; +delete from hrsa_add_up_situation where 1=1 +; +delete from hrsa_attend_quote where 1=1 +; +delete from hrsa_attend_quote_data where 1=1 +; +delete from hrsa_attend_quote_data_value where 1=1 +; +delete from hrsa_attend_quote_field where 1=1 +; +delete from hrsa_attend_quote_sync_set where 1=1 +; + + +delete from hrsa_scheme_detail where 1=1 +; +delete from hrsa_social_archives where 1=1 +; +delete from hrsa_fund_archives where 1=1 +; +delete from hrsa_other_archives where 1=1 +; + + +delete from hrsa_bill_batch where 1=1 +; + +delete from hrsa_bill_detail where 1=1 +; +delete from hrsa_bill_detail_temp where 1=1 +; +delete from hrsa_bill_inspect where 1=1 +; + + + +delete from hrsa_check_result where 1=1 +; +delete from hrsa_check_result_record where 1=1 +; +delete from hrsa_ck_result_detail_temp where 1=1 +; +delete from hrsa_excel_acct_result where 1=1 +; + +delete from hrsa_other_deduction where 1=1 +; +delete from hrsa_salary_acct_emp where 1=1 +; +delete from hrsa_salary_acct_record where 1=1 +; +delete from hrsa_salary_acct_result where 1=1 +; +delete from hrsa_salary_archive where 1=1 +; +delete from hrsa_salary_archive_dimission where 1=1 +; +delete from hrsa_salary_archive_item where 1=1 +; +delete from hrsa_salary_archive_tax_agent where 1=1 +; +delete from hrsa_salary_item where 1=1 +; +delete from hrsa_salary_send where 1=1 +; +delete from hrsa_salary_send_info where 1=1 +; +delete from hrsa_salary_sob where 1=1 +; +delete from hrsa_salary_sob_adjust_rule where 1=1 +; +delete from hrsa_salary_sob_emp_field where 1=1 +; +delete from hrsa_salary_sob_item where 1=1 +; +delete from hrsa_salary_sob_item_group where 1=1 +; +delete from hrsa_salary_sob_range where 1=1 +; +delete from hrsa_salary_template where 1=1 +; + +delete from hrsa_social_security_scheme where 1=1 +; +delete from hrsa_sys_tax_rate_base where 1=1 +; +delete from hrsa_sys_tax_rate_detail where 1=1 +; +delete from hrsa_tax_agent where 1=1 +; +delete from hrsa_tax_agent_emp where 1=1 +; +delete from hrsa_tax_agent_emp_change where 1=1 +; +delete from hrsa_tax_agent_admin where 1=1 +; +delete from hrsa_tax_agent_manage_range where 1=1 +; + +delete from hrsa_tax_agent_sub_admin where 1=1 +; +delete from hrsa_tax_agent_sub_admin_emp where 1=1 +; + +delete from hrsa_tax_declaration where 1=1 +; +delete from hrsa_tax_declaration_detail where 1=1 +; +delete from hrsa_tax_rate_base where 1=1 +; +delete from hrsa_tax_rate_detail where 1=1 +; +delete from hrsa_salary_acct_result_report where 1=1 +; + +delete from hrsa_insurance_base_info where 1=1 +; + + +delete from hrsa_salary_sob_back_item where 1=1 +; +delete from hrsa_salary_send_range where 1=1 +; +delete from hrsa_salary_send_range_obj where 1=1 +; +delete from hrsa_compensation_log where 1=1 +; +delete from hrsa_compensation_config where 1=1 +; +delete from hrsa_special_add_deduction where 1=1 +; + + + diff --git a/src/com/engine/salary/entity/extemp/param/ExtEmpSaveParam.java b/src/com/engine/salary/entity/extemp/param/ExtEmpSaveParam.java new file mode 100644 index 000000000..afb5ccb4b --- /dev/null +++ b/src/com/engine/salary/entity/extemp/param/ExtEmpSaveParam.java @@ -0,0 +1,102 @@ +package com.engine.salary.entity.extemp.param; + +import com.engine.salary.common.BaseQueryParam; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 数据采集-累计专项附加扣除查询参数 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ExtEmpSaveParam extends BaseQueryParam { + + private Long id; + + /** + * 姓名 + */ + private String username; + /** + * 部门 + */ + private String departmentName; + /** + * 部门ID + */ + private Long departmentId; + /** + * 分部 + */ + private String subcompanyName; + /** + * 分部ID + */ + private Long subcompanyId; + /** + * 岗位 + */ + private String jobtitleName; + /** + * 岗位ID + */ + private Long jobtitleId; + /** + * 入职日期 + */ + private String companystartdate; + /** + * 手机 + */ + private String mobile; + /** + * 状态编码 + */ + private String status; + /** + * 工号 + */ + private String workcode; + /** + * 性别 + */ + private String sex; + /** + * 邮件 + */ + private String email; + /** + * 电话 + */ + private String telephone; + /** + * 职称 + */ + private String jobcall; + /** + * 出生日期 + */ + private String birthday; + /** + * 身份证号码 + */ + private String idNo; + /** + * 本人开户的银行卡卡号 + */ + private String bankCardNum; + /** + * 本人开户的银行卡开户支行全称 + */ + private String bankName; + +} diff --git a/src/com/engine/salary/web/ExtEmpController.java b/src/com/engine/salary/web/ExtEmpController.java index f918ec31d..bd5a02d04 100644 --- a/src/com/engine/salary/web/ExtEmpController.java +++ b/src/com/engine/salary/web/ExtEmpController.java @@ -1,7 +1,27 @@ package com.engine.salary.web; +import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; +import com.engine.salary.entity.extemp.param.ExtEmpSaveParam; +import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.util.ResponseResult; +import com.engine.salary.wrapper.ExtEmpWrapper; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import java.util.Collection; +import java.util.List; + /** - * 流程相关 + * 外部人员 *

Copyright: Copyright (c) 2022

*

Company: 泛微软件

* @@ -10,6 +30,41 @@ package com.engine.salary.web; **/ public class ExtEmpController { + private ExtEmpWrapper getExtEmpWrapper(User user) { + return ServiceUtil.getService(ExtEmpWrapper.class, user); + } + + @POST + @Path("/list") + @Produces(MediaType.APPLICATION_JSON) + public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ExtEmpQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getExtEmpWrapper(user)::list, param); + } + + @POST + @Path("/save") + @Produces(MediaType.APPLICATION_JSON) + public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ExtEmpSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getExtEmpWrapper(user)::save, param); + } + + @POST + @Path("/update") + @Produces(MediaType.APPLICATION_JSON) + public String update(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ExtEmpSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getExtEmpWrapper(user)::update, param); + } + + @POST + @Path("/delete") + @Produces(MediaType.APPLICATION_JSON) + public String delete(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection ids) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult, String>(user).run(getExtEmpWrapper(user)::delete, ids); + } } diff --git a/src/com/engine/salary/wrapper/ExtEmpWrapper.java b/src/com/engine/salary/wrapper/ExtEmpWrapper.java index 70bb6a54b..92ee40588 100644 --- a/src/com/engine/salary/wrapper/ExtEmpWrapper.java +++ b/src/com/engine/salary/wrapper/ExtEmpWrapper.java @@ -3,9 +3,11 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; +import com.engine.salary.entity.extemp.param.ExtEmpSaveParam; import com.engine.salary.entity.extemp.po.ExtEmpPO; import com.engine.salary.service.ExtEmpService; import com.engine.salary.service.impl.ExtEmpServiceImpl; +import org.springframework.beans.BeanUtils; import weaver.hrm.User; import java.util.Collection; @@ -19,29 +21,31 @@ import java.util.List; * @author qiantao * @version 1.0 **/ -public class ExtEmpWrapper extends Service implements ExtEmpService { +public class ExtEmpWrapper extends Service { private ExtEmpService getExtEmpService(User user) { - return ServiceUtil.getService(ExtEmpServiceImpl.class, user); + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); } - @Override public List list(ExtEmpQueryParam param) { return null; } - @Override - public void save(ExtEmpPO po) { + public void save(ExtEmpSaveParam param) { + + ExtEmpPO po = new ExtEmpPO(); + BeanUtils.copyProperties(param, po); + getExtEmpService(user).save(po); } - @Override - public void update(ExtEmpPO po) { + public void update(ExtEmpSaveParam param) { + ExtEmpPO po = new ExtEmpPO(); + BeanUtils.copyProperties(param, po); getExtEmpService(user).update(po); } - @Override public void delete(Collection ids) { getExtEmpService(user).delete(ids); } From a5596d503f657bf105a8b151759cbe5d7bf8a3cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 3 Mar 2023 16:57:52 +0800 Subject: [PATCH 03/86] =?UTF-8?q?=E5=A4=96=E9=83=A8=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/extemp/param/ExtEmpSaveParam.java | 3 +- .../salary/entity/extemp/po/ExtEmpPO.java | 11 ++++- .../mapper/extemp/ExternalEmployeeMapper.java | 44 ++++++++----------- .../mapper/extemp/ExternalEmployeeMapper.xml | 2 +- .../engine/salary/service/ExtEmpService.java | 8 +++- .../service/impl/ExtEmpServiceImpl.java | 37 ++++++++++++++-- .../engine/salary/web/ExtEmpController.java | 6 +-- .../engine/salary/wrapper/ExtEmpWrapper.java | 17 +++---- 8 files changed, 79 insertions(+), 49 deletions(-) diff --git a/src/com/engine/salary/entity/extemp/param/ExtEmpSaveParam.java b/src/com/engine/salary/entity/extemp/param/ExtEmpSaveParam.java index afb5ccb4b..f38362d8a 100644 --- a/src/com/engine/salary/entity/extemp/param/ExtEmpSaveParam.java +++ b/src/com/engine/salary/entity/extemp/param/ExtEmpSaveParam.java @@ -1,6 +1,5 @@ package com.engine.salary.entity.extemp.param; -import com.engine.salary.common.BaseQueryParam; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -18,7 +17,7 @@ import lombok.NoArgsConstructor; @Builder @NoArgsConstructor @AllArgsConstructor -public class ExtEmpSaveParam extends BaseQueryParam { +public class ExtEmpSaveParam { private Long id; diff --git a/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java b/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java index 82a24937a..e266f5ba2 100644 --- a/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java +++ b/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java @@ -1,11 +1,13 @@ package com.engine.salary.entity.extemp.po; +import com.engine.salary.annotation.TableTitle; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Collection; import java.util.Date; /** @@ -22,10 +24,12 @@ public class ExtEmpPO { /** * 姓名 */ + @TableTitle(title = "姓名", dataIndex = "username", key = "username") private String username; /** * 部门 */ + @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") private String departmentName; /** * 部门ID @@ -34,6 +38,7 @@ public class ExtEmpPO { /** * 分部 */ + @TableTitle(title = "分部", dataIndex = "subcompanyName", key = "subcompanyName") private String subcompanyName; /** * 分部ID @@ -42,6 +47,7 @@ public class ExtEmpPO { /** * 岗位 */ + @TableTitle(title = "岗位", dataIndex = "jobtitleName", key = "jobtitleName") private String jobtitleName; /** * 岗位ID @@ -50,6 +56,7 @@ public class ExtEmpPO { /** * 入职日期 */ + @TableTitle(title = "入职日期", dataIndex = "companystartdate", key = "companystartdate") private String companystartdate; /** * 手机 @@ -62,6 +69,7 @@ public class ExtEmpPO { /** * 工号 */ + @TableTitle(title = "工号", dataIndex = "workcode", key = "workcode") private String workcode; /** * 性别 @@ -120,4 +128,5 @@ public class ExtEmpPO { */ private String tenantKey; -} \ No newline at end of file + private Collection ids; +} diff --git a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java index 5f052651c..7fa9abc28 100644 --- a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java +++ b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java @@ -6,59 +6,53 @@ import java.util.List; public interface ExternalEmployeeMapper { - /** + /** * 查询所有记录 * * @return 返回集合,没有返回空List */ - List listAll(); + List listAll(); - /** + /** * 根据主键查询 * * @param id 主键 * @return 返回记录,没有返回null */ - ExtEmpPO getById(Integer id); - - /** - * 新增,插入所有字段 - * - * @param externalEmployee 新增的记录 - * @return 返回影响行数 - */ - int insert(ExtEmpPO externalEmployee); - - /** + ExtEmpPO getById(Integer id); + + List listSome(ExtEmpPO po); + + /** * 新增,忽略null字段 * * @param externalEmployee 新增的记录 * @return 返回影响行数 */ - int insertIgnoreNull(ExtEmpPO externalEmployee); - - /** + int insertIgnoreNull(ExtEmpPO externalEmployee); + + /** * 修改,修改所有字段 * * @param externalEmployee 修改的记录 * @return 返回影响行数 */ - int update(ExtEmpPO externalEmployee); - - /** + int update(ExtEmpPO externalEmployee); + + /** * 修改,忽略null字段 * * @param externalEmployee 修改的记录 * @return 返回影响行数 */ - int updateIgnoreNull(ExtEmpPO externalEmployee); - - /** + int updateIgnoreNull(ExtEmpPO externalEmployee); + + /** * 删除记录 * * @return 返回影响行数 */ - int delete(Long id); - + int delete(Long id); + } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml index aff4029da..730eae408 100644 --- a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml @@ -87,7 +87,7 @@ AND id = #{id} - + AND username = #{username} diff --git a/src/com/engine/salary/service/ExtEmpService.java b/src/com/engine/salary/service/ExtEmpService.java index 04a388f67..4c2bbf01f 100644 --- a/src/com/engine/salary/service/ExtEmpService.java +++ b/src/com/engine/salary/service/ExtEmpService.java @@ -1,7 +1,9 @@ package com.engine.salary.service; import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; +import com.engine.salary.entity.extemp.param.ExtEmpSaveParam; import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.util.page.PageInfo; import java.util.Collection; import java.util.List; @@ -10,9 +12,11 @@ public interface ExtEmpService { List list(ExtEmpQueryParam param); - void save(ExtEmpPO po); + PageInfo listPage (ExtEmpQueryParam param); - void update(ExtEmpPO po); + void save(ExtEmpSaveParam po); + + void update(ExtEmpSaveParam po); void delete(Collection ids); diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java index b61665f6b..64093fde4 100644 --- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -2,13 +2,19 @@ package com.engine.salary.service.impl; import com.engine.core.impl.Service; import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; +import com.engine.salary.entity.extemp.param.ExtEmpSaveParam; import com.engine.salary.entity.extemp.po.ExtEmpPO; import com.engine.salary.mapper.extemp.ExternalEmployeeMapper; import com.engine.salary.service.ExtEmpService; import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; +import dm.jdbc.util.IdGenerator; import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.BeanUtils; import java.util.Collection; +import java.util.Date; import java.util.List; /** @@ -29,16 +35,41 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { @Override public List list(ExtEmpQueryParam param) { - return null; + return getExternalEmployeeMapper().listSome(ExtEmpPO.builder().username(param.getUsername()).build()); } @Override - public void save(ExtEmpPO po) { + public PageInfo listPage(ExtEmpQueryParam param) { + List extEmpPOS = list(param); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), extEmpPOS, ExtEmpPO.class); + + } + + @Override + public void save(ExtEmpSaveParam param) { + ExtEmpPO po = new ExtEmpPO(); + BeanUtils.copyProperties(param, po); + + po.setId(IdGenerator.generate()); + po.setCreator((long) user.getUID()); + po.setModifier((long) user.getUID()); + Date now = new Date(); + po.setCreateTime(now); + po.setUpdateTime(now); + po.setDeleteType(0); + getExternalEmployeeMapper().insertIgnoreNull(po); } @Override - public void update(ExtEmpPO po) { + public void update(ExtEmpSaveParam param) { + ExtEmpPO po = new ExtEmpPO(); + BeanUtils.copyProperties(param, po); + + po.setModifier((long) user.getUID()); + Date now = new Date(); + po.setUpdateTime(now); + getExternalEmployeeMapper().updateIgnoreNull(po); } diff --git a/src/com/engine/salary/web/ExtEmpController.java b/src/com/engine/salary/web/ExtEmpController.java index bd5a02d04..24cd5fb17 100644 --- a/src/com/engine/salary/web/ExtEmpController.java +++ b/src/com/engine/salary/web/ExtEmpController.java @@ -5,6 +5,7 @@ import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; import com.engine.salary.entity.extemp.param.ExtEmpSaveParam; import com.engine.salary.entity.extemp.po.ExtEmpPO; import com.engine.salary.util.ResponseResult; +import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.ExtEmpWrapper; import io.swagger.v3.oas.annotations.parameters.RequestBody; import weaver.hrm.HrmUserVarify; @@ -18,7 +19,6 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import java.util.Collection; -import java.util.List; /** * 外部人员 @@ -35,11 +35,11 @@ public class ExtEmpController { } @POST - @Path("/list") + @Path("/listPage") @Produces(MediaType.APPLICATION_JSON) public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ExtEmpQueryParam param) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>(user).run(getExtEmpWrapper(user)::list, param); + return new ResponseResult>(user).run(getExtEmpWrapper(user)::listPage, param); } @POST diff --git a/src/com/engine/salary/wrapper/ExtEmpWrapper.java b/src/com/engine/salary/wrapper/ExtEmpWrapper.java index 92ee40588..70f63b78c 100644 --- a/src/com/engine/salary/wrapper/ExtEmpWrapper.java +++ b/src/com/engine/salary/wrapper/ExtEmpWrapper.java @@ -7,11 +7,10 @@ import com.engine.salary.entity.extemp.param.ExtEmpSaveParam; import com.engine.salary.entity.extemp.po.ExtEmpPO; import com.engine.salary.service.ExtEmpService; import com.engine.salary.service.impl.ExtEmpServiceImpl; -import org.springframework.beans.BeanUtils; +import com.engine.salary.util.page.PageInfo; import weaver.hrm.User; import java.util.Collection; -import java.util.List; /** * 累计专项 @@ -28,22 +27,16 @@ public class ExtEmpWrapper extends Service { } - public List list(ExtEmpQueryParam param) { - return null; + public PageInfo listPage(ExtEmpQueryParam param) { + return getExtEmpService(user).listPage(param); } public void save(ExtEmpSaveParam param) { - - ExtEmpPO po = new ExtEmpPO(); - BeanUtils.copyProperties(param, po); - - getExtEmpService(user).save(po); + getExtEmpService(user).save(param); } public void update(ExtEmpSaveParam param) { - ExtEmpPO po = new ExtEmpPO(); - BeanUtils.copyProperties(param, po); - getExtEmpService(user).update(po); + getExtEmpService(user).update(param); } public void delete(Collection ids) { From a423790a354c4aefd37a0a6f85a08a056bc2bb73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 6 Mar 2023 17:57:20 +0800 Subject: [PATCH 04/86] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/EmployBiz.java | 38 +++++++-------- src/com/engine/salary/biz/SIAccountBiz.java | 8 ++-- .../mapper/datacollection/EmployMapper.java | 46 +++++++++++++++---- .../mapper/datacollection/EmployMapper.xml | 22 --------- .../salary/service/SalaryEmployeeService.java | 14 +++++- .../impl/AddUpDeductionServiceImpl.java | 12 ++--- .../impl/AddUpSituationServiceImpl.java | 13 +++--- .../impl/AttendQuoteDataServiceImpl.java | 3 +- .../service/impl/ExtEmpServiceImpl.java | 10 ++++ .../impl/OtherDeductionServiceImpl.java | 13 +++--- .../service/impl/RecordsBuildServiceImpl.java | 12 +++-- .../impl/SalaryAcctCalculateServiceImpl.java | 39 ++++++++-------- .../impl/SalaryAcctExcelServiceImpl.java | 2 +- .../impl/SalaryAcctResultServiceImpl.java | 2 +- .../SalaryComparisonResultServiceImpl.java | 2 +- .../impl/SalaryEmployeeServiceImpl.java | 35 ++++++++++---- .../impl/TaxAgentManageRangeServiceImpl.java | 27 +++++------ .../service/impl/TaxAgentServiceImpl.java | 4 -- .../impl/TaxDeclarationDetailServiceImpl.java | 6 +-- .../wrapper/SalaryAcctEmployeeWrapper.java | 2 +- .../salary/wrapper/TaxAgentWrapper.java | 2 +- 21 files changed, 176 insertions(+), 136 deletions(-) diff --git a/src/com/engine/salary/biz/EmployBiz.java b/src/com/engine/salary/biz/EmployBiz.java index 5b2e288ba..4b04e4d01 100644 --- a/src/com/engine/salary/biz/EmployBiz.java +++ b/src/com/engine/salary/biz/EmployBiz.java @@ -17,6 +17,16 @@ import java.util.List; public class EmployBiz extends BaseBean { + public List listAll(){ + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + try { + EmployMapper mapper = sqlSession.getMapper(EmployMapper.class); + return mapper.listAll(); + } finally { + sqlSession.close(); + } + } + /** * 查询人员列表 * @@ -70,24 +80,6 @@ public class EmployBiz extends BaseBean { } } - public List getAdminEmployeeByIds(List list) { - if (CollectionUtils.isEmpty(list)) { - return new ArrayList<>(); - } - SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); - try { - EmployMapper mapper = sqlSession.getMapper(EmployMapper.class); - List employeeList = Lists.newArrayList(); - List> partition = Lists.partition(list, 1000); - for (List longs : partition) { - employeeList.addAll(mapper.getAdminEmployeeByIds(longs)); - } - return employeeList; - } finally { - sqlSession.close(); - } - } - /** * 岗位信息 @@ -158,4 +150,14 @@ public class EmployBiz extends BaseBean { sqlSession.close(); } } + + public List listAllForReport() { + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + try { + EmployMapper mapper = sqlSession.getMapper(EmployMapper.class); + return mapper.listAllForReport(); + } finally { + sqlSession.close(); + } + } } diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index a567d2f78..c9625c079 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -9,7 +9,6 @@ import com.engine.salary.cache.SalaryCacheKey; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.encrypt.AESEncryptUtil; import com.engine.salary.encrypt.EncryptUtil; -import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryacct.dto.SalaryAcctProgressDTO; import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO; import com.engine.salary.entity.siaccount.dto.SIAccountUtilDTO; @@ -22,7 +21,6 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.siaccount.*; import com.engine.salary.enums.sicategory.*; import com.engine.salary.exception.SalaryRunTimeException; -import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.siaccount.*; import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper; import com.engine.salary.mapper.sicategory.ICategoryMapper; @@ -117,6 +115,11 @@ public class SIAccountBiz extends Service { return (SalaryAcctProgressService) ServiceUtil.getService(SalaryAcctProgressServiceImpl.class, user); } + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + public PageInfo listPage(InsuranceAccountBatchParam queryParam) { List list = getInsuranceAccountBatchMapper().list(queryParam); PageInfo page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), @@ -1102,7 +1105,6 @@ public class SIAccountBiz extends Service { InsuranceAccountBatchPO insuranceAccountBatchPO = getInsuranceAccountBatchMapper().getByBillMonth(billMonth, param.getPaymentOrganization()); encryptUtil.decrypt(insuranceAccountBatchPO, InsuranceAccountBatchPO.class); - DataCollectionEmployee simpleEmployee = MapperProxyFactory.getProxy(EmployMapper.class).getEmployeeById(employeeId); insuranceAccountBatchPO.setAccountant(currentUserName); insuranceAccountBatchPO.setUpdateTime(new Date()); insuranceAccountBatchPO.setSocialPay(socialSum.toPlainString()); diff --git a/src/com/engine/salary/mapper/datacollection/EmployMapper.java b/src/com/engine/salary/mapper/datacollection/EmployMapper.java index 496f00ed0..d73cef7ba 100644 --- a/src/com/engine/salary/mapper/datacollection/EmployMapper.java +++ b/src/com/engine/salary/mapper/datacollection/EmployMapper.java @@ -14,20 +14,34 @@ import java.util.List; public interface EmployMapper { + /** - * 获取所有员工 + * 只查人力资源表 + * @return + */ + List listAll(); + + /** + * 获取所有员工,关联部门 * * @return */ List listEmployee(); + /** + * 单表查询 + * @param ids + * @return + */ List getEmployeeByIds(@Param("collection") List ids); + /** + * 多表联查 + * @param ids + * @return + */ List getEmployeeByIdsAll(@Param("collection") List ids); - List getAdminEmployeeByIds(@Param("collection") List list); - - List getEmployeeIdsByUserName(@Param("userName") String userName); /** * 根据薪资账套的人员范围转换而成的查询参数查询人员 @@ -37,24 +51,40 @@ public interface EmployMapper { */ List listByParams(@Param("params") Collection queryParams); + /** + * 多表,详细信息 + * @param employeeId + * @return + */ DataCollectionEmployee getEmployeeById(Long employeeId); - List listAllFields(); - /** * 报表专用 * @return */ List listAllForReport(); + /** + * 所以岗位 + * @param ids + * @return + */ List listPositionInfo(@Param("collection") List ids); + /** + * 所以部门 + * @param departmentIds + * @return + */ List getDeptInfoList(@Param("departmentIds") List departmentIds); + /** + * 所以分部 + * @param subDepartmentIds + * @return + */ List getSubCompanyInfoList(@Param("subDepartmentIds") List subDepartmentIds); - List listAll(); - List listHrmInfoByIdAndName(@Param("param") HrmQueryParam param); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/EmployMapper.xml b/src/com/engine/salary/mapper/datacollection/EmployMapper.xml index 806a1bf2d..7e5fce302 100644 --- a/src/com/engine/salary/mapper/datacollection/EmployMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/EmployMapper.xml @@ -81,19 +81,6 @@ - - - select - a.LASTNAME as username - from hrmresource a - where - e.status not in (7) - and (e.accounttype is null or e.accounttype = 0) - - SELECT - + FROM hrsa_tax_agent_emp t WHERE delete_type = 0 @@ -37,7 +41,7 @@ @@ -45,7 +49,7 @@ + SELECT + + FROM hrsa_tax_agent_ext_range t + WHERE delete_type = 0 + + + + + + + + + + + + INSERT INTO hrsa_tax_agent_ext_range + + + + create_time, + + + creator, + + + delete_type, + + + id, + + + target_id, + + + target_type, + + + tax_agent_id, + + + tenant_key, + + + update_time, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{id}, + + + #{targetId}, + + + #{targetType}, + + + #{taxAgentId}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + UPDATE hrsa_tax_agent_ext_range + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + target_id=#{targetId}, + target_type=#{targetType}, + tax_agent_id=#{taxAgentId}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_agent_ext_range + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + target_id=#{targetId}, + + + target_type=#{targetType}, + + + tax_agent_id=#{taxAgentId}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_agent_ext_range + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/ExtEmpService.java b/src/com/engine/salary/service/ExtEmpService.java index 4c2bbf01f..969651b95 100644 --- a/src/com/engine/salary/service/ExtEmpService.java +++ b/src/com/engine/salary/service/ExtEmpService.java @@ -1,5 +1,6 @@ package com.engine.salary.service; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; import com.engine.salary.entity.extemp.param.ExtEmpSaveParam; import com.engine.salary.entity.extemp.po.ExtEmpPO; @@ -20,4 +21,13 @@ public interface ExtEmpService { void delete(Collection ids); + DataCollectionEmployee getEmployeeById(Long id); + + /** + * 获取人员信息 + * @param ids + * @return + */ + List getEmployeeByIds(List ids); + } \ No newline at end of file diff --git a/src/com/engine/salary/service/TaxAgentEmpService.java b/src/com/engine/salary/service/TaxAgentEmpService.java index d5c9f6127..6ea2779e4 100644 --- a/src/com/engine/salary/service/TaxAgentEmpService.java +++ b/src/com/engine/salary/service/TaxAgentEmpService.java @@ -38,4 +38,11 @@ public interface TaxAgentEmpService{ * @param currentEmployeeId */ void syncTaxAgentEmployee(List taxAgentEmpSaveParamList, Long currentEmployeeId); + + /** + * 同步外部人员 + * @param taxAgentEmpSaveParamList + * @param currentEmployeeId + */ + void syncTaxAgentExtEmployee(List taxAgentEmpSaveParamList, Long currentEmployeeId); } diff --git a/src/com/engine/salary/service/TaxAgentManageRangeService.java b/src/com/engine/salary/service/TaxAgentManageRangeService.java index 35f665594..baef0ea9d 100644 --- a/src/com/engine/salary/service/TaxAgentManageRangeService.java +++ b/src/com/engine/salary/service/TaxAgentManageRangeService.java @@ -1,10 +1,7 @@ package com.engine.salary.service; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeListDTO; -import com.engine.salary.entity.taxagent.param.TaxAgentImportParam; -import com.engine.salary.entity.taxagent.param.TaxAgentRangeQueryParam; -import com.engine.salary.entity.taxagent.param.TaxAgentRangeSaveParam; -import com.engine.salary.entity.taxagent.param.TaxAgentSubAdminRangeQueryParam; +import com.engine.salary.entity.taxagent.param.*; import com.engine.salary.entity.taxagent.po.TaxAgentManageRangePO; import com.engine.salary.util.page.PageInfo; @@ -55,6 +52,12 @@ public interface TaxAgentManageRangeService { */ void save(TaxAgentRangeSaveParam saveParam); + /** + * 保存外部人员范围 + * @param saveParam + */ + void saveExtRange(TaxAgentManageRangeExtSaveParam saveParam); + /** * 根据主键id删除管理范围 diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java index e59099e03..46ec42bcc 100644 --- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -14,6 +14,7 @@ import dm.jdbc.util.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.BeanUtils; +import java.util.ArrayList; import java.util.Collection; import java.util.Date; import java.util.List; @@ -82,10 +83,43 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { } } - public List cover(List extEmps) { + @Override + public DataCollectionEmployee getEmployeeById(Long id) { + ExtEmpPO po = getExternalEmployeeMapper().getById(id); + return cover(po); + } + + @Override + public List getEmployeeByIds(List ids) { + if (CollectionUtils.isEmpty(ids)) { + return new ArrayList<>(); + } + List extEmpPOS = getExternalEmployeeMapper().listSome(ExtEmpPO.builder().ids(ids).build()); + + return coverList(extEmpPOS); + + } + + + public DataCollectionEmployee cover(ExtEmpPO extPo) { + if (extPo == null) { + return null; + } + DataCollectionEmployee employee = new DataCollectionEmployee(); + BeanUtils.copyProperties(extPo, employee); + employee.setEmployeeId(extPo.getId()); + return employee; + } + + public List coverList(List extEmps) { + if (CollectionUtils.isEmpty(extEmps)) { + return new ArrayList<>(); + } + return extEmps.stream().map(emp -> { DataCollectionEmployee employee = new DataCollectionEmployee(); BeanUtils.copyProperties(emp, employee); + employee.setEmployeeId(emp.getId()); return employee; }).collect(Collectors.toList()); } diff --git a/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java index 4cf2168ed..a5847783f 100644 --- a/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java @@ -7,6 +7,7 @@ import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.taxagent.param.TaxAgentEmpSaveParam; import com.engine.salary.entity.taxagent.po.TaxAgentEmpChangePO; import com.engine.salary.entity.taxagent.po.TaxAgentEmpPO; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.engine.salary.enums.taxagent.TaxAgentEmpChangeModuleEnum; import com.engine.salary.enums.taxagent.TaxAgentEmpChangeTypeEnum; import com.engine.salary.mapper.taxagent.TaxAgentEmpMapper; @@ -154,4 +155,100 @@ public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpServic getTaxAgentEmpChangeService(user).batchInsert(taxAgentEmpChangeList); } } + + @Override + public void syncTaxAgentExtEmployee(List taxAgentEmpSaveParamList, Long currentEmployeeId) { + if (CollectionUtils.isEmpty(taxAgentEmpSaveParamList)) { + return; + } + List taxAgentIds = taxAgentEmpSaveParamList.stream().map(TaxAgentEmpSaveParam::getTaxAgentId).collect(Collectors.toList()); + List taxAgentEmployeeExistList = this.listByTaxAgentIds(taxAgentIds); + Date now = new Date(); + // 关联表 + List taxAgentEmployeeAddList = Lists.newArrayList(); + List taxAgentEmployeeDelIds = Lists.newArrayList(); + // 增量表 + List taxAgentEmpChangeList = Lists.newArrayList(); + + taxAgentEmpSaveParamList.forEach(saveParam -> { + List existList = taxAgentEmployeeExistList.stream().filter(f -> f.getTaxAgentId().equals(saveParam.getTaxAgentId())).collect(Collectors.toList()); + Map taxAgentEmployeeMap = SalaryEntityUtil.convert2Map(existList, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); + for (DataCollectionEmployee se : saveParam.getSalaryEmployeeList()) { + String key = saveParam.getTaxAgentId() + "-" + se.getEmployeeId(); + // 本地有的不动 + if (taxAgentEmployeeMap.containsKey(key)) { + taxAgentEmployeeMap.remove(key); + continue; + } + taxAgentEmployeeAddList.add(TaxAgentEmpPO.builder() + .id(IdGenerator.generate()) + .taxAgentId(saveParam.getTaxAgentId()) + .employeeId(se.getEmployeeId()) + .employeeName(se.getUsername()) + .employeeType(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue()) + .creator(currentEmployeeId) + .createTime(now) + .updateTime(now) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .deleteType(0) + .build()); + + Arrays.stream(TaxAgentEmpChangeModuleEnum.values()).forEach(e -> { + taxAgentEmpChangeList.add(TaxAgentEmpChangePO.builder() + .id(IdGenerator.generate()) + .taxAgentId(saveParam.getTaxAgentId()) + .employeeId(se.getEmployeeId()) + .employeeName(se.getUsername()) + .changeType(TaxAgentEmpChangeTypeEnum.ADD.getValue()) + .moduleType(e.getValue()) + .employeeType(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue()) + .creator(currentEmployeeId) + .createTime(now) + .updateTime(now) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .deleteType(0) + .build()); + }); + + } + //遍历剩余的就是删除的 + for (String key : taxAgentEmployeeMap.keySet()) { + TaxAgentEmpPO value = taxAgentEmployeeMap.get(key); + taxAgentEmployeeDelIds.add(value.getId()); + + Arrays.stream(TaxAgentEmpChangeModuleEnum.values()).forEach(e -> { + taxAgentEmpChangeList.add(TaxAgentEmpChangePO.builder() + .id(IdGenerator.generate()) + .taxAgentId(saveParam.getTaxAgentId()) + .employeeId(value.getEmployeeId()) + .employeeName(value.getEmployeeName()) + .changeType(TaxAgentEmpChangeTypeEnum.DEL.getValue()) + .moduleType(e.getValue()) + .employeeType(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue()) + .creator(currentEmployeeId) + .createTime(now) + .updateTime(now) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .deleteType(0) + .build()); + }); + } + }); + + // 关联表==================================================== + // 新增 + if (CollectionUtils.isNotEmpty(taxAgentEmployeeAddList)) { + List> partition = Lists.partition(taxAgentEmployeeAddList, 100); + partition.forEach(getTaxAgentEmpMapper()::batchInsert); + } + // 删除 + if (CollectionUtils.isNotEmpty(taxAgentEmployeeDelIds)) { + List> partition = Lists.partition(taxAgentEmployeeDelIds, 100); + partition.forEach(getTaxAgentEmpMapper()::deleteByIds); + } + // 增量表==================================================== + if (CollectionUtils.isNotEmpty(taxAgentEmpChangeList)) { + getTaxAgentEmpChangeService(user).batchInsert(taxAgentEmpChangeList); + } + } } diff --git a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java index c834df650..278570013 100644 --- a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java @@ -21,6 +21,7 @@ import com.engine.salary.enums.salarysob.TargetTypeEnum; import com.engine.salary.enums.taxagent.TaxAgentRangeTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.sys.SalarySysConfMapper; +import com.engine.salary.mapper.taxagent.TaxAgentExtRangeMapper; import com.engine.salary.mapper.taxagent.TaxAgentManageRangeMapper; import com.engine.salary.service.*; import com.engine.salary.sys.entity.po.SalarySysConfPO; @@ -68,6 +69,10 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM return MapperProxyFactory.getProxy(TaxAgentManageRangeMapper.class); } + private TaxAgentExtRangeMapper getTaxAgentExtRangeMapper() { + return MapperProxyFactory.getProxy(TaxAgentExtRangeMapper.class); + } + private TaxAgentService getTaxAgentService(User user) { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } @@ -79,11 +84,16 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM private SalaryArchiveService getSalaryArchiveService(User user) { return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user); } - + private SalaryEmployeeService getSalaryEmployeeService(User user) { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + private ExtEmpService getExtEmpService(User user) { + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); + } + + private SalarySysConfMapper getSalarySysConfMapper() { return SqlProxyHandle.getProxy(SalarySysConfMapper.class); } @@ -93,7 +103,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM } public SIArchivesService getSIArchivesService(User user) { - return ServiceUtil.getService(SIArchivesServiceImpl.class,user); + return ServiceUtil.getService(SIArchivesServiceImpl.class, user); } @@ -348,6 +358,64 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM } + + /** + * 根据个税口角义务人id保存管理范围 + * + * @param saveParam 保存参数 + */ + @Override + public void saveExtRange(TaxAgentManageRangeExtSaveParam saveParam) { + + if (saveParam == null) { + throw new SalaryRunTimeException("参数错误"); + } + Long taxAgentId = saveParam.getTaxAgentId(); + if (Objects.isNull(taxAgentId)) { + throw new SalaryRunTimeException("个税扣缴义务人的id不允许为空"); + } + + + // 查询个税扣缴义务人 + TaxAgentPO taxAgent = getTaxAgentService(user).getById(taxAgentId); + if (Objects.isNull(taxAgent)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(108605, "参数错误,个税扣缴义务人不存在或不在权限范围内")); + } + + List targetIds = saveParam.getTargetIds(); + List employees = getExtEmpService(user).getEmployeeByIds(targetIds); + if (Objects.isNull(employees)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(108605, "参数错误,无此外部人员")); + } + + + /* 同步本地人员范围的关联人员=========================== */ + if (saveParam.isSync()) { + //同步执行 + syncLocalExtEmp(taxAgentId, employees); + } else { + taskExecutor.execute(() -> { + syncLocalExtEmp(taxAgentId, employees); + }); + } + } + + private void syncLocalExtEmp(Long taxAgentId, List allSalaryEmployees) { + + List taxAgentEmpSaveParamList = Collections.singletonList(getTaxAgentEmpSyncParam(taxAgentId, allSalaryEmployees)); + // 同步个税扣缴义务人的人员 + getTaxAgentEmpService(user).syncTaxAgentExtEmployee(taxAgentEmpSaveParamList, (long) user.getUID()); + +// //生成档案 + getSalaryArchiveService(user).handleChangeData(1L); +// //生成社保福利档案 +// String welSign = (String) Util_DataCache.getObjVal("welfareChangeSign"); +// if (welSign == null || "0".equals(welSign)) { +// getSIArchivesService(user).handleChangeData(1L); +// } + } + + /** * 获取个税口角义务人的管理范围 * @@ -549,6 +617,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM /** * 导入数据 + * * @param taxAgentImportParam * @return */ @@ -667,18 +736,18 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM } // 设置员工状态 - if(StringUtils.isEmpty(employeeStatusStr)){ + if (StringUtils.isEmpty(employeeStatusStr)) { po.setEmployeeStatus(allEmployeeStatuses); - }else{ + } else { Boolean[] haveError = {false}; // 人员状态字符串转换为对应的value List status = SalaryEmployeeStatusEnum.parseByFormatStr(employeeStatusStr, haveError); - if(haveError[0]){ + if (haveError[0]) { Map errorMessageMap = new HashMap<>(); errorMessageMap.put("message", rowIndex + "员工状态不存在,或格式有误。格式为:试用、正式、临时、试用延期"); errorData.add(errorMessageMap); errorSum += 1; - }else{ + } else { po.setEmployeeStatus(status); } } @@ -687,7 +756,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM if (Objects.isNull(taxAgent)) { //个税扣缴义务人不存在 Map errorMessageMap = new HashMap<>(); - errorMessageMap.put("message","个税扣缴义务人不存在或不在权限范围内"); + errorMessageMap.put("message", "个税扣缴义务人不存在或不在权限范围内"); errorData.add(errorMessageMap); errorSum += 1; } @@ -758,7 +827,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM } // 多条相同人的则以第一条为准,如果逆序排列(用于重复的则以最后一条为准)Collections.reverse(pos); // 去重(通过记录的唯一条件(人员id) - List finalPos = pos.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTargetId() ))), ArrayList::new)); + List finalPos = pos.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTargetId()))), ArrayList::new)); return finalPos; } @@ -770,7 +839,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM throw new SalaryRunTimeException("文件不存在"); } Long taxAgentId = importParam.getTaxAgentId(); - if(Objects.isNull(taxAgentId)){ + if (Objects.isNull(taxAgentId)) { throw new SalaryRunTimeException("个税扣缴义务人为空"); } } diff --git a/src/com/engine/salary/web/TaxAgentController.java b/src/com/engine/salary/web/TaxAgentController.java index 812d6d262..161426750 100644 --- a/src/com/engine/salary/web/TaxAgentController.java +++ b/src/com/engine/salary/web/TaxAgentController.java @@ -253,6 +253,14 @@ public class TaxAgentController { return new ResponseResult(user).run(getTaxAgentWrapper(user)::saveRange, saveParam); } + @POST + @Path("/range/ext/save") + @Produces(MediaType.APPLICATION_JSON) + public String saveExtRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentManageRangeExtSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxAgentWrapper(user)::saveExtRange, saveParam); + } + //删除人员范围 @POST @Path("/range/delete") diff --git a/src/com/engine/salary/wrapper/TaxAgentWrapper.java b/src/com/engine/salary/wrapper/TaxAgentWrapper.java index 86df32a70..9ca28c641 100644 --- a/src/com/engine/salary/wrapper/TaxAgentWrapper.java +++ b/src/com/engine/salary/wrapper/TaxAgentWrapper.java @@ -347,6 +347,16 @@ public class TaxAgentWrapper extends Service { return StringUtils.EMPTY; } + /** + * 外部人员范围 + * @param saveParam + * @return + */ + public String saveExtRange(TaxAgentManageRangeExtSaveParam saveParam) { + getTaxAgentManageRangeService(user).saveExtRange(saveParam); + return StringUtils.EMPTY; + } + /** * 删除管理范围 * @@ -438,4 +448,6 @@ public class TaxAgentWrapper extends Service { public Map importData(TaxAgentImportParam taxAgentImportParam) { return getTaxAgentManageRangeService(user).importData(taxAgentImportParam); } + + } From d8c13b70d2ca3663a78113a6f602b93d25c819e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 8 Mar 2023 18:01:19 +0800 Subject: [PATCH 08/86] =?UTF-8?q?=E5=86=85=E5=A4=96=E9=83=A8=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E5=8C=B9=E9=85=8D=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/SalaryEmployeeServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index 704003b35..157426822 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -50,6 +50,8 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + boolean openExtEmp = true; + @Override public List listAll() { return employBiz.listEmployee(); From 32b1a2db48ab86f2b065face679c9156e113e090 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Mon, 13 Mar 2023 15:53:56 +0800 Subject: [PATCH 09/86] =?UTF-8?q?employeeService=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=A4=96=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/extemp/ExternalEmployeeMapper.java | 31 +++++ .../mapper/extemp/ExternalEmployeeMapper.xml | 126 ++++++++++++++++++ .../engine/salary/service/ExtEmpService.java | 13 ++ .../service/impl/ExtEmpServiceImpl.java | 33 +++++ .../impl/SalaryEmployeeServiceImpl.java | 49 +++++-- 5 files changed, 244 insertions(+), 8 deletions(-) diff --git a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java index 8eeb8f64c..455eb8adf 100644 --- a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java +++ b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.java @@ -1,7 +1,11 @@ package com.engine.salary.mapper.extemp; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; +import org.apache.ibatis.annotations.Param; +import java.util.Collection; import java.util.List; public interface ExternalEmployeeMapper { @@ -55,4 +59,31 @@ public interface ExternalEmployeeMapper { */ int delete(Long id); + /** + * 根据薪资账套的人员范围转换而成的查询参数查询人员 + * + * @param queryParams 薪资账套的人员范围转换而成的查询参数 + * @return + */ + Collection listByParams( @Param("params") List queryParams); + + /** + * 获取所有员工,关联部门 + * + * @return + */ + List listEmployee(); + + /** + * 多表联查 + * @param ids + * @return + */ + List getEmployeeByIdsAll(@Param("collection")List ids); + + /** + * 报表专用 + * @return + */ + Collection listAllForReport(); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml index 730eae408..5b8361eda 100644 --- a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml @@ -170,6 +170,132 @@ ORDER BY id DESC + + + + + diff --git a/src/com/engine/salary/service/ExtEmpService.java b/src/com/engine/salary/service/ExtEmpService.java index 969651b95..7e44f4ccb 100644 --- a/src/com/engine/salary/service/ExtEmpService.java +++ b/src/com/engine/salary/service/ExtEmpService.java @@ -4,6 +4,7 @@ import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; import com.engine.salary.entity.extemp.param.ExtEmpSaveParam; import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; import com.engine.salary.util.page.PageInfo; import java.util.Collection; @@ -30,4 +31,16 @@ public interface ExtEmpService { */ List getEmployeeByIds(List ids); + List listByParams(List includeQueryParams); + + /** + * 查询人员列表 + * + * @return + */ + List listEmployee(); + + Collection getEmployeeByIdsAll(List ids); + + Collection listAllForReport(); } \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java index 46ec42bcc..0bc669d71 100644 --- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -5,11 +5,13 @@ import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; import com.engine.salary.entity.extemp.param.ExtEmpSaveParam; import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; import com.engine.salary.mapper.extemp.ExternalEmployeeMapper; import com.engine.salary.service.ExtEmpService; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; +import com.google.common.collect.Lists; import dm.jdbc.util.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.BeanUtils; @@ -100,6 +102,37 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { } + @Override + public List listByParams(List includeQueryParams) { + List emps = new ArrayList<>(); + List> partition = Lists.partition(includeQueryParams, 100); + partition.forEach(list->{ + emps.addAll(getExternalEmployeeMapper().listByParams(list)); + }); + return emps; + } + + @Override + public List listEmployee() { + return getExternalEmployeeMapper().listEmployee(); + } + + @Override + public Collection getEmployeeByIdsAll(List ids) { + List employeeList = new ArrayList<>(); + List> partition = Lists.partition(ids, 1000); + partition.forEach(e->{ + List employeeByIdsAll = getExternalEmployeeMapper().getEmployeeByIdsAll(e); + employeeList.addAll(employeeByIdsAll); + }); + return employeeList; + } + + @Override + public Collection listAllForReport() { + return getExternalEmployeeMapper().listAllForReport(); + } + public DataCollectionEmployee cover(ExtEmpPO extPo) { if (extPo == null) { diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index 157426822..8e44870f4 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -13,6 +13,7 @@ import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; import com.engine.salary.entity.salarysob.po.SalarySobRangePO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.mapper.sys.SalarySysConfMapper; +import com.engine.salary.service.ExtEmpService; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.SalarySobRangeService; import com.engine.salary.sys.entity.po.SalarySysConfPO; @@ -46,20 +47,29 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee return SqlProxyHandle.getProxy(SalarySysConfMapper.class); } - private SalaryEmployeeService getSalaryEmployeeService(User user) { - return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + + private ExtEmpService getExtEmpService(User user) { + return ServiceUtil.getService(ExtEmpServiceImpl.class, user); } boolean openExtEmp = true; @Override public List listAll() { - return employBiz.listEmployee(); + List result = employBiz.listEmployee(); + if(openExtEmp){ + result.addAll(getExtEmpService(user).listEmployee()); + } + return result; } @Override public List listAllForReport() { - return employBiz.listAllForReport(); + List result = employBiz.listAllForReport(); + if(openExtEmp){ + result.addAll(getExtEmpService(user).listAllForReport()); + } + return result; } @Override @@ -72,7 +82,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee // 将薪资账套的人员范围转换成人员查询参数 List includeQueryParams = SalarySobRangeBO.convert2EmployeeQueryParam(includeSalarySobRangePOS); // 根据上一步的查询参数查询人员 - List includeSalaryEmployees = getSalaryEmployeeService(user).listByParams(includeQueryParams); + List includeSalaryEmployees = listByParams(includeQueryParams); if (CollectionUtils.isEmpty(includeSalaryEmployees)) { return Collections.emptyList(); } @@ -84,7 +94,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee // 将薪资账套的人员范围转换成人员查询参数 List excludeQueryParams = SalarySobRangeBO.convert2EmployeeQueryParam(excludeSalarySobRangePOS); // 根据上一步的查询参数查询人员 - List excludeSalaryEmployees = getSalaryEmployeeService(user).listByParams(excludeQueryParams); + List excludeSalaryEmployees = listByParams(excludeQueryParams); // 需要排除的人员范围 Set excludeEmployeeIds = SalaryEntityUtil.properties(excludeSalaryEmployees, DataCollectionEmployee::getEmployeeId); // 过滤人员 @@ -97,12 +107,23 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee @Override public List getEmployeeByIdsAll(List ids) { - return employBiz.getEmployeeByIdsAll(ids); + List result = employBiz.getEmployeeByIdsAll(ids); + if(openExtEmp){ + result.addAll(getExtEmpService(user).getEmployeeByIdsAll(ids)); + } + return result; } @Override public DataCollectionEmployee getEmployeeById(Long employeeId) { + if(openExtEmp){ + DataCollectionEmployee employeeById = getExtEmpService(user).getEmployeeById(employeeId); + if(Objects.nonNull(employeeById)){ + return employeeById; + } + } return employBiz.getEmployeeById(employeeId); + } @Override @@ -114,7 +135,11 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee List> partition = Lists.partition(simpleEmployeeIds, 1000); for (List longs : partition) { employeeList.addAll(employBiz.getEmployeeByIds(longs)); + if(openExtEmp){ + employeeList.addAll(getExtEmpService(user).getEmployeeByIds(longs)); + } } + return employeeList; } @@ -177,11 +202,19 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee @Override public List listEmployee() { - return employBiz.listEmployee(); + List result = employBiz.listEmployee(); + if(openExtEmp){ + result.addAll(getExtEmpService(user).listEmployee()); + } + return result; } @Override public List listByParams(List includeQueryParams) { + List result = employBiz.listByParams(includeQueryParams); + if(openExtEmp){ + result.addAll(getExtEmpService(user).listByParams(includeQueryParams)); + } return employBiz.listByParams(includeQueryParams); } } From 7b0e1cb1f34b0b806dfdeec8ccbd0116db678780 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Mon, 13 Mar 2023 15:57:12 +0800 Subject: [PATCH 10/86] =?UTF-8?q?employeeService=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=A4=96=E9=83=A8=20fixBug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/SalaryEmployeeServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index 8e44870f4..284efe857 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -123,7 +123,6 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee } } return employBiz.getEmployeeById(employeeId); - } @Override @@ -215,6 +214,6 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee if(openExtEmp){ result.addAll(getExtEmpService(user).listByParams(includeQueryParams)); } - return employBiz.listByParams(includeQueryParams); + return result; } } From a61b7ac7bc9eefec47a3f6aa89b7936c0f1a1bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 13 Mar 2023 16:04:19 +0800 Subject: [PATCH 11/86] =?UTF-8?q?=E5=A4=96=E9=83=A8=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/SalaryArchiveListDTO.java | 2 + .../param/SalaryArchiveQueryParam.java | 5 ++ .../mapper/archive/SalaryArchiveMapper.java | 9 ++ .../mapper/archive/SalaryArchiveMapper.xml | 89 +++++++++++++++++++ .../engine/salary/service/ExtEmpService.java | 1 + .../salary/service/SalaryArchiveService.java | 2 + .../service/impl/ExtEmpServiceImpl.java | 6 ++ .../impl/SalaryArchiveExcelServiceImpl.java | 2 +- .../impl/SalaryArchiveServiceImpl.java | 26 ++++-- .../engine/salary/web/ExtEmpController.java | 13 ++- .../salary/web/SalaryArchiveController.java | 16 ++++ .../engine/salary/wrapper/ExtEmpWrapper.java | 4 + .../salary/wrapper/SalaryArchiveWrapper.java | 2 - 13 files changed, 162 insertions(+), 15 deletions(-) diff --git a/src/com/engine/salary/entity/salaryarchive/dto/SalaryArchiveListDTO.java b/src/com/engine/salary/entity/salaryarchive/dto/SalaryArchiveListDTO.java index 00e64d7d6..107b71b50 100644 --- a/src/com/engine/salary/entity/salaryarchive/dto/SalaryArchiveListDTO.java +++ b/src/com/engine/salary/entity/salaryarchive/dto/SalaryArchiveListDTO.java @@ -36,6 +36,8 @@ public class SalaryArchiveListDTO { @TableTitle(title = "人员信息表的主键id", dataIndex = "employeeId", key = "employeeId") private Long employeeId; + private Integer employeeType; + /** * 姓名 */ diff --git a/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java b/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java index 80f8d6368..c298bd500 100644 --- a/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java +++ b/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java @@ -80,4 +80,9 @@ public class SalaryArchiveQueryParam extends BaseQueryParam { //列表类型:PENDING:待定薪;FIXED:发薪;SUSPEND:待停薪;STOP:停薪" private SalaryArchiveListTypeEnum listType; + /** + * 是否是外部系统档案 + */ + private boolean extSalaryArchiveList; + } diff --git a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.java b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.java index 1775995f3..a51718a6c 100644 --- a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.java +++ b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.java @@ -51,6 +51,13 @@ public interface SalaryArchiveMapper { */ List list(@Param("param") SalaryArchiveQueryParam param); + /** + * 外部人员 + * @param queryParam + * @return + */ + List listExtSalaryArchive(@Param("param")SalaryArchiveQueryParam queryParam); + /** * 批量插入 @@ -122,4 +129,6 @@ public interface SalaryArchiveMapper { void deletePendingTodo(@Param("ids") Collection ids); void deleteSuspendTodo(@Param("ids") Collection ids); + + } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml index 36b599165..1257dfe61 100644 --- a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml +++ b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml @@ -327,6 +327,95 @@ + + + INSERT INTO hrsa_salary_archive ( id, diff --git a/src/com/engine/salary/service/ExtEmpService.java b/src/com/engine/salary/service/ExtEmpService.java index 7e44f4ccb..8aedeeb8d 100644 --- a/src/com/engine/salary/service/ExtEmpService.java +++ b/src/com/engine/salary/service/ExtEmpService.java @@ -43,4 +43,5 @@ public interface ExtEmpService { Collection getEmployeeByIdsAll(List ids); Collection listAllForReport(); + ExtEmpPO getById(Long id); } \ No newline at end of file diff --git a/src/com/engine/salary/service/SalaryArchiveService.java b/src/com/engine/salary/service/SalaryArchiveService.java index 9ef63a791..ce97616b3 100644 --- a/src/com/engine/salary/service/SalaryArchiveService.java +++ b/src/com/engine/salary/service/SalaryArchiveService.java @@ -36,6 +36,8 @@ public interface SalaryArchiveService { */ SalaryArchivePO getById(Long salaryArchiveId); + List getSalaryArchiveList (SalaryArchiveQueryParam queryParam); + List listSome(SalaryArchivePO po); /** diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java index 0bc669d71..4a3693f90 100644 --- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -56,6 +56,7 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { BeanUtils.copyProperties(param, po); po.setId(IdGenerator.generate()); + po.setStatus("3"); po.setCreator((long) user.getUID()); po.setModifier((long) user.getUID()); Date now = new Date(); @@ -133,6 +134,11 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { return getExternalEmployeeMapper().listAllForReport(); } + @Override + public ExtEmpPO getById(Long id) { + return getExternalEmployeeMapper().getById(id); + } + public DataCollectionEmployee cover(ExtEmpPO extPo) { if (extPo == null) { diff --git a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java index f8f3a1edd..b0c89ffa9 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java @@ -306,7 +306,7 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch rows.add(header); // 获取所有个税扣缴义务人 Collection taxAgentList = getTaxAgentService(user).listAll(); - Collection salaryArchives = getSalaryArchiveMapper().list(queryParam); + Collection salaryArchives = salaryArchiveService(user).getSalaryArchiveList(queryParam); // boolean isSearchIdNo = enableHr && StringUtils.isNotEmpty(queryParam.getIdNo()); // if (isSearchIdNo) { // Map idNoEmpMap = salaryEmployeeService diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index f039017a0..143bc2817 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -153,6 +153,14 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe return getSalaryArchiveMapper().listSome(po); } + @Override + public List getSalaryArchiveList(SalaryArchiveQueryParam queryParam) { + if (queryParam.isExtSalaryArchiveList()) { + return getSalaryArchiveMapper().listExtSalaryArchive(queryParam); + } + return getSalaryArchiveMapper().list(queryParam); + } + @Override public PageInfo listPage(SalaryArchiveQueryParam queryParam) { long currentEmployeeId = user.getUID(); @@ -161,7 +169,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe * 异步处理档案数据 */ String handleable = Util.null2String(Util_DataCache.getObjVal("salaryArchiveHandleable")); - if (StringUtils.isBlank(handleable) || OpenEnum.OPEN.getValue().equals(handleable)) { + if ((StringUtils.isBlank(handleable) || OpenEnum.OPEN.getValue().equals(handleable)) && !queryParam.isExtSalaryArchiveList()) { new Thread() { public void run() { Util_DataCache.setObjVal("salaryArchiveHandleable", "0"); @@ -182,7 +190,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe //排序配置 OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); queryParam.setOrderRule(orderRule); - List list = getSalaryArchiveMapper().list(queryParam); + List list = getSalaryArchiveList(queryParam); list = list.stream() //过滤档案状态 .filter(dto -> { @@ -231,12 +239,13 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe // 1.定薪员工非在职 if (CollectionUtils.isNotEmpty(personnelStatuss)) { - List noNormalList = getSalaryArchiveMapper().list(SalaryArchiveQueryParam.builder() + SalaryArchiveQueryParam queryParam = SalaryArchiveQueryParam.builder() // 离职 .personnelStatuss(personnelStatuss) // 定薪列表 .runStatusList(Collections.singletonList(SalaryArchiveStatusEnum.FIXED.getValue())) - .build()); + .build(); + List noNormalList = getSalaryArchiveList(queryParam); if (CollectionUtils.isNotEmpty(noNormalList)) { List idList = noNormalList.stream().map(SalaryArchiveListDTO::getId).collect(Collectors.toList()); List> partition = Lists.partition(idList, 999); @@ -328,12 +337,12 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe Set taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId); //获取所有薪资档案 - List list = getSalaryArchiveMapper().list(queryParam); + List list = getSalaryArchiveList(queryParam); List finalAllArchive = list.stream().filter(dto -> employeeId.contains(dto.getEmployeeId()) && taxAgentIds.contains(dto.getTaxAgentId())).collect(Collectors.toList()); return finalAllArchive; } else { - return getSalaryArchiveMapper().list(queryParam); + return getSalaryArchiveList(queryParam); } } @@ -450,7 +459,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe String sheetName = SalaryI18nUtil.getI18nLabel(85368, "薪资档案"); // 获取所有可被引用的薪资项目 List salaryItems = salaryItemMapper.getCanAdjustSalaryItems(); - String[] header = {SalaryI18nUtil.getI18nLabel(85429, "姓名"), SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), SalaryI18nUtil.getI18nLabel(86185, "部门"), SalaryI18nUtil.getI18nLabel(86176, "工号"),SalaryI18nUtil.getI18nLabel(86186, "手机号"), SalaryI18nUtil.getI18nLabel(91075, "状态"), SalaryI18nUtil.getI18nLabel(91075, "起始发薪日期"), SalaryI18nUtil.getI18nLabel(91075, "最后发薪日期")}; + String[] header = {SalaryI18nUtil.getI18nLabel(85429, "姓名"), SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), SalaryI18nUtil.getI18nLabel(86185, "部门"), SalaryI18nUtil.getI18nLabel(86176, "工号"), SalaryI18nUtil.getI18nLabel(86186, "手机号"), SalaryI18nUtil.getI18nLabel(91075, "状态"), SalaryI18nUtil.getI18nLabel(91075, "起始发薪日期"), SalaryI18nUtil.getI18nLabel(91075, "最后发薪日期")}; // 2.表头 List headerList = new ArrayList<>(Arrays.asList(header)); for (SalaryItemPO salaryItem : salaryItems) { @@ -468,7 +477,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); queryParam.setOrderRule(orderRule); - Collection salaryArchives = getSalaryArchiveMapper().list(queryParam); + Collection salaryArchives = getSalaryArchiveList(queryParam); //分权 Boolean needAuth = getTaxAgentService(user).isNeedAuth(employeeId); @@ -783,7 +792,6 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe } - /** * 处理历史数据 * 下回发版可删除 diff --git a/src/com/engine/salary/web/ExtEmpController.java b/src/com/engine/salary/web/ExtEmpController.java index 24cd5fb17..9be31acf7 100644 --- a/src/com/engine/salary/web/ExtEmpController.java +++ b/src/com/engine/salary/web/ExtEmpController.java @@ -13,9 +13,7 @@ import weaver.hrm.User; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import java.util.Collection; @@ -66,5 +64,14 @@ public class ExtEmpController { return new ResponseResult, String>(user).run(getExtEmpWrapper(user)::delete, ids); } + @GET + @Path("/detail") + @Produces(MediaType.APPLICATION_JSON) + public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getExtEmpWrapper(user)::detail, id); + } + + } diff --git a/src/com/engine/salary/web/SalaryArchiveController.java b/src/com/engine/salary/web/SalaryArchiveController.java index 28e773578..7dab8f6d0 100644 --- a/src/com/engine/salary/web/SalaryArchiveController.java +++ b/src/com/engine/salary/web/SalaryArchiveController.java @@ -223,6 +223,22 @@ public class SalaryArchiveController { return new ResponseResult>(user).run(getSalaryArchiveWrapper(user)::stopList, queryParam); } + /** + * 外部人员列表 + * @param request + * @param response + * @param queryParam + * @return + */ + @POST + @Path("/extList") + @Produces(MediaType.APPLICATION_JSON) + public String extList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryArchiveQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalaryArchiveWrapper(user)::listPage, queryParam); + } + + /** * 取消停薪 diff --git a/src/com/engine/salary/wrapper/ExtEmpWrapper.java b/src/com/engine/salary/wrapper/ExtEmpWrapper.java index 70f63b78c..f78f0e2ec 100644 --- a/src/com/engine/salary/wrapper/ExtEmpWrapper.java +++ b/src/com/engine/salary/wrapper/ExtEmpWrapper.java @@ -42,4 +42,8 @@ public class ExtEmpWrapper extends Service { public void delete(Collection ids) { getExtEmpService(user).delete(ids); } + + public ExtEmpPO detail(Long id) { + return getExtEmpService(user).getById(id); + } } diff --git a/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java b/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java index f76e0b194..9994e12e7 100644 --- a/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java @@ -183,8 +183,6 @@ public class SalaryArchiveWrapper extends Service { * @return */ public Map listPage(SalaryArchiveQueryParam queryParam) { -// queryParam.setRunStatusList(Arrays.asList(SalaryArchiveStatusEnum.FIXED.getValue())); -// WeaTable weaTable = list(queryParam, SalaryArchiveListTypeEnum.PENDING); Map list = list(queryParam); return list; } From d5a97c819208cebd1b972f802132971446123ee3 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Mon, 13 Mar 2023 16:12:10 +0800 Subject: [PATCH 12/86] =?UTF-8?q?employeeService=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=A4=96=E9=83=A8=20fixBug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/extemp/ExternalEmployeeMapper.xml | 38 ++++++++----------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml index 5b8361eda..e99f10f4a 100644 --- a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml @@ -172,9 +172,8 @@ From 0c409c627cc0df3bd7349e2c69a94eaf66d07f97 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Mon, 13 Mar 2023 16:16:05 +0800 Subject: [PATCH 13/86] =?UTF-8?q?employeeService=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=A4=96=E9=83=A8=20fixBug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml index e99f10f4a..0a8ac06b9 100644 --- a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml @@ -265,7 +265,7 @@ c.id as jobtitleId from hrsa_external_employee e left join hrmdepartment d on e.department_id = d.id - left join hrmjobtitles c on e.jobtitle = c.id + left join hrmjobtitles c on e.jobtitle_id = c.id left join HrmSubCompany sc on e.SUBCOMPANY_ID=sc.id where 1 = 1 From 767fbe36f52b01b14737c6c0cf69b7aa944ff5dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 14 Mar 2023 10:52:48 +0800 Subject: [PATCH 14/86] =?UTF-8?q?=E5=A4=96=E9=83=A8=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/SalarySobRangeExtSaveParam.java | 36 +++ .../salarysob/po/SalarySobExtRangePO.java | 65 +++++ .../salarysob/SalarySobExtRangeMapper.java | 69 +++++ .../salarysob/SalarySobExtRangeMapper.xml | 249 ++++++++++++++++++ .../taxagent/TaxAgentExtRangeMapper.java | 5 +- .../taxagent/TaxAgentExtRangeMapper.xml | 10 + .../salary/service/SalarySobRangeService.java | 17 ++ .../service/TaxAgentManageRangeService.java | 1 + .../impl/SalaryArchiveServiceImpl.java | 1 + .../impl/SalarySobRangeServiceImpl.java | 98 +++++-- .../impl/TaxAgentManageRangeServiceImpl.java | 42 +++ .../salary/web/SalarySobController.java | 28 ++ .../engine/salary/web/TaxAgentController.java | 9 + .../salary/wrapper/SalarySobRangeWrapper.java | 19 ++ .../salary/wrapper/TaxAgentWrapper.java | 6 + 15 files changed, 633 insertions(+), 22 deletions(-) create mode 100644 src/com/engine/salary/entity/salarysob/param/SalarySobRangeExtSaveParam.java create mode 100644 src/com/engine/salary/entity/salarysob/po/SalarySobExtRangePO.java create mode 100644 src/com/engine/salary/mapper/salarysob/SalarySobExtRangeMapper.java create mode 100644 src/com/engine/salary/mapper/salarysob/SalarySobExtRangeMapper.xml diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobRangeExtSaveParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobRangeExtSaveParam.java new file mode 100644 index 000000000..7bdb173ef --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobRangeExtSaveParam.java @@ -0,0 +1,36 @@ +package com.engine.salary.entity.salarysob.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.Data; + +import java.util.List; + +/** + * 外部人员管理范围保存参数 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class SalarySobRangeExtSaveParam { + + //薪资账套的id + @DataCheck(require = true, message = "薪资账套的ID不允许为空") + private Long salarySobId; + + + /** + * 对象id + */ + private List targetIds; + + /** + * 对象类型。1:外部人员 + */ + private Long targetType; + + + +} diff --git a/src/com/engine/salary/entity/salarysob/po/SalarySobExtRangePO.java b/src/com/engine/salary/entity/salarysob/po/SalarySobExtRangePO.java new file mode 100644 index 000000000..1e2c82838 --- /dev/null +++ b/src/com/engine/salary/entity/salarysob/po/SalarySobExtRangePO.java @@ -0,0 +1,65 @@ +package com.engine.salary.entity; + +import com.engine.salary.annotation.TableTitle; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.Date; + +/** + * 个税扣缴义务人的管理范围表 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SalarySobExtRangePO { + + /** + * 主键id + */ + private Long id; + /** + * 账套id + */ + private Long salarySobId; + /** + * 对象id + */ + private Long targetId; + /** + * 对象类型。1:外部人员 + */ + private Integer targetType; + /** + * 租户ID + */ + private String tenantKey; + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 创建时间 + */ + private Date createTime; + /** + * 创建人 + */ + private Long creator; + /** + * 是否已删除。0:未删除、1:已删除 + */ + private Integer deleteType; + + //主键id集合 + private Collection ids; + + @TableTitle(title = "名称", dataIndex = "targetName", key = "targetName") + private String targetName; + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobExtRangeMapper.java b/src/com/engine/salary/mapper/salarysob/SalarySobExtRangeMapper.java new file mode 100644 index 000000000..b8c01933c --- /dev/null +++ b/src/com/engine/salary/mapper/salarysob/SalarySobExtRangeMapper.java @@ -0,0 +1,69 @@ +package com.engine.salary.mapper.salarysob; + +import com.engine.salary.entity.SalarySobExtRangePO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface SalarySobExtRangeMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(SalarySobExtRangePO salarySobExtRange); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + SalarySobExtRangePO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param salarySobExtRange 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(SalarySobExtRangePO salarySobExtRange); + + /** + * 修改,修改所有字段 + * + * @param salarySobExtRange 修改的记录 + * @return 返回影响行数 + */ + int update(SalarySobExtRangePO salarySobExtRange); + + /** + * 修改,忽略null字段 + * + * @param salarySobExtRange 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(SalarySobExtRangePO salarySobExtRange); + + /** + * 删除记录 + * + * @param salarySobExtRange 待删除的记录 + * @return 返回影响行数 + */ + int delete(SalarySobExtRangePO salarySobExtRange); + + List listPage4Ext(SalarySobExtRangePO build); + + void deleteByIds(@Param("ids") Collection ids); +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobExtRangeMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobExtRangeMapper.xml new file mode 100644 index 000000000..2265cfab2 --- /dev/null +++ b/src/com/engine/salary/mapper/salarysob/SalarySobExtRangeMapper.xml @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + t.create_time + , t.creator + , t.delete_type + , t.id + , t.salary_sob_id + , t.target_id + , t.target_type + , t.tenant_key + , t.update_time + + + + + + + + + + + + + + + INSERT INTO hrsa_salary_sob_ext_range + + + + create_time, + + + creator, + + + delete_type, + + + id, + + + salary_sob_id, + + + target_id, + + + target_type, + + + tenant_key, + + + update_time, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{id}, + + + #{salarySobId}, + + + #{targetId}, + + + #{targetType}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + UPDATE hrsa_salary_sob_ext_range + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + salary_sob_id=#{salarySobId}, + target_id=#{targetId}, + target_type=#{targetType}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_salary_sob_ext_range + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + salary_sob_id=#{salarySobId}, + + + target_id=#{targetId}, + + + target_type=#{targetType}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_salary_sob_ext_range + SET delete_type=1 + WHERE id = #{id} AND delete_type = 0 + + + + + + + + UPDATE hrsa_salary_sob_ext_range + SET delete_type=1 + WHERE id IN and delete_type=0 + + #{id} + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.java b/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.java index a187c6751..87a03f58a 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.java +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.java @@ -1,7 +1,9 @@ package com.engine.salary.mapper.taxagent; import com.engine.salary.entity.taxagent.po.TaxAgentExtRangePO; +import org.apache.ibatis.annotations.Param; +import java.util.Collection; import java.util.List; public interface TaxAgentExtRangeMapper { @@ -60,5 +62,6 @@ public interface TaxAgentExtRangeMapper { * @return 返回影响行数 */ int delete(TaxAgentExtRangePO taxAgentExtRange); - + + void deleteByIds(@Param("ids")Collection ids); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.xml b/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.xml index 398864b9e..c7e3e0e13 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.xml +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.xml @@ -210,5 +210,15 @@ AND delete_type = 0 + + UPDATE hrsa_tax_agent_ext_range + SET delete_type=1 + WHERE id in + + #{id} + + AND delete_type = 0 + + \ No newline at end of file diff --git a/src/com/engine/salary/service/SalarySobRangeService.java b/src/com/engine/salary/service/SalarySobRangeService.java index 3bfb8172a..91e2c3430 100644 --- a/src/com/engine/salary/service/SalarySobRangeService.java +++ b/src/com/engine/salary/service/SalarySobRangeService.java @@ -1,6 +1,8 @@ package com.engine.salary.service; +import com.engine.salary.entity.SalarySobExtRangePO; import com.engine.salary.entity.salarysob.dto.SalarySobRangeListDTO; +import com.engine.salary.entity.salarysob.param.SalarySobRangeExtSaveParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeImportParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeQueryParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeSaveParam; @@ -63,6 +65,19 @@ public interface SalarySobRangeService { */ void save(SalarySobRangeSaveParam saveParam); + /** + * 保存外部人员 + * @param saveParam + */ + void saveExtRange(SalarySobRangeExtSaveParam saveParam); + + /** + * 外部人员列表 + * @param param + * @return + */ + PageInfo listPage4Ext(SalarySobRangeQueryParam param); + /** * 根据主键id删除薪资账套的人员范围 * @@ -70,6 +85,8 @@ public interface SalarySobRangeService { */ void deleteByIds(Collection ids); + void deleteSalarySobExtRange(Collection ids); + /** * 根据薪资账套id删除薪资账套的人员范围 * diff --git a/src/com/engine/salary/service/TaxAgentManageRangeService.java b/src/com/engine/salary/service/TaxAgentManageRangeService.java index baef0ea9d..c9eb1ed0a 100644 --- a/src/com/engine/salary/service/TaxAgentManageRangeService.java +++ b/src/com/engine/salary/service/TaxAgentManageRangeService.java @@ -58,6 +58,7 @@ public interface TaxAgentManageRangeService { */ void saveExtRange(TaxAgentManageRangeExtSaveParam saveParam); + void deleteExtRange(Collection ids); /** * 根据主键id删除管理范围 diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index 143bc2817..7eb561b51 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -190,6 +190,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe //排序配置 OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); queryParam.setOrderRule(orderRule); + queryParam.setExtSalaryArchiveList(true); List list = getSalaryArchiveList(queryParam); list = list.stream() //过滤档案状态 diff --git a/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java index 7a67185e4..3da01f5b0 100644 --- a/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java @@ -6,6 +6,8 @@ import com.engine.core.impl.Service; import com.engine.hrm.biz.OrganizationShowSetBiz; import com.engine.salary.biz.SalarySobRangeBiz; import com.engine.salary.biz.SpecialAddDeductionBiz; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.SalarySobExtRangePO; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.hrm.DeptInfo; import com.engine.salary.entity.hrm.PositionInfo; @@ -14,6 +16,7 @@ import com.engine.salary.entity.salarysob.bo.SalarySobRangeBO; import com.engine.salary.entity.salarysob.bo.SalarySobRangeSaveBO; import com.engine.salary.entity.salarysob.dto.SalarySobRangeImportListDTO; import com.engine.salary.entity.salarysob.dto.SalarySobRangeListDTO; +import com.engine.salary.entity.salarysob.param.SalarySobRangeExtSaveParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeImportParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeQueryParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeSaveParam; @@ -24,6 +27,7 @@ import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum; import com.engine.salary.enums.salarysob.TargetTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.salarysob.SalarySobExtRangeMapper; import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.SalarySobRangeService; @@ -40,10 +44,10 @@ import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.valid.ValidUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import dm.jdbc.util.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; -import org.apache.commons.lang3.math.NumberUtils; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.file.ImageFileManager; @@ -84,6 +88,10 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange return SqlProxyHandle.getProxy(SalarySysConfMapper.class); } + private SalarySobExtRangeMapper getSalarySobExtRangeMapper() { + return SqlProxyHandle.getProxy(SalarySobExtRangeMapper.class); + } + // private ComInfoCache comInfoCache; // private LoggerTemplate salarySobLoggerTemplate; @@ -144,7 +152,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange List positionInfos = getSalaryEmployeeService(user).listPositionInfo(positionIds); // 薪资账套的人员范围po转换成列表dto - List salarySobRangeListDTOS = SalarySobRangeBO.convert2ListDTO(salarySobRangePOS, empInfos, deptInfos,subCompanyInfos, positionInfos); + List salarySobRangeListDTOS = SalarySobRangeBO.convert2ListDTO(salarySobRangePOS, empInfos, deptInfos, subCompanyInfos, positionInfos); // 根据对象名称过滤 if (StringUtils.isNotEmpty(queryParam.getTargetName())) { salarySobRangeListDTOS = salarySobRangeListDTOS.stream() @@ -152,7 +160,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange .collect(Collectors.toList()); } // 填充总数和当页数据 - PageInfo pageInfo = new PageInfo(salarySobRangeListDTOS,SalarySobRangeListDTO.class); + PageInfo pageInfo = new PageInfo(salarySobRangeListDTOS, SalarySobRangeListDTO.class); pageInfo.setTotal(salarySobRangeListDTOS.size()); pageInfo.setList(SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), salarySobRangeListDTOS)); pageInfo.setPageNum(queryParam.getCurrent()); @@ -194,6 +202,46 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange // salarySobLoggerTemplate.write(loggerContext); } + @Override + public void saveExtRange(SalarySobRangeExtSaveParam saveParam) { + ValidUtil.doValidator(saveParam); + + // 查询薪资账套 + SalarySobPO salarySobPO = getSalarySobService(user).getById(saveParam.getSalarySobId()); + if (Objects.isNull(salarySobPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "参数错误,薪资账套不存在或者已被删除")); + } + // 查询已有的人员范围 + List salarySobRangePOS = getSalarySobExtRangeMapper().listSome(SalarySobExtRangePO.builder().salarySobId(saveParam.getSalarySobId()).build()); + // 处理一下本次的保存参数(如果原来添加过对应的人员(/部门/岗位),那么本次不需要新增,只需要更新) + List oldTargetIds = SalaryEntityUtil.properties(salarySobRangePOS, SalarySobExtRangePO::getTargetId, Collectors.toList()); + + List targetIds = saveParam.getTargetIds(); + Date date = new Date(); + if (CollectionUtils.isNotEmpty(targetIds)) { + targetIds.stream().filter(targetId -> !oldTargetIds.contains(targetId)).forEach(targetId -> { + SalarySobExtRangePO po = SalarySobExtRangePO.builder() + .id(IdGenerator.generate()) + .targetType(1) + .salarySobId(saveParam.getSalarySobId()) + .targetId(targetId) + .createTime(date) + .updateTime(date) + .creator((long) user.getUID()) + .deleteType(0) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + getSalarySobExtRangeMapper().insertIgnoreNull(po); + }); + } + } + + @Override + public PageInfo listPage4Ext(SalarySobRangeQueryParam param) { + List salarySobRangePOS = getSalarySobExtRangeMapper().listPage4Ext(SalarySobExtRangePO.builder().salarySobId(param.getSalarySobId()).build()); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), salarySobRangePOS, SalarySobExtRangePO.class); + } + @Override public void deleteByIds(Collection ids) { // 查询薪资账套的人员范围 @@ -205,13 +253,13 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange // 删除薪资账套的人员范围 salarySobRangeBiz.deleteByIds(ids); // 查询薪资账套 - Set salarySobIds = SalaryEntityUtil.properties(salarySobRangePOS, SalarySobRangePO::getSalarySobId); - List salarySobPOS = getSalarySobService(user).listByIds(salarySobIds); - // 是"关联人员范围"还是"从范围中排除" - Integer includeType = salarySobRangePOS.get(0).getIncludeType(); - // todo 记录日志 - String operateTypeName = Objects.equals(includeType, NumberUtils.INTEGER_ONE) ? - SalaryI18nUtil.getI18nLabel(98605, "关联人员范围删除对象") : SalaryI18nUtil.getI18nLabel(98606, "从范围中排除删除对象"); +// Set salarySobIds = SalaryEntityUtil.properties(salarySobRangePOS, SalarySobRangePO::getSalarySobId); +// List salarySobPOS = getSalarySobService(user).listByIds(salarySobIds); +// // 是"关联人员范围"还是"从范围中排除" +// Integer includeType = salarySobRangePOS.get(0).getIncludeType(); +// // todo 记录日志 +// String operateTypeName = Objects.equals(includeType, NumberUtils.INTEGER_ONE) ? +// SalaryI18nUtil.getI18nLabel(98605, "关联人员范围删除对象") : SalaryI18nUtil.getI18nLabel(98606, "从范围中排除删除对象"); // salarySobPOS.forEach(salarySobPO -> { // LoggerContext loggerContext = new LoggerContext<>(); // loggerContext.setTargetId("" + salarySobPO.getId()); @@ -222,6 +270,14 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange // }); } + @Override + public void deleteSalarySobExtRange(Collection ids) { + if(CollectionUtils.isEmpty(ids)){ + return; + } + getSalarySobExtRangeMapper().deleteByIds(ids); + } + @Override public void deleteBySalarySobIds(Collection salarySobIds) { salarySobRangeBiz.deleteBySalarySobIds(salarySobIds); @@ -241,10 +297,10 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; // 注释 List excelComments = Lists.newArrayList(); - if(confValue.equals("1")){ + if (confValue.equals("1")) { // 人员校验规则为工号 excelComments.add(new ExcelComment(3, 0, 4, 2, SalaryI18nUtil.getI18nLabel(100344, "必填"))); - }else { + } else { excelComments.add(new ExcelComment(0, 0, 1, 2, SalaryI18nUtil.getI18nLabel(100344, "必填"))); } excelComments.add(new ExcelComment(4, 0, 6, 3, SalaryI18nUtil.getI18nLabel(100344, "若不填,默认全部员工状态。指定员工状态格式:试用、正式、临时、试用延期"))); @@ -363,19 +419,19 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange } // 设置员工状态 - if(StringUtils.isEmpty(employeeStatusStr)){ + if (StringUtils.isEmpty(employeeStatusStr)) { SalaryEmployeeStatusEnum[] values = SalaryEmployeeStatusEnum.values(); po.setEmployeeStatus(SalaryEmployeeStatusEnum.values()); - }else{ + } else { Boolean[] haveError = {false}; // 人员状态字符串转换为对应的value SalaryEmployeeStatusEnum[] status = SalaryEmployeeStatusEnum.getEnumsParseByFormatStr(employeeStatusStr, haveError); - if(haveError[0]){ + if (haveError[0]) { Map errorMessageMap = new HashMap<>(); errorMessageMap.put("message", rowIndex + "员工状态不存在,或格式有误。格式为:试用、正式、临时、试用延期"); errorData.add(errorMessageMap); errorSum += 1; - }else{ + } else { po.setEmployeeStatus(status); } } @@ -426,7 +482,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange } // 多条相同人的则以第一条为准,如果逆序排列(用于重复的则以最后一条为准)Collections.reverse(pos); // 去重(通过记录的唯一条件(人员id) - List finalPos = pos.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTargetId() ))), ArrayList::new)); + List finalPos = pos.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTargetId()))), ArrayList::new)); return finalPos; } @@ -453,7 +509,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange InputStream fileInputStream = null; try { fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); - List salarySobRangeImportList = ExcelParseHelper.parse2Map(fileInputStream, SalarySobRangeImportListDTO.class, 0, 1, 5, "TaxAgentEmployee.xlsx"); + List salarySobRangeImportList = ExcelParseHelper.parse2Map(fileInputStream, SalarySobRangeImportListDTO.class, 0, 1, 5, "TaxAgentEmployee.xlsx"); apidatas.put("preview", salarySobRangeImportList); } finally { IOUtils.closeQuietly(fileInputStream); @@ -463,16 +519,16 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange /** + * @return List> * @description 获取excel数据行 - * @return List> * @author Harryxzy * @date 2023/1/9 11:37 */ private List> getExcelRowList() { // 表头 List headers = Lists.newArrayList(); - headers.add(SalaryI18nUtil.getI18nLabel( 85429, "姓名")); - headers.add(SalaryI18nUtil.getI18nLabel( 86185, "部门")); + headers.add(SalaryI18nUtil.getI18nLabel(85429, "姓名")); + headers.add(SalaryI18nUtil.getI18nLabel(86185, "部门")); headers.add(SalaryI18nUtil.getI18nLabel(86186, "手机号")); headers.add(SalaryI18nUtil.getI18nLabel(86317, "工号")); headers.add(SalaryI18nUtil.getI18nLabel(86318, "员工状态")); diff --git a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java index 278570013..8db5bb8de 100644 --- a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java @@ -4,6 +4,7 @@ import com.api.formmode.mybatis.util.SqlProxyHandle; import com.cloudstore.dev.api.util.Util_DataCache; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.hrm.DeptInfo; import com.engine.salary.entity.hrm.HrmStatus; @@ -13,6 +14,7 @@ import com.engine.salary.entity.taxagent.bo.TaxAgentBO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeListDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeListDTO; import com.engine.salary.entity.taxagent.param.*; +import com.engine.salary.entity.taxagent.po.TaxAgentExtRangePO; import com.engine.salary.entity.taxagent.po.TaxAgentManageRangePO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; @@ -35,6 +37,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.weaver.util.threadPool.ThreadPoolUtil; import com.weaver.util.threadPool.entity.LocalRunnable; +import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -388,6 +391,25 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(108605, "参数错误,无此外部人员")); } + Date now = new Date(); + List oldPO = listExtByIds(targetIds); + List oldIds = SalaryEntityUtil.properties(oldPO, TaxAgentExtRangePO::getTargetId, Collectors.toList()); + targetIds.stream().filter(targetId -> !oldIds.contains(targetId)).forEach(targetId -> { + TaxAgentExtRangePO po = TaxAgentExtRangePO.builder() + .id(IdGenerator.generate()) + .taxAgentId(taxAgentId) + .targetId(targetId) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .deleteType(0) + .targetType(1) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + + getTaxAgentExtRangeMapper().insertIgnoreNull(po); + }); + /* 同步本地人员范围的关联人员=========================== */ if (saveParam.isSync()) { @@ -400,6 +422,26 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM } } + private List listExtByIds(Collection targetIds) { + List oldPO = getTaxAgentExtRangeMapper().listSome(TaxAgentExtRangePO.builder().ids(targetIds).build()); + return oldPO; + } + + @Override + public void deleteExtRange(Collection ids) { + // 查询管理范围 + List taxAgentManageRanges = listExtByIds(ids); + if (CollectionUtils.isEmpty(taxAgentManageRanges)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98604, "数据不存在或已被删除")); + } + List taxAgentIds = taxAgentManageRanges.stream().map(TaxAgentExtRangePO::getTaxAgentId).distinct().collect(Collectors.toList()); + if (taxAgentIds.size() > 1) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(110159, "一次只能删一个个税个税扣缴义务人的范围")); + } + // 删除管理范围 + getTaxAgentExtRangeMapper().deleteByIds(ids); + } + private void syncLocalExtEmp(Long taxAgentId, List allSalaryEmployees) { List taxAgentEmpSaveParamList = Collections.singletonList(getTaxAgentEmpSyncParam(taxAgentId, allSalaryEmployees)); diff --git a/src/com/engine/salary/web/SalarySobController.java b/src/com/engine/salary/web/SalarySobController.java index ad3bd6423..bb50f41af 100644 --- a/src/com/engine/salary/web/SalarySobController.java +++ b/src/com/engine/salary/web/SalarySobController.java @@ -1,6 +1,7 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.SalarySobExtRangePO; import com.engine.salary.entity.salaryitem.dto.SalaryItemListDTO; import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam; import com.engine.salary.entity.salarysob.dto.*; @@ -193,6 +194,22 @@ public class SalarySobController { return new ResponseResult(user).run(getSalarySobRangeWrapper(user)::save, saveParam); } + @POST + @Path("/ext/save") + @Produces(MediaType.APPLICATION_JSON) + public String saveSalarySobExtRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobRangeExtSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalarySobRangeWrapper(user)::saveExtRange, saveParam); + } + + @POST + @Path("/range/ext/list") + @Produces(MediaType.APPLICATION_JSON) + public String listPage4Ext(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobRangeQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalarySobRangeWrapper(user)::listPage4Ext, queryParam); + } + /** * 删除薪资账套人员范围 */ @@ -204,6 +221,17 @@ public class SalarySobController { return new ResponseResult, String>(user).run(getSalarySobRangeWrapper(user)::delete, ids); } + /** + * 删除薪资账套人员范围 + */ + @POST + @Path("/range/ext/delete") + @Produces(MediaType.APPLICATION_JSON) + public String deleteSalarySobExtRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection ids) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult, String>(user).run(getSalarySobRangeWrapper(user)::deleteSalarySobExtRange, ids); + } + /*** * @description 下载薪资账套人员范围导入模板 * @return Response diff --git a/src/com/engine/salary/web/TaxAgentController.java b/src/com/engine/salary/web/TaxAgentController.java index 161426750..a175685f9 100644 --- a/src/com/engine/salary/web/TaxAgentController.java +++ b/src/com/engine/salary/web/TaxAgentController.java @@ -270,6 +270,15 @@ public class TaxAgentController { return new ResponseResult, String>(user).run(getTaxAgentWrapper(user)::deleteRange, ids); } + //删除外部人员范围 + @POST + @Path("/range/ext/delete") + @Produces(MediaType.APPLICATION_JSON) + public String deleteExtRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection ids) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult, String>(user).run(getTaxAgentWrapper(user)::deleteExtRange, ids); + } + /** * 下载人员范围导入模板 * diff --git a/src/com/engine/salary/wrapper/SalarySobRangeWrapper.java b/src/com/engine/salary/wrapper/SalarySobRangeWrapper.java index dbc24da12..710d21b56 100644 --- a/src/com/engine/salary/wrapper/SalarySobRangeWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobRangeWrapper.java @@ -2,7 +2,9 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.entity.SalarySobExtRangePO; import com.engine.salary.entity.salarysob.dto.SalarySobRangeListDTO; +import com.engine.salary.entity.salarysob.param.SalarySobRangeExtSaveParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeImportParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeQueryParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeSaveParam; @@ -68,6 +70,19 @@ public class SalarySobRangeWrapper extends Service { getSalarySobRangeService(user).save(saveParam); } + /** + * 保存 + * + * @param saveParam 保存参数 + */ + public void saveExtRange(SalarySobRangeExtSaveParam saveParam) { + getSalarySobRangeService(user).saveExtRange(saveParam); + } + + public PageInfo listPage4Ext(SalarySobRangeQueryParam param) { + return getSalarySobRangeService(user).listPage4Ext(param); + } + /** * 删除 * @@ -77,6 +92,10 @@ public class SalarySobRangeWrapper extends Service { getSalarySobRangeService(user).deleteByIds(ids); } + public void deleteSalarySobExtRange(Collection ids) { + getSalarySobRangeService(user).deleteSalarySobExtRange(ids); + } + /*** * @description 下载薪资账套人员范围导入模板 * @return XSSFWorkbook diff --git a/src/com/engine/salary/wrapper/TaxAgentWrapper.java b/src/com/engine/salary/wrapper/TaxAgentWrapper.java index 9ca28c641..4040f4476 100644 --- a/src/com/engine/salary/wrapper/TaxAgentWrapper.java +++ b/src/com/engine/salary/wrapper/TaxAgentWrapper.java @@ -357,6 +357,11 @@ public class TaxAgentWrapper extends Service { return StringUtils.EMPTY; } + public void deleteExtRange(Collection ids) { + + getTaxAgentManageRangeService(user).deleteExtRange(ids); + } + /** * 删除管理范围 * @@ -450,4 +455,5 @@ public class TaxAgentWrapper extends Service { } + } From 5f465aa91478f4c18394875c9ccc17a5cc9aa124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 14 Mar 2023 15:22:50 +0800 Subject: [PATCH 15/86] =?UTF-8?q?=E5=A4=96=E9=83=A8=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E5=88=97=E8=A1=A8=E5=92=8C=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/TaxAgentRangeExtQueryParam.java | 29 ++++++++++++++ .../taxagent/po/TaxAgentExtRangePO.java | 6 +++ .../taxagent/TaxAgentExtRangeMapper.java | 4 +- .../taxagent/TaxAgentExtRangeMapper.xml | 29 ++++++++++++++ .../service/TaxAgentManageRangeService.java | 17 +++++--- .../impl/TaxAgentManageRangeServiceImpl.java | 10 +++++ .../engine/salary/web/TaxAgentController.java | 27 +++++++++---- .../salary/wrapper/TaxAgentWrapper.java | 40 +++++++++++-------- 8 files changed, 132 insertions(+), 30 deletions(-) create mode 100644 src/com/engine/salary/entity/taxagent/param/TaxAgentRangeExtQueryParam.java diff --git a/src/com/engine/salary/entity/taxagent/param/TaxAgentRangeExtQueryParam.java b/src/com/engine/salary/entity/taxagent/param/TaxAgentRangeExtQueryParam.java new file mode 100644 index 000000000..29ea1586c --- /dev/null +++ b/src/com/engine/salary/entity/taxagent/param/TaxAgentRangeExtQueryParam.java @@ -0,0 +1,29 @@ +package com.engine.salary.entity.taxagent.param; + +import com.engine.salary.common.BaseQueryParam; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 个税扣缴义务人人员范围查询参数 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//个税扣缴义务人人员范围查询参数 +public class TaxAgentRangeExtQueryParam extends BaseQueryParam { + + //个税扣缴义务人id + private Long taxAgentId; + + //对象") + private String targetName; +} diff --git a/src/com/engine/salary/entity/taxagent/po/TaxAgentExtRangePO.java b/src/com/engine/salary/entity/taxagent/po/TaxAgentExtRangePO.java index 7c2e483e2..b5d3a4ad4 100644 --- a/src/com/engine/salary/entity/taxagent/po/TaxAgentExtRangePO.java +++ b/src/com/engine/salary/entity/taxagent/po/TaxAgentExtRangePO.java @@ -58,4 +58,10 @@ public class TaxAgentExtRangePO { //主键id集合 private Collection ids; + /** + * 名字 + */ + private String targetName; + + } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.java b/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.java index 87a03f58a..b25c935c6 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.java +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.java @@ -21,7 +21,9 @@ public interface TaxAgentExtRangeMapper { * @return 返回集合,没有返回空List */ List listSome(TaxAgentExtRangePO taxAgentExtRange); - + + List list(TaxAgentExtRangePO taxAgentExtRange); + /** * 根据主键查询 diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.xml b/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.xml index c7e3e0e13..149d63984 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.xml +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.xml @@ -88,6 +88,35 @@ + + INSERT INTO hrsa_tax_agent_ext_range diff --git a/src/com/engine/salary/service/TaxAgentManageRangeService.java b/src/com/engine/salary/service/TaxAgentManageRangeService.java index c9eb1ed0a..00cc7eb76 100644 --- a/src/com/engine/salary/service/TaxAgentManageRangeService.java +++ b/src/com/engine/salary/service/TaxAgentManageRangeService.java @@ -2,6 +2,7 @@ package com.engine.salary.service; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeListDTO; import com.engine.salary.entity.taxagent.param.*; +import com.engine.salary.entity.taxagent.po.TaxAgentExtRangePO; import com.engine.salary.entity.taxagent.po.TaxAgentManageRangePO; import com.engine.salary.util.page.PageInfo; @@ -52,6 +53,16 @@ public interface TaxAgentManageRangeService { */ void save(TaxAgentRangeSaveParam saveParam); + + /** + * 根据主键id删除管理范围 + * + * @param ids + */ + void deleteByIds(Collection ids); + + PageInfo listExt(TaxAgentRangeExtQueryParam param); + /** * 保存外部人员范围 * @param saveParam @@ -60,12 +71,6 @@ public interface TaxAgentManageRangeService { void deleteExtRange(Collection ids); - /** - * 根据主键id删除管理范围 - * - * @param ids - */ - void deleteByIds(Collection ids); /** * 根据个税扣缴义务人的id删除管理范围 diff --git a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java index 8db5bb8de..8484e2f9e 100644 --- a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java @@ -527,6 +527,16 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM // 记录日志 todo } + @Override + public PageInfo listExt(TaxAgentRangeExtQueryParam param) { + if(param.getTaxAgentId() == null){ + throw new SalaryRunTimeException("扣缴义务人id为空"); + } + + List taxAgentExtRangePOS = getTaxAgentExtRangeMapper().list(TaxAgentExtRangePO.builder().taxAgentId(param.getTaxAgentId()).build()); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(),taxAgentExtRangePOS,TaxAgentExtRangePO.class); + } + @Override public void deleteByTaxAgentIds(Collection taxAgentIds) { getTaxAgentManageRangeMapper().deleteByTaxAgentIds(taxAgentIds); diff --git a/src/com/engine/salary/web/TaxAgentController.java b/src/com/engine/salary/web/TaxAgentController.java index a175685f9..aad5e89e3 100644 --- a/src/com/engine/salary/web/TaxAgentController.java +++ b/src/com/engine/salary/web/TaxAgentController.java @@ -7,6 +7,7 @@ import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeFormDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeListDTO; import com.engine.salary.entity.taxagent.param.*; import com.engine.salary.entity.taxagent.po.TaxAgentBasePO; +import com.engine.salary.entity.taxagent.po.TaxAgentExtRangePO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.util.ResponseResult; import com.engine.salary.util.page.PageInfo; @@ -253,13 +254,7 @@ public class TaxAgentController { return new ResponseResult(user).run(getTaxAgentWrapper(user)::saveRange, saveParam); } - @POST - @Path("/range/ext/save") - @Produces(MediaType.APPLICATION_JSON) - public String saveExtRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentManageRangeExtSaveParam saveParam) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getTaxAgentWrapper(user)::saveExtRange, saveParam); - } + //删除人员范围 @POST @@ -270,6 +265,24 @@ public class TaxAgentController { return new ResponseResult, String>(user).run(getTaxAgentWrapper(user)::deleteRange, ids); } + //外部人员 + @POST + @Path("/range/listExt") + @Produces(MediaType.APPLICATION_JSON) + public String listExt(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentRangeExtQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxAgentWrapper(user)::listExt, queryParam); + } + + + @POST + @Path("/range/ext/save") + @Produces(MediaType.APPLICATION_JSON) + public String saveExtRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxAgentManageRangeExtSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getTaxAgentWrapper(user)::saveExtRange, saveParam); + } + //删除外部人员范围 @POST @Path("/range/ext/delete") diff --git a/src/com/engine/salary/wrapper/TaxAgentWrapper.java b/src/com/engine/salary/wrapper/TaxAgentWrapper.java index 4040f4476..a7e695f54 100644 --- a/src/com/engine/salary/wrapper/TaxAgentWrapper.java +++ b/src/com/engine/salary/wrapper/TaxAgentWrapper.java @@ -10,6 +10,7 @@ import com.engine.salary.entity.taxagent.bo.TaxAgentBO; import com.engine.salary.entity.taxagent.dto.*; import com.engine.salary.entity.taxagent.param.*; import com.engine.salary.entity.taxagent.po.TaxAgentAdminPO; +import com.engine.salary.entity.taxagent.po.TaxAgentExtRangePO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salarysob.TargetTypeEnum; @@ -66,7 +67,6 @@ public class TaxAgentWrapper extends Service { } - // private PaymentAgencyService paymentAgencyService; // // private SIEmployeeStatusMapper siEmployeeStatusMapper; @@ -308,8 +308,7 @@ public class TaxAgentWrapper extends Service { * @return */ public PageInfo listRangeInclude(TaxAgentRangeQueryParam queryParam) { - PageInfo listPage = getTaxAgentManageRangeService(user).listPageByParamAndIncludeType(queryParam, NumberUtils.INTEGER_ONE); - return listPage; + return getTaxAgentManageRangeService(user).listPageByParamAndIncludeType(queryParam, NumberUtils.INTEGER_ONE); } /** @@ -319,8 +318,7 @@ public class TaxAgentWrapper extends Service { * @return */ public PageInfo listRangeExclude(TaxAgentRangeQueryParam queryParam) { - PageInfo listPage = getTaxAgentManageRangeService(user).listPageByParamAndIncludeType(queryParam, NumberUtils.INTEGER_ZERO); - return listPage; + return getTaxAgentManageRangeService(user).listPageByParamAndIncludeType(queryParam, NumberUtils.INTEGER_ZERO); } /** @@ -347,8 +345,26 @@ public class TaxAgentWrapper extends Service { return StringUtils.EMPTY; } + + /** + * 删除管理范围 + * + * @param ids + * @return + */ + public String deleteRange(Collection ids) { + getTaxAgentManageRangeService(user).deleteByIds(ids); + return StringUtils.EMPTY; + } + + + public PageInfo listExt(TaxAgentRangeExtQueryParam param) { + return getTaxAgentManageRangeService(user).listExt(param); + } + /** * 外部人员范围 + * * @param saveParam * @return */ @@ -362,16 +378,6 @@ public class TaxAgentWrapper extends Service { getTaxAgentManageRangeService(user).deleteExtRange(ids); } - /** - * 删除管理范围 - * - * @param ids - * @return - */ - public String deleteRange(Collection ids) { - getTaxAgentManageRangeService(user).deleteByIds(ids); - return StringUtils.EMPTY; - } /** * 获取个税管理的人员情况 @@ -431,6 +437,7 @@ public class TaxAgentWrapper extends Service { /** * 下载人员范围导入模板 + * * @param downloadTemplateParam * @return */ @@ -440,6 +447,7 @@ public class TaxAgentWrapper extends Service { /** * 预览人员范围 + * * @param taxAgentImportParam */ public Map preview(TaxAgentImportParam taxAgentImportParam) { @@ -448,6 +456,7 @@ public class TaxAgentWrapper extends Service { /** * 个税扣缴义务人-人员范围导入 + * * @param taxAgentImportParam */ public Map importData(TaxAgentImportParam taxAgentImportParam) { @@ -455,5 +464,4 @@ public class TaxAgentWrapper extends Service { } - } From 5b88cda35c09b4e333877d48eabb87b1dea2fa1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 15 Mar 2023 09:13:29 +0800 Subject: [PATCH 16/86] =?UTF-8?q?=E8=B4=A6=E5=A5=97=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=8E=A5=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taxagent/po/TaxAgentExtRangePO.java | 2 ++ .../salarysob/SalarySobExtRangeMapper.xml | 3 +- .../taxagent/TaxAgentExtRangeMapper.xml | 14 ++++---- .../impl/TaxAgentManageRangeServiceImpl.java | 15 ++++++-- .../salary/web/SalarySobController.java | 34 ++++++++++--------- .../salary/wrapper/SalarySobRangeWrapper.java | 6 ++-- 6 files changed, 44 insertions(+), 30 deletions(-) diff --git a/src/com/engine/salary/entity/taxagent/po/TaxAgentExtRangePO.java b/src/com/engine/salary/entity/taxagent/po/TaxAgentExtRangePO.java index b5d3a4ad4..071380108 100644 --- a/src/com/engine/salary/entity/taxagent/po/TaxAgentExtRangePO.java +++ b/src/com/engine/salary/entity/taxagent/po/TaxAgentExtRangePO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.taxagent.po; +import com.engine.salary.annotation.TableTitle; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -61,6 +62,7 @@ public class TaxAgentExtRangePO { /** * 名字 */ + @TableTitle(title = "姓名",key = "targetName",dataIndex = "targetName") private String targetName; diff --git a/src/com/engine/salary/mapper/salarysob/SalarySobExtRangeMapper.xml b/src/com/engine/salary/mapper/salarysob/SalarySobExtRangeMapper.xml index 2265cfab2..066bf3d61 100644 --- a/src/com/engine/salary/mapper/salarysob/SalarySobExtRangeMapper.xml +++ b/src/com/engine/salary/mapper/salarysob/SalarySobExtRangeMapper.xml @@ -240,10 +240,11 @@ UPDATE hrsa_salary_sob_ext_range SET delete_type=1 - WHERE id IN and delete_type=0 + WHERE id IN #{id} + and delete_type=0 \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.xml b/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.xml index 149d63984..9483e76a0 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.xml +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentExtRangeMapper.xml @@ -95,26 +95,26 @@ ,e.username as targetName FROM hrsa_tax_agent_ext_range t left join hrsa_external_employee e on t.target_id = e.id - WHERE delete_type = 0 + WHERE t.delete_type = 0 - AND id = #{id} + AND t.id = #{id} - AND target_id = #{targetId} + AND t.target_id = #{targetId} - AND target_type = #{targetType} + AND t.target_type = #{targetType} - AND tax_agent_id = #{taxAgentId} + AND t.tax_agent_id = #{taxAgentId} - AND id IN + AND t.id IN #{id} - ORDER BY id DESC + ORDER BY t.id DESC diff --git a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java index 8484e2f9e..8417f11d1 100644 --- a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java @@ -392,7 +392,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM } Date now = new Date(); - List oldPO = listExtByIds(targetIds); + List oldPO = listAllExtBytaxAgentId(taxAgentId); List oldIds = SalaryEntityUtil.properties(oldPO, TaxAgentExtRangePO::getTargetId, Collectors.toList()); targetIds.stream().filter(targetId -> !oldIds.contains(targetId)).forEach(targetId -> { TaxAgentExtRangePO po = TaxAgentExtRangePO.builder() @@ -422,9 +422,18 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM } } + private List listAllExtBytaxAgentId(Long taxAgentId) { + if(taxAgentId ==null){ + return new ArrayList<>(); + } + return getTaxAgentExtRangeMapper().listSome(TaxAgentExtRangePO.builder().taxAgentId(taxAgentId).build()); + } + private List listExtByIds(Collection targetIds) { - List oldPO = getTaxAgentExtRangeMapper().listSome(TaxAgentExtRangePO.builder().ids(targetIds).build()); - return oldPO; + if(CollectionUtils.isEmpty(targetIds)){ + return new ArrayList<>(); + } + return getTaxAgentExtRangeMapper().listSome(TaxAgentExtRangePO.builder().ids(targetIds).build()); } @Override diff --git a/src/com/engine/salary/web/SalarySobController.java b/src/com/engine/salary/web/SalarySobController.java index bb50f41af..430181e92 100644 --- a/src/com/engine/salary/web/SalarySobController.java +++ b/src/com/engine/salary/web/SalarySobController.java @@ -194,22 +194,6 @@ public class SalarySobController { return new ResponseResult(user).run(getSalarySobRangeWrapper(user)::save, saveParam); } - @POST - @Path("/ext/save") - @Produces(MediaType.APPLICATION_JSON) - public String saveSalarySobExtRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobRangeExtSaveParam saveParam) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getSalarySobRangeWrapper(user)::saveExtRange, saveParam); - } - - @POST - @Path("/range/ext/list") - @Produces(MediaType.APPLICATION_JSON) - public String listPage4Ext(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobRangeQueryParam queryParam) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>(user).run(getSalarySobRangeWrapper(user)::listPage4Ext, queryParam); - } - /** * 删除薪资账套人员范围 */ @@ -221,6 +205,24 @@ public class SalarySobController { return new ResponseResult, String>(user).run(getSalarySobRangeWrapper(user)::delete, ids); } + @POST + @Path("/range/ext/list") + @Produces(MediaType.APPLICATION_JSON) + public String listPage4Ext(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobRangeQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalarySobRangeWrapper(user)::listPage4Ext, queryParam); + } + + + @POST + @Path("/ext/save") + @Produces(MediaType.APPLICATION_JSON) + public String saveSalarySobExtRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobRangeExtSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalarySobRangeWrapper(user)::saveExtRange, saveParam); + } + + /** * 删除薪资账套人员范围 */ diff --git a/src/com/engine/salary/wrapper/SalarySobRangeWrapper.java b/src/com/engine/salary/wrapper/SalarySobRangeWrapper.java index 710d21b56..c5484135a 100644 --- a/src/com/engine/salary/wrapper/SalarySobRangeWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobRangeWrapper.java @@ -79,7 +79,7 @@ public class SalarySobRangeWrapper extends Service { getSalarySobRangeService(user).saveExtRange(saveParam); } - public PageInfo listPage4Ext(SalarySobRangeQueryParam param) { + public PageInfo listPage4Ext(SalarySobRangeQueryParam param) { return getSalarySobRangeService(user).listPage4Ext(param); } @@ -107,8 +107,8 @@ public class SalarySobRangeWrapper extends Service { } /** - * @description 薪资账套人员范围导入预览 * @return void + * @description 薪资账套人员范围导入预览 * @author Harryxzy * @date 2023/1/9 13:37 */ @@ -117,8 +117,8 @@ public class SalarySobRangeWrapper extends Service { } /** + * @return Map * @description 导入薪资账套人员范围 - * @return Map * @author Harryxzy * @date 2023/1/9 14:10 */ From 6bb6e350a8f45e8ba22f4e7774f85d6aabe3cfac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 15 Mar 2023 10:43:05 +0800 Subject: [PATCH 17/86] =?UTF-8?q?=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIAccountBiz.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index d5c003157..9fcb770fb 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -128,10 +128,6 @@ public class SIAccountBiz extends Service { return MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class); } - private EmployMapper getEmployMapper() { - return MapperProxyFactory.getProxy(EmployMapper.class); - } - private ICategoryMapper getICategoryMapper() { return MapperProxyFactory.getProxy(ICategoryMapper.class); } From 1f9597195f8afa3240b82c70271e388313b26b10 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Wed, 15 Mar 2023 15:49:20 +0800 Subject: [PATCH 18/86] =?UTF-8?q?=E5=A4=96=E9=83=A8=E4=BA=BA=E5=91=98-?= =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E6=89=A3=E7=BC=B4=E4=B9=89=E5=8A=A1=E4=BA=BA?= =?UTF-8?q?service=E8=8E=B7=E5=8F=96=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=94=B9=E5=8F=98=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/TaxAgentServiceImpl.java | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java index 2e9bc4c03..e6319ddc2 100644 --- a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java @@ -7,6 +7,7 @@ import com.engine.core.impl.Service; import com.engine.salary.constant.SalaryAuthConstant; import com.engine.salary.entity.datacollection.AddUpDeduction; import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.datacollection.po.OtherDeductionPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; @@ -111,6 +112,9 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { return MapperProxyFactory.getProxy(TaxAgentMapper.class); } + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } // private PaymentAgencyMapper paymentAgencyMapper; @@ -129,7 +133,18 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { @Override public List listEmployees() { - return getTaxAgentMapper().listEmployee(); + List employees = getSalaryEmployeeService(user).listEmployee(); + return convert2TaxAgentEmployeePO(employees); + } + + public List convert2TaxAgentEmployeePO(List dataCollectionEmployees){ + List result = new ArrayList<>(); + dataCollectionEmployees.stream().forEach(PO -> { + TaxAgentEmployeePO taxAgentEmployeePO = new TaxAgentEmployeePO(); + BeanUtils.copyProperties(PO, taxAgentEmployeePO); + result.add(taxAgentEmployeePO); + }); + return result; } @Override @@ -586,7 +601,8 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { } List taxAgentIds = allTaxAgents.stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - List allEmployees = getTaxAgentMapper().listEmployee(); + List employees = getSalaryEmployeeService(user).listEmployee(); + List allEmployees =convert2TaxAgentEmployeePO(employees); if (employeeStatus != null) { List personnelStatusList; // 查询人员状态 @@ -631,7 +647,8 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { return taxAgentManageRangeEmployeeList; } List taxAgentIds = allTaxAgents.stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - List allEmployees = getTaxAgentMapper().listEmployee(); + List employees = getSalaryEmployeeService(user).listEmployee(); + List allEmployees = convert2TaxAgentEmployeePO(employees); taxAgentManageRangeEmployeeList.addAll(getTaxAgentEmp(allTaxAgents, taxAgentIds, allEmployees)); return taxAgentManageRangeEmployeeList; } @@ -646,7 +663,8 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { } List taxAgentIds = allTaxAgents.stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - List allEmployees = getTaxAgentMapper().listEmployee(); + List employees = getSalaryEmployeeService(user).listEmployee(); + List allEmployees = convert2TaxAgentEmployeePO(employees); // 1.判断自己是否是管理员, 如果是管理员,就是能够操作所属个税扣缴义务人下的所有人的数据 List taxAgentAdminList = getTaxAgentAdminService(user).listByTaxAgentIdsAndEmployeeId(taxAgentIds, (long) user.getUID()); From ace15ca7a15bb043bc7322cee2af72ab125202b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 15 Mar 2023 18:03:46 +0800 Subject: [PATCH 19/86] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataCollectionEmployee.java | 3 + .../salaryacct/bo/SalaryAcctEmployeeBO.java | 39 ++++++ .../salaryacct/po/SalaryAcctEmployeePO.java | 8 ++ .../bo/SalaryArchiveExcelBO.java | 48 +++---- .../param/SalaryArchiveImportHandleParam.java | 14 +- .../SalaryArchiveListTypeEnum.java | 3 +- .../mapper/archive/SalaryArchiveMapper.xml | 12 +- .../mapper/taxagent/TaxAgentEmpMapper.xml | 3 + .../salary/service/SalaryEmployeeService.java | 2 + .../service/SalarySobExtRangeService.java | 54 ++++++++ .../salary/service/SalarySobRangeService.java | 17 --- .../service/impl/ExtEmpServiceImpl.java | 2 + .../impl/SalaryAcctEmployeeServiceImpl.java | 2 +- .../impl/SalaryArchiveExcelServiceImpl.java | 10 +- .../impl/SalaryArchiveServiceImpl.java | 1 - .../impl/SalaryEmployeeServiceImpl.java | 79 +++++++---- .../impl/SalarySobExtRangeServiceImpl.java | 131 ++++++++++++++++++ .../impl/SalarySobRangeServiceImpl.java | 52 ------- .../service/impl/TaxAgentEmpServiceImpl.java | 9 +- .../salary/web/SalaryArchiveController.java | 2 +- .../salary/wrapper/SalaryArchiveWrapper.java | 13 ++ .../salary/wrapper/SalarySobRangeWrapper.java | 12 +- 22 files changed, 371 insertions(+), 145 deletions(-) create mode 100644 src/com/engine/salary/service/SalarySobExtRangeService.java create mode 100644 src/com/engine/salary/service/impl/SalarySobExtRangeServiceImpl.java diff --git a/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java b/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java index 4be37e92f..d9d021fa5 100644 --- a/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java +++ b/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java @@ -99,5 +99,8 @@ public class DataCollectionEmployee { //是否是系统管理员 private Boolean isAdmin; + //是否外部人员 + private boolean extEmp; + } diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java index 6ce040fed..39499174c 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java @@ -120,6 +120,45 @@ public class SalaryAcctEmployeeBO { return resultList; } + public static List convert2Employee(Collection employee, + SalaryAcctRecordPO salaryAcctRecord, + List salaryArchiveTaxAgentData, + Long employeeId) { + if (CollectionUtils.isEmpty(employee)) { + return Collections.emptyList(); + } + List resultList = Lists.newArrayList(); + Map>> empIdKeyTaxAgentMap = SalaryEntityUtil.group2Map(salaryArchiveTaxAgentData, SalaryArchiveDataDTO::getEmployeeId, SalaryArchiveDataDTO::getTaxAgents); + Date now = new Date(); + for (DataCollectionEmployee emp : employee) { + Set taxAgentIds = Sets.newHashSet(); + Set> taxAgentSet = empIdKeyTaxAgentMap.getOrDefault(emp.getEmployeeId(), Collections.emptySet()); + for (List taxAgents : taxAgentSet) { + taxAgentIds.addAll(SalaryEntityUtil.properties(taxAgents, SalaryArchiveTaxAgentDataDTO::getTaxAgentId)); + } + if (CollectionUtils.isEmpty(taxAgentIds)) { + taxAgentIds.add(0L); + } + for (Long taxAgentId : taxAgentIds) { + SalaryAcctEmployeePO salaryAcctEmployee = SalaryAcctEmployeePO.builder() + .salaryAcctRecordId(salaryAcctRecord.getId()) + .salarySobId(salaryAcctRecord.getSalarySobId()) + .salaryMonth(salaryAcctRecord.getSalaryMonth()) + .employeeId(emp.getEmployeeId()) + .employeeType(emp.isExtEmp() ? 1 : 0) + .taxAgentId(taxAgentId) + .creator(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(0) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + resultList.add(salaryAcctEmployee); + } + } + return resultList; + } + public static List> partitionByEmployeeId(List salaryAcctEmployees) { if (CollectionUtils.isEmpty(salaryAcctEmployees)) { diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java index fdea4f715..f9c1d68e6 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.salaryacct.po; import com.engine.salary.annotation.SalaryFormulaVar; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -49,6 +50,13 @@ public class SalaryAcctEmployeePO { @SalaryFormulaVar(defaultLabel = "人员id", labelId = 86321, dataType = "number") private Long employeeId; + /** + * 人员类型,0或null组织架构,1非系统人员 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + /** * 个税扣缴义务人id */ diff --git a/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveExcelBO.java b/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveExcelBO.java index 7674039d9..1ac1bc242 100644 --- a/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveExcelBO.java +++ b/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveExcelBO.java @@ -1,6 +1,5 @@ package com.engine.salary.entity.salaryarchive.bo; -import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.constant.SalaryArchiveConstant; import com.engine.salary.constant.SalaryDefaultTenantConstant; @@ -18,10 +17,6 @@ import com.engine.salary.entity.taxagent.param.TaxAgentRangeSaveParam; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salaryarchive.*; import com.engine.salary.enums.salarysob.TargetTypeEnum; -import com.engine.salary.service.SalaryEmployeeService; -import com.engine.salary.service.TaxAgentManageRangeService; -import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; -import com.engine.salary.service.impl.TaxAgentManageRangeServiceImpl; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.excel.ExcelComment; @@ -46,15 +41,6 @@ import java.util.stream.Collectors; */ public class SalaryArchiveExcelBO extends Service { - - private SalaryEmployeeService getSalaryEmployeeService() { - return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); - } - - public TaxAgentManageRangeService getTaxAgentManageRangeService() { - return ServiceUtil.getService(TaxAgentManageRangeServiceImpl.class, user); - } - public static String userNameI18n; public static String departmentI18n; public static String jobNumI18n; @@ -360,20 +346,28 @@ public class SalaryArchiveExcelBO extends Service { String userName = Optional.ofNullable(map.get(userNameI18n)).orElse("").toString(); String deparmentName = Optional.ofNullable(map.get(departmentI18n)).orElse("").toString(); String mobileName = Optional.ofNullable(map.get("手机号")).orElse("").toString(); - String jobNum = Optional.ofNullable(map.get(jobNumI18n)).orElse("").toString(); - String hrmStatus = Optional.ofNullable(map.get(hrStatusI18n)).orElse("").toString(); -// Optional optionalStatus = importHandleParam.getHrmStatusList().stream().filter(s -> s.getName().equals(hrmStatus)).findFirst(); -// String codeId = optionalStatus.map(status -> status.getCodeId() + "").orElse(""); + String workcode = Optional.ofNullable(map.get("工号")).orElse("").toString(); - List emps = importHandleParam.getEmployees().stream().filter(e -> - (StringUtils.isBlank(userName) || Objects.equals(e.getUsername(), userName)) - && (StringUtils.isBlank(deparmentName) || Objects.equals(e.getDepartmentName(), deparmentName)) - && (StringUtils.isBlank(mobileName) || Objects.equals(e.getMobile(), mobileName)) -// && (StringUtils.isBlank(jobNum) || Objects.equals(e.getWorkcode(), jobNum)) - ) -// && (StringUtils.isBlank(hrmStatus) || Objects.equals(e.getPersonnelStatus(), codeId)) -// .map(DataCollectionEmployee::getEmployeeId) - .collect(Collectors.toList()); + String validType = importHandleParam.getEmpValidType(); + List emps = new ArrayList<>(); + //外部人员 + if(importHandleParam.isExtEmp()){ + emps = importHandleParam.getEmployees().stream().filter(e -> + (StringUtils.isBlank(userName) || Objects.equals(e.getUsername(), userName)) + && (StringUtils.isBlank(deparmentName) || Objects.equals(e.getDepartmentName(), deparmentName)) + && (StringUtils.isBlank(mobileName) || Objects.equals(e.getMobile(), mobileName))).collect(Collectors.toList()); + }else { + if ("0".equals(validType)) { + //“0”代表姓名+部门+手机号的匹配原则,“1”代表工号为唯一匹配原则 + emps = importHandleParam.getEmployees().stream().filter(e -> + (StringUtils.isBlank(userName) || Objects.equals(e.getUsername(), userName)) + && (StringUtils.isBlank(deparmentName) || Objects.equals(e.getDepartmentName(), deparmentName)) + && (StringUtils.isBlank(mobileName) || Objects.equals(e.getMobile(), mobileName))).collect(Collectors.toList()); + } else if ("1".equals(validType)) { + emps = importHandleParam.getEmployees().stream().filter(e -> (StringUtils.isBlank(workcode) || Objects.equals(e.getWorkcode(), workcode))) + .collect(Collectors.toList()); + } + } List employeeSameIds = new ArrayList<>(); if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { diff --git a/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveImportHandleParam.java b/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveImportHandleParam.java index cf5173288..17b552ca6 100644 --- a/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveImportHandleParam.java +++ b/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveImportHandleParam.java @@ -62,6 +62,11 @@ public class SalaryArchiveImportHandleParam { */ boolean isProcess; + /** + * 是否是外部人员 + */ + boolean isExtEmp; + /** * 说明 */ @@ -72,6 +77,11 @@ public class SalaryArchiveImportHandleParam { Long currentEmployeeId; String tenantKey; + /** + * 人员验证方式 + */ + String empValidType; + // 待定薪列表 boolean isPendingList; // 定薪列表 @@ -86,10 +96,6 @@ public class SalaryArchiveImportHandleParam { */ List employees; - /** - * 租户下的人员状态 - */ -// List hrmStatusList; /** * 获取所有个税扣缴义务人 diff --git a/src/com/engine/salary/enums/salaryarchive/SalaryArchiveListTypeEnum.java b/src/com/engine/salary/enums/salaryarchive/SalaryArchiveListTypeEnum.java index 2b04a2336..014bb4052 100644 --- a/src/com/engine/salary/enums/salaryarchive/SalaryArchiveListTypeEnum.java +++ b/src/com/engine/salary/enums/salaryarchive/SalaryArchiveListTypeEnum.java @@ -15,7 +15,8 @@ public enum SalaryArchiveListTypeEnum { PENDING("PENDING", "待定薪", 107875), FIXED("FIXED", "发薪", 109713), SUSPEND("SUSPEND", "待停薪", 107879), - STOP("STOP", "停薪", 109348); + STOP("STOP", "停薪", 109348), + EXT("EXT", "非系统人员", 109348); private String value; diff --git a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml index 1257dfe61..7fe3768fd 100644 --- a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml +++ b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml @@ -408,12 +408,12 @@ - - AND t.run_status IN - - #{runStatus} - - + + + + + + diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentEmpMapper.xml b/src/com/engine/salary/mapper/taxagent/TaxAgentEmpMapper.xml index bae6797bf..d418e242d 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentEmpMapper.xml +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentEmpMapper.xml @@ -82,6 +82,9 @@ AND employee_type = #{employeeType} + + AND (employee_type is null or employee_type = 0) + AND tax_agent_id IN diff --git a/src/com/engine/salary/service/SalaryEmployeeService.java b/src/com/engine/salary/service/SalaryEmployeeService.java index 7cb496957..eb7d56277 100644 --- a/src/com/engine/salary/service/SalaryEmployeeService.java +++ b/src/com/engine/salary/service/SalaryEmployeeService.java @@ -78,6 +78,8 @@ public interface SalaryEmployeeService { */ List matchImportEmployee(List employeeList, String userName, String deparmentName, String mobile, String workcode, Long uid); + String empValidType(); + List getDeptInfoList(List departmentIds); List getSubCompanyInfoList(List subDepartmentIds); diff --git a/src/com/engine/salary/service/SalarySobExtRangeService.java b/src/com/engine/salary/service/SalarySobExtRangeService.java new file mode 100644 index 000000000..0fd6d5bb1 --- /dev/null +++ b/src/com/engine/salary/service/SalarySobExtRangeService.java @@ -0,0 +1,54 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.SalarySobExtRangePO; +import com.engine.salary.entity.salarysob.param.SalarySobRangeExtSaveParam; +import com.engine.salary.entity.salarysob.param.SalarySobRangeQueryParam; +import com.engine.salary.util.page.PageInfo; + +import java.util.Collection; +import java.util.List; + +/** + * 薪资账套人员范围 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public interface SalarySobExtRangeService { + + /** + * 根据主键id查询薪资账套的人员范围 + * + * @param ids 薪资账套的人员范围的主键id + * @return + */ + List listByIds(Collection ids); + + /** + * 根据薪资账套ID和类型查询薪资账套的人员范围 + * + * @param salarySobId 薪资账套id + * @return + */ + List listBySalarySobId(Long salarySobId); + + + /** + * 保存外部人员 + * @param saveParam + */ + void saveExtRange(SalarySobRangeExtSaveParam saveParam); + + /** + * 外部人员列表 + * @param param + * @return + */ + PageInfo listPage4Ext(SalarySobRangeQueryParam param); + + + void deleteSalarySobExtRange(Collection ids); + +} diff --git a/src/com/engine/salary/service/SalarySobRangeService.java b/src/com/engine/salary/service/SalarySobRangeService.java index 91e2c3430..3bfb8172a 100644 --- a/src/com/engine/salary/service/SalarySobRangeService.java +++ b/src/com/engine/salary/service/SalarySobRangeService.java @@ -1,8 +1,6 @@ package com.engine.salary.service; -import com.engine.salary.entity.SalarySobExtRangePO; import com.engine.salary.entity.salarysob.dto.SalarySobRangeListDTO; -import com.engine.salary.entity.salarysob.param.SalarySobRangeExtSaveParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeImportParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeQueryParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeSaveParam; @@ -65,19 +63,6 @@ public interface SalarySobRangeService { */ void save(SalarySobRangeSaveParam saveParam); - /** - * 保存外部人员 - * @param saveParam - */ - void saveExtRange(SalarySobRangeExtSaveParam saveParam); - - /** - * 外部人员列表 - * @param param - * @return - */ - PageInfo listPage4Ext(SalarySobRangeQueryParam param); - /** * 根据主键id删除薪资账套的人员范围 * @@ -85,8 +70,6 @@ public interface SalarySobRangeService { */ void deleteByIds(Collection ids); - void deleteSalarySobExtRange(Collection ids); - /** * 根据薪资账套id删除薪资账套的人员范围 * diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java index 4a3693f90..5c9a1be10 100644 --- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -147,6 +147,7 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { DataCollectionEmployee employee = new DataCollectionEmployee(); BeanUtils.copyProperties(extPo, employee); employee.setEmployeeId(extPo.getId()); + employee.setExtEmp(true); return employee; } @@ -159,6 +160,7 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { DataCollectionEmployee employee = new DataCollectionEmployee(); BeanUtils.copyProperties(emp, employee); employee.setEmployeeId(emp.getId()); + employee.setExtEmp(true); return employee; }).collect(Collectors.toList()); } diff --git a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java index 0016a4526..07e1eee68 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java @@ -492,7 +492,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct List employeeIds = SalaryEntityUtil.properties(salaryEmployees, DataCollectionEmployee::getEmployeeId,Collectors.toList()); List salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentId); // 转换成薪资核算人员po - List salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2EmployeePO(employeeIds, salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID()); + List salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID()); //过滤掉不属于当前账套扣缴义务人的人员 salaryAcctEmployeePOS = salaryAcctEmployeePOS.stream().filter(po -> Objects.equals(taxAgentId, po.getTaxAgentId())).collect(Collectors.toList()); diff --git a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java index b0c89ffa9..5260bf10f 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java @@ -17,7 +17,6 @@ import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.param.TaxAgentRangeSaveParam; -import com.engine.salary.entity.taxagent.po.TaxAgentEmployeePO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.salaryarchive.SalaryArchiveImportTypeEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveListTypeEnum; @@ -696,11 +695,6 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch List salaryArchiveIds = salaryArchiveList.stream().map(SalaryArchivePO::getId).collect(Collectors.toList()); Map salaryArchivesMap = SalaryEntityUtil.convert2Map(salaryArchiveList, k -> k.getEmployeeId() + "-" + k.getTaxAgentId()); - List employees = getTaxAgentService(user).listEmployees(); - - // 查询人员状态 -// List hrmStatusList = hrmCommonHrmStatusService.list(tenantKey); - return SalaryArchiveImportHandleParam.builder() .isProcess(param.isProcess()) .description(param.getDescription()) @@ -708,12 +702,16 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch .importType(importType) .currentEmployeeId((long) user.getUID()) .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + //人员定位方式 + .empValidType(getSalaryEmployeeService(user).empValidType()) // 待定薪列表 .isPendingList(isPendingList) // 定薪列表 .isFixedList(isFixedList) // 待停薪列表 .isSuspendList(isSuspendList) + //外部人员 + .isExtEmp(param.isExtEmp()) // 初始化导入 .isInit(isInit) // 调薪导入 diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index 36d9f521f..a016c3f48 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -190,7 +190,6 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe //排序配置 OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); queryParam.setOrderRule(orderRule); - queryParam.setExtSalaryArchiveList(true); List list = getSalaryArchiveList(queryParam); list = list.stream() //过滤档案状态 diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index 284efe857..1f61ac4a6 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -4,6 +4,7 @@ import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.EmployBiz; +import com.engine.salary.entity.SalarySobExtRangePO; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.hrm.DeptInfo; import com.engine.salary.entity.hrm.PositionInfo; @@ -15,6 +16,7 @@ import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.service.ExtEmpService; import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.service.SalarySobExtRangeService; import com.engine.salary.service.SalarySobRangeService; import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.util.SalaryEntityUtil; @@ -43,6 +45,10 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee return ServiceUtil.getService(SalarySobRangeServiceImpl.class, user); } + private SalarySobExtRangeService getSalarySobExtRangeService(User user) { + return ServiceUtil.getService(SalarySobExtRangeServiceImpl.class, user); + } + private SalarySysConfMapper getSalarySysConfMapper() { return SqlProxyHandle.getProxy(SalarySysConfMapper.class); } @@ -74,34 +80,47 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee @Override public List listBySalarySobId(Long salarySobId) { + + List includeSalaryEmployees = new ArrayList<>(); + // 查询薪资账套的人员范围 List includeSalarySobRangePOS = getSalarySobRangeService(user).listBySalarySobIdAndIncludeType(salarySobId, NumberUtils.INTEGER_ONE); - if (CollectionUtils.isEmpty(includeSalarySobRangePOS)) { - return Collections.emptyList(); - } - // 将薪资账套的人员范围转换成人员查询参数 - List includeQueryParams = SalarySobRangeBO.convert2EmployeeQueryParam(includeSalarySobRangePOS); - // 根据上一步的查询参数查询人员 - List includeSalaryEmployees = listByParams(includeQueryParams); - if (CollectionUtils.isEmpty(includeSalaryEmployees)) { - return Collections.emptyList(); - } - //去重 - includeSalaryEmployees = includeSalaryEmployees.stream().distinct().collect(Collectors.toList()); - // 查询薪资账套的人员范围(从范围中排除) - List excludeSalarySobRangePOS = getSalarySobRangeService(user).listBySalarySobIdAndIncludeType(salarySobId, NumberUtils.INTEGER_ZERO); - if (CollectionUtils.isNotEmpty(excludeSalarySobRangePOS)) { + if (CollectionUtils.isNotEmpty(includeSalarySobRangePOS)) { // 将薪资账套的人员范围转换成人员查询参数 - List excludeQueryParams = SalarySobRangeBO.convert2EmployeeQueryParam(excludeSalarySobRangePOS); + List includeQueryParams = SalarySobRangeBO.convert2EmployeeQueryParam(includeSalarySobRangePOS); // 根据上一步的查询参数查询人员 - List excludeSalaryEmployees = listByParams(excludeQueryParams); - // 需要排除的人员范围 - Set excludeEmployeeIds = SalaryEntityUtil.properties(excludeSalaryEmployees, DataCollectionEmployee::getEmployeeId); - // 过滤人员 - includeSalaryEmployees = includeSalaryEmployees.stream() - .filter(salaryEmployee -> !excludeEmployeeIds.contains(salaryEmployee.getEmployeeId())) - .collect(Collectors.toList()); + includeSalaryEmployees = listByParams(includeQueryParams); + if (CollectionUtils.isEmpty(includeSalaryEmployees)) { + return Collections.emptyList(); + } + //去重 + includeSalaryEmployees = includeSalaryEmployees.stream().distinct().collect(Collectors.toList()); + // 查询薪资账套的人员范围(从范围中排除) + List excludeSalarySobRangePOS = getSalarySobRangeService(user).listBySalarySobIdAndIncludeType(salarySobId, NumberUtils.INTEGER_ZERO); + if (CollectionUtils.isNotEmpty(excludeSalarySobRangePOS)) { + // 将薪资账套的人员范围转换成人员查询参数 + List excludeQueryParams = SalarySobRangeBO.convert2EmployeeQueryParam(excludeSalarySobRangePOS); + // 根据上一步的查询参数查询人员 + List excludeSalaryEmployees = listByParams(excludeQueryParams); + // 需要排除的人员范围 + Set excludeEmployeeIds = SalaryEntityUtil.properties(excludeSalaryEmployees, DataCollectionEmployee::getEmployeeId); + // 过滤人员 + includeSalaryEmployees = includeSalaryEmployees.stream() + .filter(salaryEmployee -> !excludeEmployeeIds.contains(salaryEmployee.getEmployeeId())) + .collect(Collectors.toList()); + } } + + //外部人员 + List salarySobExtRangePOS = getSalarySobExtRangeService(user).listBySalarySobId(salarySobId); + if(CollectionUtils.isNotEmpty(salarySobExtRangePOS)){ + List ids = SalaryEntityUtil.properties(salarySobExtRangePOS, SalarySobExtRangePO::getTargetId, Collectors.toList()); + List extEmps = getExtEmpService(user).getEmployeeByIds(ids); + extEmps = extEmps.stream().distinct().collect(Collectors.toList()); + + includeSalaryEmployees.addAll(extEmps); + } + return includeSalaryEmployees; } @@ -166,8 +185,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee } //查询对于人员信息导入筛选的全局配置 - SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); - String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; + String confValue = empValidType(); List employees = new ArrayList<>(); //“0”代表姓名+部门+手机号的匹配原则,“1”代表工号为唯一匹配原则 if ("0".equals(confValue)) { @@ -184,6 +202,17 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee } + /** + * 人员定位方式 + * “0”代表姓名+部门+手机号的匹配原则,“1”代表工号为唯一匹配原则 + * @return + */ + @Override + public String empValidType() { + SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); + return (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; + } + @Override public List getDeptInfoList(List departmentIds) { return employBiz.getDeptInfoList(departmentIds); diff --git a/src/com/engine/salary/service/impl/SalarySobExtRangeServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobExtRangeServiceImpl.java new file mode 100644 index 000000000..54808736d --- /dev/null +++ b/src/com/engine/salary/service/impl/SalarySobExtRangeServiceImpl.java @@ -0,0 +1,131 @@ +package com.engine.salary.service.impl; + +import com.api.formmode.mybatis.util.SqlProxyHandle; +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.SalarySobExtRangePO; +import com.engine.salary.entity.salarysob.param.SalarySobRangeExtSaveParam; +import com.engine.salary.entity.salarysob.param.SalarySobRangeQueryParam; +import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.salarysob.SalarySobExtRangeMapper; +import com.engine.salary.mapper.sys.SalarySysConfMapper; +import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.service.SalarySobExtRangeService; +import com.engine.salary.service.SalarySobService; +import com.engine.salary.service.TaxAgentService; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.page.PageInfo; +import com.engine.salary.util.page.SalaryPageUtil; +import com.engine.salary.util.valid.ValidUtil; +import dm.jdbc.util.IdGenerator; +import org.apache.commons.collections4.CollectionUtils; +import weaver.hrm.User; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 薪资账套人员范围 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class SalarySobExtRangeServiceImpl extends Service implements SalarySobExtRangeService { + + + + private SalarySobService getSalarySobService(User user) { + return ServiceUtil.getService(SalarySobServiceImpl.class, user); + } + + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + private SalarySysConfMapper getSalarySysConfMapper() { + return SqlProxyHandle.getProxy(SalarySysConfMapper.class); + } + + private SalarySobExtRangeMapper getSalarySobExtRangeMapper() { + return SqlProxyHandle.getProxy(SalarySobExtRangeMapper.class); + } + +// private ComInfoCache comInfoCache; +// private LoggerTemplate salarySobLoggerTemplate; + + @Override + public List listByIds(Collection ids) { + if (CollectionUtils.isEmpty(ids)) { + return Collections.emptyList(); + } + return getSalarySobExtRangeMapper().listSome(SalarySobExtRangePO.builder().ids(ids).build()); + } + + @Override + public List listBySalarySobId(Long salarySobId) { + if (salarySobId ==null) { + return Collections.emptyList(); + } + return getSalarySobExtRangeMapper().listSome(SalarySobExtRangePO.builder().salarySobId(salarySobId).build()); + } + + + @Override + public void saveExtRange(SalarySobRangeExtSaveParam saveParam) { + ValidUtil.doValidator(saveParam); + + // 查询薪资账套 + SalarySobPO salarySobPO = getSalarySobService(user).getById(saveParam.getSalarySobId()); + if (Objects.isNull(salarySobPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "参数错误,薪资账套不存在或者已被删除")); + } + // 查询已有的人员范围 + List salarySobRangePOS = getSalarySobExtRangeMapper().listSome(SalarySobExtRangePO.builder().salarySobId(saveParam.getSalarySobId()).build()); + // 处理一下本次的保存参数(如果原来添加过对应的人员(/部门/岗位),那么本次不需要新增,只需要更新) + List oldTargetIds = SalaryEntityUtil.properties(salarySobRangePOS, SalarySobExtRangePO::getTargetId, Collectors.toList()); + + List targetIds = saveParam.getTargetIds(); + Date date = new Date(); + if (CollectionUtils.isNotEmpty(targetIds)) { + targetIds.stream().filter(targetId -> !oldTargetIds.contains(targetId)).forEach(targetId -> { + SalarySobExtRangePO po = SalarySobExtRangePO.builder() + .id(IdGenerator.generate()) + .targetType(1) + .salarySobId(saveParam.getSalarySobId()) + .targetId(targetId) + .createTime(date) + .updateTime(date) + .creator((long) user.getUID()) + .deleteType(0) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + getSalarySobExtRangeMapper().insertIgnoreNull(po); + }); + } + } + + @Override + public PageInfo listPage4Ext(SalarySobRangeQueryParam param) { + List salarySobRangePOS = getSalarySobExtRangeMapper().listPage4Ext(SalarySobExtRangePO.builder().salarySobId(param.getSalarySobId()).build()); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), salarySobRangePOS, SalarySobExtRangePO.class); + } + + + @Override + public void deleteSalarySobExtRange(Collection ids) { + if(CollectionUtils.isEmpty(ids)){ + return; + } + getSalarySobExtRangeMapper().deleteByIds(ids); + } + +} diff --git a/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java index 3da01f5b0..257ab6d72 100644 --- a/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java @@ -6,8 +6,6 @@ import com.engine.core.impl.Service; import com.engine.hrm.biz.OrganizationShowSetBiz; import com.engine.salary.biz.SalarySobRangeBiz; import com.engine.salary.biz.SpecialAddDeductionBiz; -import com.engine.salary.constant.SalaryDefaultTenantConstant; -import com.engine.salary.entity.SalarySobExtRangePO; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.hrm.DeptInfo; import com.engine.salary.entity.hrm.PositionInfo; @@ -16,7 +14,6 @@ import com.engine.salary.entity.salarysob.bo.SalarySobRangeBO; import com.engine.salary.entity.salarysob.bo.SalarySobRangeSaveBO; import com.engine.salary.entity.salarysob.dto.SalarySobRangeImportListDTO; import com.engine.salary.entity.salarysob.dto.SalarySobRangeListDTO; -import com.engine.salary.entity.salarysob.param.SalarySobRangeExtSaveParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeImportParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeQueryParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeSaveParam; @@ -44,7 +41,6 @@ import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.valid.ValidUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import dm.jdbc.util.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; @@ -202,46 +198,6 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange // salarySobLoggerTemplate.write(loggerContext); } - @Override - public void saveExtRange(SalarySobRangeExtSaveParam saveParam) { - ValidUtil.doValidator(saveParam); - - // 查询薪资账套 - SalarySobPO salarySobPO = getSalarySobService(user).getById(saveParam.getSalarySobId()); - if (Objects.isNull(salarySobPO)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "参数错误,薪资账套不存在或者已被删除")); - } - // 查询已有的人员范围 - List salarySobRangePOS = getSalarySobExtRangeMapper().listSome(SalarySobExtRangePO.builder().salarySobId(saveParam.getSalarySobId()).build()); - // 处理一下本次的保存参数(如果原来添加过对应的人员(/部门/岗位),那么本次不需要新增,只需要更新) - List oldTargetIds = SalaryEntityUtil.properties(salarySobRangePOS, SalarySobExtRangePO::getTargetId, Collectors.toList()); - - List targetIds = saveParam.getTargetIds(); - Date date = new Date(); - if (CollectionUtils.isNotEmpty(targetIds)) { - targetIds.stream().filter(targetId -> !oldTargetIds.contains(targetId)).forEach(targetId -> { - SalarySobExtRangePO po = SalarySobExtRangePO.builder() - .id(IdGenerator.generate()) - .targetType(1) - .salarySobId(saveParam.getSalarySobId()) - .targetId(targetId) - .createTime(date) - .updateTime(date) - .creator((long) user.getUID()) - .deleteType(0) - .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .build(); - getSalarySobExtRangeMapper().insertIgnoreNull(po); - }); - } - } - - @Override - public PageInfo listPage4Ext(SalarySobRangeQueryParam param) { - List salarySobRangePOS = getSalarySobExtRangeMapper().listPage4Ext(SalarySobExtRangePO.builder().salarySobId(param.getSalarySobId()).build()); - return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), salarySobRangePOS, SalarySobExtRangePO.class); - } - @Override public void deleteByIds(Collection ids) { // 查询薪资账套的人员范围 @@ -270,14 +226,6 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange // }); } - @Override - public void deleteSalarySobExtRange(Collection ids) { - if(CollectionUtils.isEmpty(ids)){ - return; - } - getSalarySobExtRangeMapper().deleteByIds(ids); - } - @Override public void deleteBySalarySobIds(Collection salarySobIds) { salarySobRangeBiz.deleteBySalarySobIds(salarySobIds); diff --git a/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java index a5847783f..84ed0b59d 100644 --- a/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java @@ -162,7 +162,7 @@ public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpServic return; } List taxAgentIds = taxAgentEmpSaveParamList.stream().map(TaxAgentEmpSaveParam::getTaxAgentId).collect(Collectors.toList()); - List taxAgentEmployeeExistList = this.listByTaxAgentIds(taxAgentIds); + List taxAgentEmployeeExistList = this.listExtByTaxAgentIds(taxAgentIds); Date now = new Date(); // 关联表 List taxAgentEmployeeAddList = Lists.newArrayList(); @@ -251,4 +251,11 @@ public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpServic getTaxAgentEmpChangeService(user).batchInsert(taxAgentEmpChangeList); } } + + private List listExtByTaxAgentIds(List taxAgentIds) { + if (CollectionUtils.isEmpty(taxAgentIds)) { + return Lists.newArrayList(); + } + return getTaxAgentEmpMapper().listSome(TaxAgentEmpPO.builder().employeeType(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue()).taxAgentIds(taxAgentIds).build()); + } } diff --git a/src/com/engine/salary/web/SalaryArchiveController.java b/src/com/engine/salary/web/SalaryArchiveController.java index 7dab8f6d0..226e72c65 100644 --- a/src/com/engine/salary/web/SalaryArchiveController.java +++ b/src/com/engine/salary/web/SalaryArchiveController.java @@ -235,7 +235,7 @@ public class SalaryArchiveController { @Produces(MediaType.APPLICATION_JSON) public String extList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryArchiveQueryParam queryParam) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>(user).run(getSalaryArchiveWrapper(user)::listPage, queryParam); + return new ResponseResult>(user).run(getSalaryArchiveWrapper(user)::extList, queryParam); } diff --git a/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java b/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java index 9994e12e7..59c1d2da1 100644 --- a/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java @@ -304,6 +304,19 @@ public class SalaryArchiveWrapper extends Service { } + /** + * 外部人员 + * @param queryParam + * @return + */ + public Map extList(SalaryArchiveQueryParam queryParam) { + queryParam.setRunStatusList(Arrays.asList(SalaryArchiveStatusEnum.FIXED.getValue())); + queryParam.setExtSalaryArchiveList(true); + return list(queryParam, SalaryArchiveListTypeEnum.EXT); + } + + + /** * 获取薪资档案详情表单 * diff --git a/src/com/engine/salary/wrapper/SalarySobRangeWrapper.java b/src/com/engine/salary/wrapper/SalarySobRangeWrapper.java index c5484135a..e85253543 100644 --- a/src/com/engine/salary/wrapper/SalarySobRangeWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobRangeWrapper.java @@ -8,7 +8,9 @@ import com.engine.salary.entity.salarysob.param.SalarySobRangeExtSaveParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeImportParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeQueryParam; import com.engine.salary.entity.salarysob.param.SalarySobRangeSaveParam; +import com.engine.salary.service.SalarySobExtRangeService; import com.engine.salary.service.SalarySobRangeService; +import com.engine.salary.service.impl.SalarySobExtRangeServiceImpl; import com.engine.salary.service.impl.SalarySobRangeServiceImpl; import com.engine.salary.util.page.PageInfo; import org.apache.commons.lang.math.NumberUtils; @@ -32,6 +34,10 @@ public class SalarySobRangeWrapper extends Service { return ServiceUtil.getService(SalarySobRangeServiceImpl.class, user); } + private SalarySobExtRangeService getSalarySobExtRangeService(User user) { + return ServiceUtil.getService(SalarySobExtRangeServiceImpl.class, user); + } + /** * 薪资账套的人员范围列表(关联人员范围) * @@ -76,11 +82,11 @@ public class SalarySobRangeWrapper extends Service { * @param saveParam 保存参数 */ public void saveExtRange(SalarySobRangeExtSaveParam saveParam) { - getSalarySobRangeService(user).saveExtRange(saveParam); + getSalarySobExtRangeService(user).saveExtRange(saveParam); } public PageInfo listPage4Ext(SalarySobRangeQueryParam param) { - return getSalarySobRangeService(user).listPage4Ext(param); + return getSalarySobExtRangeService(user).listPage4Ext(param); } /** @@ -93,7 +99,7 @@ public class SalarySobRangeWrapper extends Service { } public void deleteSalarySobExtRange(Collection ids) { - getSalarySobRangeService(user).deleteSalarySobExtRange(ids); + getSalarySobExtRangeService(user).deleteSalarySobExtRange(ids); } /*** From 81650888c7d39dd954e1127791f2d8665987feb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 15 Mar 2023 18:21:04 +0800 Subject: [PATCH 20/86] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/entity/extemp/po/ExtEmpPO.java | 4 +++ .../service/impl/ExtEmpServiceImpl.java | 33 +++++++++++++++---- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java b/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java index e266f5ba2..093f5eda3 100644 --- a/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java +++ b/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java @@ -129,4 +129,8 @@ public class ExtEmpPO { private String tenantKey; private Collection ids; + + + private String departmentOrgName; + private String subcompanyOrgName; } diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java index 5c9a1be10..0578a9dd4 100644 --- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -1,13 +1,17 @@ package com.engine.salary.service.impl; +import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; import com.engine.salary.entity.extemp.param.ExtEmpSaveParam; import com.engine.salary.entity.extemp.po.ExtEmpPO; +import com.engine.salary.entity.hrm.DeptInfo; +import com.engine.salary.entity.hrm.SubCompanyInfo; import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; import com.engine.salary.mapper.extemp.ExternalEmployeeMapper; import com.engine.salary.service.ExtEmpService; +import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; @@ -15,11 +19,9 @@ import com.google.common.collect.Lists; import dm.jdbc.util.IdGenerator; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.BeanUtils; +import weaver.hrm.User; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; /** @@ -37,6 +39,10 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { return MapperProxyFactory.getProxy(ExternalEmployeeMapper.class); } + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + @Override public List list(ExtEmpQueryParam param) { @@ -107,7 +113,7 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { public List listByParams(List includeQueryParams) { List emps = new ArrayList<>(); List> partition = Lists.partition(includeQueryParams, 100); - partition.forEach(list->{ + partition.forEach(list -> { emps.addAll(getExternalEmployeeMapper().listByParams(list)); }); return emps; @@ -122,7 +128,7 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { public Collection getEmployeeByIdsAll(List ids) { List employeeList = new ArrayList<>(); List> partition = Lists.partition(ids, 1000); - partition.forEach(e->{ + partition.forEach(e -> { List employeeByIdsAll = getExternalEmployeeMapper().getEmployeeByIdsAll(e); employeeList.addAll(employeeByIdsAll); }); @@ -136,6 +142,21 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { @Override public ExtEmpPO getById(Long id) { + ExtEmpPO po = getExternalEmployeeMapper().getById(id); + if (po != null) { + if (po.getDepartmentId() != null) { + List deptInfoList = getSalaryEmployeeService(user).getDeptInfoList(Collections.singletonList(po.getDepartmentId())); + if (CollectionUtils.isNotEmpty(deptInfoList)) { + po.setDepartmentOrgName(deptInfoList.get(0).getName()); + } + } + if (po.getSubcompanyId() != null) { + List subInfoList = getSalaryEmployeeService(user).getSubCompanyInfoList(Collections.singletonList(po.getSubcompanyId())); + if (CollectionUtils.isNotEmpty(subInfoList)) { + po.setSubcompanyOrgName(subInfoList.get(0).getName()); + } + } + } return getExternalEmployeeMapper().getById(id); } From 62d124efb138b7540d5d97b76945c44ce52afcee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 15 Mar 2023 22:48:01 +0800 Subject: [PATCH 21/86] =?UTF-8?q?=E5=A4=96=E9=83=A8=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E7=BB=88=E6=9E=81=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salaryarchive/bo/SalaryArchiveBO.java | 5 + .../datacollection/UseEmployeeTypeEnum.java | 54 ++++++++ .../archive/SalaryArchiveItemMapper.xml | 126 ++++++------------ .../salaryacct/SalaryAcctEmployeeMapper.xml | 29 ++-- .../mapper/taxagent/TaxAgentEmpMapper.xml | 3 - .../engine/salary/service/ExtEmpService.java | 1 + .../salary/service/TaxAgentEmpService.java | 3 +- .../salary/service/TaxAgentService.java | 8 +- .../impl/AddUpDeductionServiceImpl.java | 2 - .../service/impl/ExtEmpServiceImpl.java | 2 +- .../impl/SalaryArchiveExcelServiceImpl.java | 8 -- .../impl/SalaryArchiveItemServiceImpl.java | 45 ++++--- .../impl/SalaryArchiveServiceImpl.java | 33 +++-- .../service/impl/TaxAgentEmpServiceImpl.java | 24 ++-- .../service/impl/TaxAgentServiceImpl.java | 25 +--- .../engine/salary/web/SIReportController.java | 4 - .../salary/web/SalaryArchiveController.java | 19 ++- .../wrapper/SalaryArchiveItemWrapper.java | 34 +++-- .../salary/wrapper/SalaryArchiveWrapper.java | 22 +-- 19 files changed, 237 insertions(+), 210 deletions(-) create mode 100644 src/com/engine/salary/enums/datacollection/UseEmployeeTypeEnum.java diff --git a/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveBO.java b/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveBO.java index 2006e553a..555c2a1cb 100644 --- a/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveBO.java +++ b/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveBO.java @@ -385,4 +385,9 @@ public class SalaryArchiveBO { */ private List changeIds; } + + + public static boolean isNotExtEmp(SalaryArchivePO po) { + return po.getEmployeeType() == null || po.getEmployeeType() == 1; + } } diff --git a/src/com/engine/salary/enums/datacollection/UseEmployeeTypeEnum.java b/src/com/engine/salary/enums/datacollection/UseEmployeeTypeEnum.java new file mode 100644 index 000000000..09e31d614 --- /dev/null +++ b/src/com/engine/salary/enums/datacollection/UseEmployeeTypeEnum.java @@ -0,0 +1,54 @@ +package com.engine.salary.enums.datacollection; + +import com.engine.salary.enums.BaseEnum; + +import java.util.Arrays; +import java.util.Optional; + +/** + * 人员使用枚举 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public enum UseEmployeeTypeEnum implements BaseEnum { + + ORG(0, "组织架构", 109125), + EXT(1, "非系统人员", 119127), + ALl(2, "所有人员", 119127), + ; + + private int value; + + private String defaultLabel; + + private int labelId; + + UseEmployeeTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + @Override + public Integer getValue() { + return value; + } + + @Override + public Integer getLabelId() { + return labelId; + } + + @Override + public String getDefaultLabel() { + return defaultLabel; + } + + public static String getNameByValue(String value) { + Optional optional = Arrays.stream(UseEmployeeTypeEnum.values()).filter(r -> r.getValue().toString().equals(value)).findFirst(); + return optional.isPresent() ? optional.get().name() : ""; + } +} diff --git a/src/com/engine/salary/mapper/archive/SalaryArchiveItemMapper.xml b/src/com/engine/salary/mapper/archive/SalaryArchiveItemMapper.xml index ba93b03b2..db76c9cb2 100644 --- a/src/com/engine/salary/mapper/archive/SalaryArchiveItemMapper.xml +++ b/src/com/engine/salary/mapper/archive/SalaryArchiveItemMapper.xml @@ -536,32 +536,60 @@ SELECT FROM hrsa_salary_archive_item t1 - LEFT JOIN hrmresource e ON e.id = t1.employee_id - LEFT JOIN hrmdepartment d ON d.id = e.departmentid LEFT JOIN hrmresource o ON o.id = t1.operator LEFT JOIN hrsa_salary_item t2 ON t2.id = t1.salary_item_id WHERE t1.delete_type = 0 - AND e.status != '7' and (e.accounttype is null or e.accounttype = 0) AND t1.salary_item_id IN #{id} - - - AND - ( - e.lastname like CONCAT('%',#{param.keyword},'%') - OR d.departmentname like CONCAT('%',#{param.keyword},'%') - OR t2.name like CONCAT('%',#{param.keyword},'%') - ) - AND t2.name like CONCAT('%',#{param.adjustItem},'%') - + + AND t1.id IN + + #{id} + + + + + AND t1.employee_id = #{param.employeeId} + + + + AND t1.salary_archive_id = #{param.salaryArchiveId} + + + + AND d.id IN + + #{id} + + + + + AND t1.adjust_reason = #{param.adjustReason} + + + + AND (t1.effective_time BETWEEN #{param.effectiveTime[0]} AND #{param.effectiveTime[1]}) + + + + AND (t1.operate_time BETWEEN CONCAT(#{param.operateTime[0]},' 00:00:00') AND + CONCAT(#{param.operateTime[1]},' 23:59:59')) + + + + AND t1.operator IN + + #{id} + + ORDER BY t1.effective_time DESC,t1.id DESC t1.id, t1.employee_id, - e.lastname as username, - e.status AS employeeStatus, - d.departmentname AS departmentName, t1.effective_time, t1.adjust_reason, t2.name AS adjust_item, diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml index f399e37a6..d7f6e92c0 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml @@ -14,6 +14,7 @@ + @@ -44,13 +46,13 @@ . id , emp1.salary_acct_record_id, emp1.salary_sob_id, emp1.employee_id, emp1.tax_agent_id, emp1.salary_month, - emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key + emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key,emp1.employee_type INSERT INTO hrsa_salary_acct_emp( salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month, - creator, create_time, update_time, delete_type, tenant_key) + creator, create_time, update_time, delete_type, tenant_key,employee_type) VALUES ( @@ -63,14 +65,15 @@ #{emp.createTime}, #{emp.updateTime}, #{emp.deleteType}, - #{emp.tenantKey} + #{emp.tenantKey}, + #{emp.employeeType} ) INSERT INTO hrsa_salary_acct_emp( salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month, - creator, create_time, update_time, delete_type, tenant_key) + creator, create_time, update_time, delete_type, tenant_key,employee_type) select @@ -83,7 +86,8 @@ #{emp.createTime,jdbcType=DATE}, #{emp.updateTime,jdbcType=DATE}, #{emp.deleteType,jdbcType=INTEGER}, - #{emp.tenantKey,jdbcType=VARCHAR} + #{emp.tenantKey,jdbcType=VARCHAR}, + #{emp.employeeType,jdbcType=INTEGER} from dual @@ -91,7 +95,7 @@ INSERT INTO hrsa_salary_acct_emp( salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month, - creator, create_time, update_time, delete_type, tenant_key) + creator, create_time, update_time, delete_type, tenant_key,employee_type) VALUES ( #{emp.salaryAcctRecordId}, @@ -103,7 +107,8 @@ #{emp.createTime}, #{emp.updateTime}, #{emp.deleteType}, - #{emp.tenantKey} + #{emp.tenantKey}, + #{emp.employeeType} )
@@ -151,13 +156,13 @@ SELECT DISTINCT emp1.id, emp1.salary_acct_record_id, emp1.salary_sob_id, emp1.employee_id, emp1.tax_agent_id, emp1.salary_month, - emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key + emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key,emp1.employee_type FROM ( SELECT id, salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month, - creator, create_time, update_time, delete_type, tenant_key + creator, create_time, update_time, delete_type, tenant_key,employee_type FROM hrsa_salary_acct_emp WHERE @@ -228,13 +233,13 @@ SELECT DISTINCT emp1.id, emp1.salary_acct_record_id, emp1.salary_sob_id, emp1.employee_id, emp1.tax_agent_id, emp1.salary_month, - emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key + emp1.creator, emp1.create_time, emp1.update_time, emp1.delete_type, emp1.tenant_key,emp1.employee_type FROM ( SELECT id, salary_acct_record_id, salary_sob_id, employee_id, tax_agent_id, salary_month, - creator, create_time, update_time, delete_type, tenant_key + creator, create_time, update_time, delete_type, tenant_key,employee_type FROM hrsa_salary_acct_emp WHERE diff --git a/src/com/engine/salary/mapper/taxagent/TaxAgentEmpMapper.xml b/src/com/engine/salary/mapper/taxagent/TaxAgentEmpMapper.xml index d418e242d..bae6797bf 100644 --- a/src/com/engine/salary/mapper/taxagent/TaxAgentEmpMapper.xml +++ b/src/com/engine/salary/mapper/taxagent/TaxAgentEmpMapper.xml @@ -82,9 +82,6 @@ AND employee_type = #{employeeType} - - AND (employee_type is null or employee_type = 0) - AND tax_agent_id IN diff --git a/src/com/engine/salary/service/ExtEmpService.java b/src/com/engine/salary/service/ExtEmpService.java index 8aedeeb8d..d6f3b2d7d 100644 --- a/src/com/engine/salary/service/ExtEmpService.java +++ b/src/com/engine/salary/service/ExtEmpService.java @@ -43,5 +43,6 @@ public interface ExtEmpService { Collection getEmployeeByIdsAll(List ids); Collection listAllForReport(); + ExtEmpPO getById(Long id); } \ No newline at end of file diff --git a/src/com/engine/salary/service/TaxAgentEmpService.java b/src/com/engine/salary/service/TaxAgentEmpService.java index 6ea2779e4..06cf297b3 100644 --- a/src/com/engine/salary/service/TaxAgentEmpService.java +++ b/src/com/engine/salary/service/TaxAgentEmpService.java @@ -2,6 +2,7 @@ package com.engine.salary.service; import com.engine.salary.entity.taxagent.param.TaxAgentEmpSaveParam; import com.engine.salary.entity.taxagent.po.TaxAgentEmpPO; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import java.util.Collection; import java.util.List; @@ -29,7 +30,7 @@ public interface TaxAgentEmpService{ * @param taxAgentIds * @return */ - List listByTaxAgentIds(List taxAgentIds); + List listByTaxAgentIds(List taxAgentIds, UseEmployeeTypeEnum type); /** * 同步人员到本地关联表 diff --git a/src/com/engine/salary/service/TaxAgentService.java b/src/com/engine/salary/service/TaxAgentService.java index 2890f94b8..3794d51c8 100644 --- a/src/com/engine/salary/service/TaxAgentService.java +++ b/src/com/engine/salary/service/TaxAgentService.java @@ -243,11 +243,5 @@ public interface TaxAgentService { Boolean adminChangeCheck(TaxAgentAdminChangeCheckParam checkParam); - /** - * 获取个税扣缴义务人下的人员范围 - * - * @param taxAgentId - * @return - */ - Collection listEmployeeIdsInTaxAgent(Long taxAgentId); + } diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index 2edf4c4ed..197fe9a87 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -662,8 +662,6 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction List accountedEmployeeData = getAccountedEmployeeData(DateUtil.format(yearMonth, "yyyy-MM")); for (TaxAgentPO taxAgent : taxAgents) { - Collection employeeIds = getTaxAgentService(user) - .listEmployeeIdsInTaxAgent(taxAgent.getId()); List employeePOs = getSpecialAddDeductionService(user) .getSpecialAddDeductionPOByEmployee(null, taxAgent.getId()); diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java index 0578a9dd4..3499db754 100644 --- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -157,7 +157,7 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { } } } - return getExternalEmployeeMapper().getById(id); + return po; } diff --git a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java index 5260bf10f..53c8fbb48 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java @@ -14,7 +14,6 @@ import com.engine.salary.entity.salaryarchive.param.SalaryArchiveQueryParam; import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; -import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.param.TaxAgentRangeSaveParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; @@ -317,19 +316,12 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch long employeeId = user.getUID(); if (getTaxAgentService(user).isNeedAuth(employeeId)) { - List taxAgentEmployees = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId); List taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); salaryArchives = salaryArchives.stream().filter(f -> // 作为管理员 taxAgentIdsAsAdmin.contains(f.getTaxAgentId()) - // 作为分管理员 -// || TaxAgentBO.checkTaxAgentAndEmployee(taxAgentEmployees, f.getTaxAgentId(), f.getEmployeeId()) -// || employeeId.equals(f.getModifier()) ).collect(Collectors.toList()); } - Map idNoEmpMap = -// enableHr ? salaryEmployeeService.mapByEmployeeIds(salaryArchives.stream().map(SalaryArchiveListDTO::getEmployeeId).distinct().collect(Collectors.toList()), tenantKey) -// : new HashMap<>(); if (queryParam.getHasData()) { List> listMaps = salaryArchiveService(user) diff --git a/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java index d48072db8..080b330fe 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java @@ -11,12 +11,14 @@ import com.engine.salary.entity.salaryarchive.param.*; import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveFieldTypeEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveItemAdjustReasonEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.SalaryArchiveItemService; +import com.engine.salary.service.TaxAgentService; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.excel.ExcelUtil; @@ -56,6 +58,10 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi return ServiceUtil.getService(SalaryArchiveItemServiceImpl.class, user); } + private TaxAgentService getTaxAgentService(User user) { + return ServiceUtil.getService(TaxAgentServiceImpl.class, user); + } + /** * 获取未生效 lt * @@ -179,7 +185,7 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi List salaryArchiveItems = Lists.newArrayList(); if (isNoNeedSalaryItem) { - salaryArchiveItems.addAll(getIneffectiveSalaryItems(saIds, salaryItemIds)); + salaryArchiveItems.addAll(getIneffectiveSalaryItems(saIds, salaryItemIds)); } else { List> partition = Lists.partition((List) saIds, 1000); Collection finalSalaryItemIds = salaryItemIds; @@ -216,31 +222,31 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(115437, "停薪列表禁止操作")); } SalaryArchiveItemPO salaryArchiveItem = null; - if (salaryArchiveItemSaveParam.getSalaryArchiveItemId() != null ) { + if (salaryArchiveItemSaveParam.getSalaryArchiveItemId() != null) { salaryArchiveItem = salaryArchiveItemMapper.getById(salaryArchiveItemSaveParam.getSalaryArchiveItemId()); if (salaryArchiveItem == null || !salaryArchiveItem.getSalaryArchiveId().equals(salaryArchiveId)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100428, "该薪资档案的薪资项目的调整记录不存在")); } if (salaryArchiveItemSaveParam.getSalaryArchiveItems().size() > 1) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(149535, "单个调整不能处理多个薪资项目")); - } else if (!salaryArchiveItems.get(0).getSalaryItemId().equals(salaryArchiveItem.getSalaryItemId())){ - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel( 149539, "单个调薪的目标项目和调整明细项目id不一致")); + } else if (!salaryArchiveItems.get(0).getSalaryItemId().equals(salaryArchiveItem.getSalaryItemId())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(149539, "单个调薪的目标项目和调整明细项目id不一致")); } } // 构建更新PO - SalaryArchiveItemPO updateSalaryArchiveItemPO = buildUpdateSalaryArchiveItemPO(salaryArchiveItemSaveParam,salaryArchiveItems,salaryItemIds,salaryArchiveItem); + SalaryArchiveItemPO updateSalaryArchiveItemPO = buildUpdateSalaryArchiveItemPO(salaryArchiveItemSaveParam, salaryArchiveItems, salaryItemIds, salaryArchiveItem); salaryArchiveItemMapper.updateIgnoreNull(updateSalaryArchiveItemPO); } return StringUtils.EMPTY; } /** - * @description 构建薪资档案中调薪的更新PO * @return null + * @description 构建薪资档案中调薪的更新PO * @author Harryxzy * @date 2022/11/14 14:24 */ - private SalaryArchiveItemPO buildUpdateSalaryArchiveItemPO(SalaryArchiveItemSaveParam salaryArchiveItemSaveParam,List salaryArchiveItems,List salaryItemIds,SalaryArchiveItemPO salaryArchiveItem) { + private SalaryArchiveItemPO buildUpdateSalaryArchiveItemPO(SalaryArchiveItemSaveParam salaryArchiveItemSaveParam, List salaryArchiveItems, List salaryItemIds, SalaryArchiveItemPO salaryArchiveItem) { // 获取所有可被引用的薪资项目 List salaryItems = getSalaryArchiveItemService(user).getCanAdjustSalaryItems(); // 获取生效+未生效的数据 @@ -267,8 +273,8 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi } // 修改了生效日期 - if(!salaryArchiveItemSaveParam.getEffectiveTime().equals(salaryArchiveItem.getEffectiveTime())){ - boolean isEffectiveTimeRepeat = list.stream().anyMatch(it -> it.getEffectiveTime().equals(saveEffectiveTime)); + if (!salaryArchiveItemSaveParam.getEffectiveTime().equals(salaryArchiveItem.getEffectiveTime())) { + boolean isEffectiveTimeRepeat = list.stream().anyMatch(it -> it.getEffectiveTime().equals(saveEffectiveTime)); if (isEffectiveTimeRepeat) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(153539, "已经存在该生效日期的调整记录,请修改生效日期")); } @@ -276,9 +282,9 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi // 1.检验是否可以调整 // if (effectiveSalaryItem != null) { - // 当前已经生效的时间 + // 当前已经生效的时间 // Date effectiveTime = effectiveSalaryItem.getEffectiveTime(); - // 1.1 如果保存的生效日期早于<当前已生效 + // 1.1 如果保存的生效日期早于<当前已生效 // if (saveEffectiveTime.before(effectiveTime)) { // if(salaryArchiveItemSaveParam.getCanOperator() == Boolean.TRUE){ // throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100429, "生效日期不可早于当前已生效的调整日期")); @@ -545,9 +551,9 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98299, "参数错误,薪资项目不存在或已被删除")); } // if (salaryArchiveItem.getEffectiveTime().after(new Date())) { - salaryArchiveItem.setDeleteType(1); - // 删除未生效数据 - salaryArchiveItemMapper.updateById(salaryArchiveItem); + salaryArchiveItem.setDeleteType(1); + // 删除未生效数据 + salaryArchiveItemMapper.updateById(salaryArchiveItem); // } else { // throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98299, "该薪资项目已生效不可删除")); // } @@ -561,7 +567,16 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi */ @Override public List getCanAdjustSalaryItems() { - return salaryItemMapper.getCanAdjustSalaryItems(); + Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID()); + List taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId, Collectors.toList()); + + List canAdjustSalaryItems = salaryItemMapper.getCanAdjustSalaryItems(); + canAdjustSalaryItems = canAdjustSalaryItems.stream() + .filter(item -> item.getSharedType() == null + || 0 == item.getSharedType() + || (StringUtils.isNotBlank(item.getTaxAgentIds()) && SalaryEntityUtil.judgeIntersection(taxAgentIds, Arrays.stream(item.getTaxAgentIds().split(",")).map(Long::valueOf).collect(Collectors.toList())))) + .collect(Collectors.toList()); + return canAdjustSalaryItems; } diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index a016c3f48..65a0d5a8a 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -925,14 +925,6 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe public Map queryTabTotal() { long currentEmployeeId = user.getUID(); -// // 1.历史数据处理 -// handleHistory(currentEmployeeId); -// // 2.待停薪自动处理 -// handleSuspendData(currentEmployeeId); -// // 3.增量数据处理 -// handleChangeData(currentEmployeeId); - - // tab页签数量 Map result = new HashMap<>(); @@ -941,7 +933,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe //获取管理的人员范围 List taxAgentEmployeeDTOS = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId); Map> taxAgentEmployeesMap = SalaryEntityUtil.convert2Map(taxAgentEmployeeDTOS, TaxAgentManageRangeEmployeeDTO::getTaxAgentId, TaxAgentManageRangeEmployeeDTO::getEmployeeList); - List list = null; + List list = new ArrayList<>(); if (needAuth) { // 获取作为管理员的所有个税扣缴义务人列表 Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin(currentEmployeeId); @@ -966,17 +958,23 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe long fixedTotal = 0L; long suspendTotal = 0L; long stopTotal = 0L; + long extTotal = 0L; for (SalaryArchivePO sa : list) { - if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.PENDING.getValue())) { - pendingTotal += 1; - } else if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.FIXED.getValue()) || sa.getRunStatus().equals(SalaryArchiveStatusEnum.SUSPEND.getValue())) { - fixedTotal += 1; - if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.SUSPEND.getValue())) { - suspendTotal += 1; + Integer employeeType = sa.getEmployeeType(); + if (employeeType == null || employeeType == 0) { + if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.PENDING.getValue())) { + pendingTotal += 1; + } else if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.FIXED.getValue()) || sa.getRunStatus().equals(SalaryArchiveStatusEnum.SUSPEND.getValue())) { + fixedTotal += 1; + if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.SUSPEND.getValue())) { + suspendTotal += 1; + } + } else if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) || sa.getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) { + stopTotal += 1; } - } else if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) || sa.getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) { - stopTotal += 1; + } else { + extTotal += 1; } } @@ -984,6 +982,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe result.put(SalaryArchiveListTypeEnum.FIXED.getValue(), fixedTotal); result.put(SalaryArchiveListTypeEnum.SUSPEND.getValue(), suspendTotal); result.put(SalaryArchiveListTypeEnum.STOP.getValue(), stopTotal); + result.put(SalaryArchiveListTypeEnum.EXT.getValue(), extTotal); return result; } diff --git a/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java index 84ed0b59d..cc2d23985 100644 --- a/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java @@ -8,6 +8,7 @@ import com.engine.salary.entity.taxagent.param.TaxAgentEmpSaveParam; import com.engine.salary.entity.taxagent.po.TaxAgentEmpChangePO; import com.engine.salary.entity.taxagent.po.TaxAgentEmpPO; import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.taxagent.TaxAgentEmpChangeModuleEnum; import com.engine.salary.enums.taxagent.TaxAgentEmpChangeTypeEnum; import com.engine.salary.mapper.taxagent.TaxAgentEmpMapper; @@ -56,11 +57,20 @@ public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpServic } @Override - public List listByTaxAgentIds(List taxAgentIds) { + public List listByTaxAgentIds(List taxAgentIds, UseEmployeeTypeEnum type) { if (CollectionUtils.isEmpty(taxAgentIds)) { return Lists.newArrayList(); } - return getTaxAgentEmpMapper().listSome(TaxAgentEmpPO.builder().taxAgentIds(taxAgentIds).build()); + TaxAgentEmpPO param = TaxAgentEmpPO.builder().taxAgentIds(taxAgentIds).build(); + if (type == UseEmployeeTypeEnum.ORG) { + param.setEmployeeType(DataCollectionEmployeeTypeEnum.ORGANIZATION.getValue()); + } + + if (type == UseEmployeeTypeEnum.EXT) { + param.setEmployeeType(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue()); + } + + return getTaxAgentEmpMapper().listSome(param); } @Override @@ -69,7 +79,7 @@ public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpServic return; } List taxAgentIds = taxAgentEmpSaveParamList.stream().map(TaxAgentEmpSaveParam::getTaxAgentId).collect(Collectors.toList()); - List taxAgentEmployeeExistList = this.listByTaxAgentIds(taxAgentIds); + List taxAgentEmployeeExistList = this.listByTaxAgentIds(taxAgentIds, UseEmployeeTypeEnum.ORG); Date now = new Date(); // 关联表 List taxAgentEmployeeAddList = Lists.newArrayList(); @@ -162,7 +172,7 @@ public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpServic return; } List taxAgentIds = taxAgentEmpSaveParamList.stream().map(TaxAgentEmpSaveParam::getTaxAgentId).collect(Collectors.toList()); - List taxAgentEmployeeExistList = this.listExtByTaxAgentIds(taxAgentIds); + List taxAgentEmployeeExistList = this.listByTaxAgentIds(taxAgentIds, UseEmployeeTypeEnum.ORG); Date now = new Date(); // 关联表 List taxAgentEmployeeAddList = Lists.newArrayList(); @@ -252,10 +262,4 @@ public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpServic } } - private List listExtByTaxAgentIds(List taxAgentIds) { - if (CollectionUtils.isEmpty(taxAgentIds)) { - return Lists.newArrayList(); - } - return getTaxAgentEmpMapper().listSome(TaxAgentEmpPO.builder().employeeType(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue()).taxAgentIds(taxAgentIds).build()); - } } diff --git a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java index e6319ddc2..e9c4d6749 100644 --- a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java @@ -21,6 +21,7 @@ import com.engine.salary.entity.taxagent.param.TaxAgentAdminChangeCheckParam; import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.param.TaxAgentSaveParam; import com.engine.salary.entity.taxagent.po.*; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum; import com.engine.salary.enums.taxagent.TaxAgentRoleTypeEnum; @@ -32,7 +33,6 @@ import com.engine.salary.mapper.datacollection.OtherDeductionMapper; import com.engine.salary.mapper.salarysob.SalarySobMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.*; -import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; @@ -137,7 +137,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { return convert2TaxAgentEmployeePO(employees); } - public List convert2TaxAgentEmployeePO(List dataCollectionEmployees){ + public List convert2TaxAgentEmployeePO(List dataCollectionEmployees) { List result = new ArrayList<>(); dataCollectionEmployees.stream().forEach(PO -> { TaxAgentEmployeePO taxAgentEmployeePO = new TaxAgentEmployeePO(); @@ -285,7 +285,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { List taxAgents = getTaxAgentMapper().listAll(); List taxAgentIds = taxAgents.stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - List taxAgentEmployees = getTaxAgentEmpService(user).listByTaxAgentIds(taxAgentIds); + List taxAgentEmployees = getTaxAgentEmpService(user).listByTaxAgentIds(taxAgentIds, UseEmployeeTypeEnum.ORG); if (CollectionUtils.isEmpty(taxAgentEmployees)) { return Lists.newArrayList(); @@ -602,7 +602,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { List taxAgentIds = allTaxAgents.stream().map(TaxAgentPO::getId).collect(Collectors.toList()); List employees = getSalaryEmployeeService(user).listEmployee(); - List allEmployees =convert2TaxAgentEmployeePO(employees); + List allEmployees = convert2TaxAgentEmployeePO(employees); if (employeeStatus != null) { List personnelStatusList; // 查询人员状态 @@ -626,13 +626,6 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { if (CollectionUtils.isNotEmpty(adminTaxAgentIds)) { taxAgentManageRangeEmployeeList.addAll(getTaxAgentEmp(allTaxAgents, adminTaxAgentIds, allEmployees)); } - // 2.根据作为非管理员查找自己作为分管理员, 对应的管理范围人员 - List noAdminTaxAgentIds = allTaxAgents.stream() - .map(TaxAgentPO::getId) - .filter(id -> !adminTaxAgentIds.contains(id)).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(noAdminTaxAgentIds)) { -// taxAgentManageRangeEmployeeList.addAll(getTaxAgentSubAdminEmp(allTaxAgents, noAdminTaxAgentIds, allEmployees)); - } return taxAgentManageRangeEmployeeList; } @@ -720,7 +713,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { */ private List getTaxAgentEmp(List allTaxAgents, List taxAgentIds, List allEmployees) { List taxAgentManageRangeEmployeeList = Lists.newArrayList(); - List taxAgentEmps = getTaxAgentEmpService(user).listByTaxAgentIds(taxAgentIds); + List taxAgentEmps = getTaxAgentEmpService(user).listByTaxAgentIds(taxAgentIds, UseEmployeeTypeEnum.ALl); taxAgentEmps = taxAgentEmps.stream().filter(f -> allEmployees.stream().anyMatch(e -> e.getEmployeeId().equals(f.getEmployeeId()))).collect(Collectors.toList()); @@ -772,12 +765,4 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { return taxAgentEmployeeList; } - @Override - public Collection listEmployeeIdsInTaxAgent(Long taxAgentId) { - List taxAgentEmpPOS = getTaxAgentEmpService(user).listByTaxAgentIds(Collections.singletonList(taxAgentId)); - - return SalaryEntityUtil.properties(taxAgentEmpPOS, TaxAgentEmpPO::getEmployeeId); - } - - } diff --git a/src/com/engine/salary/web/SIReportController.java b/src/com/engine/salary/web/SIReportController.java index f75e130c4..55b602525 100644 --- a/src/com/engine/salary/web/SIReportController.java +++ b/src/com/engine/salary/web/SIReportController.java @@ -11,7 +11,6 @@ import com.engine.salary.wrapper.SalaryArchiveItemWrapper; import io.swagger.v3.oas.annotations.parameters.RequestBody; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; -import weaver.login.AuthenticUtil; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -21,10 +20,8 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; -import java.util.Arrays; import java.util.Map; import java.util.Optional; -import java.util.Vector; /** * 福利报表 @@ -70,7 +67,6 @@ public class SIReportController { String pageSize = Optional.ofNullable(request.getParameter("pageSize")).orElse("10"); salaryItemAdjustRecordQueryParam.setCurrent(Integer.valueOf(current)); salaryItemAdjustRecordQueryParam.setPageSize(Integer.valueOf(pageSize)); - getSalaryArchiveItemWrapper(user).adjustRecordList(salaryItemAdjustRecordQueryParam); return new ResponseResult>(user).run(getSalaryArchiveItemWrapper(user)::adjustRecordList, salaryItemAdjustRecordQueryParam); } } diff --git a/src/com/engine/salary/web/SalaryArchiveController.java b/src/com/engine/salary/web/SalaryArchiveController.java index 226e72c65..e7cf41913 100644 --- a/src/com/engine/salary/web/SalaryArchiveController.java +++ b/src/com/engine/salary/web/SalaryArchiveController.java @@ -225,6 +225,7 @@ public class SalaryArchiveController { /** * 外部人员列表 + * * @param request * @param response * @param queryParam @@ -239,7 +240,6 @@ public class SalaryArchiveController { } - /** * 取消停薪 * @@ -411,9 +411,15 @@ public class SalaryArchiveController { boolean isInit = SalaryArchiveImportTypeEnum.INIT.getValue().equals(queryParam.getImportType()); boolean isSalaryItemAdjust = SalaryArchiveImportTypeEnum.SALARYITEMADJUST.getValue().equals(queryParam.getImportType()); + boolean isExtEmp = queryParam.isExtSalaryArchiveList(); + // 名称 String finalNameI18n = SalaryI18nUtil.getI18nLabel(101601, "薪资档案导入模板-") + SalaryI18nUtil.getI18nLabel(listTypeEnum.getLabelId(), listTypeEnum.getDefaultLabel()); + if (isExtEmp) { + finalNameI18n += "-非系统人员"; + } + if (isFixedList) { // 初始化 if (isInit) { @@ -496,6 +502,12 @@ public class SalaryArchiveController { if (StringUtils.isNotBlank(listType)) { param.setListType(SalaryArchiveListTypeEnum.parseByValue(listType)); } + //1标识外部人员 + String extSalaryArchiveList = request.getParameter("extSalaryArchiveList"); + extSalaryArchiveList ="1"; + if (StringUtils.isNotBlank(extSalaryArchiveList)) { + param.setExtSalaryArchiveList("1".equals(extSalaryArchiveList)); + } return param; } @@ -736,8 +748,8 @@ public class SalaryArchiveController { /** - * @description 编辑前获取薪资项目调整信息 * @return String + * @description 编辑前获取薪资项目调整信息 * @author Harryxzy * @date 2022/11/15 9:25 */ @@ -750,8 +762,8 @@ public class SalaryArchiveController { } /** - * @description 单个档案的薪资项目调整的编辑 * @return String + * @description 单个档案的薪资项目调整的编辑 * @author Harryxzy * @date 2022/11/11 13:50 */ @@ -944,7 +956,6 @@ public class SalaryArchiveController { /******** 个税扣缴义务人调整记录 end ***********************************************************************************************/ - @GET @Path("/handleRepeatData") @Produces(MediaType.APPLICATION_JSON) diff --git a/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java b/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java index 49d527a06..98d9815a5 100644 --- a/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java @@ -2,6 +2,7 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveItemFormDTO; import com.engine.salary.entity.salaryarchive.dto.SalaryItemAdjustRecordListDTO; import com.engine.salary.entity.salaryarchive.dto.SingleSalaryItemAdjustRecordListDTO; @@ -15,12 +16,8 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveItemAdjustReasonEnum; import com.engine.salary.exception.SalaryRunTimeException; -import com.engine.salary.service.SalaryArchiveItemService; -import com.engine.salary.service.SalaryItemService; -import com.engine.salary.service.TaxAgentService; -import com.engine.salary.service.impl.SalaryArchiveItemServiceImpl; -import com.engine.salary.service.impl.SalaryItemServiceImpl; -import com.engine.salary.service.impl.TaxAgentServiceImpl; +import com.engine.salary.service.*; +import com.engine.salary.service.impl.*; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.proxy.SalaryArchiveItemWrapperProxy; @@ -56,6 +53,15 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt return (TaxAgentService) ServiceUtil.getService(TaxAgentServiceImpl.class, user); } + private SalaryArchiveService getSalaryArchiveService(User user) { + return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user); + } + + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + + /** * 构建薪资项目基础信息表单 * @@ -217,6 +223,8 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt List salaryItemList = getSalaryArchiveItemService(user).getCanAdjustSalaryItems(); List salaryItemIds = salaryItemList.stream().map(SalaryItemPO::getId).collect(Collectors.toList()); + DataCollectionEmployee employee = getSalaryEmployeeService(user).getEmployeeById(queryParam.getEmployeeId()); + List listAll = getSalaryArchiveItemService(user).salaryItemAdjustRecordList(SalaryItemAdjustRecordQueryParam.builder().build(), salaryItemIds); PageInfo list = getSalaryArchiveItemService(user).salaryItemAdjustRecordListPage(queryParam, salaryItemIds); List listResult = list.getList(); @@ -228,7 +236,9 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt Optional optional = listAll.stream().filter(f -> f.getSalaryArchiveId().equals(m.getSalaryArchiveId()) && f.getSalaryItemId().equals(m.getSalaryItemId())).findFirst(); m.setAdjustBefore(optional.isPresent() ? optional.get().getAdjustAfter() : ""); - m.setEmployeeStatus(UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(m.getEmployeeStatus()))); + m.setUsername(employee.getUsername()); + m.setDepartmentName(employee.getDepartmentName()); + m.setEmployeeStatus(UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(employee.getStatus()))); m.setAdjustReason(SalaryArchiveItemAdjustReasonEnum.getDefaultLabelByValue(m.getAdjustReason())); }); @@ -242,7 +252,9 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt * @return */ public PageInfo singleSalaryItemAdjustRecordList(SingleSalaryItemAdjustRecordQueryParam queryParam) { - if (queryParam.getSalaryArchiveId() == null) { + Long salaryArchiveId = queryParam.getSalaryArchiveId(); + + if (salaryArchiveId == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100425, "薪资档案id不能为空")); } // 获取所有可被引用的薪资项目 @@ -266,8 +278,8 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt } Optional optional = listAll.stream() .filter(f -> f.getSalaryArchiveId().equals(m.getSalaryArchiveId())) - .filter(f ->f.getSalaryItemId().equals(m.getSalaryItemId())) - .filter(f->f.getEffectiveTime().before(m.getEffectiveTime())) + .filter(f -> f.getSalaryItemId().equals(m.getSalaryItemId())) + .filter(f -> f.getEffectiveTime().before(m.getEffectiveTime())) .findFirst(); m.setAdjustBefore(optional.isPresent() ? optional.get().getAdjustAfter() : ""); @@ -279,7 +291,7 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt }); List salaryItemPageIds = resultList.stream().map(SingleSalaryItemAdjustRecordListDTO::getSalaryItemId).collect(Collectors.toList()); - List effectiveSalaryItems = getSalaryArchiveItemService(user).getEffectiveSalaryItems(queryParam.getSalaryArchiveId(), salaryItemPageIds); + List effectiveSalaryItems = getSalaryArchiveItemService(user).getEffectiveSalaryItems(salaryArchiveId, salaryItemPageIds); // 行记录按钮权限控制 for (int i = 0; i < resultList.size(); i++) { SingleSalaryItemAdjustRecordListDTO singleSalaryItemAdjustRecord = resultList.get(i); diff --git a/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java b/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java index 59c1d2da1..f6e49b738 100644 --- a/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java @@ -306,6 +306,7 @@ public class SalaryArchiveWrapper extends Service { /** * 外部人员 + * * @param queryParam * @return */ @@ -316,7 +317,6 @@ public class SalaryArchiveWrapper extends Service { } - /** * 获取薪资档案详情表单 * @@ -438,15 +438,17 @@ public class SalaryArchiveWrapper extends Service { * @return */ public XSSFWorkbook downloadTemplate(SalaryArchiveQueryParam queryParam) { - if (queryParam.getListType() == null) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(109712, "列表类型必传")); - } else { - // 定薪列表导入有调薪导入和初始化导入 - if (queryParam.getListType().equals(SalaryArchiveListTypeEnum.FIXED.getValue())) { - Optional optional = Arrays.stream(SalaryArchiveImportTypeEnum.values()) - .filter(e -> StringUtils.isNotEmpty(queryParam.getImportType()) && e.getValue().equals(queryParam.getImportType())).findFirst(); - if (!optional.isPresent()) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100593, "导入类型不正确")); + if(!queryParam.isExtSalaryArchiveList()){ + if (queryParam.getListType() == null) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(109712, "列表类型必传")); + } else { + // 定薪列表导入有调薪导入和初始化导入 + if (queryParam.getListType().equals(SalaryArchiveListTypeEnum.FIXED.getValue())) { + Optional optional = Arrays.stream(SalaryArchiveImportTypeEnum.values()) + .filter(e -> StringUtils.isNotEmpty(queryParam.getImportType()) && e.getValue().equals(queryParam.getImportType())).findFirst(); + if (!optional.isPresent()) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100593, "导入类型不正确")); + } } } } From 8430397d033fce6109399977df0f64ad316ca819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 16 Mar 2023 16:10:29 +0800 Subject: [PATCH 22/86] =?UTF-8?q?=E5=A4=96=E9=83=A8=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E7=BB=88=E6=9E=81=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/entity/extemp/po/ExtEmpPO.java | 2 +- .../salaryBill/po/SalarySendInfoPO.java | 8 +++++ .../bo/SalaryArchiveExcelBO.java | 2 +- .../datacollection/UseEmployeeTypeEnum.java | 2 +- .../mapper/extemp/ExternalEmployeeMapper.xml | 1 - .../salaryacct/SalaryAcctEmployeeMapper.xml | 1 + .../salarybill/SalarySendInfoMapper.xml | 20 ++++++++---- .../salary/service/SalaryEmployeeService.java | 3 +- .../service/impl/ExtEmpServiceImpl.java | 2 +- .../service/impl/SIAccountServiceImpl.java | 5 +-- .../impl/SalaryArchiveExcelServiceImpl.java | 11 +++++-- .../impl/SalaryEmployeeServiceImpl.java | 31 ++++++++++++------- .../service/impl/SalarySendServiceImpl.java | 1 + .../impl/TaxAgentManageRangeServiceImpl.java | 17 +++++----- .../service/impl/TaxAgentServiceImpl.java | 2 +- 15 files changed, 72 insertions(+), 36 deletions(-) diff --git a/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java b/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java index 093f5eda3..3d67dea25 100644 --- a/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java +++ b/src/com/engine/salary/entity/extemp/po/ExtEmpPO.java @@ -47,7 +47,7 @@ public class ExtEmpPO { /** * 岗位 */ - @TableTitle(title = "岗位", dataIndex = "jobtitleName", key = "jobtitleName") +// @TableTitle(title = "岗位", dataIndex = "jobtitleName", key = "jobtitleName") private String jobtitleName; /** * 岗位ID diff --git a/src/com/engine/salary/entity/salaryBill/po/SalarySendInfoPO.java b/src/com/engine/salary/entity/salaryBill/po/SalarySendInfoPO.java index 15171f1e3..9687badc6 100644 --- a/src/com/engine/salary/entity/salaryBill/po/SalarySendInfoPO.java +++ b/src/com/engine/salary/entity/salaryBill/po/SalarySendInfoPO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.salaryBill.po; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -44,6 +45,13 @@ public class SalarySendInfoPO { */ private Long employeeId; + /** + * 人员类型,0或null组织架构,1非系统人员 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + /** * 人员信息表的主键id */ diff --git a/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveExcelBO.java b/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveExcelBO.java index 1ac1bc242..d70e63448 100644 --- a/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveExcelBO.java +++ b/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveExcelBO.java @@ -388,7 +388,7 @@ public class SalaryArchiveExcelBO extends Service { if (employeeId == null) { Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowindex + "人员存在重复数据,请确定姓名、部门、手机号唯一"); + errorMessageMap.put("message", rowindex + "查找人员失败,请确定姓名、部门、手机号正确且唯一"); excelComments.add(errorMessageMap); isError = true; return isError; diff --git a/src/com/engine/salary/enums/datacollection/UseEmployeeTypeEnum.java b/src/com/engine/salary/enums/datacollection/UseEmployeeTypeEnum.java index 09e31d614..64b0cdde2 100644 --- a/src/com/engine/salary/enums/datacollection/UseEmployeeTypeEnum.java +++ b/src/com/engine/salary/enums/datacollection/UseEmployeeTypeEnum.java @@ -17,7 +17,7 @@ public enum UseEmployeeTypeEnum implements BaseEnum { ORG(0, "组织架构", 109125), EXT(1, "非系统人员", 119127), - ALl(2, "所有人员", 119127), + ALL(2, "所有人员", 119127), ; private int value; diff --git a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml index 0a8ac06b9..9b34541e1 100644 --- a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml @@ -241,7 +241,6 @@ e.mobile, e.workcode from hrsa_external_employee e - left join hrmdepartment d on e.department_id = d.id @@ -59,7 +61,8 @@ create_time, update_time, tenant_key, - salary_acct_type + salary_acct_type, + employee_type ) VALUES @@ -75,7 +78,8 @@ #{item.createTime}, #{item.updateTime}, #{item.tenantKey}, - #{item.salaryAcctType} + #{item.salaryAcctType}, + #{item.employeeType} )
@@ -92,7 +96,8 @@ create_time, update_time, tenant_key, - salary_acct_type + salary_acct_type, + employee_type ) @@ -108,7 +113,8 @@ #{item.createTime,jdbcType=DATE}, #{item.updateTime,jdbcType=DATE}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.salaryAcctType,jdbcType=INTEGER} + #{item.salaryAcctType,jdbcType=INTEGER}, + #{item.employeeType,jdbcType=INTEGER} from dual @@ -126,7 +132,8 @@ create_time, update_time, tenant_key, - salary_acct_type + salary_acct_type, + employee_type ) VALUES ( @@ -141,7 +148,8 @@ #{item.createTime}, #{item.updateTime}, #{item.tenantKey}, - #{item.salaryAcctType} + #{item.salaryAcctType}, + #{item.employeeType} ) diff --git a/src/com/engine/salary/service/SalaryEmployeeService.java b/src/com/engine/salary/service/SalaryEmployeeService.java index eb7d56277..4ed715bf2 100644 --- a/src/com/engine/salary/service/SalaryEmployeeService.java +++ b/src/com/engine/salary/service/SalaryEmployeeService.java @@ -5,6 +5,7 @@ import com.engine.salary.entity.hrm.DeptInfo; import com.engine.salary.entity.hrm.PositionInfo; import com.engine.salary.entity.hrm.SubCompanyInfo; import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import java.util.List; @@ -23,7 +24,7 @@ public interface SalaryEmployeeService { * * @return */ - List listAll(); + List listAll(UseEmployeeTypeEnum empType); /** * 获取报表人员字段 diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java index 3499db754..19068bdda 100644 --- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -62,7 +62,7 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { BeanUtils.copyProperties(param, po); po.setId(IdGenerator.generate()); - po.setStatus("3"); + po.setStatus("1"); po.setCreator((long) user.getUID()); po.setModifier((long) user.getUID()); Date now = new Date(); diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 0e2cecded..e2a19ecbe 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -31,6 +31,7 @@ import com.engine.salary.entity.sicategory.po.ICategoryPO; import com.engine.salary.entity.sischeme.po.InsuranceSchemePO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.siaccount.*; import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.enums.sicategory.WelfareTypeEnum; @@ -1257,7 +1258,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getName, TaxAgentPO::getId); // 获取租户下所有的人员 - List salaryEmployees = getSalaryEmployeeService(user).listAll(); + List salaryEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ORG); // 失败的数量 int failCount = 0; @@ -1921,7 +1922,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } // 获取租户下所有的人员 - List salaryEmployees = getSalaryEmployeeService(user).listAll(); + List salaryEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ORG); // 失败的数量 int failCount = 0; diff --git a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java index 53c8fbb48..290e2cb21 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java @@ -17,6 +17,7 @@ import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.param.TaxAgentRangeSaveParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveImportTypeEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveListTypeEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum; @@ -38,6 +39,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import weaver.file.ImageFileManager; +import weaver.general.Util; import weaver.hrm.User; import java.io.InputStream; @@ -334,7 +336,7 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch // row.add(e.get("incomeCategory").toString()); // row.add(e.get("salarySob").toString()); // row.add(e.get("hiredate")); - row.add(e.get("departmentName")); + row.add(Util.null2String(e.get("departmentName"))); row.add(e.get("mobile") == null ? "" : e.get("mobile").toString()); row.add(Optional.ofNullable(e.get("jobNum")).orElse("").toString()); // if (enableHr) { @@ -687,6 +689,11 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch List salaryArchiveIds = salaryArchiveList.stream().map(SalaryArchivePO::getId).collect(Collectors.toList()); Map salaryArchivesMap = SalaryEntityUtil.convert2Map(salaryArchiveList, k -> k.getEmployeeId() + "-" + k.getTaxAgentId()); + UseEmployeeTypeEnum empType = UseEmployeeTypeEnum.ORG; + //外部人员导入 + if(param.isExtEmp()){ + empType = UseEmployeeTypeEnum.EXT; + } return SalaryArchiveImportHandleParam.builder() .isProcess(param.isProcess()) .description(param.getDescription()) @@ -709,7 +716,7 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch // 调薪导入 .isSalaryItemAdjust(isSalaryItemAdjust) // 获取租户下所有的人员 - .employees(getSalaryEmployeeService(user).listAll()) + .employees(getSalaryEmployeeService(user).listAll(empType)) // .hrmStatusList(hrmStatusList) // 获取所有个税扣缴义务人 .taxAgentList(taxAgentList) diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index 1f61ac4a6..26f73361c 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -13,6 +13,7 @@ import com.engine.salary.entity.salarysob.bo.SalarySobRangeBO; import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; import com.engine.salary.entity.salarysob.po.SalarySobRangePO; import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.service.ExtEmpService; import com.engine.salary.service.SalaryEmployeeService; @@ -61,9 +62,16 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee boolean openExtEmp = true; @Override - public List listAll() { - List result = employBiz.listEmployee(); - if(openExtEmp){ + public List listAll(UseEmployeeTypeEnum empType) { + List result = new ArrayList<>(); + if (empType == UseEmployeeTypeEnum.ORG) { + result = employBiz.listEmployee(); + } + if (empType == UseEmployeeTypeEnum.EXT) { + result = getExtEmpService(user).listEmployee(); + } + if (empType == UseEmployeeTypeEnum.ALL) { + result.addAll(employBiz.listEmployee()); result.addAll(getExtEmpService(user).listEmployee()); } return result; @@ -72,7 +80,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee @Override public List listAllForReport() { List result = employBiz.listAllForReport(); - if(openExtEmp){ + if (openExtEmp) { result.addAll(getExtEmpService(user).listAllForReport()); } return result; @@ -113,7 +121,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee //外部人员 List salarySobExtRangePOS = getSalarySobExtRangeService(user).listBySalarySobId(salarySobId); - if(CollectionUtils.isNotEmpty(salarySobExtRangePOS)){ + if (CollectionUtils.isNotEmpty(salarySobExtRangePOS)) { List ids = SalaryEntityUtil.properties(salarySobExtRangePOS, SalarySobExtRangePO::getTargetId, Collectors.toList()); List extEmps = getExtEmpService(user).getEmployeeByIds(ids); extEmps = extEmps.stream().distinct().collect(Collectors.toList()); @@ -127,7 +135,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee @Override public List getEmployeeByIdsAll(List ids) { List result = employBiz.getEmployeeByIdsAll(ids); - if(openExtEmp){ + if (openExtEmp) { result.addAll(getExtEmpService(user).getEmployeeByIdsAll(ids)); } return result; @@ -135,9 +143,9 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee @Override public DataCollectionEmployee getEmployeeById(Long employeeId) { - if(openExtEmp){ + if (openExtEmp) { DataCollectionEmployee employeeById = getExtEmpService(user).getEmployeeById(employeeId); - if(Objects.nonNull(employeeById)){ + if (Objects.nonNull(employeeById)) { return employeeById; } } @@ -153,7 +161,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee List> partition = Lists.partition(simpleEmployeeIds, 1000); for (List longs : partition) { employeeList.addAll(employBiz.getEmployeeByIds(longs)); - if(openExtEmp){ + if (openExtEmp) { employeeList.addAll(getExtEmpService(user).getEmployeeByIds(longs)); } } @@ -205,6 +213,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee /** * 人员定位方式 * “0”代表姓名+部门+手机号的匹配原则,“1”代表工号为唯一匹配原则 + * * @return */ @Override @@ -231,7 +240,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee @Override public List listEmployee() { List result = employBiz.listEmployee(); - if(openExtEmp){ + if (openExtEmp) { result.addAll(getExtEmpService(user).listEmployee()); } return result; @@ -240,7 +249,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee @Override public List listByParams(List includeQueryParams) { List result = employBiz.listByParams(includeQueryParams); - if(openExtEmp){ + if (openExtEmp) { result.addAll(getExtEmpService(user).listByParams(includeQueryParams)); } return result; diff --git a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java index 80cae1f54..701047481 100644 --- a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java @@ -286,6 +286,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService .id(IdGenerator.generate()) .salarySendId(salarySendId) .employeeId(m.getEmployeeId()) + .employeeType(m.getEmployeeType()) .salaryMonth(m.getSalaryMonth()) .taxAgentId(m.getTaxAgentId()) .salaryAcctRecordId(m.getSalaryAcctRecordId()) diff --git a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java index 332b433aa..4d8e1e8cf 100644 --- a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java @@ -18,6 +18,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentExtRangePO; import com.engine.salary.entity.taxagent.po.TaxAgentManageRangePO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum; import com.engine.salary.enums.salarysob.TargetTypeEnum; import com.engine.salary.enums.taxagent.TaxAgentRangeTypeEnum; @@ -326,7 +327,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM // 去重 allRanges = allRanges.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTaxAgentId() + "." + f.getRangeType() + "." + f.getTargetType() + "." + f.getTargetId() + "." + f.getEmployeeStatus() + "." + f.getIncludeType()))), ArrayList::new)); - List salaryEmployees = getSalaryEmployeeService(user).listAll(); + List salaryEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ORG); List allSalaryEmployees = this.getManageRangeSalaryEmployees(saveParam.getTaxAgentId(), allRanges, salaryEmployees); /* 检查当前个税扣缴义务人的所有人员范围与所有分管理员的管理范围===========================end */ @@ -435,14 +436,14 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM } private List listAllExtBytaxAgentId(Long taxAgentId) { - if(taxAgentId ==null){ + if (taxAgentId == null) { return new ArrayList<>(); } return getTaxAgentExtRangeMapper().listSome(TaxAgentExtRangePO.builder().taxAgentId(taxAgentId).build()); } private List listExtByIds(Collection targetIds) { - if(CollectionUtils.isEmpty(targetIds)){ + if (CollectionUtils.isEmpty(targetIds)) { return new ArrayList<>(); } return getTaxAgentExtRangeMapper().listSome(TaxAgentExtRangePO.builder().ids(targetIds).build()); @@ -528,7 +529,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM // List allSubAdminRanges = allManageRanges.stream().filter(f -> f.getRangeType().equals(TaxAgentRangeTypeEnum.SUBADMIN.getValue())).collect(Collectors.toList()); Long taxAgentId = taxAgentIds.get(0); - List salaryEmployees = getSalaryEmployeeService(user).listAll(); + List salaryEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ORG); List allSalaryEmployees = this.getManageRangeSalaryEmployees(taxAgentId, allRanges, salaryEmployees); // List allSubAdminSalaryEmployees = this.getManageRangeSalaryEmployees(taxAgentId, allSubAdminRanges, salaryEmployees); @@ -548,12 +549,12 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM @Override public PageInfo listExt(TaxAgentRangeExtQueryParam param) { - if(param.getTaxAgentId() == null){ + if (param.getTaxAgentId() == null) { throw new SalaryRunTimeException("扣缴义务人id为空"); } List taxAgentExtRangePOS = getTaxAgentExtRangeMapper().list(TaxAgentExtRangePO.builder().taxAgentId(param.getTaxAgentId()).build()); - return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(),taxAgentExtRangePOS,TaxAgentExtRangePO.class); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), taxAgentExtRangePOS, TaxAgentExtRangePO.class); } @Override @@ -578,7 +579,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM } taxAgentIds = allManageRanges.stream().map(TaxAgentManageRangePO::getTaxAgentId).distinct().collect(Collectors.toList()); // 获取所有人员 - List salaryEmployees = getSalaryEmployeeService(user).listAll(); + List salaryEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ORG); List taxAgentEmpSaveParamList = Lists.newArrayList(); List subAdminEmpSaveParamList = Lists.newArrayList(); @@ -852,7 +853,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM // 去重 allRanges = allRanges.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTaxAgentId() + "." + f.getRangeType() + "." + f.getTargetType() + "." + f.getTargetId() + "." + f.getEmployeeStatus() + "." + f.getIncludeType()))), ArrayList::new)); - List salaryEmployees = getSalaryEmployeeService(user).listAll(); + List salaryEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ORG); List allSalaryEmployees = this.getManageRangeSalaryEmployees(taxAgentId, allRanges, salaryEmployees); /* 检查当前个税扣缴义务人的所有人员范围与所有分管理员的管理范围===========================end */ diff --git a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java index e9c4d6749..b0019fb39 100644 --- a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java @@ -713,7 +713,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { */ private List getTaxAgentEmp(List allTaxAgents, List taxAgentIds, List allEmployees) { List taxAgentManageRangeEmployeeList = Lists.newArrayList(); - List taxAgentEmps = getTaxAgentEmpService(user).listByTaxAgentIds(taxAgentIds, UseEmployeeTypeEnum.ALl); + List taxAgentEmps = getTaxAgentEmpService(user).listByTaxAgentIds(taxAgentIds, UseEmployeeTypeEnum.ALL); taxAgentEmps = taxAgentEmps.stream().filter(f -> allEmployees.stream().anyMatch(e -> e.getEmployeeId().equals(f.getEmployeeId()))).collect(Collectors.toList()); From f79569fe4f30715f0cfb42bf3d3f8aab754c3389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 16 Mar 2023 17:19:02 +0800 Subject: [PATCH 23/86] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=B7=A5=E8=B5=84?= =?UTF-8?q?=E5=8D=95=E4=BA=BA=E5=90=8D=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/salaryBill/dto/SalarySendInfoListDTO.java | 9 +++++++++ .../salary/mapper/extemp/ExternalEmployeeMapper.xml | 1 + .../salary/mapper/salarybill/SalarySendInfoMapper.xml | 1 + 3 files changed, 11 insertions(+) diff --git a/src/com/engine/salary/entity/salaryBill/dto/SalarySendInfoListDTO.java b/src/com/engine/salary/entity/salaryBill/dto/SalarySendInfoListDTO.java index 89bde7d45..52f197bbf 100644 --- a/src/com/engine/salary/entity/salaryBill/dto/SalarySendInfoListDTO.java +++ b/src/com/engine/salary/entity/salaryBill/dto/SalarySendInfoListDTO.java @@ -1,6 +1,7 @@ package com.engine.salary.entity.salaryBill.dto; import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.AllArgsConstructor; @@ -48,4 +49,12 @@ public class SalarySendInfoListDTO { private String sendStatus; + /** + * 人员类型,0或null组织架构,1非系统人员 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + } diff --git a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml index 9b34541e1..0a8ac06b9 100644 --- a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml @@ -241,6 +241,7 @@ e.mobile, e.workcode from hrsa_external_employee e + left join hrmdepartment d on e.department_id = d.id SELECT - a.bill_month billmonth,c.tax_cycle taxcycle + a.bill_month billmonth,c.tax_cycle taxcycle, c.salary_month salaryMonth, b.social_security_cycle_type socialSecurityCycleType FROM hrsa_bill_batch a,hrsa_salary_sob b,hrsa_salary_acct_record c WHERE diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 4db81131b..5181b615e 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -1267,11 +1267,11 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { @Override public void socialSecurityBenefitsRecalculate(InsuranceAccountBatchPO param) { //fixme 重新核算的校验逻辑 1、先取台账对应扣缴义务人下的所有账套 2、取账套下所有核算记录 3、判断核算记录有没有使用对应月份的福利台账 -// int num = getSiAccountBiz(user).checkIfBusinessaccounting(param); -// //表示已经被核算过不能重新核算 -// if (num > 0) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98831, "已被薪酬核算给核算过,无法重新核算!")); -// } + int num = getSiAccountBiz(user).checkIfBusinessaccounting(param); + //表示已经被核算过不能重新核算 + if (num > 0) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "已被薪酬核算给核算过,无法重新核算!")); + } param.setBillStatus(0); getSiAccountBiz(user).updateById(param); } From 89ecf0984daef27448208f2be6ba329f5c7cedb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 12 Jul 2023 09:45:00 +0800 Subject: [PATCH 35/86] =?UTF-8?q?fix=E5=A4=96=E9=83=A8=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/EmployBiz.java | 18 ------------ src/com/engine/salary/biz/SIAccountBiz.java | 2 -- .../SalaryStatisticsEmployeeServiceImpl.java | 3 +- .../salary/service/TaxAgentService.java | 8 +++++- .../impl/AddUpDeductionServiceImpl.java | 2 -- .../impl/SalaryArchiveExcelServiceImpl.java | 4 ++- .../impl/SalaryEmployeeServiceImpl.java | 7 +++++ .../impl/TaxAgentManageRangeServiceImpl.java | 5 ++-- .../service/impl/TaxAgentServiceImpl.java | 9 ++++++ .../salary/web/SalarySobController.java | 28 ++++++++++++++++++- 10 files changed, 58 insertions(+), 28 deletions(-) diff --git a/src/com/engine/salary/biz/EmployBiz.java b/src/com/engine/salary/biz/EmployBiz.java index beb8c4741..cc412c210 100644 --- a/src/com/engine/salary/biz/EmployBiz.java +++ b/src/com/engine/salary/biz/EmployBiz.java @@ -80,24 +80,6 @@ public class EmployBiz extends BaseBean { } } - public List getAdminEmployeeByIds(List list) { - if (CollectionUtils.isEmpty(list)) { - return new ArrayList<>(); - } - SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); - try { - EmployMapper mapper = sqlSession.getMapper(EmployMapper.class); - List employeeList = Lists.newArrayList(); - List> partition = Lists.partition(list, 1000); - for (List longs : partition) { - employeeList.addAll(mapper.getAdminEmployeeByIds(longs)); - } - return employeeList; - } finally { - sqlSession.close(); - } - } - /** * 岗位信息 diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index e70a1d972..9b15eff0f 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -9,9 +9,7 @@ import com.engine.salary.cache.SalaryCacheKey; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.encrypt.AESEncryptUtil; import com.engine.salary.encrypt.EncryptUtil; -import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.progress.ProgressDTO; -import com.engine.salary.entity.salaryacct.dto.SalaryAcctProgressDTO; import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO; import com.engine.salary.entity.siaccount.dto.SIAccountUtilDTO; import com.engine.salary.entity.siaccount.param.*; diff --git a/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java b/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java index 926faa3cb..c8ae9e9c5 100644 --- a/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java +++ b/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java @@ -10,6 +10,7 @@ import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.mapper.salaryacct.SalaryAcctEmployeeMapper; import com.engine.salary.report.common.constant.SalaryConstant; import com.engine.salary.report.entity.bo.SalaryStatisticsEmployeeBO; @@ -138,7 +139,7 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala // .collect(Collectors.toSet()); // } if (CollectionUtils.isNotEmpty(innerEmployeeIds)) { - List salaryEmployees = getSalaryEmployeeService(user).listAll(); + List salaryEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL); Set finalInnerEmployeeIds = innerEmployeeIds; innerEmployeeIds = salaryEmployees.stream() .filter(e -> finalInnerEmployeeIds.contains(e.getEmployeeId()) && (e.getUsername().contains(queryParam.getKeyword()) || (StringUtils.isNotEmpty(e.getWorkcode()) && e.getWorkcode().contains(queryParam.getKeyword())))) diff --git a/src/com/engine/salary/service/TaxAgentService.java b/src/com/engine/salary/service/TaxAgentService.java index 3794d51c8..2890f94b8 100644 --- a/src/com/engine/salary/service/TaxAgentService.java +++ b/src/com/engine/salary/service/TaxAgentService.java @@ -243,5 +243,11 @@ public interface TaxAgentService { Boolean adminChangeCheck(TaxAgentAdminChangeCheckParam checkParam); - + /** + * 获取个税扣缴义务人下的人员范围 + * + * @param taxAgentId + * @return + */ + Collection listEmployeeIdsInTaxAgent(Long taxAgentId); } diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index b77e25aaa..bb0242cf4 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -670,8 +670,6 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction List accountedEmployeeData = getAccountedEmployeeData(DateUtil.format(yearMonth, "yyyy-MM")); for (TaxAgentPO taxAgent : taxAgents) { - Collection employeeIds = getTaxAgentService(user) - .listEmployeeIdsInTaxAgent(taxAgent.getId()); List employeePOs = getSpecialAddDeductionService(user) .getSpecialAddDeductionPOByEmployee(null, taxAgent.getId()); diff --git a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java index 3c9c0b931..978563ab8 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java @@ -14,6 +14,7 @@ import com.engine.salary.entity.salaryarchive.param.SalaryArchiveQueryParam; import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.param.TaxAgentRangeSaveParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; @@ -23,6 +24,7 @@ import com.engine.salary.enums.salaryarchive.SalaryArchiveListTypeEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum; import com.engine.salary.mapper.archive.SalaryArchiveMapper; import com.engine.salary.service.*; +import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.SalaryEntityUtil; @@ -620,7 +622,7 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch map = data.get(i); map.put("index", i + 2); // 3.校验行内容 - boolean isError = SalaryArchiveExcelBO.singleRowCheck(allTodoSalaryArchives, map, headers, effectiveTimeIndex, excelComments, errorCount, importHandleParam, confValue); + boolean isError = SalaryArchiveExcelBO.singleRowCheck(allTodoSalaryArchives, map, headers, effectiveTimeIndex, excelComments, errorCount, importHandleParam); if (isError) { errorCount += 1; // 添加错误数据 diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index f93b44837..35ab6fb5b 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -14,6 +14,7 @@ import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; import com.engine.salary.entity.salarysob.po.SalarySobRangePO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; +import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.service.ExtEmpService; import com.engine.salary.service.SalaryEmployeeService; @@ -21,6 +22,7 @@ import com.engine.salary.service.SalarySobExtRangeService; import com.engine.salary.service.SalarySobRangeService; import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.db.MapperProxyFactory; import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -59,6 +61,11 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee return ServiceUtil.getService(ExtEmpServiceImpl.class, user); } + + private SalarySobExtRangeService getSalarySobExtRangeService(User user) { + return ServiceUtil.getService(SalarySobExtRangeServiceImpl.class, user); + } + boolean openExtEmp = true; @Override diff --git a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java index b3e7785e8..06cdeb04f 100644 --- a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java @@ -4,6 +4,7 @@ import com.api.formmode.mybatis.util.SqlProxyHandle; import com.cloudstore.dev.api.util.Util_DataCache; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.hrm.DeptInfo; import com.engine.salary.entity.hrm.HrmStatus; @@ -325,7 +326,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM // 去重 allRanges = allRanges.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTaxAgentId() + "." + f.getRangeType() + "." + f.getTargetType() + "." + f.getTargetId() + "." + f.getEmployeeStatus() + "." + f.getIncludeType()))), ArrayList::new)); - List salaryEmployees = getEmployMapper().listAll(); + List salaryEmployees = getSalaryEmployeeService().listAll(UseEmployeeTypeEnum.ALL); List allSalaryEmployees = this.getManageRangeSalaryEmployees(saveParam.getTaxAgentId(), allRanges, salaryEmployees); /* 检查当前个税扣缴义务人的所有人员范围与所有分管理员的管理范围===========================end */ @@ -859,7 +860,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM // 去重 allRanges = allRanges.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTaxAgentId() + "." + f.getRangeType() + "." + f.getTargetType() + "." + f.getTargetId() + "." + f.getEmployeeStatus() + "." + f.getIncludeType()))), ArrayList::new)); - List salaryEmployees = getEmployMapper().listAll(); + List salaryEmployees = getSalaryEmployeeService().listAll(UseEmployeeTypeEnum.ALL); List allSalaryEmployees = this.getManageRangeSalaryEmployees(taxAgentId, allRanges, salaryEmployees); /* 检查当前个税扣缴义务人的所有人员范围与所有分管理员的管理范围===========================end */ diff --git a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java index b0019fb39..cf118a036 100644 --- a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java @@ -33,6 +33,7 @@ import com.engine.salary.mapper.datacollection.OtherDeductionMapper; import com.engine.salary.mapper.salarysob.SalarySobMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.*; +import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; @@ -765,4 +766,12 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { return taxAgentEmployeeList; } + @Override + public Collection listEmployeeIdsInTaxAgent(Long taxAgentId) { + List taxAgentEmpPOS = getTaxAgentEmpService(user).listByTaxAgentIds(Collections.singletonList(taxAgentId),UseEmployeeTypeEnum.ALL); + + return SalaryEntityUtil.properties(taxAgentEmpPOS, TaxAgentEmpPO::getEmployeeId); + } + + } diff --git a/src/com/engine/salary/web/SalarySobController.java b/src/com/engine/salary/web/SalarySobController.java index 708886864..840e1bc33 100644 --- a/src/com/engine/salary/web/SalarySobController.java +++ b/src/com/engine/salary/web/SalarySobController.java @@ -2,7 +2,6 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; import com.engine.salary.entity.SalarySobExtRangePO; -import com.engine.salary.entity.salaryitem.dto.SalaryItemListDTO; import com.engine.salary.entity.salaryitem.dto.SalaryItemSobListDTO; import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam; import com.engine.salary.entity.salarysob.dto.*; @@ -184,6 +183,33 @@ public class SalarySobController { // return WeaResult.success(weaForm); // } + @POST + @Path("/ext/save") + @Produces(MediaType.APPLICATION_JSON) + public String saveSalarySobExtRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobRangeExtSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalarySobRangeWrapper(user)::saveExtRange, saveParam); + } + + @POST + @Path("/range/ext/list") + @Produces(MediaType.APPLICATION_JSON) + public String listPage4Ext(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobRangeQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalarySobRangeWrapper(user)::listPage4Ext, queryParam); + } + + /** + * 删除薪资账套人员范围 + */ + @POST + @Path("/range/ext/delete") + @Produces(MediaType.APPLICATION_JSON) + public String deleteSalarySobExtRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection ids) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult, String>(user).run(getSalarySobRangeWrapper(user)::deleteSalarySobExtRange, ids); + } + /** * 保存薪资账套人员范围 */ From 58fe219cdb3509d2a8897e350c890ed159d3a27e Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Wed, 12 Jul 2023 11:25:44 +0800 Subject: [PATCH 36/86] =?UTF-8?q?fix=20=E5=B7=A5=E8=B5=84=E5=8D=95?= =?UTF-8?q?=E5=8F=8D=E9=A6=88bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salarybill/BillConfimStatusEnum.java | 2 +- .../salarybill/SalarySendInfoMapper.xml | 11 ++++--- .../service/impl/SalarySendServiceImpl.java | 32 +++++++++++++------ 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/com/engine/salary/enums/salarybill/BillConfimStatusEnum.java b/src/com/engine/salary/enums/salarybill/BillConfimStatusEnum.java index 112c86034..89ca4e758 100644 --- a/src/com/engine/salary/enums/salarybill/BillConfimStatusEnum.java +++ b/src/com/engine/salary/enums/salarybill/BillConfimStatusEnum.java @@ -14,7 +14,7 @@ public enum BillConfimStatusEnum implements BaseEnum { UNCONFIRMED(0, "未确认", 93286), CONFIRMED(1, "已确认", 93212), - AUTOCONFIRMED(3, "自动确认", 93212); + AUTOCONFIRMED(2, "自动确认", 93212); private final int value; diff --git a/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml b/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml index e7f192a15..506afd10c 100644 --- a/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml +++ b/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml @@ -614,13 +614,16 @@ delete_type = #{po.deleteType}, - salary_template = #{po.salaryTemplate} + salary_template = #{po.salaryTemplate}, - bill_read_status = #{po.billReadStatus} + bill_read_status = #{po.billReadStatus}, - bill_confirm_status = #{po.billConfirmStatus} + bill_confirm_status = #{po.billConfirmStatus}, + + + send_employee_id = #{po.sendEmployeeId} @@ -771,7 +774,7 @@ UPDATE hrsa_salary_send_info set - confirm_status = 2 + bill_confirm_status = 2 where delete_type = 0 diff --git a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java index 93cc03be8..b0da29ed7 100644 --- a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java @@ -482,10 +482,13 @@ public class SalarySendServiceImpl extends Service implements SalarySendService } SalarySendInfoPO salarySendInfo = salarySendInfos.get(0); // 更新查看状态 - if(salarySendInfo.getBillReadStatus() == null || NumberUtils.compare(salarySendInfo.getBillReadStatus(),BillReadStatusEnum.UNREAD.getValue()) == 0 ){ - salarySendInfo.setBillReadStatus(BillReadStatusEnum.READED.getValue()); - salarySendInfo.setUpdateTime(new Date()); - getSalarySendInfoMapper().updateIgnoreNull(salarySendInfo); + SalarySysConfPO feedbackPO = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_SEND_FEEDBACK); + if (feedbackPO != null && StringUtils.equals(feedbackPO.getConfValue(),"1")){ + if(salarySendInfo.getBillReadStatus() == null || NumberUtils.compare(salarySendInfo.getBillReadStatus(),BillReadStatusEnum.UNREAD.getValue()) == 0 ){ + salarySendInfo.setBillReadStatus(BillReadStatusEnum.READED.getValue()); + salarySendInfo.setUpdateTime(new Date()); + getSalarySendInfoMapper().updateIgnoreNull(salarySendInfo); + } } // List salarySends = new LambdaQueryChainWrapper<>(mapper) // .eq(SalarySendPO::getDeleteType, 0) @@ -611,11 +614,16 @@ public class SalarySendServiceImpl extends Service implements SalarySendService map.put("salaryTemplate", salaryTemplate); map.put("salaryAcctResult", salaryAcctResultS); // 工资单发送人、是否已确认 - map.put("confirmStatus", salarySendInfo.getBillConfirmStatus() == null ? "0" : salarySendInfo.getBillConfirmStatus().toString()); - map.put("sendEmployeeId", salarySendInfo.getSalarySendId()); - BaseBean baseBean = new BaseBean(); - String workFlowId = baseBean.getPropValue("hrmSalary", "feedbackWorkflowId"); - map.put("feedbackWorkflowId",workFlowId); + if (feedbackPO != null && StringUtils.equals(feedbackPO.getConfValue(),"1")){ + map.put("confirmStatus", salarySendInfo.getBillConfirmStatus() == null ? "0" : salarySendInfo.getBillConfirmStatus().toString()); + map.put("sendEmployeeId", salarySendInfo.getSalarySendId()); + BaseBean baseBean = new BaseBean(); + String workFlowId = baseBean.getPropValue("hrmSalary", "feedbackWorkflowId"); + map.put("feedbackWorkflowId",workFlowId); + }else{ + map.put("confirmStatus", "1"); + } + return map; } @@ -1616,7 +1624,11 @@ public class SalarySendServiceImpl extends Service implements SalarySendService @Override public List listAllUnConfirmedSendInfo() { - return getSalarySendInfoMapper().listSome(SalarySendInfoPO.builder().billConfirmStatus(BillConfimStatusEnum.UNCONFIRMED.getValue()).build()); + return getSalarySendInfoMapper().listSome( + SalarySendInfoPO.builder() + .billConfirmStatus(BillConfimStatusEnum.UNCONFIRMED.getValue()) + .sendStatus(1) + .build()); } @Override From 820d15d06faca7296e6d80057076ee5f48cac406 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Wed, 12 Jul 2023 15:17:59 +0800 Subject: [PATCH 37/86] =?UTF-8?q?=E5=B7=A5=E8=B5=84=E5=8D=95=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salaryBill/dto/SalaryBaseSetFormDTO.java | 7 +- .../dto/SalaryBillAckFeedbackDTO.java | 35 ++++++++++ .../param/SalaryBaseSetSaveParam.java | 19 ++--- .../mapper/sys/SalarySysConfMapper.java | 3 + .../salary/mapper/sys/SalarySysConfMapper.xml | 13 ++++ .../service/SalaryBillBaseSetService.java | 9 ++- .../impl/SalaryBillBaseSetServiceImpl.java | 69 +++++++++++++------ .../sys/constant/SalarySysConstant.java | 8 ++- .../sys/service/SalarySysConfService.java | 16 +++++ .../impl/SalarySysConfServiceImpl.java | 11 ++- .../timer/AutoConfirmSalaryBillCronJob.java | 2 +- .../wrapper/SalaryBillBaseSetWrapper.java | 13 ++-- 12 files changed, 156 insertions(+), 49 deletions(-) create mode 100644 src/com/engine/salary/entity/salaryBill/dto/SalaryBillAckFeedbackDTO.java diff --git a/src/com/engine/salary/entity/salaryBill/dto/SalaryBaseSetFormDTO.java b/src/com/engine/salary/entity/salaryBill/dto/SalaryBaseSetFormDTO.java index 020e858cb..5bc07f1e1 100644 --- a/src/com/engine/salary/entity/salaryBill/dto/SalaryBaseSetFormDTO.java +++ b/src/com/engine/salary/entity/salaryBill/dto/SalaryBaseSetFormDTO.java @@ -29,10 +29,7 @@ public class SalaryBaseSetFormDTO { // 水印设置 private Object watermarkSetting; - // 签名确认 - private Boolean ackStatus; - - // 员工反馈 - private Boolean feedbackStatus; + // 工资单反馈设置 + private SalaryBillAckFeedbackDTO ackFeedbackSetting; } diff --git a/src/com/engine/salary/entity/salaryBill/dto/SalaryBillAckFeedbackDTO.java b/src/com/engine/salary/entity/salaryBill/dto/SalaryBillAckFeedbackDTO.java new file mode 100644 index 000000000..340e97387 --- /dev/null +++ b/src/com/engine/salary/entity/salaryBill/dto/SalaryBillAckFeedbackDTO.java @@ -0,0 +1,35 @@ +package com.engine.salary.entity.salaryBill.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author Harryxzy + * @ClassName SalaryBillAckFeedbackDTO + * @date 2023/07/12 13:46 + * @description 工资单确认和反馈DTO + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SalaryBillAckFeedbackDTO { + + /** + * 工资单确认反馈是否开启。0:否,1:是 + */ + private String ackStatus; + + /** + * 反馈地址 + */ + private String feedBackUrl; + + /** + * 超时自动确认天数 + */ + private Integer autoAckDays; + +} diff --git a/src/com/engine/salary/entity/salaryBill/param/SalaryBaseSetSaveParam.java b/src/com/engine/salary/entity/salaryBill/param/SalaryBaseSetSaveParam.java index a08ddf83e..4716f9958 100644 --- a/src/com/engine/salary/entity/salaryBill/param/SalaryBaseSetSaveParam.java +++ b/src/com/engine/salary/entity/salaryBill/param/SalaryBaseSetSaveParam.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.salaryBill.param; +import com.engine.salary.entity.salaryBill.dto.SalaryBillAckFeedbackDTO; import com.engine.salary.enums.salarybill.SalaryTemplateWatermarkTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.util.SalaryI18nUtil; @@ -7,6 +8,7 @@ import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import org.apache.commons.lang3.StringUtils; import java.util.Map; import java.util.Objects; @@ -32,11 +34,8 @@ public class SalaryBaseSetSaveParam { // 自定义设置内容") private Map wmSetting; - // 是否启用确认") - private Boolean ackStatus; - - // 是否启用反馈") - private Boolean feedbackStatus; + // 工资单确认反馈设置 + private SalaryBillAckFeedbackDTO ackFeedbackSetting; public static void checkParam(SalaryBaseSetSaveParam saveParam) { if (Objects.isNull(saveParam.getWatermarkStatus())) { @@ -51,14 +50,10 @@ public class SalaryBaseSetSaveParam { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(220419, "自定义水印的设置内容必传")); } } + if (Objects.isNull(saveParam.getAckFeedbackSetting()) || StringUtils.isBlank(saveParam.getAckFeedbackSetting().getAckStatus())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(220418, "工资单确认反馈信息必传")); + } -// if (Objects.isNull(saveParam.getAckStatus())) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 222645, "是否启用确认必传")); -// } -// -// if (Objects.isNull(saveParam.getFeedbackStatus())) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 222646, "是否启用反馈必传")); -// } } } diff --git a/src/com/engine/salary/mapper/sys/SalarySysConfMapper.java b/src/com/engine/salary/mapper/sys/SalarySysConfMapper.java index 36e3a4d37..88f07ce7f 100644 --- a/src/com/engine/salary/mapper/sys/SalarySysConfMapper.java +++ b/src/com/engine/salary/mapper/sys/SalarySysConfMapper.java @@ -1,6 +1,7 @@ package com.engine.salary.mapper.sys; import com.engine.salary.sys.entity.po.SalarySysConfPO; +import org.apache.ibatis.annotations.Param; import java.util.Date; import java.util.List; @@ -73,4 +74,6 @@ public interface SalarySysConfMapper { * @date 2022/11/9 21:09 */ Date getTaxDeclarationRebootDate(); + + List getListByCodes(@Param("codes") List codes); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/sys/SalarySysConfMapper.xml b/src/com/engine/salary/mapper/sys/SalarySysConfMapper.xml index 3d0c299c4..a30c8e822 100644 --- a/src/com/engine/salary/mapper/sys/SalarySysConfMapper.xml +++ b/src/com/engine/salary/mapper/sys/SalarySysConfMapper.xml @@ -237,4 +237,17 @@ select update_time from HRSA_SALARY_SYS_CONF WHERE conf_key = 'taxDeclarationFunction' + + \ No newline at end of file diff --git a/src/com/engine/salary/service/SalaryBillBaseSetService.java b/src/com/engine/salary/service/SalaryBillBaseSetService.java index 42a2b5f45..4ea8ef0a6 100644 --- a/src/com/engine/salary/service/SalaryBillBaseSetService.java +++ b/src/com/engine/salary/service/SalaryBillBaseSetService.java @@ -1,5 +1,6 @@ package com.engine.salary.service; +import com.engine.salary.entity.salaryBill.dto.SalaryBillAckFeedbackDTO; import com.engine.salary.entity.salaryBill.dto.SalaryBillWatermarkDTO; import com.engine.salary.entity.salaryBill.param.SalaryBaseSetSaveParam; @@ -28,7 +29,7 @@ public interface SalaryBillBaseSetService { // SalaryBillAckFeedbackDTO getAckFeedbackSetting(); /** - * 保存工资单水印设置 + * 保存工资单模板基础设置 * * @param saveParam * @return @@ -41,4 +42,10 @@ public interface SalaryBillBaseSetService { * @return */ String previewWaterMark(Map wmSetting); + + /** + * 获取默认工资单确认反馈设置 + * @return + */ + SalaryBillAckFeedbackDTO getDefaultAckFeedbackSetting(); } diff --git a/src/com/engine/salary/service/impl/SalaryBillBaseSetServiceImpl.java b/src/com/engine/salary/service/impl/SalaryBillBaseSetServiceImpl.java index 28d96c728..476717d7c 100644 --- a/src/com/engine/salary/service/impl/SalaryBillBaseSetServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryBillBaseSetServiceImpl.java @@ -6,6 +6,7 @@ import com.engine.core.impl.Service; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryBill.bo.SalaryBillBO; +import com.engine.salary.entity.salaryBill.dto.SalaryBillAckFeedbackDTO; import com.engine.salary.entity.salaryBill.dto.SalaryBillWatermarkDTO; import com.engine.salary.entity.salaryBill.param.SalaryBaseSetSaveParam; import com.engine.salary.entity.salaryBill.po.SalaryBillWatermarkPO; @@ -13,7 +14,12 @@ import com.engine.salary.enums.salarybill.SalaryTemplateWatermarkTypeEnum; import com.engine.salary.service.SalaryBillBaseSetService; import com.engine.salary.service.SalaryBillWatermarkService; import com.engine.salary.service.SalaryEmployeeService; +import com.engine.salary.sys.constant.SalarySysConstant; +import com.engine.salary.sys.entity.po.SalarySysConfPO; +import com.engine.salary.sys.service.SalarySysConfService; +import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.JsonUtil; +import com.engine.salary.util.SalaryEntityUtil; import com.google.common.collect.Lists; import dm.jdbc.util.IdGenerator; import org.apache.commons.collections.CollectionUtils; @@ -21,10 +27,9 @@ import org.apache.commons.lang.math.NumberUtils; import org.apache.commons.lang3.StringUtils; import weaver.hrm.User; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; + +import static com.engine.salary.sys.constant.SalarySysConstant.*; /** * @Description: 工资单水印 @@ -42,6 +47,10 @@ public class SalaryBillBaseSetServiceImpl extends Service implements SalaryBillB return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + public SalarySysConfService getSalarySysConfService(User user) { + return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); + } + @Override public SalaryBillWatermarkDTO getWatermarkSetting() { List list = getSalaryBillWatermarkService(user).listAll(); @@ -96,23 +105,16 @@ public class SalaryBillBaseSetServiceImpl extends Service implements SalaryBillB .build()); -// // 工资单确认和反馈 =========================================================== -// new LambdaUpdateChainWrapper<>(salaryBillAckFeedbackMapper) -// .eq(SalaryBillAckFeedbackPO::getDeleteType, 0) -// .eq(SalaryBillAckFeedbackPO::getTenantKey, tenantKey) -// .set(SalaryBillAckFeedbackPO::getDeleteType, 3) -// .update(); -// salaryBillAckFeedbackMapper.insert(SalaryBillAckFeedbackPO.builder() -// .id(IdGenerator.generate()) -// .ackStatus(saveParam.getAckStatus() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO) -// .feedbackStatus(saveParam.getFeedbackStatus() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO) -// .createTime(now) -// .updateTime(now) -// .creator(employeeId) -// .deleteType(NumberUtils.INTEGER_ZERO) -// .tenantKey(tenantKey) -// .build()); - + // 工资单确认和反馈 =========================================================== + SalaryBillAckFeedbackDTO ackFeedbackSetting = saveParam.getAckFeedbackSetting(); + // 1.保存确认反馈开关状态 + getSalarySysConfService(user).saveSettingByType(ackFeedbackSetting.getAckStatus(), SALARY_SEND_FEEDBACK, "工资单确认反馈状态", "billSend"); + if(StringUtils.equals(ackFeedbackSetting.getAckStatus(),"1")){ + // 2.保存反馈地址 + getSalarySysConfService(user).saveSettingByType(ackFeedbackSetting.getFeedBackUrl(), SALARY_FEEDBACK_URL, "工资单反馈地址", "billSend"); + // 3.保存自动确认时间 + getSalarySysConfService(user).saveSettingByType(ackFeedbackSetting.getAutoAckDays().toString(), SALARY_AUTO_ACK_DAYS, "工资单反馈自动确认", "billSend"); + } return StringUtils.EMPTY; } @@ -126,4 +128,29 @@ public class SalaryBillBaseSetServiceImpl extends Service implements SalaryBillB DataCollectionEmployee simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(Long.valueOf(user.getUID())); return SalaryBillBO.handleWmText(wmText, wmTextFieldIds, simpleEmployee); } + + @Override + public SalaryBillAckFeedbackDTO getDefaultAckFeedbackSetting() { + // 获取反馈开启状态、自动确认时长、反馈地址 + List codes = Arrays.asList(SalarySysConstant.SALARY_SEND_FEEDBACK, SalarySysConstant.SALARY_AUTO_ACK_DAYS, SalarySysConstant.SALARY_FEEDBACK_URL); + List sysConfList= getSalarySysConfService(user).getListByCodes(codes); + Map sysConfMap = SalaryEntityUtil.convert2Map(sysConfList, SalarySysConfPO::getConfKey, SalarySysConfPO::getConfValue); + + SalaryBillAckFeedbackDTO defaultAckFeedBackDTO = SalaryBillAckFeedbackDTO.builder().build(); + String ackStatus = sysConfMap.getOrDefault(SalarySysConstant.SALARY_SEND_FEEDBACK, "0"); + if (StringUtils.equals(ackStatus,"0")) { + // 未开启工资单确认 + defaultAckFeedBackDTO.setAckStatus("0"); + defaultAckFeedBackDTO.setAutoAckDays(0); + return defaultAckFeedBackDTO; + } + defaultAckFeedBackDTO.setAckStatus(ackStatus); + // 获取超时自动确认时间 + Integer autoAckDays = Integer.valueOf(sysConfMap.getOrDefault(SalarySysConstant.SALARY_AUTO_ACK_DAYS, "7")); + defaultAckFeedBackDTO.setAutoAckDays(autoAckDays); + // 反馈地址 + String feedbackUrl = sysConfMap.getOrDefault(SalarySysConstant.SALARY_FEEDBACK_URL, ""); + defaultAckFeedBackDTO.setFeedBackUrl(feedbackUrl); + return defaultAckFeedBackDTO; + } } diff --git a/src/com/engine/salary/sys/constant/SalarySysConstant.java b/src/com/engine/salary/sys/constant/SalarySysConstant.java index fca545078..b6d49d941 100644 --- a/src/com/engine/salary/sys/constant/SalarySysConstant.java +++ b/src/com/engine/salary/sys/constant/SalarySysConstant.java @@ -82,13 +82,17 @@ public class SalarySysConstant { public static final String SALARY_ARCHIVE_DELETE = "salaryArchiveDelete"; /** - * 工资单反馈 + * 工资单确认反馈状态 */ public static final String SALARY_SEND_FEEDBACK = "SALARY_SEND_FEEDBACK"; /** * 工资单反馈自动确认 */ - public static final String SALARY_AUTO_CONFIRM = "SALARY_AUTO_CONFIRM"; + public static final String SALARY_AUTO_ACK_DAYS = "SALARY_AUTO_ACK_DAYS"; + /** + * 工资单反馈地址 + */ + public static final String SALARY_FEEDBACK_URL = "SALARY_FEEDBACK_URL"; } diff --git a/src/com/engine/salary/sys/service/SalarySysConfService.java b/src/com/engine/salary/sys/service/SalarySysConfService.java index 2e62f7401..e92637840 100644 --- a/src/com/engine/salary/sys/service/SalarySysConfService.java +++ b/src/com/engine/salary/sys/service/SalarySysConfService.java @@ -114,4 +114,20 @@ public interface SalarySysConfService { * @param param */ void saveSalarySendFeedback(SalarySysConfPO param); + + /** + * 根据code返回list + * @param codes + * @return + */ + List getListByCodes(List codes); + + /** + * 保存或者修改应用设置 + * @param confValue + * @param confKey + * @param title + * @param app + */ + void saveSettingByType(String confValue, String confKey, String title, String app); } diff --git a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java index bf3a6afd4..eb0001d40 100644 --- a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java +++ b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java @@ -440,6 +440,14 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe saveSettingByType(param.getConfValue(), SALARY_SEND_FEEDBACK, "工资单反馈", "basic"); } + @Override + public List getListByCodes(List codes) { + if(CollectionUtils.isEmpty(codes)){ + return Collections.emptyList(); + } + return getSalarySysConfMapper().getListByCodes(codes); + } + /** * 保存或者修改应用设置 * @@ -448,7 +456,8 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe * @param title * @param app */ - private void saveSettingByType(String confValue, String confKey, String title, String app) { + @Override + public void saveSettingByType(String confValue, String confKey, String title, String app) { SalarySysConfPO po = getOneByCode(confKey); if (po == null) { SalarySysConfPO build = SalarySysConfPO.builder() diff --git a/src/com/engine/salary/timer/AutoConfirmSalaryBillCronJob.java b/src/com/engine/salary/timer/AutoConfirmSalaryBillCronJob.java index af2128b8f..79abafde8 100644 --- a/src/com/engine/salary/timer/AutoConfirmSalaryBillCronJob.java +++ b/src/com/engine/salary/timer/AutoConfirmSalaryBillCronJob.java @@ -45,7 +45,7 @@ public class AutoConfirmSalaryBillCronJob extends BaseCronJob { if(ObjectUtils.isEmpty(feedbackPO) || StringUtils.equals(feedbackPO.getConfValue(), "0")){ return; } - SalarySysConfPO salaryAutoConfirmPO = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_AUTO_CONFIRM); + SalarySysConfPO salaryAutoConfirmPO = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_AUTO_ACK_DAYS); Long timeOutDays = ObjectUtils.isNotEmpty(salaryAutoConfirmPO) && NumberUtils.isCreatable(salaryAutoConfirmPO.getConfValue()) ? Long.valueOf(salaryAutoConfirmPO.getConfValue()) : 7L; LocalDateTime now = LocalDateTime.now(); diff --git a/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java b/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java index 033dbd18e..63f0b3d37 100644 --- a/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryBillBaseSetWrapper.java @@ -3,6 +3,7 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.entity.salaryBill.dto.SalaryBaseSetFormDTO; +import com.engine.salary.entity.salaryBill.dto.SalaryBillAckFeedbackDTO; import com.engine.salary.entity.salaryBill.dto.SalaryBillWatermarkDTO; import com.engine.salary.entity.salaryBill.param.SalaryBaseSetSaveParam; import com.engine.salary.service.SalaryBillBaseSetService; @@ -45,7 +46,7 @@ public class SalaryBillBaseSetWrapper extends Service { public SalaryBaseSetFormDTO getBaseSetForm() { SalaryBaseSetFormDTO dto = new SalaryBaseSetFormDTO(); SalaryBillWatermarkDTO salaryBillWatermark = getSalaryBillBaseSetService(user).getWatermarkSetting(); -// SalaryBillAckFeedbackDTO salaryBillAckFeedback = salaryBillBaseSetService.getAckFeedbackSetting(); + SalaryBillAckFeedbackDTO salaryBillAckFeedback = getSalaryBillBaseSetService(user).getDefaultAckFeedbackSetting(); if (Objects.isNull(salaryBillWatermark)) { dto.setWatermarkStatus(false); @@ -57,16 +58,16 @@ public class SalaryBillBaseSetWrapper extends Service { dto.setWatermarkSetting(salaryBillWatermark.getWmSetting()); dto.setWatermark(salaryBillWatermark.getWatermarkType()); } -// if (Objects.nonNull(salaryBillAckFeedback)) { -// data.put("ackStatus", salaryBillAckFeedback.getAckStatus()); -// data.put("feedbackStatus", salaryBillAckFeedback.getFeedbackStatus()); -// } + if (Objects.nonNull(salaryBillAckFeedback)) { + // 工资单反馈默认设置 + dto.setAckFeedbackSetting(salaryBillAckFeedback); + } return dto; } /** - * 保存工资单水印设置 + * 保存工资单模板基础设置 * * @param saveParam * @return From c78c8375f0ee553ee7fa94bd5ae1d5e9d14e15a1 Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 12 Jul 2023 15:20:02 +0800 Subject: [PATCH 38/86] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A0=B8=E7=AE=97=EF=BC=8C=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=AF=BC=E5=87=BA=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/constant/SalaryItemConstant.java | 5 + .../param/SalaryAcctResultQueryParam.java | 3 + .../service/SalaryAcctExcelService.java | 10 ++ .../impl/SalaryAcctExcelServiceImpl.java | 106 +++++++++++++++++- .../salary/web/SalaryAcctController.java | 50 +++++++++ 5 files changed, 169 insertions(+), 5 deletions(-) diff --git a/src/com/engine/salary/constant/SalaryItemConstant.java b/src/com/engine/salary/constant/SalaryItemConstant.java index 790a288cb..26bac736b 100644 --- a/src/com/engine/salary/constant/SalaryItemConstant.java +++ b/src/com/engine/salary/constant/SalaryItemConstant.java @@ -20,5 +20,10 @@ public class SalaryItemConstant { */ public static final String RESULT_IMPORT_FIELD_SIGN="_salaryAcctResultImportFieldSign"; + /** + * 薪资核算导出缓存表头字段key + */ + public static final String RESULT_EXPORT_FIELD_SIGN="_salaryAcctResultExportFieldSign"; + } diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultQueryParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultQueryParam.java index 21221a4b3..939163a9d 100644 --- a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultQueryParam.java +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultQueryParam.java @@ -57,4 +57,7 @@ public class SalaryAcctResultQueryParam extends BaseQueryParam { private Collection ids; private String workcode; + + //薪资项目id + private Collection salaryItemIds; } diff --git a/src/com/engine/salary/service/SalaryAcctExcelService.java b/src/com/engine/salary/service/SalaryAcctExcelService.java index 147c38eea..25dbc0d18 100644 --- a/src/com/engine/salary/service/SalaryAcctExcelService.java +++ b/src/com/engine/salary/service/SalaryAcctExcelService.java @@ -73,6 +73,14 @@ public interface SalaryAcctExcelService { */ SalaryAcctImportFieldDTO getImportField(Long salaryAcctId); + /** + * 薪资核算导出时候薪资项目按取值方式分组 + * + * @param salaryAcctId + * @return + */ + SalaryAcctImportFieldDTO getExportField(Long salaryAcctId); + /** * 下载薪资核算导入模板 * @@ -110,6 +118,8 @@ public interface SalaryAcctExcelService { void cacheImportField(List salaryItems); + void cacheExportField(List salaryItems); + // // /** // * 薪资核算结果校验异常导出 diff --git a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java index 6cba27124..486073fbf 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java @@ -287,12 +287,38 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc List headerColumnGroup = Lists.newArrayList(); // 查询列表的表头 List weaTableColumns = listWeaTableColumn(salaryAcctRecordPO); - parseHeader(headerColumnGroup, weaTableColumns); + + //判断是否按照自定义字段导出表头 + List finalWeaTableColumns = new ArrayList<>(); + if (queryParam.getSalaryItemIds() != null ) { + // 必须选择导出所需的薪资项目 + if (CollectionUtils.isEmpty(queryParam.getSalaryItemIds())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99019, "参数错误,请选择导入模板所需的薪资项目")); + } + List headerRangeList = new ArrayList<>(); + List salaryItemPOS = getSalaryItemService(user).listByIds(queryParam.getSalaryItemIds()); + for (SalaryItemPO salaryItemPO : salaryItemPOS) { + headerRangeList.add(salaryItemPO.getId().toString()); + } + for (WeaTableColumnGroup tableColumn : weaTableColumns) { + WeaTableColumnGroup columnGroupItem = (WeaTableColumnGroup) tableColumn; + if (columnGroupItem.getChildren() != null) { + List childrenColumns = columnGroupItem.getChildren().stream().filter(f -> headerRangeList.contains(f.getColumn())).collect(Collectors.toList()); + if (childrenColumns.size() > 0) { + columnGroupItem.setChildren(childrenColumns); + finalWeaTableColumns.add(columnGroupItem); + } + } else if (headerRangeList.contains(columnGroupItem.getColumn())) { + finalWeaTableColumns.add(columnGroupItem); + } + + } + } else { + finalWeaTableColumns = weaTableColumns; + } +// parseHeader(headerColumnGroup, weaTableColumns); + parseHeader(headerColumnGroup, finalWeaTableColumns); // // excel导出的表头 -// String[] headers = headerColumnGroup.stream() -// .map(WeaTableColumn::getText) -// .toArray(String[]::new); -// List headerList = new ArrayList<>(Arrays.asList(headers)); List headerList = new ArrayList<>(weaTableColumns); // 查询薪资核算结果 List> resultMapList = getSalaryAcctResultService(user).listByParam(queryParam); @@ -461,6 +487,70 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc return SalaryAcctImportFieldDTO.builder().itemsByGroup(itemsByGroup).checkItems(checkItems).build(); } + @Override + public SalaryAcctImportFieldDTO getExportField(Long salaryAcctRecordId) { + // 查询薪资核算记录 + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(salaryAcctRecordId); + if (Objects.isNull(salaryAcctRecordPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除")); + } + // 查询薪资核算记录所用的薪资账套的薪资项目副本 + List salarySobItems = getSalarySobItemService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); + Set salaryItemIds = SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId); + // 查询薪资项目 + List salaryItems = getSalaryItemService(user).listByIds(salaryItemIds); + Map salaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId); + + Map> salarySobItemPOMap = SalaryEntityUtil.group2Map(salarySobItems, SalarySobItemPO::getSalarySobItemGroupId); + + // 查询薪资账套的薪资项目分类 + List salarySobItemGroupPOS = getSalarySobItemGroupService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); + // 对分组进行排序 + salarySobItemGroupPOS = SalaryAcctResultBO.sortGroup(salarySobItemGroupPOS); + // 对分组内薪资项目排序 + SalaryAcctResultBO.sortItem(salarySobItemPOMap); + // 根据账套分组封装薪资项目的值 + List itemsByGroup = new ArrayList<>(); + for(SalarySobItemGroupPO groupPO : salarySobItemGroupPOS){ + List groupItems = salarySobItemPOMap.getOrDefault(groupPO.getId(),Collections.emptyList()); + List items = groupItems.stream() + .map(salarySobItemPO -> SalaryAcctImportFieldDTO.ImportFieldDTO.builder() + .salaryItemId(salarySobItemPO.getSalaryItemId()) + .salaryItemName(Optional.ofNullable(salaryItemMap.get(salarySobItemPO.getSalaryItemId())).map(SalaryItemPO::getName).orElse(StringUtils.EMPTY)) + .build()) + .collect(Collectors.toList()); + + itemsByGroup.add(SalaryAcctImportFieldDTO.ImportFieldByGroupDTO.builder() + .salarySobItemGroupId(groupPO.getId()) + .salarySobItemGroupName(groupPO.getName()) + .salaryItems(items) + .sortedIndex(groupPO.getSortedIndex()).build() ); + } + // 未分类 + List noGroupItems = salarySobItemPOMap.getOrDefault(0L, Collections.emptyList()); + if(CollectionUtils.isNotEmpty(noGroupItems)){ + List items = noGroupItems.stream() + .map(salarySobItemPO ->SalaryAcctImportFieldDTO.ImportFieldDTO.builder() + .salaryItemId(salarySobItemPO.getSalaryItemId()) + .salaryItemName(Optional.ofNullable(salaryItemMap.get(salarySobItemPO.getSalaryItemId())).map(SalaryItemPO::getName).orElse(StringUtils.EMPTY)) + .build()) + .collect(Collectors.toList()); + + itemsByGroup.add(SalaryAcctImportFieldDTO.ImportFieldByGroupDTO.builder() + .salarySobItemGroupId(0L) + .salarySobItemGroupName("未分类") + .salaryItems(items) + .sortedIndex(itemsByGroup.size()).build()); + } + // 缓存勾选 + String cacheKey = user.getUID() + SalaryItemConstant.RESULT_EXPORT_FIELD_SIGN; + String cacheValue = (String)Util_DataCache.getObjVal(cacheKey); + List checkItems = JsonUtil.parseList(cacheValue, Long.class) == null ? new ArrayList<>() : JsonUtil.parseList(cacheValue, Long.class); + // 转换成dto +// return SalaryAcctImportFieldDTO.builder().formulaItems(formulaItems).sqlItems(sqlItems).inputItems(inputItems).checkItems(checkItems).build(); + return SalaryAcctImportFieldDTO.builder().itemsByGroup(itemsByGroup).checkItems(checkItems).build(); + } + @Override public XSSFWorkbook exportImportTemplate(SalaryAcctImportTemplateParam param) { ValidUtil.doValidator(param); @@ -697,6 +787,12 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc Util_DataCache.setObjVal(cacheKey, JsonUtil.toJsonString(salaryItems)); } + @Override + public void cacheExportField(List salaryItems) { + String cacheKey = user.getUID() + SalaryItemConstant.RESULT_EXPORT_FIELD_SIGN; + Util_DataCache.setObjVal(cacheKey, JsonUtil.toJsonString(salaryItems)); + } + @Override public Map previewImportSalaryAcctResult(SalaryAcctImportParam param) { diff --git a/src/com/engine/salary/web/SalaryAcctController.java b/src/com/engine/salary/web/SalaryAcctController.java index 8df680db0..3167e4e1c 100644 --- a/src/com/engine/salary/web/SalaryAcctController.java +++ b/src/com/engine/salary/web/SalaryAcctController.java @@ -481,6 +481,38 @@ public class SalaryAcctController { } } + //导出核算结果(自定义导出字段) + @GET + @Path("/acctresult/exportWithCustomFields") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response exportSalaryAcctResultWithCustomFields(@Context HttpServletRequest request, @Context HttpServletResponse response) { + try { + SalaryAcctResultQueryParam param = new SalaryAcctResultQueryParam(); + setSalaryAcctResultQueryParam(request, param); + String salaryItemIds = request.getParameter("salaryItemIds"); + if (StringUtils.isNotBlank(salaryItemIds)) { + param.setSalaryItemIds(Arrays.stream(salaryItemIds.split(",")).map(Long::valueOf).collect(Collectors.toList())); + } + User user = HrmUserVarify.getUser(request, response); + XSSFWorkbook workbook = getSalaryAcctExcelWrapper(user).exportSalaryAcctResult(param); + String fileName = "薪资核算结果" + LocalDate.now(); + try { + fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + StreamingOutput output = outputStream -> { + workbook.write(outputStream); + outputStream.flush(); + }; + response.setContentType("application/octet-stream"); + return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build(); + } catch (Exception e) { + log.error("薪资核算结果导出异常", e); + throw e; + } + } + //导入核算结果前生成导入模板时可选的薪资项目 @GET @@ -491,6 +523,15 @@ public class SalaryAcctController { return new ResponseResult(user).run(getSalaryAcctExcelService(user)::getImportField, salaryAcctRecordId); } + //导出核算结果前生成可选的薪资项目 + @GET + @Path("/acctresult/exportField") + @Produces(MediaType.APPLICATION_JSON) + public String exportField(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalaryAcctExcelService(user)::getExportField, salaryAcctRecordId); + } + // 薪资核算导入字段缓存 @POST @Path("/acctresult/cacheImportField") @@ -500,6 +541,15 @@ public class SalaryAcctController { return new ResponseResult, String>(user).run(getSalaryAcctExcelService(user)::cacheImportField, param.getSalaryItems()); } + // 薪资核算导出字段缓存 + @POST + @Path("/acctresult/cacheExportField") + @Produces(MediaType.APPLICATION_JSON) + public String cacheExportField(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctImportParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult, String>(user).run(getSalaryAcctExcelService(user)::cacheExportField, param.getSalaryItems()); + } + //导出导入模板 @GET @Path("/acctresult/importtemplate/export") From 23c0a78adcdca2a9717440ecb0a5c40cbf45f8b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 13 Jul 2023 10:20:41 +0800 Subject: [PATCH 39/86] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=88=9D=E5=A7=8B=E5=8C=96=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SalaryArchiveExcelServiceImpl.java | 33 +++++++------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java index 978563ab8..a3c51c7ca 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java @@ -14,7 +14,6 @@ import com.engine.salary.entity.salaryarchive.param.SalaryArchiveQueryParam; import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; -import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.param.TaxAgentRangeSaveParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; @@ -315,32 +314,24 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch rows.add(header); // 获取所有个税扣缴义务人 Collection taxAgentList = getTaxAgentService(user).listAll(); - Collection salaryArchives = getSalaryArchiveMapper().list(queryParam); -// boolean isSearchIdNo = enableHr && StringUtils.isNotEmpty(queryParam.getIdNo()); -// if (isSearchIdNo) { -// Map idNoEmpMap = salaryEmployeeService -// .mapByEmployeeIds(salaryArchives.stream().map(SalaryArchiveListDTO::getEmployeeId).distinct().collect(Collectors.toList()), tenantKey); -// salaryArchives = salaryArchives.stream().filter(f -> Optional.ofNullable(idNoEmpMap.get(f.getEmployeeId())).orElse("").contains(queryParam.getIdNo())) -// .collect(Collectors.toList()); -// } - // 开启分权并且不是薪酬模块总管理员 + Collection salaryArchives = new ArrayList<>(); + + if (queryParam.isExtSalaryArchiveList()) { + //非系统人员档案 + salaryArchives = getSalaryArchiveMapper().listExtSalaryArchive(queryParam); + } else { + salaryArchives = getSalaryArchiveMapper().list(queryParam); + } long employeeId = user.getUID(); if (getTaxAgentService(user).isNeedAuth(employeeId)) { - List taxAgentEmployees = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId); List taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - salaryArchives = salaryArchives.stream().filter(f -> + salaryArchives = salaryArchives.stream() + .filter(f -> // 作为管理员 taxAgentIdsAsAdmin.contains(f.getTaxAgentId()) - // 作为分管理员 -// || TaxAgentBO.checkTaxAgentAndEmployee(taxAgentEmployees, f.getTaxAgentId(), f.getEmployeeId()) -// || employeeId.equals(f.getModifier()) - ).collect(Collectors.toList()); + ).collect(Collectors.toList()); } - Map idNoEmpMap = -// enableHr ? salaryEmployeeService.mapByEmployeeIds(salaryArchives.stream().map(SalaryArchiveListDTO::getEmployeeId).distinct().collect(Collectors.toList()), tenantKey) -// : - new HashMap<>(); if (queryParam.getHasData()) { List> listMaps = salaryArchiveService(user) .buildSalaryArchiveData(salaryArchives, taxAgentList, salaryItems, Boolean.FALSE); @@ -716,7 +707,7 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch UseEmployeeTypeEnum empType = UseEmployeeTypeEnum.ORG; //外部人员导入 - if(param.isExtEmp()){ + if (param.isExtEmp()) { empType = UseEmployeeTypeEnum.EXT; } return SalaryArchiveImportHandleParam.builder() From 888938f150c0b1de09c51abbd8f8526ffadfe77d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 13 Jul 2023 11:33:58 +0800 Subject: [PATCH 40/86] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/sys/service/SalarySysConfService.java | 6 ++++++ .../service/impl/SalarySysConfServiceImpl.java | 15 ++++++++++----- .../salary/web/SalarySystemConfigController.java | 16 ++++++++++++++++ .../wrapper/SalarySystemConfigWrapper.java | 4 ++++ 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/src/com/engine/salary/sys/service/SalarySysConfService.java b/src/com/engine/salary/sys/service/SalarySysConfService.java index 5f0414164..e0ed13931 100644 --- a/src/com/engine/salary/sys/service/SalarySysConfService.java +++ b/src/com/engine/salary/sys/service/SalarySysConfService.java @@ -108,4 +108,10 @@ public interface SalarySysConfService { * @param setting */ void saveArchiveDelete(String setting); + + /** + * 保存或者更新 + * @param salarySysConfPO + */ + void operate(SalarySysConfPO salarySysConfPO); } diff --git a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java index ec39eb31a..984486e4a 100644 --- a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java +++ b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java @@ -433,6 +433,11 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe saveSettingByType(setting, SALARY_ARCHIVE_DELETE, "薪资、社保福利档案删除规则", "basic"); } + @Override + public void operate(SalarySysConfPO salarySysConfPO) { + saveSettingByType(salarySysConfPO.getConfValue(), salarySysConfPO.getConfKey(), salarySysConfPO.getTitle(), salarySysConfPO.getModule()); + } + /** * 保存或者修改应用设置 * @@ -498,23 +503,23 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe } SalarySysConfPO salaryAcctEmployeeRule = salarySysConfMap.get(SALARY_ACCT_EMPLOYEE_RULE); - if (salaryAcctEmployeeRule == null ) { + if (salaryAcctEmployeeRule == null) { // 薪资核算人员匹配规则 appSettingVO.setSalaryAcctEmployeeRule(SalaryAcctEmployeeRuleEnum.BYPAYENDTIME.getValue()); } else { - appSettingVO.setSalaryAcctEmployeeRule( SalaryAcctEmployeeRuleEnum.parseByValue(salaryAcctEmployeeRule.getConfValue()).getValue() ); + appSettingVO.setSalaryAcctEmployeeRule(SalaryAcctEmployeeRuleEnum.parseByValue(salaryAcctEmployeeRule.getConfValue()).getValue()); } SalarySysConfPO withDrawRule = salarySysConfMap.get(WITHDRAW_TAX_DECLARATION); - if (withDrawRule == null ) { + if (withDrawRule == null) { // 个税申报撤回 appSettingVO.setWithDrawTaxDeclaration("0"); } else { - appSettingVO.setWithDrawTaxDeclaration( withDrawRule.getConfValue() ); + appSettingVO.setWithDrawTaxDeclaration(withDrawRule.getConfValue()); } SalarySysConfPO salaryArchiveDeletePO = salarySysConfMap.get(SALARY_ARCHIVE_DELETE); - if (salaryArchiveDeletePO == null ) { + if (salaryArchiveDeletePO == null) { // 是否允许删除薪资、社保档案,默认不允许删除 appSettingVO.setSalaryArchiveDelete("0"); } else { diff --git a/src/com/engine/salary/web/SalarySystemConfigController.java b/src/com/engine/salary/web/SalarySystemConfigController.java index 1d640cd17..ab185e359 100644 --- a/src/com/engine/salary/web/SalarySystemConfigController.java +++ b/src/com/engine/salary/web/SalarySystemConfigController.java @@ -140,6 +140,22 @@ public class SalarySystemConfigController { return new ResponseResult(user).run(getSalarySystemConfigWrapper(user)::update, param); } + /** + * 新增或更新系统配置 + * + * @param request + * @param response + * @return + */ + @POST + @Path("/operate") + @Produces(MediaType.APPLICATION_JSON) + public String operate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySysConfPO param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalarySystemConfigWrapper(user)::operate, param); + } + + /** * 单个规则配置 * diff --git a/src/com/engine/salary/wrapper/SalarySystemConfigWrapper.java b/src/com/engine/salary/wrapper/SalarySystemConfigWrapper.java index 16ec870b5..d9acd2170 100644 --- a/src/com/engine/salary/wrapper/SalarySystemConfigWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySystemConfigWrapper.java @@ -151,4 +151,8 @@ public class SalarySystemConfigWrapper extends Service { public void saveArchiveDelete(String setting) { getSalarySysConfService(user).saveArchiveDelete(setting); } + + public void operate(SalarySysConfPO salarySysConfPO) { + getSalarySysConfService(user).operate(salarySysConfPO); + } } From 30d61e352f8b37346b526a8cb054af2a64923325 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Thu, 13 Jul 2023 11:50:02 +0800 Subject: [PATCH 41/86] =?UTF-8?q?=E5=B7=A5=E8=B5=84=E5=8D=95=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salaryBill/dto/SalarySendInfoListDTO.java | 5 +++ .../salaryBill/dto/SalarySendListDTO.java | 5 +++ .../dto/SalaryTemplateBaseSetDTO.java | 16 +++++++ .../dto/SalaryTemplateShowSetDTO.java | 17 ++++++++ .../param/SalaryTemplateSaveParam.java | 16 +++++++ .../salaryBill/po/SalaryTemplatePO.java | 18 ++++++++ .../salarybill/SalaryTemplateMapper.xml | 12 ++++++ .../service/impl/SalarySendServiceImpl.java | 43 +++++++++---------- .../impl/SalaryTemplateServiceImpl.java | 3 ++ .../salary/wrapper/SalarySendWrapper.java | 14 +----- .../salary/wrapper/SalaryTemplateWrapper.java | 16 +++++++ 11 files changed, 129 insertions(+), 36 deletions(-) diff --git a/src/com/engine/salary/entity/salaryBill/dto/SalarySendInfoListDTO.java b/src/com/engine/salary/entity/salaryBill/dto/SalarySendInfoListDTO.java index ed7626794..00548b4b6 100644 --- a/src/com/engine/salary/entity/salaryBill/dto/SalarySendInfoListDTO.java +++ b/src/com/engine/salary/entity/salaryBill/dto/SalarySendInfoListDTO.java @@ -61,5 +61,10 @@ public class SalarySendInfoListDTO { */ private Integer salaryAcctType; + /** + * 该模板是否开启了工资单反馈确认 + */ + private boolean needAck; + } diff --git a/src/com/engine/salary/entity/salaryBill/dto/SalarySendListDTO.java b/src/com/engine/salary/entity/salaryBill/dto/SalarySendListDTO.java index c4c72bda0..915045c89 100644 --- a/src/com/engine/salary/entity/salaryBill/dto/SalarySendListDTO.java +++ b/src/com/engine/salary/entity/salaryBill/dto/SalarySendListDTO.java @@ -141,5 +141,10 @@ public class SalarySendListDTO { */ // private Integer haveBackCalc; + /** + * 工资单确认反馈状态 + */ + private Integer ackFeedbackStatus; + } diff --git a/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateBaseSetDTO.java b/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateBaseSetDTO.java index b09f269b0..910e38e10 100644 --- a/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateBaseSetDTO.java +++ b/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateBaseSetDTO.java @@ -66,4 +66,20 @@ public class SalaryTemplateBaseSetDTO { // 发送时间 private String autoSendTimeOfDay; + + /** + * 工资单确认反馈状态 + */ + private Boolean ackFeedbackStatus; + + /** + * 自动确认超时天数 + */ + private Integer autoAckDays; + + /** + * 反馈流程地址 + * + */ + private String feedbackUrl; } diff --git a/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateShowSetDTO.java b/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateShowSetDTO.java index 8f976ec9d..86aaeb0d6 100644 --- a/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateShowSetDTO.java +++ b/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateShowSetDTO.java @@ -54,4 +54,21 @@ public class SalaryTemplateShowSetDTO { // 薪资项为0时不显示") private Boolean salaryItemZeroStatus; + + /** + * 工资单确认反馈状态 + */ + private Boolean ackFeedbackStatus; + + /** + * 自动确认超时天数 + */ + private Integer autoAckDays; + + /** + * 反馈流程地址 + * + */ + private String feedbackUrl; + } diff --git a/src/com/engine/salary/entity/salaryBill/param/SalaryTemplateSaveParam.java b/src/com/engine/salary/entity/salaryBill/param/SalaryTemplateSaveParam.java index 2dc7643d2..ff8af0607 100644 --- a/src/com/engine/salary/entity/salaryBill/param/SalaryTemplateSaveParam.java +++ b/src/com/engine/salary/entity/salaryBill/param/SalaryTemplateSaveParam.java @@ -88,6 +88,22 @@ public class SalaryTemplateSaveParam { // 补发薪资项目设置 private List replenishSalaryItemSetting; + /** + * 工资单确认反馈状态 + */ + private Boolean ackFeedbackStatus; + + /** + * 自动确认超时天数 + */ + private Integer autoAckDays; + + /** + * 反馈流程地址 + * + */ + private String feedbackUrl; + public static void checkParam(SalaryTemplateSaveParam saveParam) { if (saveParam.getSalarySobId() == null) { throw new SalaryRunTimeException("薪资账套表的主键id必传;"); diff --git a/src/com/engine/salary/entity/salaryBill/po/SalaryTemplatePO.java b/src/com/engine/salary/entity/salaryBill/po/SalaryTemplatePO.java index f5c416305..fd8e1a1c9 100644 --- a/src/com/engine/salary/entity/salaryBill/po/SalaryTemplatePO.java +++ b/src/com/engine/salary/entity/salaryBill/po/SalaryTemplatePO.java @@ -170,5 +170,23 @@ public class SalaryTemplatePO { */ private String tenantKey; + /** + * 工资单确认反馈状态 + */ + private Integer ackFeedbackStatus; + + /** + * 自动确认超时天数 + */ + private Integer autoAckDays; + + /** + * 反馈流程地址 + * + */ + private String feedbackUrl; + + + private Collection salarySobIds; } diff --git a/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml b/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml index 56cd60808..5eb01a1ed 100644 --- a/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml +++ b/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml @@ -84,6 +84,9 @@ auto_send_cycle_type, auto_send_day_of_month, auto_send_time_of_day, + ack_feedback_status, + auto_ack_days, + feedback_url, create_time, update_time, creator, @@ -513,6 +516,15 @@ auto_send_time_of_day=#{autoSendTimeOfDay}, + + ack_feedback_status=#{ackFeedbackStatus}, + + + auto_ack_days=#{autoAckDays}, + + + feedback_url=#{feedbackUrl}, + create_time=#{createTime}, diff --git a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java index b0da29ed7..6f951f136 100644 --- a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java @@ -50,8 +50,6 @@ import com.engine.salary.mapper.salaryacct.SalaryAcctResultMapper; import com.engine.salary.mapper.salarybill.SalarySendInfoMapper; import com.engine.salary.mapper.salarybill.SalarySendMapper; import com.engine.salary.service.*; -import com.engine.salary.sys.constant.SalarySysConstant; -import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.sys.entity.vo.OrderRuleVO; import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; @@ -74,7 +72,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import weaver.common.MessageUtil; -import weaver.general.BaseBean; import weaver.hrm.User; import weaver.hrm.company.SubCompanyComInfo; import weaver.hrm.resource.ResourceComInfo; @@ -423,11 +420,6 @@ public class SalarySendServiceImpl extends Service implements SalarySendService } Long salaryAcctId = salarySend.getSalaryAccountingId(); SalarySobCycleDTO salarySobCycleDTO = getSalaryAcctRecordService(user).getSalarySobCycleById(salaryAcctId); -// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); -// List salaryAcctRecordPOS = getSalaryAcctRecordService(user).listBySalarySobIds(Collections.singletonList(salarySobCycleDTO.getSalarySobId())); -// // 是否有回算记录 -// boolean haveBackCalc = salaryAcctRecordPOS.stream().filter(PO -> Objects.equals(PO.getBackCalcStatus(), NumberUtils.INTEGER_ONE) && -// Objects.equals(sdf.format(PO.getSalaryMonth()), SalaryDateUtil.MONTH_FORMATTER.format(salarySobCycleDTO.getSalaryMonth()))).collect(Collectors.toList()).size() > 0; String template = ""; // 获取默认模板 List salaryTemplates = getSalaryTemplateService(user).getDefaultTemplates(Collections.singletonList(salarySend.getSalarySobId())); @@ -481,14 +473,18 @@ public class SalarySendServiceImpl extends Service implements SalarySendService throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100511, "当前账号无法查看此工资单")); } SalarySendInfoPO salarySendInfo = salarySendInfos.get(0); + // 获取默认模板信息 + SalarySendPO salarySendPO = getSalarySendMapper().getById(salarySendInfo.getSalarySendId()); + if(ObjectUtils.isEmpty(salarySendPO)) + throw new SalaryRunTimeException("工资单不存在"); + List salaryTemplates = getSalaryTemplateService(user).getDefaultTemplates(Collections.singletonList(salarySendPO.getSalarySobId())); + Integer ackFeedbackStatus = salaryTemplates.get(0).getAckFeedbackStatus(); // 更新查看状态 - SalarySysConfPO feedbackPO = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_SEND_FEEDBACK); - if (feedbackPO != null && StringUtils.equals(feedbackPO.getConfValue(),"1")){ - if(salarySendInfo.getBillReadStatus() == null || NumberUtils.compare(salarySendInfo.getBillReadStatus(),BillReadStatusEnum.UNREAD.getValue()) == 0 ){ - salarySendInfo.setBillReadStatus(BillReadStatusEnum.READED.getValue()); - salarySendInfo.setUpdateTime(new Date()); - getSalarySendInfoMapper().updateIgnoreNull(salarySendInfo); - } + if ( (ackFeedbackStatus!=null && NumberUtils.compare(ackFeedbackStatus,1) == 1) + && (salarySendInfo.getBillReadStatus() == null || NumberUtils.compare(salarySendInfo.getBillReadStatus(),BillReadStatusEnum.UNREAD.getValue()) == 0)) { + salarySendInfo.setBillReadStatus(BillReadStatusEnum.READED.getValue()); + salarySendInfo.setUpdateTime(new Date()); + getSalarySendInfoMapper().updateIgnoreNull(salarySendInfo); } // List salarySends = new LambdaQueryChainWrapper<>(mapper) // .eq(SalarySendPO::getDeleteType, 0) @@ -614,17 +610,14 @@ public class SalarySendServiceImpl extends Service implements SalarySendService map.put("salaryTemplate", salaryTemplate); map.put("salaryAcctResult", salaryAcctResultS); // 工资单发送人、是否已确认 - if (feedbackPO != null && StringUtils.equals(feedbackPO.getConfValue(),"1")){ + if (ackFeedbackStatus!=null && NumberUtils.compare(ackFeedbackStatus,1) == 1) { map.put("confirmStatus", salarySendInfo.getBillConfirmStatus() == null ? "0" : salarySendInfo.getBillConfirmStatus().toString()); - map.put("sendEmployeeId", salarySendInfo.getSalarySendId()); - BaseBean baseBean = new BaseBean(); - String workFlowId = baseBean.getPropValue("hrmSalary", "feedbackWorkflowId"); - map.put("feedbackWorkflowId",workFlowId); + map.put("sendEmployeeId", salarySendInfo.getSendEmployeeId()); + map.put("feedbackWorkflowUrl",salaryTemplates.get(0).getFeedbackUrl()); }else{ map.put("confirmStatus", "1"); } - return map; } @@ -671,8 +664,12 @@ public class SalarySendServiceImpl extends Service implements SalarySendService List page = salarySendInfoMapper.list(queryParam); PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), page, SalarySendInfoListDTO.class); - SalarySysConfPO needFeedBack = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_SEND_FEEDBACK); - if(ObjectUtils.isNotEmpty(needFeedBack) && StringUtils.equals(needFeedBack.getConfValue(),"1")){ + SalarySendPO salarySendPO = getSalarySendMapper().getById(queryParam.getSalarySendId()); + if (ObjectUtils.isEmpty(salarySendPO)) + throw new SalaryRunTimeException("工资单不存在或已被删除"); + List salaryTemplates = getSalaryTemplateService(user).getDefaultTemplates(Collections.singletonList(salarySendPO.getSalarySobId())); + Integer ackFeedbackStatus = salaryTemplates.get(0).getAckFeedbackStatus(); + if (ackFeedbackStatus!=null && NumberUtils.compare(ackFeedbackStatus,1) == 1) { // 默认为空时,未读未确认 pageInfo.getList().stream().forEach(obj -> { SalarySendInfoListDTO dto = (SalarySendInfoListDTO) obj; diff --git a/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java b/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java index 8c6bc6650..72ed6c76e 100644 --- a/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java @@ -197,6 +197,9 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate salaryTemplateNew.setSalaryItemZeroStatus(saveParam.getSalaryItemZeroStatus()?1:0); salaryTemplateNew.setAutoSendStatus(saveParam.getAutoSendStatus()?1:0); salaryTemplateNew.setAutoSendCycleType(saveParam.getAutoSendCycleType()); + salaryTemplateNew.setAckFeedbackStatus(saveParam.getAckFeedbackStatus()?1:0); + salaryTemplateNew.setAutoAckDays(saveParam.getAutoAckDays()); + salaryTemplateNew.setFeedbackUrl(saveParam.getFeedbackUrl()); // todo 薪资项目设置检查校验 salaryTemplateNew.setSalaryItemSetting(saveParam.getSalaryItemSetting() != null ? JSONUtil.toJsonStr(saveParam.getSalaryItemSetting()) : ""); salaryTemplateNew.setReplenishSalaryItemSetting(saveParam.getReplenishSalaryItemSetting() != null ? JSONUtil.toJsonStr(saveParam.getReplenishSalaryItemSetting()) : ""); diff --git a/src/com/engine/salary/wrapper/SalarySendWrapper.java b/src/com/engine/salary/wrapper/SalarySendWrapper.java index 5fbf57805..0b6548fda 100644 --- a/src/com/engine/salary/wrapper/SalarySendWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySendWrapper.java @@ -148,22 +148,10 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy // todo 目前就一个回算,那么没有冻结且是回算,就展示补发名称 e.setTemplate(NumberUtils.INTEGER_ONE.equals(e.getSalaryAcctType()) ? optional.get().getReplenishName() : optional.get().getName()); e.setTemplateId(optional.get().getId()); + e.setAckFeedbackStatus(optional.get().getAckFeedbackStatus() == null ? 0 : optional.get().getAckFeedbackStatus()); } -// e.setHaveBackCalc(NumberUtils.INTEGER_ZERO); }); } - // 薪资核算ID - Set salaryAcctIds = SalaryEntityUtil.properties(pageList, SalarySendListDTO::getSalaryAcctId); - // 获取是回算的薪资核算ID - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - List salaryAcctRecordPOS = getSalaryAcctRecordService(user).getBackCalcRecordByIds(salaryAcctIds); -// Set backCalcSalarySobs = SalaryEntityUtil.properties(salaryAcctRecordPOS, salaryAcctRecordPO -> salaryAcctRecordPO.getSalarySobId() + "-" + sdf.format(salaryAcctRecordPO.getSalaryMonth())); -// // 判断是否回算过,haveBackCalc 属性 -// pageList.stream().forEach(salarySendDTO -> { -// if (backCalcSalarySobs.contains(salarySendDTO.getSalarySobId() + "-" + sdf.format(salarySendDTO.getSalaryYearMonth()))) { -// salarySendDTO.setHaveBackCalc(NumberUtils.INTEGER_ONE); -// } -// }); List columns = buildWeaTableColumns(); WeaTable table = new WeaTable(); table.setColumns(columns); diff --git a/src/com/engine/salary/wrapper/SalaryTemplateWrapper.java b/src/com/engine/salary/wrapper/SalaryTemplateWrapper.java index 216fd2ecf..640a498d2 100644 --- a/src/com/engine/salary/wrapper/SalaryTemplateWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryTemplateWrapper.java @@ -20,6 +20,7 @@ import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; import com.mzlion.core.utils.BeanUtils; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import weaver.hrm.User; @@ -60,6 +61,10 @@ public class SalaryTemplateWrapper extends Service { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } + private SalaryBillBaseSetService getSalaryBillBaseSetService(User user) { + return ServiceUtil.getService(SalaryBillBaseSetServiceImpl.class, user); + } + /** * 工资单模板列表 * @@ -154,6 +159,8 @@ public class SalaryTemplateWrapper extends Service { salaryTemplateBaseSetDTO.setSalarySob(po.getSalarySobId()); salaryTemplateBaseSetDTO.setSendEmail(po.getSendEmailId()); salaryTemplateBaseSetDTO.setAutoSendStatus(po.getAutoSendStatus() == null ? false : po.getAutoSendStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue())); + salaryTemplateBaseSetDTO.setAckFeedbackStatus(po.getAckFeedbackStatus() == null ? false : NumberUtils.compare(po.getAckFeedbackStatus(), 1) == 1); + salaryTemplateBaseSetDTO.setAutoAckDays(ObjectUtils.isEmpty(po.getAutoAckDays()) ? 7 : po.getAutoAckDays()); // 规则赋值 如果为ALL传“” 如果为byRule传薪资项目ID salaryTemplateBaseSetDTO.setReplenishRule(SalaryTemplateReplenishRuleEnum.ALL.getValue().equals(po.getReplenishRule()) ? "" : po.getReplenishRule()); // 规则设置赋值 @@ -182,6 +189,13 @@ public class SalaryTemplateWrapper extends Service { // WeaForm salaryTemplateBase = SalaryFormatUtil.getInstance().buildForm(SalaryTemplateBaseSetDTO.class, SalaryTemplateBaseSetDTO.builder().salarySobOptions(salarySobOptions).sendEmailOptions(sendEmailOptions).build()); + if(id == null){ + // 新建,获取默认的确认反馈信息 + SalaryBillAckFeedbackDTO defaultAckFeedback = getSalaryBillBaseSetService(user).getDefaultAckFeedbackSetting(); + salaryTemplateBaseSetDTO.setAckFeedbackStatus(StringUtils.equals(defaultAckFeedback.getAckStatus(),"1")); + salaryTemplateBaseSetDTO.setAutoAckDays(defaultAckFeedback.getAutoAckDays()); + salaryTemplateBaseSetDTO.setFeedbackUrl(defaultAckFeedback.getFeedBackUrl()); + } Map salaryTemplateBase = new HashMap<>(); salaryTemplateBase.put("data", salaryTemplateBaseSetDTO); salaryTemplateBase.put("salarySobOptions", salarySobOptions); @@ -215,6 +229,8 @@ public class SalaryTemplateWrapper extends Service { salaryTemplateShowSetDTO.setTextContentPosition(po.getTextContentPosition().toString()); salaryTemplateShowSetDTO.setSalaryItemNullStatus(po.getSalaryItemNullStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue())); salaryTemplateShowSetDTO.setSalaryItemZeroStatus(po.getSalaryItemZeroStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue())); + salaryTemplateShowSetDTO.setAckFeedbackStatus(po.getAckFeedbackStatus() != null && NumberUtils.compare(po.getAckFeedbackStatus(),1) == 1); + salaryTemplateShowSetDTO.setAutoAckDays(ObjectUtils.isEmpty(po.getAutoAckDays()) ? 7 : po.getAutoAckDays()); } Map salaryTemplateShowSet = new HashMap<>(); From 4901f79066793fce3fdca753b01a8dfada4a04e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 13 Jul 2023 14:11:32 +0800 Subject: [PATCH 42/86] =?UTF-8?q?=E6=A0=B8=E7=AE=97=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=A4=96=E9=83=A8=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/ExtEmpServiceImpl.java | 5 +++-- .../salary/service/impl/SalaryEmployeeServiceImpl.java | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java index 19068bdda..8db902160 100644 --- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -103,8 +103,9 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { if (CollectionUtils.isEmpty(ids)) { return new ArrayList<>(); } - List extEmpPOS = getExternalEmployeeMapper().listSome(ExtEmpPO.builder().ids(ids).build()); - + List extEmpPOS = new ArrayList<>(); + List> partition = Lists.partition(ids, 500); + partition.forEach(list ->extEmpPOS.addAll(getExternalEmployeeMapper().listSome(ExtEmpPO.builder().ids(list).build())) ); return coverList(extEmpPOS); } diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index 35ab6fb5b..d4cbdb8bf 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -141,7 +141,14 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee @Override public List getEmployeeByIdsAll(List ids) { - return employBiz.getEmployeeByIdsAll(ids); + if (CollectionUtils.isEmpty(ids)) { + return new ArrayList<>(); + } + List employeeList = employBiz.getEmployeeByIdsAll(ids); + if (openExtEmp) { + employeeList.addAll(getExtEmpService(user).getEmployeeByIds(ids)); + } + return employeeList; } @Override From 0fc16efb116e88483edc975afbe34c1ef98bc9b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 13 Jul 2023 14:11:54 +0800 Subject: [PATCH 43/86] =?UTF-8?q?=E6=A0=B8=E7=AE=97=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=A4=96=E9=83=A8=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java b/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java index 567e10cdc..9c17eaf78 100644 --- a/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java @@ -2,7 +2,6 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.biz.EmployBiz; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryBill.dto.SalarySendCheckDTO; import com.engine.salary.entity.salaryacct.bo.SalaryAcctRecordBO; From b007b1b351e31928853eb32bb59fa7a8bc88ae0e Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 13 Jul 2023 14:43:54 +0800 Subject: [PATCH 44/86] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A0=B8=E7=AE=97=EF=BC=8C=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=AF=BC=E5=87=BA=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/web/SalaryAcctController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/engine/salary/web/SalaryAcctController.java b/src/com/engine/salary/web/SalaryAcctController.java index 3167e4e1c..b6b0d7e38 100644 --- a/src/com/engine/salary/web/SalaryAcctController.java +++ b/src/com/engine/salary/web/SalaryAcctController.java @@ -489,6 +489,7 @@ public class SalaryAcctController { try { SalaryAcctResultQueryParam param = new SalaryAcctResultQueryParam(); setSalaryAcctResultQueryParam(request, param); + //设置自定义导出字段 String salaryItemIds = request.getParameter("salaryItemIds"); if (StringUtils.isNotBlank(salaryItemIds)) { param.setSalaryItemIds(Arrays.stream(salaryItemIds.split(",")).map(Long::valueOf).collect(Collectors.toList())); From 942a3b2a9732ebc4ac17e715d231442ac588b8ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 13 Jul 2023 17:23:28 +0800 Subject: [PATCH 45/86] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=A5=E8=B5=84?= =?UTF-8?q?=E5=8D=95=E5=8F=91=E9=80=81=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SalarySendServiceImpl.java | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java index 6c2ff5056..9b0a8970a 100644 --- a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java @@ -441,7 +441,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService Boolean canSend = true; SalaryAcctRecordPO acctRecord = getSalaryAcctRecordService(user).getById(salaryAcctId); // 回算过,但是查看的是普通工资单(不能发);回算过,但是查看的是回算工资单(可以发);记录没回算过(可以发) - if(Objects.equals(acctRecord.getBackCalcStatus(), NumberUtils.INTEGER_ONE) && Objects.equals(salarySend.getSalaryAcctType(),NumberUtils.INTEGER_ZERO)){ + if (Objects.equals(acctRecord.getBackCalcStatus(), NumberUtils.INTEGER_ONE) && Objects.equals(salarySend.getSalaryAcctType(), NumberUtils.INTEGER_ZERO)) { canSend = false; } @@ -475,7 +475,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService if (CollectionUtils.isEmpty(salarySendInfos)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100511, "工资单信息不存在")); } - if(currentEmployeeId.compareTo(salarySendInfos.get(0).getEmployeeId()) != 0){ + if (currentEmployeeId.compareTo(salarySendInfos.get(0).getEmployeeId()) != 0) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100511, "当前账号无法查看此工资单")); } SalarySendInfoPO salarySendInfo = salarySendInfos.get(0); @@ -615,7 +615,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService */ private void handleSalaryWatermark(SalaryTemplatePO salaryTemplate, SalarySendInfoPO salarySendInfo, Long currentEmployeeId) { SalaryBillWatermarkDTO salaryBillWatermark = JsonUtil.parseObject(salaryTemplate.getSalaryWatermark(), SalaryBillWatermarkDTO.class); - if (Objects.isNull(salaryBillWatermark) || !salaryBillWatermark.getWatermarkStatus() ) { + if (Objects.isNull(salaryBillWatermark) || !salaryBillWatermark.getWatermarkStatus()) { return; } // 发送时已经处理好变量字段,可直接获取判断 @@ -647,8 +647,23 @@ public class SalarySendServiceImpl extends Service implements SalarySendService queryParam.setOrderRule(orderRule); List page = salarySendInfoMapper.list(queryParam); - return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), + PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), page, SalarySendInfoListDTO.class); + List list = pageInfo.getList(); + + List employeeList = getExtEmpService(user).listEmployee(); + Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); + list.forEach(dto -> { + if (dto.getEmployeeType() != null && Objects.equals(dto.getEmployeeType(), 1)) { + DataCollectionEmployee employee = employeeMap.get(dto.getEmployeeId()); + dto.setUsername(employee.getUsername()); + dto.setDepartment(employee.getDepartmentName()); + dto.setMobile(employee.getMobile()); + dto.setJobNum(employee.getWorkcode()); + } + }); + pageInfo.setList(list); + return pageInfo; } @Override @@ -1575,7 +1590,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService @Override public List getNeedSendInfoList(List salarySendIds) { - if(CollectionUtils.isEmpty(salarySendIds)){ + if (CollectionUtils.isEmpty(salarySendIds)) { return Collections.emptyList(); } return getSalarySendInfoMapper().getNeedSendInfoList(salarySendIds); @@ -1583,7 +1598,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService @Override public List getNeedSendListBySalarySobIds(List salarySobIds) { - if(CollectionUtils.isEmpty(salarySobIds)){ + if (CollectionUtils.isEmpty(salarySobIds)) { return Collections.emptyList(); } return getSalarySendMapper().getNeedSendListBySalarySobIds(salarySobIds); From 3571797e122a82ed2a259254f03b6548c485573a Mon Sep 17 00:00:00 2001 From: sy Date: Fri, 14 Jul 2023 09:13:19 +0800 Subject: [PATCH 46/86] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A0=B8=E7=AE=97=EF=BC=8C=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=87=BD=E6=95=B0=E4=B8=AD=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A0=B8=E7=AE=97=E6=98=8E=E7=BB=86=E9=A1=B9?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E7=BC=B4=E7=BA=B3=E7=8A=B6=E6=80=81=E7=9A=84?= =?UTF-8?q?=E7=BB=86=E5=88=86=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SIAccountServiceImpl.java | 194 +++++++++++++++--- 1 file changed, 169 insertions(+), 25 deletions(-) diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 5181b615e..aef9ef3c2 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -935,28 +935,145 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { record.put("perSum", item.getPerSum()); record.put("comSum", item.getComSum()); - //20230707增加福利核算明细中的缴纳状态+合计的数据项 + //20230707增加福利核算明细中的缴纳状态+合计的数据项、缴纳状态+福利项的数据项 InsuranceAccountDetailPO commonSiAcct = siAcctResultWithEmpAndPayStatus.get(item.getEmployeeId() + "_" + PaymentStatusEnum.COMMON.getValue()); InsuranceAccountDetailPO repairSiAcct = siAcctResultWithEmpAndPayStatus.get(item.getEmployeeId() + "_" + PaymentStatusEnum.REPAIR.getValue()); InsuranceAccountDetailPO balanceSiAcct = siAcctResultWithEmpAndPayStatus.get(item.getEmployeeId() + "_" + PaymentStatusEnum.BALANCE.getValue()); + //社保-正常缴纳 + if (StringUtils.isNotEmpty(commonSiAcct.getSocialPerJson())) { + Map socialJson = JSON.parseObject(commonSiAcct.getSocialPerJson(), new HashMap().getClass()); + socialJson.forEach((k, v) -> { + record.put(k + "socialCommonPer", v); + }); + } + if (StringUtils.isNotEmpty(commonSiAcct.getSocialComJson())) { + Map socialJson = JSON.parseObject(commonSiAcct.getSocialComJson(), new HashMap().getClass()); + socialJson.forEach((k, v) -> { + record.put(k + "socialCommonCom", v); + }); + } record.put("socialPerCommonSum", commonSiAcct != null ? commonSiAcct.getSocialPerSum() : new BigDecimal("0")); record.put("socialComCommonSum", commonSiAcct != null ? commonSiAcct.getSocialComSum() : new BigDecimal("0")); + //社保-补缴 + if (StringUtils.isNotEmpty(repairSiAcct.getSocialPerJson())) { + Map socialJson = JSON.parseObject(repairSiAcct.getSocialPerJson(), new HashMap().getClass()); + socialJson.forEach((k, v) -> { + record.put(k + "socialRepairPer", v); + }); + } + if (StringUtils.isNotEmpty(repairSiAcct.getSocialComJson())) { + Map socialJson = JSON.parseObject(repairSiAcct.getSocialComJson(), new HashMap().getClass()); + socialJson.forEach((k, v) -> { + record.put(k + "socialRepairCom", v); + }); + } record.put("socialPerRepairSum", repairSiAcct != null ? repairSiAcct.getSocialPerSum() : new BigDecimal("0")); record.put("socialComRepairSum", repairSiAcct != null ? repairSiAcct.getSocialComSum() : new BigDecimal("0")); + //社保-补差 + if (StringUtils.isNotEmpty(balanceSiAcct.getSocialPerJson())) { + Map socialJson = JSON.parseObject(balanceSiAcct.getSocialPerJson(), new HashMap().getClass()); + socialJson.forEach((k, v) -> { + record.put(k + "socialBalancePer", v); + }); + } + if (StringUtils.isNotEmpty(balanceSiAcct.getSocialComJson())) { + Map socialJson = JSON.parseObject(balanceSiAcct.getSocialComJson(), new HashMap().getClass()); + socialJson.forEach((k, v) -> { + record.put(k + "socialBalanceCom", v); + }); + } record.put("socialPerBalanceSum", balanceSiAcct != null ? balanceSiAcct.getSocialPerSum() : new BigDecimal("0")); record.put("socialComBalanceSum", balanceSiAcct != null ? balanceSiAcct.getSocialComSum() : new BigDecimal("0")); + //公积金-正常缴纳 + if (StringUtils.isNotEmpty(commonSiAcct.getFundPerJson())) { + Map socialJson = JSON.parseObject(commonSiAcct.getFundPerJson(), new HashMap().getClass()); + socialJson.forEach((k, v) -> { + record.put(k + "fundCommonPer", v); + }); + } + if (StringUtils.isNotEmpty(commonSiAcct.getFundComJson())) { + Map socialJson = JSON.parseObject(commonSiAcct.getFundComJson(), new HashMap().getClass()); + socialJson.forEach((k, v) -> { + record.put(k + "fundCommonCom", v); + }); + } record.put("fundPerCommonSum", commonSiAcct != null ? commonSiAcct.getFundPerSum() : new BigDecimal("0")); record.put("fundComCommonSum", commonSiAcct != null ? commonSiAcct.getFundComSum() : new BigDecimal("0")); + //公积金-补缴 + if (StringUtils.isNotEmpty(repairSiAcct.getFundPerJson())) { + Map fundJson = JSON.parseObject(repairSiAcct.getFundPerJson(), new HashMap().getClass()); + fundJson.forEach((k, v) -> { + record.put(k + "fundRepairPer", v); + }); + } + if (StringUtils.isNotEmpty(repairSiAcct.getFundComJson())) { + Map fundJson = JSON.parseObject(repairSiAcct.getFundComJson(), new HashMap().getClass()); + fundJson.forEach((k, v) -> { + record.put(k + "fundRepairCom", v); + }); + } record.put("fundPerRepairSum", repairSiAcct != null ? repairSiAcct.getFundPerSum() : new BigDecimal("0")); record.put("fundComRepairSum", repairSiAcct != null ? repairSiAcct.getFundComSum() : new BigDecimal("0")); + //公积金-补差 + if (StringUtils.isNotEmpty(balanceSiAcct.getFundPerJson())) { + Map fundJson = JSON.parseObject(balanceSiAcct.getFundPerJson(), new HashMap().getClass()); + fundJson.forEach((k, v) -> { + record.put(k + "fundBalancePer", v); + }); + } + if (StringUtils.isNotEmpty(balanceSiAcct.getFundComJson())) { + Map fundJson = JSON.parseObject(balanceSiAcct.getFundComJson(), new HashMap().getClass()); + fundJson.forEach((k, v) -> { + record.put(k + "fundBalanceCom", v); + }); + } record.put("fundPerBalanceSum", balanceSiAcct != null ? balanceSiAcct.getFundPerSum() : new BigDecimal("0")); record.put("fundComBalanceSum", balanceSiAcct != null ? balanceSiAcct.getFundComSum() : new BigDecimal("0")); + //其他福利-正常缴纳 + if (StringUtils.isNotEmpty(commonSiAcct.getOtherPerJson())) { + Map otherJson = JSON.parseObject(commonSiAcct.getOtherPerJson(), new HashMap().getClass()); + otherJson.forEach((k, v) -> { + record.put(k + "otherCommonPer", v); + }); + } + if (StringUtils.isNotEmpty(commonSiAcct.getOtherComJson())) { + Map otherJson = JSON.parseObject(commonSiAcct.getOtherComJson(), new HashMap().getClass()); + otherJson.forEach((k, v) -> { + record.put(k + "otherCommonCom", v); + }); + } record.put("otherPerCommonSum", commonSiAcct != null ? commonSiAcct.getOtherPerSum() : new BigDecimal("0")); record.put("otherComCommonSum", commonSiAcct != null ? commonSiAcct.getOtherComSum() : new BigDecimal("0")); + //其他福利-补缴 + if (StringUtils.isNotEmpty(repairSiAcct.getOtherPerJson())) { + Map otherJson = JSON.parseObject(repairSiAcct.getOtherPerJson(), new HashMap().getClass()); + otherJson.forEach((k, v) -> { + record.put(k + "otherRepairPer", v); + }); + } + if (StringUtils.isNotEmpty(repairSiAcct.getOtherComJson())) { + Map otherJson = JSON.parseObject(repairSiAcct.getOtherComJson(), new HashMap().getClass()); + otherJson.forEach((k, v) -> { + record.put(k + "otherRepairCom", v); + }); + } record.put("otherPerRepairSum", repairSiAcct != null ? repairSiAcct.getOtherPerSum() : new BigDecimal("0")); record.put("otherComRepairSum", repairSiAcct != null ? repairSiAcct.getOtherComSum() : new BigDecimal("0")); + //其他福利-补差 + if (StringUtils.isNotEmpty(balanceSiAcct.getOtherPerJson())) { + Map otherJson = JSON.parseObject(balanceSiAcct.getOtherPerJson(), new HashMap().getClass()); + otherJson.forEach((k, v) -> { + record.put(k + "otherBalancePer", v); + }); + } + if (StringUtils.isNotEmpty(balanceSiAcct.getOtherComJson())) { + Map otherJson = JSON.parseObject(balanceSiAcct.getOtherComJson(), new HashMap().getClass()); + otherJson.forEach((k, v) -> { + record.put(k + "otherBalanceCom", v); + }); + } record.put("otherPerBalanceSum", balanceSiAcct != null ? balanceSiAcct.getOtherPerSum() : new BigDecimal("0")); record.put("otherComBalanceSum", balanceSiAcct != null ? balanceSiAcct.getOtherComSum() : new BigDecimal("0")); @@ -981,34 +1098,48 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } Map result = new LinkedHashMap<>(); + + Map commonResult = new LinkedHashMap<>(); + Map repairResult = new LinkedHashMap<>(); + Map balanceResult = new LinkedHashMap<>(); + result.put(SalaryI18nUtil.getI18nLabel(100393, "个人合计"), "perSum"); result.put(SalaryI18nUtil.getI18nLabel(100388, "社保个人合计"), "socialPerSum"); result.put(SalaryI18nUtil.getI18nLabel(100390, "公积金个人合计"), "fundPerSum"); result.put(SalaryI18nUtil.getI18nLabel(100392, "其他福利个人合计"), "otherPerSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "个人正常缴纳合计"), "perCommonSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "社保个人正常缴纳合计"), "socialPerCommonSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "公积金个人正常缴纳合计"), "fundPerCommonSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "其他福利个人正常缴纳合计"), "otherPerCommonSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "个人补缴合计"), "perRepairSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "社保个人补缴合计"), "socialPerRepairSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "公积金个人补缴合计"), "fundPerRepairSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "其他福利个人补缴合计"), "otherPerRepairSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "个人补差合计"), "perBalanceSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "社保个人补差合计"), "socialPerBalanceSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "公积金个人补差合计"), "fundPerBalanceSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "其他福利个人补差合计"), "otherPerBalanceSum"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "个人正常缴纳合计"), "perCommonSum"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "社保个人正常缴纳合计"), "socialPerCommonSum"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "公积金个人正常缴纳合计"), "fundPerCommonSum"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "其他福利个人正常缴纳合计"), "otherPerCommonSum"); + repairResult.put(SalaryI18nUtil.getI18nLabel(0, "个人补缴合计"), "perRepairSum"); + repairResult.put(SalaryI18nUtil.getI18nLabel(0, "社保个人补缴合计"), "socialPerRepairSum"); + repairResult.put(SalaryI18nUtil.getI18nLabel(0, "公积金个人补缴合计"), "fundPerRepairSum"); + repairResult.put(SalaryI18nUtil.getI18nLabel(0, "其他福利个人补缴合计"), "otherPerRepairSum"); + balanceResult.put(SalaryI18nUtil.getI18nLabel(0, "个人补差合计"), "perBalanceSum"); + balanceResult.put(SalaryI18nUtil.getI18nLabel(0, "社保个人补差合计"), "socialPerBalanceSum"); + balanceResult.put(SalaryI18nUtil.getI18nLabel(0, "公积金个人补差合计"), "fundPerBalanceSum"); + balanceResult.put(SalaryI18nUtil.getI18nLabel(0, "其他福利个人补差合计"), "otherPerBalanceSum"); Map categoryIdNameMap = getSICategoryService(user).categoryIdNameMap(); list.stream().forEach(item -> { if (Objects.equals(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), item.getWelfareType())) { result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(87159, "个人"), item.getId() + "socialPer"); + commonResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "正常缴纳个人"), item.getId() + "socialCommonPer"); + repairResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补缴个人"), item.getId() + "socialRepairPer"); + balanceResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补差个人"), item.getId() + "socialBalancePer"); } if (Objects.equals(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), item.getWelfareType())) { result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(87159, "个人"), item.getId() + "fundPer"); + commonResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "正常缴纳个人"), item.getId() + "fundCommonPer"); + repairResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补缴个人"), item.getId() + "fundRepairPer"); + balanceResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补差个人"), item.getId() + "fundBalancePer"); } if (Objects.equals(WelfareTypeEnum.OTHER.getValue(), item.getWelfareType())) { result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(87159, "个人"), item.getId() + "otherPer"); + commonResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "正常缴纳个人"), item.getId() + "otherCommonPer"); + repairResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补缴个人"), item.getId() + "otherRepairPer"); + balanceResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补差个人"), item.getId() + "otherBalancePer"); } }); result.put(SalaryI18nUtil.getI18nLabel(100397, "单位合计"), "comSum"); @@ -1016,30 +1147,43 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { result.put(SalaryI18nUtil.getI18nLabel(100395, "公积金单位合计"), "fundComSum"); result.put(SalaryI18nUtil.getI18nLabel(100396, "其他福利单位合计"), "otherComSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "单位正常缴纳合计"), "comCommonSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "社保单位正常缴纳合计"), "socialComCommonSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "公积金单位正常缴纳合计"), "fundComCommonSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "其他福利单位正常缴纳合计"), "otherComCommonSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "单位补缴合计"), "comRepairSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "社保单位补缴合计"), "socialComRepairSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "公积金单位补缴合计"), "fundComRepairSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "其他福利单位补缴合计"), "otherComRepairSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "单位补差合计"), "comBalanceSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "社保单位补差合计"), "socialComBalanceSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "公积金单位补差合计"), "fundComBalanceSum"); - result.put(SalaryI18nUtil.getI18nLabel(0, "其他福利单位补差合计"), "otherComBalanceSum"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "单位正常缴纳合计"), "comCommonSum"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "社保单位正常缴纳合计"), "socialComCommonSum"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "公积金单位正常缴纳合计"), "fundComCommonSum"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "其他福利单位正常缴纳合计"), "otherComCommonSum"); + repairResult.put(SalaryI18nUtil.getI18nLabel(0, "单位补缴合计"), "comRepairSum"); + repairResult.put(SalaryI18nUtil.getI18nLabel(0, "社保单位补缴合计"), "socialComRepairSum"); + repairResult.put(SalaryI18nUtil.getI18nLabel(0, "公积金单位补缴合计"), "fundComRepairSum"); + repairResult.put(SalaryI18nUtil.getI18nLabel(0, "其他福利单位补缴合计"), "otherComRepairSum"); + balanceResult.put(SalaryI18nUtil.getI18nLabel(0, "单位补差合计"), "comBalanceSum"); + balanceResult.put(SalaryI18nUtil.getI18nLabel(0, "社保单位补差合计"), "socialComBalanceSum"); + balanceResult.put(SalaryI18nUtil.getI18nLabel(0, "公积金单位补差合计"), "fundComBalanceSum"); + balanceResult.put(SalaryI18nUtil.getI18nLabel(0, "其他福利单位补差合计"), "otherComBalanceSum"); list.stream().forEach(item -> { if (Objects.equals(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), item.getWelfareType())) { result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(100289, "单位"), item.getId() + "socialCom"); + commonResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "正常缴纳单位"), item.getId() + "socialCommonCom"); + repairResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补缴单位"), item.getId() + "socialRepairCom"); + balanceResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补差单位"), item.getId() + "socialBalanceCom"); } if (Objects.equals(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), item.getWelfareType())) { result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(100289, "单位"), item.getId() + "fundCom"); + commonResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "正常缴纳单位"), item.getId() + "fundCommonCom"); + repairResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补缴单位"), item.getId() + "fundRepairCom"); + balanceResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补差单位"), item.getId() + "fundBalanceCom"); } if (Objects.equals(WelfareTypeEnum.OTHER.getValue(), item.getWelfareType())) { result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(100289, "单位"), item.getId() + "otherCom"); + commonResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "正常缴纳单位"), item.getId() + "otherCommonCom"); + repairResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补缴单位"), item.getId() + "otherRepairCom"); + balanceResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补差单位"), item.getId() + "otherBalanceCom"); } }); + + result.putAll(commonResult); + result.putAll(repairResult); + result.putAll(balanceResult); return result; } From 6279f0d8c95c4a00b6ee1382d40b51e3219dc933 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Fri, 14 Jul 2023 09:55:36 +0800 Subject: [PATCH 47/86] =?UTF-8?q?=E5=B7=A5=E8=B5=84=E5=8D=95=E5=8F=8D?= =?UTF-8?q?=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salarybill/SalarySendInfoMapper.java | 7 +++ .../salarybill/SalarySendInfoMapper.xml | 14 ++++++ .../mapper/salarybill/SalarySendMapper.java | 2 + .../mapper/salarybill/SalarySendMapper.xml | 12 +++++ .../salarybill/SalaryTemplateMapper.xml | 20 +++++--- .../salary/service/SalarySendService.java | 4 +- .../salary/service/SalaryTemplateService.java | 6 +++ .../service/impl/SalarySendServiceImpl.java | 21 ++++++--- .../impl/SalaryTemplateServiceImpl.java | 5 ++ .../timer/AutoConfirmSalaryBillCronJob.java | 46 +++++++++++-------- 10 files changed, 103 insertions(+), 34 deletions(-) diff --git a/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.java b/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.java index 93f184d84..2da9e21b9 100644 --- a/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.java +++ b/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.java @@ -107,4 +107,11 @@ public interface SalarySendInfoMapper { * @param needAutoIds */ void autoConfirmSalaryBill(@Param("ids") List needAutoIds); + + /** + * 根据薪资账套id获取已发送,确认状态为未确认的工资单 + * @param salarySobIds + * @return + */ + List listUnConfirmedSendInfo(@Param("salarySobIds") List salarySobIds); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml b/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml index 506afd10c..b8e3c1f55 100644 --- a/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml +++ b/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml @@ -717,6 +717,20 @@ + diff --git a/src/com/engine/salary/mapper/salarybill/SalarySendMapper.java b/src/com/engine/salary/mapper/salarybill/SalarySendMapper.java index ef1e6f6cb..95e3e73ed 100644 --- a/src/com/engine/salary/mapper/salarybill/SalarySendMapper.java +++ b/src/com/engine/salary/mapper/salarybill/SalarySendMapper.java @@ -65,4 +65,6 @@ public interface SalarySendMapper { void deleteBySalaryAcctRecordIds(@Param("salaryAcctRecordId") Collection ids); List getNeedSendListBySalarySobIds(@Param("salarySobIds")List salarySobIds); + + List getByIds(@Param("ids") List salarySendId); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salarybill/SalarySendMapper.xml b/src/com/engine/salary/mapper/salarybill/SalarySendMapper.xml index 5b87e3774..c78a00525 100644 --- a/src/com/engine/salary/mapper/salarybill/SalarySendMapper.xml +++ b/src/com/engine/salary/mapper/salarybill/SalarySendMapper.xml @@ -252,6 +252,18 @@ + diff --git a/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml b/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml index 5eb01a1ed..d48505e58 100644 --- a/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml +++ b/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml @@ -48,13 +48,16 @@ , t.salary_item_null_status , t.salary_item_zero_status , t.salary_item_setting - , replenish_name - , replenish_rule - , replenish_salary_item_setting - , auto_send_status - , auto_send_cycle_type - , auto_send_day_of_month - , auto_send_time_of_day + , t.replenish_name + , t.replenish_rule + , t.replenish_salary_item_setting + , t.auto_send_status + , t.auto_send_cycle_type + , t.auto_send_day_of_month + , t.auto_send_time_of_day + , t.ack_feedback_status + , t.auto_ack_days + , t.feedback_url , t.create_time , t.update_time , t.creator @@ -324,6 +327,9 @@ AND auto_send_status = #{autoSendStatus} + + AND ack_feedback_status = #{ackFeedbackStatus} + AND salary_sob_id IN diff --git a/src/com/engine/salary/service/SalarySendService.java b/src/com/engine/salary/service/SalarySendService.java index f0cab60a3..90da3440f 100644 --- a/src/com/engine/salary/service/SalarySendService.java +++ b/src/com/engine/salary/service/SalarySendService.java @@ -207,11 +207,13 @@ public interface SalarySendService { * @return * @return */ - List listAllUnConfirmedSendInfo(); + List listUnConfirmedSendInfo(List salarySobIds); /** * 自动确认工资单 * @param needAutoIds */ void autoConfirmSalaryBill(List needAutoIds); + + List getByIds(List salarySendId); } diff --git a/src/com/engine/salary/service/SalaryTemplateService.java b/src/com/engine/salary/service/SalaryTemplateService.java index 37c13637e..bdf8826cb 100644 --- a/src/com/engine/salary/service/SalaryTemplateService.java +++ b/src/com/engine/salary/service/SalaryTemplateService.java @@ -125,4 +125,10 @@ public interface SalaryTemplateService { * 获取所有设置了定时发送的默认工资单模板 */ List getAutoSendTemplate(); + + /** + * 获取所有开启了工资单确认反馈的默认工资单模板 + * @return + */ + List listNeedAckDefaultTemplate(); } diff --git a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java index 6f951f136..38e07dc39 100644 --- a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java @@ -1620,12 +1620,10 @@ public class SalarySendServiceImpl extends Service implements SalarySendService } @Override - public List listAllUnConfirmedSendInfo() { - return getSalarySendInfoMapper().listSome( - SalarySendInfoPO.builder() - .billConfirmStatus(BillConfimStatusEnum.UNCONFIRMED.getValue()) - .sendStatus(1) - .build()); + public List listUnConfirmedSendInfo(List salarySobIds) { + if(CollectionUtils.isEmpty(salarySobIds)) + return Collections.emptyList(); + return getSalarySendInfoMapper().listUnConfirmedSendInfo(salarySobIds); } @Override @@ -1633,6 +1631,15 @@ public class SalarySendServiceImpl extends Service implements SalarySendService if(CollectionUtils.isEmpty(needAutoSendIds)){ return; } - getSalarySendInfoMapper().autoConfirmSalaryBill(needAutoSendIds); + List> partition = Lists.partition((List) needAutoSendIds, 500); + partition.forEach(getSalarySendInfoMapper()::autoConfirmSalaryBill); + } + + @Override + public List getByIds(List salarySendId) { + if(CollectionUtils.isEmpty(salarySendId)){ + return Collections.emptyList(); + } + return getSalarySendMapper().getByIds(salarySendId); } } diff --git a/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java b/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java index 72ed6c76e..7d0b790c5 100644 --- a/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryTemplateServiceImpl.java @@ -355,4 +355,9 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate public List getAutoSendTemplate() { return mapper.listSome(SalaryTemplatePO.builder().autoSendStatus(NumberUtils.INTEGER_ONE).useType(NumberUtils.INTEGER_ONE).deleteType(NumberUtils.INTEGER_ZERO).build()); } + + @Override + public List listNeedAckDefaultTemplate() { + return mapper.listSome(SalaryTemplatePO.builder().useType(NumberUtils.INTEGER_ONE).ackFeedbackStatus(NumberUtils.INTEGER_ONE).build()); + } } diff --git a/src/com/engine/salary/timer/AutoConfirmSalaryBillCronJob.java b/src/com/engine/salary/timer/AutoConfirmSalaryBillCronJob.java index 79abafde8..9ddee0497 100644 --- a/src/com/engine/salary/timer/AutoConfirmSalaryBillCronJob.java +++ b/src/com/engine/salary/timer/AutoConfirmSalaryBillCronJob.java @@ -2,22 +2,24 @@ package com.engine.salary.timer; import com.engine.common.util.ServiceUtil; import com.engine.salary.entity.salaryBill.po.SalarySendInfoPO; +import com.engine.salary.entity.salaryBill.po.SalarySendPO; +import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO; import com.engine.salary.service.SalarySendService; +import com.engine.salary.service.SalaryTemplateService; import com.engine.salary.service.impl.SalarySendServiceImpl; -import com.engine.salary.sys.constant.SalarySysConstant; -import com.engine.salary.sys.entity.po.SalarySysConfPO; -import com.engine.salary.sys.service.SalarySysConfService; -import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; +import com.engine.salary.service.impl.SalaryTemplateServiceImpl; import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.math.NumberUtils; import weaver.hrm.User; import weaver.interfaces.schedule.BaseCronJob; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -31,8 +33,8 @@ public class AutoConfirmSalaryBillCronJob extends BaseCronJob { return ServiceUtil.getService(SalarySendServiceImpl.class, user); } - private SalarySysConfService getSalarySysConfService(User user) { - return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); + private SalaryTemplateService getSalaryTemplateService(User user) { + return ServiceUtil.getService(SalaryTemplateServiceImpl.class, user); } @Override @@ -40,20 +42,26 @@ public class AutoConfirmSalaryBillCronJob extends BaseCronJob { User user = new User(); user.setUid(1); user.setLoginid("sysadmin"); - // 获取超时时间 - SalarySysConfPO feedbackPO = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_SEND_FEEDBACK); - if(ObjectUtils.isEmpty(feedbackPO) || StringUtils.equals(feedbackPO.getConfValue(), "0")){ - return; - } - SalarySysConfPO salaryAutoConfirmPO = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_AUTO_ACK_DAYS); - Long timeOutDays = ObjectUtils.isNotEmpty(salaryAutoConfirmPO) && NumberUtils.isCreatable(salaryAutoConfirmPO.getConfValue()) ? - Long.valueOf(salaryAutoConfirmPO.getConfValue()) : 7L; + // 获取所有需要确认反馈的默认工资单模板 + List templates = getSalaryTemplateService(user).listNeedAckDefaultTemplate(); + // key:薪资账套id,value:对应的自动确认天数 + Map salarySobAckDaysMap = SalaryEntityUtil.convert2Map(templates, SalaryTemplatePO::getSalarySobId, SalaryTemplatePO::getAutoAckDays); + // 根据薪资账套id获取已发送,确认状态为未确认的工资单 + List unConfirmedList = getSalarySendService(user).listUnConfirmedSendInfo(new ArrayList<>(salarySobAckDaysMap.keySet())); + List sendList = getSalarySendService(user).getByIds(unConfirmedList.stream().map(SalarySendInfoPO::getSalarySendId).distinct().collect(Collectors.toList())); + // key:工资单发放id,value:自动确认超时天数 + HashMap autoAckDaysMap = new HashMap<>(); + sendList.stream().forEach(send -> { + Integer autoAckDays = salarySobAckDaysMap.getOrDefault(send.getSalarySobId(), 7); + autoAckDaysMap.put(send.getId(), autoAckDays); + }); LocalDateTime now = LocalDateTime.now(); - // 获取所有确认状态为 未确认的工资单 - List unConfirmedList = getSalarySendService(user).listAllUnConfirmedSendInfo(); List needAutoIds = unConfirmedList.stream().filter(po -> { LocalDateTime sendDateTime = SalaryDateUtil.dateToLocalDateTime(po.getSendTime()); - LocalDateTime autoDateTime = sendDateTime.plus(timeOutDays, ChronoUnit.DAYS); + Integer autoDays = autoAckDaysMap.get(po.getSalarySendId()); + if (ObjectUtils.isEmpty(autoDays)) + return false; + LocalDateTime autoDateTime = sendDateTime.plus(autoDays, ChronoUnit.DAYS); return !autoDateTime.isAfter(now); }).map(SalarySendInfoPO::getId).collect(Collectors.toList()); // 自动确认 From faf9636a0ddc179b59a16813c17213cf4de9f9d2 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Fri, 14 Jul 2023 11:34:53 +0800 Subject: [PATCH 48/86] =?UTF-8?q?=E8=96=AA=E8=B5=84=E9=A1=B9=E7=9B=AE-?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E6=97=B6=E9=9A=90=E8=97=8F=20temp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/entity/salaryitem/bo/SalaryItemBO.java | 2 ++ .../entity/salaryitem/dto/SalaryFieldListDTO.java | 5 +++++ .../entity/salaryitem/dto/SalaryItemListDTO.java | 5 +++++ .../entity/salaryitem/param/SalaryItemSaveParam.java | 4 ++++ .../salary/entity/salaryitem/po/SalaryItemPO.java | 5 +++++ .../salary/mapper/salaryitem/SalaryItemMapper.xml | 12 +++++++++++- .../salary/service/impl/SalaryItemServiceImpl.java | 1 + 7 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java b/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java index 80ea657a2..0a7dbcdb2 100644 --- a/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java +++ b/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java @@ -99,6 +99,7 @@ public class SalaryItemBO { .systemName(sysSalaryItemNameMap.getOrDefault(salaryItemPO.getSysSalaryItemId(), StringUtils.EMPTY)) .useInEmployeeSalary(salaryItemPO.getUseInEmployeeSalary()) .useDefault(salaryItemPO.getUseDefault()) + .hideDefault(salaryItemPO.getHideDefault() == null ? 0 : salaryItemPO.getHideDefault()) .roundingMode(Optional.ofNullable(salaryRoundingModeEnum) .map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel())) .orElse(StringUtils.EMPTY)) @@ -256,6 +257,7 @@ public class SalaryItemBO { .sysSalaryItemId(NumberUtils.LONG_ZERO) .useDefault(saveParam.getUseDefault()) .useInEmployeeSalary(saveParam.getUseInEmployeeSalary()) + .hideDefault(saveParam.getHideDefault()) .roundingMode(saveParam.getRoundingMode() == null ? SalaryRoundingModeEnum.ROUNDING.getValue() : saveParam.getRoundingMode()) .pattern(Optional.ofNullable(saveParam.getPattern()).orElse(2)) .valueType(saveParam.getValueType()) diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryFieldListDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryFieldListDTO.java index 96eaf0bec..b7461398b 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryFieldListDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryFieldListDTO.java @@ -40,6 +40,11 @@ public class SalaryFieldListDTO { @TableTitle(title = "默认使用",dataIndex = "useDefault",key = "useDefault") private Integer useDefault; + //核算时隐藏 + @SalaryTableColumn(text = "默认隐藏", width = "10%", column = "hideDefault") + @TableTitle(title = "默认隐藏",dataIndex = "hideDefault",key = "hideDefault") + private Integer hideDefault; + //进位规则 @SalaryTableColumn(text = "进位规则", width = "10%", column = "roundingMode",transmethod = "com.engine.salary.transmethod.TransMethod.roundingMode") @TableTitle(title = "进位规则",dataIndex = "roundingMode",key = "roundingMode") diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java index 510a75f18..02c51998c 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java @@ -51,6 +51,11 @@ public class SalaryItemListDTO { @TableTitle(title = "默认使用",dataIndex = "useDefault",key = "useDefault") private Integer useDefault; + //核算时隐藏 + @SalaryTableColumn(text = "默认隐藏", width = "10%", column = "hideDefault") + @TableTitle(title = "默认隐藏",dataIndex = "hideDefault",key = "hideDefault") + private Integer hideDefault; + //进位规则 @SalaryTableColumn(text = "进位规则", width = "10%", column = "roundingMode",transmethod = "com.engine.salary.transmethod.TransMethod.roundingMode") @TableTitle(title = "进位规则",dataIndex = "roundingMode",key = "roundingMode") diff --git a/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java b/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java index 00325afc1..5d5db6cb1 100644 --- a/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java +++ b/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java @@ -49,6 +49,10 @@ public class SalaryItemSaveParam { //薪资档案引用 private Integer useInEmployeeSalary; + //核算时默认隐藏 + @DataCheck(require = true, message = "默认隐藏不允许为空") + private Integer hideDefault; + /** * 舍入规则 diff --git a/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java b/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java index f54afc630..3115f0efa 100644 --- a/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java +++ b/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java @@ -64,6 +64,11 @@ public class SalaryItemPO { */ private Integer useInEmployeeSalary; + /** + * 核算时隐藏 + */ + private Integer hideDefault; + /** * 进位规则 * diff --git a/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml b/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml index 557ff7364..7dd705c72 100644 --- a/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml +++ b/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml @@ -50,7 +50,8 @@ t.data_type, t.shared_type, t.tax_agent_ids, - t.sorted_index + t.sorted_index, + t.hide_default @@ -168,6 +169,9 @@ use_in_employee_salary, + + hide_default, + rounding_mode, @@ -236,6 +240,9 @@ #{useInEmployeeSalary}, + + #{hideDefault}, + #{roundingMode}, @@ -307,6 +314,9 @@ use_in_employee_salary=#{useInEmployeeSalary}, + + hide_default=#{hideDefault}, + rounding_mode=#{roundingMode}, diff --git a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java index 95b6bf39e..d2c0999f3 100644 --- a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java @@ -236,6 +236,7 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService newSalaryItemPO.setName(saveParam.getName()); newSalaryItemPO.setUseDefault(saveParam.getUseDefault()); newSalaryItemPO.setUseInEmployeeSalary(saveParam.getUseInEmployeeSalary()); + newSalaryItemPO.setHideDefault(saveParam.getHideDefault()); newSalaryItemPO.setRoundingMode(saveParam.getRoundingMode()); newSalaryItemPO.setPattern(saveParam.getPattern()); // newSalaryItemPO.setValueType(saveParam.getValueType()); From 2e2954f70653ecdb5ab9d8f8614858ea0b0e3e35 Mon Sep 17 00:00:00 2001 From: sy Date: Fri, 14 Jul 2023 14:43:30 +0800 Subject: [PATCH 49/86] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A0=B8=E7=AE=97=EF=BC=8C=E8=A1=A5=E7=BC=B4?= =?UTF-8?q?=E5=92=8C=E8=A1=A5=E5=B7=AE=E4=B8=AA=E4=BA=BA=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E9=A1=B9=E6=98=8E=E7=BB=86=E6=A0=B8=E7=AE=97=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SIAccountServiceImpl.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index aef9ef3c2..c7bb46933 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -955,13 +955,13 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { record.put("socialPerCommonSum", commonSiAcct != null ? commonSiAcct.getSocialPerSum() : new BigDecimal("0")); record.put("socialComCommonSum", commonSiAcct != null ? commonSiAcct.getSocialComSum() : new BigDecimal("0")); //社保-补缴 - if (StringUtils.isNotEmpty(repairSiAcct.getSocialPerJson())) { + if (repairSiAcct != null && StringUtils.isNotEmpty(repairSiAcct.getSocialPerJson())) { Map socialJson = JSON.parseObject(repairSiAcct.getSocialPerJson(), new HashMap().getClass()); socialJson.forEach((k, v) -> { record.put(k + "socialRepairPer", v); }); } - if (StringUtils.isNotEmpty(repairSiAcct.getSocialComJson())) { + if (repairSiAcct != null && StringUtils.isNotEmpty(repairSiAcct.getSocialComJson())) { Map socialJson = JSON.parseObject(repairSiAcct.getSocialComJson(), new HashMap().getClass()); socialJson.forEach((k, v) -> { record.put(k + "socialRepairCom", v); @@ -970,13 +970,13 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { record.put("socialPerRepairSum", repairSiAcct != null ? repairSiAcct.getSocialPerSum() : new BigDecimal("0")); record.put("socialComRepairSum", repairSiAcct != null ? repairSiAcct.getSocialComSum() : new BigDecimal("0")); //社保-补差 - if (StringUtils.isNotEmpty(balanceSiAcct.getSocialPerJson())) { + if (balanceSiAcct != null && StringUtils.isNotEmpty(balanceSiAcct.getSocialPerJson())) { Map socialJson = JSON.parseObject(balanceSiAcct.getSocialPerJson(), new HashMap().getClass()); socialJson.forEach((k, v) -> { record.put(k + "socialBalancePer", v); }); } - if (StringUtils.isNotEmpty(balanceSiAcct.getSocialComJson())) { + if (balanceSiAcct != null && StringUtils.isNotEmpty(balanceSiAcct.getSocialComJson())) { Map socialJson = JSON.parseObject(balanceSiAcct.getSocialComJson(), new HashMap().getClass()); socialJson.forEach((k, v) -> { record.put(k + "socialBalanceCom", v); @@ -1001,13 +1001,13 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { record.put("fundPerCommonSum", commonSiAcct != null ? commonSiAcct.getFundPerSum() : new BigDecimal("0")); record.put("fundComCommonSum", commonSiAcct != null ? commonSiAcct.getFundComSum() : new BigDecimal("0")); //公积金-补缴 - if (StringUtils.isNotEmpty(repairSiAcct.getFundPerJson())) { + if (repairSiAcct != null && StringUtils.isNotEmpty(repairSiAcct.getFundPerJson())) { Map fundJson = JSON.parseObject(repairSiAcct.getFundPerJson(), new HashMap().getClass()); fundJson.forEach((k, v) -> { record.put(k + "fundRepairPer", v); }); } - if (StringUtils.isNotEmpty(repairSiAcct.getFundComJson())) { + if (repairSiAcct != null && StringUtils.isNotEmpty(repairSiAcct.getFundComJson())) { Map fundJson = JSON.parseObject(repairSiAcct.getFundComJson(), new HashMap().getClass()); fundJson.forEach((k, v) -> { record.put(k + "fundRepairCom", v); @@ -1016,13 +1016,13 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { record.put("fundPerRepairSum", repairSiAcct != null ? repairSiAcct.getFundPerSum() : new BigDecimal("0")); record.put("fundComRepairSum", repairSiAcct != null ? repairSiAcct.getFundComSum() : new BigDecimal("0")); //公积金-补差 - if (StringUtils.isNotEmpty(balanceSiAcct.getFundPerJson())) { + if (balanceSiAcct != null && StringUtils.isNotEmpty(balanceSiAcct.getFundPerJson())) { Map fundJson = JSON.parseObject(balanceSiAcct.getFundPerJson(), new HashMap().getClass()); fundJson.forEach((k, v) -> { record.put(k + "fundBalancePer", v); }); } - if (StringUtils.isNotEmpty(balanceSiAcct.getFundComJson())) { + if (balanceSiAcct != null && StringUtils.isNotEmpty(balanceSiAcct.getFundComJson())) { Map fundJson = JSON.parseObject(balanceSiAcct.getFundComJson(), new HashMap().getClass()); fundJson.forEach((k, v) -> { record.put(k + "fundBalanceCom", v); @@ -1047,13 +1047,13 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { record.put("otherPerCommonSum", commonSiAcct != null ? commonSiAcct.getOtherPerSum() : new BigDecimal("0")); record.put("otherComCommonSum", commonSiAcct != null ? commonSiAcct.getOtherComSum() : new BigDecimal("0")); //其他福利-补缴 - if (StringUtils.isNotEmpty(repairSiAcct.getOtherPerJson())) { + if (repairSiAcct != null && StringUtils.isNotEmpty(repairSiAcct.getOtherPerJson())) { Map otherJson = JSON.parseObject(repairSiAcct.getOtherPerJson(), new HashMap().getClass()); otherJson.forEach((k, v) -> { record.put(k + "otherRepairPer", v); }); } - if (StringUtils.isNotEmpty(repairSiAcct.getOtherComJson())) { + if (repairSiAcct != null && StringUtils.isNotEmpty(repairSiAcct.getOtherComJson())) { Map otherJson = JSON.parseObject(repairSiAcct.getOtherComJson(), new HashMap().getClass()); otherJson.forEach((k, v) -> { record.put(k + "otherRepairCom", v); @@ -1062,13 +1062,13 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { record.put("otherPerRepairSum", repairSiAcct != null ? repairSiAcct.getOtherPerSum() : new BigDecimal("0")); record.put("otherComRepairSum", repairSiAcct != null ? repairSiAcct.getOtherComSum() : new BigDecimal("0")); //其他福利-补差 - if (StringUtils.isNotEmpty(balanceSiAcct.getOtherPerJson())) { + if (balanceSiAcct != null && StringUtils.isNotEmpty(balanceSiAcct.getOtherPerJson())) { Map otherJson = JSON.parseObject(balanceSiAcct.getOtherPerJson(), new HashMap().getClass()); otherJson.forEach((k, v) -> { record.put(k + "otherBalancePer", v); }); } - if (StringUtils.isNotEmpty(balanceSiAcct.getOtherComJson())) { + if (balanceSiAcct != null && StringUtils.isNotEmpty(balanceSiAcct.getOtherComJson())) { Map otherJson = JSON.parseObject(balanceSiAcct.getOtherComJson(), new HashMap().getClass()); otherJson.forEach((k, v) -> { record.put(k + "otherBalanceCom", v); From b0e8da2ad4c1f02c3c800c86fac18c12b949aa87 Mon Sep 17 00:00:00 2001 From: sy Date: Fri, 14 Jul 2023 17:32:16 +0800 Subject: [PATCH 50/86] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E8=A7=84=E5=88=99=E8=B4=A6=E5=8D=95=E6=9C=88?= =?UTF-8?q?=E4=BB=BD=E9=80=86=E5=BA=8F=E3=80=81=E6=9B=B4=E6=96=B0=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E9=80=86=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/mapper/siaccount/InsuranceAccountBatchMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml b/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml index 4aeeafc25..784c6e848 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml @@ -156,7 +156,7 @@ left join hrsa_tax_agent t1 on t.payment_organization = t1.id WHERE t.delete_type = 0 - ORDER BY t.bill_month DESC + ORDER BY t.bill_month DESC, t.update_time DESC diff --git a/src/com/engine/salary/service/impl/SalaryBillBaseSetServiceImpl.java b/src/com/engine/salary/service/impl/SalaryBillBaseSetServiceImpl.java index 476717d7c..73a5a184b 100644 --- a/src/com/engine/salary/service/impl/SalaryBillBaseSetServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryBillBaseSetServiceImpl.java @@ -142,6 +142,7 @@ public class SalaryBillBaseSetServiceImpl extends Service implements SalaryBillB // 未开启工资单确认 defaultAckFeedBackDTO.setAckStatus("0"); defaultAckFeedBackDTO.setAutoAckDays(0); + defaultAckFeedBackDTO.setFeedBackUrl("/"); return defaultAckFeedBackDTO; } defaultAckFeedBackDTO.setAckStatus(ackStatus); diff --git a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java index 38e07dc39..9fd325cf6 100644 --- a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java @@ -480,8 +480,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService List salaryTemplates = getSalaryTemplateService(user).getDefaultTemplates(Collections.singletonList(salarySendPO.getSalarySobId())); Integer ackFeedbackStatus = salaryTemplates.get(0).getAckFeedbackStatus(); // 更新查看状态 - if ( (ackFeedbackStatus!=null && NumberUtils.compare(ackFeedbackStatus,1) == 1) - && (salarySendInfo.getBillReadStatus() == null || NumberUtils.compare(salarySendInfo.getBillReadStatus(),BillReadStatusEnum.UNREAD.getValue()) == 0)) { + if (salarySendInfo.getBillReadStatus() == null || NumberUtils.compare(salarySendInfo.getBillReadStatus(),BillReadStatusEnum.UNREAD.getValue()) == 0) { salarySendInfo.setBillReadStatus(BillReadStatusEnum.READED.getValue()); salarySendInfo.setUpdateTime(new Date()); getSalarySendInfoMapper().updateIgnoreNull(salarySendInfo); @@ -610,7 +609,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService map.put("salaryTemplate", salaryTemplate); map.put("salaryAcctResult", salaryAcctResultS); // 工资单发送人、是否已确认 - if (ackFeedbackStatus!=null && NumberUtils.compare(ackFeedbackStatus,1) == 1) { + if (ackFeedbackStatus!=null && NumberUtils.compare(ackFeedbackStatus,1) == 0) { map.put("confirmStatus", salarySendInfo.getBillConfirmStatus() == null ? "0" : salarySendInfo.getBillConfirmStatus().toString()); map.put("sendEmployeeId", salarySendInfo.getSendEmployeeId()); map.put("feedbackWorkflowUrl",salaryTemplates.get(0).getFeedbackUrl()); @@ -669,7 +668,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService throw new SalaryRunTimeException("工资单不存在或已被删除"); List salaryTemplates = getSalaryTemplateService(user).getDefaultTemplates(Collections.singletonList(salarySendPO.getSalarySobId())); Integer ackFeedbackStatus = salaryTemplates.get(0).getAckFeedbackStatus(); - if (ackFeedbackStatus!=null && NumberUtils.compare(ackFeedbackStatus,1) == 1) { + if (ackFeedbackStatus!=null && NumberUtils.compare(ackFeedbackStatus,1) == 0) { // 默认为空时,未读未确认 pageInfo.getList().stream().forEach(obj -> { SalarySendInfoListDTO dto = (SalarySendInfoListDTO) obj; @@ -769,6 +768,9 @@ public class SalarySendServiceImpl extends Service implements SalarySendService Map map = JsonUtil.parseMap(salaryTemplateContent, Object.class); return SalaryTemplatePO.builder() .id(Long.valueOf(map.getOrDefault("id", "0").toString())) + .ackFeedbackStatus(Integer.valueOf(map.getOrDefault("ackFeedbackStatus", "0").toString())) + .autoAckDays(Integer.valueOf(map.getOrDefault("autoAckDays", "0").toString())) + .feedbackUrl(map.getOrDefault("feedbackUrl", "").toString()) .name(map.getOrDefault("name", "").toString()) .salarySobId(Long.valueOf(map.getOrDefault("salarySobId", "0").toString())) .useType(Integer.valueOf(map.getOrDefault("useType", "0").toString())) diff --git a/src/com/engine/salary/wrapper/SalaryTemplateWrapper.java b/src/com/engine/salary/wrapper/SalaryTemplateWrapper.java index 640a498d2..d5d7a68cf 100644 --- a/src/com/engine/salary/wrapper/SalaryTemplateWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryTemplateWrapper.java @@ -159,7 +159,7 @@ public class SalaryTemplateWrapper extends Service { salaryTemplateBaseSetDTO.setSalarySob(po.getSalarySobId()); salaryTemplateBaseSetDTO.setSendEmail(po.getSendEmailId()); salaryTemplateBaseSetDTO.setAutoSendStatus(po.getAutoSendStatus() == null ? false : po.getAutoSendStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue())); - salaryTemplateBaseSetDTO.setAckFeedbackStatus(po.getAckFeedbackStatus() == null ? false : NumberUtils.compare(po.getAckFeedbackStatus(), 1) == 1); + salaryTemplateBaseSetDTO.setAckFeedbackStatus(po.getAckFeedbackStatus() == null ? false : NumberUtils.compare(po.getAckFeedbackStatus(), 1) == 0); salaryTemplateBaseSetDTO.setAutoAckDays(ObjectUtils.isEmpty(po.getAutoAckDays()) ? 7 : po.getAutoAckDays()); // 规则赋值 如果为ALL传“” 如果为byRule传薪资项目ID salaryTemplateBaseSetDTO.setReplenishRule(SalaryTemplateReplenishRuleEnum.ALL.getValue().equals(po.getReplenishRule()) ? "" : po.getReplenishRule()); @@ -229,8 +229,6 @@ public class SalaryTemplateWrapper extends Service { salaryTemplateShowSetDTO.setTextContentPosition(po.getTextContentPosition().toString()); salaryTemplateShowSetDTO.setSalaryItemNullStatus(po.getSalaryItemNullStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue())); salaryTemplateShowSetDTO.setSalaryItemZeroStatus(po.getSalaryItemZeroStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue())); - salaryTemplateShowSetDTO.setAckFeedbackStatus(po.getAckFeedbackStatus() != null && NumberUtils.compare(po.getAckFeedbackStatus(),1) == 1); - salaryTemplateShowSetDTO.setAutoAckDays(ObjectUtils.isEmpty(po.getAutoAckDays()) ? 7 : po.getAutoAckDays()); } Map salaryTemplateShowSet = new HashMap<>(); From 1b289319a4f070e8adae0613d2fa4812474c0125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 17 Jul 2023 11:52:10 +0800 Subject: [PATCH 53/86] =?UTF-8?q?=E5=B7=A5=E8=B5=84=E5=8D=95=E5=8F=8D?= =?UTF-8?q?=E9=A6=88sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202307170403.sql | 24 +++++++++++++++++++ resource/sqlupgrade/GS/sql202307170403.sql | 24 +++++++++++++++++++ resource/sqlupgrade/JC/sql202307170403.sql | 24 +++++++++++++++++++ resource/sqlupgrade/Mysql/sql202307170403.sql | 9 +++++++ .../sqlupgrade/Oracle/sql202307170403.sql | 23 ++++++++++++++++++ resource/sqlupgrade/PG/sql202307170403.sql | 9 +++++++ .../sqlupgrade/SQLServer/sql202307170403.sql | 11 +++++++++ resource/sqlupgrade/ST/sql202307170403.sql | 24 +++++++++++++++++++ 8 files changed, 148 insertions(+) create mode 100644 resource/sqlupgrade/DM/sql202307170403.sql create mode 100644 resource/sqlupgrade/GS/sql202307170403.sql create mode 100644 resource/sqlupgrade/JC/sql202307170403.sql create mode 100644 resource/sqlupgrade/Mysql/sql202307170403.sql create mode 100644 resource/sqlupgrade/Oracle/sql202307170403.sql create mode 100644 resource/sqlupgrade/PG/sql202307170403.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202307170403.sql create mode 100644 resource/sqlupgrade/ST/sql202307170403.sql diff --git a/resource/sqlupgrade/DM/sql202307170403.sql b/resource/sqlupgrade/DM/sql202307170403.sql new file mode 100644 index 000000000..bc59c53ae --- /dev/null +++ b/resource/sqlupgrade/DM/sql202307170403.sql @@ -0,0 +1,24 @@ +alter table hrsa_salary_send_info +add bill_read_status NUMBER null; +/ + +alter table hrsa_salary_send_info +add bill_confirm_status NUMBER null; +/ + +alter table hrsa_salary_send_info +add send_employee_id NUMBER(38,0) NULL; +/ + +alter table hrsa_salary_template +add ack_feedback_status NUMBER NULL; +/ + +alter table hrsa_salary_template +add auto_ack_days NUMBER NULL; +/ + +alter table hrsa_salary_template +add feedback_url VARCHAR2(500) NULL; +/ + diff --git a/resource/sqlupgrade/GS/sql202307170403.sql b/resource/sqlupgrade/GS/sql202307170403.sql new file mode 100644 index 000000000..bc59c53ae --- /dev/null +++ b/resource/sqlupgrade/GS/sql202307170403.sql @@ -0,0 +1,24 @@ +alter table hrsa_salary_send_info +add bill_read_status NUMBER null; +/ + +alter table hrsa_salary_send_info +add bill_confirm_status NUMBER null; +/ + +alter table hrsa_salary_send_info +add send_employee_id NUMBER(38,0) NULL; +/ + +alter table hrsa_salary_template +add ack_feedback_status NUMBER NULL; +/ + +alter table hrsa_salary_template +add auto_ack_days NUMBER NULL; +/ + +alter table hrsa_salary_template +add feedback_url VARCHAR2(500) NULL; +/ + diff --git a/resource/sqlupgrade/JC/sql202307170403.sql b/resource/sqlupgrade/JC/sql202307170403.sql new file mode 100644 index 000000000..bc59c53ae --- /dev/null +++ b/resource/sqlupgrade/JC/sql202307170403.sql @@ -0,0 +1,24 @@ +alter table hrsa_salary_send_info +add bill_read_status NUMBER null; +/ + +alter table hrsa_salary_send_info +add bill_confirm_status NUMBER null; +/ + +alter table hrsa_salary_send_info +add send_employee_id NUMBER(38,0) NULL; +/ + +alter table hrsa_salary_template +add ack_feedback_status NUMBER NULL; +/ + +alter table hrsa_salary_template +add auto_ack_days NUMBER NULL; +/ + +alter table hrsa_salary_template +add feedback_url VARCHAR2(500) NULL; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202307170403.sql b/resource/sqlupgrade/Mysql/sql202307170403.sql new file mode 100644 index 000000000..a01647d03 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202307170403.sql @@ -0,0 +1,9 @@ +ALTER TABLE hrsa_salary_send_info +ADD COLUMN bill_read_status int NULL, +ADD COLUMN bill_confirm_status int NULL, +ADD COLUMN send_employee_id BIGINT NULL; + +ALTER TABLE hrsa_salary_template +ADD COLUMN ack_feedback_status int NULL, +ADD COLUMN auto_ack_days int NULL, +ADD COLUMN feedback_url varchar(500) NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202307170403.sql b/resource/sqlupgrade/Oracle/sql202307170403.sql new file mode 100644 index 000000000..8765e111d --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202307170403.sql @@ -0,0 +1,23 @@ +alter table hrsa_salary_send_info +add bill_read_status NUMBER null +/ + +alter table hrsa_salary_send_info +add bill_confirm_status NUMBER null +/ + +alter table hrsa_salary_send_info +add send_employee_id NUMBER(38,0) NULL +/ + +alter table hrsa_salary_template +add ack_feedback_status NUMBER NULL +/ + +alter table hrsa_salary_template +add auto_ack_days NUMBER NULL +/ + +alter table hrsa_salary_template +add feedback_url VARCHAR2(500) NULL +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202307170403.sql b/resource/sqlupgrade/PG/sql202307170403.sql new file mode 100644 index 000000000..a01647d03 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202307170403.sql @@ -0,0 +1,9 @@ +ALTER TABLE hrsa_salary_send_info +ADD COLUMN bill_read_status int NULL, +ADD COLUMN bill_confirm_status int NULL, +ADD COLUMN send_employee_id BIGINT NULL; + +ALTER TABLE hrsa_salary_template +ADD COLUMN ack_feedback_status int NULL, +ADD COLUMN auto_ack_days int NULL, +ADD COLUMN feedback_url varchar(500) NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202307170403.sql b/resource/sqlupgrade/SQLServer/sql202307170403.sql new file mode 100644 index 000000000..de0724f06 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202307170403.sql @@ -0,0 +1,11 @@ +ALTER TABLE hrsa_salary_send_info +ADD bill_read_status int NULL, +bill_confirm_status int NULL, +send_employee_id BIGINT NULL +GO + +ALTER TABLE hrsa_salary_template +ADD ack_feedback_status int NULL, +auto_ack_days int NULL, +feedback_url varchar(500) NULL +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202307170403.sql b/resource/sqlupgrade/ST/sql202307170403.sql new file mode 100644 index 000000000..bc59c53ae --- /dev/null +++ b/resource/sqlupgrade/ST/sql202307170403.sql @@ -0,0 +1,24 @@ +alter table hrsa_salary_send_info +add bill_read_status NUMBER null; +/ + +alter table hrsa_salary_send_info +add bill_confirm_status NUMBER null; +/ + +alter table hrsa_salary_send_info +add send_employee_id NUMBER(38,0) NULL; +/ + +alter table hrsa_salary_template +add ack_feedback_status NUMBER NULL; +/ + +alter table hrsa_salary_template +add auto_ack_days NUMBER NULL; +/ + +alter table hrsa_salary_template +add feedback_url VARCHAR2(500) NULL; +/ + From e83302caac64b6ae567b58ebf84f62ccf139bf35 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Mon, 17 Jul 2023 12:11:31 +0800 Subject: [PATCH 54/86] =?UTF-8?q?=E5=B7=A5=E8=B5=84=E5=8D=95=E5=8F=8D?= =?UTF-8?q?=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/SalarySendServiceImpl.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java index 9fd325cf6..f6b149e70 100644 --- a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java @@ -477,8 +477,6 @@ public class SalarySendServiceImpl extends Service implements SalarySendService SalarySendPO salarySendPO = getSalarySendMapper().getById(salarySendInfo.getSalarySendId()); if(ObjectUtils.isEmpty(salarySendPO)) throw new SalaryRunTimeException("工资单不存在"); - List salaryTemplates = getSalaryTemplateService(user).getDefaultTemplates(Collections.singletonList(salarySendPO.getSalarySobId())); - Integer ackFeedbackStatus = salaryTemplates.get(0).getAckFeedbackStatus(); // 更新查看状态 if (salarySendInfo.getBillReadStatus() == null || NumberUtils.compare(salarySendInfo.getBillReadStatus(),BillReadStatusEnum.UNREAD.getValue()) == 0) { salarySendInfo.setBillReadStatus(BillReadStatusEnum.READED.getValue()); @@ -609,10 +607,9 @@ public class SalarySendServiceImpl extends Service implements SalarySendService map.put("salaryTemplate", salaryTemplate); map.put("salaryAcctResult", salaryAcctResultS); // 工资单发送人、是否已确认 - if (ackFeedbackStatus!=null && NumberUtils.compare(ackFeedbackStatus,1) == 0) { + if (NumberUtils.compare(salaryTemplate.getAckFeedbackStatus(),1) == 0) { map.put("confirmStatus", salarySendInfo.getBillConfirmStatus() == null ? "0" : salarySendInfo.getBillConfirmStatus().toString()); map.put("sendEmployeeId", salarySendInfo.getSendEmployeeId()); - map.put("feedbackWorkflowUrl",salaryTemplates.get(0).getFeedbackUrl()); }else{ map.put("confirmStatus", "1"); } From 88892f1aac04772158650fea4a6e5b7b8a5bc781 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Mon, 17 Jul 2023 12:36:20 +0800 Subject: [PATCH 55/86] =?UTF-8?q?=E5=B7=A5=E8=B5=84=E5=8D=95=E5=8F=8D?= =?UTF-8?q?=E9=A6=88fixBug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salaryBill/bo/SalaryTemplateBO.java | 3 ++ .../salarybill/SalaryTemplateMapper.xml | 36 +++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/src/com/engine/salary/entity/salaryBill/bo/SalaryTemplateBO.java b/src/com/engine/salary/entity/salaryBill/bo/SalaryTemplateBO.java index a72575661..a12f0e81f 100644 --- a/src/com/engine/salary/entity/salaryBill/bo/SalaryTemplateBO.java +++ b/src/com/engine/salary/entity/salaryBill/bo/SalaryTemplateBO.java @@ -77,6 +77,9 @@ public class SalaryTemplateBO { .autoSendStatus(saveParam.getAutoSendStatus()?1:0) .autoSendDayOfMonth(saveParam.getAutoSendDayOfMonth()) .autoSendTimeOfDay(saveParam.getAutoSendTimeOfDay()) + .ackFeedbackStatus(saveParam.getAckFeedbackStatus()?1:0) + .autoAckDays(saveParam.getAutoAckDays()) + .feedbackUrl(saveParam.getFeedbackUrl()) .createTime(new Date()) .updateTime(new Date()) .creator(employeeId) diff --git a/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml b/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml index d48505e58..29a016b93 100644 --- a/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml +++ b/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml @@ -621,6 +621,15 @@ auto_send_time_of_day, + + ack_feedback_status, + + + auto_ack_days, + + + feedback_url, + create_time, @@ -707,6 +716,15 @@ #{autoSendTimeOfDay}, + + #{ackFeedbackStatus}, + + + #{autoAckDays}, + + + #{feedbackUrl}, + #{createTime}, @@ -803,6 +821,15 @@ auto_send_time_of_day, + + ack_feedback_status, + + + auto_ack_days, + + + feedback_url, + create_time, @@ -889,6 +916,15 @@ #{autoSendTimeOfDay}, + + #{ackFeedbackStatus}, + + + #{autoAckDays}, + + + #{feedbackUrl}, + #{createTime}, From 5d6a471fb8e04c5a8a19d0f193c0be5b8c28524c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 17 Jul 2023 14:37:15 +0800 Subject: [PATCH 56/86] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=9C=AA=E9=80=82?= =?UTF-8?q?=E9=85=8D=E6=95=B0=E6=8D=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/GS/sql202307170403.sql | 24 ---------------------- resource/sqlupgrade/ST/sql202307170403.sql | 24 ---------------------- 2 files changed, 48 deletions(-) delete mode 100644 resource/sqlupgrade/GS/sql202307170403.sql delete mode 100644 resource/sqlupgrade/ST/sql202307170403.sql diff --git a/resource/sqlupgrade/GS/sql202307170403.sql b/resource/sqlupgrade/GS/sql202307170403.sql deleted file mode 100644 index bc59c53ae..000000000 --- a/resource/sqlupgrade/GS/sql202307170403.sql +++ /dev/null @@ -1,24 +0,0 @@ -alter table hrsa_salary_send_info -add bill_read_status NUMBER null; -/ - -alter table hrsa_salary_send_info -add bill_confirm_status NUMBER null; -/ - -alter table hrsa_salary_send_info -add send_employee_id NUMBER(38,0) NULL; -/ - -alter table hrsa_salary_template -add ack_feedback_status NUMBER NULL; -/ - -alter table hrsa_salary_template -add auto_ack_days NUMBER NULL; -/ - -alter table hrsa_salary_template -add feedback_url VARCHAR2(500) NULL; -/ - diff --git a/resource/sqlupgrade/ST/sql202307170403.sql b/resource/sqlupgrade/ST/sql202307170403.sql deleted file mode 100644 index bc59c53ae..000000000 --- a/resource/sqlupgrade/ST/sql202307170403.sql +++ /dev/null @@ -1,24 +0,0 @@ -alter table hrsa_salary_send_info -add bill_read_status NUMBER null; -/ - -alter table hrsa_salary_send_info -add bill_confirm_status NUMBER null; -/ - -alter table hrsa_salary_send_info -add send_employee_id NUMBER(38,0) NULL; -/ - -alter table hrsa_salary_template -add ack_feedback_status NUMBER NULL; -/ - -alter table hrsa_salary_template -add auto_ack_days NUMBER NULL; -/ - -alter table hrsa_salary_template -add feedback_url VARCHAR2(500) NULL; -/ - From 1ea80b8fe99df61d70fb35a3b04c3b4d359a3a0a Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Mon, 17 Jul 2023 15:01:14 +0800 Subject: [PATCH 57/86] =?UTF-8?q?=E5=B7=A5=E8=B5=84=E5=8D=95=E5=8F=8D?= =?UTF-8?q?=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salarybill/BillConfimStatusEnum.java | 2 +- .../salarybill/SalarySendInfoMapper.xml | 2 +- .../salary/service/SalaryBillService.java | 6 +++++ .../service/impl/SalaryBillServiceImpl.java | 11 +++++++++ .../salary/web/SalaryBillController.java | 24 +++++++++++++++++++ .../salary/wrapper/SalarySendWrapper.java | 7 ++++++ 6 files changed, 50 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/enums/salarybill/BillConfimStatusEnum.java b/src/com/engine/salary/enums/salarybill/BillConfimStatusEnum.java index 89ca4e758..2a1626532 100644 --- a/src/com/engine/salary/enums/salarybill/BillConfimStatusEnum.java +++ b/src/com/engine/salary/enums/salarybill/BillConfimStatusEnum.java @@ -14,7 +14,7 @@ public enum BillConfimStatusEnum implements BaseEnum { UNCONFIRMED(0, "未确认", 93286), CONFIRMED(1, "已确认", 93212), - AUTOCONFIRMED(2, "自动确认", 93212); + FEEDBACK(2, "已反馈", 0); private final int value; diff --git a/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml b/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml index e6f733971..7d4001131 100644 --- a/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml +++ b/src/com/engine/salary/mapper/salarybill/SalarySendInfoMapper.xml @@ -788,7 +788,7 @@ UPDATE hrsa_salary_send_info set - bill_confirm_status = 2 + bill_confirm_status = 1 where delete_type = 0 diff --git a/src/com/engine/salary/service/SalaryBillService.java b/src/com/engine/salary/service/SalaryBillService.java index 23bd54597..0f8b9030a 100644 --- a/src/com/engine/salary/service/SalaryBillService.java +++ b/src/com/engine/salary/service/SalaryBillService.java @@ -36,6 +36,12 @@ public interface SalaryBillService { */ void confirmSalaryBill(Long salaryInfoId); + /** + * 工资单反馈 + * @param salaryInfoId + */ + void feedBackSalaryBill(Long salaryInfoId); + /** * 工资单撤回 * diff --git a/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java b/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java index ed8dc4351..6b438b564 100644 --- a/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java @@ -436,6 +436,17 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService getSalarySendInfoMapper().updateIgnoreNull(sendInfoPO); } + @Override + public void feedBackSalaryBill(Long salaryInfoId) { + SalarySendInfoPO sendInfoPO = getSalarySendInfoMapper().getById(salaryInfoId); + if(ObjectUtils.isEmpty(sendInfoPO)){ + throw new SalaryRunTimeException("工资单不存在或已被删除!"); + } + sendInfoPO.setBillConfirmStatus(BillConfimStatusEnum.FEEDBACK.getValue()); + sendInfoPO.setUpdateTime(new Date()); + getSalarySendInfoMapper().updateIgnoreNull(sendInfoPO); + } + public List> getSendInfoList(Long sendId, List ids) { SalarySendPO salarySend = getSalarySendMapper().getById(sendId); diff --git a/src/com/engine/salary/web/SalaryBillController.java b/src/com/engine/salary/web/SalaryBillController.java index 080e982d7..ea5cdeece 100644 --- a/src/com/engine/salary/web/SalaryBillController.java +++ b/src/com/engine/salary/web/SalaryBillController.java @@ -569,6 +569,30 @@ public class SalaryBillController { } return new ResponseResult>(user).run(getSalarySendWrapper(user)::confirmSalaryBill, salaryInfoId); } + + /** + * 工资单反馈 + * + * @param salaryInfoId + * @return + */ + @GET + @Path("/feedBackSalaryBill") + @Produces(MediaType.APPLICATION_JSON) + public String feedBackSalaryBill(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salaryInfoId") Long salaryInfoId) { + User user = null; + String recipient = request.getParameter("recipient"); + String em_auth_userid = request.getParameter("em_auth_userid"); + log.info("salary recipient: {} em_auth_userid: {}", recipient, em_auth_userid); + if (StringUtils.isNotBlank(recipient) && NumberUtils.isCreatable(recipient)) { + user = new User(Integer.parseInt(recipient)); + } else if (StringUtils.isNotBlank(em_auth_userid) && NumberUtils.isCreatable(em_auth_userid)) { + user = new User(Integer.parseInt(em_auth_userid)); + } else { + user = HrmUserVarify.getUser(request, response); + } + return new ResponseResult>(user).run(getSalarySendWrapper(user)::feedBackSalaryBill, salaryInfoId); + } /******** 工资单发放 end ***********************************************************************************************/ /** diff --git a/src/com/engine/salary/wrapper/SalarySendWrapper.java b/src/com/engine/salary/wrapper/SalarySendWrapper.java index 0b6548fda..60a480841 100644 --- a/src/com/engine/salary/wrapper/SalarySendWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySendWrapper.java @@ -686,6 +686,13 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy } getSalaryBillService(user).confirmSalaryBill(salaryInfoId); } + + public void feedBackSalaryBill(Long salaryInfoId) { + if(ObjectUtil.isNull(salaryInfoId)){ + throw new SalaryRunTimeException("工资单id不能为空!"); + } + getSalaryBillService(user).feedBackSalaryBill(salaryInfoId); + } } From f93090b063c502842013d8a641d8efc445e4db55 Mon Sep 17 00:00:00 2001 From: sy Date: Mon, 17 Jul 2023 17:53:59 +0800 Subject: [PATCH 58/86] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A0=B8=E7=AE=97=EF=BC=8C=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=AF=BC=E5=87=BA=E5=AD=97=E6=AE=B5=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=9C=AA=E5=88=86=E7=B1=BB=E5=AD=97=E6=AE=B5=E8=AF=86=E5=88=AB?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SalaryAcctExcelServiceImpl.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java index 486073fbf..3e808cb80 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java @@ -44,6 +44,7 @@ import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.Column; import com.engine.salary.util.valid.ValidUtil; +import com.engine.salary.wrapper.SalarySobItemWrapper; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; @@ -102,10 +103,6 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc return (SalaryItemService) ServiceUtil.getService(SalaryItemServiceImpl.class, user); } -// private SalaryFormulaService getSalaryFormulaService(User user) { -// return (SalaryFormulaService) ServiceUtil.getService(SalaryFormulaServiceImpl.class, user); -// } - private SalaryComparisonResultService getSalaryComparisonResultService(User user) { return (SalaryComparisonResultService) ServiceUtil.getService(SalaryComparisonResultServiceImpl.class, user); } @@ -123,12 +120,6 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc return ServiceUtil.getService(SalarySobItemGroupServiceImpl.class, user); } - private SalaryCheckResultService salaryCheckResultService; - - private SalaryCheckResultDetailService salaryCheckResultDetailService; - - private SalarySobCheckRuleService salarySobCheckRuleService; - private SalaryAcctReportService getSalaryAcctReportService(User user) { return ServiceUtil.getService(SalaryAcctReportServiceImpl.class, user); } @@ -145,6 +136,10 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc return ServiceUtil.getService(SalaryAcctResultLogServiceImpl.class, user); } + private SalarySobItemWrapper getSalarySobItemWrapper(User user) { + return ServiceUtil.getService(SalarySobItemWrapper.class, user); + } + @Override public XSSFWorkbook exportSalaryAcctEmployee(SalaryAcctEmployeeQueryParam queryParam) { ValidUtil.doValidator(queryParam); @@ -291,6 +286,10 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc //判断是否按照自定义字段导出表头 List finalWeaTableColumns = new ArrayList<>(); if (queryParam.getSalaryItemIds() != null ) { + //获取人员基本信息字段(汇总) + Collection> empFieldList = getSalarySobItemWrapper(user).empFieldList(); + List empFieldIdList= new ArrayList<>(); + empFieldList.forEach(f -> empFieldIdList.add(f.get("id"))); // 必须选择导出所需的薪资项目 if (CollectionUtils.isEmpty(queryParam.getSalaryItemIds())) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99019, "参数错误,请选择导入模板所需的薪资项目")); @@ -308,7 +307,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc columnGroupItem.setChildren(childrenColumns); finalWeaTableColumns.add(columnGroupItem); } - } else if (headerRangeList.contains(columnGroupItem.getColumn())) { + } else if (empFieldIdList.contains(tableColumn.getColumn()) || headerRangeList.contains(tableColumn.getColumn())){ finalWeaTableColumns.add(columnGroupItem); } @@ -319,7 +318,8 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc // parseHeader(headerColumnGroup, weaTableColumns); parseHeader(headerColumnGroup, finalWeaTableColumns); // // excel导出的表头 - List headerList = new ArrayList<>(weaTableColumns); +// List headerList = new ArrayList<>(weaTableColumns); + List headerList = new ArrayList<>(finalWeaTableColumns); // 查询薪资核算结果 List> resultMapList = getSalaryAcctResultService(user).listByParam(queryParam); From 7c3c929fcd07a8bfc1de5aa50e6798bdb583269a Mon Sep 17 00:00:00 2001 From: sy Date: Tue, 18 Jul 2023 09:33:07 +0800 Subject: [PATCH 59/86] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=96=B9=E6=A1=88=EF=BC=8C=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=A6=8F=E5=88=A9=E9=A1=B9=E5=90=AF=E7=94=A8=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SICategoryBiz.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/salary/biz/SICategoryBiz.java b/src/com/engine/salary/biz/SICategoryBiz.java index 36cb4f218..6fb23037d 100644 --- a/src/com/engine/salary/biz/SICategoryBiz.java +++ b/src/com/engine/salary/biz/SICategoryBiz.java @@ -161,7 +161,7 @@ public class SICategoryBiz { throw new SalaryRunTimeException("isUse is required"); } List insuranceSchemeDetailPOS = new SISchemeBiz().queryListByInsuranceIdIsPayment(id, IsPaymentEnum.YES.getValue()); - if(CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) { + if(CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS) && isUse == 0) { throw new SalaryRunTimeException("该福利开启缴费,不可删除(或停用)"); } ICategoryPO iCategoryPO = getByID(id); From b8f44dd5b6a029314a236d7a8c22cfe7e67ca234 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Tue, 18 Jul 2023 11:00:13 +0800 Subject: [PATCH 60/86] =?UTF-8?q?=E8=96=AA=E8=B5=84=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E6=97=B6=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java | 2 ++ .../engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java | 1 + .../salary/entity/salaryitem/dto/SalaryItemFormDTO.java | 3 +++ .../salary/entity/salaryitem/dto/SalaryItemSobListDTO.java | 5 +++++ 4 files changed, 11 insertions(+) diff --git a/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java b/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java index 0a7dbcdb2..b750c2c27 100644 --- a/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java +++ b/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java @@ -146,6 +146,7 @@ public class SalaryItemBO { .systemName(sysSalaryItemNameMap.getOrDefault(salaryItemPO.getSysSalaryItemId(), StringUtils.EMPTY)) .useInEmployeeSalary(salaryItemPO.getUseInEmployeeSalary()) .useDefault(salaryItemPO.getUseDefault()) + .hideDefault(salaryItemPO.getHideDefault() == null ? 0 : salaryItemPO.getHideDefault()) .roundingMode(Optional.ofNullable(salaryRoundingModeEnum) .map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel())) .orElse(StringUtils.EMPTY)) @@ -182,6 +183,7 @@ public class SalaryItemBO { .setName(salaryItemPO.getName()) .setSystemType(salaryItemPO.getSystemType()) .setUseDefault(salaryItemPO.getUseDefault()) + .setHideDefault(salaryItemPO.getHideDefault() == null ? 0 : salaryItemPO.getHideDefault()) .setUseInEmployeeSalary(salaryItemPO.getUseInEmployeeSalary()) .setRoundingMode(salaryItemPO.getRoundingMode()) .setPattern(salaryItemPO.getPattern()) diff --git a/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java b/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java index a84ded713..544550acf 100644 --- a/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java +++ b/src/com/engine/salary/entity/salaryitem/bo/SysSalaryItemBO.java @@ -93,6 +93,7 @@ public class SysSalaryItemBO { .setCanEdit(sysSalaryItemPO.getCanEdit()) .setSystemType(sysSalaryItemPO.getSystemType()) .setUseDefault(sysSalaryItemPO.getUseDefault()) + .setHideDefault(0) .setUseInEmployeeSalary(sysSalaryItemPO.getUseInEmployeeSalary()) .setRoundingMode(sysSalaryItemPO.getRoundingMode()) .setPattern(sysSalaryItemPO.getPattern()) diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java index 95903867d..5585bc530 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java @@ -42,6 +42,9 @@ public class SalaryItemFormDTO { //默认使用") private Integer useDefault; + //默认隐藏") + private Integer hideDefault; + //薪资档案引用") private Integer useInEmployeeSalary; diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemSobListDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemSobListDTO.java index ef88c307a..799570c95 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemSobListDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemSobListDTO.java @@ -49,6 +49,11 @@ public class SalaryItemSobListDTO { @TableTitle(title = "默认使用",dataIndex = "useDefault",key = "useDefault") private Integer useDefault; + //核算时默认隐藏 + @SalaryTableColumn(text = "默认隐藏", width = "10%", column = "useDefault") + @TableTitle(title = "默认隐藏",dataIndex = "useDefault",key = "useDefault") + private Integer hideDefault; + //进位规则 @SalaryTableColumn(text = "进位规则", width = "10%", column = "roundingMode",transmethod = "com.engine.salary.transmethod.TransMethod.roundingMode") @TableTitle(title = "进位规则",dataIndex = "roundingMode",key = "roundingMode") From d551f5ae763cde954f24217391d280260efbc546 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Tue, 18 Jul 2023 14:03:59 +0800 Subject: [PATCH 61/86] =?UTF-8?q?=E8=96=AA=E8=B5=84=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E6=97=B6=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/salarysob/bo/SalarySobItemBO.java | 57 +++++++++++++++++-- .../impl/SalarySobItemServiceImpl.java | 18 ++---- .../service/impl/SalarySobServiceImpl.java | 7 +++ 3 files changed, 63 insertions(+), 19 deletions(-) diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java index 311dabd63..314dc4c5e 100644 --- a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java +++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java @@ -12,10 +12,7 @@ import lombok.Data; import lombok.experimental.Accessors; import org.apache.commons.lang3.math.NumberUtils; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -70,6 +67,8 @@ public class SalarySobItemBO { List defaultSalaryItemPOS, Long employeeId, String tenantKey) { Date now = new Date(); + // 需要保存的隐藏项目 + List needInsertItemHides = new ArrayList<>(); // 处理薪资账套默认的薪资项目分类 Map salarySobItemGroupIdMap = Maps.newHashMapWithExpectedSize(salarySobDefaultItemGroupPOS.size()); List salarySobItemGroups = Lists.newArrayListWithExpectedSize(salarySobDefaultItemGroupPOS.size()); @@ -88,8 +87,23 @@ public class SalarySobItemBO { .deleteType(NumberUtils.INTEGER_ZERO) .build()); salarySobItemGroupIdMap.put(salarySobDefaultItemGroupPO.getId(), salarySobItemGroupId); + + // 保存薪资项目分类隐藏信息 + needInsertItemHides.add(SalarySobItemHidePO.builder() + .id(IdGenerator.generate()) + .salarySobId(salarySobId) + .salaryItemId(salarySobItemGroupId) + .isGroup(1) + .itemHide(0L) + .creator(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build()); } + List salarySobItems = Lists.newArrayListWithExpectedSize(defaultSalaryItemPOS.size()); // 处理薪资账套默认的系统薪资项目 Set sysSalaryItemIds = SalaryEntityUtil.properties(salarySobDefaultItemPOS, SalarySobDefaultItemPO::getSysSalaryItemId); @@ -113,6 +127,20 @@ public class SalarySobItemBO { .tenantKey(tenantKey) .deleteType(NumberUtils.INTEGER_ZERO) .build()); + + // 保存薪资项目隐藏信息 + needInsertItemHides.add(SalarySobItemHidePO.builder() + .id(IdGenerator.generate()) + .salarySobId(salarySobId) + .salaryItemId(salaryItemPO.getId()) + .isGroup(0) + .itemHide(Long.valueOf(salaryItemPO.getHideDefault())) + .creator(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build()); } // 处理薪资账套默认的自定义薪资项目(开启了"默认使用") for (int i = 0; i < defaultSalaryItemPOS.size(); i++) { @@ -139,6 +167,19 @@ public class SalarySobItemBO { .tenantKey(tenantKey) .deleteType(NumberUtils.INTEGER_ZERO) .build()); + // 保存薪资项目隐藏信息 + needInsertItemHides.add(SalarySobItemHidePO.builder() + .id(IdGenerator.generate()) + .salarySobId(salarySobId) + .salaryItemId(salaryItemPO.getId()) + .isGroup(0) + .itemHide(Long.valueOf(salaryItemPO.getHideDefault())) + .creator(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build()); } // 薪资账套默认的回算薪资项目 @@ -165,7 +206,8 @@ public class SalarySobItemBO { salarySobBackItems.add(salarySobBackItemPO); } - return new Result().setNeedInsertSalarySobItems(salarySobItems).setNeedInsertSalarySobItemGroups(salarySobItemGroups).setNeedInsertSalarySobBackItems(salarySobBackItems); + return new Result().setNeedInsertSalarySobItems(salarySobItems).setNeedInsertSalarySobItemGroups(salarySobItemGroups) + .setNeedInsertSalarySobBackItems(salarySobBackItems).setNeedInsertItemHides(needInsertItemHides); } @Data @@ -186,5 +228,10 @@ public class SalarySobItemBO { * 需要保存的回算薪资项目 */ List needInsertSalarySobBackItems; + + /** + * 需要保存的薪资项目隐藏信息 + */ + List needInsertItemHides; } } diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index e370e40e3..4d1a8d659 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -378,16 +378,13 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe .salarySobId(salarySobId) .salaryItemId(salarySobItemGroupId) .isGroup(1) - .itemHide(itemGroupParam.getItemHide()) + .itemHide(itemGroupParam.getItemHide() == null ? 0L : itemGroupParam.getItemHide()) .creator(employeeId) .createTime(now) .updateTime(now) .deleteType(NumberUtils.INTEGER_ZERO) .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) .build(); - if (itemGroupParam.getItemHide() == null) { - salarySobGroupItemHidePO.setItemHide(Long.valueOf(0)); - } needInsertItemShow.add(salarySobGroupItemHidePO); // salarySobItemMapper.InsertItemShow(salarySobGroupItemHidePO); @@ -448,17 +445,13 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe .salarySobId(salarySobId) .salaryItemId(groupId) .isGroup(1) - .itemHide(itemGroupParam.getItemHide()) + .itemHide(itemGroupParam.getItemHide() == null ? 0L : itemGroupParam.getItemHide()) .creator(employeeId) .createTime(now) .updateTime(now) .deleteType(NumberUtils.INTEGER_ZERO) .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) .build(); - if (itemGroupParam.getItemHide() == null) { - salarySobGroupItemHidePO.setItemHide(Long.valueOf(0)); - } -// salarySobItemMapper.InsertItemShow(salarySobGroupItemHidePO); needInsertItemShow.add(salarySobGroupItemHidePO); @@ -502,7 +495,6 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe .deleteType(NumberUtils.INTEGER_ZERO) .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) .build(); -// salarySobItemMapper.InsertItemShow(salarySobItemHidePO); needInsertItemShow.add(salarySobItemHidePO); } //更新 @@ -520,7 +512,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe getSalarySobItemMapper().updateIgnoreNull(salarySobItemPO); // 保存薪资项目是否展示 Long salarySobItemShowId = IdGenerator.generate(); - SalarySobItemHidePO salarySobItemHidePO = SalarySobItemHidePO.builder() + needInsertItemShow.add(SalarySobItemHidePO.builder() .id(salarySobItemShowId) .salarySobId(salarySobId) .salaryItemId(itemParam.getSalaryItemId()) @@ -531,9 +523,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe .updateTime(now) .deleteType(NumberUtils.INTEGER_ZERO) .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .build(); -// salarySobItemMapper.InsertItemShow(salarySobItemHidePO); - needInsertItemShow.add(salarySobItemHidePO); + .build()); } diff --git a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java index 1cf4943b6..aec691198 100644 --- a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java @@ -372,6 +372,13 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { if (CollectionUtils.isNotEmpty(result.getNeedInsertSalarySobBackItems())) { getSalarySobBackItemService(user).batchInsert(result.getNeedInsertSalarySobBackItems()); } + if (CollectionUtils.isNotEmpty(result.getNeedInsertItemHides())) { + //去重 + List list = new ArrayList<>(result.getNeedInsertItemHides().stream() + .collect(Collectors.toMap(SalarySobItemHidePO::getSalaryItemId, Function.identity(), (oldValue, newValue) -> oldValue)) + .values()); + salarySobItemService.batchInsertItemShow(list); + } } /** From db9a0e22eb005bbc6e9f447933dc991e88f29cb9 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Tue, 18 Jul 2023 17:00:09 +0800 Subject: [PATCH 62/86] =?UTF-8?q?=E8=96=AA=E8=B5=84=E9=A1=B9=E7=9B=AE-?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E6=97=B6=E9=9A=90=E8=97=8Ffixbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/entity/salaryitem/dto/SalaryItemSobListDTO.java | 4 ++-- .../engine/salary/entity/salarysob/bo/SalarySobItemBO.java | 4 ++-- src/com/engine/salary/wrapper/SalarySobItemWrapper.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemSobListDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemSobListDTO.java index 799570c95..78bc4a84f 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemSobListDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemSobListDTO.java @@ -50,8 +50,8 @@ public class SalaryItemSobListDTO { private Integer useDefault; //核算时默认隐藏 - @SalaryTableColumn(text = "默认隐藏", width = "10%", column = "useDefault") - @TableTitle(title = "默认隐藏",dataIndex = "useDefault",key = "useDefault") + @SalaryTableColumn(text = "默认隐藏", width = "10%", column = "hideDefault") + @TableTitle(title = "默认隐藏",dataIndex = "hideDefault",key = "hideDefault") private Integer hideDefault; //进位规则 diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java index 314dc4c5e..3e2513908 100644 --- a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java +++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemBO.java @@ -134,7 +134,7 @@ public class SalarySobItemBO { .salarySobId(salarySobId) .salaryItemId(salaryItemPO.getId()) .isGroup(0) - .itemHide(Long.valueOf(salaryItemPO.getHideDefault())) + .itemHide(Long.valueOf(salaryItemPO.getHideDefault()== null ? 0 : salaryItemPO.getHideDefault())) .creator(employeeId) .createTime(now) .updateTime(now) @@ -173,7 +173,7 @@ public class SalarySobItemBO { .salarySobId(salarySobId) .salaryItemId(salaryItemPO.getId()) .isGroup(0) - .itemHide(Long.valueOf(salaryItemPO.getHideDefault())) + .itemHide(Long.valueOf(salaryItemPO.getHideDefault() == null ? 0 : salaryItemPO.getHideDefault())) .creator(employeeId) .createTime(now) .updateTime(now) diff --git a/src/com/engine/salary/wrapper/SalarySobItemWrapper.java b/src/com/engine/salary/wrapper/SalarySobItemWrapper.java index 2400f224b..096d9a395 100644 --- a/src/com/engine/salary/wrapper/SalarySobItemWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobItemWrapper.java @@ -96,7 +96,7 @@ public class SalarySobItemWrapper extends Service { } }) .collect(Collectors.toList()); - SalaryPageUtil.buildPage(searchCurrent, searchPageSize, salaryItemList); + salaryItemList = SalaryPageUtil.buildPage(searchCurrent, searchPageSize, salaryItemList).getList(); //最终返回的分页对象 PageInfo dtoPage = new PageInfo<>(SalaryItemSobListDTO.class); From 78e5d37cf3b889bb63d8ca4317ada55c69bf73bc Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Tue, 18 Jul 2023 17:22:42 +0800 Subject: [PATCH 63/86] =?UTF-8?q?=E8=96=AA=E8=B5=84=E9=A1=B9=E7=9B=AE-?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E6=97=B6=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/entity/salaryitem/dto/SalaryFieldListDTO.java | 4 ++-- .../salary/entity/salaryitem/dto/SalaryItemFormDTO.java | 2 +- .../salary/entity/salaryitem/dto/SalaryItemListDTO.java | 4 ++-- .../salary/entity/salaryitem/dto/SalaryItemSobListDTO.java | 4 ++-- .../salary/entity/salaryitem/param/SalaryItemSaveParam.java | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryFieldListDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryFieldListDTO.java index b7461398b..e8a2afa8f 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryFieldListDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryFieldListDTO.java @@ -41,8 +41,8 @@ public class SalaryFieldListDTO { private Integer useDefault; //核算时隐藏 - @SalaryTableColumn(text = "默认隐藏", width = "10%", column = "hideDefault") - @TableTitle(title = "默认隐藏",dataIndex = "hideDefault",key = "hideDefault") + @SalaryTableColumn(text = "核算时隐藏", width = "10%", column = "hideDefault") + @TableTitle(title = "核算时隐藏",dataIndex = "hideDefault",key = "hideDefault") private Integer hideDefault; //进位规则 diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java index 5585bc530..c00b85844 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java @@ -42,7 +42,7 @@ public class SalaryItemFormDTO { //默认使用") private Integer useDefault; - //默认隐藏") + //核算时隐藏") private Integer hideDefault; //薪资档案引用") diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java index 02c51998c..adb0dc4b1 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java @@ -52,8 +52,8 @@ public class SalaryItemListDTO { private Integer useDefault; //核算时隐藏 - @SalaryTableColumn(text = "默认隐藏", width = "10%", column = "hideDefault") - @TableTitle(title = "默认隐藏",dataIndex = "hideDefault",key = "hideDefault") + @SalaryTableColumn(text = "核算时隐藏", width = "10%", column = "hideDefault") + @TableTitle(title = "核算时隐藏",dataIndex = "hideDefault",key = "hideDefault") private Integer hideDefault; //进位规则 diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemSobListDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemSobListDTO.java index 78bc4a84f..ae0ecf30f 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemSobListDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemSobListDTO.java @@ -50,8 +50,8 @@ public class SalaryItemSobListDTO { private Integer useDefault; //核算时默认隐藏 - @SalaryTableColumn(text = "默认隐藏", width = "10%", column = "hideDefault") - @TableTitle(title = "默认隐藏",dataIndex = "hideDefault",key = "hideDefault") + @SalaryTableColumn(text = "核算时隐藏", width = "10%", column = "hideDefault") + @TableTitle(title = "核算时隐藏",dataIndex = "hideDefault",key = "hideDefault") private Integer hideDefault; //进位规则 diff --git a/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java b/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java index 5d5db6cb1..a2c6fa84b 100644 --- a/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java +++ b/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java @@ -50,7 +50,7 @@ public class SalaryItemSaveParam { private Integer useInEmployeeSalary; //核算时默认隐藏 - @DataCheck(require = true, message = "默认隐藏不允许为空") + @DataCheck(require = true, message = "核算时隐藏不允许为空") private Integer hideDefault; From 5e227febee027fce2c59ae1e8040b86d1f4157e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 18 Jul 2023 17:59:20 +0800 Subject: [PATCH 64/86] =?UTF-8?q?=E5=85=B3=E9=97=AD=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E7=AE=97=E7=A8=8E=E5=90=8E=EF=BC=8C=E7=B3=BB=E7=BB=9F=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E9=A1=B9=E7=9B=AE=E5=8F=AF=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/wrapper/SalaryFieldWrapper.java | 19 ++++++++++++++++--- .../salary/wrapper/SalaryItemWrapper.java | 15 ++++++++++++++- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/com/engine/salary/wrapper/SalaryFieldWrapper.java b/src/com/engine/salary/wrapper/SalaryFieldWrapper.java index 00ec26ebf..38f53c4fb 100644 --- a/src/com/engine/salary/wrapper/SalaryFieldWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryFieldWrapper.java @@ -25,6 +25,9 @@ import com.engine.salary.service.impl.SalaryFormulaServiceImpl; import com.engine.salary.service.impl.SalaryItemServiceImpl; import com.engine.salary.service.impl.SalarySobItemServiceImpl; import com.engine.salary.service.impl.SysSalaryItemServiceImpl; +import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum; +import com.engine.salary.sys.service.SalarySysConfService; +import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.Column; @@ -49,11 +52,11 @@ import java.util.*; public class SalaryFieldWrapper extends Service { private SalaryItemService getSalaryItemService(User user) { - return ServiceUtil.getService(SalaryItemServiceImpl.class, user); + return ServiceUtil.getService(SalaryItemServiceImpl.class, user); } private SalaryFormulaService getSalaryFormulaService(User user) { - return ServiceUtil.getService(SalaryFormulaServiceImpl.class, user); + return ServiceUtil.getService(SalaryFormulaServiceImpl.class, user); } @@ -69,6 +72,10 @@ public class SalaryFieldWrapper extends Service { return ServiceUtil.getService(SysSalaryItemServiceImpl.class, user); } + private SalarySysConfService getSalarySysConfService(User user) { + return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); + } + /** * 薪资项目列表 * @@ -100,6 +107,9 @@ public class SalaryFieldWrapper extends Service { salaryItemListDTOPage.getColumns().clear(); salaryItemListDTOPage.setColumns(fieldColumns); + //是否需要系统算税,不需要则去除系统项目 + TaxDeclarationFunctionEnum taxDeclarationFunctionEnum = getSalarySysConfService(user).getTaxDeclaration(); + // 被薪资账套引用的薪资项目 if (CollectionUtils.isNotEmpty(salaryItemList)) { // 查询系统薪资项目 @@ -109,7 +119,9 @@ public class SalaryFieldWrapper extends Service { List salaryItemListDTOS = SalaryItemBO.convert2ListDTO(salaryItemList, Collections.emptyList(), sysSalaryItemPOS); //系统项目不删除 salaryItemListDTOS.forEach(dto -> { - if (StringUtils.isNotBlank(dto.getSystemName()) || usingItemIds.contains(dto.getId()) || usingCodes.contains(dto.getCode())) { + if ((taxDeclarationFunctionEnum != TaxDeclarationFunctionEnum.CLOSURE && StringUtils.isNotBlank(dto.getSystemName())) + || usingItemIds.contains(dto.getId()) + || usingCodes.contains(dto.getCode())) { dto.setCanDelete(false); } }); @@ -207,6 +219,7 @@ public class SalaryFieldWrapper extends Service { /** * 保存字段排序信息 + * * @param salaryItemPOS */ public void saveSortedIndex(List salaryItemPOS) { diff --git a/src/com/engine/salary/wrapper/SalaryItemWrapper.java b/src/com/engine/salary/wrapper/SalaryItemWrapper.java index 3a03a30d3..84355ade6 100644 --- a/src/com/engine/salary/wrapper/SalaryItemWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryItemWrapper.java @@ -18,6 +18,9 @@ import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.*; import com.engine.salary.service.impl.*; +import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum; +import com.engine.salary.sys.service.SalarySysConfService; +import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; @@ -61,6 +64,10 @@ public class SalaryItemWrapper extends Service { return ServiceUtil.getService(SalarySobBackItemServiceImpl.class, user); } + private SalarySysConfService getSalarySysConfService(User user) { + return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); + } + /** * 薪资项目列表 * @@ -89,6 +96,10 @@ public class SalaryItemWrapper extends Service { salaryItemListDTOPage.setPageNum(page.getPageNum()); salaryItemListDTOPage.setTotal(page.getTotal()); + //是否需要系统算税,不需要则去除系统项目 + TaxDeclarationFunctionEnum taxDeclarationFunctionEnum = getSalarySysConfService(user).getTaxDeclaration(); + + // 被薪资账套引用的薪资项目 if (CollectionUtils.isNotEmpty(salaryItemList)) { //2、填充公式内容 @@ -101,7 +112,9 @@ public class SalaryItemWrapper extends Service { List salaryItemListDTOS = SalaryItemBO.convert2ListDTO(salaryItemList, expressFormulas, sysSalaryItemPOS); //系统项目不删除 salaryItemListDTOS.forEach(dto -> { - if (StringUtils.isNotBlank(dto.getSystemName()) || usingItemIds.contains(dto.getId()) || usingCodes.contains(dto.getCode())) { + if ((taxDeclarationFunctionEnum != TaxDeclarationFunctionEnum.CLOSURE && StringUtils.isNotBlank(dto.getSystemName())) + || usingItemIds.contains(dto.getId()) + || usingCodes.contains(dto.getCode())) { dto.setCanDelete(false); } }); From cb3b55f8b4eb4fec9c61ae309b35acc50fb2ccfd Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Wed, 19 Jul 2023 09:35:30 +0800 Subject: [PATCH 65/86] =?UTF-8?q?=E8=96=AA=E8=B5=84=E9=A1=B9=E7=9B=AE-?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E6=97=B6=E9=9A=90=E8=97=8Fsql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202307180603.sql | 4 ++++ resource/sqlupgrade/JC/sql202307180603.sql | 4 ++++ resource/sqlupgrade/Mysql/sql202307180603.sql | 2 ++ resource/sqlupgrade/Oracle/sql202307180603.sql | 3 +++ resource/sqlupgrade/PG/sql202307180603.sql | 2 ++ resource/sqlupgrade/SQLServer/sql202307180603.sql | 3 +++ 6 files changed, 18 insertions(+) create mode 100644 resource/sqlupgrade/DM/sql202307180603.sql create mode 100644 resource/sqlupgrade/JC/sql202307180603.sql create mode 100644 resource/sqlupgrade/Mysql/sql202307180603.sql create mode 100644 resource/sqlupgrade/Oracle/sql202307180603.sql create mode 100644 resource/sqlupgrade/PG/sql202307180603.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202307180603.sql diff --git a/resource/sqlupgrade/DM/sql202307180603.sql b/resource/sqlupgrade/DM/sql202307180603.sql new file mode 100644 index 000000000..9154924fe --- /dev/null +++ b/resource/sqlupgrade/DM/sql202307180603.sql @@ -0,0 +1,4 @@ +alter table hrsa_salary_item + add hide_default NUMBER null; +/ + diff --git a/resource/sqlupgrade/JC/sql202307180603.sql b/resource/sqlupgrade/JC/sql202307180603.sql new file mode 100644 index 000000000..9154924fe --- /dev/null +++ b/resource/sqlupgrade/JC/sql202307180603.sql @@ -0,0 +1,4 @@ +alter table hrsa_salary_item + add hide_default NUMBER null; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202307180603.sql b/resource/sqlupgrade/Mysql/sql202307180603.sql new file mode 100644 index 000000000..5ddb48c1c --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202307180603.sql @@ -0,0 +1,2 @@ +ALTER TABLE hrsa_salary_item +ADD COLUMN hide_default int NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202307180603.sql b/resource/sqlupgrade/Oracle/sql202307180603.sql new file mode 100644 index 000000000..8bccbf455 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202307180603.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_item + add hide_default NUMBER null +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202307180603.sql b/resource/sqlupgrade/PG/sql202307180603.sql new file mode 100644 index 000000000..5ddb48c1c --- /dev/null +++ b/resource/sqlupgrade/PG/sql202307180603.sql @@ -0,0 +1,2 @@ +ALTER TABLE hrsa_salary_item +ADD COLUMN hide_default int NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202307180603.sql b/resource/sqlupgrade/SQLServer/sql202307180603.sql new file mode 100644 index 000000000..8160ebc94 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202307180603.sql @@ -0,0 +1,3 @@ +ALTER TABLE hrsa_salary_item +ADD hide_default int NULL +GO \ No newline at end of file From b77e7a737ce59da48004bf00a541535f1f2260b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 19 Jul 2023 09:58:42 +0800 Subject: [PATCH 66/86] =?UTF-8?q?=E5=A4=96=E9=83=A8=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E4=B8=8D=E5=8F=AF=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ExtEmpServiceImpl.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java index 8db902160..8936dfd1e 100644 --- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -9,6 +9,7 @@ import com.engine.salary.entity.extemp.po.ExtEmpPO; import com.engine.salary.entity.hrm.DeptInfo; import com.engine.salary.entity.hrm.SubCompanyInfo; import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; +import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.extemp.ExternalEmployeeMapper; import com.engine.salary.service.ExtEmpService; import com.engine.salary.service.SalaryEmployeeService; @@ -18,6 +19,7 @@ import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; import dm.jdbc.util.IdGenerator; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import weaver.hrm.User; @@ -58,6 +60,12 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { @Override public void save(ExtEmpSaveParam param) { + + List extEmpPOS = getExternalEmployeeMapper().listSome(ExtEmpPO.builder().username(param.getUsername()).build()); + if (CollectionUtils.isNotEmpty(extEmpPOS)) { + throw new SalaryRunTimeException("姓名已存在!"); + } + ExtEmpPO po = new ExtEmpPO(); BeanUtils.copyProperties(param, po); @@ -75,6 +83,15 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { @Override public void update(ExtEmpSaveParam param) { + + ExtEmpPO oldPO = getExternalEmployeeMapper().getById(param.getId()); + if (!StringUtils.equals(oldPO.getUsername(), param.getUsername())) { + List extEmpPOS = getExternalEmployeeMapper().listSome(ExtEmpPO.builder().username(param.getUsername()).build()); + if (CollectionUtils.isNotEmpty(extEmpPOS)) { + throw new SalaryRunTimeException("姓名已存在!"); + } + } + ExtEmpPO po = new ExtEmpPO(); BeanUtils.copyProperties(param, po); @@ -105,7 +122,7 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { } List extEmpPOS = new ArrayList<>(); List> partition = Lists.partition(ids, 500); - partition.forEach(list ->extEmpPOS.addAll(getExternalEmployeeMapper().listSome(ExtEmpPO.builder().ids(list).build())) ); + partition.forEach(list -> extEmpPOS.addAll(getExternalEmployeeMapper().listSome(ExtEmpPO.builder().ids(list).build()))); return coverList(extEmpPOS); } From 47b02e4d5d3ede871e66a0a482566f07acae6299 Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 19 Jul 2023 10:03:29 +0800 Subject: [PATCH 67/86] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A0=B8=E7=AE=97=EF=BC=8C=E5=BD=92=E6=A1=A3?= =?UTF-8?q?action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action/SalaryAcctFileByIdAction.java | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/com/engine/salary/action/SalaryAcctFileByIdAction.java diff --git a/src/com/engine/salary/action/SalaryAcctFileByIdAction.java b/src/com/engine/salary/action/SalaryAcctFileByIdAction.java new file mode 100644 index 000000000..9674aa9f4 --- /dev/null +++ b/src/com/engine/salary/action/SalaryAcctFileByIdAction.java @@ -0,0 +1,59 @@ +package com.engine.salary.action; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.service.SalaryAcctRecordService; +import com.engine.salary.service.impl.SalaryAcctRecordServiceImpl; +import lombok.extern.slf4j.Slf4j; +import weaver.general.Util; +import weaver.hrm.User; +import weaver.interfaces.workflow.action.Action; +import weaver.soa.workflow.request.Property; +import weaver.soa.workflow.request.RequestInfo; + +import java.util.Arrays; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Author: sy + * @Description: 通过薪资核算id归档台账记录 + * @Date: 2023/7/18 + **/ +@Slf4j +public class SalaryAcctFileByIdAction implements Action { + private SalaryAcctRecordService getSalaryAcctRecordService(User user) { + return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); + } + + private String acctRecordId; + + public String getAcctRecordId() { + return acctRecordId; + } + + public void setAcctRecordId(String acctRecordId) { + this.acctRecordId = acctRecordId; + } + + @Override + public String execute(RequestInfo requestInfo) { + User user = requestInfo.getRequestManager().getUser(); + + Property[] properties = requestInfo.getMainTableInfo().getProperty(); + Map fieldMap = Arrays.stream(properties).collect(Collectors.toMap(Property::getName, + property -> Util.null2String(property.getValue()))); + + Long salaryAcctId = fieldMap.get(acctRecordId) != null ? Long.parseLong(fieldMap.get(acctRecordId)) : 0L; + + if (!salaryAcctId.equals(0L)) { + try { + getSalaryAcctRecordService(user).file(salaryAcctId); + } catch (Exception e) { + log.error("薪资核算归档异常", e); + requestInfo.getRequestManager().setMessage(e.getMessage()); + return FAILURE_AND_CONTINUE; + } + } + return SUCCESS; + } +} From 3cc0d412ce9d67ef26a7688444c40d757c650cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 19 Jul 2023 10:58:11 +0800 Subject: [PATCH 68/86] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=A4=96=E9=83=A8=E4=BA=BA=E5=91=98=E5=90=8D=E7=A7=B0=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/SalarySendServiceImpl.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java index 9b0a8970a..c5ab1970f 100644 --- a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java @@ -1342,9 +1342,23 @@ public class SalarySendServiceImpl extends Service implements SalarySendService OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); queryParam.setOrderRule(orderRule); List list = salarySendInfoMapper.list(queryParam); + List employeeList = getExtEmpService(user).listEmployee(); + Map> idEmpMap = SalaryEntityUtil.group2Map(employeeList, DataCollectionEmployee::getEmployeeId); list.forEach(e -> { // 发放状态 e.setSendStatus(SalarySendStatusEnum.getDefaultLabelByValue(Integer.valueOf(e.getSendStatus()))); + + //外部人员 + if (Objects.equals(e.getEmployeeType(), 1)) { + List employees = idEmpMap.getOrDefault(e.getEmployeeId(), new ArrayList<>()); + if (CollectionUtils.isNotEmpty(employees) && employees.size() == 1) { + DataCollectionEmployee employee = employees.get(0); + e.setUsername(employee.getUsername()); + e.setDepartment(employee.getDepartmentName()); + e.setMobile(employee.getMobile()); + e.setJobNum(employee.getWorkcode()); + } + } }); // 3.添加行记录 From 57f75d36a0181623f4edb2632ba38a87055c68e8 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Wed, 19 Jul 2023 11:10:27 +0800 Subject: [PATCH 69/86] =?UTF-8?q?fix=E4=B8=AA=E7=A8=8E=E6=89=A3=E7=BC=B4?= =?UTF-8?q?=E4=B9=89=E5=8A=A1=E4=BA=BA=E4=BF=9D=E5=AD=98=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E5=89=8D=E5=90=8E=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/service/impl/TaxAgentServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java index 7addd6ac8..c3ab8c9b6 100644 --- a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java @@ -296,6 +296,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { @Override public String save(TaxAgentSaveParam saveParam) { ValidUtil.doValidator(saveParam); + saveParam.setName(StringUtils.trim(saveParam.getName())); // 是否开启分权 boolean isOpenDevolution = getTaxAgentBaseService(user).isOpenDevolution(); @@ -340,6 +341,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { @Override public String update(TaxAgentSaveParam saveParam) { ValidUtil.doValidator(saveParam, RuntimeTypeEnum.UPDATE); + saveParam.setName(StringUtils.trim(saveParam.getName())); TaxAgentPO taxAgent = getById(saveParam.getId()); if (taxAgent == null) { From 31a863c937bd694be69e1cf2d8b49cee8754e452 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Wed, 19 Jul 2023 11:51:31 +0800 Subject: [PATCH 70/86] =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=B7=A5=E8=B5=84=E5=8D=95=E6=A8=A1=E6=9D=BF=E6=97=B6=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/service/impl/SalarySendServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java index f6b149e70..7e5d5a944 100644 --- a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java @@ -664,6 +664,8 @@ public class SalarySendServiceImpl extends Service implements SalarySendService if (ObjectUtils.isEmpty(salarySendPO)) throw new SalaryRunTimeException("工资单不存在或已被删除"); List salaryTemplates = getSalaryTemplateService(user).getDefaultTemplates(Collections.singletonList(salarySendPO.getSalarySobId())); + if(CollectionUtils.isEmpty(salaryTemplates)) + throw new SalaryRunTimeException("请先设置工资单模板"); Integer ackFeedbackStatus = salaryTemplates.get(0).getAckFeedbackStatus(); if (ackFeedbackStatus!=null && NumberUtils.compare(ackFeedbackStatus,1) == 0) { // 默认为空时,未读未确认 From 311aa8f139744e403ee53970aa5bf2183f54f46b Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Wed, 19 Jul 2023 16:17:40 +0800 Subject: [PATCH 71/86] =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E5=A4=A7=E6=8B=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/SalarySendServiceImpl.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java index 7e5d5a944..6f01b9fe0 100644 --- a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java @@ -475,8 +475,9 @@ public class SalarySendServiceImpl extends Service implements SalarySendService SalarySendInfoPO salarySendInfo = salarySendInfos.get(0); // 获取默认模板信息 SalarySendPO salarySendPO = getSalarySendMapper().getById(salarySendInfo.getSalarySendId()); - if(ObjectUtils.isEmpty(salarySendPO)) + if(ObjectUtils.isEmpty(salarySendPO)){ throw new SalaryRunTimeException("工资单不存在"); + } // 更新查看状态 if (salarySendInfo.getBillReadStatus() == null || NumberUtils.compare(salarySendInfo.getBillReadStatus(),BillReadStatusEnum.UNREAD.getValue()) == 0) { salarySendInfo.setBillReadStatus(BillReadStatusEnum.READED.getValue()); @@ -661,11 +662,13 @@ public class SalarySendServiceImpl extends Service implements SalarySendService PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), page, SalarySendInfoListDTO.class); SalarySendPO salarySendPO = getSalarySendMapper().getById(queryParam.getSalarySendId()); - if (ObjectUtils.isEmpty(salarySendPO)) + if (ObjectUtils.isEmpty(salarySendPO)){ throw new SalaryRunTimeException("工资单不存在或已被删除"); + } List salaryTemplates = getSalaryTemplateService(user).getDefaultTemplates(Collections.singletonList(salarySendPO.getSalarySobId())); - if(CollectionUtils.isEmpty(salaryTemplates)) + if(CollectionUtils.isEmpty(salaryTemplates)){ throw new SalaryRunTimeException("请先设置工资单模板"); + } Integer ackFeedbackStatus = salaryTemplates.get(0).getAckFeedbackStatus(); if (ackFeedbackStatus!=null && NumberUtils.compare(ackFeedbackStatus,1) == 0) { // 默认为空时,未读未确认 From 013137ba30e2c551e1ee12942e217af40c1e8aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 19 Jul 2023 17:07:38 +0800 Subject: [PATCH 72/86] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E7=8A=B6=E6=80=81=E6=98=AF=E4=B8=B4=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/service/impl/ExtEmpServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java index 8936dfd1e..8de9513ee 100644 --- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -70,7 +70,7 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { BeanUtils.copyProperties(param, po); po.setId(IdGenerator.generate()); - po.setStatus("1"); + po.setStatus("2"); po.setCreator((long) user.getUID()); po.setModifier((long) user.getUID()); Date now = new Date(); From 1c83f1ab0e7b556b5e1643165092db3e13928e99 Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 19 Jul 2023 18:02:44 +0800 Subject: [PATCH 73/86] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A0=B8=E7=AE=97=EF=BC=8C=E5=BD=92=E6=A1=A3?= =?UTF-8?q?action=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/action/SalaryAcctFileByIdAction.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/action/SalaryAcctFileByIdAction.java b/src/com/engine/salary/action/SalaryAcctFileByIdAction.java index 9674aa9f4..710233ecb 100644 --- a/src/com/engine/salary/action/SalaryAcctFileByIdAction.java +++ b/src/com/engine/salary/action/SalaryAcctFileByIdAction.java @@ -3,7 +3,9 @@ package com.engine.salary.action; import com.engine.common.util.ServiceUtil; import com.engine.salary.service.SalaryAcctRecordService; import com.engine.salary.service.impl.SalaryAcctRecordServiceImpl; +import com.engine.salary.util.SalaryI18nUtil; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; import weaver.general.Util; import weaver.hrm.User; import weaver.interfaces.workflow.action.Action; @@ -43,7 +45,7 @@ public class SalaryAcctFileByIdAction implements Action { Map fieldMap = Arrays.stream(properties).collect(Collectors.toMap(Property::getName, property -> Util.null2String(property.getValue()))); - Long salaryAcctId = fieldMap.get(acctRecordId) != null ? Long.parseLong(fieldMap.get(acctRecordId)) : 0L; + Long salaryAcctId = StringUtils.isNotBlank(fieldMap.get(acctRecordId)) ? Long.parseLong(fieldMap.get(acctRecordId)) : 0L; if (!salaryAcctId.equals(0L)) { try { @@ -53,6 +55,9 @@ public class SalaryAcctFileByIdAction implements Action { requestInfo.getRequestManager().setMessage(e.getMessage()); return FAILURE_AND_CONTINUE; } + } else { + requestInfo.getRequestManager().setMessage(SalaryI18nUtil.getI18nLabel(542300, "薪资核算记录不存在或已被删除")); + return FAILURE_AND_CONTINUE; } return SUCCESS; } From b98fc4c5272af7a904a23093d454d494c89ac8cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 20 Jul 2023 10:17:20 +0800 Subject: [PATCH 74/86] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SalarySendServiceImpl.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java index d59004fe5..d13a0f2b9 100644 --- a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java @@ -690,20 +690,19 @@ public class SalarySendServiceImpl extends Service implements SalarySendService } }); } - return pageInfo; List list = pageInfo.getList(); List employeeList = getExtEmpService(user).listEmployee(); Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); list.forEach(dto -> { - if (dto.getEmployeeType() != null && Objects.equals(dto.getEmployeeType(), 1)) { - DataCollectionEmployee employee = employeeMap.get(dto.getEmployeeId()); - dto.setUsername(employee.getUsername()); - dto.setDepartment(employee.getDepartmentName()); - dto.setMobile(employee.getMobile()); - dto.setJobNum(employee.getWorkcode()); - } - }); + if (dto.getEmployeeType() != null && Objects.equals(dto.getEmployeeType(), 1)) { + DataCollectionEmployee employee = employeeMap.get(dto.getEmployeeId()); + dto.setUsername(employee.getUsername()); + dto.setDepartment(employee.getDepartmentName()); + dto.setMobile(employee.getMobile()); + dto.setJobNum(employee.getWorkcode()); + } + }); pageInfo.setList(list); return pageInfo; } From ce32c6571c2636e834da2d85607acf899e34decc Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Thu, 20 Jul 2023 11:14:58 +0800 Subject: [PATCH 75/86] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=87=8D=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salaryitem/SysSalaryItemMapper.java | 7 + .../mapper/salaryitem/SysSalaryItemMapper.xml | 212 +++++++++++++++++- .../salary/service/SysSalaryItemService.java | 2 + .../impl/SysSalaryItemServiceImpl.java | 5 + .../salary/wrapper/SysSalaryItemWrapper.java | 2 +- 5 files changed, 225 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/mapper/salaryitem/SysSalaryItemMapper.java b/src/com/engine/salary/mapper/salaryitem/SysSalaryItemMapper.java index baf9716cb..64fc27445 100644 --- a/src/com/engine/salary/mapper/salaryitem/SysSalaryItemMapper.java +++ b/src/com/engine/salary/mapper/salaryitem/SysSalaryItemMapper.java @@ -20,6 +20,13 @@ public interface SysSalaryItemMapper { * @return */ List listSome(SysSalaryItemPO po); + + /** + * 条件查询 + * @param po + * @return + */ + List listLikeName(SysSalaryItemPO po); /** diff --git a/src/com/engine/salary/mapper/salaryitem/SysSalaryItemMapper.xml b/src/com/engine/salary/mapper/salaryitem/SysSalaryItemMapper.xml index f8faf9c90..5f0f1977d 100644 --- a/src/com/engine/salary/mapper/salaryitem/SysSalaryItemMapper.xml +++ b/src/com/engine/salary/mapper/salaryitem/SysSalaryItemMapper.xml @@ -75,7 +75,7 @@ AND id = #{id} - AND name like '%'+#{name}+'%' + AND name = #{name} AND code = #{code} @@ -143,6 +143,214 @@ AND id = #{id} + + AND name = #{name} + + + AND code = #{code} + + + AND system_type = #{systemType} + + + AND use_default = #{useDefault} + + + AND use_in_employee_salary = #{useInEmployeeSalary} + + + AND rounding_mode = #{roundingMode} + + + AND pattern = #{pattern} + + + AND value_type = #{valueType} + + + AND formula_id = #{formulaId} + + + AND description = #{description} + + + AND can_edit = #{canEdit} + + + AND data_type = #{dataType} + + + AND creator = #{creator} + + + AND delete_type = #{deleteType} + + + AND tenant_key = #{tenantKey} + + + AND create_time = #{createTime} + + + AND update_time = #{updateTime} + + + AND id IN + + #{id} + + + ORDER BY id DESC + + + + + + + + -