xuhy
2025-05-07 a09726dcdb35f396bc042c9aa497b5b1a7bafaad
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
package com.ruoyi.admin.controller.large;
 
 
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.admin.large.model.AnalysisServiceIndexChildData;
import com.ruoyi.admin.large.service.AnalysisServiceIndexChildDataService;
import com.ruoyi.admin.large.service.AnalysisServiceIndexDataService;
import com.ruoyi.common.core.domain.R;
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.util.List;
 
/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xiaochen
 * @since 2025-04-21
 */
@Api(tags = {"大屏-服务分析指标"})
@RestController
@RequestMapping("/analysis-service-index-child-data")
public class AnalysisServiceIndexChildDataController {
    private final AnalysisServiceIndexChildDataService analysisServiceIndexChildDataService;
    private final AnalysisServiceIndexDataService analysisServiceIndexDataService;
 
    @Autowired
    public AnalysisServiceIndexChildDataController(AnalysisServiceIndexChildDataService analysisServiceIndexChildDataService, AnalysisServiceIndexDataService analysisServiceIndexDataService) {
        this.analysisServiceIndexChildDataService = analysisServiceIndexChildDataService;
        this.analysisServiceIndexDataService = analysisServiceIndexDataService;
    }
    /**
     * 修改服务指标分析渠道商
     */
    @ApiOperation( value = "修改服务指标分析渠道商")
    @PostMapping(value = "/update")
    public R<Boolean> update(@RequestBody List<AnalysisServiceIndexChildData> dto) {
        Integer serviceIndexId = dto.get(0).getServiceIndexId();
        analysisServiceIndexChildDataService.remove(Wrappers.lambdaQuery(AnalysisServiceIndexChildData.class)
                .eq(AnalysisServiceIndexChildData::getServiceIndexId, serviceIndexId));
        return R.ok(analysisServiceIndexChildDataService.saveBatch(dto));
    }
 
    /**
     * 查询服务指标分析渠道商列表
     */
    @ApiOperation( value = "通过渠道商id查询指标")
    @GetMapping(value = "/getListByServiceId")
    public R<List<AnalysisServiceIndexChildData>> getListByServiceId(@RequestParam("serviceIndexId") Integer serviceIndexId) {
        List<AnalysisServiceIndexChildData> list = analysisServiceIndexChildDataService.list(Wrappers.lambdaQuery(AnalysisServiceIndexChildData.class)
                .eq(AnalysisServiceIndexChildData::getServiceIndexId, serviceIndexId));
        return R.ok(list);
    }
    /**
     * 查询服务指标分析渠道商列表
     */
    @ApiOperation( value = "通过渠道商id查询指标-兼容大屏接口",notes = "大屏接口")
    @GetMapping(value = "/getLargeListByServiceId")
    public R<List<AnalysisServiceIndexChildData>> getLargeListByServiceId(@RequestParam("serviceIndexId") Integer serviceIndexId) {
        List<AnalysisServiceIndexChildData> list = analysisServiceIndexChildDataService.list(Wrappers.lambdaQuery(AnalysisServiceIndexChildData.class)
                .eq(AnalysisServiceIndexChildData::getServiceIndexId, serviceIndexId));
        return R.ok(list);
    }
 
}