From 4b26e3b108dff9a96873a66aa20e94096e68e4cb Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期四, 23 一月 2025 18:30:25 +0800
Subject: [PATCH] bug修改
---
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderEvaluateController.java | 50 ++++++++++++++++++++++++++++++++++----------------
1 files changed, 34 insertions(+), 16 deletions(-)
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderEvaluateController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderEvaluateController.java
index ab31311..5723d6b 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderEvaluateController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderEvaluateController.java
@@ -1,9 +1,14 @@
package com.ruoyi.order.controller;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.PageInfo;
+import com.ruoyi.common.security.annotation.Logical;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.order.api.model.TOrderEvaluate;
+import com.ruoyi.order.api.model.TOrderEvaluateTag;
import com.ruoyi.order.api.query.TOrderEvaluateQuery;
import com.ruoyi.order.api.vo.SiteDetailEvaluateVO;
import com.ruoyi.order.api.vo.TOrderEvaluateVO;
@@ -11,11 +16,14 @@
import com.ruoyi.order.dto.GetOrderEvaluatePageListDTO;
import com.ruoyi.order.dto.OrderEvaluateVo;
import com.ruoyi.order.service.TOrderEvaluateService;
+import com.ruoyi.order.service.TOrderEvaluateTagService;
+import com.ruoyi.order.vo.ReplyEvaluationVO;
import com.ruoyi.other.api.vo.TEvaluationTagVO;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
@@ -34,12 +42,21 @@
@Autowired
private TOrderEvaluateService orderEvaluateService;
+
+ @Resource
+ private TOrderEvaluateTagService orderEvaluateTagService;
+
+ @Resource
+ private TokenService tokenService;
+
+
+
@ApiOperation(tags = {"小程序-订单评价"},value = "充电订单评价标签及数量查询")
- @PostMapping(value = "/getTagCount")
- public AjaxResult<List<TEvaluationTagVO>> getTagCount() {
- return AjaxResult.ok(orderEvaluateService.getTagCount());
+ @GetMapping(value = "/getTagCount")
+ public AjaxResult<List<TEvaluationTagVO>> getTagCount(@ApiParam(value = "站点id")Integer siteId) {
+ return AjaxResult.ok(orderEvaluateService.getTagCount(siteId));
}
@ApiOperation(tags = {"小程序-订单评价"},value = "充电订单评价分页列表查询")
@@ -53,8 +70,8 @@
-
- @GetMapping(value = "/getPageList")
+ @RequiresPermissions(value = {"/chargeEvaluation/list"}, logical = Logical.OR)
+ @PostMapping(value = "/getPageList")
@ApiOperation(value = "获取充电评价列表", tags = {"管理后台-充电评价"})
public AjaxResult<PageInfo<GetOrderEvaluatePageListDTO>> getPageList(@RequestBody GetOrderEvaluatePageList pageList){
PageInfo<GetOrderEvaluatePageListDTO> list = orderEvaluateService.getPageList(pageList);
@@ -62,23 +79,24 @@
}
-
- @DeleteMapping(value = "/delOrderEvaluate")
+ @RequiresPermissions(value = {"/chargeEvaluation/del"}, logical = Logical.OR)
+ @DeleteMapping(value = "/delOrderEvaluate/{id}")
@ApiOperation(value = "删除充电评价", tags = {"管理后台-充电评价"})
- public AjaxResult delOrderEvaluate(@PathVariable Long id){
+ public AjaxResult delOrderEvaluate(@PathVariable("id") Long id){
TOrderEvaluate orderEvaluate = orderEvaluateService.getById(id);
orderEvaluateService.removeById(orderEvaluate);
+ orderEvaluateTagService.remove(new LambdaQueryWrapper<TOrderEvaluateTag>().eq(TOrderEvaluateTag::getOrderEvaluateId, id));
return AjaxResult.success();
}
-
+ @RequiresPermissions(value = {"/chargeEvaluation/reply"}, logical = Logical.OR)
@PostMapping(value = "/replyEvaluation")
@ApiOperation(value = "充电评价回复", tags = {"管理后台-充电评价"})
- public AjaxResult replyEvaluation(@PathVariable("id") Long id, @RequestParam("reply") String reply){
- TOrderEvaluate orderEvaluate = orderEvaluateService.getById(id);
- reply = reply.replaceAll("& #40;", "(")
+ public AjaxResult replyEvaluation(@RequestBody ReplyEvaluationVO vo){
+ TOrderEvaluate orderEvaluate = orderEvaluateService.getById(vo.getId());
+ String reply = vo.getReply().replaceAll("& #40;", "(")
.replaceAll("& #41;", ")")
.replaceAll("& #40;", "(")
.replaceAll("& #41;", ")")
@@ -93,10 +111,10 @@
-
- @DeleteMapping(value = "/delOrderEvaluateReply")
+ @RequiresPermissions(value = {"/chargeEvaluation/del"}, logical = Logical.OR)
+ @DeleteMapping(value = "/delOrderEvaluateReply/{id}")
@ApiOperation(value = "删除充电评价回复", tags = {"管理后台-充电评价"})
- public AjaxResult delOrderEvaluateReply(@PathVariable Long id){
+ public AjaxResult delOrderEvaluateReply(@PathVariable("id") Long id){
TOrderEvaluate orderEvaluate = orderEvaluateService.getById(id);
orderEvaluate.setEvaluationResponse("");
orderEvaluateService.updateById(orderEvaluate);
@@ -126,7 +144,7 @@
@ApiImplicitParam(value = "订单id", name = "orderId", required = true),
@ApiImplicitParam(value = "订单类型(1=充电订单,2=购物订单,3=兑换订单,4=会员订单)", name = "orderType", required = true),
})
- public AjaxResult<OrderEvaluateVo> getOrderEvaluate(@PathVariable Integer orderId, Integer orderType){
+ public AjaxResult<OrderEvaluateVo> getOrderEvaluate(String orderId, Integer orderType){
OrderEvaluateVo orderEvaluate = orderEvaluateService.getOrderEvaluate(orderId, orderType);
return AjaxResult.success(orderEvaluate);
}
--
Gitblit v1.7.1