|
|
@ -1,5 +1,6 @@
|
|
|
|
package com.engine.organization.service.impl;
|
|
|
|
package com.engine.organization.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.api.browser.bean.BrowserBean;
|
|
|
|
import com.api.browser.bean.SearchConditionGroup;
|
|
|
|
import com.api.browser.bean.SearchConditionGroup;
|
|
|
|
import com.api.browser.bean.SearchConditionItem;
|
|
|
|
import com.api.browser.bean.SearchConditionItem;
|
|
|
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
|
|
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
|
|
@ -12,7 +13,10 @@ 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.po.ExtendTitlePO;
|
|
|
|
import com.engine.organization.entity.extend.po.ExtendTitlePO;
|
|
|
|
|
|
|
|
import com.engine.organization.entity.hrmresource.bo.HrmRelationBO;
|
|
|
|
|
|
|
|
import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam;
|
|
|
|
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
|
|
|
|
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
|
|
|
|
|
|
|
|
import com.engine.organization.entity.hrmresource.po.HrmRelationPO;
|
|
|
|
import com.engine.organization.entity.hrmresource.vo.ScHrmResourceVO;
|
|
|
|
import com.engine.organization.entity.hrmresource.vo.ScHrmResourceVO;
|
|
|
|
import com.engine.organization.entity.job.bo.JobBO;
|
|
|
|
import com.engine.organization.entity.job.bo.JobBO;
|
|
|
|
import com.engine.organization.entity.job.po.JobPO;
|
|
|
|
import com.engine.organization.entity.job.po.JobPO;
|
|
|
@ -21,7 +25,14 @@ import com.engine.organization.entity.searchtree.SearchTreeParams;
|
|
|
|
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.ExtendTitleMapper;
|
|
|
|
import com.engine.organization.mapper.extend.ExtendTitleMapper;
|
|
|
|
|
|
|
|
import com.engine.organization.mapper.hrmresource.HrmRelationMapper;
|
|
|
|
import com.engine.organization.mapper.job.JobMapper;
|
|
|
|
import com.engine.organization.mapper.job.JobMapper;
|
|
|
|
|
|
|
|
import com.engine.organization.mapper.post.PostInfoMapper;
|
|
|
|
|
|
|
|
import com.engine.organization.mapper.post.PostMapper;
|
|
|
|
|
|
|
|
import com.engine.organization.mapper.scheme.GradeMapper;
|
|
|
|
|
|
|
|
import com.engine.organization.mapper.scheme.LevelMapper;
|
|
|
|
|
|
|
|
import com.engine.organization.mapper.scheme.SchemeMapper;
|
|
|
|
|
|
|
|
import com.engine.organization.mapper.sequence.SequenceMapper;
|
|
|
|
import com.engine.organization.service.ExtService;
|
|
|
|
import com.engine.organization.service.ExtService;
|
|
|
|
import com.engine.organization.service.HrmResourceService;
|
|
|
|
import com.engine.organization.service.HrmResourceService;
|
|
|
|
import com.engine.organization.util.MenuBtn;
|
|
|
|
import com.engine.organization.util.MenuBtn;
|
|
|
@ -39,6 +50,7 @@ import weaver.hrm.User;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @author:dxfeng
|
|
|
|
* @author:dxfeng
|
|
|
@ -82,6 +94,34 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private static final String JCL_ORG_HRMEXT_DT1 = "JCL_ORG_HRMRESOURCEEXT_DT1";
|
|
|
|
private static final String JCL_ORG_HRMEXT_DT1 = "JCL_ORG_HRMRESOURCEEXT_DT1";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private SchemeMapper getSchemeMapper() {
|
|
|
|
|
|
|
|
return MapperProxyFactory.getProxy(SchemeMapper.class);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private LevelMapper getLevelMapper() {
|
|
|
|
|
|
|
|
return MapperProxyFactory.getProxy(LevelMapper.class);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private GradeMapper getGradeMapper() {
|
|
|
|
|
|
|
|
return MapperProxyFactory.getProxy(GradeMapper.class);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private SequenceMapper getSequenceMapper() {
|
|
|
|
|
|
|
|
return MapperProxyFactory.getProxy(SequenceMapper.class);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private PostMapper getPostMapper() {
|
|
|
|
|
|
|
|
return MapperProxyFactory.getProxy(PostMapper.class);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private PostInfoMapper getPostInfoMapper() {
|
|
|
|
|
|
|
|
return MapperProxyFactory.getProxy(PostInfoMapper.class);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private HrmRelationMapper getHrmRelationMapper() {
|
|
|
|
|
|
|
|
return MapperProxyFactory.getProxy(HrmRelationMapper.class);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private DepartmentMapper getDepartmentMapper() {
|
|
|
|
private DepartmentMapper getDepartmentMapper() {
|
|
|
|
return MapperProxyFactory.getProxy(DepartmentMapper.class);
|
|
|
|
return MapperProxyFactory.getProxy(DepartmentMapper.class);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -102,6 +142,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
return ServiceUtil.getService(ExtServiceImpl.class, user);
|
|
|
|
return ServiceUtil.getService(ExtServiceImpl.class, user);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Map<String, Object> getSearchTree(SearchTreeParams params) {
|
|
|
|
public Map<String, Object> getSearchTree(SearchTreeParams params) {
|
|
|
|
String keyword = params.getKeyword();
|
|
|
|
String keyword = params.getKeyword();
|
|
|
@ -243,6 +284,116 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
return btnDatas;
|
|
|
|
return btnDatas;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public Map<String, Object> getTabForm(Map<String, Object> params) {
|
|
|
|
|
|
|
|
String viewAttrStr = (String) params.get("viewAttr");
|
|
|
|
|
|
|
|
OrganizationAssert.notBlank(viewAttrStr, "未指定操作类型,请确认");
|
|
|
|
|
|
|
|
String id = Util.null2String(params.get("id"));
|
|
|
|
|
|
|
|
OrganizationAssert.notBlank(id, "数据有误,请确认");
|
|
|
|
|
|
|
|
int viewAttr = Integer.parseInt(viewAttrStr);
|
|
|
|
|
|
|
|
Map<String, Object> apiDatas = new HashMap<>();
|
|
|
|
|
|
|
|
List<SearchConditionItem> selectItems = new ArrayList<>();
|
|
|
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
|
|
|
SearchConditionItem schemeId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "等级方案", "161", "schemeId", "schemeBrowser");
|
|
|
|
|
|
|
|
schemeId.setRules("required");
|
|
|
|
|
|
|
|
SearchConditionItem gradeId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "职级", "161", "gradeId", "gradeBrowser");
|
|
|
|
|
|
|
|
gradeId.setRules("required");
|
|
|
|
|
|
|
|
SearchConditionItem levelId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "职等", "162", "levelId", "levelBrowser");
|
|
|
|
|
|
|
|
levelId.setRules("required");
|
|
|
|
|
|
|
|
SearchConditionItem sequenceId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "岗位序列", "161", "sequenceId", "sequenceBrowser");
|
|
|
|
|
|
|
|
sequenceId.setRules("required");
|
|
|
|
|
|
|
|
SearchConditionItem postId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "职务分类", "161", "postId", "postBrowser");
|
|
|
|
|
|
|
|
postId.setRules("required");
|
|
|
|
|
|
|
|
SearchConditionItem postInfoId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "职务信息", "161", "postInfoId", "postInfoBrowser");
|
|
|
|
|
|
|
|
postInfoId.setRules("required");
|
|
|
|
|
|
|
|
SearchConditionItem companyId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "分部", "161", "companyId", "compBrowser");
|
|
|
|
|
|
|
|
companyId.setRules("required");
|
|
|
|
|
|
|
|
SearchConditionItem departmentId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "部门", "161", "departmentId", "deptBrowser");
|
|
|
|
|
|
|
|
departmentId.setRules("required");
|
|
|
|
|
|
|
|
SearchConditionItem jobId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "岗位", "161", "jobId", "jobBrowser");
|
|
|
|
|
|
|
|
jobId.setRules("required");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 编辑状态下赋值操作
|
|
|
|
|
|
|
|
HrmRelationPO relationPO = getHrmRelationMapper().getRelationById(Long.parseLong(id));
|
|
|
|
|
|
|
|
if (null != relationPO) {
|
|
|
|
|
|
|
|
setBrowserValue(schemeId, relationPO.getSchemeId(), getSchemeMapper().listSchemesByIds(Stream.of(relationPO.getSchemeId()).collect(Collectors.toList())), null, null);
|
|
|
|
|
|
|
|
setBrowserValue(gradeId, relationPO.getGradeId(), getGradeMapper().listGradessByIds(Stream.of(relationPO.getGradeId()).collect(Collectors.toList())), "scheme_id", relationPO.getSchemeId());
|
|
|
|
|
|
|
|
setBrowserValue(levelId, relationPO.getLevelId(), getLevelMapper().listLevelsByIds(DeleteParam.builder().ids(relationPO.getLevelId()).build().getIds()), "grade_id", relationPO.getGradeId());
|
|
|
|
|
|
|
|
setBrowserValue(sequenceId, relationPO.getSequenceId(), getSequenceMapper().listSequencesByIds(Stream.of(relationPO.getSequenceId()).collect(Collectors.toList())), "scheme_id", relationPO.getSchemeId());
|
|
|
|
|
|
|
|
setBrowserValue(postId, relationPO.getPostId(), getPostMapper().listPostsByIds(Stream.of(relationPO.getPostId()).collect(Collectors.toList())), null, null);
|
|
|
|
|
|
|
|
setBrowserValue(postInfoId, relationPO.getPostInfoId(), getPostInfoMapper().listPostInfosByIds(Stream.of(relationPO.getPostInfoId()).collect(Collectors.toList())), "post_id", relationPO.getPostId());
|
|
|
|
|
|
|
|
setBrowserValue(companyId, relationPO.getCompanyId(), getCompMapper().listCompsByIds(Stream.of(relationPO.getCompanyId()).collect(Collectors.toList())), null, null);
|
|
|
|
|
|
|
|
setBrowserValue(departmentId, relationPO.getDepartmentId(), getDepartmentMapper().listDeptsByIds(Stream.of(relationPO.getDepartmentId()).collect(Collectors.toList())), "comp_id", relationPO.getCompanyId());
|
|
|
|
|
|
|
|
setBrowserValue(jobId, relationPO.getJobId(), getJobMapper().listJobsByIds(Stream.of(relationPO.getJobId()).collect(Collectors.toList())), "dept_id", relationPO.getDepartmentId());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
selectItems.add(schemeId);
|
|
|
|
|
|
|
|
selectItems.add(gradeId);
|
|
|
|
|
|
|
|
selectItems.add(levelId);
|
|
|
|
|
|
|
|
selectItems.add(sequenceId);
|
|
|
|
|
|
|
|
selectItems.add(postId);
|
|
|
|
|
|
|
|
selectItems.add(postInfoId);
|
|
|
|
|
|
|
|
selectItems.add(companyId);
|
|
|
|
|
|
|
|
selectItems.add(departmentId);
|
|
|
|
|
|
|
|
selectItems.add(jobId);
|
|
|
|
|
|
|
|
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
|
|
|
|
|
|
|
|
HashMap<String, Object> buttonsMap = new HashMap<>();
|
|
|
|
|
|
|
|
buttonsMap.put("hasEdit", true);
|
|
|
|
|
|
|
|
buttonsMap.put("hasSave", true);
|
|
|
|
|
|
|
|
apiDatas.put("buttons", buttonsMap);
|
|
|
|
|
|
|
|
apiDatas.put("conditions", addGroups);
|
|
|
|
|
|
|
|
return apiDatas;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public long saveTabForm(HrmRelationSaveParam params) {
|
|
|
|
|
|
|
|
HrmRelationPO hrmRelationPO = HrmRelationBO.convertSaveParamToPO(params);
|
|
|
|
|
|
|
|
hrmRelationPO.setCreator((long) user.getUID());
|
|
|
|
|
|
|
|
hrmRelationPO.setCreateTime(new Date());
|
|
|
|
|
|
|
|
hrmRelationPO.setDeleteType(0);
|
|
|
|
|
|
|
|
getHrmRelationMapper().insertIgnoreNull(hrmRelationPO);
|
|
|
|
|
|
|
|
return hrmRelationPO.getId();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public long updateTabForm(HrmRelationSaveParam params) {
|
|
|
|
|
|
|
|
HrmRelationPO hrmRelationPO = HrmRelationBO.convertSaveParamToPO(params);
|
|
|
|
|
|
|
|
hrmRelationPO.setUpdateTime(new Date());
|
|
|
|
|
|
|
|
getHrmRelationMapper().updateHrmRelation(hrmRelationPO);
|
|
|
|
|
|
|
|
return hrmRelationPO.getId();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 浏览按钮赋值
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param browserItem
|
|
|
|
|
|
|
|
* @param browserValue
|
|
|
|
|
|
|
|
* @param maps
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private void setBrowserValue(SearchConditionItem browserItem, Object browserValue, List<Map<String, Object>> maps, String relateField, Object relatedValue) {
|
|
|
|
|
|
|
|
browserItem.setValue(browserValue);
|
|
|
|
|
|
|
|
BrowserBean browserBean = browserItem.getBrowserConditionParam();
|
|
|
|
|
|
|
|
browserBean.setReplaceDatas(maps);
|
|
|
|
|
|
|
|
browserItem.setBrowserConditionParam(browserBean);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(relateField) && 1 != browserItem.getViewAttr()) {
|
|
|
|
|
|
|
|
long l = System.currentTimeMillis();
|
|
|
|
|
|
|
|
Map<String, Object> completeParams = browserBean.getCompleteParams();
|
|
|
|
|
|
|
|
completeParams.put("currenttime", l);
|
|
|
|
|
|
|
|
completeParams.put(relateField + "_" + l, relatedValue);
|
|
|
|
|
|
|
|
Map<String, Object> conditionDataParams = browserBean.getConditionDataParams();
|
|
|
|
|
|
|
|
conditionDataParams.put("currenttime", l);
|
|
|
|
|
|
|
|
conditionDataParams.put(relateField + "_" + l, relatedValue);
|
|
|
|
|
|
|
|
Map<String, Object> dataParams = browserBean.getDataParams();
|
|
|
|
|
|
|
|
dataParams.put("currenttime", l);
|
|
|
|
|
|
|
|
dataParams.put(relateField + "_" + l, relatedValue);
|
|
|
|
|
|
|
|
Map<String, Object> destDataParams = browserBean.getDestDataParams();
|
|
|
|
|
|
|
|
destDataParams.put("currenttime", l);
|
|
|
|
|
|
|
|
destDataParams.put(relateField + "_" + l, relatedValue);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询条件
|
|
|
|
* 查询条件
|
|
|
|
*
|
|
|
|
*
|
|
|
|