From 98be1b363a9fd17b9f5414d0ff442d2743ad9543 Mon Sep 17 00:00:00 2001 From: whycrzg <ruanzhigang@whycst.com> Date: 星期一, 01 二月 2021 13:48:20 +0800 Subject: [PATCH] update --- src/main/java/com/fgkj/controller/BattInfController.java | 50 +++++++++++++++++++++++++++++++++----------------- 1 files changed, 33 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/fgkj/controller/BattInfController.java b/src/main/java/com/fgkj/controller/BattInfController.java index 61f83d7..8883b1b 100644 --- a/src/main/java/com/fgkj/controller/BattInfController.java +++ b/src/main/java/com/fgkj/controller/BattInfController.java @@ -7,6 +7,7 @@ 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; @@ -23,42 +24,57 @@ //娣诲姞鏂扮殑鐢垫睜缁� @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,鐢垫睜缁刬d -- Gitblit v1.9.1