فهرست منبع

眼科 就诊卡支付接口完善

mengkang 4 سال پیش
والد
کامیت
688eac5bfa

+ 33 - 8
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -666,10 +666,12 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                    String price = Integer.parseInt(totalFee)/100+"";
                    if (businessOrderDO.getOrderType()==10){
                        ykyyService.upRecharge4Jkzl(seqNo,Integer.parseInt(price),0);
                        String re = ykyyService.upRecharge4Jkzl(seqNo, Integer.parseInt(price), 0);
                        logger.info("调用结果="+re);
                    }
                    if (businessOrderDO.getOrderType()==11){
                        ykyyService.upRecharge4Jkzl(seqNo,Integer.parseInt(price),1);
                        String re = ykyyService.upRecharge4Jkzl(seqNo, Integer.parseInt(price), 1);
                        logger.info("调用结果="+re);
                    }
                }
@ -1145,7 +1147,19 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
    }
    public Map yktMedicalCardTopUp(String mzhm,Double jkje,Integer type,Integer paymentType,String patientId,String wechatId){
    /**
     * 眼科就诊卡充值
     * @param mzhm
     * @param jkje
     * @param type
     * @param paymentType
     * @param patientId
     * @param wechatId
     * @param hospitalId
     * @return
     * @throws Exception
     */
    public Map yktMedicalCardTopUp(String mzhm,Double jkje,Integer type,Integer paymentType,String patientId,String wechatId,String hospitalId) throws Exception {
        BasePatientDO patientDO = patientDao.findById(patientId);
        BusinessOrderDO businessOrderDO = new BusinessOrderDO();
        businessOrderDO.setPatient(patientId);
@ -1153,34 +1167,45 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        businessOrderDO.setCreateTime(DateUtil.getNowDate());
        businessOrderDO.setOrderCategory("5");
        businessOrderDO.setDescription("眼科就诊卡充值");
        businessOrderDO.setPayPrice(jkje);
        if (paymentType==1){
            businessOrderDO.setPayType(2);
        }
        if (paymentType==2){
            businessOrderDO.setPayType(1);
        }
        businessOrderDO.setPayPrice(jkje);
        if (type==0){
            businessOrderDO.setOrderType(10);
        }
        if (type==1){
            businessOrderDO.setOrderType(11);
        }
        String rs = ykyyService.getNewSerialNumber(mzhm, jkje.intValue(), type, paymentType, patientDO.getUserId(), "");
        Map<String,Object> map=null;
        String rs = ykyyService.getNewSerialNumber(mzhm, jkje.intValue(), type, paymentType, patientDO.getUserId(), hospitalId);
        Map<String,Object> rsMap = JSONObject.parseObject(rs, Map.class);
        if ("10000".equalsIgnoreCase(JSONObject.toJSONString(rsMap.get("code")))){
            businessOrderDO.setOrderNo(JSONObject.toJSONString(rsMap.get("value")));
        }else {
            map.put("error","眼科接口调用失败");
            logger.info("error="+"眼科接口调用失败");
            return map;
        }
        businessOrderDO = businessOrderDao.save(businessOrderDO);
        List<BasePatientWechatDo> patientWechatDoList = patientWechatDao.findByWechatIdAndPatientId(wechatId, patientId);
        Map<String,Object> map=null;
        if (patientWechatDoList.isEmpty()){
            map.put("error","无opinId");
            logger.info("error="+"无opinId");
            return map;
        }
        WxWechatDO wxWechatDO = wechatDao.findById(wechatId);
        String url = wxWechatDO.getBaseUrl();
        String notifyUrl =url;
        String price = businessOrderDO.getPayPrice()*100+"";
//       map = unifiedorder(wechatId,businessOrderDO.getDescription(),price,WeChatConfig.TRADE_TYPE_JSAPI,patientWechatDoList.get(0).getOpenid(),orderNo,notifyUrl);
        map = unifiedorder(wechatId,businessOrderDO.getDescription(),price,WeChatConfig.TRADE_TYPE_JSAPI,patientWechatDoList.get(0).getOpenid(),businessOrderDO.getOrderNo(),notifyUrl);
        logger.info("success="+JSONObject.toJSONString(map));
        return map;
    }

+ 4 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -1272,9 +1272,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "paymentType", value = "1支付宝 2微信", required = true)
            @RequestParam(required = true)Integer paymentType,
            @ApiParam(name = "patientId", value = "居民Ccode", required = true)
            @RequestParam(required = true)String patientId) throws Exception {
            @RequestParam(required = true)String patientId,
            @ApiParam(name = "hospitalId", value = "医院Ccode", required = true)
            @RequestParam(required = true)String hospitalId) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",businessOrderService.yktMedicalCardTopUp(mzhm,jkje,type,paymentType,patientId,wxId));
            return ObjEnvelop.getSuccess("ok",businessOrderService.yktMedicalCardTopUp(mzhm,jkje,type,paymentType,patientId,wxId,hospitalId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }