|
|
|
@ -9,6 +9,7 @@ import com.engine.core.impl.Service;
|
|
|
|
|
import com.engine.hrm.util.face.HrmFaceCheckManager;
|
|
|
|
|
import com.engine.organization.component.OrganizationWeaTable;
|
|
|
|
|
import com.engine.organization.entity.DeleteParam;
|
|
|
|
|
import com.engine.organization.entity.commom.RecordInfo;
|
|
|
|
|
import com.engine.organization.entity.company.bo.CompBO;
|
|
|
|
|
import com.engine.organization.entity.company.po.CompPO;
|
|
|
|
|
import com.engine.organization.entity.department.bo.DepartmentBO;
|
|
|
|
@ -102,6 +103,9 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
*/
|
|
|
|
|
private static final String JCL_ORG_HRMEXT_DT1 = "JCL_ORG_HRMRESOURCEEXT_DT1";
|
|
|
|
|
|
|
|
|
|
private static final String HRM_RESOURCE = "hrmresource";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String RIGHT_NAME = "Roster:All";
|
|
|
|
|
|
|
|
|
|
private SchemeMapper getSchemeMapper() {
|
|
|
|
@ -152,6 +156,10 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
return MapperProxyFactory.getProxy(ExtendTitleMapper.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private SystemDataMapper getSystemDataMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(SystemDataMapper.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ExtService getExtService(User user) {
|
|
|
|
|
return ServiceUtil.getService(ExtServiceImpl.class, user);
|
|
|
|
|
}
|
|
|
|
@ -184,7 +192,10 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID, "1");
|
|
|
|
|
if (CollectionUtils.isNotEmpty(extendTitles)) {
|
|
|
|
|
for (ExtendTitlePO extendTitle : extendTitles) {
|
|
|
|
|
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_HRM, 2, extendTitle.getId() + "", null, null, null)));
|
|
|
|
|
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);
|
|
|
|
@ -194,28 +205,17 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
@Override
|
|
|
|
|
public Long saveBaseForm(Map<String, Object> params) {
|
|
|
|
|
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
|
// 通过岗位,获取分部、部门、等其他信息
|
|
|
|
|
String jobId = Util.null2String(params.get("job_title"));
|
|
|
|
|
if (StringUtils.isNotBlank(jobId)) {
|
|
|
|
|
JobPO jobById = getJobMapper().getJobById(Long.parseLong(jobId));
|
|
|
|
|
params.put("department_id", jobById.getParentDept());
|
|
|
|
|
params.put("company_id", jobById.getParentComp());
|
|
|
|
|
params.put("ec_department", jobById.getEcDepartment());
|
|
|
|
|
params.put("ec_company", jobById.getEcCompany());
|
|
|
|
|
// 等级方案、岗位序列、职等职级
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
String showOrder = Util.null2String(params.get("show_order"));
|
|
|
|
|
// 初始化排序字段
|
|
|
|
|
if (StringUtils.isBlank(showOrder)) {
|
|
|
|
|
Long maxId = getHrmResourceMapper().getMaxId();
|
|
|
|
|
params.put("show_order", null == maxId ? 1 : maxId + 1);
|
|
|
|
|
}
|
|
|
|
|
// 完善新增参数
|
|
|
|
|
completeParams(params);
|
|
|
|
|
|
|
|
|
|
// 新增EC人员,新增成功后,新增到聚才林人员表
|
|
|
|
|
Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.RESOURCE, OperateTypeEnum.ADD, params).sync();
|
|
|
|
|
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());
|
|
|
|
|
return getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRM, params, "", null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -239,7 +239,10 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(extendTitles)) {
|
|
|
|
|
for (ExtendTitlePO extendTitle : extendTitles) {
|
|
|
|
|
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_HRM : JCL_ORG_HRMEXT, viewAttr, id, extendTitle.getId() + "", "")));
|
|
|
|
|
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));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -266,16 +269,9 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
groupId = GROUP_ID.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String jobId = Util.null2String(params.get("job_title"));
|
|
|
|
|
if (StringUtils.isNotBlank(jobId)) {
|
|
|
|
|
JobPO jobById = getJobMapper().getJobById(Long.parseLong(jobId));
|
|
|
|
|
params.put("department_id", jobById.getParentDept());
|
|
|
|
|
params.put("company_id", jobById.getParentComp());
|
|
|
|
|
params.put("ec_department", jobById.getEcDepartment());
|
|
|
|
|
params.put("ec_company", jobById.getEcCompany());
|
|
|
|
|
// 等级方案、岗位序列、职等职级
|
|
|
|
|
// 完善更新参数
|
|
|
|
|
completeParams(params);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// 更新EC人员,更新成功后,更新聚才林人员表
|
|
|
|
|
Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.RESOURCE, OperateTypeEnum.UPDATE, params).sync();
|
|
|
|
|
String ecResourceId = Util.null2String(syncMap.get("id"));
|
|
|
|
@ -285,7 +281,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
// 更新主表数据
|
|
|
|
|
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRM, params, "", id);
|
|
|
|
|
// 更新主表拓展表
|
|
|
|
|
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRMEXT, params, groupId, id);
|
|
|
|
|
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRMEXT, params, groupId, id);
|
|
|
|
|
//更新明细表
|
|
|
|
|
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_HRMEXT_DT1, params, id);
|
|
|
|
|
|
|
|
|
@ -329,6 +325,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
btnDatas.put("topMenu", topMenuList);
|
|
|
|
|
rightMenuList.add(MenuBtn.builder().isBatch("1").isTop("1").menuFun("new").menuIcon("icon-coms-New-Flow").menuName("新建人员").type("BTN_Addnew").build());
|
|
|
|
|
rightMenuList.add(MenuBtn.builder().isBatch("0").isTop("0").menuFun("custom").menuIcon("icon-coms-task-list").menuName("显示列定制").type("BTN_COLUMN").build());
|
|
|
|
|
rightMenuList.add(MenuBtn.rightMenu_btnLog());
|
|
|
|
|
btnDatas.put("rightMenu", rightMenuList);
|
|
|
|
|
return btnDatas;
|
|
|
|
|
}
|
|
|
|
@ -675,4 +672,29 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
buildParentComps(parentComp, builderComps);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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.getParentDept());
|
|
|
|
|
params.put("company_id", jobById.getParentComp());
|
|
|
|
|
params.put("ec_department", jobById.getEcDepartment());
|
|
|
|
|
params.put("ec_company", jobById.getEcCompany());
|
|
|
|
|
// 职级
|
|
|
|
|
params.put("job_level", jobById.getGradeId());
|
|
|
|
|
String showOrder = Util.null2String(params.get("show_order"));
|
|
|
|
|
// 初始化排序字段
|
|
|
|
|
if (StringUtils.isBlank(showOrder)) {
|
|
|
|
|
Long orderNum = getHrmResourceMapper().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");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|