Pu Zhibing
2025-02-24 f703e6ebceac409876e6a4af3da436b3b1ec927c
修改管理后台登录和鉴权逻辑
22个文件已修改
2个文件已删除
136 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/sangeshenbian/SystemUserVo.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/sangeshenbian/SystemUserService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_dlz/target/classes/com/panzhihua/service_dlz/ServiceDlzApplication.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_dlz/target/classes/com/panzhihua/service_dlz/controller/CommonController.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/BannerController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/DepartmentController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/MessageNotificationController.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/ProblemTypeController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemMenuController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemRoleController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemUserController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/WorkOrderItemConfigController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/BannerMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/DepartmentMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/MessageNotificationMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/ProblemTypeMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/SystemMenuMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/SystemRoleMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/SystemRoleMenuMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/WorkOrderItemConfigMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/MessageNotification.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/SystemUser.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/warpper/MessageNotificationList.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/MessageNotificationMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/sangeshenbian/SystemUserVo.java
@@ -1,8 +1,5 @@
package com.panzhihua.common.model.vos.sangeshenbian;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -19,120 +16,100 @@
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "数据ID")
    private Integer id;
    /**
     * 姓名
     */
    @TableField("name")
    @ApiModelProperty(value = "姓名", required = true)
    private String name;
    /**
     * 手机号
     */
    @TableField("phone")
    @ApiModelProperty(value = "手机号", required = true)
    private String phone;
    /**
     * 密码
     */
    @TableField("password")
    @ApiModelProperty(value = "密码", required = true)
    private String password;
    /**
     * 一级单位id
     */
    @TableField("one_department_id")
    @ApiModelProperty(value = "一级单位id", required = true)
    private Integer oneDepartmentId;
    /**
     * 二级单位id
     */
    @TableField("two_department_id")
    @ApiModelProperty(value = "二级单位id")
    private Integer twoDepartmentId;
    /**
     * 三级单位id
     */
    @TableField("three_department_id")
    @ApiModelProperty(value = "三级单位id")
    private Integer threeDepartmentId;
    /**
     * 四级单位id
     */
    @TableField("four_department_id")
    @ApiModelProperty(value = "四级单位id")
    private Integer fourDepartmentId;
    /**
     * 是否是管理员(0=否,1=是)
     */
    @TableField("is_admin")
    @ApiModelProperty(value = "是否是管理员(0=否,1=是)", required = true)
    private Integer isAdmin;
    /**
     * 职位id
     */
    @TableField("system_post_id")
    @ApiModelProperty(value = "职位id", required = true)
    private Integer systemPostId;
    /**
     * 角色id
     */
    @TableField("system_role_id")
    @ApiModelProperty(value = "角色id", required = true)
    private Integer systemRoleId;
    /**
     * 账号层级(1=市级账号,2=区县账号,3=街道账号,4=社区账号)
     */
    @TableField("account_level")
    @ApiModelProperty(value = "账号层级(1=市级账号,2=区县账号,3=街道账号,4=社区账号)", required = true)
    private Integer accountLevel;
    /**
     * 所属区县
     */
    @TableField("districts")
    @ApiModelProperty(value = "所属区县")
    private String districts;
    /**
     * 区县编号
     */
    @TableField("districts_code")
    @ApiModelProperty(value = "区县编号")
    private String districtsCode;
    /**
     * 街道
     */
    @TableField("street")
    @ApiModelProperty(value = "街道")
    private String street;
    /**
     * 街道编号
     */
    @TableField("street_code")
    @ApiModelProperty(value = "街道编号")
    private String streetCode;
    /**
     * 社区
     */
    @TableField("community")
    @ApiModelProperty(value = "社区")
    private String community;
    /**
     * 社区编号
     */
    @TableField("community_code")
    @ApiModelProperty(value = "社区编号")
    private String communityCode;
    /**
     * 状态(1=正常,2=冻结,3=删除)
     */
    @TableField("status")
    private Integer status;
    /**
     * 添加时间
     */
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
    
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/sangeshenbian/SystemUserService.java
@@ -21,6 +21,6 @@
     *            用户的ID
     * @return 用户所有角色
     */
    @PostMapping("/sangeshenbian/sangeshenbian/getUserById")
    @PostMapping("/systemUser/getUserById")
    R<SystemUserVo> getUserById(@RequestParam("id") String id);
}
springcloud_k8s_panzhihuazhihuishequ/service_dlz/target/classes/com/panzhihua/service_dlz/ServiceDlzApplication.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/service_dlz/target/classes/com/panzhihua/service_dlz/controller/CommonController.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/BannerController.java
@@ -24,7 +24,7 @@
 */
@Api
@RestController
@RequestMapping("/sangeshenbian/banner")
@RequestMapping("/banner")
public class BannerController extends BaseController {
    
    @Resource
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/DepartmentController.java
@@ -23,7 +23,7 @@
 */
@Api
@RestController
@RequestMapping("/sangeshenbian/department")
@RequestMapping("/department")
public class DepartmentController {
    
    @Resource
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/MessageNotificationController.java
@@ -5,6 +5,7 @@
import com.panzhihua.common.interfaces.OperLog;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.sangeshenbian.model.MessageNotification;
import com.panzhihua.sangeshenbian.model.SystemUser;
import com.panzhihua.sangeshenbian.service.IMessageNotificationService;
import com.panzhihua.sangeshenbian.service.ISystemUserService;
import com.panzhihua.sangeshenbian.warpper.MessageNotificationList;
@@ -21,7 +22,7 @@
@Api
@RestController
@RequestMapping("/sangeshenbian/messageNotification")
@RequestMapping("/messageNotification")
public class MessageNotificationController extends BaseController {
    
    @Resource
@@ -30,10 +31,32 @@
    @Resource
    private ISystemUserService systemUserService;
    
    @GetMapping("/list")
    @ApiOperation(value = "获取消息通知列表", tags = {"三个身边后台-消息通知"})
    @OperLog(operModul = "三个身边后台",operType = 0, businessType = "获取消息通知列表")
    public R<IPage<MessageNotification>> list(MessageNotificationList query) {
        Integer id = this.getLoginUserInfoSanGeShenBian().getId();
        SystemUser systemUser = systemUserService.getById(id);
        switch (systemUser.getAccountLevel()){
            case 1:
                query.setUserId("510400");
                break;
            case 2:
                query.setUserId(systemUser.getDistrictsCode());
                break;
            case 3:
                query.setUserId(systemUser.getStreetId().toString());
                break;
            case 4:
                query.setUserId(systemUser.getCommunityId().toString());
                break;
            case 5:
                query.setUserId(id.toString());
                break;
        }
        query.setUndertakerType(systemUser.getAccountLevel());
        IPage<MessageNotification> page = messageNotificationService.list(query);
        return R.ok(page);
    }
@@ -57,9 +80,30 @@
    @ApiOperation(value = "获取未读数量", tags = {"三个身边后台-消息通知"})
    @OperLog(operModul = "三个身边后台",operType = 0, businessType = "获取未读数量")
    public R unreadCount() {
        Integer id = this.getLoginUserInfoSanGeShenBian().getId();
        SystemUser systemUser = systemUserService.getById(id);
        String userId = null;
        switch (systemUser.getAccountLevel()){
            case 1:
                userId = "510400";
                break;
            case 2:
                userId = systemUser.getDistrictsCode();
                break;
            case 3:
                userId = systemUser.getStreetId().toString();
                break;
            case 4:
                userId = systemUser.getCommunityId().toString();
                break;
            case 5:
                userId = id.toString();
                break;
        }
        Integer count = messageNotificationService.lambdaQuery()
                .eq(MessageNotification::getReadStatus, 0)
                .eq(MessageNotification::getUndertakerUserId, getUserId())
                .eq(MessageNotification::getUndertakerType, systemUser.getAccountLevel())
                .eq(MessageNotification::getUndertakerUserId, userId)
                .count();
        return R.ok(count);
    }
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/ProblemTypeController.java
@@ -25,7 +25,7 @@
 */
@Api
@RestController
@RequestMapping("/sangeshenbian/problemType")
@RequestMapping("/problemType")
public class ProblemTypeController extends BaseController {
    
    @Resource
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemMenuController.java
@@ -7,7 +7,6 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -20,7 +19,7 @@
 */
@Api
@RestController
@RequestMapping("/sangeshenbian/systemMenu")
@RequestMapping("/systemMenu")
public class SystemMenuController {
    
    @Resource
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemRoleController.java
@@ -25,7 +25,7 @@
 */
@Api
@RestController
@RequestMapping("/sangeshenbian/systemRole")
@RequestMapping("/systemRole")
public class SystemRoleController extends BaseController {
    
    @Resource
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemUserController.java
@@ -40,7 +40,7 @@
 */
@Api
@RestController
@RequestMapping("/sangeshenbian/systemUser")
@RequestMapping("/systemUser")
public class SystemUserController extends BaseController {
    
    @Resource
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/WorkOrderItemConfigController.java
@@ -16,7 +16,7 @@
 */
@Api
@RestController
@RequestMapping("/sangeshenbian/workOrderItemConfig")
@RequestMapping("/workOrderItemConfig")
public class WorkOrderItemConfigController {
    
    @Resource
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/BannerMapper.java
@@ -4,12 +4,14 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.sangeshenbian.model.Banner;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
 * @author zhibing.pu
 * @Date 2025/2/23 2:44
 */
@Mapper
public interface BannerMapper extends BaseMapper<Banner> {
    
    
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/DepartmentMapper.java
@@ -2,10 +2,12 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panzhihua.sangeshenbian.model.Department;
import org.apache.ibatis.annotations.Mapper;
/**
 * @author zhibing.pu
 * @Date 2025/2/19 17:42
 */
@Mapper
public interface DepartmentMapper extends BaseMapper<Department> {
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/MessageNotificationMapper.java
@@ -5,12 +5,14 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.sangeshenbian.model.MessageNotification;
import com.panzhihua.sangeshenbian.warpper.MessageNotificationList;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
 * @author zhibing.pu
 * @Date 2025/2/23 3:03
 */
@Mapper
public interface MessageNotificationMapper extends BaseMapper<MessageNotification> {
    
    
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/ProblemTypeMapper.java
@@ -4,12 +4,14 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.sangeshenbian.model.ProblemType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
 * @author zhibing.pu
 * @Date 2025/2/23 2:25
 */
@Mapper
public interface ProblemTypeMapper extends BaseMapper<ProblemType> {
    
    
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/SystemMenuMapper.java
@@ -2,10 +2,12 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panzhihua.sangeshenbian.model.SystemMenu;
import org.apache.ibatis.annotations.Mapper;
/**
 * @author zhibing.pu
 * @Date 2025/2/23 1:02
 */
@Mapper
public interface SystemMenuMapper extends BaseMapper<SystemMenu> {
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/SystemRoleMapper.java
@@ -5,6 +5,7 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.sangeshenbian.model.SystemRole;
import com.panzhihua.sangeshenbian.warpper.SystemRoleListVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -13,6 +14,7 @@
 * @author zhibing.pu
 * @Date 2025/2/19 16:40
 */
@Mapper
public interface SystemRoleMapper extends BaseMapper<SystemRole> {
    
    
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/SystemRoleMenuMapper.java
@@ -2,10 +2,12 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panzhihua.sangeshenbian.model.SystemRoleMenu;
import org.apache.ibatis.annotations.Mapper;
/**
 * @author zhibing.pu
 * @Date 2025/2/19 17:24
 */
@Mapper
public interface SystemRoleMenuMapper extends BaseMapper<SystemRoleMenu> {
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/WorkOrderItemConfigMapper.java
@@ -2,10 +2,12 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panzhihua.sangeshenbian.model.WorkOrderItemConfig;
import org.apache.ibatis.annotations.Mapper;
/**
 * @author zhibing.pu
 * @Date 2025/2/23 2:06
 */
@Mapper
public interface WorkOrderItemConfigMapper extends BaseMapper<WorkOrderItemConfig> {
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/MessageNotification.java
@@ -35,7 +35,13 @@
     */
    @TableField("undertaker_user_id")
    @ApiModelProperty("承办者用户id")
    private Integer undertakerUserId;
    private String undertakerUserId;
    /**
     * 承办人类型(1=市级,2=区县,3=街道,4=社区,5=党员)
     */
    @TableField("undertaker_type")
    @ApiModelProperty("承办人类型(1=市级,2=区县,3=街道,4=社区,5=党员)")
    private Integer undertakerType;
    /**
     * 承办者
     */
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/SystemUser.java
@@ -89,7 +89,7 @@
     * 账号层级(1=市级账号,2=区县账号,3=街道账号,4=社区账号)
     */
    @TableField("account_level")
    @ApiModelProperty(value = "账号层级(1=市级账号,2=区县账号,3=街道账号,4=社区账号)", required = true)
    @ApiModelProperty(value = "账号层级(1=市级账号,2=区县账号,3=街道账号,4=社区账号,5=党员账号)", required = true)
    private Integer accountLevel;
    /**
     * 所属区县
@@ -110,11 +110,11 @@
    @ApiModelProperty(value = "街道")
    private String street;
    /**
     * 街道编号
     * 街道ID
     */
    @TableField("street_code")
    @ApiModelProperty(value = "街道编号")
    private String streetCode;
    @TableField("street_id")
    @ApiModelProperty(value = "街道ID")
    private Integer streetId;
    /**
     * 社区
     */
@@ -122,11 +122,11 @@
    @ApiModelProperty(value = "社区")
    private String community;
    /**
     * 社区编号
     * 社区ID
     */
    @TableField("community_code")
    @ApiModelProperty(value = "社区编号")
    private String communityCode;
    @TableField("community_id")
    @ApiModelProperty(value = "社区ID")
    private Integer communityId;
    /**
     * 状态(1=正常,2=冻结,3=删除)
     */
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/warpper/MessageNotificationList.java
@@ -25,4 +25,8 @@
    private Integer pageNum;
    @ApiModelProperty("每页数")
    private Integer pageSize;
    private Integer undertakerType;
    private String userId;
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/MessageNotificationMapper.xml
@@ -21,7 +21,7 @@
        left join sgsb_system_user c on (a.phone = c.phone)
        left join sgsb_department d on (c.department_id = d.id)
        left join sgsb_position e on (c.position_id = e.id)
        where 1=1
        where a.undertaker_type = #{query.undertakerType} and a.undertaker_user_id = #{query.userId}
        <if test="query.title != null and query.title != ''">
            and a.title like concat('%', #{query.title}, '%')
        </if>