zhibing.pu
2024-08-12 34d18c08f04de78eccb42b88b7484b0531d263ff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
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.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 io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.time.LocalDateTime;
import java.util.List;
 
/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xiaochen
 * @since 2024-08-07
 */
@Api(tags = "订单评价")
@RestController
@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();
    }
    
}