|
@@ -7,9 +7,12 @@ import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.common.utils.PageUtils;
|
|
|
import com.ruoyi.common.core.page.PagePlus;
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
+import com.ruoyi.zhdd.domain.PlanFile;
|
|
|
import com.ruoyi.zhdd.domain.PlanTask;
|
|
|
+import com.ruoyi.zhdd.domain.bo.PlanFileBo;
|
|
|
import com.ruoyi.zhdd.domain.bo.PlanTaskBo;
|
|
|
import com.ruoyi.zhdd.domain.vo.PlanTaskVo;
|
|
|
+import com.ruoyi.zhdd.service.IPlanFileService;
|
|
|
import com.ruoyi.zhdd.service.IPlanTaskService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -40,6 +43,8 @@ public class PlanServiceImpl extends ServicePlusImpl<PlanMapper, Plan, PlanVo> i
|
|
|
|
|
|
@Autowired
|
|
|
private IPlanTaskService planTaskService;
|
|
|
+ @Autowired
|
|
|
+ private IPlanFileService planFileService;
|
|
|
|
|
|
@Override
|
|
|
public PlanVo queryById(Long id){
|
|
@@ -69,6 +74,9 @@ public class PlanServiceImpl extends ServicePlusImpl<PlanMapper, Plan, PlanVo> i
|
|
|
map.put("3", three);
|
|
|
map.put("4", four);
|
|
|
voById.setPlanTasks(map);
|
|
|
+ PlanFileBo planFileBo = new PlanFileBo();
|
|
|
+ planFileBo.setPlanId(id);
|
|
|
+ voById.setPlanFiles(planFileService.queryList(planFileBo));
|
|
|
return voById;
|
|
|
}
|
|
|
|
|
@@ -103,7 +111,13 @@ public class PlanServiceImpl extends ServicePlusImpl<PlanMapper, Plan, PlanVo> i
|
|
|
for (PlanTask planTask : bo.getPlanTasks()) {
|
|
|
planTask.setPlanId(planId);
|
|
|
}
|
|
|
- return planTaskService.saveAll(bo.getPlanTasks());
|
|
|
+ // 处理预案文件
|
|
|
+ for (PlanFile planFile : bo.getPlanFiles()) {
|
|
|
+ planFile.setPlanId(planId);
|
|
|
+ }
|
|
|
+ planTaskService.saveAll(bo.getPlanTasks());
|
|
|
+ planFileService.saveAll(bo.getPlanFiles());
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -118,7 +132,14 @@ public class PlanServiceImpl extends ServicePlusImpl<PlanMapper, Plan, PlanVo> i
|
|
|
for (PlanTask planTask : bo.getPlanTasks()) {
|
|
|
planTask.setPlanId(planId);
|
|
|
}
|
|
|
- return planTaskService.saveAll(bo.getPlanTasks());
|
|
|
+ planFileService.remove(Wrappers.<PlanFile>lambdaQuery().eq(PlanFile::getPlanId, planId));
|
|
|
+ // 处理预案文件
|
|
|
+ for (PlanFile planFile : bo.getPlanFiles()) {
|
|
|
+ planFile.setPlanId(planId);
|
|
|
+ }
|
|
|
+ planTaskService.saveAll(bo.getPlanTasks());
|
|
|
+ planFileService.saveAll(bo.getPlanFiles());
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -138,6 +159,8 @@ public class PlanServiceImpl extends ServicePlusImpl<PlanMapper, Plan, PlanVo> i
|
|
|
}
|
|
|
removeByIds(ids);
|
|
|
// 同时删除预案任务数据
|
|
|
- return planTaskService.remove(Wrappers.<PlanTask>lambdaQuery().in(PlanTask::getPlanId, ids));
|
|
|
+ planTaskService.remove(Wrappers.<PlanTask>lambdaQuery().in(PlanTask::getPlanId, ids));
|
|
|
+ planFileService.remove(Wrappers.<PlanFile>lambdaQuery().in(PlanFile::getPlanId, ids));
|
|
|
+ return true;
|
|
|
}
|
|
|
}
|