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
744be23d
Commit
744be23d
authored
Mar 25, 2021
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
元素含量分布统计
parent
c0b44c16
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
34 deletions
+45
-34
DataStatisticsController.java
.../cement/business/controller/DataStatisticsController.java
+4
-5
ItemDistribution.java
...a/cn/wise/sc/cement/business/entity/ItemDistribution.java
+2
-1
DataStatisticsMapper.xml
...se/sc/cement/business/mapper/xml/DataStatisticsMapper.xml
+24
-11
ItemDistributionVo.java
.../wise/sc/cement/business/model/vo/ItemDistributionVo.java
+4
-2
DataStatisticsServiceImpl.java
...ment/business/service/impl/DataStatisticsServiceImpl.java
+11
-15
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/DataStatisticsController.java
View file @
744be23d
...
...
@@ -35,8 +35,7 @@ public class DataStatisticsController {
@Autowired
private
IDataStatisticsService
dataStatisticsService
;
@Autowired
private
IEntrustService
entrustService
;
@ApiOperation
(
value
=
"统计概览-重要数值统计"
)
...
...
@@ -110,7 +109,7 @@ public class DataStatisticsController {
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
"
列表
导出-委托单进展统计"
)
@ApiOperation
(
"导出-委托单进展统计"
)
@PostMapping
(
"/exportEntrustList"
)
public
void
exportEntrustList
(
Integer
cycle
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
clientName
,
String
fileName
,
HttpServletResponse
response
)
{
...
...
@@ -170,7 +169,7 @@ public class DataStatisticsController {
}
@ApiOperation
(
"
列表
导出-检测项统计"
)
@ApiOperation
(
"导出-检测项统计"
)
@PostMapping
(
"/exportTeamList"
)
public
void
exportTeamList
(
Integer
cycle
,
String
startDate
,
String
endDate
,
String
fileName
,
HttpServletResponse
response
)
{
try
{
...
...
@@ -202,7 +201,7 @@ public class DataStatisticsController {
}
@ApiOperation
(
"
列表
导出-检测元素含量分布情况统计"
)
@ApiOperation
(
"导出-检测元素含量分布情况统计"
)
@PostMapping
(
"/exportItemDistribution"
)
public
void
exportItemDistribution
(
@RequestBody
CountItemDistributionQuery
query
,
String
fileName
,
HttpServletResponse
response
)
{
try
{
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/entity/ItemDistribution.java
View file @
744be23d
...
...
@@ -9,6 +9,7 @@ import lombok.Data;
**/
@Data
public
class
ItemDistribution
{
private
Integer
count
;
private
String
maxCount
;
private
String
minCount
;
private
String
key
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/DataStatisticsMapper.xml
View file @
744be23d
...
...
@@ -457,7 +457,8 @@
SELECT COUNT(sd.team_id) as `count`,t.`name` FROM sample_distribution sd
LEFT JOIN sample s ON sd.sample_id = s.id
LEFT JOIN team t ON t.id = sd.team_id
WHERE 1=1
WHERE s.is_check = 1 and s.cement_code = s.parallel_code
and sd.status = 4 and sd.check_id is not null
<if
test=
"start != null and end != null"
>
AND (sd.finish_time between #{start} and #{end})
</if>
...
...
@@ -470,12 +471,19 @@
</select>
<select
id=
"countItemDistribution"
resultType=
"cn.wise.sc.cement.business.entity.ItemDistribution"
>
SELECT COUNT(a.sample_id) as `count`,`key` from
(SELECT sd.team_id,sd.sample_id,t.`name`,sd.finish_time,CONCAT(sd.team_id,',',s.origin,',',s.is_foreign) as
`key` FROM sample_distribution sd
SELECT
IF(LENGTH(TRIM(MAX(a.last_result)))
<
1 ,0, MAX(a.last_result)) as maxCount,
IF(LENGTH(TRIM(MIN(a.last_result)))
<
1 ,0, MIN(a.last_result) ) as minCount,
`key`
from(
SELECT sd.team_id,t.`name`,sdc.last_result,
CONCAT(sd.team_id,',',s.origin,',',s.is_foreign) as `key`
FROM sample_distribution sd
left join sample_distribution_check sdc on sdc.id = sd.check_id
LEFT JOIN sample s ON sd.sample_id = s.id
LEFT JOIN team t ON t.id = sd.team_id
WHERE 1=1
WHERE s.is_check = 1 and s.cement_code = s.parallel_code
and sd.status = 4 and sd.check_id is not null
<if
test=
"start != null and end != null"
>
AND (sd.finish_time between #{start} and #{end})
</if>
...
...
@@ -488,20 +496,25 @@
<if
test=
"itemId != null"
>
AND sd.team_id = #{itemId}
</if>
) a GROUP BY a.`key`
) a
GROUP BY a.`key`
</select>
<select
id=
"exporItemDistributionList"
resultType=
"java.util.HashMap"
>
SELECT (@i:=@i+1) as 序号,
COUNT(a.sample_id) as `count`,
IF(LENGTH(TRIM(MAX(a.last_result)))
<
1 ,0, MAX(a.last_result)) as maxCount,
IF(LENGTH(TRIM(MIN(a.last_result)))
<
1 ,0, MIN(a.last_result) ) as minCount,
`key`
from
(SELECT sd.team_id,sd.sample_id,t.`name`,sd.finish_time,CONCAT(sd.team_id,',',s.origin,',',s.is_foreign) as
`key` FROM sample_distribution sd
(SELECT sd.team_id,t.`name`,sdc.last_result,
CONCAT(sd.team_id,',',s.origin,',',s.is_foreign) as `key`
FROM sample_distribution sd
left join sample_distribution_check sdc on sdc.id = sd.check_id
LEFT JOIN sample s ON sd.sample_id = s.id
LEFT JOIN team t ON t.id = sd.team_id
,(select @i:=0)t
WHERE 1=1
WHERE s.is_check = 1 and s.cement_code = s.parallel_code
and sd.status = 4 and sd.check_id is not null
<if
test=
"start != null and end != null"
>
AND (sd.finish_time between #{start} and #{end})
</if>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/ItemDistributionVo.java
View file @
744be23d
...
...
@@ -17,7 +17,9 @@ public class ItemDistributionVo implements Serializable {
private
String
id
;
private
String
itemName
;
private
String
origin
;
private
Integer
itemCount
;
private
String
time
;
private
Integer
sampleCount
;
private
String
maxCount
;
private
String
minCount
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/DataStatisticsServiceImpl.java
View file @
744be23d
...
...
@@ -820,7 +820,9 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
String
endTime
=
query
.
getEndTime
();
Long
itemId
=
query
.
getItemId
();
List
<
String
>
origins
=
query
.
getOrigins
();
if
(
query
.
getPageQuery
()
==
null
){
return
BaseResponse
.
errorMsg
(
"请传入分页参数"
);
}
Page
<
ItemDistribution
>
page
=
new
Page
<>(
query
.
getPageQuery
().
getPageNo
(),
query
.
getPageQuery
().
getPageSize
());
//获取检测项目城市分布统计
...
...
@@ -843,12 +845,8 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
vo
.
setOrigin
(
origin
);
vo
.
setItemName
(
sample
.
getName
());
vo
.
setSampleCount
(
sample
.
getCount
());
vo
.
setItemCount
(
distribution
.
getCount
());
if
(
StringUtils
.
isEmpty
(
startTime
)
||
StringUtils
.
isEmpty
(
endTime
)){
vo
.
setTime
(
null
);
}
else
{
vo
.
setTime
(
startTime
+
"_"
+
endTime
);
}
vo
.
setMaxCount
(
distribution
.
getMaxCount
());
vo
.
setMinCount
(
distribution
.
getMinCount
());
rtsRecords
.
add
(
vo
);
}
...
...
@@ -885,7 +883,7 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
headers
[
0
]
=
"序号"
;
headers
[
1
]
=
"检测元素"
;
headers
[
2
]
=
"地区"
;
headers
[
3
]
=
"元素含量"
;
headers
[
3
]
=
"元素含量
区间
"
;
headers
[
4
]
=
"样品数量"
;
List
<
Object
[]>
datas
=
new
ArrayList
<>(
list
.
size
());
...
...
@@ -905,12 +903,10 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
vo
.
setOrigin
(
origin
);
vo
.
setItemName
(
sample
.
getName
());
vo
.
setSampleCount
(
sample
.
getCount
());
vo
.
setItemCount
(
Integer
.
valueOf
(
m
.
get
(
"count"
).
toString
()));
if
(
StringUtils
.
isEmpty
(
startTime
)
||
StringUtils
.
isEmpty
(
endTime
)){
vo
.
setTime
(
null
);
}
else
{
vo
.
setTime
(
startTime
+
"_"
+
endTime
);
}
vo
.
setMaxCount
(
m
.
get
(
"maxCount"
).
toString
());
vo
.
setMinCount
(
m
.
get
(
"minCount"
).
toString
());
for
(
int
j
=
0
;
j
<
headers
.
length
;
j
++)
{
String
obj
=
""
;
if
(
j
==
1
){
...
...
@@ -918,7 +914,7 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
}
else
if
(
j
==
2
){
objects
[
2
]
=
vo
.
getOrigin
();
}
else
if
(
j
==
3
){
objects
[
3
]
=
vo
.
get
Item
Count
();
objects
[
3
]
=
vo
.
get
MinCount
()+
"-"
+
vo
.
getMax
Count
();
}
else
if
(
j
==
4
){
objects
[
4
]
=
vo
.
getSampleCount
();
}
else
{
...
...
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