web : 修改bug

dev_2.1.0
xueqingkun 1 year ago
parent b25502f4e5
commit 9ac58c3c6c

@ -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;
}
/**

@ -147,10 +147,17 @@ public class DiseaseTreatmentPlanManageServiceImpl implements DiseaseTreatmentPl
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean deleteDiseaseTreatmentPlan(String id) {
Assert.notEmpty(id,"id不能为空");
return diseaseTreatmentPlanService.removeById(id);
DiseaseTreatmentPlan diseaseTreatmentPlan = diseaseTreatmentPlanService.getById(id);
if (Objects.isNull(diseaseTreatmentPlan)){
return false;
}
diseaseTreatmentPlanService.removeById(id);
diseaseTreatmentPlanDrugService.lambdaUpdate().eq(DiseaseTreatmentPlanDrug::getDiseaseTreatmentPlanId,id).remove();
return true;
}
@Override

@ -215,8 +215,10 @@ public class AskDiagnosisResultServiceImpl implements AskDiagnosisResultService
physicalRecordList = physicalRecordList.stream()
.filter(distinctPredicateNotNull(PhysicalRecordByResultDTO::getToolLocationName)).collect(Collectors.toList());
// 工具id相等且 位置为空或者位置id相等
BiFunction<PhysicalRecordByResultDTO,DiseasePhysicalResVo,Boolean> biFunction = (r, diseasePhysical) -> StrUtil.equals(diseasePhysical.getToolId(),r.getToolId())
&& StrUtil.equals(diseasePhysical.getLocationId(),(r.getLocationId()));
&& ((StrUtil.isEmpty(diseasePhysical.getLocationId()) && StrUtil.isEmpty(diseasePhysical.getLocationId()))
|| StrUtil.equals(diseasePhysical.getLocationId(),(r.getLocationId())));
Function<PhysicalRecordByResultDTO,BasisDiagnosisNodeResVO> t1 = r -> new BasisDiagnosisNodeResVO(1, r.getToolLocationName(),
r.getRecordId(), functionCorrect.apply(r));

Loading…
Cancel
Save