人员管理BUG修复
This commit is contained in:
parent
396a4570d0
commit
63b6b88a96
|
|
@ -30,8 +30,7 @@ import lombok.NoArgsConstructor;
|
|||
sortway = " asc",
|
||||
primarykey = "id",
|
||||
operates = {
|
||||
@OrganizationTableOperate(index = "0", text = "查看"),
|
||||
@OrganizationTableOperate(index = "1", text = "编辑")
|
||||
@OrganizationTableOperate(text = "查看")
|
||||
},
|
||||
tableType = WeaTableType.CHECKBOX
|
||||
)
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ public interface HrmResourceMapper {
|
|||
*/
|
||||
Long getMaxId();
|
||||
|
||||
Long getMaxShowOrder();
|
||||
|
||||
|
||||
/**
|
||||
* 根据ID查询姓名
|
||||
*
|
||||
|
|
|
|||
|
|
@ -50,6 +50,10 @@
|
|||
inner join hrmresource b on a.uuid = b.uuid
|
||||
where b.id = #{ecResourceId}
|
||||
</select>
|
||||
<select id="getMaxShowOrder" resultType="java.lang.Long">
|
||||
select max(show_order)
|
||||
from jcl_org_hrmresource
|
||||
</select>
|
||||
<!-- <select id="getKeyMapByKetField" resultType="com.alibaba.fastjson.JSONObject">-->
|
||||
<!-- select id, account_type, certificate_num, login_id, work_code, ${keyField}-->
|
||||
<!-- from jcl_org_hrmresource-->
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import com.engine.organization.util.db.MapperProxyFactory;
|
|||
import com.engine.organization.util.field.FieldDefinedValueUtil;
|
||||
import com.engine.portal.biz.constants.ModuleConstants;
|
||||
import com.engine.portal.biz.nonstandardfunction.SysModuleInfoBiz;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.blog.BlogShareManager;
|
||||
import weaver.cowork.CoworkShareManager;
|
||||
import weaver.crm.CrmShareBase;
|
||||
|
|
@ -92,12 +93,12 @@ public class HrmPersonnelCardServiceImpl extends Service implements HrmPersonnel
|
|||
List<Anchor> anchorList = new ArrayList<>();
|
||||
// 添加字段分组信息
|
||||
for (ExtendGroupPO extendGroupPO : extendGroupList) {
|
||||
anchorList.add(Anchor.builder().id("group_" + extendGroupPO.getId()).title(extendGroupPO.getGroupName()).build());
|
||||
anchorList.add(Anchor.builder().id("group" + extendGroupPO.getId()).title(extendGroupPO.getGroupName()).build());
|
||||
}
|
||||
// 添加拓展页面信息
|
||||
List<ResourceBaseTab> resourceBaseTabList = getPersonnelCardMapper().getResourceBaseTabList();
|
||||
for (ResourceBaseTab resourceBaseTab : resourceBaseTabList) {
|
||||
anchorList.add(Anchor.builder().id("tab_" + resourceBaseTab.getId()).title(resourceBaseTab.getGroupName()).build());
|
||||
anchorList.add(Anchor.builder().id("tab" + resourceBaseTab.getId()).title(resourceBaseTab.getGroupName()).build());
|
||||
}
|
||||
|
||||
resultMap.put("user", userInfo);
|
||||
|
|
@ -113,7 +114,7 @@ public class HrmPersonnelCardServiceImpl extends Service implements HrmPersonnel
|
|||
List<Iframe> iframeList = new ArrayList<>();
|
||||
List<ResourceBaseTab> resourceBaseTabList = getPersonnelCardMapper().getResourceBaseTabList();
|
||||
for (ResourceBaseTab resourceBaseTab : resourceBaseTabList) {
|
||||
iframeList.add(Iframe.builder().id("tab_" + resourceBaseTab.getId()).title(resourceBaseTab.getGroupName()).url(resourceBaseTab.getLinkUrl()).build());
|
||||
iframeList.add(Iframe.builder().id("tab" + resourceBaseTab.getId()).title(resourceBaseTab.getGroupName()).url(resourceBaseTab.getLinkUrl()).build());
|
||||
}
|
||||
return iframeList;
|
||||
}
|
||||
|
|
@ -167,13 +168,16 @@ public class HrmPersonnelCardServiceImpl extends Service implements HrmPersonnel
|
|||
|
||||
private FormItem getFormItem(ExtendGroupPO extendGroup, Long uId) {
|
||||
FormItem formItem = new FormItem();
|
||||
formItem.setId("group_" + extendGroup.getId());
|
||||
formItem.setId("group" + extendGroup.getId());
|
||||
formItem.setTitle(extendGroup.getGroupName());
|
||||
List<ExtendTitlePO> extendTitleList = getExtendTitleMapper().getTitlesByGroupID(extendGroup.getId(), IS_SHOW);
|
||||
List<Item> itemList = new ArrayList<>();
|
||||
for (ExtendTitlePO extendTitlePO : extendTitleList) {
|
||||
List<ExtendInfoPO> extendInfoList = getExtendInfoMapper().listFields(extendGroup.getExtendType().toString(), extendTitlePO.getId().toString(), ExtendGroupBO.getTableNameByGroupPO(extendGroup), ExtendInfoOperateType.LIST.getValue(), IS_SHOW);
|
||||
String fields = extendInfoList.stream().map(ExtendInfoPO::getFieldName).collect(Collectors.joining(","));
|
||||
if(StringUtils.isBlank(fields)){
|
||||
continue;
|
||||
}
|
||||
ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName(ExtendGroupBO.getTableNameByGroupPO(extendGroup)).fields(fields).params(null).id(uId).build();
|
||||
Map<String, Object> fieldValueMap = getExtMapper().listExt(infoParams);
|
||||
for (ExtendInfoPO extendInfoPO : extendInfoList) {
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
package com.engine.organization.wrapper;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.annotation.Log;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
|
||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
import com.engine.organization.enums.LogModuleNameEnum;
|
||||
import com.engine.organization.enums.OperateTypeEnum;
|
||||
import com.engine.organization.service.HrmResourceService;
|
||||
import com.engine.organization.service.impl.HrmResourceServiceImpl;
|
||||
import com.engine.organization.util.OrganizationWrapper;
|
||||
|
|
@ -34,8 +38,11 @@ public class HrmResourceWrapper extends OrganizationWrapper {
|
|||
return getHrmResourceService(user).getSaveForm();
|
||||
}
|
||||
|
||||
@Log(operateType = OperateTypeEnum.ADD, operateModule = LogModuleNameEnum.RESOURCE, operateDesc = "新增人员")
|
||||
public Long saveBaseForm(Map<String, Object> params) {
|
||||
Long resourceId = getHrmResourceService(user).saveBaseForm(params);
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), params.get("last_name").toString(), JSON.toJSONString(params), "新增人员");
|
||||
return resourceId;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue