Browse Source

Merge branch 'dev' of huangwenjie/wlyy2.0 into dev

huangwenjie 5 years ago
parent
commit
e75b832408

+ 10 - 1
business/base-service/src/main/java/com/yihu/jw/wechat/service/WxAccessTokenService.java

@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.transaction.Transactional;
import java.util.*;
/**
@ -106,6 +107,15 @@ public class WxAccessTokenService extends BaseJpaService<WxAccessTokenDO, WxAcce
        }
    }
    
    /**
     * wechatId 删除无效 wechatId
     * @param wechatId
     */
    @Transactional
    public void deleteByWechatId(String wechatId){
        wxAccessTokenDao.deleteByWechatId(wechatId);
    }
    
    /**
     * 过期后删掉accesstoken,  重新获取
     * @param wechatId
@ -113,7 +123,6 @@ public class WxAccessTokenService extends BaseJpaService<WxAccessTokenDO, WxAcce
     */
    public String updateAccessToken(String wechatId){
        try {
            wxAccessTokenDao.deleteByWechatId(wechatId);
            //根据wechatCode查找出appid和appSecret
            WxWechatDO wxWechat = wechatDao.findById(wechatId);
            String token_url = "https://api.weixin.qq.com/cgi-bin/token";

+ 1 - 0
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -694,6 +694,7 @@ public class ImService {
				if("xm_zsyy_wx".equals(wechat_appid)){
					accessToken = entranceService.getAccessToken("100033");
				}else{
					wxAccessTokenService.deleteByWechatId(wechat_appid);
					accessToken = wxAccessTokenService.updateAccessToken(wechat_appid);
					is = getInputStreamReLoad(mediaId,wechat_appid,accessToken);
					return is;

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -235,7 +235,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
		//处理语音文件
		if(!org.springframework.util.StringUtils.isEmpty(wechat_appid)){
			
			imService.getInputStream("1",wechat_appid);
//			imService.getInputStream("1",wechat_appid);
			
			String path = imService.fetchWxVoices(wechat_appid);
			logger.info("voice_path:"+path);