whyclxw
7 天以前 257c8bcbc5453ecfa9c108ed650422013f7c11b6
src/main/java/com/whyc/controller/AlmParamController.java
@@ -2,6 +2,7 @@
import com.whyc.constant.*;
import com.whyc.dto.AlarmParam;
import com.whyc.dto.Param.AlmAnalyseDto;
import com.whyc.dto.Param.ParamAlmDto;
import com.whyc.dto.Real.AlmDto;
import com.whyc.dto.Response;
@@ -9,16 +10,16 @@
import com.whyc.pojo.db_param.BattAlmparam;
import com.whyc.pojo.db_param.DevAlmparam;
import com.whyc.pojo.db_pwrdev_alarm.PwrdevAlarmParam;
import com.whyc.service.BattAlmparamService;
import com.whyc.service.DevAlmparamService;
import com.whyc.service.PwrdevAlarmParamService;
import com.whyc.service.*;
import com.whyc.util.ActionUtil;
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.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@RestController
@@ -34,6 +35,15 @@
    @Autowired
    private PwrdevAlarmParamService pwrAlmparamService;
    @Autowired
    private BattalarmDataService battalarmDataService;
    @Autowired
    private PwrdevAlarmService pwrdevAlarmService;
    @Autowired
    private BattRealdataIdService battRealdataIdService;
    /*@PostMapping("getBattAlmParam")
    @ApiOperation("获取电池告警参数")
@@ -45,9 +55,14 @@
    @PostMapping("getBattAlmParam")
    @ApiOperation("获取电池告警参数")
    public Response getBattAlmParam(@RequestBody ParamAlmDto dto){
        Integer uid=ActionUtil.getUser().getId();
        dto.setUid(uid);
        return battAlmparamService.getBattAlmParam(dto);
    }
    @GetMapping("getBattAlmParamToExport")
    @ApiOperation("获取电池告警参数(无参用于导出)")
    public Response getBattAlmParamToExport(){
        Integer uid=ActionUtil.getUser().getId();
        return battAlmparamService.getBattAlmParamToExport(uid);
    }
    @PostMapping("setBattAlmParam")
@@ -78,12 +93,15 @@
    @PostMapping("getPwrAlmParam")
    @ApiOperation("获取电源告警参数")
    public Response getPwrAlmParam(@RequestBody ParamAlmDto dto){
        Integer uid=ActionUtil.getUser().getId();
        dto.setUid(uid);
        return pwrAlmparamService.getPwrAlmParam(dto);
    }
    @GetMapping("getPwrAlmParamToExport")
    @ApiOperation("获取电源告警参数(无参用于导出)")
    public Response getPwrAlmParamToExport(){
        Integer uid=ActionUtil.getUser().getId();
        return pwrAlmparamService.getPwrAlmParamToExport(uid);
    }
    @PostMapping("setPwrAlmParam")
    @ApiOperation("修改电源告警参数")
    public Response setPwrAlmParam(@RequestBody List<PwrdevAlarmParam> almparamList){
@@ -111,4 +129,26 @@
        return new Response<List<AlarmParam>>().set(1,list);
    }
    @PostMapping("getBattAlmAnalyse")
    @ApiOperation("预警分析管理-电池告警")
    public Response getBattAlmAnalyse(@RequestBody AlmAnalyseDto dto){
        Integer uid=ActionUtil.getUser().getId();
        dto.setUid(uid);
        return battalarmDataService.getBattAlmAnalyse(dto);
    }
    @GetMapping("getBattHisRealInAlm")
    @ApiOperation("预警分析管理-主属性和分析属性")
    public Response getBattHisRealInAlm(@RequestParam Integer battgroupId,@RequestParam String startTime,@RequestParam(required = false) Integer almId) throws ParseException, InterruptedException {
        return battRealdataIdService.getBattHisRealInAlm(battgroupId,startTime,almId);
    }
    @PostMapping("getPwrtAlmAnalyse")
    @ApiOperation("预警分析管理-电源告警")
    public Response getPwrtAlmAnalyse(@RequestBody AlmAnalyseDto dto){
        Integer uid=ActionUtil.getUser().getId();
        dto.setUid(uid);
        return pwrdevAlarmService.getPwrtAlmAnalyse(dto);
    }
}