Преглед изворни кода

客户信息表增加展示医生/药师拒方原因

cgp пре 1 дан
родитељ
комит
e2e5aa59ea

+ 4 - 0
fs-service/src/main/java/com/fs/qw/domain/FsCompanyCustomer.java

@@ -169,6 +169,10 @@ public class FsCompanyCustomer extends BaseEntity {
      * */
     private String noEncryptPhone;
 
+    // 非数据库字段
+    /** 医生拒方原因 */
+    private String auditReason;
+
     // 非数据库字段,用于接收前端排序参数
     /** 排序字段(create_time / filing_time) */
     private String sortField;

+ 7 - 1
fs-service/src/main/java/com/fs/qw/service/impl/FsCompanyCustomerServiceImpl.java

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