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
39cf9028
Commit
39cf9028
authored
Mar 03, 2021
by
zhangmengqi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev'
parents
e2cfc750
f237380a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
288 additions
and
63 deletions
+288
-63
CollectUtil.java
...java/com/patzn/cloud/service/lims/common/CollectUtil.java
+188
-55
SoilExperimentController.java
...ervice/lims/soil/controller/SoilExperimentController.java
+12
-0
ISoilExperimentService.java
...oud/service/lims/soil/service/ISoilExperimentService.java
+2
-0
SoilAppendixServiceImpl.java
...rvice/lims/soil/service/impl/SoilAppendixServiceImpl.java
+17
-0
SoilExperimentServiceImpl.java
...ice/lims/soil/service/impl/SoilExperimentServiceImpl.java
+60
-0
application-zhyf.yml
src/main/resources/application-zhyf.yml
+7
-7
TestDian.java
...test/java/com/patzn/cloud/service/lims/test/TestDian.java
+2
-1
No files found.
src/main/java/com/patzn/cloud/service/lims/common/CollectUtil.java
View file @
39cf9028
package
com
.
patzn
.
cloud
.
service
.
lims
.
common
;
package
com
.
patzn
.
cloud
.
service
.
lims
.
common
;
import
com.baomidou.mybatisplus.toolkit.CollectionUtils
;
import
com.patzn.cloud.service.lims.collect.statics.StaticsData
;
import
com.patzn.cloud.service.lims.collect.statics.StaticsData
;
import
com.patzn.cloud.service.soil.entity.SoilExperimentCollectData
;
import
com.patzn.cloud.service.soil.entity.SoilExperimentCollectData
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -11,7 +12,7 @@ import java.util.List;
...
@@ -11,7 +12,7 @@ import java.util.List;
public
class
CollectUtil
{
public
class
CollectUtil
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
File
file
=
new
File
(
"D://
直接剪切YP202102003
.txt"
);
File
file
=
new
File
(
"D://
固结S-5
.txt"
);
try
{
try
{
FileInputStream
io
=
new
FileInputStream
(
file
);
FileInputStream
io
=
new
FileInputStream
(
file
);
txt2String
(
io
);
txt2String
(
io
);
...
@@ -28,71 +29,105 @@ public class CollectUtil {
...
@@ -28,71 +29,105 @@ public class CollectUtil {
try
{
try
{
InputStreamReader
inputReader
=
new
InputStreamReader
(
io
,
"GBK"
);
InputStreamReader
inputReader
=
new
InputStreamReader
(
io
,
"GBK"
);
BufferedReader
brCheck
=
new
BufferedReader
(
inputReader
);
//构造一个BufferedReader类来读取文件
BufferedReader
br
=
new
BufferedReader
(
inputReader
);
//构造一个BufferedReader类来读取文件
BufferedReader
br
=
new
BufferedReader
(
inputReader
);
//构造一个BufferedReader类来读取文件
String
s
=
null
;
String
s
=
null
;
List
<
String
>
titleList
=
new
ArrayList
<>();
List
<
String
>
titleList
=
new
ArrayList
<>();
while
((
s
=
br
.
readLine
())!=
null
){
//使用readLine方法,一次读一行
List
<
String
>
wuxianceList
=
new
ArrayList
<>();
String
content
=
s
;
List
<
String
>
unitList
=
new
ArrayList
<>();
List
<
String
>
yuanzhuangList
=
new
ArrayList
<>();
content
=
content
.
replace
(
"凝 聚 力"
,
"凝聚力"
);
List
<
String
>
chongsuList
=
new
ArrayList
<>();
content
=
content
.
replace
(
"灵 敏 度"
,
"灵敏度"
);
content
=
content
.
replace
(
"粘 聚 力"
,
"凝聚力"
);
StringBuffer
sbAll
=
new
StringBuffer
();
content
=
content
.
replace
(
"粘聚力"
,
"凝聚力"
);
content
=
content
.
replace
(
"压缩系数(100-200KPa):"
,
"压缩系数(100-200KPa)"
);
List
<
String
>
allStringList
=
new
ArrayList
<>();
content
=
content
.
replace
(
"压缩模量(100-200KPa):"
,
"压缩模量(100-200KPa)"
);
content
=
content
.
replace
(
"压缩系数(100-200KPa):"
,
"压缩系数(100-200KPa)"
);
while
((
s
=
brCheck
.
readLine
())!=
null
){
content
=
content
.
replace
(
"压缩模量(100-200KPa):"
,
"压缩模量(100-200KPa)"
);
allStringList
.
add
(
s
);
String
[]
dataArray
=
content
.
split
(
" "
);
String
content
=
s
.
replace
(
" "
,
""
);
for
(
String
handleS:
dataArray
)
{
sbAll
.
append
(
content
);
handleS
=
handleS
.
trim
();
}
handleS
=
handleS
.
replace
(
":"
,
""
).
replace
(
":"
,
""
);
if
(
""
.
equals
(
handleS
)){
if
(
sbAll
.
toString
().
contains
(
"无侧限抗压强度试验"
)){
boolean
isWuxiance
=
false
;
int
i
=
0
;
for
(
String
str:
allStringList
)
{
String
content
=
str
;
if
(
""
.
equals
(
content
)){
continue
;
continue
;
}
}
if
(
handleS
.
contains
(
"
─"
)){
if
(
content
.
contains
(
"─
─"
)){
continue
;
continue
;
}
}
if
(
handleS
.
contains
(
"│"
)){
if
(
content
.
contains
(
"│"
)){
if
(
content
.
contains
(
"剪切峰值"
)||
isWuxiance
){
isWuxiance
=
true
;
String
[]
titleNameArray
=
content
.
split
(
"│"
);
for
(
String
titleName:
titleNameArray
)
{
titleName
=
titleName
.
replace
(
" "
,
""
);
if
(
StringUtils
.
isBlank
(
titleName
)){
continue
;
}
if
(
i
==
0
){
wuxianceList
.
add
(
titleName
);
}
else
if
(
i
==
1
){
unitList
.
add
(
titleName
);
}
else
if
(
i
==
2
){
yuanzhuangList
.
add
(
titleName
);
}
else
if
(
i
==
3
){
chongsuList
.
add
(
titleName
);
}
}
i
=
i
+
1
;
}
continue
;
continue
;
}
}
titleList
.
add
(
handleS
);
System
.
out
.
println
(
s
);
result
.
append
(
System
.
lineSeparator
()+
s
);
}
}
// if (checkContent(content, StaticsData.parseTxtList)){
System
.
out
.
println
(
wuxianceList
);
// String njl= subString(s,"凝 聚 力","内摩擦角");
System
.
out
.
println
(
unitList
);
// SoilExperimentCollectData njlData = new SoilExperimentCollectData();
System
.
out
.
println
(
yuanzhuangList
);
// njlData.setName("凝聚力");
System
.
out
.
println
(
chongsuList
);
// njlData.setTestValue(njl);
//
}
else
{
// String nmcj= subString(s,"内摩擦角","有效凝聚力");
// SoilExperimentCollectData nmcjData = new SoilExperimentCollectData();
for
(
String
str:
allStringList
){
// nmcjData.setName("内摩擦角");
String
content
=
str
;
// nmcjData.setTestValue(nmcj);
//
content
=
content
.
replace
(
"凝 聚 力"
,
"凝聚力"
);
//
content
=
content
.
replace
(
"灵 敏 度"
,
"灵敏度"
);
// String yxnjl= subString(s,"有效凝聚力","有效摩擦角");
content
=
content
.
replace
(
"粘 聚 力"
,
"凝聚力"
);
// SoilExperimentCollectData yxnjlData = new SoilExperimentCollectData();
content
=
content
.
replace
(
"粘聚力"
,
"凝聚力"
);
// yxnjlData.setName("有效凝聚力");
content
=
content
.
replace
(
"固结系数(t90):"
,
"固结系数(t90)"
);
// yxnjlData.setTestValue(yxnjl);
content
=
content
.
replace
(
"压缩系数(100-200KPa):"
,
"压缩系数(100-200KPa)"
);
//
content
=
content
.
replace
(
"压缩模量(100-200KPa):"
,
"压缩模量(100-200KPa)"
);
//
content
=
content
.
replace
(
"压缩系数(100-200KPa):"
,
"压缩系数(100-200KPa)"
);
// String yxmcj= subString(s,"有效摩擦角");
content
=
content
.
replace
(
"压缩模量(100-200KPa):"
,
"压缩模量(100-200KPa)"
);
//
String
[]
dataArray
=
content
.
split
(
" "
);
// SoilExperimentCollectData yxmcjData = new SoilExperimentCollectData();
for
(
String
handleS:
dataArray
)
{
// yxmcjData.setName("有效摩擦角");
handleS
=
handleS
.
trim
();
// yxmcjData.setTestValue(yxmcj);
handleS
=
handleS
.
replace
(
":"
,
""
).
replace
(
":"
,
""
);
//
if
(
""
.
equals
(
handleS
)){
//
continue
;
//
}
// dataList.add(njlData);
if
(
handleS
.
contains
(
"─"
)){
// dataList.add(yxmcjData);
continue
;
// dataList.add(nmcjData);
}
// dataList.add(yxnjlData);
if
(
handleS
.
contains
(
"│"
)){
//
continue
;
// }
}
titleList
.
add
(
handleS
);
System
.
out
.
println
(
s
);
}
result
.
append
(
System
.
lineSeparator
()+
s
);
System
.
out
.
println
(
s
);
result
.
append
(
System
.
lineSeparator
()+
s
);
}
}
}
int
size
=
titleList
.
size
();
int
size
=
titleList
.
size
();
...
@@ -104,6 +139,11 @@ public class CollectUtil {
...
@@ -104,6 +139,11 @@ public class CollectUtil {
String
sampleCode
=
""
;
String
sampleCode
=
""
;
String
yasuomoliang100to200
=
""
;
String
yasuomoliang100to200
=
""
;
String
testMethod
=
""
;
String
testMethod
=
""
;
String
gujieT90
=
""
;
String
youxiaonianjuli
=
""
;
String
youxiaomocajiao
=
""
;
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
String
str
=
titleList
.
get
(
i
);
String
str
=
titleList
.
get
(
i
);
...
@@ -188,6 +228,46 @@ public class CollectUtil {
...
@@ -188,6 +228,46 @@ public class CollectUtil {
}
}
}
}
if
(
"固结系数(t90)"
.
equals
(
str
)){
gujieT90
=
titleList
.
get
(
i
+
1
);
if
(
StringUtils
.
isNotBlank
(
gujieT90
)){
SoilExperimentCollectData
collectData
=
new
SoilExperimentCollectData
();
collectData
.
setName
(
"固结系数(t90)"
);
collectData
.
setTestValue
(
gujieT90
);
if
(
i
+
2
<
size
){
collectData
.
setUnit
(
titleList
.
get
(
i
+
2
));
}
dataList
.
add
(
collectData
);
}
}
if
(
"有效粘聚力"
.
equals
(
str
)){
youxiaonianjuli
=
titleList
.
get
(
i
+
1
);
if
(
StringUtils
.
isNotBlank
(
youxiaonianjuli
)){
SoilExperimentCollectData
collectData
=
new
SoilExperimentCollectData
();
collectData
.
setName
(
"有效粘聚力"
);
collectData
.
setTestValue
(
youxiaonianjuli
);
if
(
i
+
2
<
size
){
collectData
.
setUnit
(
titleList
.
get
(
i
+
2
));
}
dataList
.
add
(
collectData
);
}
}
if
(
"有效摩擦角"
.
equals
(
str
)){
youxiaomocajiao
=
titleList
.
get
(
i
+
1
);
if
(
StringUtils
.
isNotBlank
(
youxiaomocajiao
)){
SoilExperimentCollectData
collectData
=
new
SoilExperimentCollectData
();
collectData
.
setName
(
"有效摩擦角"
);
collectData
.
setTestValue
(
youxiaomocajiao
);
if
(
i
+
2
<
size
){
collectData
.
setUnit
(
titleList
.
get
(
i
+
2
));
}
dataList
.
add
(
collectData
);
}
}
if
(
"试验编号"
.
equals
(
str
)){
if
(
"试验编号"
.
equals
(
str
)){
sampleCode
=
titleList
.
get
(
i
+
1
);
sampleCode
=
titleList
.
get
(
i
+
1
);
}
}
...
@@ -203,7 +283,60 @@ public class CollectUtil {
...
@@ -203,7 +283,60 @@ public class CollectUtil {
}
}
}
}
if
(
CollectionUtils
.
isNotEmpty
(
wuxianceList
)){
if
(
CollectionUtils
.
isNotEmpty
(
yuanzhuangList
)&&
wuxianceList
.
size
()
==
yuanzhuangList
.
size
()){
Integer
yuanzhuangJianQie
=
null
;
int
sizeTitle
=
wuxianceList
.
size
();
for
(
int
i
=
0
;
i
<
sizeTitle
;
i
++)
{
String
titleName
=
wuxianceList
.
get
(
i
);
if
(
"剪切峰值"
.
equals
(
titleName
)){
yuanzhuangJianQie
=
i
;
break
;
}
}
if
(
null
!=
yuanzhuangJianQie
){
String
yuanzhuangJQQD
=
yuanzhuangList
.
get
(
yuanzhuangJianQie
);
if
(
StringUtils
.
isNotBlank
(
yuanzhuangJQQD
)){
SoilExperimentCollectData
collectData
=
new
SoilExperimentCollectData
();
collectData
.
setName
(
"原状剪切强度"
);
collectData
.
setTestValue
(
yuanzhuangJQQD
);
dataList
.
add
(
collectData
);
}
}
}
if
(
CollectionUtils
.
isNotEmpty
(
chongsuList
)&&
wuxianceList
.
size
()
==
chongsuList
.
size
()){
Integer
yuanzhuangJianQie
=
null
;
int
sizeTitle
=
wuxianceList
.
size
();
for
(
int
i
=
0
;
i
<
sizeTitle
;
i
++)
{
String
titleName
=
wuxianceList
.
get
(
i
);
if
(
"剪切峰值"
.
equals
(
titleName
)){
yuanzhuangJianQie
=
i
;
break
;
}
}
if
(
null
!=
yuanzhuangJianQie
){
String
yuanzhuangJQQD
=
chongsuList
.
get
(
yuanzhuangJianQie
);
if
(
StringUtils
.
isNotBlank
(
yuanzhuangJQQD
)){
SoilExperimentCollectData
collectData
=
new
SoilExperimentCollectData
();
collectData
.
setName
(
"重塑剪切强度"
);
collectData
.
setTestValue
(
yuanzhuangJQQD
);
dataList
.
add
(
collectData
);
}
}
}
}
br
.
close
();
br
.
close
();
brCheck
.
close
();
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
src/main/java/com/patzn/cloud/service/lims/soil/controller/SoilExperimentController.java
View file @
39cf9028
...
@@ -660,6 +660,11 @@ public class SoilExperimentController extends ServiceController {
...
@@ -660,6 +660,11 @@ public class SoilExperimentController extends ServiceController {
}
}
@ApiOperation
(
value
=
"填写开土制备记录"
,
notes
=
"填写开土制备记录"
)
@ApiOperation
(
value
=
"填写开土制备记录"
,
notes
=
"填写开土制备记录"
)
@PostMapping
(
"/save_excel_open_soil_record"
)
@PostMapping
(
"/save_excel_open_soil_record"
)
public
RestResult
<
SoilOpenSoilRecord
>
saveExcelOpenSoilRecord
(
@RequestParam
(
"entrustId"
)
Long
entrustId
,
@RequestParam
(
"templateId"
)
Long
templateId
)
{
public
RestResult
<
SoilOpenSoilRecord
>
saveExcelOpenSoilRecord
(
@RequestParam
(
"entrustId"
)
Long
entrustId
,
@RequestParam
(
"templateId"
)
Long
templateId
)
{
...
@@ -675,6 +680,13 @@ public class SoilExperimentController extends ServiceController {
...
@@ -675,6 +680,13 @@ public class SoilExperimentController extends ServiceController {
}
}
@ApiOperation
(
value
=
"高级实验报告生成"
,
notes
=
"高级实验报告生成"
)
@PostMapping
(
"/senior_test_report"
)
public
RestResult
<
SoilExpReport
>
seniorTestReport
(
@RequestParam
(
"id"
)
Long
id
)
{
return
success
(
soilExperimentService
.
seniorTestReport
(
id
,
getAccount
()));
}
...
...
src/main/java/com/patzn/cloud/service/lims/soil/service/ISoilExperimentService.java
View file @
39cf9028
...
@@ -103,4 +103,6 @@ public interface ISoilExperimentService extends IBaseService<SoilExperiment> {
...
@@ -103,4 +103,6 @@ public interface ISoilExperimentService extends IBaseService<SoilExperiment> {
boolean
uploadGdsFile
(
MultipartFile
file
);
boolean
uploadGdsFile
(
MultipartFile
file
);
boolean
uploadDynamicsCollect
(
MultipartHttpServletRequest
httpServletRequest
,
Long
entrustId
,
Account
account
);
boolean
uploadDynamicsCollect
(
MultipartHttpServletRequest
httpServletRequest
,
Long
entrustId
,
Account
account
);
SoilExpReport
seniorTestReport
(
Long
id
,
Account
account
);
}
}
src/main/java/com/patzn/cloud/service/lims/soil/service/impl/SoilAppendixServiceImpl.java
View file @
39cf9028
...
@@ -7,6 +7,7 @@ import com.patzn.cloud.service.lims.soil.mapper.SoilAppendixMapper;
...
@@ -7,6 +7,7 @@ import com.patzn.cloud.service.lims.soil.mapper.SoilAppendixMapper;
import
com.patzn.cloud.service.lims.soil.service.ISoilAppendixService
;
import
com.patzn.cloud.service.lims.soil.service.ISoilAppendixService
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
com.patzn.cloud.service.soil.entity.SoilAppendix
;
import
com.patzn.cloud.service.soil.entity.SoilAppendix
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
...
@@ -31,6 +32,22 @@ public class SoilAppendixServiceImpl extends BaseServiceImpl<SoilAppendixMapper,
...
@@ -31,6 +32,22 @@ public class SoilAppendixServiceImpl extends BaseServiceImpl<SoilAppendixMapper,
@Override
@Override
public
Page
<
SoilAppendix
>
page
(
Page
<
SoilAppendix
>
page
,
SoilAppendix
soilAppendix
)
{
public
Page
<
SoilAppendix
>
page
(
Page
<
SoilAppendix
>
page
,
SoilAppendix
soilAppendix
)
{
Wrapper
wrapper
=
new
EntityWrapper
<>(
soilAppendix
);
Wrapper
wrapper
=
new
EntityWrapper
<>(
soilAppendix
);
if
(
StringUtils
.
isNotBlank
(
soilAppendix
.
getTitle
())){
wrapper
.
like
(
"title"
,
soilAppendix
.
getTitle
());
soilAppendix
.
setTitle
(
null
);
}
if
(
StringUtils
.
isNotBlank
(
soilAppendix
.
getRemark
())){
wrapper
.
like
(
"remark"
,
soilAppendix
.
getRemark
());
soilAppendix
.
setRemark
(
null
);
}
if
(
StringUtils
.
isNotBlank
(
soilAppendix
.
getSampleCode
())){
wrapper
.
like
(
"sample_code"
,
soilAppendix
.
getSampleCode
());
soilAppendix
.
setSampleCode
(
null
);
}
wrapper
.
orderBy
(
"ctime"
);
wrapper
.
orderBy
(
"ctime"
);
return
this
.
page
(
page
,
wrapper
);
return
this
.
page
(
page
,
wrapper
);
}
}
...
...
src/main/java/com/patzn/cloud/service/lims/soil/service/impl/SoilExperimentServiceImpl.java
View file @
39cf9028
...
@@ -169,6 +169,10 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
...
@@ -169,6 +169,10 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
@Autowired
@Autowired
private
ISoilExpRelOriginalRecordService
soilExpRelOriginalRecordService
;
@Autowired
private
SysOrgClient
sysOrgClient
;
private
SysOrgClient
sysOrgClient
;
@Override
@Override
...
@@ -963,6 +967,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
...
@@ -963,6 +967,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
}
}
mapReplace
.
put
(
"#{sampleCode}"
,
vo
.
getSampleCode
());
mapReplace
.
put
(
"#{sampleCode}"
,
vo
.
getSampleCode
());
mapReplace
.
put
(
"#{siteNo}"
,
vo
.
getSiteNo
());
mapReplace
.
put
(
"#{sampleDepth}"
,
vo
.
getSampleDepth
());
mapReplace
.
put
(
"#{sampleDepth}"
,
vo
.
getSampleDepth
());
HSSFWorkbookUtil
.
replaceModel
(
mapReplace
,
xssfWorkbook
,
sheet
);
HSSFWorkbookUtil
.
replaceModel
(
mapReplace
,
xssfWorkbook
,
sheet
);
nextSample
++;
nextSample
++;
...
@@ -995,6 +1000,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
...
@@ -995,6 +1000,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
}
}
mapReplace
.
put
(
"#{sampleCode}"
,
firstVO
.
getSampleCode
());
mapReplace
.
put
(
"#{sampleCode}"
,
firstVO
.
getSampleCode
());
mapReplace
.
put
(
"#{siteNo}"
,
firstVO
.
getSiteNo
());
mapReplace
.
put
(
"#{sampleDepth}"
,
firstVO
.
getSampleDepth
());
mapReplace
.
put
(
"#{sampleDepth}"
,
firstVO
.
getSampleDepth
());
HSSFWorkbookUtil
.
replaceModel
(
mapReplace
,
xssfWorkbook
,
xssfSheet
);
HSSFWorkbookUtil
.
replaceModel
(
mapReplace
,
xssfWorkbook
,
xssfSheet
);
...
@@ -1613,6 +1619,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
...
@@ -1613,6 +1619,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
}
}
mapReplace
.
put
(
"#{sampleCode}"
,
vo
.
getSampleCode
());
mapReplace
.
put
(
"#{sampleCode}"
,
vo
.
getSampleCode
());
mapReplace
.
put
(
"#{siteNo}"
,
vo
.
getSiteNo
());
mapReplace
.
put
(
"#{sampleDepth}"
,
vo
.
getSampleDepth
());
mapReplace
.
put
(
"#{sampleDepth}"
,
vo
.
getSampleDepth
());
HSSFWorkbookUtil
.
replaceModel
(
mapReplace
,
xssfWorkbook
,
sheet
);
HSSFWorkbookUtil
.
replaceModel
(
mapReplace
,
xssfWorkbook
,
sheet
);
nextSample
++;
nextSample
++;
...
@@ -1645,6 +1652,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
...
@@ -1645,6 +1652,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
}
}
mapReplace
.
put
(
"#{sampleCode}"
,
firstVO
.
getSampleCode
());
mapReplace
.
put
(
"#{sampleCode}"
,
firstVO
.
getSampleCode
());
mapReplace
.
put
(
"#{siteNo}"
,
firstVO
.
getSiteNo
());
HSSFWorkbookUtil
.
replaceModel
(
mapReplace
,
xssfWorkbook
,
xssfSheet
);
HSSFWorkbookUtil
.
replaceModel
(
mapReplace
,
xssfWorkbook
,
xssfSheet
);
int
length
=
voList
.
size
();
int
length
=
voList
.
size
();
...
@@ -2491,6 +2499,58 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
...
@@ -2491,6 +2499,58 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
SoilExpReport
seniorTestReport
(
Long
id
,
Account
account
)
{
RestAssert
.
fail
(
null
==
id
,
"请选择高级试验!"
);
List
<
SoilExpRelOriginalRecord
>
relOriginalRecordList
=
soilExpRelOriginalRecordService
.
list
(
Condition
.
create
().
eq
(
"exp_id"
,
id
).
last
(
" LIMIT 1 "
));
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
relOriginalRecordList
),
"原始记录暂未生成!"
);
SoilExpRelOriginalRecord
originalRecord
=
relOriginalRecordList
.
get
(
0
);
SoilOriginalRecord
record
=
soilOriginalRecordService
.
getById
(
originalRecord
.
getRecordId
());
InputStream
io
=
ossClient
.
download
(
record
.
getObjectKey
());
if
(
null
==
io
){
logger
.
error
(
"----------------------2"
);
RestAssert
.
fail
(
"模板不存在"
);
}
logger
.
error
(
" InputStream io 存在"
);
SoilExpReport
objectKey
=
null
;
XSSFWorkbook
xssfWorkbook
=
null
;
try
{
xssfWorkbook
=
new
XSSFWorkbook
(
io
);
}
catch
(
Exception
e
){
logger
.
error
(
"获取开土制备记录模板错误"
+
e
.
getMessage
());
e
.
printStackTrace
();
}
FileOutputStream
os
=
null
;
File
file
=
null
;
String
generated
=
"试验项目报告"
;
SoilEntrust
entrust
=
soilEntrustService
.
getById
(
record
.
getEntrustId
());
SoilExperiment
experiment
=
getById
(
id
);
try
{
file
=
File
.
createTempFile
(
generated
,
".xlsx"
);
os
=
new
FileOutputStream
(
file
);
xssfWorkbook
.
write
(
os
);
os
.
flush
();
objectKey
=
soilExpReportService
.
uploadExpReportGenerate
(
new
Long
[]{
id
},
null
,
entrust
,
experiment
.
getName
(),
account
,
"报告生成"
,
file
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
os
.
close
();
xssfWorkbook
.
close
();
io
.
close
();
FileUtils
.
deleteFiles
(
file
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
return
objectKey
;
}
public
boolean
parseTxt
(
MultipartFile
smbFile
,
CollectDataType
request
)
{
public
boolean
parseTxt
(
MultipartFile
smbFile
,
CollectDataType
request
)
{
try
{
try
{
List
<
SoilExperimentCollectData
>
dataList
=
CollectUtil
.
txt2String
(
smbFile
.
getInputStream
());
List
<
SoilExperimentCollectData
>
dataList
=
CollectUtil
.
txt2String
(
smbFile
.
getInputStream
());
...
...
src/main/resources/application-zhyf.yml
View file @
39cf9028
...
@@ -11,20 +11,20 @@ service:
...
@@ -11,20 +11,20 @@ service:
spring
:
spring
:
datasource
:
datasource
:
username
:
dbsoiladmin
username
:
dbsoiladmin
password
:
ptoil
!%&
wzhj768
password
:
ptoilwzhj768
url
:
jdbc:postgresql://
127.0.0.1
:5432/pc_lims_soil
url
:
jdbc:postgresql://
db
:5432/pc_lims_soil
driver-class-name
:
org.postgresql.Driver
driver-class-name
:
org.postgresql.Driver
dynamic
:
dynamic
:
enabled
:
false
enabled
:
false
# 注册中心配置
# 注册中心配置
cloud
:
cloud
:
consul
:
consul
:
host
:
127.0.0.1
host
:
consul
rabbitmq
:
rabbitmq
:
host
:
127.0.0.1
host
:
rabbitmq
port
:
5672
port
:
5672
username
:
patznsomq
username
:
patznsomq
password
:
mqsoil456
#@$5
password
:
mqsoil456
!
virtual-host
:
/
virtual-host
:
/
topic
:
topic
:
push-msg
:
pro.topic.push.msg
push-msg
:
pro.topic.push.msg
...
@@ -34,12 +34,12 @@ spring:
...
@@ -34,12 +34,12 @@ spring:
report-make-msg
:
pro.topic.report.make.msg
report-make-msg
:
pro.topic.report.make.msg
soil-work-msg
:
pro.topic.soil.work.msg
soil-work-msg
:
pro.topic.soil.work.msg
redis
:
redis
:
host
:
127.0.0.1
host
:
redis
password
:
ptsoil476TMa
password
:
ptsoil476TMa
# Mongodb GridFS
# Mongodb GridFS
data
:
data
:
mongodb
:
mongodb
:
uri
:
mongodb://mgluser:soild574ld@
127.0.0.1
:27017/lims
uri
:
mongodb://mgluser:soild574ld@
mongodb
:27017/lims
grid-fs-database
:
lims
grid-fs-database
:
lims
# Mongodb GridFS 存储
# Mongodb GridFS 存储
...
...
src/test/java/com/patzn/cloud/service/lims/test/TestDian.java
View file @
39cf9028
...
@@ -17,7 +17,8 @@ import java.util.Random;
...
@@ -17,7 +17,8 @@ import java.util.Random;
public
class
TestDian
{
public
class
TestDian
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
createScatterChart
();
String
a
=
null
;
System
.
out
.
println
(
"abc"
.
contains
(
a
));
}
}
public
static
void
createScatterChart
()
throws
IOException
{
public
static
void
createScatterChart
()
throws
IOException
{
XSSFWorkbook
wb
=
new
XSSFWorkbook
();
XSSFWorkbook
wb
=
new
XSSFWorkbook
();
...
...
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