| | |
| | | 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.*; |
| | | |
| | |
| | | |
| | | @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); |
| | |
| | | |
| | | //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); |
| | |
| | | } |
| | | |
| | | @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);///--------- |
| | |
| | | |
| | | //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);///--------- |
| | |
| | | } |
| | | |
| | | @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); |
| | |
| | | } |
| | | |
| | | @GetMapping("all") |
| | | @ApiOperation(notes = "",value="all") |
| | | public ServiceModel searchAll(){ |
| | | ServiceModel model = service.searchAll(); |
| | | |
| | |
| | | |
| | | //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(); |
| | |
| | | }*/ |
| | | //8.1放电计划管理中进页面查询 |
| | | @GetMapping("battGroupInfo") |
| | | @ApiOperation(notes = "",value="放电计划管理中进页面查询") |
| | | public ServiceModel serchBattgroupinfo(){ |
| | | User_inf uinf=(User_inf) ActionUtil.getUser(); |
| | | ServiceModel model = service.serchBattgroupinfo(uinf); |
| | |
| | | } |
| | | //新版添加放电计划查询<排除设置过放电计划的电池组> |
| | | @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(); |
| | |
| | | } |
| | | //8.1查询未开始放电的放电计划总数 |
| | | @GetMapping("nums") |
| | | @ApiOperation(notes = "",value="查询未开始放电的放电计划总数") |
| | | public ServiceModel searchNums() { |
| | | User_inf uinf=(User_inf) ActionUtil.getUser(); |
| | | ServiceModel model = service.searchNums(uinf); |
| | |
| | | *Preset_groupvol:放电失败 |
| | | *num: 总数*/ |
| | | @GetMapping("state") |
| | | @ApiOperation(notes = "",value="放电计划管理中饼状图(放电计划统计查询)") |
| | | public ServiceModel searchState(){ |
| | | User_inf uinf=(User_inf) ActionUtil.getUser(); |
| | | ServiceModel model = service.searchState(uinf); |
| | |
| | | *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); |