Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
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
pseer
gxpt_ht
Commits
97d8f520
Commit
97d8f520
authored
Nov 10, 2023
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新下单逻辑
parent
af9a3b54
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
9 deletions
+76
-9
saleStatusEnum.java
...mmon/src/main/java/share/common/enums/saleStatusEnum.java
+35
-0
SStore.java
share-system/src/main/java/share/system/domain/SStore.java
+12
-0
TuangouReceiptPrepareResponseEntityVo.java
...stem/domain/vo/TuangouReceiptPrepareResponseEntityVo.java
+1
-0
QPServiceImpl.java
...rc/main/java/share/system/service/impl/QPServiceImpl.java
+16
-7
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+12
-2
No files found.
share-common/src/main/java/share/common/enums/saleStatusEnum.java
0 → 100644
View file @
97d8f520
package
share
.
common
.
enums
;
public
enum
saleStatusEnum
{
//1-未开始售卖,2-售卖中,3-售卖结束
NOT_START
(
"1"
,
"未开始售卖"
),
SELLING
(
"2"
,
"售卖中"
),
END
(
"3"
,
"售卖结束"
),
;
private
String
code
;
private
String
name
;
saleStatusEnum
()
{
}
saleStatusEnum
(
String
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
share-system/src/main/java/share/system/domain/SStore.java
View file @
97d8f520
...
...
@@ -77,9 +77,21 @@ public class SStore extends BaseEntity
@Excel
(
name
=
"门店类型 1:标准店 2: 形象店 3:旗舰店"
)
private
String
storeType
;
@Excel
(
name
=
"美团点评店铺id"
)
private
String
openShopUuid
;
@TableField
(
exist
=
false
)
private
List
<
SRoom
>
roolList
;
public
String
getOpenShopUuid
()
{
return
openShopUuid
;
}
public
void
setOpenShopUuid
(
String
openShopUuid
)
{
this
.
openShopUuid
=
openShopUuid
;
}
public
List
<
SRoom
>
getRoolList
()
{
return
roolList
;
}
...
...
share-system/src/main/java/share/system/domain/vo/TuangouReceiptPrepareResponseEntityVo.java
View file @
97d8f520
...
...
@@ -6,4 +6,5 @@ import lombok.Data;
@Data
public
class
TuangouReceiptPrepareResponseEntityVo
extends
TuangouReceiptPrepareResponseEntity
{
private
String
expirationTime
;
private
Long
consumerCouponId
;
}
share-system/src/main/java/share/system/service/impl/QPServiceImpl.java
View file @
97d8f520
...
...
@@ -60,15 +60,12 @@ public class QPServiceImpl implements QPService {
if
(
sCoupon
==
null
)
{
throw
new
RuntimeException
(
"未找到对应的优惠券"
);
}
TuangouReceiptPrepareResponseEntityVo
response
=
new
TuangouReceiptPrepareResponseEntityVo
();
//查询领取记录表
LambdaQueryWrapper
<
SConsumerCoupon
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SConsumerCoupon:
:
getCouponId
,
prepare
.
getDeal_title
());
SConsumerCoupon
one
=
isConsumerCouponService
.
getOne
(
queryWrapper
);
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
List
<
TuangouDealQueryShopDealResponseEntity
>
queryshopdeal
=
queryshopdeal
(
openShopUuid
);
queryshopdeal
.
stream
().
forEach
(
o
->
{
});
if
(
ObjectUtils
.
isNotEmpty
(
one
))
{
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
sConsumerCoupon
.
setDealId
(
prepare
.
getDeal_id
());
...
...
@@ -78,10 +75,19 @@ public class QPServiceImpl implements QPService {
sConsumerCoupon
.
setRoomType
(
RoomType
.
getCodeList
());
sConsumerCoupon
.
setEndDate
(
prepare
.
getReceiptEndDate
());
sConsumerCoupon
.
setCreateBy
(
String
.
valueOf
(
user
.
getId
()));
//根据门店id查询门店信息
List
<
TuangouDealQueryShopDealResponseEntity
>
queryshopdeal
=
queryshopdeal
(
openShopUuid
);
queryshopdeal
.
stream
().
forEach
(
o
->
{
//套餐名称相同并且在售卖中
if
(
prepare
.
getDeal_title
().
equals
(
o
.
getTitle
())
&&
o
.
getSale_status
().
equals
(
saleStatusEnum
.
SELLING
.
getCode
()))
{
sConsumerCoupon
.
setCouponTimeStart
(
o
.
getReceipt_begin_date
());
sConsumerCoupon
.
setCouponTimeEnd
(
o
.
getReceipt_end_date
());
}
});
sConsumerCoupon
.
setCreateTime
(
new
Date
());
isConsumerCouponService
.
insertSConsumerCoupon
(
sConsumerCoupon
);
response
.
setConsumerCouponId
(
sConsumerCoupon
.
getId
());
}
else
{
}
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
sConsumerCoupon
.
setConsumerId
(
user
.
getId
());
sConsumerCoupon
.
setDealId
(
prepare
.
getDeal_id
());
...
...
@@ -103,10 +109,13 @@ public class QPServiceImpl implements QPService {
sConsumerCoupon
.
setCouponTimeStart
(
sCoupon
.
getValidStartTime
());
sConsumerCoupon
.
setCouponTimeEnd
(
sCoupon
.
getValidEndTime
());
sConsumerCoupon
.
setCreateBy
(
String
.
valueOf
(
user
.
getId
()));
sConsumerCoupon
.
setCreateTime
(
new
Date
());
isConsumerCouponService
.
insertSConsumerCoupon
(
sConsumerCoupon
);
response
.
setConsumerCouponId
(
sConsumerCoupon
.
getId
());
}
SimpleDateFormat
format2
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
output1
=
format2
.
format
(
prepare
.
getReceiptEndDate
());
TuangouReceiptPrepareResponseEntityVo
response
=
new
TuangouReceiptPrepareResponseEntityVo
();
BeanUtils
.
copyProperties
(
prepare
,
response
);
response
.
setExpirationTime
(
output1
);
return
response
;
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
97d8f520
...
...
@@ -81,6 +81,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
@Autowired
private
DeviceOpService
deviceOpService
;
@Autowired
private
QPService
qpService
;
/**
* 查询订单
...
...
@@ -176,8 +178,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
if
(
ObjectUtil
.
isNull
(
user
))
{
throw
new
BaseException
(
"您的登录已过期,请先登录"
);
}
SStore
sStore
=
storeService
.
getById
(
request
.
getStoreId
());
//验劵
TuangouReceiptPrepareResponseEntityVo
tuangouReceiptPrepareResponseEntityVo
=
qpService
.
consumeByUser
(
request
.
getCode
(),
sStore
.
getOpenShopUuid
());
SOrder
sOrder
=
generatSOrder
(
request
,
user
);
//校验订单金额
checkOrderPrice
(
sOrder
,
user
);
...
...
@@ -195,8 +198,15 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
// 加入自动未支付自动取消队列
redisUtil
.
lPush
(
Constants
.
ORDER_AUTO_CANCEL_KEY
,
sOrder
.
getOrderNo
());
}
if
(
response
.
getStatus
().
equals
(
YesNoEnum
.
yes
.
getFlag
()))
{
SConsumerCoupon
consumerCoupon
=
new
SConsumerCoupon
();
consumerCoupon
.
setId
(
tuangouReceiptPrepareResponseEntityVo
.
getConsumerCouponId
());
consumerCoupon
.
setUseStatus
(
UserStatusEnum
.
USED
.
getCode
());
consumerCouponService
.
updateById
(
consumerCoupon
);
}
else
{
consumerCouponService
.
deleteSConsumerCouponById
(
tuangouReceiptPrepareResponseEntityVo
.
getConsumerCouponId
());
}
save
(
sOrder
);
return
response
;
}
...
...
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