springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/controller/ComplaintController.java
New file @@ -0,0 +1,53 @@ package com.panzhihua.sangeshenbian.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.utlis.DateUtils; import com.panzhihua.sangeshenbian.annotation.DistributedLock; import com.panzhihua.sangeshenbian.entity.Complaint; import com.panzhihua.sangeshenbian.enums.ProcessStatusEnum; import com.panzhihua.sangeshenbian.service.IComplaintService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.text.SimpleDateFormat; import java.util.Date; import static cn.hutool.core.util.ObjectUtil.isNull; /** * <p> * 诉求报告表 前端控制器 * </p> * * @author * @since 2025-02-22 */ @RestController @RequestMapping("/complaint") @RequiredArgsConstructor @Api(tags = "诉求管理") public class ComplaintController extends BaseController { private final IComplaintService complaintService; /** * 录入诉求 */ @PostMapping("/save") @ApiOperation(value = "录入诉求") @DistributedLock(lockName = "complaint_serial_number_lock") public void save(Complaint complaint) { complaintService.saveComplaint(complaint,getUserId()); } } springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/controller/ComplaintFlowController.java
New file @@ -0,0 +1,20 @@ package com.panzhihua.sangeshenbian.controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * <p> * 诉求流转记录表 前端控制器 * </p> * * @author * @since 2025-02-22 */ @RestController @RequestMapping("/complaint-flow") public class ComplaintFlowController { } springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/controller/ComplaintProgressController.java
New file @@ -0,0 +1,20 @@ package com.panzhihua.sangeshenbian.controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * <p> * 前端控制器 * </p> * * @author * @since 2025-02-22 */ @RestController @RequestMapping("/complaint-progress") public class ComplaintProgressController { } springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/ComplaintFlowMapper.java
New file @@ -0,0 +1,17 @@ package com.panzhihua.sangeshenbian.dao; import com.panzhihua.sangeshenbian.entity.ComplaintFlow; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; /** * <p> * 诉求流转记录表 Mapper 接口 * </p> * * @author * @since 2025-02-22 */ public interface ComplaintFlowMapper extends BaseMapper<ComplaintFlow> { } springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/ComplaintMapper.java
New file @@ -0,0 +1,17 @@ package com.panzhihua.sangeshenbian.dao; import com.panzhihua.sangeshenbian.entity.Complaint; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.springframework.stereotype.Repository; /** * <p> * 问题报告表 Mapper 接口 * </p> * * @author * @since 2025-02-22 */ public interface ComplaintMapper extends BaseMapper<Complaint> { } springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/ComplaintProgressMapper.java
New file @@ -0,0 +1,16 @@ package com.panzhihua.sangeshenbian.dao; import com.panzhihua.sangeshenbian.entity.ComplaintProgress; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * <p> * Mapper 接口 * </p> * * @author * @since 2025-02-22 */ public interface ComplaintProgressMapper extends BaseMapper<ComplaintProgress> { } springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/entity/Complaint.java
New file @@ -0,0 +1,109 @@ package com.panzhihua.sangeshenbian.entity; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableId; import java.io.Serializable; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; /** * <p> * 问题报告表 * </p> * * @author * @since 2025-02-22 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("sgsb_complaint") @ApiModel(value="Complaint对象", description="问题报告表") public class Complaint implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = " ") @TableId(value = "id") private Long id; @ApiModelProperty(value = "诉求号") @TableField("serial_number") private String serialNumber; @ApiModelProperty(value = "问题发生时间") @TableField("time") private LocalDateTime time; @ApiModelProperty(value = "问题类型") @TableField("problem_type") private String problemType; @ApiModelProperty(value = "群众姓名") @TableField("name") private String name; @ApiModelProperty(value = "联系电话") @TableField("contact_number") private String contactNumber; @ApiModelProperty(value = "问题发生地点") @TableField("location") private String location; @ApiModelProperty(value = "详细地址描述") @TableField("detailed_address") private String detailedAddress; @ApiModelProperty(value = "问题标题") @TableField("description_title") private String descriptionTitle; @ApiModelProperty(value = "问题描述内容") @TableField("description_content") private String descriptionContent; @ApiModelProperty(value = "上传图片") @TableField("images") private String images; @ApiModelProperty(value = "上传视频") @TableField("videos") private String videos; @ApiModelProperty(value = "审核状态:0-待审核 1-审核通过 2-审核驳回") @TableField("audit_status") private Integer auditStatus; @ApiModelProperty(value = "流转状态:0-正在办理 1-延期办理 2-超时办理 3-已办结") @TableField("status") private Integer status; @ApiModelProperty(value = "办理人id") @TableField("handler_id") private Long handlerId; @ApiModelProperty(value = "创建人") @TableField("create_by") private Long createBy; @ApiModelProperty(value = "创建时间") @TableField("create_time") private LocalDateTime createTime; @ApiModelProperty(value = "修改人") @TableField("update_by") private Long updateBy; @ApiModelProperty(value = "修改时间") @TableField("update_time") private LocalDateTime updateTime; } springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/entity/ComplaintFlow.java
New file @@ -0,0 +1,52 @@ package com.panzhihua.sangeshenbian.entity; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableId; import java.time.LocalDateTime; import java.io.Serializable; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; /** * <p> * 诉求流转记录表 * </p> * * @author * @since 2025-02-22 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("sgsb_complaint_flow") @ApiModel(value="ComplaintFlow对象", description="诉求流转记录表") public class ComplaintFlow implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "主键ID") @TableId(value = "id") private Integer id; @ApiModelProperty(value = "处理层级: 0-社区 1-街道 2-区/县 3市") @TableField("level") private Boolean level; @ApiModelProperty(value = "处理单位名称") @TableField("name") private String name; @ApiModelProperty(value = "下派时间") @TableField("dispatch_time") private LocalDateTime dispatchTime; @ApiModelProperty(value = "处理状态:0-未处理 1-已处理") @TableField("status") private Boolean status; } springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/entity/ComplaintProgress.java
New file @@ -0,0 +1,61 @@ package com.panzhihua.sangeshenbian.entity; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableId; import java.io.Serializable; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; /** * <p> * * </p> * * @author * @since 2025-02-22 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("sgsb_complaint_progress") @ApiModel(value="ComplaintProgress对象", description="") public class ComplaintProgress implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "主键") @TableId(value = "id") private Long id; @ApiModelProperty(value = "诉求id") @TableField("issue_report_id") private Long issueReportId; @ApiModelProperty(value = "办理进度描述") @TableField("describe") private String describe; @ApiModelProperty(value = "图片url") @TableField("img_url") private String imgUrl; @ApiModelProperty(value = "视频url") @TableField("video") private String video; @ApiModelProperty(value = "创建时间") @TableField("create_time") private LocalDateTime createTime; @ApiModelProperty(value = "创建人") @TableField("create_by") private Long createBy; } springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/IComplaintFlowService.java
New file @@ -0,0 +1,16 @@ package com.panzhihua.sangeshenbian.service; import com.panzhihua.sangeshenbian.entity.ComplaintFlow; import com.baomidou.mybatisplus.extension.service.IService; /** * <p> * 诉求流转记录表 服务类 * </p> * * @author * @since 2025-02-22 */ public interface IComplaintFlowService extends IService<ComplaintFlow> { } springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/IComplaintProgressService.java
New file @@ -0,0 +1,16 @@ package com.panzhihua.sangeshenbian.service; import com.panzhihua.sangeshenbian.entity.ComplaintProgress; import com.baomidou.mybatisplus.extension.service.IService; /** * <p> * 服务类 * </p> * * @author * @since 2025-02-22 */ public interface IComplaintProgressService extends IService<ComplaintProgress> { } springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/IComplaintService.java
New file @@ -0,0 +1,16 @@ package com.panzhihua.sangeshenbian.service; import com.panzhihua.sangeshenbian.entity.Complaint; import com.baomidou.mybatisplus.extension.service.IService; /** * <p> * 问题报告表 服务类 * </p> * * @author * @since 2025-02-22 */ public interface IComplaintService extends IService<Complaint> { void saveComplaint(Complaint complaint,Long userId); } springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintFlowServiceImpl.java
New file @@ -0,0 +1,20 @@ package com.panzhihua.sangeshenbian.service.impl; import com.panzhihua.sangeshenbian.entity.ComplaintFlow; import com.panzhihua.sangeshenbian.dao.ComplaintFlowMapper; import com.panzhihua.sangeshenbian.service.IComplaintFlowService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; /** * <p> * 诉求流转记录表 服务实现类 * </p> * * @author * @since 2025-02-22 */ @Service public class ComplaintFlowServiceImpl extends ServiceImpl<ComplaintFlowMapper, ComplaintFlow> implements IComplaintFlowService { } springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintProgressServiceImpl.java
New file @@ -0,0 +1,20 @@ package com.panzhihua.sangeshenbian.service.impl; import com.panzhihua.sangeshenbian.entity.ComplaintProgress; import com.panzhihua.sangeshenbian.dao.ComplaintProgressMapper; import com.panzhihua.sangeshenbian.service.IComplaintProgressService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; /** * <p> * 服务实现类 * </p> * * @author * @since 2025-02-22 */ @Service public class ComplaintProgressServiceImpl extends ServiceImpl<ComplaintProgressMapper, ComplaintProgress> implements IComplaintProgressService { } springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java
New file @@ -0,0 +1,63 @@ package com.panzhihua.sangeshenbian.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.panzhihua.common.utlis.DateUtils; import com.panzhihua.sangeshenbian.entity.Complaint; import com.panzhihua.sangeshenbian.enums.ProcessStatusEnum; import com.panzhihua.sangeshenbian.dao.ComplaintMapper; import com.panzhihua.sangeshenbian.service.IComplaintService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import java.text.SimpleDateFormat; import java.util.Date; import static cn.hutool.core.util.ObjectUtil.isNull; /** * <p> * 问题报告表 服务实现类 * </p> * * @author * @since 2025-02-22 */ @Service public class ComplaintServiceImpl extends ServiceImpl<ComplaintMapper, Complaint> implements IComplaintService { @Override public void saveComplaint(Complaint complaint,Long userId) { // 获取当前日期(年月日) String datePrefix = new SimpleDateFormat("yyyyMMdd").format(new Date()); // 查询当前日期的最大流水号 Complaint lastComplaint = getOne(new LambdaQueryWrapper<Complaint>() .likeRight(Complaint::getSerialNumber, datePrefix) // 查询以当前日期开头的流水号 .orderByDesc(Complaint::getSerialNumber) .last("limit 1")); String serialNumber; if (isNull(lastComplaint)) { // 如果当天没有记录,从 0001 开始 serialNumber = datePrefix + "0001"; } else { // 获取当前日期的最大流水号,并递增 String lastSerialNumber = lastComplaint.getSerialNumber(); int num = Integer.parseInt(lastSerialNumber.substring(lastSerialNumber.length() - 4)); // 提取后4位数字 serialNumber = datePrefix + String.format("%04d", num + 1); // 递增并格式化为4位 } // 设置流水号 complaint.setSerialNumber(serialNumber); // 设置其他字段 complaint.setStatus(ProcessStatusEnum.PROCESSING.getCode()); complaint.setCreateTime(DateUtils.getCurrentDate()); complaint.setCreateBy(userId); complaint.setUpdateBy(userId); complaint.setUpdateTime(DateUtils.getCurrentDate()); // 保存诉求记录 save(complaint); } } springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/ComplaintFlowMapper.xml
New file @@ -0,0 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.panzhihua.sangeshenbian.dao.ComplaintFlowMapper"> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/ComplaintMapper.xml
New file @@ -0,0 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.panzhihua.sangeshenbian.dao.ComplaintMapper"> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/ComplaintProgressMapper.xml
New file @@ -0,0 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.panzhihua.sangeshenbian.dao.ComplaintProgressMapper"> </mapper>