whycxzp
2021-07-26 24fd4ac01b448c2dab5dbcc1f9a641a38fc783e7
src/main/java/com/whyc/controller/AFEInverterController.java
@@ -10,14 +10,28 @@
import io.swagger.annotations.ApiOperation;
import jdk.nashorn.internal.objects.annotations.Getter;
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 org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
 * 特别注意:
 * 通讯协议中:
 * 有功功率单位为0.1kW
 * 输出电流单位为0.1A
 *
 * web页面端:
 * 有功功率单位为kW
 * 输出电流单位为A
 *
 * 故:
 * 查询时,需要将这两个字段结果,*0.1
 * TODO
 */
@RestController
@RequestMapping("afeInverter")
@Api(tags = "afe变频器-逆变器的实时数据信息")
@Api(tags = "afe变频器-逆变器的数据信息")
public class AFEInverterController {
    @Autowired
@@ -35,8 +49,14 @@
        return service.getInfoByDeviceId(devId);
    }
    @GetMapping("field")
    @ApiOperation(value = "查询告警阈值字段")
    public Response<Map<String, List>> getField(){
        return service.getField();
    }
    @GetMapping("tableNames")
    @ApiOperation(value = "查询历史记录存在的表格")
    @ApiOperation(value = "查询历史记录存在的表")
    public Response<String> getTableNames(){
        return service.getTableNames();
    }
@@ -44,11 +64,12 @@
    /**
     * ======History======
     * 历史查询时,因为历史记录是按照日期分表的,如果查询所有的日期表(union)后再分页,会导致速度极慢,故查询按照单个日期查询
     * TODO 待确定是否需要加上日期
     * */
    @GetMapping("history/all")
    @ApiOperation(value = "获取所有历史记录")
    public Response<PageInfo<AFEInverterState>> getHistory(@RequestParam int pageNum, int pageSize,String tablePrefixTime){
        return service.getHistory(pageNum,pageSize,tablePrefixTime);
    @ApiOperation(value = "查询历史记录")
    public Response<PageInfo<AFEInverterState>> getHistory(@RequestParam int pageNum, int pageSize,int devId){
        return service.getHistory(pageNum,pageSize,devId);
    }
}