VVT789
2025-02-13 9a33fc4f8a0ace2d076418bd0f8d6441cb34b9a3
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
package com.zhitan.web.controller.energyMonitor;
 
import com.zhitan.common.annotation.Log;
import com.zhitan.common.core.controller.BaseController;
import com.zhitan.common.core.domain.AjaxResult;
import com.zhitan.energyMonitor.service.IElectricThreePhaseService;
import com.zhitan.model.domain.EnergyIndex;
import com.zhitan.model.service.IEnergyIndexService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
/**
 * @Description: 三相不平衡
 * @Author: yxw
 * @Date: 2022-04-24
 * @Version: V1.2
 */
@Api(tags = "三相不平衡")
@RestController
@RequestMapping("/threePhaseUnbalanceAnalysis")
@Slf4j
public class ElectricThreePhaseController extends BaseController {
 
    @Autowired
    private IElectricThreePhaseService electricThreePhaseService;
    @Autowired
    private IEnergyIndexService energyIndexService;
 
    /**
     * 获取用能单元下的某个电表的三相不平衡数据
     *
     * @param nodeId 节点id
     * @param meterId      电表id
     * @param timeType     时间类型 DAY/MONTH/YEAR
     * @param timeCode     时间值 与时间类型对应:2022-03-21/2022-03/2022
     * @param requestType  请求类型:0.电压;1.电流
     * @return
     */
    @Log(title = "根据电表id查询三相不平衡数据")
    @ApiOperation(value = "根据电表id查询三相不平衡数据", notes = "根据电表id查询三相不平衡数据")
    @GetMapping(value = "/detail")
    public AjaxResult list(@RequestParam(name = "nodeId") String nodeId,
                           @RequestParam(name = "meterId") String meterId,
                           @RequestParam(name = "timeType") String timeType,
                           @RequestParam(name = "timeCode") String timeCode,
                           @RequestParam(name = "requestType") String requestType) {
        if (ObjectUtils.isEmpty(meterId)){
            return AjaxResult.error("电表id不能为空");
        }
 
        List<EnergyIndex> energyIndexList = energyIndexService.listDeviceIndex(nodeId, meterId);
 
        return AjaxResult.success(electricThreePhaseService.list(timeType, timeCode, energyIndexList, requestType, meterId));
    }
 
}