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
0cff4e7d
Commit
0cff4e7d
authored
Oct 27, 2020
by
qinhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.报告统计--多平行样适配
2.质量检测详情修改
parent
d03b29ca
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
232 additions
and
184 deletions
+232
-184
ReportController.java
.../wise/sc/cement/business/controller/ReportController.java
+19
-11
EntrustReport.java
...java/cn/wise/sc/cement/business/entity/EntrustReport.java
+6
-1
EntrustMapper.xml
...a/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
+2
-2
SampleCheckMapper.xml
.../wise/sc/cement/business/mapper/xml/SampleCheckMapper.xml
+5
-6
SixElementReport.java
...va/cn/wise/sc/cement/business/model/SixElementReport.java
+6
-0
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+192
-162
application.yml
cement-business/src/main/resources/application.yml
+2
-2
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/ReportController.java
View file @
0cff4e7d
...
...
@@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -90,7 +91,7 @@ public class ReportController {
//首页及封面导出
ReportDetailVo
rts
=
iEntrustService
.
getReportDetail
(
entrustId
);
if
(
rts
==
null
){
if
(
rts
==
null
)
{
return
;
}
Map
<
String
,
Object
>
beanParams
=
new
HashMap
<>(
10
);
...
...
@@ -121,7 +122,7 @@ public class ReportController {
//化学工业导出
List
<
IndustrialReport
>
list1
=
iEntrustService
.
getSampleIndustrialCheck
(
entrustId
);
list1
.
forEach
(
this
::
initMapStr2AlongPro
);
beanParams
.
put
(
"list3"
,
list1
);
beanParams
.
put
(
"list3"
,
list1
);
WordUtil
.
writeWordReport
(
rts
.
getProjectName
()
+
"(报告)"
,
"report.ftl"
,
beanParams
,
response
,
FileExt
.
EXCL
);
...
...
@@ -137,7 +138,10 @@ public class ReportController {
private
void
initMapStr2AlongPro
(
SixElementReport
sixElement
)
{
String
countResult
=
sixElement
.
getCountResults
();
HashMap
<
String
,
String
>
countResultMap
=
JSON
.
parseObject
(
countResult
,
HashMap
.
class
);
List
<
SixElementReport
.
Element
>
list
=
JSON
.
parseArray
(
countResult
,
SixElementReport
.
Element
.
class
);
HashMap
<
String
,
String
>
countResultMap
=
new
HashMap
<>(
list
.
size
());
list
.
forEach
(
arg
->
countResultMap
.
put
(
arg
.
getName
(),
arg
.
getValue
()));
sixElement
.
setAl2o3
(
"-"
);
sixElement
.
setTio2
(
"-"
);
...
...
@@ -159,16 +163,19 @@ public class ReportController {
sixElement
.
setSo3
(
countResultMap
.
getOrDefault
(
SixElementKey
.
SO3
.
getKey
(),
"0"
));
}
private
void
initMapStr2AlongPro
(
IndustrialReport
industrialReport
){
private
void
initMapStr2AlongPro
(
IndustrialReport
industrialReport
)
{
String
countResult
=
industrialReport
.
getCountResults
();
HashMap
<
String
,
String
>
countResultMap
=
JSON
.
parseObject
(
countResult
,
HashMap
.
class
);
List
<
SixElementReport
.
Element
>
list
=
JSON
.
parseArray
(
countResult
,
SixElementReport
.
Element
.
class
);
industrialReport
.
setAad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
Aad
.
getKey
(),
"0"
));
industrialReport
.
setJz
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
JZ
.
getKey
(),
"0"
));
industrialReport
.
setMad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
Mad
.
getKey
(),
"0"
));
industrialReport
.
setMjkg
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
QnetAdMJkg
.
getKey
(),
"0"
));
industrialReport
.
setStad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
StAd
.
getKey
(),
"0"
));
industrialReport
.
setVad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
Vad
.
getKey
(),
"0"
));
HashMap
<
String
,
String
>
countResultMap
=
new
HashMap
<>(
list
.
size
());
list
.
forEach
(
arg
->
countResultMap
.
put
(
arg
.
getName
(),
arg
.
getValue
()));
industrialReport
.
setAad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
Aad
.
getKey
(),
"0"
));
industrialReport
.
setJz
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
JZ
.
getKey
(),
"0"
));
industrialReport
.
setMad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
Mad
.
getKey
(),
"0"
));
industrialReport
.
setMjkg
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
QnetAdMJkg
.
getKey
(),
"0"
));
industrialReport
.
setStad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
StAd
.
getKey
(),
"0"
));
industrialReport
.
setVad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
Vad
.
getKey
(),
"0"
));
}
...
...
@@ -194,4 +201,5 @@ public class ReportController {
return
strBuilder
.
replace
(
0
,
5
,
""
).
toString
();
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/entity/EntrustReport.java
View file @
0cff4e7d
...
...
@@ -72,7 +72,7 @@ public class EntrustReport {
/**
* 机械仪器名字
*/
private
String
equipmentName
;
private
String
equipmentName
;
/**
* 用户id
...
...
@@ -93,4 +93,9 @@ public class EntrustReport {
* 样品创建时间
*/
private
Date
sendTime
;
/**
* 器械id
*/
private
Integer
equipmentId
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
View file @
0cff4e7d
...
...
@@ -229,9 +229,9 @@
SELECT e.id,e.project_name,e.send_name,e.client_id,e.entrust_code,e.project_type,sscct.* FROM entrust e
RIGHT JOIN
(SELECT id,entrust_id,team_ids,method_numbers,name,scct.check_id,
scct.equipment_name,scct.user_id,create_time as send_time FROM sample s
scct.equipment_name,scct.user_id,create_time as send_time
,scct.equipment_id
FROM sample s
RIGHT JOIN
(SELECT check_id,equipment_name,sample_id,user_id FROM sample_check_team sct
(SELECT check_id,equipment_name,sample_id,user_id
,equipment_id
FROM sample_check_team sct
RIGHT JOIN
(SELECT entrust_id,id FROM sample_check WHERE entrust_id = #{entrustId}) sc
ON sct.check_id = sc.id ) scct
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/SampleCheckMapper.xml
View file @
0cff4e7d
...
...
@@ -4,17 +4,16 @@
<select
id=
"getSampleSixElementCheck"
resultType=
"cn.wise.sc.cement.business.model.SixElementReport"
>
SELECT * FROM (SELECT count_results,entrust_id,team_group_name,sct.sample_id FROM sample_check sc
SELECT * FROM (SELECT count_results,entrust_id,team_group_name,sct.sample_id
,sc.id
FROM sample_check sc
LEFT JOIN
(SELECT check_id,sample_id FROM sample_check_team) sct
ON sct.check_id = sc.id
AND sc. is_parallel = 0
WHERE sct.sample_id IS NOT NULL AND sc.team_group_name = '六元素' ) sscct
WHERE sample_id IS NOT NULL AND sc.team_group_name = '六元素' ) sscct
RIGHT JOIN
(SELECT cement_code,sample_code,sample_form,`name` as sample_nam
e,weight,id
(SELECT cement_code,sample_code,sample_form,`name` as sample_name,parallel_cod
e,weight,id
FROM sample) s
ON s.id = sscct.sample_id AND entrust_id = #{entrustId}
WHERE count_results IS NOT NULL;
WHERE count_results IS NOT NULL
AND s.parallel_code = cement_code
;
</select>
<select
id=
"getSampleIndustrialCheck"
resultType=
"cn.wise.sc.cement.business.model.IndustrialReport"
>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/SixElementReport.java
View file @
0cff4e7d
...
...
@@ -62,4 +62,10 @@ public class SixElementReport implements Serializable {
private
String
al2o3
=
""
;
private
String
tio2
=
""
;
@Data
public
static
class
Element
implements
Serializable
{
private
String
name
;
private
String
value
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
0cff4e7d
This diff is collapsed.
Click to expand it.
cement-business/src/main/resources/application.yml
View file @
0cff4e7d
...
...
@@ -7,8 +7,8 @@ spring:
active
:
dev
datasource
:
# 192.168.110.85 admin!@#123
url
:
jdbc:mysql://192.168.110.85:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
#
url: jdbc:mysql://81.68.92.175:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
#
url: jdbc:mysql://192.168.110.85:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url
:
jdbc:mysql://81.68.92.175:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username
:
root
password
:
admin!@#123
driverClassName
:
com.mysql.cj.jdbc.Driver
...
...
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