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
1a852660
Commit
1a852660
authored
May 06, 2020
by
zhangzc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改token校验
完善司机接口
parent
d6c384a1
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
152 additions
and
141 deletions
+152
-141
CheckCustomToken.java
...a/com/esv/freight/app/common/filter/CheckCustomToken.java
+9
-0
DriverInterface.java
src/main/java/com/esv/freight/app/feign/DriverInterface.java
+2
-2
DriverAccountController.java
...pp/module/account/controller/DriverAccountController.java
+5
-12
DriverPasswordController.java
...p/module/account/controller/DriverPasswordController.java
+85
-3
OwnerAccountController.java
...app/module/account/controller/OwnerAccountController.java
+2
-8
OwnerPasswordController.java
...pp/module/account/controller/OwnerPasswordController.java
+1
-4
LoginForm.java
...va/com/esv/freight/app/module/account/form/LoginForm.java
+4
-8
AppLoginService.java
...v/freight/app/module/account/service/AppLoginService.java
+1
-1
AppLoginImpl.java
...freight/app/module/account/service/impl/AppLoginImpl.java
+17
-6
DeliveryAddressController.java
.../module/address/controller/DeliveryAddressController.java
+5
-20
ReceiveAddressController.java
...p/module/address/controller/ReceiveAddressController.java
+5
-20
GrabController.java
...reight/app/module/grabbing/controller/GrabController.java
+3
-7
OrderController.java
.../freight/app/module/order/controller/OrderController.java
+6
-24
VehicleController.java
...ight/app/module/vehicle/controller/VehicleController.java
+4
-16
DriverWaybillController.java
...pp/module/waybill/controller/DriverWaybillController.java
+2
-6
OwnerWaybillController.java
...app/module/waybill/controller/OwnerWaybillController.java
+1
-4
No files found.
src/main/java/com/esv/freight/app/common/filter/CheckCustomToken.java
View file @
1a852660
package
com
.
esv
.
freight
.
app
.
common
.
filter
;
import
com.esv.freight.app.common.exception.EException
;
import
com.esv.freight.app.feign.CarrierInterface
;
import
com.esv.freight.app.feign.DriverInterface
;
import
com.esv.freight.app.feign.NoticeInterface
;
import
com.esv.freight.app.module.account.CustomToken
;
import
com.esv.freight.app.module.account.service.AppLoginService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.regex.Pattern
;
...
...
@@ -50,16 +55,19 @@ public class CheckCustomToken {
"/app/driverBackend/account/login/loginBySms"
.
equals
(
url
)
||
"/app/driverBackend/account/login/loginByPwd"
.
equals
(
url
)
||
"/app/driverBackend/account/carrier/list"
.
equals
(
url
)
||
"/app/driverBackend/account/login/check/phone"
.
equals
(
url
)
||
"/app/driverBackend/password/reset"
.
equals
(
url
))
{
//此类接口不校验token
return
;
}
// 检验token是否为空
if
(
StringUtils
.
isEmpty
(
customToken
.
getAccount
())
||
StringUtils
.
isEmpty
(
customToken
.
getAccessToken
())
||
StringUtils
.
isEmpty
(
customToken
.
getRefreshToken
()))
{
throw
new
EException
(
601
,
"无效的Token"
);
}
// 校验手机号格式是否正确
if
(!
isPhone
(
customToken
.
getAccount
()))
{
throw
new
EException
(
601
,
"无效的Token"
);
}
...
...
@@ -70,6 +78,7 @@ public class CheckCustomToken {
return
;
}
// 校验userId是否为空
if
(
StringUtils
.
isEmpty
(
customToken
.
getUserId
()))
{
throw
new
EException
(
601
,
"无效的Token"
);
}
...
...
src/main/java/com/esv/freight/app/feign/DriverInterface.java
View file @
1a852660
...
...
@@ -45,6 +45,6 @@ public interface DriverInterface {
* @param bodyJson
* @return
*/
@PostMapping
(
value
=
"/customer/
goodsowner/account
/edit"
)
JSONObject
updateAccountInfo
(
JSONObject
bodyJson
);
@PostMapping
(
value
=
"/customer/
carrier/driver
/edit"
)
JSONObject
edit
(
JSONObject
bodyJson
);
}
src/main/java/com/esv/freight/app/module/account/controller/DriverAccountController.java
View file @
1a852660
...
...
@@ -15,6 +15,7 @@ import com.esv.freight.app.module.account.form.LoginForm;
import
com.esv.freight.app.module.account.form.RefreshTokenForm
;
import
com.esv.freight.app.module.account.service.AppLoginService
;
import
com.esv.freight.app.module.account.validator.groups.ValidatorAccountExist
;
import
com.esv.freight.app.module.account.validator.groups.ValidatorDriverLoginBySms
;
import
com.esv.freight.app.module.account.validator.groups.ValidatorLoginByPwd
;
import
com.esv.freight.app.module.account.validator.groups.ValidatorLoginBySms
;
import
com.esv.freight.app.module.account.vo.AccountExistVO
;
...
...
@@ -65,7 +66,7 @@ public class DriverAccountController {
* createTime 2020/04/14 14:00
**/
@PostMapping
(
"/login/loginBySms"
)
public
EResponse
loginBySms
(
@RequestHeader
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorLoginBySms
.
class
)
LoginForm
loginForm
)
{
public
EResponse
loginBySms
(
@RequestHeader
@RequestBody
(
required
=
false
)
@Validated
(
Validator
Driver
LoginBySms
.
class
)
LoginForm
loginForm
)
{
// 调用通知服务验证短信接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
@@ -190,11 +191,7 @@ public class DriverAccountController {
**/
@PostMapping
(
"/detail"
)
public
EResponse
detail
()
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
String
phone
=
ReqUtils
.
getTokenInfo
().
getAccount
();
// 调用获取账号详情接口
...
...
@@ -253,18 +250,14 @@ public class DriverAccountController {
**/
@PostMapping
(
"/realNameAuth"
)
public
EResponse
realNameAuth
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorInsert
.
class
)
DriverAuthForm
driverAuthForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用编辑帐号信息接口
JSONObject
reqJson
=
new
JSONObject
();
reqJson
.
put
(
"id"
,
driverAuthForm
.
getId
());
log
.
info
(
reqJson
.
toJSONString
());
JSONObject
result
=
driverInterface
.
updateAccountInfo
(
reqJson
);
JSONObject
result
=
driverInterface
.
edit
(
reqJson
);
log
.
info
(
result
.
toJSONString
());
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
...
...
src/main/java/com/esv/freight/app/module/account/controller/DriverPasswordController.java
View file @
1a852660
package
com
.
esv
.
freight
.
app
.
module
.
account
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.esv.freight.app.common.response.ECode
;
import
com.esv.freight.app.common.response.EResponse
;
import
com.esv.freight.app.common.util.ReqUtils
;
import
com.esv.freight.app.common.validator.groups.ValidatorInsert
;
import
com.esv.freight.app.feign.CarrierInterface
;
import
com.esv.freight.app.feign.DriverInterface
;
import
com.esv.freight.app.feign.NoticeInterface
;
import
com.esv.freight.app.module.account.form.LoginForm
;
import
com.esv.freight.app.module.account.form.ModifyPasswordForm
;
...
...
@@ -29,11 +33,13 @@ public class DriverPasswordController {
private
NoticeInterface
noticeInterface
;
private
AppLoginService
appLoginService
;
private
DriverInterface
driverInterface
;
@Autowired
public
DriverPasswordController
(
NoticeInterface
noticeInterface
,
AppLoginService
appLoginService
)
{
public
DriverPasswordController
(
DriverInterface
driverInterface
,
NoticeInterface
noticeInterface
,
AppLoginService
appLoginService
)
{
this
.
noticeInterface
=
noticeInterface
;
this
.
appLoginService
=
appLoginService
;
this
.
driverInterface
=
driverInterface
;
}
/**
...
...
@@ -46,7 +52,49 @@ public class DriverPasswordController {
@PostMapping
(
"/reset"
)
public
EResponse
reset
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorInsert
.
class
)
LoginForm
loginForm
)
{
return
EResponse
.
error
(
1001
,
"短信验证码错误或已失效"
);
// 调用查询帐号详情接口
JSONObject
reqJson
=
new
JSONObject
();
reqJson
.
put
(
"account"
,
loginForm
.
getPhone
());
log
.
info
(
reqJson
.
toJSONString
());
JSONObject
result
=
driverInterface
.
getDetailByAccount
(
reqJson
);
log
.
info
(
result
.
toJSONString
());
if
(
result
.
getInteger
(
"code"
)
==
1001
)
{
return
EResponse
.
error
(
1001
,
"手机号未注册"
);
}
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
}
Long
id
=
result
.
getJSONObject
(
"data"
).
getLong
(
"id"
);
// 调用通知服务验证短信接口
reqJson
.
clear
();
reqJson
.
put
(
"phone"
,
loginForm
.
getPhone
());
reqJson
.
put
(
"type"
,
"reset_pwd"
);
reqJson
.
put
(
"captcha"
,
loginForm
.
getSmsCode
());
log
.
info
(
reqJson
.
toJSONString
());
result
=
noticeInterface
.
checkSmsCaptcha
(
reqJson
);
log
.
info
(
result
.
toJSONString
());
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
}
// 调用编辑帐号信息接口
reqJson
.
clear
();
reqJson
.
put
(
"id"
,
id
);
reqJson
.
put
(
"password"
,
loginForm
.
getPwd
());
log
.
info
(
reqJson
.
toJSONString
());
result
=
driverInterface
.
edit
(
reqJson
);
log
.
info
(
result
.
toJSONString
());
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
}
return
EResponse
.
ok
();
}
/**
...
...
@@ -57,7 +105,41 @@ public class DriverPasswordController {
* createTime 2020/04/14 16:00
**/
@PostMapping
(
"/edit"
)
public
EResponse
edit
(
@RequestHeader
(
"Union-Authorization"
)
String
accessToken
,
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorInsert
.
class
)
ModifyPasswordForm
modifyPasswordFrom
)
{
public
EResponse
edit
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorInsert
.
class
)
ModifyPasswordForm
modifyPasswordFrom
)
{
appLoginService
.
checkAccessToken
();
String
phone
=
ReqUtils
.
getTokenInfo
().
getAccount
();
// 调用帐号密码校验接口
JSONObject
reqJson
=
new
JSONObject
();
reqJson
.
put
(
"account"
,
phone
);
reqJson
.
put
(
"password"
,
modifyPasswordFrom
.
getOldPwd
());
log
.
info
(
reqJson
.
toJSONString
());
JSONObject
result
=
driverInterface
.
accountCheck
(
reqJson
);
log
.
info
(
result
.
toJSONString
());
if
(
result
.
getInteger
(
"code"
)
==
1002
)
{
return
EResponse
.
error
(
1001
,
"原密码错误"
);
}
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
}
Long
id
=
result
.
getJSONObject
(
"data"
).
getLong
(
"id"
);
// 调用编辑帐号信息接口
reqJson
.
clear
();
reqJson
.
put
(
"id"
,
id
);
reqJson
.
put
(
"password"
,
modifyPasswordFrom
.
getNewPwd
());
log
.
info
(
reqJson
.
toJSONString
());
result
=
driverInterface
.
edit
(
reqJson
);
log
.
info
(
result
.
toJSONString
());
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
}
return
EResponse
.
ok
();
}
...
...
src/main/java/com/esv/freight/app/module/account/controller/OwnerAccountController.java
View file @
1a852660
...
...
@@ -143,10 +143,7 @@ public class OwnerAccountController {
**/
@PostMapping
(
"/detail"
)
public
EResponse
detail
()
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
String
phone
=
ReqUtils
.
getTokenInfo
().
getAccount
();
...
...
@@ -197,10 +194,7 @@ public class OwnerAccountController {
@PostMapping
(
"/realNameAuth"
)
public
EResponse
realNameAuth
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorInsert
.
class
)
OwnerAuthForm
ownerAuthForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用编辑帐号信息接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
src/main/java/com/esv/freight/app/module/account/controller/OwnerPasswordController.java
View file @
1a852660
...
...
@@ -107,10 +107,7 @@ public class OwnerPasswordController {
@PostMapping
(
"/edit"
)
public
EResponse
edit
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorInsert
.
class
)
ModifyPasswordForm
modifyPasswordFrom
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
String
phone
=
ReqUtils
.
getTokenInfo
().
getAccount
();
...
...
src/main/java/com/esv/freight/app/module/account/form/LoginForm.java
View file @
1a852660
package
com
.
esv
.
freight
.
app
.
module
.
account
.
form
;
import
com.esv.freight.app.common.validator.groups.ValidatorDelete
;
import
com.esv.freight.app.common.validator.groups.ValidatorInsert
;
import
com.esv.freight.app.common.validator.groups.ValidatorList
;
import
com.esv.freight.app.common.validator.groups.ValidatorUpdate
;
import
com.esv.freight.app.module.account.validator.groups.ValidatorAccountExist
;
import
com.esv.freight.app.module.account.validator.groups.ValidatorDriverLoginBySms
;
import
com.esv.freight.app.module.account.validator.groups.ValidatorLoginByPwd
;
...
...
@@ -30,26 +26,26 @@ public class LoginForm {
* 手机号
*/
@Length
(
min
=
11
,
max
=
11
,
message
=
"参数phone长度不合法"
,
groups
=
{
ValidatorLoginByPwd
.
class
,
ValidatorLoginBySms
.
class
,
ValidatorAccountExist
.
class
,
ValidatorDriverLoginBySms
.
class
})
@Not
Null
(
message
=
"参数phone不能为空"
,
groups
=
{
ValidatorLoginByPwd
.
class
,
ValidatorLoginBySms
.
class
,
ValidatorAccountExist
.
class
,
ValidatorDriverLoginBySms
.
class
})
@Not
Blank
(
message
=
"参数phone不能为空"
,
groups
=
{
ValidatorLoginByPwd
.
class
,
ValidatorLoginBySms
.
class
,
ValidatorAccountExist
.
class
,
ValidatorDriverLoginBySms
.
class
})
private
String
phone
;
/**
* 短信验证码
*/
@Length
(
min
=
6
,
max
=
6
,
message
=
"参数smsCode长度不合法"
,
groups
=
{
ValidatorLoginBySms
.
class
,
ValidatorDriverLoginBySms
.
class
})
@Not
Null
(
message
=
"参数smsCode不能为空"
,
groups
=
{
ValidatorLoginBySms
.
class
})
@Not
Blank
(
message
=
"参数smsCode不能为空"
,
groups
=
{
ValidatorLoginBySms
.
class
})
private
String
smsCode
;
/**
* 密码
*/
@Length
(
min
=
32
,
max
=
32
,
message
=
"参数pwd长度不合法"
,
groups
=
{
ValidatorLoginByPwd
.
class
})
@Not
Null
(
message
=
"参数pwd不能为空"
,
groups
=
{
ValidatorLoginByPwd
.
class
})
@Not
Blank
(
message
=
"参数pwd不能为空"
,
groups
=
{
ValidatorLoginByPwd
.
class
})
private
String
pwd
;
/**
* 承运商帐号ID
*/
@NotNull
(
message
=
"参数carrierId不能为空"
,
groups
=
{
ValidatorDriverLoginBySms
.
class
})
private
Stri
ng
carrierId
;
private
Lo
ng
carrierId
;
}
src/main/java/com/esv/freight/app/module/account/service/AppLoginService.java
View file @
1a852660
...
...
@@ -57,7 +57,7 @@ public interface AppLoginService extends IService<AppLoginEntity> {
* author 张志臣
* createTime 2020/04/13 16:48
**/
boolean
isInvalidAccessToken
(
String
accessToken
);
void
checkAccessToken
(
);
/**
* description 判断refreshToken是否有效
...
...
src/main/java/com/esv/freight/app/module/account/service/impl/AppLoginImpl.java
View file @
1a852660
...
...
@@ -3,11 +3,13 @@ package com.esv.freight.app.module.account.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.esv.freight.app.common.exception.EException
;
import
com.esv.freight.app.common.util.ReqUtils
;
import
com.esv.freight.app.module.account.dao.AppLoginDao
;
import
com.esv.freight.app.module.account.entity.AppLoginEntity
;
import
com.esv.freight.app.module.account.form.RefreshTokenForm
;
import
com.esv.freight.app.module.account.service.AppLoginService
;
import
com.esv.freight.app.module.account.vo.LoginVO
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.Calendar
;
...
...
@@ -122,21 +124,30 @@ public class AppLoginImpl extends ServiceImpl<AppLoginDao, AppLoginEntity> imple
}
@Override
public
boolean
isInvalidAccessToken
(
String
accessToken
)
{
public
void
checkAccessToken
()
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
String
phone
=
ReqUtils
.
getTokenInfo
().
getAccount
();
AppLoginEntity
entity
=
this
.
getAccountByAccessToken
(
accessToken
);
AppLoginEntity
entity
=
this
.
getAccountByPhone
(
phone
);
// 手机号尚未登录
if
(
entity
==
null
)
{
throw
new
EException
(
602
,
"Token已过期,请重新登录"
);
throw
new
EException
(
601
,
"无效的Token"
);
}
if
(
StringUtils
.
isEmpty
(
entity
.
getAccessToken
()))
{
throw
new
EException
(
601
,
"您的车辆信息发生变化,需要您重新登录"
);
}
if
(!
entity
.
getAccessToken
().
equals
(
accessToken
))
{
throw
new
EException
(
601
,
"您的帐号正在其他设备登录,若非本人操作,您的密码已泄漏,请修改登录密码,以保证帐号安全。"
);
}
Date
current
=
new
Date
();
Date
accessDate
=
entity
.
getAccessTokenValidTime
();
if
(
current
.
after
(
accessDate
))
{
return
true
;
throw
new
EException
(
602
,
"Token已过期"
)
;
}
return
false
;
}
@Override
...
...
src/main/java/com/esv/freight/app/module/address/controller/DeliveryAddressController.java
View file @
1a852660
...
...
@@ -54,10 +54,7 @@ public class DeliveryAddressController {
@PostMapping
(
"/list"
)
public
EResponse
list
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorList
.
class
)
AddressQueryForm
addressQueryForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用获取货主发货地址列表接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
@@ -97,10 +94,7 @@ public class DeliveryAddressController {
@PostMapping
(
"/add"
)
public
EResponse
add
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorInsert
.
class
)
DeliveryAddressForm
deliveryAddressForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用添加货主发货地址接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
@@ -133,10 +127,7 @@ public class DeliveryAddressController {
@PostMapping
(
"/edit"
)
public
EResponse
edit
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorUpdate
.
class
)
DeliveryAddressForm
deliveryAddressForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用编辑货主发货地址接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
@@ -168,10 +159,7 @@ public class DeliveryAddressController {
@PostMapping
(
"/delete"
)
public
EResponse
delete
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorDelete
.
class
)
AddressQueryForm
addressQueryForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用获取删除货主发货地址接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
@@ -195,10 +183,7 @@ public class DeliveryAddressController {
@PostMapping
(
"/detail"
)
public
EResponse
detail
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorDetail
.
class
)
DeliveryAddressForm
deliveryAddressForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用获取发货地址详情接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
src/main/java/com/esv/freight/app/module/address/controller/ReceiveAddressController.java
View file @
1a852660
...
...
@@ -56,10 +56,7 @@ public class ReceiveAddressController {
@PostMapping
(
"/list"
)
public
EResponse
list
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorList
.
class
)
AddressQueryForm
addressQueryForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用获取货主发货地址列表接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
@@ -99,10 +96,7 @@ public class ReceiveAddressController {
@PostMapping
(
"/add"
)
public
EResponse
add
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorInsert
.
class
)
ReceiveAddressForm
receiveAddressForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用添加货主发货地址接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
@@ -135,10 +129,7 @@ public class ReceiveAddressController {
@PostMapping
(
"/edit"
)
public
EResponse
edit
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorInsert
.
class
)
ReceiveAddressForm
receiveAddressForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用编辑货主发货地址接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
@@ -170,10 +161,7 @@ public class ReceiveAddressController {
@PostMapping
(
"/delete"
)
public
EResponse
delete
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorInsert
.
class
)
AddressQueryForm
addressQueryForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用获取删除货主发货地址接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
@@ -197,10 +185,7 @@ public class ReceiveAddressController {
@PostMapping
(
"/detail"
)
public
EResponse
detail
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorDetail
.
class
)
ReceiveAddressForm
receiveAddressForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用获取发货地址详情接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
src/main/java/com/esv/freight/app/module/grabbing/controller/GrabController.java
View file @
1a852660
...
...
@@ -53,11 +53,9 @@ public class GrabController {
* createTime 2020/04/24 17:00
**/
@PostMapping
(
"/find/list"
)
public
EResponse
getFindGoodsList
(
@Request
Header
(
"Union-Authorization"
)
String
accessToken
,
@Request
Body
(
required
=
false
)
@Validated
(
ValidatorList
.
class
)
OrderGrabbingQueryForm
orderGrabbingQueryForm
)
{
public
EResponse
getFindGoodsList
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorList
.
class
)
OrderGrabbingQueryForm
orderGrabbingQueryForm
)
{
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用查询抢单信息列表接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
@@ -126,9 +124,7 @@ public class GrabController {
@PostMapping
(
"/find/grab"
)
public
EResponse
grabOrder
(
@RequestHeader
(
"Union-Authorization"
)
String
accessToken
,
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorUpdate
.
class
)
OrderGrabbingQueryForm
orderGrabbingQueryForm
)
{
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用抢单接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
src/main/java/com/esv/freight/app/module/order/controller/OrderController.java
View file @
1a852660
...
...
@@ -59,10 +59,7 @@ public class OrderController {
@PostMapping
(
"/statistics/getCountByType"
)
public
EResponse
getCountByType
()
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用货主查询不同状态的订单数接口
JSONObject
result
=
tmsInterface
.
getOrderCount
();
...
...
@@ -92,10 +89,7 @@ public class OrderController {
@PostMapping
(
"/list"
)
public
EResponse
list
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorList
.
class
)
OrderQueryForm
orderQueryForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用订单列表分页查询接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
@@ -157,10 +151,7 @@ public class OrderController {
@PostMapping
(
"/add"
)
public
EResponse
add
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorInsert
.
class
)
OrderForm
orderForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用订单新增接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
@@ -203,10 +194,7 @@ public class OrderController {
@PostMapping
(
"/cancel"
)
public
EResponse
cancel
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorDetail
.
class
)
OrderQueryForm
orderQueryForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用取消订单接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
@@ -232,10 +220,7 @@ public class OrderController {
@PostMapping
(
"/detail"
)
public
EResponse
detail
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorDetail
.
class
)
OrderQueryForm
orderQueryForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用获取订单详情接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
@@ -284,10 +269,7 @@ public class OrderController {
@PostMapping
(
"/edit"
)
public
EResponse
edit
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorUpdate
.
class
)
OrderForm
orderForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用编辑订单接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
src/main/java/com/esv/freight/app/module/vehicle/controller/VehicleController.java
View file @
1a852660
...
...
@@ -60,10 +60,7 @@ public class VehicleController {
@PostMapping
(
"/add"
)
public
EResponse
add
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorInsert
.
class
)
VehicleForm
vehicleForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用新增车辆接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
@@ -126,10 +123,7 @@ public class VehicleController {
**/
@PostMapping
(
"/edit"
)
public
EResponse
edit
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorUpdate
.
class
)
VehicleForm
vehicleForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用编辑车辆接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
@@ -192,10 +186,7 @@ public class VehicleController {
**/
@PostMapping
(
"/detail"
)
public
EResponse
detail
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorUpdate
.
class
)
VehicleQueryForm
vehicleQueryForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用获取订单详情接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
@@ -267,10 +258,7 @@ public class VehicleController {
**/
@PostMapping
(
"/list"
)
public
EResponse
list
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorUpdate
.
class
)
VehicleQueryForm
vehicleQueryForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用订单列表分页查询接口
/* JSONObject reqJson = new JSONObject();
...
...
src/main/java/com/esv/freight/app/module/waybill/controller/DriverWaybillController.java
View file @
1a852660
...
...
@@ -80,9 +80,7 @@ public class DriverWaybillController {
@PostMapping
(
"/list"
)
public
EResponse
list
(
@RequestHeader
(
"Union-Authorization"
)
String
accessToken
,
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorList
.
class
)
WaybillQueryForm
waybillQueryForm
)
{
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
//TODO 调用获取运单列表接口
...
...
@@ -99,9 +97,7 @@ public class DriverWaybillController {
@PostMapping
(
"/detail"
)
public
EResponse
detail
(
@RequestHeader
(
"Union-Authorization"
)
String
accessToken
,
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorDetail
.
class
)
WaybillQueryForm
waybillQueryForm
)
{
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
//TODO 调用获取运单详情接口
...
...
src/main/java/com/esv/freight/app/module/waybill/controller/OwnerWaybillController.java
View file @
1a852660
...
...
@@ -57,10 +57,7 @@ public class OwnerWaybillController {
@PostMapping
(
"/list"
)
public
EResponse
list
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorList
.
class
)
WaybillQueryForm
waybillQueryForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
appLoginService
.
checkAccessToken
();
// 调用运单列表分页查询接口
JSONObject
reqJson
=
new
JSONObject
();
...
...
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