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
5d5def06
Commit
5d5def06
authored
Apr 24, 2020
by
zhangzc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改实名认证接口
parent
e9b29999
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
188 additions
and
126 deletions
+188
-126
AuthFilter.java
...in/java/com/esv/freight/app/common/filter/AuthFilter.java
+21
-8
FileInterface.java
src/main/java/com/esv/freight/app/feign/FileInterface.java
+26
-0
OwnerAccountController.java
...app/module/account/controller/OwnerAccountController.java
+60
-30
RealNameAuthForm.java
...esv/freight/app/module/account/form/RealNameAuthForm.java
+26
-14
OwnerAccountDetailVO.java
...v/freight/app/module/account/vo/OwnerAccountDetailVO.java
+17
-5
OrderController.java
.../freight/app/module/order/controller/OrderController.java
+11
-47
OrderQueryForm.java
...com/esv/freight/app/module/order/form/OrderQueryForm.java
+2
-3
OrderListItemVO.java
.../com/esv/freight/app/module/order/vo/OrderListItemVO.java
+17
-2
OwnerWaybillController.java
...app/module/waybill/controller/OwnerWaybillController.java
+3
-17
WaybillListItemVO.java
.../esv/freight/app/module/waybill/vo/WaybillListItemVO.java
+5
-0
No files found.
src/main/java/com/esv/freight/app/common/filter/AuthFilter.java
View file @
5d5def06
...
@@ -3,6 +3,7 @@ package com.esv.freight.app.common.filter;
...
@@ -3,6 +3,7 @@ package com.esv.freight.app.common.filter;
import
com.esv.freight.app.common.response.ECode
;
import
com.esv.freight.app.common.response.ECode
;
import
com.esv.freight.app.common.response.EResponse
;
import
com.esv.freight.app.common.response.EResponse
;
import
com.esv.freight.app.common.util.AESSecretUtils
;
import
com.esv.freight.app.common.util.AESSecretUtils
;
import
com.esv.freight.app.common.wrapper.RestRequestWrapper
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
...
@@ -47,6 +48,17 @@ public class AuthFilter implements Filter {
...
@@ -47,6 +48,17 @@ public class AuthFilter implements Filter {
log
.
info
(
AESSecretUtils
.
decryptToStr
(
accessTokenTest
,
AES_KEY
));
log
.
info
(
AESSecretUtils
.
decryptToStr
(
accessTokenTest
,
AES_KEY
));
/************************ Token加解密示例 ************************/
/************************ Token加解密示例 ************************/
RestRequestWrapper
requestWrapper
=
new
RestRequestWrapper
((
HttpServletRequest
)
servletRequest
);
String
url
=
requestWrapper
.
getRequestURI
();
if
(
"/app/ownerBackend/account/login/loginByPwd"
.
equals
(
url
)
||
"/app/ownerBackend/account/login/loginBySms"
.
equals
(
url
)){
//此类接口不校验token
}
else
{
HttpServletRequest
request
=
(
HttpServletRequest
)
servletRequest
;
HttpServletRequest
request
=
(
HttpServletRequest
)
servletRequest
;
HttpServletResponse
response
=
(
HttpServletResponse
)
servletResponse
;
HttpServletResponse
response
=
(
HttpServletResponse
)
servletResponse
;
String
accessToken
=
request
.
getHeader
(
"Union-Authorization"
);
String
accessToken
=
request
.
getHeader
(
"Union-Authorization"
);
...
@@ -55,7 +67,8 @@ public class AuthFilter implements Filter {
...
@@ -55,7 +67,8 @@ public class AuthFilter implements Filter {
return
;
return
;
}
else
{
}
else
{
// 解析并校验Token
// 解析并校验Token
String
analysisToken
=
AESSecretUtils
.
decryptToStr
(
accessToken
,
AES_KEY
);
}
}
}
filterChain
.
doFilter
(
servletRequest
,
servletResponse
);
filterChain
.
doFilter
(
servletRequest
,
servletResponse
);
...
...
src/main/java/com/esv/freight/app/feign/FileInterface.java
0 → 100644
View file @
5d5def06
package
com
.
esv
.
freight
.
app
.
feign
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
/**
* @description:
* @project: Freight
* @name: com.esv.freight.app.feign.FileInterface
* @author: 张志臣
* @email: zhangzhichen@esvtek.com
* @createTime: 2020/04/17 17:48
* @version:1.0
*/
@FeignClient
(
value
=
"freight-file-service"
)
public
interface
FileInterface
{
/**
* 校验短信验证码
* @param bodyJson
* @return
*/
@PostMapping
(
value
=
"/file/upload/single"
)
JSONObject
uploadSingleFile
(
JSONObject
bodyJson
);
}
src/main/java/com/esv/freight/app/module/account/controller/OwnerAccountController.java
View file @
5d5def06
...
@@ -2,6 +2,7 @@ package com.esv.freight.app.module.account.controller;
...
@@ -2,6 +2,7 @@ package com.esv.freight.app.module.account.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.esv.freight.app.feign.DictInterface
;
import
com.esv.freight.app.feign.DictInterface
;
import
com.esv.freight.app.feign.FileInterface
;
import
com.esv.freight.app.feign.GoodsOwnerInterface
;
import
com.esv.freight.app.feign.GoodsOwnerInterface
;
import
com.esv.freight.app.feign.NoticeInterface
;
import
com.esv.freight.app.feign.NoticeInterface
;
import
com.esv.freight.app.module.account.form.*
;
import
com.esv.freight.app.module.account.form.*
;
...
@@ -37,13 +38,15 @@ public class OwnerAccountController {
...
@@ -37,13 +38,15 @@ public class OwnerAccountController {
private
NoticeInterface
noticeInterface
;
private
NoticeInterface
noticeInterface
;
private
GoodsOwnerInterface
goodsOwnerInterface
;
private
GoodsOwnerInterface
goodsOwnerInterface
;
private
AppLoginService
appLoginService
;
private
AppLoginService
appLoginService
;
private
FileInterface
fileInterface
;
@Autowired
@Autowired
public
OwnerAccountController
(
GoodsOwnerInterface
goodsOwnerInterface
,
DictInterface
dictInterface
,
NoticeInterface
noticeInterface
,
AppLoginService
appLoginService
)
{
public
OwnerAccountController
(
FileInterface
fileInterface
,
GoodsOwnerInterface
goodsOwnerInterface
,
DictInterface
dictInterface
,
NoticeInterface
noticeInterface
,
AppLoginService
appLoginService
)
{
this
.
dictInterface
=
dictInterface
;
this
.
dictInterface
=
dictInterface
;
this
.
goodsOwnerInterface
=
goodsOwnerInterface
;
this
.
goodsOwnerInterface
=
goodsOwnerInterface
;
this
.
noticeInterface
=
noticeInterface
;
this
.
noticeInterface
=
noticeInterface
;
this
.
appLoginService
=
appLoginService
;
this
.
appLoginService
=
appLoginService
;
this
.
fileInterface
=
fileInterface
;
}
}
/**
/**
...
@@ -61,9 +64,7 @@ public class OwnerAccountController {
...
@@ -61,9 +64,7 @@ public class OwnerAccountController {
reqJson
.
put
(
"phone"
,
loginForm
.
getPhone
());
reqJson
.
put
(
"phone"
,
loginForm
.
getPhone
());
reqJson
.
put
(
"type"
,
"login"
);
reqJson
.
put
(
"type"
,
"login"
);
reqJson
.
put
(
"captcha"
,
loginForm
.
getSmsCode
());
reqJson
.
put
(
"captcha"
,
loginForm
.
getSmsCode
());
log
.
info
(
reqJson
.
toJSONString
());
JSONObject
resultCheck
=
noticeInterface
.
checkSmsCaptcha
(
reqJson
);
JSONObject
resultCheck
=
noticeInterface
.
checkSmsCaptcha
(
reqJson
);
log
.
info
(
resultCheck
.
toJSONString
());
if
(
resultCheck
.
getInteger
(
"code"
)
!=
200
)
{
if
(
resultCheck
.
getInteger
(
"code"
)
!=
200
)
{
return
EResponse
.
error
(
resultCheck
.
getInteger
(
"code"
),
resultCheck
.
getString
(
"message"
));
return
EResponse
.
error
(
resultCheck
.
getInteger
(
"code"
),
resultCheck
.
getString
(
"message"
));
...
@@ -72,9 +73,7 @@ public class OwnerAccountController {
...
@@ -72,9 +73,7 @@ public class OwnerAccountController {
// 调用注册帐号接口
// 调用注册帐号接口
reqJson
.
clear
();
reqJson
.
clear
();
reqJson
.
put
(
"account"
,
loginForm
.
getPhone
());
reqJson
.
put
(
"account"
,
loginForm
.
getPhone
());
log
.
info
(
reqJson
.
toJSONString
());
JSONObject
resultRegister
=
goodsOwnerInterface
.
accountRegister
(
reqJson
);
JSONObject
resultRegister
=
goodsOwnerInterface
.
accountRegister
(
reqJson
);
log
.
info
(
resultRegister
.
toJSONString
());
// 1001表示 帐号已存在
// 1001表示 帐号已存在
if
(
resultRegister
.
getInteger
(
"code"
)
!=
200
&&
resultRegister
.
getInteger
(
"code"
)
!=
1001
)
{
if
(
resultRegister
.
getInteger
(
"code"
)
!=
200
&&
resultRegister
.
getInteger
(
"code"
)
!=
1001
)
{
...
@@ -99,9 +98,7 @@ public class OwnerAccountController {
...
@@ -99,9 +98,7 @@ public class OwnerAccountController {
JSONObject
reqJson
=
new
JSONObject
();
JSONObject
reqJson
=
new
JSONObject
();
reqJson
.
put
(
"account"
,
loginForm
.
getPhone
());
reqJson
.
put
(
"account"
,
loginForm
.
getPhone
());
reqJson
.
put
(
"password"
,
loginForm
.
getPwd
());
reqJson
.
put
(
"password"
,
loginForm
.
getPwd
());
log
.
info
(
reqJson
.
toJSONString
());
JSONObject
result
=
goodsOwnerInterface
.
checkAccountPwd
(
reqJson
);
JSONObject
result
=
goodsOwnerInterface
.
checkAccountPwd
(
reqJson
);
log
.
info
(
result
.
toJSONString
());
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
...
@@ -171,24 +168,15 @@ public class OwnerAccountController {
...
@@ -171,24 +168,15 @@ public class OwnerAccountController {
accountDetailVO
.
setSourceType
(
result
.
getJSONObject
(
"data"
).
getString
(
"sourceType"
));
accountDetailVO
.
setSourceType
(
result
.
getJSONObject
(
"data"
).
getString
(
"sourceType"
));
accountDetailVO
.
setAuditStatus
(
result
.
getJSONObject
(
"data"
).
getInteger
(
"auditStatus"
));
accountDetailVO
.
setAuditStatus
(
result
.
getJSONObject
(
"data"
).
getInteger
(
"auditStatus"
));
accountDetailVO
.
setOwnerType
(
result
.
getJSONObject
(
"data"
).
getInteger
(
"ownerType"
));
accountDetailVO
.
setOwnerType
(
result
.
getJSONObject
(
"data"
).
getInteger
(
"ownerType"
));
accountDetailVO
.
set
OwnerFullName
(
result
.
getJSONObject
(
"data"
).
getString
(
"ownerFullName
"
));
accountDetailVO
.
set
Name
(
result
.
getJSONObject
(
"data"
).
getString
(
"contactor
"
));
accountDetailVO
.
setIdCard
(
result
.
getJSONObject
(
"data"
).
getString
(
"idCard"
));
accountDetailVO
.
setIdCard
(
result
.
getJSONObject
(
"data"
).
getString
(
"idCard"
));
accountDetailVO
.
setIdCardExpireDate
(
result
.
getJSONObject
(
"data"
).
getString
(
"idCardExpireDate"
));
accountDetailVO
.
setIdCardExpireDate
(
result
.
getJSONObject
(
"data"
).
getString
(
"idCardExpireDate"
));
accountDetailVO
.
setIdCardFileFrontURL
(
result
.
getJSONObject
(
"data"
).
getString
(
"idCardFrontUrl"
));
accountDetailVO
.
setIdCardFileFrontId
(
result
.
getJSONObject
(
"data"
).
getString
(
"idCardFrontUrl"
));
accountDetailVO
.
setIdCardFileBackURL
(
result
.
getJSONObject
(
"data"
).
getString
(
"idCardBackUrl"
));
accountDetailVO
.
setIdCardFileBackId
(
result
.
getJSONObject
(
"data"
).
getString
(
"idCardBackUrl"
));
/*
accountDetailVO
.
setProvinceCode
(
result
.
getJSONObject
(
"data"
).
getString
(
"provinceCode"
));
AccountDetailVO accountDetailVO = new AccountDetailVO();
accountDetailVO
.
setCityCode
(
result
.
getJSONObject
(
"data"
).
getString
(
"cityCode"
));
accountDetailVO.setId("12345678");
accountDetailVO
.
setDistrictCode
(
result
.
getJSONObject
(
"data"
).
getString
(
"districtCode"
));
accountDetailVO.setAccount("15040196733");
accountDetailVO
.
setDetailAddress
(
result
.
getJSONObject
(
"data"
).
getString
(
"detailAddress"
));
accountDetailVO.setSourceType("2");
accountDetailVO.setAuditStatus(1);
accountDetailVO.setOwnerType(1);
accountDetailVO.setOwnerFullName("测试123");
accountDetailVO.setIdCard("210112198707070023");
accountDetailVO.setIdCardExpireDate("2030-02-05");
accountDetailVO.setIdCardFileFrontURL("1123");
accountDetailVO.setIdCardFileBackURL("4456");
*/
return
EResponse
.
ok
(
accountDetailVO
);
return
EResponse
.
ok
(
accountDetailVO
);
}
}
...
@@ -202,17 +190,59 @@ public class OwnerAccountController {
...
@@ -202,17 +190,59 @@ public class OwnerAccountController {
@PostMapping
(
"/realNameAuth"
)
@PostMapping
(
"/realNameAuth"
)
public
EResponse
realNameAuth
(
@RequestHeader
(
"Union-Authorization"
)
String
accessToken
,
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorInsert
.
class
)
RealNameAuthForm
realNameAuthForm
)
{
public
EResponse
realNameAuth
(
@RequestHeader
(
"Union-Authorization"
)
String
accessToken
,
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorInsert
.
class
)
RealNameAuthForm
realNameAuthForm
)
{
if
(
realNameAuthForm
==
null
)
{
return
EResponse
.
error
(
ECode
.
PARAM_ERROR
);
}
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
}
// TODO,Feign调用货主账号密码,目前暂时设定成功
// 调用上传单个文件接口-身份证正面
if
(
"1234qwer"
.
equals
(
realNameAuthForm
.
getIdCard
()))
{
JSONObject
reqJson
=
new
JSONObject
();
return
EResponse
.
error
(
1001
,
"身份证信息与照片不一致"
);
reqJson
.
put
(
"fileType"
,
"image"
);
reqJson
.
put
(
"fileData"
,
realNameAuthForm
.
getIdCardFileFront
());
reqJson
.
put
(
"fileName"
,
"idCardFileFront"
);
log
.
info
(
reqJson
.
toJSONString
());
JSONObject
result
=
fileInterface
.
uploadSingleFile
(
reqJson
);
log
.
info
(
result
.
toJSONString
());
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
}
String
idCardFrontId
=
String
.
valueOf
(
result
.
getJSONObject
(
"data"
).
getString
(
"id"
));
// 调用上传单个文件接口-身份证反面
reqJson
.
clear
();
reqJson
.
put
(
"fileType"
,
"image"
);
reqJson
.
put
(
"fileData"
,
realNameAuthForm
.
getIdCardFileBack
());
reqJson
.
put
(
"fileName"
,
"idCardFileBack"
);
log
.
info
(
reqJson
.
toJSONString
());
result
=
fileInterface
.
uploadSingleFile
(
reqJson
);
log
.
info
(
result
.
toJSONString
());
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
}
String
idCardBackId
=
String
.
valueOf
(
result
.
getJSONObject
(
"data"
).
getString
(
"id"
));
// 调用编辑帐号信息接口
reqJson
.
clear
();
reqJson
.
put
(
"id"
,
realNameAuthForm
.
getId
());
reqJson
.
put
(
"ownerType"
,
realNameAuthForm
.
getOwnerType
());
reqJson
.
put
(
"contactor"
,
realNameAuthForm
.
getName
());
reqJson
.
put
(
"idCard"
,
realNameAuthForm
.
getIdCard
());
reqJson
.
put
(
"idCardExpireDate"
,
realNameAuthForm
.
getIdCardExpireDate
());
reqJson
.
put
(
"idCardFrontUrl"
,
idCardFrontId
);
reqJson
.
put
(
"idCardBackUrl"
,
idCardBackId
);
reqJson
.
put
(
"detailAddress"
,
realNameAuthForm
.
getDetailAddress
());
reqJson
.
put
(
"provinceCode"
,
realNameAuthForm
.
getProvinceCode
());
reqJson
.
put
(
"cityCode"
,
realNameAuthForm
.
getCityCode
());
reqJson
.
put
(
"districtCode"
,
realNameAuthForm
.
getDistrictCode
());
log
.
info
(
reqJson
.
toJSONString
());
result
=
goodsOwnerInterface
.
updateAccountInfo
(
reqJson
);
log
.
info
(
result
.
toJSONString
());
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
}
}
return
EResponse
.
ok
();
return
EResponse
.
ok
();
...
...
src/main/java/com/esv/freight/app/module/account/form/RealNameAuthForm.java
View file @
5d5def06
...
@@ -8,7 +8,9 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
...
@@ -8,7 +8,9 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
org.hibernate.validator.constraints.Length
;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Pattern
;
/**
/**
* @description: 账号实名认证验证类
* @description: 账号实名认证验证类
...
@@ -22,67 +24,77 @@ import javax.validation.constraints.NotNull;
...
@@ -22,67 +24,77 @@ import javax.validation.constraints.NotNull;
@Data
@Data
public
class
RealNameAuthForm
{
public
class
RealNameAuthForm
{
/**
* 货主ID
*/
@NotNull
(
message
=
"参数id不能为空"
,
groups
=
{
ValidatorUpdate
.
class
})
private
Long
id
;
/**
* 货主类型:1-个人、2-企业
*/
@Pattern
(
regexp
=
"[12]"
,
message
=
"参数ownerType不合法"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
})
@NotBlank
(
message
=
"参数ownerType不能为空"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
})
private
String
ownerType
;
/**
/**
* 身份证正面图片数据
* 身份证正面图片数据
*/
*/
@Not
Null
(
message
=
"参数idCardFileFront不能为空"
)
@Not
Blank
(
message
=
"参数idCardFileFront不能为空"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
}
)
private
String
idCardFileFront
;
private
String
idCardFileFront
;
/**
/**
* 身份证背面图片数据
* 身份证背面图片数据
*/
*/
@Not
Null
(
message
=
"参数idCardFileBack不能为空"
)
@Not
Blank
(
message
=
"参数idCardFileBack不能为空"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
}
)
private
String
idCardFileBack
;
private
String
idCardFileBack
;
/**
/**
* 姓名
* 姓名
*/
*/
@
NotNull
(
message
=
"参数name不能为空"
)
@
Length
(
max
=
20
,
message
=
"参数name长度不合法"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
}
)
@
Length
(
max
=
50
,
message
=
"姓名长度不合法"
)
@
NotBlank
(
message
=
"参数name不能为空"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
}
)
private
String
name
;
private
String
name
;
/**
/**
* 身份证号码
* 身份证号码
*/
*/
@Length
(
max
=
18
,
message
=
"参数idCard长度不合法"
,
groups
=
{
ValidatorList
.
class
})
@Length
(
min
=
18
,
max
=
18
,
message
=
"参数idCard长度不合法"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
})
@Length
(
min
=
18
,
max
=
18
,
message
=
"参数idCard长度不合法"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
})
@Not
Null
(
message
=
"参数idCard不能为空"
)
@Not
Blank
(
message
=
"参数idCard不能为空"
,
groups
=
{
ValidatorInsert
.
class
}
)
private
String
idCard
;
private
String
idCard
;
/**
/**
* 身份证有效期,格式yyyy.MM.dd,或长期
* 身份证有效期,格式yyyy.MM.dd,或长期
*/
*/
@Length
(
max
=
50
,
message
=
"参数idCardExpireDate长度不合法"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
})
private
String
idCardExpireDate
;
private
String
idCardExpireDate
;
/**
/**
* 省份代码
* 省份代码
*/
*/
@Length
(
max
=
6
,
message
=
"参数provinceCode长度不合法"
,
groups
=
{
ValidatorList
.
class
})
@Length
(
min
=
6
,
max
=
6
,
message
=
"参数provinceCode长度不合法"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
})
@Length
(
min
=
6
,
max
=
6
,
message
=
"参数provinceCode长度不合法"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
})
@Not
Null
(
message
=
"参数provinceCode不能为空"
)
@Not
Blank
(
message
=
"参数provinceCode不能为空"
,
groups
=
{
ValidatorInsert
.
class
}
)
private
String
provinceCode
;
private
String
provinceCode
;
/**
/**
* 市代码
* 市代码
*/
*/
@Length
(
max
=
6
,
message
=
"参数cityCode长度不合法"
,
groups
=
{
ValidatorList
.
class
})
@Length
(
min
=
6
,
max
=
6
,
message
=
"参数cityCode长度不合法"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
})
@Length
(
min
=
6
,
max
=
6
,
message
=
"参数cityCode长度不合法"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
})
@Not
Null
(
message
=
"参数cityCode不能为空"
)
@Not
Blank
(
message
=
"参数cityCode不能为空"
,
groups
=
{
ValidatorInsert
.
class
}
)
private
String
cityCode
;
private
String
cityCode
;
/**
/**
* 区县代码
* 区县代码
*/
*/
@Length
(
max
=
6
,
message
=
"参数districtCode长度不合法"
,
groups
=
{
ValidatorList
.
class
})
@Length
(
min
=
6
,
max
=
6
,
message
=
"参数districtCode长度不合法"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
})
@Length
(
min
=
6
,
max
=
6
,
message
=
"参数districtCode长度不合法"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
})
@Not
Null
(
message
=
"参数districtCode不能为空"
)
@Not
Blank
(
message
=
"参数districtCode不能为空"
,
groups
=
{
ValidatorInsert
.
class
}
)
private
String
districtCode
;
private
String
districtCode
;
/**
/**
* 详细地址
* 详细地址
*/
*/
@
NotNull
(
message
=
"参数detailAddress不能为空"
)
@
Length
(
max
=
100
,
message
=
"参数detailAddress长度不合法"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
}
)
@
Length
(
max
=
50
,
message
=
"详细地址长度不合法"
)
@
NotBlank
(
message
=
"参数detailAddress不能为空"
,
groups
=
{
ValidatorInsert
.
class
}
)
private
String
detailAddress
;
private
String
detailAddress
;
@Override
@Override
...
...
src/main/java/com/esv/freight/app/module/account/vo/OwnerAccountDetailVO.java
View file @
5d5def06
...
@@ -30,7 +30,7 @@ public class OwnerAccountDetailVO {
...
@@ -30,7 +30,7 @@ public class OwnerAccountDetailVO {
private
Integer
ownerType
;
private
Integer
ownerType
;
// 姓名
// 姓名
private
String
ownerFullN
ame
;
private
String
n
ame
;
// 身份证号码
// 身份证号码
private
String
idCard
;
private
String
idCard
;
...
@@ -38,9 +38,21 @@ public class OwnerAccountDetailVO {
...
@@ -38,9 +38,21 @@ public class OwnerAccountDetailVO {
// 身份证有效期 格式yyyy.MM.dd,或长期
// 身份证有效期 格式yyyy.MM.dd,或长期
private
String
idCardExpireDate
;
private
String
idCardExpireDate
;
// 身份证正面图片
URL
// 身份证正面图片
ID
private
String
idCardFileFront
URL
;
private
String
idCardFileFront
Id
;
// 身份证反面图片URL
// 身份证反面图片ID
private
String
idCardFileBackURL
;
private
String
idCardFileBackId
;
// 省份代码
private
String
provinceCode
;
// 市代码
private
String
cityCode
;
// 区县代码
private
String
districtCode
;
// 详细地址
private
String
detailAddress
;
}
}
src/main/java/com/esv/freight/app/module/order/controller/OrderController.java
View file @
5d5def06
...
@@ -6,6 +6,7 @@ import com.esv.freight.app.common.response.ECode;
...
@@ -6,6 +6,7 @@ import com.esv.freight.app.common.response.ECode;
import
com.esv.freight.app.common.response.EResponse
;
import
com.esv.freight.app.common.response.EResponse
;
import
com.esv.freight.app.common.validator.groups.ValidatorDetail
;
import
com.esv.freight.app.common.validator.groups.ValidatorDetail
;
import
com.esv.freight.app.common.validator.groups.ValidatorInsert
;
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.common.validator.groups.ValidatorUpdate
;
import
com.esv.freight.app.feign.TmsInterface
;
import
com.esv.freight.app.feign.TmsInterface
;
import
com.esv.freight.app.module.account.service.AppLoginService
;
import
com.esv.freight.app.module.account.service.AppLoginService
;
...
@@ -43,47 +44,10 @@ public class OrderController {
...
@@ -43,47 +44,10 @@ public class OrderController {
private
AppLoginService
appLoginService
;
private
AppLoginService
appLoginService
;
private
TmsInterface
tmsInterface
;
private
TmsInterface
tmsInterface
;
private
OrderListVO
pageResultVerify
,
pageResultNew
,
pageResultExecute
;
/**
* description 测试数据,临时使用
* param param
* return com.esv.freight.common.response.EResponse
* author 张志臣
* createTime 2020/04/11 11:00
**/
private
void
createTestData
()
{
pageResultVerify
=
new
OrderListVO
();
List
<
OrderListItemVO
>
verifyList
=
new
ArrayList
<>();
OrderListItemVO
itemVO
=
new
OrderListItemVO
();
itemVO
.
setId
(
10056L
);
itemVO
.
setOrderNO
(
"2020042109300101"
);
itemVO
.
setOrderState
(
1
);
itemVO
.
setAuditState
(
2
);
itemVO
.
setDeliveryCity
(
"210100"
);
itemVO
.
setReceiveCity
(
"210100"
);
itemVO
.
setGoodsName
(
1101
);
itemVO
.
setGoodsTotalAmount
(
new
BigDecimal
(
26
));
itemVO
.
setGoodsUnit
(
"吨"
);
itemVO
.
setCreateTime
(
new
Date
());
itemVO
.
setRequiredReceiveTime
(
new
Date
());
itemVO
.
setRequiredDeliveryTime
(
new
Date
());
itemVO
.
setOrderSource
(
"1"
);
verifyList
.
add
(
itemVO
);
pageResultVerify
.
setPageNum
(
1L
);
pageResultVerify
.
setPageSize
(
20L
);
pageResultVerify
.
setTotal
(
1L
);
pageResultVerify
.
setRecordSize
(
1L
);
pageResultVerify
.
setRecord
(
verifyList
);
}
@Autowired
@Autowired
public
OrderController
(
TmsInterface
tmsInterface
,
AppLoginService
appLoginService
)
{
public
OrderController
(
TmsInterface
tmsInterface
,
AppLoginService
appLoginService
)
{
this
.
appLoginService
=
appLoginService
;
this
.
appLoginService
=
appLoginService
;
this
.
tmsInterface
=
tmsInterface
;
this
.
tmsInterface
=
tmsInterface
;
createTestData
();
}
}
/**
/**
...
@@ -117,7 +81,7 @@ public class OrderController {
...
@@ -117,7 +81,7 @@ public class OrderController {
* createTime 2020/04/18 11:00
* createTime 2020/04/18 11:00
**/
**/
@PostMapping
(
"/list"
)
@PostMapping
(
"/list"
)
public
EResponse
list
(
@RequestHeader
(
"Union-Authorization"
)
String
accessToken
,
@RequestBody
(
required
=
false
)
@Validated
(
Validator
Inser
t
.
class
)
OrderQueryForm
orderQueryForm
)
{
public
EResponse
list
(
@RequestHeader
(
"Union-Authorization"
)
String
accessToken
,
@RequestBody
(
required
=
false
)
@Validated
(
Validator
Lis
t
.
class
)
OrderQueryForm
orderQueryForm
)
{
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
...
@@ -128,9 +92,7 @@ public class OrderController {
...
@@ -128,9 +92,7 @@ public class OrderController {
reqJson
.
put
(
"goodsOwnerId"
,
orderQueryForm
.
getGoodsOwnerId
());
reqJson
.
put
(
"goodsOwnerId"
,
orderQueryForm
.
getGoodsOwnerId
());
reqJson
.
put
(
"pageNum"
,
orderQueryForm
.
getPageNum
());
reqJson
.
put
(
"pageNum"
,
orderQueryForm
.
getPageNum
());
reqJson
.
put
(
"pageSize"
,
orderQueryForm
.
getPageSize
());
reqJson
.
put
(
"pageSize"
,
orderQueryForm
.
getPageSize
());
if
(
orderQueryForm
.
getOrderState
()
!=
null
){
reqJson
.
put
(
"orderStateList"
,
orderQueryForm
.
getOrderStateList
());
reqJson
.
put
(
"orderState"
,
orderQueryForm
.
getOrderState
());
}
log
.
info
(
reqJson
.
toJSONString
());
log
.
info
(
reqJson
.
toJSONString
());
JSONObject
result
=
tmsInterface
.
listOrders
(
reqJson
);
JSONObject
result
=
tmsInterface
.
listOrders
(
reqJson
);
log
.
info
(
result
.
toJSONString
());
log
.
info
(
result
.
toJSONString
());
...
@@ -138,7 +100,7 @@ public class OrderController {
...
@@ -138,7 +100,7 @@ public class OrderController {
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
}
}
/*
OrderListVO
pageResultVO
=
new
OrderListVO
();
OrderListVO
pageResultVO
=
new
OrderListVO
();
JSONObject
data
=
result
.
getJSONObject
(
"data"
);
JSONObject
data
=
result
.
getJSONObject
(
"data"
);
pageResultVO
.
setPageSize
(
data
.
getLong
(
"pageSize"
));
pageResultVO
.
setPageSize
(
data
.
getLong
(
"pageSize"
));
...
@@ -154,23 +116,25 @@ public class OrderController {
...
@@ -154,23 +116,25 @@ public class OrderController {
vo
.
setId
(
object
.
getLong
(
"id"
));
vo
.
setId
(
object
.
getLong
(
"id"
));
vo
.
setOrderNO
(
object
.
getString
(
"orderNo"
));
vo
.
setOrderNO
(
object
.
getString
(
"orderNo"
));
vo
.
setOrderState
(
object
.
getInteger
(
"orderState"
));
vo
.
setOrderState
(
object
.
getInteger
(
"orderState"
));
vo.setDeliveryCity(object.getString("deliveryCity"));
vo
.
setAuditState
(
object
.
getInteger
(
"auditState"
));
vo.setReceiveCity(object.getString("receiveCity"));
vo
.
setDeliveryCityCode
(
object
.
getString
(
"deliveryCityCode"
));
vo
.
setReceiveCityCode
(
object
.
getString
(
"receiveCityCode"
));
vo
.
setBusinessType
(
object
.
getInteger
(
"businessType"
));
vo
.
setGoodsType
(
object
.
getInteger
(
"goodsType"
));
vo
.
setGoodsName
(
object
.
getInteger
(
"goodsName"
));
vo
.
setGoodsName
(
object
.
getInteger
(
"goodsName"
));
vo
.
setGoodsDetail
(
object
.
getString
(
"goodsDetail"
));
vo
.
setGoodsTotalAmount
(
object
.
getBigDecimal
(
"goodsTotalAmount"
));
vo
.
setGoodsTotalAmount
(
object
.
getBigDecimal
(
"goodsTotalAmount"
));
vo
.
setGoodsUnit
(
object
.
getString
(
"goodsUnit"
));
vo
.
setGoodsUnit
(
object
.
getString
(
"goodsUnit"
));
vo
.
setRequiredDeliveryTime
(
object
.
getDate
(
"requiredDeliveryTime"
));
vo
.
setRequiredDeliveryTime
(
object
.
getDate
(
"requiredDeliveryTime"
));
vo
.
setRequiredReceiveTime
(
object
.
getDate
(
"requiredReceiveTime"
));
vo
.
setRequiredReceiveTime
(
object
.
getDate
(
"requiredReceiveTime"
));
vo
.
setCreateTime
(
object
.
getDate
(
"createTime"
));
vo
.
setCreateTime
(
object
.
getDate
(
"createTime"
));
vo
.
setOrderSource
(
object
.
getString
(
"orderSource"
));
records
.
add
(
vo
);
records
.
add
(
vo
);
}
}
pageResultVO
.
setRecord
(
records
);
pageResultVO
.
setRecord
(
records
);
}
}
return
EResponse
.
ok
(
pageResultVO
);
return
EResponse
.
ok
(
pageResultVO
);
*/
return
EResponse
.
ok
(
pageResultVerify
);
}
}
/**
/**
...
...
src/main/java/com/esv/freight/app/module/order/form/OrderQueryForm.java
View file @
5d5def06
...
@@ -10,6 +10,7 @@ import org.hibernate.validator.constraints.Range;
...
@@ -10,6 +10,7 @@ import org.hibernate.validator.constraints.Range;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Positive
;
import
javax.validation.constraints.Positive
;
import
java.util.List
;
/**
/**
* @description: 订单列表验证类
* @description: 订单列表验证类
...
@@ -38,9 +39,7 @@ public class OrderQueryForm {
...
@@ -38,9 +39,7 @@ public class OrderQueryForm {
/**
/**
* 订单类型:1-待审核、2-已取消、3-新增、4-执行中、5-已完结
* 订单类型:1-待审核、2-已取消、3-新增、4-执行中、5-已完结
*/
*/
@Positive
(
message
=
"参数订单状态不合法"
,
groups
=
{
ValidatorList
.
class
})
private
List
<
Integer
>
orderStateList
;
@Range
(
min
=
1
,
max
=
5
,
message
=
"无效的订单状态"
,
groups
=
{
ValidatorList
.
class
})
private
Integer
orderState
;
/**
/**
* 当前页数
* 当前页数
...
...
src/main/java/com/esv/freight/app/module/order/vo/OrderListItemVO.java
View file @
5d5def06
...
@@ -40,18 +40,33 @@ public class OrderListItemVO {
...
@@ -40,18 +40,33 @@ public class OrderListItemVO {
/**
/**
* 发货城市编码
* 发货城市编码
*/
*/
private
String
deliveryCity
;
private
String
deliveryCity
Code
;
/**
/**
* 收货城市编码
* 收货城市编码
*/
*/
private
String
receiveCity
;
private
String
receiveCityCode
;
/**
* 业务类型
*/
private
Integer
businessType
;
/**
* 货物类型
*/
private
Integer
goodsType
;
/**
/**
* 货物名称编码
* 货物名称编码
*/
*/
private
Integer
goodsName
;
private
Integer
goodsName
;
/**
* 货物明细
*/
private
String
goodsDetail
;
/**
/**
* 货物订单量
* 货物订单量
*/
*/
...
...
src/main/java/com/esv/freight/app/module/waybill/controller/OwnerWaybillController.java
View file @
5d5def06
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.esv.freight.app.common.response.ECode
;
import
com.esv.freight.app.common.response.ECode
;
import
com.esv.freight.app.common.response.EResponse
;
import
com.esv.freight.app.common.response.EResponse
;
import
com.esv.freight.app.common.validator.groups.ValidatorInsert
;
import
com.esv.freight.app.common.validator.groups.ValidatorInsert
;
import
com.esv.freight.app.common.validator.groups.ValidatorList
;
import
com.esv.freight.app.feign.TmsInterface
;
import
com.esv.freight.app.feign.TmsInterface
;
import
com.esv.freight.app.module.account.service.AppLoginService
;
import
com.esv.freight.app.module.account.service.AppLoginService
;
import
com.esv.freight.app.module.order.form.OrderQueryForm
;
import
com.esv.freight.app.module.order.form.OrderQueryForm
;
...
@@ -56,6 +57,7 @@ public class OwnerWaybillController {
...
@@ -56,6 +57,7 @@ public class OwnerWaybillController {
itemVO
.
setCreateTime
(
new
Date
());
itemVO
.
setCreateTime
(
new
Date
());
itemVO
.
setRequiredReceiveTime
(
new
Date
());
itemVO
.
setRequiredReceiveTime
(
new
Date
());
itemVO
.
setRequiredDeliveryTime
(
new
Date
());
itemVO
.
setRequiredDeliveryTime
(
new
Date
());
itemVO
.
setVehicleNum
(
"辽A12345"
);
verifyList
.
add
(
itemVO
);
verifyList
.
add
(
itemVO
);
mWaybillListVO
.
setPageNum
(
1L
);
mWaybillListVO
.
setPageNum
(
1L
);
...
@@ -80,28 +82,12 @@ public class OwnerWaybillController {
...
@@ -80,28 +82,12 @@ public class OwnerWaybillController {
* createTime 2020/04/22 15:00
* createTime 2020/04/22 15:00
**/
**/
@PostMapping
(
"/list"
)
@PostMapping
(
"/list"
)
public
EResponse
list
(
@RequestHeader
(
"Union-Authorization"
)
String
accessToken
,
@RequestBody
(
required
=
false
)
@Validated
(
Validator
Inser
t
.
class
)
WaybillQueryForm
waybillQueryForm
)
{
public
EResponse
list
(
@RequestHeader
(
"Union-Authorization"
)
String
accessToken
,
@RequestBody
(
required
=
false
)
@Validated
(
Validator
Lis
t
.
class
)
WaybillQueryForm
waybillQueryForm
)
{
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
}
// 调用运单列表分页查询接口
/* JSONObject reqJson = new JSONObject();
reqJson.put("goodsOwnerId", orderQueryForm.getGoodsOwnerId());
reqJson.put("pageNum", orderQueryForm.getPageNum());
reqJson.put("pageSize", orderQueryForm.getPageSize());
if(orderQueryForm.getOrderState() != null){
reqJson.put("orderState", orderQueryForm.getOrderState());
}
log.info(reqJson.toJSONString());
JSONObject result = tmsInterface.listOrders(reqJson);
log.info(result.toJSONString());
if(result.getInteger("code") != 200) {
return EResponse.error(result.getInteger("code"), result.getString("message"));
}*/
return
EResponse
.
ok
(
mWaybillListVO
);
return
EResponse
.
ok
(
mWaybillListVO
);
}
}
}
}
src/main/java/com/esv/freight/app/module/waybill/vo/WaybillListItemVO.java
View file @
5d5def06
...
@@ -76,4 +76,9 @@ public class WaybillListItemVO {
...
@@ -76,4 +76,9 @@ public class WaybillListItemVO {
* 运单生成时间
* 运单生成时间
*/
*/
private
Date
createTime
;
private
Date
createTime
;
/**
* 执行车辆
*/
private
String
vehicleNum
;
}
}
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