| | |
| | | package com.fgkj.controller; |
| | | |
| | | import com.fgkj.util.*; |
| | | |
| | | import com.fgkj.dto.BattPower_off; |
| | | import com.fgkj.dto.Batt_Maint_Dealarm; |
| | | import com.fgkj.dto.ServiceModel; |
| | | import com.fgkj.dto.User_inf; |
| | | import com.fgkj.dto.*; |
| | | import com.fgkj.services.BattPower_offService; |
| | | import com.fgkj.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 javax.annotation.Resource; |
| | |
| | | private BattPower_offService service; |
| | | |
| | | @PostMapping("/") |
| | | @ApiOperation(notes = "",value="新增") |
| | | @ApiOperation(value="新增") |
| | | public ServiceModel add(@RequestBody BattPower_off bpo) { |
| | | // BattPower_off bpo = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattPower_off.class); |
| | | ServiceModel model = service.add(bpo); |
| | | |
| | | return model; |
| | |
| | | } |
| | | |
| | | @PutMapping("/") |
| | | @ApiOperation(notes = "",value="修改") |
| | | @ApiOperation(value="修改") |
| | | public ServiceModel update(@RequestBody BattPower_off bpo) { |
| | | // BattPower_off bpo = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattPower_off.class); |
| | | ServiceModel model = service.update(bpo); |
| | | |
| | | return model; |
| | | } |
| | | @DeleteMapping("/") |
| | | @ApiOperation(notes = "",value="删除") |
| | | public ServiceModel delete(@RequestBody BattPower_off bpo) { |
| | | @ApiOperation(value="删除") |
| | | public ServiceModel delete(@RequestParam int devId) { |
| | | // BattPower_off bpo = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattPower_off.class); |
| | | ServiceModel model = service.delete(bpo); |
| | | ServiceModel model = service.delete(devId); |
| | | |
| | | return model; |
| | | } |
| | | |
| | | //机房断电统计查询 |
| | | /* |
| | | * 时间段选择放在:binf的battproductdate*/ |
| | | @GetMapping("byCondition") |
| | | @ApiOperation(notes = "时间段选择放在:binf的battproductdate",value="机房断电统计查询") |
| | | public ServiceModel serchByCondition(@RequestBody Batt_Maint_Dealarm bmd){ |
| | | // Batt_Maint_Dealarm bmd = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Batt_Maint_Dealarm.class); |
| | | /** |
| | | * 时间段选择放在:binf的battproductdate |
| | | * 传入参数:poweroff_starttime两个->binf.BattProductDate和BattProductDate1 |
| | | * power_state->binf.num数值 历史或者实时 |
| | | * stationName->binf.stationName |
| | | * stationName1->binf.stationName1 |
| | | * page |
| | | * |
| | | * */ |
| | | @PostMapping("byCondition") |
| | | @ApiOperation(notes = "传入参数:battProductDate(查询时间1),battProductDate1(查询时间2),num(实时为1,历史为0),stationName,stationName1, " + |
| | | "pageNum,pageSize," + |
| | | "其中pageNum和pageSize放在url上,其他参数放在body里",value="机房断电统计查询") |
| | | public ServiceModel serchByCondition(@RequestBody BattInf battInf,@RequestParam int pageNum,@RequestParam int pageSize){ |
| | | User_inf uinf=(User_inf) ActionUtil.getUser(); |
| | | bmd.setUinf(uinf); |
| | | ServiceModel model = service.serchByCondition(bmd); |
| | | battInf.setMonNum(uinf.getuId()); |
| | | PageBean pageBean = new PageBean(); |
| | | pageBean.setPageNum(pageNum); |
| | | pageBean.setPageSize(pageSize); |
| | | ServiceModel model = service.getByCondition(battInf,pageBean); |
| | | |
| | | return model; |
| | | } |
| | |
| | | |
| | | return model; |
| | | } |
| | | @GetMapping("all") |
| | | |
| | | /*@GetMapping("all") |
| | | @ApiOperation(notes = "",value="all") |
| | | public ServiceModel searchAll(){ |
| | | ServiceModel model = service.searchAll(); |
| | | |
| | | return model; |
| | | } |
| | | }*/ |
| | | |
| | | |
| | | |