用户部门筛选bug修改
添加员工逻辑调整(正式/分正式)
This commit is contained in:
+31
-7
@@ -116,10 +116,14 @@
|
|||||||
NULL AS work_strength,
|
NULL AS work_strength,
|
||||||
sus.del_flag,
|
sus.del_flag,
|
||||||
sus.is_sync,
|
sus.is_sync,
|
||||||
NULL AS secondDepartName, -- 对应字段在 sys_user_sub 中不存在,填 NULL
|
parent_depart.depart_name AS secondDepartName,
|
||||||
NULL AS thirdDepartName,
|
direct_depart.depart_name AS thirdDepartName,
|
||||||
NULL AS dep_id,
|
CONCAT(
|
||||||
NULL AS depart_name,
|
IFNULL(parent_depart.depart_name, ''),
|
||||||
|
IF(parent_depart.depart_name IS NOT NULL AND direct_depart.depart_name IS NOT NULL, '->', ''),
|
||||||
|
IFNULL(direct_depart.depart_name, '')
|
||||||
|
) AS departNames,
|
||||||
|
sus.depart_ids as departIds,
|
||||||
sus.username,
|
sus.username,
|
||||||
sus.realname,
|
sus.realname,
|
||||||
sus.avatar,
|
sus.avatar,
|
||||||
@@ -132,24 +136,44 @@
|
|||||||
sus.main_user_relation,
|
sus.main_user_relation,
|
||||||
sus.canteen_id,
|
sus.canteen_id,
|
||||||
sus.status,
|
sus.status,
|
||||||
|
sus.card_code,
|
||||||
|
sus.card_code_status,
|
||||||
sus.remark
|
sus.remark
|
||||||
FROM
|
FROM
|
||||||
sys_user_sub sus
|
sys_user_sub sus
|
||||||
|
LEFT JOIN sys_pay_depart direct_depart
|
||||||
|
ON sus.depart_ids = direct_depart.id
|
||||||
|
AND direct_depart.del_flag = '0'
|
||||||
|
LEFT JOIN sys_pay_depart parent_depart
|
||||||
|
ON direct_depart.parent_id = parent_depart.id
|
||||||
|
AND parent_depart.del_flag = '0'
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
AND sus.user_identity = 6 -- 根据需求过滤条件
|
AND sus.user_identity = 6 -- 根据需求过滤条件
|
||||||
AND sus.del_flag = 0
|
AND sus.del_flag = 0
|
||||||
<if test="(vo.realname == null or vo.realname == '') and (vo.phone == null or vo.phone == '')">
|
|
||||||
and sus.main_user_id is null -- 默认只查询正式员工+非正式员工,搜索姓名或者手机号查询全部用户
|
and sus.main_user_id is null -- 默认只查询正式员工+非正式员工,搜索姓名或者手机号查询全部用户
|
||||||
</if>
|
|
||||||
<if test="vo.realname != null and vo.realname != ''">
|
<if test="vo.realname != null and vo.realname != ''">
|
||||||
and sus.realname like CONCAT('%', #{vo.realname},'%')
|
and sus.realname like CONCAT('%', #{vo.realname},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="vo.phone != null and vo.phone != ''">
|
<if test="vo.phone != null and vo.phone != ''">
|
||||||
and sus.phone = #{vo.phone}
|
and sus.phone = #{vo.phone}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="vo.cardCode != null and vo.cardCode != ''">
|
||||||
|
and sus.card_code like CONCAT('%',#{vo.cardCode,jdbcType=VARCHAR},'%')
|
||||||
|
</if>
|
||||||
|
<if test="vo.cardCodeStatus != null and vo.cardCodeStatus != ''">
|
||||||
|
and sus.card_code_status = #{vo.cardCodeStatus}
|
||||||
|
</if>
|
||||||
<if test="vo.mainUserRelation != null and vo.mainUserRelation != ''">
|
<if test="vo.mainUserRelation != null and vo.mainUserRelation != ''">
|
||||||
and sus.main_ser_relation = #{vo.mainUserRelation}
|
and sus.main_ser_relation = #{vo.mainUserRelation}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="vo.list != null">
|
||||||
|
and sus.depart_ids in
|
||||||
|
<foreach item="departId" collection="vo.list" open="(" separator="," close=")">
|
||||||
|
#{departId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
<if test="vo.userType != null and vo.userType != ''">
|
<if test="vo.userType != null and vo.userType != ''">
|
||||||
and sus.user_type = #{vo.userType}
|
and sus.user_type = #{vo.userType}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
+8
-5
@@ -61,12 +61,15 @@ public class CqBaseEmployeeServiceImpl extends ServiceImpl<CqBaseEmployeeMapper,
|
|||||||
user.setDelFlag(CommonConstant.DEL_FLAG_0);
|
user.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||||
user.setSysOrgCode("A01A54");//20250411 余:同一放采气六厂的,orgCode A01A54
|
user.setSysOrgCode("A01A54");//20250411 余:同一放采气六厂的,orgCode A01A54
|
||||||
user.setUserIdentity(6);
|
user.setUserIdentity(6);
|
||||||
if(StringUtils.isBlank(user.getMainUserId())){
|
if(user.getUserType() == null){
|
||||||
user.setMainUserId(null);
|
if(StringUtils.isBlank(user.getMainUserId())){
|
||||||
user.setUserType(1);//非正式员工
|
user.setMainUserId(null);
|
||||||
} else {
|
user.setUserType(1);//非正式员工
|
||||||
user.setUserType(2);//家庭用户
|
} else {
|
||||||
|
user.setUserType(2);//家庭用户
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Result result1 = sysUserService.saveUserSub(user);
|
Result result1 = sysUserService.saveUserSub(user);
|
||||||
if(result1.getCode() != 200){
|
if(result1.getCode() != 200){
|
||||||
return result1;
|
return result1;
|
||||||
|
|||||||
Reference in New Issue
Block a user