|
|
|
@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
|
import cn.hutool.core.lang.UUID;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.AbstractWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
@ -12,11 +11,14 @@ import com.supervision.manage.constant.DisposalPlanEnum;
|
|
|
|
|
import com.supervision.manage.service.ConfigTreatmentPlanManageService;
|
|
|
|
|
import com.supervision.model.ConfigTreatmentPlan;
|
|
|
|
|
import com.supervision.model.DiseaseTreatmentPlan;
|
|
|
|
|
import com.supervision.model.DiseaseTreatmentPlanDrug;
|
|
|
|
|
import com.supervision.service.ConfigTreatmentPlanService;
|
|
|
|
|
import com.supervision.service.DiseaseTreatmentPlanDrugService;
|
|
|
|
|
import com.supervision.service.DiseaseTreatmentPlanService;
|
|
|
|
|
import com.supervision.vo.manage.TreatmentPlanTreeNode;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
@ -29,6 +31,8 @@ public class ConfigTreatmentPlanManageServiceImpl implements ConfigTreatmentPlan
|
|
|
|
|
|
|
|
|
|
private final DiseaseTreatmentPlanService diseaseTreatmentPlanService;
|
|
|
|
|
|
|
|
|
|
private final DiseaseTreatmentPlanDrugService diseaseTreatmentPlanDrugService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<TreatmentPlanTreeNode> queryTree(Integer disposalMethod) {
|
|
|
|
|
|
|
|
|
@ -76,11 +80,21 @@ public class ConfigTreatmentPlanManageServiceImpl implements ConfigTreatmentPlan
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public boolean deleteTreatmentPlan(String id) {
|
|
|
|
|
|
|
|
|
|
Assert.notEmpty(id,"id 不允许为空");
|
|
|
|
|
assertTreatmentPlanUsed(id);
|
|
|
|
|
return configTreatmentPlanService.removeById(id);
|
|
|
|
|
|
|
|
|
|
ConfigTreatmentPlan configTreatmentPlan = configTreatmentPlanService.getById(id);
|
|
|
|
|
if (Objects.isNull(configTreatmentPlan)){
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
configTreatmentPlanService.removeById(id);
|
|
|
|
|
|
|
|
|
|
diseaseTreatmentPlanService.lambdaUpdate().eq(DiseaseTreatmentPlan::getTreatmentPlanId, configTreatmentPlan.getId()).remove();
|
|
|
|
|
diseaseTreatmentPlanDrugService.lambdaUpdate().eq(DiseaseTreatmentPlanDrug::getTreatmentPlanId, configTreatmentPlan.getId()).remove();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|