| | |
| | | |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.BattDischargePlanTemp; |
| | | import com.whyc.service.BattDischargePlanTempService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = "放电计划临时表") |
| | | @RequestMapping("battDischargePlanTemp") |
| | |
| | | return service.getDisabledDischargeTime(num); |
| | | } |
| | | |
| | | @ApiOperation(value = "放电时间互换") |
| | | @PostMapping("exchangeDischargeTime") |
| | | public Response updateExchangeDischargeTime(@RequestParam int numOriginal,@RequestParam int numReplaced){ |
| | | return service.exchangeDischargeTime(numOriginal,numReplaced); |
| | | } |
| | | |
| | | /** |
| | | * 创建到临时表中,专员创建 |
| | | * @param resetCapPercent |
| | | * @param startTime |
| | | * @return |
| | | * @throws ParseException |
| | | */ |
| | | @ApiOperation("创建放电计划审批清单-专员创建") |
| | | @GetMapping("generateDischargePlan") |
| | | public Response addGenerateDischargePlan(@RequestParam Float resetCapPercent,@RequestParam String startTime) throws ParseException { |
| | | return service.generateDischargePlan(resetCapPercent,startTime); |
| | | } |
| | | |
| | | /** |
| | | * 创建到临时表中,组长创建 |
| | | * @param resetCapPercent |
| | | * @param startTime |
| | | * @return |
| | | * @throws ParseException |
| | | */ |
| | | @ApiOperation("创建放电计划审批清单2-组长创建") |
| | | @GetMapping("generateDischargePlan2") |
| | | public Response addGenerateDischargePlan2(@RequestParam Float resetCapPercent,@RequestParam String startTime) throws ParseException { |
| | | return service.generateDischargePlan2(resetCapPercent,startTime); |
| | | } |
| | | |
| | | /** |
| | | * 取消创建的临时表 |
| | | * @param startTime |
| | | * @return |
| | | * @throws ParseException |
| | | */ |
| | | @ApiOperation("取消正在创建的放电计划审批清单|取消某一年度放电计划审批清单") |
| | | @PostMapping("cancelDischargePlanTemp") |
| | | @Deprecated |
| | | public Response deleteCancelDischargePlanTemp(@RequestParam String startTime) throws ParseException { |
| | | return service.deleteDischargePlanTemp(startTime); |
| | | } |
| | | |
| | | /** |
| | | * 取消尚未提交的放电计划记录-组长 |
| | | * @param startTime |
| | | * @return |
| | | * @throws ParseException |
| | | */ |
| | | @ApiOperation("删除尚未提交的放电计划记录-组长") |
| | | @PostMapping("cancelDischargePlanTemp2") |
| | | public Response deleteCancelDischargePlanTemp2(@RequestParam String startTime) throws ParseException { |
| | | return service.deleteDischargePlanTemp2(startTime); |
| | | } |
| | | |
| | | /** |
| | | * 提交放电计划临时表,更新临时表参数; |
| | | * 同时,自动提交给包含的班组的组长会签 |
| | | * @return |
| | | * @throws ParseException |
| | | */ |
| | | @ApiOperation(value="确定|更新放电计划临时表",notes = "数组内只需要传id,dischargeStartTime") |
| | | @PostMapping("listAndSubmit") |
| | | public Response updateListAndSubmit(@RequestBody List<BattDischargePlanTemp> list,@RequestParam String taskDesc) { |
| | | return service.updateListAndSubmit(list,taskDesc); |
| | | } |
| | | |
| | | /** |
| | | * 提交放电计划临时表,更新临时表参数; |
| | | * 同时,提交给管理专责 |
| | | * @return |
| | | * @throws ParseException |
| | | */ |
| | | @ApiOperation(value="确定|更新放电计划临时表",notes = "数组内只需要传id,dischargeStartTime") |
| | | @PostMapping("listAndSubmit2") |
| | | public Response updateListAndSubmit2(@RequestBody List<BattDischargePlanTemp> list,@RequestParam String taskDesc) { |
| | | return service.updateListAndSubmit2(list,taskDesc); |
| | | } |
| | | |
| | | /** |
| | | * 临时表中计划经过审核后,提交到正式的放电计划表中 已被弃用,新的审核流程更严格 {@link com.whyc.controller.WorkflowMainController} |
| | | * @param tempList 临时表中的计划 |
| | | * @return |
| | | * @throws ParseException |
| | | */ |
| | | //@ApiOperation(value = "审核放电计划",notes = "approveStatus 1:审核通过,-1:审核拒绝") |
| | | //@PutMapping("approveDischargePlan") |
| | | @Deprecated |
| | | public Response updateApproveDischargePlan(@RequestParam int approveStatus,@RequestParam(required = false) String approveReason,@RequestBody List<BattDischargePlanTemp> tempList){ |
| | | return service.updateApproveDischargePlan(approveStatus,approveReason,tempList); |
| | | } |
| | | |
| | | @ApiOperation("删除当前用户之前未提交的所有记录") |
| | | @PostMapping("deleteNotSubmitted") |
| | | public Response deleteNotSubmitted(){ |
| | | return service.deleteNotSubmitted(); |
| | | } |
| | | |
| | | @ApiOperation("查询占用的时间") |
| | | @GetMapping("occupiedTime") |
| | | public Response getOccupiedTime(){ |
| | | List<Date> occupiedTime = service.getOccupiedTime(); |
| | | return new Response().set(1,occupiedTime); |
| | | } |
| | | |
| | | } |