Pu Zhibing
2025-02-25 91ebbdc5ef67699d166498f6cf5fcc21058817dd
Merge remote-tracking branch 'origin/master'
22个文件已修改
496 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/LoginApi.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/controller/ComplaintController.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/controller/HomeController.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/enums/ReportTypeEnum.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/dto/ComplaintDispatch.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/dto/ComplaintReporAuditDTO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/Complaint.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/ComplaintAuditRecord.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/ComplaintFlow.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/ComplaintProgress.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/ProblemType.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/SystemUser.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/query/ComplaintQuery.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/vo/ComplaintVO.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/IComplaintAuditRecordService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/IComplaintFlowService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/IMessageNotificationService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintAuditRecordServiceImpl.java 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintFlowServiceImpl.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java 156 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/MessageNotificationServiceImpl.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/ComplaintMapper.xml 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/LoginApi.java
@@ -63,7 +63,11 @@
    private TokenService tokenService;
    @Resource
    private CommunityService communityService;
    @ApiOperation(value = "登录获取token", response = LoginReturnVO.class)
    @PostMapping("login-token")
    public R loginToken(@RequestParam("openId") String openId,@RequestParam("appid")String appid) {
        return tokenService.loginApplets(openId,appid);
    }
    @ApiOperation(value = "登录", response = LoginReturnVO.class)
    @PostMapping("login")
    public R login(@RequestBody LoginRequest loginRequest) {
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/controller/ComplaintController.java
@@ -10,14 +10,19 @@
import com.panzhihua.sangeshenbian.model.entity.Complaint;
import com.panzhihua.sangeshenbian.model.entity.ComplaintAuditRecord;
import com.panzhihua.sangeshenbian.model.entity.ComplaintProgress;
import com.panzhihua.sangeshenbian.model.entity.ProblemType;
import com.panzhihua.sangeshenbian.model.query.ComplaintQuery;
import com.panzhihua.sangeshenbian.model.vo.ComplaintVO;
import com.panzhihua.sangeshenbian.model.vo.DispatchVO;
import com.panzhihua.sangeshenbian.service.IComplaintService;
import com.panzhihua.sangeshenbian.service.IProblemTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@@ -40,21 +45,26 @@
@Validated
@RestController
@RequestMapping("/applet/complaint")
@RequiredArgsConstructor
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
@Api(tags = "诉求管理")
public class ComplaintController extends BaseController {
    private final IComplaintService complaintService;
    private final IProblemTypeService problemTypeService;
    @GetMapping("/problem-type/list")
    @ApiOperation("获取诉求问题类型列表")
    public R<List<ProblemType>> problemTypeList() {
        return R.ok(problemTypeService.list());
    }
    /**
     * 录入诉求
     */
    @PostMapping("/save")
    @ApiOperation(value = "录入诉求")
    @DistributedLock(lockName = "complaint_serial_number_lock")
    public void save(Complaint complaint) {
    public R<?> save(@RequestBody Complaint complaint) {
        complaintService.saveComplaint(complaint, getUserId());
        return R.ok();
    }
    @PostMapping("/list")
@@ -70,6 +80,7 @@
    }
    @GetMapping("/progress/{complaintId}")
    @ApiOperation("办理进度")
    public R<List<ComplaintProgress>> progress(@ApiParam(name = "complaintId", value = "诉求id", required = true) @PathVariable("complaintId") Long complaintId) {
        return R.ok(complaintService.progress(complaintId));
    }
@@ -149,7 +160,7 @@
     */
    @GetMapping("/getDispatchList")
    @ApiOperation(value = "获取下派单位列表")
    public R<?> getDispatchList() {
    public R<List<DispatchVO>> getDispatchList() {
        return R.ok(complaintService.getDispatchList(getLoginUserInfo()));
    }
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/controller/HomeController.java
@@ -6,6 +6,7 @@
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo;
import com.panzhihua.common.service.sangeshenbian.SystemUserService;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.sangeshenbian.model.entity.Banner;
import com.panzhihua.sangeshenbian.model.entity.SystemUser;
import com.panzhihua.sangeshenbian.model.query.BasePage;
@@ -19,6 +20,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -33,13 +35,14 @@
 */
@RestController
@RequestMapping("/applet/home")
@RequiredArgsConstructor
@RequiredArgsConstructor(onConstructor_=@Lazy)
@Api(tags = "首页相关接口")
public class HomeController extends BaseController {
    private final IBannerService bannerService;
    private final IMessageNotificationService messageNotificationService;
    private final IComplaintService complaintService;
    private final ISystemUserService systemUserService;
    private final UserService userService;
    @ApiOperation("获取banner列表")
    @GetMapping("/banner-list")
    public R<List<Banner>> getBannerList() {
@@ -68,6 +71,15 @@
    @GetMapping("/current-user-info")
    @ApiOperation("获取三个身边当前用户信息 用于判断用户是否是上级")
    public R<SystemUser> getCurrentUserInfo() {
        return R.ok(systemUserService.getSystemUserByPhone(getLoginUserInfo().getPhone()).get());
        return R.ok(systemUserService.getSystemUserByPhone(getLoginUserInfo().getPhone()).orElse(null));
    }
    /**
     * 标记已读
     */
    @PostMapping("/read")
    @ApiOperation("标记已读")
    public R<?> read(){
        messageNotificationService.read(getLoginUserInfo());
        return R.ok();
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/enums/ReportTypeEnum.java
@@ -1,10 +1,10 @@
package com.panzhihua.sangeshenbian.enums;
public enum ReportTypeEnum {
    COMMUNITY(1, "社区"),
    STREET(2, "街道"),
    DISTRICT(3, "区县"),
    CITY(4, "市");
    COMMUNITY(4, "社区"),
    STREET(3, "街道"),
    DISTRICT(2, "区县"),
    CITY(1, "市");
    private final int code;
    private final String description;
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/dto/ComplaintDispatch.java
@@ -10,6 +10,9 @@
    @ApiModelProperty(value = "诉求id")
    private Long complaintId;
    @ApiModelProperty(value = "单位id")
    private Long dispatchId; // TODO 待实现
    @ApiModelProperty(value = "内容")
    private String comment;
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/dto/ComplaintReporAuditDTO.java
@@ -5,7 +5,7 @@
@Data
public class ComplaintReporAuditDTO {
    @ApiModelProperty(value = "审核记录id")
    @ApiModelProperty(value = "诉求id")
    private Long id;
    @ApiModelProperty(value = "审核结果: 1-通过 2-驳回")
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/Complaint.java
@@ -3,11 +3,14 @@
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -33,7 +36,8 @@
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = " ")
    @TableId(value = "id")
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    @JsonSerialize(using = com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long id;
    @ApiModelProperty(value = "诉求号")
@@ -80,7 +84,7 @@
    @TableField("videos")
    private String videos;
    @ApiModelProperty(value = "流转状态:0-正在办理 1-延期办理 2-超时办理 3-已办结 4-群众撤销 5-上报待审核 6-上级驳回")
    @ApiModelProperty(value = "流转状态:0-正在办理 1-延期办理 2-超时办理 3-已办结 4-群众撤销 5-上报待审核 6-上级驳回 7-延期待审核")
    @TableField("status")
    private Integer status;
@@ -140,4 +144,18 @@
    @TableField("completion_user_phone")
    private String completionUserPhone;
    @ApiModelProperty(value = "截止日期")
    @TableField("closing_time")
    private Date closingTime;
    @ApiModelProperty(value = "超时天数")
    @TableField("over_time_days")
    private Integer overTimeDays;
    @ApiModelProperty(value = "经度")
    private BigDecimal longitude;
    @ApiModelProperty(value = "纬度")
    private BigDecimal latitude;
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/ComplaintAuditRecord.java
@@ -6,6 +6,9 @@
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -31,6 +34,7 @@
    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using = com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long id;
    @ApiModelProperty(value = "是否最新")
@@ -75,7 +79,7 @@
    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;
    private Date createTime;
    @ApiModelProperty(value = "修改人")
    @TableField("update_by")
@@ -83,7 +87,15 @@
    @ApiModelProperty(value = "修改时间")
    @TableField("update_time")
    private LocalDateTime updateTime;
    private Date updateTime;
    @ApiModelProperty("上报人")
    private String reporter;
    @ApiModelProperty("所属部门")
    private String departmentName;
    @ApiModelProperty("部门id")
    private Integer departmentId;
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/ComplaintFlow.java
@@ -8,6 +8,7 @@
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -32,10 +33,11 @@
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键ID")
    @TableId(value = "id")
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    @JsonSerialize(using = com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long id;
    @ApiModelProperty(value = "主键ID")
    @ApiModelProperty(value = "诉求ID")
    @TableField(value = "complaint_id")
    private Long complaintId;
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/ComplaintProgress.java
@@ -8,6 +8,7 @@
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -32,7 +33,8 @@
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键")
    @TableId(value = "id")
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    @JsonSerialize(using = com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long id;
    @ApiModelProperty(value = "诉求id")
@@ -40,7 +42,7 @@
    private Long complaintId;
    @ApiModelProperty(value = "办理进度描述")
    @TableField("describe")
    @TableField("`describe`")
    private String describe;
    @ApiModelProperty(value = "图片url")
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/ProblemType.java
@@ -3,8 +3,10 @@
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
@@ -21,16 +23,19 @@
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty("主键")
    private Integer id;
    /**
     * 名称
     */
    @TableField("name")
    @ApiModelProperty("名称")
    private String name;
    /**
     * 删除标识(0=否,1=是)
     */
    @TableField("del")
    @TableLogic
    private Integer del;
    /**
     * 添加时间
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/SystemUser.java
@@ -7,6 +7,7 @@
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.xalan.templates.VarNameCollector;
import java.time.LocalDateTime;
@@ -114,7 +115,7 @@
     */
    @TableField("street_id")
    @ApiModelProperty(value = "街道ID")
    private Integer streetId;
    private String streetId;
    /**
     * 社区
     */
@@ -126,7 +127,7 @@
     */
    @TableField("community_id")
    @ApiModelProperty(value = "社区ID")
    private Integer communityId;
    private Long communityId;
    /**
     * 状态(1=正常,2=冻结,3=删除)
     */
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/query/ComplaintQuery.java
@@ -15,4 +15,9 @@
    @ApiModelProperty("全部:不传,上报待审核:0,正在办理:1, 办结:2")
    private Integer type;
    /**
     * 当前登录用户id
     */
    private Long userId;
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/vo/ComplaintVO.java
@@ -20,7 +20,7 @@
public class ComplaintVO extends Complaint {
    @ApiModelProperty(value = "上报人")
    private String reportName;
    private String reporter;
    @ApiModelProperty(value = "所属部门")
    private String departmentName;
@@ -31,6 +31,24 @@
    @ApiModelProperty(value = "上报说明")
    private String comment;
    @ApiModelProperty(value = "录入人")
    private String nickname;
    @ApiModelProperty(value = "联系方式")
    private String phone;
    @ApiModelProperty(value = "审核人")
    private String auditorName;
    @ApiModelProperty(value = "审核人联系方式")
    private String auditorPhone;
    @ApiModelProperty(value = "驳回原因")
    private String rejectReason;
    @ApiModelProperty(value = "审核时间")
    private Date auditTime;
    @ApiModelProperty(value = "诉求流转记录")
    List<ComplaintFlow> complaintFlows;
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/IComplaintAuditRecordService.java
@@ -1,9 +1,9 @@
package com.panzhihua.sangeshenbian.service;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.utlis.DateUtils;
import com.panzhihua.sangeshenbian.model.entity.ComplaintAuditRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.sangeshenbian.model.entity.SystemUser;
/**
 * <p>
@@ -15,9 +15,9 @@
 */
public interface IComplaintAuditRecordService extends IService<ComplaintAuditRecord> {
    // 创建审核记录
    void createComplaintAuditRecord(Long complaintId, Integer auditType, String comment, Long userId);
    void createComplaintAuditRecord(Long complaintId, Integer auditType, String comment, LoginUserInfoVO loginUserInfoVO, SystemUser adminUser);
    // 审核
    void audit(Long id, Long userId, Integer auditResult, String rejectReason);
    void audit(ComplaintAuditRecord complaintAuditRecord, Long userId, Integer auditResult, String rejectReason);
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/IComplaintFlowService.java
@@ -15,5 +15,13 @@
 * @since 2025-02-22
 */
public interface IComplaintFlowService extends IService<ComplaintFlow> {
    void createFlow(Long complaintId,Integer type, Long userId);
    /**
     * 创建流程
     * @param complaintId
     * @param reportType
     * @param type 流转类型 0-上报 1-下派
     * @param userId
     */
    void createFlow(Long complaintId , Long superiorId, Integer reportType, Integer type, Long userId);
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/IMessageNotificationService.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.sangeshenbian.model.entity.MessageNotification;
import com.panzhihua.sangeshenbian.model.query.BasePage;
import com.panzhihua.sangeshenbian.model.vo.MessageNotificationVO;
@@ -18,4 +19,10 @@
    IPage<MessageNotification> list(MessageNotificationList query);
    Page<MessageNotificationVO> getMessageList(BasePage page, Long userId);
    /**
     * 标记已读
     * @param loginUserInfoVO
     */
    void read(LoginUserInfoVO loginUserInfoVO);
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintAuditRecordServiceImpl.java
@@ -1,11 +1,15 @@
package com.panzhihua.sangeshenbian.service.impl;
import com.panzhihua.common.utlis.DateUtils;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.sangeshenbian.model.entity.ComplaintAuditRecord;
import com.panzhihua.sangeshenbian.dao.ComplaintAuditRecordMapper;
import com.panzhihua.sangeshenbian.model.entity.SystemUser;
import com.panzhihua.sangeshenbian.service.IComplaintAuditRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.Objects;
/**
 * <p>
@@ -19,30 +23,50 @@
public class ComplaintAuditRecordServiceImpl extends ServiceImpl<ComplaintAuditRecordMapper, ComplaintAuditRecord> implements IComplaintAuditRecordService {
    @Override
    public void createComplaintAuditRecord(Long complaintId, Integer auditType, String comment, Long userId) {
    public void createComplaintAuditRecord(Long complaintId, Integer auditType, String comment, LoginUserInfoVO loginUserInfoVO, SystemUser adminUser) {
        ComplaintAuditRecord auditRecord = new ComplaintAuditRecord();
        auditRecord.setComplaintId(complaintId);
        auditRecord.setLatestFlag(true);
        auditRecord.setAuditType(1);
        auditRecord.setAuditType(auditType);
        auditRecord.setAuditStatus(0);
        auditRecord.setComment(comment);
        auditRecord.setCreateBy(userId);
        auditRecord.setCreateTime(DateUtils.getCurrentDate());
        auditRecord.setUpdateBy(userId);
        auditRecord.setUpdateTime(DateUtils.getCurrentDate());
        auditRecord.setCreateBy(loginUserInfoVO.getUserId());
        auditRecord.setCreateTime(new Date());
        auditRecord.setUpdateBy(loginUserInfoVO.getUserId());
        auditRecord.setUpdateTime(new Date());
        String departmentName = "";
        String reporter = loginUserInfoVO.getNickName();
        if (Objects.nonNull(adminUser) && adminUser.getIsAdmin().equals(1)){
            switch (adminUser.getAccountLevel()) {
                case 1:
                    departmentName = "攀枝花市";//默认市级
                    break;
                case 2:
                    departmentName = adminUser.getDistricts();
                    break;
                case 3:
                    departmentName = adminUser.getStreet();
                    break;
                case 4:
                    departmentName = adminUser.getCommunity();
                    break;
            }
            auditRecord.setDepartmentName(departmentName);
            reporter = adminUser.getName();
        }
        auditRecord.setReporter(reporter);
        save(auditRecord);
    }
    @Override
    public void audit(Long id, Long userId, Integer auditResult, String rejectReason) {
        ComplaintAuditRecord auditRecord = getById(id);
        if (auditRecord == null) {
            throw new RuntimeException("审核记录不存在");
        }
        auditRecord.setAuditStatus(auditResult);
        auditRecord.setRejectReason(rejectReason);
        auditRecord.setUpdateBy(userId);
        auditRecord.setUpdateTime(DateUtils.getCurrentDate());
        save(auditRecord);
    public void audit(ComplaintAuditRecord complaintAuditRecord, Long userId, Integer auditResult, String rejectReason) {
        complaintAuditRecord.setAuditStatus(auditResult);
        complaintAuditRecord.setRejectReason(rejectReason);
        complaintAuditRecord.setAuditorId(userId);
        complaintAuditRecord.setUpdateBy(userId);
        complaintAuditRecord.setUpdateTime(new Date());
        updateById(complaintAuditRecord);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintFlowServiceImpl.java
@@ -1,7 +1,11 @@
package com.panzhihua.sangeshenbian.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.netflix.servo.monitor.LongGauge;
import com.panzhihua.common.exceptions.ServiceException;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.sangeshenbian.enums.ReportTypeEnum;
import com.panzhihua.sangeshenbian.model.entity.*;
import com.panzhihua.sangeshenbian.dao.ComplaintFlowMapper;
@@ -24,23 +28,19 @@
 * @since 2025-02-22
 */
@Service
@RequiredArgsConstructor
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
public class ComplaintFlowServiceImpl extends ServiceImpl<ComplaintFlowMapper, ComplaintFlow> implements IComplaintFlowService {
    @Lazy
    @Resource
    private IComplaintService complaintService;
    private final IComplaintService complaintService;
    private final IBcRegionService bcRegionService;
    private final IComStreetService comStreetService;
    private final IComActService comActService;
    private final UserService userService;
    
    @Override
    public void createFlow(Long complaintId , Integer type, Long userId) {
    public void createFlow(Long complaintId , Long superiorId, Integer reportType, Integer type, Long userId) {
        Complaint complaint = complaintService.getById(complaintId);
        Integer reportType = complaint.getReportType();
        String name = getFlowName(reportType, complaint);
        String name = getFlowName(reportType, superiorId);
        ComplaintFlow complaintFlow = new ComplaintFlow();
        complaintFlow.setComplaintId(complaintId);
@@ -51,21 +51,24 @@
        save(complaintFlow);
    }
    private String getFlowName(Integer reportType, Complaint complaint) {
    private String getFlowName(Integer reportType, Long superiorId) {
        String name;
        if (reportType == ReportTypeEnum.COMMUNITY.getCode()) {
            ComAct byId = comActService.getById(complaint.getSuperiorId());
            ComAct byId = comActService.getById(superiorId);
            name = byId.getName();
        }else if (reportType == ReportTypeEnum.STREET.getCode()) {
            ComStreet comStreet = comStreetService.getById(complaint.getSuperiorId());
            ComStreet comStreet = comStreetService.getById(superiorId);
            name = comStreet.getName();
        }  else if (reportType == ReportTypeEnum.CITY.getCode() || reportType == ReportTypeEnum.DISTRICT.getCode()){
            BcRegion bcRegion = bcRegionService.getOne(new LambdaQueryWrapper<BcRegion>()
                    .eq(BcRegion::getRegionCode, complaint.getSuperiorId()));
                    .eq(BcRegion::getRegionCode, superiorId));
            name = bcRegion.getRegionName();
        } else {
            // 处理未预期的账号等级
            throw new ServiceException("未知的账号等级");
            R<LoginUserInfoVO> userR = userService.getUserInfoByUserId(String.valueOf(superiorId));
            if (R.isOk(userR)) {
                throw new ServiceException("获取用户信息失败");
            }
            name =  userR.getData().getNickName();
        }
        return name;
    }
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java
@@ -31,12 +31,13 @@
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import static cn.hutool.core.util.ObjectUtil.isNull;
@@ -50,18 +51,17 @@
 * @since 2025-02-22
 */
@Service
@RequiredArgsConstructor
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
public class ComplaintServiceImpl extends ServiceImpl<ComplaintMapper, Complaint> implements IComplaintService {
    private final ISystemUserService systemUserService;
    @Lazy
    @Resource
    private IComplaintFlowService complaintFlowService;
    private final IComplaintFlowService complaintFlowService;
    private final IComplaintProgressService complaintProgressService;
    private final IComplaintAuditRecordService complaintAuditRecordService;
    private final IBcRegionService bcRegionService;
    private final IComStreetService comStreetService;
    private final IComActService comActService;
    private final IWorkOrderItemConfigService workOrderItemConfigService;
    @Override
    public void saveComplaint(Complaint complaint, Long userId) {
@@ -94,7 +94,12 @@
        complaint.setCreateBy(userId);
        complaint.setUpdateBy(userId);
        complaint.setUpdateTime(new Date(System.currentTimeMillis()));
        //查询系统配置诉求处理期限,设置截止日期
        WorkOrderItemConfig config = workOrderItemConfigService.lambdaQuery().orderByDesc(WorkOrderItemConfig::getId).last("LIMIT 1").one();
        if (Objects.isNull(config)){
            throw new ServiceException("工单事项未配置,请联系管理员");
        }
        complaint.setClosingTime(new Date(System.currentTimeMillis() + config.getDemandProcessingTime() * 24 * 60 * 60 * 1000));
        // 保存诉求记录
        save(complaint);
    }
@@ -139,6 +144,7 @@
            targetId = loginUserInfoVO.getUserId().toString();
        }
        //查询对应诉求
        query.setUserId(loginUserInfoVO.getUserId());//当前登录用户id
        page = baseMapper.selectComplaintPage(page, query, targetId,isSuperior);
        return page;
    }
@@ -173,7 +179,7 @@
        ComplaintProgress complaintProgress = BeanUtil.copyProperties(dto, ComplaintProgress.class);
        complaintProgress.setCreateTime(new Date());
        complaintProgress.setCreateBy(loginUserInfoVO.getUserId());
        complaintProgress.setCreateByName(loginUserInfoVO.getName());
        complaintProgress.setCreateByName(loginUserInfoVO.getNickName());
        complaintProgressService.save(complaintProgress);
    }
@@ -188,7 +194,8 @@
        Complaint complaint = BeanUtil.copyProperties(dto, Complaint.class);
        complaint.setUpdateTime(new Date());
        complaint.setCompletionUserId(loginUserInfoVO.getUserId());
        complaint.setCompletionUsername(loginUserInfoVO.getName());
        complaint.setCompletionUsername(loginUserInfoVO.getNickName());
        complaint.setCompletionUserPhone(loginUserInfoVO.getPhone());
        complaint.setCompletionTime(new Date());
        this.updateById(complaint);
    }
@@ -205,30 +212,34 @@
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void saveReport(ComplaintReportDTO dto, LoginUserInfoVO loginUserInfoVO) {
        String phone = loginUserInfoVO.getPhone();
        SystemUser adminUser = systemUserService.getOne(new LambdaQueryWrapper<SystemUser>()
                .eq(SystemUser::getPhone, phone)
                .eq(SystemUser::getIsAdmin, 1)
                .eq(SystemUser::getStatus, 3)
                .ne(SystemUser::getStatus, 3)
                .last("LIMIT 1"));
        Long superiorId;
        int reportType;
        if (adminUser == null) {
            superiorId = loginUserInfoVO.getCommunityId();
            if (Objects.isNull(superiorId)){
                throw new ServiceException("上报失败,请绑定社区");
            }
            reportType = ReportTypeEnum.COMMUNITY.getCode();
        } else {
            int accountLevel = adminUser.getAccountLevel(); // 改为基本类型
            if (accountLevel == 1) {
                throw new ServiceException("市级账号,无法上报!");
            }
            reportType = accountLevel + 1;
            reportType = accountLevel - 1;
            // 使用基本类型比较并补充默认分支
            if (accountLevel == ReportTypeEnum.COMMUNITY.getCode()) {
                superiorId = adminUser.getStreetId().longValue();
                superiorId = Long.parseLong(adminUser.getStreetId());
            } else if (accountLevel == ReportTypeEnum.STREET.getCode()) {
                superiorId = Long.parseLong(adminUser.getDistrictsCode());
            } else if (accountLevel == ReportTypeEnum.DISTRICT.getCode()) {
@@ -250,35 +261,35 @@
                .set(ComplaintAuditRecord::getLatestFlag,false));
        // 添加审核记录
        complaintAuditRecordService.createComplaintAuditRecord(dto.getComplaintId(), 2, dto.getComment(), loginUserInfoVO.getUserId());
        complaintAuditRecordService.createComplaintAuditRecord(dto.getComplaintId(), 2, dto.getComment(), loginUserInfoVO,adminUser);
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void saveDispatch(ComplaintDispatch dto, LoginUserInfoVO loginUserInfoVO) {
        String phone = loginUserInfoVO.getPhone();
        SystemUser adminUser = systemUserService.getOne(new LambdaQueryWrapper<SystemUser>()
                .eq(SystemUser::getPhone, phone)
                .eq(SystemUser::getIsAdmin, 1)
                .eq(SystemUser::getStatus, 3)
                .ne(SystemUser::getStatus, 3)
                .last("LIMIT 1"));
        if (adminUser == null) {
            throw new ServiceException("无权下派");
        }
        long superiorId;
        int reportType;
        int accountLevel = adminUser.getAccountLevel(); // 改为基本类型
        if (accountLevel == 1) {
            throw new ServiceException("市级账号,无法上报!");
        if (accountLevel == 4) {
            throw new ServiceException("社区账号,无法下派!");
        }
        reportType = accountLevel - 1;
        // 使用基本类型比较并补充默认分支
        if (accountLevel == ReportTypeEnum.STREET.getCode()) {
            superiorId = adminUser.getCommunityId().longValue();
        } else if (accountLevel == ReportTypeEnum.DISTRICT.getCode()) {
            superiorId = adminUser.getStreetId().longValue();
            superiorId = Long.parseLong(adminUser.getStreetId());
        } else if (accountLevel == ReportTypeEnum.CITY.getCode()) {
            superiorId = Long.parseLong(adminUser.getDistrictsCode());
        } else {
@@ -286,40 +297,127 @@
            throw new ServiceException("未知的账号等级");
        }
        Long superiorOrgId;
        Complaint complaint = getById(dto.getComplaintId());
        complaint.setReportType(reportType);
        superiorOrgId = complaint.getSuperiorId();
        complaint.setReportType(accountLevel + 1);
        complaint.setSuperiorId(superiorId);
        updateById(complaint);
        // 添加流转记录
        complaintFlowService.createFlow(dto.getComplaintId(), 1, loginUserInfoVO.getUserId());
        complaintFlowService.createFlow(dto.getComplaintId(), superiorOrgId, accountLevel, 1, loginUserInfoVO.getUserId());
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void reportAudit(ComplaintReporAuditDTO complaintReporAuditDTO, LoginUserInfoVO loginUserInfoVO) {
        complaintAuditRecordService.audit(complaintReporAuditDTO.getId(), loginUserInfoVO.getUserId(),
        Optional<SystemUser> systemUserByPhone = systemUserService.getSystemUserByPhone(loginUserInfoVO.getPhone());
        if (!systemUserByPhone.isPresent()) {
            throw new ServiceException("无权审核");
        }
        //查询上报审核记录
        ComplaintAuditRecord complaintAuditRecord = complaintAuditRecordService.lambdaQuery().eq(ComplaintAuditRecord::getComplaintId, complaintReporAuditDTO.getId())
                .eq(ComplaintAuditRecord::getAuditType, 2)
                .eq(ComplaintAuditRecord::getLatestFlag, true)
                .last("LIMIT 1").one();
        if (Objects.isNull(complaintAuditRecord)) {
            throw new ServiceException("上报申请记录不存在");
        }
        //查询待审核诉求
        complaintAuditRecordService.audit(complaintAuditRecord,  loginUserInfoVO.getUserId(),
                complaintReporAuditDTO.getAuditResult(), complaintReporAuditDTO.getRejectReason());
        // 添加流转记录
        ComplaintAuditRecord complaintAuditRecord = complaintAuditRecordService.getById(complaintReporAuditDTO.getId());
        complaintFlowService.createFlow(complaintAuditRecord.getComplaintId(), 0, loginUserInfoVO.getUserId());
        Complaint complaint = getById(complaintAuditRecord.getComplaintId());
        Long superiorId = null;
        if (Objects.nonNull(complaint)) {
            superiorId = complaint.getCreateBy();
            if (Objects.nonNull(complaint.getSuperiorId())) {
                superiorId = complaint.getSuperiorId();
            }
            complaintFlowService.createFlow(complaintAuditRecord.getComplaintId(), superiorId,complaint.getReportType(),0, loginUserInfoVO.getUserId());
        }
        //审核通过后,将诉求转移给上级
        if (complaintAuditRecord.getAuditType().equals(2) && complaintAuditRecord.getAuditStatus().equals(1)){
            SystemUser systemUser = systemUserByPhone.get();
                switch (systemUser.getAccountLevel()) {
                    case 1:
                        superiorId = 510400L;//默认市级
                        break;
                    case 2:
                        superiorId = Long.parseLong(systemUser.getDistrictsCode());
                        break;
                    case 3:
                        superiorId = Long.parseLong(systemUser.getStreetId());
                        break;
                    case 4:
                        superiorId = systemUser.getCommunityId();
                        break;
                }
            }
            complaint.setSuperiorId(superiorId);
            updateById(complaint );
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void saveDelay(ComplaintDelayDTO dto, LoginUserInfoVO loginUserInfoVO) {
        // 标记最新
        complaintAuditRecordService.update(new LambdaUpdateWrapper<ComplaintAuditRecord>()
                .eq(ComplaintAuditRecord::getComplaintId, dto.getComplaintId())
                .set(ComplaintAuditRecord::getLatestFlag,false));
        SystemUser systemUser = systemUserService.getSystemUserByPhone(loginUserInfoVO.getPhone()).orElse(null);
        Long superiorId;
        int reportType;
        if (systemUser == null) {
            superiorId = loginUserInfoVO.getCommunityId();
            if (Objects.isNull(superiorId)){
                throw new ServiceException("上报失败,请绑定社区");
            }
            reportType = ReportTypeEnum.COMMUNITY.getCode();
        } else {
            int accountLevel = systemUser.getAccountLevel(); // 改为基本类型
            if (accountLevel == 1) {
                throw new ServiceException("市级账号,无法上报!");
            }
            reportType = accountLevel + 1;
            // 使用基本类型比较并补充默认分支
            if (accountLevel == ReportTypeEnum.COMMUNITY.getCode()) {
                superiorId = Long.parseLong(systemUser.getStreetId());
            } else if (accountLevel == ReportTypeEnum.STREET.getCode()) {
                superiorId = Long.parseLong(systemUser.getDistrictsCode());
            } else if (accountLevel == ReportTypeEnum.DISTRICT.getCode()) {
                superiorId = 510400L; // 攀枝花市
            } else {
                // 处理未预期的账号等级
                throw new ServiceException("未知的账号等级");
            }
        }
        Complaint complaint = getById(dto.getComplaintId());
        complaint.setReportType(reportType);
        complaint.setSuperiorId(superiorId);
        updateById(complaint);
        // 添加审核记录
        complaintAuditRecordService.createComplaintAuditRecord(dto.getComplaintId(), 1, dto.getComment(), loginUserInfoVO.getUserId());
        complaintAuditRecordService.createComplaintAuditRecord(dto.getComplaintId(), 1, dto.getComment(), loginUserInfoVO, systemUser);
    }
    @Override
    public void delayAudit(ComplaintDelayAuditDTO complaintDelayAuditDTO, LoginUserInfoVO loginUserInfoVO) {
        complaintAuditRecordService.audit(complaintDelayAuditDTO.getId(), loginUserInfoVO.getUserId(),
        //查询待审核诉求
        ComplaintAuditRecord complaintAuditRecord = complaintAuditRecordService.lambdaQuery().eq(ComplaintAuditRecord::getComplaintId, complaintDelayAuditDTO.getComplaintId())
                .eq(ComplaintAuditRecord::getAuditType, 1)
                .eq(ComplaintAuditRecord::getAuditStatus, 0)
                .eq(ComplaintAuditRecord::getLatestFlag, true)
                .last("LIMIT 1").one();
        if (Objects.isNull(complaintAuditRecord)) {
            throw new ServiceException("诉求延期申请不存在");
        }
        complaintAuditRecordService.audit(complaintAuditRecord, loginUserInfoVO.getUserId(),
                complaintDelayAuditDTO.getAuditResult(), complaintDelayAuditDTO.getRejectReason());
    }
@@ -330,16 +428,16 @@
        SystemUser adminUser = systemUserService.getOne(new LambdaQueryWrapper<SystemUser>()
                .eq(SystemUser::getPhone, phone)
                .eq(SystemUser::getIsAdmin, 1)
                .eq(SystemUser::getStatus, 3)
                .ne(SystemUser::getStatus, 3)
                .last("LIMIT 1"));
        if (adminUser == null) {
            throw new ServiceException("无权下派");
        }
        int accountLevel = adminUser.getAccountLevel(); // 改为基本类型
        if (accountLevel == 1) {
      /*  if (accountLevel == 1) {
            throw new ServiceException("市级账号,无法上报!");
        }
        }*/
        // 使用基本类型比较并补充默认分支
        List<DispatchVO> dispatchVOList = new ArrayList<>();
@@ -361,7 +459,7 @@
            }
        } else if (accountLevel == ReportTypeEnum.CITY.getCode()) {
            List<BcRegion> list = bcRegionService.list(new LambdaQueryWrapper<BcRegion>()
                    .eq(BcRegion::getHierarchyOrder, 3));
                    .eq(BcRegion::getHierarchyOrder, 3).eq(BcRegion::getParentId, 510400));//获取攀枝花市下的区县
            for (BcRegion region : list) {
                DispatchVO dispatchVO = new DispatchVO();
                dispatchVO.setId(Long.valueOf(region.getRegionCode()));
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/MessageNotificationServiceImpl.java
@@ -1,23 +1,34 @@
package com.panzhihua.sangeshenbian.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.service.sangeshenbian.SystemUserService;
import com.panzhihua.sangeshenbian.dao.MessageNotificationMapper;
import com.panzhihua.sangeshenbian.model.entity.MessageNotification;
import com.panzhihua.sangeshenbian.model.entity.SystemUser;
import com.panzhihua.sangeshenbian.model.query.BasePage;
import com.panzhihua.sangeshenbian.model.vo.MessageNotificationVO;
import com.panzhihua.sangeshenbian.service.IMessageNotificationService;
import com.panzhihua.sangeshenbian.service.ISystemUserService;
import com.panzhihua.sangeshenbian.warpper.MessageNotificationList;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import java.util.Objects;
import java.util.Optional;
/**
 * @author zhibing.pu
 * @Date 2025/2/23 3:04
 */
@Service
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
public class MessageNotificationServiceImpl extends ServiceImpl<MessageNotificationMapper, MessageNotification> implements IMessageNotificationService {
    private final ISystemUserService systemUserService;
    
    @Override
    public IPage<MessageNotification> list(MessageNotificationList query) {
@@ -31,7 +42,39 @@
    @Override
    public Page<MessageNotificationVO> getMessageList(BasePage basePage, Long userId) {
        //TODO 待完善
        Page<MessageNotificationVO> page = new Page<>(basePage.getPageNum(),basePage.getPageSize());
        return page;
        Page<MessageNotification> page = lambdaQuery().page(new Page<>(basePage.getPageNum(),basePage.getPageSize()));
        return (Page<MessageNotificationVO>) page.convert(item-> BeanUtil.copyProperties(item, MessageNotificationVO.class));
    }
    /**
     * 标记已读
     * @param loginUserInfoVO
     */
    @Override
    public void read(LoginUserInfoVO loginUserInfoVO) {
        String undertakerUserId = "";
        Optional<SystemUser> systemUserByPhone = systemUserService.getSystemUserByPhone(loginUserInfoVO.getPhone());
        if (systemUserByPhone.isPresent()) {
            SystemUser systemUser = systemUserByPhone.get();
            if (systemUser.getIsAdmin().equals(1)){
                switch (systemUser.getAccountLevel()) {
                    case 1:
                        undertakerUserId = "510400";//默认市级
                        break;
                    case 2:
                        undertakerUserId = systemUser.getDistrictsCode();
                        break;
                    case 3:
                        undertakerUserId = systemUser.getStreetId();
                        break;
                    case 4:
                        undertakerUserId = systemUser.getCommunityId().toString();
                        break;
                }
            }
        }else {
            undertakerUserId = loginUserInfoVO.getUserId().toString();
        }
        this.lambdaUpdate().eq(MessageNotification::getUndertakerUserId, undertakerUserId).set(MessageNotification::getReadStatus, 1).update();
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/ComplaintMapper.xml
@@ -16,8 +16,9 @@
               sc.images,
               sc.videos,
               CASE
                   WHEN scar.audit_type = 1 AND scar.audit_status = 1 THEN 5
                   WHEN scar.audit_type = 2 AND scar.audit_status = 2 THEN 6
                   WHEN scar.audit_type = 1 AND scar.audit_status = 0 THEN 7
                   WHEN scar.audit_type = 2 AND scar.audit_status = 0 THEN 5
                   WHEN scar.audit_status = 2 THEN 6
                   ELSE sc.status
                   END          AS status,
               sc.report_type,
@@ -35,6 +36,7 @@
               sc.completion_username,
               sc.completion_user_phone,
               sc.closing_time,
               sc.over_time_days,
               sc.latitude,
               sc.longitude,
               scar.audit_type,
@@ -44,15 +46,14 @@
               scar.videos,
               scar.create_time AS reportTime,
               scar.system_user_id,
               scar.name        AS reportName,
               scar.reporter,
               scar.department_name,
               scar.department_id
        FROM sgsb_complaint sc
                 LEFT JOIN sgsb_complaint_audit_record scar ON scar.complaint_id = sc.id AND scar.latest_flag = 1
        <where>
            <if test="query.type ==null">
                (scar.audit_type = 1 AND scar.audit_status = 1)
                OR (scar.audit_type = 2 AND scar.audit_status = 2)
            <if test="query.type ==null and isSuperior == 1">
                 AND (scar.auditor_id IS NULL OR scar.auditor_id != #{query.userId})
            </if>
            <if test="isSuperior == 1 and targetId != null">
                AND sc.superior_id = #{targetId}
@@ -61,10 +62,10 @@
                AND sc.create_by = #{targetId}
            </if>
            <if test="query.type!=null and query.type == 0">
                AND scar.audit_type = 2 AND scar.audit_status = 2
                AND(scar.audit_type = 1 AND scar.audit_status = 0) OR (scar.audit_type = 2 AND scar.audit_status = 0)
            </if>
            <if test="query.type!=null and query.type == 1">
                AND sc.status = 0
                AND sc.status IN(0,1,2)
            </if>
            <if test="query.type!=null and query.type == 2">
                AND sc.status = 3
@@ -86,8 +87,9 @@
               sc.images,
               sc.videos,
               CASE
                   WHEN scar.audit_type = 1 AND scar.audit_status = 1 THEN 5
                   WHEN scar.audit_type = 2 AND scar.audit_status = 2 THEN 6
        WHEN scar.audit_type = 1 AND scar.audit_status = 0 THEN 7
        WHEN scar.audit_type = 2 AND scar.audit_status = 0 THEN 5
        WHEN scar.audit_status = 2 THEN 6
                   ELSE sc.status
                   END          AS status,
               sc.report_type,
@@ -105,6 +107,7 @@
               sc.completion_username,
               sc.completion_user_phone,
               sc.closing_time,
        sc.over_time_days,
               sc.latitude,
               sc.longitude,
               scar.audit_type,
@@ -114,13 +117,20 @@
               scar.videos,
               scar.create_time AS reportTime,
               scar.system_user_id,
               scar.name        AS reportName,
        scar.reporter,
               scar.department_name,
               scar.department_id,
               scar.comment
        scar.comment,
        scar.create_time AS auditTime,
        scar.reject_reason,
        su.nick_name,
        su.phone,
        su2.nick_name AS auditorName,
        su2.phone AS auditorPhone
        FROM sgsb_complaint sc
            LEFT JOIN sys_user su ON su.user_id = sc.create_by
                 LEFT JOIN sgsb_complaint_audit_record scar ON scar.complaint_id = sc.id AND scar.latest_flag = 1
        WHERE sc.id = #{id}
        LEFT JOIN sys_user su2 ON su2.user_id = scar.auditor_id AND scar.audit_status != 0
        <where>
            sc.id = #{id}
        </where>