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();