ソースを参照

增加费用不一致拦截

hurugang 4 年 前
コミット
e46d07827e

+ 13 - 0
src/main/java/cn/hnthyy/thmz/controller/MzReceiptSerialController.java

@@ -8,6 +8,7 @@ import cn.hnthyy.thmz.entity.MzException;
 import cn.hnthyy.thmz.entity.his.*;
 import cn.hnthyy.thmz.entity.thmz.User;
 import cn.hnthyy.thmz.enums.YesNoEnum;
+import cn.hnthyy.thmz.pageDto.MzChargeDetailPageDto;
 import cn.hnthyy.thmz.service.his.*;
 import cn.hnthyy.thmz.service.thmz.UserService;
 import cn.hnthyy.thmz.vo.MzReceiptSerialVo;
@@ -159,6 +160,18 @@ public class MzReceiptSerialController {
                 log.info("当前病人没有实际缴费,暂时不打印发票,patientId={},time={},receiptNo={}", patientId, times, receiptNo);
                 return resultMap;
             }
+            MzChargeDetailPageDto mzChargeDetailPageDto = new MzChargeDetailPageDto();
+            MzChargeDetail mzChargeDetail = new MzChargeDetail(patientId, times);
+            mzChargeDetail.setPayMark(YesNoEnum.NO.code.toString());
+            mzChargeDetailPageDto.setMzChargeDetail(mzChargeDetail);
+            mzChargeDetailPageDto.setOwnData(YesNoEnum.YES);
+            List<MzChargeDetail> mzChargeDetailList= mzChargeDetailService.queryMzChargeDetailWithPage(mzChargeDetailPageDto);
+            if(totalPay.compareTo(mzChargeDetailList.get(0).getAmount())!=0){
+                resultMap.put("code", -1);
+                resultMap.put("message", "当前病人实际缴费金额与发票金额不一致,无法出示发票给患者,请联系信息管理员");
+                log.info("当前病人实际缴费金额与发票金额不一致,无法出示发票给患者,patientId={},time={},receiptNo={}", patientId, times, receiptNo);
+                return resultMap;
+            }
             User tokenUser = TokenUtil.getUser(httpServletRequest);
             resultMap.put("code", 0);
             resultMap.put("message", "根据病人编号和就诊次数查询其当次缴费对应的所有发票成功");