package com.fgkj.controller;
|
|
import com.fgkj.dto.BattInf;
|
import com.fgkj.dto.Batt_Maint_Dealarm;
|
import com.fgkj.dto.Batttestdata_inf;
|
import com.fgkj.dto.ServiceModel;
|
import com.fgkj.services.Batttestdata_infService;
|
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 javax.annotation.Resource;
|
import java.text.ParseException;
|
|
@RequestMapping("battTestDataInf")
|
@RestController
|
@Api(tags = "battTestDataInf接口")
|
//Perry TODO
|
public class Batttestdata_infController{
|
|
ServiceModel model = new ServiceModel();
|
|
@Resource
|
private Batttestdata_infService service;
|
|
// private Batttestdata_inf bti;
|
// private Batt_Maint_Dealarm bmd;
|
|
@GetMapping("byInfo")
|
@ApiOperation(notes = "",value="历史数据查询")
|
public ServiceModel findByInfo(@RequestBody Batttestdata_inf bti){
|
model=service.serchByCondition(bti);
|
|
return model;
|
}
|
|
/**
|
* 根据电池组id查询电池组的inf表中的放电信息
|
*/
|
@GetMapping("battTestInfDataById")
|
@ApiOperation(notes = "",value="电池组id查询电池组的inf表中的放电信息")
|
public ServiceModel searchBattTestInfDataById(@RequestBody Batttestdata_inf bti){
|
// Batttestdata_inf bti = ActionUtil.getGson().fromJson(json, Batttestdata_inf.class);
|
model=service.serchByCondition(bti);
|
|
return model;
|
}
|
|
//0.7电测放电测试比例
|
@GetMapping("testScale")
|
@ApiOperation(notes = "",value="电测放电测试比例")
|
public ServiceModel searchTestsCale(@RequestBody Batt_Maint_Dealarm bmd){
|
try {
|
model=service.serchByInfo(bmd);
|
} catch (ParseException e) {
|
e.printStackTrace();
|
}
|
|
return model;
|
}
|
|
//0.10电池健康率
|
@GetMapping("healthRate")
|
@ApiOperation(notes = "",value="电池健康率")
|
public ServiceModel searchGood(){
|
model=service.serchGood();
|
|
return model;
|
}
|
|
//6.4.2根据条件查询符合条件的测试完成的电池组(蓄电池放电测试完成率)
|
@GetMapping("completeRate")
|
@ApiOperation(notes = "",value="条件查询符合条件的测试完成的电池组(蓄电池放电测试完成率)")
|
public ServiceModel serchComplete(@RequestBody Batttestdata_inf b){
|
// Batttestdata_inf b=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result, Batttestdata_inf.class);
|
ServiceModel model=service.serchComplete(b);
|
|
return model;
|
}
|
|
//6.4.4根据条件查询符合条件的测试完成的电池组(蓄电池容量预警)
|
@GetMapping("capWarning")
|
@ApiOperation(notes = "",value="条件查询符合条件的测试完成的电池组(蓄电池容量预警)")
|
public ServiceModel serchCap(@RequestBody Batttestdata_inf b){
|
// Batttestdata_inf b=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result, Batttestdata_inf.class);
|
ServiceModel model=service.serchCap(b);
|
|
return model;
|
}
|
|
//电池组历史放电数据续航能力查询
|
@GetMapping("battLife")
|
@ApiOperation(notes = "",value="电池组历史放电数据续航能力查询")
|
public ServiceModel serchBattLife(@RequestBody BattInf binf){
|
// BattInf binf = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result, BattInf.class);
|
ServiceModel model = new ServiceModel();
|
if(binf.getBattGroupId() == 0){
|
model = service.serchBattLifeNow(binf);
|
}else if(binf.getBattGroupId() == 1){
|
model = service.serchBattLife(binf);
|
}
|
return model;
|
}
|
/* 根据电池组id查询电池组的inf表中的放电信息 <!------ 跨域访问 --------->
|
*/
|
@GetMapping("battTestInfDataById_ky")
|
@ApiOperation(tags = "跨域", notes = "",value="根据电池组id查询电池组的inf表中的放电信息 跨域专用")
|
public ServiceModel searchBattTestInfDataById_ky(@RequestBody Batttestdata_inf bti){
|
// Batttestdata_inf bti = ActionUtil.getGson().fromJson(json, Batttestdata_inf.class);
|
model=service.serchByCondition_ky(bti);
|
|
return model;
|
}
|
|
}
|