Преглед изворни кода

解决历史处方查看不了的问题

hurugang пре 4 година
родитељ
комит
1a5ee4d301

+ 2 - 2
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzChargeDetailMapper.java

@@ -315,7 +315,7 @@ public interface MzChargeDetailMapper {
             "rtrim(self_flag) self_flag,rtrim(responce_type) responce_type,dec_amount,back_serial,input_time,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,supply_amount,rtrim(cy_jssm) cy_jssm,",
             "dept_no,gl_percent_ft,rtrim(yb_zf_flag) yb_zf_flag,orig_price,rtrim(try_result) try_result,rtrim(supply_exec) supply_exec,rtrim(cy_dj) cy_dj,rtrim(receive_flag) receive_flag,",
             "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id ",
-            "from dbo.mz_charge_detail where  patient_id =#{patientId,jdbcType=CHAR} and times =#{times,jdbcType=INTEGER}" +
+            "from dbo.${tableName} where  patient_id =#{patientId,jdbcType=CHAR} and times =#{times,jdbcType=INTEGER}" +
                     "<choose>" +
                     "<when test='payMark!=null and payMark ==0 '>",
             " and pay_mark=#{payMark,jdbcType=CHAR}  and confirm_flag <![CDATA[<>]]> 4 ",
@@ -329,7 +329,7 @@ public interface MzChargeDetailMapper {
             "</when>",
                     "order by order_no asc",
             "</script>"})
-    List<MzChargeDetail> selectMzChargeDetailByPatientId(@Param("patientId") String patientId, @Param("times") Integer times,@Param("receiptNo") Integer receiptNo, @Param("payMark") String payMark);
+    List<MzChargeDetail> selectMzChargeDetailByPatientId(@Param("tableName") String tableName,@Param("patientId") String patientId, @Param("times") Integer times,@Param("receiptNo") Integer receiptNo, @Param("payMark") String payMark);
 
     /**
      * 根据当期那病人与就诊次数以及收费编码查询对应的药品数量与退药量

+ 58 - 22
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -3,7 +3,6 @@ package cn.hnthyy.thmz.service.impl.his.mz;
 import cn.hnthyy.thmz.Utils.CloneUtil;
 import cn.hnthyy.thmz.Utils.DateUtil;
 import cn.hnthyy.thmz.Utils.JsonUtil;
-import cn.hnthyy.thmz.Utils.StringUtil;
 import cn.hnthyy.thmz.common.Constants;
 import cn.hnthyy.thmz.common.SpringUtil;
 import cn.hnthyy.thmz.entity.MzException;
@@ -293,7 +292,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             throw new MzException("病人编号和就诊次数不能为空!");
         }
         List<MzYjReq> mzYjReqs = mzYjReqService.queryNotPayMzYjReq(new MzYjReq(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes()));
-        List<MzChargeDetail> mzChargeDetailList = mzChargeDetailMapper.selectMzChargeDetailByPatientId(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), null, PayMarkEnum.NO_CHARGE.code);
+        List<MzChargeDetail> mzChargeDetailList = mzChargeDetailMapper.selectMzChargeDetailByPatientId("mz_charge_detail",mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), null, PayMarkEnum.NO_CHARGE.code);
         return getMzChargeDetails(mzChargeDetail, yesNo, receiptNo, mzYjReqs, mzChargeDetailList);
     }
 
@@ -475,7 +474,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         mzChargeDetailMapper.setTempDataReceiptNo(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), receiptNo);
         mzChargeDetailMapper.updateMzChargeDetailFull(mzChargeDetail);
         //入库收费明细数据结束
-        List<MzChargeDetail> mzChargeDetailList = mzChargeDetailMapper.selectMzChargeDetailByPatientId(mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), null, PayMarkEnum.NO_CHARGE.code);
+        List<MzChargeDetail> mzChargeDetailList = mzChargeDetailMapper.selectMzChargeDetailByPatientId("mz_charge_detail",mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), null, PayMarkEnum.NO_CHARGE.code);
         //所有应收费用的明细 将所有费用按照类型归类
         Map<String, BigDecimal> feeMap = new HashMap<>();
         //实际应付金额
@@ -949,7 +948,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                         tempMap.put("cyJssm", mzChargeDetail.getCyJssm() != null ? mzChargeDetail.getCyJssm() : "");
                         SupplyTypeEnum supplyTypeEnum = SupplyTypeEnum.getSupplyTypeByCode(mzChargeDetail.getCyDj());
                         tempMap.put("cyDj", supplyTypeEnum != null ? supplyTypeEnum.name : "");
-                        CyFysmEnum cyFysmEnum = CyFysmEnum.geteCyFysmByCode(mzChargeDetail.getCyFysm().toString());
+                        CyFysmEnum cyFysmEnum = CyFysmEnum.geteCyFysmByCode(mzChargeDetail.getCyFysm()==null?null:mzChargeDetail.getCyFysm().toString());
                         tempMap.put("cyFysm", cyFysmEnum != null ? cyFysmEnum.name : "");
                         tempMap.put("detail", new ArrayList<>());
                         zyPrescription.add(tempMap);
@@ -1084,8 +1083,11 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             getIndex(zyPrescription, sbd, 1);
         }
         if(zlPrescription.size()>0){
-            sbd.append("医技与诊疗:");
-            getIndex(zlPrescription, sbd, 0);
+            List<String> detail = (List<String>) zlPrescription.get(0).get("detail");
+            if(detail!=null && detail.size()>0){
+                sbd.append("医技与诊疗:");
+                getIndex(zlPrescription, sbd, 0);
+            }
         }
         mzPrescriptionVo.getMzBlRecord().setEmrProcess(sbd.toString());
     }
@@ -1685,22 +1687,56 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             //只需要构造病历信息,不需要设置用药和诊疗信息
             return mzPrescriptionVo;
         }
-        List<MzChargeDetail> mzChargeDetailList = mzChargeDetailMapper.selectMzChargeDetailByPatientId(patientId, times, null, payMark);
-        List<MzChargeDetail> removeList = null;
-        for (MzChargeDetail mzChargeDetail : mzChargeDetailList) {
-            if (PayMarkEnum.CHARGED.code.equals(payMark)) {
-                //对于已经收费的药品记录查询,只需要查询医生开立的药品,给要方式等记录需要过滤
-                if (removeList == null) {
-                    removeList = new ArrayList<>();
+        List<MzChargeDetail> mzChargeDetailList = mzChargeDetailMapper.selectMzChargeDetailByPatientId("mz_charge_detail",patientId, times, null, payMark);
+        if(PayMarkEnum.CHARGED.code.equals(payMark)){
+            List<MzChargeDetail> hisMzChargeDetailList = mzChargeDetailMapper.selectMzChargeDetailByPatientId("mz_charge_detail_b",patientId, times, null, payMark);
+            Set<String> temSet = new HashSet<>();
+            StringBuilder sbd = new StringBuilder();
+            if(mzChargeDetailList!=null && mzChargeDetailList.size()>0){
+                for(MzChargeDetail mzChargeDetail : mzChargeDetailList){
+                    sbd.setLength(0);
+                    temSet.add(sbd.append(mzChargeDetail.getPatientId()).append("_").append(mzChargeDetail.getTimes()).append("_").append(mzChargeDetail.getReceiptNo()).append("_").append(mzChargeDetail.getItemNo()).append("_").append(mzChargeDetail.getChargeItemCode()).toString());
                 }
-                if (YesNoEnum.YES.code != (mzChargeDetail.getGroupId())) {
-                    removeList.add(mzChargeDetail);
+            }
+            if(hisMzChargeDetailList!=null && hisMzChargeDetailList.size()>0){
+                for(MzChargeDetail mzChargeDetail : hisMzChargeDetailList){
+                    if(temSet.contains(sbd.append(mzChargeDetail.getPatientId()).append("_").append(mzChargeDetail.getTimes()).append("_").append(mzChargeDetail.getReceiptNo()).append("_").append(mzChargeDetail.getItemNo()).append("_").append(mzChargeDetail.getChargeItemCode()).toString())){
+                        continue;
+                    }
+                    mzChargeDetailList.add(mzChargeDetail);
                 }
             }
-            if ("2".equals(mzChargeDetail.getJzFlag())) {
-                mzChargeDetail.setGroupNo("111");
-            } else if ("3".equals(mzChargeDetail.getJzFlag())) {
-                mzChargeDetail.setGroupNo("131");
+        }
+        List<MzChargeDetail> removeList = null;
+        if(mzChargeDetailList!=null && mzChargeDetailList.size()>0){
+            //麻、精一
+            List<MzZdYpYsh> mjyList = mzZdYpYshMapper.selectMjyByCommonParams(null, null, null, null);
+            Set<String> mjySet = null;
+            if (mjyList != null) {
+                mjySet = mjyList.stream().map(m -> m.getCode()).collect(Collectors.toSet());
+            }
+            //精二
+            List<MzZdYpYsh> jeList = mzZdYpYshMapper.selectJeByCommonParams(null, null, null, null);
+            Set<String> jeSet = null;
+            if (jeList != null) {
+                jeSet = jeList.stream().map(m -> m.getCode()).collect(Collectors.toSet());
+            }
+            for (MzChargeDetail mzChargeDetail : mzChargeDetailList) {
+                if (PayMarkEnum.CHARGED.code.equals(payMark)) {
+                    //对于已经收费的药品记录查询,只需要查询医生开立的药品,给要方式等记录需要过滤
+                    if (removeList == null) {
+                        removeList = new ArrayList<>();
+                    }
+                    if ((Constants.YJ_GROUP_NO.equals(mzChargeDetail.getGroupNo()) && !(mzChargeDetail.getReqNo()==null || Integer.valueOf(0).equals(mzChargeDetail.getReqNo()))) || Constants.SSWRF.equals(mzChargeDetail.getBillItemCode())) {
+                        //医技收费 和四舍五入的目录移除
+                        removeList.add(mzChargeDetail);
+                    }
+                }
+                if (mjySet.contains(mzChargeDetail.getChargeItemCode())) {
+                    mzChargeDetail.setGroupNo("111");
+                } else if (jeSet.contains(mzChargeDetail.getChargeItemCode())) {
+                    mzChargeDetail.setGroupNo("131");
+                }
             }
         }
         if (PayMarkEnum.CHARGED.code.equals(payMark) && removeList != null) {
@@ -1964,7 +2000,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
 
     @Override
     public List<MzChargeDetail> queryChargeDetail(MzChargeDetail mzChargeDetail) {
-        return mzChargeDetailMapper.selectMzChargeDetailByPatientId(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), mzChargeDetail.getReceiptNo(), mzChargeDetail.getPayMark());
+        return mzChargeDetailMapper.selectMzChargeDetailByPatientId("mz_charge_detail",mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), mzChargeDetail.getReceiptNo(), mzChargeDetail.getPayMark());
     }
 
     @Override
@@ -2005,7 +2041,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             throw new MzException("退费失败,特门收费必须全退!");
         }
         List<String> chargeItemCodeList = mzChargeDetails.stream().filter(u -> StringUtils.isNotBlank(u.getChargeItemCode())).map(u -> u.getChargeItemCode()).collect(Collectors.toList());
-        List<MzChargeDetail> oriMzChargeDetails = mzChargeDetailMapper.selectMzChargeDetailByPatientId(mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), mzDepositFileVo.getReceiptNo(), PayMarkEnum.CHARGED.code);
+        List<MzChargeDetail> oriMzChargeDetails = mzChargeDetailMapper.selectMzChargeDetailByPatientId("mz_charge_detail",mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), mzDepositFileVo.getReceiptNo(), PayMarkEnum.CHARGED.code);
         Date now = new Date();
         List<MzChargeDetail> tcMzChargeDetails = new ArrayList<>();
         List<MzChargeDetail> removeMzChargeDetails = new ArrayList<>();
@@ -2429,7 +2465,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         if (chargeItemCodeList == null || chargeItemCodeList.size() == 0) {
             throw new MzException("没有选择需要退费的收费明细,无法退费");
         }
-        List<MzChargeDetail> mzChargeDetails = mzChargeDetailMapper.selectMzChargeDetailByPatientId(mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), mzDepositFileVo.getReceiptNo(), PayMarkEnum.CHARGED.code);
+        List<MzChargeDetail> mzChargeDetails = mzChargeDetailMapper.selectMzChargeDetailByPatientId("mz_charge_detail",mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), mzDepositFileVo.getReceiptNo(), PayMarkEnum.CHARGED.code);
         if (mzChargeDetails == null || mzChargeDetails.size() == 0) {
             throw new MzException("当前病人无可退费用,无法退费");
         }

+ 16 - 6
src/main/resources/static/js/mz/clinic.js

@@ -5514,7 +5514,7 @@ function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) {
                         if (arr != null && arr.length > 0) {
                             var xyhtml = "";
                             for (var i = 0; i < arr.length; i++) {
-                                xyhtml += "<div>";
+                                xyhtml += "<div style='margin-bottom: 5px;padding-left: 10px;'>";
                                 xyhtml += arr[i];
                                 xyhtml += "</div>";
                             }
@@ -5537,18 +5537,28 @@ function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) {
                         if (zyArr != null && zyArr.length > 0) {
                             var zyhtml = "";
                             for (var i = 1; i < zyArr.length; i++) {
-                                zyhtml += "<div>";
+                                if(i%4==1){
+                                    zyhtml +='<div class="item form-group" style="margin-bottom: -5px;">';
+                                }
+                                zyhtml +='<div class="col-md-3 col-sm-3 col-xs-12">';
                                 zyhtml += zyArr[i];
                                 zyhtml += "</div>";
+                                if(i%4==0){
+                                    zyhtml +='</div>';
+                                }
                             }
                             var zyfs = zyArr[0].substring(zyArr[0].indexOf("付数:") + 3);
                             if (zyfs != null && zyfs != "") {
-                                zyhtml += " <div>";
+                                if(zyArr.length%4==1){
+                                    zyhtml +='<div class="item form-group" style="margin-bottom: -5px;">';
+                                }
+                                zyhtml +='<div class="col-md-3 col-sm-3 col-xs-12">';
                                 zyhtml += ' <div style="text-indent: 2em;">';
                                 zyhtml += '  <div>';
-                                zyhtml += 'x<span>';
+                                zyhtml += 'X<span>';
                                 zyhtml += zyfs;
-                                zyhtml += '</span> 付</div></div></div>';
+                                zyhtml += '</span> 付</div></div>';
+                                zyhtml +='</div>';
                             }
                             $("#prescriptionDetail_zyzlContent").html(zyhtml);
                             $("#prescriptionDetail_zyzlTitle").removeClass("hide").addClass("in");
@@ -5564,7 +5574,7 @@ function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) {
                         if (zlyjArr != null && zlyjArr.length > 0) {
                             var zlyjhtml = "";
                             for (var i = 0; i < zlyjArr.length; i++) {
-                                zlyjhtml += "<div>";
+                                zlyjhtml += "<div style='margin-bottom: 5px;padding-left: 10px;'>";
                                 zlyjhtml += zlyjArr[i];
                                 zlyjhtml += "</div>";
                             }