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
6b67dc15
Commit
6b67dc15
authored
Nov 18, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master-vehicle-bg'
parents
fa28e058
1c46624e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
8 deletions
+62
-8
BranchCompanyVehicleCount.java
...xxfc/platform/vehicle/pojo/BranchCompanyVehicleCount.java
+9
-0
ImportVehicleDataBiz.java
...a/com/xxfc/platform/vehicle/biz/ImportVehicleDataBiz.java
+2
-4
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+4
-0
VehicleInformationDownloadBiz.java
...c/platform/vehicle/biz/VehicleInformationDownloadBiz.java
+6
-0
VehicleMapper.java
.../java/com/xxfc/platform/vehicle/mapper/VehicleMapper.java
+2
-0
VehicleInformationDownloadController.java
...icle/rest/admin/VehicleInformationDownloadController.java
+25
-3
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+14
-1
No files found.
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/BranchCompanyVehicleCount.java
0 → 100644
View file @
6b67dc15
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
;
import
lombok.Data
;
@Data
public
class
BranchCompanyVehicleCount
{
private
String
parkBranchCompanyName
;
private
Integer
count
;
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/ImportVehicleDataBiz.java
View file @
6b67dc15
package
com
.
xxfc
.
platform
.
vehicle
.
biz
;
package
com
.
xxfc
.
platform
.
vehicle
.
biz
;
import
cn.hutool.core.date.DateField
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateTime
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.xxfc.platform.vehicle.entity.Constant
;
import
com.xxfc.platform.vehicle.entity.Constant
;
...
@@ -15,7 +14,6 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -15,7 +14,6 @@ import org.springframework.transaction.annotation.Transactional;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -138,8 +136,8 @@ public class ImportVehicleDataBiz extends BaseBiz<VehicleMapper, Vehicle> {
...
@@ -138,8 +136,8 @@ public class ImportVehicleDataBiz extends BaseBiz<VehicleMapper, Vehicle> {
}
}
}
}
System
.
out
.
println
(
"stringBuffer:"
+
stringBuffer
);
log
.
info
(
"stringBuffer:"
+
stringBuffer
);
System
.
out
.
println
(
"stringBuffer2:"
+
stringBuffer2
);
log
.
info
(
"stringBuffer2:"
+
stringBuffer2
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
log
.
error
(
e
.
getMessage
());
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
6b67dc15
...
@@ -1514,4 +1514,8 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -1514,4 +1514,8 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
return
vehicles
.
stream
().
map
(
Vehicle:
:
getId
).
collect
(
Collectors
.
toList
());
return
vehicles
.
stream
().
map
(
Vehicle:
:
getId
).
collect
(
Collectors
.
toList
());
}
}
public
List
<
BranchCompanyVehicleCount
>
getAllVehicleInfo
()
{
return
mapper
.
getAllVehicleInfo
();
}
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleInformationDownloadBiz.java
View file @
6b67dc15
...
@@ -6,6 +6,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
...
@@ -6,6 +6,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.mapper.VehicleMapper
;
import
com.xxfc.platform.vehicle.mapper.VehicleMapper
;
import
com.xxfc.platform.vehicle.pojo.BranchCompanyVehicleCount
;
import
com.xxfc.platform.vehicle.pojo.ResultVehicleVo
;
import
com.xxfc.platform.vehicle.pojo.ResultVehicleVo
;
import
com.xxfc.platform.vehicle.pojo.VehicleExcelVo
;
import
com.xxfc.platform.vehicle.pojo.VehicleExcelVo
;
import
com.xxfc.platform.vehicle.pojo.VehiclePageQueryVo
;
import
com.xxfc.platform.vehicle.pojo.VehiclePageQueryVo
;
...
@@ -92,4 +93,9 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl
...
@@ -92,4 +93,9 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl
return
arrayList
;
return
arrayList
;
}
}
public
List
<
BranchCompanyVehicleCount
>
getAllVehicleInfo
()
{
return
vehicleBiz
.
getAllVehicleInfo
();
}
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/VehicleMapper.java
View file @
6b67dc15
...
@@ -53,4 +53,6 @@ public interface VehicleMapper extends Mapper<Vehicle> {
...
@@ -53,4 +53,6 @@ public interface VehicleMapper extends Mapper<Vehicle> {
@Select
(
"select `id` from `vehicle` where `is_del`=0"
)
@Select
(
"select `id` from `vehicle` where `is_del`=0"
)
List
<
String
>
findExistVehicleIds
();
List
<
String
>
findExistVehicleIds
();
List
<
BranchCompanyVehicleCount
>
getAllVehicleInfo
();
}
}
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/admin/VehicleInformationDownloadController.java
View file @
6b67dc15
...
@@ -10,6 +10,7 @@ import com.github.wxiaoqi.security.common.exception.BaseException;
...
@@ -10,6 +10,7 @@ import com.github.wxiaoqi.security.common.exception.BaseException;
import
com.xxfc.platform.vehicle.biz.VehicleBiz
;
import
com.xxfc.platform.vehicle.biz.VehicleBiz
;
import
com.xxfc.platform.vehicle.biz.VehicleInformationDownloadBiz
;
import
com.xxfc.platform.vehicle.biz.VehicleInformationDownloadBiz
;
import
com.xxfc.platform.vehicle.common.BaseController
;
import
com.xxfc.platform.vehicle.common.BaseController
;
import
com.xxfc.platform.vehicle.pojo.BranchCompanyVehicleCount
;
import
com.xxfc.platform.vehicle.pojo.VehicleExcelVo
;
import
com.xxfc.platform.vehicle.pojo.VehicleExcelVo
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -41,10 +42,10 @@ public class VehicleInformationDownloadController extends BaseController<Vehicle
...
@@ -41,10 +42,10 @@ public class VehicleInformationDownloadController extends BaseController<Vehicle
HttpServletResponse
response
;
HttpServletResponse
response
;
@GetMapping
(
"/excel"
)
@GetMapping
(
"/excel"
)
public
void
downloadExcel
(
@RequestParam
(
value
=
"vehiclePageQueryVoJson"
,
required
=
false
)
String
vehiclePageQueryVoJson
)
throws
Exception
{
public
void
downloadExcel
(
@RequestParam
(
value
=
"vehiclePageQueryVoJson"
,
required
=
false
)
String
vehiclePageQueryVoJson
)
throws
Exception
{
UserDTO
userDTO
=
userFeign
.
userinfoByToken
(
userAuthConfig
.
getToken
(
request
)).
getData
();
UserDTO
userDTO
=
userFeign
.
userinfoByToken
(
userAuthConfig
.
getToken
(
request
)).
getData
();
if
(
userDTO
==
null
)
{
if
(
userDTO
==
null
)
{
throw
new
BaseException
(
"token已失效"
);
throw
new
BaseException
(
"token已失效"
);
}
}
List
<
VehicleExcelVo
>
rows
=
baseBiz
.
getList
(
vehiclePageQueryVoJson
,
userDTO
);
List
<
VehicleExcelVo
>
rows
=
baseBiz
.
getList
(
vehiclePageQueryVoJson
,
userDTO
);
ExcelWriter
writer
=
ExcelUtil
.
getWriter
(
true
);
ExcelWriter
writer
=
ExcelUtil
.
getWriter
(
true
);
...
@@ -67,4 +68,25 @@ public class VehicleInformationDownloadController extends BaseController<Vehicle
...
@@ -67,4 +68,25 @@ public class VehicleInformationDownloadController extends BaseController<Vehicle
//此处记得关闭输出Servlet流
//此处记得关闭输出Servlet流
IoUtil
.
close
(
out
);
IoUtil
.
close
(
out
);
}
}
@GetMapping
(
"/app/unauth/export"
)
public
void
exportVehicleInfo
()
throws
Exception
{
List
<
BranchCompanyVehicleCount
>
rows
=
baseBiz
.
getAllVehicleInfo
();
ExcelWriter
writer
=
ExcelUtil
.
getWriter
(
true
);
writer
.
addHeaderAlias
(
"parkBranchCompanyName"
,
"停靠分公司"
);
writer
.
addHeaderAlias
(
"count"
,
"车辆数量"
);
// 一次性写出内容,使用默认样式,强制输出标题
writer
.
write
(
rows
,
true
);
//response为HttpServletResponse对象
response
.
setContentType
(
"application/vnd.ms-excel;charset=utf-8"
);
//test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename=vehicleInfo.xlsx"
);
//out为OutputStream,需要写出到的目标流
ServletOutputStream
out
=
response
.
getOutputStream
();
writer
.
flush
(
out
,
true
);
// 关闭writer,释放内存
writer
.
close
();
//此处记得关闭输出Servlet流
IoUtil
.
close
(
out
);
}
}
}
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
6b67dc15
...
@@ -590,7 +590,20 @@
...
@@ -590,7 +590,20 @@
) r ORDER BY r.parkBranchCompanyName
) r ORDER BY r.parkBranchCompanyName
</select>
</select>
<!--导出分公司停靠所有车辆-->
<select
id=
"getAllVehicleInfo"
resultType=
"com.xxfc.platform.vehicle.pojo.BranchCompanyVehicleCount"
>
SELECT
b1. NAME AS parkBranchCompanyName,
count(v1.id) as count
FROM
branch_company b1
LEFT JOIN vehicle v1 ON v1.park_branch_company_id = b1.id
WHERE
b1.is_del = 0
AND v1.is_del = 0
GROUP BY b1.`name`
order by b1.`name`
</select>
<select
id=
"lockByCode"
resultType=
"com.xxfc.platform.vehicle.entity.Vehicle"
<select
id=
"lockByCode"
resultType=
"com.xxfc.platform.vehicle.entity.Vehicle"
parameterType=
"com.xxfc.platform.vehicle.pojo.AddOrUpdateVehicleVo"
>
parameterType=
"com.xxfc.platform.vehicle.pojo.AddOrUpdateVehicleVo"
>
...
...
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