Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
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
项目统一框架
amos-boot-biz
Commits
a37f2347
Commit
a37f2347
authored
Aug 23, 2023
by
杨阳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 登录方式更换成 平台的微信登录
2. 认证字段返回bug fixed 3. 登录权限 bug修复 4. 农户信息入库问题测试
parent
23d6dfe7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
PeasantHouseholdWxController.java
...ule/hygf/biz/controller/PeasantHouseholdWxController.java
+3
-1
PeasantHouseholdServiceImpl.java
...le/hygf/biz/service/impl/PeasantHouseholdServiceImpl.java
+0
-0
WxServiceImpl.java
...amos/boot/module/hygf/biz/service/impl/WxServiceImpl.java
+5
-2
application-dev.properties
...le-hygf-biz/src/main/resources/application-dev.properties
+4
-1
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/PeasantHouseholdWxController.java
View file @
a37f2347
...
...
@@ -19,6 +19,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -143,7 +144,7 @@ public class PeasantHouseholdWxController extends BaseController {
}
}
model
.
setProjectAddressName
(
area
.
length
()
>
2
?
area
.
substring
(
0
,
area
.
length
()
-
2
)
:
area
);
if
(
"1"
.
equals
(
model
.
getIsPermanent
()))
{
if
(
"1"
.
equals
(
model
.
getIsPermanent
())
||
"true"
.
equals
(
model
.
getIsPermanent
())
)
{
model
.
setPermanentAddress
(
model
.
getProjectAddress
());
model
.
setPermanentAddressDetail
(
model
.
getProjectAddressDetail
());
model
.
setPermanentAddressName
(
area
.
length
()
>
2
?
area
.
substring
(
0
,
area
.
length
()
-
2
)
:
area
);
...
...
@@ -203,6 +204,7 @@ public class PeasantHouseholdWxController extends BaseController {
@RequestParam
(
value
=
"width"
,
required
=
false
,
defaultValue
=
"350"
)
String
width
,
HttpServletResponse
response
)
{
AgencyUserModel
userInfo
=
getUserInfo
();
log
.
info
(
"获取区域经销商二维码, userId:{}"
,
userInfo
.
getUserId
());
String
accessToken
=
wxService
.
getAccessToken
();
// 生成二维码
String
page
=
miniprogramLoginPage
;
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/PeasantHouseholdServiceImpl.java
View file @
a37f2347
This diff is collapsed.
Click to expand it.
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/WxServiceImpl.java
View file @
a37f2347
...
...
@@ -93,14 +93,16 @@ public class WxServiceImpl implements IWxService {
StringBuffer
buildUrl
=
new
StringBuffer
();
buildUrl
.
append
(
url
).
append
(
"grant_type="
+
grant_type
).
append
(
"&appid="
+
appid
).
append
(
"&secret="
+
secret
);
try
{
log
.
info
(
"获取access_token入参 => {}"
,
buildUrl
);
String
resultStr
=
HttpUtils
.
doGet
(
buildUrl
.
toString
());
log
.
info
(
"获取access_token返回值 => {}"
,
resultStr
);
AccessTokenDto
accessToken
=
JSON
.
parseObject
(
resultStr
,
AccessTokenDto
.
class
);
if
(
accessToken
.
getErrcode
()
!=
null
&&
0
!=
accessToken
.
getErrcode
())
{
throw
new
RuntimeException
(
accessToken
.
getErrmsg
());
}
return
accessToken
;
}
catch
(
Exception
e
)
{
log
.
error
(
"
getSmallPro
token is error url:{}"
,
buildUrl
.
toString
());
log
.
error
(
"
获取access_
token is error url:{}"
,
buildUrl
.
toString
());
throw
new
RuntimeException
(
e
.
getMessage
());
}
}
...
...
@@ -121,6 +123,7 @@ public class WxServiceImpl implements IWxService {
*/
private
WechatQrCodeDTO
buildQrParam
(
String
url
,
String
access_token
,
String
scene
,
String
page
,
Long
width
,
Boolean
auto_color
,
JSONObject
line_color
,
Boolean
is_hyaline
)
{
log
.
info
(
"生成二维码入参, url=>{}, access_token=>{}, scene=>{}, page=>{},"
,
url
,
access_token
,
scene
,
page
);
WechatQrCodeDTO
smallProQrCodeVo
=
new
WechatQrCodeDTO
();
StringBuffer
buildUrl
=
new
StringBuffer
();
buildUrl
.
append
(
url
).
append
(
"access_token="
+
access_token
);
...
...
@@ -223,7 +226,7 @@ public class WxServiceImpl implements IWxService {
log
.
info
(
"微信 Code2Session, code =>{}, 结果 => {}"
,
code
,
resultStr
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
resultStr
);
if
(
jsonObject
==
null
||
jsonObject
.
getIntValue
(
"errcode"
)
!=
0
)
{
throw
new
BadRequest
(
jsonObject
.
getString
(
"errmsg"
)
);
throw
new
BadRequest
(
"微信授权失败, 请重新授权"
);
}
return
jsonObject
;
}
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/resources/application-dev.properties
View file @
a37f2347
...
...
@@ -138,9 +138,11 @@ hygfProgram.secret=3bfd098cfdac002126e728d2dbf83c0d
farmer.orgCode
=
86
farmer.sequenceNbr
=
1620981815542046722
farmer.orgNamesWithoutRole
=
farmer.roleId
=
16
78211468450885633
farmer.roleId
=
16
93559312426758146
# 配置接口授权用户
platform.access.loginId
=
hygf_platform
platform.access.password
=
AC286A35E74D2DD281EB979789DECF3A
# 测试用的经销商userid
dealer.userId
=
# 测试的时候默认密码
farmer.registerPassword
=
a123456
\ No newline at end of file
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