| New file | 
|  |  |  | 
|---|
|  |  |  | package com.dy.pipIrrGlobal.daoOp; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.pojoOp.OpeFeedback; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.voOp.Vofeedback; | 
|---|
|  |  |  | import org.apache.ibatis.annotations.Mapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Map; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author :WuZeYu | 
|---|
|  |  |  | * @Date :2024/7/29  16:45 | 
|---|
|  |  |  | * @LastEditTime :2024/7/29  16:45 | 
|---|
|  |  |  | * @Description | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Mapper | 
|---|
|  |  |  | public interface OpeFeedbackMapper extends BaseMapper<OpeFeedback> { | 
|---|
|  |  |  | int deleteByPrimaryKey(Long id); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | int insert(OpeFeedback record); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | int insertSelective(OpeFeedback record); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | OpeFeedback selectByPrimaryKey(Long id); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | int updateByPrimaryKeySelective(OpeFeedback record); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | int updateByPrimaryKey(OpeFeedback record); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Long getRecordCount(Map<String, Object> params); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<Vofeedback> getFeedbacks(Map<String, Object> params); | 
|---|
|  |  |  | } | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | package com.dy.pipIrrGlobal.daoOp; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.pojoOp.OpeFeedbackReply; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.voOp.Vofeedback; | 
|---|
|  |  |  | import org.apache.ibatis.annotations.Mapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Map; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author :WuZeYu | 
|---|
|  |  |  | * @Date :2024/7/31  15:35 | 
|---|
|  |  |  | * @LastEditTime :2024/7/31  15:35 | 
|---|
|  |  |  | * @Description | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Mapper | 
|---|
|  |  |  | public interface OpeFeedbackReplyMapper extends BaseMapper<OpeFeedbackReply> { | 
|---|
|  |  |  | int deleteByPrimaryKey(Long id); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | int insert(OpeFeedbackReply record); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | int insertSelective(OpeFeedbackReply record); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | OpeFeedbackReply selectByPrimaryKey(Long id); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | int updateByPrimaryKeySelective(OpeFeedbackReply record); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | int updateByPrimaryKey(OpeFeedbackReply record); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Long getRecordCount(Map<String, Object> params); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<Vofeedback> getFeedbackReplys(Map<String, Object> params); | 
|---|
|  |  |  | } | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | package com.dy.pipIrrGlobal.pojoOp; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson2.annotation.JSONField; | 
|---|
|  |  |  | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.annotation.IdType; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.annotation.TableId; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.annotation.TableName; | 
|---|
|  |  |  | import com.dy.common.po.BaseEntity; | 
|---|
|  |  |  | import com.fasterxml.jackson.annotation.JsonFormat; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.media.Schema; | 
|---|
|  |  |  | import jakarta.validation.constraints.NotNull; | 
|---|
|  |  |  | import lombok.*; | 
|---|
|  |  |  | import org.hibernate.validator.constraints.Length; | 
|---|
|  |  |  | import org.springframework.format.annotation.DateTimeFormat; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author :WuZeYu | 
|---|
|  |  |  | * @Date :2024/7/29  16:45 | 
|---|
|  |  |  | * @LastEditTime :2024/7/29  16:45 | 
|---|
|  |  |  | * @Description | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 问题反馈表 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @TableName(value="ope_feedback", autoResultMap = true) | 
|---|
|  |  |  | @Data | 
|---|
|  |  |  | @ToString | 
|---|
|  |  |  | @Builder | 
|---|
|  |  |  | @NoArgsConstructor | 
|---|
|  |  |  | @AllArgsConstructor | 
|---|
|  |  |  | @Schema(name = "问题反馈表") | 
|---|
|  |  |  | public class OpeFeedback implements BaseEntity { | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 主键 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @JSONField(serializeUsing= ObjectWriterImplToString.class) | 
|---|
|  |  |  | @TableId(type = IdType.INPUT) | 
|---|
|  |  |  | private Long id; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 反馈内容 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Length(message = "反馈内容不大于{max}字",  max = 200) | 
|---|
|  |  |  | private String content; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 图片;最多3张图片 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Length(message = "图片不大于{max}字", max = 255) | 
|---|
|  |  |  | private String image; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 音频;最多1个 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Length(message = "音频不大于{max}字",  max = 255) | 
|---|
|  |  |  | private String audio; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 视频;最多1个 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Length(message = "视频不大于{max}字,",  max = 255) | 
|---|
|  |  |  | private String video; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 联系电话;联系电话 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Length(message = "联系电话不大于{max}字,不小于{min}字", min = 11, max = 11) | 
|---|
|  |  |  | private String phone; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 农户ID | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private Long feedbackerId; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 反馈时间 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
|---|
|  |  |  | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | 
|---|
|  |  |  | private Date feedbackTime; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 经度 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private Double lng; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 纬度 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private Double lat; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 反馈状态;0-进行中,1-管理员结束,2-管理员删除 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private Byte state; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | package com.dy.pipIrrGlobal.pojoOp; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson2.annotation.JSONField; | 
|---|
|  |  |  | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.annotation.IdType; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.annotation.TableId; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.annotation.TableName; | 
|---|
|  |  |  | import com.dy.common.po.BaseEntity; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.media.Schema; | 
|---|
|  |  |  | import jakarta.validation.constraints.NotNull; | 
|---|
|  |  |  | import lombok.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author :WuZeYu | 
|---|
|  |  |  | * @Date :2024/7/31  15:35 | 
|---|
|  |  |  | * @LastEditTime :2024/7/31  15:35 | 
|---|
|  |  |  | * @Description | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 反馈回复记录表; | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @TableName(value="ope_feedback_reply", autoResultMap = true) | 
|---|
|  |  |  | @Data | 
|---|
|  |  |  | @ToString | 
|---|
|  |  |  | @Builder | 
|---|
|  |  |  | @NoArgsConstructor | 
|---|
|  |  |  | @AllArgsConstructor | 
|---|
|  |  |  | @Schema(name = "反馈回复记录表") | 
|---|
|  |  |  | public class OpeFeedbackReply implements BaseEntity { | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 主键 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @JSONField(serializeUsing= ObjectWriterImplToString.class) | 
|---|
|  |  |  | @TableId(type = IdType.INPUT) | 
|---|
|  |  |  | private Long id; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 反馈编号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @NotNull | 
|---|
|  |  |  | private Long feedbackId; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 回复内容 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @NotNull | 
|---|
|  |  |  | private String replyContent; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 回复时间 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private Date replyTime; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 回复人ID | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @NotNull | 
|---|
|  |  |  | private Long replierId; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | package com.dy.pipIrrGlobal.voOp; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.dy.common.po.BaseEntity; | 
|---|
|  |  |  | import lombok.Data; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author :WuZeYu | 
|---|
|  |  |  | * @Date :2024/7/30  9:48 | 
|---|
|  |  |  | * @LastEditTime :2024/7/30  9:48 | 
|---|
|  |  |  | * @Description | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Data | 
|---|
|  |  |  | public class Vofeedback implements BaseEntity { | 
|---|
|  |  |  | private static final long serialVersionUID = 202407301133001L; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 主键id | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private String id; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 反馈内容 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private String content; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 反馈图片 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private String image; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 反馈音频 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private String audio; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 反馈视频 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private String video; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 反馈人手机号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private String phone; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 反馈人id(农户ID) | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private String feedbackerId; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 反馈人名称 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private String feedbackerName; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 反馈时间 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private String feedbackTime; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 反馈地址 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private String lng;//经度 | 
|---|
|  |  |  | private String lat;//纬度 | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 反馈状态 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private Byte state; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | pipIrr: | 
|---|
|  |  |  | global: | 
|---|
|  |  |  | dev: false   #是否开发阶段,true或false | 
|---|
|  |  |  | dev: true   #是否开发阶段,true或false | 
|---|
|  |  |  | dsName: ym  #开发阶段,设置临时的数据库名称 | 
|---|
|  |  |  | mw: | 
|---|
|  |  |  | webPort: 8070 | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | <?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.dy.pipIrrGlobal.daoOp.OpeFeedbackMapper"> | 
|---|
|  |  |  | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoOp.OpeFeedback"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | <!--@Table ope_feedback--> | 
|---|
|  |  |  | <id column="id" jdbcType="BIGINT" property="id" /> | 
|---|
|  |  |  | <result column="content" jdbcType="VARCHAR" property="content" /> | 
|---|
|  |  |  | <result column="image" jdbcType="VARCHAR" property="image" /> | 
|---|
|  |  |  | <result column="audio" jdbcType="VARCHAR" property="audio" /> | 
|---|
|  |  |  | <result column="video" jdbcType="VARCHAR" property="video" /> | 
|---|
|  |  |  | <result column="phone" jdbcType="VARCHAR" property="phone" /> | 
|---|
|  |  |  | <result column="feedbacker_id" jdbcType="BIGINT" property="feedbackerId" /> | 
|---|
|  |  |  | <result column="feedback_time" jdbcType="TIMESTAMP" property="feedbackTime" /> | 
|---|
|  |  |  | <result column="lng" jdbcType="DOUBLE" property="lng" /> | 
|---|
|  |  |  | <result column="lat" jdbcType="DOUBLE" property="lat" /> | 
|---|
|  |  |  | <result column="state" jdbcType="TINYINT" property="state" /> | 
|---|
|  |  |  | </resultMap> | 
|---|
|  |  |  | <sql id="Base_Column_List"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | id, content, image, audio, video, phone, feedbacker_id, feedback_time, lng, lat, | 
|---|
|  |  |  | `state` | 
|---|
|  |  |  | </sql> | 
|---|
|  |  |  | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | select | 
|---|
|  |  |  | <include refid="Base_Column_List" /> | 
|---|
|  |  |  | from ope_feedback | 
|---|
|  |  |  | where id = #{id,jdbcType=BIGINT} | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | delete from ope_feedback | 
|---|
|  |  |  | where id = #{id,jdbcType=BIGINT} | 
|---|
|  |  |  | </delete> | 
|---|
|  |  |  | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeFeedback"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | insert into ope_feedback (id, content, image, | 
|---|
|  |  |  | audio, video, phone, | 
|---|
|  |  |  | feedbacker_id, feedback_time, lng, | 
|---|
|  |  |  | lat, `state`) | 
|---|
|  |  |  | values (#{id,jdbcType=BIGINT}, #{content,jdbcType=VARCHAR}, #{image,jdbcType=VARCHAR}, | 
|---|
|  |  |  | #{audio,jdbcType=VARCHAR}, #{video,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, | 
|---|
|  |  |  | #{feedbackerId,jdbcType=BIGINT}, #{feedbackTime,jdbcType=TIMESTAMP}, #{lng,jdbcType=DOUBLE}, | 
|---|
|  |  |  | #{lat,jdbcType=DOUBLE}, #{state,jdbcType=TINYINT}) | 
|---|
|  |  |  | </insert> | 
|---|
|  |  |  | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeFeedback"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | insert into ope_feedback | 
|---|
|  |  |  | <trim prefix="(" suffix=")" suffixOverrides=","> | 
|---|
|  |  |  | <if test="id != null"> | 
|---|
|  |  |  | id, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="content != null"> | 
|---|
|  |  |  | content, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="image != null"> | 
|---|
|  |  |  | image, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="audio != null"> | 
|---|
|  |  |  | audio, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="video != null"> | 
|---|
|  |  |  | video, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="phone != null"> | 
|---|
|  |  |  | phone, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="feedbackerId != null"> | 
|---|
|  |  |  | feedbacker_id, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="feedbackTime != null"> | 
|---|
|  |  |  | feedback_time, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="lng != null"> | 
|---|
|  |  |  | lng, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="lat != null"> | 
|---|
|  |  |  | lat, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="state != null"> | 
|---|
|  |  |  | `state`, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | <trim prefix="values (" suffix=")" suffixOverrides=","> | 
|---|
|  |  |  | <if test="id != null"> | 
|---|
|  |  |  | #{id,jdbcType=BIGINT}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="content != null"> | 
|---|
|  |  |  | #{content,jdbcType=VARCHAR}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="image != null"> | 
|---|
|  |  |  | #{image,jdbcType=VARCHAR}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="audio != null"> | 
|---|
|  |  |  | #{audio,jdbcType=VARCHAR}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="video != null"> | 
|---|
|  |  |  | #{video,jdbcType=VARCHAR}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="phone != null"> | 
|---|
|  |  |  | #{phone,jdbcType=VARCHAR}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="feedbackerId != null"> | 
|---|
|  |  |  | #{feedbackerId,jdbcType=BIGINT}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="feedbackTime != null"> | 
|---|
|  |  |  | #{feedbackTime,jdbcType=TIMESTAMP}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="lng != null"> | 
|---|
|  |  |  | #{lng,jdbcType=DOUBLE}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="lat != null"> | 
|---|
|  |  |  | #{lat,jdbcType=DOUBLE}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="state != null"> | 
|---|
|  |  |  | #{state,jdbcType=TINYINT}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | </insert> | 
|---|
|  |  |  | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeFeedback"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | update ope_feedback | 
|---|
|  |  |  | <set> | 
|---|
|  |  |  | <if test="content != null"> | 
|---|
|  |  |  | content = #{content,jdbcType=VARCHAR}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="image != null"> | 
|---|
|  |  |  | image = #{image,jdbcType=VARCHAR}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="audio != null"> | 
|---|
|  |  |  | audio = #{audio,jdbcType=VARCHAR}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="video != null"> | 
|---|
|  |  |  | video = #{video,jdbcType=VARCHAR}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="phone != null"> | 
|---|
|  |  |  | phone = #{phone,jdbcType=VARCHAR}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="feedbackerId != null"> | 
|---|
|  |  |  | feedbacker_id = #{feedbackerId,jdbcType=BIGINT}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="feedbackTime != null"> | 
|---|
|  |  |  | feedback_time = #{feedbackTime,jdbcType=TIMESTAMP}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="lng != null"> | 
|---|
|  |  |  | lng = #{lng,jdbcType=DOUBLE}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="lat != null"> | 
|---|
|  |  |  | lat = #{lat,jdbcType=DOUBLE}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="state != null"> | 
|---|
|  |  |  | `state` = #{state,jdbcType=TINYINT}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </set> | 
|---|
|  |  |  | where id = #{id,jdbcType=BIGINT} | 
|---|
|  |  |  | </update> | 
|---|
|  |  |  | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeFeedback"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | update ope_feedback | 
|---|
|  |  |  | set content = #{content,jdbcType=VARCHAR}, | 
|---|
|  |  |  | image = #{image,jdbcType=VARCHAR}, | 
|---|
|  |  |  | audio = #{audio,jdbcType=VARCHAR}, | 
|---|
|  |  |  | video = #{video,jdbcType=VARCHAR}, | 
|---|
|  |  |  | phone = #{phone,jdbcType=VARCHAR}, | 
|---|
|  |  |  | feedbacker_id = #{feedbackerId,jdbcType=BIGINT}, | 
|---|
|  |  |  | feedback_time = #{feedbackTime,jdbcType=TIMESTAMP}, | 
|---|
|  |  |  | lng = #{lng,jdbcType=DOUBLE}, | 
|---|
|  |  |  | lat = #{lat,jdbcType=DOUBLE}, | 
|---|
|  |  |  | `state` = #{state,jdbcType=TINYINT} | 
|---|
|  |  |  | where id = #{id,jdbcType=BIGINT} | 
|---|
|  |  |  | </update> | 
|---|
|  |  |  | <!--自定义查询数量--> | 
|---|
|  |  |  | <select id="getRecordCount" resultType="java.lang.Long"> | 
|---|
|  |  |  | select | 
|---|
|  |  |  | count(*) AS recordCount | 
|---|
|  |  |  | from ope_feedback ofb | 
|---|
|  |  |  | left join se_client sc on ofb.feedbacker_id = sc.id | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | <if test="feedbackerId != null"> | 
|---|
|  |  |  | and ofb.feedbacker_id = #{feedbackerId,jdbcType=BIGINT} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="feedbackerName != null"> | 
|---|
|  |  |  | and sc.name = #{feedbackerName,jdbcType=VARCHAR} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="timeStart != null"> | 
|---|
|  |  |  | and ofb.feedback_time >= #{timeStart,jdbcType=TIMESTAMP} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="timeStop != null"> | 
|---|
|  |  |  | and ofb.feedback_time <= #{timeStop,jdbcType=TIMESTAMP} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="state != null"> | 
|---|
|  |  |  | and ofb.`state` = #{state,jdbcType=TINYINT} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | <!--自定义查询--> | 
|---|
|  |  |  | <select id="getFeedbacks" resultType="com.dy.pipIrrGlobal.voOp.Vofeedback"> | 
|---|
|  |  |  | select | 
|---|
|  |  |  | cast(ofb.id as char) as id, | 
|---|
|  |  |  | ofb.content as content, | 
|---|
|  |  |  | ofb.image as image, | 
|---|
|  |  |  | ofb.audio as audio, | 
|---|
|  |  |  | ofb.video as video, | 
|---|
|  |  |  | ofb.phone as phone, | 
|---|
|  |  |  | cast(ofb.feedbacker_id as char) as feedbackerId, | 
|---|
|  |  |  | ofb.feedback_time as feedbackTime, | 
|---|
|  |  |  | ofb.lng as lng, | 
|---|
|  |  |  | ofb.lat as lat, | 
|---|
|  |  |  | ofb.`state` as state, | 
|---|
|  |  |  | sc.name feedbackerName | 
|---|
|  |  |  | from ope_feedback ofb | 
|---|
|  |  |  | left join se_client sc on ofb.feedbacker_id = sc.id | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | <if test="feedbackerId != null"> | 
|---|
|  |  |  | and ofb.feedbacker_id = #{feedbackerId,jdbcType=BIGINT} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="feedbackerName != null"> | 
|---|
|  |  |  | and sc.name = #{feedbackerName,jdbcType=VARCHAR} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="timeStart != null"> | 
|---|
|  |  |  | and ofb.feedback_time >= #{timeStart,jdbcType=TIMESTAMP} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="timeStop != null"> | 
|---|
|  |  |  | and ofb.feedback_time <= #{timeStop,jdbcType=TIMESTAMP} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="state != null"> | 
|---|
|  |  |  | and ofb.`state` = #{state,jdbcType=TINYINT} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | order by ofb.id desc | 
|---|
|  |  |  | <if test="pageCurr != null and pageSize != null"> | 
|---|
|  |  |  | LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | </mapper> | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | <?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.dy.pipIrrGlobal.daoOp.OpeFeedbackReplyMapper"> | 
|---|
|  |  |  | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoOp.OpeFeedbackReply"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | <!--@Table ope_feedback_reply--> | 
|---|
|  |  |  | <id column="id" jdbcType="BIGINT" property="id" /> | 
|---|
|  |  |  | <result column="feedback_id" jdbcType="BIGINT" property="feedbackId" /> | 
|---|
|  |  |  | <result column="reply_content" jdbcType="VARCHAR" property="replyContent" /> | 
|---|
|  |  |  | <result column="reply_time" jdbcType="TIMESTAMP" property="replyTime" /> | 
|---|
|  |  |  | <result column="replier_id" jdbcType="BIGINT" property="replierId" /> | 
|---|
|  |  |  | </resultMap> | 
|---|
|  |  |  | <sql id="Base_Column_List"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | id, feedback_id, reply_content, reply_time, replier_id | 
|---|
|  |  |  | </sql> | 
|---|
|  |  |  | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | select | 
|---|
|  |  |  | <include refid="Base_Column_List" /> | 
|---|
|  |  |  | from ope_feedback_reply | 
|---|
|  |  |  | where id = #{id,jdbcType=BIGINT} | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | delete from ope_feedback_reply | 
|---|
|  |  |  | where id = #{id,jdbcType=BIGINT} | 
|---|
|  |  |  | </delete> | 
|---|
|  |  |  | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeFeedbackReply"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | insert into ope_feedback_reply (id, feedback_id, reply_content, | 
|---|
|  |  |  | reply_time, replier_id) | 
|---|
|  |  |  | values (#{id,jdbcType=BIGINT}, #{feedbackId,jdbcType=BIGINT}, #{replyContent,jdbcType=VARCHAR}, | 
|---|
|  |  |  | #{replyTime,jdbcType=TIMESTAMP}, #{replierId,jdbcType=BIGINT}) | 
|---|
|  |  |  | </insert> | 
|---|
|  |  |  | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeFeedbackReply"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | insert into ope_feedback_reply | 
|---|
|  |  |  | <trim prefix="(" suffix=")" suffixOverrides=","> | 
|---|
|  |  |  | <if test="id != null"> | 
|---|
|  |  |  | id, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="feedbackId != null"> | 
|---|
|  |  |  | feedback_id, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="replyContent != null"> | 
|---|
|  |  |  | reply_content, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="replyTime != null"> | 
|---|
|  |  |  | reply_time, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="replierId != null"> | 
|---|
|  |  |  | replier_id, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | <trim prefix="values (" suffix=")" suffixOverrides=","> | 
|---|
|  |  |  | <if test="id != null"> | 
|---|
|  |  |  | #{id,jdbcType=BIGINT}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="feedbackId != null"> | 
|---|
|  |  |  | #{feedbackId,jdbcType=BIGINT}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="replyContent != null"> | 
|---|
|  |  |  | #{replyContent,jdbcType=VARCHAR}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="replyTime != null"> | 
|---|
|  |  |  | #{replyTime,jdbcType=TIMESTAMP}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="replierId != null"> | 
|---|
|  |  |  | #{replierId,jdbcType=BIGINT}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | </insert> | 
|---|
|  |  |  | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeFeedbackReply"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | update ope_feedback_reply | 
|---|
|  |  |  | <set> | 
|---|
|  |  |  | <if test="feedbackId != null"> | 
|---|
|  |  |  | feedback_id = #{feedbackId,jdbcType=BIGINT}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="replyContent != null"> | 
|---|
|  |  |  | reply_content = #{replyContent,jdbcType=VARCHAR}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="replyTime != null"> | 
|---|
|  |  |  | reply_time = #{replyTime,jdbcType=TIMESTAMP}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="replierId != null"> | 
|---|
|  |  |  | replier_id = #{replierId,jdbcType=BIGINT}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </set> | 
|---|
|  |  |  | where id = #{id,jdbcType=BIGINT} | 
|---|
|  |  |  | </update> | 
|---|
|  |  |  | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeFeedbackReply"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | update ope_feedback_reply | 
|---|
|  |  |  | set feedback_id = #{feedbackId,jdbcType=BIGINT}, | 
|---|
|  |  |  | reply_content = #{replyContent,jdbcType=VARCHAR}, | 
|---|
|  |  |  | reply_time = #{replyTime,jdbcType=TIMESTAMP}, | 
|---|
|  |  |  | replier_id = #{replierId,jdbcType=BIGINT} | 
|---|
|  |  |  | where id = #{id,jdbcType=BIGINT} | 
|---|
|  |  |  | </update> | 
|---|
|  |  |  | </mapper> | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | @MapperScan(basePackages={"com.dy.pipIrrGlobal.daoRm", "com.dy.pipIrrGlobal.daoPr", "com.dy.pipIrrGlobal.daoSe", "com.dy.pipIrrGlobal.daoBa"}) | 
|---|
|  |  |  | @MapperScan(basePackages={"com.dy.pipIrrGlobal.daoRm", "com.dy.pipIrrGlobal.daoPr", "com.dy.pipIrrGlobal.daoSe", "com.dy.pipIrrGlobal.daoBa","com.dy.pipIrrGlobal.daoOp"}) | 
|---|
|  |  |  | public class PipIrrWebOperationApplication { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static void main(String[] args) { | 
|---|
|  |  |  | 
|---|
|  |  |  | package com.dy.pipIrrOperation.feedback; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.dy.common.aop.SsoAop; | 
|---|
|  |  |  | import com.dy.common.webUtil.BaseResponse; | 
|---|
|  |  |  | import com.dy.common.webUtil.BaseResponseUtils; | 
|---|
|  |  |  | import com.dy.common.webUtil.QueryResultVo; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.pojoOp.OpeFeedback; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.voOp.Vofeedback; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.Parameter; | 
|---|
|  |  |  | import jakarta.validation.Valid; | 
|---|
|  |  |  | import lombok.RequiredArgsConstructor; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RestController; | 
|---|
|  |  |  | import org.springframework.http.MediaType; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  | import org.springframework.validation.BindingResult; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author ZhuBaoMin | 
|---|
|  |  |  | 
|---|
|  |  |  | public class FeedbackCtrl { | 
|---|
|  |  |  | private final FeedbackSv feedbackSv; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 添加问题反馈 | 
|---|
|  |  |  | * @param feedback | 
|---|
|  |  |  | * @param bindingResult | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE) | 
|---|
|  |  |  | @Transactional(rollbackFor = Exception.class) | 
|---|
|  |  |  | @SsoAop | 
|---|
|  |  |  | public BaseResponse<Boolean> add(@RequestBody @Valid OpeFeedback feedback, @Parameter(hidden = true) BindingResult bindingResult){ | 
|---|
|  |  |  | if (bindingResult != null && bindingResult.hasErrors()) { | 
|---|
|  |  |  | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (feedback.getFeedbackerId() == null){ | 
|---|
|  |  |  | return BaseResponseUtils.buildFail("请传入农户id"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Integer rec = Optional.ofNullable(feedbackSv.add(feedback)).orElse(0); | 
|---|
|  |  |  | if (rec == 0) { | 
|---|
|  |  |  | return BaseResponseUtils.buildFail("添加失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return BaseResponseUtils.buildSuccess(true); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 修改问题反馈状态 | 
|---|
|  |  |  | * @param feedback | 
|---|
|  |  |  | * @param bindingResult | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE) | 
|---|
|  |  |  | @Transactional(rollbackFor = Exception.class) | 
|---|
|  |  |  | @SsoAop() | 
|---|
|  |  |  | public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid OpeFeedback feedback, @Parameter(hidden = true) BindingResult bindingResult) { | 
|---|
|  |  |  | if (bindingResult != null && bindingResult.hasErrors()) { | 
|---|
|  |  |  | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (feedback.getId() == null){ | 
|---|
|  |  |  | return BaseResponseUtils.buildFail("请传入id"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (feedback.getState() == null){ | 
|---|
|  |  |  | return BaseResponseUtils.buildFail("请传入状态"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | int count ; | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | count = feedbackSv.update(feedback); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | log.error("修改问题反馈状态异常", e); | 
|---|
|  |  |  | return BaseResponseUtils.buildException(e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (count <= 0) { | 
|---|
|  |  |  | return BaseResponseUtils.buildFail("修改状态失败"); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | return BaseResponseUtils.buildSuccess(true); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 删除问题反馈 | 
|---|
|  |  |  | * @param map | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping(path = "delete") | 
|---|
|  |  |  | @Transactional(rollbackFor = Exception.class) | 
|---|
|  |  |  | @SsoAop() | 
|---|
|  |  |  | public BaseResponse<Boolean> delete(@RequestBody Map map) { | 
|---|
|  |  |  | if (map == null || map.size() <= 0) { | 
|---|
|  |  |  | return BaseResponseUtils.buildFail("请传入id"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Long id = Long.parseLong(map.get("id").toString()); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Integer recordCount = Optional.ofNullable(feedbackSv.delete(id)).orElse(0); | 
|---|
|  |  |  | if (recordCount == 0) { | 
|---|
|  |  |  | return BaseResponseUtils.buildFail("删除失败"); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | return BaseResponseUtils.buildSuccess(true); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | log.error("删除异常", e); | 
|---|
|  |  |  | return BaseResponseUtils.buildException(e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 分页查询问题反馈 | 
|---|
|  |  |  | * @param qo | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping(path = "getFeedbacks") | 
|---|
|  |  |  | @SsoAop() | 
|---|
|  |  |  | public BaseResponse<QueryResultVo<List<Vofeedback>>> getFeedbacks(QueryVo qo) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | QueryResultVo<List<Vofeedback>> res = feedbackSv.getFeedbacks(qo); | 
|---|
|  |  |  | if (res == null) { | 
|---|
|  |  |  | return BaseResponseUtils.buildFail("查询失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return BaseResponseUtils.buildSuccess(res); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | log.error("查询异常", e); | 
|---|
|  |  |  | return BaseResponseUtils.buildException(e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | package com.dy.pipIrrOperation.feedback; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.dy.common.webUtil.QueryResultVo; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.daoOp.OpeFeedbackMapper; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.pojoOp.OpeFeedback; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.voOp.Vofeedback; | 
|---|
|  |  |  | import lombok.RequiredArgsConstructor; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.apache.dubbo.common.utils.PojoUtils; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Map; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author ZhuBaoMin | 
|---|
|  |  |  | 
|---|
|  |  |  | @Service | 
|---|
|  |  |  | @RequiredArgsConstructor | 
|---|
|  |  |  | public class FeedbackSv { | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private OpeFeedbackMapper opeFeedbackMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 添加问题反馈 | 
|---|
|  |  |  | * @param feedback | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public int add(OpeFeedback feedback) { | 
|---|
|  |  |  | feedback.setState((byte)0); | 
|---|
|  |  |  | feedback.setFeedbackTime(new Date()); | 
|---|
|  |  |  | int i = opeFeedbackMapper.insertSelective(feedback); | 
|---|
|  |  |  | return i; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 修改问题反馈状态 | 
|---|
|  |  |  | * @param feedback | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public int update(OpeFeedback feedback) { | 
|---|
|  |  |  | int i = opeFeedbackMapper.updateByPrimaryKeySelective(feedback); | 
|---|
|  |  |  | return i; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 删除问题反馈 | 
|---|
|  |  |  | * @param id | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public int delete(Long id) { | 
|---|
|  |  |  | int i = opeFeedbackMapper.deleteByPrimaryKey(id); | 
|---|
|  |  |  | return i; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 获取问题反馈 | 
|---|
|  |  |  | * @param qo | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public QueryResultVo<List<Vofeedback>> getFeedbacks(QueryVo qo) { | 
|---|
|  |  |  | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); | 
|---|
|  |  |  | Long itemTotal = opeFeedbackMapper.getRecordCount(params); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | QueryResultVo<List<Vofeedback>> rsVo = new QueryResultVo<>(); | 
|---|
|  |  |  | rsVo.pageSize = qo.pageSize; | 
|---|
|  |  |  | rsVo.pageCurr = qo.pageCurr; | 
|---|
|  |  |  | rsVo.calculateAndSet(itemTotal, params); | 
|---|
|  |  |  | rsVo.obj = opeFeedbackMapper.getFeedbacks(params); | 
|---|
|  |  |  | return rsVo; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | package com.dy.pipIrrOperation.feedback; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.dy.common.webUtil.QueryConditionVo; | 
|---|
|  |  |  | import lombok.*; | 
|---|
|  |  |  | import org.springframework.format.annotation.DateTimeFormat; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author :WuZeYu | 
|---|
|  |  |  | * @Date :2024/7/30  9:32 | 
|---|
|  |  |  | * @LastEditTime :2024/7/30  9:32 | 
|---|
|  |  |  | * @Description | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Data | 
|---|
|  |  |  | @EqualsAndHashCode(callSuper = false) | 
|---|
|  |  |  | @ToString(callSuper = true) | 
|---|
|  |  |  | @NoArgsConstructor | 
|---|
|  |  |  | @AllArgsConstructor | 
|---|
|  |  |  | @Builder | 
|---|
|  |  |  | public class QueryVo extends QueryConditionVo { | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 反馈人id | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private String feedbackerId; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 反馈人姓名 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private String feedbackerName; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 反馈状态 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private Byte state; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 查询开始日期 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
|---|
|  |  |  | private Date timeStart; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 查询结束日期 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
|---|
|  |  |  | private Date timeStop; | 
|---|
|  |  |  | } | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | package com.dy.pipIrrOperation.feedbackReply; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.dy.common.aop.SsoAop; | 
|---|
|  |  |  | import com.dy.common.webUtil.BaseResponse; | 
|---|
|  |  |  | import com.dy.common.webUtil.BaseResponseUtils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.pojoOp.OpeFeedbackReply; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.Parameter; | 
|---|
|  |  |  | import jakarta.validation.Valid; | 
|---|
|  |  |  | import lombok.RequiredArgsConstructor; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.http.MediaType; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  | import org.springframework.validation.BindingResult; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.Objects; | 
|---|
|  |  |  | import java.util.Optional; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author :WuZeYu | 
|---|
|  |  |  | * @Date :2024/7/31  16:19 | 
|---|
|  |  |  | * @LastEditTime :2024/7/31  16:19 | 
|---|
|  |  |  | * @Description | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Slf4j | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | @RequestMapping(path="feedbackReply") | 
|---|
|  |  |  | @RequiredArgsConstructor | 
|---|
|  |  |  | public class FeedbackReplyCtrl { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private final FeedbackReplySv feedbackReplySv; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 添加问题反馈回复 | 
|---|
|  |  |  | * @param reply | 
|---|
|  |  |  | * @param bindingResult | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE) | 
|---|
|  |  |  | @Transactional(rollbackFor = Exception.class) | 
|---|
|  |  |  | @SsoAop | 
|---|
|  |  |  | public BaseResponse<Boolean> add(@RequestBody @Valid OpeFeedbackReply reply, @Parameter(hidden = true) BindingResult bindingResult){ | 
|---|
|  |  |  | if (bindingResult != null && bindingResult.hasErrors()) { | 
|---|
|  |  |  | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Integer rec = Optional.ofNullable(feedbackReplySv.add(reply)).orElse(0); | 
|---|
|  |  |  | if (rec == 0) { | 
|---|
|  |  |  | return BaseResponseUtils.buildFail("添加失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return BaseResponseUtils.buildSuccess(true); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | package com.dy.pipIrrOperation.feedbackReply; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author :WuZeYu | 
|---|
|  |  |  | * @Date :2024/7/31  16:19 | 
|---|
|  |  |  | * @LastEditTime :2024/7/31  16:19 | 
|---|
|  |  |  | * @Description | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public class FeedbackReplySv { | 
|---|
|  |  |  | } | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | package com.dy.pipIrrOperation.feedbackReply; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author :WuZeYu | 
|---|
|  |  |  | * @Date :2024/7/31  16:20 | 
|---|
|  |  |  | * @LastEditTime :2024/7/31  16:20 | 
|---|
|  |  |  | * @Description | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public class QueryVo { | 
|---|
|  |  |  | } | 
|---|