Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
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
项目统一框架
amos-boot-biz
Commits
fa45eb1a
Commit
fa45eb1a
authored
Aug 16, 2024
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
气瓶下钻页面功能-修改
parent
e9815511
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
15 deletions
+51
-15
CylinderDPStatisticsServiceImpl.java
...tcs/biz/service/impl/CylinderDPStatisticsServiceImpl.java
+48
-14
CylinderInfoMapper.xml
...-ymt-api/src/main/resources/mapper/CylinderInfoMapper.xml
+3
-1
No files found.
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/CylinderDPStatisticsServiceImpl.java
View file @
fa45eb1a
...
...
@@ -527,15 +527,22 @@ public class CylinderDPStatisticsServiceImpl {
List
<
Double
>
offloadingVolumes
=
new
ArrayList
<>();
String
fillingStartTime
,
fillingEndTime
;
if
(
ObjectUtils
.
isEmpty
(
dpFilterParamForDetailDto
.
getTimeSearchOne
()
.
getBeginDate
()
))
{
if
(
ObjectUtils
.
isEmpty
(
dpFilterParamForDetailDto
.
getTimeSearchOne
()))
{
fillingStartTime
=
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
))
+
" 00:00:00"
;
fillingEndTime
=
LocalDate
.
now
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
))
+
" 23:59:59"
;
}
else
{
fillingStartTime
=
dpFilterParamForDetailDto
.
getTimeSearchOne
().
getBeginDate
()
+
" 00:00:00"
;
fillingEndTime
=
dpFilterParamForDetailDto
.
getTimeSearchOne
().
getBeginDate
()
+
" 23:59:59"
;
if
(!
ObjectUtils
.
isEmpty
(
dpFilterParamForDetailDto
.
getTimeSearchOne
().
getBeginDate
()))
{
fillingStartTime
=
dpFilterParamForDetailDto
.
getTimeSearchOne
().
getBeginDate
();
}
else
{
fillingStartTime
=
null
;
}
if
(!
ObjectUtils
.
isEmpty
(
dpFilterParamForDetailDto
.
getTimeSearchOne
().
getEndDate
()))
{
fillingEndTime
=
dpFilterParamForDetailDto
.
getTimeSearchOne
().
getEndDate
();
}
else
{
fillingEndTime
=
null
;
}
}
List
<
Map
<
String
,
Object
>>
list
=
getFillingQuantity
(
dpFilterParamForDetailDto
,
fillingStartTime
,
fillingEndTime
);
regionModels
.
forEach
(
r
->
{
//充装量和
List
<
Map
<
String
,
Object
>>
regionCode
=
list
.
stream
().
filter
(
e
->
e
.
get
(
"regionCode"
).
toString
().
contains
(
r
.
getRegionCode
().
toString
())).
collect
(
Collectors
.
toList
());
...
...
@@ -545,8 +552,12 @@ public class CylinderDPStatisticsServiceImpl {
}
//卸液量和
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
r
.
getRegionCode
().
toString
());
List
<
String
>
collect1
=
cylinderInfoMapper
.
queryoffloadingByOrgCode
(
orgCode
,
fillingStartTime
,
fillingEndTime
).
stream
().
map
(
e
->
e
.
getOffloadingVolume
()).
collect
(
Collectors
.
toList
());
Double
offloadingVolume
=
collect1
.
stream
().
mapToDouble
(
Double:
:
valueOf
).
sum
();
List
<
CylinderFillingRecordStatisticsDto
>
cylinderFillingRecordStatisticsDtos
=
cylinderInfoMapper
.
queryoffloadingByOrgCode
(
orgCode
,
fillingStartTime
,
fillingEndTime
);
Double
offloadingVolume
=
0.0d
;
if
(!
ObjectUtils
.
isEmpty
(
cylinderFillingRecordStatisticsDtos
)){
List
<
String
>
collect1
=
cylinderInfoMapper
.
queryoffloadingByOrgCode
(
orgCode
,
fillingStartTime
,
fillingEndTime
).
stream
().
map
(
e
->
e
.
getOffloadingVolume
()).
collect
(
Collectors
.
toList
());
offloadingVolume
=
collect1
.
stream
().
mapToDouble
(
Double:
:
valueOf
).
sum
();
}
fillingQuantitys
.
add
(
fillingQuantity
);
offloadingVolumes
.
add
(
offloadingVolume
);
});
...
...
@@ -600,10 +611,19 @@ public class CylinderDPStatisticsServiceImpl {
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
DateUtils
.
DATE_TIME_PATTERN
);
//充装时间
if
(!
ObjectUtils
.
isEmpty
(
fillingStartTime
)
&&
!
ObjectUtils
.
isEmpty
(
fillingStartTime
)
)
{
if
(!
ObjectUtils
.
isEmpty
(
fillingStartTime
))
{
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
try
{
query
.
must
(
QueryBuilders
.
rangeQuery
(
"inspectionDateMs"
).
gte
(
sdf
.
parse
(
fillingStartTime
).
getTime
()));
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
boolMust
.
must
(
query
);
}
if
(!
ObjectUtils
.
isEmpty
(
fillingEndTime
)
)
{
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
try
{
query
.
must
(
QueryBuilders
.
rangeQuery
(
"inspectionDateAfterMS"
).
lte
(
sdf
.
parse
(
fillingEndTime
).
getTime
()));
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
...
...
@@ -679,22 +699,36 @@ public class CylinderDPStatisticsServiceImpl {
boolMust
.
must
(
query
);
}
String
fillingStartTime
,
fillingEndTime
;
if
(
ObjectUtils
.
isEmpty
(
dpFilterParamForDetailDto
.
getTimeSearchOne
()
.
getBeginDate
()
))
{
fillingStartTime
=
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
))
+
" 00:00:00"
;
String
fillingStartTime
=
null
,
fillingEndTime
=
null
;
if
(
ObjectUtils
.
isEmpty
(
dpFilterParamForDetailDto
.
getTimeSearchOne
()))
{
fillingStartTime
=
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
))
+
" 00:00:00"
;
fillingEndTime
=
LocalDate
.
now
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
))
+
" 23:59:59"
;
}
else
{
fillingStartTime
=
dpFilterParamForDetailDto
.
getTimeSearchOne
().
getBeginDate
()
+
" 00:00:00"
;
fillingEndTime
=
dpFilterParamForDetailDto
.
getTimeSearchOne
().
getBeginDate
()
+
" 23:59:59"
;
if
(!
ObjectUtils
.
isEmpty
(
dpFilterParamForDetailDto
.
getTimeSearchOne
().
getEndDate
()))
{
fillingStartTime
=
dpFilterParamForDetailDto
.
getTimeSearchOne
().
getBeginDate
()
+
" 00:00:00"
;
}
if
(!
ObjectUtils
.
isEmpty
(
dpFilterParamForDetailDto
.
getTimeSearchOne
().
getBeginDate
()))
{
fillingEndTime
=
dpFilterParamForDetailDto
.
getTimeSearchOne
().
getBeginDate
()
+
" 23:59:59"
;
}
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
DateUtils
.
DATE_TIME_PATTERN
);
//充装时间
if
(!
ObjectUtils
.
isEmpty
(
fillingStartTime
)
&&
!
ObjectUtils
.
isEmpty
(
fillingEndTime
)
)
{
//充装
开始
时间
if
(!
ObjectUtils
.
isEmpty
(
fillingStartTime
))
{
flag
=
false
;
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
try
{
query
.
must
(
QueryBuilders
.
rangeQuery
(
"inspectionDateMs"
).
gte
(
sdf
.
parse
(
fillingStartTime
).
getTime
()));
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
boolMust
.
must
(
query
);
}
//充装结束时间
if
(!
ObjectUtils
.
isEmpty
(
fillingEndTime
)
)
{
flag
=
false
;
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
try
{
query
.
must
(
QueryBuilders
.
rangeQuery
(
"inspectionDateAfterMS"
).
lte
(
sdf
.
parse
(
fillingEndTime
).
getTime
()));
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/CylinderInfoMapper.xml
View file @
fa45eb1a
...
...
@@ -367,7 +367,9 @@
tz_base_enterprise_info i
WHERE
i.app_id = f.app_id
AND f.statistics_sync_date
<![CDATA[>=]]>
#{startTime}
<if
test=
"startTime != null and startTime != '' "
>
AND f.statistics_sync_date
<![CDATA[>=]]>
#{startTime}
</if>
<if
test=
"endTime != null and endTime != '' "
>
AND f.statistics_sync_date
<![CDATA[<=]]>
#{endTime}
</if>
...
...
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