瀏覽代碼

优化特门退费判断逻辑

hurugang 2 年之前
父節點
當前提交
dba89ca126

+ 2 - 0
src/main/java/cn/hnthyy/thmz/pageDto/MzChargeDetailPageDto.java

@@ -2,7 +2,9 @@ package cn.hnthyy.thmz.pageDto;
 
 import cn.hnthyy.thmz.entity.his.mz.MzChargeDetail;
 import cn.hnthyy.thmz.enums.YesNoEnum;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.util.Date;
 /**

+ 3 - 12
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -94,8 +94,6 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
     @Autowired
     private YpZdDictService ypZdDictService;
     @Autowired
-    private MzChargeDetailYbService mzChargeDetailYbService;
-    @Autowired
     //解决循环依赖
     @Lazy
     private OrderStatusChangeService orderStatusChangeService;
@@ -145,9 +143,6 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
     @SuppressWarnings("all")
     @Autowired
     private YpBaseYfMapper ypBaseYfMapper;
-    //    @SuppressWarnings("all")
-//    @Autowired
-//    private MzChargeDetailYbMapper mzChargeDetailYbMapper;
     @SuppressWarnings("all")
     @Autowired
     private MzfzPatientOrderMapper mzfzPatientOrderMapper;
@@ -3095,11 +3090,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         if (!allRefund) {
             mzBlRecord = mzBlRecordMapper.selectMzBlRecordByPatientIdAndTimes(mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes());
         }
-        MzChargeDetailYb mzChargeDetailYb = new MzChargeDetailYb();
-        mzChargeDetailYb.setPatientId(mzDepositFileVo.getPatientId());
-        mzChargeDetailYb.setTimes(mzDepositFileVo.getTimes());
-        mzChargeDetailYb.setReceiptNo(mzDepositFileVo.getReceiptNo());
-        int count = mzChargeDetailYbService.queryTmCount(mzChargeDetailYb);
+        int count = mzPatientMiMapper.countYbZf(mzDepositFileVo.getPatientId(),mzDepositFileVo.getTimes());
         if (count > 0 && !allRefund) {
             throw new MzException("退费失败,此处方有门诊报销支付,必须全退!");
         }
@@ -3143,7 +3134,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             times = 0;
             if (count > 0) {
                 //PayInfo result=
-                PayInfo result = tsmzService.retractFees(opId, mzChargeDetailYb.getPatientId(), mzChargeDetailYb.getTimes(), mzChargeDetailYb.getReceiptNo());
+                PayInfo result = tsmzService.retractFees(opId, mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), mzDepositFileVo.getReceiptNo());
                 if (result == null || result.getCode() != 0) {
                     throw new MzException("退费失败,特门退费失败!");
                 }
@@ -4156,7 +4147,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                 BigDecimal unitPrice = mzChargeDetail.getUnitPrice() == null ? BigDecimal.ZERO : mzChargeDetail.getUnitPrice().setScale(2, BigDecimal.ROUND_HALF_UP);
                 if (!Constants.TC.equals(mzChargeDetail.getBillItemCode()) && BigDecimal.ZERO.compareTo(unitPrice) == 0) {
                     unitPrice = BigDecimal.valueOf(0.01D);
-                    log.error("有为空的单价项目,费用明细具体如下{}", mzChargeDetail.toString());
+                    log.error("有单价为空的项目,费用明细具体如下{}", mzChargeDetail.toString());
                     mzChargeDetail.setUnitPrice(unitPrice);
                 }
                 //进行营销折扣计算并写入库 优先申请科室的折扣率  医生系统做完移走开始

+ 19 - 12
src/main/java/cn/hnthyy/thmz/service/impl/thmz/TsmzServiceImpl.java

@@ -39,9 +39,9 @@ public class TsmzServiceImpl implements TsmzService {
 
     @Override
     public PayInfo uploadFees(String staffId, String patientId, Integer times, Integer receiptNo) {
-        String balc = mzPatientMiMapper.selectMztczfsf(patientId,times,null);
+        String balc = mzPatientMiMapper.selectMztczfsf(patientId, times, null);
         if (balc == null) {
-           return null;
+            return null;
         }
         log.info("调用医保试算接口,操作人={},病人={},就诊次数={},缴费次数={}", staffId, patientId, times, receiptNo);
         String realUrl = tsmzServiceUrl + "/uploadFees";
@@ -69,7 +69,7 @@ public class TsmzServiceImpl implements TsmzService {
                 payInfo.setCode(-1);
                 payInfo.setErrorMessage((String) resultJSONO.get("msg"));
                 return payInfo;
-            }else if ((int) resultJSONO.get("code") == -2) {
+            } else if ((int) resultJSONO.get("code") == -2) {
                 PayInfo payInfo = new PayInfo();
                 payInfo.setCode(-2);
                 payInfo.setErrorMessage((String) resultJSONO.get("msg"));
@@ -122,12 +122,19 @@ public class TsmzServiceImpl implements TsmzService {
             }
             if ((int) resultJSONO.get("code") == 0) {
                 return getPayInfo(resultJSONO);
-            } else if ((int) resultJSONO.get("code") == -1) {
+            }
+            if ((int) resultJSONO.get("code") == -1) {
                 PayInfo payInfo = new PayInfo();
                 payInfo.setCode(-1);
                 payInfo.setErrorMessage((String) resultJSONO.get("msg"));
                 return payInfo;
             }
+            if ((int) resultJSONO.get("code") == -2) {
+                PayInfo payInfo = new PayInfo();
+                payInfo.setCode(-2);
+                payInfo.setErrorMessage((String) resultJSONO.get("msg"));
+                return payInfo;
+            }
         } catch (Exception e) {
             log.error("特殊门诊病人取消费用上传失败,病人id={},就诊次数times={},缴费次数receiptNo={}", patientId, times, receiptNo);
             e.printStackTrace();
@@ -238,7 +245,7 @@ public class TsmzServiceImpl implements TsmzService {
             int code = (int) resultJSONO.get("code");
             String msg = (String) resultJSONO.get("msg");
             if (code == 0) {
-                String balc = mzPatientMiMapper.selectMztczfsf(patientId,-1,"310");
+                String balc = mzPatientMiMapper.selectMztczfsf(patientId, -1, "310");
                 if (balc == null) {
                     resultMap.put("code", -2);
                     resultMap.put("message", "该患者无门诊共济信息!");
@@ -267,7 +274,7 @@ public class TsmzServiceImpl implements TsmzService {
     }
 
     @Override
-    public PayInfo directRegistration(String staffId, String patientId, Integer times, String readCardResult, Integer acctUsedFlag,String readCardType) {
+    public PayInfo directRegistration(String staffId, String patientId, Integer times, String readCardResult, Integer acctUsedFlag, String readCardType) {
         log.info("调用职工门诊统筹试算接口,操作人={},病人={},就诊次数={}", staffId, patientId, times);
         String realUrl = tsmzServiceUrl + "/directRegistration";
         Map<String, Object> map = new HashMap<>();
@@ -276,12 +283,12 @@ public class TsmzServiceImpl implements TsmzService {
         map.put("patientId", patientId);
         map.put("times", times);
         map.put("readCardType", readCardType);
-        map.put("acctUsedFlag", acctUsedFlag==null?0:acctUsedFlag);
+        map.put("acctUsedFlag", acctUsedFlag == null ? 0 : acctUsedFlag);
         map.put("readCardResult", readCardResult);
         //Map 转成  JSONObject 字符串
         JSONObject jsonObj = new JSONObject(map);
         try {
-            String result =  HttpUtil.sendHttpPost(realUrl, jsonObj.toString(), 20000);
+            String result = HttpUtil.sendHttpPost(realUrl, jsonObj.toString(), 20000);
             if (StringUtils.isBlank(result)) {
                 return null;
             }
@@ -296,7 +303,7 @@ public class TsmzServiceImpl implements TsmzService {
                 payInfo.setCode(-1);
                 payInfo.setErrorMessage((String) resultJSONO.get("msg"));
                 return payInfo;
-            }else if ((int) resultJSONO.get("code") == -2) {
+            } else if ((int) resultJSONO.get("code") == -2) {
                 PayInfo payInfo = new PayInfo();
                 payInfo.setCode(-2);
                 payInfo.setErrorMessage((String) resultJSONO.get("msg"));
@@ -312,7 +319,7 @@ public class TsmzServiceImpl implements TsmzService {
 
     @Override
     @Async("asyncServiceExecutor")
-    public void directRegistrationAsync(String staffId, String patientId, Integer times, String readCardResult, Integer acctUsedFlag,String readCardType) {
+    public void directRegistrationAsync(String staffId, String patientId, Integer times, String readCardResult, Integer acctUsedFlag, String readCardType) {
         log.info("调用职工门诊统筹试算接口,操作人={},病人={},就诊次数={}", staffId, patientId, times);
         String realUrl = tsmzServiceUrl + "/directRegistration";
         Map<String, Object> map = new HashMap<>();
@@ -321,7 +328,7 @@ public class TsmzServiceImpl implements TsmzService {
         map.put("patientId", patientId);
         map.put("times", times);
         map.put("readCardType", readCardType);
-        map.put("acctUsedFlag", acctUsedFlag==null?0:acctUsedFlag);
+        map.put("acctUsedFlag", acctUsedFlag == null ? 0 : acctUsedFlag);
         map.put("readCardResult", readCardResult);
         //Map 转成  JSONObject 字符串
         JSONObject jsonObj = new JSONObject(map);
@@ -335,7 +342,7 @@ public class TsmzServiceImpl implements TsmzService {
 
     @Override
     public Map<String, BigDecimal> queryYbAmount(String patientId, Integer times) {
-        return mzPatientMiMapper.selectYbAmount(patientId,times);
+        return mzPatientMiMapper.selectYbAmount(patientId, times);
     }
 
 }

+ 37 - 0
src/main/resources/static/js/mz/clinic.js

@@ -11079,4 +11079,41 @@ function calculateZl(flag) {
         return;
     }
     $("#totalAmountZl").val(Multiply(totalNumZl, zlItemPrice).toFixed(2));
+}
+
+
+/**
+ *打印外伤无第三方责任承诺书
+ */
+function printNoThirdParty() {
+    printNoThirdPartyCommon(1);
+}
+
+
+
+/**
+ * 打印检查检验报告单
+ * @param printType 打印模式 1 预览打印  2 打印设置
+ */
+function printNoThirdPartyCommon(printType) {
+    var title = "外伤无第三方责任承诺书";
+    setPrint();
+    LODOP = getLodop();
+    LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "长沙泰和医院" + title);
+    LODOP.SET_PRINT_STYLE("FontSize", 7); //字体大小
+    //设置默认打印机
+    LODOP.SET_PRINTER_INDEX(printIndex);
+    LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
+    LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
+    LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
+    LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", title);//对新建的纸张重命名
+    LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
+    //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
+    var strStyle = "<style>table{width: 96%;} #jy_detail_content thead {border-bottom: 1px solid black;border-collapse: collapse;}</style>";
+    LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("print_no_third_party_table").innerHTML);
+    if (printType == 1) {
+        LODOP.PREVIEW();
+    } else if (printType == 2) {
+        LODOP.PRINT_SETUP();
+    }
 }

+ 42 - 0
src/main/resources/templates/mz/clinic.html

@@ -339,6 +339,9 @@
                         </p>
                     </div>
                     <div class="col-md-4 col-sm-4 col-xs-12" style="text-align: right;">
+                        <a onclick="printNoThirdParty()"
+                           style="cursor: pointer;color: #2e69eb !important;font-size: 14px;"><i
+                                class="fa fa-print">&nbsp;外伤无第三方责任承诺书</i></a>
                         <a style="cursor: pointer;font-size: 14px;color: #2e69eb!important;display: none"
                            onclick="transferTreatment()" id="transferTreatment">&nbsp;&nbsp;转诊</i></a>
                         <a style="cursor: pointer;font-size: 14px;color: #2e69eb!important;display: none"
@@ -3269,6 +3272,45 @@
 <!--转诊/发起会诊弹窗结尾-->
 
 
+
+<!--打印外伤无第三方责任承诺书开始-->
+<div id="print_no_third_party_table" class="hide"
+     style="width:920px;height: calc(100% - 160px);margin:0 auto;border: 1px solid #337ab7;font-size: 13px;padding: 40px 20px 40px 20px;overflow-y: auto; overflow-x:hidden;">
+    <div>
+        <div>
+            <div style="position: relative;">
+                <div style="text-align:center;font-weight: 700;">外伤无第三方责任承诺书</div>
+            </div>
+            <table class="table table-striped table-bordered"
+                   style="margin-top: 10px;border: 1px solid black;" rules="all">
+                <thead style="font-size: 16px;" >
+                    <tr>
+                        <td width="20%">承诺人</td>
+                        <td width="25%"></td>
+                        <td width="20%">联系电话</td>
+                        <td width="35%"></td>
+                    </tr>
+                    <tr>
+                        <td width="20%">证件类型</td>
+                        <td width="25%"></td>
+                        <td width="20%">证件号码</td>
+                        <td width="35%"></td>
+                    </tr>
+                    <tr>
+                        <td width="20%">承诺事项</td>
+                        <td colspan="3"></td>
+                    </tr>
+                </thead>
+                <tbody style="font-size: 13px;">
+                <tr>
+                </tr>
+                </tbody>
+            </table>
+        </div>
+    </div>
+</div>
+<!--打印外伤无第三方责任承诺书结束-->
+
 <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>
     <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0></embed>
 </object>