Bläddra i källkod

取消自动结算和自动保存处方

lighter_217 4 månader sedan
förälder
incheckning
3b09acf12f
1 ändrade filer med 2 tillägg och 60 borttagningar
  1. 2 60
      src/main/java/thyyxxk/simzfeeoprnsystm/service/SiMzFeeService.java

+ 2 - 60
src/main/java/thyyxxk/simzfeeoprnsystm/service/SiMzFeeService.java

@@ -590,20 +590,12 @@ public class SiMzFeeService {
 
     private ResultVo<FundDetail> dealSetlEntity(MzPatientInfo p, SiSetlinfo setlEntity) {
         saveSetlinfoToDatabase(setlEntity, p);
-        if (!p.getStraitSettle() && BigDecimal.ZERO.compareTo(setlEntity.getPsnCashPay()) == 0) {
-            ResultVo<String> mzChargeResponse = mzHisChargeProcess(p.getPatNo(), p.getTimes(),
-                    String.valueOf(setlEntity.getMedfeeSumamt()));
-            if (mzChargeResponse.getCode() != ExceptionEnum.SUCCESS.getCode()) {
-                revokeOutpatientSettlementForTask(setlEntity);
-                return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, mzChargeResponse.getMessage());
-            }
-        }
         setlinfoDao.deletePreSettleInfo(p.getPatNo(), p.getTimes());
         return getFundDetailFromSetlinfo(setlEntity);
     }
 
     private SiSetlinfo querySettlementInfo(MzPatientInfo p) {
-        String url = "http://172.16.32.167:8077/siQuery/querySettlementInfo";
+        String url = "http://130.150.161.72:8706/siQuery/querySettlementInfo";
         JSONObject params = new JSONObject();
         params.put("psnNo", p.getPsnNo());
         params.put("mdtrtId", p.getMdtrtId());
@@ -677,21 +669,6 @@ public class SiMzFeeService {
             return getFundDetailFromSetlinfo(setlinfo);
         }
 
-        String staffDept = mzDao.selectStaffDepartment(p.getStaffId());
-//        if (!Objects.equals(staffDept, "3020100") &&
-//                !Objects.equals(staffDept, "3060000") &&
-//                !Objects.equals(staffDept, "3100000")) {
-//            if (!Objects.equals(p.getStaffId(), setlinfo.getStaffId())) {
-//                return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, "您没有权限撤销本条医保业务,请到收费窗口退处方,或者联系医保科处理。");
-//            }
-//        }
-
-        // todo 把下方 3060000 换成财务科室的编码
-        if (BigDecimal.ZERO.compareTo(setlinfo.getPsnCashPay()) == 0
-                && !Objects.equals(staffDept, "3060000")) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "本次结算【个人现金支付为0】,请到收费窗口做退费操作。");
-        }
-
         JSONObject input = exec.makeTradeHeaderWithInsureArea(SiFunction.REVOKE_OUTPATIENT_SETTLEMENT,
                 mzDao.selectAdmdvs(setlinfo.getPatNo(), setlinfo.getTimes(), setlinfo.getLedgerSn()), p.getStaffId());
         JSONObject data = new JSONObject();
@@ -872,18 +849,8 @@ public class SiMzFeeService {
             return outpatientSettlement(mzptnt);
         }
 
-        // 如果试算个人现金支付为0,直接结算
         mzptnt.setReadCardBizType(ReadCardBizType.SETTLEMENT.getCode());
-        ResultVo<FundDetail> presetlResponse = outpatientPreSettlement(mzptnt);
-        if (presetlResponse.getCode() == ExceptionEnum.SUCCESS.getCode()) {
-            FundDetail fundDetail = presetlResponse.getData();
-            BigDecimal cashpay = new BigDecimal(fundDetail.getCashPay());
-            if (cashpay.compareTo(BigDecimal.ZERO) == 0) {
-                return outpatientSettlement(mzptnt);
-            }
-        }
-
-        return presetlResponse;
+        return outpatientPreSettlement(mzptnt);
     }
 
     public String generateSiMzFees(MzPatientInfo mzptnt) {
@@ -937,31 +904,6 @@ public class SiMzFeeService {
         return response.getString("message");
     }
 
-    private ResultVo<String> mzHisChargeProcess(String patientId, int times, String totalFee) {
-        JSONObject params = new JSONObject();
-        params.put("patientId", patientId);
-        params.put("times", times);
-        params.put("totalFee", totalFee);
-        int tryTimes = 1;
-        JSONObject response = webHisService.mzChargeFee(hisApi.getMz(), params);
-        log.info("第{}次保存处方:\n参数:{}\n结果:{}", tryTimes, params, response);
-        while (0 != response.getInteger("code") && tryTimes < 5
-                && !response.getString("message").contains("已经收费")) {
-            try {
-                tryTimes += 1;
-                response = webHisService.mzChargeFee(hisApi.getMz(), params);
-                log.info("第{}次保存处方:\n参数:{}\n结果:{}", tryTimes, params, response);
-                TimeUnit.SECONDS.sleep(Math.min(tryTimes, 3));
-            } catch (Exception e) {
-                log.error("TIMEUNIT SLEEP ERROR", e);
-            }
-        }
-        if (0 != response.getInteger("code") && !response.getString("message").contains("已经收费")) {
-            return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR, "自动保存处方失败,将为您撤销门诊医保业务。");
-        }
-        return ResultVoUtil.success();
-    }
-
     public ResultVo<Integer> isPatientDuringSiSettle(String patientId) {
         int result = MzgjUtil.inProcessing(patientId) ? 1 : 0;
         return ResultVoUtil.success(result);