Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
5931a53c
Commit
5931a53c
authored
Jun 25, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/base-modify' into base-modify
parents
faa0408d
03895874
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
10 deletions
+93
-10
OrderTourVerificationBiz.java
...com/xxfc/platform/order/biz/OrderTourVerificationBiz.java
+48
-2
OrderTourVerificationController.java
.../platform/order/rest/OrderTourVerificationController.java
+15
-2
TourGoodVerificationBiz.java
...a/com/xxfc/platform/tour/biz/TourGoodVerificationBiz.java
+6
-4
VehicleFeign.java
...in/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
+6
-2
BranchCompanyController.java
...m/xxfc/platform/vehicle/rest/BranchCompanyController.java
+18
-0
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderTourVerificationBiz.java
View file @
5931a53c
package
com
.
xxfc
.
platform
.
order
.
biz
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.order.contant.enumerate.OrderStatusEnum
;
import
com.xxfc.platform.order.entity.BaseOrder
;
import
com.xxfc.platform.order.entity.OrderTourDetail
;
import
com.xxfc.platform.order.mapper.OrderTourVerificationMapper
;
import
com.xxfc.platform.order.pojo.order.OrderTourVerificationVO
;
import
com.xxfc.platform.tour.feign.TourFeign
;
import
com.xxfc.platform.tour.vo.TourGoodOrderFindVo
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 旅游订单核销
*
...
...
@@ -29,6 +34,8 @@ public class OrderTourVerificationBiz{
@Autowired
private
BaseOrderBiz
baseOrderBiz
;
@Autowired
private
OrderTourDetailBiz
tourDetailBiz
;
@Autowired
private
TourFeign
tourFeign
;
/**
...
...
@@ -43,18 +50,43 @@ public class OrderTourVerificationBiz{
}
//核销
public
ObjectRestResponse
VerificationByOrder
(
Integer
orderId
){
BaseOrder
baseOrder
=
baseOrderBiz
.
selectById
(
orderId
);
public
ObjectRestResponse
VerificationByOrder
(
String
no
,
List
<
BranchCompany
>
list
,
UserDTO
userDTO
){
BaseOrder
baseOrder
=
new
BaseOrder
();
baseOrder
.
setNo
(
no
);
baseOrder
=
baseOrderBiz
.
selectOne
(
baseOrder
);
if
(
baseOrder
==
null
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"订单不存在"
);
}
if
(
baseOrder
.
getStatus
()!=
OrderStatusEnum
.
ORDER_TOSTART
.
getCode
()){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"订单不是已支付状态"
);
}
Integer
orderId
=
baseOrder
.
getId
();
OrderTourDetail
tourDetail
=
new
OrderTourDetail
();
tourDetail
.
setOrderId
(
orderId
);
tourDetail
=
tourDetailBiz
.
selectOne
(
tourDetail
);
if
(
tourDetail
==
null
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"订单不存在"
);
}
Integer
verificationId
=
tourDetail
.
getVerificationId
();
Integer
total_number
=
tourDetail
.
getTotalNumber
();
if
(
userDTO
.
getDataAll
()==
2
){
Integer
companyId
=
tourDetail
.
getStartCompanyId
();
if
(
companyId
!=
null
){
boolean
falg
=
isPower
(
list
,
companyId
);
if
(!
falg
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"无权限操作"
);
}
}
}
baseOrder
=
new
BaseOrder
();
baseOrder
.
setId
(
orderId
);
baseOrder
.
setStatus
(
OrderStatusEnum
.
ORDER_FINISH
.
getCode
());
baseOrderBiz
.
updateSelectiveById
(
baseOrder
);
tourDetail
.
setVerificationUser
(
userDTO
.
getId
());
tourDetail
.
setVerificationName
(
userDTO
.
getName
());
tourDetail
.
setVerificationTime
(
System
.
currentTimeMillis
());
tourDetailBiz
.
updateSelectiveById
(
tourDetail
);
tourFeign
.
updateTourGoodPersonNum
(
verificationId
,
"verification_person"
,
total_number
);
return
ObjectRestResponse
.
succ
();
}
...
...
@@ -70,6 +102,20 @@ public class OrderTourVerificationBiz{
return
ObjectRestResponse
.
succ
(
tourFeign
.
findTourGoodOrders
(
BeanUtil
.
beanToMap
(
tourGoodOrderFindVo
)));
}
public
boolean
isPower
(
List
<
BranchCompany
>
list
,
Integer
companyId
){
boolean
falg
=
false
;
if
(
list
.
size
()>
0
){
for
(
BranchCompany
company:
list
)
{
if
(
company
.
getId
()==
companyId
){
falg
=
true
;
break
;
}
}
}
return
falg
;
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderTourVerificationController.java
View file @
5931a53c
...
...
@@ -10,12 +10,16 @@ import com.github.wxiaoqi.security.common.rest.CommonBaseController;
import
com.xxfc.platform.order.biz.OrderTourVerificationBiz
;
import
com.xxfc.platform.order.entity.BaseOrder
;
import
com.xxfc.platform.tour.vo.TourGoodOrderFindVo
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.List
;
@RestController
@RequestMapping
(
"tour"
)
@IgnoreClientToken
...
...
@@ -48,9 +52,18 @@ public class OrderTourVerificationController extends CommonBaseController {
@RequestMapping
(
value
=
"/verification/check"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
value
=
"旅游核销"
)
public
ObjectRestResponse
<
BaseOrder
>
check
(
@RequestParam
(
value
=
"
orderId"
,
defaultValue
=
"0"
)
Integer
orderId
@RequestParam
(
value
=
"
no"
,
defaultValue
=
""
)
String
no
){
return
verificationBiz
.
VerificationByOrder
(
orderId
);
UserDTO
userDTO
=
getUserInfo
();
if
(
userDTO
==
null
){
return
ObjectRestResponse
.
createDefaultFail
();
}
List
<
BranchCompany
>
list
=
new
ArrayList
<>();
if
(
userDTO
.
getDataAll
()==
2
){
list
=
vehicleFeign
.
companyAll
(
userDTO
.
getDataAll
(),
userDTO
.
getDataCompany
(),
userDTO
.
getDataZone
());
}
return
verificationBiz
.
VerificationByOrder
(
no
,
list
,
userDTO
);
}
@RequestMapping
(
value
=
"/verification/finish"
,
method
=
RequestMethod
.
POST
)
...
...
xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/biz/TourGoodVerificationBiz.java
View file @
5931a53c
...
...
@@ -9,6 +9,8 @@ import com.xxfc.platform.tour.entity.TourGoodVerification;
import
com.xxfc.platform.tour.mapper.TourGoodVerificationMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalTime
;
import
java.util.*
;
...
...
@@ -49,21 +51,21 @@ public class TourGoodVerificationBiz extends BaseBiz<TourGoodVerificationMapper,
List
<
TourGoodOrderVo
>
tourGoodOrderVos
=
tourGoodOrderVoPageDataVO
.
getData
();
tourGoodOrderVos
.
stream
().
peek
(
tourGoodOrderVo
->
{
tourGoodOrderVo
.
setLeaveOfNum
(
tourGoodOrderVo
.
getHeadCount
()-
tourGoodOrderVo
.
getTripOfNum
());
String
startDateStr
=
DateUtil
.
format
(
tourGoodOrderVo
.
getStartDate
(),
"YYYY
.MM.
dd"
);
String
startDateStr
=
DateUtil
.
format
(
tourGoodOrderVo
.
getStartDate
(),
"YYYY
-MM-
dd"
);
tourGoodOrderVo
.
setTravelTime
(
startDateStr
);
Long
startTime
=
tourGoodOrderVo
.
getStartTime
();
if
(
null
!=
startTime
){
LocalTime
localTime
=
LocalTime
.
ofSecondOfDay
(
startTime
);
/*
LocalTime localTime = LocalTime.ofSecondOfDay(startTime);
String timeStr = String.format("%s:%s:%s",localTime.getHour()==0?"00":localTime.getHour(),
localTime
.
getMinute
()==
0
?
"00"
:
localTime
.
getMinute
(),
localTime
.
getSecond
()==
0
?
"00"
:
localTime
.
getSecond
());
localTime.getMinute()==0?"00":localTime.getMinute(),localTime.getSecond()==0?"00":localTime.getSecond());*/
String
timeStr
=
new
SimpleDateFormat
(
"HH:mm"
).
format
(
startTime
);
tourGoodOrderVo
.
setTravelTime
(
String
.
format
(
"%s %s"
,
tourGoodOrderVo
.
getTravelTime
(),
timeStr
));
}
}).
count
();
return
tourGoodOrderVoPageDataVO
;
}
/**
* 更改发车状态
* @param verficationId
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
View file @
5931a53c
...
...
@@ -2,6 +2,7 @@ package com.xxfc.platform.vehicle.feign;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.entity.VehicleBookRecord
;
import
com.xxfc.platform.vehicle.entity.VehicleModel
;
...
...
@@ -46,6 +47,9 @@ public interface VehicleFeign {
public
RestResponse
<
Integer
>
proveVehicleBooking
(
@PathVariable
Long
bookRecordId
);
//获取分公司列表
@GetMapping
(
"/branchCompany/list"
)
public
List
<
Integer
>
companyList
(
@RequestParam
(
value
=
"dataZone"
)
String
dataZone
,
@RequestParam
(
value
=
"dataCompany"
)
String
dataCompany
);
@GetMapping
(
"/branchCompany/all"
)
public
List
<
BranchCompany
>
companyAll
(
@RequestParam
(
value
=
"dataAll"
)
Integer
dataAll
,
@RequestParam
(
value
=
"dataCompany"
)
String
dataCompany
,
@RequestParam
(
value
=
"dataZone"
)
String
dataZone
);
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/BranchCompanyController.java
View file @
5931a53c
...
...
@@ -19,6 +19,7 @@ import com.github.wxiaoqi.security.common.vo.PageDataVO;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
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.*
;
...
...
@@ -133,4 +134,21 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
UserDTO
userDTO
=
userFeign
.
userinfoByToken
(
userAuthConfig
.
getToken
(
request
)).
getData
();
return
RestResponse
.
data
(
baseBiz
.
getListByUser
(
userDTO
));
}
//获取分公司列表
@GetMapping
(
"all"
)
public
List
<
BranchCompany
>
companyAll
(
@RequestParam
(
value
=
"dataAll"
,
defaultValue
=
"2"
)
Integer
dataAll
,
@RequestParam
(
value
=
"dataCompany"
,
defaultValue
=
""
)
String
dataCompany
,
@RequestParam
(
value
=
"dataZone"
,
defaultValue
=
""
)
String
dataZone
)
{
UserDTO
userDTO
=
new
UserDTO
();
userDTO
.
setDataAll
(
dataAll
);
if
(
StringUtils
.
isNotBlank
(
dataCompany
)){
userDTO
.
setDataCompany
(
dataCompany
);
}
if
(
StringUtils
.
isNotBlank
(
dataZone
)){
userDTO
.
setDataZone
(
dataZone
);
}
return
baseBiz
.
getListByUser
(
userDTO
);
}
}
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