From ff88b1f9ca8f75aa3f826882aa0e32df1246757e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 21 Jun 2022 11:38:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=98=E5=B7=A5=E5=AD=97=E6=AE=B5=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sql/判断核算人员的范围.sql | 10 ++++++++++ .../service/impl/SalarySobItemServiceImpl.java | 15 +++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 resource/sql/判断核算人员的范围.sql diff --git a/resource/sql/判断核算人员的范围.sql b/resource/sql/判断核算人员的范围.sql new file mode 100644 index 000000000..bf6790886 --- /dev/null +++ b/resource/sql/判断核算人员的范围.sql @@ -0,0 +1,10 @@ +--过滤入职日期大于薪资周期的 + + +select e.companystartdate +from hrmresource e + left join hrmdepartment d on e.departmentid = d.id + left join hrmjobtitles c on e.jobtitle = c.id +WHERE e.status in (0,1,2,3) and (e.accounttype is null or e.accounttype = 0) + and e.subcompanyid1 IN (1) +ORDER BY e.companystartdate desc \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index 214e1683b..ecb8a2aae 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -158,14 +158,25 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe ValidUtil.doValidator(saveParam); - //1、账套存在 + //账套存在 Long salarySobId = saveParam.getSalarySobId(); SalarySobPO salarySobPO = salarySobBiz.getById(salarySobId); if (Objects.isNull(salarySobPO)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "参数错误,薪资账套不存在或者已被删除")); } - // todo 2、分类名称唯一 + //员工信息字段不可重复 + List empFields = saveParam.getEmpFields(); + if(CollectionUtils.isNotEmpty(empFields)){ + int count = (int)SalaryEntityUtil.properties(empFields, SalarySobItemSaveParam.SalarySobEmpFieldParam::getFieldId).stream().distinct().count(); + if(count < empFields.size()){ + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "分类名称重复!")); + } + }else { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "员工信息不能为空!")); + } + + //分类名称唯一 List itemGroups = saveParam.getItemGroups(); if(CollectionUtils.isNotEmpty(itemGroups)){ int count = (int)SalaryEntityUtil.properties(itemGroups, SalarySobItemSaveParam.SalarySobItemGroupParam::getName).stream().distinct().count();