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
5efd1e68
Commit
5efd1e68
authored
Dec 31, 2020
by
wangweidong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
土工平台修改
parent
3816196a
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
262 additions
and
15 deletions
+262
-15
ChangeExcelData.java
.../com/patzn/cloud/service/lims/common/ChangeExcelData.java
+83
-0
HSSFWorkbookUtil.java
...com/patzn/cloud/service/lims/common/HSSFWorkbookUtil.java
+79
-1
SoilExpReportController.java
...service/lims/soil/controller/SoilExpReportController.java
+10
-0
ISoilEntrustService.java
.../cloud/service/lims/soil/service/ISoilEntrustService.java
+1
-1
ISoilExpReportService.java
...loud/service/lims/soil/service/ISoilExpReportService.java
+2
-0
SoilEntrustRecordServiceImpl.java
.../lims/soil/service/impl/SoilEntrustRecordServiceImpl.java
+1
-1
SoilEntrustServiceImpl.java
...ervice/lims/soil/service/impl/SoilEntrustServiceImpl.java
+2
-2
SoilExpReportServiceImpl.java
...vice/lims/soil/service/impl/SoilExpReportServiceImpl.java
+60
-0
SoilExperimentServiceImpl.java
...ice/lims/soil/service/impl/SoilExperimentServiceImpl.java
+18
-4
SoilSampleServiceImpl.java
...service/lims/soil/service/impl/SoilSampleServiceImpl.java
+6
-6
No files found.
src/main/java/com/patzn/cloud/service/lims/common/ChangeExcelData.java
0 → 100644
View file @
5efd1e68
package
com
.
patzn
.
cloud
.
service
.
lims
.
common
;
import
java.io.*
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
org.apache.poi.EncryptedDocumentException
;
import
org.apache.poi.openxml4j.exceptions.InvalidFormatException
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.Row
;
import
org.apache.poi.ss.usermodel.Sheet
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.apache.poi.ss.usermodel.WorkbookFactory
;
public
class
ChangeExcelData
{
public
static
void
main
(
String
[]
args
)
throws
IOException
,
EncryptedDocumentException
,
InvalidFormatException
{
String
path
=
"D:\\HHKJ\\project\\test\\excel.xlsx"
;
String
outPath
=
"D:\\HHKJ\\project\\test\\excel1.xlsx"
;
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"county"
,
"阳朔"
);
params
.
put
(
"patroltime"
,
"2019年1月15日"
);
params
.
put
(
"address"
,
"具体地点"
);
params
.
put
(
"slyz_type"
,
"乱建"
);
params
.
put
(
"rectify"
,
"2019年1月15日"
);
params
.
put
(
"rectifyrequest"
,
"拆除乱建"
);
params
.
put
(
"sendtime"
,
"2019年1月15日"
);
new
ChangeExcelData
().
replaceExcel
(
path
,
outPath
,
params
);
}
public
void
replaceExcel
(
String
inPath
,
String
outPath
,
Map
params
)
throws
IOException
,
InvalidFormatException
{
InputStream
is
=
new
FileInputStream
(
new
File
(
inPath
));
Workbook
wb
=
WorkbookFactory
.
create
(
is
);
Sheet
sheet
=
wb
.
getSheetAt
(
0
);
//获取Excel的工作表sheet,下标从0开始。
int
trLength
=
sheet
.
getLastRowNum
();
//获取Excel的行数
for
(
int
i
=
0
;
i
<
trLength
;
i
++)
{
Row
row
=
sheet
.
getRow
(
i
);
//获取Excel的行,下标从0开始
if
(
row
==
null
)
{
//若行为空,则遍历下一行
continue
;
}
int
minColIx
=
row
.
getFirstCellNum
();
int
maxColIx
=
row
.
getLastCellNum
();
for
(
int
colIx
=
minColIx
;
colIx
<
maxColIx
;
colIx
++)
{
Cell
cell
=
row
.
getCell
(
colIx
);
//获取指定单元格,单元格从左到右下标从0开始
String
runText
=
cell
.
getStringCellValue
();
if
(
runText
.
equals
(
""
)){
continue
;
}
System
.
out
.
println
(
cell
);
Matcher
matcher
=
this
.
matcher
(
runText
);
if
(
matcher
.
find
())
{
while
((
matcher
=
this
.
matcher
(
runText
)).
find
())
{
runText
=
matcher
.
replaceFirst
(
String
.
valueOf
(
params
.
get
(
matcher
.
group
(
1
))));
}
cell
.
setCellValue
(
runText
);
}
}
}
OutputStream
out
=
new
FileOutputStream
(
new
File
(
outPath
));
wb
.
write
(
out
);
is
.
close
();
out
.
close
();
}
/**
* 正则匹配字符串
* @param str
* @return
*/
private
Matcher
matcher
(
String
str
)
{
Pattern
pattern
=
Pattern
.
compile
(
"\\{(.+?)\\}"
,
Pattern
.
CASE_INSENSITIVE
);
Matcher
matcher
=
pattern
.
matcher
(
str
);
return
matcher
;
}
}
src/main/java/com/patzn/cloud/service/lims/common/HSSFWorkbookUtil.java
View file @
5efd1e68
...
...
@@ -253,7 +253,7 @@ public class HSSFWorkbookUtil {
* @throws IOException
* @throws FileNotFoundException
*/
public
static
XSSFWorkbook
insertImage
(
XSSFWorkbook
wb
,
Map
<
String
,
File
>
imageFileMap
)
throws
FileNotFoundException
,
IOException
{
public
static
XSSFWorkbook
insertImage
(
XSSFWorkbook
wb
,
Map
<
String
,
File
>
imageFileMap
,
boolean
resize
)
throws
FileNotFoundException
,
IOException
{
XSSFSheet
sheet
=
wb
.
getSheetAt
(
0
);
...
...
@@ -282,6 +282,7 @@ public class HSSFWorkbookUtil {
Picture
pict
=
drawing
.
createPicture
(
anchor
,
nameIndex
.
get
(
qrcodeName
));
// 计算单元格的长宽
if
(
resize
){
// 指定我想要的长宽
double
standardWidth
=
600
;
double
standardHeight
=
830
;
...
...
@@ -298,6 +299,10 @@ public class HSSFWorkbookUtil {
double
a
=
standardWidth
/
cellWidth
;
double
b
=
standardHeight
/
cellHeight
;
pict
.
resize
(
a
,
b
);
}
else
{
pict
.
resize
();
}
}
}
}
...
...
@@ -305,6 +310,69 @@ public class HSSFWorkbookUtil {
}
return
wb
;
}
public
static
XSSFWorkbook
insertImageByIO
(
XSSFWorkbook
wb
,
Map
<
String
,
InputStream
>
imageFileMap
,
boolean
resize
)
throws
FileNotFoundException
,
IOException
{
XSSFSheet
sheet
=
wb
.
getSheetAt
(
0
);
//数据行数
int
n
=
sheet
.
getLastRowNum
();
Map
<
String
,
Integer
>
nameIndex
=
addPicture2WorkbookByIO
(
wb
,
imageFileMap
);
CreationHelper
helper
=
wb
.
getCreationHelper
();
Drawing
drawing
=
sheet
.
createDrawingPatriarch
();
ClientAnchor
anchor
=
helper
.
createClientAnchor
();
for
(
int
i
=
0
;
i
<
n
;
i
++)
{
XSSFRow
xssfRow
=
sheet
.
getRow
(
i
);
if
(
null
!=
xssfRow
){
int
column0
=
xssfRow
.
getFirstCellNum
();
int
column1
=
xssfRow
.
getLastCellNum
();
for
(
int
j
=
column0
;
j
<
column1
;
j
++)
{
XSSFCell
cell
=
xssfRow
.
getCell
(
j
);
if
(
null
!=
cell
){
String
qrcodeName
=
HSSFWorkbookUtil
.
getJavaValue
(
cell
).
toString
();
System
.
out
.
println
(
qrcodeName
);
if
(
nameIndex
.
containsKey
(
qrcodeName
))
{
anchor
.
setCol1
(
j
);
anchor
.
setRow1
(
i
);
System
.
out
.
println
(
"setCol1:"
+
j
);
System
.
out
.
println
(
"setRow1:"
+
i
);
Picture
pict
=
drawing
.
createPicture
(
anchor
,
nameIndex
.
get
(
qrcodeName
));
// 计算单元格的长宽
cell
.
setCellValue
(
""
);
if
(
resize
){
// 指定我想要的长宽
double
standardWidth
=
600
;
double
standardHeight
=
830
;
double
w
=
sheet
.
getColumnWidth
(
cell
.
getColumnIndex
());
double
h
=
cell
.
getRow
().
getHeight
();
double
cellWidth
=
sheet
.
getColumnWidthInPixels
(
cell
.
getColumnIndex
());
double
cellHeight
=
cell
.
getRow
().
getHeightInPoints
()/
72
*
96
;
// 计算需要的长宽比例的系数
double
a
=
standardWidth
/
cellWidth
;
double
b
=
standardHeight
/
cellHeight
;
pict
.
resize
(
a
,
b
);
}
else
{
pict
.
resize
();
}
}
}
}
}
}
return
wb
;
}
private
static
Map
<
String
,
Integer
>
addPicture2Workbook
(
XSSFWorkbook
wb
,
Map
<
String
,
File
>
qr
)
throws
FileNotFoundException
,
IOException
{
Map
<
String
,
Integer
>
indx
=
Maps
.
newHashMap
();
...
...
@@ -315,6 +383,16 @@ public class HSSFWorkbookUtil {
return
indx
;
}
private
static
Map
<
String
,
Integer
>
addPicture2WorkbookByIO
(
XSSFWorkbook
wb
,
Map
<
String
,
InputStream
>
qr
)
throws
FileNotFoundException
,
IOException
{
Map
<
String
,
Integer
>
indx
=
Maps
.
newHashMap
();
for
(
Map
.
Entry
<
String
,
InputStream
>
kv
:
qr
.
entrySet
())
{
indx
.
put
(
kv
.
getKey
(),
wb
.
addPicture
(
kv
.
getValue
(),
XSSFWorkbook
.
PICTURE_TYPE_PNG
));
}
System
.
out
.
println
(
"pictures : "
+
indx
.
size
());
return
indx
;
}
public
static
void
insertImageByRowColFile
(
XSSFWorkbook
wb
,
XSSFSheet
sheet
,
int
row
,
int
col
,
File
file
)
{
XSSFRow
xssfRow
=
sheet
.
getRow
(
row
);
if
(
null
!=
xssfRow
){
...
...
src/main/java/com/patzn/cloud/service/lims/soil/controller/SoilExpReportController.java
View file @
5efd1e68
...
...
@@ -76,6 +76,16 @@ public class SoilExpReportController extends ServiceController {
return
success
(
soilExpReportService
.
save
(
soilExpReport
));
}
@ApiOperation
(
"试验项目报告复核"
)
@PostMapping
(
"/exp_report_check"
)
public
RestResult
<
Boolean
>
expReportCheckSubmit
(
@RequestParam
(
"ids"
)
Long
[]
ids
)
{
return
success
(
soilExpReportService
.
expReportCheckSubmit
(
ids
,
getAccount
()));
}
@ApiOperation
(
"根据 ids 删除"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"主键列表"
,
required
=
true
,
paramType
=
"query"
,
allowMultiple
=
true
,
dataTypeClass
=
Long
.
class
),
...
...
src/main/java/com/patzn/cloud/service/lims/soil/service/ISoilEntrustService.java
View file @
5efd1e68
...
...
@@ -80,7 +80,7 @@ public interface ISoilEntrustService extends IBaseService<SoilEntrust> {
Page
<
SoilEntrustVO
>
pageVOTake
(
Page
<
SoilEntrustVO
>
page
,
SoilEntrustVO
soilEntrust
);
void
changeStatus
(
SoilEntrustStatusEnum
receive
,
SoilEntrustStatusEnum
send
,
List
<
Long
>
entrustIds
,
Account
account
,
String
样品接收完成
);
void
changeStatus
(
SoilEntrustStatusEnum
receive
,
SoilEntrustStatusEnum
send
,
List
<
Long
>
entrustIds
,
Account
account
,
Integer
type
,
String
remark
);
boolean
editImportEntrust
(
Long
id
,
MultipartFile
file
,
Account
account
);
...
...
src/main/java/com/patzn/cloud/service/lims/soil/service/ISoilExpReportService.java
View file @
5efd1e68
...
...
@@ -26,4 +26,6 @@ public interface ISoilExpReportService extends IBaseService<SoilExpReport> {
SoilExpReport
uploadExpReportGenerate
(
Long
[]
ids
,
SoilExpReportTemplate
template
,
SoilEntrust
entrust
,
String
expName
,
Account
account
,
String
report
,
File
file
);
SoilReport
generateReport
(
Long
entrustId
,
Long
templateId
,
Long
[]
expReportIds
);
boolean
expReportCheckSubmit
(
Long
[]
ids
,
Account
account
);
}
src/main/java/com/patzn/cloud/service/lims/soil/service/impl/SoilEntrustRecordServiceImpl.java
View file @
5efd1e68
...
...
@@ -49,7 +49,7 @@ public class SoilEntrustRecordServiceImpl extends BaseServiceImpl<SoilEntrustRec
if
(
ArrayUtils
.
isEmpty
(
ids
)){
return
;
}
record
(
from
,
to
,
Arrays
.
asList
(
ids
),
1
,
account
,
remark
);
record
(
from
,
to
,
Arrays
.
asList
(
ids
),
type
,
account
,
remark
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
src/main/java/com/patzn/cloud/service/lims/soil/service/impl/SoilEntrustServiceImpl.java
View file @
5efd1e68
...
...
@@ -620,7 +620,7 @@ public class SoilEntrustServiceImpl extends BaseServiceImpl<SoilEntrustMapper, S
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
changeStatus
(
SoilEntrustStatusEnum
from
,
SoilEntrustStatusEnum
to
,
List
<
Long
>
entrustIds
,
Account
account
,
String
remark
)
{
public
void
changeStatus
(
SoilEntrustStatusEnum
from
,
SoilEntrustStatusEnum
to
,
List
<
Long
>
entrustIds
,
Account
account
,
Integer
type
,
String
remark
)
{
if
(
CollectionUtils
.
isEmpty
(
entrustIds
)){
return
;
}
...
...
@@ -628,7 +628,7 @@ public class SoilEntrustServiceImpl extends BaseServiceImpl<SoilEntrustMapper, S
entrust
.
setStatus
(
to
);
entrust
.
setProgress
(
to
);
if
(
super
.
update
(
entrust
,
Condition
.
create
().
in
(
"id"
,
entrustIds
))){
soilEntrustRecordService
.
record
(
from
,
to
,
entrustIds
,
1
,
account
,
remark
);
soilEntrustRecordService
.
record
(
from
,
to
,
entrustIds
,
type
,
account
,
remark
);
}
}
...
...
src/main/java/com/patzn/cloud/service/lims/soil/service/impl/SoilExpReportServiceImpl.java
View file @
5efd1e68
...
...
@@ -8,8 +8,10 @@ import com.patzn.cloud.commons.api.RestAssert;
import
com.patzn.cloud.commons.controller.Account
;
import
com.patzn.cloud.commons.controller.LoginHelper
;
import
com.patzn.cloud.commons.toolkit.FileUtils
;
import
com.patzn.cloud.feign.base.client.SysUserClient
;
import
com.patzn.cloud.oss.starter.OssClient
;
import
com.patzn.cloud.oss.starter.OssFileResult
;
import
com.patzn.cloud.service.base.entity.SysFileSignature
;
import
com.patzn.cloud.service.lims.common.AsposeUtil
;
import
com.patzn.cloud.service.lims.common.HSSFWorkbookUtil
;
import
com.patzn.cloud.service.lims.common.StringHandleUtils
;
...
...
@@ -50,6 +52,10 @@ public class SoilExpReportServiceImpl extends BaseServiceImpl<SoilExpReportMappe
@Autowired
private
OssClient
ossClient
;
@Autowired
private
SysUserClient
sysUserClient
;
@Autowired
private
ISoilEntrustService
soilEntrustService
;
...
...
@@ -388,6 +394,60 @@ public class SoilExpReportServiceImpl extends BaseServiceImpl<SoilExpReportMappe
return
null
;
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
expReportCheckSubmit
(
Long
[]
ids
,
Account
account
)
{
RestAssert
.
fail
(
ArrayUtils
.
isEmpty
(
ids
),
"请选择要复核通过的试验报告"
);
SysFileSignature
signature
=
sysUserClient
.
signature
(
account
.
getUserId
()).
serviceData
();
if
(
null
==
signature
){
return
true
;
}
List
<
SoilExpReport
>
reportList
=
list
(
Condition
.
create
().
in
(
"id"
,
ids
));
try
{
List
<
File
>
deletedList
=
new
ArrayList
<>();
List
<
SoilExpReport
>
updateReportList
=
new
ArrayList
<>();
for
(
SoilExpReport
soilExpReport:
reportList
)
{
XSSFWorkbook
xssfWorkbook
=
HSSFWorkbookUtil
.
getWorkbookByIO
(
ossClient
.
download
(
soilExpReport
.
getObjectKey
()));
Map
<
String
,
InputStream
>
inputStreamMap
=
new
HashMap
<>();
inputStreamMap
.
put
(
"#{checker}}"
,
ossClient
.
download
(
signature
.
getObjectKey
()));
HSSFWorkbookUtil
.
insertImageByIO
(
xssfWorkbook
,
inputStreamMap
,
false
);
FileOutputStream
os
=
null
;
File
file
=
null
;
String
generated
=
"试验项目报告"
+
soilExpReport
.
getId
();
file
=
File
.
createTempFile
(
generated
,
".xlsx"
);
os
=
new
FileOutputStream
(
file
);
xssfWorkbook
.
write
(
os
);
os
.
flush
();
OssFileResult
ossFileResult
=
ossClient
.
upload
(
file
);
deletedList
.
add
(
file
);
os
.
close
();
xssfWorkbook
.
close
();
SoilExpReport
expReport
=
new
SoilExpReport
();
expReport
.
setId
(
soilExpReport
.
getId
());
expReport
.
setObjectKey
(
ossFileResult
.
getObjectKey
());
expReport
.
setBucketName
(
ossFileResult
.
getBucketName
());
expReport
.
setVersionId
(
ossFileResult
.
getVersionId
());
expReport
.
setStatus
(
1
);
expReport
.
setProgress
(
1
);
updateReportList
.
add
(
expReport
);
}
if
(
CollectionUtils
.
isNotEmpty
(
updateReportList
)){
super
.
updateBatchById
(
updateReportList
);
}
}
catch
(
Exception
e
){
logger
.
error
(
"复核试验报告插入电子签名失败"
+
e
.
getMessage
());
}
return
true
;
}
public
InputStream
exportToExcelInputStream
(
XSSFWorkbook
workbook
)
{
...
...
src/main/java/com/patzn/cloud/service/lims/soil/service/impl/SoilExperimentServiceImpl.java
View file @
5efd1e68
...
...
@@ -21,6 +21,7 @@ import com.patzn.cloud.feign.lims.base.client.LmsUserGroupClient;
import
com.patzn.cloud.feign.lims.base.client.LmsUserRelGroupClient
;
import
com.patzn.cloud.oss.starter.OssClient
;
import
com.patzn.cloud.oss.starter.OssFileResult
;
import
com.patzn.cloud.service.base.entity.SysFileSignature
;
import
com.patzn.cloud.service.base.entity.SysUser
;
import
com.patzn.cloud.service.lims.base.entity.LmsUserRelGroup
;
import
com.patzn.cloud.service.lims.base.vo.LmsUserRelGroupVO
;
...
...
@@ -114,6 +115,8 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
@Autowired
private
OssClient
ossClient
;
@Autowired
private
SysUserClient
sysUserClient
;
@Autowired
private
ISoilAppendixService
soilAppendixService
;
...
...
@@ -143,8 +146,6 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
private
LmsUserRelGroupClient
lmsUserRelGroupClient
;
@Autowired
private
SysUserClient
sysUserClient
;
@Autowired
private
SysOrgClient
sysOrgClient
;
...
...
@@ -689,6 +690,11 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
mapReplace
.
put
(
"#{client}"
,
entrust
.
getClient
());
mapReplace
.
put
(
"#{boreholeName}"
,
entrust
.
getBoreholeName
());
mapReplace
.
put
(
"#{projectNo}"
,
entrust
.
getProjectNo
());
SysFileSignature
signature
=
sysUserClient
.
signature
(
account
.
getUserId
()).
serviceData
();
if
(
null
==
template
.
getMoreSheet
()
||
0
==
template
.
getMoreSheet
()){
HSSFWorkbookUtil
.
replaceModel
(
mapReplace
,
xssfWorkbook
,
0
);
sheetOne
.
setForceFormulaRecalculation
(
true
);
...
...
@@ -797,7 +803,15 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
}
if
(
null
!=
signature
){
Map
<
String
,
InputStream
>
mapSignature
=
new
HashMap
<>();
mapSignature
.
put
(
"#{mainTest}"
,
ossClient
.
download
(
signature
.
getObjectKey
()));
try
{
HSSFWorkbookUtil
.
insertImageByIO
(
xssfWorkbook
,
mapSignature
,
false
);
}
catch
(
Exception
e
){
logger
.
error
(
"试验项目报告插入电子签名失败"
+
e
.
getMessage
());
}
}
FileOutputStream
os
=
null
;
File
file
=
null
;
String
generated
=
"试验项目报告"
;
...
...
@@ -1254,7 +1268,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
"APPENDIX "
+
count
+
" "
+
testEnglish
);
try
{
HSSFWorkbookUtil
.
replaceModel
(
replaceMap
,
xssfWorkbook
);
HSSFWorkbookUtil
.
insertImage
(
xssfWorkbook
,
fileMap
);
HSSFWorkbookUtil
.
insertImage
(
xssfWorkbook
,
fileMap
,
true
);
}
catch
(
Exception
e
){
logger
.
error
(
"generateExcelReport错误"
+
e
.
getMessage
());
}
...
...
src/main/java/com/patzn/cloud/service/lims/soil/service/impl/SoilSampleServiceImpl.java
View file @
5efd1e68
...
...
@@ -449,7 +449,7 @@ public class SoilSampleServiceImpl extends BaseServiceImpl<SoilSampleMapper, Soi
List
<
SoilSample
>
checkList
=
super
.
list
(
Condition
.
create
().
setSqlSelect
(
"entrust_id"
).
in
(
"entrust_id"
,
entrustIds
).
eq
(
"status"
,
SoilSampleStatusEnum
.
RECEIVE
));
if
(
CollectionUtils
.
isEmpty
(
checkList
)){
soilEntrustService
.
changeStatus
(
SoilEntrustStatusEnum
.
RECEIVE
,
SoilEntrustStatusEnum
.
SEND
,
entrustIds
,
account
,
"样品接收完成"
);
soilEntrustService
.
changeStatus
(
SoilEntrustStatusEnum
.
RECEIVE
,
SoilEntrustStatusEnum
.
SEND
,
entrustIds
,
account
,
0
,
"样品接收完成"
);
}
else
{
List
<
Long
>
noReceiveOkList
=
checkList
.
stream
().
map
(
s
->{
return
s
.
getEntrustId
();
...
...
@@ -461,7 +461,7 @@ public class SoilSampleServiceImpl extends BaseServiceImpl<SoilSampleMapper, Soi
}
if
(
CollectionUtils
.
isNotEmpty
(
entrustIds
)){
soilEntrustService
.
changeStatus
(
SoilEntrustStatusEnum
.
RECEIVE
,
SoilEntrustStatusEnum
.
SEND
,
entrustIds
,
account
,
"样品接收完成"
);
soilEntrustService
.
changeStatus
(
SoilEntrustStatusEnum
.
RECEIVE
,
SoilEntrustStatusEnum
.
SEND
,
entrustIds
,
account
,
0
,
"样品接收完成"
);
}
}
return
true
;
...
...
@@ -495,7 +495,7 @@ public class SoilSampleServiceImpl extends BaseServiceImpl<SoilSampleMapper, Soi
}).
collect
(
Collectors
.
toList
());
List
<
SoilSample
>
checkList
=
super
.
list
(
Condition
.
create
().
setSqlSelect
(
"entrust_id"
).
in
(
"entrust_id"
,
entrustIds
).
eq
(
"status"
,
SoilSampleStatusEnum
.
SEND
));
if
(
CollectionUtils
.
isEmpty
(
checkList
)){
soilEntrustService
.
changeStatus
(
SoilEntrustStatusEnum
.
SEND
,
SoilEntrustStatusEnum
.
TEST
,
entrustIds
,
account
,
"样品发放完成"
);
soilEntrustService
.
changeStatus
(
SoilEntrustStatusEnum
.
SEND
,
SoilEntrustStatusEnum
.
TEST
,
entrustIds
,
account
,
0
,
"样品发放完成"
);
}
else
{
List
<
Long
>
noReceiveOkList
=
checkList
.
stream
().
map
(
s
->{
return
s
.
getEntrustId
();
...
...
@@ -506,7 +506,7 @@ public class SoilSampleServiceImpl extends BaseServiceImpl<SoilSampleMapper, Soi
}
}
if
(
CollectionUtils
.
isNotEmpty
(
entrustIds
)){
soilEntrustService
.
changeStatus
(
SoilEntrustStatusEnum
.
SEND
,
SoilEntrustStatusEnum
.
TEST
,
entrustIds
,
account
,
"样品发放完成"
);
soilEntrustService
.
changeStatus
(
SoilEntrustStatusEnum
.
SEND
,
SoilEntrustStatusEnum
.
TEST
,
entrustIds
,
account
,
0
,
"样品发放完成"
);
}
}
...
...
@@ -817,7 +817,7 @@ public class SoilSampleServiceImpl extends BaseServiceImpl<SoilSampleMapper, Soi
List
<
SoilSample
>
checkList
=
super
.
list
(
Condition
.
create
().
setSqlSelect
(
"entrust_id"
).
in
(
"entrust_id"
,
entrustIds
).
eq
(
"status"
,
SoilSampleStatusEnum
.
RECEIVE
));
if
(
CollectionUtils
.
isEmpty
(
checkList
)){
soilEntrustService
.
changeStatus
(
SoilEntrustStatusEnum
.
RECEIVE
,
SoilEntrustStatusEnum
.
SEND
,
entrustIds
,
account
,
"样品接收完成"
);
soilEntrustService
.
changeStatus
(
SoilEntrustStatusEnum
.
RECEIVE
,
SoilEntrustStatusEnum
.
SEND
,
entrustIds
,
account
,
0
,
"样品接收完成"
);
}
else
{
List
<
Long
>
noReceiveOkList
=
checkList
.
stream
().
map
(
s
->{
return
s
.
getEntrustId
();
...
...
@@ -829,7 +829,7 @@ public class SoilSampleServiceImpl extends BaseServiceImpl<SoilSampleMapper, Soi
}
if
(
CollectionUtils
.
isNotEmpty
(
entrustIds
)){
soilEntrustService
.
changeStatus
(
SoilEntrustStatusEnum
.
RECEIVE
,
SoilEntrustStatusEnum
.
SEND
,
entrustIds
,
account
,
"样品接收完成"
);
soilEntrustService
.
changeStatus
(
SoilEntrustStatusEnum
.
RECEIVE
,
SoilEntrustStatusEnum
.
SEND
,
entrustIds
,
account
,
0
,
"样品接收完成"
);
}
}
return
sendSample
(
ids
,
account
);
...
...
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