whycrzh
2021-01-28 c8332186836b3dfe1fbd32d7bec7cd29a57e1888
src/main/java/com/fgkj/controller/BattDischarge_planController.java
@@ -5,6 +5,7 @@
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.*;
@@ -14,13 +15,14 @@
@RequestMapping("battDischargePlan")
@RestController
@Api
@Api(tags = "battDischargePlan接口")
public class BattDischarge_planController{
   @Resource
   private BattDischarge_planService service;
   @PostMapping("/")
   @ApiOperation(notes = "",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);
@@ -30,6 +32,7 @@
   
   //8.1批量添加电池计划
   @PostMapping("/batch")
   @ApiOperation(notes = "",value="批量添加电池计划")
   public ServiceModel  addPro(@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.addPro(plans);
@@ -38,6 +41,7 @@
   }
   @PutMapping("/")
   @ApiOperation(notes = "",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);///---------
@@ -47,6 +51,7 @@
   
    //8.1批量修改放电计划的开始时间
   @PutMapping("/batch")
   @ApiOperation(notes = "",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);///---------
@@ -55,6 +60,7 @@
   }
   @DeleteMapping("/")
   @ApiOperation(notes = "",value="删除")
   public ServiceModel del(@RequestBody BattDischarge_plan plan){
      // BattDischarge_plan plan = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattDischarge_plan.class);
      ServiceModel model = service.del(plan);
@@ -63,6 +69,7 @@
   }
   @GetMapping("all")
   @ApiOperation(notes = "",value="all")
   public ServiceModel searchAll(){
      ServiceModel model = service.searchAll();
@@ -71,6 +78,7 @@
   
   //8.1放电计划查询
   @GetMapping("byCondition")
   @ApiOperation(notes = "",value="放电计划查询")
   public ServiceModel serchByCondition(@RequestBody Batt_Maint_Dealarm bmd){
      // Batt_Maint_Dealarm bmd = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Batt_Maint_Dealarm.class);
      User_inf uinf=(User_inf) ActionUtil.getUser();
@@ -88,6 +96,7 @@
   }*/
   //8.1放电计划管理中进页面查询
   @GetMapping("battGroupInfo")
   @ApiOperation(notes = "",value="放电计划管理中进页面查询")
   public ServiceModel serchBattgroupinfo(){
      User_inf uinf=(User_inf) ActionUtil.getUser();
      ServiceModel model = service.serchBattgroupinfo(uinf);
@@ -96,6 +105,7 @@
   }
   //新版添加放电计划查询<排除设置过放电计划的电池组>
   @GetMapping("battPlan")
   @ApiOperation(notes = "",value="新版添加放电计划查询<排除设置过放电计划的电池组>")
   public ServiceModel serchBattPlan(@RequestBody BattInf binf){
      // BattInf binf= getGson("yyyy-MM-dd HH:mm:ss").fromJson(json,BattInf.class);
      User_inf uinf=(User_inf) ActionUtil.getUser();
@@ -106,6 +116,7 @@
   }
   //8.1查询未开始放电的放电计划总数
   @GetMapping("nums")
   @ApiOperation(notes = "",value="查询未开始放电的放电计划总数")
   public ServiceModel searchNums() {
      User_inf uinf=(User_inf) ActionUtil.getUser();
      ServiceModel model = service.searchNums(uinf);
@@ -121,6 +132,7 @@
    *Preset_groupvol:放电失败 
    *num: 总数*/
   @GetMapping("state")
   @ApiOperation(notes = "",value="放电计划管理中饼状图(放电计划统计查询)")
   public ServiceModel searchState(){
      User_inf uinf=(User_inf) ActionUtil.getUser();
      ServiceModel model = service.searchState(uinf);
@@ -133,6 +145,9 @@
          *1.同机房(或设备)同一时间只能一组电池组放电
          *2.同机房(或设备)内电池组放电时间相隔至少3天*/
   @GetMapping("/judgePlan")
   @ApiOperation(notes = "原则:\n" +
         "\t\t\t *1.同机房(或设备)同一时间只能一组电池组放电\n" +
         "\t\t\t *2.同机房(或设备)内电池组放电时间相隔至少3天",value="批量添加作业计划/修改作业计划时时先检测计划的可行性")
   public ServiceModel 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());
      ServiceModel model = service.judgePlan(listAll);