whycxzp
2023-07-26 fe229b032e5c3d24b232ef6e048bc2147f7f2392
src/main/java/com/whyc/controller/PowerInfController.java
@@ -1,6 +1,7 @@
package com.whyc.controller;
import com.whyc.dto.Response;
import com.whyc.dto.paramter.PowerInfPar;
import com.whyc.factory.BattinfGroupFactory;
import com.whyc.pojo.Battinf;
import com.whyc.pojo.PowerInf;
@@ -47,11 +48,11 @@
                String nextStationId = battInfService.getNextStationId();
                StationInf station = new StationInf();
                station.setStationId(nextStationId);
                station.setStationName(battinf.getStationName());
                station.setStationName1(battinf.getStationName1());
                station.setStationName2(battinf.getStationName2());
                station.setStationName3(battinf.getStationName3());
                station.setStationName5(battinf.getStationName5());
                station.setStationName(powerInf.getStationName());
                station.setStationName1(powerInf.getStationName1());
                station.setStationName2(powerInf.getStationName2());
                station.setStationName3(powerInf.getStationName3());
                station.setStationName5(powerInf.getStationName5());
                stationInfService.insertStation(station);
                //powerInf.setStationId(String.valueOf(battInfService.searchMaxId_zj()));
                powerInf.setStationId(nextStationId);
@@ -148,11 +149,12 @@
        return service.getStations(userInf.getUId(),stationName5);
    }
    @GetMapping("getPowerDevicesPage")
    @PostMapping("getPowerDevicesPage")
    @ApiOperation(value = "用户管理的电源信息分页")
    public Response getPowerDevicesPage(@RequestParam int pageNum,@RequestParam int pageSize,@RequestParam(required = false) String stationId, @RequestParam(required = false) String stationName1,@RequestParam(required = false) String stationName2,@RequestParam(required = false) String stationName5){
    public Response getPowerDevicesPage(@RequestParam int pageNum, @RequestParam int pageSize
            , @RequestBody PowerInfPar powerInfPar) {
        UserInf userInf = (UserInf) ActionUtil.getUser();
        return service.getPowerDevicesPage(pageNum,pageSize,userInf.getUId(),stationId, stationName1,stationName2,stationName5);
        return service.getPowerDevicesPage(pageNum, pageSize, userInf.getUId(), powerInfPar);
    }
@@ -200,4 +202,10 @@
        UserInf userInf = (UserInf) ActionUtil.getUser();
        return service.getPwrInf(userInf.getUId());
    }
    @GetMapping("getPwrProducer")
    @ApiOperation(value = "获取所有的电源品牌")
    public Response getPwrProducer() {
        return service.getPwrProducer();
    }
}