Procházet zdrojové kódy

feat: ysy生成处方签名

xdd před 3 týdny
rodič
revize
4fd70dab50

+ 2 - 0
fs-admin/src/test/java/com/fs/course/controller/OpenIMServiceTest.java

@@ -98,6 +98,8 @@ public class OpenIMServiceTest {
         o.setCheckDoctor("");
         o.setDoctorName(f.getDoctorName());
         o.setTelPhone("15560889998");
+        o.setDoctorTitle("砖家");
+        o.setDoctorNo("155608608433128");
         String s = prescriptionImageService.generatePrescriptionImage(o);
         log.info(s);
     }

+ 10 - 0
fs-service/src/main/java/com/fs/his/param/PrescribeXyImgParam.java

@@ -69,6 +69,16 @@ public class PrescribeXyImgParam {
      */
     private String drugDoctorUrl;
 
+    /**
+     * 证号
+     */
+    private String doctorNo;
+
+    /**
+     * 医生职称
+     */
+    private String doctorTitle;
+
     @Excel(name = "医嘱")
     private String remark;
 }

+ 6 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsPrescribeServiceImpl.java

@@ -535,6 +535,12 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
             o.setDispatcher("");
             o.setCheckDoctor("");
             o.setDoctorName(f.getDoctorName());
+            o.setTelPhone(f.getPatientTel());
+            FsDoctor fsDoctor = doctorMapper.selectFsDoctorByDoctorId(f.getDoctorId());
+            Asserts.notNull(fsDoctor,String.format("医生 %s 未找到!",f.getDoctorId()));
+            o.setDoctorNo(fsDoctor.getCertificateCode());
+            o.setDoctorTitle(fsDoctor.getPosition());
+
             String url = prescriptionImageService.generatePrescriptionImage(o);
             FsPrescribe fsPrescribe = new FsPrescribe();
             fsPrescribe.setPrescribeImgUrl(url);

+ 26 - 0
fs-service/src/main/java/com/fs/his/service/impl/PrescriptionImageServiceImpl.java

@@ -86,6 +86,9 @@ public class PrescriptionImageServiceImpl implements PrescriptionImageService {
             // 绘制诊断
             drawDiagnosis(pen, param);
 
+            // 绘制医生证号和医生职称
+            drawDoctorNoAndDoctorTitle(pen,param);
+
             // 绘制药品列表
             int lastY = drawDrugList(pen, param.getPrescribeDrug());
 
@@ -217,6 +220,29 @@ public class PrescriptionImageServiceImpl implements PrescriptionImageService {
         }
     }
 
+
+    /**
+     * 绘制医生证号和职称
+     * @param pen
+     * @param param
+     */
+    private void drawDoctorNoAndDoctorTitle(Graphics2D pen, PrescribeXyImgParam param) {
+
+        if (StringUtils.isNotBlank(param.getDoctorNo())) {
+            int x = 747;
+            int y = 1383;
+            int maxWidth = 760;
+            drawMultiLineText(pen, param.getDoctorNo(), x, y, maxWidth);
+        }
+
+        if (StringUtils.isNotBlank(param.getDoctorTitle())) {
+            int x = 290;
+            int y = 1561;
+            int maxWidth = 760;
+            drawMultiLineText(pen, param.getDoctorNo(), x, y, maxWidth);
+        }
+    }
+
     /**
      * 绘制药品列表
      * @return 返回最后一行的Y坐标