瀏覽代碼

增加手机退费接口

hurugang 4 年之前
父節點
當前提交
b1f740c685

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

@@ -10,6 +10,8 @@ import cn.hnthyy.thmz.entity.his.mz.*;
 import cn.hnthyy.thmz.entity.his.zd.ZdEmpTitle;
 import cn.hnthyy.thmz.entity.his.zd.ZdMzClass;
 import cn.hnthyy.thmz.entity.his.zd.ZdUnitCode;
+import cn.hnthyy.thmz.entity.thmz.User;
+import cn.hnthyy.thmz.enums.ConfirmFlagEnum;
 import cn.hnthyy.thmz.enums.PayMarkEnum;
 import cn.hnthyy.thmz.enums.YesNoEnum;
 import cn.hnthyy.thmz.pageDto.MzChargeDetailPageDto;
@@ -20,6 +22,7 @@ import cn.hnthyy.thmz.service.his.zd.ZdEmpTitleService;
 import cn.hnthyy.thmz.service.his.zd.ZdMzClassService;
 import cn.hnthyy.thmz.service.his.zd.ZdUnitCodeService;
 import cn.hnthyy.thmz.service.his.zy.APatientMiService;
+import cn.hnthyy.thmz.service.thmz.UserService;
 import cn.hnthyy.thmz.vo.*;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -66,6 +69,8 @@ public class MedicalViewApiController {
     private MzZdWorkTimeService mzZdWorkTimeService;
     @Autowired
     private MzyReqrecService mzyReqrecService;
+    @Autowired
+    private UserService userService;
 
     //海慈身份证类型
     private static final String ID_CARD_TYPE = "11";
@@ -83,6 +88,7 @@ public class MedicalViewApiController {
     private static final String WX = "WX";
     //支付宝
     private static final String ZFB = "ZFB";
+
     /**
      * 患者信息查询
      *
@@ -102,18 +108,18 @@ public class MedicalViewApiController {
             results.put("resultMessage", "顾客证件号码不能为空");
             return results;
         }
-        if (!Arrays.asList(ID_CARD_TYPE,MEDICAL_CARD_TYPE).contains(haicipat.getPatIdType())) {
+        if (!Arrays.asList(ID_CARD_TYPE, MEDICAL_CARD_TYPE).contains(haicipat.getPatIdType())) {
             results.put("resultCode", -1);
             results.put("resultMessage", "顾客证件类型非身份证或者诊疗卡,暂不支持");
             return results;
         }
-        List<MzPatientMi> mzPatientMis =null;
-        if(ID_CARD_TYPE.equals(haicipat.getPatIdType())){
+        List<MzPatientMi> mzPatientMis = null;
+        if (ID_CARD_TYPE.equals(haicipat.getPatIdType())) {
             mzPatientMis = mzPatientMiService.queryBySocialNo(haicipat.getPatIdNo(), null);
-        }else if(MEDICAL_CARD_TYPE.equals(haicipat.getPatIdType())){
+        } else if (MEDICAL_CARD_TYPE.equals(haicipat.getPatIdType())) {
             MzPatientMi mzPatientMi = mzPatientMiService.queryByIcCardNo(haicipat.getPatIdNo());
-            if(mzPatientMi!=null){
-                mzPatientMis=Arrays.asList(mzPatientMi);
+            if (mzPatientMi != null) {
+                mzPatientMis = Arrays.asList(mzPatientMi);
             }
         }
         if (mzPatientMis == null || mzPatientMis.size() == 0) {
@@ -494,7 +500,7 @@ public class MedicalViewApiController {
                 results.put("resultMessage", "患者诊疗卡号查询不到对应的患者信息");
                 return results;
             }
-            List<MzChargeDetail> mzChargeDetailList = mzChargeDetailService.unPaidToFullChargeDetail(mzPatientMi.getPatientId(),mzPatientMi.getName());
+            List<MzChargeDetail> mzChargeDetailList = mzChargeDetailService.unPaidToFullChargeDetail(mzPatientMi.getPatientId(), mzPatientMi.getName());
             if (mzChargeDetailList == null || mzChargeDetailList.size() == 0) {
                 results.put("resultCode", -1);
                 results.put("resultMessage", "未查询到待缴费记录");
@@ -523,7 +529,7 @@ public class MedicalViewApiController {
         } catch (Exception e) {
             e.printStackTrace();
             results.put("resultCode", -1);
-            results.put("resultMessage", "门诊待缴费记录查询失败,请联系管理员,错误信息{"+e.getMessage()+"}");
+            results.put("resultMessage", "门诊待缴费记录查询失败,请联系管理员,错误信息{" + e.getMessage() + "}");
             log.error("系统异常,错误信息{}", e.getMessage());
             return results;
         }
@@ -683,7 +689,7 @@ public class MedicalViewApiController {
             return results;
         }
         try {
-            MzDepositFile mzDepositFileDb = mzDepositFileService.queryMzDepositFileByAgtordnum(haiciCharge.getPsOrdNum(), haiciCharge.getAgtOrdNum(),null);
+            MzDepositFile mzDepositFileDb = mzDepositFileService.queryMzDepositFileByAgtordnum(haiciCharge.getPsOrdNum(), haiciCharge.getAgtOrdNum(), null);
             if (mzDepositFileDb != null && PayMarkEnum.CHARGED.code.equals(mzDepositFileDb.getPayMark())) {
                 results.put("resultCode", 0);
                 results.put("resultMessage", "缴费成功");
@@ -770,7 +776,7 @@ public class MedicalViewApiController {
             return results;
         }
         try {
-            MzDepositFile mzDepositFileDb = mzDepositFileService.queryMzDepositFileByAgtordnum(haiciCharge.getPsOrdNum(), haiciCharge.getAgtOrdNum(),null);
+            MzDepositFile mzDepositFileDb = mzDepositFileService.queryMzDepositFileByAgtordnum(haiciCharge.getPsOrdNum(), haiciCharge.getAgtOrdNum(), null);
             if (mzDepositFileDb != null && PayMarkEnum.CHARGED.code.equals(mzDepositFileDb.getPayMark())) {
                 results.put("resultCode", 0);
                 results.put("resultMessage", "门诊缴费订单支付状态查询成功");
@@ -796,102 +802,70 @@ public class MedicalViewApiController {
     }
 
 
-
-//    /**
-//     * 门诊缴费订单退费
-//     *
-//     * @param haiciCharge
-//     * @return
-//     */
-//    @RequestMapping(value = "/saveRefundFeeFormHaiCi", method = {RequestMethod.POST})
-//    public Map<String, Object> saveRefundFeeFormHaiCi(@RequestBody HaiciCharge haiciCharge) {
-//        Map<String, Object> results = new HashMap<>();
-//        if (haiciCharge == null) {
-//            results.put("resultCode", -1);
-//            results.put("resultMessage", "门诊缴费订单支付参数为空");
-//            return results;
-//        }
-//        if (haiciCharge.getPatCardType() == null) {
-//            results.put("resultCode", -1);
-//            results.put("resultMessage", "患者诊疗卡类型不能为空");
-//            return results;
-//        }
-//        if (StringUtils.isBlank(haiciCharge.getPatCardNo())) {
-//            results.put("resultCode", -1);
-//            results.put("resultMessage", "患者诊疗卡号不能为空");
-//            return results;
-//        }
-//        if (StringUtils.isBlank(haiciCharge.getHisOrdNum())) {
-//            results.put("resultCode", -1);
-//            results.put("resultMessage", "医院订单号不能为空");
-//            return results;
-//        }
-//        if (StringUtils.isBlank(haiciCharge.getPsOrdNum())) {
-//            results.put("resultCode", -1);
-//            results.put("resultMessage", "平台订单号不能为空");
-//            return results;
-//        }
-//        if (StringUtils.isBlank(haiciCharge.getPayMode())) {
-//            results.put("resultCode", -1);
-//            results.put("resultMessage", "支付方式不能为空");
-//            return results;
-//        }
-//        if (!Arrays.asList(WX, ZFB).contains(haiciCharge.getPayMode())) {
-//            results.put("resultCode", -1);
-//            results.put("resultMessage", "支付方式有误,请联系管理员");
-//            return results;
-//        }
-//        if (haiciCharge.getPayAmt() == null) {
-//            results.put("resultCode", -1);
-//            results.put("resultMessage", "支付金额不能为空");
-//            return results;
-//        }
-//        if (StringUtils.isBlank(haiciCharge.getAgtOrdNum())) {
-//            results.put("resultCode", -1);
-//            results.put("resultMessage", "支付机构流水号不能为空");
-//            return results;
-//        }
-//        if (haiciCharge.getPayTime() == null) {
-//            results.put("resultCode", -1);
-//            results.put("resultMessage", "支付时间不能为空");
-//            return results;
-//        }
-//        try {
-//            MzDepositFile mzDepositFileDb = mzDepositFileService.queryMzDepositFileByAgtordnum(haiciCharge.getPsOrdNum(), haiciCharge.getAgtOrdNum(),null);
-//            if (mzDepositFileDb != null && PayMarkEnum.CHARGED.code.equals(mzDepositFileDb.getPayMark())) {
-//                results.put("resultCode", 0);
-//                results.put("resultMessage", "缴费成功");
-//                results.put("guideListInfo", "");
-//                return results;
-//            }
-//            String[] arr = haiciCharge.getHisOrdNum().split("_");
-//            MzDepositFileVo mzDepositFileVo = new MzDepositFileVo();
-//            mzDepositFileVo.setPatientId(arr[0]);
-//            mzDepositFileVo.setTimes(Integer.valueOf(arr[1]));
-//            mzDepositFileVo.setReceiptNo(Integer.valueOf(arr[2]));
-//            MzDepositFile mzDepositFile = new MzDepositFile();
-//            if (WX.equals(haiciCharge.getPayMode())) {
-//                mzDepositFile.setChequeType(Constants.ZZWX);
-//            } else {
-//                mzDepositFile.setChequeType(Constants.ZZZFB);
-//            }
-//            mzDepositFile.setPsordnum(haiciCharge.getPsOrdNum());
-//            mzDepositFile.setAgtordnum(haiciCharge.getAgtOrdNum());
-//            mzDepositFile.setAmount(haiciCharge.getPayAmt().divide(BigDecimal.valueOf(100)));
-//            mzDepositFileVo.setMzDepositFiles(Arrays.asList(mzDepositFile));
-//            mzChargeDetailService.chargeFee(Constants.BRZZJF_CODE, mzDepositFileVo);
-//            results.put("resultCode", 0);
-//            results.put("resultMessage", "缴费成功");
-//            results.put("guideListInfo", "");
-//            return results;
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//            results.put("resultCode", -1);
-//            results.put("resultMessage", "门诊缴费订单支付失败,请联系管理员");
-//            log.error("系统异常,错误信息{}", e.getMessage());
-//            return results;
-//        }
-//    }
+    /**
+     * 门诊缴费订单退费
+     *
+     * @param haiciCharge
+     * @return
+     */
+    @RequestMapping(value = "/saveRefundFeeFormHaiCi", method = {RequestMethod.POST})
+    public Map<String, Object> saveRefundFeeFormHaiCi(@RequestBody HaiciCharge haiciCharge) {
+        Map<String, Object> results = new HashMap<>();
+        if (haiciCharge == null) {
+            results.put("resultCode", -1);
+            results.put("resultMessage", "门诊缴费订单退费参数为空");
+            return results;
+        }
+        if (StringUtils.isBlank(haiciCharge.getHisOrdNum())) {
+            results.put("resultCode", -1);
+            results.put("resultMessage", "医院订单号不能为空");
+            return results;
+        }
+        try {
+            String[] arr = haiciCharge.getHisOrdNum().split("-");
+            MzChargeDetail mzChargeDetail = new MzChargeDetail(arr[0], Integer.valueOf(arr[1]));
+            mzChargeDetail.setReceiptNo(Integer.valueOf(arr[2]));
+            List<MzChargeDetail> mzChargeDetailList = mzChargeDetailService.queryMzChargeDetailByBillItemCode(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), mzChargeDetail.getReceiptNo(), PayMarkEnum.CHARGED.code, "2", Arrays.asList("TC"));
+            if (mzChargeDetailList == null || mzChargeDetailList.size() == 0) {
+                results.put("resultCode", -1);
+                results.put("resultMessage", "未查询到已缴费明细记录");
+                return results;
+            }
+            String chargeItemCodes = null;
+            for (MzChargeDetail md : mzChargeDetailList) {
+                if (md == null || Constants.TC.equals(md.getBillItemCode())) {
+                    continue;
+                }
+                if(ConfirmFlagEnum.CONFIRM.code.equals(md.getConfirmFlag())){
+                    results.put("resultCode", -1);
+                    results.put("resultMessage", "无法退费,当前处方已经被确认,请您联系该科室进行处理");
+                    return results;
+                }
+                if (chargeItemCodes == null) {
+                    chargeItemCodes = md.getBillItemCode();
+                } else {
+                    chargeItemCodes += "," + md.getBillItemCode();
+                }
+            }
+            MzDepositFileVo mzDepositFileVo = new  MzDepositFileVo();
+            mzDepositFileVo.setPatientId(arr[0]);
+            mzDepositFileVo.setTimes(Integer.valueOf(arr[1]));
+            mzDepositFileVo.setReceiptNo(Integer.valueOf(arr[2]));
+            mzDepositFileVo.setChargeItemCodes(chargeItemCodes);
+            User tokenUser = userService.queryUserByUserIdCode(Constants.BRZZJF_CODE);
+            mzChargeDetailService.refundFee(tokenUser.getUserIdCode(),mzDepositFileVo);
+            results.put("resultCode", 0);
+            results.put("resultMessage", "退费成功");
+            results.put("guideListInfo", "");
+            return results;
+        } catch (Exception e) {
+            e.printStackTrace();
+            results.put("resultCode", -1);
+            results.put("resultMessage", "门诊订单退费失败,请联系管理员");
+            log.error("系统异常,错误信息{}", e.getMessage());
+            return results;
+        }
+    }
 
 
     /**
@@ -927,14 +901,13 @@ public class MedicalViewApiController {
         } catch (Exception e) {
             e.printStackTrace();
             results.put("resultCode", -1);
-            results.put("resultMessage", "门诊已缴费记录查询失败,请联系管理员,错误信息{"+e.getMessage()+"}");
+            results.put("resultMessage", "门诊已缴费记录查询失败,请联系管理员,错误信息{" + e.getMessage() + "}");
             log.error("系统异常,错误信息{}", e.getMessage());
             return results;
         }
     }
 
 
-
     /**
      * 门诊挂号记录查询
      *
@@ -962,7 +935,7 @@ public class MedicalViewApiController {
             mzyReqrecPageDto.setPatientIds(Arrays.asList(mzyReqrec.getPatientId()));
             mzyReqrecPageDto.setTableName("mzy_reqrec");
             List<MzyReqrec> mzyReqrecList = mzyReqrecService.queryMzyReqrecWithPage(mzyReqrecPageDto);
-            List<Map<String,Object>> list = new ArrayList<>();
+            List<Map<String, Object>> list = new ArrayList<>();
             Map<String, String> employeeMap = null;
             Set<String> set = new HashSet<>();
             employeeMap = getStringStringMap(mzyReqrecList, list, employeeMap, set);
@@ -981,39 +954,39 @@ public class MedicalViewApiController {
         } catch (Exception e) {
             e.printStackTrace();
             results.put("resultCode", -1);
-            results.put("resultMessage", "门诊挂号记录查询失败,请联系管理员,错误信息{"+e.getMessage()+"}");
+            results.put("resultMessage", "门诊挂号记录查询失败,请联系管理员,错误信息{" + e.getMessage() + "}");
             log.error("系统异常,错误信息{}", e.getMessage());
             return results;
         }
     }
 
     private Map<String, String> getStringStringMap(List<MzyReqrec> mzyReqrecList, List<Map<String, Object>> list, Map<String, String> employeeMap, Set<String> set) {
-        if(mzyReqrecList!=null && mzyReqrecList.size()>0){
+        if (mzyReqrecList != null && mzyReqrecList.size() > 0) {
             if (employeeMap == null) {
                 List<Employee> employees = employeeService.queryAll();
                 if (employees != null) {
                     employeeMap = employees.stream().collect(Collectors.toMap(Employee::getEmployeeCode, Employee::getEmployeeName));
                 }
             }
-            for (MzyReqrec mr:mzyReqrecList){
-                if(set.contains(mr.getPsordnum())){
+            for (MzyReqrec mr : mzyReqrecList) {
+                if (set.contains(mr.getPsordnum())) {
                     continue;
                 }
-                Map<String,Object> map = new HashMap<>();
-                map.put("patientId",mr.getPatientId());
-                map.put("doctorName",employeeMap.get(mr.getDoctorCode()));
-                map.put("unitName",zdUnitCodeService.queryDeptNameByIdInCache(mr.getUnitCode()));
-                map.put("requestDay",DateUtil.fomart(mr.getRequestDay(),"yyyy-MM-dd HH:mm:ss"));
-                map.put("opDay",DateUtil.fomart(mr.getOpDay(),"yyyy-MM-dd HH:mm:ss"));
+                Map<String, Object> map = new HashMap<>();
+                map.put("patientId", mr.getPatientId());
+                map.put("doctorName", employeeMap.get(mr.getDoctorCode()));
+                map.put("unitName", zdUnitCodeService.queryDeptNameByIdInCache(mr.getUnitCode()));
+                map.put("requestDay", DateUtil.fomart(mr.getRequestDay(), "yyyy-MM-dd HH:mm:ss"));
+                map.put("opDay", DateUtil.fomart(mr.getOpDay(), "yyyy-MM-dd HH:mm:ss"));
                 if (StringUtils.isNotBlank(mr.getChargeType())) {
                     MzyZdChargeType mzyZdChargeType = mzyZdChargeTypeService.queryByCode(mr.getChargeType());
                     if (mzyZdChargeType != null) {
                         map.put("chargeType", mzyZdChargeType.getName());
-                    }else {
-                        map.put("chargeType","");
+                    } else {
+                        map.put("chargeType", "");
                     }
                 }
-                BigDecimal fee=BigDecimal.ZERO;
+                BigDecimal fee = BigDecimal.ZERO;
                 if (mr.getReqFee() == null) {
                     mr.setReqFee(BigDecimal.ZERO);
                 }
@@ -1024,7 +997,7 @@ public class MedicalViewApiController {
                     mr.setOthFee(BigDecimal.ZERO);
                 }
                 fee = fee.add(mr.getReqFee()).add(mr.getClinicFee()).add(mr.getOthFee());
-                map.put("fee",fee);
+                map.put("fee", fee);
                 list.add(map);
                 set.add(mr.getPatientId());
             }
@@ -1087,8 +1060,6 @@ public class MedicalViewApiController {
     }
 
 
-
-
     /**
      * 新冠拦截手机挂号
      *
@@ -1108,11 +1079,12 @@ public class MedicalViewApiController {
             return resultMap;
         }
         try {
-            mzyReqrecService.covidManageForHaici(patientId,unitCode);
+            mzyReqrecService.covidManageForHaici(patientId, unitCode);
             resultMap.put("code", 0);
             resultMap.put("message", "当前病人已经通过流调");
             return resultMap;
         } catch (MzException e) {
+            e.printStackTrace();
             log.error("系统异常,请联系管理员");
             resultMap.put("code", e.getValue());
             resultMap.put("message", e.getMessage());
@@ -1121,7 +1093,6 @@ public class MedicalViewApiController {
     }
 
 
-
     /**
      * 根据门诊科室分类码查询科室列表
      *
@@ -1263,9 +1234,9 @@ public class MedicalViewApiController {
             }
             List<Employee> notDoctors = new ArrayList<>();
             for (Employee employee : employees) {
-                if(titGradeMap!=null){
+                if (titGradeMap != null) {
                     Integer titGrade = titGradeMap.get(employee.getEmpTitCode());
-                    if(!Constants.DOCTOR_TIT_GRADE.equals(titGrade)){
+                    if (!Constants.DOCTOR_TIT_GRADE.equals(titGrade)) {
                         notDoctors.add(employee);
                         continue;
                     }
@@ -1404,11 +1375,6 @@ public class MedicalViewApiController {
     }
 
 
-
-
-
-
-
     /**
      * 查询可以挂号的医生号源信息
      *
@@ -1485,14 +1451,14 @@ public class MedicalViewApiController {
                         fee = fee.add(mzyZdChargeType.getReqFee()).add(mzyZdChargeType.getClinicFee()).add(mzyZdChargeType.getOthFee());
                     }
                 }
-                String ampm =(String) map.get("ampm");
+                String ampm = (String) map.get("ampm");
                 BigDecimal checkFee = (BigDecimal) map.get("checkFee");
                 if (checkFee == null) {
                     checkFee = BigDecimal.ZERO;
                 }
                 fee = fee.add(checkFee);
-                if(mzyReqrecService.notPayGhFee(unitCode, requestDayD, ampm)){
-                    fee= BigDecimal.ZERO;
+                if (mzyReqrecService.notPayGhFee(unitCode, requestDayD, ampm)) {
+                    fee = BigDecimal.ZERO;
                 }
                 map.put("fee", fee);
                 map.remove("checkFee");
@@ -1528,19 +1494,16 @@ public class MedicalViewApiController {
     }
 
 
-
-
-
     /**
      * 根据排班主键和生日查询挂号费用  (费用确认低于7岁儿童增加挂号费 上调50%)
      *
      * @return
      */
     @RequestMapping(value = "/getMzChargeTypeByRequestIdForHaiCi", method = {RequestMethod.GET})
-    public Map<String, Object> getMzChargeTypeByRequestIdForHaiCi(@RequestParam("mzyRequestId") Long mzyRequestId,@RequestParam("patientId") String patientId) {
+    public Map<String, Object> getMzChargeTypeByRequestIdForHaiCi(@RequestParam("mzyRequestId") Long mzyRequestId, @RequestParam("patientId") String patientId) {
         Map<String, Object> resultMap = new HashMap<>();
         try {
-            if (mzyRequestId==null) {
+            if (mzyRequestId == null) {
                 resultMap.put("code", -1);
                 resultMap.put("message", "排班主键不能为空");
                 return resultMap;
@@ -1550,23 +1513,23 @@ public class MedicalViewApiController {
                 resultMap.put("message", "病人门诊ID不能为空");
                 return resultMap;
             }
-            MzPatientMi mzPatientMi=mzPatientMiService.queryByPatientId(patientId);
-            if(mzPatientMi==null){
+            MzPatientMi mzPatientMi = mzPatientMiService.queryByPatientId(patientId);
+            if (mzPatientMi == null) {
                 resultMap.put("code", -1);
                 resultMap.put("message", "病人不存在");
                 return resultMap;
             }
-            Date birthDayD =mzPatientMi.getBirthDay();
-            MzyZdChargeType mzyZdChargeType=mzyRequestService.calculateAddition(mzyRequestId,birthDayD);
+            Date birthDayD = mzPatientMi.getBirthDay();
+            MzyZdChargeType mzyZdChargeType = mzyRequestService.calculateAddition(mzyRequestId, birthDayD);
             BigDecimal fee = BigDecimal.ZERO;
-            if(mzyZdChargeType.getReqFee()!=null){
-                fee=fee.add(mzyZdChargeType.getReqFee());
+            if (mzyZdChargeType.getReqFee() != null) {
+                fee = fee.add(mzyZdChargeType.getReqFee());
             }
-            if(mzyZdChargeType.getClinicFee()!=null){
-                fee=fee.add(mzyZdChargeType.getClinicFee());
+            if (mzyZdChargeType.getClinicFee() != null) {
+                fee = fee.add(mzyZdChargeType.getClinicFee());
             }
-            if(mzyZdChargeType.getOthFee()!=null){
-                fee=fee.add(mzyZdChargeType.getOthFee());
+            if (mzyZdChargeType.getOthFee() != null) {
+                fee = fee.add(mzyZdChargeType.getOthFee());
             }
             resultMap.put("code", 0);
             resultMap.put("message", "根据排班主键和生日查询挂号费用功");
@@ -1583,8 +1546,6 @@ public class MedicalViewApiController {
     }
 
 
-
-
     /**
      * 门诊挂号支付
      *
@@ -1718,7 +1679,7 @@ public class MedicalViewApiController {
 //            return results;
 //        }
         try {
-            MzyReqrec mzyReqrec = mzyReqrecService.queryMzyReqrecByAgtordnum(haiciCharge.getPsOrdNum(), haiciCharge.getAgtOrdNum(),null);
+            MzyReqrec mzyReqrec = mzyReqrecService.queryMzyReqrecByAgtordnum(haiciCharge.getPsOrdNum(), haiciCharge.getAgtOrdNum(), null);
             if (mzyReqrec != null) {
                 results.put("resultCode", 0);
                 results.put("resultMessage", "门诊挂号订单支付状态查询成功");
@@ -1769,22 +1730,22 @@ public class MedicalViewApiController {
                 return resultMap;
             }
             //日期参数为了兼容不同的接口,设计了两个不同的字段
-            if(StringUtils.isNotBlank(mzChargeDetailPageDto.getBeginTimeStr())){
-                mzChargeDetailPageDto.setBeginTime(DateUtil.pase(mzChargeDetailPageDto.getBeginTimeStr(),"yyyy-MM-dd HH:mm:ss"));
+            if (StringUtils.isNotBlank(mzChargeDetailPageDto.getBeginTimeStr())) {
+                mzChargeDetailPageDto.setBeginTime(DateUtil.pase(mzChargeDetailPageDto.getBeginTimeStr(), "yyyy-MM-dd HH:mm:ss"));
             }
-            if(StringUtils.isNotBlank(mzChargeDetailPageDto.getEndTimeStr())){
-                mzChargeDetailPageDto.setEndTime(DateUtil.pase(mzChargeDetailPageDto.getEndTimeStr(),"yyyy-MM-dd HH:mm:ss"));
+            if (StringUtils.isNotBlank(mzChargeDetailPageDto.getEndTimeStr())) {
+                mzChargeDetailPageDto.setEndTime(DateUtil.pase(mzChargeDetailPageDto.getEndTimeStr(), "yyyy-MM-dd HH:mm:ss"));
             }
             PageViewVo pageViewVo = new PageViewVo();
             MzChargeDetail mzChargeDetail = mzChargeDetailPageDto.getMzChargeDetail();
-            if(mzChargeDetail==null){
+            if (mzChargeDetail == null) {
                 mzChargeDetail = new MzChargeDetail();
                 mzChargeDetailPageDto.setMzChargeDetail(mzChargeDetail);
             }
-            if(StringUtils.isBlank(mzChargeDetail.getPayMark())){
+            if (StringUtils.isBlank(mzChargeDetail.getPayMark())) {
                 mzChargeDetail.setPayMark(PayMarkEnum.CHARGED.code);
-            }else {
-                if(!Arrays.asList(PayMarkEnum.CHARGED.code,PayMarkEnum.RETURN_PREMIUM.code).contains(mzChargeDetail.getPayMark())){
+            } else {
+                if (!Arrays.asList(PayMarkEnum.CHARGED.code, PayMarkEnum.RETURN_PREMIUM.code).contains(mzChargeDetail.getPayMark())) {
                     resultMap.put("code", -1);
                     resultMap.put("message", "订单状态参数错误");
                     return resultMap;
@@ -1876,7 +1837,7 @@ public class MedicalViewApiController {
             List<MzChargeDetail> mzChargeDetailList = mzChargeDetailService.queryMzChargeDetailByBillItemCode(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), mzChargeDetail.getReceiptNo(), PayMarkEnum.CHARGED.code, "2", Arrays.asList("TC"));
             if (mzChargeDetailList == null || mzChargeDetailList.size() == 0) {
                 results.put("resultCode", -1);
-                results.put("resultMessage", "未查询到缴费明细记录");
+                results.put("resultMessage", "未查询到缴费明细记录");
                 return results;
             }
             mzChargeDetailList = mzChargeDetailService.getMzChargeDetails(mzChargeDetailList);
@@ -1923,9 +1884,6 @@ public class MedicalViewApiController {
     }
 
 
-
-
-
     /**
      * 门诊缴费订单支付(单病种)
      *
@@ -1956,7 +1914,7 @@ public class MedicalViewApiController {
             return results;
         }
         try {
-            MzDepositFile mzDepositFile =new MzDepositFile();
+            MzDepositFile mzDepositFile = new MzDepositFile();
             mzDepositFile.setChequeType(Constants.YBJZ);
             mzDepositFileVo.setMzDepositFiles(Arrays.asList(mzDepositFile));
             mzChargeDetailService.chargeFee(Constants.DBZJF_CODE, mzDepositFileVo);
@@ -1993,7 +1951,7 @@ public class MedicalViewApiController {
             results.put("resultMessage", "患者ID不能为空");
             return results;
         }
-        if (mzChargeDetail.getTimes()==null) {
+        if (mzChargeDetail.getTimes() == null) {
             results.put("resultCode", -1);
             results.put("resultMessage", "病人就诊次数不能为空");
             return results;

+ 6 - 2
src/main/java/cn/hnthyy/thmz/service/impl/thmz/ScheduleOfMedicalServiceImpl.java

@@ -25,6 +25,7 @@ import cn.hnthyy.thmz.service.thmz.MessageService;
 import cn.hnthyy.thmz.service.thmz.ScheduleOfMedicalService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Propagation;
@@ -61,7 +62,9 @@ public class ScheduleOfMedicalServiceImpl implements ScheduleOfMedicalService {
     private MzPatientMiService mzPatientMiService;
     @Autowired
     private HaiCiAdapterService haiCiAdapterService;
-
+    //医技预约审核驳回回调地址
+    @Value("${callBackYJYYUrl}")
+    private String callBackYJYYUrl;
     @Override
     @Transactional(value = "thmzTransactionManager", propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
     public int saveScheduleOfMedical(ScheduleOfMedical scheduleOfMedical,Long userId) throws MzException {
@@ -233,7 +236,8 @@ public class ScheduleOfMedicalServiceImpl implements ScheduleOfMedicalService {
                 if(StringUtils.isNotBlank(dbScheduleOfMedical.getJcxm())){
                     jcxm = dbScheduleOfMedical.getJcxm()+"预约申请失败通知";
                 }
-                haiCiAdapterService.commonMessageNotice(mzPatientMi.getIcCardNo(), "{\"data\":{\"first\":{\"color\":\"#FF0000\",\"value\":\""+first+"\"},\"keyword1\":{\"color\":\"#173177\",\"value\":\"" + jcxm + "\"},\"keyword2\":{\"color\":\"#173177\",\"value\":\""+mzPatientMi.getName()+"\"}},\"remark\":{\"color\":\"#FF0000\",\"value\":\"感谢你的使用!\"},\"miniprogram\":{\"appid\":\"\",\"pagepath\":\"\"},\"template_id\":\"mFlPZb1ohuxZXjJ75F83gd1lKPyaZjMb_RedHJmOkZM\",\"touser\":\"\",\"url\":\"\"}", new Date());
+                String url = callBackYJYYUrl+reqNo+"&response_type=code&scope=snsapi_base&state=1#wechat_redirect";
+                haiCiAdapterService.commonMessageNotice(mzPatientMi.getIcCardNo(), "{\"data\":{\"first\":{\"color\":\"#FF0000\",\"value\":\""+first+"\"},\"keyword1\":{\"color\":\"#173177\",\"value\":\"" + jcxm + "\"},\"keyword2\":{\"color\":\"#173177\",\"value\":\""+mzPatientMi.getName()+"\"}},\"remark\":{\"color\":\"#FF0000\",\"value\":\"感谢你的使用!\"},\"miniprogram\":{\"appid\":\"\",\"pagepath\":\"\"},\"template_id\":\"mFlPZb1ohuxZXjJ75F83gd1lKPyaZjMb_RedHJmOkZM\",\"touser\":\"\",\"url\":\""+url+"\"}", new Date());
                 haiCiAdapterService.rejectCallbackScheduleOfMedical(reqNo);
             }
             return num;

+ 3 - 0
src/main/resources/application-dev.yml

@@ -120,3 +120,6 @@ tsmzServiceUrl: "http://172.16.30.27:8704/shengyb/mt"
 
 #流行病调查问卷测试地址
 lxbdcwjUrl: "http://192.168.3.20:8081/assessments/covid/"
+
+#医技预约审核驳回回调地址
+callBackYJYYUrl: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxbde6b16acad84204&redirect_uri=http://172.16.30.26:8805/wxserver/redirect/page2?to=resignOrRefund_"

+ 4 - 1
src/main/resources/application-prod.yml

@@ -120,4 +120,7 @@ wxPayOrderServiceUrl: "http://webhis.thyy.cn:8706"
 tsmzServiceUrl: "http://webhis.thyy.cn:8706/markMtFees"
 
 #流行病调查问卷生产地址
-lxbdcwjUrl: "http://csth.hnthhz.com:8083/assessments/covid/"
+lxbdcwjUrl: "http://csth.hnthhz.com:8083/assessments/covid/"
+
+#医技预约审核驳回回调地址
+callBackYJYYUrl: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxbde6b16acad84204&redirect_uri=http://staticweb.hnthyy.cn/wxserver/redirect/page2?to=resignOrRefund_"