|
|
|
@ -17,16 +17,23 @@ import com.engine.organization.entity.company.po.CompPO;
|
|
|
|
|
import com.engine.organization.entity.department.bo.DepartmentBO;
|
|
|
|
|
import com.engine.organization.entity.department.dto.DepartmentListDTO;
|
|
|
|
|
import com.engine.organization.entity.department.po.DepartmentPO;
|
|
|
|
|
import com.engine.organization.entity.extend.bo.ExtendInfoBO;
|
|
|
|
|
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
|
|
|
|
import com.engine.organization.entity.job.bo.JobBO;
|
|
|
|
|
import com.engine.organization.entity.job.dto.JobListDTO;
|
|
|
|
|
import com.engine.organization.entity.job.param.JobSearchParam;
|
|
|
|
|
import com.engine.organization.entity.job.po.JobDTPO;
|
|
|
|
|
import com.engine.organization.entity.job.po.JobPO;
|
|
|
|
|
import com.engine.organization.entity.scheme.po.GradePO;
|
|
|
|
|
import com.engine.organization.entity.searchtree.SearchTree;
|
|
|
|
|
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
|
|
|
|
import com.engine.organization.mapper.comp.CompMapper;
|
|
|
|
|
import com.engine.organization.mapper.department.DepartmentMapper;
|
|
|
|
|
import com.engine.organization.mapper.extend.ExtendGroupMapper;
|
|
|
|
|
import com.engine.organization.mapper.job.JobDTMapper;
|
|
|
|
|
import com.engine.organization.mapper.job.JobMapper;
|
|
|
|
|
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;
|
|
|
|
@ -86,6 +93,10 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
|
return MapperProxyFactory.getProxy(JobMapper.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private JobDTMapper getJobDTMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(JobDTMapper.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CompMapper getCompMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(CompMapper.class);
|
|
|
|
|
}
|
|
|
|
@ -143,7 +154,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> listPage(JobSearchParam param) {
|
|
|
|
|
Map<String, Object> datas = new HashMap<>();
|
|
|
|
|
JobPO jobPO = JobBO.convertParamsToPO(param, (long) user.getUID());
|
|
|
|
|
JobPO jobPO = JobBO.convertParamsToPO(param, user.getUID());
|
|
|
|
|
boolean filter = isFilter(jobPO);
|
|
|
|
|
PageInfo<JobListDTO> pageInfos;
|
|
|
|
|
List<JobListDTO> allList = getJobMapper().listNoFilter();
|
|
|
|
@ -336,7 +347,27 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
|
// 拓展页面分组
|
|
|
|
|
resultMap.put("tabInfo", getExtService(user).getTabInfo(EXTEND_TYPE, JCL_ORG_JOBEXT));
|
|
|
|
|
// 处理明细表
|
|
|
|
|
resultMap.put("tables", getExtService(user).getExtendTables(user, EXTEND_TYPE, JCL_ORG_JOBEXT_DT1, id, viewAttr, false));
|
|
|
|
|
List<Map<String, Object>> extendTables = getExtService(user).getExtendTables(user, EXTEND_TYPE, JCL_ORG_JOBEXT_DT1, id, viewAttr, false);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> tableMap = new HashMap<>();
|
|
|
|
|
tableMap.put("hide", false);
|
|
|
|
|
tableMap.put("tabname", "职等职级");
|
|
|
|
|
Map<String, Object> tabinfoMap = new HashMap<>();
|
|
|
|
|
List<ExtendInfoPO> infoPOList = new ArrayList<>();
|
|
|
|
|
infoPOList.add(ExtendInfoPO.builder().fieldName("gradeId").fieldNameDesc("职级").controlType(3).isrequired(1).browserType("161").customBrowserId("gradeBrowser").build());
|
|
|
|
|
infoPOList.add(ExtendInfoPO.builder().fieldName("levelId").fieldNameDesc("职等").controlType(3).isrequired(1).browserType("162").customBrowserId("levelBrowser").build());
|
|
|
|
|
tabinfoMap.put("columns", ExtendInfoBO.convertInfoListToTable(user, infoPOList, viewAttr, false));
|
|
|
|
|
tabinfoMap.put("rownum", "rownum");
|
|
|
|
|
// 去除null 元素
|
|
|
|
|
List<JobDTPO> maps = getJobDTMapper().listJobDTByMainID(id);
|
|
|
|
|
maps.removeIf(Objects::isNull);
|
|
|
|
|
tabinfoMap.put("datas", maps);
|
|
|
|
|
tableMap.put("tabinfo", tabinfoMap);
|
|
|
|
|
// 添加明细表
|
|
|
|
|
extendTables.add(0, tableMap);
|
|
|
|
|
|
|
|
|
|
resultMap.put("tables", extendTables);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> apiDatas = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
apiDatas.put("result", resultMap);
|
|
|
|
@ -350,8 +381,18 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
|
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
|
|
|
|
JobPO jobPO = JobBO.convertParamsToPO(params, user.getUID());
|
|
|
|
|
jobPO.setIsKey(null == jobPO.getIsKey() ? 0 : jobPO.getIsKey());
|
|
|
|
|
// 设置对应的等级方案
|
|
|
|
|
return getJobMapper().insertIgnoreNull(jobPO);
|
|
|
|
|
int insertCount = getJobMapper().insertIgnoreNull(jobPO);
|
|
|
|
|
if (null != jobPO.getSchemeId()) {
|
|
|
|
|
// 插入明细表信息
|
|
|
|
|
// 根据等级方案查询职等、职级
|
|
|
|
|
List<GradePO> gradePOS = MapperProxyFactory.getProxy(GradeMapper.class).listGradesBySchemeId(jobPO.getSchemeId());
|
|
|
|
|
for (GradePO gradePO : gradePOS) {
|
|
|
|
|
List<Map<String, Object>> maps = MapperProxyFactory.getProxy(LevelMapper.class).listLevelsByIds(QueryParam.builder().ids(gradePO.getLevelId()).build().getIds());
|
|
|
|
|
String levelNames = maps.stream().map(item -> (String) item.get("name")).collect(Collectors.joining(","));
|
|
|
|
|
insertCount += getJobDTMapper().insertIgnoreNull(JobDTPO.builder().levelId(gradePO.getLevelId()).gradeId(gradePO.getId() + "").levelIdspan(levelNames).gradeIdspan(gradePO.getGradeName()).mainId(jobPO.getId()).creator((long) user.getUID()).deleteType(0).createTime(new Date()).updateTime(new Date()).build());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return insertCount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -365,11 +406,29 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
|
updateCount += getJobMapper().updateBaseJob(jobPO);
|
|
|
|
|
// 更新主表拓展表
|
|
|
|
|
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOBEXT, params, groupId, jobPO.getId());
|
|
|
|
|
//更新明细表
|
|
|
|
|
// 更新明细表
|
|
|
|
|
getJobDTMapper().deleteByIds(jobPO.getId());
|
|
|
|
|
int rowNum = Util.getIntValue((String) params.get("rownum"));
|
|
|
|
|
for (int i = 0; i < rowNum; i++) {
|
|
|
|
|
String levelId = (String) params.get("levelId_" + i);
|
|
|
|
|
String gradeId = (String) params.get("gradeId_" + i);
|
|
|
|
|
String levelIdspan = (String) params.get("levelIdspan_" + i);
|
|
|
|
|
String gradeIdspan = (String) params.get("gradeIdspan_" + i);
|
|
|
|
|
getJobDTMapper().insertIgnoreNull(JobDTPO.builder().levelId(levelId).gradeId(gradeId).levelIdspan(levelIdspan).gradeIdspan(gradeIdspan).mainId(jobPO.getId()).creator((long) user.getUID()).deleteType(0).createTime(new Date()).updateTime(new Date()).build());
|
|
|
|
|
}
|
|
|
|
|
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_JOBEXT_DT1, params, jobPO.getId());
|
|
|
|
|
return updateCount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int copyJobItem(long id, long departmentId) {
|
|
|
|
|
JobPO jobById = getJobMapper().getJobById(id);
|
|
|
|
|
// TODO 自动编号
|
|
|
|
|
jobById.setJobNo("复制_" + jobById.getJobNo());
|
|
|
|
|
jobById.setParentDept(departmentId);
|
|
|
|
|
return getJobMapper().insertIgnoreNull(jobById);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int updateForbiddenTagById(JobSearchParam params) {
|
|
|
|
|
JobPO jobPO = JobPO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
|
|
|
|
@ -624,7 +683,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
|
// 岗位序列
|
|
|
|
|
SearchConditionItem sequenceBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "岗位序列", "161", "sequenceId", "sequenceBrowser");
|
|
|
|
|
// 等级方案
|
|
|
|
|
SearchConditionItem schemeBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 1, false, "等级方案", "161", "schemeId", "schemeBrowser");
|
|
|
|
|
SearchConditionItem schemeBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "等级方案", "161", "schemeId", "schemeBrowser");
|
|
|
|
|
// 上级岗位
|
|
|
|
|
SearchConditionItem parentJobBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级岗位", "161", "parentJob", "jobBrowser");
|
|
|
|
|
// 是否关键岗
|
|
|
|
|