|
|
@@ -102,14 +102,20 @@ public class FsCompanyCustomerServiceImpl implements IFsCompanyCustomerService {
|
|
|
}
|
|
|
//批量获取处方信息
|
|
|
List<FsPrescribeDataScrm> fsPrescribeDataScrms = prescribeDataScrmMapper.selectFsPrescribeDataScrmListByIds(prescriptionIds);
|
|
|
- //TODO 后续可能会在客户信息列表展示商城处方信息
|
|
|
+ final Map<Long, String> prescriptionMap = CollectionUtils.isEmpty(fsPrescribeDataScrms)
|
|
|
+ ? Collections.emptyMap()
|
|
|
+ : fsPrescribeDataScrms.stream()
|
|
|
+ .collect(Collectors.toMap(FsPrescribeDataScrm::getPrescribeId, FsPrescribeDataScrm::getAuditReason));
|
|
|
//批量获取医生id
|
|
|
List<Long> doctorIds = companyCustomers.stream().map(FsCompanyCustomer::getDoctorId).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
//查询医生信息并用Map<Long,String>存起来key为医生id,value为医生名称
|
|
|
Map<Long, String> doctorMap = fsDoctorMapper.selectDoctorByIds(doctorIds).stream().collect(Collectors.toMap(FsDoctor::getDoctorId, FsDoctor::getDoctorName));
|
|
|
//遍历companyCustomers根据医生id赋值正确医生名字
|
|
|
companyCustomers.forEach(customer -> {
|
|
|
+ //获取正确的医生名字(解决历史数据问题)
|
|
|
customer.setDoctorName(doctorMap.get(customer.getDoctorId()));
|
|
|
+ //获取医生/药师拒方原因
|
|
|
+ customer.setAuditReason(prescriptionMap.getOrDefault(customer.getPrescribeId(), ""));
|
|
|
});
|
|
|
return companyCustomers;
|
|
|
}
|