Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
163c6c25
Commit
163c6c25
authored
Aug 31, 2022
by
李灿灿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单唯一性校验
parent
93f0abb8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
OrderConstants.java
...fu/cloud/plus/v1/yifu/order/constants/OrderConstants.java
+8
-0
TOrderServiceImpl.java
...ud/plus/v1/yifu/order/service/impl/TOrderServiceImpl.java
+24
-0
No files found.
yifu-order/yifu-order-api/src/main/java/com/yifu/cloud/plus/v1/yifu/order/constants/OrderConstants.java
View file @
163c6c25
...
...
@@ -38,6 +38,14 @@ public class OrderConstants {
* 订单编号不能为空
*/
public
static
final
String
ORDER_NO_IS_EMPTY
=
"订单编号不能为空"
;
/**
* 订单不存在
*/
public
static
final
String
ORDER_NO_NOT_EXIST
=
"订单不存在"
;
/**
* 订单已存在
*/
public
static
final
String
ORDER_NO_IS_EXIST
=
"订单已存在"
;
/**
* 下单人不能为空
*/
...
...
yifu-order/yifu-order-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/order/service/impl/TOrderServiceImpl.java
View file @
163c6c25
...
...
@@ -191,6 +191,14 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
if
(
Common
.
isEmpty
(
orderNo
)){
return
R
.
failed
(
OrderConstants
.
ORDER_NO_IS_EMPTY
);
}
TOrder
one
=
this
.
getOne
(
Wrappers
.<
TOrder
>
query
().
lambda
()
.
eq
(
TOrder:
:
getOrderNo
,
orderNo
)
.
eq
(
TOrder:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
one
).
isPresent
()){
return
R
.
failed
(
OrderConstants
.
ORDER_NO_NOT_EXIST
);
}
if
(
Common
.
isEmpty
(
replyContent
)
&&
ArrayUtils
.
isEmpty
(
file
)){
return
R
.
failed
(
OrderConstants
.
REPLY_CONTENT_AND_ENCLOSURE_IS_EMPTY
);
}
...
...
@@ -299,6 +307,14 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
if
(
Common
.
isEmpty
(
vo
.
getOrderNo
())){
return
R
.
failed
(
OrderConstants
.
ORDER_NO_IS_EMPTY
);
}
TOrder
one
=
this
.
getOne
(
Wrappers
.<
TOrder
>
query
().
lambda
()
.
eq
(
TOrder:
:
getOrderNo
,
vo
.
getOrderNo
())
.
eq
(
TOrder:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(
Optional
.
ofNullable
(
one
).
isPresent
()){
return
R
.
failed
(
OrderConstants
.
ORDER_NO_IS_EXIST
);
}
if
(
Common
.
isEmpty
(
vo
.
getCreateName
())){
return
R
.
failed
(
OrderConstants
.
ORDER_NAME_IS_EMPTY
);
}
...
...
@@ -383,6 +399,14 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
if
(
Common
.
isEmpty
(
vo
.
getOrderNo
())){
return
R
.
failed
(
OrderConstants
.
ORDER_NO_IS_EMPTY
);
}
TOrder
one
=
this
.
getOne
(
Wrappers
.<
TOrder
>
query
().
lambda
()
.
eq
(
TOrder:
:
getOrderNo
,
vo
.
getOrderNo
())
.
eq
(
TOrder:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(!
Optional
.
ofNullable
(
one
).
isPresent
()){
return
R
.
failed
(
OrderConstants
.
ORDER_NO_NOT_EXIST
);
}
if
(
Common
.
isEmpty
(
vo
.
getCreateName
())){
return
R
.
failed
(
OrderConstants
.
REPLY_NAME_IS_EMPTY
);
}
...
...
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