Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
app-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SuperHive
back-end
app-service
Commits
c283210c
Commit
c283210c
authored
May 16, 2020
by
zhangzc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
6e0c1a2c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
16 deletions
+46
-16
TokenComponent.java
.../com/esv/freight/app/common/component/TokenComponent.java
+12
-0
AccountConstants.java
...om/esv/freight/app/common/constants/AccountConstants.java
+6
-0
DriverAccountController.java
...pp/module/account/controller/DriverAccountController.java
+15
-8
OwnerAccountController.java
...app/module/account/controller/OwnerAccountController.java
+12
-6
AppLoginServiceImpl.java
.../app/module/account/service/impl/AppLoginServiceImpl.java
+1
-2
No files found.
src/main/java/com/esv/freight/app/common/component/TokenComponent.java
View file @
c283210c
...
@@ -224,4 +224,16 @@ public class TokenComponent {
...
@@ -224,4 +224,16 @@ public class TokenComponent {
public
String
getTokenInfoCacheKey
(
String
account
,
Integer
accountType
)
{
public
String
getTokenInfoCacheKey
(
String
account
,
Integer
accountType
)
{
return
applicationName
+
"::token::"
+
accountType
+
"::"
+
account
;
return
applicationName
+
"::token::"
+
accountType
+
"::"
+
account
;
}
}
/**
* description 清除缓存Key
* param [account, accountType]
* return java.lang.String
* author Administrator
* createTime 2020/05/14 15:07
**/
public
void
cleatTokenInfoCache
(
TokenInfoPojo
tokenInfoPojo
)
{
String
key
=
getTokenInfoCacheKey
(
tokenInfoPojo
.
getAccount
(),
tokenInfoPojo
.
getAccountType
());
redisComponent
.
del
(
key
);
}
}
}
src/main/java/com/esv/freight/app/common/constants/AccountConstants.java
View file @
c283210c
...
@@ -41,4 +41,10 @@ public class AccountConstants {
...
@@ -41,4 +41,10 @@ public class AccountConstants {
public
static
final
Integer
ACCOUNT_LOGIN_MODE_PWD
=
1
;
public
static
final
Integer
ACCOUNT_LOGIN_MODE_PWD
=
1
;
public
static
final
Integer
ACCOUNT_LOGIN_MODE_SMS
=
2
;
public
static
final
Integer
ACCOUNT_LOGIN_MODE_SMS
=
2
;
/**
* 审核状态:0-待审核、1-审核成功,2-审核失败
**/
public
static
final
Integer
AUDIT_STATUS_CHECK_PENDING
=
0
;
public
static
final
Integer
AUDIT_STATUS_CHECK_SUCCESS
=
1
;
public
static
final
Integer
AUDIT_STATUS_CHECK_FAIL
=
2
;
}
}
src/main/java/com/esv/freight/app/module/account/controller/DriverAccountController.java
View file @
c283210c
...
@@ -28,6 +28,7 @@ import com.esv.freight.app.module.account.vo.CarrierInfoBriefVO;
...
@@ -28,6 +28,7 @@ import com.esv.freight.app.module.account.vo.CarrierInfoBriefVO;
import
com.esv.freight.app.module.account.vo.DriverAccountDetailVO
;
import
com.esv.freight.app.module.account.vo.DriverAccountDetailVO
;
import
com.esv.freight.app.module.account.vo.LoginVO
;
import
com.esv.freight.app.module.account.vo.LoginVO
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
...
@@ -133,11 +134,13 @@ public class DriverAccountController {
...
@@ -133,11 +134,13 @@ public class DriverAccountController {
return
FeignUtils
.
getFeignEResponse
(
result
);
return
FeignUtils
.
getFeignEResponse
(
result
);
}
}
// 校验帐号状态:1-正常、2-停用
DriverAccountInfoPojo
driverAccountInfoPojo
=
JSONObject
.
toJavaObject
(
FeignUtils
.
getFeignDataJson
(
result
),
DriverAccountInfoPojo
.
class
);
DriverAccountInfoPojo
driverAccountInfoPojo
=
JSONObject
.
toJavaObject
(
FeignUtils
.
getFeignDataJson
(
result
),
DriverAccountInfoPojo
.
class
);
if
(
AccountConstants
.
AUDIT_STATUS_CHECK_SUCCESS
.
equals
(
driverAccountInfoPojo
.
getAuditStatus
()))
{
// 校验帐号状态:1-正常、2-停用
if
(
AccountConstants
.
ACCOUNT_STATUS_BLOCK
.
equals
(
driverAccountInfoPojo
.
getAccountStatus
()))
{
if
(
AccountConstants
.
ACCOUNT_STATUS_BLOCK
.
equals
(
driverAccountInfoPojo
.
getAccountStatus
()))
{
return
EResponse
.
error
(
1003
,
"帐号已停用"
);
return
EResponse
.
error
(
1003
,
"帐号已停用"
);
}
}
}
// 登录
// 登录
driverAccountInfoPojo
.
setLoginMode
(
AccountConstants
.
ACCOUNT_LOGIN_MODE_SMS
);
driverAccountInfoPojo
.
setLoginMode
(
AccountConstants
.
ACCOUNT_LOGIN_MODE_SMS
);
...
@@ -172,11 +175,13 @@ public class DriverAccountController {
...
@@ -172,11 +175,13 @@ public class DriverAccountController {
return
FeignUtils
.
getFeignEResponse
(
result
);
return
FeignUtils
.
getFeignEResponse
(
result
);
}
}
// 2:校验帐号状态:1-正常、2-停用
DriverAccountInfoPojo
driverAccountInfoPojo
=
JSONObject
.
toJavaObject
(
FeignUtils
.
getFeignDataJson
(
result
),
DriverAccountInfoPojo
.
class
);
DriverAccountInfoPojo
driverAccountInfoPojo
=
JSONObject
.
toJavaObject
(
FeignUtils
.
getFeignDataJson
(
result
),
DriverAccountInfoPojo
.
class
);
if
(
AccountConstants
.
AUDIT_STATUS_CHECK_SUCCESS
.
equals
(
driverAccountInfoPojo
.
getAuditStatus
()))
{
// 校验帐号状态:1-正常、2-停用
if
(
AccountConstants
.
ACCOUNT_STATUS_BLOCK
.
equals
(
driverAccountInfoPojo
.
getAccountStatus
()))
{
if
(
AccountConstants
.
ACCOUNT_STATUS_BLOCK
.
equals
(
driverAccountInfoPojo
.
getAccountStatus
()))
{
return
EResponse
.
error
(
1003
,
"帐号已停用"
);
return
EResponse
.
error
(
1003
,
"帐号已停用"
);
}
}
}
// 登录
// 登录
driverAccountInfoPojo
.
setLoginMode
(
AccountConstants
.
ACCOUNT_LOGIN_MODE_PWD
);
driverAccountInfoPojo
.
setLoginMode
(
AccountConstants
.
ACCOUNT_LOGIN_MODE_PWD
);
...
@@ -269,7 +274,9 @@ public class DriverAccountController {
...
@@ -269,7 +274,9 @@ public class DriverAccountController {
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
}
}
DriverAccountDetailVO
detailVO
=
new
DriverAccountDetailVO
();
DriverAccountDetailVO
detailVO
=
JSONObject
.
toJavaObject
(
FeignUtils
.
getFeignDataJson
(
result
),
DriverAccountDetailVO
.
class
);
/*
detailVO.setId(String.valueOf(result.getJSONObject("data").getLong("id")));
detailVO.setId(String.valueOf(result.getJSONObject("data").getLong("id")));
detailVO.setCarrierId(result.getJSONObject("data").getLong("carrierId"));
detailVO.setCarrierId(result.getJSONObject("data").getLong("carrierId"));
detailVO.setCarrierName(result.getJSONObject("data").getString("carrierName"));
detailVO.setCarrierName(result.getJSONObject("data").getString("carrierName"));
...
@@ -301,7 +308,7 @@ public class DriverAccountController {
...
@@ -301,7 +308,7 @@ public class DriverAccountController {
detailVO.setCertificateVehicle(result.getJSONObject("data").getInteger("certificateVehicle"));
detailVO.setCertificateVehicle(result.getJSONObject("data").getInteger("certificateVehicle"));
detailVO.setCertificateEndDate(result.getJSONObject("data").getString("certificateEndDate"));
detailVO.setCertificateEndDate(result.getJSONObject("data").getString("certificateEndDate"));
detailVO.setCertificateNumber(result.getJSONObject("data").getString("certificateNumber"));
detailVO.setCertificateNumber(result.getJSONObject("data").getString("certificateNumber"));
detailVO
.
setCertificateUrl
(
result
.
getJSONObject
(
"data"
).
getString
(
"certificateUrl"
));
detailVO.setCertificateUrl(result.getJSONObject("data").getString("certificateUrl"));
*/
return
EResponse
.
ok
(
detailVO
);
return
EResponse
.
ok
(
detailVO
);
}
}
...
...
src/main/java/com/esv/freight/app/module/account/controller/OwnerAccountController.java
View file @
c283210c
...
@@ -121,9 +121,12 @@ public class OwnerAccountController {
...
@@ -121,9 +121,12 @@ public class OwnerAccountController {
// 校验帐号状态:1-正常、2-停用
// 校验帐号状态:1-正常、2-停用
OwnerAccountInfoPojo
ownerAccountInfoPojo
=
JSONObject
.
toJavaObject
(
FeignUtils
.
getFeignDataJson
(
result
),
OwnerAccountInfoPojo
.
class
);
OwnerAccountInfoPojo
ownerAccountInfoPojo
=
JSONObject
.
toJavaObject
(
FeignUtils
.
getFeignDataJson
(
result
),
OwnerAccountInfoPojo
.
class
);
if
(
AccountConstants
.
AUDIT_STATUS_CHECK_SUCCESS
.
equals
(
ownerAccountInfoPojo
.
getAuditStatus
()))
{
// 校验帐号状态:1-正常、2-停用
if
(
AccountConstants
.
ACCOUNT_STATUS_BLOCK
.
equals
(
ownerAccountInfoPojo
.
getAccountStatus
()))
{
if
(
AccountConstants
.
ACCOUNT_STATUS_BLOCK
.
equals
(
ownerAccountInfoPojo
.
getAccountStatus
()))
{
return
EResponse
.
error
(
1003
,
"帐号已停用"
);
return
EResponse
.
error
(
1003
,
"帐号已停用"
);
}
}
}
// 登录
// 登录
ownerAccountInfoPojo
.
setLoginMode
(
AccountConstants
.
ACCOUNT_LOGIN_MODE_SMS
);
ownerAccountInfoPojo
.
setLoginMode
(
AccountConstants
.
ACCOUNT_LOGIN_MODE_SMS
);
...
@@ -158,11 +161,14 @@ public class OwnerAccountController {
...
@@ -158,11 +161,14 @@ public class OwnerAccountController {
return
FeignUtils
.
getFeignEResponse
(
result
);
return
FeignUtils
.
getFeignEResponse
(
result
);
}
}
// 2:校验帐号状态:1-正常、2-停用
// 校验帐号状态:1-正常、2-停用
OwnerAccountInfoPojo
ownerAccountInfoPojo
=
JSONObject
.
toJavaObject
(
FeignUtils
.
getFeignDataJson
(
result
),
OwnerAccountInfoPojo
.
class
);
OwnerAccountInfoPojo
ownerAccountInfoPojo
=
JSONObject
.
toJavaObject
(
FeignUtils
.
getFeignDataJson
(
result
),
OwnerAccountInfoPojo
.
class
);
if
(
AccountConstants
.
AUDIT_STATUS_CHECK_SUCCESS
.
equals
(
ownerAccountInfoPojo
.
getAuditStatus
()))
{
// 校验帐号状态:1-正常、2-停用
if
(
AccountConstants
.
ACCOUNT_STATUS_BLOCK
.
equals
(
ownerAccountInfoPojo
.
getAccountStatus
()))
{
if
(
AccountConstants
.
ACCOUNT_STATUS_BLOCK
.
equals
(
ownerAccountInfoPojo
.
getAccountStatus
()))
{
return
EResponse
.
error
(
1003
,
"帐号已停用"
);
return
EResponse
.
error
(
1003
,
"帐号已停用"
);
}
}
}
// 登录
// 登录
ownerAccountInfoPojo
.
setLoginMode
(
AccountConstants
.
ACCOUNT_LOGIN_MODE_PWD
);
ownerAccountInfoPojo
.
setLoginMode
(
AccountConstants
.
ACCOUNT_LOGIN_MODE_PWD
);
...
...
src/main/java/com/esv/freight/app/module/account/service/impl/AppLoginServiceImpl.java
View file @
c283210c
...
@@ -137,8 +137,7 @@ public class AppLoginServiceImpl extends ServiceImpl<AppLoginDao, AppLoginEntity
...
@@ -137,8 +137,7 @@ public class AppLoginServiceImpl extends ServiceImpl<AppLoginDao, AppLoginEntity
this
.
baseMapper
.
updateById
(
appLoginEntity
);
this
.
baseMapper
.
updateById
(
appLoginEntity
);
//清缓存
//清缓存
String
key
=
tokenComponent
.
getTokenInfoCacheKey
(
tokenInfoPojo
.
getAccount
(),
tokenInfoPojo
.
getAccountType
());
tokenComponent
.
cleatTokenInfoCache
(
tokenInfoPojo
);
redisComponent
.
del
(
key
);
}
}
@Override
@Override
...
...
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