Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
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
3faa344c
Commit
3faa344c
authored
4 years ago
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
检测报告导出 优化 20210510 客户提出的问题
parent
ebb3d48c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
222 additions
and
108 deletions
+222
-108
ReportController.java
.../wise/sc/cement/business/controller/ReportController.java
+62
-7
SampleCheckMapper.xml
.../wise/sc/cement/business/mapper/xml/SampleCheckMapper.xml
+1
-0
ReportDetailVo.java
...java/cn/wise/sc/cement/business/model/ReportDetailVo.java
+4
-3
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+143
-91
CheckCountUtil.java
.../java/cn/wise/sc/cement/business/util/CheckCountUtil.java
+11
-6
report_new.ftl
cement-business/src/main/resources/templates/report_new.ftl
+1
-1
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/ReportController.java
View file @
3faa344c
...
...
@@ -85,8 +85,9 @@ public class ReportController {
beanParams
.
put
(
"sender"
,
rts
.
getSender
());
beanParams
.
put
(
"sendDate"
,
rts
.
getSendDate
());
beanParams
.
put
(
"sampleNum"
,
rts
.
getSampleNum
());
beanParams
.
put
(
"sampleNames"
,
set2String
(
rts
.
getSampleNames
()));
beanParams
.
put
(
"teamNames"
,
set2String
(
rts
.
getTeamNames
()));
beanParams
.
put
(
"sampleNames"
,
List2String
(
rts
.
getSampleNames
()));
beanParams
.
put
(
"sampleNamesD"
,
List2StringD
(
rts
.
getSampleNames
()));
beanParams
.
put
(
"teamNames"
,
List2String
(
rts
.
getTeamNames
()));
beanParams
.
put
(
"projectName"
,
rts
.
getProjectName
());
beanParams
.
put
(
"printDate"
,
rts
.
getPrintDate
());
...
...
@@ -95,9 +96,10 @@ public class ReportController {
beanParams
.
put
(
"day"
,
DateUtil
.
dayOfMonth
(
DateUtil
.
date
()));
beanParams
.
put
(
"reportNo"
,
StrUtil
.
isEmpty
(
rts
.
getReportNo
())
?
""
:
rts
.
getReportNo
());
beanParams
.
put
(
"firstMethodName"
,
getFirstSet
(
rts
.
getMethodNames
()));
beanParams
.
put
(
"firstMethodName"
,
getFirstList
(
rts
.
getMethodNames
()));
beanParams
.
put
(
"methodNames"
,
moveFirstList
(
rts
.
getMethodNames
()));
beanParams
.
put
(
"firstEquipment"
,
getFirstSet
(
rts
.
getEquipmentNames
()));
beanParams
.
put
(
"methodNames"
,
moveFirst
(
rts
.
getMethodNames
()));
beanParams
.
put
(
"equipmentNames"
,
moveFirst
(
rts
.
getEquipmentNames
()));
//十元素1导出
...
...
@@ -127,7 +129,36 @@ public class ReportController {
}
//检测依据 第一条记录
private
String
getFirstList
(
List
<
String
>
list
)
{
if
(
list
!=
null
&&
list
.
size
()>
0
){
Iterator
<
String
>
iterator
=
list
.
iterator
();
if
(
iterator
.
hasNext
())
{
return
iterator
.
next
();
}
}
return
""
;
}
//检测依据 第一条之外的记录
private
static
List
<
String
>
moveFirstList
(
List
<
String
>
list
)
{
if
(
list
!=
null
&&
list
.
size
()>
0
){
List
<
String
>
newSet
=
new
ArrayList
<>(
list
.
size
());
Iterator
<
String
>
iterator
=
list
.
iterator
();
if
(
iterator
.
hasNext
())
{
String
next
=
iterator
.
next
();
newSet
.
addAll
(
list
);
newSet
.
remove
(
next
);
return
newSet
;
}
}
return
null
;
}
//设备第一条记录
private
String
getFirstSet
(
Set
<
String
>
set
)
{
if
(
set
!=
null
&&
set
.
size
()>
0
){
Iterator
<
String
>
iterator
=
set
.
iterator
();
...
...
@@ -135,10 +166,9 @@ public class ReportController {
return
iterator
.
next
();
}
}
return
""
;
}
//设备除第一条之外的记录
private
static
Set
<
String
>
moveFirst
(
Set
<
String
>
set
)
{
if
(
set
!=
null
&&
set
.
size
()>
0
){
Set
<
String
>
newSet
=
new
HashSet
<>(
set
.
size
());
...
...
@@ -153,13 +183,38 @@ public class ReportController {
return
null
;
}
private
String
set2String
(
Set
<
String
>
source
)
{
//首页 样品名称和检测项名称 转字符串
private
String
List2String
(
List
<
String
>
source
)
{
if
(
source
.
size
()
==
0
)
{
return
""
;
}
StringBuilder
strBuilder
=
new
StringBuilder
();
int
i
=
0
;
for
(
String
target
:
source
)
{
strBuilder
.
append
(
"、"
).
append
(
target
);
}
return
strBuilder
.
replace
(
0
,
1
,
""
).
toString
();
}
//封面的样品名称 转字符串 只显示前两个即可
private
String
List2StringD
(
List
<
String
>
source
)
{
if
(
source
.
size
()
==
0
)
{
return
""
;
}
StringBuilder
strBuilder
=
new
StringBuilder
();
int
i
=
0
;
//2021.05.10 样品名称应该从委托单的第一个样品开始,最多两个即可,例如生料1、生料1-1等,用“等”字代替
for
(
String
target
:
source
)
{
if
(
i
<
2
){
strBuilder
.
append
(
"、"
).
append
(
target
);
}
else
if
(
i
==
2
){
strBuilder
.
append
(
" 等"
);
}
else
{
break
;
}
i
=
i
+
1
;
}
return
strBuilder
.
replace
(
0
,
1
,
""
).
toString
();
}
...
...
This diff is collapsed.
Click to expand it.
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/SampleCheckMapper.xml
View file @
3faa344c
...
...
@@ -16,6 +16,7 @@
#{teamNames}
</foreach>
group by s.id, sdc.id,t.name
order by s.id asc
</select>
<select
id=
"getSampleIndustrialCheck"
resultType=
"cn.wise.sc.cement.business.model.vo.IndustrialReport"
>
...
...
This diff is collapsed.
Click to expand it.
cement-business/src/main/java/cn/wise/sc/cement/business/model/ReportDetailVo.java
View file @
3faa344c
...
...
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.Set
;
/**
...
...
@@ -29,13 +30,13 @@ public class ReportDetailVo implements Serializable {
@ApiModelProperty
(
"样品数量"
)
private
Integer
sampleNum
;
@ApiModelProperty
(
"样品名称"
)
private
Se
t
<
String
>
sampleNames
;
private
Lis
t
<
String
>
sampleNames
;
@ApiModelProperty
(
"检测类别"
)
private
String
type
=
"委托"
;
@ApiModelProperty
(
"检测项目"
)
private
Se
t
<
String
>
teamNames
;
private
Lis
t
<
String
>
teamNames
;
@ApiModelProperty
(
"检测依据"
)
private
Se
t
<
String
>
methodNames
;
private
Lis
t
<
String
>
methodNames
;
@ApiModelProperty
(
"主要仪器设备(编号)"
)
private
Set
<
String
>
equipmentNames
;
@ApiModelProperty
(
"项目名称"
)
...
...
This diff is collapsed.
Click to expand it.
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
3faa344c
This diff is collapsed.
Click to expand it.
cement-business/src/main/java/cn/wise/sc/cement/business/util/CheckCountUtil.java
View file @
3faa344c
...
...
@@ -1137,9 +1137,12 @@ public class CheckCountUtil {
*/
public
static
String
countYMXGrade
(
Map
<
String
,
String
>
resultMap
)
{
String
count
=
""
;
if
(
StringUtils
.
isNotBlank
(
resultMap
.
get
(
"易磨性(kWh/t)"
))
){
BigDecimal
YMX_kWh_t
=
getBigDecimal
(
resultMap
.
get
(
"易磨性(kWh/t)"
));
if
(
StringUtils
.
isNotBlank
(
resultMap
.
get
(
"易磨性(MJ/t)"
))&&
StringUtils
.
isNotBlank
(
resultMap
.
get
(
"易磨性(kWh/t)"
))
){
BigDecimal
YMX_MJ_t
=
getBigDecimal
(
resultMap
.
get
(
"易磨性(MJ/t)"
).
trim
());
BigDecimal
YMX_kWh_t
=
getBigDecimal
(
resultMap
.
get
(
"易磨性(kWh/t)"
).
trim
());
if
(
YMX_kWh_t
.
compareTo
(
new
BigDecimal
(
18
))==
1
){
count
=
"E"
;
}
else
if
(
YMX_kWh_t
.
compareTo
(
new
BigDecimal
(
13
))==
1
){
...
...
@@ -1155,9 +1158,11 @@ public class CheckCountUtil {
if
(
YMX_kWh_t
!=
null
){
YMX_kWh_t_str
=
YMX_kWh_t
.
toString
();
}
count
=
"易磨性值="
+
YMX_kWh_t_str
+
" \n 易磨性等级="
+
count
;
String
YMX_MJ_t_str
=
""
;
if
(
YMX_MJ_t
!=
null
){
YMX_MJ_t_str
=
YMX_MJ_t
.
toString
();
}
count
=
"易磨性(MJ/t)="
+
YMX_MJ_t_str
+
" \n 易磨性值="
+
YMX_kWh_t_str
+
" \n 易磨性等级="
+
count
;
}
return
count
;
...
...
This diff is collapsed.
Click to expand it.
cement-business/src/main/resources/templates/report_new.ftl
View file @
3faa344c
...
...
@@ -3550,7 +3550,7 @@
<Cell
ss:StyleID=
"s86"
><NamedCell
ss:Name=
"Print_Area"
/></Cell>
<Cell
ss:StyleID=
"s73"
><Data
ss:Type=
"String"
>
样品名称:
</Data><NamedCell
ss:Name=
"Print_Area"
/></Cell>
<Cell
ss:StyleID=
"s87"
><Data
ss:Type=
"String"
>
${sampleNames}
</Data><NamedCell
<Cell
ss:StyleID=
"s87"
><Data
ss:Type=
"String"
>
${sampleNames
D
}
</Data><NamedCell
ss:Name=
"Print_Area"
/></Cell>
<Cell
ss:StyleID=
"s88"
><NamedCell
ss:Name=
"Print_Area"
/></Cell>
<Cell
ss:StyleID=
"s86"
><NamedCell
ss:Name=
"Print_Area"
/></Cell>
...
...
This diff is collapsed.
Click to expand it.
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