From 4d54d652b4bdb4ab2f3ee6ba670348fab9b07365 Mon Sep 17 00:00:00 2001 From: luodangjia <luodangjia> Date: 星期二, 13 八月 2024 11:00:53 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TOrderEvaluateController.java | 98 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 96 insertions(+), 2 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 9b8a2d1..844f56e 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,24 @@ package com.ruoyi.order.controller; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.web.page.PageInfo; +import com.ruoyi.order.api.model.TOrderEvaluate; +import com.ruoyi.order.api.query.TOrderEvaluateQuery; +import com.ruoyi.order.api.vo.SiteDetailEvaluateVO; +import com.ruoyi.order.api.vo.TOrderEvaluateVO; +import com.ruoyi.order.dto.GetOrderEvaluatePageList; +import com.ruoyi.order.dto.GetOrderEvaluatePageListDTO; +import com.ruoyi.order.service.TOrderEvaluateService; +import com.ruoyi.other.api.vo.TEvaluationTagVO; import io.swagger.annotations.Api; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; +import java.util.List; /** * <p> @@ -18,5 +33,84 @@ @RequestMapping("/t-order-evaluate") public class TOrderEvaluateController { + @Autowired + private TOrderEvaluateService orderEvaluateService; + + + @ApiOperation(tags = {"小程序-订单评价"},value = "充电订单评价标签及数量查询") + @PostMapping(value = "/getTagCount") + public AjaxResult<List<TEvaluationTagVO>> getTagCount() { + return AjaxResult.ok(orderEvaluateService.getTagCount()); + } + + @ApiOperation(tags = {"小程序-订单评价"},value = "充电订单评价分页列表查询") + @PostMapping(value = "/pageList") + public AjaxResult<PageInfo<TOrderEvaluateVO>> pageList(@RequestBody TOrderEvaluateQuery query) { + return AjaxResult.ok(orderEvaluateService.getTagList(query)); + } + + + + + + + + @GetMapping(value = "/getPageList") + @ApiOperation(value = "获取充电评价列表", tags = {"管理后台-充电评价"}) + public AjaxResult<PageInfo<GetOrderEvaluatePageListDTO>> getPageList(@RequestBody GetOrderEvaluatePageList pageList){ + PageInfo<GetOrderEvaluatePageListDTO> list = orderEvaluateService.getPageList(pageList); + return AjaxResult.success(list); + } + + + + @DeleteMapping(value = "/delOrderEvaluate") + @ApiOperation(value = "删除充电评价", tags = {"管理后台-充电评价"}) + public AjaxResult delOrderEvaluate(@PathVariable Long id){ + TOrderEvaluate orderEvaluate = orderEvaluateService.getById(id); + orderEvaluate.setDelFlag(true); + orderEvaluateService.updateById(orderEvaluate); + return AjaxResult.success(); + } + + + + + @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;", "(") + .replaceAll("& #41;", ")") + .replaceAll("& #40;", "(") + .replaceAll("& #41;", ")") + .replaceAll("& #39;", "'") + .replaceAll("& lt;", "<") + .replaceAll("& gt;", ">"); + orderEvaluate.setEvaluationResponse(reply); + orderEvaluate.setResponseTime(LocalDateTime.now()); + orderEvaluateService.updateById(orderEvaluate); + return AjaxResult.success(); + } + + + + + @DeleteMapping(value = "/delOrderEvaluateReply") + @ApiOperation(value = "删除充电评价回复", tags = {"管理后台-充电评价"}) + public AjaxResult delOrderEvaluateReply(@PathVariable Long id){ + TOrderEvaluate orderEvaluate = orderEvaluateService.getById(id); + orderEvaluate.setEvaluationResponse(""); + orderEvaluateService.updateById(orderEvaluate); + return AjaxResult.success(); + } + + + @ApiOperation(tags = {"小程序-订单评价"},value = "电站详情中评价列表查询") + @GetMapping(value = "/getSiteDetailEveList") + public AjaxResult<SiteDetailEvaluateVO> getSiteDetailEveList(@RequestParam(value = "siteId")@ApiParam(value = "站点id")Integer siteId) { + return AjaxResult.ok(orderEvaluateService.getSiteDetailEveList(siteId)); + } + } -- Gitblit v1.7.1