mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
新增问题反馈表记录用户反馈的问题, 提供查询接口和保存接口
This commit is contained in:
@@ -14,10 +14,10 @@ import com.jsowell.common.response.RestApiResponse;
|
||||
import com.jsowell.common.util.SMSUtil;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.MemberPlateNumberRelation;
|
||||
import com.jsowell.pile.domain.UserFrequentedStationInfo;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.vo.base.MemberWalletVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.InvoiceTitleVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.MemberVO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.MemberWalletInfoVO;
|
||||
@@ -59,6 +59,9 @@ public class MemberController extends BaseController {
|
||||
@Autowired
|
||||
private PileStationInfoService pileStationInfoService;
|
||||
|
||||
@Autowired
|
||||
private MemberFeedbackService memberFeedbackService;
|
||||
|
||||
/**
|
||||
* 下发短信接口 business
|
||||
* http://localhost:8080/uniapp/member/sendSMS
|
||||
@@ -677,4 +680,51 @@ public class MemberController extends BaseController {
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户反馈信息保存
|
||||
* @param request
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/saveFeedback")
|
||||
public RestApiResponse<?> saveFeedback(HttpServletRequest request, @RequestBody MemberFeedbackDTO dto) {
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
String memberId = getMemberIdByAuthorization(request);
|
||||
dto.setMemberId(memberId);
|
||||
memberFeedbackService.saveFeedback(dto);
|
||||
response = new RestApiResponse<>();
|
||||
}catch (Exception e) {
|
||||
logger.error("用户反馈信息保存 error", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
logger.info("用户反馈信息保存 result:{}", response);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户获取反馈信息列表
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getFeedbackList")
|
||||
public RestApiResponse<?> getFeedbackList(HttpServletRequest request) {
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
String memberId = getMemberIdByAuthorization(request);
|
||||
List<MemberFeedbackVO> list = memberFeedbackService.getFeedbackList(memberId);
|
||||
logger.info("用户获取反馈信息列表 list:{}", JSON.toJSONString(list));
|
||||
response = new RestApiResponse<>(ImmutableMap.of("list", list));
|
||||
}catch (Exception e) {
|
||||
logger.error("用户获取反馈信息列表 error", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
logger.info("用户获取反馈信息列表 result:{}", response);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.jsowell.pile.domain;
|
||||
|
||||
import com.jsowell.common.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class MemberFeedback extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 会员id
|
||||
*/
|
||||
private String memberId;
|
||||
|
||||
/**
|
||||
* 会员姓名
|
||||
*/
|
||||
private String memberName;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
private String contactInfo;
|
||||
|
||||
/**
|
||||
* 反馈类型 1=功能建议,2=系统BUG,3=服务投诉,4=站点问题,5=电桩问题,6=其他)
|
||||
*/
|
||||
private String feedbackType;
|
||||
|
||||
/**
|
||||
* 反馈内容
|
||||
*/
|
||||
private String feedbackContent;
|
||||
|
||||
/**
|
||||
* 处理状态(0=未处理,1=处理中,2=已处理,3=待跟进)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 管理员回复内容
|
||||
*/
|
||||
private String replyContent;
|
||||
|
||||
/**
|
||||
* 管理员回复时间
|
||||
*/
|
||||
private Date replyTime;
|
||||
|
||||
/**
|
||||
* 删除标记(0=未删除,1=已删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.jsowell.pile.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class MemberFeedbackDTO {
|
||||
|
||||
/**
|
||||
* 会员ID
|
||||
*/
|
||||
private String memberId;
|
||||
|
||||
/**
|
||||
* 反馈内容
|
||||
*/
|
||||
private String feedbackContent;
|
||||
|
||||
/**
|
||||
* 反馈类型
|
||||
*/
|
||||
private String feedbackType;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.jsowell.pile.mapper;
|
||||
|
||||
import com.jsowell.pile.domain.MemberFeedback;
|
||||
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface MemberFeedbackMapper {
|
||||
|
||||
/**
|
||||
* 保存会员反馈信息
|
||||
* @param memberFeedback
|
||||
* @return
|
||||
*/
|
||||
public int insertMemberFeedback(MemberFeedback memberFeedback);
|
||||
|
||||
/**
|
||||
* 根据会员ID查询会员反馈信息列表
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
List<MemberFeedbackVO> selectMemberFeedbackList(String memberId);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import com.jsowell.pile.dto.MemberFeedbackDTO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MemberFeedbackService {
|
||||
|
||||
/**
|
||||
* 用户反馈信息保存
|
||||
* @param dto
|
||||
*/
|
||||
void saveFeedback(MemberFeedbackDTO dto);
|
||||
|
||||
/**
|
||||
* 获取用户反馈信息列表
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
List<MemberFeedbackVO> getFeedbackList(String memberId);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.jsowell.pile.service.impl;
|
||||
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.pile.domain.MemberBasicInfo;
|
||||
import com.jsowell.pile.domain.MemberFeedback;
|
||||
import com.jsowell.pile.dto.MemberFeedbackDTO;
|
||||
import com.jsowell.pile.mapper.MemberBasicInfoMapper;
|
||||
import com.jsowell.pile.mapper.MemberFeedbackMapper;
|
||||
import com.jsowell.pile.service.MemberFeedbackService;
|
||||
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class MemberFeedbackServiceImpl implements MemberFeedbackService {
|
||||
|
||||
@Autowired
|
||||
MemberBasicInfoMapper memberBasicInfoMapper;
|
||||
|
||||
@Autowired
|
||||
MemberFeedbackMapper memberFeedbackMapper;
|
||||
|
||||
/**
|
||||
* 用户反馈保存
|
||||
* @param dto
|
||||
*/
|
||||
@Override
|
||||
public void saveFeedback(MemberFeedbackDTO dto) {
|
||||
MemberBasicInfo memberInfo = memberBasicInfoMapper.selectInfoByMemberId(dto.getMemberId());
|
||||
if (memberInfo == null) {
|
||||
throw new IllegalArgumentException("");
|
||||
}
|
||||
MemberFeedback memberFeedback = MemberFeedback.builder ()
|
||||
.memberId(dto.getMemberId())
|
||||
.memberName(memberInfo.getNickName())
|
||||
.contactInfo(memberInfo.getMobileNumber()) // 联系方式
|
||||
.feedbackType(dto.getFeedbackType()) //反馈类型
|
||||
.feedbackContent(dto.getFeedbackContent())
|
||||
.status(Constants.ONE)
|
||||
.createTime(DateUtils.getNowDate())
|
||||
.delFlag(Constants.ZERO)
|
||||
.build();
|
||||
|
||||
// 保存反馈信息至数据库
|
||||
memberFeedbackMapper.insertMemberFeedback(memberFeedback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户反馈列表
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MemberFeedbackVO> getFeedbackList(String memberId) {
|
||||
return memberFeedbackMapper.selectMemberFeedbackList(memberId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.jsowell.pile.vo.uniapp.customer;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
public class MemberFeedbackVO {
|
||||
|
||||
/**
|
||||
* 会员id
|
||||
*/
|
||||
private String memberId;
|
||||
|
||||
/**
|
||||
* 会员姓名
|
||||
*/
|
||||
private String memberName;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
private String contactInfo;
|
||||
|
||||
/**
|
||||
* 反馈类型 1=功能建议,2=系统BUG,3=服务投诉,4=站点问题,5=电桩问题,6=其他)
|
||||
*/
|
||||
private String feedbackType;
|
||||
|
||||
/**
|
||||
* 反馈内容
|
||||
*/
|
||||
private String feedbackContent;
|
||||
|
||||
/**
|
||||
* 处理状态(0=未处理,1=处理中,2=已处理,3=待跟进)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 管理员回复内容
|
||||
*/
|
||||
private String replyContent;
|
||||
|
||||
/**
|
||||
* 管理员回复时间
|
||||
*/
|
||||
private Date replyTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
<?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.jsowell.pile.mapper.MemberFeedbackMapper">
|
||||
|
||||
<resultMap type="com.jsowell.pile.domain.MemberFeedback" id="MemberFeedbackResultMap">
|
||||
<result property="id" column="id" />
|
||||
<result property="memberId" column="member_id" />
|
||||
<result property="memberName" column="member_name" />
|
||||
<result property="contactInfo" column="contact_info" />
|
||||
<result property="feedbackType" column="feedback_type" />
|
||||
<result property="feedbackContent" column="feedback_content" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="replyContent" column="reply_content" />
|
||||
<result property="replyTime" column="reply_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCarCouponRecordVo">
|
||||
select id, member_id, member_name, contact_info, feedback_type, feedback_content, status, create_time, update_time, reply_content, reply_time, del_flag from member_feedback
|
||||
</sql>
|
||||
|
||||
<insert id="insertMemberFeedback" parameterType="com.jsowell.pile.domain.MemberFeedback">
|
||||
insert into member_feedback
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="memberId != null">
|
||||
member_id,
|
||||
</if>
|
||||
<if test="memberName != null">
|
||||
member_name,
|
||||
</if>
|
||||
<if test="contactInfo != null">
|
||||
contact_info,
|
||||
</if>
|
||||
<if test="feedbackType != null">
|
||||
feedback_type,
|
||||
</if>
|
||||
<if test="feedbackContent != null">
|
||||
feedback_content,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="replyContent != null">
|
||||
reply_content,
|
||||
</if>
|
||||
<if test="replyTime != null">
|
||||
reply_time,
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
del_flag,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="memberId != null">
|
||||
#{memberId},
|
||||
</if>
|
||||
<if test="memberName != null">
|
||||
#{memberName},
|
||||
</if>
|
||||
<if test="contactInfo != null">
|
||||
#{contactInfo},
|
||||
</if>
|
||||
<if test="feedbackType != null">
|
||||
#{feedbackType},
|
||||
</if>
|
||||
<if test="feedbackContent != null">
|
||||
#{feedbackContent},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="replyContent != null">
|
||||
#{replyContent},
|
||||
</if>
|
||||
<if test="replyTime != null">
|
||||
#{replyTime},
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
#{delFlag},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="selectMemberFeedbackList" resultType="com.jsowell.pile.vo.uniapp.customer.MemberFeedbackVO">
|
||||
SELECT member_id, member_name, contact_info, feedback_type, feedback_content, status, create_time, update_time, reply_content, reply_time
|
||||
FROM member_feedback
|
||||
WHERE member_id = #{memberId} AND del_flag = '0'
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user