| | |
| | | package com.fgkj.controller; |
| | | |
| | | import com.fgkj.util.*; |
| | | |
| | | import com.fgkj.dto.BattInf; |
| | | 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.BattInfServices; |
| | | import com.fgkj.util.ActionUtil; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.sun.xml.internal.bind.v2.TODO; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @RequestMapping("battInf") |
| | | @RestController |
| | | @Api |
| | | @Api(tags = "battInf接口") |
| | | public class BattInfController{ |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private BattInfServices service; |
| | | |
| | | private ServiceModel model; |
| | | |
| | | // private BattInf bif; |
| | | // private Batt_maintenance_inf bmaif; |
| | | // private Batttestdata_inf btdif; |
| | | // private User_inf uinf; |
| | | //private Battalarm_data bdata; |
| | | |
| | | //添加新的电池组 |
| | | @PostMapping("/") |
| | | @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()); |
| | | ServiceModel model = service.add(list); |
| | | |
| | | return model; |
| | | return service.add(list); |
| | | } |
| | | |
| | | |
| | | //修改电池组信息 |
| | | @PutMapping("/") |
| | | @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()); |
| | | ServiceModel model = service.update(list); |
| | | |
| | | return model; |
| | | return service.update(list); |
| | | } |
| | | |
| | | |
| | | //修改电池信息配置(ip地址,掩码和网关) |
| | | @PostMapping("/ip") |
| | | public ServiceModel updateIp(@RequestBody BattInf binf) { |
| | | // BattInf binf= getGson("yyyy-MM-dd").fromJson(json, BattInf.class); |
| | | //System.out.println(binf); |
| | | ServiceModel model = service.updateIp(binf); |
| | | |
| | | return model; |
| | | @ApiOperation(notes = "",value="修改电池信息配置(ip地址,掩码和网关)") |
| | | 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("/") |
| | | public ServiceModel delete(@RequestBody List<BattInf> list) { |
| | | // List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType()); |
| | | ServiceModel model = service.delete(list); |
| | | |
| | | return model; |
| | | |
| | | //删除电池组 stationName日志记录使用 |
| | | @DeleteMapping("/") |
| | | @ApiOperation(notes = "[{ \"battGroupId\": 1000021, \"stationName\": \"test\" }]",value="删除电池组") |
| | | public ServiceModel delete(@RequestBody List<BattInf> list) { |
| | | return service.delete(list); |
| | | } |
| | | //根据维护区和机房名称查询电池组信息 |
| | | @GetMapping("inform") |
| | | public ServiceModel searchInform(@RequestBody Batt_Maint_Dealarm bmd) { |
| | | // Batt_Maint_Dealarm bmd = getGson().fromJson(json, Batt_Maint_Dealarm.class); |
| | | ServiceModel model = service.searchInform(bmd); |
| | | |
| | | return model; |
| | | @PostMapping("inform") |
| | | @ApiOperation(notes = "stationName1、2、3、5 为模糊查询条件",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 |
| | | @GetMapping("maxId") |
| | | @ApiOperation(notes = "",value="添加站点时返回最大的机房id,设备id,电池组id") |
| | | public ServiceModel searchmaxId() { |
| | | ServiceModel model = service.searchmaxId(); |
| | | |
| | | return model; |
| | | return service.searchmaxId(); |
| | | } |
| | | |
| | | @GetMapping("byCondition") |
| | | public ServiceModel serchByCondition(@RequestBody BattInf bif) { |
| | | model = service.serchByCondition(bif); |
| | | return model; |
| | | @PostMapping("byCondition") |
| | | @ApiOperation(notes = "查capstdolstd/moncount/serstd",value="battgroupid查机房名称和电池组名称") |
| | | public ServiceModelOnce serchByCondition(@RequestParam Integer battGroupId) { |
| | | BattInf bif =new BattInf(); |
| | | bif.setBattGroupId(battGroupId); |
| | | return service.serchByCondition(bif); |
| | | } |
| | | |
| | | @GetMapping("all") |
| | | @ApiOperation(notes = "查所有的电池组",value="all") |
| | | public ServiceModel searchAll() { |
| | | model = service.searchAll(); |
| | | return model; |
| | | return service.searchAll(); |
| | | } |
| | | |
| | | /*@GetMapping("byBattGroupId") |
| | |
| | | }*/ |
| | | |
| | | //根据电池id查询电池的基本信息 |
| | | @GetMapping("byBattGroupId") |
| | | public ServiceModel searchBattBybattgroupid(@RequestBody BattInf bif){ |
| | | model=service.searchBattBybattgroupid(bif); |
| | | @PostMapping("searchBattBybattgroupId") |
| | | @ApiOperation(notes = "",value="电池id查询电池的基本信息") |
| | | public ServiceModel searchBattBybattgroupid(@RequestParam Integer battGroupId) { |
| | | BattInf bif = new BattInf(); |
| | | bif.setBattGroupId(battGroupId); |
| | | |
| | | return service.searchBattBybattgroupid(bif); |
| | | } |
| | | |
| | | @PostMapping("findByBattGroupId") |
| | | @ApiOperation(notes = "",value="findByBattGroupId") |
| | | public ServiceModel findByBattGroupId(@RequestParam Integer battGroupId){ |
| | | BattInf binf = new BattInf(); |
| | | binf.setBattGroupId(battGroupId); |
| | | ServiceModel model=service.findByBattGroupId(binf); |
| | | return model; |
| | | } |
| | | |
| | | |
| | | //查询出当前存在内存中最大的设备的id(很重要**********) |
| | | @GetMapping("maxDevId") |
| | | @ApiOperation(notes = "",value="查询出当前存在内存中最大的设备的id(很重要**********)") |
| | | public ServiceModel searchMaxdevId_binf(){ |
| | | ServiceModel model=service.searchMaxdevId_binf(); |
| | | return model; |
| | | return service.searchMaxdevId_binf(); |
| | | } |
| | | |
| | | //----------根据StationName1(维护区) 查不重复的BattGroupName(蓄电池组) |
| | | @GetMapping("byStationName1") |
| | | public ServiceModel serchByStationName1(@RequestBody BattInf bif){ |
| | | model=service.serchByStationName1(bif); |
| | | return model; |
| | | @PostMapping("byStationName1") |
| | | @ApiOperation(notes = "stationName1如果无值传String类型的null,底层查询不同",value="StationName1(维护区) 查不重复的BattGroupName(蓄电池组)") |
| | | public ServiceModelOnce serchByStationName1(@ApiParam(value = "维护区",required = false) @RequestParam String stationName1){ |
| | | BattInf bif = new BattInf(); |
| | | // System.out.println("bif ---= " + bif); |
| | | if (stationName1!=null&&!stationName1.equals("null")) { |
| | | bif.setStationName1(stationName1); |
| | | } |
| | | return service.serchByStationName1(bif); |
| | | } |
| | | //----------根据StationName1(维护区) 查不重复的StationName(站点) |
| | | @GetMapping("byStationName") |
| | | public ServiceModel serchByStationName(@RequestBody BattInf bif){ |
| | | model=service.serchByStationName(bif); |
| | | return model; |
| | | @PostMapping("byStationName") |
| | | @ApiOperation(notes = "",value="StationName1(维护区) 查不重复的StationName(站点)") |
| | | public ServiceModelOnce serchByStationName(@RequestParam String stationName1) { |
| | | BattInf bif = new BattInf(); |
| | | bif.setStationName1(stationName1); |
| | | return service.serchByStationName(bif); |
| | | } |
| | | //----------根据StationName1(维护区) 查不重复的StationName(站点)不包含91000000一期设备 |
| | | @GetMapping("byStationNameWithout91") |
| | | public ServiceModel serchByStationNameNot91(@RequestBody BattInf bif){ |
| | | model=service.serchByStationNameNot91(bif); |
| | | return model; |
| | | @PostMapping("byStationNameWithout91") |
| | | @ApiOperation(notes = "",value="StationName1(维护区) 查不重复的StationName(站点)不包含91000000一期设备") |
| | | public ServiceModelOnce serchByStationNameNot91(@ApiParam(value = "省",required = true) @RequestParam String stationName1) { |
| | | BattInf bif = new BattInf(); |
| | | bif.setStationName1(stationName1); |
| | | return service.serchByStationNameNot91(bif); |
| | | } |
| | | //--查不重复的StationName1(维护区) |
| | | @GetMapping("byStation") |
| | | public ServiceModel serchByStation(){ |
| | | model=service.serchByStation(); |
| | | return model; |
| | | @ApiOperation(notes = "sum 集合长度",value="查不重复的StationName1(维护区)") |
| | | public ServiceModelOnce serchByStation(){ |
| | | return service.serchByStation(); |
| | | } |
| | | //--查不重复的StationName1(维护区)不包含91000000一期设备 |
| | | @GetMapping("byStationWithout91") |
| | | public ServiceModel serchByStationNot91(){ |
| | | model=service.serchByStationNot91(); |
| | | return model; |
| | | @ApiOperation(notes = "",value="查不重复的StationName1(维护区)不包含91000000一期设备") |
| | | public ServiceModelOnce serchByStationNot91(){ |
| | | return service.serchByStationNot91(); |
| | | } |
| | | //-----------查询所有的省份 |
| | | @GetMapping("allStationName1") |
| | | @ApiOperation(notes = "需要session中的uId",value="查询所有的省份") |
| | | public ServiceModel serchAllStationName1(){ |
| | | User_inf uinf=(User_inf) ActionUtil.getUser(); |
| | | model=service.serchAllStationName1(uinf); |
| | | return model; |
| | | return service.serchAllStationName1(uinf); |
| | | } |
| | | // ----------查询所有的市 |
| | | @GetMapping("allStationName2") |
| | | public ServiceModel serchAllStationName2(@RequestBody BattInf binf){ |
| | | @PostMapping("allStationName2") |
| | | @ApiOperation(notes = "模糊查询",value="查询所有的市") |
| | | public ServiceModel serchAllStationName2(@ApiParam(value = "省",required = true) @RequestParam String stationName1) { |
| | | BattInf binf = new BattInf(); |
| | | User_inf uinf=(User_inf) ActionUtil.getUser(); |
| | | // BattInf binf= getGson("yyyy-MM-dd").fromJson(json, BattInf.class); |
| | | binf.setNum(uinf.getUId()); |
| | | model=service.serchAllStationName2(binf); |
| | | return model; |
| | | binf.setNum(uinf.getuId()); |
| | | binf.setStationName1(stationName1); |
| | | return service.serchAllStationName2(binf); |
| | | } |
| | | //--查询所有的区县 |
| | | @GetMapping("allStationName5") |
| | | public ServiceModel serchAllStationName5(@RequestBody BattInf binf){ |
| | | // BattInf binf= getGson("yyyy-MM-dd").fromJson(json, BattInf.class); |
| | | model=service.serchAllStationName5(binf); |
| | | |
| | | return model; |
| | | @PostMapping("allStationName5") |
| | | @ApiOperation(notes = "",value="查询所有的区县") |
| | | public ServiceModel serchAllStationName5(@ApiParam(value = "省",required = true) @RequestParam String stationName1,@ApiParam(value = "市",required = true) @RequestParam String stationName2) { |
| | | BattInf binf = new BattInf(); |
| | | User_inf uinf = (User_inf) ActionUtil.getUser(); |
| | | binf.setNum(uinf.getuId()); |
| | | binf.setStationName1(stationName1); |
| | | binf.setStationName2(stationName2); |
| | | return service.serchAllStationName5(binf); |
| | | } |
| | | //--查询所有的机房 |
| | | @GetMapping("allStationName") |
| | | public ServiceModel serchAllStationName(@RequestBody BattInf binf){ |
| | | // BattInf binf= getGson("yyyy-MM-dd").fromJson(json, BattInf.class); |
| | | model=service.serchAllStationName(binf); |
| | | |
| | | return model; |
| | | @PostMapping("allStationName") |
| | | @ApiOperation(notes = "",value="查询所有的机房—带参") |
| | | public ServiceModel serchAllStationName(@ApiParam(value = "省",required = true) @RequestParam String stationName1,@ApiParam(value = "市",required = true) @RequestParam String stationName2,@ApiParam(value = "区",required = true) @RequestParam String stationName5) { |
| | | BattInf binf = new BattInf(); |
| | | User_inf uinf = (User_inf) ActionUtil.getUser(); |
| | | binf.setNum(uinf.getuId()); |
| | | binf.setStationName1(stationName1); |
| | | binf.setStationName2(stationName2); |
| | | binf.setStationName5(stationName5); |
| | | return service.serchAllStationName(binf); |
| | | } |
| | | |
| | | //--查询电池组信息 |
| | | @GetMapping("allBattInf") |
| | | public ServiceModel serchAllBattinf(@RequestBody BattInf binf){ |
| | | // BattInf binf= getGson("yyyy-MM-dd").fromJson(json, BattInf.class); |
| | | model=service.serchAllBattinf(binf); |
| | | |
| | | return model; |
| | | @PostMapping("allBattInf") |
| | | @ApiOperation(notes = "参数s1、s2、s5 模糊查询参数",value="查询电池组信息") |
| | | public ServiceModel serchAllBattinf(@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) { |
| | | BattInf binf = new BattInf(); |
| | | binf.setStationName1(stationName1); |
| | | binf.setStationName2(stationName2); |
| | | binf.setStationName5(stationName5); |
| | | binf.setStationName3(stationName3); |
| | | return service.serchAllBattinf(binf); |
| | | } |
| | | |
| | | //----------根据StationName(站点) 查不重复的BattGroupName(蓄电池组) |
| | | @GetMapping("byBattGroupName") |
| | | public ServiceModel serchByBattGroupName(@RequestBody BattInf bif){ |
| | | model=service.serchByBattGroupName(bif); |
| | | |
| | | return model; |
| | | @PostMapping("byBattGroupName") |
| | | @ApiOperation(notes = "",value="StationName(站点) 查不重复的BattGroupName(蓄电池组)") |
| | | public ServiceModelOnce serchByBattGroupName(@ApiParam(value = "地址",required = true) @RequestParam String stationName,@ApiParam(value = "省",required = true) @RequestParam String stationName1){ |
| | | BattInf binf = new BattInf(); |
| | | binf.setStationName(stationName); |
| | | binf.setStationName1(stationName1); |
| | | return service.serchByBattGroupName(binf); |
| | | } |
| | | //查电池品牌 |
| | | @GetMapping("battProducer") |
| | | public ServiceModel serchByBattProducer(){ |
| | | model=service.serchByBattProducer(); |
| | | |
| | | return model; |
| | | @ApiOperation(notes = "",value="查电池品牌") |
| | | public ServiceModelOnce serchByBattProducer(){ |
| | | |
| | | return service.serchByBattProducer(); |
| | | } |
| | | //查单体电压 |
| | | @GetMapping("monVolStd") |
| | | public ServiceModel serchByMonVolStd(){ |
| | | model=service.serchByMonVolStd(); |
| | | |
| | | return model; |
| | | @ApiOperation(notes = "",value="查单体电压") |
| | | public ServiceModelOnce serchByMonVolStd(){ |
| | | |
| | | return service.serchByMonVolStd(); |
| | | } |
| | | //查电池容量 |
| | | @GetMapping("monCapStd") |
| | | public ServiceModel serchByMonCapStd(){ |
| | | model=service.serchByMonCapStd(); |
| | | |
| | | return model; |
| | | @ApiOperation(notes = "",value="查电池容量") |
| | | public ServiceModelOnce serchByMonCapStd(){ |
| | | |
| | | return service.serchByMonCapStd(); |
| | | } |
| | | |
| | | //查询菜单 |
| | | //查询菜单 TODO |
| | | @GetMapping("menu") |
| | | @ApiOperation(notes = "TODO ",value="查询菜单") |
| | | public ServiceModel findMenu(){ |
| | | model=service.findMenu(); |
| | | |
| | | return model; |
| | | } |
| | | |
| | | //判断新增的电池组是否存在 |
| | | @GetMapping("judgeBatt") |
| | | public ServiceModel judgeBatt(@RequestBody BattInf binf){ |
| | | // BattInf binf= getGson("yyyy-MM-dd").fromJson(json, BattInf.class); |
| | | ServiceModel model=service.judgeBatt(binf); |
| | | |
| | | return model; |
| | | |
| | | return service.findMenu(); |
| | | } |
| | | |
| | | @GetMapping("byBattGroupId2") |
| | | public ServiceModel findByBattGroupId(@RequestBody BattInf bif){ |
| | | model=service.findByBattGroupId(bif); |
| | | Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create(); |
| | | |
| | | return model; |
| | | //判断新增的电池组是否存在 |
| | | @PostMapping("judgeBatt") |
| | | @ApiOperation(notes = "",value="判断新增的电池组是否存在") |
| | | public ServiceModel judgeBatt(@ApiParam(value = "站点",required = true) @RequestParam String stationName) { |
| | | BattInf binf = new BattInf(); |
| | | binf.setStationName(stationName); |
| | | return service.judgeBatt(binf); |
| | | } |
| | | |
| | | //根据电池组id查询不重复的单体编号 |
| | | @GetMapping("monNumByBattGroupId") |
| | | public ServiceModel serchByMonNum(@RequestBody BattInf bif){ |
| | | model=service.serchByMonNum(bif); |
| | | |
| | | return model; |
| | | @PostMapping("monNumByBattGroupId") |
| | | @ApiOperation(notes = "",value="电池组id查询不重复的单体编号") |
| | | public ServiceModelOnce serchByMonNum(@RequestParam Integer battGroupId) { |
| | | BattInf binf = new BattInf(); |
| | | binf.setBattGroupId(battGroupId); |
| | | |
| | | return service.serchByMonNum(binf); |
| | | } |
| | | |
| | | |
| | | //5.3添加选取电池组或者机房或者维护区(未被应用) |
| | | @Deprecated |
| | | public ServiceModel serchBatt(@RequestBody BattInf bif) { |
| | | // bif=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,BattInf.class); |
| | | model=service.serchBatt(bif); |
| | | |
| | | return model; |
| | | @PostMapping("serchBatt") |
| | | @ApiOperation(notes = "结果集:{ \"code\": 1, \"msg\": null, \"data\": [{ \"stationId\": \"42010007\", \"stationName\": \"山西省-太原市-迎泽区-局机房119-局机房站-1\", \"stationName1\": \"山西省\"\"battGroupId\": 1000003, \"battGroupName\": \"电池组1\", \"battGroupName\": \"电池组1\" }]}",value="添加选取电池组或者机房或者维护区(未被应用)") |
| | | public ServiceModel serchBatt(@ApiParam(value = "地址",required = true) @RequestParam String stationName,@ApiParam(value = "省",required = true) @RequestParam String stationName1,@RequestParam Integer battGroupId) { |
| | | BattInf binf = new BattInf(); |
| | | binf.setStationName(stationName); |
| | | binf.setStationName1(stationName1); |
| | | binf.setBattGroupId(battGroupId); |
| | | return service.serchBatt(binf); |
| | | } |
| | | |
| | | |
| | | //TODO 数据不足待测 |
| | | //6.4.7按地域和标称电压分组统计蓄电池组服役超期的数量 |
| | | /* |
| | | * 区域层次放在stationid中 |
| | | * battgroupnum 中存放统计方式:年度统计为0 季度统计为1 |
| | | * moncount中存放统计季度:一季度为1 以此类推 |
| | | * monnum 中存放年份*/ |
| | | @GetMapping("beyondTime") |
| | | public ServiceModel serchBeyondTime(@RequestBody BattInf bif){ |
| | | // bif=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,BattInf.class); |
| | | model=service.serchBeyondTime(bif); |
| | | |
| | | * moncount中存放统计季度:一季度为1 以此类推 -3 |
| | | * monnum 中存放年份 -2020*/ |
| | | @PostMapping("beyondTime") |
| | | @ApiOperation(notes = "TODO 待测", |
| | | value="按地域和标称电压分组统计蓄电池组服役超期的数量") |
| | | public ServiceModel serchBeyondTime(@ApiParam(value = "区域层次(字符串数字)",required = true) @RequestParam String stationId, |
| | | @ApiParam(value = "年份",required = true) @RequestParam Integer monNum, |
| | | @ApiParam(value = "统计方式:年度统计为0 季度统计为1",required = true) @RequestParam Integer battGroupNum, |
| | | @ApiParam(value = "统计季度:一季度为1 以此类推",required = true) @RequestParam Integer monCount) { |
| | | ServiceModel model= new ServiceModel(); |
| | | try { |
| | | Integer.parseInt(stationId); |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | model.setMsg("参数不合法"); |
| | | return model; |
| | | } |
| | | BattInf binf = new BattInf(); |
| | | binf.setStationId(stationId); |
| | | binf.setBattGroupNum(battGroupNum); |
| | | binf.setMonNum(monNum); |
| | | binf.setMonCount(monCount); |
| | | model =service.serchBeyondTime(binf); |
| | | return model; |
| | | } |
| | | |
| | | //6.4.8按地域和标称电压分组统计蓄电池组的数量(蓄电池组数量统计) |
| | | @GetMapping("battGroupCountByMonVolStdGroup") |
| | | public ServiceModel serchByMonVolStdGroup(@RequestBody BattInf bif){ |
| | | // bif=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,BattInf.class); |
| | | model=service.serchByMonVolStdGroup(bif); |
| | | |
| | | @PostMapping("battGroupCountByMonVolStdGroup") |
| | | @ApiOperation(notes = "TODO 待测",value="按地域和标称电压分组统计蓄电池组的数量(蓄电池组数量统计)") |
| | | public ServiceModel serchByMonVolStdGroup(@ApiParam(value = "区域层次(字符串数字)",required = true) @RequestParam String stationId, |
| | | @ApiParam(value = "获取年份",required = true) @RequestParam Integer monNum, |
| | | @ApiParam(value = "存放统计方式:年度统计为0 季度统计为1",required = true) @RequestParam Integer battGroupNum, |
| | | @ApiParam(value = "存放统计季度:一季度为1 以此类推",required = true) @RequestParam Integer monCount){ |
| | | ServiceModel model = new ServiceModel(); |
| | | BattInf bif = new BattInf(); |
| | | try { |
| | | Integer.parseInt(stationId); |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | model.setMsg("参数不合法"); |
| | | return model; |
| | | } |
| | | bif.setStationId(stationId); |
| | | bif.setBattGroupNum(battGroupNum); |
| | | bif.setMonNum(monNum); |
| | | bif.setMonCount(monCount); |
| | | model = service.serchByMonVolStdGroup(bif); |
| | | return model; |
| | | } |
| | | |
| | | //6.4.9按地域和标称电压分组统计蓄电池组品牌的数量(蓄电池供应商信息统计) |
| | | @GetMapping("battProducerCountByBattProducerGroup") |
| | | public ServiceModel serchByBattProducerGroup(@RequestBody BattInf bif){ |
| | | // bif=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,BattInf.class); |
| | | model=service.serchByBattProducerGroup(bif); |
| | | |
| | | return model; |
| | | @PostMapping("battProducerCountByBattProducerGroup") |
| | | @ApiOperation(notes = "",value="按地域和标称电压分组统计蓄电池组品牌的数量(蓄电池供应商信息统计)") |
| | | public ServiceModel serchByBattProducerGroup(@ApiParam(value = "区域层次(字符串数字)",required = true) @RequestParam String stationId, |
| | | @ApiParam(value = "获取年份",required = true) @RequestParam Integer monNum, |
| | | @ApiParam(value = "存放统计方式:年度统计为0 季度统计为1",required = true) @RequestParam Integer battGroupNum, |
| | | @ApiParam(value = "存放统计季度:一季度为1 以此类推",required = true) @RequestParam Integer monCount){ |
| | | ServiceModel model = new ServiceModel(); |
| | | BattInf bif = new BattInf(); |
| | | try { |
| | | Integer.parseInt(stationId); |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | model.setMsg("参数不合法"); |
| | | return model; |
| | | } |
| | | bif.setStationId(stationId); |
| | | bif.setBattGroupNum(battGroupNum); |
| | | bif.setMonNum(monNum); |
| | | bif.setMonCount(monCount); |
| | | return service.serchByBattProducerGroup(bif); |
| | | } |
| | | |
| | | //6.4.10按地域和标称电压分组统计蓄电池组使用时间(蓄电池投产年限统计) |
| | | @GetMapping("battGroupTimeInUse") |
| | | public ServiceModel serchByBattInUseDateGroup(@RequestBody BattInf bif){ |
| | | // bif=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,BattInf.class); |
| | | model=service.serchByBattInUseDateGroup(bif); |
| | | |
| | | return model; |
| | | @PostMapping("battGroupTimeInUse") |
| | | @ApiOperation(notes = "",value="按地域和标称电压分组统计蓄电池组使用时间(蓄电池投产年限统计)") |
| | | public ServiceModel serchByBattInUseDateGroup(@ApiParam(value = "区域层次(字符串数字)",required = true) @RequestParam String stationId, |
| | | @ApiParam(value = "获取年份",required = true) @RequestParam Integer monNum, |
| | | @ApiParam(value = "存放统计方式:年度统计为0 季度统计为1",required = true) @RequestParam Integer battGroupNum, |
| | | @ApiParam(value = "存放统计季度:一季度为1 以此类推",required = true) @RequestParam Integer monCount){ |
| | | ServiceModel model = new ServiceModel(); |
| | | BattInf bif = new BattInf(); |
| | | try { |
| | | Integer.parseInt(stationId); |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | model.setMsg("参数不合法"); |
| | | return model; |
| | | } |
| | | bif.setStationId(stationId); |
| | | bif.setBattGroupNum(battGroupNum); |
| | | bif.setMonNum(monNum); |
| | | bif.setMonCount(monCount); |
| | | return service.serchByBattInUseDateGroup(bif); |
| | | } |
| | | |
| | | //1 根据机房id查询电池组id排序最小值 |
| | | @GetMapping("byIdLow") |
| | | public ServiceModel serchByIdLow(@RequestBody BattInf bif){ |
| | | // bif=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,BattInf.class); |
| | | ServiceModel model =service.serchByIdLow(bif); |
| | | |
| | | return model; |
| | | @PostMapping("byIdLow") |
| | | @ApiOperation(notes = "",value="机房id查询电池组id排序最小值") |
| | | public ServiceModel serchByIdLow(@RequestParam String stationId){ |
| | | ServiceModel model = new ServiceModel(); |
| | | BattInf bif = new BattInf(); |
| | | try { |
| | | Integer.parseInt(stationId); |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | model.setMsg("参数不合法"); |
| | | return model; |
| | | } |
| | | bif.setStationId(stationId); |
| | | return service.serchByIdLow(bif); |
| | | } |
| | | |
| | | //查询所有的机房 |
| | | @GetMapping("allStation") |
| | | @ApiOperation(notes = "",value="查询所有的机房") |
| | | public ServiceModel serchAllStation(){ |
| | | User_inf u = (User_inf)ActionUtil.getUser(); |
| | | ServiceModel model = service.serchAllStation(u); |
| | | |
| | | return model; |
| | | |
| | | return service.serchAllStation(u); |
| | | } |
| | | |
| | | |
| | | //搜索机房或电池组 |
| | | @GetMapping("stationOrBattGroup") |
| | | public ServiceModel serchStationOrBattgroup(@RequestBody BattInf binf){ |
| | | // BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class); |
| | | ServiceModel model = service.serchStationOrBattgroup(binf); |
| | | |
| | | return model; |
| | | @PostMapping("stationOrBattGroup") |
| | | @ApiOperation(notes = "num:1 机房;0电池组 两种状态 stationName9 模糊查询条件", value = "搜索机房或电池组") |
| | | public ServiceModel serchStationOrBattgroup(@ApiParam(value = "1 机房;0 电池组",required = true) @RequestParam Integer num,@RequestParam String stationName9) { |
| | | BattInf binf = new BattInf(); |
| | | binf.setNum(num); |
| | | binf.setStationName9(stationName9); |
| | | return service.serchStationOrBattgroup(binf); |
| | | } |
| | | |
| | | //根据机房id查询机房下的电池组信息 |
| | | @GetMapping("battByStationId") |
| | | public ServiceModel serchBattByStation(@RequestBody BattInf binf){ |
| | | // BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class); |
| | | ServiceModel model = service.serchBattByStation(binf); |
| | | // result = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").toJson(model); |
| | | return model; |
| | | @PostMapping("battByStationId") |
| | | @ApiOperation(notes = "",value="机房id查询机房下的电池组信息") |
| | | public ServiceModel serchBattByStation(@RequestParam String stationId){ |
| | | ServiceModel model = new ServiceModel(); |
| | | BattInf binf = new BattInf(); |
| | | try { |
| | | Integer.parseInt(stationId); |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | model.setMsg("参数不合法"); |
| | | return model; |
| | | } |
| | | binf.setStationId(stationId); |
| | | return service.serchBattByStation(binf); |
| | | } |
| | | |
| | | //查询所有的电池组数 |
| | | @GetMapping("battCount") |
| | | public ServiceModel serchAllBatt(){ |
| | | @ApiOperation(notes = "",value="查询所有的电池组数") |
| | | public ServiceModelOnce serchAllBatt(){ |
| | | User_inf u = (User_inf)ActionUtil.getUser(); |
| | | ServiceModel model = service.serchAllBatt(u); |
| | | |
| | | return model; |
| | | |
| | | return service.serchAllBatt(u); |
| | | } |
| | | |
| | | //查站点下的所有设备名称 |
| | | @GetMapping("devNameByStationName3") |
| | | public ServiceModel searchDevByStationName3(@RequestBody BattInf binf){ |
| | | // BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class); |
| | | ServiceModel model = service.searchDevByStationName3(binf); |
| | | |
| | | return model; |
| | | @PostMapping("devNameByStationName3") |
| | | @ApiOperation(notes = "模糊查询", value = "查站点下的所有设备名称") |
| | | public ServiceModel searchDevByStationName3(@ApiParam(value = "省", required = true) @RequestParam String stationName1, @ApiParam(value = "市", required = true) @RequestParam String stationName2, |
| | | @ApiParam(value = "机房", required = true) @RequestParam String stationName3, @ApiParam(value = "区", required = true) @RequestParam String stationName5) { |
| | | BattInf binf = new BattInf(); |
| | | binf.setStationName1(stationName1); |
| | | binf.setStationName2(stationName2); |
| | | binf.setStationName3(stationName3); |
| | | binf.setStationName5(stationName5); |
| | | return service.searchDevByStationName3(binf); |
| | | } |
| | | |
| | | //首页上根据stationid查询电池组的机历卡 |
| | | @GetMapping("battAllInfoByStationId") |
| | | public ServiceModel serchBattAllInfoByStationId(@RequestBody BattInf binf){ |
| | | // BattInf binf=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class); |
| | | ServiceModel model = service.serchBattAllInfoByStationId(binf); |
| | | |
| | | return model; |
| | | @PostMapping("battAllInfoByStationId") |
| | | @ApiOperation(notes = "",value="首页上根据stationid查询电池组的机历卡") |
| | | public ServiceModel serchBattAllInfoByStationId(@RequestParam String stationId){ |
| | | ServiceModel model = new ServiceModel(); |
| | | BattInf binf = new BattInf(); |
| | | try { |
| | | Integer.parseInt(stationId); |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | model.setMsg("参数不合法"); |
| | | return model; |
| | | } |
| | | binf.setStationId(stationId); |
| | | return service.serchBattAllInfoByStationId(binf); |
| | | } |
| | | //跨域访问获取所有电池组的信息<-------跨域-----------> |
| | | @GetMapping("inform_ky") |
| | | @ApiOperation(tags = "跨域", notes = "",value="跨域访问获取所有电池组的信息") |
| | | public ServiceModel searchInform_ky(){ |
| | | //isAllowHeaders(); //允许跨域访问 |
| | | ServiceModel model = new ServiceModel(); |
| | | model = service.searchInform_ky(); |
| | | |
| | | return model; |
| | | |
| | | return service.searchInform_ky(); |
| | | } |
| | | //添加新的电池组 |
| | | @PostMapping("ky") |
| | | @ApiOperation(notes = "TODO",value="添加新的电池组TODO") |
| | | public ServiceModel add_ky(@RequestBody List<BattInf> list) { |
| | | // List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType()); |
| | | ServiceModel model = service.add(list); |
| | | |
| | | return model; |
| | | return service.add(list); |
| | | } |
| | | //修改电池组信息<-------跨域-----------> |
| | | @PutMapping("ky") |
| | | @ApiOperation(tags = "跨域", notes = "",value="修改电池组信息") |
| | | public ServiceModel update_ky(@RequestBody List<BattInf> list) { |
| | | // List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType()); |
| | | ServiceModel model = service.update(list); |
| | | |
| | | return model; |
| | | return service.update(list); |
| | | } |
| | | //删除电池组<-------跨域-----------> |
| | | @DeleteMapping("ky") |
| | | @ApiOperation(tags = "跨域", notes = "",value="删除电池组") |
| | | public ServiceModel delete_ky(@RequestBody List<BattInf> list) { |
| | | // List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType()); |
| | | ServiceModel model = service.delete(list); |
| | | |
| | | return model; |
| | | return service.delete(list); |
| | | } |
| | | |
| | | //查询电池组信息<大屏显示> |
| | | @GetMapping("battOnBigScreen") |
| | | public ServiceModel serchBatt_DP(@RequestBody BattInf binf){ |
| | | // BattInf binf= getGson("yyyy-MM-dd").fromJson(json, BattInf.class); |
| | | model=service.serchBatt_DP(binf); |
| | | |
| | | return model; |
| | | @ApiOperation(notes = "未使用参数查询",value="查询电池组信息<大屏显示>") |
| | | public ServiceModel serchBatt_DP(){ |
| | | |
| | | BattInf binf= new BattInf(); |
| | | return service.serchBatt_DP(binf); |
| | | } |
| | | //紫晶山西——---机房列表 |
| | | @GetMapping("stationList") |
| | | @ApiOperation(notes = "",value="紫晶山西——---机房列表") |
| | | public ServiceModel searchStationList(){ |
| | | model=service.searchStationList(); |
| | | |
| | | return model; |
| | | |
| | | return service.searchStationList(); |
| | | } |
| | | |
| | | } |