部门管理功能逻辑调整

pull/79/head
dxfeng 2 years ago
parent bd33075e14
commit fb17f43323

@ -35,12 +35,13 @@ 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.service.ImportCommonService;
import com.engine.organization.thread.*;
import com.engine.organization.thread.HrmResourceTriggerRunnable;
import com.engine.organization.thread.JobTriggerRunnable;
import com.engine.organization.thread.OrganizationSyncEc;
import com.engine.organization.util.HasRightUtil;
import com.engine.organization.util.OrganizationAssert;
import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.organization.util.excel.ExcelUtil;
import com.engine.organization.util.relation.EcHrmRelationUtil;
import com.engine.organization.util.saveimport.OrgImportUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -725,9 +726,8 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
}
}
map.put("parent_company", parentCompanyId);
if (null != parentCompanyId) {
map.put("ec_company", EcHrmRelationUtil.getEcCompanyId(parentCompanyId.toString()));
}
map.put("ec_company", parentCompanyId);
companyName = split[split.length - 1];
map.put("comp_name", companyName);
}
@ -962,11 +962,10 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
}
}
map.put("parent_comp", parentCompanyId);
map.put("ec_company", EcHrmRelationUtil.getEcCompanyId(parentCompanyId.toString()));
map.put("ec_company", parentCompanyId);
map.put("parent_dept", parentDepartmentId);
if (null != parentDepartmentId) {
map.put("ec_department", EcHrmRelationUtil.getEcDepartmentId(parentDepartmentId.toString()));
}
map.put("ec_department", parentDepartmentId);
departmentName = split[split.length - 1];
map.put("dept_name", departmentName);
}
@ -1223,10 +1222,8 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
}
map.put("parent_comp", parentCompanyId);
map.put("parent_dept", parentDepartmentId);
map.put("ec_company", EcHrmRelationUtil.getEcCompanyId(Util.null2String(parentCompanyId)));
if (null != parentDepartmentId) {
map.put("ec_department", EcHrmRelationUtil.getEcDepartmentId(Util.null2String(parentDepartmentId)));
}
map.put("ec_company", parentCompanyId);
map.put("ec_department", parentDepartmentId);
map.put("parent_job", parentJobId);
jobName = split[split.length - 1];
map.put("job_name", jobName);
@ -1486,10 +1483,9 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
}
map.put("company_id", parentCompanyId);
map.put("department_id", parentDepartmentId);
map.put("ec_company", EcHrmRelationUtil.getEcCompanyId(Util.null2String(parentCompanyId)));
if (null != parentDepartmentId) {
map.put("ec_department", EcHrmRelationUtil.getEcDepartmentId(Util.null2String(parentDepartmentId)));
}
map.put("ec_company", parentCompanyId);
map.put("ec_department", parentDepartmentId);
map.put("job_title", parentJobId);
}
}

@ -54,7 +54,6 @@ import com.engine.organization.util.detach.DetachUtil;
import com.engine.organization.util.page.Column;
import com.engine.organization.util.page.PageInfo;
import com.engine.organization.util.page.PageUtil;
import com.engine.organization.util.relation.EcHrmRelationUtil;
import com.engine.organization.util.tree.SearchTreeUtil;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
@ -278,7 +277,7 @@ public class JobServiceImpl extends Service implements JobService {
CompPO compPO = getCompMapper().listById(param.getSubcompanyid1());
if (null != compPO) {
params.put("parent_comp", compPO.getId());
params.put("ec_company", EcHrmRelationUtil.getEcCompanyId(compPO.getId().toString()));
params.put("ec_company", compPO.getId());
}
}
// 部门

@ -14,7 +14,6 @@ import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.organization.util.relation.EcHrmRelationUtil;
import com.engine.organization.util.relation.ResourceSyncUtil;
import org.apache.commons.collections.CollectionUtils;
import weaver.conn.RecordSet;
import weaver.general.Util;
import weaver.hrm.User;
@ -381,11 +380,7 @@ public class OrganizationSyncEc {
*
*/
private void updateCompany() {
Map<String, Object> map = new HashMap<>();
// 获取ec表ID
buildEcCompanyData(map);
map.putAll(params);
this.resultMap = ServiceUtil.getService(OrganizationServiceImpl.class, user).editSubCompany(map, user);
this.resultMap = ServiceUtil.getService(OrganizationServiceImpl.class, user).editSubCompany(params, user);
}
/**
@ -403,59 +398,4 @@ public class OrganizationSyncEc {
}
}
/**
*
*
* @param map
*/
private void buildEcCompanyData(Map<String, Object> map) {
String ecCompanyId = Util.null2String(params.get("id"));
map.put("id", ecCompanyId);
RecordSet rs = new RecordSet();
// 先查拓展表
rs.execute("select * from hrmsubcompanydefined where subcomid = '" + ecCompanyId + "'");
int colcount = rs.getColCounts();
if (rs.next()) {
for (int i = 1; i <= colcount; i++) {
map.put(rs.getColumnName(i).toLowerCase(), Util.null2String(rs.getString(i)));
}
}
// 再查主表
rs.execute("select * from hrmsubcompany where id = '" + ecCompanyId + "'");
colcount = rs.getColCounts();
if (rs.next()) {
for (int i = 1; i <= colcount; i++) {
map.put(rs.getColumnName(i).toLowerCase(), Util.null2String(rs.getString(i)));
}
}
}
/**
*
*
* @param map
*/
private void buildEcDepartmentData(Map<String, Object> map) {
String ecDepartment = EcHrmRelationUtil.getEcDepartmentId(Util.null2String(params.get("id")));
map.put("id", ecDepartment);
RecordSet rs = new RecordSet();
// 先查拓展表
rs.execute("select * from hrmdepartmentdefined where deptid = '" + ecDepartment + "'");
int colcount = rs.getColCounts();
if (rs.next()) {
for (int i = 1; i <= colcount; i++) {
map.put(rs.getColumnName(i).toLowerCase(), Util.null2String(rs.getString(i)));
}
}
// 再查主表
rs.execute("select id,departmentmark,departmentname,subcompanyid1,supdepid,allsupdepid,canceled,departmentcode,coadjutant,outkey,budgetatuomoveorder,ecology_pinyin_search,tlevel,created,creater,modified,modifier,uuid,showorder,showorderoftree,tenant_key from hrmdepartment where id = '" + ecDepartment + "'");
colcount = rs.getColCounts();
if (rs.next()) {
for (int i = 1; i <= colcount; i++) {
map.put(rs.getColumnName(i).toLowerCase(), Util.null2String(rs.getString(i)));
}
}
}
}

@ -1,8 +1,6 @@
package com.engine.organization.util.relation;
import com.engine.organization.entity.commom.RecordInfo;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.department.po.DepartmentPO;
import com.engine.organization.entity.job.po.JobPO;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
@ -40,35 +38,6 @@ public class EcHrmRelationUtil {
return MapperProxyFactory.getProxy(JobMapper.class);
}
/**
* jcl_org_comp.idHrmSubCompany.id
*
* @param companyId
* @return
*/
public static String getEcCompanyId(String companyId) {
CompPO compPO = getCompMapper().listById(Integer.parseInt(companyId));
RecordInfo supSubCompany = getSystemDataMapper().getHrmObjectByUUID(HRM_COMPANY, compPO.getUuid());
if (null == supSubCompany) {
return "0";
}
return supSubCompany.getId();
}
/**
* jcl_org_dept.idHrmDepartment.id
*
* @param departmentId
* @return
*/
public static String getEcDepartmentId(String departmentId) {
DepartmentPO departmentPO = getDepartmentMapper().getDeptById(Integer.parseInt(departmentId));
RecordInfo supDepartment = getSystemDataMapper().getHrmObjectByUUID(HRM_DEPARTMENT, departmentPO.getUuid());
return supDepartment.getId();
}
public static String getEcJobId(Long jclJobId) {
JobPO jobById = getJobMapper().getJobById(jclJobId);
if (null == jobById) {

@ -17,7 +17,6 @@ import com.engine.organization.mapper.staff.StaffMapper;
import com.engine.organization.mapper.staff.StaffPlanMapper;
import com.engine.organization.util.OrganizationAssert;
import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.organization.util.relation.EcHrmRelationUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.xssf.usermodel.XSSFCell;
@ -161,7 +160,7 @@ public class StaffInfoImportUtil {
}
}
map.put("comp_id", parentCompanyId);
map.put("ec_company", EcHrmRelationUtil.getEcCompanyId(Util.null2String(parentCompanyId)));
map.put("ec_company", parentCompanyId);
}
// 部门
if ("dept_id".equals(infoPO.getFieldName())) {
@ -185,9 +184,7 @@ public class StaffInfoImportUtil {
}
map.put("dept_id", parentDepartmentId);
if (null != parentDepartmentId) {
map.put("ec_department", EcHrmRelationUtil.getEcDepartmentId(Util.null2String(parentDepartmentId)));
}
map.put("ec_department", parentDepartmentId);
}
// 岗位

@ -1,7 +1,6 @@
package com.engine.organization.wrapper;
import com.engine.organization.util.OrganizationWrapper;
import com.engine.organization.util.relation.EcHrmRelationUtil;
import org.apache.commons.lang3.StringUtils;
/**
@ -16,15 +15,16 @@ public class JclOrgWrapper extends OrganizationWrapper {
if (StringUtils.isAnyBlank(jclId, type)) {
return null;
}
switch (type) {
case "1":
return EcHrmRelationUtil.getEcCompanyId(jclId);
case "2":
return EcHrmRelationUtil.getEcDepartmentId(jclId);
case "3":
default:
return "";
}
//switch (type) {
// case "1":
// return EcHrmRelationUtil.getEcCompanyId(jclId);
// case "2":
// return EcHrmRelationUtil.getEcDepartmentId(jclId);
// case "3":
// default:
// return "";
//}
return jclId;
}
public String getJclOrgId(String ecId, String type) {

Loading…
Cancel
Save