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
e3e27fa6
Commit
e3e27fa6
authored
Sep 14, 2020
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改车辆排班和出车记录
parent
64622f9a
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
207 additions
and
5 deletions
+207
-5
DepartureLogVo.java
...n/java/com/xxfc/platform/vehicle/pojo/DepartureLogVo.java
+12
-0
VehiclePlanDto.java
...va/com/xxfc/platform/vehicle/pojo/dto/VehiclePlanDto.java
+8
-1
BranchCompanyBiz.java
.../java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
+13
-0
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+13
-0
VehicleController.java
...ava/com/xxfc/platform/vehicle/rest/VehicleController.java
+3
-2
VehicleDepartureController.java
...xfc/platform/vehicle/rest/VehicleDepartureController.java
+1
-1
VehicleDepartureLogMapper.xml
...r/src/main/resources/mapper/VehicleDepartureLogMapper.xml
+3
-1
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+115
-0
VehicleWarningMsgMapper.xml
...ver/src/main/resources/mapper/VehicleWarningMsgMapper.xml
+39
-0
No files found.
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/DepartureLogVo.java
View file @
e3e27fa6
...
...
@@ -44,6 +44,18 @@ public class DepartureLogVo extends VehicleDepartureLog {
*/
private
String
departureName
;
/**
* 预计收车门店
*/
private
String
expectArrivalName
;
/**
* 所属门店
*/
private
String
subordinateName
;
/**
* 公里数统计
*/
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/dto/VehiclePlanDto.java
View file @
e3e27fa6
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
.
dto
;
import
com.github.wxiaoqi.security.common.vo.DataInter
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -7,7 +8,7 @@ import lombok.Data;
import
java.util.List
;
@Data
public
class
VehiclePlanDto
extends
PageParam
{
public
class
VehiclePlanDto
extends
PageParam
implements
DataInter
{
/**
* 车辆编号
...
...
@@ -50,4 +51,10 @@ public class VehiclePlanDto extends PageParam {
* 车型id
*/
private
Integer
modelId
;
private
Long
branchId
;
List
<
Integer
>
dataCorporationIds
;
List
<
Integer
>
dataCompanyIds
;
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
View file @
e3e27fa6
...
...
@@ -312,6 +312,19 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
}
public
List
<
BranchCompany
>
dataBranch
(
String
dataZone
)
{
if
(
StringUtils
.
isBlank
(
dataZone
))
{
return
new
ArrayList
<
BranchCompany
>();
}
List
<
Integer
>
zoneIds
=
Arrays
.
asList
(
dataZone
.
split
(
","
)).
parallelStream
().
map
(
s
->
Integer
.
valueOf
(
s
)).
collect
(
Collectors
.
toList
());
Example
example
=
new
Example
(
BranchCompany
.
class
);
example
.
createCriteria
().
andIn
(
"companyId"
,
zoneIds
);
List
<
BranchCompany
>
zoneCompanys
=
selectByExample
(
example
);
return
zoneCompanys
;
}
public
RestResponse
<
String
>
importExcel
(
MultipartFile
multipartfile
,
HttpServletRequest
request
)
{
try
{
List
<
String
[]>
readExcel
=
ExcelImport
.
getExcelData
(
multipartfile
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
e3e27fa6
...
...
@@ -1189,6 +1189,19 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
//去重
return
zoneCompanyIds
.
parallelStream
().
distinct
().
collect
(
Collectors
.
toList
());
}
public
List
<
Integer
>
dataBranch
(
String
dataZone
,
String
dataCompany
)
{
List
<
Integer
>
zoneCompanyIds
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotBlank
(
dataZone
)){
List
<
BranchCompany
>
zoneCompanys
=
branchCompanyBiz
.
dataBranch
(
dataZone
);
zoneCompanyIds
=
zoneCompanys
.
parallelStream
().
map
(
BranchCompany:
:
getId
).
collect
(
Collectors
.
toList
());
}
if
(
StringUtils
.
isNotBlank
(
dataCompany
))
{
List
<
Integer
>
dataCompanyIds
=
Arrays
.
asList
(
dataCompany
.
split
(
","
)).
parallelStream
().
map
(
s
->
Integer
.
valueOf
(
s
)).
collect
(
Collectors
.
toList
());
zoneCompanyIds
.
addAll
(
dataCompanyIds
);
}
//去重
return
zoneCompanyIds
.
parallelStream
().
distinct
().
collect
(
Collectors
.
toList
());
}
public
PageDataVO
<
UsableVehicleModelVO
>
searchUsableModel
(
UsableVeicleDTO
dto
)
{
Map
<
String
,
Object
>
params
=
BeanUtil
.
beanToMap
(
dto
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleController.java
View file @
e3e27fa6
...
...
@@ -453,7 +453,7 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
@IgnoreClientToken
@IgnoreUserToken
public
ObjectRestResponse
<
Map
<
String
,
Object
>>
getVehiclePlanList
(
VehiclePlanDto
vehiclePlanDto
)
{
UserDTO
userDTO
=
getAdminUserInfo
();
/*
UserDTO userDTO = getAdminUserInfo();
if(userDTO == null) {
return ObjectRestResponse.createFailedResult(ResultCode.RSTOKEN_EXPIRED_CODE, "token失效");
}
...
...
@@ -480,7 +480,8 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
}
}
}
vehiclePlanDto
.
setCompanyIds
(
companyList
);
vehiclePlanDto.setCompanyIds(companyList);*/
setPowerData
(
vehiclePlanDto
,
true
);
//获取列表
PageDataVO
<
VehicleAndModelInfoVo
>
pageDataVO
=
baseBiz
.
getAllVehicle
(
vehiclePlanDto
);
//获取警告信息
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleDepartureController.java
View file @
e3e27fa6
...
...
@@ -75,7 +75,7 @@ public class VehicleDepartureController {
UserDTO
userDTO
=
userFeign
.
userinfoByToken
(
userAuthConfig
.
getToken
(
request
)).
getData
();
if
(
userDTO
!=
null
)
{
if
(
userDTO
.
getDataAll
()
==
2
)
{
List
<
Integer
>
companyList
=
vehicleBiz
.
data
Company
(
userDTO
.
getDataZone
(),
userDTO
.
getDataCompany
());
List
<
Integer
>
companyList
=
vehicleBiz
.
data
Branch
(
userDTO
.
getDataCorporation
(),
userDTO
.
getDataCompany
());
return
RestResponse
.
data
(
vehicleDepartureService
.
pageNotAllData
(
numberPlate
,
code
,
zoneId
,
departureId
,
arrivalBranchCompanyId
,
use
,
startTime
,
endTime
,
page
,
limit
,
companyList
));
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleDepartureLogMapper.xml
View file @
e3e27fa6
...
...
@@ -143,13 +143,15 @@
- unix_timestamp(vehicle_departure_log.departure_time)) MOD
86400/3600,(unix_timestamp(vehicle_departure_log.arrival_time) -
unix_timestamp(vehicle_departure_log.departure_time))/3600)),0),'小时')
as departureDay,bc.name as departureName,bc1.name as arrivalName,
as departureDay,bc.name as departureName,bc1.name as arrivalName,
bc2.name as expectArrivalName,bc3.name as subordinateName,
IF((IFNULL(vehicle_departure_log.mileage_end,0)-IFNULL(vehicle_departure_log.mileage_start,0))>0,IFNULL(vehicle_departure_log.mileage_end,0)-IFNULL(vehicle_departure_log.mileage_start,0),0)
as mileage
from vehicle_departure_log
left join vehicle on vehicle_departure_log.vehicle_id = vehicle.id
LEFT JOIN branch_company bc ON vehicle_departure_log.departure_branch_company_id = bc.id
LEFT JOIN branch_company bc1 ON vehicle_departure_log.arrival_branch_company_id = bc1.id
LEFT JOIN branch_company bc2 ON vehicle_departure_log.expect_arrival_branch_company_id = bc2.id
LEFT JOIN branch_company bc3 ON vehicle.subordinate_branch = bc3.id
LEFT JOIN vehicle_book_record bc2 ON vehicle_departure_log.book_record_id = bc2.id
<trim
prefix=
"where"
suffixOverrides=
"and"
>
<if
test=
"numberPlate != null and numberPlate != ''"
>
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
e3e27fa6
...
...
@@ -753,6 +753,12 @@
#{id}
</foreach>
</if>
<if
test=
"parkBranchCompanyId != null and parkBranchCompanyId > 0"
>
and (bc2.id = #{parkBranchCompanyId} or bc3.id = #{parkBranchCompanyId}or bc4.id = #{parkBranchCompanyId})
</if>
<if
test=
"branchId != null and branchId > 0"
>
and (bc2.company_id = #{branchId} or bc3.company_id = #{branchId} or bc4.company_id = #{branchId})
</if>
<if
test=
"zoneId !=null"
>
and bc2.zone_id = #{zoneId}
</if>
...
...
@@ -765,6 +771,37 @@
<if
test=
"code !=null"
>
and v1.code=#{code}
</if>
<if
test=
"dataCompanyIds != null and dataCompanyIds.size() > 0"
>
and ( bc2.id in
<foreach
collection=
"dataCompanyIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
or bc3.id in
<foreach
collection=
"dataCompanyIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
or bc4.id in
<foreach
collection=
"dataCompanyIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
)
</if>
<if
test=
"dataCorporationIds != null and dataCorporationIds.size() > 0"
>
and ( bc2.company_id in
<foreach
collection=
"dataCorporationIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
or bc3.company_id in
<foreach
collection=
"dataCorporationIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
or bc4.company_id in
<foreach
collection=
"dataCorporationIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
)
</if>
and v1.is_del != 1
</where>
</select>
...
...
@@ -850,6 +887,8 @@
from vehicle v1
-- 所属分公司
LEFT JOIN branch_company bc1 ON v1.subordinate_branch = bc1.id
LEFT JOIN branch_company bc3 ON v1.park_branch_company_id = bc3.id
LEFT JOIN branch_company bc4 ON v1.expect_destination_branch_company_id = bc4.id
<where>
<if
test=
"startTime != null"
>
and v1.create_time between #{startTime} and #{endTime}
...
...
@@ -868,6 +907,43 @@
<foreach
collection=
"companyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</if>
<if
test=
"parkBranchCompanyId != null and parkBranchCompanyId > 0"
>
and (bc1.id = #{parkBranchCompanyId} or bc3.id = #{parkBranchCompanyId}or bc4.id = #{parkBranchCompanyId})
</if>
<if
test=
"branchId != null and branchId > 0"
>
and (bc1.company_id = #{branchId} or bc3.company_id = #{branchId} or bc4.company_id = #{branchId})
</if>
<if
test=
"dataCompanyIds != null and dataCompanyIds.size() > 0"
>
and ( bc1.id in
<foreach
collection=
"dataCompanyIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
or bc3.id in
<foreach
collection=
"dataCompanyIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
or bc4.id in
<foreach
collection=
"dataCompanyIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
)
</if>
<if
test=
"dataCorporationIds != null and dataCorporationIds.size() > 0"
>
and ( bc1.company_id in
<foreach
collection=
"dataCorporationIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
or bc3.company_id in
<foreach
collection=
"dataCorporationIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
or bc4.company_id in
<foreach
collection=
"dataCorporationIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
)
</if>
and v1.is_del != 1
</where>
...
...
@@ -876,6 +952,8 @@
SELECT count(*) total, '0' travel_status, '总数' detail from vehicle v2
-- 所属分公司
LEFT JOIN branch_company bc2 ON v2.subordinate_branch = bc2.id
LEFT JOIN branch_company bc3 ON v1.park_branch_company_id = bc3.id
LEFT JOIN branch_company bc4 ON v1.expect_destination_branch_company_id = bc4.id
<where>
<if
test=
"startTime != null"
>
and v2.create_time between #{startTime} and #{endTime}
...
...
@@ -897,6 +975,43 @@
</if>
<if
test=
"modelId != null and modelId != ''"
>
and v2.model_id = #{modelId}
</if>
<if
test=
"parkBranchCompanyId != null and parkBranchCompanyId > 0"
>
and (bc2.id = #{parkBranchCompanyId} or bc3.id = #{parkBranchCompanyId}or bc4.id = #{parkBranchCompanyId})
</if>
<if
test=
"branchId != null and branchId > 0"
>
and (bc2.company_id = #{branchId} or bc3.company_id = #{branchId} or bc4.company_id = #{branchId})
</if>
<if
test=
"dataCompanyIds != null and dataCompanyIds.size() > 0"
>
and ( bc2.id in
<foreach
collection=
"dataCompanyIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
or bc3.id in
<foreach
collection=
"dataCompanyIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
or bc4.id in
<foreach
collection=
"dataCompanyIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
)
</if>
<if
test=
"dataCorporationIds != null and dataCorporationIds.size() > 0"
>
and ( bc2.company_id in
<foreach
collection=
"dataCorporationIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
or bc3.company_id in
<foreach
collection=
"dataCorporationIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
or bc4.company_id in
<foreach
collection=
"dataCorporationIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
)
</if>
and v2.is_del != 1
</where>
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleWarningMsgMapper.xml
View file @
e3e27fa6
...
...
@@ -45,6 +45,8 @@
from vehicle_warning_msg w
left join vehicle v on w.vehicle_id = v.id
LEFT JOIN branch_company bc2 ON v.subordinate_branch = bc2.id
LEFT JOIN branch_company bc3 ON v.park_branch_company_id = bc3.id
LEFT JOIN branch_company bc4 ON v.expect_destination_branch_company_id = bc4.id
<where>
<if
test=
"vehicleId != null"
>
and w.vehicle_id = #{vehicleId}
...
...
@@ -70,6 +72,43 @@
#{id}
</foreach>
</if>
<if
test=
"parkBranchCompanyId != null and parkBranchCompanyId > 0"
>
and (bc2.id = #{parkBranchCompanyId} or bc3.id = #{parkBranchCompanyId}or bc4.id = #{parkBranchCompanyId})
</if>
<if
test=
"branchId != null and branchId > 0"
>
and (bc2.company_id = #{branchId} or bc3.company_id = #{branchId} or bc4.company_id = #{branchId})
</if>
<if
test=
"dataCompanyIds != null and dataCompanyIds.size() > 0"
>
and ( bc2.id in
<foreach
collection=
"dataCompanyIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
or bc3.id in
<foreach
collection=
"dataCompanyIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
or bc4.id in
<foreach
collection=
"dataCompanyIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
)
</if>
<if
test=
"dataCorporationIds != null and dataCorporationIds.size() > 0"
>
and ( bc2.company_id in
<foreach
collection=
"dataCorporationIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
or bc3.company_id in
<foreach
collection=
"dataCorporationIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
or bc4.company_id in
<foreach
collection=
"dataCorporationIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
)
</if>
</where>
</select>
...
...
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