Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
tianjin-cement
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
竹天卫
tianjin-cement
Commits
9e5729b7
Commit
9e5729b7
authored
Apr 29, 2021
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导出-委托单进展统计
parent
d6e6e00f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
21 deletions
+24
-21
DataStatisticsMapper.xml
...se/sc/cement/business/mapper/xml/DataStatisticsMapper.xml
+2
-2
DataStatisticsServiceImpl.java
...ment/business/service/impl/DataStatisticsServiceImpl.java
+22
-19
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/DataStatisticsMapper.xml
View file @
9e5729b7
...
@@ -166,7 +166,7 @@
...
@@ -166,7 +166,7 @@
left join project p on p.id = e.project_id
left join project p on p.id = e.project_id
left join client c on c.id = e.client_id
left join client c on c.id = e.client_id
left join sys_user su on su.id = e.user_id
left join sys_user su on su.id = e.user_id
where e.status != 0 and e.project_type is not null
where e.status != 0
and e.status
<
9
and e.project_type is not null
<if
test=
"params.clientId != null"
>
<if
test=
"params.clientId != null"
>
and e.clientId = #{clientId}
and e.clientId = #{clientId}
</if>
</if>
...
@@ -261,7 +261,7 @@
...
@@ -261,7 +261,7 @@
left join client c on c.id = e.client_id
left join client c on c.id = e.client_id
left join sys_user su on su.id = e.user_id
left join sys_user su on su.id = e.user_id
,(select @i:=0)aa
,(select @i:=0)aa
where e.status != 0 and e.project_type is not null
where e.status != 0
and e.status
<
9
and e.project_type is not null
<if
test=
"params.clientId != null"
>
<if
test=
"params.clientId != null"
>
and e.clientId = #{clientId}
and e.clientId = #{clientId}
</if>
</if>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/DataStatisticsServiceImpl.java
View file @
9e5729b7
...
@@ -399,11 +399,13 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
...
@@ -399,11 +399,13 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
QueryWrapper
<
Sample
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
Sample
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
in
(
"entrust_id"
,
queryList
);
queryWrapper
.
in
(
"entrust_id"
,
queryList
);
List
<
Sample
>
sampleList
=
sampleService
.
list
(
queryWrapper
);
List
<
Sample
>
sampleList
=
sampleService
.
list
(
queryWrapper
);
List
<
Integer
>
sampleIdList
=
sampleList
.
stream
().
filter
(
x
->
x
.
getCementCode
().
equals
(
x
.
getParallelCode
())).
map
(
Sample:
:
getId
).
collect
(
Collectors
.
toList
());
//4.查询所有的派发检测项
//4.查询所有的派发检测项
QueryWrapper
<
SampleDistribution
>
sdqueryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
SampleDistribution
>
sdqueryWrapper
=
new
QueryWrapper
<>();
sdqueryWrapper
.
in
(
"entrust_id"
,
queryList
);
sdqueryWrapper
.
in
(
"entrust_id"
,
queryList
);
sdqueryWrapper
.
in
(
"sample_id"
,
sample
List
.
stream
().
filter
(
x
->
x
.
getCementCode
().
equals
(
x
.
getParallelCode
())).
map
(
Sample:
:
getId
).
collect
(
Collectors
.
toList
())
);
sdqueryWrapper
.
in
(
"sample_id"
,
sample
IdList
);
List
<
SampleDistribution
>
sampleDistributions
=
sampleDistributionService
.
list
(
sdqueryWrapper
);
List
<
SampleDistribution
>
sampleDistributions
=
sampleDistributionService
.
list
(
sdqueryWrapper
);
//5.分组并统计
//5.分组并统计
Map
<
Integer
,
List
<
SampleDistribution
>>
groupByEntrustId
=
sampleDistributions
.
stream
().
collect
(
Collectors
.
groupingBy
(
SampleDistribution:
:
getEntrustId
,
Collectors
.
toList
()));
Map
<
Integer
,
List
<
SampleDistribution
>>
groupByEntrustId
=
sampleDistributions
.
stream
().
collect
(
Collectors
.
groupingBy
(
SampleDistribution:
:
getEntrustId
,
Collectors
.
toList
()));
//6.开始填充数据。首先填充表头
//6.开始填充数据。首先填充表头
...
@@ -432,28 +434,28 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
...
@@ -432,28 +434,28 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
//填充数据,从第二行开始
//填充数据,从第二行开始
int
rownum
=
2
;
int
rownum
=
2
;
for
(
int
j
=
0
;
j
<
entrustList
.
size
();
j
++)
{
for
(
int
j
=
0
;
j
<
entrustList
.
size
();
j
++)
{
Map
<
String
,
Object
>
entrust
=
entrustList
.
get
(
j
);
Map
<
String
,
Object
>
entrust
=
entrustList
.
get
(
j
);
int
entrustId
=
Integer
.
parseInt
(
entrust
.
get
(
"entrustId"
).
toString
());
int
entrustId
=
Integer
.
parseInt
(
entrust
.
get
(
"entrustId"
).
toString
());
if
(
groupByEntrustId
.
get
(
entrustId
)
!=
null
)
{
//只要评审通过的单子 都可以导出
XSSFRow
row0
=
sheet
.
createRow
(
rownum
++);
XSSFRow
row0
=
sheet
.
createRow
(
rownum
++);
Map
<
Integer
,
List
<
SampleDistribution
>>
sampleDistribuGroup
=
groupByEntrustId
.
get
(
entrustId
).
stream
().
collect
(
Collectors
.
groupingBy
(
SampleDistribution:
:
getTeamId
,
Collectors
.
toList
()));
//处理委托人信息表头
//处理委托人信息表头
for
(
int
i
=
0
;
i
<
infoHeader
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
infoHeader
.
size
();
i
++)
{
XSSFCell
tempCell
=
row0
.
createCell
(
i
);
XSSFCell
tempCell
=
row0
.
createCell
(
i
);
if
(
infoHeader
.
get
(
i
).
equals
(
"实际产值"
)){
if
(
infoHeader
.
get
(
i
).
equals
(
"实际产值"
)){
Double
outPutValue
=
sampleList
Double
outPutValue
=
sampleList
.
stream
()
.
stream
()
.
filter
(
x
->
x
.
getCementCode
().
equals
(
x
.
getParallelCode
())
&&
x
.
getEntrustId
()
==
entrustId
)
.
filter
(
x
->
x
.
getCementCode
().
equals
(
x
.
getParallelCode
())
&&
x
.
getEntrustId
()
==
entrustId
)
.
mapToDouble
(
item
->
item
.
getOutputValue
().
doubleValue
()).
sum
();
.
mapToDouble
(
item
->
item
.
getOutputValue
().
doubleValue
()).
sum
();
tempCell
.
setCellValue
(
outPutValue
==
null
?
""
:
outPutValue
.
toString
());
tempCell
.
setCellValue
(
outPutValue
==
null
?
""
:
outPutValue
.
toString
());
tempCell
.
setCellStyle
(
style
);
tempCell
.
setCellStyle
(
style
);
}
else
{
}
else
{
tempCell
.
setCellValue
(
entrust
.
get
(
infoHeader
.
get
(
i
))
==
null
?
""
:
entrust
.
get
(
infoHeader
.
get
(
i
)).
toString
());
tempCell
.
setCellValue
(
entrust
.
get
(
infoHeader
.
get
(
i
))
==
null
?
""
:
entrust
.
get
(
infoHeader
.
get
(
i
)).
toString
());
tempCell
.
setCellStyle
(
style
);
tempCell
.
setCellStyle
(
style
);
}
}
}
}
if
(
groupByEntrustId
.
get
(
entrustId
)
!=
null
)
{
Map
<
Integer
,
List
<
SampleDistribution
>>
sampleDistribuGroup
=
groupByEntrustId
.
get
(
entrustId
).
stream
().
collect
(
Collectors
.
groupingBy
(
SampleDistribution:
:
getTeamId
,
Collectors
.
toList
()));
//处理检测项总产值表头
//处理检测项总产值表头
for
(
int
i
=
infoHeader
.
size
();
i
<
teamList
.
size
()
+
infoHeader
.
size
();
i
++)
{
for
(
int
i
=
infoHeader
.
size
();
i
<
teamList
.
size
()
+
infoHeader
.
size
();
i
++)
{
XSSFCell
tempCell
=
row0
.
createCell
(
i
);
XSSFCell
tempCell
=
row0
.
createCell
(
i
);
...
@@ -479,6 +481,7 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
...
@@ -479,6 +481,7 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
tempCell2
.
setCellStyle
(
style
);
tempCell2
.
setCellStyle
(
style
);
}
}
}
}
}
}
ExcelUtil
.
excelExportNew
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"委托单进展统计"
:
fileName
,
wb
,
response
);
ExcelUtil
.
excelExportNew
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"委托单进展统计"
:
fileName
,
wb
,
response
);
...
...
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