|
|
@ -18,7 +18,6 @@ import com.engine.organization.entity.company.po.CompPO;
|
|
|
|
import com.engine.organization.entity.department.bo.DepartmentBO;
|
|
|
|
import com.engine.organization.entity.department.bo.DepartmentBO;
|
|
|
|
import com.engine.organization.entity.department.po.DepartmentPO;
|
|
|
|
import com.engine.organization.entity.department.po.DepartmentPO;
|
|
|
|
import com.engine.organization.entity.extend.bo.ExtendInfoBO;
|
|
|
|
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.extend.po.ExtendInfoPO;
|
|
|
|
import com.engine.organization.entity.hrmresource.bo.HrmRelationBO;
|
|
|
|
import com.engine.organization.entity.hrmresource.bo.HrmRelationBO;
|
|
|
|
import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam;
|
|
|
|
import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam;
|
|
|
@ -36,7 +35,6 @@ import com.engine.organization.entity.searchtree.SearchTreeParams;
|
|
|
|
import com.engine.organization.enums.HrmGroupEnum;
|
|
|
|
import com.engine.organization.enums.HrmGroupEnum;
|
|
|
|
import com.engine.organization.mapper.comp.CompMapper;
|
|
|
|
import com.engine.organization.mapper.comp.CompMapper;
|
|
|
|
import com.engine.organization.mapper.department.DepartmentMapper;
|
|
|
|
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.HrmRelationMapper;
|
|
|
|
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
|
|
|
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
|
|
|
import com.engine.organization.mapper.job.JobMapper;
|
|
|
|
import com.engine.organization.mapper.job.JobMapper;
|
|
|
@ -56,12 +54,12 @@ import org.apache.commons.collections.CollectionUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.json.JSONException;
|
|
|
|
import org.json.JSONException;
|
|
|
|
import org.json.JSONObject;
|
|
|
|
import org.json.JSONObject;
|
|
|
|
|
|
|
|
import weaver.common.DateUtil;
|
|
|
|
import weaver.conn.RecordSet;
|
|
|
|
import weaver.conn.RecordSet;
|
|
|
|
import weaver.general.StringUtil;
|
|
|
|
import weaver.general.StringUtil;
|
|
|
|
import weaver.general.Util;
|
|
|
|
import weaver.general.Util;
|
|
|
|
import weaver.hrm.definedfield.HrmFieldManager;
|
|
|
|
import weaver.hrm.definedfield.HrmFieldManager;
|
|
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
@ -205,6 +203,9 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Integer saveSearchTemplate(SearchTemplateParam params) {
|
|
|
|
public Integer saveSearchTemplate(SearchTemplateParam params) {
|
|
|
|
|
|
|
|
// 重复名称校验
|
|
|
|
|
|
|
|
SearchTemplatePO searchTemplateByName = getHrmResourceMapper().getSearchTemplateByName(user.getUID(), params.getShowname());
|
|
|
|
|
|
|
|
OrganizationAssert.isNull(searchTemplateByName, "改模板名称已存在");
|
|
|
|
SearchTemplatePO templatePO = buildSearchTemplateByFields(params.getFields());
|
|
|
|
SearchTemplatePO templatePO = buildSearchTemplateByFields(params.getFields());
|
|
|
|
if (null == templatePO) {
|
|
|
|
if (null == templatePO) {
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
@ -261,12 +262,15 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
templates = getHrmResourceMapper().getSearchTemplatesByUser(userUID);
|
|
|
|
templates = getHrmResourceMapper().getSearchTemplatesByUser(userUID);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
templates.add(0, SearchTemplateParam.builder().key("-1").selected(false).showname("默认模板").build());
|
|
|
|
templates.add(0, SearchTemplateParam.builder().key("-1").showname("默认模板").build());
|
|
|
|
return templates;
|
|
|
|
return templates;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Integer saveCustomTemplate(SearchTemplateParam params) {
|
|
|
|
public Integer saveCustomTemplate(SearchTemplateParam params) {
|
|
|
|
|
|
|
|
// 重复名称校验
|
|
|
|
|
|
|
|
SearchTemplatePO searchTemplateByName = getHrmResourceMapper().getCustomTemplateByName(user.getUID(), params.getShowname());
|
|
|
|
|
|
|
|
OrganizationAssert.isNull(searchTemplateByName, "改模板名称已存在");
|
|
|
|
SearchTemplatePO templatePO = buildSearchTemplateByFields(params.getFields());
|
|
|
|
SearchTemplatePO templatePO = buildSearchTemplateByFields(params.getFields());
|
|
|
|
if (null == templatePO) {
|
|
|
|
if (null == templatePO) {
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
@ -502,10 +506,10 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Map<String, Object> getCustomTemplate(Map<String, Object> params) {
|
|
|
|
public Map<String, Object> getCustomTemplate(Map<String, Object> params) {
|
|
|
|
List<ExtendInfoPO> infoPOList = new ArrayList<>();
|
|
|
|
List<ExtendInfoPO> infoPOList = new ArrayList<>();
|
|
|
|
infoPOList.add(ExtendInfoPO.builder().id(null).fieldName("name").fieldNameDesc("模板名称").fieldType("varchar(255)").controlType(1).browserType("1").customValue("[\"input\",\"text\",\"50\"]").showOrder(1).isrequired(0).isSystemDefault(0).build());
|
|
|
|
infoPOList.add(ExtendInfoPO.builder().viewAttr(2).id(null).fieldName("name").fieldNameDesc("模板名称").fieldType("varchar(255)").controlType(1).browserType("1").customValue("[\"input\",\"text\",\"50\"]").showOrder(1).isrequired(0).isSystemDefault(0).build());
|
|
|
|
infoPOList.add(ExtendInfoPO.builder().id(null).fieldName("createTime").fieldNameDesc("创建时间").fieldType("date").controlType(1).browserType("1").customValue("[\"input\",\"text\",\"50\"]").showOrder(2).isrequired(0).isSystemDefault(0).build());
|
|
|
|
infoPOList.add(ExtendInfoPO.builder().viewAttr(1).id(null).fieldName("createTime").fieldNameDesc("创建时间").fieldType("date").controlType(1).browserType("1").customValue("[\"input\",\"text\",\"50\"]").showOrder(2).isrequired(0).isSystemDefault(0).build());
|
|
|
|
Map<String, Object> tabInfoMap = new HashMap<>();
|
|
|
|
Map<String, Object> tabInfoMap = new HashMap<>();
|
|
|
|
tabInfoMap.put("columns", ExtendInfoBO.convertInfoListToTable(user, infoPOList, 2, false, true));
|
|
|
|
tabInfoMap.put("columns", ExtendInfoBO.convertInfoListToTable(user, infoPOList, false, true));
|
|
|
|
List<JclOrgCustomTemplatePO> jclOrgCustomTemplatePOS = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).listAll();
|
|
|
|
List<JclOrgCustomTemplatePO> jclOrgCustomTemplatePOS = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).listAll();
|
|
|
|
List<Integer> isUsed = new ArrayList<>();
|
|
|
|
List<Integer> isUsed = new ArrayList<>();
|
|
|
|
AtomicInteger index = new AtomicInteger(0);
|
|
|
|
AtomicInteger index = new AtomicInteger(0);
|
|
|
@ -513,9 +517,9 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
|
resultMap.put("id", item.getId());
|
|
|
|
resultMap.put("id", item.getId());
|
|
|
|
resultMap.put("name", item.getName());
|
|
|
|
resultMap.put("name", item.getName());
|
|
|
|
resultMap.put("createTime", item.getCreateTime());
|
|
|
|
resultMap.put("createTime", DateUtil.getDate(item.getCreateTime(), DateUtil.FORMAT_FULL));
|
|
|
|
|
|
|
|
|
|
|
|
if(item.getIsused()!=null){
|
|
|
|
if (item.getIsused() != null) {
|
|
|
|
|
|
|
|
|
|
|
|
if (1 == item.getIsused()) {
|
|
|
|
if (1 == item.getIsused()) {
|
|
|
|
isUsed.add(index.get());
|
|
|
|
isUsed.add(index.get());
|
|
|
@ -571,6 +575,9 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String key = entry.getKey();
|
|
|
|
String key = entry.getKey();
|
|
|
|
|
|
|
|
if ("lastName".equals(key)) {
|
|
|
|
|
|
|
|
sb.append(" and t.lastname ").append(dbType.like(value));
|
|
|
|
|
|
|
|
}
|
|
|
|
SearchConditionItem searchConditionItem = allFieldsMap.get(key);
|
|
|
|
SearchConditionItem searchConditionItem = allFieldsMap.get(key);
|
|
|
|
buildDynamicSql(searchConditionItem, key, value, sb, dbType);
|
|
|
|
buildDynamicSql(searchConditionItem, key, value, sb, dbType);
|
|
|
|
// 根据不同的类型,不同的查询方式
|
|
|
|
// 根据不同的类型,不同的查询方式
|
|
|
@ -1093,7 +1100,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
private static String getFieldName(String fieldabel) {
|
|
|
|
private static String getFieldName(String fieldabel) {
|
|
|
|
RecordSet recordSet = new RecordSet();
|
|
|
|
RecordSet recordSet = new RecordSet();
|
|
|
|
String fieldname = null;
|
|
|
|
String fieldname = null;
|
|
|
|
recordSet.executeQuery("select fieldname from jcl_org_field where fieldlabel='" + fieldabel+"'");
|
|
|
|
recordSet.executeQuery("select fieldname from jcl_org_field where fieldlabel='" + fieldabel + "'");
|
|
|
|
if (recordSet.next()) {
|
|
|
|
if (recordSet.next()) {
|
|
|
|
fieldname = recordSet.getString("fieldname");
|
|
|
|
fieldname = recordSet.getString("fieldname");
|
|
|
|
}
|
|
|
|
}
|
|
|
|