Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gk
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
micro_app
gk
Commits
f4dce490
Commit
f4dce490
authored
Jun 11, 2020
by
yangshuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修改
parent
11daef44
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
CmptMapper.xml
.../com/dlbridge/jadp/plugins/cmpt/dao/mapper/CmptMapper.xml
+4
-4
WeixinInfoService.java
...dlbridge/jadp/plugins/cmpt/service/WeixinInfoService.java
+7
-4
MicroApiController.java
...om/dlbridge/jadp/plugins/cmpt/web/MicroApiController.java
+1
-0
No files found.
src/main/java/com/dlbridge/jadp/plugins/cmpt/dao/mapper/CmptMapper.xml
View file @
f4dce490
...
...
@@ -135,15 +135,15 @@
<if
test=
"@org.apache.commons.lang3.StringUtils@isNotBlank(param.keyword)"
>
and a.cmpt_name like concat('%',#{param.keyword},'%')
</if>
<if
test=
"true"
>
and a.cmpt_status = 2
</if>
<if
test=
"param.type == 1"
>
and now() >= c.openTime and c.deadLine >= now()
</if>
<if
test=
"param.userId > 0"
>
and c.createUserId=#{param.userId}
and c.createUserId=#{param.userId}
and a.cmpt_status = 2
</if>
<if
test=
"param.userId lt 0"
>
and c.createUserId
<![CDATA[ <> ]]>
427744 and a.cmpt_status = 2
</if>
</sql>
<update
id=
"updateCmpt"
>
...
...
src/main/java/com/dlbridge/jadp/plugins/cmpt/service/WeixinInfoService.java
View file @
f4dce490
...
...
@@ -34,15 +34,18 @@ public class WeixinInfoService {
public
JSONObject
getOpenIdAndSessionKey
(
String
code
,
String
partnerId
)
{
try
{
Partner
parnter
=
cmptMapper
.
getParnterByParnterId
(
partnerId
);
log
.
info
(
"appid:"
+
parnter
.
getAppId
()
+
",secret:"
+
parnter
.
getAppSecret
());
CloseableHttpClient
hp
=
createSSLClientDefault
();
HttpGet
hg
=
new
HttpGet
(
"https://api.weixin.qq.com/sns/jscode2session?appid="
+
parnter
.
getAppId
()
+
"&secret="
+
parnter
.
getAppSecret
()
+
"&js_code="
+
code
+
"&grant_type=authorization_code"
);
String
url
=
"https://api.weixin.qq.com/sns/jscode2session?appid="
+
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
);
HttpEntity
entity
=
response
.
getEntity
();
String
content
=
EntityUtils
.
toString
(
entity
,
"utf-8"
);
JSONObject
json
=
JSON
.
parseObject
(
content
);
log
.
info
(
content
);
log
.
info
(
"请求路径:"
+
url
+
",返回数据:"
+
content
);
hp
.
close
();
return
json
;
}
catch
(
Exception
e
)
{
...
...
src/main/java/com/dlbridge/jadp/plugins/cmpt/web/MicroApiController.java
View file @
f4dce490
...
...
@@ -425,6 +425,7 @@ public class MicroApiController {
log
.
info
(
"code:"
+
code
+
",encryptedData:"
+
encryptedData
+
",code:"
+
code
);
log
.
info
(
"请求方法:"
+
request
.
getMethod
());
String
partnerId
=
request
.
getParameter
(
"partnerId"
);
log
.
info
(
"请求参数:"
+
request
.
getQueryString
());
JSONObject
json
=
weixinInfoService
.
getOpenIdAndSessionKey
(
code
,
partnerId
);
String
openid
=
null
;
String
session_key
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment