package com.fgkj.controller;
|
|
import com.fgkj.util.*;
|
|
import com.fgkj.dto.*;
|
import com.fgkj.services.BattDischarge_planService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.List;
|
|
import javax.annotation.Resource;
|
|
@RequestMapping("battDischargePlan")
|
@RestController
|
@Api(tags = "battDischargePlan接口")
|
public class BattDischarge_planController{
|
|
@Resource
|
private BattDischarge_planService service;
|
|
@PostMapping("/")
|
@ApiOperation(notes = "{ \"battgroupid\": 1000002, \"battIndexInFbs\": 0, \"discharge_starttime\": \"2020-12-30 11:04:21\", \"discharge_starttime1\": \"2020-12-30 11:04:21\", \"discharge_stoptime\": \"2020-12-30 11:04:21\", \"discharge_stoptime1\": \"2020-12-30 11:04:21\", \"discharge_state\": 0, \"discharge_reason\": 0, \"discharge_cleartype\": 0, \"preset_time\": 0, \"preset_cap\": 0.0, \"preset_monvol\": 0.0, \"preset_groupvol\": 0.0, \"preset_curr\": 0.0, \"preset_mon\": 0, \"dcvolhighlimit\": 0.0, \"chargecurrset\": 0.0, \"plan_circle\": 0, \"plan_rate\": 0, \"note\": \"\" }",value="新增")
|
public ServiceModel add(@RequestBody BattDischarge_plan plan){
|
// BattDischarge_plan plan = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattDischarge_plan.class);
|
ServiceModel model =service.add(plan);
|
|
return model;
|
}
|
|
//8.1批量添加电池计划
|
@PostMapping("/batch")
|
@ApiOperation(notes = "[{ \"battgroupid\": 1000002, \"battIndexInFbs\": 0, \"discharge_starttime\": \"2020-12-30 11:04:21\", \"discharge_starttime1\": \"2020-12-30 11:04:21\", \"discharge_stoptime\": \"2020-12-30 11:04:21\", \"discharge_stoptime1\": \"2020-12-30 11:04:21\", \"discharge_state\": 0, \"discharge_reason\": 0, \"discharge_cleartype\": 0, \"preset_time\": 0, \"preset_cap\": 0.0, \"preset_monvol\": 0.0, \"preset_groupvol\": 0.0, \"preset_curr\": 0.0, \"preset_mon\": 0, \"dcvolhighlimit\": 0.0, \"chargecurrset\": 0.0, \"plan_circle\": 0, \"plan_rate\": 0, \"note\": \"\" }]",value="批量添加电池计划")
|
public ServiceModel addPro(@RequestBody List<BattDischarge_plan> list){
|
// List<BattDischarge_plan> plans = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json,new TypeToken<List<BattDischarge_plan>>(){}.getType());
|
ServiceModel model = service.addPro(list);
|
|
return model;
|
}
|
|
@PutMapping("/")
|
@ApiOperation(notes = "{ \"num\": 11, \"battgroupid\": 0, \"battIndexInFbs\": 0, \"discharge_starttime\": \"2020-12-31 11:52:56\", \"discharge_starttime1\": \"2020-12-31 11:52:56\", \"discharge_stoptime\": \"2020-12-31 11:52:56\", \"discharge_stoptime1\": \"2020-12-31 11:52:56\", \"discharge_state\": 0, \"discharge_reason\": 0, \"discharge_cleartype\": 0, \"preset_time\": 0, \"preset_cap\": 0.0, \"preset_monvol\": 0.0, \"preset_groupvol\": 0.0, \"preset_curr\": 0.0, \"preset_mon\": 0, \"dcvolhighlimit\": 0.0, \"chargecurrset\": 0.0, \"plan_circle\": 0, \"plan_rate\": 0, \"note\": \"\" }",value="修改")
|
public ServiceModel update(@RequestBody BattDischarge_plan plan){
|
// BattDischarge_plan plan = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattDischarge_plan.class);
|
ServiceModel model = service.update(plan);///---------
|
|
return model;
|
}
|
|
//8.1批量修改放电计划的开始时间
|
@PutMapping("/batch")
|
@ApiOperation(notes = "[{ \"num\":1, \"battgroupid\": 1000002, \"battIndexInFbs\": 0, \"discharge_starttime\": \"2020-12-30 11:04:21\", \"discharge_starttime1\": \"2020-12-30 11:04:21\", \"discharge_stoptime\": \"2020-12-30 11:04:21\", \"discharge_stoptime1\": \"2020-12-30 11:04:21\", \"discharge_state\": 0, \"discharge_reason\": 0, \"discharge_cleartype\": 0, \"preset_time\": 0, \"preset_cap\": 0.0, \"preset_monvol\": 0.0, \"preset_groupvol\": 0.0, \"preset_curr\": 0.0, \"preset_mon\": 0, \"dcvolhighlimit\": 0.0, \"chargecurrset\": 0.0, \"plan_circle\": 0, \"plan_rate\": 0, \"note\": \"\" }]",value="批量修改放电计划的开始时间")
|
public ServiceModel updatePro(@RequestBody List<BattDischarge_plan> plans){
|
// List<BattDischarge_plan> plans = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json,new TypeToken<List<BattDischarge_plan>>(){}.getType());
|
ServiceModel model = service.updatePro(plans);///---------
|
|
return model;
|
}
|
|
@DeleteMapping("/")
|
@ApiOperation(notes = "",value="删除")
|
public ServiceModel del(@RequestParam Integer num) {
|
BattDischarge_plan plan = new BattDischarge_plan();
|
plan.setNum(num);
|
ServiceModel model = service.del(plan);
|
|
return model;
|
}
|
|
@GetMapping("all")
|
@ApiOperation(notes = "",value="all")
|
public ServiceModel searchAll(){
|
ServiceModel model = service.searchAll();
|
|
return model;
|
}
|
|
//8.1放电计划查询
|
@PostMapping("byCondition")
|
@ApiOperation(notes = "{ \"binf\": { \"stationName\": \"\", \"stationName1\": \"\", \"battGroupId\": 0 },\"pageBean\": { \"pageSize\": 3, \"pageNum\": 0 },\"bplan\": { \"discharge_starttime\": \"2001-02-01 08:16:35\", \"discharge_starttime1\": \"2021-02-01 08:16:35\", \"discharge_state\": 0 } }",value="放电计划查询")
|
public ServiceModel serchByCondition(@RequestBody Batt_Maint_Dealarm bmd){
|
User_inf uinf=(User_inf) ActionUtil.getUser();
|
bmd.setUinf(uinf);
|
ServiceModel model = service.serchByCondition(bmd);
|
|
return model;
|
}
|
/*//8.1放电计划管理中查询
|
public ServiceModel serchBattgroupinfo(){
|
BattInf binf = ActionUtil.getGson("yyyy-MM-dd").fromJson(json, BattInf.class);
|
ServiceModel model = service.serchBattgroupinfo(binf);
|
|
return model;
|
}*/
|
|
//8.1放电计划管理中进页面查询
|
@GetMapping("battGroupInfo")
|
@ApiOperation(notes = "",value="放电计划管理中进页面查询")
|
public ServiceModel serchBattgroupinfo(){
|
User_inf uinf=(User_inf) ActionUtil.getUser();
|
ServiceModel model = service.serchBattgroupinfo(uinf);
|
|
return model;
|
}
|
|
|
//新版添加放电计划查询<排除设置过放电计划的电池组>
|
@PostMapping("battPlan")
|
@ApiOperation(notes = "stationId 等四个参数为模糊查询 结果集:{ \"code\": 1, \"msg\": \"查询成功!\", \"data\": [{ \"stationId\": \"42010007\", \"stationName\": \"山西省-太原市-迎泽区-局机房119-局机房站-1\", \"fbsDeviceId\": 910000001\"fparam\": { \"hourRate\": 0, \"disCurr\": 0, \"disCap\": 0, \"disTime\": 0, \"groupVol_Low\": 0, \"monomerVol_Low\": 0, \"monomerLowCount\": 0, \"battGroupNum\": 0, \"onlineLowAction\": 0, \"dCVolHighLimit\": 0, \"chargeCurrSet\": 0, \"offLineYH_Cycle\": 0, \"offLineYHTimes\": 0, \"offLineYHOnceCycle\": 0, \"onLineVol_Low\": 0 } }]}",value="新版添加放电计划查询<排除设置过放电计划的电池组>")
|
public ServiceModel serchBattPlan(@RequestParam String stationId,@RequestParam String stationName1,@RequestParam String stationName2,@RequestParam String stationName5) {
|
BattInf binf = new BattInf();
|
User_inf uinf = (User_inf) ActionUtil.getUser();
|
binf.setNum(uinf.getuId());
|
binf.setStationId(stationId);
|
binf.setStationName1(stationName1);
|
binf.setStationName2(stationName2);
|
binf.setStationName5(stationName5);
|
ServiceModel model = service.serchBattPlan(binf);
|
|
return model;
|
}
|
//8.1查询未开始放电的放电计划总数
|
@GetMapping("nums")
|
@ApiOperation(notes = "",value="查询未开始放电的放电计划总数")
|
public ServiceModelOnce searchNums() {
|
User_inf uinf = (User_inf) ActionUtil.getUser();
|
ServiceModelOnce model = service.searchNums(uinf);
|
|
return model;
|
}
|
|
//8.1放电计划管理中饼状图(放电计划统计查询)
|
/*BattIndexInFbs:未放电
|
*Preset_time:放电延时
|
*Preset_cap: 放电完成
|
*Preset_monvol:放电进行中
|
*Preset_groupvol:放电失败
|
*num: 总数*/
|
@GetMapping("state")
|
@ApiOperation(notes = "",value="放电计划管理中饼状图(放电计划统计查询)")
|
public ServiceModelOnce searchState() {
|
User_inf uinf = (User_inf) ActionUtil.getUser();
|
ServiceModelOnce model = service.searchState(uinf);
|
|
return model;
|
}
|
|
//8.1批量添加作业计划/修改作业计划时时先检测计划的可行性
|
/*原则:
|
*1.同机房(或设备)同一时间只能一组电池组放电
|
*2.同机房(或设备)内电池组放电时间相隔至少3天*/
|
@PostMapping("/judgePlan")
|
@ApiOperation(notes = "原则:\n" +
|
"\t\t\t *1.同机房(或设备)同一时间只能一组电池组放电\n" +
|
"\t\t\t *2.同机房(或设备)内电池组放电时间相隔至少3天",value="批量添加作业计划/修改作业计划时时先检测计划的可行性")
|
public ServiceModelOnce judgePlan(@RequestBody List<BattDischarge_plan> listAll){
|
// List<BattDischarge_plan> listAll= getGson("yyyy-MM-dd HH:mm:ss").fromJson(json,new TypeToken<List<BattDischarge_plan>>(){}.getType());
|
ServiceModelOnce model = service.judgePlan(listAll);
|
|
return model;
|
|
}
|
|
}
|