package com.fgkj.controller;
|
|
import com.fgkj.dto.*;
|
import com.fgkj.services.Batt_rtstateService;
|
import com.fgkj.util.ActionUtil;
|
import io.swagger.annotations.Api;
|
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 javax.annotation.Resource;
|
|
@RequestMapping("battRtState")
|
@RestController
|
@Api
|
public class Batt_rtstateController{
|
|
@Resource
|
private Batt_rtstateService service;
|
|
ServiceModel model = new ServiceModel();
|
|
// private Batt_rtstate rtstate;
|
|
//实时监测中的查询实时组端信息
|
@GetMapping("byCondition")
|
public ServiceModel serchByCondition(@RequestBody Batt_rtstate rtstate){
|
//System.out.println("开始查询rtstate");
|
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")
|
public ServiceModel serchByMons(@RequestBody BattInf binf){
|
// BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
|
ServiceModel model = service.serchByMons(binf);
|
return model;
|
}
|
|
//根据电池组id查询该电池组/单体的实时情况(电池续航能力)
|
@GetMapping("byInfo")
|
public ServiceModel serchByInfo(@RequestBody BattInf binf){
|
// BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
|
ServiceModel model = service.serchByInfo(binf);
|
return model;
|
}
|
|
//查询电池组的实时状态(电池组状态查询<放电,充电>)
|
// public ServiceModel serchBattState(){
|
// Batt_Maint_Dealarm bmd = ActionUtil.getGson().fromJson(json, Batt_Maint_Dealarm.class);
|
// ServiceModel model = service.serchBattState(bmd);
|
// result = ActionUtil.tojson(model);
|
// return model;
|
// }
|
//首页上饼状图电池状态比例
|
@GetMapping("battStateRate")
|
public ServiceModel serchBattStateRate(){
|
User_inf uinf=(User_inf) ActionUtil.getUser();
|
ServiceModel model = service.serchBattStateRate(uinf);
|
return model;
|
}
|
|
//电池组实时情况+实时电池续航能力查询
|
@GetMapping("battLife")
|
public ServiceModel serchBattLife(@RequestBody Batt_Maint_Dealarm 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);
|
return model;
|
}
|
|
//测试数据——实时查询中左下角的充放电统计(旧)
|
@GetMapping("disOrCharge")
|
public ServiceModel serchDisOrChargr(){
|
ServiceModel model = service.serchDisOrChargr();
|
return model;
|
}
|
|
//测试数据——实时查询中左下角的充放电统计(用户管理的机房)
|
@GetMapping("disOrCharge2")
|
public ServiceModel serchDisOrChargrNew(){
|
User_inf uinf=(User_inf) ActionUtil.getUser();
|
ServiceModel model = service.serchDisOrChargrNew(uinf);
|
return model;
|
}
|
//实时监测中的查询实时组端信息 <!-- 跨域访问 --->
|
@GetMapping("byCondition_ky")
|
public ServiceModel serchByCondition_ky(@RequestBody Batt_rtstate rtstate){
|
//ActionUtil.isAllowHeaders(); //允许跨域访问
|
// rtstate = ActionUtil.getGson().fromJson(json, Batt_rtstate.class);
|
ServiceModel model=service.serchByCondition_ky(rtstate);
|
// result = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").toJson(model);
|
return model;
|
}
|
|
}
|