Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-service-soil
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-soil
Commits
99537cad
Commit
99537cad
authored
Mar 27, 2021
by
wangweidong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
土工平台修改
parent
7497bfd5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
66 deletions
+90
-66
SoilExperimentServiceImpl.java
...ice/lims/soil/service/impl/SoilExperimentServiceImpl.java
+30
-58
SoilOriginalTemplateServiceImpl.java
...ms/soil/service/impl/SoilOriginalTemplateServiceImpl.java
+60
-8
No files found.
src/main/java/com/patzn/cloud/service/lims/soil/service/impl/SoilExperimentServiceImpl.java
View file @
99537cad
...
...
@@ -486,32 +486,32 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
XSSFCell
cell11
=
sheet
.
getRow
(
1
).
getCell
(
1
);
cell11
.
setCellStyle
(
style
);
cell11
.
setCellValue
(
"
对数
y轴"
);
cell11
.
setCellValue
(
"y轴"
);
XSSFCell
cell20
=
sheet
.
getRow
(
2
).
getCell
(
0
);
cell20
.
setCellFormula
(
"
LOG10('界限含水率 (碟式液限仪多点法)'!D"
+
xBegin1
+
")
"
);
cell20
.
setCellFormula
(
"
'界限含水率 (碟式液限仪多点法)'!D"
+
xBegin1
+
"
"
);
XSSFCell
cell30
=
sheet
.
getRow
(
3
).
getCell
(
0
);
cell30
.
setCellFormula
(
"
LOG10('界限含水率 (碟式液限仪多点法)'!D"
+
xBegin2
+
")
"
);
cell30
.
setCellFormula
(
"
'界限含水率 (碟式液限仪多点法)'!D"
+
xBegin2
+
"
"
);
XSSFCell
cell40
=
sheet
.
getRow
(
4
).
getCell
(
0
);
cell40
.
setCellFormula
(
"
LOG10('界限含水率 (碟式液限仪多点法)'!D"
+
xBegin3
+
")
"
);
cell40
.
setCellFormula
(
"
'界限含水率 (碟式液限仪多点法)'!D"
+
xBegin3
+
"
"
);
XSSFCell
cell21
=
sheet
.
getRow
(
2
).
getCell
(
1
);
cell21
.
setCellFormula
(
"
LOG10('界限含水率 (碟式液限仪多点法)'!J"
+
xBegin1
+
")
"
);
cell21
.
setCellFormula
(
"
'界限含水率 (碟式液限仪多点法)'!J"
+
xBegin1
+
"
"
);
XSSFCell
cell31
=
sheet
.
getRow
(
3
).
getCell
(
1
);
cell31
.
setCellFormula
(
"
LOG10('界限含水率 (碟式液限仪多点法)'!J"
+
xBegin2
+
")
"
);
cell31
.
setCellFormula
(
"
'界限含水率 (碟式液限仪多点法)'!J"
+
xBegin2
+
"
"
);
XSSFCell
cell41
=
sheet
.
getRow
(
4
).
getCell
(
1
);
cell41
.
setCellFormula
(
"
LOG10('界限含水率 (碟式液限仪多点法)'!J"
+
xBegin3
+
")
"
);
cell41
.
setCellFormula
(
"
'界限含水率 (碟式液限仪多点法)'!J"
+
xBegin3
+
"
"
);
XSSFCell
cell60
=
sheet
.
getRow
(
6
).
getCell
(
0
);
...
...
@@ -541,7 +541,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
XSSFCell
cell101
=
sheet
.
getRow
(
10
).
getCell
(
1
);
cell101
.
setCellFormula
(
"
10^
(B8*LOG10(25)+B9)"
);
cell101
.
setCellFormula
(
"(B8*LOG10(25)+B9)"
);
GenerateChart
(
sheet
,
"'界限含水率 (碟式液限仪多点法)'!$D$"
+
xBegin1
+
":"
+
"$D$"
+
xBegin3
,
"'界限含水率 (碟式液限仪多点法)'!$J$"
+
xBegin1
+
":$J$"
+
xBegin3
);
xBegin1
+=
xStep
;
...
...
@@ -636,7 +636,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
int
insertRow
=
beginRow
+
sampleMergerNum
*
templateSampleNum
;
logger
.
error
(
"---------------------9"
);
XSSFRow
zeroRow
=
sheetOne
.
getRow
(
beginRow
);
XSSFCellStyle
cellStyle
=
zeroRow
.
getCell
(
0
).
getCellStyle
();
logger
.
error
(
"----------------------10"
);
int
lastCellNum
=
zeroRow
.
getLastCellNum
();
...
...
@@ -649,6 +649,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
XSSFRow
row
=
sheetOne
.
createRow
(
insertRow
);
row
.
setHeight
(
zeroRow
.
getHeight
());
for
(
int
j
=
0
;
j
<
lastCellNum
;
j
++)
{
XSSFCellStyle
cellStyle
=
zeroRow
.
getCell
(
j
).
getCellStyle
();
XSSFCell
xssfCell
=
row
.
createCell
(
j
);
xssfCell
.
setCellStyle
(
cellStyle
);
}
...
...
@@ -741,32 +742,32 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
XSSFCell
cell11
=
sheet
.
getRow
(
1
).
getCell
(
1
);
cell11
.
setCellStyle
(
style
);
cell11
.
setCellValue
(
"对数
y轴
"
);
cell11
.
setCellValue
(
"对数"
);
XSSFCell
cell20
=
sheet
.
getRow
(
2
).
getCell
(
0
);
cell20
.
setCellFormula
(
"
LOG10('界限含水率 (碟式液限仪多点法)'!D"
+
xBegin1
+
")
"
);
cell20
.
setCellFormula
(
"
'界限含水率 (碟式液限仪多点法)'!D"
+
xBegin1
+
"
"
);
XSSFCell
cell30
=
sheet
.
getRow
(
3
).
getCell
(
0
);
cell30
.
setCellFormula
(
"
LOG10('界限含水率 (碟式液限仪多点法)'!D"
+
xBegin2
+
")
"
);
cell30
.
setCellFormula
(
"
'界限含水率 (碟式液限仪多点法)'!D"
+
xBegin2
+
"
"
);
XSSFCell
cell40
=
sheet
.
getRow
(
4
).
getCell
(
0
);
cell40
.
setCellFormula
(
"
LOG10('界限含水率 (碟式液限仪多点法)'!D"
+
xBegin3
+
")
"
);
cell40
.
setCellFormula
(
"
'界限含水率 (碟式液限仪多点法)'!D"
+
xBegin3
+
"
"
);
XSSFCell
cell21
=
sheet
.
getRow
(
2
).
getCell
(
1
);
cell21
.
setCellFormula
(
"
LOG10('界限含水率 (碟式液限仪多点法)'!J"
+
xBegin1
+
")
"
);
cell21
.
setCellFormula
(
"
'界限含水率 (碟式液限仪多点法)'!J"
+
xBegin1
+
"
"
);
XSSFCell
cell31
=
sheet
.
getRow
(
3
).
getCell
(
1
);
cell31
.
setCellFormula
(
"
LOG10('界限含水率 (碟式液限仪多点法)'!J"
+
xBegin2
+
")
"
);
cell31
.
setCellFormula
(
"
'界限含水率 (碟式液限仪多点法)'!J"
+
xBegin2
+
"
"
);
XSSFCell
cell41
=
sheet
.
getRow
(
4
).
getCell
(
1
);
cell41
.
setCellFormula
(
"
LOG10('界限含水率 (碟式液限仪多点法)'!J"
+
xBegin3
+
")
"
);
cell41
.
setCellFormula
(
"
'界限含水率 (碟式液限仪多点法)'!J"
+
xBegin3
+
"
"
);
XSSFCell
cell60
=
sheet
.
getRow
(
6
).
getCell
(
0
);
...
...
@@ -796,7 +797,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
XSSFCell
cell101
=
sheet
.
getRow
(
10
).
getCell
(
1
);
cell101
.
setCellFormula
(
"
10^
(B8*LOG10(25)+B9)"
);
cell101
.
setCellFormula
(
"(B8*LOG10(25)+B9)"
);
GenerateChart
(
sheet
,
"'界限含水率 (碟式液限仪多点法)'!$D$"
+
xBegin1
+
":"
+
"$D$"
+
xBegin3
,
"'界限含水率 (碟式液限仪多点法)'!$J$"
+
xBegin1
+
":$J$"
+
xBegin3
);
xBegin1
+=
xStep
;
...
...
@@ -1072,6 +1073,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
}
// HSSFWorkbookUtil.replaceModel(mapReplace,xssfWorkbook,sheet);
nextSample
++;
HSSFWorkbookUtil
.
replaceModel
(
mapReplace
,
xssfWorkbook
,
sheet
);
}
...
...
@@ -1121,10 +1123,10 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
mapReplace
.
put
(
"#{密度9.81}"
,
""
);
}
HSSFWorkbookUtil
.
replaceModel
(
mapReplace
,
xssfWorkbook
,
xssfSheet
);
int
numSheet
=
xssfWorkbook
.
getNumberOfSheets
();
for
(
int
i
=
0
;
i
<
numSheet
;
i
++)
{
HSSFWorkbookUtil
.
replaceModel
(
mapReplace
,
xssfWorkbook
,
xssfWorkbook
.
getSheetAt
(
i
));
}
//
int numSheet = xssfWorkbook.getNumberOfSheets();
//
for (int i = 0; i < numSheet; i++) {
//
HSSFWorkbookUtil.replaceModel(mapReplace,xssfWorkbook,xssfWorkbook.getSheetAt(i));
//
}
int
length
=
voList
.
size
();
// for (int i = 0; i < length; i++) {
...
...
@@ -1801,7 +1803,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
int
sampleMergerNum
=
sampleMergerNumOri
;
int
insertRow
=
beginRow
+
sampleMergerNum
*
templateSampleNum
;
XSSFRow
zeroRow
=
sheetOne
.
getRow
(
beginRow
);
XSSFCellStyle
cellStyle
=
zeroRow
.
getCell
(
0
).
getCellStyle
();
int
lastCellNum
=
zeroRow
.
getLastCellNum
();
int
insertCount
=
voList
.
size
()-
templateSampleNum
;
...
...
@@ -1812,6 +1814,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
row
.
setHeight
(
zeroRow
.
getHeight
());
for
(
int
j
=
0
;
j
<
lastCellNum
;
j
++)
{
XSSFCell
xssfCell
=
row
.
createCell
(
j
);
XSSFCellStyle
cellStyle
=
zeroRow
.
getCell
(
j
).
getCellStyle
();
xssfCell
.
setCellStyle
(
cellStyle
);
}
insertRow
++;
...
...
@@ -2934,17 +2937,6 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
List
<
SoilItem
>
saveSoilItemList
=
new
ArrayList
<>();
List
<
SoilItem
>
updateSoilItemList
=
new
ArrayList
<>();
String
testMethod
=
null
;
List
<
SoilItem
>
soilItems
=
soilItemService
.
list
(
Condition
.
create
().
eq
(
"experiment_id"
,
request
.
getExpId
()));
Map
<
String
,
SoilItem
>
soilItemMap
=
new
HashMap
<>();
for
(
SoilItem
item
:
soilItems
)
{
soilItemMap
.
put
(
item
.
getExperimentId
()+
item
.
getName
(),
item
);
}
for
(
SoilExperimentCollectData
collectData:
dataList
)
{
collectData
.
setExpId
(
request
.
getExpId
());
if
(
"试验方法"
.
equals
(
collectData
.
getName
())){
...
...
@@ -2960,15 +2952,11 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
item
.
setTestValue
(
collectData
.
getTestValue
());
item
.
setExperimentId
(
request
.
getExpId
());
item
.
setUnit
(
collectData
.
getUnit
());
if
(
null
==
soilItemMap
.
get
(
item
.
getExperimentId
()+
item
.
getName
())){
saveSoilItemList
.
add
(
item
);
}
else
{
item
.
setId
(
soilItemMap
.
get
(
item
.
getExperimentId
()+
item
.
getName
()).
getId
());
updateSoilItemList
.
add
(
item
);
}
}
if
(
CollectionUtils
.
isNotEmpty
(
saveSoilItemList
)){
soilItemService
.
remove
(
Condition
.
create
().
eq
(
"experiment_id"
,
request
.
getExpId
()));
soilItemService
.
saveBatch
(
saveSoilItemList
);
}
if
(
CollectionUtils
.
isNotEmpty
(
updateSoilItemList
)){
...
...
@@ -3520,16 +3508,6 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
List
<
SoilItem
>
updateSoilItemList
=
new
ArrayList
<>();
String
testMethod
=
null
;
List
<
SoilItem
>
soilItems
=
soilItemService
.
list
(
Condition
.
create
().
eq
(
"experiment_id"
,
request
.
getExpId
()));
Map
<
String
,
SoilItem
>
soilItemMap
=
new
HashMap
<>();
for
(
SoilItem
item
:
soilItems
)
{
soilItemMap
.
put
(
item
.
getExperimentId
()+
item
.
getName
(),
item
);
}
for
(
SoilExperimentCollectData
collectData:
dataList
)
{
collectData
.
setEquipName
(
request
.
getEquipName
());
collectData
.
setLabNum
(
request
.
getLabNum
());
...
...
@@ -3551,22 +3529,16 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
item
.
setTestValue
(
collectData
.
getTestValue
());
item
.
setExperimentId
(
request
.
getExpId
());
item
.
setUnit
(
collectData
.
getUnit
());
if
(
null
==
soilItemMap
.
get
(
item
.
getExperimentId
()+
item
.
getName
())){
saveSoilItemList
.
add
(
item
);
}
else
{
item
.
setId
(
soilItemMap
.
get
(
item
.
getExperimentId
()+
item
.
getName
()).
getId
());
updateSoilItemList
.
add
(
item
);
}
}
if
(
CollectionUtils
.
isNotEmpty
(
saveSoilItemList
)){
soilItemService
.
remove
(
Condition
.
create
().
eq
(
"experiment_id"
,
request
.
getExpId
()));
soilItemService
.
saveBatch
(
saveSoilItemList
);
}
if
(
CollectionUtils
.
isNotEmpty
(
updateSoilItemList
)){
soilItemService
.
updateBatchById
(
updateSoilItemList
);
}
//
if (CollectionUtils.isNotEmpty(updateSoilItemList)){
//
soilItemService.updateBatchById(updateSoilItemList);
//
}
if
(
StringUtils
.
isNotBlank
(
testMethod
)){
SoilExperiment
experiment
=
new
SoilExperiment
();
experiment
.
setTestMethod
(
testMethod
);
...
...
src/main/java/com/patzn/cloud/service/lims/soil/service/impl/SoilOriginalTemplateServiceImpl.java
View file @
99537cad
...
...
@@ -730,11 +730,65 @@ public class SoilOriginalTemplateServiceImpl extends BaseServiceImpl<SoilOrigina
if
(
null
==
config
.
getItemed
()||
0
==
config
.
getItemed
()){
continue
;
}
List
<
SoilExperiment
>
listE
=
experimentMap
.
get
(
sampleCode
);
if
(
CollectionUtils
.
isEmpty
(
listE
)){
continue
;
}
SoilExperiment
exp
=
listE
.
get
(
0
);
if
(
null
==
exp
){
continue
;
}
if
(
null
==
config
.
getColumnPlace
()){
if
(
null
!=
config
.
getItemed
()
&&
config
.
getItemed
()
==
1
&&
null
!=
config
.
getMergeBegin
()
&&
null
!=
config
.
getMergeRowNum
()){
ItemCollectEntity
collectEntity
=
new
ItemCollectEntity
();
collectEntity
.
setItemName
(
config
.
getAttributeName
());
collectEntity
.
setColumnPlace
(
config
.
getMergeBegin
());
collectEntity
.
setUnit
(
config
.
getUnit
());
collectEntity
.
setItemMegerRow
(
config
.
getMergeRowNum
());
collectEntity
.
setAttribute
(
config
.
getDataAttribute
());
collectEntity
.
setSingleElse
(
1
);
XSSFRow
valueNRow
=
xssfSheet
.
getRow
(
config
.
getMergeRowNum
());
XSSFCell
cellN
=
valueNRow
.
getCell
(
config
.
getMergeBegin
());
String
valueN
=
formatter
.
formatCellValue
(
cellN
,
evaluator
);
if
(
StringUtils
.
isNotBlank
(
valueN
)){
String
keyN
=
sampleCode
+
exp
.
getId
()+
config
.
getAttributeName
();
if
(!
stringMap
.
containsKey
(
keyN
)){
SoilItem
item
=
new
SoilItem
();
item
.
setCompanyId
(
companyId
);
item
.
setExperimentId
(
exp
.
getId
());
item
.
setUnit
(
config
.
getUnit
());
item
.
setTestValue
(
valueN
);
item
.
setName
(
config
.
getAttributeName
());
saveItemList
.
add
(
item
);
}
else
{
SoilItem
soilItem
=
new
SoilItem
();
soilItem
.
setTestValue
(
valueN
);
soilItem
.
setCompanyId
(
companyId
);
soilItem
.
setUnit
(
config
.
getUnit
());
soilItem
.
setId
(
stringMap
.
get
(
keyN
));
updateItemList
.
add
(
soilItem
);
}
}
}
continue
;
}
Integer
row
=
config
.
getMergeRowNum
();
Integer
col
=
config
.
getColumnPlace
();
Integer
sampleCodeRow
=
config
.
getMergeBegin
();
Integer
sampleCodeCol
=
config
.
getMergeEnd
();
...
...
@@ -770,16 +824,14 @@ public class SoilOriginalTemplateServiceImpl extends BaseServiceImpl<SoilOrigina
continue
;
}
List
<
SoilExperiment
>
listE
=
experimentMap
.
get
(
sampleCode
);
if
(
CollectionUtils
.
isEmpty
(
listE
)){
continue
;
}
SoilExperiment
exp
=
listE
.
get
(
0
);
if
(
null
==
exp
){
continue
;
}
String
key
=
sampleCode
+
exp
.
getId
()+
config
.
getAttributeName
();
if
(!
stringMap
.
containsKey
(
key
)){
SoilItem
item
=
new
SoilItem
();
item
.
setCompanyId
(
companyId
);
...
...
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