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
99ffcd77
Commit
99ffcd77
authored
Apr 29, 2020
by
zhangzc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化运单功能
parent
de4f3007
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
473 additions
and
201 deletions
+473
-201
AuthFilter.java
...in/java/com/esv/freight/app/common/filter/AuthFilter.java
+0
-5
FeignConfigure.java
src/main/java/com/esv/freight/app/config/FeignConfigure.java
+6
-5
DriverInterface.java
src/main/java/com/esv/freight/app/feign/DriverInterface.java
+50
-0
FileInterface.java
src/main/java/com/esv/freight/app/feign/FileInterface.java
+1
-1
TmsGrabInterface.java
...main/java/com/esv/freight/app/feign/TmsGrabInterface.java
+33
-0
TmsOrderInterface.java
...ain/java/com/esv/freight/app/feign/TmsOrderInterface.java
+7
-16
TmsWaybillInterface.java
...n/java/com/esv/freight/app/feign/TmsWaybillInterface.java
+58
-0
DriverAccountController.java
...pp/module/account/controller/DriverAccountController.java
+103
-23
OwnerAccountController.java
...app/module/account/controller/OwnerAccountController.java
+24
-31
DriverAuthForm.java
...m/esv/freight/app/module/account/form/DriverAuthForm.java
+25
-0
OwnerAuthForm.java
...om/esv/freight/app/module/account/form/OwnerAuthForm.java
+3
-3
DriverAccountDetailVO.java
.../freight/app/module/account/vo/DriverAccountDetailVO.java
+64
-10
GrabController.java
...reight/app/module/grabbing/controller/GrabController.java
+7
-7
OrderController.java
.../freight/app/module/order/controller/OrderController.java
+21
-12
VehicleForm.java
.../com/esv/freight/app/module/vehicle/form/VehicleForm.java
+0
-6
VehicleListItemVO.java
.../esv/freight/app/module/vehicle/vo/VehicleListItemVO.java
+2
-24
DriverWaybillController.java
...pp/module/waybill/controller/DriverWaybillController.java
+3
-5
OwnerWaybillController.java
...app/module/waybill/controller/OwnerWaybillController.java
+56
-37
WaybillQueryForm.java
...esv/freight/app/module/waybill/form/WaybillQueryForm.java
+3
-4
WaybillListItemVO.java
.../esv/freight/app/module/waybill/vo/WaybillListItemVO.java
+7
-12
No files found.
src/main/java/com/esv/freight/app/common/filter/AuthFilter.java
View file @
99ffcd77
...
...
@@ -86,11 +86,6 @@ public class AuthFilter implements Filter {
String
url
=
requestWrapper
.
getRequestURI
();
CheckCustomToken
.
check
(
customToken
,
url
);
request
.
setAttribute
(
"tokenInfo"
,
customToken
);
// TODO 如果租户ID正确,进行设置操作,网关请求头
String
userId
=
customToken
.
getUserId
();
// TODO 将userId进行设置操作,网关请求头
filterChain
.
doFilter
(
servletRequest
,
servletResponse
);
}
...
...
src/main/java/com/esv/freight/app/config/FeignConfigure.java
View file @
99ffcd77
package
com
.
esv
.
freight
.
app
.
config
;
import
com.esv.freight.app.common.util.ReqUtils
;
import
com.esv.freight.app.module.account.CustomToken
;
import
com.esv.gateway.common.GatewayHeaders
;
import
feign.RequestInterceptor
;
import
org.slf4j.MDC
;
...
...
@@ -38,16 +39,16 @@ public class FeignConfigure {
RequestInterceptor
requestInterceptor
=
((
requestTemplate
->
{
requestTemplate
.
header
(
"trace_id"
,
MDC
.
get
(
"traceId"
));
requestTemplate
.
header
(
"application_name"
,
applicationName
);
requestTemplate
.
header
(
"Source-Type"
,
"
2
"
);
requestTemplate
.
header
(
"Source-Type"
,
"
4
"
);
requestTemplate
.
header
(
"esv_data_perm"
,
"0"
);
requestTemplate
.
header
(
"esv_tenant"
,
"1"
);
requestTemplate
.
header
(
"gateway_traceid"
,
"1"
);
requestTemplate
.
header
(
"esv_system"
,
"app"
);
requestTemplate
.
header
(
"esv_tenant"
,
"2"
);
requestTemplate
.
header
(
"esv_department"
,
"5"
);
requestTemplate
.
header
(
"esv_department_children"
,
"5,6,7"
);
requestTemplate
.
header
(
"esv_user"
,
"1"
);
requestTemplate
.
header
(
"esv_account"
,
"18524431581"
);
CustomToken
customToken
=
ReqUtils
.
getTokenInfo
();
requestTemplate
.
header
(
"esv_user"
,
customToken
.
getUserId
());
requestTemplate
.
header
(
"esv_account"
,
customToken
.
getAccount
());
requestTemplate
.
header
(
"esv_tenant"
,
String
.
valueOf
(
customToken
.
getTenantId
()));
}));
return
requestInterceptor
;
}
...
...
src/main/java/com/esv/freight/app/feign/DriverInterface.java
0 → 100644
View file @
99ffcd77
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.DriverInterface
* @author: 张志臣
* @email: zhangzhichen@esvtek.com
* @createTime: 2020/04/28 20:00
* @version:1.0
*/
@FeignClient
(
value
=
"freight-customer-service"
)
public
interface
DriverInterface
{
/**
* 校验司机账号密码
* @param bodyJson
* @return
*/
@PostMapping
(
value
=
"/customer/carrier/driver/password/check"
)
JSONObject
checkAccountPwd
(
JSONObject
bodyJson
);
/**
* 注册司机账号
* @param bodyJson
* @return
*/
@PostMapping
(
value
=
"/customer/goodsowner/account/register"
)
JSONObject
accountRegister
(
JSONObject
bodyJson
);
/**
* 获取司机账号详情
* @param bodyJson
* @return
*/
@PostMapping
(
value
=
"/customer/goodsowner/account/detail"
)
JSONObject
getAccountDetail
(
JSONObject
bodyJson
);
/**
* 更改司机账号信息
* @param bodyJson
* @return
*/
@PostMapping
(
value
=
"/customer/goodsowner/account/edit"
)
JSONObject
updateAccountInfo
(
JSONObject
bodyJson
);
}
src/main/java/com/esv/freight/app/feign/FileInterface.java
View file @
99ffcd77
...
...
@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.PostMapping;
public
interface
FileInterface
{
/**
*
校验短信验证码
*
文件上传
* @param bodyJson
* @return
*/
...
...
src/main/java/com/esv/freight/app/feign/TmsGrabInterface.java
0 → 100644
View file @
99ffcd77
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.TmsGrabInterface
* @author: 张志臣
* @email: zhangzhichen@esvtek.com
* @createTime: 2020/04/29 10:00
* @version:1.0
*/
@FeignClient
(
value
=
"freight-tms-service"
)
public
interface
TmsGrabInterface
{
/**
* 查询抢单信息列表
* @param bodyJson
* @return
*/
@PostMapping
(
value
=
"tms/order/grabbing/list"
)
JSONObject
getOrderGrabbingList
(
JSONObject
bodyJson
);
/**
* 司机抢单
* @param bodyJson
* @return
*/
@PostMapping
(
value
=
"tms/order/grabbing/grab"
)
JSONObject
grabOrder
(
JSONObject
bodyJson
);
}
src/main/java/com/esv/freight/app/feign/TmsInterface.java
→
src/main/java/com/esv/freight/app/feign/Tms
Order
Interface.java
View file @
99ffcd77
...
...
@@ -7,14 +7,14 @@ import org.springframework.web.bind.annotation.PostMapping;
/**
* @description:
* @project: Freight
* @name: com.esv.freight.app.feign.TmsInterface
* @name: com.esv.freight.app.feign.Tms
Order
Interface
* @author: 张志臣
* @email: zhangzhichen@esvtek.com
* @createTime: 2020/04/21 10:00
* @version:1.0
*/
@FeignClient
(
value
=
"freight-tms-service"
)
public
interface
TmsInterface
{
public
interface
Tms
Order
Interface
{
/**
* 发布订单
...
...
@@ -45,8 +45,8 @@ public interface TmsInterface {
* @param bodyJson
* @return
*/
@PostMapping
(
value
=
"tms/order/edit"
)
JSONObject
editOrder
(
JSONObject
bodyJson
);
@PostMapping
(
value
=
"tms/order/edit
/owner
"
)
JSONObject
editOrder
Owner
(
JSONObject
bodyJson
);
/**
* 查询订单详情
...
...
@@ -57,18 +57,9 @@ public interface TmsInterface {
JSONObject
getOrderDetail
(
JSONObject
bodyJson
);
/**
* 查询抢单信息列表
* @param bodyJson
* @return
*/
@PostMapping
(
value
=
"tms/order/grabbing/list"
)
JSONObject
getOrderGrabbingList
(
JSONObject
bodyJson
);
/**
* 司机抢单
* @param bodyJson
* 货主查询不同状态的订单数
* @return
*/
@PostMapping
(
value
=
"tms/order/g
rabbing/grab
"
)
JSONObject
g
rabOrder
(
JSONObject
bodyJson
);
@PostMapping
(
value
=
"tms/order/g
et/count
"
)
JSONObject
g
etOrderCount
(
);
}
src/main/java/com/esv/freight/app/feign/TmsWaybillInterface.java
0 → 100644
View file @
99ffcd77
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.TmsWaybillInterface
* @author: 张志臣
* @email: zhangzhichen@esvtek.com
* @createTime: 2020/04/29 10:00
* @version:1.0
*/
@FeignClient
(
value
=
"freight-tms-service"
)
public
interface
TmsWaybillInterface
{
/**
* 运单列表
* @param bodyJson
* @return
*/
@PostMapping
(
value
=
"tms/waybill/list"
)
JSONObject
listWaybills
(
JSONObject
bodyJson
);
/**
* 运单详情
* @param bodyJson
* @return
*/
@PostMapping
(
value
=
"tms/waybill/detail"
)
JSONObject
getWaybillDetail
(
JSONObject
bodyJson
);
/**
* 上传发货单据
* @param bodyJson
* @return
*/
@PostMapping
(
value
=
"tms/waybill/delivery/evidence/upload"
)
JSONObject
uploadDeliveryEvidence
(
JSONObject
bodyJson
);
/**
* 上传收货单据
* @param bodyJson
* @return
*/
@PostMapping
(
value
=
"tms/waybill/receive/evidence/upload"
)
JSONObject
uploadReceiveEvidence
(
JSONObject
bodyJson
);
/**
* 运单签收
* @param bodyJson
* @return
*/
@PostMapping
(
value
=
"tms/waybill/sign"
)
JSONObject
sign
(
JSONObject
bodyJson
);
}
src/main/java/com/esv/freight/app/module/account/controller/DriverAccountController.java
View file @
99ffcd77
...
...
@@ -5,9 +5,12 @@ 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.D
ict
Interface
;
import
com.esv.freight.app.feign.D
river
Interface
;
import
com.esv.freight.app.feign.NoticeInterface
;
import
com.esv.freight.app.module.account.CustomToken
;
import
com.esv.freight.app.module.account.form.DriverAuthForm
;
import
com.esv.freight.app.module.account.form.LoginForm
;
import
com.esv.freight.app.module.account.form.OwnerAuthForm
;
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.ValidatorLoginByPwd
;
...
...
@@ -34,15 +37,15 @@ import org.springframework.web.bind.annotation.*;
@Validated
public
class
DriverAccountController
{
private
D
ictInterface
dict
Interface
;
private
D
riverInterface
driver
Interface
;
private
NoticeInterface
noticeInterface
;
private
AppLoginService
appLoginService
;
@Autowired
public
DriverAccountController
(
DictInterface
dictInterface
,
NoticeInterface
noticeInterface
,
AppLoginService
appLoginService
)
{
this
.
dictInterface
=
dictInterface
;
public
DriverAccountController
(
DriverInterface
driverInterface
,
NoticeInterface
noticeInterface
,
AppLoginService
appLoginService
)
{
this
.
noticeInterface
=
noticeInterface
;
this
.
appLoginService
=
appLoginService
;
this
.
appLoginService
=
appLoginService
;
}
/**
...
...
@@ -68,7 +71,15 @@ public class DriverAccountController {
return
EResponse
.
error
(
resultCheck
.
getInteger
(
"code"
),
resultCheck
.
getString
(
"message"
));
}
// todo 调用注册帐号接口,等待司机管理服务接口
// 调用注册帐号接口
reqJson
.
clear
();
reqJson
.
put
(
"account"
,
loginForm
.
getPhone
());
JSONObject
resultRegister
=
driverInterface
.
accountRegister
(
reqJson
);
// 1001表示 帐号已存在
if
(
resultRegister
.
getInteger
(
"code"
)
!=
200
&&
resultRegister
.
getInteger
(
"code"
)
!=
1001
)
{
return
EResponse
.
error
(
resultRegister
.
getInteger
(
"code"
),
resultRegister
.
getString
(
"message"
));
}
LoginVO
loginByPwdVO
=
appLoginService
.
login
(
loginForm
.
getPhone
());
return
EResponse
.
ok
(
loginByPwdVO
);
...
...
@@ -84,7 +95,15 @@ public class DriverAccountController {
@PostMapping
(
"/login/loginByPwd"
)
public
EResponse
loginByPwd
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorLoginByPwd
.
class
)
LoginForm
loginForm
)
{
// todo 调用帐号密码校验接口,等待司机管理服务接口
// 调用帐号密码校验接口
JSONObject
reqJson
=
new
JSONObject
();
reqJson
.
put
(
"account"
,
loginForm
.
getPhone
());
reqJson
.
put
(
"password"
,
loginForm
.
getPwd
());
JSONObject
result
=
driverInterface
.
checkAccountPwd
(
reqJson
);
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
}
LoginVO
loginByPwdVO
=
appLoginService
.
login
(
loginForm
.
getPhone
());
return
EResponse
.
ok
(
loginByPwdVO
);
...
...
@@ -99,8 +118,8 @@ public class DriverAccountController {
**/
@PostMapping
(
"/logout"
)
public
EResponse
logout
()
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
appLoginService
.
logout
(
accessToken
);
CustomToken
customToken
=
ReqUtils
.
getTokenInfo
();
appLoginService
.
logout
(
customToken
.
getAccessToken
()
);
return
EResponse
.
ok
();
}
...
...
@@ -114,8 +133,8 @@ public class DriverAccountController {
@PostMapping
(
"/token/refresh"
)
public
EResponse
refresh
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorInsert
.
class
)
RefreshTokenForm
refreshTokenForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
LoginVO
loginByPwdVO
=
appLoginService
.
refreshToken
(
accessToken
,
refreshTokenForm
);
CustomToken
customToken
=
ReqUtils
.
getTokenInfo
();
LoginVO
loginByPwdVO
=
appLoginService
.
refreshToken
(
customToken
.
getAccessToken
()
,
refreshTokenForm
);
return
EResponse
.
ok
(
loginByPwdVO
);
}
...
...
@@ -133,20 +152,81 @@ public class DriverAccountController {
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
String
phone
=
ReqUtils
.
getTokenInfo
().
getAccount
();
// 调用帐号密码校验接口
JSONObject
reqJsonDetail
=
new
JSONObject
();
reqJsonDetail
.
put
(
"account"
,
phone
);
log
.
info
(
reqJsonDetail
.
toJSONString
());
JSONObject
result
=
driverInterface
.
getAccountDetail
(
reqJsonDetail
);
log
.
info
(
result
.
toJSONString
());
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
}
DriverAccountDetailVO
detailVO
=
new
DriverAccountDetailVO
();
detailVO
.
setId
(
"12345678"
);
detailVO
.
setAccount
(
"15040196726"
);
detailVO
.
setAuditStatus
(
1
);
detailVO
.
setSourceType
(
"2"
);
detailVO
.
setName
(
"测试666"
);
detailVO
.
setIdCard
(
"210112198707070023"
);
detailVO
.
setIdCardExpireDate
(
"2030.02.05"
);
detailVO
.
setIdCardFileBackId
(
"111"
);
detailVO
.
setIdCardFileFrontId
(
"222"
);
detailVO
.
setProvinceCode
(
"210000"
);
detailVO
.
setCityCode
(
"210100"
);
detailVO
.
setDistrictCode
(
"210104"
);
detailVO
.
setDetailAddress
(
"惠工街206号卓展中心"
);
detailVO
.
setId
(
String
.
valueOf
(
result
.
getJSONObject
(
"data"
).
getLong
(
"id"
)));
detailVO
.
setCarrierId
(
result
.
getJSONObject
(
"data"
).
getLong
(
"carrierId"
));
detailVO
.
setAccount
(
result
.
getJSONObject
(
"data"
).
getString
(
"account"
));
detailVO
.
setSourceType
(
result
.
getJSONObject
(
"data"
).
getString
(
"sourceType"
));
detailVO
.
setAuditStatus
(
result
.
getJSONObject
(
"data"
).
getInteger
(
"auditStatus"
));
detailVO
.
setAuthenticateStatus
(
result
.
getJSONObject
(
"data"
).
getInteger
(
"authenticateStatus"
));
detailVO
.
setName
(
result
.
getJSONObject
(
"data"
).
getString
(
"name"
));
detailVO
.
setIdCard
(
result
.
getJSONObject
(
"data"
).
getString
(
"idCard"
));
detailVO
.
setIdCardExpireDate
(
result
.
getJSONObject
(
"data"
).
getString
(
"idCardExpireDate"
));
detailVO
.
setIdCardFrontUrl
(
result
.
getJSONObject
(
"data"
).
getString
(
"idCardFrontUrl"
));
detailVO
.
setIdCardBackUrl
(
result
.
getJSONObject
(
"data"
).
getString
(
"idCardBackUrl"
));
detailVO
.
setSettlementType
(
result
.
getJSONObject
(
"data"
).
getInteger
(
"settlementType"
));
detailVO
.
setSex
(
result
.
getJSONObject
(
"data"
).
getInteger
(
"sex"
));
detailVO
.
setBirthDate
(
result
.
getJSONObject
(
"data"
).
getString
(
"birthDate"
));
detailVO
.
setNation
(
result
.
getJSONObject
(
"data"
).
getString
(
"nation"
));
detailVO
.
setNativePlace
(
result
.
getJSONObject
(
"data"
).
getString
(
"nativePlace"
));
detailVO
.
setProvinceCode
(
result
.
getJSONObject
(
"data"
).
getString
(
"provinceCode"
));
detailVO
.
setCityCode
(
result
.
getJSONObject
(
"data"
).
getString
(
"cityCode"
));
detailVO
.
setDistrictCode
(
result
.
getJSONObject
(
"data"
).
getString
(
"districtCode"
));
detailVO
.
setDetailAddress
(
result
.
getJSONObject
(
"data"
).
getString
(
"detailAddress"
));
detailVO
.
setDrivingLicense
(
result
.
getJSONObject
(
"data"
).
getString
(
"drivingLicense"
));
detailVO
.
setDrivingLicenseType
(
result
.
getJSONObject
(
"data"
).
getInteger
(
"drivingLicenseType"
));
detailVO
.
setDrivingLicenseStartDate
(
result
.
getJSONObject
(
"data"
).
getString
(
"drivingLicenseStartDate"
));
detailVO
.
setDrivingLicenseEndDate
(
result
.
getJSONObject
(
"data"
).
getString
(
"drivingLicenseEndDate"
));
detailVO
.
setDrivingLicenseIssueDepartment
(
result
.
getJSONObject
(
"data"
).
getString
(
"drivingLicenseIssueDepartment"
));
detailVO
.
setDrivingLicenseInitDate
(
result
.
getJSONObject
(
"data"
).
getString
(
"drivingLicenseInitDate"
));
detailVO
.
setDrivingLicenseUrl
(
result
.
getJSONObject
(
"data"
).
getString
(
"drivingLicenseUrl"
));
detailVO
.
setCertificateVehicle
(
result
.
getJSONObject
(
"data"
).
getInteger
(
"certificateVehicle"
));
detailVO
.
setCertificateEndDate
(
result
.
getJSONObject
(
"data"
).
getString
(
"certificateEndDate"
));
detailVO
.
setCertificateNumber
(
result
.
getJSONObject
(
"data"
).
getString
(
"certificateNumber"
));
detailVO
.
setCertificateUrl
(
result
.
getJSONObject
(
"data"
).
getString
(
"certificateUrl"
));
return
EResponse
.
ok
(
detailVO
);
}
/**
* description 帐号实名认证
* param [RealNameAuthForm]
* return com.esv.freight.common.response.EResponse
* author 张志臣
* createTime 2020/04/13 10:00
**/
@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
);
}
// 调用编辑帐号信息接口
JSONObject
reqJson
=
new
JSONObject
();
reqJson
.
put
(
"id"
,
driverAuthForm
.
getId
());
log
.
info
(
reqJson
.
toJSONString
());
JSONObject
result
=
driverInterface
.
updateAccountInfo
(
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 @
99ffcd77
...
...
@@ -2,9 +2,6 @@ package com.esv.freight.app.module.account.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.esv.freight.app.common.util.ReqUtils
;
import
com.esv.freight.app.common.util.SecurityUtils
;
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.NoticeInterface
;
import
com.esv.freight.app.module.account.CustomToken
;
...
...
@@ -37,19 +34,15 @@ import org.springframework.web.bind.annotation.*;
@Validated
public
class
OwnerAccountController
{
private
DictInterface
dictInterface
;
private
NoticeInterface
noticeInterface
;
private
GoodsOwnerInterface
goodsOwnerInterface
;
private
NoticeInterface
noticeInterface
;
private
AppLoginService
appLoginService
;
private
FileInterface
fileInterface
;
@Autowired
public
OwnerAccountController
(
FileInterface
fileInterface
,
GoodsOwnerInterface
goodsOwnerInterface
,
DictInterface
dictInterface
,
NoticeInterface
noticeInterface
,
AppLoginService
appLoginService
)
{
this
.
dictInterface
=
dictInterface
;
public
OwnerAccountController
(
GoodsOwnerInterface
goodsOwnerInterface
,
NoticeInterface
noticeInterface
,
AppLoginService
appLoginService
)
{
this
.
goodsOwnerInterface
=
goodsOwnerInterface
;
this
.
noticeInterface
=
noticeInterface
;
this
.
appLoginService
=
appLoginService
;
this
.
fileInterface
=
fileInterface
;
}
/**
...
...
@@ -201,7 +194,7 @@ public class OwnerAccountController {
* createTime 2020/04/13 10:00
**/
@PostMapping
(
"/realNameAuth"
)
public
EResponse
realNameAuth
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorInsert
.
class
)
RealNameAuthForm
realName
AuthForm
)
{
public
EResponse
realNameAuth
(
@RequestBody
(
required
=
false
)
@Validated
(
ValidatorInsert
.
class
)
OwnerAuthForm
owner
AuthForm
)
{
String
accessToken
=
ReqUtils
.
getTokenInfo
().
getAccessToken
();
if
(
appLoginService
.
isInvalidAccessToken
(
accessToken
))
{
...
...
@@ -210,27 +203,27 @@ public class OwnerAccountController {
// 调用编辑帐号信息接口
JSONObject
reqJson
=
new
JSONObject
();
reqJson
.
put
(
"id"
,
realName
AuthForm
.
getId
());
reqJson
.
put
(
"ownerType"
,
realName
AuthForm
.
getOwnerType
());
reqJson
.
put
(
"contactor"
,
realName
AuthForm
.
getName
());
reqJson
.
put
(
"idCard"
,
realName
AuthForm
.
getIdCard
());
reqJson
.
put
(
"idCardExpireDate"
,
realName
AuthForm
.
getIdCardExpireDate
());
reqJson
.
put
(
"idCardFrontUrl"
,
realName
AuthForm
.
getIdCardFileFrontUrl
());
reqJson
.
put
(
"idCardBackUrl"
,
realName
AuthForm
.
getIdCardFileBackUrl
());
reqJson
.
put
(
"detailAddress"
,
realName
AuthForm
.
getDetailAddress
());
reqJson
.
put
(
"provinceCode"
,
realName
AuthForm
.
getProvinceCode
());
reqJson
.
put
(
"cityCode"
,
realName
AuthForm
.
getCityCode
());
reqJson
.
put
(
"districtCode"
,
realName
AuthForm
.
getDistrictCode
());
if
(
"2"
.
equals
(
realName
AuthForm
.
getOwnerType
()))
{
reqJson
.
put
(
"ownerFullName"
,
realName
AuthForm
.
getOwnerFullName
());
reqJson
.
put
(
"ownerBriefName"
,
realName
AuthForm
.
getOwnerBriefName
());
reqJson
.
put
(
"uniCreditCode"
,
realName
AuthForm
.
getUniCreditCode
());
reqJson
.
put
(
"creditExpireDate"
,
realName
AuthForm
.
getCreditExpireDate
());
reqJson
.
put
(
"creditOriginalUrl"
,
realName
AuthForm
.
getCreditOriginalUrl
());
reqJson
.
put
(
"creditCopyUrl"
,
realName
AuthForm
.
getCreditCopyUrl
());
reqJson
.
put
(
"legalPerson"
,
realName
AuthForm
.
getLegalPerson
());
reqJson
.
put
(
"legalPhone"
,
realName
AuthForm
.
getLegalPhone
());
reqJson
.
put
(
"id"
,
owner
AuthForm
.
getId
());
reqJson
.
put
(
"ownerType"
,
owner
AuthForm
.
getOwnerType
());
reqJson
.
put
(
"contactor"
,
owner
AuthForm
.
getName
());
reqJson
.
put
(
"idCard"
,
owner
AuthForm
.
getIdCard
());
reqJson
.
put
(
"idCardExpireDate"
,
owner
AuthForm
.
getIdCardExpireDate
());
reqJson
.
put
(
"idCardFrontUrl"
,
owner
AuthForm
.
getIdCardFileFrontUrl
());
reqJson
.
put
(
"idCardBackUrl"
,
owner
AuthForm
.
getIdCardFileBackUrl
());
reqJson
.
put
(
"detailAddress"
,
owner
AuthForm
.
getDetailAddress
());
reqJson
.
put
(
"provinceCode"
,
owner
AuthForm
.
getProvinceCode
());
reqJson
.
put
(
"cityCode"
,
owner
AuthForm
.
getCityCode
());
reqJson
.
put
(
"districtCode"
,
owner
AuthForm
.
getDistrictCode
());
if
(
"2"
.
equals
(
owner
AuthForm
.
getOwnerType
()))
{
reqJson
.
put
(
"ownerFullName"
,
owner
AuthForm
.
getOwnerFullName
());
reqJson
.
put
(
"ownerBriefName"
,
owner
AuthForm
.
getOwnerBriefName
());
reqJson
.
put
(
"uniCreditCode"
,
owner
AuthForm
.
getUniCreditCode
());
reqJson
.
put
(
"creditExpireDate"
,
owner
AuthForm
.
getCreditExpireDate
());
reqJson
.
put
(
"creditOriginalUrl"
,
owner
AuthForm
.
getCreditOriginalUrl
());
reqJson
.
put
(
"creditCopyUrl"
,
owner
AuthForm
.
getCreditCopyUrl
());
reqJson
.
put
(
"legalPerson"
,
owner
AuthForm
.
getLegalPerson
());
reqJson
.
put
(
"legalPhone"
,
owner
AuthForm
.
getLegalPhone
());
}
log
.
info
(
reqJson
.
toJSONString
());
...
...
src/main/java/com/esv/freight/app/module/account/form/DriverAuthForm.java
0 → 100644
View file @
99ffcd77
package
com
.
esv
.
freight
.
app
.
module
.
account
.
form
;
import
com.esv.freight.app.common.validator.groups.ValidatorUpdate
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
/**
* @description: 司机实名认证验证类
* @project: Freight
* @name: com.esv.freight.module.ownerBackend.account.form.DriverAuthForm
* @author: 张志臣
* @email: zhangzhichen@esvtek.com
* @createTime: 2020/04/28 20:00
* @version:1.0
*/
@Data
public
class
DriverAuthForm
{
/**
* 司机ID
*/
@NotNull
(
message
=
"参数id不能为空"
,
groups
=
{
ValidatorUpdate
.
class
})
private
Long
id
;
}
src/main/java/com/esv/freight/app/module/account/form/
RealName
AuthForm.java
→
src/main/java/com/esv/freight/app/module/account/form/
Owner
AuthForm.java
View file @
99ffcd77
...
...
@@ -13,16 +13,16 @@ import javax.validation.constraints.NotNull;
import
javax.validation.constraints.Pattern
;
/**
* @description:
账号
实名认证验证类
* @description:
货主
实名认证验证类
* @project: Freight
* @name: com.esv.freight.module.ownerBackend.account.form.
RealName
AuthForm
* @name: com.esv.freight.module.ownerBackend.account.form.
Owner
AuthForm
* @author: 张志臣
* @email: zhangzhichen@esvtek.com
* @createTime: 2020/04/13 10:00
* @version:1.0
*/
@Data
public
class
RealName
AuthForm
{
public
class
Owner
AuthForm
{
/**
* 货主ID
...
...
src/main/java/com/esv/freight/app/module/account/vo/DriverAccountDetailVO.java
View file @
99ffcd77
...
...
@@ -17,15 +17,21 @@ public class DriverAccountDetailVO {
// 账号ID
private
String
id
;
// 登录帐号,货主手机号
// 承运商帐号ID
private
Long
carrierId
;
// 登录帐号,司机手机号
private
String
account
;
// 创建来源:1-平台创建、2-自行注册
private
String
sourceType
;
// 货主帐号审核状态:0-待审核、1-审核成功,2-审核失败
,APP自行注册需要平台审核
// 货主帐号审核状态:0-待审核、1-审核成功,2-审核失败
private
Integer
auditStatus
;
// 认证状态:1-未认证、2-已认证
private
Integer
authenticateStatus
;
// 姓名
private
String
name
;
...
...
@@ -35,21 +41,69 @@ public class DriverAccountDetailVO {
// 身份证有效期 格式yyyy.MM.dd,或长期
private
String
idCardExpireDate
;
// 身份证正面图片ID
private
String
idCardFileFrontId
;
// 身份证正面图片URL
private
String
idCardFrontUrl
;
// 身份证反面图片URL
private
String
idCardBackUrl
;
// 结算对象(字典表):1-个人、2-所属承运商
private
Integer
settlementType
;
// 性别(字典表):1-男、2-女、3-未知
private
Integer
sex
;
//
身份证反面图片ID
private
String
idCardFileBackId
;
//
出生日期
private
String
birthDate
;
// 省份代码
// 民族
private
String
nation
;
// 籍贯
private
String
nativePlace
;
// 住址-省份代码
private
String
provinceCode
;
// 市代码
//
住址-
市代码
private
String
cityCode
;
// 区县代码
//
住址-
区县代码
private
String
districtCode
;
// 详细地址
//
住址-
详细地址
private
String
detailAddress
;
// 驾驶证号码
private
String
drivingLicense
;
// 驾驶证类型(字典表):1-A1、2-A2、3-A3、4-A1A2、5-A2E、6-A2D、7-B1、8-B2、9-C1、0-其他
private
Integer
drivingLicenseType
;
// 驾驶证有效期起
private
String
drivingLicenseStartDate
;
// 驾驶证有效期止
private
String
drivingLicenseEndDate
;
// 发证机关
private
String
drivingLicenseIssueDepartment
;
// 初次获得驾驶证日期
private
String
drivingLicenseInitDate
;
// 驾驶证正面图片URL
private
String
drivingLicenseUrl
;
// 道路运输从业资格证-所驾驶车辆(字典表):1-4.5吨及以下、2-4.5吨以上
private
Integer
certificateVehicle
;
// 道路运输从业资格证-有效期止
private
String
certificateEndDate
;
// 道路运输从业资格证-从业资格证号
private
String
certificateNumber
;
// 道路运输从业资格证-正面图片URL
private
String
certificateUrl
;
}
src/main/java/com/esv/freight/app/module/grabbing/controller/GrabController.java
View file @
99ffcd77
...
...
@@ -6,12 +6,12 @@ import com.esv.freight.app.common.response.ECode;
import
com.esv.freight.app.common.response.EResponse
;
import
com.esv.freight.app.common.validator.groups.ValidatorList
;
import
com.esv.freight.app.common.validator.groups.ValidatorUpdate
;
import
com.esv.freight.app.feign.TmsInterface
;
import
com.esv.freight.app.feign.TmsGrabInterface
;
import
com.esv.freight.app.feign.TmsOrderInterface
;
import
com.esv.freight.app.module.account.service.AppLoginService
;
import
com.esv.freight.app.module.grabbing.form.OrderGrabbingQueryForm
;
import
com.esv.freight.app.module.grabbing.vo.GrabListItemVO
;
import
com.esv.freight.app.module.grabbing.vo.GrabListVO
;
import
com.esv.freight.app.module.order.vo.OrderStatisticsVO
;
import
com.mysql.cj.util.StringUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -37,12 +37,12 @@ import java.util.List;
public
class
GrabController
{
private
AppLoginService
appLoginService
;
private
Tms
Interface
tms
Interface
;
private
Tms
GrabInterface
tmsGrab
Interface
;
@Autowired
public
GrabController
(
Tms
Interface
tms
Interface
,
AppLoginService
appLoginService
)
{
public
GrabController
(
Tms
GrabInterface
tmsGrab
Interface
,
AppLoginService
appLoginService
)
{
this
.
appLoginService
=
appLoginService
;
this
.
tms
Interface
=
tms
Interface
;
this
.
tms
GrabInterface
=
tmsGrab
Interface
;
}
/**
...
...
@@ -83,7 +83,7 @@ public class GrabController {
reqJson
.
put
(
"pageNum"
,
orderGrabbingQueryForm
.
getPageNum
());
reqJson
.
put
(
"pageSize"
,
orderGrabbingQueryForm
.
getPageSize
());
log
.
info
(
reqJson
.
toJSONString
());
JSONObject
result
=
tmsInterface
.
getOrderGrabbingList
(
reqJson
);
JSONObject
result
=
tms
Grab
Interface
.
getOrderGrabbingList
(
reqJson
);
log
.
info
(
result
.
toJSONString
());
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
...
...
@@ -134,7 +134,7 @@ public class GrabController {
JSONObject
reqJson
=
new
JSONObject
();
reqJson
.
put
(
"orderGrabbingId"
,
orderGrabbingQueryForm
.
getOrderId
());
log
.
info
(
reqJson
.
toJSONString
());
JSONObject
result
=
tmsInterface
.
grabOrder
(
reqJson
);
JSONObject
result
=
tms
Grab
Interface
.
grabOrder
(
reqJson
);
log
.
info
(
result
.
toJSONString
());
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
...
...
src/main/java/com/esv/freight/app/module/order/controller/OrderController.java
View file @
99ffcd77
...
...
@@ -9,7 +9,7 @@ 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.ValidatorList
;
import
com.esv.freight.app.common.validator.groups.ValidatorUpdate
;
import
com.esv.freight.app.feign.TmsInterface
;
import
com.esv.freight.app.feign.Tms
Order
Interface
;
import
com.esv.freight.app.module.account.service.AppLoginService
;
import
com.esv.freight.app.module.order.form.OrderForm
;
import
com.esv.freight.app.module.order.form.OrderQueryForm
;
...
...
@@ -41,10 +41,10 @@ import java.util.List;
public
class
OrderController
{
private
AppLoginService
appLoginService
;
private
TmsInterface
tmsInterface
;
private
Tms
Order
Interface
tmsInterface
;
@Autowired
public
OrderController
(
TmsInterface
tmsInterface
,
AppLoginService
appLoginService
)
{
public
OrderController
(
Tms
Order
Interface
tmsInterface
,
AppLoginService
appLoginService
)
{
this
.
appLoginService
=
appLoginService
;
this
.
tmsInterface
=
tmsInterface
;
}
...
...
@@ -64,12 +64,21 @@ public class OrderController {
return
EResponse
.
error
(
ECode
.
TOKEN_EXPIRED
);
}
// 调用货主查询不同状态的订单数接口
JSONObject
result
=
tmsInterface
.
getOrderCount
();
log
.
info
(
result
.
toJSONString
());
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
}
OrderStatisticsVO
orderStatisticsVO
=
new
OrderStatisticsVO
();
orderStatisticsVO
.
setCancelled
(
6
);
orderStatisticsVO
.
setComplete
(
5
);
orderStatisticsVO
.
setExecuting
(
3
);
orderStatisticsVO
.
setPending
(
6
);
orderStatisticsVO
.
setPublished
(
10
);
JSONObject
data
=
result
.
getJSONObject
(
"data"
);
orderStatisticsVO
.
setCancelled
(
data
.
getInteger
(
"cancelledCount"
));
orderStatisticsVO
.
setComplete
(
data
.
getInteger
(
"finishedCount"
));
orderStatisticsVO
.
setExecuting
(
data
.
getInteger
(
"executingCount"
));
orderStatisticsVO
.
setPending
(
data
.
getInteger
(
"auditPendingCount"
));
orderStatisticsVO
.
setPublished
(
data
.
getInteger
(
"addedCount"
));
return
EResponse
.
ok
(
orderStatisticsVO
);
}
...
...
@@ -160,7 +169,7 @@ public class OrderController {
reqJson
.
put
(
"goodsType"
,
orderForm
.
getGoodsType
());
reqJson
.
put
(
"goodsNameCode"
,
orderForm
.
getGoodsNameCode
());
reqJson
.
put
(
"goodsDetail"
,
orderForm
.
getGoodsDetail
());
reqJson
.
put
(
"
goodsTotal
Amount"
,
orderForm
.
getGoodsTotalAmount
());
reqJson
.
put
(
"
totalGoods
Amount"
,
orderForm
.
getGoodsTotalAmount
());
reqJson
.
put
(
"goodsUnit"
,
orderForm
.
getGoodsUnit
());
reqJson
.
put
(
"goodsUnitPrice"
,
orderForm
.
getGoodsUnitPrice
());
reqJson
.
put
(
"freightUnitPriceInput"
,
orderForm
.
getFreightUnitPriceInput
());
...
...
@@ -250,7 +259,7 @@ public class OrderController {
orderDetailVO
.
setGoodsNameCode
(
data
.
getInteger
(
"goodsNameCode"
));
orderDetailVO
.
setGoodsNameCode
(
data
.
getInteger
(
"goodsNameCode"
));
orderDetailVO
.
setGoodsDetail
(
data
.
getString
(
"goodsDetail"
));
orderDetailVO
.
setGoodsTotalAmount
(
data
.
getBigDecimal
(
"
goodsTotal
Amount"
));
orderDetailVO
.
setGoodsTotalAmount
(
data
.
getBigDecimal
(
"
totalGoods
Amount"
));
orderDetailVO
.
setGoodsUnit
(
data
.
getInteger
(
"goodsUnit"
));
orderDetailVO
.
setGoodsUnitPrice
(
data
.
getBigDecimal
(
"goodsUnitPrice"
));
orderDetailVO
.
setFreightUnitPriceInput
(
data
.
getBigDecimal
(
"freightUnitPriceInput"
));
...
...
@@ -288,7 +297,7 @@ public class OrderController {
reqJson
.
put
(
"goodsType"
,
orderForm
.
getGoodsType
());
reqJson
.
put
(
"goodsNameCode"
,
orderForm
.
getGoodsNameCode
());
reqJson
.
put
(
"goodsDetail"
,
orderForm
.
getGoodsDetail
());
reqJson
.
put
(
"
goodsTotal
Amount"
,
orderForm
.
getGoodsTotalAmount
());
reqJson
.
put
(
"
totalGoods
Amount"
,
orderForm
.
getGoodsTotalAmount
());
reqJson
.
put
(
"goodsUnit"
,
orderForm
.
getGoodsUnit
());
reqJson
.
put
(
"goodsUnitPrice"
,
orderForm
.
getGoodsUnitPrice
());
reqJson
.
put
(
"freightUnitPriceInput"
,
orderForm
.
getFreightUnitPriceInput
());
...
...
@@ -301,7 +310,7 @@ public class OrderController {
reqJson
.
put
(
"vehicleLength"
,
orderForm
.
getVehicleLength
());
reqJson
.
put
(
"remark"
,
orderForm
.
getRemark
());
log
.
info
(
reqJson
.
toJSONString
());
JSONObject
result
=
tmsInterface
.
editOrder
(
reqJson
);
JSONObject
result
=
tmsInterface
.
editOrder
Owner
(
reqJson
);
log
.
info
(
result
.
toJSONString
());
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
...
...
src/main/java/com/esv/freight/app/module/vehicle/form/VehicleForm.java
View file @
99ffcd77
...
...
@@ -79,12 +79,6 @@ public class VehicleForm {
@Range
(
min
=
1000
,
max
=
5000
,
message
=
"参数vehicleHeight不合法"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
})
@NotNull
(
message
=
"参数vehicleHeight不能为空"
,
groups
=
{
ValidatorInsert
.
class
})
private
Integer
vehicleHeight
;
/**
* 车辆所属(字典表):1-自有车、2-外协车
*/
@Range
(
min
=
1
,
max
=
2
,
message
=
"参数vehicleBelong不合法"
,
groups
=
{
ValidatorInsert
.
class
,
ValidatorUpdate
.
class
})
@NotNull
(
message
=
"参数vehicleBelong不能为空"
,
groups
=
{
ValidatorInsert
.
class
})
private
Integer
vehicleBelong
;
/**
* 年审日期
*/
...
...
src/main/java/com/esv/freight/app/module/vehicle/vo/VehicleListItemVO.java
View file @
99ffcd77
...
...
@@ -21,14 +21,12 @@ public class VehicleListItemVO {
*
*/
private
Long
id
;
/**
* 车牌号
*/
private
String
licenseNumber
;
/**
* 车辆状态:1-正常、2-停用
*/
private
String
vehicleStatus
;
/**
* 审核状态(字典表):0-待审核、1-审核成功,2-审核失败
*/
...
...
@@ -41,30 +39,10 @@ public class VehicleListItemVO {
* 二级车辆类型(字典表)
*/
private
Integer
vehicleType2
;
/**
* 行驶证档案编号
*/
private
String
vehicleLicenseNumber
;
/**
* 道路运输证号
*/
private
String
roadCertificateNumber
;
/**
* 核定载质量(吨)
*/
private
BigDecimal
loadCapacity
;
/**
* 创建来源:1-平台创建、2-司机创建
*/
private
String
sourceType
;
/**
* 创建者
*/
private
String
createUser
;
/**
* 创建时间
*/
private
Long
createTime
;
@Override
public
String
toString
()
{
...
...
src/main/java/com/esv/freight/app/module/waybill/controller/DriverWaybillController.java
View file @
99ffcd77
...
...
@@ -4,7 +4,7 @@ import com.esv.freight.app.common.response.ECode;
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.ValidatorList
;
import
com.esv.freight.app.feign.TmsInterface
;
import
com.esv.freight.app.feign.Tms
Order
Interface
;
import
com.esv.freight.app.module.account.service.AppLoginService
;
import
com.esv.freight.app.module.waybill.form.WaybillQueryForm
;
import
com.esv.freight.app.module.waybill.vo.WaybillListItemVO
;
...
...
@@ -35,7 +35,7 @@ import java.util.List;
public
class
DriverWaybillController
{
private
AppLoginService
appLoginService
;
private
TmsInterface
tmsInterface
;
private
Tms
Order
Interface
tmsInterface
;
private
WaybillListVO
mWaybillListVO
;
...
...
@@ -53,8 +53,6 @@ public class DriverWaybillController {
itemVO
.
setGoodsTotalAmount
(
new
BigDecimal
(
26
));
itemVO
.
setGoodsUnit
(
"吨"
);
itemVO
.
setCreateTime
(
new
Date
());
itemVO
.
setRequiredReceiveTime
(
new
Date
());
itemVO
.
setRequiredDeliveryTime
(
new
Date
());
itemVO
.
setVehicleNum
(
"辽A12345"
);
verifyList
.
add
(
itemVO
);
...
...
@@ -66,7 +64,7 @@ public class DriverWaybillController {
}
@Autowired
public
DriverWaybillController
(
TmsInterface
tmsInterface
,
AppLoginService
appLoginService
)
{
public
DriverWaybillController
(
Tms
Order
Interface
tmsInterface
,
AppLoginService
appLoginService
)
{
this
.
appLoginService
=
appLoginService
;
this
.
tmsInterface
=
tmsInterface
;
createTestData
();
...
...
src/main/java/com/esv/freight/app/module/waybill/controller/OwnerWaybillController.java
View file @
99ffcd77
package
com
.
esv
.
freight
.
app
.
module
.
waybill
.
controller
;
import
com.alibaba.fastjson.JSONArray
;
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.
validator.groups.ValidatorInsert
;
import
com.esv.freight.app.common.
util.ReqUtils
;
import
com.esv.freight.app.common.validator.groups.ValidatorList
;
import
com.esv.freight.app.feign.TmsInterface
;
import
com.esv.freight.app.feign.TmsOrderInterface
;
import
com.esv.freight.app.feign.TmsWaybillInterface
;
import
com.esv.freight.app.module.account.service.AppLoginService
;
import
com.esv.freight.app.module.order.form.OrderQueryForm
;
import
com.esv.freight.app.module.waybill.form.WaybillQueryForm
;
import
com.esv.freight.app.module.waybill.vo.WaybillListItemVO
;
import
com.esv.freight.app.module.waybill.vo.WaybillListVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -37,41 +39,12 @@ import java.util.List;
public
class
OwnerWaybillController
{
private
AppLoginService
appLoginService
;
private
TmsInterface
tmsInterface
;
private
WaybillListVO
mWaybillListVO
;
private
void
createTestData
()
{
mWaybillListVO
=
new
WaybillListVO
();
List
<
WaybillListItemVO
>
verifyList
=
new
ArrayList
<>();
WaybillListItemVO
itemVO
=
new
WaybillListItemVO
();
itemVO
.
setId
(
10056L
);
itemVO
.
setWaybillNO
(
"YD202004221300002"
);
itemVO
.
setOrderNO
(
"D2020042109300101"
);
itemVO
.
setWaybillState
(
5
);
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
.
setVehicleNum
(
"辽A12345"
);
verifyList
.
add
(
itemVO
);
mWaybillListVO
.
setPageNum
(
1L
);
mWaybillListVO
.
setPageSize
(
20L
);
mWaybillListVO
.
setTotal
(
1L
);
mWaybillListVO
.
setRecordSize
(
1L
);
mWaybillListVO
.
setRecord
(
verifyList
);
}
private
TmsWaybillInterface
tmsWaybillInterface
;
@Autowired
public
OwnerWaybillController
(
Tms
Interface
tms
Interface
,
AppLoginService
appLoginService
)
{
public
OwnerWaybillController
(
Tms
WaybillInterface
tmsWaybill
Interface
,
AppLoginService
appLoginService
)
{
this
.
appLoginService
=
appLoginService
;
this
.
tmsInterface
=
tmsInterface
;
createTestData
();
this
.
tmsWaybillInterface
=
tmsWaybillInterface
;
}
/**
...
...
@@ -82,12 +55,58 @@ public class OwnerWaybillController {
* createTime 2020/04/22 15:00
**/
@PostMapping
(
"/list"
)
public
EResponse
list
(
@Request
Header
(
"Union-Authorization"
)
String
accessToken
,
@Request
Body
(
required
=
false
)
@Validated
(
ValidatorList
.
class
)
WaybillQueryForm
waybillQueryForm
)
{
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
);
}
return
EResponse
.
ok
(
mWaybillListVO
);
// 调用运单列表分页查询接口
JSONObject
reqJson
=
new
JSONObject
();
reqJson
.
put
(
"goodsOwnerId"
,
waybillQueryForm
.
getUserId
());
reqJson
.
put
(
"pageNum"
,
waybillQueryForm
.
getPageNum
());
reqJson
.
put
(
"pageSize"
,
waybillQueryForm
.
getPageSize
());
if
(!
StringUtils
.
isEmpty
(
waybillQueryForm
.
getOrderNo
()))
{
reqJson
.
put
(
"orderNo"
,
waybillQueryForm
.
getOrderNo
());
}
log
.
info
(
reqJson
.
toJSONString
());
JSONObject
result
=
tmsWaybillInterface
.
listWaybills
(
reqJson
);
log
.
info
(
result
.
toJSONString
());
if
(
result
.
getInteger
(
"code"
)
!=
200
)
{
return
EResponse
.
error
(
result
.
getInteger
(
"code"
),
result
.
getString
(
"message"
));
}
WaybillListVO
pageResultVO
=
new
WaybillListVO
();
JSONObject
data
=
result
.
getJSONObject
(
"data"
);
pageResultVO
.
setPageSize
(
data
.
getLong
(
"pageSize"
));
pageResultVO
.
setPageNum
(
data
.
getLong
(
"pageNum"
));
pageResultVO
.
setTotal
(
data
.
getLong
(
"total"
));
pageResultVO
.
setRecordSize
(
data
.
getLong
(
"recordSize"
));
if
(
pageResultVO
.
getRecordSize
()
>
0
)
{
JSONArray
items
=
data
.
getJSONArray
(
"records"
);
List
<
WaybillListItemVO
>
records
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
items
.
size
();
++
i
)
{
WaybillListItemVO
vo
=
new
WaybillListItemVO
();
JSONObject
object
=
items
.
getJSONObject
(
i
);
vo
.
setId
(
object
.
getLong
(
"id"
));
vo
.
setWaybillNO
(
object
.
getString
(
"waybillNO"
));
vo
.
setOrderNO
(
object
.
getString
(
"orderNo"
));
vo
.
setWaybillState
(
object
.
getInteger
(
"waybillState"
));
vo
.
setDeliveryCity
(
object
.
getString
(
"deliveryCityCode"
));
vo
.
setReceiveCity
(
object
.
getString
(
"receiveCityCode"
));
vo
.
setGoodsName
(
object
.
getInteger
(
"goodsNameCode"
));
vo
.
setGoodsTotalAmount
(
object
.
getBigDecimal
(
"goodsAmount"
));
vo
.
setGoodsUnit
(
object
.
getString
(
"goodsUnit"
));
vo
.
setCreateTime
(
object
.
getDate
(
"createTime"
));
vo
.
setVehicleId
(
object
.
getString
(
"vehicleId"
));
vo
.
setVehicleNum
(
object
.
getString
(
"vehicleLicenseNo"
));
records
.
add
(
vo
);
}
pageResultVO
.
setRecord
(
records
);
}
return
EResponse
.
ok
(
pageResultVO
);
}
}
src/main/java/com/esv/freight/app/module/waybill/form/WaybillQueryForm.java
View file @
99ffcd77
...
...
@@ -10,6 +10,7 @@ import org.hibernate.validator.constraints.Range;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Positive
;
import
java.util.List
;
/**
* @description:
...
...
@@ -49,11 +50,9 @@ public class WaybillQueryForm {
private
String
orderNo
;
/**
* 运单状态
* 运单状态
:1-装货中、2-运输中、3-已交货、4-已签收、5-已回单、6-已作废
*/
@Positive
(
message
=
"参数运单状态不合法"
,
groups
=
{
ValidatorList
.
class
})
@Range
(
min
=
1
,
max
=
100
,
message
=
"无效的运单状态"
,
groups
=
{
ValidatorList
.
class
})
private
Integer
waybillState
;
private
List
<
Integer
>
waybillStateList
;
/**
* 当前页数
...
...
src/main/java/com/esv/freight/app/module/waybill/vo/WaybillListItemVO.java
View file @
99ffcd77
...
...
@@ -23,7 +23,7 @@ public class WaybillListItemVO {
private
Long
id
;
/**
* 运单号
* 运单号
,YD+”8位日期“+”6位序号“
*/
private
String
waybillNO
;
...
...
@@ -33,7 +33,7 @@ public class WaybillListItemVO {
private
String
orderNO
;
/**
* 运单状态
* 运单状态
1-装货中;2-运输中;3-已交货;4-已签收;5-已回单;6-已作废
*/
private
Integer
waybillState
;
...
...
@@ -63,22 +63,17 @@ public class WaybillListItemVO {
private
String
goodsUnit
;
/**
* 要求发货时间
*/
private
Date
requiredDeliveryTime
;
/**
* 要求交货时间
* 运单生成时间
*/
private
Date
requiredReceiv
eTime
;
private
Date
creat
eTime
;
/**
*
运单生成时间
*
执行车辆ID
*/
private
Date
createTime
;
private
String
vehicleId
;
/**
* 执行车辆
* 执行车辆
车牌号
*/
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