|
@ -3,6 +3,7 @@ package com.yihu.jw.wechat.service;
|
|
import com.yihu.jw.entity.base.wx.JsApiTicket;
|
|
import com.yihu.jw.entity.base.wx.JsApiTicket;
|
|
import com.yihu.jw.entity.base.wx.WxWechatDO;
|
|
import com.yihu.jw.entity.base.wx.WxWechatDO;
|
|
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
|
|
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
|
|
|
|
import com.yihu.jw.hospital.prescription.service.entrance.TnyyEntranceService;
|
|
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
|
|
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
|
|
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
|
|
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
|
|
import com.yihu.jw.wechat.dao.WechatDao;
|
|
import com.yihu.jw.wechat.dao.WechatDao;
|
|
@ -22,6 +23,8 @@ public class WechatInfoService {
|
|
private EntranceService entranceService;
|
|
private EntranceService entranceService;
|
|
@Autowired
|
|
@Autowired
|
|
private XzzxEntranceService xzzxEntranceService;
|
|
private XzzxEntranceService xzzxEntranceService;
|
|
|
|
@Autowired
|
|
|
|
private TnyyEntranceService tnyyEntranceService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 通过code获取判断openid
|
|
* 通过code获取判断openid
|
|
@ -66,7 +69,7 @@ public class WechatInfoService {
|
|
WxWechatDO wxWechat = null;
|
|
WxWechatDO wxWechat = null;
|
|
|
|
|
|
//中山医院互联网医院
|
|
//中山医院互联网医院
|
|
if("xm_zsyy_wx".equals(wxId) || "xm_xzzx_wx".equals(wxId) || "xm_ykyy_wx".equals(wxId)){
|
|
|
|
|
|
if("xm_zsyy_wx".equals(wxId) || "xm_xzzx_wx".equals(wxId) || "xm_ykyy_wx".equals(wxId)||"sd_tnzyy_wx".equals(wxId)){
|
|
jsapiTickets = wxAccessTokenService.findJsapiTicket(wxId);
|
|
jsapiTickets = wxAccessTokenService.findJsapiTicket(wxId);
|
|
}else{
|
|
}else{
|
|
wxWechat = wxAccessTokenService.getWxInfo(wxId);
|
|
wxWechat = wxAccessTokenService.getWxInfo(wxId);
|
|
@ -97,6 +100,15 @@ public class WechatInfoService {
|
|
|
|
|
|
}else if("xm_xzzx_wx".equals(wxId)){
|
|
}else if("xm_xzzx_wx".equals(wxId)){
|
|
token = xzzxEntranceService.getXzToken();
|
|
token = xzzxEntranceService.getXzToken();
|
|
|
|
}else if("xm_xzzx_wx".equals(wxId)){
|
|
|
|
token = xzzxEntranceService.getXzToken();
|
|
|
|
}else if("sd_tnzyy_wx".equals(wxId)){
|
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = tnyyEntranceService.getAccessToken();
|
|
|
|
if (jsonObject.getString("ResultCode")!=null&&jsonObject.getString("ResultCode").equalsIgnoreCase("0")){
|
|
|
|
token = jsonObject.getString("AccessToken");
|
|
|
|
}else {
|
|
|
|
throw new Exception("获取ACCESSTOKEN失败");
|
|
|
|
}
|
|
}else{
|
|
}else{
|
|
token = wxAccessTokenService.getWxAccessTokenById(wxId).getAccessToken();
|
|
token = wxAccessTokenService.getWxAccessTokenById(wxId).getAccessToken();
|
|
}
|
|
}
|
|
@ -114,7 +126,7 @@ public class WechatInfoService {
|
|
JsApiTicket newJsApiTicket = new JsApiTicket();
|
|
JsApiTicket newJsApiTicket = new JsApiTicket();
|
|
newJsApiTicket.setJsapi_ticket(ticket);
|
|
newJsApiTicket.setJsapi_ticket(ticket);
|
|
newJsApiTicket.setExpires_in(Long.parseLong(expires_in));
|
|
newJsApiTicket.setExpires_in(Long.parseLong(expires_in));
|
|
if("xm_zsyy_wx".equals(wxId) || "xm_xzzx_wx".equals(wxId) || "xm_ykyy_wx".equals(wxId)){
|
|
|
|
|
|
if("xm_zsyy_wx".equals(wxId) || "xm_xzzx_wx".equals(wxId) || "xm_ykyy_wx".equals(wxId)||"sd_tnzyy_wx".equals(wxId)){
|
|
newJsApiTicket.setAcc_id(wxId);
|
|
newJsApiTicket.setAcc_id(wxId);
|
|
}else{
|
|
}else{
|
|
newJsApiTicket.setAcc_id(wxWechat.getAppOriginId());
|
|
newJsApiTicket.setAcc_id(wxWechat.getAppOriginId());
|