| | |
| | | import com.fgkj.util.ActionUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | |
| | | @Resource |
| | | private Batt_rtstateService service; |
| | | |
| | | ServiceModel model = new ServiceModel(); |
| | | |
| | | // private Batt_rtstate rtstate; |
| | | |
| | | //实时监测中的查询实时组端信息 |
| | | @GetMapping("byCondition") |
| | | @PostMapping("byCondition") |
| | | @ApiOperation(notes = "",value="实时监测中的查询实时组端信息") |
| | | public ServiceModel serchByCondition(@RequestBody Batt_rtstate rtstate){ |
| | | //System.out.println("开始查询rtstate"); |
| | | public ServiceModel serchByCondition(@RequestParam Integer battGroupId) { |
| | | Batt_rtstate rtstate= new Batt_rtstate(); |
| | | rtstate.setBattGroupId(battGroupId); |
| | | ServiceModel model=service.serchByCondition(rtstate); |
| | | //System.out.println(model); |
| | | // result = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").toJson(model); |
| | | return model; |
| | | } |
| | | |
| | | //9.1根据查询电池组单体的实时数据(电池单体实时信息) |
| | | @GetMapping("byMons") |
| | | @PostMapping("byMons") |
| | | @ApiOperation(notes = "",value="查询电池组单体的实时数据(电池单体实时信息)") |
| | | public ServiceModel serchByMons(@RequestBody BattInf binf){ |
| | | // BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class); |
| | | public ServiceModel serchByMons(@RequestParam Integer battGroupId,@RequestParam Integer monNum) { |
| | | BattInf binf = new BattInf(); |
| | | binf.setBattGroupId(battGroupId); |
| | | binf.setMonNum(monNum); |
| | | ServiceModel model = service.serchByMons(binf); |
| | | return model; |
| | | } |
| | | |
| | | //根据电池组id查询该电池组/单体的实时情况(电池续航能力) |
| | | @GetMapping("byInfo") |
| | | @PostMapping("byInfo") |
| | | @ApiOperation(notes = "",value="电池组id查询该电池组/单体的实时情况(电池续航能力)") |
| | | public ServiceModel serchByInfo(@RequestBody BattInf binf){ |
| | | // BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class); |
| | | public ServiceModel serchByInfo(@RequestParam Integer battGroupId) { |
| | | BattInf binf = new BattInf(); |
| | | binf.setBattGroupId(battGroupId); |
| | | ServiceModel model = service.serchByInfo(binf); |
| | | return model; |
| | | } |
| | |
| | | ServiceModel model = service.serchBattStateRate(uinf); |
| | | return model; |
| | | } |
| | | |
| | | |
| | | //电池组实时情况+实时电池续航能力查询 |
| | | @GetMapping("battLife") |
| | | @ApiOperation(notes = "",value="电池组实时情况+实时电池续航能力查询") |
| | | @PostMapping("battLife") |
| | | @ApiOperation(notes = "{ \"binf\": { \"num\": 1, \"stationId\": \"\", \"stationName\": \"\", \"stationName1\": \"\", \"battGroupId\": 0 },\"pageBean\": { \"pageNum\": 0, \"pageSize\": 22 } }",value="电池组实时情况+实时电池续航能力查询") |
| | | public ServiceModel serchBattLife(@RequestBody Batt_Maint_Dealarm bmd){ |
| | | System.out.println("bmd = " + bmd); |
| | | // Batt_Maint_Dealarm bmd = ActionUtil.getGson().fromJson(json, Batt_Maint_Dealarm.class); |
| | | User_inf uinf=(User_inf) ActionUtil.getUser(); |
| | | bmd.setUinf(uinf); |
| | | ServiceModel model = service.serchBattLife(bmd); |
| | |
| | | |
| | | //测试数据——实时查询中左下角的充放电统计(旧) |
| | | @GetMapping("disOrCharge") |
| | | @ApiOperation(notes = "",value="测试数据——实时查询中左下角的充放电统计(旧)") |
| | | @Deprecated |
| | | @ApiOperation(notes = "Deprecated",value="测试数据——实时查询中左下角的充放电统计(旧)") |
| | | public ServiceModel serchDisOrChargr(){ |
| | | ServiceModel model = service.serchDisOrChargr(); |
| | | return model; |
| | |
| | | return model; |
| | | } |
| | | //实时监测中的查询实时组端信息 <!-- 跨域访问 ---> |
| | | @GetMapping("byCondition_ky") |
| | | @ApiOperation(notes = "跨域访问",value="实时监测中的查询实时组端信息") |
| | | public ServiceModel serchByCondition_ky(@RequestBody Batt_rtstate rtstate){ |
| | | @PostMapping("byCondition_ky") |
| | | @ApiOperation(tags = "跨域", notes = "",value="实时监测中的查询实时组端信息 跨域访问") |
| | | public ServiceModel serchByCondition_ky(@RequestParam Integer battGroupId){ |
| | | Batt_rtstate rtstate= new Batt_rtstate(); |
| | | rtstate.setBattGroupId(battGroupId); |
| | | //ActionUtil.isAllowHeaders(); //允许跨域访问 |
| | | // rtstate = ActionUtil.getGson().fromJson(json, Batt_rtstate.class); |
| | | ServiceModel model=service.serchByCondition_ky(rtstate); |