소스 검색

优化门诊代缴费信息查询

hurugang 3 년 전
부모
커밋
f215bc8be5

+ 11 - 38
src/main/java/cn/hnthyy/thmz/controller/api/MedicalViewApiController.java

@@ -550,9 +550,17 @@ public class MedicalViewApiController {
                 map.put("medInsAmt", BigDecimal.ZERO);
                 map.put("selfAmt", totalAmount);
                 map.put("priceTime", DateUtil.fomart(mzChargeDetail.getPriceTime(), "yyyy-MM-dd HH:mm:ss"));
-                map.put("patientId", mzChargeDetail.getPatientId());
-                map.put("times", mzChargeDetail.getTimes());
-                map.put("receiptNo", mzChargeDetail.getReceiptNo());
+                //不是医保查询的时候调用,需要查询是否有医保报销信息
+                if(haicipat.getYbRequest()==null || !YesNoEnum.YES.code.equals(haicipat.getYbRequest())){
+                    PayInfo payInfo = tsmzService.uploadFees(whiteList.getOpId(), mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), mzChargeDetail.getReceiptNo());
+                    if (payInfo != null && payInfo.getCode() == 0) {
+                        //个人医保账户支付
+                        map.put("acctPay", payInfo.getAcctPay());
+                        //医保统筹报销
+                        map.put("fundPay", payInfo.getFundPay());
+                        map.put("selfAmt", mzChargeDetail.getAmount().subtract(payInfo.getAcctPay()).subtract(payInfo.getFundPay()).multiply(BigDecimal.valueOf(100)));
+                    }
+                }
                 returnList.add(map);
             }
             results.put("resultCode", 0);
@@ -569,41 +577,6 @@ public class MedicalViewApiController {
     }
 
 
-    /**
-     * 门诊待缴费记录查询(支持门诊统筹报销)
-     *
-     * @param haicipat
-     * @return
-     */
-    @RequestMapping(value = "/getMzChargeDetailForUnPaidForMztc", method = {RequestMethod.POST})
-    public Map<String, Object> getMzChargeDetailForUnPaidForMztc(@RequestBody Haicipat haicipat, HttpServletRequest httpServletRequest) {
-        Map<String, Object> results = getMzChargeDetailForUnPaid(haicipat, httpServletRequest);
-        String ip = HttpUtil.getIPAddress(httpServletRequest);
-        WhiteList whiteList = whiteListService.queryByIpAddress(ip);
-        if (whiteList == null) {
-            results.put("resultCode", -1);
-            results.put("resultMessage", "当前请求来源未在白名单中【" + ip + "】");
-            return results;
-        }
-        if ((Integer) results.get("resultCode") == 0) {
-            List<Map<String, Object>> returnList = (List<Map<String, Object>>) results.get("data");
-            if (returnList != null && returnList.size() > 0) {
-                for (Map<String, Object> map : returnList) {
-                    PayInfo payInfo = tsmzService.uploadFees(whiteList.getOpId(), (String) map.get("patientId"), (Integer) map.get("times"), (Integer) map.get("receiptNo"));
-                    if (payInfo != null && payInfo.getCode() == 0) {
-                        BigDecimal totalAmt = (BigDecimal) map.get("totalAmt");
-                        //个人医保账户支付
-                        map.put("acctPay", payInfo.getAcctPay());
-                        //医保统筹报销
-                        map.put("fundPay", payInfo.getFundPay());
-                        map.put("selfAmt", totalAmt.divide(BigDecimal.valueOf(100)).subtract(payInfo.getAcctPay()).subtract(payInfo.getFundPay()).multiply(BigDecimal.valueOf(100)));
-                    }
-                }
-            }
-        }
-        return results;
-    }
-
 
     /**
      * 门诊待缴费记录明细查询

+ 3 - 1
src/main/java/cn/hnthyy/thmz/entity/haici/Haicipat.java

@@ -44,5 +44,7 @@ public class Haicipat {
     //绑定渠道类型  WX:微信公众服务号 ZFB:支付宝钱包服务窗
     private String channelType;
     //渠道用户 ID 唯一标识微信公众服务号或者支付宝钱包 服务窗用户的 id,医院如需存储,需要保留 200 位的字段
-    private String openId;
+    private String openId;    //是否是医保请求调用  1 是
+    private Integer ybRequest;
+
 }

+ 4 - 0
src/main/java/cn/hnthyy/thmz/service/impl/thmz/TsmzServiceImpl.java

@@ -39,6 +39,10 @@ public class TsmzServiceImpl implements TsmzService {
 
     @Override
     public PayInfo uploadFees(String staffId, String patientId, Integer times, Integer receiptNo) {
+        String balc = mzPatientMiMapper.selectMztczfsf(patientId);
+        if (balc == null) {
+           return null;
+        }
         log.info("调用医保试算接口,操作人={},病人={},就诊次数={},缴费次数={}", staffId, patientId, times, receiptNo);
         String realUrl = tsmzServiceUrl + "/uploadFees";
         Map<String, Object> map = new HashMap<>();