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);
|
}
|
|
}
|