|
|
|
@ -316,8 +316,18 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
public Integer updateCustomTemplate(Map<String, Object> params) {
|
|
|
|
|
int rowNum = Util.getIntValue((String) params.get("rownum"));
|
|
|
|
|
int count = 0;
|
|
|
|
|
List<Long> allIds = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).listAllId();
|
|
|
|
|
List<Long> allIds = getJclOrgCustomTemplateMapper().listAllId();
|
|
|
|
|
String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
|
|
|
|
|
List<String> nameList = new ArrayList<>();
|
|
|
|
|
for (int i = 0; i < rowNum; i++) {
|
|
|
|
|
String recordIndex = "_" + i;
|
|
|
|
|
String name = Util.null2String(params.get("name" + recordIndex));
|
|
|
|
|
if (StringUtils.isNotBlank(name)) {
|
|
|
|
|
nameList.add(name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OrganizationAssert.isFalse(new HashSet<>(nameList).size() < nameList.size(), "模板名称不能重复");
|
|
|
|
|
for (int i = 0; i < rowNum; i++) {
|
|
|
|
|
String recordIndex = "_" + i;
|
|
|
|
|
String id = Util.null2String(params.get("id" + recordIndex));
|
|
|
|
@ -333,6 +343,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
allIds.remove(jclId);
|
|
|
|
|
} else {
|
|
|
|
|
//插入
|
|
|
|
|
OrganizationAssert.isFalse("".equals(name), "模板名称不能为空");
|
|
|
|
|
jclOrgCustomTemplatePO.setName(name);
|
|
|
|
|
jclOrgCustomTemplatePO.setCreator(user.getUID());
|
|
|
|
|
jclOrgCustomTemplatePO.setCreateTime(new java.sql.Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
|
|
|
|
|