| | |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | | |
| | |
| | | } |
| | | |
| | | @GetMapping("/schedule-suggest/last-limit") |
| | | @Operation(summary = "根据监控对象获取最新预警信息") |
| | | @Operation(summary = "根据监控对象获取最新调度建议") |
| | | public CommonResult<List<ScheduleSuggestRespDTO>> getLastLimitScheduleSuggest(HttpServletResponse response, HttpServletRequest |
| | | request, @RequestParam("scheduleObj") String scheduleObj, @RequestParam("limit") Integer limit) { |
| | | List<ScheduleSuggestRespDTO> data = mcsApi.getLastLimitScheduleSuggest(scheduleObj, limit); |
| | | return CommonResult.success(data); |
| | | } |
| | | |
| | | @PostMapping("/schedule-suggest/list") |
| | | @Operation(summary = "获取调度建议") |
| | | public CommonResult<List<ScheduleSuggestRespDTO>> listScheduleSuggest(@RequestBody ScheduleSuggestReqDTO vo) { |
| | | List<ScheduleSuggestRespDTO> list = mcsApi.listScheduleSuggest(vo); |
| | | return CommonResult.success(list); |
| | | } |
| | | |
| | | @PostMapping("/alarm-suggest/page") |
| | |
| | | return CommonResult.success(data); |
| | | } |
| | | |
| | | @GetMapping("/predict-data/electric") |
| | | @Operation(summary = "电力功率因数预测结果查询") |
| | | public CommonResult<Map<String,List<Object[]>>> getElectricPredictData(@RequestParam String itemCode) { |
| | | Map<String,List<Object[]>> data = mcsApi.getElectricPredictData(itemCode); |
| | | return CommonResult.success(data); |
| | | } |
| | | @GetMapping("/schedule-data/last") |
| | | @Operation(summary = "调度模型最新结果查询") |
| | | public CommonResult<List<StScheduleRecordVO>> getLastScheduleData(@RequestParam String scheduleCode, @RequestParam Integer limit) { |
| | |
| | | return CommonResult.success(mcsApi.getLastScheduleData(scheduleCode,limit)); |
| | | } |
| | | |
| | | @PostMapping("/machineRealTimeStatus") |
| | | @Operation(summary = "发电机组实时状态查询") |
| | | CommonResult<List<Map<String, Object>>> getRealTimeStatus(@RequestBody List<Map<String, Object>> machines) { |
| | | return CommonResult.success(mcsApi.getRealTimeStatus(machines)); |
| | | @PostMapping("/schedule-data/last/more") |
| | | @Operation(summary = "多个调度模型最新结果查询") |
| | | public CommonResult<Map<String,List<StScheduleRecordVO>>> getMoreLastScheduleData(@RequestBody Map<String,Object> params) { |
| | | if (!params.containsKey("scheduleCodes")) { |
| | | return success(new HashMap<>()); |
| | | } |
| | | Set<String> scheduleCodes = new HashSet<>(((List<String>) params.get("scheduleCodes"))); |
| | | if (CollectionUtils.isEmpty(scheduleCodes)) { |
| | | return success(new HashMap<>()); |
| | | } |
| | | Integer limit = 1; |
| | | if (params.containsKey("limit")) { |
| | | limit = Integer.parseInt(params.get("limit").toString()); |
| | | } |
| | | |
| | | Map<String,List<StScheduleRecordVO>> result = new HashMap<>(scheduleCodes.size()); |
| | | for (String scheduleCode : scheduleCodes) { |
| | | result.put(scheduleCode,mcsApi.getLastScheduleData(scheduleCode, limit)); |
| | | } |
| | | return CommonResult.success(result); |
| | | } |
| | | |
| | | @PostMapping("/predict-data/itemNo") |
| | |
| | | CommonResult<Map<String,List<Object[]>>> getPredictDataItemNo(@RequestBody PreDataItemNoReqVO reqVO) { |
| | | return CommonResult.success(mcsApi.getPredictDataItemNo(reqVO)); |
| | | } |
| | | |
| | | @GetMapping("/electricityPrice/list") |
| | | @Operation(summary = "电价表") |
| | | public CommonResult<List<ElectricityPriceSegmentedDTO>> getElectricityPriceList(@RequestParam("year") String year, @RequestParam("time") String time) { |
| | | List<ElectricityPriceSegmentedDTO> electricityPriceSegmentedList = mcsApi.getElectricityPriceList(year, time); |
| | | return CommonResult.success(electricityPriceSegmentedList); |
| | | } |
| | | |
| | | @GetMapping("/schedule/model/setting/update") |
| | | @Operation(summary = "修改调度模型配置") |
| | | public CommonResult<Boolean> updateScheduleModelSetting(@RequestParam("modelCode") String modelCode, @RequestParam("key") String key, @RequestParam("value") String value){ |
| | | mcsApi.updateScheduleModelSetting(modelCode, key, value); |
| | | return success( true); |
| | | } |
| | | } |