浏览代码

第三医院版本开发

wangzhinan 1 年之前
父节点
当前提交
324113d454

+ 41 - 29
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -1426,15 +1426,15 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
     * @param tradeType
     * @param tradeType
     * @return
     * @return
     */
     */
    public JSONObject tradeQuery(String orderNo,String tradeType) throws Exception {
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByOrderNo(orderNo);
    public JSONObject tradeQuery(String relationCode,String tradeType) throws Exception {
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(relationCode);
        String operatorId = "";
        String operatorId = "";
        String operatorName = "";
        String operatorName = "";
        if(wechatId.equalsIgnoreCase("xm_dsyy_wx")){
        if(wechatId.equalsIgnoreCase("xm_dsyy_wx")){
            operatorId = "HLWCS";
            operatorId = "HLWCS";
            operatorName = "互联网医院";
            operatorName = "互联网医院";
        }
        }
        String response = ylzPayService.tradeQuery(operatorId,operatorName,orderNo,tradeType,businessOrderDO.getRematk());
        String response = ylzPayService.tradeQuery(operatorId,operatorName,businessOrderDO.getOrderNo(),tradeType,businessOrderDO.getRematk());
        JSONObject object = JSONObject.parseObject(response);
        JSONObject object = JSONObject.parseObject(response);
        if (object.getString("respCode").equalsIgnoreCase("000000")){
        if (object.getString("respCode").equalsIgnoreCase("000000")){
            JSONObject param = object.getJSONObject("param");
            JSONObject param = object.getJSONObject("param");
@ -1675,7 +1675,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
     * @return
     * @return
     * @throws Exception
     * @throws Exception
     */
     */
    public String ylzRechargePreDs(String code,String depositType,String wechatId,String cardType,String cardNo,boolean demoFlag) throws Exception {
    public String ylzRechargePreDs(String code,String depositType,String wechatId,String cardType,String cardNo,boolean demoFlag,String appletCode) throws Exception {
        try {
        try {
            String response = null;
            String response = null;
            WxWechatDO wxWechatDO = wechatDao.findById(wechatId).get();
            WxWechatDO wxWechatDO = wechatDao.findById(wechatId).get();
@ -1718,15 +1718,19 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                businessOrderDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
                businessOrderDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
                businessOrderDO.setDepositType(depositType);
                businessOrderDO.setDepositType(depositType);
                businessOrderDao.save(businessOrderDO);
                businessOrderDao.save(businessOrderDO);
                if(depositType.equalsIgnoreCase("WX_MIN")){
                    openId = patientDO.getOpenid();
                if (StringUtils.isNotBlank(appletCode)){
                    logger.info("appletCode不为空"+appletCode);
                    Map<String,Object> objectMap = checkApplets(appletCode,wxWechatDO.getApplets(),wxWechatDO.getAppletsSecret());
                    if (objectMap!=null){
                        openId = objectMap.get("openid").toString();
                        logger.info("appletCode"+appletCode);
                        logger.info("openid"+openId);
                    }
                }else {
                }else {
                    List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wechatId,wlyyOutpatientDO.getConsumer());
                    if (patientWechatDos!=null&&patientWechatDos.size()!=0){
                        BasePatientWechatDo patientWechatDo = patientWechatDos.get(0);
                        openId = patientWechatDo.getOpenid();
                    }else {
                        throw new Exception("请关注“第三医院”公众号,点击互联网医院-在线诊室进行结算!");
                    logger.info("appletCode为空"+appletCode);
                    List<BasePatientWechatDo> patientWechatDo = patientWechatDao.findByWechatIdAndPatientId(wechatId,businessOrderDO.getPatient());
                    if (patientWechatDo!=null&&patientWechatDo.size()!=0){
                        openId = patientWechatDo.get(0).getOpenid();
                    }
                    }
                }
                }
                String price = businessOrderDO.getPayPrice().toString();
                String price = businessOrderDO.getPayPrice().toString();
@ -1808,15 +1812,19 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                businessOrderDO.setCreateTime(new Date());
                businessOrderDO.setCreateTime(new Date());
                businessOrderDO.setUpdateTime(new Date());
                businessOrderDO.setUpdateTime(new Date());
                businessOrderDao.save(businessOrderDO);
                businessOrderDao.save(businessOrderDO);
                if(depositType.equalsIgnoreCase("WX_MIN")){
                    openId = patientDO.getOpenid();
                if (StringUtils.isNotBlank(appletCode)){
                    logger.info("appletCode不为空"+appletCode);
                    Map<String,Object> objectMap = checkApplets(appletCode,wxWechatDO.getApplets(),wxWechatDO.getAppletsSecret());
                    if (objectMap!=null){
                        openId = objectMap.get("openid").toString();
                        logger.info("appletCode"+appletCode);
                        logger.info("openid"+openId);
                    }
                }else {
                }else {
                    List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wechatId,wlyyOutpatientDO.getConsumer());
                    if (patientWechatDos!=null&&patientWechatDos.size()!=0){
                        BasePatientWechatDo patientWechatDo = patientWechatDos.get(0);
                        openId = patientWechatDo.getOpenid();
                    }else {
                        throw new Exception("请关注“第三医院”公众号,点击互联网医院-在线诊室进行结算!");
                    logger.info("appletCode为空"+appletCode);
                    List<BasePatientWechatDo> patientWechatDo = patientWechatDao.findByWechatIdAndPatientId(wechatId,businessOrderDO.getPatient());
                    if (patientWechatDo!=null&&patientWechatDo.size()!=0){
                        openId = patientWechatDo.get(0).getOpenid();
                    }
                    }
                }
                }
                String price = businessOrderDO.getPayPrice().toString();
                String price = businessOrderDO.getPayPrice().toString();
@ -2046,7 +2054,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
     * @return
     * @return
     * @throws Exception
     * @throws Exception
     */
     */
    public String ylzRechargeJson(String code,String depositType,String wechatId,String cardType,String cardNo,boolean demoFlag) throws Exception {
    public String ylzRechargeJson(String code,String depositType,String wechatId,String cardType,String cardNo,boolean demoFlag,String appletCode) throws Exception {
        String response = null;
        String response = null;
        WxWechatDO wxWechatDO = wechatDao.findByIdAndStatus(wechatId);
        WxWechatDO wxWechatDO = wechatDao.findByIdAndStatus(wechatId);
        if(wxWechatDO==null){
        if(wxWechatDO==null){
@ -2131,15 +2139,19 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
            businessOrderDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
            businessOrderDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
            businessOrderDO.setDepositType(depositType);
            businessOrderDO.setDepositType(depositType);
            businessOrderDao.save(businessOrderDO);
            businessOrderDao.save(businessOrderDO);
            if(depositType.equalsIgnoreCase("WX_MIN")){
                openId = patientDO.getOpenid();
            if (StringUtils.isNotBlank(appletCode)){
                logger.info("appletCode不为空"+appletCode);
                Map<String,Object> objectMap = checkApplets(appletCode,wxWechatDO.getApplets(),wxWechatDO.getAppletsSecret());
                if (objectMap!=null){
                    openId = objectMap.get("openid").toString();
                    logger.info("appletCode"+appletCode);
                    logger.info("openid"+openId);
                }
            }else {
            }else {
                List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wechatId,wlyyOutpatientDO.getConsumer());
                if (patientWechatDos!=null&&patientWechatDos.size()!=0){
                    BasePatientWechatDo patientWechatDo = patientWechatDos.get(0);
                    openId = patientWechatDo.getOpenid();
                }else {
                    throw new Exception("请关注“第三医院”公众号,点击互联网医院-在线诊室进行结算!");
                logger.info("appletCode为空"+appletCode);
                List<BasePatientWechatDo> patientWechatDo = patientWechatDao.findByWechatIdAndPatientId(wechatId,businessOrderDO.getPatient());
                if (patientWechatDo!=null&&patientWechatDo.size()!=0){
                    openId = patientWechatDo.get(0).getOpenid();
                }
                }
            }
            }
            String price = businessOrderDO.getPayPrice().toString();
            String price = businessOrderDO.getPayPrice().toString();

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

@ -2152,8 +2152,10 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "cardType", value = "cardType", required = true)
            @ApiParam(name = "cardType", value = "cardType", required = true)
            @RequestParam(required = true) String cardType,
            @RequestParam(required = true) String cardType,
            @ApiParam(name = "cardNo", value = "cardNo", required = true)
            @ApiParam(name = "cardNo", value = "cardNo", required = true)
            @RequestParam(required = true) String cardNo) throws Exception {
        return ObjEnvelop.getSuccess("ok", businessOrderService.ylzRechargeJson(relationCode, depositType, wxId, cardType, cardNo, demoFlag));
            @RequestParam(required = true) String cardNo,
            @ApiParam(name = "appletCode", value = "appletCode", required = false)
            @RequestParam(required = false) String appletCode) throws Exception {
        return ObjEnvelop.getSuccess("ok", businessOrderService.ylzRechargeJson(relationCode, depositType, wxId, cardType, cardNo, demoFlag,appletCode));
    }
    }
    /**
    /**
@ -2173,10 +2175,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "cardType", value = "cardType", required = true)
            @ApiParam(name = "cardType", value = "cardType", required = true)
            @RequestParam(required = true) String cardType,
            @RequestParam(required = true) String cardType,
            @ApiParam(name = "cardNo", value = "cardNo", required = true)
            @ApiParam(name = "cardNo", value = "cardNo", required = true)
            @RequestParam(required = true) String cardNo) throws Exception {
            @RequestParam(required = true) String cardNo,
            @ApiParam(name = "appletCode", value = "appletCode", required = false)
            @RequestParam(required = false) String appletCode) throws Exception {
        try {
        try {
            if (wxId.equalsIgnoreCase("xm_dsyy_wx")){
            if (wxId.equalsIgnoreCase("xm_dsyy_wx")){
                return ObjEnvelop.getSuccess("ok", businessOrderService.ylzRechargePreDs(relationCode, depositType, wxId, cardType, cardNo, demoFlag));
                return ObjEnvelop.getSuccess("ok", businessOrderService.ylzRechargePreDs(relationCode, depositType, wxId, cardType, cardNo, demoFlag,appletCode));
            }else {
            }else {
                return ObjEnvelop.getSuccess("ok", businessOrderService.ylzRechargePre(relationCode, depositType, wxId, cardType, cardNo, demoFlag));
                return ObjEnvelop.getSuccess("ok", businessOrderService.ylzRechargePre(relationCode, depositType, wxId, cardType, cardNo, demoFlag));
@ -2331,10 +2335,10 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    public ObjEnvelop tradeQuery(
    public ObjEnvelop tradeQuery(
            @ApiParam(name = "tradeType", value = "交易hop.trade.recharge退款hop.trade.refund", required = true)
            @ApiParam(name = "tradeType", value = "交易hop.trade.recharge退款hop.trade.refund", required = true)
            @RequestParam(required = true) String tradeType,
            @RequestParam(required = true) String tradeType,
            @ApiParam(name = "orderNo", value = "orderNo", required = true)
            @RequestParam(required = true) String orderNo) throws Exception {
            @ApiParam(name = "relationCode", value = "relationCode", required = true)
            @RequestParam(required = true) String relationCode) throws Exception {
        try {
        try {
            return ObjEnvelop.getSuccess("ok", businessOrderService.tradeQuery(orderNo, tradeType));
            return ObjEnvelop.getSuccess("ok", businessOrderService.tradeQuery(relationCode, tradeType));
        } catch (Exception e) {
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return ObjEnvelop.getError(e.getMessage());
        }
        }