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
3933280e
Commit
3933280e
authored
Jan 04, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
验劵方法修改
parent
ccf6f6ad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
25 deletions
+28
-25
QPServiceImpl.java
...rc/main/java/share/system/service/impl/QPServiceImpl.java
+28
-25
No files found.
share-system/src/main/java/share/system/service/impl/QPServiceImpl.java
View file @
3933280e
...
...
@@ -59,6 +59,20 @@ public class QPServiceImpl implements QPService {
@Autowired
private
RedisUtil
redisUtil
;
//默认门槛时长
private
static
final
String
DEFAULT_MIN_DURATION
=
"0"
;
//默认时长
private
static
final
String
DEFAULT_DURATION
=
"0"
;
//默认折扣最大时长
private
static
final
String
DEFAULT_MAX_DURATION
=
"999"
;
//默认优惠开始(有效)时段
private
static
final
String
DEFAULT_START_TIME
=
"00:00"
;
//默认优惠结束(有效)时段
private
static
final
String
DEFAULT_END_TIME
=
"24:00"
;
//默认门槛金额
private
static
final
BigDecimal
DEFAULT_MIN_PRICE
=
BigDecimal
.
valueOf
(
0.00
);
/**
* 用户验卷接口
*/
...
...
@@ -88,23 +102,26 @@ public class QPServiceImpl implements QPService {
//根据优惠卷名称查询优惠劵配置
SCoupon
sCoupon
=
isCouponService
.
selectSCouponByName
(
prepare
.
getDeal_title
());
TuangouReceiptPrepareResponseEntityVo
response
=
new
TuangouReceiptPrepareResponseEntityVo
();
if
(
ObjectUtils
.
isEmpty
(
sCoupon
))
{
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
sConsumerCoupon
.
setConsumerId
(
user
.
getId
());
sConsumerCoupon
.
setDealId
(
prepare
.
getDeal_id
());
sConsumerCoupon
.
setCouponCode
(
code
);
sConsumerCoupon
.
setName
(
prepare
.
getDeal_title
());
sConsumerCoupon
.
setSourceType
(
SourceTypeEnum
.
CHECK
.
getCode
());
sConsumerCoupon
.
setPlatformType
(
PlatformTypeEnum
.
MEITUAN
.
getCode
());
sConsumerCoupon
.
setUseStatus
(
UserStatusEnum
.
UNUSED
.
getCode
());
sConsumerCoupon
.
setCreateBy
(
String
.
valueOf
(
user
.
getId
()));
sConsumerCoupon
.
setCreateTime
(
new
Date
());
if
(
ObjectUtils
.
isEmpty
(
sCoupon
))
{
sConsumerCoupon
.
setCouponType
(
CouponTypeEnum
.
CASH
.
getCode
());
sConsumerCoupon
.
setStoreType
(
StoreType
.
getCodeList
());
sConsumerCoupon
.
setRoomType
(
RoomType
.
getCodeList
());
sConsumerCoupon
.
setCreateBy
(
String
.
valueOf
(
user
.
getId
()));
sConsumerCoupon
.
setMinDuration
(
"0"
);
sConsumerCoupon
.
setMaxDuration
(
"999"
);
sConsumerCoupon
.
setDuration
(
"0"
);
sConsumerCoupon
.
setMinPrice
(
BigDecimal
.
valueOf
(
0.00
)
);
sConsumerCoupon
.
setMinDuration
(
DEFAULT_MIN_DURATION
);
sConsumerCoupon
.
setMaxDuration
(
DEFAULT_MAX_DURATION
);
sConsumerCoupon
.
setDuration
(
DEFAULT_DURATION
);
sConsumerCoupon
.
setMinPrice
(
DEFAULT_MIN_PRICE
);
sConsumerCoupon
.
setSubPrice
(
BigDecimal
.
valueOf
(
prepare
.
getDeal_marketprice
()));
sConsumerCoupon
.
setSourceType
(
SourceTypeEnum
.
CHECK
.
getCode
());
sConsumerCoupon
.
setPlatformType
(
PlatformTypeEnum
.
MEITUAN
.
getCode
());
//根据门店id查询门店信息
List
<
TuangouDealQueryShopDealResponseEntity
>
queryshopdeal
=
queryshopdeal
(
openShopUuid
);
queryshopdeal
.
stream
().
forEach
(
o
->
{
...
...
@@ -122,20 +139,10 @@ public class QPServiceImpl implements QPService {
}
});
sConsumerCoupon
.
setCouponTimeStart
(
"00:00"
);
sConsumerCoupon
.
setCouponTimeEnd
(
"24:00"
);
sConsumerCoupon
.
setUseStatus
(
UserStatusEnum
.
UNUSED
.
getCode
());
sConsumerCoupon
.
setCreateBy
(
String
.
valueOf
(
user
.
getId
()));
sConsumerCoupon
.
setCreateTime
(
new
Date
());
isConsumerCouponService
.
insertSConsumerCoupon
(
sConsumerCoupon
);
response
.
setConsumerCouponId
(
sConsumerCoupon
.
getId
());
sConsumerCoupon
.
setCouponTimeStart
(
DEFAULT_START_TIME
);
sConsumerCoupon
.
setCouponTimeEnd
(
DEFAULT_END_TIME
);
}
else
{
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
sConsumerCoupon
.
setConsumerId
(
user
.
getId
());
sConsumerCoupon
.
setDealId
(
prepare
.
getDeal_id
());
sConsumerCoupon
.
setCouponId
(
sCoupon
.
getId
());
sConsumerCoupon
.
setCouponCode
(
code
);
sConsumerCoupon
.
setName
(
prepare
.
getDeal_title
());
sConsumerCoupon
.
setCouponType
(
sCoupon
.
getCouponType
());
sConsumerCoupon
.
setStoreType
(
sCoupon
.
getStoreType
());
sConsumerCoupon
.
setRoomType
(
sCoupon
.
getRoomType
());
...
...
@@ -144,18 +151,14 @@ public class QPServiceImpl implements QPService {
sConsumerCoupon
.
setDuration
(
sCoupon
.
getDuration
());
sConsumerCoupon
.
setMinPrice
(
sCoupon
.
getMinPrice
());
sConsumerCoupon
.
setSubPrice
(
sCoupon
.
getSubPrice
());
sConsumerCoupon
.
setSourceType
(
SourceTypeEnum
.
CHECK
.
getCode
());
sConsumerCoupon
.
setPlatformType
(
PlatformTypeEnum
.
MEITUAN
.
getCode
());
sConsumerCoupon
.
setStartDate
(
sCoupon
.
getStartDate
());
sConsumerCoupon
.
setEndDate
(
prepare
.
getReceiptEndDate
());
sConsumerCoupon
.
setCouponTimeStart
(
sCoupon
.
getValidStartTime
());
sConsumerCoupon
.
setCouponTimeEnd
(
sCoupon
.
getValidEndTime
());
sConsumerCoupon
.
setUseStatus
(
UserStatusEnum
.
UNUSED
.
getCode
());
sConsumerCoupon
.
setCreateBy
(
String
.
valueOf
(
user
.
getId
()));
sConsumerCoupon
.
setCreateTime
(
new
Date
());
}
isConsumerCouponService
.
insertSConsumerCoupon
(
sConsumerCoupon
);
response
.
setConsumerCouponId
(
sConsumerCoupon
.
getId
());
}
//设置过期时间30分钟
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"receipt_code"
,
prepare
.
getReceipt_code
());
...
...
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