mitao
2025-02-26 b251ce2e713864dbb871b2600c359b097884c629
三个身边代码提交
7个文件已修改
155 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/controller/ComplaintController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/dto/ComplaintDelayDTO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/Complaint.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/scheduled/ComplaintTasks.java 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/bootstrap.yml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/ComplaintMapper.xml 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/controller/ComplaintController.java
@@ -62,7 +62,7 @@
    @PostMapping("/save")
    @ApiOperation(value = "录入诉求")
    @DistributedLock(lockName = "complaint_serial_number_lock")
    public R<?> save(@RequestBody Complaint complaint) {
    public R<?> save(@Valid @RequestBody Complaint complaint) {
        complaintService.saveComplaint(complaint, getUserId());
        return R.ok();
    }
@@ -130,7 +130,7 @@
     */
    @PostMapping("/saveDelay")
    @ApiOperation(value = "延期申请")
    public R<?> saveDelay(@RequestBody ComplaintDelayDTO dto){
    public R<?> saveDelay(@Valid @RequestBody ComplaintDelayDTO dto){
        complaintService.saveDelay(dto, getLoginUserInfo());
        return R.ok();
    }
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/dto/ComplaintDelayDTO.java
@@ -4,6 +4,8 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
@ApiModel(value = "诉求延期")
public class ComplaintDelayDTO {
@@ -12,6 +14,7 @@
    private Long complaintId;
    @ApiModelProperty("说明")
    @NotBlank(message = "说明不能为空")
    private String comment;
    @ApiModelProperty("图片")
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/Complaint.java
@@ -18,6 +18,9 @@
import lombok.experimental.Accessors;
import org.checkerframework.checker.units.qual.A;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
 * <p>
 * 问题报告表
@@ -46,34 +49,42 @@
    @ApiModelProperty(value = "问题发生时间")
    @TableField("time")
    @NotNull(message = "时间不能为空")
    private Date time;
    @ApiModelProperty(value = "问题类型")
    @TableField("problem_type")
    @NotBlank(message = "问题类型不能为空")
    private String problemType;
    @ApiModelProperty(value = "群众姓名")
    @TableField("name")
    @NotBlank(message = "群众姓名不能为空")
    private String name;
    @ApiModelProperty(value = "联系电话")
    @TableField("contact_number")
    @NotBlank(message = "联系电话不能为空")
    private String contactNumber;
    @ApiModelProperty(value = "问题发生地点")
    @TableField("location")
    @NotBlank(message = "地点不能为空")
    private String location;
    @ApiModelProperty(value = "详细地址描述")
    @TableField("detailed_address")
    @NotBlank(message = "详细地址不能为空")
    private String detailedAddress;
    @ApiModelProperty(value = "问题标题")
    @TableField("description_title")
    @NotBlank(message = "问题标题不能为空")
    private String descriptionTitle;
    @ApiModelProperty(value = "问题描述内容")
    @TableField("description_content")
    @NotBlank(message = "问题描述内容不能为空")
    private String descriptionContent;
    @ApiModelProperty(value = "上传图片")
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/scheduled/ComplaintTasks.java
@@ -1,20 +1,20 @@
package com.panzhihua.sangeshenbian.scheduled;
import com.panzhihua.sangeshenbian.service.IComplaintService;
import lombok.RequiredArgsConstructor;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
@RequiredArgsConstructor
public class ComplaintTasks {
    private final IComplaintService complaintService;
    /**
     * 诉求超时处理
     */
    @Scheduled(fixedRate = 60000)
    public void complaintTimeout() {
        complaintService.list();
    }
}
//package com.panzhihua.sangeshenbian.scheduled;
//
//import com.panzhihua.sangeshenbian.service.IComplaintService;
//import lombok.RequiredArgsConstructor;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//
//@Component
//@RequiredArgsConstructor
//public class ComplaintTasks {
//    private final IComplaintService complaintService;
//
//    /**
//     * 诉求超时处理
//     */
//    @Scheduled(fixedRate = 60000)
//    public void complaintTimeout() {
//        complaintService.list();
//    }
//}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java
@@ -331,33 +331,33 @@
        Complaint complaint = getById(complaintAuditRecord.getComplaintId());
        Long superiorId = null;
        if (Objects.nonNull(complaint)) {
        if (Objects.nonNull(complaint) && complaintReporAuditDTO.getAuditResult().equals(1)) {
            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;
            //审核通过后,将诉求转移给上级
            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 );
                complaint.setSuperiorId(superiorId);
                updateById(complaint );
        }
    }
@@ -419,6 +419,12 @@
        }
        complaintAuditRecordService.audit(complaintAuditRecord, loginUserInfoVO.getUserId(),
                complaintDelayAuditDTO.getAuditResult(), complaintDelayAuditDTO.getRejectReason());
        //审核通过后,设置诉求延期
        if (complaintAuditRecord.getAuditType().equals(1) && complaintAuditRecord.getAuditStatus().equals(1)){
            Complaint complaint = getById(complaintAuditRecord.getComplaintId());
            complaint.setStatus(1);
            updateById(complaint);
        }
    }
    @Override
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/bootstrap.yml
@@ -15,7 +15,8 @@
      max-file-size: 10MB
      max-request-size: 10MB
server:
  max-http-header-size: 10MB
eureka:
  client:
    service-url:
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/ComplaintMapper.xml
@@ -3,6 +3,7 @@
<mapper namespace="com.panzhihua.sangeshenbian.dao.ComplaintMapper">
    <select id="selectComplaintPage" resultType="com.panzhihua.sangeshenbian.model.vo.ComplaintVO">
SELECT * FROM (
        SELECT sc.id,
               sc.serial_number,
               sc.time,
@@ -42,8 +43,6 @@
               scar.audit_type,
               scar.audit_status,
               scar.comment,
               scar.images,
               scar.videos,
               scar.create_time AS reportTime,
               scar.system_user_id,
               scar.reporter,
@@ -51,27 +50,28 @@
               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 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}
            </if>
            <if test="isSuperior == 0 and targetId != null">
                AND sc.create_by = #{targetId}
            </if>
            <if test="query.type!=null and query.type == 0">
                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 IN(0,1,2)
            </if>
            <if test="query.type!=null and query.type == 2">
                AND sc.status = 3
            </if>
        </where>
        ORDER BY sc.create_time DESC
        WHERE
        ((scar.audit_type = 2 AND scar.audit_status != 1) OR (scar.audit_type = 1) OR
         (scar.id IS NULL) OR (scar.audit_type = 2 AND scar.audit_status = 1 AND scar.auditor_id = #{query.userId}))
        ) AS t
         <where>
             <if test="isSuperior == 1 and targetId != null">
                 AND superior_id = #{targetId}
             </if>
             <if test="isSuperior == 0 and targetId != null">
                 AND create_by = #{targetId}
             </if>
             <if test="query.type!=null and query.type == 0">
                 AND(audit_type = 1 AND audit_status = 0) OR (audit_type = 2 AND audit_status = 0)
             </if>
             <if test="query.type!=null and query.type == 1">
                 AND (status IN(0,1,2) )
             </if>
             <if test="query.type!=null and query.type == 2">
                 AND status = 3
             </if>
         </where>
        ORDER BY create_time DESC
    </select>
    <select id="getDetail" resultType="com.panzhihua.sangeshenbian.model.vo.ComplaintVO">
        SELECT sc.id,