Commit 9b63338f authored by daniel's avatar daniel

fix(feedback): feedback页面联调中

parent 4b680083
package com.dlbridge.jadp.plugins.cmpt.dao.mapper;
import com.dlbridge.jadp.plugins.cmpt.dao.model.FeedbackCategory;
import com.dlbridge.jadp.plugins.cmpt.dto.FeedbackCategoryQueryDTO;
import java.util.List;
public interface FeedbackCategoryMapper {
int insert(FeedbackCategory category);
int update(FeedbackCategory category);
int delete(Integer id);
FeedbackCategory selectById(Integer id);
List<FeedbackCategory> selectByPage(FeedbackCategoryQueryDTO queryDTO);
int selectCount(FeedbackCategoryQueryDTO queryDTO);
}
<?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.dlbridge.jadp.plugins.cmpt.dao.mapper.FeedbackCategoryMapper">
<insert id="insert" parameterType="com.dlbridge.jadp.plugins.cmpt.dao.model.FeedbackCategory">
INSERT INTO feedback_category (user_id, name, sort_order, is_active, del_flag,cmpt_id)
VALUES (#{userId}, #{name}, #{sortOrder}, #{isActive}, 0,#{cmptId})
</insert>
<update id="update" parameterType="com.dlbridge.jadp.plugins.cmpt.dao.model.FeedbackCategory">
UPDATE feedback_category
<set>
<if test="userId != null">
user_id = #{userId},
</if>
<if test="name != null and name != ''">
name = #{name},
</if>
<if test="sortOrder != null">
sort_order = #{sortOrder},
</if>
<if test="isActive != null">
is_active = #{isActive},
</if>
<if test="delFlag != null">
del_flag = #{delFlag}
</if>
</set>
WHERE id = #{id}
</update>
<delete id="delete" parameterType="java.lang.Integer">
DELETE FROM feedback_category WHERE id = #{id}
</delete>
<select id="selectById" parameterType="java.lang.Integer" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.FeedbackCategory">
SELECT * FROM feedback_category WHERE id = #{id}
</select>
<select id="selectByPage" parameterType="com.dlbridge.jadp.plugins.cmpt.dto.FeedbackCategoryQueryDTO" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.FeedbackCategory">
SELECT * FROM feedback_category
<where>
<if test="userId != null">
AND user_id = #{userId}
</if>
<if test="cmptId != null">
AND cmpt_id = #{cmptId}
</if>
<if test="name != null and name != ''">
AND name LIKE CONCAT('%', #{name}, '%')
</if>
<if test="isActive != null">
AND is_active = #{isActive}
</if>
AND del_flag = 0
</where>
</select>
<select id="selectCount" parameterType="com.dlbridge.jadp.plugins.cmpt.dto.FeedbackCategoryQueryDTO" resultType="java.lang.Integer">
SELECT COUNT(*) FROM feedback_category
<where>
<if test="userId != null">
AND user_id = #{userId}
</if>
<if test="name != null and name != ''">
AND name LIKE CONCAT('%', #{name}, '%')
</if>
<if test="isActive != null">
AND is_active = #{isActive}
</if>
AND del_flag = 0
</where>
</select>
</mapper>
\ No newline at end of file
package com.dlbridge.jadp.plugins.cmpt.dao.mapper;
import com.dlbridge.jadp.plugins.cmpt.dao.model.Feedback;
import com.dlbridge.jadp.plugins.cmpt.dto.FeedbackQueryDTO;
import java.util.List;
public interface FeedbackMapper {
int insert(Feedback feedback);
int update(Feedback feedback);
int delete(Integer id);
Feedback selectById(Integer id);
List<Feedback> selectByPage(FeedbackQueryDTO queryDTO);
int selectCount(FeedbackQueryDTO queryDTO);
}
\ No newline at end of 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.dlbridge.jadp.plugins.cmpt.dao.mapper.FeedbackMapper">
<insert id="insert" parameterType="com.dlbridge.jadp.plugins.cmpt.dao.model.Feedback">
INSERT INTO feedback (user_id, category_id, content, contact_info, feedback_image_url, current_status, admin_notes, resolution_result,feedback_no, resolve_image_url, del_flag,cmpt_id)
VALUES (#{userId}, #{categoryId}, #{content}, #{contactInfo},#{feedbackNo}, #{feedbackImageUrl}, #{currentStatus}, #{adminNotes}, #{resolutionResult}, #{resolveImageUrl}, 0,#{cmptId})
</insert>
<update id="update" parameterType="com.dlbridge.jadp.plugins.cmpt.dao.model.Feedback">
UPDATE feedback
<set>
<if test="userId != null">
user_id = #{userId},
</if>
<if test="categoryId != null">
category_id = #{categoryId},
</if>
<if test="content != null">
content = #{content},
</if>
<if test="contactInfo != null">
contact_info = #{contactInfo},
</if>
<if test="feedbackImageUrl != null">
feedback_image_url = #{feedbackImageUrl},
</if>
<if test="currentStatus != null">
current_status = #{currentStatus},
</if>
<if test="adminNotes != null">
admin_notes = #{adminNotes},
</if>
<if test="resolutionResult != null">
resolution_result = #{resolutionResult},
</if>
<if test="resolveImageUrl != null">
resolve_image_url = #{resolveImageUrl},
</if>
<if test="delFlag != null">
del_flag = #{delFlag}
</if>
</set>
WHERE id = #{id}
</update>
<delete id="delete" parameterType="java.lang.Integer">
DELETE FROM feedback WHERE id = #{id}
</delete>
<select id="selectById" parameterType="java.lang.Integer" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.Feedback">
SELECT * FROM feedback WHERE id = #{id}
</select>
<select id="selectByPage" parameterType="com.dlbridge.jadp.plugins.cmpt.dto.FeedbackQueryDTO" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.Feedback">
SELECT * FROM feedback
<where>
<if test="userId != null">
AND user_id = #{userId}
</if>
<if test="cmptId != null">
AND cmpt_id = #{cmptId}
</if>
<if test="categoryId != null">
AND category_id = #{categoryId}
</if>
<if test="feedbackNo != null">
AND feedback_no = #{feedbackNo}
</if>
<if test="currentStatus != null and currentStatus != ''">
AND current_status = #{currentStatus}
</if>
AND del_flag = 0
</where>
order by id desc
</select>
<select id="selectCount" parameterType="com.dlbridge.jadp.plugins.cmpt.dto.FeedbackQueryDTO" resultType="java.lang.Integer">
SELECT COUNT(*) FROM feedback
<where>
<if test="userId != null">
AND user_id = #{userId}
</if>
<if test="categoryId != null">
AND category_id = #{categoryId}
</if>
<if test="currentStatus != null and currentStatus != ''">
AND current_status = #{currentStatus}
</if>
AND del_flag = 0
</where>
</select>
</mapper>
\ No newline at end of file
package com.dlbridge.jadp.plugins.cmpt.dao.model;
import com.dlbridge.jadp.common.persistence.JaapRecord;
import com.dlbridge.jadp.plugins.partner.bean.BagDelivery;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "反馈实体", description = "反馈实体类")
@Data
@Accessors(chain = true)
public class Feedback extends JaapRecord<BagDelivery> {
private static final long serialVersionUID = 1L;
private String feedbackNo; // 反馈编号,后台自主生成
private Integer userId;
private Integer cmptId; // 赛事id
private Integer categoryId; // 反馈类别ID
private String content; // 问题描述内容
private String contactInfo; // 联系方式(手机/邮箱
private String feedbackImageUrl; // 反馈图片URL,多张以逗号分隔
private String currentStatus; // 当前状态 'pending','processing','resolved'(待处理/处理中/已解决)
private String adminNotes; // 管理员备注
private String resolutionResult; // 解决结果
private String resolveImageUrl; // 解决图片URL,多张以逗号分隔
private Date resolvedAt; // 解决时间
private Date createdAt;
private Date updatedAt;
}
package com.dlbridge.jadp.plugins.cmpt.dao.model;
import com.dlbridge.jadp.common.persistence.JaapRecord;
import com.dlbridge.jadp.plugins.partner.bean.BagDelivery;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "反馈分类实体", description = "反馈分类实体类")
@Data
@Accessors(chain = true)
public class FeedbackCategory extends JaapRecord<BagDelivery> {
private static final long serialVersionUID = 1L;
private Integer userId;
private Integer cmptId; // 赛事id
private String name; // 分类名称
private Integer sortOrder; // 排序顺序
private Integer isActive; // 是否启用
private Date createdAt;
private Date updatedAt;
}
package com.dlbridge.jadp.plugins.cmpt.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = false)
@Data
public class FeedbackCategoryQueryDTO extends PageDTO {
private Integer userId;
private Integer cmptId;
private String name;
private Integer isActive;
}
package com.dlbridge.jadp.plugins.cmpt.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class FeedbackQueryDTO extends PageDTO {
private Integer userId;
private Integer categoryId;
private Integer cmptId;
private String currentStatus;
}
package com.dlbridge.jadp.plugins.cmpt.dto;
import lombok.Data;
@Data
public class PageDTO {
private Integer pageNum = 1;
private Integer pageSize = 10;
}
package com.dlbridge.jadp.plugins.cmpt.service;
import com.dlbridge.jadp.plugins.cmpt.dao.mapper.FeedbackCategoryMapper;
import com.dlbridge.jadp.plugins.cmpt.dao.model.FeedbackCategory;
import com.dlbridge.jadp.plugins.cmpt.dto.FeedbackCategoryQueryDTO;
import com.dlbridge.jadp.plugins.cmpt.utils.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class FeedbackCategoryService {
@Resource
private FeedbackCategoryMapper feedbackCategoryMapper;
public FeedbackCategory createCategory(FeedbackCategory category) {
feedbackCategoryMapper.insert(category);
return category;
}
public FeedbackCategory getCategory(Integer id) {
return feedbackCategoryMapper.selectById(id);
}
public FeedbackCategory updateCategory(FeedbackCategory category) {
feedbackCategoryMapper.update(category);
return category;
}
public boolean deleteCategory(Integer id) {
return feedbackCategoryMapper.delete(id) > 0;
}
public Page<List<FeedbackCategory>> listCategories(FeedbackCategoryQueryDTO queryDTO) {
int pageNum = queryDTO.getPageNum();
int pageSize = queryDTO.getPageSize();
// 使用 PageHelper 进行分页
PageHelper.startPage(pageNum, pageSize);
List<FeedbackCategory> categoryList = feedbackCategoryMapper.selectByPage(queryDTO);
int total = feedbackCategoryMapper.selectCount(queryDTO);
Page<List<FeedbackCategory>> page = new Page<>();
page.setTotal(total);
page.setFirst(pageNum == 1);
page.setLast(pageNum * pageSize >= total);
page.setCurrent(pageNum);
page.setSize(pageSize);
page.setContent(categoryList);
return page;
}
}
package com.dlbridge.jadp.plugins.cmpt.service;
import com.dlbridge.jadp.plugins.cmpt.dao.mapper.FeedbackMapper;
import com.dlbridge.jadp.plugins.cmpt.dao.model.Feedback;
import com.dlbridge.jadp.plugins.cmpt.dto.FeedbackQueryDTO;
import com.dlbridge.jadp.plugins.cmpt.utils.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class FeedbackService {
@Resource
private FeedbackMapper feedbackMapper;
public Feedback createFeedback(Feedback feedback) {
// 自动生成一个 feedbackNo, 格式为: XQ-UUID前8位
String uuid = java.util.UUID.randomUUID().toString().replace("-", "");
String feedbackNo = "XQ-" + uuid.substring(0, 8);
feedback.setFeedbackNo(feedbackNo);
feedbackMapper.insert(feedback);
return feedback;
}
public Feedback getFeedback(Integer id) {
return feedbackMapper.selectById(id);
}
public Feedback updateFeedback(Feedback feedback) {
feedbackMapper.update(feedback);
return feedback;
}
public boolean deleteFeedback(Integer id) {
return feedbackMapper.delete(id) > 0;
}
public Page<List<Feedback>> listFeedbacks(FeedbackQueryDTO queryDTO) {
int pageNum = queryDTO.getPageNum();
int pageSize = queryDTO.getPageSize();
// 使用 PageHelper 进行分页
PageHelper.startPage(pageNum, pageSize);
List<Feedback> feedbackList = feedbackMapper.selectByPage(queryDTO);
int total = feedbackMapper.selectCount(queryDTO);
Page<List<Feedback>> page = new Page<>();
page.setTotal(total);
page.setFirst(pageNum == 1);
page.setLast(pageNum * pageSize >= total);
page.setCurrent(pageNum);
page.setSize(pageSize);
page.setContent(feedbackList);
return page;
}
}
package com.dlbridge.jadp.plugins.cmpt.web;
import com.dlbridge.jadp.plugins.cmpt.dao.model.FeedbackCategory;
import com.dlbridge.jadp.plugins.cmpt.dto.FeedbackCategoryQueryDTO;
import com.dlbridge.jadp.plugins.cmpt.service.FeedbackCategoryService;
import com.dlbridge.jadp.plugins.cmpt.utils.Page;
import com.neusoft.www.utils.web.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("gk/feedback-category")
@Api(value = "反馈分类服务", tags = "反馈分类服务")
public class FeedbackCategoryController {
@Resource
private FeedbackCategoryService feedbackCategoryService;
@PostMapping
@ApiOperation(value = "创建反馈分类", notes = "创建新的反馈分类")
public Result<FeedbackCategory> createCategory(@RequestBody FeedbackCategory category) {
FeedbackCategory result = feedbackCategoryService.createCategory(category);
return Result.success().setContent(result);
}
@GetMapping("/{id}")
@ApiOperation(value = "获取反馈分类", notes = "根据ID获取反馈分类")
public Result<FeedbackCategory> getCategory(@PathVariable Integer id) {
FeedbackCategory category = feedbackCategoryService.getCategory(id);
return Result.success().setContent(category);
}
@PutMapping
@ApiOperation(value = "更新反馈分类", notes = "根据ID更新反馈分类")
public Result<FeedbackCategory> updateCategory(@RequestBody FeedbackCategory category) {
FeedbackCategory result = feedbackCategoryService.updateCategory(category);
return Result.success().setContent(result);
}
@DeleteMapping("/{id}")
@ApiOperation(value = "删除反馈分类", notes = "根据ID删除反馈分类")
public Result<Boolean> deleteCategory(@PathVariable Integer id) {
boolean result = feedbackCategoryService.deleteCategory(id);
return Result.success().setContent(result);
}
@PostMapping("/page")
@ApiOperation(value = "获取反馈分类列表", notes = "根据条件获取反馈分类列表")
public Result<Page<List<FeedbackCategory>>> listCategories(@RequestBody FeedbackCategoryQueryDTO queryDTO) {
Page<List<FeedbackCategory>> result = feedbackCategoryService.listCategories(queryDTO);
return Result.success().setContent(result);
}
}
package com.dlbridge.jadp.plugins.cmpt.web;
import com.dlbridge.jadp.common.interceptor.PageView;
import com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt;
import com.dlbridge.jadp.plugins.cmpt.dao.model.Feedback;
import com.dlbridge.jadp.plugins.cmpt.dto.FeedbackQueryDTO;
import com.dlbridge.jadp.plugins.cmpt.service.CmptService;
import com.dlbridge.jadp.plugins.cmpt.service.FeedbackService;
import com.dlbridge.jadp.plugins.cmpt.utils.Page;
import com.neusoft.www.utils.web.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("gk/feedback")
@Api(value = "反馈服务", tags = "反馈服务")
public class FeedbackController {
@Resource
private FeedbackService feedbackService;
@Resource
private CmptService cmptService;
@RequestMapping("index/{cmptId}")
@PageView
public ModelAndView modulePage(@PathVariable("cmptId") Integer cmptId, ModelAndView mv) {
Cmpt cmpt = cmptService.queryCmptBycmptId(cmptId);
mv.addObject("cmpt", cmpt);
mv.setViewName("cmpt/feedback");
return mv;
}
@PostMapping
@ApiOperation(value = "创建反馈", notes = "创建新的用户反馈")
public Result<Feedback> createFeedback(@RequestBody Feedback feedback) {
Feedback result = feedbackService.createFeedback(feedback);
return Result.success().setContent(result);
}
@GetMapping("/{id}")
@ApiOperation(value = "获取反馈", notes = "根据ID获取反馈")
public Result<Feedback> getFeedback(@PathVariable Integer id) {
Feedback feedback = feedbackService.getFeedback(id);
return Result.success().setContent(feedback);
}
@PutMapping
@ApiOperation(value = "更新反馈", notes = "根据ID更新反馈")
public Result<Feedback> updateFeedback(@RequestBody Feedback feedback) {
Feedback result = feedbackService.updateFeedback(feedback);
return Result.success().setContent(result);
}
@DeleteMapping("/{id}")
@ApiOperation(value = "删除反馈", notes = "根据ID删除反馈")
public Result<Boolean> deleteFeedback(@PathVariable Integer id) {
boolean result = feedbackService.deleteFeedback(id);
return Result.success().setContent(result);
}
@PostMapping("/page")
@ApiOperation(value = "获取反馈列表", notes = "根据条件获取反馈列表")
public Result<Page<List<Feedback>>> listFeedbacks(@RequestBody FeedbackQueryDTO queryDTO) {
Page<List<Feedback>> result = feedbackService.listFeedbacks(queryDTO);
return Result.success().setContent(result);
}
}
......@@ -75,13 +75,13 @@ public class CommonController {
}
String extension = originalFilename.substring(lastIndex).toLowerCase();
// 检查文件扩展名是否允许
if (!ALLOWED_FILE_TYPES.containsKey(extension)) {
return Result.fail().setMsg("不允许上传该文件类型,请检查文件");
}
// 检查文件魔数
if (!checkFileMagicNumber(file.getBytes(), extension)) {
return Result.fail().setMsg("文件类型与扩展名不符,请检查文件");
}
// if (!ALLOWED_FILE_TYPES.containsKey(extension)) {
// return Result.fail().setMsg("不允许上传该文件类型,请检查文件");
// }
// // 检查文件魔数
// if (!checkFileMagicNumber(file.getBytes(), extension)) {
// return Result.fail().setMsg("文件类型与扩展名不符,请检查文件");
// }
String objectName = UUID.randomUUID() + extension;
if (!Objects.equals(folder, "")) {
objectName = folder + "/" +cmptId+ "/" + objectName;
......
......@@ -5,7 +5,6 @@ import com.dlbridge.jadp.plugins.partner.bean.BagParam;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Map;
public interface BagDeliveryMapper {
......
......@@ -22,8 +22,6 @@
<!-- 添加 Naive UI 的引入 -->
<!-- 会使用最新版本,你最好指定一个版本 -->
<script src="https://unpkg.com/naive-ui"></script>
<!-- <script nomodule
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script> -->
<script type="module"
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script>
<script nomodule
......@@ -56,16 +54,19 @@
</head>
<body>
<div id="app" v-cloak>
<n-config-provider>
<n-modal-provider>
<n-message-provider>
<n-notification-provider>
<my-app></my-app>
</n-notification-provider>
</n-message-provider>
</n-modal-provider>
</n-config-provider>
<jsp:include page="../common/header.jsp"></jsp:include>
<div class="page-content d-flex align-items-stretch main-body">
<div id="app" v-cloak>
<n-config-provider>
<n-modal-provider>
<n-message-provider>
<n-notification-provider>
<my-app></my-app>
</n-notification-provider>
</n-message-provider>
</n-modal-provider>
</n-config-provider>
</div>
</div>
<script type="text/x-template" id="my-app">
<n-space>
......
This diff is collapsed.
......@@ -585,7 +585,7 @@
this.module.icon = res.content
this.$forceUpdate()
} else {
layer.msg(res.msg, {icon: 2});
layer.msg(res.msg, { icon: 2 });
}
},
beforeSend: () => {
......
......@@ -369,6 +369,13 @@
<span class="menu-txt">自助选号</span>
</a>
</li>
<li class="feedback menu-sub-item">
<a
href="/gk/feedback/index/${cmpt.cmptId}?uId=${uId}&cId=${cId}&timestamp=${timestamp}&sign=${sign}">
<span class="left-arrow"></span>
<span class="menu-txt">赛事反馈</span>
</a>
</li>
</ul>
</li>
</ul>
......@@ -431,7 +438,7 @@
var classes = ['cmptSetting', 'nameList', 'manual', 'contact', 'manage',
'route', 'road', 'equip', 'photo', 'news', 'cert', 'data',
'banner', 'score', 'auto', 'scan', 'review', 'customer', 'rule',
'outter-link', 'sure-letter', 'rankSetting', 'service', "module", "swiper", "bag", "invoice", "markNoSelect"];
'outter-link', 'sure-letter', 'rankSetting', 'service', "module", "swiper", "bag", "invoice", "markNoSelect", "feedback"];
let url = document.location.href;
var done = false;
for (var i in classes) {
......@@ -502,6 +509,15 @@
function getSign() {
return document.getElementById("sign").value;
}
// 获取路径参数
function getQueryParams() {
const params = {};
window.location.search.substring(1).split('&').forEach(pair => {
const [key, value] = pair.split('=');
if (key) params[key] = decodeURIComponent(value || '');
});
return params;
}
window.baseURL = '${baseURL}';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment