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
464448a6
Commit
464448a6
authored
Mar 15, 2021
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
校核详情导出 & 标签导出
parent
f40d98be
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
273 additions
and
65 deletions
+273
-65
EntrustController.java
...wise/sc/cement/business/controller/EntrustController.java
+17
-35
SampleMapper.java
.../java/cn/wise/sc/cement/business/mapper/SampleMapper.java
+1
-1
DataStatisticsMapper.xml
...se/sc/cement/business/mapper/xml/DataStatisticsMapper.xml
+2
-0
NonStandardApprovalMapper.xml
.../cement/business/mapper/xml/NonStandardApprovalMapper.xml
+2
-1
SampleDistributionMapper.xml
...c/cement/business/mapper/xml/SampleDistributionMapper.xml
+3
-0
SampleLabelVo.java
...va/cn/wise/sc/cement/business/model/vo/SampleLabelVo.java
+0
-10
IEntrustService.java
...a/cn/wise/sc/cement/business/service/IEntrustService.java
+4
-6
DataStatisticsServiceImpl.java
...ment/business/service/impl/DataStatisticsServiceImpl.java
+1
-0
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+238
-12
ExcelUtil.java
.../main/java/cn/wise/sc/cement/business/util/ExcelUtil.java
+3
-0
DataStatisticsMapper.xml
...n/wise/sc/cement/business/mapper/DataStatisticsMapper.xml
+2
-0
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/EntrustController.java
View file @
464448a6
...
@@ -855,51 +855,33 @@ public class EntrustController {
...
@@ -855,51 +855,33 @@ public class EntrustController {
}
}
@ApiOperation
(
value
=
"查看样品标签"
)
@GetMapping
(
"/getSampleLabelList"
)
public
BaseResponse
getSampleLabelList
(
Integer
entrustId
)
{
try
{
return
entrustService
.
getSampleLabelList
(
entrustId
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"查看样品标签{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
//todo 导出样品标签功能待完善
@PostMapping
(
"/exportSampleLabel/{entrustId}"
)
@ApiOperation
(
"导出样品标签"
)
@ApiOperation
(
"导出样品标签"
)
@PostMapping
(
"/exportSampleLabel/{entrustId}"
)
public
void
exportSampleLabel
(
@PathVariable
(
"entrustId"
)
Integer
entrustId
,
public
void
exportSampleLabel
(
@PathVariable
(
"entrustId"
)
Integer
entrustId
,
HttpServletResponse
response
)
{
String
fileName
,
HttpServletResponse
response
)
{
Map
<
String
,
Object
>
map
=
entrustService
.
getSampleLabelList
(
entrustId
).
getData
();
try
{
if
(
map
==
null
)
{
entrustService
.
exportSampleLabel
(
entrustId
,
fileName
,
response
);
return
;
}
List
<
Sample
>
sampleList
=
(
List
<
Sample
>)
map
.
get
(
"list"
);
if
(
sampleList
==
null
||
sampleList
.
size
()==
0
)
{
return
;
}
Entrust
entrust
=
(
Entrust
)
map
.
get
(
"entrust"
);
Map
<
String
,
Object
>
beanParams
=
new
HashMap
<>(
5
);
//(不包含平行样)
}
catch
(
Exception
e
)
{
List
<
SampleLabelVo
>
sampleLabelVoList
=
new
ArrayList
<>();
log
.
debug
(
"导出样品标签{}"
,
e
);
for
(
int
i
=
0
;
i
<
sampleList
.
size
();
i
++){
SampleLabelVo
sampleLabelVo
=
new
SampleLabelVo
();
i
=
i
+
4
;
}
}
beanParams
.
put
(
"list"
,
sampleList
);
WordUtil
.
writeWordReport
(
entrust
.
getEntrustCode
()
+
"-"
+
entrust
.
getProjectName
()
+
"-样品标签"
,
"sampleFlow.ftl"
,
beanParams
,
response
,
FileExt
.
DOC
);
}
}
@ApiOperation
(
"导出-委托单校核详情"
)
@PostMapping
(
"/exportCheckDetail/{entrustId}"
)
public
void
exportCheckDetail
(
@PathVariable
(
"entrustId"
)
Integer
entrustId
,
String
fileName
,
HttpServletResponse
response
)
{
try
{
entrustService
.
exportCheckDetail
(
entrustId
,
fileName
,
response
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"导出-委托单校核详情{}"
,
e
);
}
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/SampleMapper.java
View file @
464448a6
...
@@ -57,7 +57,7 @@ public interface SampleMapper extends BaseMapper<Sample> {
...
@@ -57,7 +57,7 @@ public interface SampleMapper extends BaseMapper<Sample> {
@Select
(
"select * from sample where entrust_id = #{entrustId} and cement_code= #{cementCode}"
)
@Select
(
"select * from sample where entrust_id = #{entrustId} and cement_code= #{cementCode}"
)
List
<
Sample
>
getByCementCode
(
@Param
(
"entrustId"
)
Integer
entrustId
,
@Param
(
"cementCode"
)
String
cementCode
);
List
<
Sample
>
getByCementCode
(
@Param
(
"entrustId"
)
Integer
entrustId
,
@Param
(
"cementCode"
)
String
cementCode
);
@Select
(
"select * from sample where entrust_id = #{entrustId} order by
id asc
"
)
@Select
(
"select * from sample where entrust_id = #{entrustId} order by
cement_code asc
"
)
List
<
Sample
>
getSampleCheckList
(
Integer
entrustId
);
List
<
Sample
>
getSampleCheckList
(
Integer
entrustId
);
List
<
SampleSaveDto
>
getSampleSaveList
();
List
<
SampleSaveDto
>
getSampleSaveList
();
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/DataStatisticsMapper.xml
View file @
464448a6
...
@@ -520,4 +520,6 @@
...
@@ -520,4 +520,6 @@
</mapper>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/NonStandardApprovalMapper.xml
View file @
464448a6
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
<select
id=
"exportList"
resultType=
"java.util.HashMap"
>
<select
id=
"exportList"
resultType=
"java.util.HashMap"
>
SELECT
SELECT
IF(ISNULL(na.id),'',na.id)
as 序号,
(@i:=@i+1)
as 序号,
IF(ISNULL(su.name),'',su.name) as 姓名,
IF(ISNULL(su.name),'',su.name) as 姓名,
IF(ISNULL(su.username),'',su.username) as 账户,
IF(ISNULL(su.username),'',su.username) as 账户,
IF(ISNULL(na.statistical),'',na.statistical) as 统计日期,
IF(ISNULL(na.statistical),'',na.statistical) as 统计日期,
...
@@ -62,6 +62,7 @@
...
@@ -62,6 +62,7 @@
)as 状态
)as 状态
FROM nonstandard_apply na
FROM nonstandard_apply na
left join sys_user su on na.user_id = su.id
left join sys_user su on na.user_id = su.id
,(select @i:=0)aa
<include
refid=
"where"
/>
<include
refid=
"where"
/>
order by na.start_time desc
order by na.start_time desc
</select>
</select>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/SampleDistributionMapper.xml
View file @
464448a6
...
@@ -170,4 +170,7 @@
...
@@ -170,4 +170,7 @@
where sd.entrust_id = #{entrustId}
where sd.entrust_id = #{entrustId}
group by sd.sample_id,sd.user_id
group by sd.sample_id,sd.user_id
</select>
</select>
</mapper>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/SampleLabelVo.java
View file @
464448a6
...
@@ -13,28 +13,18 @@ import lombok.Data;
...
@@ -13,28 +13,18 @@ import lombok.Data;
@ApiModel
(
"委托-样品标签打印Vo"
)
@ApiModel
(
"委托-样品标签打印Vo"
)
public
class
SampleLabelVo
{
public
class
SampleLabelVo
{
@ApiModelProperty
(
"样品名"
)
@ApiModelProperty
(
"样品名"
)
private
String
sampleName1
;
private
String
sampleName1
;
@ApiModelProperty
(
"平行样编号"
)
@ApiModelProperty
(
"平行样编号"
)
private
String
parallelCode1
;
private
String
parallelCode1
;
@ApiModelProperty
(
"样品名"
)
private
String
sampleName2
;
@ApiModelProperty
(
"平行样编号"
)
@ApiModelProperty
(
"平行样编号"
)
private
String
parallelCode2
;
private
String
parallelCode2
;
@ApiModelProperty
(
"样品名"
)
private
String
sampleName3
;
@ApiModelProperty
(
"平行样编号"
)
@ApiModelProperty
(
"平行样编号"
)
private
String
parallelCode3
;
private
String
parallelCode3
;
@ApiModelProperty
(
"样品名"
)
private
String
sampleName4
;
@ApiModelProperty
(
"平行样编号"
)
@ApiModelProperty
(
"平行样编号"
)
private
String
parallelCode4
;
private
String
parallelCode4
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IEntrustService.java
View file @
464448a6
...
@@ -180,15 +180,13 @@ public interface IEntrustService extends IService<Entrust> {
...
@@ -180,15 +180,13 @@ public interface IEntrustService extends IService<Entrust> {
*/
*/
BaseResponse
<
Map
<
String
,
Object
>>
getSampleFlowList
(
Integer
entrustId
);
BaseResponse
<
Map
<
String
,
Object
>>
getSampleFlowList
(
Integer
entrustId
);
/**
* 查看样品标签
* @param entrustId
* @return
*/
BaseResponse
<
Map
<
String
,
Object
>>
getSampleLabelList
(
Integer
entrustId
);
void
exportSampleLabel
(
Integer
entrustId
,
String
fileName
,
HttpServletResponse
response
);
void
exportCheckDetail
(
Integer
entrustId
,
String
fileName
,
HttpServletResponse
response
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/DataStatisticsServiceImpl.java
View file @
464448a6
...
@@ -380,6 +380,7 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
...
@@ -380,6 +380,7 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
QueryWrapper
<
Team
>
teamQueryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
Team
>
teamQueryWrapper
=
new
QueryWrapper
<>();
teamQueryWrapper
.
eq
(
"is_display"
,
1
);
teamQueryWrapper
.
eq
(
"is_display"
,
1
);
teamQueryWrapper
.
eq
(
"status"
,
1
);
teamQueryWrapper
.
eq
(
"status"
,
1
);
teamQueryWrapper
.
orderByAsc
(
"group_id"
,
"sort_no"
);
List
<
Team
>
teamList
=
teamService
.
list
(
teamQueryWrapper
);
List
<
Team
>
teamList
=
teamService
.
list
(
teamQueryWrapper
);
//转化成id为key的map
//转化成id为key的map
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
464448a6
...
@@ -5550,24 +5550,250 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -5550,24 +5550,250 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
}
/**
/**
*
查看
样品标签
*
导出
样品标签
* @param entrustId
* @param entrustId
* @return
* @return
*/
*/
public
BaseResponse
<
Map
<
String
,
Object
>>
getSampleLabelList
(
Integer
entrustId
)
{
public
void
exportSampleLabel
(
Integer
entrustId
,
if
(
entrustId
==
null
){
String
fileName
,
HttpServletResponse
response
)
{
return
BaseResponse
.
errorMsg
(
"参数错误"
);
EntrustVo
entrustVo
=
entrustMapper
.
getDetail
(
entrustId
);
List
<
Sample
>
list
=
sampleMapper
.
getSampleCheckList
(
entrustId
);
Map
<
String
,
List
<
Sample
>>
groupByCementCode
=
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
Sample:
:
getCementCode
,
Collectors
.
toList
()));
//开始填充数据。首先填充表头
XSSFWorkbook
wb
=
new
XSSFWorkbook
();
XSSFSheet
sheet
=
wb
.
createSheet
();
sheet
.
setDefaultColumnWidth
(
20
);
XSSFCellStyle
style
=
wb
.
createCellStyle
();
XSSFFont
font
=
wb
.
createFont
();
//水平居中
style
.
setAlignment
(
HorizontalAlignment
.
CENTER
);
//垂直居中
style
.
setVerticalAlignment
(
VerticalAlignment
.
CENTER
);
//字体加粗
font
.
setBold
(
true
);
style
.
setFont
(
font
);
int
coloum
=
0
;
for
(
Map
.
Entry
<
String
,
List
<
Sample
>>
entry
:
groupByCementCode
.
entrySet
()){
List
<
Sample
>
sampleList
=
entry
.
getValue
();
int
rownum
=
0
;
//记录当前插入数据的行数
if
(
coloum
==
0
){
for
(
int
i
=
0
;
i
<
sampleList
.
size
();
i
++){
rownum
=
i
*
4
;
XSSFRow
row1
=
sheet
.
createRow
(
rownum
);
row1
.
setHeightInPoints
(
46.5f
);
XSSFCell
tempCell_1
=
row1
.
createCell
(
coloum
);
tempCell_1
.
setCellValue
(
entrustVo
.
getProjectName
());
tempCell_1
.
setCellStyle
(
style
);
XSSFRow
row2
=
sheet
.
createRow
(
rownum
+
1
);
row2
.
setHeightInPoints
(
19.5f
);
XSSFCell
tempCell_2
=
row2
.
createCell
(
coloum
);
tempCell_2
.
setCellValue
(
entrustVo
.
getProjectCode
());
tempCell_2
.
setCellStyle
(
style
);
XSSFRow
row3
=
sheet
.
createRow
(
rownum
+
2
);
row3
.
setHeightInPoints
(
19.5f
);
XSSFCell
tempCell_3
=
row3
.
createCell
(
coloum
);
tempCell_3
.
setCellValue
(
sampleList
.
get
(
i
).
getName
());
tempCell_3
.
setCellStyle
(
style
);
XSSFRow
row4
=
sheet
.
createRow
(
rownum
+
3
);
row4
.
setHeightInPoints
(
19.5f
);
XSSFCell
tempCell_4
=
row4
.
createCell
(
coloum
);
tempCell_4
.
setCellValue
(
sampleList
.
get
(
i
).
getParallelCode
());
tempCell_4
.
setCellStyle
(
style
);
}
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
}
else
{
Entrust
entrust
=
entrustMapper
.
selectById
(
entrustId
);
for
(
int
i
=
0
;
i
<
sampleList
.
size
();
i
++){
if
(
entrust
==
null
)
{
rownum
=
i
*
4
;
return
BaseResponse
.
errorMsg
(
"信息错误"
);
XSSFRow
row1
=
sheet
.
getRow
(
rownum
)==
null
?
sheet
.
createRow
(
rownum
):
sheet
.
getRow
(
rownum
);
row1
.
setHeightInPoints
(
46.5f
);
XSSFCell
tempCell_1
=
row1
.
createCell
(
coloum
);
tempCell_1
.
setCellValue
(
entrustVo
.
getProjectName
());
tempCell_1
.
setCellStyle
(
style
);
XSSFRow
row2
=
sheet
.
getRow
(
rownum
+
1
)==
null
?
sheet
.
createRow
(
rownum
+
1
):
sheet
.
getRow
(
rownum
+
1
);
row2
.
setHeightInPoints
(
19.5f
);
XSSFCell
tempCell_2
=
row2
.
createCell
(
coloum
);
tempCell_2
.
setCellValue
(
entrustVo
.
getProjectCode
());
tempCell_2
.
setCellStyle
(
style
);
XSSFRow
row3
=
sheet
.
getRow
(
rownum
+
2
)==
null
?
sheet
.
createRow
(
rownum
+
2
):
sheet
.
getRow
(
rownum
+
2
);
row3
.
setHeightInPoints
(
19.5f
);
XSSFCell
tempCell_3
=
row3
.
createCell
(
coloum
);
tempCell_3
.
setCellValue
(
sampleList
.
get
(
i
).
getName
());
tempCell_3
.
setCellStyle
(
style
);
XSSFRow
row4
=
sheet
.
getRow
(
rownum
+
3
)==
null
?
sheet
.
createRow
(
rownum
+
3
):
sheet
.
getRow
(
rownum
+
3
);
row4
.
setHeightInPoints
(
19.5f
);
XSSFCell
tempCell_4
=
row4
.
createCell
(
coloum
);
tempCell_4
.
setCellValue
(
sampleList
.
get
(
i
).
getParallelCode
());
tempCell_4
.
setCellStyle
(
style
);
}
}
List
<
Sample
>
list
=
sampleMapper
.
getSampleCheckList
(
entrustId
);
map
.
put
(
"list"
,
list
);
}
map
.
put
(
"entrust"
,
entrust
);
coloum
=
coloum
+
1
;
return
BaseResponse
.
okData
(
map
);
}
ExcelUtil
.
excelExportNew
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"委托列表"
:
fileName
,
wb
,
response
);
}
/**
* 导出-委托单校核详情
* @param entrustId
* @param fileName
* @param response
*/
@Override
public
void
exportCheckDetail
(
Integer
entrustId
,
String
fileName
,
HttpServletResponse
response
)
{
EntrustVo
entrustVo
=
entrustMapper
.
getDetail
(
entrustId
);
if
(
entrustVo
==
null
){
return
;
}
//1.首先查询所有可见的检测项
QueryWrapper
<
Team
>
teamQueryWrapper
=
new
QueryWrapper
<>();
teamQueryWrapper
.
eq
(
"is_display"
,
1
);
teamQueryWrapper
.
eq
(
"status"
,
1
);
teamQueryWrapper
.
orderByAsc
(
"group_id"
,
"sort_no"
);
List
<
Team
>
teamList
=
teamService
.
list
(
teamQueryWrapper
);
//2只看主样 对应的最终结果值
List
<
Sample
>
sampleList
=
sampleMapper
.
getCheckSampleList
(
entrustId
);
//4.查询所有的派发检测项
QueryWrapper
<
SampleDistribution
>
sdqueryWrapper
=
new
QueryWrapper
<>();
sdqueryWrapper
.
eq
(
"entrust_id"
,
entrustId
);
sdqueryWrapper
.
in
(
"sample_id"
,
sampleList
.
stream
().
map
(
Sample:
:
getId
).
collect
(
Collectors
.
toList
()));
List
<
SampleDistribution
>
sampleDistributions
=
sampleDistributionService
.
list
(
sdqueryWrapper
);
//5.分组并统计 检测项id list
Map
<
Integer
,
List
<
SampleDistribution
>>
groupByTeamId
=
sampleDistributions
.
stream
().
collect
(
Collectors
.
groupingBy
(
SampleDistribution:
:
getTeamId
,
Collectors
.
toList
()));
//6.开始填充数据。首先填充表头
XSSFWorkbook
wb
=
new
XSSFWorkbook
();
XSSFSheet
sheet
=
wb
.
createSheet
();
XSSFCellStyle
style
=
wb
.
createCellStyle
();
XSSFFont
font
=
wb
.
createFont
();
//水平居中
style
.
setAlignment
(
HorizontalAlignment
.
CENTER
);
//垂直居中
style
.
setVerticalAlignment
(
VerticalAlignment
.
CENTER
);
//生成表头
String
[]
in_fo
=
{
"委托单号"
,
"委托单位"
,
"项目编号"
,
"项目名称"
,
"委托人"
,
"样品名称"
,
"本所编号"
,
"是否加急"
,
};
List
<
String
>
infoHeader
=
Arrays
.
asList
(
in_fo
);
generatoronsignationWorkbook2
(
font
,
style
,
sheet
,
infoHeader
,
teamList
.
stream
().
map
(
Team:
:
getName
).
collect
(
Collectors
.
toList
()));
//填充数据,从第二行开始
int
rownum
=
1
;
if
(
sampleList
!=
null
&&
sampleList
.
size
()
>
0
)
{
for
(
Sample
sample
:
sampleList
)
{
XSSFRow
row0
=
sheet
.
createRow
(
rownum
++);
// Map<Integer, List<SampleDistribution>> sampleDistribuGroup = groupByEntrustId.get(sample.getId()).stream().collect(Collectors.groupingBy(SampleDistribution::getTeamId, Collectors.toList()));
//处理委托人信息表头
for
(
int
i
=
0
;
i
<
infoHeader
.
size
();
i
++)
{
XSSFCell
tempCell
=
row0
.
createCell
(
i
);
if
(
infoHeader
.
get
(
i
).
equals
(
"委托单号"
)){
tempCell
.
setCellValue
(
entrustVo
.
getEntrustCode
()
==
null
?
""
:
entrustVo
.
getEntrustCode
());
tempCell
.
setCellStyle
(
style
);
}
else
if
(
infoHeader
.
get
(
i
).
equals
(
"委托单位"
)){
tempCell
.
setCellValue
(
entrustVo
.
getClientName
()
==
null
?
""
:
entrustVo
.
getClientName
());
tempCell
.
setCellStyle
(
style
);
}
else
if
(
infoHeader
.
get
(
i
).
equals
(
"项目编号"
)){
tempCell
.
setCellValue
(
entrustVo
.
getProjectCode
()
==
null
?
""
:
entrustVo
.
getProjectCode
());
tempCell
.
setCellStyle
(
style
);
}
else
if
(
infoHeader
.
get
(
i
).
equals
(
"项目名称"
)){
tempCell
.
setCellValue
(
entrustVo
.
getProjectName
()
==
null
?
""
:
entrustVo
.
getProjectName
());
tempCell
.
setCellStyle
(
style
);
}
else
if
(
infoHeader
.
get
(
i
).
equals
(
"委托人"
)){
tempCell
.
setCellValue
(
entrustVo
.
getUserName
()
==
null
?
""
:
entrustVo
.
getUserName
());
tempCell
.
setCellStyle
(
style
);
}
else
if
(
infoHeader
.
get
(
i
).
equals
(
"样品名称"
)){
tempCell
.
setCellValue
(
sample
.
getName
()
==
null
?
""
:
sample
.
getName
());
tempCell
.
setCellStyle
(
style
);
}
else
if
(
infoHeader
.
get
(
i
).
equals
(
"本所编号"
)){
tempCell
.
setCellValue
(
sample
.
getParallelCode
()
==
null
?
""
:
sample
.
getParallelCode
());
tempCell
.
setCellStyle
(
style
);
}
else
if
(
infoHeader
.
get
(
i
).
equals
(
"是否加急"
)){
tempCell
.
setCellValue
(
entrustVo
.
getIsUrgent
()
==
1
?
"加急"
:
"不加急"
);
tempCell
.
setCellStyle
(
style
);
}
}
//处理检测项总产值表头
for
(
int
i
=
infoHeader
.
size
();
i
<
teamList
.
size
()
+
infoHeader
.
size
();
i
++)
{
XSSFCell
tempCell
=
row0
.
createCell
(
i
);
Team
team
=
teamList
.
get
(
i
-
infoHeader
.
size
());
List
<
SampleDistribution
>
sdList
=
groupByTeamId
.
get
(
team
.
getId
());
String
lastResult
=
""
;
if
(
sdList
!=
null
&&
sdList
.
size
()>
0
){
if
(
sdList
.
get
(
0
).
getCheckId
()
!=
null
){
SampleDistributionCheck
disCheck
=
sampleDistributionCheckMapper
.
selectById
(
sdList
.
get
(
0
).
getCheckId
());
lastResult
=
disCheck
.
getLastResult
();
}
else
{
lastResult
=
sdList
.
get
(
0
).
getDistributionResult
();
}
}
tempCell
.
setCellValue
(
sdList
==
null
?
""
:
lastResult
);
tempCell
.
setCellStyle
(
style
);
}
}
}
}
ExcelUtil
.
excelExportNew
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"委托列表"
:
fileName
,
wb
,
response
);
}
private
static
void
generatoronsignationWorkbook2
(
XSSFFont
font
,
XSSFCellStyle
style
,
XSSFSheet
sheet
,
List
<
String
>
infoHeader
,
List
<
String
>
teamsHeader
)
{
//委托项的表头
int
rownum
=
0
;
//创建第一行
XSSFRow
row0
=
sheet
.
createRow
(
rownum
++);
//处理委托人信息表头
for
(
int
i
=
0
;
i
<
infoHeader
.
size
();
i
++)
{
XSSFCell
tempCell
=
row0
.
createCell
(
i
);
tempCell
.
setCellValue
(
infoHeader
.
get
(
i
));
tempCell
.
setCellStyle
(
style
);
}
//处理检测项总产值表头
for
(
int
i
=
infoHeader
.
size
();
i
<
teamsHeader
.
size
()
+
infoHeader
.
size
();
i
++)
{
XSSFCell
tempCell
=
row0
.
createCell
(
i
);
tempCell
.
setCellValue
(
ExcelUtil
.
applyFontsub
(
teamsHeader
.
get
(
i
-
infoHeader
.
size
()),
font
));
tempCell
.
setCellStyle
(
style
);
}
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/util/ExcelUtil.java
View file @
464448a6
...
@@ -326,6 +326,9 @@ public class ExcelUtil {
...
@@ -326,6 +326,9 @@ public class ExcelUtil {
public
static
XSSFRichTextString
applyFontsub
(
String
sub
,
XSSFFont
xxsfFont
)
{
public
static
XSSFRichTextString
applyFontsub
(
String
sub
,
XSSFFont
xxsfFont
)
{
XSSFRichTextString
richString
=
new
XSSFRichTextString
();
XSSFRichTextString
richString
=
new
XSSFRichTextString
();
if
(
sub
.
contains
(
"<sup>"
)
||
sub
.
contains
(
"</sup>"
))
{
sub
=
sub
.
replaceAll
(
"<sup>-</sup>"
,
"⁻"
);
}
if
(
sub
.
contains
(
"<sub>"
)
||
sub
.
contains
(
"</sub>"
))
{
if
(
sub
.
contains
(
"<sub>"
)
||
sub
.
contains
(
"</sub>"
))
{
xxsfFont
.
setTypeOffset
(
FontFormatting
.
SS_SUB
);
xxsfFont
.
setTypeOffset
(
FontFormatting
.
SS_SUB
);
richString
.
setString
(
sub
.
replaceAll
(
"</sub>"
,
"<sub>"
).
replaceAll
(
"<sub>"
,
""
));
richString
.
setString
(
sub
.
replaceAll
(
"</sub>"
,
"<sub>"
).
replaceAll
(
"<sub>"
,
""
));
...
...
cement-business/target/classes/cn/wise/sc/cement/business/mapper/DataStatisticsMapper.xml
View file @
464448a6
...
@@ -520,4 +520,6 @@
...
@@ -520,4 +520,6 @@
</mapper>
</mapper>
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