|
|
|
@ -1,7 +1,9 @@
|
|
|
|
|
package com.supervision.service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import com.supervision.constant.TreatmentPlanIdConstant;
|
|
|
|
|
import com.supervision.model.ConfigDrug;
|
|
|
|
|
import com.supervision.model.ConfigTreatmentPlan;
|
|
|
|
|
import com.supervision.model.TreatmentPlanRecord;
|
|
|
|
@ -9,6 +11,7 @@ import com.supervision.service.ConfigDrugService;
|
|
|
|
|
import com.supervision.service.ConfigTreatmentPlanService;
|
|
|
|
|
import com.supervision.service.TreatmentPlanRecordService;
|
|
|
|
|
import com.supervision.mapper.TreatmentPlanRecordMapper;
|
|
|
|
|
import com.supervision.vo.ask.TreatmentPlanRecordVo;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
@ -29,7 +32,7 @@ public class TreatmentPlanRecordServiceImpl extends ServiceImpl<TreatmentPlanRec
|
|
|
|
|
|
|
|
|
|
private final ConfigDrugService configDrugService;
|
|
|
|
|
@Override
|
|
|
|
|
public List<TreatmentPlanRecord> queryByProcessId(String processId) {
|
|
|
|
|
public List<? extends TreatmentPlanRecord> queryByProcessId(String processId) {
|
|
|
|
|
|
|
|
|
|
// 1. 查询处置计划记录
|
|
|
|
|
List<TreatmentPlanRecord> treatmentPlanRecordList = super.lambdaQuery().eq(TreatmentPlanRecord::getProcessId, processId).list();
|
|
|
|
@ -52,19 +55,24 @@ public class TreatmentPlanRecordServiceImpl extends ServiceImpl<TreatmentPlanRec
|
|
|
|
|
}
|
|
|
|
|
Map<String, ConfigDrug> configDrugMap = configDrugs.stream().collect(Collectors.toMap(ConfigDrug::getId, v -> v));
|
|
|
|
|
|
|
|
|
|
List<TreatmentPlanRecordVo> result = new ArrayList<>();
|
|
|
|
|
for (TreatmentPlanRecord treatmentPlan : treatmentPlanRecordList) {
|
|
|
|
|
TreatmentPlanRecordVo bean = BeanUtil.toBean(treatmentPlan, TreatmentPlanRecordVo.class);
|
|
|
|
|
ConfigTreatmentPlan configTreatmentPlan = configTreatmentPlanMap.get(treatmentPlan.getTreatmentPlanId());
|
|
|
|
|
if (null != configTreatmentPlan){
|
|
|
|
|
treatmentPlan.setDisposalPlan(configTreatmentPlan.getDisposalPlan());
|
|
|
|
|
treatmentPlan.setFirstMeasures(configTreatmentPlan.getFirstMeasures());
|
|
|
|
|
bean.setDisposalPlan(configTreatmentPlan.getDisposalPlanId());
|
|
|
|
|
bean.setDisposalPlanName(configTreatmentPlan.getDisposalPlan());
|
|
|
|
|
bean.setFirstMeasures(configTreatmentPlan.getFirstMeasures());
|
|
|
|
|
}
|
|
|
|
|
ConfigDrug configDrug = configDrugMap.get(treatmentPlan.getDrugId());
|
|
|
|
|
if (null != configDrug){
|
|
|
|
|
treatmentPlan.setDisposalPlan("药物");
|
|
|
|
|
treatmentPlan.setDrugName(configDrug.getDrugName());
|
|
|
|
|
bean.setDisposalPlan(TreatmentPlanIdConstant.DRUG_ID);
|
|
|
|
|
bean.setDisposalPlanName("药物");
|
|
|
|
|
bean.setDrugName(configDrug.getDrugName());
|
|
|
|
|
}
|
|
|
|
|
result.add(bean);
|
|
|
|
|
}
|
|
|
|
|
return treatmentPlanRecordList;
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|