mg
2022-10-28 d4f9e73dc6f275a44b45afa13b5af4bf45cae073
用戶表刪除部门Id逻辑修改
7个文件已修改
118 ■■■■ 已修改文件
ycl-common/src/main/java/com/ycl/entity/user/UmsAdmin.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/mapper/user/UmsAdminMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/service/user/impl/UmsAdminServiceImpl.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/resources/mapper/user/UmsAdminMapper.xml 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/mapper/caseHandler/BaseCaseMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/mapper/caseHandler/PartyInfoMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/mapper/caseHandler/ViolationsMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/entity/user/UmsAdmin.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ycl.entity.depart.UmsDepart;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
@@ -75,9 +76,6 @@
    @ApiModelProperty(value = "职务")
    private String jobTitle;
    @ApiModelProperty(value = "部门id")
    private Long departmentId;
    @ApiModelProperty(value = "部门名称")
    @TableField(exist = false)
    private String departName;
@@ -94,8 +92,11 @@
    @ApiModelProperty(value = "是否为网格管理员:0->不是;1->是")
    private Integer isGrid;
    @ApiModelProperty(value = "角色列表")
    @TableField(exist = false)
    private UmsDepart depart;
    @ApiModelProperty(value = "角色列表")
    @TableField(exist = false)
    private List<UmsRole> roles;
}
ycl-common/src/main/java/com/ycl/mapper/user/UmsAdminMapper.java
@@ -1,7 +1,9 @@
package com.ycl.mapper.user;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ycl.entity.user.UmsAdmin;
import com.ycl.vo.user.UserVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -21,4 +23,6 @@
     */
    List<Long> getAdminIdList(@Param("resourceId") Long resourceId);
    Page<UmsAdmin> selectCondPage(@Param("page") Page<UmsAdmin> page, @Param("umsAdmin") UserVO.PageUserVO pageUserVO);
}
ycl-common/src/main/java/com/ycl/service/user/impl/UmsAdminServiceImpl.java
@@ -10,7 +10,6 @@
import com.ycl.bo.AdminUserDetails;
import com.ycl.dto.UmsAdminParam;
import com.ycl.dto.UpdateAdminPasswordParam;
import com.ycl.entity.depart.UmsDepart;
import com.ycl.entity.user.*;
import com.ycl.exception.ApiException;
import com.ycl.exception.Asserts;
@@ -24,10 +23,8 @@
import com.ycl.utils.SpringUtil;
import com.ycl.utils.common.LiveTimeMillisecond;
import com.ycl.utils.common.MacUtils;
import com.ycl.utils.common.PojoUtils;
import com.ycl.utils.redis.RedisKey;
import com.ycl.vo.user.UserVO;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
@@ -159,7 +156,7 @@
        //添加部门
        UmsDepartManage departManage = new UmsDepartManage();
        departManage.setUserId(umsAdmin.getId());
        departManage.setDepartId(umsAdmin.getDepartmentId());
        departManage.setDepartId(umsAdminParam.getDepartmentId());
        departManage.setCreateTime(new Date());
        departManage.setUpdateTime(new Date());
        umsDepartManageMapper.insert(departManage);
@@ -349,7 +346,7 @@
        int pageSize = pageUserVO.getPageSize();
        int current = pageUserVO.getCurrent();
        Page<UmsAdmin> page = new Page<>(current, pageSize);
        LambdaQueryWrapper<UmsAdmin> queryWrapper = new LambdaQueryWrapper<>();
       /* LambdaQueryWrapper<UmsAdmin> queryWrapper = new LambdaQueryWrapper<>();
        if (StringUtils.isNotBlank(pageUserVO.getKeyword())) {
            queryWrapper.like(UmsAdmin::getUsername, pageUserVO.getKeyword())
@@ -361,23 +358,9 @@
        }
        if (PojoUtils.Vo.isUsefulSearchParam(pageUserVO.getUserType())) {
            queryWrapper.eq(UmsAdmin::getUserType, pageUserVO.getUserType());
        }
        if (PojoUtils.Vo.isUsefulSearchParam(pageUserVO.getDepartmentId())) {
            queryWrapper.eq(UmsAdmin::getDepartmentId, pageUserVO.getDepartmentId());
        }
        Page<UmsAdmin> page1 = baseMapper.selectPage(page, queryWrapper);
        List<UmsAdmin> records = page1.getRecords();
        if (CollUtil.isNotEmpty(records)) {
            records.forEach(e -> {
                UmsDepart umsDepart = departService.getById(e.getDepartmentId());
                if (null != umsDepart) {
                    e.setDepartName(umsDepart.getDepartName());
                }
                //获取角色列表
                List<UmsRole> roles = umsRoleMapper.getRoleList(e.getId());
                e.setRoles(roles);
            });
        }
        }*/
        Page<UmsAdmin> page1 = baseMapper.selectCondPage(page,pageUserVO);
        return page1;
    }
ycl-common/src/main/resources/mapper/user/UmsAdminMapper.xml
@@ -18,10 +18,31 @@
        <result column="ip_address" property="ipAddress"/>
        <result column="is_dy" property="isDy"/>
        <result column="job_title" property="jobTitle"/>
        <result column="department_id" property="departmentId"/>
        <result column="user_type" property="userType"/>
        <result column="zj" property="zj"/>
        <result column="mobile" property="mobile"/>
    </resultMap>
    <resultMap type="com.ycl.entity.user.UmsAdmin" id="CondMapResultMap" extends="BaseResultMap">
        <association property="depart" javaType="com.ycl.entity.depart.UmsDepart">
            <id column="depart_id" property="id"/>
            <result column="depart_name" property="departName"/>
            <result column="depart_des" property="departDes"/>
            <result column="depart_type" property="departType"/>
            <result column="parent_id" property="parentId"/>
            <result column="depart_status" property="status"/>
            <result column="depart_create_time" property="createTime"/>
            <result column="depart_update_time" property="updateTime"/>
            <result column="is_deleted" property="isDeleted"/>
        </association>
        <collection property="roles" javaType="ArrayList" ofType="com.ycl.entity.user.UmsRole">
            <id column="role_id" property="id" />
            <result column="name" property="name" />
            <result column="description" property="description" />
            <result column="admin_count" property="adminCount" />
            <result column="role_create_time" property="createTime" />
            <result column="role_status" property="status" />
            <result column="sort" property="sort" />
        </collection>
    </resultMap>
    <select id="getAdminIdList" resultType="java.lang.Long">
@@ -31,4 +52,45 @@
        WHERE rr.resource_id = #{resourceId}
    </select>
    <select id="selectCondPage" parameterType="com.ycl.entity.user.UmsAdmin" resultMap="CondMapResultMap">
        SELECT
            ua.*,
            ud.id depart_id,
            ud.depart_name,
            ud.depart_des,
            ud.depart_type,
            ud.parent_id,
            ud.create_time depat_create_time,
            ud.update_time depat_update_time,
            ud.STATUS depart_status,
            ud.is_deleted,
            ur.id role_id,
            ur.id NAME,
            ur.description,
            ur.admin_count,
            ur.create_time role_create_time,
            ur.STATUS role_status,
            ur.sort
        FROM
            ums_admin ua
                LEFT JOIN ums_depart_manager udm ON ua.id = udm.user_id
                LEFT JOIN ums_depart ud ON udm.depart_id = ud.id
                LEFT JOIN ums_admin_role_relation uarr ON ua.id = uarr.admin_id
                LEFT JOIN ums_role ur ON uarr.role_id = ur.id
        where 1=1
        <if test="umsAdmin.keyword !=null and umsAdmin.keyword =''">
            AND (ua.username LIKE concat('%',#{umsAdmin.keyword,jdbcType=VARCHAR},'%')
                     or ua.nick_name LIKE concat('%',#{umsAdmin.keyword,jdbcType=VARCHAR},'%')
                     or ua.mobile ua.nick_name LIKE concat('%',#{umsAdmin.keyword,jdbcType=VARCHAR},'%'))
        </if>
        <if test="umsAdmin.userType !=null and umsAdmin.userType >=0 ">
            AND ua.user_type = #{umsAdmin.userType}
        </if>
        <if test="umsAdmin.jobTitle !=null and umsAdmin.jobTitle=''">
            AND ua.job_title = #{umsAdmin.jobTitle}
        </if>
        ORDER BY
            ua.id DESC
    </select>
</mapper>
ycl-platform/src/main/resources/mapper/caseHandler/BaseCaseMapper.xml
@@ -116,7 +116,7 @@
               usr2.region_name community_text,
               ua.username      create_user_text
        FROM ums_base_case ubc
                 LEFT JOIN ums_data_dictionary udd on ubc.category = udd.id and udd.type_code = '01'
                 LEFT JOIN ums_data_dictionary udd on ubc.category = udd.id
                 LEFT JOIN ums_sccg_region usr on ubc.street_id = usr.id
                 LEFT JOIN ums_sccg_region usr2 on ubc.community_id = usr2.id
                 LEFT JOIN ums_admin ua on ubc.create_user = ua.id
ycl-platform/src/main/resources/mapper/caseHandler/PartyInfoMapper.xml
@@ -38,9 +38,9 @@
            udd3.name nation_text
        FROM
            ums_party_info upi
                LEFT JOIN ums_data_dictionary udd on upi.certificate_type = udd.id and udd.type_code = '03'
                LEFT JOIN ums_data_dictionary udd2 on upi.education_degree = udd2.id and udd2.type_code = '04'
                LEFT JOIN ums_data_dictionary udd3 on upi.nation = udd3.id and udd3.type_code = '05'
                LEFT JOIN ums_data_dictionary udd on upi.certificate_type = udd.id
                LEFT JOIN ums_data_dictionary udd2 on upi.education_degree = udd2.id
                LEFT JOIN ums_data_dictionary udd3 on upi.nation = udd3.id
        WHERE
            upi.`id` = #{id}
    </select>
ycl-platform/src/main/resources/mapper/caseHandler/ViolationsMapper.xml
@@ -34,9 +34,9 @@
            udd3.name grade_text
        FROM
            ums_violations uv
                LEFT JOIN ums_data_dictionary udd on uv.category_id = udd.id and udd.type_code = '01'
                LEFT JOIN ums_data_dictionary udd2 on uv.type_id = udd2.id and udd2.type_code = '01'
                LEFT JOIN ums_data_dictionary udd3 on uv.grade_id = udd3.id and udd3.type_code = '02'
                LEFT JOIN ums_data_dictionary udd on uv.category_id = udd.id
                LEFT JOIN ums_data_dictionary udd2 on uv.type_id = udd2.id
                LEFT JOIN ums_data_dictionary udd3 on uv.grade_id = udd3.id
        WHERE
            uv.`id` =  #{id}
    </select>