package com.fgkj.controller;
|
|
import com.fgkj.dto.*;
|
import com.fgkj.services.Batt_maint_infService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
|
@RequestMapping("battMaintInf")
|
@RestController
|
@Api(tags = "battMaintInf接口")
|
public class Batt_maint_infController{
|
|
@Resource
|
private Batt_maint_infService service;
|
|
/*private Batt_maint_inf bmi;
|
private Batt_Maint_Dealarm bd;
|
private Batt_User_Permit bup;*/
|
//private BattInf binf;
|
|
|
//2.1电池故障维护记录查询
|
@GetMapping("maint")
|
@ApiOperation(notes = "",value="电池故障维护记录查询")
|
public ServiceModel serchMaint(@RequestBody Batt_Maint_Dealarm bd){
|
//System.out.println(bd);
|
// bd = ActionUtil.getGson("yyyy-MM-dd").fromJson(result, Batt_Maint_Dealarm.class);
|
ServiceModel model=service.serchMaint(bd);
|
return model;
|
}
|
|
// 2.2电池故障处理统计查询
|
/*
|
* maint_result存放统计方式
|
* fault_caption存放维护区
|
* master_check存放包机人
|
* remark存放品牌
|
*/
|
@GetMapping("byCondition")
|
@ApiOperation(notes = "",value="电池故障处理统计查询")
|
public List serchByCondition(@RequestBody Batt_User_Permit bup){
|
// bup= ActionUtil.getGson("yyyy-MM-dd").fromJson(result, Batt_User_Permit.class);
|
List list=service.serchByCondition(bup);
|
return list;
|
}
|
|
//0.3查询所有的维护记录(只传page对象)
|
@GetMapping("/")
|
@ApiOperation(notes = "",value="查询所有的维护记录(只传page对象)")
|
public ServiceModel search(){
|
ServiceModel model=service.search();
|
return model;
|
}
|
|
//0.4电池组故障率
|
@GetMapping("all")
|
@ApiOperation(notes = "",value="电池组故障率")
|
public ServiceModel searchAll(){
|
ServiceModel model=service.searchAll();
|
return model;
|
}
|
|
//0.4/0.8电池组故障率/维护率(最新)
|
@GetMapping("byStationName")
|
@ApiOperation(notes = "",value="电池组故障率/维护率(最新)")
|
public ServiceModel searchByStationName(@RequestBody Batt_Maint_Dealarm bd) {
|
ServiceModel model=service.searchByStationName(bd);
|
|
return model;
|
}
|
|
//根据电池组id查询电池的故障信息
|
@GetMapping("byBattGroupId")
|
@ApiOperation(notes = "",value="电池组id查询电池的故障信息")
|
public ServiceModel searchByBattgroupId(@RequestBody Batt_maint_inf bmi){
|
// bmi=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result, Batt_maint_inf.class);
|
ServiceModel model=service.searchByBattgroupId(bmi);
|
return model;
|
}
|
|
//2.1 电池维护记录查询(编辑记录)
|
@PutMapping("/")
|
@ApiOperation(notes = "",value="电池维护记录查询(编辑记录)")
|
public ServiceModel update(@RequestBody Batt_maint_inf bmi,@RequestBody List<Batt_maint_process> process) {
|
// bmi=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result, Batt_maint_inf.class);
|
// List<Batt_maint_process> process = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, new TypeToken<List<Batt_maint_process>>(){}.getType());
|
ServiceModel model=service.update(bmi,process);
|
return model;
|
}
|
//2.1 电池维护记录查询(删除记录)
|
@DeleteMapping("/")
|
@ApiOperation(notes = "",value="电池维护记录查询(删除记录)")
|
public ServiceModel delete(@RequestBody Batt_maint_inf bmi) {
|
// bmi=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result, Batt_maint_inf.class);
|
ServiceModel model=service.delete(bmi);
|
return model;
|
}
|
|
|
/*public static void main(String[] args) throws ParseException {
|
Batt_maint_infService us = new Batt_maint_infService();
|
|
BattInf binf = new BattInf();
|
|
binf.setStationName("");
|
binf.setStationName1("");
|
binf.setBattGroupName("");
|
binf.setBattGroupName1("");
|
binf.setBattProducer("");
|
binf.setMonCapStd(100f); binf.setMonVolStd(12f);
|
binf.setBattGroupId(0);
|
binf.setStationName("");
|
binf.setStationName1("");
|
//binf.setBattGroupName("");
|
binf.setBattGroupId(0);
|
binf.setBattGroupName1("");
|
binf.setBattProducer("");
|
binf.setMonCapStd(0f);
|
binf.setMonVolStd(0f);
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
Date date1 = sdf.parse("2000-01-01");
|
Date date2 = sdf.parse("2016-07-14");
|
binf.setBattProductDate(ActionUtil.getSimpDate(date1));
|
binf.setBattProductDate1(ActionUtil.getSimpDate(date2));
|
binf.setBattInUseDate(ActionUtil.getSimpDate(date1));
|
binf.setBattInUseDate1(ActionUtil.getSimpDate(date2));
|
|
*//*
|
binf.getStationName1(), binf.getStationName(),
|
binf.getBattGroupName(), binf.getBattProducer(),
|
binf.getBattGroupName1(), binf.getBattProductDate(),
|
binf.getBattProductDate1(), binf.getBattInUseDate(),
|
binf.getBattInUseDate1(),uinf.getuName()
|
*//*
|
|
Batt_maintenance_inf minf = new Batt_maintenance_inf();
|
minf.setRemark("100");
|
minf.setMaintenance_time(ActionUtil.getSimpDate(date1));
|
minf.setMaintenance_time1(ActionUtil.getSimpDate(date2));
|
|
Batttestdata_inf tdata = new Batttestdata_inf();
|
tdata.setTest_type(0);
|
tdata.setRecord_time(ActionUtil.getSimpDate(date1));
|
tdata.setRecord_time1(ActionUtil.getSimpDate(date2));
|
|
User_inf uinf=new User_inf();
|
uinf.setuName("0");
|
|
Page p=new Page();
|
p.setPageCurr(1);
|
p.setPageSize(1);
|
|
Batt_Maint_Dealarm bmd = new Batt_Maint_Dealarm();
|
bmd.setBinf(binf);
|
bmd.setMinf(minf);
|
bmd.setTdata(tdata);
|
bmd.setPage(p);
|
bmd.setUinf(uinf);
|
//List list=us.serchMaint(bmd);
|
List list=us.serchByCondition(bmd);
|
//System.out.println(list);
|
}*/
|
|
}
|