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
326697dd
Commit
326697dd
authored
Sep 22, 2020
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调车相关
parent
87b2a9a1
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
169 additions
and
10 deletions
+169
-10
PageParam.java
...java/com/github/wxiaoqi/security/common/vo/PageParam.java
+4
-1
ShuntApply.java
.../main/java/com/xxfc/platform/order/entity/ShuntApply.java
+14
-0
ShuntApplyController.java
...va/com/xxfc/platform/order/rest/ShuntApplyController.java
+1
-1
BgShuntApplyController.java
...latform/order/rest/background/BgShuntApplyController.java
+105
-8
VehicleFeign.java
...in/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
+4
-0
RentVehicleController.java
...com/xxfc/platform/vehicle/rest/RentVehicleController.java
+41
-0
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/vo/PageParam.java
View file @
326697dd
package
com
.
github
.
wxiaoqi
.
security
.
common
.
vo
;
package
com
.
github
.
wxiaoqi
.
security
.
common
.
vo
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -10,5 +11,7 @@ public class PageParam {
...
@@ -10,5 +11,7 @@ public class PageParam {
@ApiModelProperty
(
"每页限制"
)
@ApiModelProperty
(
"每页限制"
)
Integer
limit
;
Integer
limit
;
public
Query
initQuery
()
{
return
new
Query
(
this
);
}
}
}
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/ShuntApply.java
View file @
326697dd
...
@@ -158,4 +158,18 @@ public class ShuntApply implements Serializable {
...
@@ -158,4 +158,18 @@ public class ShuntApply implements Serializable {
@ApiModelProperty
(
value
=
"超时时间戳"
,
hidden
=
true
)
@ApiModelProperty
(
value
=
"超时时间戳"
,
hidden
=
true
)
private
Long
overTime
;
private
Long
overTime
;
/**
* 开始城市编码
*/
@Column
(
name
=
"start_city_code"
)
@ApiModelProperty
(
value
=
"开始城市编码"
)
private
Integer
startCityCode
;
/**
* 结束城市编码
*/
@Column
(
name
=
"end_city_code"
)
@ApiModelProperty
(
value
=
"结束城市编码"
,
hidden
=
true
)
private
Integer
endCityCode
;
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/ShuntApplyController.java
View file @
326697dd
...
@@ -51,7 +51,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
...
@@ -51,7 +51,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
@RequestMapping
(
value
=
"/addApply"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/addApply"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
@ApiOperation
(
value
=
"
申请列表
"
)
@ApiOperation
(
value
=
"
添加申请
"
)
public
ObjectRestResponse
addApply
(
@RequestBody
ShuntApply
shuntApply
)
{
public
ObjectRestResponse
addApply
(
@RequestBody
ShuntApply
shuntApply
)
{
//查询列表数据
//查询列表数据
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/background/BgShuntApplyController.java
View file @
326697dd
package
com
.
xxfc
.
platform
.
order
.
rest
.
background
;
package
com
.
xxfc
.
platform
.
order
.
rest
.
background
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.
common.context.BaseContextHandler
;
import
com.github.wxiaoqi.security.
admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.util.OrderUtil
;
import
com.github.wxiaoqi.security.common.util.OrderUtil
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
...
@@ -19,22 +20,29 @@ import com.xxfc.platform.order.entity.BaseOrder;
...
@@ -19,22 +20,29 @@ import com.xxfc.platform.order.entity.BaseOrder;
import
com.xxfc.platform.order.entity.ShuntApply
;
import
com.xxfc.platform.order.entity.ShuntApply
;
import
com.xxfc.platform.order.mqhandler.RabbitProduct
;
import
com.xxfc.platform.order.mqhandler.RabbitProduct
;
import
com.xxfc.platform.order.pojo.order.RentVehicleBO
;
import
com.xxfc.platform.order.pojo.order.RentVehicleBO
;
import
com.xxfc.platform.order.pojo.order.add.BgAddRentDTO
;
import
com.xxfc.platform.order.service.OrderRentVehicleService
;
import
com.xxfc.platform.order.service.OrderRentVehicleService
;
import
com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus
;
import
com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus
;
import
com.xxfc.platform.vehicle.entity.VehicleModel
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.pojo.RentVehicleBookDTO
;
import
com.xxfc.platform.vehicle.pojo.vo.UsableVeicleVO
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
lombok.Data
;
import
org.jsoup.helper.DataUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
ShuntApply
.
STATUS_CONFIRM
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
ShuntApply
.
STATUS_CONFIRM
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
ShuntApply
.
STATUS_CRT
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
ShuntApply
.
STATUS_CRT
;
@RestController
@RestController
@RequestMapping
(
"/background/shuntApply"
)
@RequestMapping
(
"/background/shuntApply"
)
public
class
BgShuntApplyController
extends
BaseController
<
ShuntApplyBiz
,
ShuntApply
>
{
public
class
BgShuntApplyController
extends
BaseController
<
ShuntApplyBiz
,
ShuntApply
>
implements
UserRestInterface
{
@Autowired
@Autowired
...
@@ -55,10 +63,89 @@ public class BgShuntApplyController extends BaseController<ShuntApplyBiz, ShuntA
...
@@ -55,10 +63,89 @@ public class BgShuntApplyController extends BaseController<ShuntApplyBiz, ShuntA
@Autowired
@Autowired
RabbitProduct
rabbitProduct
;
RabbitProduct
rabbitProduct
;
@RequestMapping
(
value
=
"/confirmApply"
,
method
=
RequestMethod
.
POST
)
@Override
public
UserFeign
getUserFeign
()
{
return
this
.
userFeign
;
}
@RequestMapping
(
value
=
"/steward/list"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ApiOperation
(
value
=
"根据城市查询待确认申请列表"
)
public
ObjectRestResponse
<
List
<
StewardShuntApply
>>
stewardList
(
ListDTO
dto
)
{
//获取该城市的申请最大和最小时间
//获取该店铺
List
<
ShuntApply
>
list
=
baseBiz
.
selectByWeekend
(
w
->
{
w
.
andEqualTo
(
ShuntApply:
:
getStartCityCode
,
dto
.
getCityCode
());
w
.
andEqualTo
(
ShuntApply:
:
getStatus
,
STATUS_CRT
);
return
w
;
},
" crt_time desc "
);
List
<
StewardShuntApply
>
returnList
=
CollUtil
.
newArrayList
();
Integer
companyId
=
getAdminUserInfo
().
getCompanyId
();
if
(
CollUtil
.
isNotEmpty
(
list
))
{
//group by 车型
//List<Integer> modelList = list.parallelStream().map(ShuntApply::getModelId).distinct().collect(Collectors.toList());
//.collect(Collectors.groupingBy(ShuntApply::getModelId));
Map
<
Integer
,
List
<
ShuntApply
>>
modelMap
=
list
.
parallelStream
().
collect
(
Collectors
.
groupingBy
(
ShuntApply:
:
getModelId
));
Long
startTime
=
list
.
parallelStream
().
map
(
ShuntApply:
:
getStartTime
).
min
(
Long:
:
compareTo
).
get
();
Long
endTime
=
list
.
parallelStream
().
map
(
ShuntApply:
:
getEndTime
).
max
(
Long:
:
compareTo
).
get
();
for
(
Integer
modelId
:
modelMap
.
keySet
())
{
RentVehicleBookDTO
rbd
=
new
RentVehicleBookDTO
();
rbd
.
setModelId
(
modelId
);
rbd
.
setParkBranchCompanyId
(
companyId
);
rbd
.
setStartCompanyId
(
companyId
);
rbd
.
setEndCompanyId
(
companyId
);
rbd
.
setBookStartDate
(
DateUtil
.
date
(
startTime
).
toDateStr
());
rbd
.
setBookEndDate
(
DateUtil
.
date
(
endTime
).
toDateStr
());
rbd
.
setBookStartDateTime
(
DateUtil
.
date
(
startTime
).
toTimeStr
());
rbd
.
setBookEndDateTime
(
DateUtil
.
date
(
endTime
).
toTimeStr
());
//查询本公司时间段内可用车辆
ObjectRestResponse
<
PageDataVO
<
UsableVeicleVO
>>
usableVehiclePage
=
vehicleFeign
.
applyUsableVehicle
(
rbd
);
if
(
CollUtil
.
isNotEmpty
(
usableVehiclePage
.
getData
().
getData
()))
{
modelMap
.
get
(
modelId
).
forEach
(
shuntApply
->
{
List
<
UsableVeicleVO
>
vehicles
=
CollUtil
.
newArrayList
();
usableVehiclePage
.
getData
().
getData
().
forEach
(
usableVeicleVO
->
{
//判断是否预定时间内可租
usableVeicleVO
.
setAllowRent
(
SYS_TRUE
);
//如果"必须在这时间后预定" 存在 并且 比预定开始时间 要晚,那么不允许预定
if
(
null
!=
usableVeicleVO
.
getToLiftMustAfterDate
()
&&
DateUtil
.
date
(
shuntApply
.
getStartTime
()).
isBeforeOrEquals
(
usableVeicleVO
.
getToLiftMustAfterDate
()))
{
usableVeicleVO
.
setAllowRent
(
SYS_FALSE
);
}
//如果"必须在这时间前预定" 存在 并且 比预定结束时间 要早,那么不允许预定
if
(
null
!=
usableVeicleVO
.
getToReturnMustBeforeDate
()
&&
DateUtil
.
date
(
shuntApply
.
getEndTime
()).
isAfterOrEquals
(
usableVeicleVO
.
getToReturnMustBeforeDate
()))
{
usableVeicleVO
.
setAllowRent
(
SYS_FALSE
);
}
if
(
SYS_TRUE
.
equals
(
usableVeicleVO
.
getAllowRent
()))
{
vehicles
.
add
(
BeanUtil
.
toBean
(
usableVeicleVO
,
UsableVeicleVO
.
class
));
}
});
if
(
CollUtil
.
isNotEmpty
(
vehicles
))
{
StewardShuntApply
stewardShuntApply
=
BeanUtil
.
toBean
(
shuntApply
,
StewardShuntApply
.
class
);
stewardShuntApply
.
setVehicles
(
vehicles
);
returnList
.
add
(
stewardShuntApply
);
}
});
}
}
}
return
ObjectRestResponse
.
succ
(
returnList
);
}
@RequestMapping
(
value
=
"/steward/confirmApply"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
@ApiOperation
(
value
=
"后台确认申请"
)
@ApiOperation
(
value
=
"后台确认申请"
)
public
ObjectRestResponse
confirmApply
(
@RequestBody
c
onfirmApplyDTO
dto
)
{
public
ObjectRestResponse
stewardConfirmApply
(
@RequestBody
C
onfirmApplyDTO
dto
)
{
//查询列表数据
//查询列表数据
if
(
StrUtil
.
isBlank
(
getCurrentUserId
()))
{
if
(
StrUtil
.
isBlank
(
getCurrentUserId
()))
{
...
@@ -99,8 +186,18 @@ public class BgShuntApplyController extends BaseController<ShuntApplyBiz, ShuntA
...
@@ -99,8 +186,18 @@ public class BgShuntApplyController extends BaseController<ShuntApplyBiz, ShuntA
}
}
@Data
@Data
public
static
class
c
onfirmApplyDTO
{
public
static
class
C
onfirmApplyDTO
{
Integer
applyId
;
Integer
applyId
;
String
vehicleId
;
String
vehicleId
;
}
}
@Data
public
static
class
ListDTO
{
Integer
cityCode
;
}
@Data
public
static
class
StewardShuntApply
extends
ShuntApply
{
List
<
UsableVeicleVO
>
vehicles
;
}
}
}
\ No newline at end of file
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
View file @
326697dd
...
@@ -13,6 +13,7 @@ import com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO;
...
@@ -13,6 +13,7 @@ import com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO;
import
com.xxfc.platform.vehicle.pojo.vo.AccompanyingItemVo
;
import
com.xxfc.platform.vehicle.pojo.vo.AccompanyingItemVo
;
import
com.xxfc.platform.vehicle.pojo.vo.BranComanyLeaderVo
;
import
com.xxfc.platform.vehicle.pojo.vo.BranComanyLeaderVo
;
import
com.xxfc.platform.vehicle.pojo.vo.BranchCompanyListVO
;
import
com.xxfc.platform.vehicle.pojo.vo.BranchCompanyListVO
;
import
com.xxfc.platform.vehicle.pojo.vo.UsableVeicleVO
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
...
@@ -243,4 +244,7 @@ public interface VehicleFeign {
...
@@ -243,4 +244,7 @@ public interface VehicleFeign {
@RequestMapping
(
value
=
"/vehicleInfo/selectByCompanyIds"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/vehicleInfo/selectByCompanyIds"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
List
<
Vehicle
>>
vehicleSelectByCompanyIds
(
@RequestParam
(
"companyIds"
)
String
companyIds
);
public
ObjectRestResponse
<
List
<
Vehicle
>>
vehicleSelectByCompanyIds
(
@RequestParam
(
"companyIds"
)
String
companyIds
);
@RequestMapping
(
value
=
"/vehicleInfo/rent/apply/usable-vehicle"
,
method
=
RequestMethod
.
POST
)
public
ObjectRestResponse
<
PageDataVO
<
UsableVeicleVO
>>
applyUsableVehicle
(
@RequestBody
RentVehicleBookDTO
rbd
);
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/RentVehicleController.java
View file @
326697dd
...
@@ -195,6 +195,47 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
...
@@ -195,6 +195,47 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
return
ObjectRestResponse
.
succ
(
uvmvpdvs
);
return
ObjectRestResponse
.
succ
(
uvmvpdvs
);
}
}
@ApiOperation
(
"调车申请列表-可用车辆查询"
)
@RequestMapping
(
value
=
"/rent/apply/usable-vehicle"
,
method
=
RequestMethod
.
POST
)
@IgnoreUserToken
public
ObjectRestResponse
<
PageDataVO
<
UsableVeicleVO
>>
applyUsableVehicle
(
@RequestBody
RentVehicleBookDTO
rbd
)
{
// rbd.setModelId(data.getVehicleModel().getId());
// rbd.setParkBranchCompanyId(dto.getStartCompanyId());
// rbd.setStartCompanyId(dto.getStartCompanyId());
// rbd.setEndCompanyId(dto.getEndCompanyId());
// rbd.setBookStartDate(dto.getStartDate());
// rbd.setBookEndDate(dto.getEndDate());
// rbd.setBookStartDateTime(dto.getStartDateTime());
// rbd.setBookEndDateTime(dto.getEndDateTime());
rbd
.
setRecordIntersection
(
Boolean
.
TRUE
);
rbd
.
setLimit
(
100
);
rbd
.
setPage
(
1
);
rbd
.
setYearNo4Where
(
Boolean
.
TRUE
);
//查询可车辆信息
PageDataVO
<
UsableVeicleVO
>
pageDataVO
=
vehicleBiz
.
searchUsableVehicle
(
rbd
);
if
(
CollUtil
.
isNotEmpty
(
pageDataVO
.
getData
()))
{
for
(
UsableVeicleVO
usableVeicleVO
:
pageDataVO
.
getData
())
{
//判断是否预定时间内可租
usableVeicleVO
.
setAllowRent
(
SYS_TRUE
);
//如果"必须在这时间后预定" 存在 并且 比预定开始时间 要晚,那么不允许预定
if
(
null
!=
usableVeicleVO
.
getToLiftMustAfterDate
()
&&
DateUtil
.
parse
(
rbd
.
getBookStartDateTime
()).
isBeforeOrEquals
(
usableVeicleVO
.
getToLiftMustAfterDate
()))
{
usableVeicleVO
.
setAllowRent
(
SYS_FALSE
);
}
//如果"必须在这时间前预定" 存在 并且 比预定结束时间 要早,那么不允许预定
if
(
null
!=
usableVeicleVO
.
getToReturnMustBeforeDate
()
&&
DateUtil
.
parse
(
rbd
.
getBookEndDateTime
()).
isAfterOrEquals
(
usableVeicleVO
.
getToReturnMustBeforeDate
()))
{
usableVeicleVO
.
setAllowRent
(
SYS_FALSE
);
}
}
}
return
ObjectRestResponse
.
succ
(
pageDataVO
);
}
/**
/**
* 后台查询可用车辆(车型)
* 后台查询可用车辆(车型)
*
*
...
...
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