cgp 2 днів тому
батько
коміт
1fc700cc65

+ 4 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsPrescribeDataScrmServiceImpl.java

@@ -371,6 +371,10 @@ public class FsPrescribeDataScrmServiceImpl implements IFsPrescribeDataScrmServi
         String prescribeCode= IdUtil.getSnowflake(0, 0).nextIdStr();
         data.setPrescribeCode(prescribeCode);
         // 医生id
+        FsDoctor doctor = fsDoctorMapper.selectFsDoctorByDoctorId(customer.getDoctorId());
+        if (doctor!=null&&doctor.getStatus()==0){
+            throw new CustomException("医生已停用,请更换医生!");
+        }
         data.setDoctorId(customer.getDoctorId());
         data.setStatus(0);
         data.setCreateTime(DateUtils.getNowDate());

+ 4 - 0
fs-service/src/main/java/com/fs/qw/service/impl/FsCompanyCustomerServiceImpl.java

@@ -105,6 +105,7 @@ public class FsCompanyCustomerServiceImpl implements IFsCompanyCustomerService {
         final Map<Long, String> prescriptionMap = CollectionUtils.isEmpty(fsPrescribeDataScrms)
                 ? Collections.emptyMap()
                 : fsPrescribeDataScrms.stream()
+                .filter(p -> Integer.valueOf(-1).equals(p.getDoctorConfirm()))//只给销售展示被医生拒方的原因
                 .collect(Collectors.toMap(
                         FsPrescribeDataScrm::getPrescribeId,
                         p -> p.getAuditReason() == null ? "" : p.getAuditReason()));
@@ -277,6 +278,9 @@ public class FsCompanyCustomerServiceImpl implements IFsCompanyCustomerService {
         FsDoctor fsDoctor = fsDoctorMapper.selectFsDoctorByDoctorId(companyUser.getDoctorId());
         fsCompanyCustomer.setDoctorId(fsDoctor.getDoctorId());
         fsCompanyCustomer.setDoctorName(fsDoctor.getDoctorName());
+        if (fsDoctor.getStatus()==0){
+            throw new CustomException("医生已停用,请更换医生!");
+        }
         return fsCompanyCustomerMapper.updateFsCompanyCustomer(fsCompanyCustomer);
     }