LIJU 2 nedēļas atpakaļ
vecāks
revīzija
f58909bfe7

+ 18 - 0
src/main/java/cn/hnthyy/thmz/controller/mz/MzPharmacyController.java

@@ -417,6 +417,15 @@ public class MzPharmacyController {
                             Employee employee = employeeService.queryByUserCode(mzChargeDetail.getDoctorCode());
                             if(null != employee){
                                 mzChargeDetail.setEmployeeName(employee.getEmployeeName());
+                                
+                                // 获取药师执业资格证号:优先取执业证编码,如果为空则取医保赋码
+                                String pharPracCertNo = "";
+                                if (StringUtils.isNotBlank(employee.getPracticeCertificate())) {
+                                    pharPracCertNo = employee.getPracticeCertificate();
+                                } else if (StringUtils.isNotBlank(employee.getYbCode())) {
+                                    pharPracCertNo = employee.getYbCode();
+                                }
+                                mzChargeDetail.setPharPracCertNo(pharPracCertNo);
                             }
                         }
                         // 查询今日排队发药状态
@@ -442,6 +451,15 @@ public class MzPharmacyController {
                         Employee employee = employeeService.queryByUserCode(chargeDetailInfoVo.getDoctorCode());
                         if (employee != null) {
                             chargeDetailInfoVo.setEmployeeName(employee.getEmployeeName());
+                            
+                            // 获取药师执业资格证号:优先取执业证编码,如果为空则取医保赋码
+                            String pharPracCertNo = "";
+                            if (StringUtils.isNotBlank(employee.getPracticeCertificate())) {
+                                pharPracCertNo = employee.getPracticeCertificate();
+                            } else if (StringUtils.isNotBlank(employee.getYbCode())) {
+                                pharPracCertNo = employee.getYbCode();
+                            }
+                            chargeDetailInfoVo.setPharPracCertNo(pharPracCertNo);
                         }
                     }
 

+ 2 - 0
src/main/java/cn/hnthyy/thmz/entity/his/mz/Employee.java

@@ -33,6 +33,8 @@ public class Employee {
     private String wbCode;
     //医生的医保赋码
     private String ybCode;
+    //执业证编码
+    private String practiceCertificate;
     //中药处方权 0:未授权,1:授权
     private Integer doctorZy;
     //双通道药品权限

+ 9 - 9
src/main/java/cn/hnthyy/thmz/mapper/his/mz/EmployeeMapper.java

@@ -14,7 +14,7 @@ public interface EmployeeMapper {
      * @param codeRs
      * @return
      */
-    @Select(" select top 1 rtrim(code) employeeCode,rtrim(name) employeeName,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,rtrim(yb_code) yb_code,social_no from a_employee_mi WITH(NOLOCK) where  code_rs =#{codeRs} order by mark")
+    @Select(" select top 1 rtrim(code) employeeCode,rtrim(name) employeeName,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,rtrim(yb_code) yb_code,rtrim(practice_certificate) practiceCertificate,social_no from a_employee_mi WITH(NOLOCK) where  code_rs =#{codeRs} order by mark")
     Employee selectByCodeRs(@Param("codeRs") String codeRs);
 
 
@@ -25,7 +25,7 @@ public interface EmployeeMapper {
      * @return
      */
     @Select({"<script>",
-            "select rtrim(code) employee_code,rtrim(name) employee_name,del_flag,rtrim(mark) mark,rtrim(dept_code) dept_code,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,rtrim(yb_code) yb_code from a_employee_mi WITH(NOLOCK) where (del_flag is null or del_flag =0 ) ",
+            "select rtrim(code) employee_code,rtrim(name) employee_name,del_flag,rtrim(mark) mark,rtrim(dept_code) dept_code,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,rtrim(yb_code) yb_code,rtrim(practice_certificate) practiceCertificate from a_employee_mi WITH(NOLOCK) where (del_flag is null or del_flag =0 ) ",
             "<when test='depts!=null'>",
             " and  dept_code in",
             "<foreach item='item' index='index' collection='depts' open='(' separator=',' close=')'>",
@@ -43,7 +43,7 @@ public interface EmployeeMapper {
      * @return
      */
     @Select({"<script>",
-            "select rtrim(code) employee_code,rtrim(name) employee_name,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,rtrim(yb_code) yb_code from a_employee_mi WITH(NOLOCK) where (del_flag is null or del_flag =0 )",
+            "select rtrim(code) employee_code,rtrim(name) employee_name,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,rtrim(yb_code) yb_code,rtrim(practice_certificate) practiceCertificate from a_employee_mi WITH(NOLOCK) where (del_flag is null or del_flag =0 )",
             "<when test='dept!=null'>",
             " and dept_code =#{dept}",
             "</when>",
@@ -57,7 +57,7 @@ public interface EmployeeMapper {
      * @param name
      * @return
      */
-    @Select(" select top 1 rtrim(code) employeeCode,rtrim(name) employeeName,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,rtrim(yb_code) yb_code from a_employee_mi WITH(NOLOCK)  where name =#{name} and (del_flag is null or del_flag =0 )")
+    @Select(" select top 1 rtrim(code) employeeCode,rtrim(name) employeeName,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,rtrim(yb_code) yb_code,rtrim(practice_certificate) practiceCertificate from a_employee_mi WITH(NOLOCK)  where name =#{name} and (del_flag is null or del_flag =0 )")
     Employee selectByUserName(@Param("name") String name);
 
 
@@ -67,7 +67,7 @@ public interface EmployeeMapper {
      * @param code
      * @return
      */
-    @Select(" select top 1 rtrim(code) employeeCode,rtrim(name) employeeName,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,rtrim(yb_code) yb_code,doctor_zy,dualchnl_flag,order_yn from a_employee_mi WITH(NOLOCK) where  code =#{code} ")
+    @Select(" select top 1 rtrim(code) employeeCode,rtrim(name) employeeName,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,rtrim(yb_code) yb_code,rtrim(practice_certificate) practiceCertificate,doctor_zy,dualchnl_flag,order_yn from a_employee_mi WITH(NOLOCK) where  code =#{code} ")
     Employee selectByUserCode(@Param("code") String code);
 
 
@@ -77,7 +77,7 @@ public interface EmployeeMapper {
      * @return
      */
     @Select({"<script>",
-            "select rtrim(code) employeeCode,rtrim(name) employeeName,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,rtrim(yb_code) yb_code from a_employee_mi WITH(NOLOCK) where  code in",
+            "select rtrim(code) employeeCode,rtrim(name) employeeName,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,rtrim(yb_code) yb_code,rtrim(practice_certificate) practiceCertificate from a_employee_mi WITH(NOLOCK) where  code in",
             "<foreach item='item' index='index' collection='codes' open='(' separator=',' close=')'>",
             "#{item}",
             "</foreach>",
@@ -89,7 +89,7 @@ public interface EmployeeMapper {
      * 查询所有医生
      * @return
      */
-    @Select("select rtrim(code) employeeCode,rtrim(name) employeeName,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,py_code,d_code as wb_code,rtrim(yb_code) yb_code from a_employee_mi WITH(NOLOCK) where (del_flag is null or del_flag =0 ) ")
+    @Select("select rtrim(code) employeeCode,rtrim(name) employeeName,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,py_code,d_code as wb_code,rtrim(yb_code) yb_code,rtrim(practice_certificate) practiceCertificate from a_employee_mi WITH(NOLOCK) where (del_flag is null or del_flag =0 ) ")
     List<Employee> selectAll();
 
 
@@ -100,7 +100,7 @@ public interface EmployeeMapper {
      * @return
      */
     @Select({"<script>",
-            "select rtrim(code) code,rtrim(name) name,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,rtrim(yb_code) yb_code from  a_employee_mi  where (del_flag is null or del_flag =0 ) ",
+            "select rtrim(code) code,rtrim(name) name,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,rtrim(yb_code) yb_code,rtrim(practice_certificate) practiceCertificate from  a_employee_mi  where (del_flag is null or del_flag =0 ) ",
             "<when test='code!=null'>",
             " and  code like #{code} or name like #{code} or py_code like #{code} or d_code like #{code} ",
             "</when>",
@@ -111,7 +111,7 @@ public interface EmployeeMapper {
      * 模糊查询医生
      * @return
      */
-    @Select("SELECT rtrim(code) employee_code,rtrim(name) employee_name,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,py_code,d_code as wb_code,rtrim(yb_code) yb_code FROM a_employee_mi WITH(NOLOCK) " +
+    @Select("SELECT rtrim(code) employee_code,rtrim(name) employee_name,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs,rtrim(dept_code) dept_code,py_code,d_code as wb_code,rtrim(yb_code) yb_code,rtrim(practice_certificate) practiceCertificate FROM a_employee_mi WITH(NOLOCK) " +
             " where    py_code like '${searchText}%' or" +
             "    d_code  like '${searchText}%'  or" +
             "    code    like '${searchText}%' or" +

+ 2 - 0
src/main/java/cn/hnthyy/thmz/vo/ChargeDetailInfoVo.java

@@ -55,4 +55,6 @@ public class ChargeDetailInfoVo {
     private String pdSort;
     //发药排队时间
     private String pdTime;
+    //药师执业资格证号
+    private String pharPracCertNo;
 }

+ 16 - 9
src/main/resources/static/js/mz/west_pharmacy_send.js

@@ -103,7 +103,9 @@ $(function () {
         let name = $("#nameLabel").val();
         let patientId = $("#patientIdLabel").val();
         let realNo = $("#realNoLabel").val();
-        sendMedicineProcessing(realNo, orderNo, receiptNo, times, patientId, name);
+        // 从全局变量获取药师执业资格证号
+        let pharPracCertNo = window.currentPharPracCertNo || '';
+        sendMedicineProcessing(realNo, orderNo, receiptNo, times, patientId, name, pharPracCertNo);
     });
     $("#printSend").click(function (t) {
         $('#zydybqModal').modal('hide');
@@ -250,7 +252,7 @@ function sendRefundButtonChange(object, realIndex) {
 /**
  * 发药处理
  */
-function sendMedicineProcessing(realNo, orderNo, receiptNo, times, patientId, name) {
+function sendMedicineProcessing(realNo, orderNo, receiptNo, times, patientId, name, pharPracCertNo) {
     $("#sendDispose").attr("disabled", true);
     $("#sendDrug").attr("disabled", true);
     
@@ -310,7 +312,7 @@ function sendMedicineProcessing(realNo, orderNo, receiptNo, times, patientId, na
             }
             if (res.code == 0) {
                 // 发药成功后,调用医保接口
-                callYbSaleGoodsItem(realNo, orderNo, receiptNo, times, patientId, name);
+                callYbSaleGoodsItem(realNo, orderNo, receiptNo, times, patientId, name, pharPracCertNo);
                 
                 successMesage(res);
                 $('#cfxxModal').modal('hide');
@@ -410,9 +412,11 @@ function initTbTable(pageIndex) {
                         //     str += '<button type="button" class="btn btn-primary btn-sm" title="叫号" onclick="callNumber(\'' + row.patientId + '\',\'' + row.name + '\')">叫号 <i class="glyphicon glyphicon-bullhorn"></i></button>';
                         // }
                         if (row.confirmFlag == 5 || row.confirmFlag == 0) {
-                            str += '<button type="button" class="btn btn-primary btn-sm" title="发药" id="sendDrug" onclick="sendMedicineProcessing(\'' + row.realNo + '\',\'' + row.orderNo + '\',\'' + row.receiptNo + '\',\'' + row.times + '\',\'' + row.patientId + '\',\'' + row.name + '\')">发药 <i class="fa fa-check-square-o"></i></button>';
+                            let pharPracCertNoForSend = (row.pharPracCertNo || '').replace(/'/g, '\\\'');
+                            str += '<button type="button" class="btn btn-primary btn-sm" title="发药" id="sendDrug" onclick="sendMedicineProcessing(\'' + row.realNo + '\',\'' + row.orderNo + '\',\'' + row.receiptNo + '\',\'' + row.times + '\',\'' + row.patientId + '\',\'' + row.name + '\',\'' + pharPracCertNoForSend + '\')">发药 <i class="fa fa-check-square-o"></i></button>';
                         }
-                        str += '<button type="button" class="btn btn-primary btn-sm" title="详细" onclick="prescriptionDetail(\'' + row.realNo + '\',\'' + row.orderNo + '\',\'' + row.receiptNo + '\',\'' + row.times + '\',\'' + row.patientId + '\',\'' + row.confirmFlag + '\')">详细 <i class="fa fa-plus"></i></button>';
+                        let pharPracCertNo = (row.pharPracCertNo || '').replace(/'/g, '\\\'');
+                        str += '<button type="button" class="btn btn-primary btn-sm" title="详细" onclick="prescriptionDetail(\'' + row.realNo + '\',\'' + row.orderNo + '\',\'' + row.receiptNo + '\',\'' + row.times + '\',\'' + row.patientId + '\',\'' + row.confirmFlag + '\',\'' + pharPracCertNo + '\')">详细 <i class="fa fa-plus"></i></button>';
                         str += '<button type="button" class="btn btn-primary btn-sm" title="历史处方" onclick="prescriptionHistoryDetail(\'' + row.patientId + '\',\'' + 0 +'\')">历史处方 <i class="fa fa-eye"></i></button>';
                         str += '<button type="button" class="btn btn-primary btn-sm" title="打印处方" onclick="printPrescription(\'' + row.patientId + '\',\'' + row.times + '\',\'' + row.orderNo +'\')">打印处方 <i class="fa fa-print"></i></button>';
                     }
@@ -1256,7 +1260,10 @@ function cleanParams() {
  * 查询病人处方明细
  */
 var $table;
-function prescriptionDetail(realNo, orderNo, receiptNo, times, patientId, confirmFlag) {
+function prescriptionDetail(realNo, orderNo, receiptNo, times, patientId, confirmFlag, pharPracCertNo) {
+    // 设置全局变量,供发药按钮使用
+    window.currentPharPracCertNo = pharPracCertNo || '';
+    
     let isXy = yf.xyFlag === '1';
     if (confirmFlag == 5 || confirmFlag == 0) {
         $("#sendDispose").show();//显示
@@ -3064,7 +3071,7 @@ function addTracCodgToCell(tracCodg, $element) {
  * @param patientId 病人ID
  * @param name 病人姓名
  */
-function callYbSaleGoodsItem(realNo, orderNo, receiptNo, times, patientId, name) {
+function callYbSaleGoodsItem(realNo, orderNo, receiptNo, times, patientId, name, pharPracCertNo) {
     // 获取处方明细数据
     let tableData = $("#tb_table_right").bootstrapTable('getData');
     
@@ -3113,8 +3120,8 @@ function callYbSaleGoodsItem(realNo, orderNo, receiptNo, times, patientId, name)
             // 药师姓名
             pharName: currentUserName,
             
-            // 药师执业资格证号(暂时为空,需要从用户信息中获取)
-            pharPracCertNo: '',
+            // 药师执业资格证号
+            pharPracCertNo: pharPracCertNo || '',
             
             // 销售/退货经办人姓名
             selRetnOpterName: currentUserName,