| | |
| | | import com.google.gson.GsonBuilder; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | //添加新的电池组 |
| | | @PostMapping("/") |
| | | @ApiOperation(notes = "",value="添加新的电池组") |
| | | @ApiOperation(notes = "TODO 未完成",value="添加新的电池组") |
| | | public ServiceModel add(@RequestBody List<BattInf> list) { |
| | | // List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType()); |
| | | |
| | | return service.add(list); |
| | | } |
| | | |
| | | |
| | | //修改电池组信息 |
| | | @PutMapping("/") |
| | | @ApiOperation(notes = "",value="修改电池组信息") |
| | | @ApiOperation(notes = "[{ \"stationId\": \"1000023\", \"stationName\": \"tt\", \"stationName1\": \"t1\", \"stationName2\": \"t2\", \"stationName3\": \"t3\", \"stationName4\": \"t4\", \"stationName5\": \"t5\", \"stationName6\": \"\", \"stationName7\": \"\", \"stationName8\": \"\", \"stationName9\": \"\", \"stationIp\": \"1\", \"fbsDeviceId\": 0, \"fbsDeviceIp\": \"127.0.0.1\", \"fbsDeviceIp_WG\": \"t\", \"fbsDeviceName\": \"t\", \"groupIndexInFBSDevice\": 0, \"battModel\": \"\", \"battGroupId\": 1000023, \"battGroupNum\": 0, \"battGroupName\": \"t\", \"floatVolLevel\": 0.0, \"offlineVolLevel\": 0.0, \"battFloatCurrent\": 0.0, \"deviceId\": \"\", \"deviceName\": \"\", \"monCount\": 0, \"monCapStd\": 0.0, \"monResStd\": 0.0, \"monSerStd\": 0.0, \"monTmpStd\": 0.0, \"monVolStd\": 0.0, \"monVolLowToAvg\": 0.0, \"battProducer\": \"\", \"battProductDate\": \"2020-12-31 11:52:56\", \"battProductDate1\": \"2020-12-31 11:52:56\", \"battInUseDate\": \"2020-12-31 11:52:56\", \"load_curr\": 0.0, \"disCurrMax\": 0.0, \"station_phone\": \"\", \"stationId_ex\": \"\", \"videoOrImage\": \"\", \"vol_grade\": 0.0, \"manufacturers\": \"\", \"assetequipment\": \"\", \"deviceclasspath\": \"\", \"deviceoperationdepartment\": \"\", \"propertyRightUnit\": \"\", \"propertyAttribute\": \"\", \"factoryNumber\": \"\", \"operationTeam\": \"\", \"deviceIdentityCode\": \"\", \"projectType\": \"\", \"batteryApplicationType\": \"\", \"singleRatedVoltage\": 0.0, \"remoteMonitor\": \"\", \"batttIndependentPlaced\": \"\", \"junChargeVoltageValue\": 0.0 }]",value="修改电池组信息") |
| | | public ServiceModel update(@RequestBody List<BattInf> list) { |
| | | // List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType()); |
| | | return service.update(list); |
| | | } |
| | | |
| | | |
| | | //修改电池信息配置(ip地址,掩码和网关) |
| | | @PostMapping("/ip") |
| | | @ApiOperation(notes = "",value="修改电池信息配置(ip地址,掩码和网关)") |
| | | public ServiceModel updateIp(@RequestBody BattInf binf) { |
| | | // BattInf binf= getGson("yyyy-MM-dd").fromJson(json, BattInf.class); |
| | | //System.out.println(binf); |
| | | |
| | | public ServiceModel updateIp(@RequestParam String fbsDeviceIp,@RequestParam String fbsDeviceIp_YM,@RequestParam String fbsDeviceIp_WG,@RequestParam Integer fbsDeviceId) { |
| | | BattInf binf= new BattInf(); |
| | | binf.setFbsDeviceIp(fbsDeviceIp); |
| | | binf.setFbsDeviceIp_YM(fbsDeviceIp_YM); |
| | | binf.setFbsDeviceIp_WG(fbsDeviceIp_WG); |
| | | binf.setFbsDeviceId(fbsDeviceId); |
| | | return service.updateIp(binf); |
| | | } |
| | | //删除电池组 |
| | | @DeleteMapping("/") |
| | | @ApiOperation(notes = "",value="删除电池组") |
| | | public ServiceModel delete(@RequestBody List<BattInf> list) { |
| | | // List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType()); |
| | | |
| | | |
| | | //删除电池组 stationName日志记录使用 |
| | | @DeleteMapping("/") |
| | | @ApiOperation(notes = "[{ \"battGroupId\": 1000021, \"stationName\": \"test\" }]",value="删除电池组") |
| | | public ServiceModel delete(@RequestBody List<BattInf> list) { |
| | | return service.delete(list); |
| | | } |
| | | //根据维护区和机房名称查询电池组信息 |
| | | @GetMapping("inform") |
| | | @ApiOperation(notes = "",value="维护区和机房名称查询电池组信息") |
| | | public ServiceModel searchInform(@RequestBody Batt_Maint_Dealarm bmd) { |
| | | // Batt_Maint_Dealarm bmd = getGson().fromJson(json, Batt_Maint_Dealarm.class); |
| | | |
| | | @PostMapping("inform") |
| | | @ApiOperation(notes = "stationName 为模糊查询条件",value="维护区和机房名称查询电池组信息") |
| | | public ServiceModel searchInform(@ApiParam(value = "省",required = true) @RequestParam String stationName1, @ApiParam(value = "市",required = true)@RequestParam String stationName2, @ApiParam(value = "区",required = true)@RequestParam String stationName5, @ApiParam(value = "机房",required = true)@RequestParam String stationName3, @ApiParam(value = "页码",required = true)@RequestParam Integer pageNum, @ApiParam(value = "页面数量",required = true)@RequestParam Integer pageSize) { |
| | | Batt_Maint_Dealarm bmd = new Batt_Maint_Dealarm(); |
| | | bmd.setBinf(new BattInf()); |
| | | BattInf battInf = new BattInf(); |
| | | battInf.setStationName1(stationName1); |
| | | battInf.setStationName2(stationName2); |
| | | battInf.setStationName3(stationName3); |
| | | battInf.setStationName5(stationName5); |
| | | PageBean pageBean = new PageBean(); |
| | | pageBean.setPageSize(pageSize); |
| | | pageBean.setPageNum(pageNum); |
| | | bmd.setPageBean(pageBean); |
| | | bmd.setBinf(battInf); |
| | | return service.searchInform(bmd); |
| | | } |
| | | //添加站点时返回最大的机房id,设备id,电池组id |