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
3ea61724
Commit
3ea61724
authored
Jan 08, 2020
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into feature-zjw
parents
1f8c0040
7e60347b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
13 deletions
+49
-13
BaseOrderMapper.xml
...rder-server/src/main/resources/mapper/BaseOrderMapper.xml
+2
-2
BranchCompanyVehicleCountBiz.java
...fc/platform/vehicle/biz/BranchCompanyVehicleCountBiz.java
+33
-2
VehicleCountRecordBiz.java
.../com/xxfc/platform/vehicle/biz/VehicleCountRecordBiz.java
+2
-1
VehicleWarningMsgBiz.java
...a/com/xxfc/platform/vehicle/biz/VehicleWarningMsgBiz.java
+3
-0
BranchCompanyVehicleCountController.java
...hicle/rest/admin/BranchCompanyVehicleCountController.java
+4
-4
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+5
-4
No files found.
xx-order/xx-order-server/src/main/resources/mapper/BaseOrderMapper.xml
View file @
3ea61724
...
@@ -323,7 +323,7 @@
...
@@ -323,7 +323,7 @@
(
(
(
(
orv.start_time
>
#{startTime}
orv.start_time
>
#{startTime}
AND orv.start_time
<
#{
start
Time}
AND orv.start_time
<
#{
end
Time}
AND orv.end_time
>
#{endTime}
AND orv.end_time
>
#{endTime}
)
)
OR (
OR (
...
@@ -332,7 +332,7 @@
...
@@ -332,7 +332,7 @@
)
)
OR (
OR (
orv.start_time
<
#{startTime}
orv.start_time
<
#{startTime}
AND orv.end_time
>
#{
end
Time}
AND orv.end_time
>
#{
start
Time}
AND orv.end_time
<
#{endTime}
AND orv.end_time
<
#{endTime}
)
)
OR (
OR (
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/BranchCompanyVehicleCountBiz.java
View file @
3ea61724
...
@@ -20,7 +20,10 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -20,7 +20,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
@Service
@Service
@Slf4j
@Slf4j
...
@@ -95,8 +98,8 @@ public class BranchCompanyVehicleCountBiz extends BaseBiz<BranchCompanyVehicleCo
...
@@ -95,8 +98,8 @@ public class BranchCompanyVehicleCountBiz extends BaseBiz<BranchCompanyVehicleCo
branchCompanyVehicleCountDTO
.
setPage
(
page
);
branchCompanyVehicleCountDTO
.
setPage
(
page
);
branchCompanyVehicleCountDTO
.
setLimit
(
limit
);
branchCompanyVehicleCountDTO
.
setLimit
(
limit
);
if
(
StringUtils
.
isBlank
(
branchCompanyVehicleCountDTO
.
getStartTime
())
||
StringUtils
.
isBlank
(
branchCompanyVehicleCountDTO
.
getEndTime
()))
{
if
(
StringUtils
.
isBlank
(
branchCompanyVehicleCountDTO
.
getStartTime
())
||
StringUtils
.
isBlank
(
branchCompanyVehicleCountDTO
.
getEndTime
()))
{
branchCompanyVehicleCountDTO
.
setStartTime
(
DateTime
.
now
().
minusDays
(
1
).
toString
(
DATE_TIME_FORMATTER
));
branchCompanyVehicleCountDTO
.
setStartTime
(
DateTime
.
now
().
toString
(
DATE_TIME_FORMATTER
));
branchCompanyVehicleCountDTO
.
setEndTime
(
DateTime
.
now
().
minusDays
(
1
).
toString
(
DATE_TIME_FORMATTER
));
branchCompanyVehicleCountDTO
.
setEndTime
(
DateTime
.
now
().
toString
(
DATE_TIME_FORMATTER
));
}
}
Query
query
=
new
Query
(
branchCompanyVehicleCountDTO
);
Query
query
=
new
Query
(
branchCompanyVehicleCountDTO
);
if
(
type
==
1
)
{
//按天
if
(
type
==
1
)
{
//按天
...
@@ -120,4 +123,32 @@ public class BranchCompanyVehicleCountBiz extends BaseBiz<BranchCompanyVehicleCo
...
@@ -120,4 +123,32 @@ public class BranchCompanyVehicleCountBiz extends BaseBiz<BranchCompanyVehicleCo
return
ObjectRestResponse
.
succ
(
new
PageDataVO
<>());
return
ObjectRestResponse
.
succ
(
new
PageDataVO
<>());
}
}
public
List
<
BranchCompanyVehicleCountVo
>
exportAllDate
(
BranchCompanyVehicleCountDTO
branchCompanyVehicleCountDTO
)
{
Integer
type
=
branchCompanyVehicleCountDTO
.
getType
()
==
null
?
1
:
branchCompanyVehicleCountDTO
.
getType
();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
if
(
branchCompanyVehicleCountDTO
.
getCompanyId
()
!=
null
)
{
param
.
put
(
"companyId"
,
branchCompanyVehicleCountDTO
.
getCompanyId
());
}
if
(
type
==
1
)
{
//按天
return
mapper
.
getAllCountInfo
(
param
);
}
if
(
type
==
2
)
{
//按周
List
<
BranchCompanyVehicleCountVo
>
pageDataVO
=
mapper
.
countByWeek
(
param
);
if
(
pageDataVO
!=
null
&&
pageDataVO
.
size
()
>
0
)
{
pageDataVO
.
parallelStream
().
forEach
(
result
->
{
String
weekStartDate
=
OrderDateUtils
.
getStartDayOfWeekNo
(
result
.
getCountYear
(),
result
.
getCountWeek
());
String
weekEndDate
=
OrderDateUtils
.
getEndDayOfWeekNo
(
result
.
getCountYear
(),
result
.
getCountWeek
());
result
.
setWeekStartDate
(
weekStartDate
);
result
.
setWeekEndDate
(
weekEndDate
);
});
}
return
pageDataVO
;
}
if
(
type
==
3
)
{
//按月
return
mapper
.
countByMonth
(
param
);
}
return
new
ArrayList
<>();
}
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleCountRecordBiz.java
View file @
3ea61724
...
@@ -123,7 +123,8 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
...
@@ -123,7 +123,8 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
DateTime
startDay
=
DateTime
.
parse
(
startDate
,
DEFAULT_DATE_TIME_FORMATTER
);
DateTime
startDay
=
DateTime
.
parse
(
startDate
,
DEFAULT_DATE_TIME_FORMATTER
);
DateTime
endDay
=
DateTime
.
parse
(
endDate
,
DEFAULT_DATE_TIME_FORMATTER
);
DateTime
endDay
=
DateTime
.
parse
(
endDate
,
DEFAULT_DATE_TIME_FORMATTER
);
int
i
=
0
;
int
i
=
0
;
for
(
DateTime
curDate
=
startDay
;
i
<
30
;
curDate
=
curDate
.
minusDays
(
1
))
{
int
monthDay
=
endDay
.
getDayOfMonth
()
-
startDay
.
getDayOfMonth
()
+
1
;
for
(
DateTime
curDate
=
startDay
;
i
<
monthDay
;
curDate
=
curDate
.
minusDays
(
1
))
{
i
++;
i
++;
nowTime
=
curDate
.
getMillis
();
nowTime
=
curDate
.
getMillis
();
lastTime
=
nowTime
+
24
*
3600
*
1000
-
1
;
lastTime
=
nowTime
+
24
*
3600
*
1000
-
1
;
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleWarningMsgBiz.java
View file @
3ea61724
...
@@ -103,6 +103,9 @@ public class VehicleWarningMsgBiz extends BaseBiz<VehicleWarningMsgMapper, Vehic
...
@@ -103,6 +103,9 @@ public class VehicleWarningMsgBiz extends BaseBiz<VehicleWarningMsgMapper, Vehic
*/
*/
public
RestResponse
<
PageDataVO
<
VehicleWarningMsg
>>
getByPage
(
String
queryVehicleWarningMsgVoJson
){
public
RestResponse
<
PageDataVO
<
VehicleWarningMsg
>>
getByPage
(
String
queryVehicleWarningMsgVoJson
){
try
{
try
{
if
(
StringUtils
.
isBlank
(
queryVehicleWarningMsgVoJson
))
{
return
RestResponse
.
codeAndMessage
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
(),
ResCode
.
INVALID_REST_REQ_PARAM
.
getDesc
());
}
QueryVehicleWarningMsgVo
queryVehicleWarningMsgVo
=
JSON
.
parseObject
(
queryVehicleWarningMsgVoJson
,
QueryVehicleWarningMsgVo
.
class
);
QueryVehicleWarningMsgVo
queryVehicleWarningMsgVo
=
JSON
.
parseObject
(
queryVehicleWarningMsgVoJson
,
QueryVehicleWarningMsgVo
.
class
);
PageHelper
.
startPage
(
queryVehicleWarningMsgVo
.
getPage
(),
queryVehicleWarningMsgVo
.
getLimit
());
PageHelper
.
startPage
(
queryVehicleWarningMsgVo
.
getPage
(),
queryVehicleWarningMsgVo
.
getLimit
());
UserDTO
userDTO
=
getAdminUserInfo
();
UserDTO
userDTO
=
getAdminUserInfo
();
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/admin/BranchCompanyVehicleCountController.java
View file @
3ea61724
...
@@ -4,7 +4,6 @@ import cn.hutool.core.io.IoUtil;
...
@@ -4,7 +4,6 @@ import cn.hutool.core.io.IoUtil;
import
cn.hutool.poi.excel.ExcelUtil
;
import
cn.hutool.poi.excel.ExcelUtil
;
import
cn.hutool.poi.excel.ExcelWriter
;
import
cn.hutool.poi.excel.ExcelWriter
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.vehicle.biz.BranchCompanyVehicleCountBiz
;
import
com.xxfc.platform.vehicle.biz.BranchCompanyVehicleCountBiz
;
import
com.xxfc.platform.vehicle.common.BaseController
;
import
com.xxfc.platform.vehicle.common.BaseController
;
import
com.xxfc.platform.vehicle.pojo.BranchCompanyVehicleCountVo
;
import
com.xxfc.platform.vehicle.pojo.BranchCompanyVehicleCountVo
;
...
@@ -17,6 +16,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
...
@@ -17,6 +16,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
@Controller
@Controller
@RequestMapping
(
value
=
"/bg-vehicle/count"
)
@RequestMapping
(
value
=
"/bg-vehicle/count"
)
...
@@ -33,8 +33,8 @@ public class BranchCompanyVehicleCountController extends BaseController<BranchCo
...
@@ -33,8 +33,8 @@ public class BranchCompanyVehicleCountController extends BaseController<BranchCo
}
}
@GetMapping
(
"/app/unauth/export"
)
@GetMapping
(
"/app/unauth/export"
)
public
void
exportVehicleInfo
(
BranchCompanyVehicleCountDTO
branchCompanyVehicleCountDTO
)
throws
Exception
{
public
void
exportVehicleInfo
(
BranchCompanyVehicleCountDTO
branchCompanyVehicleCountDTO
)
throws
Exception
{
PageDataVO
<
BranchCompanyVehicleCountVo
>
pageDataVO
=
baseBiz
.
getAllCountInfo
(
branchCompanyVehicleCountDTO
).
getData
(
);
List
<
BranchCompanyVehicleCountVo
>
pageDataVO
=
baseBiz
.
exportAllDate
(
branchCompanyVehicleCountDTO
);
if
(
pageDataVO
!=
null
&&
pageDataVO
.
getData
()
!=
null
)
{
if
(
pageDataVO
!=
null
&&
pageDataVO
.
size
()
>
0
)
{
ExcelWriter
writer
=
ExcelUtil
.
getWriter
(
true
);
ExcelWriter
writer
=
ExcelUtil
.
getWriter
(
true
);
writer
.
addHeaderAlias
(
"companyId"
,
"公司ID"
);
writer
.
addHeaderAlias
(
"companyId"
,
"公司ID"
);
writer
.
addHeaderAlias
(
"companyName"
,
"公司名"
);
writer
.
addHeaderAlias
(
"companyName"
,
"公司名"
);
...
@@ -50,7 +50,7 @@ public class BranchCompanyVehicleCountController extends BaseController<BranchCo
...
@@ -50,7 +50,7 @@ public class BranchCompanyVehicleCountController extends BaseController<BranchCo
writer
.
setColumnWidth
(
6
,
17
);
writer
.
setColumnWidth
(
6
,
17
);
writer
.
setColumnWidth
(
1
,
17
);
writer
.
setColumnWidth
(
1
,
17
);
// 一次性写出内容,使用默认样式,强制输出标题
// 一次性写出内容,使用默认样式,强制输出标题
writer
.
write
(
pageDataVO
.
getData
()
,
true
);
writer
.
write
(
pageDataVO
,
true
);
//response为HttpServletResponse对象
//response为HttpServletResponse对象
response
.
setContentType
(
"application/vnd.ms-excel;charset=utf-8"
);
response
.
setContentType
(
"application/vnd.ms-excel;charset=utf-8"
);
//test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
//test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
3ea61724
...
@@ -598,16 +598,17 @@
...
@@ -598,16 +598,17 @@
SELECT
SELECT
b.id AS companyId,
b.id AS companyId,
DATE_FORMAT(
DATE_FORMAT(
DATE_SUB(NOW(), INTERVAL 1 DAY
),
NOW(
),
'%Y'
'%Y'
) AS countYear,
) AS countYear,
DATE_FORMAT(
DATE_SUB(NOW(), INTERVAL 1 DAY
), '%m') AS countMonth,
DATE_FORMAT(
NOW(
), '%m') AS countMonth,
DATE_FORMAT(
DATE_SUB(NOW(), INTERVAL 1 DAY
), '%u') AS countWeek,
DATE_FORMAT(
NOW(
), '%u') AS countWeek,
DATE_FORMAT(
DATE_SUB(NOW(), INTERVAL 1 DAY
), '%Y-%m-%d') AS countDate,
DATE_FORMAT(
NOW(
), '%Y-%m-%d') AS countDate,
count(*) AS vehicleNum
count(*) AS vehicleNum
FROM
FROM
vehicle v
vehicle v
LEFT JOIN branch_company b ON b.id = v.park_branch_company_id
LEFT JOIN branch_company b ON b.id = v.park_branch_company_id
where v.is_del = 0
GROUP BY
GROUP BY
b.id
b.id
</select>
</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