员工字段不可重复

This commit is contained in:
钱涛 2022-06-21 11:38:55 +08:00
parent 3363120c44
commit ff88b1f9ca
2 changed files with 23 additions and 2 deletions

View File

@ -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

View File

@ -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<SalarySobItemSaveParam.SalarySobEmpFieldParam> 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<SalarySobItemSaveParam.SalarySobItemGroupParam> itemGroups = saveParam.getItemGroups();
if(CollectionUtils.isNotEmpty(itemGroups)){
int count = (int)SalaryEntityUtil.properties(itemGroups, SalarySobItemSaveParam.SalarySobItemGroupParam::getName).stream().distinct().count();