package com.newfiber.api.pc.controller.zhz; import com.newfiber.api.core.annotation.SysLog; import com.newfiber.api.core.commons.ResultCode; import com.newfiber.api.core.commons.ResultObj; import com.newfiber.api.pc.dto.OperationPumpDTO; import com.newfiber.api.pc.dto.PumpRuntimeDTO; import com.newfiber.api.pc.model.zhz.PumpRuntimeData; import com.newfiber.api.pc.service.PumpRuntimeDataService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import java.util.List; /** * @description: 泵机运行时数据管理层 * @author: 张鸿志 * @date: 2020/12/14 15:23 * @version: v1.0 */ @RestController @RequestMapping("/pumpRuntime") @Api(value = "PumpRuntimeDataController",tags = "泵机运行时数据管理层") @CrossOrigin public class PumpRuntimeDataController { @Autowired private PumpRuntimeDataService pumpRuntimeDataService; @PostMapping("/selectRuntimeData") @ApiOperation("查询某个站点下某种泵机类型的所有泵机运行数据") @SysLog(actionType = "4",value = "查询某个站点下某种泵机类型的所有泵机运行数据") public ResultObj<List<PumpRuntimeData>> selectPumpRuntimeDataByStationNoOrPumpType(@RequestBody PumpRuntimeDTO pumpRuntimeDTO){ return new ResultObj<List<PumpRuntimeData>>(ResultCode.OK,pumpRuntimeDataService.selectPumpRuntimeDataByStationNoOrPumpType(pumpRuntimeDTO)); } @PostMapping("/operation") @ApiOperation("操作泵机状态:1:打开泵机,2:关闭泵机") public ResultObj operationPumpState(@RequestBody OperationPumpDTO operationPumpDTO, HttpServletRequest request){ pumpRuntimeDataService.operationPumpState(operationPumpDTO,request); return ResultObj.ok(); } }