Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-service-hmhj
Overview
Overview
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
wangweidong
patzn-cloud-service-hmhj
Commits
9781e83e
Commit
9781e83e
authored
Jul 16, 2021
by
ghxdhr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
原始记录修改
parent
c79981d7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
124 additions
and
27 deletions
+124
-27
OriginalFactory.java
...tzn/cloud/service/lims/hmhj/original/OriginalFactory.java
+4
-4
SingleSheetMoreOperation.java
.../service/lims/hmhj/original/SingleSheetMoreOperation.java
+49
-0
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+70
-22
EntrustServiceImpl.java
...ud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
+1
-1
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/original/OriginalFactory.java
View file @
9781e83e
...
@@ -29,11 +29,11 @@ public class OriginalFactory {
...
@@ -29,11 +29,11 @@ public class OriginalFactory {
if
(
null
==
template
.
getSampleBeginRow
()||
null
==
template
.
getSampleMergerNum
()||
null
==
template
.
getTemplateSampleNum
()){
if
(
null
==
template
.
getSampleBeginRow
()||
null
==
template
.
getSampleMergerNum
()||
null
==
template
.
getTemplateSampleNum
()){
return
null
;
return
null
;
}
}
if
(
voList
.
size
()<
template
.
getTemplateSampleNum
()){
//
if (voList.size()<template.getTemplateSampleNum()){
return
new
SingleSheetLittleOperation
(
template
,
voList
,
entrust
,
configList
,
xssfWorkbook
);
//
return new SingleSheetLittleOperation(template,voList,entrust,configList,xssfWorkbook);
}
else
{
//
}else{
return
new
SingleSheetMoreOperation
(
template
,
voList
,
entrust
,
configList
,
xssfWorkbook
);
return
new
SingleSheetMoreOperation
(
template
,
voList
,
entrust
,
configList
,
xssfWorkbook
);
}
//
}
}
else
{
}
else
{
Integer
templateSampleNum
=
template
.
getTemplateSampleNum
();
Integer
templateSampleNum
=
template
.
getTemplateSampleNum
();
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/original/SingleSheetMoreOperation.java
View file @
9781e83e
...
@@ -11,6 +11,7 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -11,6 +11,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.apache.poi.ss.util.CellRangeAddress
;
import
org.apache.poi.ss.util.CellRangeAddress
;
import
org.apache.poi.xssf.usermodel.*
;
import
org.apache.poi.xssf.usermodel.*
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -21,6 +22,7 @@ public class SingleSheetMoreOperation implements Operation {
...
@@ -21,6 +22,7 @@ public class SingleSheetMoreOperation implements Operation {
private
Entrust
entrust
;
private
Entrust
entrust
;
private
List
<
OriginalTemplateConfig
>
configList
;
private
List
<
OriginalTemplateConfig
>
configList
;
private
XSSFWorkbook
xssfWorkbook
;
private
XSSFWorkbook
xssfWorkbook
;
private
String
collectionDataPrefix
=
"clc."
;
public
SingleSheetMoreOperation
(
OriginalTemplate
template
,
List
<
EntrustSampleItemVO
>
voList
,
Entrust
entrust
,
List
<
OriginalTemplateConfig
>
configList
,
XSSFWorkbook
xssfWorkbook
)
{
public
SingleSheetMoreOperation
(
OriginalTemplate
template
,
List
<
EntrustSampleItemVO
>
voList
,
Entrust
entrust
,
List
<
OriginalTemplateConfig
>
configList
,
XSSFWorkbook
xssfWorkbook
)
{
this
.
template
=
template
;
this
.
template
=
template
;
this
.
voList
=
voList
;
this
.
voList
=
voList
;
...
@@ -173,5 +175,52 @@ public class SingleSheetMoreOperation implements Operation {
...
@@ -173,5 +175,52 @@ public class SingleSheetMoreOperation implements Operation {
}
}
}
}
}
}
// 处理曲线和空白
dealCurveAndBlank
(
configList
,
voList
,
template
,
xssfWorkbook
);
}
private
void
dealCurveAndBlank
(
List
<
OriginalTemplateConfig
>
configList
,
List
<
EntrustSampleItemVO
>
voList
,
OriginalTemplate
template
,
XSSFWorkbook
xssfWorkbook
)
{
Integer
curveBeginNum
=
template
.
getCurveBeginNum
();
Integer
blankBeginNum
=
template
.
getBlankBeginNum
();
List
<
Map
<
String
,
String
>>
curveDataList
=
null
;
Map
<
String
,
String
>
blankDataMap
=
null
;
XSSFSheet
sheet
=
xssfWorkbook
.
getSheetAt
(
0
);
if
(
CollectionUtils
.
isNotEmpty
(
voList
))
{
curveDataList
=
voList
.
get
(
0
).
getCurveDataList
();
blankDataMap
=
voList
.
get
(
0
).
getBlankDataMap
();
}
// 填充曲线数据
if
(
curveBeginNum
!=
null
&&
CollectionUtils
.
isNotEmpty
(
curveDataList
))
{
int
index
=
0
;
for
(
int
i
=
curveBeginNum
;
i
<
curveBeginNum
+
curveDataList
.
size
();
i
++)
{
XSSFRow
row
=
sheet
.
getRow
(
i
);
for
(
OriginalTemplateConfig
config
:
configList
)
{
if
(
null
==
config
.
getColumnPlace
())
{
continue
;
}
if
(
null
!=
config
.
getDataAttribute
()
&&
config
.
getDataAttribute
().
startsWith
(
collectionDataPrefix
))
{
XSSFCell
cell
=
row
.
getCell
(
config
.
getColumnPlace
());
cell
.
setCellValue
(
curveDataList
.
get
(
index
).
get
(
config
.
getDataAttribute
().
substring
(
collectionDataPrefix
.
length
())));
}
}
}
index
++;
}
// 填充空白
if
(
blankBeginNum
!=
null
&&
blankDataMap
!=
null
&&
blankDataMap
.
size
()
>
0
)
{
XSSFRow
row
=
sheet
.
getRow
(
blankBeginNum
);
// 只插固定一行
for
(
OriginalTemplateConfig
config
:
configList
)
{
if
(
null
==
config
.
getColumnPlace
())
{
continue
;
}
if
(
null
!=
config
.
getDataAttribute
()
&&
config
.
getDataAttribute
().
startsWith
(
collectionDataPrefix
))
{
XSSFCell
cell
=
row
.
getCell
(
config
.
getColumnPlace
());
cell
.
setCellValue
(
blankDataMap
.
get
(
config
.
getDataAttribute
().
substring
(
collectionDataPrefix
.
length
())));
}
}
}
}
}
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
9781e83e
This diff is collapsed.
Click to expand it.
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
View file @
9781e83e
...
@@ -1282,7 +1282,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1282,7 +1282,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
private
ByteArrayOutputStream
getEntrustBaos
()
{
private
ByteArrayOutputStream
getEntrustBaos
()
{
InputStream
inputStream
=
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
"\\templates
.\\word.\\entrust.
\\EntrustExportTemplate.docx"
);
InputStream
inputStream
=
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
"\\templates
\\word\\entrust
\\EntrustExportTemplate.docx"
);
RestAssert
.
fail
(
null
==
inputStream
,
"委托检测书模板获取失败"
);
RestAssert
.
fail
(
null
==
inputStream
,
"委托检测书模板获取失败"
);
byte
[]
buffer
=
new
byte
[
1024
];
byte
[]
buffer
=
new
byte
[
1024
];
int
len
;
int
len
;
...
...
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