部门管理功能逻辑调整

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

@ -9,12 +9,12 @@ import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.browser.bo.CusBowserTreeBO;
import com.engine.organization.entity.browser.enums.TreeNodeTypeEnum;
import com.engine.organization.entity.browser.po.CusBrowserTree;
import com.engine.organization.entity.company.po.CompanyPO;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.department.po.DepartmentPO;
import com.engine.organization.entity.job.vo.JobBrowserVO;
import com.engine.organization.entity.searchtree.SearchTree;
import com.engine.organization.entity.searchtree.SearchTreeParams;
import com.engine.organization.mapper.comp.CompanyMapper;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.util.OrganizationFormItemUtil;
import com.engine.organization.util.db.DBType;
@ -165,37 +165,37 @@ public class JobBrowserService extends BrowserService {
List<String> compHasSubs;
if (detachUtil.isDETACH()) {
if (CollectionUtils.isNotEmpty(jclRoleLevelList)) {
compHasSubs = MapperProxyFactory.getProxy(CompanyMapper.class).hasDetachSubs(jclRoleLevelList);
compHasSubs = MapperProxyFactory.getProxy(CompMapper.class).hasDetachSubs(jclRoleLevelList);
} else {
compHasSubs = new ArrayList<>();
}
} else {
compHasSubs = MapperProxyFactory.getProxy(CompanyMapper.class).hasSubs();
compHasSubs = MapperProxyFactory.getProxy(CompMapper.class).hasSubs();
}
// 部门存在下级的ID
List<String> hasSubDepartment = MapperProxyFactory.getProxy(DepartmentMapper.class).hasSubs();
if ("0".equals(params.getId())) {
List<CompanyPO> compList;
List<CompPO> compList;
if (detachUtil.isDETACH()) {
if (CollectionUtils.isNotEmpty(jclRoleLevelList)) {
compList = MapperProxyFactory.getProxy(CompanyMapper.class).getCompsByIds(jclRoleLevelList);
compList = MapperProxyFactory.getProxy(CompMapper.class).getCompsByIds(jclRoleLevelList);
// 处理上下级关系
Set<Integer> collectIds = compList.stream().map(CompanyPO::getId).collect(Collectors.toSet());
Set<Integer> collectIds = compList.stream().map(CompPO::getId).collect(Collectors.toSet());
compList.removeIf(item -> collectIds.contains(item.getSupSubComId()));
} else {
compList = new ArrayList<>();
}
} else {
compList = MapperProxyFactory.getProxy(CompanyMapper.class).listParent();
compList = MapperProxyFactory.getProxy(CompMapper.class).listParent();
}
// 获取顶层分部
compList.stream().sorted(Comparator.comparing(CompanyPO::getShowOrder)).forEach(item -> buildCompNodes(treeNodes, compHasSubs, item));
compList.stream().sorted(Comparator.comparing(CompPO::getShowOrder)).forEach(item -> buildCompNodes(treeNodes, compHasSubs, item));
} 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, "showorder");
CompPO compBuild = CompPO.builder().supSubComId(Integer.parseInt(params.getId())).canceled(0).build();
List<CompPO> compList = MapperProxyFactory.getProxy(CompMapper.class).listByFilter(compBuild, "showorder");
if (detachUtil.isDETACH()) {
detachUtil.filterCompanyList(compList);
}
@ -222,7 +222,7 @@ public class JobBrowserService extends BrowserService {
* @param compHasSubs
* @param company
*/
private void buildCompNodes(List<TreeNode> treeNodes, List<String> compHasSubs, CompanyPO company) {
private void buildCompNodes(List<TreeNode> treeNodes, List<String> compHasSubs, CompPO company) {
SearchTree searchTree = new SearchTree();
searchTree.setId(company.getId().toString());
searchTree.setType(TreeNodeTypeEnum.TYPE_COMP.getValue());

@ -1,10 +1,10 @@
package com.engine.organization.entity.company.bo;
import com.engine.organization.entity.company.dto.CompanyListDTO;
import com.engine.organization.entity.company.param.CompanyParam;
import com.engine.organization.entity.company.po.CompanyPO;
import com.engine.organization.entity.company.dto.CompListDTO;
import com.engine.organization.entity.company.param.CompParam;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.searchtree.SearchTree;
import com.engine.organization.mapper.comp.CompanyMapper;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.util.db.MapperProxyFactory;
import org.apache.commons.collections.CollectionUtils;
import weaver.general.Util;
@ -17,14 +17,14 @@ import java.util.stream.Collectors;
* @createTime: 2022/11/24
* @version: 1.0
*/
public class CompanyBO {
public class CompBO {
private static CompanyMapper getCompanyMapper() {
return MapperProxyFactory.getProxy(CompanyMapper.class);
private static CompMapper getCompMapper() {
return MapperProxyFactory.getProxy(CompMapper.class);
}
public static List<SearchTree> buildSetToSearchTree(Set<CompanyPO> comps) {
return comps.stream().sorted(Comparator.comparing(CompanyPO::getShowOrder)).map(item -> {
public static List<SearchTree> buildSetToSearchTree(Set<CompPO> comps) {
return comps.stream().sorted(Comparator.comparing(CompPO::getShowOrder)).map(item -> {
SearchTree tree = new SearchTree();
tree.setCanClick(true);
tree.setCanceled(item.getCanceled() != null && item.getCanceled() != 0);
@ -48,11 +48,11 @@ public class CompanyBO {
* @param userId
* @return
*/
public static CompanyPO convertParamToPO(CompanyParam param, Integer userId) {
public static CompPO convertParamToPO(CompParam param, Integer userId) {
if (null == param) {
return null;
}
return CompanyPO
return CompPO
.builder()
.id(param.getId() == null ? 0 : param.getId())
.subCompanyName(param.getSubCompanyName())
@ -75,27 +75,27 @@ public class CompanyBO {
.build();
}
public static List<CompanyListDTO> buildCompDTOList(Collection<CompanyPO> list, List<CompanyPO> filterList) {
public static List<CompListDTO> buildCompDTOList(Collection<CompPO> list, List<CompPO> filterList) {
// 搜索结果为空,直接返回空
if (CollectionUtils.isEmpty(filterList)) {
return Collections.emptyList();
}
// 递归添加父级数据
Map<Integer, CompanyPO> poMaps = list.stream().collect(Collectors.toMap(CompanyPO::getId, item -> item));
List<CompanyPO> addedList = new ArrayList<>();
for (CompanyPO po : filterList) {
Map<Integer, CompPO> poMaps = list.stream().collect(Collectors.toMap(CompPO::getId, item -> item));
List<CompPO> addedList = new ArrayList<>();
for (CompPO po : filterList) {
dealParentData(addedList, po, poMaps);
}
return buildCompDTOList(addedList);
}
public static List<CompanyListDTO> buildCompDTOList(List<CompanyPO> list) {
public static List<CompListDTO> buildCompDTOList(List<CompPO> list) {
Map<Integer, CompanyPO> poMaps = list.stream().collect(Collectors.toMap(CompanyPO::getId, item -> item));
Map<Integer, CompPO> poMaps = list.stream().collect(Collectors.toMap(CompPO::getId, item -> item));
List<CompanyListDTO> dtoList = list.stream().map(e ->
CompanyListDTO
List<CompListDTO> dtoList = list.stream().map(e ->
CompListDTO
.builder()
.id(e.getId())
.subCompanyCode(e.getSubCompanyCode())
@ -106,15 +106,15 @@ public class CompanyBO {
.showOrder(e.getShowOrder())
.canceled(null == e.getCanceled() ? 0 : e.getCanceled())
.build()).collect(Collectors.toList());
Map<Integer, List<CompanyListDTO>> collects = dtoList.stream().filter(item -> 0 != item.getSupSubComId()).collect(Collectors.groupingBy(CompanyListDTO::getSupSubComId));
Map<Integer, List<CompListDTO>> collects = dtoList.stream().filter(item -> 0 != item.getSupSubComId()).collect(Collectors.groupingBy(CompListDTO::getSupSubComId));
// 处理被引用数据
List<String> usedIds = getCompanyMapper().listUsedId();
List<String> usedIds = getCompMapper().listUsedId();
// 兼容MySQL
usedIds.addAll(getCompanyMapper().listUsedIds());
usedIds.addAll(getCompMapper().listUsedIds());
List<String> collect = Arrays.stream(String.join(",", usedIds).split(",")).collect(Collectors.toList());
Set<Integer> leafs = new HashSet<>();
List<CompanyListDTO> collectTree = dtoList.stream().peek(e -> {
List<CompanyListDTO> childList = collects.get(e.getId());
List<CompListDTO> collectTree = dtoList.stream().peek(e -> {
List<CompListDTO> childList = collects.get(e.getId());
leafs.add(e.getId());
if (CollectionUtils.isNotEmpty(childList)) {
e.setChildren(childList);
@ -137,11 +137,11 @@ public class CompanyBO {
* @param po
* @param poMaps
*/
private static void dealParentData(List<CompanyPO> addedList, CompanyPO po, Map<Integer, CompanyPO> poMaps) {
private static void dealParentData(List<CompPO> addedList, CompPO po, Map<Integer, CompPO> poMaps) {
if (!addedList.contains(po)) {
addedList.add(po);
}
CompanyPO parentCompPO = poMaps.get(po.getSupSubComId());
CompPO parentCompPO = poMaps.get(po.getSupSubComId());
if (null != parentCompPO) {
dealParentData(addedList, parentCompPO, poMaps);
}

@ -19,7 +19,7 @@ import java.util.List;
@NoArgsConstructor
@AllArgsConstructor
@OrganizationTable(pageId = "dcfd9d27-6ba2-11ed-996a-00ffcbed7508")
public class CompanyListDTO {
public class CompListDTO {
/**
* id
*/
@ -73,5 +73,5 @@ public class CompanyListDTO {
/**
*
*/
private List<CompanyListDTO> children;
private List<CompListDTO> children;
}

@ -15,7 +15,7 @@ import lombok.NoArgsConstructor;
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CompanyParam extends BaseQueryParam {
public class CompParam extends BaseQueryParam {
private Integer Id;
private String subCompanyName;
private String subCompanyDesc;

@ -16,7 +16,7 @@ import java.util.Date;
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CompanyPO {
public class CompPO {
private Integer id;
private String subCompanyName;
private String subCompanyDesc;

@ -5,7 +5,7 @@ import com.engine.organization.entity.department.param.DeptSearchParam;
import com.engine.organization.entity.department.po.DepartmentPO;
import com.engine.organization.entity.department.vo.SingleDeptTreeVO;
import com.engine.organization.entity.searchtree.SearchTree;
import com.engine.organization.mapper.comp.CompanyMapper;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.employee.EmployeeMapper;
import com.engine.organization.util.db.MapperProxyFactory;
@ -35,7 +35,7 @@ public class DepartmentBO {
.departmentName(e.getDepartmentName())
.departmentCode(e.getDepartmentCode())
.subCompanyId1(e.getSubCompanyId1())
.subCompanyName(0 == e.getSubCompanyId1() ? "" : MapperProxyFactory.getProxy(CompanyMapper.class).listById(e.getSubCompanyId1()).getSubCompanyName())
.subCompanyName(0 == e.getSubCompanyId1() ? "" : MapperProxyFactory.getProxy(CompMapper.class).listById(e.getSubCompanyId1()).getSubCompanyName())
.supDepId(e.getSupDepId())
.supDepName(null == poMaps.get(e.getSupDepId()) ? "" : poMaps.get(e.getSupDepId()).getDepartmentName())
// .deptPrincipal(getEmployeeNameById(e.getDeptPrincipal()))

@ -1,6 +1,6 @@
package com.engine.organization.mapper.comp;
import com.engine.organization.entity.company.po.CompanyPO;
import com.engine.organization.entity.company.po.CompPO;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
@ -12,15 +12,15 @@ import java.util.List;
* @createTime: 2022/05/16
* @version: 1.0
*/
public interface CompanyMapper {
public interface CompMapper {
/**
*
*
* @return
*/
List<CompanyPO> listAll(@Param("orderSql") String orderSql);
List<CompPO> listAll(@Param("orderSql") String orderSql);
List<CompanyPO> listByFilter(@Param("CompanyPO") CompanyPO CompanyPO, @Param("orderSql") String orderSql);
List<CompPO> listByFilter(@Param("CompanyPO") CompPO CompanyPO, @Param("orderSql") String orderSql);
/**
* ID
@ -37,7 +37,7 @@ public interface CompanyMapper {
* @param ids
* @return
*/
List<CompanyPO> listChild(@Param("ids") Collection<Long> ids);
List<CompPO> listChild(@Param("ids") Collection<Long> ids);
/**
* ID
@ -45,7 +45,7 @@ public interface CompanyMapper {
* @param id
* @return
*/
CompanyPO listById(@Param("id") Integer id);
CompPO listById(@Param("id") Integer id);
/**
* ID
@ -53,14 +53,14 @@ public interface CompanyMapper {
* @param ids
* @return
*/
List<CompanyPO> getCompsByIds(@Param("ids") Collection<Long> ids);
List<CompPO> getCompsByIds(@Param("ids") Collection<Long> ids);
/**
*
*
* @return
*/
List<CompanyPO> listParent();
List<CompPO> listParent();
List<String> hasSubs();

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.organization.mapper.comp.CompanyMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.company.po.CompanyPO">
<mapper namespace="com.engine.organization.mapper.comp.CompMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.company.po.CompPO">
<result column="id" property="id"/>
<result column="subCompanyName" property="subCompanyName"/>
<result column="subCompanyDesc" property="subCompanyDesc"/>

@ -1,7 +1,7 @@
package com.engine.organization.service;
import com.api.browser.bean.SearchConditionGroup;
import com.engine.organization.entity.company.param.CompanyParam;
import com.engine.organization.entity.company.param.CompParam;
import com.engine.organization.entity.department.param.DepartmentMoveParam;
import com.engine.organization.util.MenuBtn;
@ -22,7 +22,7 @@ public interface CompService {
* @param params
* @return
*/
Map<String, Object> listPage(CompanyParam params);
Map<String, Object> listPage(CompParam params);
/**
* /
@ -37,7 +37,7 @@ public interface CompService {
*
* @param params
*/
int updateForbiddenTagById(CompanyParam params);
int updateForbiddenTagById(CompParam params);
/**

@ -12,16 +12,16 @@ import com.engine.core.impl.Service;
import com.engine.hrm.service.impl.OrganizationServiceImpl;
import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.company.bo.CompanyBO;
import com.engine.organization.entity.company.dto.CompanyListDTO;
import com.engine.organization.entity.company.param.CompanyParam;
import com.engine.organization.entity.company.po.CompanyPO;
import com.engine.organization.entity.company.bo.CompBO;
import com.engine.organization.entity.company.dto.CompListDTO;
import com.engine.organization.entity.company.param.CompParam;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.department.param.DepartmentMoveParam;
import com.engine.organization.entity.extend.po.ExtendTitlePO;
import com.engine.organization.enums.LogModuleNameEnum;
import com.engine.organization.enums.OperateTypeEnum;
import com.engine.organization.exception.OrganizationRunTimeException;
import com.engine.organization.mapper.comp.CompanyMapper;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.extend.ExtendTitleMapper;
import com.engine.organization.service.CompService;
import com.engine.organization.service.ExtService;
@ -81,8 +81,8 @@ public class CompServiceImpl extends Service implements CompService {
*/
private static final Long GROUP_ID = 1L;
private static CompanyMapper getCompanyMapper() {
return MapperProxyFactory.getProxy(CompanyMapper.class);
private static CompMapper getCompMapper() {
return MapperProxyFactory.getProxy(CompMapper.class);
}
private ExtendTitleMapper getExtendTitleMapper() {
@ -95,44 +95,44 @@ public class CompServiceImpl extends Service implements CompService {
@Override
public Map<String, Object> listPage(CompanyParam params) {
public Map<String, Object> listPage(CompParam params) {
Map<String, Object> datas = new HashMap<>();
boolean hasRight = HasRightUtil.hasRight(user, RIGHT_NAME, true);
datas.put("hasRight", hasRight);
if (!hasRight) {
return datas;
}
CompanyPO companyPO = CompanyBO.convertParamToPO(params, user.getUID());
CompPO companyPO = CompBO.convertParamToPO(params, user.getUID());
boolean filter = isFilter(companyPO);
PageInfo<CompanyListDTO> pageInfos;
PageInfo<CompListDTO> pageInfos;
String orderSql = PageInfoSortUtil.getSortSql(params.getSortParams()," showorder ");
List<CompanyPO> allList = getCompanyMapper().listAll(orderSql);
List<CompPO> allList = getCompMapper().listAll(orderSql);
new DetachUtil(user.getUID()).filterCompanyList(allList);
// 通过子级遍历父级元素
if (filter) {
// 根据条件获取元素
List<CompanyPO> filterCompPOs = getCompanyMapper().listByFilter(companyPO, orderSql);
List<CompPO> filterCompPOs = getCompMapper().listByFilter(companyPO, orderSql);
new DetachUtil(user.getUID()).filterCompanyList(filterCompPOs);
// 添加父级元素
List<CompanyListDTO> compListDTOS = CompanyBO.buildCompDTOList(allList, filterCompPOs);
List<CompanyListDTO> subList = PageUtil.subList(params.getCurrent(), params.getPageSize(), compListDTOS);
pageInfos = new PageInfo<>(subList, CompanyListDTO.class);
List<CompListDTO> compListDTOS = CompBO.buildCompDTOList(allList, filterCompPOs);
List<CompListDTO> subList = PageUtil.subList(params.getCurrent(), params.getPageSize(), compListDTOS);
pageInfos = new PageInfo<>(subList, CompListDTO.class);
pageInfos.setTotal(compListDTOS.size());
} else {
// 组合list
List<CompanyListDTO> compListDTOS = CompanyBO.buildCompDTOList(allList);
List<CompanyListDTO> subList = PageUtil.subList(params.getCurrent(), params.getPageSize(), compListDTOS);
pageInfos = new PageInfo<>(subList, CompanyListDTO.class);
List<CompListDTO> compListDTOS = CompBO.buildCompDTOList(allList);
List<CompListDTO> subList = PageUtil.subList(params.getCurrent(), params.getPageSize(), compListDTOS);
pageInfos = new PageInfo<>(subList, CompListDTO.class);
pageInfos.setTotal(compListDTOS.size());
}
pageInfos.setPageNum(params.getCurrent());
pageInfos.setPageSize(params.getPageSize());
OrganizationWeaTable<CompanyListDTO> table = new OrganizationWeaTable<>(user, CompanyListDTO.class);
OrganizationWeaTable<CompListDTO> table = new OrganizationWeaTable<>(user, CompListDTO.class);
List<Column> columns = pageInfos.getColumns();
List<WeaTableColumn> weaTableColumn = columns.stream().map(v -> new WeaTableColumn("100", v.getTitle(), v.getKey())).collect(Collectors.toList());
table.setColumns(weaTableColumn);
@ -156,9 +156,9 @@ public class CompServiceImpl extends Service implements CompService {
}
@Override
public int updateForbiddenTagById(CompanyParam params) {
public int updateForbiddenTagById(CompParam params) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
CompanyPO compPO = CompanyPO.builder().id(params.getId()).canceled(params.getCanceled() ? 0 : 1).build();
CompPO compPO = CompPO.builder().id(params.getId()).canceled(params.getCanceled() ? 0 : 1).build();
Map<String, Object> map = new HashMap<>();
map.put("id", compPO.getId().toString());
map.put("forbiddenTag", compPO.getCanceled());
@ -415,7 +415,7 @@ public class CompServiceImpl extends Service implements CompService {
// 判断目标分部是否为它本身以及子元素
Set<Integer> disableIds = new HashSet<>();
disableIds.add(companyId);
List<CompanyPO> compPOS = getCompanyMapper().listChild(DeleteParam.builder().ids(companyId.toString()).build().getIds());
List<CompPO> compPOS = getCompMapper().listChild(DeleteParam.builder().ids(companyId.toString()).build().getIds());
if (CollectionUtils.isNotEmpty(compPOS)) {
addDisableIds(disableIds, compPOS);
}
@ -435,7 +435,7 @@ public class CompServiceImpl extends Service implements CompService {
* @param companyPO
* @return
*/
private boolean isFilter(CompanyPO companyPO) {
private boolean isFilter(CompPO companyPO) {
return StringUtils.isNotBlank(companyPO.getSubCompanyCode()) || StringUtils.isNotBlank(companyPO.getSubCompanyDesc()) || StringUtils.isNotBlank(companyPO.getSubCompanyName()) || null != companyPO.getSupSubComId();
}
@ -479,10 +479,10 @@ public class CompServiceImpl extends Service implements CompService {
* @param disableIds
* @param compPOS
*/
private void addDisableIds(Set<Integer> disableIds, List<CompanyPO> compPOS) {
for (CompanyPO compPO : compPOS) {
private void addDisableIds(Set<Integer> disableIds, List<CompPO> compPOS) {
for (CompPO compPO : compPOS) {
disableIds.add(compPO.getId());
List<CompanyPO> childCompPOS = getCompanyMapper().listChild(DeleteParam.builder().ids(compPO.getId().toString()).build().getIds());
List<CompPO> childCompPOS = getCompMapper().listChild(DeleteParam.builder().ids(compPO.getId().toString()).build().getIds());
addDisableIds(disableIds, childCompPOS);
}
}

@ -13,8 +13,8 @@ import com.engine.hrm.entity.RuleCodeType;
import com.engine.hrm.service.impl.OrganizationServiceImpl;
import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.codesetting.po.CodeRulePO;
import com.engine.organization.entity.company.bo.CompanyBO;
import com.engine.organization.entity.company.po.CompanyPO;
import com.engine.organization.entity.company.bo.CompBO;
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.param.*;
@ -30,7 +30,7 @@ import com.engine.organization.enums.LogModuleNameEnum;
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.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.extend.ExtendTitleMapper;
import com.engine.organization.mapper.job.JobMapper;
@ -106,8 +106,8 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
return MapperProxyFactory.getProxy(JobMapper.class);
}
private CompanyMapper getCompanyMapper() {
return MapperProxyFactory.getProxy(CompanyMapper.class);
private CompMapper getCompMapper() {
return MapperProxyFactory.getProxy(CompMapper.class);
}
private ExtendTitleMapper getExtendTitleMapper() {
@ -774,19 +774,19 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
private List<SearchTree> getFilterCompany(String id, String keyword) {
// 查询部门信息
Integer parentCompId = StringUtil.isEmpty(id) ? null : Integer.parseInt(id);
CompanyPO compBuild = CompanyPO.builder().subCompanyName(keyword).supSubComId(parentCompId).canceled(0).build();
List<CompanyPO> allCompanys = getCompanyMapper().listAll("showOrder");
CompPO compBuild = CompPO.builder().subCompanyName(keyword).supSubComId(parentCompId).canceled(0).build();
List<CompPO> allCompanys = getCompMapper().listAll("showOrder");
new DetachUtil(user.getUID()).filterCompanyList(allCompanys);
List<CompanyPO> filterComps = getCompanyMapper().listByFilter(compBuild, "showOrder");
List<CompPO> filterComps = getCompMapper().listByFilter(compBuild, "showOrder");
new DetachUtil(user.getUID()).filterCompanyList(filterComps);
Map<Integer, CompanyPO> allMaps = allCompanys.stream().collect(Collectors.toMap(CompanyPO::getId, item -> item, (k1, k2) -> k1));
Map<Integer, CompPO> allMaps = allCompanys.stream().collect(Collectors.toMap(CompPO::getId, item -> item, (k1, k2) -> k1));
Set<CompanyPO> builderComps = new HashSet<>();
for (CompanyPO companyPO : filterComps) {
Set<CompPO> builderComps = new HashSet<>();
for (CompPO companyPO : filterComps) {
buildParentComps(companyPO, builderComps, allMaps);
}
return SearchTreeUtil.builderTreeMode(CompanyBO.buildSetToSearchTree(builderComps));
return SearchTreeUtil.builderTreeMode(CompBO.buildSetToSearchTree(builderComps));
}
@ -796,9 +796,9 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
* @param compPO
* @param builderComps
*/
private void buildParentComps(CompanyPO compPO, Set<CompanyPO> builderComps, Map<Integer, CompanyPO> allMaps) {
private void buildParentComps(CompPO compPO, Set<CompPO> builderComps, Map<Integer, CompPO> allMaps) {
builderComps.add(compPO);
CompanyPO parentComp = allMaps.get(compPO.getSupSubComId());
CompPO parentComp = allMaps.get(compPO.getSupSubComId());
if (null != parentComp && (null == parentComp.getCanceled() || 0 == parentComp.getCanceled())) {
buildParentComps(parentComp, builderComps, allMaps);
}

@ -14,8 +14,8 @@ import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.browser.po.CustomBrowserBean;
import com.engine.organization.entity.codesetting.po.CodeRulePO;
import com.engine.organization.entity.commom.RecordInfo;
import com.engine.organization.entity.company.bo.CompanyBO;
import com.engine.organization.entity.company.po.CompanyPO;
import com.engine.organization.entity.company.bo.CompBO;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.department.bo.DepartmentBO;
import com.engine.organization.entity.department.po.DepartmentPO;
import com.engine.organization.entity.extend.po.ExtendTitlePO;
@ -32,7 +32,7 @@ import com.engine.organization.entity.searchtree.SearchTreeParams;
import com.engine.organization.enums.LogModuleNameEnum;
import com.engine.organization.enums.OperateTypeEnum;
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
import com.engine.organization.mapper.comp.CompanyMapper;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.extend.ExtendTitleMapper;
import com.engine.organization.mapper.hrmresource.HrmRelationMapper;
@ -149,8 +149,8 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
return MapperProxyFactory.getProxy(DepartmentMapper.class);
}
private CompanyMapper getCompanyMapper() {
return MapperProxyFactory.getProxy(CompanyMapper.class);
private CompMapper getCompMapper() {
return MapperProxyFactory.getProxy(CompMapper.class);
}
private JobMapper getJobMapper() {
@ -543,7 +543,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
if (StringUtil.isEmpty(id) || TYPE_COMP.equals(type)) {
Integer parentCompId = StringUtil.isEmpty(id) ? null : Integer.parseInt(id);
DepartmentPO departmentBuild = DepartmentPO.builder().departmentName(keyword).subCompanyId1(parentCompId).build();
CompanyPO compBuild = CompanyPO.builder().subCompanyName(keyword).supSubComId(parentCompId).build();
CompPO compBuild = CompPO.builder().subCompanyName(keyword).supSubComId(parentCompId).build();
// 所属分部下的岗位
JobPO jobBuild = JobPO.builder().jobName(keyword).parentComp(parentCompId).build();
searchTree = buildTreeByCompAndDept(departmentBuild, compBuild, jobBuild);
@ -574,7 +574,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
* @param jobBuild
* @return
*/
private List<SearchTree> buildTreeByCompAndDept(DepartmentPO departmentBuild, CompanyPO compBuild, JobPO jobBuild) {
private List<SearchTree> buildTreeByCompAndDept(DepartmentPO departmentBuild, CompPO compBuild, JobPO jobBuild) {
List<JobPO> jobPOS = getJobMapper().listPOsByFilter(jobBuild);
new DetachUtil(user.getUID()).filterJobList(jobPOS);
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "showorder");
@ -607,7 +607,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
}
// 查询分部信息
List<CompanyPO> filterComps = getCompanyMapper().listByFilter(compBuild, "showorder");
List<CompPO> filterComps = getCompMapper().listByFilter(compBuild, "showorder");
new DetachUtil(user.getUID()).filterCompanyList(filterComps);
Set<DepartmentPO> builderDeparts = new HashSet<>();
for (DepartmentPO departmentPO : filterDeparts) {
@ -619,19 +619,19 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
// 添加部门的上级分部
String parentCompS = deptTrees.stream().map(SearchTree::getParentComp).collect(Collectors.joining(","));
if (!StringUtil.isEmpty(parentCompS)) {
List<CompanyPO> compsByIds = getCompanyMapper().getCompsByIds(DeleteParam.builder().ids(parentCompS).build().getIds());
List<CompPO> compsByIds = getCompMapper().getCompsByIds(DeleteParam.builder().ids(parentCompS).build().getIds());
if (CollectionUtils.isNotEmpty(compsByIds)) {
filterComps.addAll(compsByIds);
}
}
List<CompanyPO> allCompanys = getCompanyMapper().listAll("showorder");
List<CompPO> allCompanys = getCompMapper().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<>();
for (CompanyPO compPO : filterComps) {
Map<Integer, CompPO> allMaps = allCompanys.stream().collect(Collectors.toMap(CompPO::getId, item -> item, (k1, k2) -> k1));
Set<CompPO> builderComps = new HashSet<>();
for (CompPO compPO : filterComps) {
buildParentComps(compPO, builderComps, allMaps);
}
return SearchTreeUtil.builderTreeMode(CompanyBO.buildSetToSearchTree(builderComps), searchTrees);
return SearchTreeUtil.builderTreeMode(CompBO.buildSetToSearchTree(builderComps), searchTrees);
}
private List<SearchTree> buildTreeByDeptAndJob(DepartmentPO departmentBuild, JobPO jobBuild) {
@ -704,9 +704,9 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
* @param compPO
* @param builderComps
*/
private void buildParentComps(CompanyPO compPO, Set<CompanyPO> builderComps, Map<Integer, CompanyPO> allMaps) {
private void buildParentComps(CompPO compPO, Set<CompPO> builderComps, Map<Integer, CompPO> allMaps) {
builderComps.add(compPO);
CompanyPO parentComp = allMaps.get(compPO.getSupSubComId());
CompPO parentComp = allMaps.get(compPO.getSupSubComId());
if (null != parentComp) {
buildParentComps(parentComp, builderComps, allMaps);
}

@ -22,7 +22,7 @@ import com.engine.organization.enums.LogModuleNameEnum;
import com.engine.organization.enums.OperateTypeEnum;
import com.engine.organization.enums.OrgImportEnum;
import com.engine.organization.exception.OrganizationRunTimeException;
import com.engine.organization.mapper.comp.CompanyMapper;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.employee.EmployeeMapper;
import com.engine.organization.mapper.extend.ExtMapper;
@ -715,7 +715,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
continue nextRow;
}
for (int index = 0; index < split.length - 1; index++) {
parentCompanyId = MapperProxyFactory.getProxy(CompanyMapper.class).getIdByNameAndPid(split[index], parentCompanyId == null ? 0 : parentCompanyId);
parentCompanyId = MapperProxyFactory.getProxy(CompMapper.class).getIdByNameAndPid(split[index], parentCompanyId == null ? 0 : parentCompanyId);
if (null == parentCompanyId) {
historyDetailPO.setOperateDetail(split[index] + "分部未找到对应数据");
historyDetailPO.setStatus("0");
@ -745,7 +745,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
continue;
}
String compNo = (String) map.get("comp_no");
Integer companyId = MapperProxyFactory.getProxy(CompanyMapper.class).getIdByNameAndPid(companyName, parentCompanyId == null ? 0 : parentCompanyId);
Integer companyId = MapperProxyFactory.getProxy(CompMapper.class).getIdByNameAndPid(companyName, parentCompanyId == null ? 0 : parentCompanyId);
if ("add".equals(operateType)) {
if (companyId != null) {
historyDetailPO.setOperateDetail("数据已存在");
@ -772,7 +772,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
}
String showOrder = Util.null2String(map.get("show_order"));
if (StringUtils.isBlank(showOrder)) {
Integer maxShowOrder = MapperProxyFactory.getProxy(CompanyMapper.class).getMaxShowOrder();
Integer maxShowOrder = MapperProxyFactory.getProxy(CompMapper.class).getMaxShowOrder();
if (null == maxShowOrder) {
maxShowOrder = 0;
}
@ -924,7 +924,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
continue nextRow;
}
for (String s : split) {
parentCompanyId = MapperProxyFactory.getProxy(CompanyMapper.class).getIdByNameAndPid(s, parentCompanyId == null ? 0 : parentCompanyId);
parentCompanyId = MapperProxyFactory.getProxy(CompMapper.class).getIdByNameAndPid(s, parentCompanyId == null ? 0 : parentCompanyId);
if (null == parentCompanyId) {
historyDetailPO.setOperateDetail(cellValue + "分部未找到对应数据");
historyDetailPO.setStatus("0");
@ -1162,7 +1162,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
continue nextRow;
}
for (String s : split) {
parentCompanyId = MapperProxyFactory.getProxy(CompanyMapper.class).getIdByNameAndPid(s, parentCompanyId == null ? 0 : parentCompanyId);
parentCompanyId = MapperProxyFactory.getProxy(CompMapper.class).getIdByNameAndPid(s, parentCompanyId == null ? 0 : parentCompanyId);
if (null == parentCompanyId) {
historyDetailPO.setOperateDetail(cellValue + "分部未找到对应数据");
historyDetailPO.setStatus("0");
@ -1426,7 +1426,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
continue nextRow;
}
for (String s : split) {
parentCompanyId = MapperProxyFactory.getProxy(CompanyMapper.class).getIdByNameAndPid(s, parentCompanyId == null ? 0 : parentCompanyId);
parentCompanyId = MapperProxyFactory.getProxy(CompMapper.class).getIdByNameAndPid(s, parentCompanyId == null ? 0 : parentCompanyId);
if (null == parentCompanyId) {
historyDetailPO.setOperateDetail(cellValue + "分部未找到对应数据");
historyDetailPO.setStatus("0");

@ -15,8 +15,8 @@ import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.browser.po.CustomBrowserBean;
import com.engine.organization.entity.codesetting.po.CodeRulePO;
import com.engine.organization.entity.commom.RecordInfo;
import com.engine.organization.entity.company.bo.CompanyBO;
import com.engine.organization.entity.company.po.CompanyPO;
import com.engine.organization.entity.company.bo.CompBO;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.department.bo.DepartmentBO;
import com.engine.organization.entity.department.po.DepartmentPO;
import com.engine.organization.entity.employee.vo.EmployeeTableVO;
@ -33,7 +33,7 @@ import com.engine.organization.entity.searchtree.SearchTreeParams;
import com.engine.organization.enums.LogModuleNameEnum;
import com.engine.organization.enums.OperateTypeEnum;
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
import com.engine.organization.mapper.comp.CompanyMapper;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.extend.ExtDTMapper;
import com.engine.organization.mapper.extend.ExtMapper;
@ -117,8 +117,8 @@ public class JobServiceImpl extends Service implements JobService {
return MapperProxyFactory.getProxy(JobMapper.class);
}
private CompanyMapper getCompanyMapper() {
return MapperProxyFactory.getProxy(CompanyMapper.class);
private CompMapper getCompMapper() {
return MapperProxyFactory.getProxy(CompMapper.class);
}
private DepartmentMapper getDepartmentMapper() {
@ -275,7 +275,7 @@ public class JobServiceImpl extends Service implements JobService {
Map<String, Object> params = new HashMap<>();
// 分部
if (StringUtils.isNotBlank(Util.null2String(param.getSubcompanyid1()))) {
CompanyPO compPO = getCompanyMapper().listById(param.getSubcompanyid1());
CompPO compPO = getCompMapper().listById(param.getSubcompanyid1());
if (null != compPO) {
params.put("parent_comp", compPO.getId());
params.put("ec_company", EcHrmRelationUtil.getEcCompanyId(compPO.getId().toString()));
@ -642,9 +642,9 @@ public class JobServiceImpl extends Service implements JobService {
* @param compPO
* @param builderComps
*/
private void buildParentComps(CompanyPO compPO, Set<CompanyPO> builderComps, Map<Integer, CompanyPO> allMaps) {
private void buildParentComps(CompPO compPO, Set<CompPO> builderComps, Map<Integer, CompPO> allMaps) {
builderComps.add(compPO);
CompanyPO parentComp = allMaps.get(compPO.getSupSubComId());
CompPO parentComp = allMaps.get(compPO.getSupSubComId());
if (null != parentComp && (null == parentComp.getCanceled() || 0 == parentComp.getCanceled())) {
buildParentComps(parentComp, builderComps, allMaps);
}
@ -664,7 +664,7 @@ public class JobServiceImpl extends Service implements JobService {
if (StringUtil.isEmpty(id) || TYPE_COMP.equals(type)) {
Integer parentCompId = StringUtil.isEmpty(id) ? null : Integer.parseInt(id);
DepartmentPO departmentBuild = DepartmentPO.builder().departmentName(keyword).subCompanyId1(parentCompId).canceled(0).build();
CompanyPO compBuild = CompanyPO.builder().subCompanyName(keyword).supSubComId(parentCompId).canceled(0).build();
CompPO compBuild = CompPO.builder().subCompanyName(keyword).supSubComId(parentCompId).canceled(0).build();
searchTree = buildTreeByCompAndDept(departmentBuild, compBuild);
} else if (TYPE_DEPT.equals(type)) {
//
@ -687,11 +687,11 @@ public class JobServiceImpl extends Service implements JobService {
* @param compBuild
* @return
*/
private List<SearchTree> buildTreeByCompAndDept(DepartmentPO departmentBuild, CompanyPO compBuild) {
private List<SearchTree> buildTreeByCompAndDept(DepartmentPO departmentBuild, CompPO compBuild) {
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "showorder");
new DetachUtil(user.getUID()).filterDepartmentList(filterDeparts);
// 查询分部信息
List<CompanyPO> filterComps = getCompanyMapper().listByFilter(compBuild, "showorder");
List<CompPO> filterComps = getCompMapper().listByFilter(compBuild, "showorder");
new DetachUtil(user.getUID()).filterCompanyList(filterComps);
Set<DepartmentPO> builderDeparts = new HashSet<>();
for (DepartmentPO departmentPO : filterDeparts) {
@ -701,19 +701,19 @@ public class JobServiceImpl extends Service implements JobService {
// 添加部门的上级分部
String parentCompS = deptTrees.stream().map(SearchTree::getParentComp).collect(Collectors.joining(","));
if (!StringUtil.isEmpty(parentCompS)) {
List<CompanyPO> compsByIds = getCompanyMapper().getCompsByIds(DeleteParam.builder().ids(parentCompS).build().getIds());
List<CompPO> compsByIds = getCompMapper().getCompsByIds(DeleteParam.builder().ids(parentCompS).build().getIds());
if (CollectionUtils.isNotEmpty(compsByIds)) {
filterComps.addAll(compsByIds);
}
}
List<CompanyPO> allCompanys = getCompanyMapper().listAll("showorder");
List<CompPO> allCompanys = getCompMapper().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<>();
for (CompanyPO compPO : filterComps) {
Map<Integer, CompPO> allMaps = allCompanys.stream().collect(Collectors.toMap(CompPO::getId, item -> item, (k1, k2) -> k1));
Set<CompPO> builderComps = new HashSet<>();
for (CompPO compPO : filterComps) {
buildParentComps(compPO, builderComps, allMaps);
}
return SearchTreeUtil.builderTreeMode(CompanyBO.buildSetToSearchTree(builderComps), deptTrees);
return SearchTreeUtil.builderTreeMode(CompBO.buildSetToSearchTree(builderComps), deptTrees);
}

@ -1,13 +1,13 @@
package com.engine.organization.thread;
import com.engine.organization.entity.company.po.CompanyPO;
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.entity.map.JclOrgMap;
import com.engine.organization.entity.staff.po.StaffPO;
import com.engine.organization.entity.staff.po.StaffPlanPO;
import com.engine.organization.enums.ModuleTypeEnum;
import com.engine.organization.mapper.comp.CompanyMapper;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
import com.engine.organization.mapper.job.JobMapper;
@ -37,8 +37,8 @@ public class StaffTriggerRunnable implements Runnable {
return MapperProxyFactory.getProxy(StaffTriggerMapper.class);
}
private CompanyMapper getCompanyMapper() {
return MapperProxyFactory.getProxy(CompanyMapper.class);
private CompMapper getCompMapper() {
return MapperProxyFactory.getProxy(CompMapper.class);
}
private DepartmentMapper getDepartmentMapper() {
@ -108,7 +108,7 @@ public class StaffTriggerRunnable implements Runnable {
if (null == companyId) {
return;
}
CompanyPO compPO = getCompanyMapper().listById(companyId);
CompPO compPO = getCompMapper().listById(companyId);
if (null != compPO) {
updateOrgMap(ModuleTypeEnum.subcompanyfielddefined.getValue().toString(), companyId.toString());
if (null != compPO.getSupSubComId() && 0 != compPO.getSupSubComId()) {

@ -1,8 +1,8 @@
package com.engine.organization.transmethod;
import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.company.po.CompanyPO;
import com.engine.organization.mapper.comp.CompanyMapper;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.util.db.MapperProxyFactory;
import java.util.List;
@ -17,8 +17,8 @@ import java.util.stream.Collectors;
public class CompTransMethod {
public static String getSpanById(String planId) {
CompanyMapper compMapper = MapperProxyFactory.getProxy(CompanyMapper.class);
List<CompanyPO> maps = compMapper.getCompsByIds(DeleteParam.builder().ids(planId).build().getIds());
return maps.stream().map(CompanyPO::getSubCompanyName).collect(Collectors.joining(","));
CompMapper compMapper = MapperProxyFactory.getProxy(CompMapper.class);
List<CompPO> maps = compMapper.getCompsByIds(DeleteParam.builder().ids(planId).build().getIds());
return maps.stream().map(CompPO::getSubCompanyName).collect(Collectors.joining(","));
}
}

@ -1,6 +1,6 @@
package com.engine.organization.transmethod;
import com.engine.organization.mapper.comp.CompanyMapper;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
import com.engine.organization.mapper.job.JobMapper;
@ -19,7 +19,7 @@ public class HrmResourceTransMethod {
}
public static String getCompanyName(String companyId) {
return MapperProxyFactory.getProxy(CompanyMapper.class).listById(Integer.parseInt(companyId)).getSubCompanyName();
return MapperProxyFactory.getProxy(CompMapper.class).listById(Integer.parseInt(companyId)).getSubCompanyName();
}
public static String getJobName(String jobTitle) {
return MapperProxyFactory.getProxy(JobMapper.class).getJobById(Long.parseLong(jobTitle)).getJobName();

@ -1,6 +1,6 @@
package com.engine.organization.util.detach;
import com.engine.organization.entity.company.po.CompanyPO;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.department.po.DepartmentPO;
import com.engine.organization.entity.job.dto.JobListDTO;
import com.engine.organization.entity.job.po.JobPO;
@ -36,7 +36,7 @@ public class DetachUtil {
/**
*
*/
public void filterCompanyList(List<CompanyPO> companyList) {
public void filterCompanyList(List<CompPO> companyList) {
if (DETACH && CollectionUtils.isNotEmpty(companyList)) {
companyList.removeIf(item -> !jclRoleLevels.contains(item.getId()));
}

@ -1,10 +1,10 @@
package com.engine.organization.util.relation;
import com.engine.organization.entity.commom.RecordInfo;
import com.engine.organization.entity.company.po.CompanyPO;
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.CompanyMapper;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
import com.engine.organization.mapper.job.JobMapper;
@ -28,8 +28,8 @@ public class EcHrmRelationUtil {
return MapperProxyFactory.getProxy(SystemDataMapper.class);
}
private static CompanyMapper getCompanyMapper() {
return MapperProxyFactory.getProxy(CompanyMapper.class);
private static CompMapper getCompMapper() {
return MapperProxyFactory.getProxy(CompMapper.class);
}
private static DepartmentMapper getDepartmentMapper() {
@ -47,7 +47,7 @@ public class EcHrmRelationUtil {
* @return
*/
public static String getEcCompanyId(String companyId) {
CompanyPO compPO = getCompanyMapper().listById(Integer.parseInt(companyId));
CompPO compPO = getCompMapper().listById(Integer.parseInt(companyId));
RecordInfo supSubCompany = getSystemDataMapper().getHrmObjectByUUID(HRM_COMPANY, compPO.getUuid());
if (null == supSubCompany) {
return "0";

@ -10,7 +10,7 @@ import com.engine.organization.entity.staff.bo.StaffBO;
import com.engine.organization.entity.staff.param.StaffSearchParam;
import com.engine.organization.entity.staff.po.StaffPO;
import com.engine.organization.entity.staff.po.StaffPlanPO;
import com.engine.organization.mapper.comp.CompanyMapper;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.job.JobMapper;
import com.engine.organization.mapper.staff.StaffMapper;
@ -151,7 +151,7 @@ public class StaffInfoImportUtil {
continue nextRow;
}
for (String s : split) {
parentCompanyId = MapperProxyFactory.getProxy(CompanyMapper.class).getIdByNameAndPid(s, parentCompanyId == null ? 0 : parentCompanyId);
parentCompanyId = MapperProxyFactory.getProxy(CompMapper.class).getIdByNameAndPid(s, parentCompanyId == null ? 0 : parentCompanyId);
if (null == parentCompanyId) {
historyDetailPO.setOperateDetail(cellValue + "分部未找到对应数据");
historyDetailPO.setStatus("0");

@ -3,7 +3,7 @@ package com.engine.organization.web;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.company.param.CompanyParam;
import com.engine.organization.entity.company.param.CompParam;
import com.engine.organization.entity.department.param.DepartmentMoveParam;
import com.engine.organization.util.response.ReturnResult;
import com.engine.organization.wrapper.CompWrapper;
@ -43,7 +43,7 @@ public class CompController {
@POST
@Path("/listComp")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult listComp(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody CompanyParam params) {
public ReturnResult listComp(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody CompParam params) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getCompWrapper(user).listPage(params));
@ -83,7 +83,7 @@ public class CompController {
@POST
@Path("/updateForbiddenTagById")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult updateForbiddenTagById(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody CompanyParam param) {
public ReturnResult updateForbiddenTagById(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody CompParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getCompWrapper(user).updateForbiddenTagById(param));

@ -4,12 +4,12 @@ import com.alibaba.fastjson.JSON;
import com.api.browser.bean.SearchConditionGroup;
import com.engine.common.util.ServiceUtil;
import com.engine.organization.annotation.Log;
import com.engine.organization.entity.company.param.CompanyParam;
import com.engine.organization.entity.company.po.CompanyPO;
import com.engine.organization.entity.company.param.CompParam;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.department.param.DepartmentMoveParam;
import com.engine.organization.enums.LogModuleNameEnum;
import com.engine.organization.enums.OperateTypeEnum;
import com.engine.organization.mapper.comp.CompanyMapper;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.service.CompService;
import com.engine.organization.service.impl.CompServiceImpl;
import com.engine.organization.util.MenuBtn;
@ -33,8 +33,8 @@ public class CompWrapper extends OrganizationWrapper {
return ServiceUtil.getService(CompServiceImpl.class, user);
}
private CompanyMapper getCompanyMapper() {
return MapperProxyFactory.getProxy(CompanyMapper.class);
private CompMapper getCompMapper() {
return MapperProxyFactory.getProxy(CompMapper.class);
}
/**
@ -43,7 +43,7 @@ public class CompWrapper extends OrganizationWrapper {
* @param params
* @return
*/
public Map<String, Object> listPage(CompanyParam params) {
public Map<String, Object> listPage(CompParam params) {
return getCompService(user).listPage(params);
}
@ -69,10 +69,10 @@ public class CompWrapper extends OrganizationWrapper {
* @param params
*/
@Log(operateType = OperateTypeEnum.UPDATE, operateDesc = "更新分部禁用标识", operateModule = LogModuleNameEnum.COMPANY)
public int updateForbiddenTagById(CompanyParam params) {
CompanyPO compPO = getCompanyMapper().listById(params.getId());
public int updateForbiddenTagById(CompParam params) {
CompPO compPO = getCompMapper().listById(params.getId());
int updateForbiddenTagById = getCompService(user).updateForbiddenTagById(params);
CompanyPO newCompPO = getCompanyMapper().listById(params.getId());
CompPO newCompPO = getCompMapper().listById(params.getId());
writeOperateLog(new Object() {
}.getClass(), compPO.getSubCompanyName(), JSON.toJSONString(params), compPO, newCompPO);
//TODO new Thread(new CompanyTriggerRunnable(compPO, newCompPO)).start();
@ -88,9 +88,9 @@ public class CompWrapper extends OrganizationWrapper {
@Log(operateType = OperateTypeEnum.UPDATE, operateDesc = "更新分部信息", operateModule = LogModuleNameEnum.COMPANY)
public Long updateComp(Map<String, Object> params) {
Integer id = Integer.parseInt(params.get("id").toString());
CompanyPO compPO = getCompanyMapper().listById(id);
CompPO compPO = getCompMapper().listById(id);
Long companyId = getCompService(user).updateComp(params);
CompanyPO newCompPO = getCompanyMapper().listById(id);
CompPO newCompPO = getCompMapper().listById(id);
writeOperateLog(new Object() {
}.getClass(), compPO.getSubCompanyName(), JSON.toJSONString(params), compPO, newCompPO);
//TODO new Thread(new CompanyTriggerRunnable(compPO, newCompPO)).start();
@ -106,9 +106,9 @@ public class CompWrapper extends OrganizationWrapper {
public Map<String, Object> deleteByIds(List<Long> ids) {
Map<String, Object> params = new HashMap<>();
params.put("id", StringUtils.join(ids, ","));
List<CompanyPO> compsByIds = getCompanyMapper().getCompsByIds(ids);
List<CompPO> compsByIds = getCompMapper().getCompsByIds(ids);
Map<String, Object> map = getCompService(user).deleteByIds(params);
for (CompanyPO compsById : compsByIds) {
for (CompPO compsById : compsByIds) {
writeOperateLog(new Object() {
}.getClass(), compsById.getSubCompanyName(), JSON.toJSONString(ids), "删除分部信息");
//TODO new CompanyTriggerRunnable(compsById).run();
@ -124,9 +124,9 @@ public class CompWrapper extends OrganizationWrapper {
*/
@Log(operateType = OperateTypeEnum.MOVE, operateDesc = "转移分部", operateModule = LogModuleNameEnum.COMPANY)
public int moveCompany(DepartmentMoveParam moveParam) {
CompanyPO compPO = getCompanyMapper().listById(moveParam.getId().intValue());
CompPO compPO = getCompMapper().listById(moveParam.getId().intValue());
int moveCompany = getCompService(user).moveCompany(moveParam);
CompanyPO newCompPO = getCompanyMapper().listById(moveParam.getId().intValue());
CompPO newCompPO = getCompMapper().listById(moveParam.getId().intValue());
writeOperateLog(new Object() {
}.getClass(), compPO.getSubCompanyName(), JSON.toJSONString(moveParam), compPO, newCompPO);
//TODO new Thread(new CompanyTriggerRunnable(compPO, newCompPO)).start();

Loading…
Cancel
Save