Parcourir la source

门诊指引单健康宣教和药品处方配置不打印

lihong il y a 10 mois
Parent
commit
22094ef25e

+ 7 - 3
src/main/java/cn/hnthyy/thmz/controller/mz/MzChargeDetailController.java

@@ -35,6 +35,7 @@ import cn.hnthyy.thmz.pageDto.MzChargeDetailPageDto;
 import cn.hnthyy.thmz.service.his.mz.*;
 import cn.hnthyy.thmz.service.his.yp.YpZdDictService;
 import cn.hnthyy.thmz.service.his.yp.YpZdDrugKindService;
+import cn.hnthyy.thmz.service.his.zd.DictDataService;
 import cn.hnthyy.thmz.service.his.zd.JcJyItemChargeService;
 import cn.hnthyy.thmz.service.his.zd.ZdChargeItemService;
 import cn.hnthyy.thmz.service.his.zd.ZdChequeTypeService;
@@ -134,9 +135,11 @@ public class MzChargeDetailController {
     DiscountService discountService;
     @Resource
     WpMzPrescriptionService wpMzPrescriptionService;
+    @Resource
+    DictDataService dictDataService;
 
-    //@Value("${healthEducationUrl}")
-    //private String healthEducationUrl;
+    @Value("${healthEducationUrl}")
+    private String healthEducationUrl;
     @Value("${wxPayQrUrl}")
     private String wxPayQrUrl;
 
@@ -2061,6 +2064,7 @@ public class MzChargeDetailController {
             }
             resultMap.put("yjReqCount", jcJyItemChargeService.queryCountByPatientId(patientId));
             resultMap.put("mzPatientMi", mzPatientMi);
+            resultMap.put("ypCfPrint", dictDataService.queryDictValueByYpCfPrint());
             resultMap.put("message", "获取病人某次处方信息成功");
             return resultMap;
         } catch (MzException e) {
@@ -2139,7 +2143,7 @@ public class MzChargeDetailController {
                 if (payQrcode != null) {
                     results.put("payQrcode", payQrcode);
                 }
-                //results.put("healthEducationUrl", healthEducationUrl);
+                results.put("healthEducationUrl", healthEducationUrl);
                 results.put("wxPayQrUrl", wxPayUrl);
             }
             if(Convert.toInt(results.get("code")) == 0){

+ 14 - 0
src/main/java/cn/hnthyy/thmz/controller/zd/DictDataController.java

@@ -6,10 +6,13 @@ import cn.hnthyy.thmz.entity.his.zd.DictData;
 import cn.hnthyy.thmz.service.his.zd.DictDataService;
 import cn.hutool.core.util.StrUtil;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Map;
+
 /**
  * @Description:
  * @Author:lihong
@@ -30,5 +33,16 @@ public class DictDataController {
         service.updateDictVlaue(dictData);
         return R.ok("更新成功");
     }
+    /**
+     * @description: 查询门诊处方 药品打印配置
+     * @author: lihong
+     * @date: 2025/2/11 9:32
+     * @return: cn.hnthyy.thmz.Utils.R
+     **/
+    @GetMapping("/queryDictValueByYpCfPrint")
+    public R queryDictValueByYpCfPrint(){
+        Map<String, Object> res = service.queryDictValueByYpCfPrint();
+        return R.ok().put("data", res);
+    }
 
 }

+ 9 - 0
src/main/java/cn/hnthyy/thmz/service/his/zd/DictDataService.java

@@ -2,6 +2,8 @@ package cn.hnthyy.thmz.service.his.zd;
 
 import cn.hnthyy.thmz.entity.his.zd.DictData;
 
+import java.util.Map;
+
 /**
  * @Description:字典
  * @Author:lihong
@@ -22,4 +24,11 @@ public interface DictDataService {
    * @return: java.lang.String
    **/
   String queryDictValueNotCach(String dictType, String dictName, String defaultValue);
+    /**
+     * @description: 查询门诊处方 药品打印配置
+     * @author: lihong
+     * @date: 2025/2/11 9:34
+     * @return: java.util.Map<java.lang.String,java.lang.Object>
+     **/
+    Map<String, Object> queryDictValueByYpCfPrint();
 }

+ 23 - 1
src/main/java/cn/hnthyy/thmz/service/impl/his/zd/DictDataServiceImpl.java

@@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -23,7 +24,7 @@ import java.util.Map;
 @Slf4j
 @Service
 public class DictDataServiceImpl implements DictDataService {
-    @Autowired
+    @Resource
     private DictDataMapper mapper;
 
     private static final Map<String, String> DICT__VALUE__MAP = new HashMap<>();
@@ -76,4 +77,25 @@ public class DictDataServiceImpl implements DictDataService {
             return defaultValue;
         }
     }
+
+    /**
+     * @description: 查询门诊处方 药品打印配置
+     * @author: lihong
+     * @date: 2025/2/11 9:34
+     * @return: java.util.Map<java.lang.String, java.lang.Object>
+     **/
+    @Override
+    public Map<String, Object> queryDictValueByYpCfPrint() {
+        Map<String, Object> res = new HashMap<>();
+        DictData dictData = new DictData();
+        dictData.setDictType("3.2");
+        List<DictData> list = mapper.selectDictData(dictData);
+        if(CollUtil.isNotEmpty(list)){
+           for(DictData data :list){
+               res.put(data.getDictName(), data.getDictValue());
+           }
+            return res;
+        }
+        return null;
+    }
 }

+ 13 - 12
src/main/resources/static/js/mz/clinic.js

@@ -11595,7 +11595,7 @@ function printPrescription(patientId, times, clnicId, payMark, printType) {
                     });
                     //普药处方
                     var pyPrescription = prescriptionDetailJson.xyPrescription.pyPrescription;
-                    if (pyPrescription != null && pyPrescription.length > 0) {
+                    if (pyPrescription != null && pyPrescription.length > 0 && res.ypCfPrint != null && res.ypCfPrint.py_print =="1") {
                         for (var i = 0; i < pyPrescription.length; i++) {
                             if (index > 0) {
                                 LODOP.NewPageA();
@@ -11636,7 +11636,7 @@ function printPrescription(patientId, times, clnicId, payMark, printType) {
                     }
                     //医材处方
                     var ycPrescription = prescriptionDetailJson.xyPrescription.ycPrescription;
-                    if (ycPrescription != null && ycPrescription.length > 0) {
+                    if (ycPrescription != null && ycPrescription.length > 0 && res.ypCfPrint != null && res.ypCfPrint.yc_print =="1") {
                         for (var i = 0; i < ycPrescription.length; i++) {
                             if (index > 0) {
                                 LODOP.NewPageA();
@@ -11665,7 +11665,7 @@ function printPrescription(patientId, times, clnicId, payMark, printType) {
                     }
                     //麻精处方
                     var mjPrescription = prescriptionDetailJson.xyPrescription.mjPrescription;
-                    if (mjPrescription != null && mjPrescription.length > 0) {
+                    if (mjPrescription != null && mjPrescription.length > 0  && res.ypCfPrint != null && res.ypCfPrint.mj_print =="1") {
                         for (var i = 0; i < mjPrescription.length; i++) {
                             if (index > 0) {
                                 LODOP.NewPageA();
@@ -11685,7 +11685,7 @@ function printPrescription(patientId, times, clnicId, payMark, printType) {
                     }
                     //精二处方
                     var jePrescription = prescriptionDetailJson.xyPrescription.jePrescription;
-                    if (jePrescription != null && jePrescription.length > 0) {
+                    if (jePrescription != null && jePrescription.length > 0 && res.ypCfPrint != null && res.ypCfPrint.mj_print =="1") {
                         for (var i = 0; i < jePrescription.length; i++) {
                             if (index > 0) {
                                 LODOP.NewPageA();
@@ -11705,7 +11705,7 @@ function printPrescription(patientId, times, clnicId, payMark, printType) {
                     }
                     $("#cfOrderNumTitle").text(null)
                     //中药处方
-                    if (prescriptionDetailJson.zyPrescription != null && prescriptionDetailJson.zyPrescription.length > 0) {
+                    if (prescriptionDetailJson.zyPrescription != null && prescriptionDetailJson.zyPrescription.length > 0 && res.ypCfPrint != null && res.ypCfPrint.zy_print =="1") {
                         var zyPrescription = prescriptionDetailJson.zyPrescription[0].detail;zyPrescription
                         var zyGroupNo = prescriptionDetailJson.zyPrescription[0].groupNo;
                         if (zyPrescription != null && zyPrescription.length > 0) {
@@ -12050,13 +12050,14 @@ function printPrescription(patientId, times, clnicId, payMark, printType) {
                                     let payQrcodeGuideCardHtml = `<img src="${src}" style="width: 100px;height: 100px"/><div style="width: 140px;margin-top: 2px;">微信支付(自费)</div>`;
                                     $("#payQrcodeGuideCard").html(payQrcodeGuideCardHtml)
                                 }
-                                // if(!stringIsBlank(res.healthEducationUrl)){
-                                //     new QRCode(document.getElementById("healthEducationCard"), res.healthEducationUrl);  // 设置要生成二维码的链接
-                                //     $("canvas").attr("id", "erw");
-                                //     let canvas = document.getElementById('erw');
-                                //     let src = canvas.toDataURL("image/png");
-                                //     $("#healthEducationCard").html("<img src='" + src + "' style='width:100px;height:100px;'/><div style='width: 100px;margin-top: 10px;text-align: center;'>健康宣教</div>");
-                                // }
+                                if(!stringIsBlank(res.healthEducationUrl)){
+                                    new QRCode(document.getElementById("healthEducationCard"), res.healthEducationUrl);  // 设置要生成二维码的链接
+                                    $("canvas").attr("id", "erw");
+                                    let canvas = document.getElementById('erw');
+                                    let src = canvas.toDataURL("image/png");
+                                    let wxPayQrCardHtml =`<img src="${src}" style="width: 100px;height: 100px"/><div style="width: 120px;margin-top: 2px;">健康宣教</div>`;
+                                    $("#healthEducationCard").html(wxPayQrCardHtml);
+                                }
                                 if(!stringIsBlank(res.wxPayQrUrl)){
                                     new QRCode(document.getElementById("wxPayQrCard"), res.wxPayQrUrl);  // 设置要生成二维码的链接
                                     $("canvas").attr("id", "erw");

+ 6 - 2
src/main/resources/templates/mz/clinic.html

@@ -2941,9 +2941,13 @@
         </table>
         <div>
             <div style="margin-top: 5px;">
-                <img src="/thmz/images/zydnew.png" style="height: 90px;width: 490px"/>
-            </div>
+                <div style="float: left;height: 130px;text-align: center">
+                    <img src="/thmz/images/zydnew.png" style="height: 110px;width: 380px"/>
+                </div>
+                <div id="healthEducationCard" style="float: right;width: 130px;height:130px;text-align: center;padding: 3px;margin-right: 3px">
 
+                </div>
+            </div>
         </div>
     </div>
 </div>