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
5373945b
Commit
5373945b
authored
Mar 27, 2021
by
wangweidong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
土工平台修改
parent
92e493b1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
99 additions
and
33 deletions
+99
-33
PngReportHandle.java
...zn/cloud/service/lims/collect/handle/PngReportHandle.java
+2
-18
SoilExperimentController.java
...ervice/lims/soil/controller/SoilExperimentController.java
+1
-1
ISoilExperimentService.java
...oud/service/lims/soil/service/ISoilExperimentService.java
+1
-1
SoilExperimentServiceImpl.java
...ice/lims/soil/service/impl/SoilExperimentServiceImpl.java
+84
-7
SoilOriginalTemplateServiceImpl.java
...ms/soil/service/impl/SoilOriginalTemplateServiceImpl.java
+11
-6
No files found.
src/main/java/com/patzn/cloud/service/lims/collect/handle/PngReportHandle.java
View file @
5373945b
...
@@ -86,25 +86,9 @@ public class PngReportHandle implements ICollectHandler {
...
@@ -86,25 +86,9 @@ public class PngReportHandle implements ICollectHandler {
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
try
{
SmbFile
smbFile
=
new
SmbFile
(
"smb://administrator:www.163.com@192.168.0.115/土工试验数据/202010020/"
);
SmbFile
[]
smbFiles
=
smbFile
.
listFiles
();
for
(
SmbFile
file:
smbFiles
)
{
String
name
=
StringHandleUtils
.
getFileNameNoEx
(
file
.
getName
());
if
(!
name
.
equals
(
"YP202010426"
)){
continue
;
}
if
(
file
.
getName
().
contains
(
".png"
)){
}
else
if
(
file
.
getName
().
contains
(
".txt"
)){
//getShareFiles("smb://administrator:www.163.com@192.168.0.115/土工试验数据/202010020/");
// txt2String(file.getInputStream());
getShareFiles
(
"smb://administrator:www.163.com@192.168.0.115@192.168.0.115/土工试验数据/"
);
System
.
out
.
println
(
file
.
getName
());
}
}
System
.
out
.
println
(
smbFile
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
}
}
}
}
src/main/java/com/patzn/cloud/service/lims/soil/controller/SoilExperimentController.java
View file @
5373945b
...
@@ -736,7 +736,7 @@ public class SoilExperimentController extends ServiceController {
...
@@ -736,7 +736,7 @@ public class SoilExperimentController extends ServiceController {
@ApiOperation
(
value
=
"界限含水率(联合测定)采集文件批量上传"
,
notes
=
"附件批量上传"
)
@ApiOperation
(
value
=
"界限含水率(联合测定)采集文件批量上传"
,
notes
=
"附件批量上传"
)
@PostMapping
(
"/upload_water_jiexian_collect/{entrustId}"
)
@PostMapping
(
"/upload_water_jiexian_collect/{entrustId}"
)
public
RestResult
<
Boolean
>
uploadWaterJieXianCollect
(
@PathVariable
(
"entrustId"
)
Long
entrustId
,
Multipart
File
httpServletRequest
)
{
public
RestResult
<
Boolean
>
uploadWaterJieXianCollect
(
@PathVariable
(
"entrustId"
)
Long
entrustId
,
Multipart
HttpServletRequest
httpServletRequest
)
{
return
success
(
soilExperimentService
.
uploadWaterJieXianCollect
(
httpServletRequest
,
entrustId
,
getAccount
()));
return
success
(
soilExperimentService
.
uploadWaterJieXianCollect
(
httpServletRequest
,
entrustId
,
getAccount
()));
}
}
...
...
src/main/java/com/patzn/cloud/service/lims/soil/service/ISoilExperimentService.java
View file @
5373945b
...
@@ -109,7 +109,7 @@ public interface ISoilExperimentService extends IBaseService<SoilExperiment> {
...
@@ -109,7 +109,7 @@ public interface ISoilExperimentService extends IBaseService<SoilExperiment> {
boolean
uploadDynamicsCollect
(
MultipartHttpServletRequest
httpServletRequest
,
Long
entrustId
,
Account
account
);
boolean
uploadDynamicsCollect
(
MultipartHttpServletRequest
httpServletRequest
,
Long
entrustId
,
Account
account
);
boolean
uploadWaterJieXianCollect
(
Multipart
File
httpServletRequest
,
Long
entrustId
,
Account
account
);
boolean
uploadWaterJieXianCollect
(
Multipart
HttpServletRequest
httpServletRequest
,
Long
entrustId
,
Account
account
);
SoilExpReport
seniorTestReport
(
Long
id
,
Account
account
);
SoilExpReport
seniorTestReport
(
Long
id
,
Account
account
);
...
...
src/main/java/com/patzn/cloud/service/lims/soil/service/impl/SoilExperimentServiceImpl.java
View file @
5373945b
...
@@ -391,6 +391,8 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
...
@@ -391,6 +391,8 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
boolean
attachJIeXianWater
=
"界限含水率 (碟式液限仪多点法)试验记录表"
.
equals
(
template
.
getName
());
boolean
attachJIeXianWater
=
"界限含水率 (碟式液限仪多点法)试验记录表"
.
equals
(
template
.
getName
());
if
(
null
==
template
.
getMoreSheet
()
||
0
==
template
.
getMoreSheet
()){
if
(
null
==
template
.
getMoreSheet
()
||
0
==
template
.
getMoreSheet
()){
logger
.
error
(
"----------------------3"
);
logger
.
error
(
"----------------------3"
);
...
@@ -417,6 +419,8 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
...
@@ -417,6 +419,8 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
for
(
SoilExperimentVO
vo:
voList
)
{
for
(
SoilExperimentVO
vo:
voList
)
{
List
<
SoilItemVO
>
soilItemVOS
=
sampleSoilItemVOMap
.
get
(
vo
.
getSampleId
());
XSSFRow
xssfRow
=
sheetOne
.
getRow
(
beginRow
);
XSSFRow
xssfRow
=
sheetOne
.
getRow
(
beginRow
);
for
(
SoilOriginalTemplateConfig
config:
configList
)
{
for
(
SoilOriginalTemplateConfig
config:
configList
)
{
if
(
null
==
config
.
getColumnPlace
()){
if
(
null
==
config
.
getColumnPlace
()){
...
@@ -426,7 +430,29 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
...
@@ -426,7 +430,29 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
if
(
"sn"
.
equals
(
config
.
getDataAttribute
())){
if
(
"sn"
.
equals
(
config
.
getDataAttribute
())){
continue
;
continue
;
}
}
cell
.
setCellValue
(
StringHandleUtils
.
getFieldIfNummReturnBlankValueByFieldName
(
config
.
getDataAttribute
(),
vo
));
if
(
null
!=
config
.
getDataAttribute
()&&
config
.
getDataAttribute
().
contains
(
"for"
)){
String
name
=
config
.
getDataAttribute
().
replace
(
"for"
,
""
);
for
(
int
i
=
0
;
i
<
sampleMergerNum
;
i
++)
{
XSSFRow
zhuiRow
=
sheetOne
.
getRow
(
beginRow
+
i
);
if
(
null
!=
zhuiRow
){
XSSFCell
cellZhui
=
zhuiRow
.
getCell
(
config
.
getColumnPlace
());
if
(
null
!=
cellZhui
){
for
(
SoilItemVO
itemVO:
soilItemVOS
)
{
if
((
name
+(
i
+
1
)).
equals
(
itemVO
.
getName
())){
cellZhui
.
setCellValue
(
itemVO
.
getTestValue
());
break
;
}
}
}
}
}
continue
;
}
cell
.
setCellValue
(
getFieldValue
(
config
.
getDataAttribute
(),
vo
,
soilItemVOList
));
}
}
beginRow
+=
sampleMergerNum
;
beginRow
+=
sampleMergerNum
;
...
@@ -671,6 +697,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
...
@@ -671,6 +697,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
}
}
for
(
SoilExperimentVO
vo:
voList
)
{
for
(
SoilExperimentVO
vo:
voList
)
{
List
<
SoilItemVO
>
soilItemVOS
=
sampleSoilItemVOMap
.
get
(
vo
.
getSampleId
());
XSSFRow
xssfRow
=
sheetOne
.
getRow
(
beginRow
);
XSSFRow
xssfRow
=
sheetOne
.
getRow
(
beginRow
);
for
(
SoilOriginalTemplateConfig
config:
configList
)
{
for
(
SoilOriginalTemplateConfig
config:
configList
)
{
...
@@ -678,10 +705,37 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
...
@@ -678,10 +705,37 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
continue
;
continue
;
}
}
XSSFCell
cell
=
xssfRow
.
getCell
(
config
.
getColumnPlace
());
XSSFCell
cell
=
xssfRow
.
getCell
(
config
.
getColumnPlace
());
if
(
null
!=
config
.
getDataAttribute
()&&
config
.
getDataAttribute
().
contains
(
"for"
)){
String
name
=
config
.
getDataAttribute
().
replace
(
"for"
,
""
);
for
(
int
i
=
0
;
i
<
sampleMergerNum
;
i
++)
{
XSSFRow
zhuiRow
=
sheetOne
.
getRow
(
beginRow
+
i
);
if
(
null
!=
zhuiRow
){
XSSFCell
cellZhui
=
zhuiRow
.
getCell
(
config
.
getColumnPlace
());
if
(
null
!=
cellZhui
){
for
(
SoilItemVO
itemVO:
soilItemVOS
)
{
if
((
name
+(
i
+
1
)).
equals
(
itemVO
.
getName
())){
cellZhui
.
setCellValue
(
itemVO
.
getTestValue
());
break
;
}
}
}
}
}
continue
;
}
if
(
"sn"
.
equals
(
config
.
getDataAttribute
())){
if
(
"sn"
.
equals
(
config
.
getDataAttribute
())){
cell
.
setCellValue
(
sn
);
cell
.
setCellValue
(
sn
);
}
else
{
}
else
{
cell
.
setCellValue
(
StringHandleUtils
.
getFieldIfNummReturnBlankValueByFieldName
(
config
.
getDataAttribute
(),
vo
));
//cell.setCellValue(StringHandleUtils.getFieldIfNummReturnBlankValueByFieldName(config.getDataAttribute(),vo));
cell
.
setCellValue
(
getFieldValue
(
config
.
getDataAttribute
(),
vo
,
soilItemVOS
));
}
}
}
}
beginRow
+=
sampleMergerNum
;
beginRow
+=
sampleMergerNum
;
...
@@ -1351,6 +1405,25 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
...
@@ -1351,6 +1405,25 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
return
objectKey
;
return
objectKey
;
}
}
private
String
getFieldValue
(
String
dataAttribute
,
SoilExperimentVO
vo
,
List
<
SoilItemVO
>
soilItemVOList
)
{
if
(
StringUtils
.
isBlank
(
dataAttribute
)){
return
""
;
}
if
(
StringHandleUtils
.
is_alpha
(
dataAttribute
)){
return
StringHandleUtils
.
getFieldIfNummReturnBlankValueByFieldName
(
dataAttribute
,
vo
);
}
else
{
if
(
CollectionUtils
.
isEmpty
(
soilItemVOList
)){
return
""
;
}
for
(
SoilItemVO
soilItemVO
:
soilItemVOList
)
{
if
(
dataAttribute
.
equals
(
soilItemVO
.
getName
())){
return
soilItemVO
.
getTestValue
();
}
}
}
return
""
;
}
public
void
GenerateChart
(
XSSFSheet
sheet
,
String
xValue
,
String
yValue
)
{
public
void
GenerateChart
(
XSSFSheet
sheet
,
String
xValue
,
String
yValue
)
{
...
@@ -2847,7 +2920,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
...
@@ -2847,7 +2920,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
@Override
public
boolean
uploadWaterJieXianCollect
(
Multipart
File
file
,
Long
entrustId
,
Account
account
)
{
public
boolean
uploadWaterJieXianCollect
(
Multipart
HttpServletRequest
multipartHttpServletRequest
,
Long
entrustId
,
Account
account
)
{
RestAssert
.
fail
(
null
==
entrustId
,
"请选则委托单ID"
);
RestAssert
.
fail
(
null
==
entrustId
,
"请选则委托单ID"
);
SoilEntrust
entrust
=
soilEntrustService
.
getById
(
entrustId
);
SoilEntrust
entrust
=
soilEntrustService
.
getById
(
entrustId
);
...
@@ -2856,9 +2929,13 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
...
@@ -2856,9 +2929,13 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
if
(
CollectionUtils
.
isEmpty
(
voList
)){
if
(
CollectionUtils
.
isEmpty
(
voList
)){
RestAssert
.
fail
(
"检测项目不存在"
);
RestAssert
.
fail
(
"检测项目不存在"
);
}
}
Iterator
<
String
>
fileNamesItOk
=
multipartHttpServletRequest
.
getFileNames
();
parseWuxingTxt
(
file
,
entrust
,
voList
);
while
(
fileNamesItOk
.
hasNext
())
{
String
fileName
=
fileNamesItOk
.
next
();
// 获取文件
MultipartFile
file
=
multipartHttpServletRequest
.
getFile
(
fileName
);
parseWuxingTxt
(
file
,
entrust
,
voList
);
}
return
true
;
return
true
;
}
}
...
@@ -3571,7 +3648,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
...
@@ -3571,7 +3648,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
RestAssert
.
fail
(
StringUtils
.
isBlank
(
collectDataVO
.
getExpName
()),
"试验项目名称不能为空!"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
collectDataVO
.
getExpName
()),
"试验项目名称不能为空!"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
collectDataVO
.
getName
()),
"指标名称不能为空!"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
collectDataVO
.
getName
()),
"指标名称不能为空!"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
collectDataVO
.
getTestValue
()),
"指标值不能为空!"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
collectDataVO
.
getTestValue
()),
"指标值不能为空!"
);
RestAssert
.
fail
(
collectDataVO
.
getEntrustCode
().
equals
(
entrust
.
getEntrustCode
()),
"委托编号不匹配!"
);
RestAssert
.
fail
(
!
collectDataVO
.
getEntrustCode
().
equals
(
entrust
.
getEntrustCode
()),
"委托编号不匹配!"
);
}
}
...
...
src/main/java/com/patzn/cloud/service/lims/soil/service/impl/SoilOriginalTemplateServiceImpl.java
View file @
5373945b
...
@@ -458,10 +458,15 @@ public class SoilOriginalTemplateServiceImpl extends BaseServiceImpl<SoilOrigina
...
@@ -458,10 +458,15 @@ public class SoilOriginalTemplateServiceImpl extends BaseServiceImpl<SoilOrigina
if
(
null
==
itemValueIndex
||
itemValueIndex
==
sampleMergerNum
){
if
(
null
==
itemValueIndex
||
itemValueIndex
==
sampleMergerNum
){
XSSFCell
itemCell
=
xssfRow
.
getCell
(
collectEntity
.
getColumnPlace
());
XSSFCell
itemCell
=
xssfRow
.
getCell
(
collectEntity
.
getColumnPlace
());
String
value
=
""
;
String
value
=
""
;
if
(
itemCell
.
getCellType
().
equals
(
CellType
.
FORMULA
)){
// if (itemCell.getCellType().equals(CellType.FORMULA)){
value
=
HSSFWorkbookUtil
.
getJavaValue
(
itemCell
).
toString
();
// value = HSSFWorkbookUtil.getJavaValue(itemCell).toString();
}
else
{
// }else {
// value = formatter.formatCellValue(itemCell, evaluator);
// }
try
{
value
=
formatter
.
formatCellValue
(
itemCell
,
evaluator
);
value
=
formatter
.
formatCellValue
(
itemCell
,
evaluator
);
}
catch
(
Exception
e
){
value
=
HSSFWorkbookUtil
.
getJavaValue
(
itemCell
).
toString
();
}
}
...
@@ -519,10 +524,10 @@ public class SoilOriginalTemplateServiceImpl extends BaseServiceImpl<SoilOrigina
...
@@ -519,10 +524,10 @@ public class SoilOriginalTemplateServiceImpl extends BaseServiceImpl<SoilOrigina
continue
;
continue
;
}
}
String
value
=
""
;
String
value
=
""
;
if
(
itemCell
.
getCellType
().
equals
(
CellType
.
FORMULA
)){
try
{
value
=
HSSFWorkbookUtil
.
getJavaValue
(
itemCell
).
toString
();
}
else
{
value
=
formatter
.
formatCellValue
(
itemCell
,
evaluator
);
value
=
formatter
.
formatCellValue
(
itemCell
,
evaluator
);
}
catch
(
Exception
e
){
value
=
HSSFWorkbookUtil
.
getJavaValue
(
itemCell
).
toString
();
}
}
...
...
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