Merge remote-tracking branch 'origin/develop' into feature/ml
This commit is contained in:
commit
5897ae1563
|
|
@ -128,7 +128,7 @@ public class JobBrowserService extends BrowserService {
|
|||
}
|
||||
}
|
||||
// 分权
|
||||
DetachUtil detachUtil = new DetachUtil(user.getUID());
|
||||
DetachUtil detachUtil = new DetachUtil(user);
|
||||
if (detachUtil.isDETACH()) {
|
||||
sqlWhere += " AND t.parent_comp in (" + detachUtil.getJclRoleLevels() + ")";
|
||||
}
|
||||
|
|
@ -143,7 +143,7 @@ public class JobBrowserService extends BrowserService {
|
|||
*/
|
||||
private List<TreeNode> getCurrentTreeNode(SearchTreeParams params) {
|
||||
// 分权
|
||||
DetachUtil detachUtil = new DetachUtil(user.getUID());
|
||||
DetachUtil detachUtil = new DetachUtil(user);
|
||||
List<Long> jclRoleLevelList;
|
||||
if (StringUtils.isNotBlank(detachUtil.getJclRoleLevels())) {
|
||||
jclRoleLevelList = Arrays.stream(detachUtil.getJclRoleLevels().split(",")).map(Long::parseLong).collect(Collectors.toList());
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
package com.api.organization.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/21
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Path("/bs/hrmorganization/detach")
|
||||
public class ManagerDetachController extends com.engine.organization.web.ManagerDetachController {
|
||||
}
|
||||
|
|
@ -110,7 +110,10 @@ public class CompBO {
|
|||
// 处理被引用数据
|
||||
List<String> usedIds = getCompMapper().listUsedId();
|
||||
// 兼容MySQL
|
||||
usedIds.addAll(getCompMapper().listUsedIds());
|
||||
List<String> strings = getCompMapper().listUsedIds();
|
||||
if (CollectionUtils.isNotEmpty(strings)) {
|
||||
usedIds.addAll(strings);
|
||||
}
|
||||
List<String> collect = Arrays.stream(String.join(",", usedIds).split(",")).collect(Collectors.toList());
|
||||
Set<Integer> leafs = new HashSet<>();
|
||||
List<CompListDTO> collectTree = dtoList.stream().peek(e -> {
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
package com.engine.organization.entity.detach.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/25
|
||||
* @Version V1.0
|
||||
**/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ManagerDetachParam {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private Integer managerType;
|
||||
|
||||
private Integer ecManager;
|
||||
|
||||
private Integer jclManager;
|
||||
|
||||
private String ecRolelevel;
|
||||
|
||||
private String jclRolelevel;
|
||||
|
||||
private String manageModule;
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
package com.engine.organization.entity.detach.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/21
|
||||
* @Version V1.0
|
||||
**/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ManagerDetachPO {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 管理员类型
|
||||
*/
|
||||
private Integer managerType;
|
||||
/**
|
||||
* ec管理员
|
||||
*/
|
||||
private Integer ecManager;
|
||||
/**
|
||||
* jcl管理员
|
||||
*/
|
||||
private Integer jclManager;
|
||||
/**
|
||||
* ec分部
|
||||
*/
|
||||
private String ecRolelevel;
|
||||
/**
|
||||
* jcl分部
|
||||
*/
|
||||
private String jclRolelevel;
|
||||
/**
|
||||
* 可管理模块
|
||||
*/
|
||||
private String manageModule;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long creator;
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
private int deleteType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
package com.engine.organization.entity.detach.vo;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.organization.annotation.OrganizationTable;
|
||||
import com.engine.organization.annotation.OrganizationTableColumn;
|
||||
import com.engine.organization.annotation.OrganizationTableOperate;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/21
|
||||
* @Version V1.0
|
||||
**/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@OrganizationTable(pageId = "0bf9b7bc-c8b0-4225-bf28-4cd015d96e98",
|
||||
fields = "t.id," +
|
||||
"t.ec_manager," +
|
||||
"t.ec_rolelevel," +
|
||||
"t.manage_module," +
|
||||
"t.creator," +
|
||||
"t.delete_type," +
|
||||
"t.create_time," +
|
||||
"t.update_time",
|
||||
fromSql = "FROM jcl_org_detach t ",
|
||||
orderby = "id",
|
||||
sortway = "asc",
|
||||
primarykey = "id",
|
||||
operates = {
|
||||
@OrganizationTableOperate(index = "0", text = "编辑"),
|
||||
@OrganizationTableOperate(index = "1", text = "删除")
|
||||
},
|
||||
tableType = WeaTableType.CHECKBOX
|
||||
)
|
||||
public class ManagerDetachVO {
|
||||
|
||||
|
||||
@OrganizationTableColumn(column = "id", display = false)
|
||||
private Long id;
|
||||
|
||||
|
||||
@OrganizationTableColumn(text = "管理员", width = "20%", column = "ec_manager", transmethod = "com.engine.organization.transmethod.ManagerDetachTransMethod.getManagerName")
|
||||
private Integer ecManager;
|
||||
|
||||
@OrganizationTableColumn(text = "可管理组织机构", width = "40%", column = "ec_rolelevel",transmethod = "com.engine.organization.transmethod.ManagerDetachTransMethod.getRoleLevel")
|
||||
private String ecRolelevel;
|
||||
|
||||
|
||||
@OrganizationTableColumn(text = "可管理模块", width = "40%", column = "manage_module")
|
||||
private String manageModule;
|
||||
|
||||
}
|
||||
|
|
@ -68,7 +68,7 @@ public class JobListDTO {
|
|||
//@TableTitle(title = "上级岗位", dataIndex = "parentJobName", key = "parentJobName")
|
||||
private String parentJobName;
|
||||
private Long parentJob;
|
||||
private Integer parentComp;
|
||||
private Integer ecCompany;
|
||||
/**
|
||||
* 是否关键岗
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -75,10 +75,6 @@
|
|||
select ec_company
|
||||
from JCL_ORG_STAFFPLAN
|
||||
where delete_type = 0
|
||||
union
|
||||
select ec_rolelevel
|
||||
from jcl_org_detach
|
||||
where delete_type = 0
|
||||
</select>
|
||||
|
||||
<select id="listChild" resultMap="BaseResultMap">
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
package com.engine.organization.mapper.detach;
|
||||
|
||||
import com.engine.organization.entity.detach.po.ManagerDetachPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/24
|
||||
* @Version V1.0
|
||||
**/
|
||||
public interface ManagerDetachMapper {
|
||||
|
||||
int insertIgnoreNull(ManagerDetachPO managerDetachPO);
|
||||
|
||||
int updateDetach(ManagerDetachPO managerDetachPO);
|
||||
|
||||
int deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
List<ManagerDetachPO> selectByIds(@Param("ids")Collection<Long> ids);
|
||||
|
||||
ManagerDetachPO getDetachById(@Param("id") Integer id);
|
||||
|
||||
List<ManagerDetachPO> getDetachListById(@Param("ecManager") Integer ecManager);
|
||||
}
|
||||
|
|
@ -1,220 +0,0 @@
|
|||
<?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.detach.ManagerDetachMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.organization.entity.detach.po.ManagerDetachPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="manager_type" property="managerType"/>
|
||||
<result column="ec_manager" property="ecManager"/>
|
||||
<result column="jcl_manager" property="jclManager"/>
|
||||
<result column="ec_rolelevel" property="ecRolelevel"/>
|
||||
<result column="jcl_rolelevel" property="jclRolelevel"/>
|
||||
<result column="manage_module" property="manageModule"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t.id
|
||||
, t.manager_type
|
||||
, t.ec_manager
|
||||
, t.jcl_manager
|
||||
, t.ec_rolelevel
|
||||
, t.jcl_rolelevel
|
||||
, t.manage_module
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.detach.po.ManagerDetachPO" keyProperty="id"
|
||||
keyColumn="id" useGeneratedKeys="true">
|
||||
INSERT INTO jcl_org_detach
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="managerType != null ">
|
||||
manager_type,
|
||||
</if>
|
||||
<if test="ecManager != null ">
|
||||
ec_manager,
|
||||
</if>
|
||||
<if test="jclManager != null ">
|
||||
jcl_manager,
|
||||
</if>
|
||||
<if test="ecRolelevel != null ">
|
||||
ec_rolelevel,
|
||||
</if>
|
||||
<if test="jclRolelevel != null ">
|
||||
jcl_rolelevel,
|
||||
</if>
|
||||
<if test="manageModule != null ">
|
||||
manage_module,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="managerType != null ">
|
||||
#{managerType},
|
||||
</if>
|
||||
<if test="ecManager != null ">
|
||||
#{ecManager},
|
||||
</if>
|
||||
<if test="jclManager != null ">
|
||||
#{jclManager},
|
||||
</if>
|
||||
<if test="ecRolelevel != null ">
|
||||
#{ecRolelevel},
|
||||
</if>
|
||||
<if test="jclRolelevel != null ">
|
||||
#{jclRolelevel},
|
||||
</if>
|
||||
<if test="manageModule != null ">
|
||||
#{manageModule},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.detach.po.ManagerDetachPO" databaseId="oracle">
|
||||
<selectKey keyProperty="id" resultType="int" order="AFTER">
|
||||
select JCL_ORG_DETACH_ID.currval from dual
|
||||
</selectKey>
|
||||
INSERT INTO jcl_org_detach
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="managerType != null ">
|
||||
manager_type,
|
||||
</if>
|
||||
<if test="ecManager != null ">
|
||||
ec_manager,
|
||||
</if>
|
||||
<if test="jclManager != null ">
|
||||
jcl_manager,
|
||||
</if>
|
||||
<if test="ecRolelevel != null ">
|
||||
ec_rolelevel,
|
||||
</if>
|
||||
<if test="jclRolelevel != null ">
|
||||
jcl_rolelevel,
|
||||
</if>
|
||||
<if test="manageModule != null ">
|
||||
manage_module,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="managerType != null ">
|
||||
#{managerType},
|
||||
</if>
|
||||
<if test="ecManager != null ">
|
||||
#{ecManager},
|
||||
</if>
|
||||
<if test="jclManager != null ">
|
||||
#{jclManager},
|
||||
</if>
|
||||
<if test="ecRolelevel != null ">
|
||||
#{ecRolelevel},
|
||||
</if>
|
||||
<if test="jclRolelevel != null ">
|
||||
#{jclRolelevel},
|
||||
</if>
|
||||
<if test="manageModule != null ">
|
||||
#{manageModule},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDetach" parameterType="com.engine.organization.entity.detach.po.ManagerDetachPO">
|
||||
update jcl_org_detach
|
||||
<set>
|
||||
ec_manager=#{ecManager},
|
||||
jcl_Manager=#{jclManager},
|
||||
ec_rolelevel=#{ecRolelevel},
|
||||
jcl_rolelevel=#{jclRolelevel}
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<update id="deleteByIds">
|
||||
UPDATE jcl_org_detach
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="selectByIds" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_detach t
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getDetachById" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_detach t
|
||||
WHERE delete_type = 0
|
||||
AND id = #{id}
|
||||
</select>
|
||||
<select id="getDetachListById" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_detach t
|
||||
WHERE delete_type = 0
|
||||
and ec_manager = #{ecManager}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
package com.engine.organization.service;
|
||||
|
||||
import com.engine.organization.entity.detach.param.ManagerDetachParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/21
|
||||
* @Version V1.0
|
||||
**/
|
||||
public interface ManagerDetachService {
|
||||
|
||||
/**
|
||||
* 获取table列表
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> listPage(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 新建编辑表单
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getForm(Integer id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
int deleteByIds(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
int save(ManagerDetachParam param);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
int updateDetach(ManagerDetachParam param);
|
||||
|
||||
/**
|
||||
* 分权开关
|
||||
* @param isDetach
|
||||
*/
|
||||
String doDetach(String isDetach);
|
||||
}
|
||||
|
|
@ -74,13 +74,13 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
String orderSql = PageInfoSortUtil.getSortSql(params.getSortParams(), " showorder ");
|
||||
List<CompPO> allList = getCompMapper().listAll(orderSql);
|
||||
|
||||
new DetachUtil(user.getUID()).filterCompanyList(allList);
|
||||
new DetachUtil(user).filterCompanyList(allList);
|
||||
|
||||
// 通过子级遍历父级元素
|
||||
if (filter) {
|
||||
// 根据条件获取元素
|
||||
List<CompPO> filterCompPOs = getCompMapper().listByFilter(companyPO, orderSql);
|
||||
new DetachUtil(user.getUID()).filterCompanyList(filterCompPOs);
|
||||
new DetachUtil(user).filterCompanyList(filterCompPOs);
|
||||
|
||||
// 添加父级元素
|
||||
List<CompListDTO> compListDTOS = CompBO.buildCompDTOList(allList, filterCompPOs);
|
||||
|
|
|
|||
|
|
@ -133,12 +133,12 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
PageInfo<DepartmentListDTO> pageInfos;
|
||||
String orderSql = PageInfoSortUtil.getSortSql(param.getSortParams(), " showorder ");
|
||||
List<DepartmentPO> allList = getDepartmentMapper().listAll(orderSql);
|
||||
new DetachUtil(user.getUID()).filterDepartmentList(allList);
|
||||
new DetachUtil(user).filterDepartmentList(allList);
|
||||
// 通过子级遍历父级元素
|
||||
if (filter) {
|
||||
// 根据条件获取元素
|
||||
List<DepartmentPO> filterDeptPOs = getDepartmentMapper().listByFilter(departmentPO, orderSql);
|
||||
new DetachUtil(user.getUID()).filterDepartmentList(filterDeptPOs);
|
||||
new DetachUtil(user).filterDepartmentList(filterDeptPOs);
|
||||
// 添加父级元素
|
||||
List<DepartmentListDTO> compListDTOS = DepartmentBO.buildDeptDTOList(allList, filterDeptPOs);
|
||||
List<DepartmentListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), compListDTOS);
|
||||
|
|
@ -705,9 +705,9 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
Integer parentCompId = StringUtil.isEmpty(id) ? null : Integer.parseInt(id);
|
||||
CompPO compBuild = CompPO.builder().subCompanyName(keyword).supSubComId(parentCompId).canceled(0).build();
|
||||
List<CompPO> allCompanys = getCompMapper().listAll("showOrder");
|
||||
new DetachUtil(user.getUID()).filterCompanyList(allCompanys);
|
||||
new DetachUtil(user).filterCompanyList(allCompanys);
|
||||
List<CompPO> filterComps = getCompMapper().listByFilter(compBuild, "showOrder");
|
||||
new DetachUtil(user.getUID()).filterCompanyList(filterComps);
|
||||
new DetachUtil(user).filterCompanyList(filterComps);
|
||||
|
||||
Map<Integer, CompPO> allMaps = allCompanys.stream().collect(Collectors.toMap(CompPO::getId, item -> item, (k1, k2) -> k1));
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ
|
|||
public XSSFWorkbook resourceExport(List<Long> ids) {
|
||||
|
||||
List<HrmResourceVO> hrmResourceVOS ;
|
||||
DetachUtil detachUtil = new DetachUtil(user.getUID());
|
||||
DetachUtil detachUtil = new DetachUtil(user);
|
||||
if (detachUtil.isDETACH()) {
|
||||
if (StringUtils.isBlank(detachUtil.getJclRoleLevels())) {
|
||||
hrmResourceVOS = new ArrayList<>();
|
||||
|
|
|
|||
|
|
@ -473,7 +473,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
}
|
||||
|
||||
// 分权查询
|
||||
DetachUtil detachUtil = new DetachUtil(user.getUID());
|
||||
DetachUtil detachUtil = new DetachUtil(user);
|
||||
String parentCompanyIds = detachUtil.getJclRoleLevels();
|
||||
if (detachUtil.isDETACH()) {
|
||||
sqlWhere += " And t.subcompanyid1 in(" + parentCompanyIds + ")";
|
||||
|
|
@ -521,9 +521,9 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
*/
|
||||
private List<SearchTree> buildTreeByCompAndDept(DepartmentPO departmentBuild, CompPO compBuild, JobPO jobBuild) {
|
||||
List<JobPO> jobPOS = getJobMapper().listPOsByFilter(jobBuild);
|
||||
new DetachUtil(user.getUID()).filterJobList(jobPOS);
|
||||
new DetachUtil(user).filterJobList(jobPOS);
|
||||
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "showorder");
|
||||
new DetachUtil(user.getUID()).filterDepartmentList(filterDeparts);
|
||||
new DetachUtil(user).filterDepartmentList(filterDeparts);
|
||||
// 添加父级岗位
|
||||
Set<JobPO> builderJobs = new HashSet<>();
|
||||
for (JobPO jobPO : jobPOS) {
|
||||
|
|
@ -553,7 +553,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
|
||||
// 查询分部信息
|
||||
List<CompPO> filterComps = getCompMapper().listByFilter(compBuild, "showorder");
|
||||
new DetachUtil(user.getUID()).filterCompanyList(filterComps);
|
||||
new DetachUtil(user).filterCompanyList(filterComps);
|
||||
Set<DepartmentPO> builderDeparts = new HashSet<>();
|
||||
for (DepartmentPO departmentPO : filterDeparts) {
|
||||
buildParentDepts(departmentPO, builderDeparts);
|
||||
|
|
@ -570,7 +570,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
}
|
||||
}
|
||||
List<CompPO> allCompanys = getCompMapper().listAll("showorder");
|
||||
new DetachUtil(user.getUID()).filterCompanyList(allCompanys);
|
||||
new DetachUtil(user).filterCompanyList(allCompanys);
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import com.engine.organization.component.OrganizationWeaTable;
|
|||
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.CompBO;
|
||||
import com.engine.organization.entity.company.po.CompPO;
|
||||
import com.engine.organization.entity.department.bo.DepartmentBO;
|
||||
|
|
@ -29,8 +28,6 @@ import com.engine.organization.entity.job.po.JobPO;
|
|||
import com.engine.organization.entity.scheme.po.GradePO;
|
||||
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.OperateTypeEnum;
|
||||
import com.engine.organization.exception.OrganizationRunTimeException;
|
||||
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
|
|
@ -38,13 +35,11 @@ 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.hrmresource.SystemDataMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.mapper.resource.ResourceMapper;
|
||||
import com.engine.organization.mapper.scheme.GradeMapper;
|
||||
import com.engine.organization.service.ExtService;
|
||||
import com.engine.organization.service.JobService;
|
||||
import com.engine.organization.thread.OrganizationSyncEc;
|
||||
import com.engine.organization.util.*;
|
||||
import com.engine.organization.util.coderule.CodeRuleUtil;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
|
|
@ -102,7 +97,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
|
||||
private static final String RIGHT_NAME = "Job:All";
|
||||
|
||||
public static final String JOB_ACTIVITY_ID;
|
||||
//public static final String JOB_ACTIVITY_ID;
|
||||
|
||||
/**
|
||||
* 岗位主表title指定ID
|
||||
|
|
@ -134,10 +129,10 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
}
|
||||
|
||||
|
||||
static {
|
||||
RecordInfo hrmJobActivity = MapperProxyFactory.getProxy(SystemDataMapper.class).getHrmObjectByUUID("hrmjobactivities", "3a2efce3-95de-4ec2-afe1-347783817bdb");
|
||||
JOB_ACTIVITY_ID = hrmJobActivity.getId();
|
||||
}
|
||||
//static {
|
||||
// RecordInfo hrmJobActivity = MapperProxyFactory.getProxy(SystemDataMapper.class).getHrmObjectByUUID("hrmjobactivities", "3a2efce3-95de-4ec2-afe1-347783817bdb");
|
||||
// JOB_ACTIVITY_ID = hrmJobActivity.getId();
|
||||
//}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSearchTree(SearchTreeParams params) {
|
||||
|
|
@ -161,12 +156,12 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
PageInfo<JobListDTO> pageInfos;
|
||||
String orderSql = PageInfoSortUtil.getSortSql(param.getSortParams(), " show_order ");
|
||||
List<JobListDTO> allList = getJobMapper().listNoFilter(orderSql);
|
||||
new DetachUtil(user.getUID()).filterJobDTOList(allList);
|
||||
new DetachUtil(user).filterJobDTOList(allList);
|
||||
// 通过子级遍历父级元素
|
||||
if (filter) {
|
||||
// 根据条件获取元素
|
||||
List<JobListDTO> filterJobPOs = getJobMapper().listByFilter(jobPO, orderSql);
|
||||
new DetachUtil(user.getUID()).filterJobDTOList(allList);
|
||||
new DetachUtil(user).filterJobDTOList(allList);
|
||||
// 添加父级元素
|
||||
List<JobListDTO> jobListDTOS = JobBO.buildJobDTOList(allList, filterJobPOs);
|
||||
List<JobListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), jobListDTOS);
|
||||
|
|
@ -371,8 +366,8 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
}
|
||||
params.put("show_order", maxShowOrder + 1);
|
||||
}
|
||||
params.put("jobactivityid", JOB_ACTIVITY_ID);
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.ADD, params).sync();
|
||||
//params.put("jobactivityid", JOB_ACTIVITY_ID);
|
||||
//new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.ADD, params).sync();
|
||||
return getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", null);
|
||||
}
|
||||
|
||||
|
|
@ -408,8 +403,8 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
params.put("ec_department", jclDepartment.getId());
|
||||
params.put("ec_company", jclDepartment.getSubCompanyId1());
|
||||
}
|
||||
params.put("jobactivityid", JOB_ACTIVITY_ID);
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.UPDATE, params, oldJobPO).sync();
|
||||
//params.put("jobactivityid", JOB_ACTIVITY_ID);
|
||||
//new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.UPDATE, params, oldJobPO).sync();
|
||||
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", searchParam.getId());
|
||||
|
||||
JobPO jobById = getJobMapper().getJobById(searchParam.getId());
|
||||
|
|
@ -477,7 +472,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
// OrganizationAssert.isTrue(hasResource == 0, "该岗位存在人员,不能封存");
|
||||
throw new OrganizationRunTimeException("该岗位不能封存");
|
||||
}
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobPO).sync();
|
||||
//new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobPO).sync();
|
||||
return getJobMapper().updateForbiddenTagById(jobPO.getId(), jobPO.getForbiddenTag());
|
||||
}
|
||||
|
||||
|
|
@ -488,7 +483,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
List<JobPO> jobsByIds = getJobMapper().getJobsByIds(ids);
|
||||
for (JobPO jobsById : jobsByIds) {
|
||||
jobsById.setForbiddenTag(1);
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobsById).sync();
|
||||
//new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobsById).sync();
|
||||
// 删除拓展表、明细表
|
||||
MapperProxyFactory.getProxy(ExtMapper.class).deleteByID("jcl_org_jobext", jobsById.getId());
|
||||
MapperProxyFactory.getProxy(ExtDTMapper.class).deleteByMainID("jcl_org_jobext_dt1", jobsById.getId(), null);
|
||||
|
|
@ -571,7 +566,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
getJobMapper().updateBaseJob(targetJob);
|
||||
//TODO new JobTriggerRunnable(jobById.getId(), targetJob.getId()).run();
|
||||
// 原岗位删除
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobById).sync();
|
||||
//new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobById).sync();
|
||||
getJobMapper().deleteByIds(Collections.singletonList(jobById.getId()));
|
||||
// 更新组织架构图
|
||||
//TODO new JobTriggerRunnable(jobById).run();
|
||||
|
|
@ -666,10 +661,10 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
*/
|
||||
private List<SearchTree> buildTreeByCompAndDept(DepartmentPO departmentBuild, CompPO compBuild) {
|
||||
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "showorder");
|
||||
new DetachUtil(user.getUID()).filterDepartmentList(filterDeparts);
|
||||
new DetachUtil(user).filterDepartmentList(filterDeparts);
|
||||
// 查询分部信息
|
||||
List<CompPO> filterComps = getCompMapper().listByFilter(compBuild, "showorder");
|
||||
new DetachUtil(user.getUID()).filterCompanyList(filterComps);
|
||||
new DetachUtil(user).filterCompanyList(filterComps);
|
||||
Set<DepartmentPO> builderDeparts = new HashSet<>();
|
||||
for (DepartmentPO departmentPO : filterDeparts) {
|
||||
buildParentDepts(departmentPO, builderDeparts);
|
||||
|
|
@ -684,7 +679,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
}
|
||||
}
|
||||
List<CompPO> allCompanys = getCompMapper().listAll("showorder");
|
||||
new DetachUtil(user.getUID()).filterCompanyList(allCompanys);
|
||||
new DetachUtil(user).filterCompanyList(allCompanys);
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -1,189 +0,0 @@
|
|||
package com.engine.organization.service.impl;
|
||||
|
||||
import com.api.browser.bean.BrowserBean;
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.api.browser.bean.SearchConditionOption;
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.organization.component.OrganizationWeaTable;
|
||||
import com.engine.organization.entity.DeleteParam;
|
||||
import com.engine.organization.entity.detach.param.ManagerDetachParam;
|
||||
import com.engine.organization.entity.detach.po.ManagerDetachPO;
|
||||
import com.engine.organization.entity.detach.vo.ManagerDetachVO;
|
||||
import com.engine.organization.mapper.detach.ManagerDetachMapper;
|
||||
import com.engine.organization.mapper.employee.EmployeeMapper;
|
||||
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
||||
import com.engine.organization.mapper.resource.ResourceMapper;
|
||||
import com.engine.organization.service.ManagerDetachService;
|
||||
import com.engine.organization.util.HasRightUtil;
|
||||
import com.engine.organization.util.OrganizationFormItemUtil;
|
||||
import com.engine.organization.util.db.DBType;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import com.weaver.file.ConfigOperator;
|
||||
import com.weaver.general.BaseBean;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/21
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class ManagerDetachServiceImpl extends Service implements ManagerDetachService {
|
||||
|
||||
|
||||
private static final String RIGHT_NAME = "MangerDeatch:All";
|
||||
|
||||
public ManagerDetachMapper getMangeDetachMapper() {
|
||||
return MapperProxyFactory.getProxy(ManagerDetachMapper.class);
|
||||
}
|
||||
|
||||
public ResourceMapper getResourceMapper() {
|
||||
return MapperProxyFactory.getProxy(ResourceMapper.class);
|
||||
}
|
||||
|
||||
public EmployeeMapper getEmployeeMapper() {
|
||||
return MapperProxyFactory.getProxy(EmployeeMapper.class);
|
||||
}
|
||||
|
||||
public SystemDataMapper getSystemDataMapper(){
|
||||
return MapperProxyFactory.getProxy(SystemDataMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
boolean hasRight = HasRightUtil.hasRight(user, RIGHT_NAME, true);
|
||||
resultMap.put("hasRight", hasRight);
|
||||
if (!hasRight) {
|
||||
return resultMap;
|
||||
}
|
||||
String detach = new BaseBean().getPropValue("hrmOrganization", "detach");
|
||||
resultMap.put("isDetach",detach);
|
||||
OrganizationWeaTable<ManagerDetachVO> table = new OrganizationWeaTable<>(user, ManagerDetachVO.class);
|
||||
String sqlWhere = buildSqlWhere(params);
|
||||
table.setSqlwhere(sqlWhere);
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
resultMap.putAll(result.getResultMap());
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getForm(Integer id) {
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionOption> selectOptions = new ArrayList<>();
|
||||
SearchConditionOption moduleOption = new SearchConditionOption("0", "组织管理",true);
|
||||
selectOptions.add(moduleOption);
|
||||
|
||||
SearchConditionItem ecManager = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, true, "管理员", "1", "ecManager", "");
|
||||
ecManager.setRules("required|string");
|
||||
SearchConditionItem ecRolelevel = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "可维护机构", "194", "ecRolelevel", "");
|
||||
ecRolelevel.setRules("required|string");
|
||||
SearchConditionItem module = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, "可管理模块", "module");
|
||||
module.setViewAttr(1);
|
||||
module.setDetailtype(2);
|
||||
module.setHasBorder(true);
|
||||
if (id != null) {
|
||||
ManagerDetachPO detachById = getMangeDetachMapper().getDetachById(id);
|
||||
BrowserBean manager = ecManager.getBrowserConditionParam();
|
||||
manager.setReplaceDatas(getEmployeeMapper().getBrowserDatas(DeleteParam.builder().ids(String.valueOf(detachById.getEcManager())).build().getIds()));
|
||||
ecManager.setBrowserConditionParam(manager);
|
||||
BrowserBean roleLevel = ecRolelevel.getBrowserConditionParam();
|
||||
roleLevel.setReplaceDatas(getSystemDataMapper().getBrowserDatas(DeleteParam.builder().ids(String.valueOf(detachById.getEcRolelevel())).build().getIds()));
|
||||
ecRolelevel.setBrowserConditionParam(roleLevel);
|
||||
}
|
||||
selectItems.add(ecManager);
|
||||
selectItems.add(ecRolelevel);
|
||||
selectItems.add(module);
|
||||
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
|
||||
apiDatas.put("condition", addGroups);
|
||||
return apiDatas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByIds(Collection<Long> ids) {
|
||||
return getMangeDetachMapper().deleteByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int save(ManagerDetachParam param) {
|
||||
ManagerDetachPO managerDetachPO = ManagerDetachPO.builder()
|
||||
.managerType(0)
|
||||
.ecManager(param.getEcManager())
|
||||
.jclManager(getResourceMapper().getJclResourceId(String.valueOf(param.getEcManager())).intValue())
|
||||
.ecRolelevel(param.getEcRolelevel())
|
||||
.manageModule("组织管理")
|
||||
.creator((long)user.getUID())
|
||||
.deleteType(0)
|
||||
.createTime(new Date())
|
||||
.updateTime(new Date())
|
||||
.build();
|
||||
|
||||
return getMangeDetachMapper().insertIgnoreNull(managerDetachPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateDetach(ManagerDetachParam param) {
|
||||
ManagerDetachPO managerDetachPO = ManagerDetachPO.builder()
|
||||
.id(param.getId())
|
||||
.ecManager(param.getEcManager())
|
||||
.jclManager(getResourceMapper().getJclResourceId(String.valueOf(param.getEcManager())).intValue())
|
||||
.ecRolelevel(param.getEcRolelevel())
|
||||
.build();
|
||||
return getMangeDetachMapper().updateDetach(managerDetachPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String doDetach(String isDetach) {
|
||||
ConfigOperator ConfigOperator = new ConfigOperator();
|
||||
ConfigOperator.setProp("hrmOrganization.properties", "detach", isDetach);
|
||||
return new BaseBean().getPropValue("hrmOrganization", "detach");
|
||||
}
|
||||
|
||||
private String buildSqlWhere(Map<String, Object> params) {
|
||||
DBType dbType = DBType.get(new RecordSet().getDBType());
|
||||
String sqlWhere = " where delete_type = 0";
|
||||
String lastName = (String) params.get("ecManager");
|
||||
List<Long> resourceIds = MapperProxyFactory.getProxy(EmployeeMapper.class).getResourceIds(lastName);
|
||||
String ecManager = StringUtils.join(resourceIds,",");
|
||||
if (StringUtils.isNotBlank(lastName)) {
|
||||
sqlWhere += " AND ec_manager in ("+ecManager+") ";
|
||||
}
|
||||
String ecRolelevel = (String) params.get("ecRolelevel");
|
||||
if (StringUtils.isNotBlank(ecRolelevel)) {
|
||||
sqlWhere += " AND " + dbType.concat("ec_rolelevel") + dbType.like(ecRolelevel);
|
||||
}
|
||||
return sqlWhere;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询当前人员所辖分部JCL_ID
|
||||
* @param uId
|
||||
* @return
|
||||
*/
|
||||
public static List<Integer> getJclRoleLevels(Integer uId) {
|
||||
List<Integer> ecRoleLevels = new ArrayList<>();
|
||||
ManagerDetachMapper mangeDetachMapper = MapperProxyFactory.getProxy(ManagerDetachMapper.class);
|
||||
List<ManagerDetachPO> detachListById = mangeDetachMapper.getDetachListById(uId);
|
||||
for (ManagerDetachPO managerDetachPO : detachListById) {
|
||||
List<Integer> ids = Stream.of(managerDetachPO.getJclRolelevel().split(",")).map(Integer::parseInt).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
ecRoleLevels.addAll(ids);
|
||||
}
|
||||
}
|
||||
return ecRoleLevels;
|
||||
}
|
||||
}
|
||||
|
|
@ -53,7 +53,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
String sql = "select id, fnumber, fname, ftype from jcl_org_map where ftype in (0, 1) ";
|
||||
|
||||
// 分部分权过滤
|
||||
DetachUtil detachUtil = new DetachUtil(user.getUID());
|
||||
DetachUtil detachUtil = new DetachUtil(user);
|
||||
if (detachUtil.isDETACH()) {
|
||||
String jclRoleLevels = detachUtil.getJclRoleLevels();
|
||||
if (StringUtils.isNotBlank(jclRoleLevels)) {
|
||||
|
|
@ -165,7 +165,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
|
||||
private void findCompanyItemByParantId(String id, int currentLevel, String level, RecordSet rs, List<Map<String, Object>> list, String whereSql, boolean expand) {
|
||||
String sql = "select id, fname, ftype, fparentid,fobjid,fecid,fnumber,fisvitual from jcl_org_map " + whereSql;
|
||||
DetachUtil detachUtil = new DetachUtil(user.getUID());
|
||||
DetachUtil detachUtil = new DetachUtil(user);
|
||||
if (detachUtil.isDETACH()) {
|
||||
if ("0".equals(id)) {
|
||||
sql += " and ftype = 1 and fobjid in(" + detachUtil.getJclRoleLevels() + ")";
|
||||
|
|
@ -373,7 +373,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
|
||||
private void findUserItemByParantId(String id, int currentLevel, String level, RecordSet rs, List<Map<String, Object>> list, String whereSql, boolean expand) {
|
||||
String sql = "select t.id, t.fname, t.ftype, t.fparentid, t.fobjparentid, t.fleader, t.fleadername, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber, t.fobjid, t.fecid, t.fleaderlv, t.fleaderst, t.fisvitual from jcl_org_map t " + whereSql;
|
||||
DetachUtil detachUtil = new DetachUtil(user.getUID());
|
||||
DetachUtil detachUtil = new DetachUtil(user);
|
||||
if (detachUtil.isDETACH()) {
|
||||
if ("0".equals(id)) {
|
||||
sql += " and t.ftype = 1 and t.fobjid in(" + detachUtil.getJclRoleLevels() + ")";
|
||||
|
|
|
|||
|
|
@ -4,13 +4,15 @@ 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;
|
||||
import com.engine.organization.service.impl.ManagerDetachServiceImpl;
|
||||
import com.weaver.general.BaseBean;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.hrm.User;
|
||||
import weaver.hrm.moduledetach.ManageDetachComInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
|
|
@ -18,18 +20,21 @@ import java.util.List;
|
|||
* @version: 1.0
|
||||
*/
|
||||
public class DetachUtil {
|
||||
private boolean DETACH = "true".equals(new BaseBean().getPropValue("hrmOrganization", "detach"));
|
||||
private boolean DETACH;
|
||||
|
||||
private final List<Integer> jclRoleLevels;
|
||||
private List<Integer> jclRoleLevels = new ArrayList<>();
|
||||
|
||||
public DetachUtil(Integer uId) {
|
||||
if (1 == uId) {
|
||||
public DetachUtil(User user) {
|
||||
ManageDetachComInfo manageDetachComInfo = new ManageDetachComInfo();
|
||||
DETACH = manageDetachComInfo.isUseManageDetach();
|
||||
if (1 == user.getUID()) {
|
||||
DETACH = false;
|
||||
}
|
||||
if (DETACH) {
|
||||
jclRoleLevels = ManagerDetachServiceImpl.getJclRoleLevels(uId);
|
||||
} else {
|
||||
jclRoleLevels = new ArrayList<>();
|
||||
String detachableSubCompanyIds = manageDetachComInfo.getDetachableSubcompanyIds(user);
|
||||
if (StringUtils.isNotBlank(detachableSubCompanyIds)) {
|
||||
jclRoleLevels = Stream.of(detachableSubCompanyIds.split(",")).map(Integer::parseInt).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -56,7 +61,7 @@ public class DetachUtil {
|
|||
*/
|
||||
public void filterJobDTOList(List<JobListDTO> jobList) {
|
||||
if (DETACH && CollectionUtils.isNotEmpty(jobList)) {
|
||||
jobList.removeIf(item -> !jclRoleLevels.contains(item.getParentComp()));
|
||||
jobList.removeIf(item -> !jclRoleLevels.contains(item.getEcCompany()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,134 +0,0 @@
|
|||
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.detach.param.ManagerDetachParam;
|
||||
import com.engine.organization.util.response.ReturnResult;
|
||||
import com.engine.organization.wrapper.ManagerDetachWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: 模块管理分权
|
||||
* @Date 2022/10/21
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class ManagerDetachController {
|
||||
|
||||
public ManagerDetachWrapper getManagerDetachWrapper(User user) {
|
||||
return ServiceUtil.getService(ManagerDetachWrapper.class,user);
|
||||
}
|
||||
|
||||
|
||||
@GET
|
||||
@Path("/getTable")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult listPage(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
return ReturnResult.successed(getManagerDetachWrapper(user).listPage(map));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GET
|
||||
@Path("/getTableBtn")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getTableBtn(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getManagerDetachWrapper(user).getTableBtn());
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GET
|
||||
@Path("/getSearchCondition")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getSearchCondition(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getManagerDetachWrapper(user).getSearchCondition());
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getForm(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
||||
@QueryParam("id") Integer id) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getManagerDetachWrapper(user).getForm(id));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/deleteByIds")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult deleteByIds(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeleteParam param) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getManagerDetachWrapper(user).deleteByIds(param.getIds()));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@POST
|
||||
@Path("/save")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult saveDetach(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ManagerDetachParam param) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getManagerDetachWrapper(user).save(param));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/update")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult updateDetach(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ManagerDetachParam param) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getManagerDetachWrapper(user).updateDetach(param));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/doDetach")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult doDetach(@Context HttpServletRequest request,@Context HttpServletResponse response,
|
||||
@QueryParam("idDetach") String isDetach) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getManagerDetachWrapper(user).doDetach(isDetach));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
package com.engine.organization.wrapper;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.annotation.Log;
|
||||
import com.engine.organization.entity.detach.param.ManagerDetachParam;
|
||||
import com.engine.organization.entity.detach.po.ManagerDetachPO;
|
||||
import com.engine.organization.enums.LogModuleNameEnum;
|
||||
import com.engine.organization.enums.OperateTypeEnum;
|
||||
import com.engine.organization.mapper.detach.ManagerDetachMapper;
|
||||
import com.engine.organization.service.ManagerDetachService;
|
||||
import com.engine.organization.service.impl.ManagerDetachServiceImpl;
|
||||
import com.engine.organization.util.MenuBtn;
|
||||
import com.engine.organization.util.OrganizationFormItemUtil;
|
||||
import com.engine.organization.util.OrganizationWrapper;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/21
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class ManagerDetachWrapper extends OrganizationWrapper {
|
||||
|
||||
public ManagerDetachService getManagerDetachService(User user) {
|
||||
return ServiceUtil.getService(ManagerDetachServiceImpl.class,user);
|
||||
}
|
||||
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
return getManagerDetachService(user).listPage(params);
|
||||
}
|
||||
|
||||
public Map<String, List<MenuBtn>> getTableBtn() {
|
||||
return MenuBtn.getCommonBtnDatas();
|
||||
}
|
||||
|
||||
public Map<String, Object> getSearchCondition() {
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
SearchConditionItem ecManager = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "管理员名称", "ecManager");
|
||||
SearchConditionItem ecRolelevel = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "可管理组织机构", "164", "ecRolelevel", "");
|
||||
conditionItems.add(ecManager);
|
||||
conditionItems.add(ecRolelevel);
|
||||
addGroups.add(new SearchConditionGroup("高级搜索条件", true, conditionItems));
|
||||
apiDatas.put("conditions", addGroups);
|
||||
return apiDatas;
|
||||
}
|
||||
|
||||
public Map<String, Object> getForm(Integer id) {
|
||||
return getManagerDetachService(user).getForm(id);
|
||||
}
|
||||
|
||||
@Log(operateType = OperateTypeEnum.DELETE,operateModule = LogModuleNameEnum.DETACH,operateDesc = "删除分权数据")
|
||||
public int deleteByIds(Collection<Long> ids) {
|
||||
List<ManagerDetachPO> managerDetachPOS = MapperProxyFactory.getProxy(ManagerDetachMapper.class).selectByIds(ids);
|
||||
int deleteByIds = getManagerDetachService(user).deleteByIds(ids);
|
||||
for (ManagerDetachPO managerDetachPO : managerDetachPOS) {
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), String.valueOf(managerDetachPO.getEcManager()), JSON.toJSONString(ids), "删除等级方案");
|
||||
}
|
||||
return deleteByIds;
|
||||
}
|
||||
|
||||
|
||||
@Log(operateType = OperateTypeEnum.ADD,operateModule = LogModuleNameEnum.DETACH,operateDesc = "新增分权管理员")
|
||||
public int save(ManagerDetachParam param) {
|
||||
int save = getManagerDetachService(user).save(param);
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), String.valueOf(param.getEcManager()), JSON.toJSONString(param), "新增分权管理员");
|
||||
return save;
|
||||
}
|
||||
|
||||
@Log(operateType = OperateTypeEnum.UPDATE, operateModule = LogModuleNameEnum.DETACH, operateDesc = "分权数据更新")
|
||||
public int updateDetach(ManagerDetachParam param) {
|
||||
ManagerDetachPO managerDetachPO = MapperProxyFactory.getProxy(ManagerDetachMapper.class).getDetachById(param.getId());
|
||||
int result = getManagerDetachService(user).updateDetach(param);
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), String.valueOf(managerDetachPO.getEcManager()), JSON.toJSONString(param), managerDetachPO, MapperProxyFactory.getProxy(ManagerDetachMapper.class).getDetachById(param.getId()));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public String doDetach(String isDetach) {
|
||||
return getManagerDetachService(user).doDetach(isDetach);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue