Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
data-acquisition
Project
Project
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
竹天卫
data-acquisition
Commits
28ae1e11
Commit
28ae1e11
authored
Apr 26, 2021
by
renchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
送验单模块代码编写
parent
d4cffa84
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
TSampleListServiceImpl.java
...isition/business/service/impl/TSampleListServiceImpl.java
+19
-2
No files found.
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/service/impl/TSampleListServiceImpl.java
View file @
28ae1e11
...
...
@@ -76,6 +76,11 @@ public class TSampleListServiceImpl extends ServiceImpl<TSampleListMapper, TSamp
//参数校验
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getYh
());
//判断数据是否存在
TSampleList
temp
=
baseMapper
.
selectById
(
query
.
getYh
());
if
(
temp
==
null
)
{
return
R
.
failed
(
"数据不存在,样号:"
+
query
.
getYh
());
}
//条件封装
TSampleList
tSampleList
=
new
TSampleList
();
BeanUtils
.
copyProperties
(
query
,
tSampleList
);
...
...
@@ -102,8 +107,8 @@ public class TSampleListServiceImpl extends ServiceImpl<TSampleListMapper, TSamp
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getYh
());
//判断数据是否已存在,如果存在不能添加
R
r
=
getByYh
(
query
);
if
(
r
.
getData
()
!=
null
)
{
TSampleList
temp
=
baseMapper
.
selectById
(
query
.
getYh
()
);
if
(
temp
!=
null
)
{
return
R
.
failed
(
"送验单样号已存在,样号:"
+
query
.
getYh
());
}
//继续判断参数
...
...
@@ -141,6 +146,10 @@ public class TSampleListServiceImpl extends ServiceImpl<TSampleListMapper, TSamp
//参数校验
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getYh
());
TSampleList
temp
=
baseMapper
.
selectById
(
query
.
getYh
());
if
(
temp
==
null
)
{
return
R
.
failed
(
"数据不存在,样号:"
+
query
.
getYh
());
}
//删除
int
delete
=
baseMapper
.
delete
(
new
QueryWrapper
<
TSampleList
>().
eq
(
ProjectEnum
.
TSampleListType
.
YH
.
getLabel
(),
query
.
getYh
()));
if
(
delete
>
0
)
{
...
...
@@ -158,6 +167,11 @@ public class TSampleListServiceImpl extends ServiceImpl<TSampleListMapper, TSamp
//参加校验
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getYh
());
//判断数据是否存在
TSampleList
temp
=
baseMapper
.
selectById
(
query
.
getYh
());
if
(
temp
==
null
)
{
return
R
.
failed
(
"数据不存在,样号:"
+
query
.
getYh
());
}
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getImageType
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
file
);
...
...
@@ -191,6 +205,9 @@ public class TSampleListServiceImpl extends ServiceImpl<TSampleListMapper, TSamp
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getYh
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getImageType
());
TSampleList
tSampleList
=
baseMapper
.
selectById
(
query
.
getYh
());
if
(
tSampleList
==
null
)
{
return
R
.
failed
(
"数据不存在,样号:"
+
query
.
getYh
());
}
//获取二维码或者记录形式
ImageUtil
.
getImage
(
query
.
getImageType
(),
tSampleList
,
response
);
//如果下载失败才会执行return
...
...
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