liusheng
4 天以前 0bbbd746e8c39d91ad7b47a4e36e29ab972dc98c
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
package com.ruoyi.satisfaction.controller;
 
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.satisfaction.domain.vo.SatisfactionExceptConfigQuestionReqVO;
import com.ruoyi.satisfaction.service.SatisfactionSubtaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.Map;
 
/**
 * 满意度异常配置题目 Controller(已迁入 ruoyi-satisfaction 模块)。
 * <p>
 * ⚠️ <b>URL 与出入参一字未改</b>:该端点原本挂在
 * {@code com.ruoyi.web.controller.smartor.ServiceSubtaskDetailTraceController}
 * (类级 {@code @RequestMapping("/smartor/trace")})下,迁移后
 * <b>类级路径与原方法路径都保持原样</b>,最终对外地址仍是
 * {@code POST /smartor/trace/getSatisfactionExceptConfigQuestion},前端无需任何改动。
 * <p>
 * <b>为什么类级路径要沿用 {@code /smartor/trace}:</b>
 * 该端点的业务是"随访任务异常跟踪页面里选择满意度异常题目",
 * 但它的数据来源与筛选逻辑(满意度分类 + 模板题目)完全属于满意度域,
 * 按模块化要求必须搬入本模块。为了做到"URL 不变",这里刻意沿用原类级前缀,
 * 而不是改到 {@code /smartor/satisfaction} 下。
 * <p>
 * <b>开关</b>:本 Controller 始终注册(不随 {@code satisfaction.enabled} 消失)。
 * 模块被关闭时由 {@code SatisfactionAvailabilityInterceptor}
 * (见 {@code config/SatisfactionWebConfig})在进入方法前抛出 {@code ServiceException},
 * 调用方会拿到<b>明确的错误提示</b>(而不是 404)。
 * 注意:同一前缀 {@code /smartor/trace} 下的<b>异常跟踪</b>端点不受影响
 * —— 拦截器只挂在本类的这 1 个路径上。
 */
@Slf4j
@Api(description = "满意度异常配置题目")
@RestController
@RequestMapping("/smartor/trace")
public class SatisfactionExceptConfigController extends BaseController {
 
    @Autowired
    private SatisfactionSubtaskService satisfactionSubtaskService;
 
    /**
     * 获取满意度异常配置题目
     * <p>
     * 迁移说明:入参、返回结构、日志格式与被迁移的实现完全一致;
     * 原实现里的查询逻辑整段搬到了
     * {@link SatisfactionSubtaskService#getSatisfactionExceptConfigQuestion}。
     */
    @ApiOperation("获取满意度异常配置题目")
    @PostMapping("/getSatisfactionExceptConfigQuestion")
    public Map<String, Object> getSatisfactionExceptConfigQuestion(
            @RequestBody SatisfactionExceptConfigQuestionReqVO questionReqVO) {
        log.info("获取满意度异常配置题目的入参: {}", questionReqVO);
        Map<String, Object> satisfactionExceptConfigQuestion =
                satisfactionSubtaskService.getSatisfactionExceptConfigQuestion(questionReqVO);
        return satisfactionExceptConfigQuestion;
    }
}