|
|
|
@ -17,6 +17,7 @@ import com.engine.organization.entity.company.po.CompPO;
|
|
|
|
|
import com.engine.organization.entity.department.bo.DepartmentBO;
|
|
|
|
|
import com.engine.organization.entity.department.po.DepartmentPO;
|
|
|
|
|
import com.engine.organization.entity.extend.bo.ExtendInfoBO;
|
|
|
|
|
import com.engine.organization.entity.extend.param.ExtendInfoParams;
|
|
|
|
|
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
|
|
|
|
import com.engine.organization.entity.hrmresource.bo.HrmRelationBO;
|
|
|
|
|
import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam;
|
|
|
|
@ -34,6 +35,7 @@ import com.engine.organization.entity.searchtree.SearchTreeParams;
|
|
|
|
|
import com.engine.organization.enums.HrmGroupEnum;
|
|
|
|
|
import com.engine.organization.mapper.comp.CompMapper;
|
|
|
|
|
import com.engine.organization.mapper.department.DepartmentMapper;
|
|
|
|
|
import com.engine.organization.mapper.extend.ExtMapper;
|
|
|
|
|
import com.engine.organization.mapper.hrmresource.HrmRelationMapper;
|
|
|
|
|
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
|
|
|
|
import com.engine.organization.mapper.job.JobMapper;
|
|
|
|
@ -43,6 +45,7 @@ import com.engine.organization.service.HrmResourceService;
|
|
|
|
|
import com.engine.organization.util.HasRightUtil;
|
|
|
|
|
import com.engine.organization.util.MenuBtn;
|
|
|
|
|
import com.engine.organization.util.OrganizationAssert;
|
|
|
|
|
import com.engine.organization.util.OrganizationDateUtil;
|
|
|
|
|
import com.engine.organization.util.db.DBType;
|
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
|
import com.engine.organization.util.detach.DetachUtil;
|
|
|
|
@ -57,6 +60,7 @@ import weaver.general.StringUtil;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
import weaver.hrm.definedfield.HrmFieldManager;
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
@ -249,6 +253,40 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
return templatePO.getId();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
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();
|
|
|
|
|
String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
|
|
|
|
|
for (int i = 0; i < rowNum; i++) {
|
|
|
|
|
String recordIndex = "_" + i;
|
|
|
|
|
String id = Util.null2String(params.get("id" + recordIndex));
|
|
|
|
|
String name = Util.null2String(params.get("name" + recordIndex));
|
|
|
|
|
JclOrgCustomTemplatePO jclOrgCustomTemplatePO = new JclOrgCustomTemplatePO();
|
|
|
|
|
if (StringUtils.isNotBlank(id)) {
|
|
|
|
|
// 更新
|
|
|
|
|
long jclId = Long.parseLong(id);
|
|
|
|
|
jclOrgCustomTemplatePO = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).selectByPrimaryKey(jclId);
|
|
|
|
|
jclOrgCustomTemplatePO.setName(name);
|
|
|
|
|
jclOrgCustomTemplatePO.setUpdateTime(new java.sql.Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
|
|
|
|
|
count += MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).updateByPrimaryKey(jclOrgCustomTemplatePO);
|
|
|
|
|
allIds.remove(jclId);
|
|
|
|
|
} else {
|
|
|
|
|
//插入
|
|
|
|
|
jclOrgCustomTemplatePO.setName(name);
|
|
|
|
|
jclOrgCustomTemplatePO.setCreator(user.getUID());
|
|
|
|
|
jclOrgCustomTemplatePO.setCreateTime(new java.sql.Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
|
|
|
|
|
jclOrgCustomTemplatePO.setUpdateTime(new java.sql.Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
|
|
|
|
|
count += MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).insert(jclOrgCustomTemplatePO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtils.isNotEmpty(allIds)) {
|
|
|
|
|
count += MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).deleteByIds(allIds);
|
|
|
|
|
}
|
|
|
|
|
return count;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void deleteCustomTemplate(Integer id) {
|
|
|
|
|
getHrmResourceMapper().deleteCustomTemplate(id, user.getUID());
|
|
|
|
@ -451,10 +489,13 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
resultMap.put("name", item.getName());
|
|
|
|
|
resultMap.put("createTime", item.getCreateTime());
|
|
|
|
|
|
|
|
|
|
if(item.getIsused()!=null){
|
|
|
|
|
|
|
|
|
|
if (1 == item.getIsused()) {
|
|
|
|
|
isUsed.add(index.get());
|
|
|
|
|
}
|
|
|
|
|
index.getAndIncrement();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return resultMap;
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|