|
|
@@ -221,7 +221,36 @@ public class ApiPlanController {
|
|
|
@GetMapping(value = "/distributeCheHui/{id}")
|
|
|
// @RequiresPermissions("core:plan:findById")
|
|
|
public AjaxResult distributeCheHui(@PathVariable Long id) {
|
|
|
- return AjaxResult.success(appPlanService.distributeCheHui(id));
|
|
|
+ int i = appPlanService.distributeCheHui(id);
|
|
|
+ AppPlan plan = appPlanService.getById(id);
|
|
|
+ //撤回后的下发如果存在子计划并且勾选立即执行也需要生成任务
|
|
|
+ if(i>0&&plan.getBuildTaskNow()==1){
|
|
|
+ DateTime datetime = new DateTime();
|
|
|
+ datetime.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
|
|
|
+ //当有周期存在时保持原有接口不变(doTask),否则按照新的接口创建
|
|
|
+ Integer plancycle = plan.getPlanCycle();
|
|
|
+ if (plancycle != null) {
|
|
|
+ if (plancycle == 2) {
|
|
|
+ taskBusiness.syncDay(datetime, plancycle);
|
|
|
+ }
|
|
|
+ if (plancycle == 3) {
|
|
|
+ taskBusiness.syncWeek(datetime, plancycle);
|
|
|
+ }
|
|
|
+ if (plancycle == 4) {
|
|
|
+ taskBusiness.syncMonth(datetime, plancycle);
|
|
|
+ }
|
|
|
+ if (plancycle == 5) {
|
|
|
+ taskBusiness.syncQuarter(datetime, plancycle);
|
|
|
+ }
|
|
|
+ if (plancycle == 6) {
|
|
|
+ taskBusiness.syncHalfYear(datetime, plancycle);
|
|
|
+ }
|
|
|
+ if (plancycle == 7) {
|
|
|
+ taskBusiness.syncYear(datetime, plancycle);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return AjaxResult.success(i);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取详情")
|