部门管理功能逻辑调整

pull/79/head
dxfeng 2 years ago
parent 1c8c7ab2aa
commit 40a6540a1d

@ -195,18 +195,18 @@ public class JobBrowserService extends BrowserService {
} else if ("1".equals(params.getType())) {
// 当前节点下的元素
CompanyPO compBuild = CompanyPO.builder().supSubComId(Integer.parseInt(params.getId())).canceled(0).build();
List<CompanyPO> compList = MapperProxyFactory.getProxy(CompanyMapper.class).listByFilter(compBuild, "show_order");
List<CompanyPO> compList = MapperProxyFactory.getProxy(CompanyMapper.class).listByFilter(compBuild, "showorder");
if (detachUtil.isDETACH()) {
detachUtil.filterCompanyList(compList);
}
DepartmentPO departmentBuild = DepartmentPO.builder().subCompanyId1(Integer.parseInt(params.getId())).canceled(0).build();
List<DepartmentPO> departmentList = MapperProxyFactory.getProxy(DepartmentMapper.class).listByFilter(departmentBuild, "show_order");
List<DepartmentPO> departmentList = MapperProxyFactory.getProxy(DepartmentMapper.class).listByFilter(departmentBuild, "showorder");
compList.forEach(item -> buildCompNodes(treeNodes, compHasSubs, item));
departmentList.stream().filter(item -> null == item.getSupDepId() || 0 == item.getSupDepId()).forEach(item -> buildDeptNodes(treeNodes, hasSubDepartment, item));
} else if ("2".equals(params.getType())) {
DepartmentPO departmentBuild = DepartmentPO.builder().supDepId(Integer.parseInt(params.getId())).canceled(0).build();
List<DepartmentPO> departmentList = MapperProxyFactory.getProxy(DepartmentMapper.class).listByFilter(departmentBuild, "show_order");
List<DepartmentPO> departmentList = MapperProxyFactory.getProxy(DepartmentMapper.class).listByFilter(departmentBuild, "showorder");
departmentList.forEach(item -> buildDeptNodes(treeNodes, hasSubDepartment, item));
}

@ -132,7 +132,7 @@ public class DepartmentBO {
return departmentPOS.stream().map(item -> {
SearchTree tree = new SearchTree();
tree.setCanClick(true);
tree.setCanceled(item.getCanceled() != 0);
tree.setCanceled(item.getCanceled() != null && item.getCanceled() != 0);
tree.setIcon(isLeaf ? "icon-coms-Branch" : "icon-coms-LargeArea");
tree.setId(item.getId().toString());
tree.setIsParent(false);

@ -34,7 +34,7 @@ public class JobBO {
.ecCompany(param.getEcCompany())
.ecDepartment(param.getEcDepartment())
.parentComp(param.getSubcompanyid1())
.parentDept( param.getDepartmentid())
.parentDept(param.getDepartmentid())
.sequenceId(param.getSequenceId())
.schemeId(param.getSchemeId())
.parentJob(param.getParentJob())
@ -83,8 +83,8 @@ public class JobBO {
.id(e.getId())
.jobNo(e.getJobNo())
.jobName(e.getJobName())
.compName(e.getCompName())
.deptName(e.getDeptName())
.subCompanyName(e.getSubCompanyName())
.departmentName(e.getDepartmentName())
.sequenceName(e.getSequenceName())
.schemeName(e.getSchemeName())
//.parentJob(e.getParentJob())

@ -34,7 +34,7 @@ public class JobListDTO {
/**
*
*/
@TableTitle(title = "名称", dataIndex = "jobName", key = "jobName",width = "150")
@TableTitle(title = "名称", dataIndex = "jobName", key = "jobName", width = "150")
private String jobName;
/**
*
@ -44,13 +44,13 @@ public class JobListDTO {
/**
*
*/
@TableTitle(title = "所属分部", dataIndex = "compName", key = "compName")
private String compName;
@TableTitle(title = "所属分部", dataIndex = "subCompanyName", key = "subCompanyName")
private String subCompanyName;
/**
*
*/
@TableTitle(title = "所属部门", dataIndex = "deptName", key = "deptName")
private String deptName;
@TableTitle(title = "所属部门", dataIndex = "departmentName", key = "departmentName")
private String departmentName;
/**
*
*/

@ -176,7 +176,7 @@ public interface JobMapper {
* @param parentCompany
* @return
*/
int updateJobCompany(@Param("ids") Collection<Long> ids, @Param("parentCompany") Integer parentCompany, @Param("ecCompany") String ecCompany);
int updateJobCompany(@Param("ids") Collection<Long> ids, @Param("parentCompany") Integer parentCompany, @Param("ecCompany") Integer ecCompany);
int isHasResource(@Param("jobId") Long jobId);
}

@ -367,16 +367,16 @@
<select id="listByFilter" resultType="com.engine.organization.entity.job.dto.JobListDTO"
parameterType="com.engine.organization.entity.job.po.JobPO">
SELECT
a.comp_name ,
b.dept_name ,
a.subcompanyname ,
b.departmentname ,
c.sequence_name,
d.scheme_name,
<include refid="baseColumns"/>
FROM jcl_org_job t
left join jcl_org_comp a on
t.parent_comp = a.id
left join jcl_org_dept b on
t.parent_dept = b.id
left join hrmsubcompany a on
t.ec_company = a.id
left join hrmdepartment b on
t.ec_department = b.id
left join jcl_org_sequence c on
t.sequence_id = c.id
left join jcl_org_scheme d on
@ -415,16 +415,16 @@
<select id="listNoFilter" resultType="com.engine.organization.entity.job.dto.JobListDTO">
SELECT
a.comp_name ,
b.dept_name ,
a.subcompanyname ,
b.departmentname ,
c.sequence_name,
d.scheme_name,
<include refid="baseColumns"/>
FROM jcl_org_job t
left join jcl_org_comp a on
t.parent_comp = a.id
left join jcl_org_dept b on
t.parent_dept = b.id
left join hrmsubcompany a on
t.ec_company = a.id
left join hrmdepartment b on
t.ec_department = b.id
left join jcl_org_sequence c on
t.sequence_id = c.id
left join jcl_org_scheme d on

@ -33,7 +33,10 @@
<!-- 表字段 -->
<sql id="baseColumns">
t.id,t.work_code,t.last_name,t.sex,t.status,t.account_type,
t
.
id
,t.work_code,t.last_name,t.sex,t.status,t.account_type,
t.belong_to,t.ec_company,t.job_title,t.ec_department,t.
scheme_id,t.sequence_id,t.job_grade,t.job_level,t.job_group_id,
t.job_activity,t.location_id,t.show_order,t.company_start_date,
@ -53,11 +56,11 @@
</update>
<select id="listAll" resultType="com.engine.organization.entity.hrmresource.vo.HrmResourceVO">
SELECT t.last_name as lastName,d.dept_name as departmentName,
c.comp_name as companyName,t.mobile,t.telephone,t1.last_name as managerName
SELECT t.last_name as lastName,d.departmentname as departmentName,
c.subcompanyname as companyName,t.mobile,t.telephone,t1.last_name as managerName
from jcl_org_hrmresource t
left join JCL_ORG_DEPT d on t.department_id = d.id
left join jcl_org_comp c on t.company_id = c.id
left join hrmdepartment d on t.ec_department = d.id
left join hrmsubcompany c on t.ec_eompany = c.id
left join jcl_org_hrmresource t1 on t.manager_id = t1.id
where 1 = 1
<if test="ids != null and ids.size > 0">
@ -108,11 +111,11 @@
from jcl_org_hrmresource t where delete_type = 0 and work_code = #{workCode}
</select>
<select id="listDetachAll" resultType="com.engine.organization.entity.hrmresource.vo.HrmResourceVO">
SELECT t.last_name as lastName,d.dept_name as departmentName,
c.comp_name as companyName,t.mobile,t.telephone,t1.last_name as managerName
SELECT t.last_name as lastName,d.departmentname as departmentName,
c.subcompanyname as companyName,t.mobile,t.telephone,t1.last_name as managerName
from jcl_org_hrmresource t
left join JCL_ORG_DEPT d on t.department_id = d.id
left join jcl_org_comp c on t.company_id = c.id
left join hrmdepartment d on t.ec_department = d.id
left join hrmsubcompany c on t.ec_company = c.id
left join jcl_org_hrmresource t1 on t.manager_id = t1.id
where 1 = 1
<if test="ids != null and ids.size > 0">

@ -12,6 +12,4 @@ import java.sql.Date;
**/
public interface JobTriggerMapper {
Integer sumStaffNum(@Param("fdatebegin") Date fdatebegin, @Param("jobId") Integer jobId);
Integer countHrmResource(@Param("parentdept") Integer parentdept, @Param("fname") String fname);
}

@ -11,12 +11,4 @@
and time_end &gt;= #{fdatebegin})
and job_id = #{jobId}
</select>
<select id="countHrmResource" resultType="java.lang.Integer">
select count(1)
from hrmresource
where status &lt;= 3
and departmentid =
(select id from hrmdepartment where uuid = (select uuid from JCL_ORG_DEPT where id = #{parentdept}))
and jobtitle in (select id from hrmjobtitles where JOBTITLENAME = #{fname})
</select>
</mapper>

@ -105,7 +105,7 @@ public class CompServiceImpl extends Service implements CompService {
CompanyPO companyPO = CompanyBO.convertParamToPO(params, user.getUID());
boolean filter = isFilter(companyPO);
PageInfo<CompanyListDTO> pageInfos;
String orderSql = PageInfoSortUtil.getSortSql(params.getSortParams());
String orderSql = PageInfoSortUtil.getSortSql(params.getSortParams()," showorder ");
List<CompanyPO> allList = getCompanyMapper().listAll(orderSql);
new DetachUtil(user.getUID()).filterCompanyList(allList);

@ -24,20 +24,15 @@ import com.engine.organization.entity.extend.po.ExtendTitlePO;
import com.engine.organization.entity.job.bo.JobBO;
import com.engine.organization.entity.job.po.JobPO;
import com.engine.organization.entity.job.vo.SingleJobTreeVO;
import com.engine.organization.entity.map.JclOrgMap;
import com.engine.organization.entity.searchtree.SearchTree;
import com.engine.organization.entity.searchtree.SearchTreeParams;
import com.engine.organization.enums.LogModuleNameEnum;
import com.engine.organization.enums.ModuleTypeEnum;
import com.engine.organization.enums.OperateTypeEnum;
import com.engine.organization.exception.OrganizationRunTimeException;
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
import com.engine.organization.mapper.comp.CompanyMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.extend.ExtDTMapper;
import com.engine.organization.mapper.extend.ExtMapper;
import com.engine.organization.mapper.extend.ExtendTitleMapper;
import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
import com.engine.organization.mapper.job.JobMapper;
import com.engine.organization.service.DepartmentService;
import com.engine.organization.service.ExtService;
@ -50,7 +45,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 com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
@ -173,7 +167,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
DepartmentPO departmentPO = DepartmentBO.convertParamsToPO(param, user.getUID());
boolean filter = isFilter(departmentPO);
PageInfo<DepartmentListDTO> pageInfos;
String orderSql = PageInfoSortUtil.getSortSql(param.getSortParams());
String orderSql = PageInfoSortUtil.getSortSql(param.getSortParams()," showorder ");
List<DepartmentPO> allList = getDepartmentMapper().listAll(orderSql);
new DetachUtil(user.getUID()).filterDepartmentList(allList);
// 通过子级遍历父级元素
@ -528,6 +522,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
deptById.setSupDepId(parentDepartmentId);
// 显示顺序字段
deptById.setShowOrder(++maxShowOrder);
deptById.setUuid(null);
// 新增EC表部门
Map<String, Object> syncMap = addEcDepartment(deptById);
@ -544,7 +539,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
if (maxJobOrder == null) {
maxJobOrder = 0;
}
recursionCopyJob(jobPOS, companyId, deptById.getId(), null, maxJobOrder, timeMillis);
recursionCopyJob(jobPOS, companyId, Integer.parseInt(ecDepartmentID), null, maxJobOrder, timeMillis);
}
// 是否复制子部门信息
@ -553,7 +548,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
List<DepartmentPO> deptListByPId = getDepartmentMapper().getDeptListByPId(originalDeptId);
for (DepartmentPO departmentPO : deptListByPId) {
// 复制子部门信息、子部门岗位信息
recursionCopyDept(departmentPO.getId(), deptById.getId(), companyId, maxShowOrder, copySubJob, copySubDept, copySubJob);
recursionCopyDept(departmentPO.getId(), Integer.parseInt(ecDepartmentID), companyId, maxShowOrder, copySubJob, copySubDept, copySubJob);
}
}
}
@ -579,17 +574,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
// 被合并部门
Integer ecParamDepartment = mergeParam.getDepartment();
DepartmentPO targetDepartment = getDepartmentMapper().getDeptById(ecParamDepartment);
// map表中合并部门parentID
Integer oldParamDepartment = mergeParam.getId();
DepartmentPO oldDepartment = getDepartmentMapper().getDeptById(oldParamDepartment);
Integer oldFParentId = null;
if (null != oldDepartment) {
java.sql.Date currentDate = new java.sql.Date(OrganizationDateUtil.stringToDate(OrganizationDateUtil.getFormatLocalDate(new Date())).getTime());
JclOrgMap jclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(currentDate, ModuleTypeEnum.departmentfielddefined.getValue().toString(), oldDepartment.getId().toString());
if (null != jclOrgMap) {
oldFParentId = jclOrgMap.getFParentId();
}
}
// 断言判断
OrganizationAssert.isFalse(null == targetDepartment, "被合并部门数据有误,暂时无法合并");
@ -644,14 +629,11 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
forbiddenChildTag(targetDepartment.getSubCompanyId1(), Util.null2String(targetDepartment.getSubCompanyId1()), deptList);
}
// 原部门删除
DepartmentPO mergeDepartment = getDepartmentMapper().getDeptById(mergeParam.getId());
// DepartmentPO mergeDepartment = getDepartmentMapper().getDeptById(mergeParam.getId());
Map<String, Object> map = new HashMap<>();
map.put("id", mergeParam.getId());
new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.CANCELED, map).sync();
// 删除拓展表、明细表
MapperProxyFactory.getProxy(ExtMapper.class).deleteByID("jcl_org_deptext", mergeParam.getId());
MapperProxyFactory.getProxy(ExtDTMapper.class).deleteByMainID("jcl_org_deptext_dt1", mergeParam.getId(), null);
// TODO 删除 getDepartmentMapper().deleteByIds(DeleteParam.builder().ids(mergeParam.getId().toString()).build().getIds());
map.put("id", Util.null2String(mergeParam.getId()));
// 删除部门
ServiceUtil.getService(OrganizationServiceImpl.class, user).delDepartment(map, user);
// 更新组织架构图
// TODO new DepartmentTriggerRunnable(mergeDepartment).run();
// 更新部门合并后名称
@ -725,7 +707,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
refreshJobComp(deptById.getId(), deptById.getSubCompanyId1());
List<DepartmentPO> deptList = getDepartmentMapper().getDeptListByPId(deptById.getId());
// 更新当前部门下的人员
new RecordSet().executeUpdate("update hrmresource set SUBCOMPANYID1 =? where DEPARTMENTID = ?", deptById.getSubCompanyId1(), deptById.getId());
// new RecordSet().executeUpdate("update hrmresource set SUBCOMPANYID1 =? where DEPARTMENTID = ?", deptById.getSubCompanyId1(), deptById.getId());
//// 更新人员组织架构图
//List<Long> hrmResourceIds = getSystemDataMapper().getHrmResourceIdsByDept(deptById.getId().toString());
//for (Long hrmResourceId : hrmResourceIds) {
@ -747,16 +729,16 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
for (DepartmentPO departmentPO : deptList) {
departmentPO.setSubCompanyId1(parentComp);
// 更新EC表部门
updateEcDepartment(departmentPO);
updateEcDepartment(departmentPO);
// 更新组织架构图
// TODO new DepartmentTriggerRunnable(departmentPO.getId()).run();
// 刷新岗位所属分部
refreshJobComp(departmentPO.getId(), parentComp);
// 更新当前部门下的人员
String ecDepartmentId = EcHrmRelationUtil.getEcDepartmentId(departmentPO.getId().toString());
new RecordSet().executeUpdate("update hrmresource set SUBCOMPANYID1 =? where DEPARTMENTID = ?", ecCompanyId, ecDepartmentId);
new RecordSet().executeUpdate("update jcl_org_hrmresource set company_id =? ,ec_company = ? where department_id =?", parentComp, ecCompanyId, departmentPO.getId());
// String ecDepartmentId = EcHrmRelationUtil.getEcDepartmentId(departmentPO.getId().toString());
//new RecordSet().executeUpdate("update hrmresource set SUBCOMPANYID1 =? where DEPARTMENTID = ?", ecCompanyId, ecDepartmentId);
//new RecordSet().executeUpdate("update jcl_org_hrmresource set company_id =? ,ec_company = ? where department_id =?", parentComp, ecCompanyId, departmentPO.getId());
//List<Long> hrmResourceIds = getSystemDataMapper().getHrmResourceIdsByDept(departmentPO.getId().toString());
//// 更新人员组织架构图
//for (Long hrmResourceId : hrmResourceIds) {
@ -905,12 +887,12 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
Map<String, Object> map = new HashMap<>();
map.put("departmentmark", departmentPO.getDepartmentMark());
map.put("departmentname", departmentPO.getDepartmentName());
map.put("subcompanyid1", departmentPO.getSubCompanyId1());
map.put("supdepid", departmentPO.getSupDepId());
map.put("showorder", departmentPO.getShowOrder());
map.put("subcompanyid1", Util.null2String(departmentPO.getSubCompanyId1()));
map.put("supdepid", Util.null2String(departmentPO.getSupDepId()));
map.put("showorder", Util.null2String(departmentPO.getShowOrder()));
map.put("departmentcode", departmentPO.getDepartmentCode());
map.put("coadjutant", departmentPO.getCoadjutant());
map.put("id", departmentPO.getId());
map.put("coadjutant", Util.null2String(departmentPO.getCoadjutant()));
map.put("id", Util.null2String(departmentPO.getId()));
new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.UPDATE, map).sync();
}
@ -924,9 +906,9 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
Map<String, Object> map = new HashMap<>();
map.put("departmentmark", departmentPO.getDepartmentMark());
map.put("departmentname", departmentPO.getDepartmentName());
map.put("subcompanyid1", departmentPO.getSubCompanyId1());
map.put("supdepid", departmentPO.getSupDepId());
map.put("showorder", departmentPO.getShowOrder());
map.put("subcompanyid1", Util.null2String(departmentPO.getSubCompanyId1()));
map.put("supdepid", Util.null2String(departmentPO.getSupDepId()));
map.put("showorder", Util.null2String(departmentPO.getShowOrder()));
map.put("departmentcode", departmentPO.getDepartmentCode());
return new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.ADD, map).sync();
}
@ -961,8 +943,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
List<JobPO> jobPOS = getJobMapper().listJobsByDepartmentId(parentDepartment);
jobPOS = jobPOS.stream().filter(item -> null == item.getParentJob() || 0 == item.getParentJob()).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(jobPOS)) {
String ecCompanyId = EcHrmRelationUtil.getEcCompanyId(parentComp.toString());
getJobMapper().updateJobCompany(jobPOS.stream().map(JobPO::getId).collect(Collectors.toList()), parentComp, ecCompanyId);
getJobMapper().updateJobCompany(jobPOS.stream().map(JobPO::getId).collect(Collectors.toList()), parentComp, parentComp);
for (JobPO jobPO : jobPOS) {
// 刷新组织架构图
new JobTriggerRunnable(jobPO.getId()).run();

@ -577,7 +577,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
private List<SearchTree> buildTreeByCompAndDept(DepartmentPO departmentBuild, CompanyPO compBuild, JobPO jobBuild) {
List<JobPO> jobPOS = getJobMapper().listPOsByFilter(jobBuild);
new DetachUtil(user.getUID()).filterJobList(jobPOS);
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "show_order");
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "showorder");
new DetachUtil(user.getUID()).filterDepartmentList(filterDeparts);
// 添加父级岗位
Set<JobPO> builderJobs = new HashSet<>();
@ -607,7 +607,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
}
// 查询分部信息
List<CompanyPO> filterComps = getCompanyMapper().listByFilter(compBuild, "show_order");
List<CompanyPO> filterComps = getCompanyMapper().listByFilter(compBuild, "showorder");
new DetachUtil(user.getUID()).filterCompanyList(filterComps);
Set<DepartmentPO> builderDeparts = new HashSet<>();
for (DepartmentPO departmentPO : filterDeparts) {
@ -624,7 +624,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
filterComps.addAll(compsByIds);
}
}
List<CompanyPO> allCompanys = getCompanyMapper().listAll("show_order");
List<CompanyPO> allCompanys = getCompanyMapper().listAll("showorder");
new DetachUtil(user.getUID()).filterCompanyList(allCompanys);
Map<Integer, CompanyPO> allMaps = allCompanys.stream().collect(Collectors.toMap(CompanyPO::getId, item -> item, (k1, k2) -> k1));
Set<CompanyPO> builderComps = new HashSet<>();
@ -636,7 +636,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
private List<SearchTree> buildTreeByDeptAndJob(DepartmentPO departmentBuild, JobPO jobBuild) {
List<JobPO> jobPOS = getJobMapper().listPOsByFilter(jobBuild);
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "show_order");
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "showorder");
// 添加父级岗位
Set<JobPO> builderJobs = new HashSet<>();
for (JobPO jobPO : jobPOS) {

@ -163,7 +163,7 @@ public class JobServiceImpl extends Service implements JobService {
JobPO jobPO = JobBO.convertParamsToPO(param, user.getUID());
boolean filter = isFilter(jobPO);
PageInfo<JobListDTO> pageInfos;
String orderSql = PageInfoSortUtil.getSortSql(param.getSortParams());
String orderSql = PageInfoSortUtil.getSortSql(param.getSortParams(), " show_order ");
List<JobListDTO> allList = getJobMapper().listNoFilter(orderSql);
new DetachUtil(user.getUID()).filterJobDTOList(allList);
// 通过子级遍历父级元素
@ -631,7 +631,7 @@ public class JobServiceImpl extends Service implements JobService {
return;
}
DepartmentPO parentDept = getDepartmentMapper().getDeptById(departmentPO.getSupDepId());
if (null != parentDept && 0 == parentDept.getCanceled()) {
if (null != parentDept && (null == parentDept.getCanceled() || 0 == parentDept.getCanceled())) {
buildParentDepts(parentDept, builderDeparts);
}
}
@ -645,7 +645,7 @@ public class JobServiceImpl extends Service implements JobService {
private void buildParentComps(CompanyPO compPO, Set<CompanyPO> builderComps, Map<Integer, CompanyPO> allMaps) {
builderComps.add(compPO);
CompanyPO parentComp = allMaps.get(compPO.getSupSubComId());
if (null != parentComp && 0 == parentComp.getCanceled()) {
if (null != parentComp && (null == parentComp.getCanceled() || 0 == parentComp.getCanceled())) {
buildParentComps(parentComp, builderComps, allMaps);
}
}
@ -669,7 +669,7 @@ public class JobServiceImpl extends Service implements JobService {
} else if (TYPE_DEPT.equals(type)) {
//
// 查询部门信息
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(DepartmentPO.builder().departmentName(keyword).canceled(0).supDepId(Integer.parseInt(id)).build(), "show_order");
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(DepartmentPO.builder().departmentName(keyword).canceled(0).supDepId(Integer.parseInt(id)).build(), "showorder");
Set<DepartmentPO> builderDeparts = new HashSet<>();
for (DepartmentPO departmentPO : filterDeparts) {
buildParentDepts(departmentPO, builderDeparts);
@ -688,10 +688,10 @@ public class JobServiceImpl extends Service implements JobService {
* @return
*/
private List<SearchTree> buildTreeByCompAndDept(DepartmentPO departmentBuild, CompanyPO compBuild) {
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "show_order");
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "showorder");
new DetachUtil(user.getUID()).filterDepartmentList(filterDeparts);
// 查询分部信息
List<CompanyPO> filterComps = getCompanyMapper().listByFilter(compBuild, "show_order");
List<CompanyPO> filterComps = getCompanyMapper().listByFilter(compBuild, "showorder");
new DetachUtil(user.getUID()).filterCompanyList(filterComps);
Set<DepartmentPO> builderDeparts = new HashSet<>();
for (DepartmentPO departmentPO : filterDeparts) {
@ -706,7 +706,7 @@ public class JobServiceImpl extends Service implements JobService {
filterComps.addAll(compsByIds);
}
}
List<CompanyPO> allCompanys = getCompanyMapper().listAll("show_order");
List<CompanyPO> allCompanys = getCompanyMapper().listAll("showorder");
new DetachUtil(user.getUID()).filterCompanyList(allCompanys);
Map<Integer, CompanyPO> allMaps = allCompanys.stream().collect(Collectors.toMap(CompanyPO::getId, item -> item, (k1, k2) -> k1));
Set<CompanyPO> builderComps = new HashSet<>();

@ -20,7 +20,7 @@ public class PageInfoSortUtil {
* @param sortParams
* @return
*/
public static String getSortSql(String sortParams) {
public static String getSortSql(String sortParams, String defaultOrder) {
JSONArray jsonArray = JSONObject.parseArray(sortParams);
if (CollectionUtils.isNotEmpty(jsonArray)) {
JSONObject jsonObject = (JSONObject) jsonArray.get(0);
@ -28,7 +28,7 @@ public class PageInfoSortUtil {
String sortOrder = jsonObject.getString("sortOrder").replace("end", "");
return "t." + orderKey + " " + sortOrder;
}
return " showOrder ";
return defaultOrder;
}
/**

Loading…
Cancel
Save