|
@@ -21,11 +21,14 @@ import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.util.SysUserUtils;
|
|
|
import com.diagbot.util.UserUtils;
|
|
|
import com.diagbot.vo.HospitalPlanCancelVO;
|
|
|
+import com.diagbot.vo.HospitalPlanDetailSaveVO;
|
|
|
import com.diagbot.vo.HospitalPlanPageVO;
|
|
|
import com.diagbot.vo.HospitalPlanSaveVO;
|
|
|
import com.diagbot.vo.HospitalPlanVO;
|
|
|
import com.diagbot.vo.HospitalSetVO;
|
|
|
import com.diagbot.vo.PlanDetailCancelVO;
|
|
|
+import com.diagbot.vo.PlanDetailSaveVO;
|
|
|
+import com.diagbot.vo.PlanDetailSubSaveVO;
|
|
|
import com.diagbot.vo.PlanRevStopVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -101,6 +104,7 @@ public class PlanFacade extends PlanServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public boolean savePlanInfoDatas(HospitalPlanSaveVO hospitalPlanSaveVO) {
|
|
|
+ Long planId = hospitalPlanSaveVO.getId();
|
|
|
Date now = DateUtil.now();
|
|
|
boolean res = false;
|
|
|
// 校验名称是否相同
|
|
@@ -132,7 +136,35 @@ public class PlanFacade extends PlanServiceImpl {
|
|
|
plan.setCreator(SysUserUtils.getCurrentPrincipleID());
|
|
|
plan.setModifier(SysUserUtils.getCurrentPrincipleID());
|
|
|
res = this.save(plan);
|
|
|
+ planId = plan.getId();
|
|
|
}
|
|
|
+ PlanDetailSaveVO planDetailSaveVO = new PlanDetailSaveVO();
|
|
|
+ planDetailSaveVO.setPlanId(planId);
|
|
|
+ planDetailSaveVO.setHospitalId(hospitalPlanSaveVO.getHospitalId());
|
|
|
+ List<HospitalPlanDetailSaveVO> planDetailParentNew = new ArrayList<>();
|
|
|
+ List<HospitalPlanDetailSaveVO> planDetailParent = hospitalPlanSaveVO.getPlanDetailParent();
|
|
|
+ if (ListUtil.isNotEmpty(planDetailParent)) {
|
|
|
+ for (HospitalPlanDetailSaveVO data : planDetailParent) {
|
|
|
+ HospitalPlanDetailSaveVO dataNew = new HospitalPlanDetailSaveVO();
|
|
|
+ BeanUtil.copyProperties(data, dataNew);
|
|
|
+ dataNew.setPlanId(planId);
|
|
|
+ List<PlanDetailSubSaveVO> planDetailSubNew = new ArrayList<>();
|
|
|
+ List<PlanDetailSubSaveVO> planDetailSub = data.getPlanDetailSub();
|
|
|
+ if (ListUtil.isNotEmpty(planDetailSub)) {
|
|
|
+ for (PlanDetailSubSaveVO dataSub : planDetailSub) {
|
|
|
+ PlanDetailSubSaveVO dataSubNew = new PlanDetailSubSaveVO();
|
|
|
+ BeanUtil.copyProperties(dataSub, dataSubNew);
|
|
|
+ dataSubNew.setPlanId(planId);
|
|
|
+ planDetailSubNew.add(dataSubNew);
|
|
|
+ }
|
|
|
+ dataNew.setPlanDetailSub(planDetailSubNew);
|
|
|
+ planDetailParentNew.add(dataNew);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ planDetailSaveVO.setPlanDetailParent(planDetailParentNew);
|
|
|
+ res = sysSetFacade.savePlanDetail(planDetailSaveVO);
|
|
|
return res;
|
|
|
}
|
|
|
|
|
@@ -191,7 +223,7 @@ public class PlanFacade extends PlanServiceImpl {
|
|
|
boolean res = false;
|
|
|
// 1.先判断数据是否存在有效
|
|
|
Plan plan = checkPlan(hospitalPlanCancelVO.getPlanId());
|
|
|
- if(plan.getPlanStatus()==1){
|
|
|
+ if (plan.getPlanStatus() == 1) {
|
|
|
throw new CommonException(CommonErrorCode.FAIL, "该方案启用中,不能删除!");
|
|
|
}
|
|
|
UpdateWrapper<Plan> planNew = new UpdateWrapper<>();
|