소스 검색

Merge branch 'dev-1.1.1' of https://172.16.32.165/hurugang/thmz_system into dev-1.1.1

hurugang 3 년 전
부모
커밋
ead7e9227b

+ 11 - 1
src/main/java/cn/hnthyy/thmz/controller/mz/MzPharmacyController.java

@@ -467,6 +467,12 @@ public class MzPharmacyController {
                 resultMap.put("message", "次数不能为空");
                 return resultMap;
             }
+            int i = mzPharmacyService.queryConfirmFlagByRealNo(mzChargeDetail.getRealNo());
+            if(i == 3 || i == 4){
+                resultMap.put("code", -1);
+                resultMap.put("message", "发药失败,该处方已退药或已退费");
+                return resultMap;
+            }
             resultMap = mzPharmacyService.sendMedicineProcessing(mzChargeDetail, tokenUser);
             if(mzChargeDetail.getGroupNo().equals("71")){
                 dispensingSocketService.sendToMedicine(mzChargeDetail.getPatientId(),chargeDetailPharmacyVo.getWinNo());
@@ -873,7 +879,11 @@ public class MzPharmacyController {
                     mzSendMedicineVo.setClassCode(mzZdSupplyType.getClassCode());
                 }
                 MzOrderFrequency mzOrderFrequencyByCode = mzOrderFrequencyService.getMzOrderFrequencyByCode(mzSendMedicineVo.getFrequency());
-                mzSendMedicineVo.setComm(mzOrderFrequencyByCode.getComm());
+                if(mzOrderFrequencyByCode == null){
+                    mzSendMedicineVo.setComm(mzSendMedicineVo.getFrequency());
+                }else{
+                    mzSendMedicineVo.setComm(mzOrderFrequencyByCode.getComm());
+                }
             }
             if(chargeDetailPharmacyVo.getAutoCellNumber() == 1){
                 dispensingSocketService.printSendToMedicine(mzChargeDetail.getPatientId(),chargeDetailPharmacyVo.getWinNo());

+ 12 - 6
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzPharmacyMapper.java

@@ -855,7 +855,7 @@ public interface MzPharmacyMapper {
     /**
      * 发药处理修改收费详细发药状态
      *
-     * @param ypMzFytj
+     * @param mzChargeDetail
      * @return
      */
     @Update("UPDATE mz_charge_detail " +
@@ -870,14 +870,10 @@ public interface MzPharmacyMapper {
             " WHERE" +
             " patient_id = #{patientId} " +
             " AND times = #{times} " +
-            " AND receipt_no = #{receiptNo} " +
             " AND order_no = #{orderNo} " +
-            " AND item_no = #{itemNo} " +
-            " AND charge_item_code = #{chargeItemCode} " +
-            " AND serial = #{serial} " +
             " AND group_no = #{groupNo} " +
             " AND ( IsNull( confirm_flag, '0' ) IN ( '0', '2','5' ) OR print_flag_yj = '1' ) ")
-    int updateFyclChargeDetailConfirmFlag(YpMzFytj ypMzFytj);
+    int updateFyclChargeDetailConfirmFlag(MzChargeDetail mzChargeDetail);
 
     /**
      * 配药处理修改收费详细发药状态
@@ -1006,4 +1002,14 @@ public interface MzPharmacyMapper {
      */
     @Select("SELECT count(1) from mz_charge_detail where rtrim(patient_id) = #{patientId} and confirm_flag=0 and charge_date>=CONVERT(varchar(10),GETDATE(),120) and group_no=71")
     int selectIncludeWfyPrescription(String patientId);
+
+
+    /**
+     * 查询处方状态
+     *
+     * @param realNo
+     * @return
+     */
+    @Select("select top 1 confirm_flag from mz_charge_detail where real_no=${realNo}")
+    int selectConfirmFlagByRealNo(@Param("realNo") Integer realNo);
 }

+ 8 - 0
src/main/java/cn/hnthyy/thmz/service/his/mz/MzPharmacyService.java

@@ -184,4 +184,12 @@ public interface MzPharmacyService {
      * @return
      */
     int getIncludeWfyPrescription(String patientId);
+
+    /**
+     * 查询处方状态
+     *
+     * @param realNo
+     * @return
+     */
+    int queryConfirmFlagByRealNo(Integer realNo);
 }

+ 11 - 4
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzPharmacyServiceImpl.java

@@ -177,7 +177,7 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
         List<YpMzFytj> ypMzFytjs = new ArrayList();
         Employee employee = employeeMapper.selectByUserCode(cfxxList.get(0).getDoctorCode());
         for (MzSendMedicineVo mzSendMedicineVo : cfxxList) {
-            if (Double.parseDouble(mzSendMedicineVo.getQuantity()) > 0) {
+            if (Double.parseDouble(mzSendMedicineVo.getQuantity()) > 0 && !mzSendMedicineVo.getPaySelf().equals("1")) {
                 YpMzFytj ypMzFytj = new YpMzFytj();
                 ypMzFytj.setPatientId(mzSendMedicineVo.getPatientId());
                 ypMzFytj.setTimes(mzSendMedicineVo.getTimes());
@@ -204,9 +204,6 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
             if (mzPharmacyMapper.insertFyclFytj(ypMzFytj) < 1) {
                 throw new MzException("保存发药统计数据为空,发药处理失败");
             }
-            if (mzPharmacyMapper.updateFyclChargeDetailConfirmFlag(ypMzFytj) < 1) {
-                throw new MzException("修改发药状态数据为空,发药处理失败");
-            }
             MzRefundMedicineVo mzRefundMedicineVo = new MzRefundMedicineVo();
             mzRefundMedicineVo.setChargeCode(ypMzFytj.getChargeItemCode());
             mzRefundMedicineVo.setSerial(ypMzFytj.getSerial());
@@ -222,6 +219,11 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
                 log.info("更新药房库存数据成功[{}]", JSONObject.valueToString(mzRefundMedicineVo));
             }
         }
+        mzChargeDetail.setConfirmTime(date);
+        mzChargeDetail.setConfirmId(user.getUserIdCode());
+        if (mzPharmacyMapper.updateFyclChargeDetailConfirmFlag(mzChargeDetail) < 1) {
+            throw new MzException("修改发药状态数据为空,发药处理失败");
+        }
         resultMap.put("code", 0);
         resultMap.put("message", "发药处理成功");
         return resultMap;
@@ -344,6 +346,11 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
         return mzPharmacyMapper.selectIncludeWfyPrescription(patientId);
     }
 
+    @Override
+    public int queryConfirmFlagByRealNo(Integer realNo) {
+        return mzPharmacyMapper.selectConfirmFlagByRealNo(realNo);
+    }
+
     @Override
     public List<ChargeDetailInfoVo> getFyclWfyPrescription(ChargeFeeParamsVo chargeFeeParamsVo) {
         return mzPharmacyMapper.selectFyclWfyPrescription(chargeFeeParamsVo);

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

@@ -121,4 +121,6 @@ public class MzSendMedicineVo implements Serializable {
     private String nationalCode;
     //是否需要做皮试:1:需要做;0:不需要做   YesNo
     private String tryFlag;
+    //1:自备药
+    private String paySelf;
 }

+ 8 - 1
src/main/resources/static/js/common/pharmacy-com.js

@@ -787,4 +787,11 @@ function getYpTypeName(ypType) {
     return ypTypeName;
 }
 
-
+//判断字符是否为空的方法
+function isEmpty(obj) {
+    if (typeof obj == "undefined" || obj == null || obj == "") {
+        return true;
+    } else {
+        return false;
+    }
+}

+ 6 - 2
src/main/resources/static/js/common/socket-com.js

@@ -163,10 +163,11 @@ function cellNumberMessage(data) {
         let rightPersonName = data.name;
         for (let i = 0; i < lineUpList.length; i++) {
             if (data.patient_id === lineUpList[i].patient_id) {
+                let flag = (!isEmpty(lineUpList[i].lineUp) && lineUpList[i].lineUp!==10000);
                 if (rightPersonName.length > 3) {
-                    rightPersonName = ((lineUpList[i].lineUp !== 10000 ? '<span style="font-size:32px; "><span class="number-name">&nbsp;' + lineUpList[i].lineUp + '&nbsp;</span>&nbsp;' : '') + rightPersonName + "</span>");
+                    rightPersonName = ((flag ? '<span style="font-size:32px; "><span class="number-name">&nbsp;' + lineUpList[i].lineUp + '&nbsp;</span>&nbsp;' : '') + rightPersonName + "</span>");
                 } else {
-                    rightPersonName = ((lineUpList[i].lineUp !== 10000 ? '<span class="number-name">&nbsp;' + lineUpList[i].lineUp + '&nbsp;</span>&nbsp;' : '') + rightPersonName);
+                    rightPersonName = ((flag ? '<span class="number-name">&nbsp;' + lineUpList[i].lineUp + '&nbsp;</span>&nbsp;' : '') + rightPersonName);
                 }
                 break
             }
@@ -255,6 +256,9 @@ function initLineUp(data) {
  * @returns {*}
  */
 function getLineUpData(data) {
+    if(isEmpty(data)){
+        return data;
+    }
     for (let i = 0; i < data.length; i++) {
         let flag = true;
         for (let j = 0; j < lineUpList.length; j++) {

+ 6 - 4
src/main/resources/static/js/mz/pharmacy-cell-number.js

@@ -242,10 +242,11 @@ function refeshTable() {
             let c = tempPastList.shift();
             let name = c.name;
             if(name){
+                let flag = (!isEmpty(c.lineUp) && c.lineUp!==10000);
                 if(name.length > 3){
-                    $("#past" + i).html((c.lineUp!==10000?'<span style="font-size:32px;"><span class="number-name" style="background: red">&nbsp;'+c.lineUp+'&nbsp;</span>&nbsp;':'')+name+"</span>");
+                    $("#past" + i).html((flag?'<span style="font-size:32px;"><span class="number-name" style="background: red">&nbsp;'+c.lineUp+'&nbsp;</span>&nbsp;':'')+name+"</span>");
                 }else{
-                    $("#past" + i).html((c.lineUp!==10000?'<span class="number-name" style="background: red">&nbsp;'+c.lineUp+'&nbsp;</span>&nbsp;':'')+name);
+                    $("#past" + i).html((flag?'<span class="number-name" style="background: red">&nbsp;'+c.lineUp+'&nbsp;</span>&nbsp;':'')+name);
                 }
             }
         }
@@ -264,10 +265,11 @@ function refeshTable() {
             //删除并返回数组的第一个元素
             let c = tempCurrentList.shift();
             let name = c.name;
+            let flag = (!isEmpty(c.lineUp) && c.lineUp!==10000);
             if(name.length > 3){
-                $("#current" + i).html((c.lineUp!==10000?'<span style="font-size:32px; "><span class="number-name">&nbsp;'+c.lineUp+'&nbsp;</span>&nbsp;':'')+name+"</span>");
+                $("#current" + i).html((flag?'<span style="font-size:32px; "><span class="number-name">&nbsp;'+c.lineUp+'&nbsp;</span>&nbsp;':'')+name+"</span>");
             }else{
-                $("#current" + i).html((c.lineUp!==10000?'<span class="number-name">&nbsp;'+c.lineUp+'&nbsp;</span>&nbsp;':'')+name);
+                $("#current" + i).html((flag?'<span class="number-name">&nbsp;'+c.lineUp+'&nbsp;</span>&nbsp;':'')+name);
             }
         }
     }

+ 2 - 1
src/main/resources/static/js/yf/spirit_anesthetic_print.js

@@ -154,6 +154,7 @@ function getSpiritAnestheticPrintData() {
                     html += '<td>' + data.drugname + '</td>';
                     html += '<td>' + data.specification + '</td>';
                     html += '<td class="xtd" style="text-align: center;">' + data.quantity + '</td>';
+                    html += '<td style="text-align: center;">' + data.chargeDate + '</td>';
                     html += '<td class="xtd" style="text-align: center;">' + data.employeeName + '</td>';
                     html += '<td class="xtd" style="text-align: center;">' + data.warnDeptName + '</td>';
                     html += '<td class="xtd" ></td>';
@@ -248,7 +249,7 @@ function getSendDrugRecordData() {
                     html += '<td>' + data.specification + '</td>';
                     html += '<td>' + data.abbrName + '</td>';
                     html += '<td class="xtd" style="text-align: center;">' + data.quantity + '</td>';
-                    html += '<td class="exclHide" style="text-align: center;">' + data.chargeDate + '</td>';
+                    html += '<td style="text-align: center;">' + data.chargeDate + '</td>';
                     let doctorName ='';
                     if(data.employeeName!=null){
                         doctorName = data.employeeName.trim().substring(0, 1) + new Array(data.employeeName.trim().length).join('*');

+ 3 - 2
src/main/resources/templates/yf/spirit_anesthetic_print.html

@@ -115,7 +115,7 @@
                             <td style="text-align: center;width: 70px;">规格</td>
                             <td style="text-align: center;width: 80px;">厂商</td>
                             <td class="xtd" style="text-align: center;width: 30px;">数量</td>
-                            <td class="exclHide" style="text-align: center;width: 45px;">发药日期</td>
+                            <td style="text-align: center;width: 45px;">发药日期</td>
                             <td class="xtd" style="text-align: center;width: 45px;">医师</td>
                             <td class="xtd" style="text-align: center;width: 45px;">给药方式</td>
                             <td class="xtd" style="text-align: center;width: 45px;">频率</td>
@@ -141,7 +141,8 @@
                             <td class="xtd" style="text-align: center;width: 45px;">编码</td>
                             <td style="text-align: center;width: 80px;">药名</td>
                             <td style="text-align: center;width: 70px;">规格</td>
-                            <td class="xtd" style="text-align: center;width: 30px;">数量</td>
+                            <td class="xtd" style="text-align: center;width: 30px;">数量
+                            <td style="text-align: center;width: 45px;">发药日期</td>
                             <td class="xtd" style="text-align: center;width: 45px;">医师</td>
                             <td class="xtd" style="text-align: center;width: 70px;">科室</td>
                             <td class="xtd" style="text-align: center;width: 45px;">复核人</td>