|
|
|
@ -111,7 +111,8 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> listPage(HrmResourceSearchParam params) {
|
|
|
|
|
OrganizationWeaTable<HrmResourceVO> table = new OrganizationWeaTable<>(user, HrmResourceVO.class);
|
|
|
|
|
String sqlWhere = buildSqlWhere(params);
|
|
|
|
|
Map<String, Object> searchParams = new HashMap<>();
|
|
|
|
|
String sqlWhere = buildSqlWhere(searchParams);
|
|
|
|
|
table.setSqlwhere(sqlWhere);
|
|
|
|
|
WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
|
result.putAll(table.makeDataResult());
|
|
|
|
@ -123,162 +124,25 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
public Map<String, Object> getSaveForm() {
|
|
|
|
|
Map<String, Object> apiDatas = new HashMap<>();
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
//List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID, "1");
|
|
|
|
|
//if (CollectionUtils.isNotEmpty(extendTitles)) {
|
|
|
|
|
// for (ExtendTitlePO extendTitle : extendTitles) {
|
|
|
|
|
// List<SearchConditionItem> items = getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_HRM, 2, extendTitle.getId().toString(), null, null, null);
|
|
|
|
|
// if (CollectionUtils.isNotEmpty(items)) {
|
|
|
|
|
// addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
apiDatas.put("condition", addGroups);
|
|
|
|
|
return apiDatas;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Long saveBaseForm(Map<String, Object> params) {
|
|
|
|
|
//HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
|
//String workCode = (String) params.get("work_code");
|
|
|
|
|
//// 判断是否开启自动编号
|
|
|
|
|
//workCode = repeatDetermine(workCode);
|
|
|
|
|
//params.put("work_code", workCode);
|
|
|
|
|
//// 完善新增参数
|
|
|
|
|
//completeParams(params);
|
|
|
|
|
//
|
|
|
|
|
//// 新增EC人员,新增成功后,新增到聚才林人员表
|
|
|
|
|
//Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.RESOURCE, OperateTypeEnum.ADD, params).sync();
|
|
|
|
|
//String ecResourceId = Util.null2String(syncMap.get("id"));
|
|
|
|
|
//OrganizationAssert.isTrue(StringUtils.isNotBlank(ecResourceId), Util.null2String(syncMap.get("message")));
|
|
|
|
|
//// 获取人员UUID
|
|
|
|
|
//RecordInfo recordInfo = getSystemDataMapper().getHrmObjectByID(HRM_RESOURCE, ecResourceId);
|
|
|
|
|
//params.put("uuid", recordInfo.getUuid());
|
|
|
|
|
//Long resourceId = getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRM, params, "", null);
|
|
|
|
|
// TODO new HrmResourceTriggerRunnable(resourceId).run();
|
|
|
|
|
//return resourceId;
|
|
|
|
|
return 0L;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getBaseForm(Map<String, Object> params) {
|
|
|
|
|
//OrganizationAssert.notNull(params.get("viewAttr"), "请标识操作类型");
|
|
|
|
|
//// 2编辑 1查看
|
|
|
|
|
//int viewAttr = Integer.parseInt((String) params.get("viewAttr"));
|
|
|
|
|
//long id = Long.parseLong((String) params.get("id"));
|
|
|
|
|
//String groupId = (String) params.get("viewCondition");
|
|
|
|
|
//
|
|
|
|
|
//HashMap<String, Object> buttonsMap = new HashMap<>();
|
|
|
|
|
//buttonsMap.put("hasEdit", true);
|
|
|
|
|
//buttonsMap.put("hasSave", true);
|
|
|
|
|
//
|
|
|
|
|
//List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
//if ("0".equals(groupId)) {
|
|
|
|
|
// groupId = GROUP_ID.toString();
|
|
|
|
|
//}
|
|
|
|
|
//List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId), "1");
|
|
|
|
|
//
|
|
|
|
|
//if (CollectionUtils.isNotEmpty(extendTitles)) {
|
|
|
|
|
// for (ExtendTitlePO extendTitle : extendTitles) {
|
|
|
|
|
// List<SearchConditionItem> items = getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_HRM : JCL_ORG_HRMEXT, viewAttr, id, extendTitle.getId() + "", "");
|
|
|
|
|
// if (CollectionUtils.isNotEmpty(items)) {
|
|
|
|
|
// addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
//
|
|
|
|
|
//HashMap<String, Object> resultMap = new HashMap<>();
|
|
|
|
|
//resultMap.put("buttons", buttonsMap);
|
|
|
|
|
//resultMap.put("conditions", addGroups);
|
|
|
|
|
//resultMap.put("id", id);
|
|
|
|
|
//// 拓展页面分组
|
|
|
|
|
//resultMap.put("tabInfo", getExtService(user).getTabInfo(EXTEND_TYPE, JCL_ORG_HRMEXT));
|
|
|
|
|
//// 处理明细表
|
|
|
|
|
//resultMap.put("tables", getExtService(user).getExtendTables(user, EXTEND_TYPE, Long.parseLong(groupId), JCL_ORG_HRMEXT_DT1, id, viewAttr, false));
|
|
|
|
|
//Map<String, Object> apiDatas = new HashMap<>();
|
|
|
|
|
//
|
|
|
|
|
//apiDatas.put("result", resultMap);
|
|
|
|
|
//
|
|
|
|
|
//return apiDatas;
|
|
|
|
|
return new HashMap<>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int updateForm(Map<String, Object> params) {
|
|
|
|
|
//Long id = Long.parseLong((String) params.get("id"));
|
|
|
|
|
//String groupId = (String) params.get("viewCondition");
|
|
|
|
|
//int updateCount = 0;
|
|
|
|
|
//if ("0".equals(groupId) || GROUP_ID.toString().equals(groupId)) {
|
|
|
|
|
// // 判断编号是否重复
|
|
|
|
|
// String workCode = Util.null2String(params.get("work_code"));
|
|
|
|
|
// HrmResourcePO resourceById = getResourceMapper().getResourceById(id.toString());
|
|
|
|
|
// if (!workCode.equals(resourceById.getWorkCode())) {
|
|
|
|
|
// workCode = repeatDetermine(workCode);
|
|
|
|
|
// params.put("work_code", workCode);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// // 完善更新参数
|
|
|
|
|
// completeParams(params);
|
|
|
|
|
//
|
|
|
|
|
// // 更新EC人员,更新成功后,更新聚才林人员表
|
|
|
|
|
// Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.RESOURCE, OperateTypeEnum.UPDATE, params).sync();
|
|
|
|
|
// String ecResourceId = Util.null2String(syncMap.get("id"));
|
|
|
|
|
// OrganizationAssert.isTrue(StringUtils.isNotBlank(ecResourceId), Util.null2String(syncMap.get("message")));
|
|
|
|
|
//
|
|
|
|
|
// // 更新主表数据
|
|
|
|
|
// updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRM, params, "", id);
|
|
|
|
|
//
|
|
|
|
|
// // TODO new HrmResourceTriggerRunnable(id).run();
|
|
|
|
|
//} else {
|
|
|
|
|
// // 更新主表拓展表
|
|
|
|
|
// getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRMEXT, params, "", id);
|
|
|
|
|
//}
|
|
|
|
|
////更新明细表
|
|
|
|
|
//getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_HRMEXT_DT1, params, id);
|
|
|
|
|
//
|
|
|
|
|
//return updateCount;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SearchTemplateParam> getSearchTemplate() {
|
|
|
|
|
int userUID = user.getUID();
|
|
|
|
|
// 根据ID查询所存储的模板
|
|
|
|
|
List<SearchTemplateParam> templates = getHrmResourceMapper().getSearchTemplatesByUser(userUID);
|
|
|
|
|
templates.add(0, SearchTemplateParam.builder().key("-1").selected(false).showName("默认模板").build());
|
|
|
|
|
return templates;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SearchConditionGroup> getAllConditions() {
|
|
|
|
|
HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo();
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> basicConditionItems = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> personalConditionItems = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> workConditionItems = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
// 基本信息:-1
|
|
|
|
|
List<CusFormFieldPO> hrmFieldsByScopeId = getSystemDataMapper().getHrmFieldsByScopeId("-1");
|
|
|
|
|
createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, basicConditionItems);
|
|
|
|
|
if (CollectionUtils.isNotEmpty(basicConditionItems)) {
|
|
|
|
|
addGroups.add(new SearchConditionGroup("基本信息", true, basicConditionItems));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 个人信息:1
|
|
|
|
|
hrmFieldsByScopeId = getSystemDataMapper().getHrmFieldsByScopeId("1");
|
|
|
|
|
createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, personalConditionItems);
|
|
|
|
|
if (CollectionUtils.isNotEmpty(personalConditionItems)) {
|
|
|
|
|
addGroups.add(new SearchConditionGroup("个人信息", true, personalConditionItems));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 工作信息:3
|
|
|
|
|
hrmFieldsByScopeId = getSystemDataMapper().getHrmFieldsByScopeId("3");
|
|
|
|
|
createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, workConditionItems);
|
|
|
|
|
if (CollectionUtils.isNotEmpty(workConditionItems)) {
|
|
|
|
|
addGroups.add(new SearchConditionGroup("工作信息", true, workConditionItems));
|
|
|
|
|
}
|
|
|
|
|
return addGroups;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void saveSearchTemplate(SearchTemplateParam params) {
|
|
|
|
|
String[] split = params.getFields().split(",");
|
|
|
|
@ -295,12 +159,17 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
workFieldsBuilder.add(fieldName.substring(fieldName.lastIndexOf("_") + 1));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
SearchTemplatePO searchTemplatePO = SearchTemplatePO.builder().name(params.getShowName()).basicFields(StringUtils.join(basicFieldsBuilder, ",")).personalFields(StringUtils.join(personalFieldsBuilder, ",")).workFields(StringUtils.join(workFieldsBuilder, ",")).creator(user.getUID()).createTime(new Date()).updateTime(new Date()).build();
|
|
|
|
|
SearchTemplatePO searchTemplatePO = SearchTemplatePO.builder().name(params.getShowname()).basicFields(StringUtils.join(basicFieldsBuilder, ",")).personalFields(StringUtils.join(personalFieldsBuilder, ",")).workFields(StringUtils.join(workFieldsBuilder, ",")).creator(user.getUID()).createTime(new Date()).updateTime(new Date()).build();
|
|
|
|
|
getHrmResourceMapper().insertSearchTemplate(searchTemplatePO);
|
|
|
|
|
// 保存模板
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void deleteSearchTemplate(Integer id) {
|
|
|
|
|
getHrmResourceMapper().deleteSearchTemplate(id, user.getUID());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
|
|
|
|
String templateId = Util.null2String(params.get("templateId"));
|
|
|
|
@ -471,49 +340,54 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
* @param params
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private String buildSqlWhere(HrmResourceSearchParam params) {
|
|
|
|
|
private String buildSqlWhere(Map<String, Object> params) {
|
|
|
|
|
DBType dbType = DBType.get(new RecordSet().getDBType());
|
|
|
|
|
String sqlWhere = " where 1=1 ";
|
|
|
|
|
String lastName = params.getLastName();
|
|
|
|
|
if (StringUtils.isNotBlank(lastName)) {
|
|
|
|
|
sqlWhere += " AND t.lastname " + dbType.like(lastName);
|
|
|
|
|
}
|
|
|
|
|
Long companyId = params.getCompanyId();
|
|
|
|
|
if (null != companyId) {
|
|
|
|
|
sqlWhere += " AND t.subcompanyid1 = '" + companyId + "'";
|
|
|
|
|
}
|
|
|
|
|
Long departmentId = params.getDepartmentId();
|
|
|
|
|
if (null != departmentId) {
|
|
|
|
|
sqlWhere += " AND t.departmentid = '" + departmentId + "'";
|
|
|
|
|
}
|
|
|
|
|
Long ecCompany = params.getEcCompany();
|
|
|
|
|
if (null != ecCompany) {
|
|
|
|
|
sqlWhere += " AND t.subcompanyid1 = '" + ecCompany + "'";
|
|
|
|
|
}
|
|
|
|
|
Long ecDepartment = params.getEcDepartment();
|
|
|
|
|
if (null != ecDepartment) {
|
|
|
|
|
sqlWhere += " AND t.departmentid = '" + ecDepartment + "'";
|
|
|
|
|
}
|
|
|
|
|
String telephone = params.getTelephone();
|
|
|
|
|
if (StringUtils.isNotBlank(telephone)) {
|
|
|
|
|
sqlWhere += " AND t.telephone " + dbType.like(telephone);
|
|
|
|
|
}
|
|
|
|
|
String mobile = params.getMobile();
|
|
|
|
|
if (StringUtils.isNotBlank(mobile)) {
|
|
|
|
|
sqlWhere += " AND t.mobile " + dbType.like(mobile);
|
|
|
|
|
}
|
|
|
|
|
Long jobTitle = params.getJobTitle();
|
|
|
|
|
if (null != jobTitle) {
|
|
|
|
|
JobPO ecJobTitleByJobId = JobBO.getEcJobTitleByJobId(jobTitle);
|
|
|
|
|
if (null != ecJobTitleByJobId) {
|
|
|
|
|
sqlWhere += " AND t.subcompanyid1 = '" + ecJobTitleByJobId.getEcCompany() + "'";
|
|
|
|
|
sqlWhere += " AND t.departmentid = '" + ecJobTitleByJobId.getEcDepartment() + "'";
|
|
|
|
|
sqlWhere += " AND t.jobtitle = '" + ecJobTitleByJobId.getEcJobTitle() + "'";
|
|
|
|
|
} else {
|
|
|
|
|
sqlWhere = " where 1 = 2 ";
|
|
|
|
|
}
|
|
|
|
|
for (Map.Entry<String, Object> entry : params.entrySet()) {
|
|
|
|
|
String key = entry.getKey();
|
|
|
|
|
Object value = entry.getValue();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//String lastName = params.getLastName();
|
|
|
|
|
//if (StringUtils.isNotBlank(lastName)) {
|
|
|
|
|
// sqlWhere += " AND t.lastname " + dbType.like(lastName);
|
|
|
|
|
//}
|
|
|
|
|
//Long companyId = params.getCompanyId();
|
|
|
|
|
//if (null != companyId) {
|
|
|
|
|
// sqlWhere += " AND t.subcompanyid1 = '" + companyId + "'";
|
|
|
|
|
//}
|
|
|
|
|
//Long departmentId = params.getDepartmentId();
|
|
|
|
|
//if (null != departmentId) {
|
|
|
|
|
// sqlWhere += " AND t.departmentid = '" + departmentId + "'";
|
|
|
|
|
//}
|
|
|
|
|
//Long ecCompany = params.getEcCompany();
|
|
|
|
|
//if (null != ecCompany) {
|
|
|
|
|
// sqlWhere += " AND t.subcompanyid1 = '" + ecCompany + "'";
|
|
|
|
|
//}
|
|
|
|
|
//Long ecDepartment = params.getEcDepartment();
|
|
|
|
|
//if (null != ecDepartment) {
|
|
|
|
|
// sqlWhere += " AND t.departmentid = '" + ecDepartment + "'";
|
|
|
|
|
//}
|
|
|
|
|
//String telephone = params.getTelephone();
|
|
|
|
|
//if (StringUtils.isNotBlank(telephone)) {
|
|
|
|
|
// sqlWhere += " AND t.telephone " + dbType.like(telephone);
|
|
|
|
|
//}
|
|
|
|
|
//String mobile = params.getMobile();
|
|
|
|
|
//if (StringUtils.isNotBlank(mobile)) {
|
|
|
|
|
// sqlWhere += " AND t.mobile " + dbType.like(mobile);
|
|
|
|
|
//}
|
|
|
|
|
//Long jobTitle = params.getJobTitle();
|
|
|
|
|
//if (null != jobTitle) {
|
|
|
|
|
// JobPO ecJobTitleByJobId = JobBO.getEcJobTitleByJobId(jobTitle);
|
|
|
|
|
// if (null != ecJobTitleByJobId) {
|
|
|
|
|
// sqlWhere += " AND t.subcompanyid1 = '" + ecJobTitleByJobId.getEcCompany() + "'";
|
|
|
|
|
// sqlWhere += " AND t.departmentid = '" + ecJobTitleByJobId.getEcDepartment() + "'";
|
|
|
|
|
// sqlWhere += " AND t.jobtitle = '" + ecJobTitleByJobId.getEcJobTitle() + "'";
|
|
|
|
|
// } else {
|
|
|
|
|
// sqlWhere = " where 1 = 2 ";
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
// 分权查询
|
|
|
|
|
DetachUtil detachUtil = new DetachUtil(user);
|
|
|
|
|
String parentCompanyIds = detachUtil.getJclRoleLevels();
|
|
|
|
@ -699,66 +573,49 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//private void completeParams(Map<String, Object> params) {
|
|
|
|
|
// String jobId = Util.null2String(params.get("job_title"));
|
|
|
|
|
// if (StringUtils.isNotBlank(jobId)) {
|
|
|
|
|
// JobPO jobById = getJobMapper().getJobById(Long.parseLong(jobId));
|
|
|
|
|
// params.put("department_id", jobById.getEcDepartment());
|
|
|
|
|
// params.put("company_id", jobById.getEcCompany());
|
|
|
|
|
// params.put("ec_department", jobById.getEcDepartment());
|
|
|
|
|
// params.put("ec_company", jobById.getEcCompany());
|
|
|
|
|
// // 等级方案、岗位序列、职等、职级
|
|
|
|
|
// params.put("scheme_id", jobById.getSchemeId());
|
|
|
|
|
// params.put("sequence_id", jobById.getSequenceId());
|
|
|
|
|
// params.put("job_level", jobById.getLevelId());
|
|
|
|
|
// params.put("job_grade", jobById.getGradeId());
|
|
|
|
|
// String showOrder = Util.null2String(params.get("show_order"));
|
|
|
|
|
// // 初始化排序字段
|
|
|
|
|
// if (StringUtils.isBlank(showOrder)) {
|
|
|
|
|
// Long orderNum = getResourceMapper().getMaxShowOrder();
|
|
|
|
|
// params.put("show_order", null == orderNum ? 1 : orderNum + 1);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// // 人员状态
|
|
|
|
|
// String status = Util.null2String(params.get("status"));
|
|
|
|
|
// if (StringUtils.isBlank(status)) {
|
|
|
|
|
// params.put("status", "0");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 判断编号是否重复
|
|
|
|
|
* 获取当前人员所有的模板信息
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
//public static String repeatDetermine(String workCode) {
|
|
|
|
|
// CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(RuleCodeType.USER.getValue());
|
|
|
|
|
// if (StringUtils.isNotBlank(workCode)) {
|
|
|
|
|
// workCode = CodeRuleUtil.generateCode(RuleCodeType.USER, workCode);
|
|
|
|
|
// List<HrmResourcePO> list = getResourceMapper().listByNo(Util.null2String(workCode));
|
|
|
|
|
// OrganizationAssert.isEmpty(list, "编号不允许重复");
|
|
|
|
|
// } else {
|
|
|
|
|
// OrganizationAssert.isTrue(null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable()), "编号不允许为空");
|
|
|
|
|
// workCode = autoCreateWorkCode();
|
|
|
|
|
// }
|
|
|
|
|
// return workCode;
|
|
|
|
|
//}
|
|
|
|
|
public List<SearchTemplateParam> getSearchTemplate() {
|
|
|
|
|
int userUID = user.getUID();
|
|
|
|
|
// 根据ID查询所存储的模板
|
|
|
|
|
List<SearchTemplateParam> templates = getHrmResourceMapper().getSearchTemplatesByUser(userUID);
|
|
|
|
|
templates.add(0, SearchTemplateParam.builder().key("-1").selected(false).showname("默认模板").build());
|
|
|
|
|
return templates;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 自动编号处理
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
//private static String autoCreateWorkCode() {
|
|
|
|
|
// String generateCode = CodeRuleUtil.generateCode(RuleCodeType.USER, "");
|
|
|
|
|
// List<HrmResourcePO> list = getResourceMapper().listByNo(Util.null2String(generateCode));
|
|
|
|
|
// if (CollectionUtils.isNotEmpty(list)) {
|
|
|
|
|
// generateCode = autoCreateWorkCode();
|
|
|
|
|
// }
|
|
|
|
|
// return generateCode;
|
|
|
|
|
//}
|
|
|
|
|
public List<SearchConditionGroup> getAllConditions() {
|
|
|
|
|
HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo();
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> basicConditionItems = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> personalConditionItems = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> workConditionItems = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
// 基本信息:-1
|
|
|
|
|
List<CusFormFieldPO> hrmFieldsByScopeId = getSystemDataMapper().getHrmFieldsByScopeId("-1");
|
|
|
|
|
createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, basicConditionItems);
|
|
|
|
|
if (CollectionUtils.isNotEmpty(basicConditionItems)) {
|
|
|
|
|
addGroups.add(new SearchConditionGroup("基本信息", true, basicConditionItems));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 个人信息:1
|
|
|
|
|
hrmFieldsByScopeId = getSystemDataMapper().getHrmFieldsByScopeId("1");
|
|
|
|
|
createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, personalConditionItems);
|
|
|
|
|
if (CollectionUtils.isNotEmpty(personalConditionItems)) {
|
|
|
|
|
addGroups.add(new SearchConditionGroup("个人信息", true, personalConditionItems));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 工作信息:3
|
|
|
|
|
hrmFieldsByScopeId = getSystemDataMapper().getHrmFieldsByScopeId("3");
|
|
|
|
|
createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, workConditionItems);
|
|
|
|
|
if (CollectionUtils.isNotEmpty(workConditionItems)) {
|
|
|
|
|
addGroups.add(new SearchConditionGroup("工作信息", true, workConditionItems));
|
|
|
|
|
}
|
|
|
|
|
return addGroups;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 构建查询条件Item
|
|
|
|
@ -778,7 +635,10 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
hrmFieldBean.setIsQuickSearch(false);
|
|
|
|
|
hrmFieldBean.setIsScope(false);
|
|
|
|
|
hrmFieldBean.setDmlurl(cusFormFieldPO.getDmlUrl());
|
|
|
|
|
conditionItems.add(hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user));
|
|
|
|
|
hrmFieldBean.setIssystem("hrm".equals(cusFormFieldPO.getTableName()) ? "1" : "0");
|
|
|
|
|
hrmFieldBean.setIsFormField(true);
|
|
|
|
|
SearchConditionItem searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
|
|
|
|
conditionItems.add(searchConditionItem);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -797,6 +657,15 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取模板中的字段,构建搜索条件
|
|
|
|
|
*
|
|
|
|
|
* @param hrmFieldSearchConditionComInfo
|
|
|
|
|
* @param addGroups
|
|
|
|
|
* @param title
|
|
|
|
|
* @param scopeid
|
|
|
|
|
* @param fieldNames
|
|
|
|
|
*/
|
|
|
|
|
private void getTemplateItems(HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo, List<SearchConditionGroup> addGroups, String title, Integer scopeid, String[] fieldNames) {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
@ -815,9 +684,12 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
hrmFieldBean.setFieldhtmltype(hrmFieldConf.getString("fieldhtmltype"));
|
|
|
|
|
hrmFieldBean.setType(hrmFieldConf.getString("type"));
|
|
|
|
|
hrmFieldBean.setDmlurl(hrmFieldConf.getString("dmlurl"));
|
|
|
|
|
hrmFieldBean.setIssystem(baseField ? "1" : "0");
|
|
|
|
|
hrmFieldBean.setIsFormField(true);
|
|
|
|
|
hrmFieldBean.setIsQuickSearch(false);
|
|
|
|
|
hrmFieldBean.setIsScope(false);
|
|
|
|
|
conditionItems.add(hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user));
|
|
|
|
|
SearchConditionItem searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
|
|
|
|
conditionItems.add(searchConditionItem);
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtils.isNotEmpty(conditionItems)) {
|
|
|
|
|
addGroups.add(new SearchConditionGroup(title, true, conditionItems));
|
|
|
|
|