From 84df8663a1c6aa4dd456e136408b3d5fff079f8f Mon Sep 17 00:00:00 2001 From: wuzeyu <1223318623@qq.com> Date: 星期三, 31 七月 2024 16:37:52 +0800 Subject: [PATCH] 问题反馈增加、删除、改状态、分页查 --- pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/QueryVo.java | 45 ++ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voOp/Vofeedback.java | 63 +++ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoOp/OpeFeedbackMapper.java | 34 ++ pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/FeedbackCtrl.java | 117 +++++++ pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeFeedbackMapper.xml | 236 ++++++++++++++ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoOp/OpeFeedbackReply.java | 63 +++ pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedbackReply/QueryVo.java | 10 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoOp/OpeFeedback.java | 100 ++++++ pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeFeedbackReplyMapper.xml | 102 ++++++ pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedbackReply/FeedbackReplySv.java | 10 pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/PipIrrWebOperationApplication.java | 2 pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/FeedbackSv.java | 61 +++ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoOp/OpeFeedbackReplyMapper.java | 34 ++ pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml | 2 pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedbackReply/FeedbackReplyCtrl.java | 60 +++ 15 files changed, 935 insertions(+), 4 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoOp/OpeFeedbackMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoOp/OpeFeedbackMapper.java new file mode 100644 index 0000000..29a60a9 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoOp/OpeFeedbackMapper.java @@ -0,0 +1,34 @@ +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); +} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoOp/OpeFeedbackReplyMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoOp/OpeFeedbackReplyMapper.java new file mode 100644 index 0000000..66776cb --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoOp/OpeFeedbackReplyMapper.java @@ -0,0 +1,34 @@ +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); +} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoOp/OpeFeedback.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoOp/OpeFeedback.java new file mode 100644 index 0000000..2680a36 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoOp/OpeFeedback.java @@ -0,0 +1,100 @@ +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; + + +} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoOp/OpeFeedbackReply.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoOp/OpeFeedbackReply.java new file mode 100644 index 0000000..375dc02 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoOp/OpeFeedbackReply.java @@ -0,0 +1,63 @@ +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; + + /** + * 鍥炲浜篒D + */ + @NotNull + private Long replierId; + + +} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voOp/Vofeedback.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voOp/Vofeedback.java new file mode 100644 index 0000000..9617df7 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voOp/Vofeedback.java @@ -0,0 +1,63 @@ +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; + /** + * 鍙嶉浜篿d(鍐滄埛ID) + */ + private String feedbackerId; + /** + * 鍙嶉浜哄悕绉� + */ + private String feedbackerName; + /** + * 鍙嶉鏃堕棿 + */ + private String feedbackTime; + /** + * 鍙嶉鍦板潃 + */ + private String lng;//缁忓害 + private String lat;//绾害 + /** + * 鍙嶉鐘舵�� + */ + private Byte state; + + + +} diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml b/pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml index e39b17a..408b44e 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml @@ -72,7 +72,7 @@ pipIrr: global: - dev: false #鏄惁寮�鍙戦樁娈碉紝true鎴杅alse + dev: true #鏄惁寮�鍙戦樁娈碉紝true鎴杅alse dsName: ym #寮�鍙戦樁娈碉紝璁剧疆涓存椂鐨勬暟鎹簱鍚嶇О mw: webPort: 8070 diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeFeedbackMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeFeedbackMapper.xml new file mode 100644 index 0000000..f660158 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeFeedbackMapper.xml @@ -0,0 +1,236 @@ +<?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> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeFeedbackReplyMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeFeedbackReplyMapper.xml new file mode 100644 index 0000000..1b5bbf5 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeFeedbackReplyMapper.xml @@ -0,0 +1,102 @@ +<?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> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/PipIrrWebOperationApplication.java b/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/PipIrrWebOperationApplication.java index 204845b..afaf09e 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/PipIrrWebOperationApplication.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/PipIrrWebOperationApplication.java @@ -18,7 +18,7 @@ }) } ) -@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) { diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/FeedbackCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/FeedbackCtrl.java index 32a36f4..dcc040c 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/FeedbackCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/FeedbackCtrl.java @@ -1,9 +1,21 @@ 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 @@ -19,4 +31,105 @@ 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("璇蜂紶鍏ュ啘鎴穒d"); + } + 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("璇蜂紶鍏d"); + } + 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("璇蜂紶鍏d"); + } + 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()); + } + } } diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/FeedbackSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/FeedbackSv.java index 2977e0c..07a54d9 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/FeedbackSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/FeedbackSv.java @@ -1,8 +1,18 @@ 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 @@ -15,4 +25,55 @@ @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; + } } diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/QueryVo.java b/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/QueryVo.java new file mode 100644 index 0000000..3622ecd --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/QueryVo.java @@ -0,0 +1,45 @@ +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 { + /** + * 鍙嶉浜篿d + */ + 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; +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedbackReply/FeedbackReplyCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedbackReply/FeedbackReplyCtrl.java new file mode 100644 index 0000000..8a93fbb --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedbackReply/FeedbackReplyCtrl.java @@ -0,0 +1,60 @@ +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); + } + + +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedbackReply/FeedbackReplySv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedbackReply/FeedbackReplySv.java new file mode 100644 index 0000000..2d6e818 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedbackReply/FeedbackReplySv.java @@ -0,0 +1,10 @@ +package com.dy.pipIrrOperation.feedbackReply; + +/** + * @author :WuZeYu + * @Date :2024/7/31 16:19 + * @LastEditTime :2024/7/31 16:19 + * @Description + */ +public class FeedbackReplySv { +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedbackReply/QueryVo.java b/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedbackReply/QueryVo.java new file mode 100644 index 0000000..fb41126 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedbackReply/QueryVo.java @@ -0,0 +1,10 @@ +package com.dy.pipIrrOperation.feedbackReply; + +/** + * @author :WuZeYu + * @Date :2024/7/31 16:20 + * @LastEditTime :2024/7/31 16:20 + * @Description + */ +public class QueryVo { +} -- Gitblit v1.8.0