|
|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.xunmei.common.core.domain.DateRange;
|
|
|
import com.xunmei.common.core.enums.CycleCommonEnum;
|
|
|
+import com.xunmei.common.core.enums.OrgTypeEnum;
|
|
|
import com.xunmei.common.core.utils.DateUtils;
|
|
|
import com.xunmei.common.core.web.domain.AjaxResult;
|
|
|
import com.xunmei.common.core.web.page.TableDataInfo;
|
|
|
@@ -70,7 +71,8 @@ public class ApiPlanController {
|
|
|
AppPlan plan = appPlanService.getById(dto.getId());
|
|
|
//如果选择了计划立即生效
|
|
|
if (plan.getBuildTaskNow() == 1) {
|
|
|
- List<AppPlan> list = appPlanService.list(new LambdaQueryWrapper<AppPlan>().eq(AppPlan::getParentId, plan.getId()).eq(AppPlan::getDeleted, 0));
|
|
|
+ LambdaQueryWrapper<AppPlan> wrapper=new LambdaQueryWrapper<AppPlan>().eq(AppPlan::getParentId, plan.getId()).eq(AppPlan::getDeleted, 0);
|
|
|
+ List<AppPlan> list = appPlanService.list(wrapper);
|
|
|
list.add(plan);
|
|
|
List<Object> newlist = new ArrayList<>(list);
|
|
|
resumptionTaskBusiness.rebuildCurrentCycleTask(newlist);
|
|
|
@@ -188,19 +190,18 @@ public class ApiPlanController {
|
|
|
@GetMapping(value = "/distributeCheHui/{id}")
|
|
|
// @RequiresPermissions("core:plan:findById")
|
|
|
public AjaxResult distributeCheHui(@PathVariable Long id) {
|
|
|
- int i = appPlanService.distributeCheHui(id);
|
|
|
+ AppPlan planOld =appPlanService.getById(id);
|
|
|
+ AppPlan planNew = appPlanService.distributeCheHui(id);
|
|
|
//撤回后下发,不重新生成任务
|
|
|
-// AppPlan plan = appPlanService.getById(id);
|
|
|
-//
|
|
|
-// //撤回后的下发如果存在子计划并且勾选立即执行也需要生成任务
|
|
|
-// if (plan.getBuildTaskNow() == 1) {
|
|
|
-// List<AppPlan> list = appPlanService.list(new LambdaQueryWrapper<AppPlan>().eq(AppPlan::getParentId, plan.getId()).eq(AppPlan::getDeleted, 0));
|
|
|
-// list.add(plan);
|
|
|
-// List<Object> newlist = new ArrayList<>(list);
|
|
|
-// resumptionTaskBusiness.rebuildCurrentCycleTask(newlist);
|
|
|
-//
|
|
|
-// }
|
|
|
- return AjaxResult.success(i);
|
|
|
+
|
|
|
+ //行社的第一次下发也是走这里,如果是所属机构是行社且第一次下发,则要生成任务
|
|
|
+ if (planOld.getBuildTaskNow() == 1 && ObjectUtil.equal(planOld.getPlanOfOrgType().intValue(), OrgTypeEnum.HANG_SHE.getCode())
|
|
|
+ && ObjectUtil.equal(planOld.getPlanStatus(),0)) {
|
|
|
+ List<Object> newlist = new ArrayList<>();
|
|
|
+ newlist.add(planNew);
|
|
|
+ resumptionTaskBusiness.rebuildCurrentCycleTask(newlist);
|
|
|
+ }
|
|
|
+ return AjaxResult.success(planNew!=null);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取详情")
|