|
@@ -110,22 +110,26 @@ public class PlanDetailFacade extends PlanDetailServiceImpl {
|
|
planDetails.setCreator(SysUserUtils.getCurrentPrincipleID());
|
|
planDetails.setCreator(SysUserUtils.getCurrentPrincipleID());
|
|
planDetails.setModifier(SysUserUtils.getCurrentPrincipleID());
|
|
planDetails.setModifier(SysUserUtils.getCurrentPrincipleID());
|
|
planDetails.setGmtModified(now);
|
|
planDetails.setGmtModified(now);
|
|
- List<PlanDetailSubSaveVO> data = planDetailSave.getPlanDetailSub();
|
|
|
|
planDetailService.save(planDetails);
|
|
planDetailService.save(planDetails);
|
|
- List<PlanDetail> planDetailList = new ArrayList<>();
|
|
|
|
- //再保存子类
|
|
|
|
- for (PlanDetailSubSaveVO planDetailVO : data) {
|
|
|
|
- PlanDetail planDetail = new PlanDetail();
|
|
|
|
- BeanUtil.copyProperties(planDetailVO, planDetail);
|
|
|
|
- planDetail.setPlanId(planDetailSaveVO.getPlanId());
|
|
|
|
- planDetail.setParentId(planDetails.getId());
|
|
|
|
- planDetail.setGmtCreate(now);
|
|
|
|
- planDetail.setCreator(SysUserUtils.getCurrentPrincipleID());
|
|
|
|
- planDetail.setModifier(SysUserUtils.getCurrentPrincipleID());
|
|
|
|
- planDetail.setGmtModified(now);
|
|
|
|
- planDetailList.add(planDetail);
|
|
|
|
|
|
+ List<PlanDetailSubSaveVO> data = planDetailSave.getPlanDetailSub();
|
|
|
|
+ if(ListUtil.isNotEmpty(data)){
|
|
|
|
+ List<PlanDetail> planDetailList = new ArrayList<>();
|
|
|
|
+ //再保存子类
|
|
|
|
+ for (PlanDetailSubSaveVO planDetailVO : data) {
|
|
|
|
+ if(planDetailVO.getCode()!=null){
|
|
|
|
+ PlanDetail planDetail = new PlanDetail();
|
|
|
|
+ BeanUtil.copyProperties(planDetailVO, planDetail);
|
|
|
|
+ planDetail.setPlanId(planDetailSaveVO.getPlanId());
|
|
|
|
+ planDetail.setParentId(planDetails.getId());
|
|
|
|
+ planDetail.setGmtCreate(now);
|
|
|
|
+ planDetail.setCreator(SysUserUtils.getCurrentPrincipleID());
|
|
|
|
+ planDetail.setModifier(SysUserUtils.getCurrentPrincipleID());
|
|
|
|
+ planDetail.setGmtModified(now);
|
|
|
|
+ planDetailList.add(planDetail);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ res = planDetailService.saveBatch(planDetailList);
|
|
}
|
|
}
|
|
- res = planDetailService.saveBatch(planDetailList);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
return res;
|
|
return res;
|