Merge remote-tracking branch 'origin/develop' into feature/ml
# Conflicts: # src/com/engine/organization/service/impl/OrgChartServiceImpl.javapull/39/head
commit
1992c1375d
Binary file not shown.
@ -0,0 +1,74 @@
|
||||
hrmresource_online=hrmresource_online
|
||||
sequenceindex=sequenceindex
|
||||
system_default_col=system_default_col
|
||||
worktask_requestbase=worktask_requestbase
|
||||
indexupdatelog=indexupdatelog
|
||||
uplogs=uplogs
|
||||
dellogs=dellogs
|
||||
ldapsetting=ldapsetting
|
||||
ldapset=ldapset
|
||||
workflowactionview=workflowactionview
|
||||
picture=picture
|
||||
slideElement=slideElement
|
||||
hpOutDataTabSetting=hpOutDataTabSetting
|
||||
hpoutdatasettingaddr=hpoutdatasettingaddr
|
||||
wfex_view=wfex_view
|
||||
hpOutDataSettingDef=hpOutDataSettingDef
|
||||
hpOutDataSettingField=hpOutDataSettingField
|
||||
view_workflowForm_selectAll=view_workflowForm_selectAll
|
||||
QRCodeComInfo=QRCodeComInfo
|
||||
emobileLoginKey=emobileLoginKey
|
||||
rule_base=rule_base
|
||||
rule_expressions=rule_expressions
|
||||
rule_expressionbase=rule_expressionbase
|
||||
rule_maplist=rule_maplist
|
||||
uf_ShopCheckPlanbat=uf_ShopCheckPlanbat
|
||||
uf_problemRegister=uf_problemRegister
|
||||
uf_checkDataSave=uf_checkDataSave
|
||||
uf_ShopCheckPlan=uf_ShopCheckPlan
|
||||
uf_ShopCheckExam=uf_ShopCheckExam
|
||||
uf_shopinfo=uf_shopinfo
|
||||
uf_shopCheck=uf_shopCheck
|
||||
uf_boroughinfo=uf_boroughinfo
|
||||
View_ShopCheck=View_ShopCheck
|
||||
user_tables=user_tables
|
||||
sys.objects=sys.objects
|
||||
USER_TAB_COLUMNS=USER_TAB_COLUMNS
|
||||
syscolumns=syscolumns
|
||||
blog_discuss=blog_discuss
|
||||
kq_format_pool=kq_format_pool
|
||||
kq_report_check=kq_report_check
|
||||
license=license
|
||||
ecologyuplist=ecologyuplist
|
||||
kq_flow_split_leave=kq_flow_split_leave
|
||||
kq_flow_split_evection=kq_flow_split_evection
|
||||
kq_flow_split_out=kq_flow_split_out
|
||||
kq_flow_split_overtime=kq_flow_split_overtime
|
||||
kq_flow_split_other=kq_flow_split_other
|
||||
kq_flow_split_leaveback=kq_flow_split_leaveback
|
||||
KQ_ATT_VACATION=KQ_ATT_VACATION
|
||||
kq_shiftschedule=kq_shiftschedule
|
||||
kq_settings=kq_settings
|
||||
dual=dual
|
||||
user_tab_columns=user_tab_columns
|
||||
syscolumns=syscolumns
|
||||
Information_schema.columns=Information_schema.columns
|
||||
ofs_todo_data=ofs_todo_data
|
||||
SYSIBM.SYSTABLES=SYSIBM.SYSTABLES
|
||||
Information_schema.columns=Information_schema.columns
|
||||
ofs_todo_data=ofs_todo_data
|
||||
information_schema.Tables=information_schema.Tables
|
||||
sysobjects=sysobjects
|
||||
hrmresourcemanager=hrmresourcemanager
|
||||
QRTZ_TRIGGERS=QRTZ_TRIGGERS
|
||||
fullsearch_schemaInfo=fullsearch_schemaInfo
|
||||
Int_WhiteList=Int_WhiteList
|
||||
Int_WhiteList_Mapping=Int_WhiteList_Mapping
|
||||
#kq_format_detail
|
||||
kq_format_detail=kq_format_detail
|
||||
#hrmschedulesign
|
||||
hrmschedulesign=hrmschedulesign
|
||||
#聚才林
|
||||
jcl_org_map=jcl_org_map
|
||||
v_jcl_zdzj=v_jcl_zdzj
|
||||
v_jcl_post=v_jcl_post
|
@ -0,0 +1,2 @@
|
||||
defaultCloseNonStandard151=true
|
||||
detach=true
|
@ -0,0 +1,13 @@
|
||||
package com.api.organization.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/11/1
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Path("/bs/hrmorganization/cardAccess")
|
||||
public class CardAccessController extends com.engine.organization.web.CardAccessController {
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
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 {
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
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;
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
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;
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
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;
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.engine.organization.entity.personnelcard.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/11/1
|
||||
* @Version V1.0
|
||||
**/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CardAccessPO {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private Integer typeId;
|
||||
|
||||
private Integer typeName;
|
||||
|
||||
private Integer status;
|
||||
|
||||
private Integer allPeople;
|
||||
|
||||
private Integer superior;
|
||||
|
||||
private String allSuperior;
|
||||
|
||||
private String custom;
|
||||
|
||||
private Long creator;
|
||||
|
||||
private int deleteType;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.engine.organization.entity.personnelcard.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/11/1
|
||||
* @Version V1.0
|
||||
**/
|
||||
|
||||
|
||||
public class CardAccessVO {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
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);
|
||||
}
|
@ -0,0 +1,224 @@
|
||||
<?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"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</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
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
</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="long" 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>
|
@ -0,0 +1,25 @@
|
||||
package com.engine.organization.mapper.personnelcard;
|
||||
|
||||
import com.engine.organization.entity.detach.po.ManagerDetachPO;
|
||||
import com.engine.organization.entity.personnelcard.po.CardAccessPO;
|
||||
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 CardAccessMapper {
|
||||
|
||||
int insertIgnoreNull(CardAccessPO cardAccessPO);
|
||||
|
||||
int updateCardAccess(CardAccessPO cardAccessPO);
|
||||
|
||||
int deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
ManagerDetachPO selectById(@Param("id") Integer id);
|
||||
}
|
@ -0,0 +1,225 @@
|
||||
<?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.personnelcard.CardAccessMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.organization.entity.personnelcard.po.CardAccessPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="type_id" property="typeId"/>
|
||||
<result column="type_name" property="typeName"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="all_people" property="allPeople"/>
|
||||
<result column="superior" property="superior"/>
|
||||
<result column="all_superior" property="allSuperior"/>
|
||||
<result column="custom" property="custom"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t.id
|
||||
, t.type_id
|
||||
, t.type_name
|
||||
, t.status
|
||||
, t.all_people
|
||||
, t.superior
|
||||
, t.all_superior
|
||||
, t.custom
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.personnelcard.po.CardAccessPO" keyProperty="id"
|
||||
keyColumn="id" useGeneratedKeys="true">
|
||||
INSERT INTO jcl_org_cardaccess
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="typeId != null ">
|
||||
type_id,
|
||||
</if>
|
||||
<if test="typeName != null ">
|
||||
type_name,
|
||||
</if>
|
||||
<if test="status != null ">
|
||||
status,
|
||||
</if>
|
||||
<if test="allPeople != null ">
|
||||
all_people,
|
||||
</if>
|
||||
<if test="superior != null ">
|
||||
superior,
|
||||
</if>
|
||||
<if test="allSuperior != null ">
|
||||
all_superior,
|
||||
</if>
|
||||
<if test="custom != null">
|
||||
custom,
|
||||
</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="typeId != null ">
|
||||
#{typeId},
|
||||
</if>
|
||||
<if test="typeName != null ">
|
||||
#{typeName},
|
||||
</if>
|
||||
<if test="status != null ">
|
||||
#{status},
|
||||
</if>
|
||||
<if test="allPeople != null ">
|
||||
#{allPeople},
|
||||
</if>
|
||||
<if test="superior != null ">
|
||||
#{superior},
|
||||
</if>
|
||||
<if test="allSuperior != null ">
|
||||
#{allSuperior},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="custom != null">
|
||||
#{custom},
|
||||
</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.personnelcard.po.CardAccessPO" databaseId="oracle">
|
||||
<selectKey keyProperty="id" resultType="long" order="AFTER">
|
||||
select JCL_ORG_CARDACCESS_ID.currval from dual
|
||||
</selectKey>
|
||||
INSERT INTO jcl_org_cardaccess
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="typeId != null ">
|
||||
type_id,
|
||||
</if>
|
||||
<if test="typeName != null ">
|
||||
type_name,
|
||||
</if>
|
||||
<if test="status != null ">
|
||||
status,
|
||||
</if>
|
||||
<if test="allPeople != null ">
|
||||
all_people,
|
||||
</if>
|
||||
<if test="superior != null ">
|
||||
superior,
|
||||
</if>
|
||||
<if test="allSuperior != null ">
|
||||
all_superior,
|
||||
</if>
|
||||
<if test="custom != null">
|
||||
custom,
|
||||
</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="typeId != null ">
|
||||
#{typeId},
|
||||
</if>
|
||||
<if test="typeName != null ">
|
||||
#{typeName},
|
||||
</if>
|
||||
<if test="status != null ">
|
||||
#{status},
|
||||
</if>
|
||||
<if test="allPeople != null ">
|
||||
#{allPeople},
|
||||
</if>
|
||||
<if test="superior != null ">
|
||||
#{superior},
|
||||
</if>
|
||||
<if test="allSuperior != null ">
|
||||
#{allSuperior},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="custom != null">
|
||||
#{custom},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCardAccess" parameterType="com.engine.organization.entity.personnelcard.po.CardAccessPO">
|
||||
update jcl_org_cardaccess
|
||||
<set>
|
||||
type_id=#{typeId},
|
||||
type_name=#{typeName},
|
||||
status=#{status},
|
||||
all_people=#{allPeople},
|
||||
all_superior=#{allSuperior},
|
||||
custom=#{custom},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<update id="deleteByIds">
|
||||
UPDATE jcl_org_cardaccess
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_cardaccess t
|
||||
WHERE delete_type = 0
|
||||
AND id = #{id}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,10 @@
|
||||
package com.engine.organization.service;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/11/1
|
||||
* @Version V1.0
|
||||
**/
|
||||
public interface CardAccessService {
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
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);
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.engine.organization.service.impl;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/11/1
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class CardAccessServiceImpl {
|
||||
}
|
@ -0,0 +1,192 @@
|
||||
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.HrmResourceMapper;
|
||||
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
||||
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.engine.organization.util.relation.EcHrmRelationUtil;
|
||||
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 HrmResourceMapper getHrmResourceMapper() {
|
||||
return MapperProxyFactory.getProxy(HrmResourceMapper.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(getHrmResourceMapper().getJclResourceId(String.valueOf(param.getEcManager())).intValue())
|
||||
.ecRolelevel(param.getEcRolelevel())
|
||||
.jclRolelevel(EcHrmRelationUtil.getJclCompanyId(param.getEcRolelevel()) != null ? String.valueOf(EcHrmRelationUtil.getBatchJclCompanyId(param.getEcRolelevel())) : null)
|
||||
.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(getHrmResourceMapper().getJclResourceId(String.valueOf(param.getEcManager())).intValue())
|
||||
.ecRolelevel(param.getEcRolelevel())
|
||||
.jclRolelevel(EcHrmRelationUtil.getJclCompanyId(param.getEcRolelevel()) != null ? String.valueOf(EcHrmRelationUtil.getBatchJclCompanyId(param.getEcRolelevel())) : null)
|
||||
.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 ec_rolelevel " +dbType.like(ecRolelevel);
|
||||
}
|
||||
return sqlWhere;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询当前人员所辖分部JCL_ID
|
||||
* @param uId
|
||||
* @return
|
||||
*/
|
||||
public static List<Long> getJclRoleLevels(Integer uId) {
|
||||
List<Long> ecRoleLevels = new ArrayList<>();
|
||||
ManagerDetachMapper mangeDetachMapper = MapperProxyFactory.getProxy(ManagerDetachMapper.class);
|
||||
List<ManagerDetachPO> detachListById = mangeDetachMapper.getDetachListById(uId);
|
||||
for (ManagerDetachPO managerDetachPO : detachListById) {
|
||||
List<Long> ids = Stream.of(managerDetachPO.getJclRolelevel().split(",")).map(Long::parseLong).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
ecRoleLevels.addAll(ids);
|
||||
}
|
||||
}
|
||||
return ecRoleLevels;
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.engine.organization.transmethod;
|
||||
|
||||
|
||||
import com.engine.organization.entity.DeleteParam;
|
||||
import com.engine.organization.mapper.employee.EmployeeMapper;
|
||||
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/26
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class ManagerDetachTransMethod {
|
||||
|
||||
public static String getManagerName(String ecManager) {
|
||||
String managerName = MapperProxyFactory.getProxy(EmployeeMapper.class).getEmployeeNameById(Long.valueOf(ecManager));
|
||||
return managerName;
|
||||
}
|
||||
|
||||
|
||||
public static String getRoleLevel(String ecRolelevel) {
|
||||
List<Map<String, Object>> maps = MapperProxyFactory.getProxy(SystemDataMapper.class).getBrowserDatas(DeleteParam.builder().ids(ecRolelevel).build().getIds());
|
||||
String names = maps.stream().map(item -> (String) item.get("name")).collect(Collectors.joining(","));
|
||||
return names;
|
||||
}
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package com.engine.organization.util.detach;
|
||||
|
||||
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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/10/28
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class DetachUtil {
|
||||
private boolean DETACH = "true".equals(new BaseBean().getPropValue("hrmOrganization", "detach"));
|
||||
|
||||
private final List<Long> jclRoleLevels;
|
||||
|
||||
public DetachUtil(Integer uId) {
|
||||
if (1 == uId) {
|
||||
DETACH = false;
|
||||
}
|
||||
if (DETACH) {
|
||||
jclRoleLevels = ManagerDetachServiceImpl.getJclRoleLevels(uId);
|
||||
} else {
|
||||
jclRoleLevels = new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分权配置过滤分部
|
||||
*/
|
||||
public void filterCompanyList(List<CompPO> companyList) {
|
||||
if (DETACH && CollectionUtils.isNotEmpty(companyList)) {
|
||||
companyList.removeIf(item -> !jclRoleLevels.contains(item.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分权配置过滤分部
|
||||
*/
|
||||
public void filterDepartmentList(List<DepartmentPO> departmentList) {
|
||||
if (DETACH && CollectionUtils.isNotEmpty(departmentList)) {
|
||||
departmentList.removeIf(item -> !jclRoleLevels.contains(item.getParentComp()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分权配置过滤分部
|
||||
*/
|
||||
public void filterJobDTOList(List<JobListDTO> jobList) {
|
||||
if (DETACH && CollectionUtils.isNotEmpty(jobList)) {
|
||||
jobList.removeIf(item -> !jclRoleLevels.contains(item.getParentComp()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分权配置过滤分部
|
||||
*/
|
||||
public void filterJobList(List<JobPO> jobList) {
|
||||
if (DETACH && CollectionUtils.isNotEmpty(jobList)) {
|
||||
jobList.removeIf(item -> !jclRoleLevels.contains(item.getParentComp()));
|
||||
}
|
||||
}
|
||||
|
||||
public String getJclRoleLevels() {
|
||||
return StringUtils.join(jclRoleLevels, ",");
|
||||
}
|
||||
|
||||
public boolean isDETACH() {
|
||||
return DETACH;
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.engine.organization.web;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/11/1
|
||||
* @Version V1.0
|
||||
**/
|
||||
|
||||
public class CardAccessController {
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
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 listScheme(@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 saveScheme(@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 updateScheme(@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);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.engine.organization.wrapper;
|
||||
|
||||
import com.engine.organization.util.OrganizationWrapper;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/11/1
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class CardAccessWrapper extends OrganizationWrapper {
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
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