新增 用户反馈信息表

This commit is contained in:
Lemon
2025-06-30 14:09:47 +08:00
parent fd527e0467
commit 0f2f25ef0b
16 changed files with 690 additions and 579 deletions

View File

@@ -17,7 +17,7 @@ import com.jsowell.pile.domain.MemberPlateNumberRelation;
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.MemberFeedbackInfoVO;
import com.jsowell.pile.vo.uniapp.customer.InvoiceTitleVO;
import com.jsowell.pile.vo.uniapp.customer.MemberVO;
import com.jsowell.pile.vo.uniapp.customer.MemberWalletInfoVO;
@@ -60,7 +60,7 @@ public class MemberController extends BaseController {
private PileStationInfoService pileStationInfoService;
@Autowired
private MemberFeedbackService memberFeedbackService;
private MemberFeedbackInfoService memberFeedbackInfoService;
/**
* 下发短信接口 business
@@ -688,12 +688,12 @@ public class MemberController extends BaseController {
* @return
*/
@PostMapping("/saveFeedback")
public RestApiResponse<?> saveFeedback(HttpServletRequest request, @RequestBody MemberFeedbackDTO dto) {
public RestApiResponse<?> saveFeedback(HttpServletRequest request, @RequestBody MemberFeedbackInfoDTO dto) {
RestApiResponse<?> response = null;
try {
String memberId = getMemberIdByAuthorization(request);
dto.setMemberId(memberId);
memberFeedbackService.saveFeedback(dto);
memberFeedbackInfoService.saveFeedbackInfo(dto);
response = new RestApiResponse<>();
}catch (Exception e) {
logger.error("用户反馈信息保存 error", e);
@@ -714,7 +714,7 @@ public class MemberController extends BaseController {
RestApiResponse<?> response = null;
try {
String memberId = getMemberIdByAuthorization(request);
List<MemberFeedbackVO> list = memberFeedbackService.getFeedbackList(memberId);
List<MemberFeedbackInfoVO> list = memberFeedbackInfoService.getInfoListByMemberId(memberId);
logger.info("用户获取反馈信息列表 list:{}", JSON.toJSONString(list));
response = new RestApiResponse<>(ImmutableMap.of("list", list));
}catch (Exception e) {

View File

@@ -1,72 +0,0 @@
package com.jsowell.web.controller.pile;
import com.jsowell.common.annotation.Log;
import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.core.domain.AjaxResult;
import com.jsowell.common.core.page.TableDataInfo;
import com.jsowell.common.enums.BusinessType;
import com.jsowell.pile.dto.MemberFeedbackDTO;
import com.jsowell.pile.dto.QueryMemberFeedbackDTO;
import com.jsowell.pile.service.MemberFeedbackService;
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 会员反馈信息Controller
*
* @author jsowell
* @date 2023-10-12
*/
@RestController
@RequestMapping("/member/feedback")
public class MemberFeedbackController extends BaseController {
@Autowired
private MemberFeedbackService memberFeedbackService;
/**
* 分页查询会员反馈列表
*/
@PreAuthorize("@ss.hasPermi('member:feedback:list')")
@PostMapping("/list")
public TableDataInfo list(@RequestBody QueryMemberFeedbackDTO dto) {
List<MemberFeedbackVO> list = memberFeedbackService.selectFeedbackList(dto);
return getDataTable(list);
}
/**
* 根据ID获取反馈详情
*/
@PreAuthorize("@ss.hasPermi('member:feedback:query')")
@GetMapping("/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
MemberFeedbackVO feedback = memberFeedbackService.getFeedbackById(id);
return AjaxResult.success(feedback);
}
/**
* 修改反馈内容(回复)
*/
@PreAuthorize("@ss.hasPermi('member:feedback:edit')")
@Log(title = "修改会员反馈", businessType = BusinessType.UPDATE)
@PutMapping("/edit")
public AjaxResult edit(@RequestBody QueryMemberFeedbackDTO dto) {
memberFeedbackService.updateFeedback(dto);
return AjaxResult.success();
}
/**
* 删除反馈信息
*/
@PreAuthorize("@ss.hasPermi('member:feedback:remove')")
@Log(title = "删除会员反馈", businessType = BusinessType.DELETE)
@DeleteMapping
public AjaxResult remove(@RequestParam List<Long> ids) {
memberFeedbackService.deleteFeedbackByIds(ids);
return AjaxResult.success();
}
}

View File

@@ -0,0 +1,109 @@
package com.jsowell.web.controller.pile;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.jsowell.pile.service.MemberFeedbackInfoService;
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackInfoVO;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.jsowell.common.annotation.Log;
import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.core.domain.AjaxResult;
import com.jsowell.common.enums.BusinessType;
import com.jsowell.pile.domain.MemberFeedbackInfo;
import com.jsowell.common.util.poi.ExcelUtil;
import com.jsowell.common.core.page.TableDataInfo;
/**
* 用户问题反馈Controller
*
* @author jsowell
* @date 2025-06-26
*/
@RestController
@RequestMapping("/pile/memberFeedbackInfo")
public class MemberFeedbackInfoController extends BaseController {
@Autowired
private MemberFeedbackInfoService memberFeedbackInfoService;
/**
* 查询用户问题反馈列表
*/
@PreAuthorize("@ss.hasPermi('pile:info:list')")
@GetMapping("/list")
public TableDataInfo list(MemberFeedbackInfo memberFeedbackInfo) {
startPage();
List<MemberFeedbackInfo> list = memberFeedbackInfoService.selectMemberFeedbackInfoList(memberFeedbackInfo);
return getDataTable(list);
}
/**
* 导出用户问题反馈列表
*/
@PreAuthorize("@ss.hasPermi('pile:info:export')")
@Log(title = "用户问题反馈", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MemberFeedbackInfo memberFeedbackInfo) {
List<MemberFeedbackInfo> list = memberFeedbackInfoService.selectMemberFeedbackInfoList(memberFeedbackInfo);
ExcelUtil<MemberFeedbackInfo> util = new ExcelUtil<MemberFeedbackInfo>(MemberFeedbackInfo.class);
util.exportExcel(response, list, "用户问题反馈数据");
}
/**
* 获取用户问题反馈详细信息
*/
@PreAuthorize("@ss.hasPermi('pile:info:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(memberFeedbackInfoService.selectMemberFeedbackInfoById(id));
}
/**
* 新增用户问题反馈
*/
@PreAuthorize("@ss.hasPermi('pile:info:add')")
@Log(title = "用户问题反馈", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MemberFeedbackInfo memberFeedbackInfo) {
return toAjax(memberFeedbackInfoService.insertMemberFeedbackInfo(memberFeedbackInfo));
}
/**
* 修改用户问题反馈
*/
@PreAuthorize("@ss.hasPermi('pile:info:edit')")
@Log(title = "用户问题反馈", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MemberFeedbackInfo memberFeedbackInfo) {
return toAjax(memberFeedbackInfoService.updateMemberFeedbackInfo(memberFeedbackInfo));
}
/**
* 删除用户问题反馈
*/
@PreAuthorize("@ss.hasPermi('pile:info:remove')")
@Log(title = "用户问题反馈", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(memberFeedbackInfoService.deleteMemberFeedbackInfoByIds(ids));
}
/**
* 通过feedbackCode查询信息详情
* @param feedbackCode
* @return
*/
@GetMapping("/getMemberFeedbackDetailByCode/{feedbackCode}")
public MemberFeedbackInfoVO getMemberFeedbackDetailByCode(@PathVariable("feedbackCode") String feedbackCode) {
return memberFeedbackInfoService.getMemberFeedbackDetailByCode(feedbackCode);
}
}

View File

@@ -3,6 +3,8 @@ package com.jsowell.common.util.id;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.RandomUtil;
import java.util.Random;
/**
* ID生成器工具类
*
@@ -130,5 +132,47 @@ public class IdUtils {
return String.valueOf(num);
}
/**
* 生成以FB开头的流水号
* @param length 流水号总长度(必须大于14因为FB+年月日时分秒(14位)已经占用了16位)
* @return 生成的流水号
* @throws IllegalArgumentException 如果length小于16时抛出异常
*/
public static String generateFBSerialNumber(int length) {
if (length < 16) {
throw new IllegalArgumentException("长度至少为16位数");
}
// 获取当前时间并格式化为yyyyMMddHHmmss
String timePart = DateUtils.dateTimeNow(DateUtils.YYMMDDHHMMSS);
// 计算需要的随机数长度
int randomLength = length - 2 - 14; // 2(FB) + 14(时间部分)
// 生成随机数部分
String randomPart = generateRandomNumber(randomLength);
// 组合所有部分
return "FB" + timePart + randomPart;
}
/**
* 生成指定长度的随机数字字符串
* @param length 随机数长度
* @return 随机数字字符串
*/
private static String generateRandomNumber(int length) {
if (length <= 0) {
return "";
}
Random random = new Random();
StringBuilder sb = new StringBuilder(length);
for (int i = 0; i < length; i++) {
sb.append(random.nextInt(10));
}
return sb.toString();
}
}

View File

@@ -1,78 +0,0 @@
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=系统BUG3=服务投诉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;
}

View File

@@ -0,0 +1,89 @@
package com.jsowell.pile.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jsowell.common.annotation.Excel;
import com.jsowell.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 用户问题反馈对象 member_feedback_info
*
* @author jsowell
* @date 2025-06-26
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class MemberFeedbackInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
/**
* 反馈信息流水号
*/
private String feedbackCode;
/**
* 会员ID
*/
@Excel(name = "会员ID")
private String memberId;
/**
* 会员姓名/昵称
*/
@Excel(name = "会员姓名/昵称")
private String nickName;
/**
* 手机号码
*/
@Excel(name = "手机号码")
private String phoneNumber;
/**
* 反馈类型1=功能建议2=系统BUG3=服务投诉4=站点问题,5=电桩问题,6=其他)
*/
@Excel(name = "反馈类型", readConverterExp = "1==功能建议2=系统BUG3=服务投诉4=站点问题,5=电桩问题,6=其他")
private String feedbackType;
/**
* 反馈内容
*/
@Excel(name = "反馈内容")
private String feedbackContent;
/**
* 处理状态0=未处理,1=处理中,2=已处理,3=待跟进)
*/
@Excel(name = "处理状态", readConverterExp = "0==未处理,1=处理中,2=已处理,3=待跟进")
private String status;
/**
* 管理员回复内容
*/
@Excel(name = "管理员回复内容")
private String replyContent;
/**
* 管理员回复时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "管理员回复时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date replyTime;
/**
* 删除标识0-正常1-删除)
*/
private String delFlag;
}

View File

@@ -7,13 +7,23 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MemberFeedbackDTO {
public class MemberFeedbackInfoDTO {
/**
* 会员ID
*/
private String memberId;
/**
* 用户昵称
*/
private String nickName;
/**
* 手机号码
*/
private String phoneNumber;
/**
* 反馈内容
*/
@@ -21,9 +31,8 @@ public class MemberFeedbackDTO {
/**
* 反馈类型
* 1=功能建议2=系统BUG3=服务投诉4=站点问题,5=电桩问题,6=其他
*/
private String feedbackType;
}

View File

@@ -0,0 +1,78 @@
package com.jsowell.pile.mapper;
import java.util.List;
import com.jsowell.pile.domain.MemberFeedbackInfo;
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackInfoVO;
import org.springframework.stereotype.Repository;
/**
* 用户问题反馈Mapper接口
*
* @author jsowell
* @date 2025-06-26
*/
@Repository
public interface MemberFeedbackInfoMapper {
/**
* 查询用户问题反馈
*
* @param id 用户问题反馈主键
* @return 用户问题反馈
*/
public MemberFeedbackInfo selectMemberFeedbackInfoById(Long id);
/**
* 查询用户问题反馈列表
*
* @param memberFeedbackInfo 用户问题反馈
* @return 用户问题反馈集合
*/
public List<MemberFeedbackInfo> selectMemberFeedbackInfoList(MemberFeedbackInfo memberFeedbackInfo);
/**
* 新增用户问题反馈
*
* @param memberFeedbackInfo 用户问题反馈
* @return 结果
*/
public int insertMemberFeedbackInfo(MemberFeedbackInfo memberFeedbackInfo);
/**
* 修改用户问题反馈
*
* @param memberFeedbackInfo 用户问题反馈
* @return 结果
*/
public int updateMemberFeedbackInfo(MemberFeedbackInfo memberFeedbackInfo);
/**
* 删除用户问题反馈
*
* @param id 用户问题反馈主键
* @return 结果
*/
public int deleteMemberFeedbackInfoById(Long id);
/**
* 批量删除用户问题反馈
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMemberFeedbackInfoByIds(Long[] ids);
/**
* 根据memberId查询信息列表
* @param memberId
* @return
*/
List<MemberFeedbackInfoVO> getInfoListByMemberId(String memberId);
/**
* 通过反馈编码查询反馈信息详情
* @param feedbackCode
* @return
*/
MemberFeedbackInfoVO getMemberFeedbackDetailByCode(String feedbackCode);
}

View File

@@ -1,53 +0,0 @@
package com.jsowell.pile.mapper;
import com.jsowell.pile.domain.MemberFeedback;
import com.jsowell.pile.dto.QueryMemberFeedbackDTO;
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackVO;
import org.apache.ibatis.annotations.Mapper;
import java.util.Date;
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);
/**
* 根据条件查询会员反馈信息列表
* @param dto
* @return
*/
List<MemberFeedbackVO> getFeedbackList(QueryMemberFeedbackDTO dto);
/**
* 根据会员ID查询会员反馈信息
* @param id
* @return
*/
MemberFeedbackVO getFeedbackById(Long id);
/**
* 根据ID更新会员反馈信息
* @param dto
*/
void updateFeedback(QueryMemberFeedbackDTO dto);
/**
* 根据ID删除会员反馈信息
* @param id
*/
void deleteMemberFeedbackById(Long id);
}

View File

@@ -0,0 +1,83 @@
package com.jsowell.pile.service;
import java.util.List;
import com.jsowell.pile.domain.MemberFeedbackInfo;
import com.jsowell.pile.dto.MemberFeedbackInfoDTO;
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackInfoVO;
/**
* 用户问题反馈Service接口
*
* @author jsowell
* @date 2025-06-26
*/
public interface MemberFeedbackInfoService {
/**
* 查询用户问题反馈
*
* @param id 用户问题反馈主键
* @return 用户问题反馈
*/
public MemberFeedbackInfo selectMemberFeedbackInfoById(Long id);
/**
* 查询用户问题反馈列表
*
* @param memberFeedbackInfo 用户问题反馈
* @return 用户问题反馈集合
*/
public List<MemberFeedbackInfo> selectMemberFeedbackInfoList(MemberFeedbackInfo memberFeedbackInfo);
/**
* 新增用户问题反馈
*
* @param memberFeedbackInfo 用户问题反馈
* @return 结果
*/
public int insertMemberFeedbackInfo(MemberFeedbackInfo memberFeedbackInfo);
/**
* 修改用户问题反馈
*
* @param memberFeedbackInfo 用户问题反馈
* @return 结果
*/
public int updateMemberFeedbackInfo(MemberFeedbackInfo memberFeedbackInfo);
/**
* 批量删除用户问题反馈
*
* @param ids 需要删除的用户问题反馈主键集合
* @return 结果
*/
public int deleteMemberFeedbackInfoByIds(Long[] ids);
/**
* 删除用户问题反馈信息
*
* @param id 用户问题反馈主键
* @return 结果
*/
public int deleteMemberFeedbackInfoById(Long id);
/**
* 保存用户提出的反馈建议信息
* @param dto
*/
void saveFeedbackInfo(MemberFeedbackInfoDTO dto);
/**
* 通过memberId查询反馈信息列表
* @param memberId
* @return
*/
List<MemberFeedbackInfoVO> getInfoListByMemberId(String memberId);
/**
* 通过反馈编码查询反馈信息详情
* @param feedbackCode
* @return
*/
MemberFeedbackInfoVO getMemberFeedbackDetailByCode(String feedbackCode);
}

View File

@@ -1,49 +0,0 @@
package com.jsowell.pile.service;
import com.jsowell.pile.dto.MemberFeedbackDTO;
import com.jsowell.pile.dto.QueryMemberFeedbackDTO;
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);
/**
* 条件查询用户反馈信息列表 (管理后台使用)
* @param dto
* @return
*/
List<MemberFeedbackVO> selectFeedbackList(QueryMemberFeedbackDTO dto);
/**
* 根据memberId获取用户反馈信息
* @param id
* @return
*/
MemberFeedbackVO getFeedbackById(Long id);
/**
* 根据memberId删除用户反馈信息
* @param dto
*/
void updateFeedback(QueryMemberFeedbackDTO dto);
/**
* 根据ids删除用户反馈信息
* @param ids
*/
void deleteFeedbackByIds(List<Long> ids);
}

View File

@@ -0,0 +1,136 @@
package com.jsowell.pile.service.impl;
import java.util.List;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.id.IdUtils;
import com.jsowell.pile.dto.MemberFeedbackInfoDTO;
import com.jsowell.pile.service.MemberFeedbackInfoService;
import com.jsowell.pile.vo.uniapp.customer.MemberFeedbackInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jsowell.pile.mapper.MemberFeedbackInfoMapper;
import com.jsowell.pile.domain.MemberFeedbackInfo;
/**
* 用户问题反馈Service业务层处理
*
* @author jsowell
* @date 2025-06-26
*/
@Service
public class MemberFeedbackInfoServiceImpl implements MemberFeedbackInfoService {
@Autowired
private MemberFeedbackInfoMapper memberFeedbackInfoMapper;
/**
* 查询用户问题反馈
*
* @param id 用户问题反馈主键
* @return 用户问题反馈
*/
@Override
public MemberFeedbackInfo selectMemberFeedbackInfoById(Long id) {
return memberFeedbackInfoMapper.selectMemberFeedbackInfoById(id);
}
/**
* 查询用户问题反馈列表
*
* @param memberFeedbackInfo 用户问题反馈
* @return 用户问题反馈
*/
@Override
public List<MemberFeedbackInfo> selectMemberFeedbackInfoList(MemberFeedbackInfo memberFeedbackInfo) {
return memberFeedbackInfoMapper.selectMemberFeedbackInfoList(memberFeedbackInfo);
}
/**
* 新增用户问题反馈
*
* @param memberFeedbackInfo 用户问题反馈
* @return 结果
*/
@Override
public int insertMemberFeedbackInfo(MemberFeedbackInfo memberFeedbackInfo) {
memberFeedbackInfo.setCreateTime(DateUtils.getNowDate());
return memberFeedbackInfoMapper.insertMemberFeedbackInfo(memberFeedbackInfo);
}
/**
* 修改用户问题反馈
*
* @param memberFeedbackInfo 用户问题反馈
* @return 结果
*/
@Override
public int updateMemberFeedbackInfo(MemberFeedbackInfo memberFeedbackInfo) {
memberFeedbackInfo.setUpdateTime(DateUtils.getNowDate());
return memberFeedbackInfoMapper.updateMemberFeedbackInfo(memberFeedbackInfo);
}
/**
* 批量删除用户问题反馈
*
* @param ids 需要删除的用户问题反馈主键
* @return 结果
*/
@Override
public int deleteMemberFeedbackInfoByIds(Long[] ids) {
return memberFeedbackInfoMapper.deleteMemberFeedbackInfoByIds(ids);
}
/**
* 删除用户问题反馈信息
*
* @param id 用户问题反馈主键
* @return 结果
*/
@Override
public int deleteMemberFeedbackInfoById(Long id) {
return memberFeedbackInfoMapper.deleteMemberFeedbackInfoById(id);
}
/**
* 保存用户提出的反馈建议信息
* @param dto
*/
@Override
public void saveFeedbackInfo(MemberFeedbackInfoDTO dto) {
MemberFeedbackInfo info = MemberFeedbackInfo.builder()
.memberId(dto.getMemberId())
.nickName(dto.getNickName())
.phoneNumber(dto.getPhoneNumber())
.feedbackType(dto.getFeedbackType())
.feedbackContent(dto.getFeedbackContent())
.status(Constants.ZERO)
.build();
// 生成24位流水号
String feedbackCode = IdUtils.generateFBSerialNumber(24);
info.setFeedbackCode(feedbackCode);
insertMemberFeedbackInfo(info);
}
/**
* 通过memberId查询反馈信息列表
* @param memberId
* @return
*/
@Override
public List<MemberFeedbackInfoVO> getInfoListByMemberId(String memberId) {
return memberFeedbackInfoMapper.getInfoListByMemberId(memberId);
}
/**
* 通过反馈编码查询反馈信息详情
* @param feedbackCode
* @return
*/
@Override
public MemberFeedbackInfoVO getMemberFeedbackDetailByCode(String feedbackCode) {
return memberFeedbackInfoMapper.getMemberFeedbackDetailByCode(feedbackCode);
}
}

View File

@@ -1,110 +0,0 @@
package com.jsowell.pile.service.impl;
import com.github.pagehelper.PageHelper;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.redis.RedisCache;
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.dto.QueryMemberFeedbackDTO;
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);
}
/**
* 条件查询用户反馈列表 (后管)
* @param dto
* @return
*/
@Override
public List<MemberFeedbackVO> selectFeedbackList(QueryMemberFeedbackDTO dto) {
//分页
dto.setPageNum(dto.getPageNum() == null? 1 : dto.getPageNum());
dto.setPageSize(dto.getPageSize() == null? 10 : dto.getPageSize());
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
return memberFeedbackMapper.getFeedbackList(dto);
}
/**
* 根据id获取用户反馈信息
* @param id
* @return
*/
@Override
public MemberFeedbackVO getFeedbackById(Long id) {
return memberFeedbackMapper.getFeedbackById(id);
}
/**
* 根据id更新用户反馈信息
* @param dto
*/
@Override
public void updateFeedback(QueryMemberFeedbackDTO dto) {
memberFeedbackMapper.updateFeedback(dto);
}
/**
* 根据id删除用户反馈信息
* @param ids
*/
@Override
public void deleteFeedbackByIds(List<Long> ids) {
for (Long id : ids) {
memberFeedbackMapper.deleteMemberFeedbackById(id);
}
}
}

View File

@@ -7,10 +7,15 @@ import java.util.Date;
@Data
@Builder
public class MemberFeedbackVO {
public class MemberFeedbackInfoVO {
private Long id;
/**
* 反馈信息流水号
*/
private String feedbackCode;
/**
* 会员id
*/
@@ -19,12 +24,12 @@ public class MemberFeedbackVO {
/**
* 会员姓名
*/
private String memberName;
private String nickName;
/**
* 联系方式
*/
private String contactInfo;
private String phoneNumber;
/**
* 反馈类型 1=功能建议2=系统BUG3=服务投诉4=站点问题,5=电桩问题,6=其他

View File

@@ -0,0 +1,126 @@
<?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.MemberFeedbackInfoMapper">
<resultMap type="com.jsowell.pile.domain.MemberFeedbackInfo" id="MemberFeedbackInfoResult">
<result property="id" column="id" />
<result property="feedbackCode" column="feedback_code" />
<result property="memberId" column="member_id" />
<result property="nickName" column="nick_name" />
<result property="phoneNumber" column="phone_number" />
<result property="feedbackType" column="feedback_type" />
<result property="feedbackContent" column="feedback_content" />
<result property="status" column="status" />
<result property="replyContent" column="reply_content" />
<result property="replyTime" column="reply_time" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectMemberFeedbackInfoVo">
select id, feedback_code, member_id, nick_name, phone_number, feedback_type, feedback_content, status, reply_content, reply_time, create_time, update_time, del_flag from member_feedback_info
</sql>
<sql id="Base_Column_List">
id, feedback_code, member_id, nick_name, phone_number, feedback_type, feedback_content, status, reply_content, reply_time, create_time, update_time, del_flag
</sql>
<select id="selectMemberFeedbackInfoList" parameterType="com.jsowell.pile.domain.MemberFeedbackInfo" resultMap="MemberFeedbackInfoResult">
<include refid="selectMemberFeedbackInfoVo"/>
<where>
<if test="feedbackCode != null and feedbackCode != ''"> and feedback_code = #{feedbackCode}</if>
<if test="memberId != null and memberId != ''"> and member_id = #{memberId}</if>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
<if test="phoneNumber != null and phoneNumber != ''"> and phone_number = #{phoneNumber}</if>
<if test="feedbackType != null and feedbackType != ''"> and feedback_type = #{feedbackType}</if>
<if test="feedbackContent != null and feedbackContent != ''"> and feedback_content = #{feedbackContent}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="replyContent != null and replyContent != ''"> and reply_content = #{replyContent}</if>
<if test="replyTime != null "> and reply_time = #{replyTime}</if>
</where>
</select>
<select id="selectMemberFeedbackInfoById" parameterType="Long" resultMap="MemberFeedbackInfoResult">
<include refid="selectMemberFeedbackInfoVo"/>
where id = #{id}
</select>
<insert id="insertMemberFeedbackInfo" parameterType="com.jsowell.pile.domain.MemberFeedbackInfo" useGeneratedKeys="true" keyProperty="id">
insert into member_feedback_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="feedbackCode != null and feedbackCode != ''">feedback_code,</if>
<if test="memberId != null and memberId != ''">member_id,</if>
<if test="nickName != null and nickName != ''">nick_name,</if>
<if test="phoneNumber != null">phone_number,</if>
<if test="feedbackType != null and feedbackType != ''">feedback_type,</if>
<if test="feedbackContent != null and feedbackContent != ''">feedback_content,</if>
<if test="status != null and status != ''">status,</if>
<if test="replyContent != null">reply_content,</if>
<if test="replyTime != null">reply_time,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="feedbackCode != null and feedbackCode != ''">#{feedbackCode},</if>
<if test="memberId != null and memberId != ''">#{memberId},</if>
<if test="nickName != null and nickName != ''">#{nickName},</if>
<if test="phoneNumber != null">#{phoneNumber},</if>
<if test="feedbackType != null and feedbackType != ''">#{feedbackType},</if>
<if test="feedbackContent != null and feedbackContent != ''">#{feedbackContent},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="replyContent != null">#{replyContent},</if>
<if test="replyTime != null">#{replyTime},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateMemberFeedbackInfo" parameterType="com.jsowell.pile.domain.MemberFeedbackInfo">
update member_feedback_info
<trim prefix="SET" suffixOverrides=",">
<if test="feedbackCode != null and feedbackCode != ''">feedback_code = #{feedbackCode},</if>
<if test="memberId != null and memberId != ''">member_id = #{memberId},</if>
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
<if test="phoneNumber != null">phone_number = #{phoneNumber},</if>
<if test="feedbackType != null and feedbackType != ''">feedback_type = #{feedbackType},</if>
<if test="feedbackContent != null and feedbackContent != ''">feedback_content = #{feedbackContent},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="replyContent != null">reply_content = #{replyContent},</if>
<if test="replyTime != null">reply_time = #{replyTime},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMemberFeedbackInfoById" parameterType="Long">
delete from member_feedback_info where id = #{id}
</delete>
<delete id="deleteMemberFeedbackInfoByIds" parameterType="String">
delete from member_feedback_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="getInfoListByMemberId" resultType="com.jsowell.pile.vo.uniapp.customer.MemberFeedbackInfoVO">
SELECT
<include refid="Base_Column_List"/>
FROM member_feedback_info
WHERE member_id = #{memberId,jdbcType=VARCHAR}
</select>
<select id="getMemberFeedbackDetailByCode" resultType="com.jsowell.pile.vo.uniapp.customer.MemberFeedbackInfoVO">
select
<include refid="Base_Column_List"/>
from member_feedback_info
where feedback_code = #{feedbackCode,jdbcType=VARCHAR}
</select>
</mapper>

View File

@@ -1,206 +0,0 @@
<?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>
<update id="updateFeedback">
UPDATE member_feedback
<set>
<if test="status != null">
status = #{status},
</if>
<if test="replyContent != null">
reply_content = #{replyContent},
</if>
<if test="replyTime != null">
reply_time = #{replyTime},
</if>
</set>
WHERE id = #{id}
</update>
<delete id="deleteMemberFeedbackById">
DELETE
FROM member_feedback
WHERE id = #{id}
</delete>
<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'
ORDER BY create_time DESC
</select>
<select id="getFeedbackList" resultType="com.jsowell.pile.vo.uniapp.customer.MemberFeedbackVO">
SELECT
id,
member_id,
member_name,
contact_info,
feedback_type,
feedback_content,
status,
create_time,
update_time,
reply_content,
reply_time
FROM member_feedback
<where>
del_flag = '0'
<if test="memberId != null and memberId != ''">
AND member_id = #{memberId}
</if>
<if test="memberName != null and memberName != ''">
AND member_name = #{memberName}
</if>
<if test="feedbackType != null and feedbackType != ''">
AND feedback_type = #{feedbackType}
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
</where>
ORDER BY create_time DESC
</select>
<select id="getFeedbackById" resultType="com.jsowell.pile.vo.uniapp.customer.MemberFeedbackVO">
SELECT id,
member_id,
member_name,
contact_info,
feedback_type,
feedback_content,
status,
create_time,
update_time,
reply_content,
reply_time
FROM member_feedback
WHERE id = #{id}
AND del_flag = '0'
</select>
</mapper>