Commit f4dce490 authored by yangshuxing's avatar yangshuxing

bug修改

parent 11daef44
...@@ -135,15 +135,15 @@ ...@@ -135,15 +135,15 @@
<if test="@org.apache.commons.lang3.StringUtils@isNotBlank(param.keyword)"> <if test="@org.apache.commons.lang3.StringUtils@isNotBlank(param.keyword)">
and a.cmpt_name like concat('%',#{param.keyword},'%') and a.cmpt_name like concat('%',#{param.keyword},'%')
</if> </if>
<if test="true">
and a.cmpt_status = 2
</if>
<if test="param.type == 1"> <if test="param.type == 1">
and now() >= c.openTime and c.deadLine >= now() and now() >= c.openTime and c.deadLine >= now()
</if> </if>
<if test="param.userId > 0"> <if test="param.userId > 0">
and c.createUserId=#{param.userId} and c.createUserId=#{param.userId} and a.cmpt_status = 2
</if> </if>
<if test="param.userId lt 0">
and c.createUserId <![CDATA[ <> ]]> 427744 and a.cmpt_status = 2
</if>
</sql> </sql>
<update id="updateCmpt"> <update id="updateCmpt">
......
...@@ -34,15 +34,18 @@ public class WeixinInfoService { ...@@ -34,15 +34,18 @@ public class WeixinInfoService {
public JSONObject getOpenIdAndSessionKey(String code, String partnerId) { public JSONObject getOpenIdAndSessionKey(String code, String partnerId) {
try { try {
Partner parnter= cmptMapper.getParnterByParnterId(partnerId); Partner parnter= cmptMapper.getParnterByParnterId(partnerId);
log.info("appid:" + parnter.getAppId() + ",secret:" + parnter.getAppSecret());
CloseableHttpClient hp = createSSLClientDefault(); CloseableHttpClient hp = createSSLClientDefault();
HttpGet hg = new HttpGet("https://api.weixin.qq.com/sns/jscode2session?appid=" + String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" +
parnter.getAppId() + "&secret=" + parnter.getAppSecret() + "&js_code=" + code + "&grant_type=authorization_code"); parnter.getAppId() + "&secret=" + parnter.getAppSecret() + "&js_code=" + code + "&grant_type=authorization_code";
HttpGet hg = new HttpGet(url);
log.info("请求路径:"+url);
CloseableHttpResponse response = hp.execute(hg); CloseableHttpResponse response = hp.execute(hg);
HttpEntity entity = response.getEntity(); HttpEntity entity = response.getEntity();
String content = EntityUtils.toString(entity, "utf-8"); String content = EntityUtils.toString(entity, "utf-8");
JSONObject json = JSON.parseObject(content); JSONObject json = JSON.parseObject(content);
log.info(content); log.info("请求路径:"+url+",返回数据:"+content);
hp.close(); hp.close();
return json; return json;
} catch (Exception e) { } catch (Exception e) {
......
...@@ -425,6 +425,7 @@ public class MicroApiController { ...@@ -425,6 +425,7 @@ public class MicroApiController {
log.info("code:" + code + ",encryptedData:" + encryptedData + ",code:" + code); log.info("code:" + code + ",encryptedData:" + encryptedData + ",code:" + code);
log.info("请求方法:" + request.getMethod()); log.info("请求方法:" + request.getMethod());
String partnerId = request.getParameter("partnerId"); String partnerId = request.getParameter("partnerId");
log.info("请求参数:"+request.getQueryString());
JSONObject json = weixinInfoService.getOpenIdAndSessionKey(code, partnerId); JSONObject json = weixinInfoService.getOpenIdAndSessionKey(code, partnerId);
String openid = null; String openid = null;
String session_key; String session_key;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment