lighter преди 1 година
родител
ревизия
2edb244eab

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

@@ -606,22 +606,22 @@ public class MedicalViewApiController {
                 map.put("selfAmt", totalAmount);
                 map.put("priceTime", DateUtil.fomart(mzChargeDetail.getPriceTime(), "yyyy-MM-dd HH:mm:ss"));
                 //不是医保查询的时候调用,需要查询是否有医保报销信息
-                if (haicipat.getYbRequest() == null || !YesNoEnum.YES.code.equals(haicipat.getYbRequest())) {
-                    PayInfo payInfo = tsmzService.uploadFees(whiteList.getOpId(), mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), mzChargeDetail.getReceiptNo(),null);
-                    if (payInfo != null && payInfo.getCode() == 0) {
-                        if (payInfo.getAcctPay() == null) {
-                            payInfo.setAcctPay(BigDecimal.ZERO);
-                        }
-                        if (payInfo.getFundPay() == null) {
-                            payInfo.setFundPay(BigDecimal.ZERO);
-                        }
-                        //个人医保账户支付
-                        map.put("acctPay", payInfo.getAcctPay().multiply(BigDecimal.valueOf(100)));
-                        //医保统筹报销
-                        map.put("fundPay", payInfo.getFundPay().multiply(BigDecimal.valueOf(100)));
-                        map.put("selfAmt", mzChargeDetail.getAmount().subtract(payInfo.getAcctPay()).subtract(payInfo.getFundPay()).multiply(BigDecimal.valueOf(100)));
-                    }
-                }
+//                if (haicipat.getYbRequest() == null || !YesNoEnum.YES.code.equals(haicipat.getYbRequest())) {
+//                    PayInfo payInfo = tsmzService.uploadFees(whiteList.getOpId(), mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), mzChargeDetail.getReceiptNo(),null);
+//                    if (payInfo != null && payInfo.getCode() == 0) {
+//                        if (payInfo.getAcctPay() == null) {
+//                            payInfo.setAcctPay(BigDecimal.ZERO);
+//                        }
+//                        if (payInfo.getFundPay() == null) {
+//                            payInfo.setFundPay(BigDecimal.ZERO);
+//                        }
+//                        //个人医保账户支付
+//                        map.put("acctPay", payInfo.getAcctPay().multiply(BigDecimal.valueOf(100)));
+//                        //医保统筹报销
+//                        map.put("fundPay", payInfo.getFundPay().multiply(BigDecimal.valueOf(100)));
+//                        map.put("selfAmt", mzChargeDetail.getAmount().subtract(payInfo.getAcctPay()).subtract(payInfo.getFundPay()).multiply(BigDecimal.valueOf(100)));
+//                    }
+//                }
                 returnList.add(map);
             }
             results.put("resultCode", 0);
@@ -846,7 +846,7 @@ public class MedicalViewApiController {
     }
 
     private void setYbDepositFile(WhiteList whiteList, MzDepositFileVo mzDepositFileVo, MzDepositFile mzDepositFile, List<MzDepositFile> mzDepositFiles) {
-        PayInfo payInfo = tsmzService.uploadFees(whiteList.getOpId(), mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), mzDepositFileVo.getReceiptNo(),null);
+        PayInfo payInfo = tsmzService.calculateCost(whiteList.getOpId(), mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), mzDepositFileVo.getReceiptNo(), null);
         if (payInfo != null && payInfo.getCode() == 0) {
             //如果门诊统筹支付有值,添加收费方式
             if (payInfo.getFundPay().compareTo(BigDecimal.ZERO) == 1) {
@@ -894,7 +894,7 @@ public class MedicalViewApiController {
             if (mzChargeDetail == null) {
                 return R.error("没有待收费记录");
             }
-            PayInfo payInfo = tsmzService.calculateCost(Constants.BRZZJF_CODE, patientId, times, 1);
+            PayInfo payInfo = tsmzService.calculateCost(Constants.BRZZJF_CODE, patientId, times, 1, null);
             if (payInfo != null && payInfo.getCode() == 0) {
                 List<MzDepositFile> mzDepositFiles = new ArrayList<>();
                 BigDecimal tempTotal = BigDecimal.ZERO;

+ 2 - 2
src/main/java/cn/hnthyy/thmz/controller/mz/MzChargeDetailController.java

@@ -1513,7 +1513,7 @@ public class MzChargeDetailController {
                 }
                 DecodedJWT decodedJWT = TokenUtil.parseJWT(token);
                 User tokenUser = (User) JsonUtil.jsontoObject(decodedJWT.getSubject(), User.class);
-                PayInfo payInfo = tsmzService.uploadFees(tokenUser.getUserIdCode(), mzChargeDetailYb.getPatientId(), mzChargeDetailYb.getTimes(), mzChargeDetailYb.getReceiptNo(),mzChargeDetailYb.getAcctUsedFlag());
+                PayInfo payInfo = tsmzService.calculateCost(tokenUser.getUserIdCode(), mzChargeDetailYb.getPatientId(), mzChargeDetailYb.getTimes(), mzChargeDetailYb.getReceiptNo(),mzChargeDetailYb.getAcctUsedFlag());
                 if (payInfo == null) {
                     resultMap.put("code", -1);
                     resultMap.put("message", "获取门诊统筹/特门费用失败");
@@ -2149,7 +2149,7 @@ public class MzChargeDetailController {
                 totalAmount = totalAmount.setScale(2, BigDecimal.ROUND_HALF_UP);
                 BigDecimal selfAmount = totalAmount;
                 User tokenUser = TokenUtil.getUser(httpServletRequest);
-                PayInfo payInfo = tsmzService.uploadFees(tokenUser.getUserIdCode(), patientId, times, receiptNo,null);
+                PayInfo payInfo = tsmzService.calculateCost(tokenUser.getUserIdCode(), patientId, times, receiptNo,null);
                 if (payInfo != null && payInfo.getCode() == 0) {
                     //个人医保账户支付
                     results.put("acctPay", payInfo.getAcctPay());

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

@@ -832,7 +832,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             //单病种收费方式也是医保记账,但是不用传医保费用 所以需要排除
             for (MzDepositFile m : mzDepositFileVo.getMzDepositFiles()) {
                 if (Constants.YBJZ.equals(m.getChequeType())) {
-                    PayInfo payInfo = tsmzService.calculateCost(opId, mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), receiptNo);
+                    PayInfo payInfo = tsmzService.calculateCost(opId, mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), receiptNo, null);
                     if (payInfo == null) {
                         throw new MzException("特门费用结算失败,错误原因:获取特门费用失败");
                     }
@@ -2812,7 +2812,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         if (mzDepositFileMapper.selectMzTcZfInfo(patientId, times, receiptNo) > 0) {
             throw new MzException("该患者本次门诊处方已经进行了门诊统筹补录,请勿重复操作!");
         }
-        PayInfo payInfo = tsmzService.uploadFees(user.getUserIdCode(), patientId, times, receiptNo,null);
+        PayInfo payInfo = tsmzService.calculateCost(user.getUserIdCode(), patientId, times, receiptNo,null);
         if (payInfo == null) {
             throw new MzException("获取门诊统筹/特门费用失败!");
         }

+ 43 - 44
src/main/java/cn/hnthyy/thmz/service/impl/thmz/TsmzServiceImpl.java

@@ -20,8 +20,6 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -43,46 +41,46 @@ public class TsmzServiceImpl implements TsmzService {
         return null;
     }
 
-    @Override
-    public PayInfo uploadFees(String staffId, String patientId, Integer times, Integer receiptNo,Integer acctUsedFlag) {
-        log.info("调用医保试算接口,操作人={},病人={},就诊次数={},缴费次数={},是否用个账={}", staffId, patientId, times, receiptNo,acctUsedFlag == null ? 0 : acctUsedFlag);
-        String realUrl = tsmzServiceUrl + "/uploadFees";
-        Map<String, Object> map = new HashMap<>();
-        //Map 对象存入 用户名,密码,电话号码
-        map.put("staffId", staffId);
-        map.put("patientId", patientId);
-        map.put("times", times);
-        map.put("receiptNo", receiptNo);
-        map.put("acctUsedFlag", acctUsedFlag == null ? 0 : acctUsedFlag);
-        //Map 转成  JSONObject 字符串
-        JSONObject jsonObj = new JSONObject(map);
-        try {
-            String result = HttpUtil.sendHttpPost(realUrl, jsonObj.toString(), 6000);
-            if (StringUtils.isBlank(result)) {
-                return null;
-            }
-            JSONObject resultJSONO = new JSONObject(result);
-            if (resultJSONO == null) {
-                return null;
-            }
-            if ((int) resultJSONO.get("code") == 0) {
-                return getPayInfo(resultJSONO);
-            } else if ((int) resultJSONO.get("code") == -1) {
-                PayInfo payInfo = new PayInfo();
-                payInfo.setCode(-1);
-                payInfo.setErrorMessage((String) resultJSONO.get("msg"));
-                return payInfo;
-            } else 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(StrUtil.format("特殊门诊病人费用试算失败,病人id={},就诊次数times={},缴费次数receiptNo={}:异常信息", patientId, times, receiptNo),e);
-        }
-        return null;
-    }
+//    @Override
+//    public PayInfo uploadFees(String staffId, String patientId, Integer times, Integer receiptNo,Integer acctUsedFlag) {
+//        log.info("调用医保试算接口,操作人={},病人={},就诊次数={},缴费次数={},是否用个账={}", staffId, patientId, times, receiptNo,acctUsedFlag == null ? 0 : acctUsedFlag);
+//        String realUrl = tsmzServiceUrl + "/uploadFees";
+//        Map<String, Object> map = new HashMap<>();
+//        //Map 对象存入 用户名,密码,电话号码
+//        map.put("staffId", staffId);
+//        map.put("patientId", patientId);
+//        map.put("times", times);
+//        map.put("receiptNo", receiptNo);
+//        map.put("acctUsedFlag", acctUsedFlag == null ? 0 : acctUsedFlag);
+//        //Map 转成  JSONObject 字符串
+//        JSONObject jsonObj = new JSONObject(map);
+//        try {
+//            String result = HttpUtil.sendHttpPost(realUrl, jsonObj.toString(), 6000);
+//            if (StringUtils.isBlank(result)) {
+//                return null;
+//            }
+//            JSONObject resultJSONO = new JSONObject(result);
+//            if (resultJSONO == null) {
+//                return null;
+//            }
+//            if ((int) resultJSONO.get("code") == 0) {
+//                return getPayInfo(resultJSONO);
+//            } else if ((int) resultJSONO.get("code") == -1) {
+//                PayInfo payInfo = new PayInfo();
+//                payInfo.setCode(-1);
+//                payInfo.setErrorMessage((String) resultJSONO.get("msg"));
+//                return payInfo;
+//            } else 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(StrUtil.format("特殊门诊病人费用试算失败,病人id={},就诊次数times={},缴费次数receiptNo={}:异常信息", patientId, times, receiptNo),e);
+//        }
+//        return null;
+//    }
 
     private PayInfo getPayInfo(JSONObject resultJSONO) {
         JSONObject tempJSONO = (JSONObject) resultJSONO.get("payInfo");
@@ -144,15 +142,16 @@ public class TsmzServiceImpl implements TsmzService {
     }
 
     @Override
-    public PayInfo calculateCost(String staffId, String patientId, Integer times, Integer receiptNo) {
+    public PayInfo calculateCost(String staffId, String patientId, Integer times, Integer receiptNo, Integer acctUsedFlag) {
         String realUrl = tsmzServiceUrl + "/calculateCost";
-        log.info("调用医保上传接口,操作人={},病人={},就诊次数={},缴费次数={}", staffId, patientId, times, receiptNo);
+        log.info("调用医保结算接口,操作人={},病人={},就诊次数={},缴费次数={},使用个账={}", staffId, patientId, times, receiptNo, acctUsedFlag);
         Map<String, Object> map = new HashMap<>();
         //Map 对象存入 用户名,密码,电话号码
         map.put("staffId", staffId);
         map.put("patientId", patientId);
         map.put("times", times);
         map.put("receiptNo", receiptNo);
+        map.put("acctUsedFlag", acctUsedFlag);
         //Map 转成  JSONObject 字符串
         JSONObject jsonObj = new JSONObject(map);
         try {

+ 2 - 2
src/main/java/cn/hnthyy/thmz/service/thmz/TsmzService.java

@@ -31,7 +31,7 @@ public interface TsmzService {
      * @param acctUsedFlag 是否使用个人账户余额结算 1使用,0不使用 2.使用共济账户
      * @return
      */
-    PayInfo uploadFees(String staffId, String patientId, Integer times, Integer receiptNo,Integer acctUsedFlag);
+//    PayInfo uploadFees(String staffId, String patientId, Integer times, Integer receiptNo, Integer acctUsedFlag);
 
     /**
      * 费用撤销
@@ -53,7 +53,7 @@ public interface TsmzService {
      * @param receiptNo
      * @return
      */
-    PayInfo calculateCost(String staffId, String patientId, Integer times, Integer receiptNo);
+    PayInfo calculateCost(String staffId, String patientId, Integer times, Integer receiptNo, Integer acctUsedFlag);
 
 
     /**