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
7b39e7a3
Commit
7b39e7a3
authored
Jan 10, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
验卷增加判断,区别是团购劵还是时长劵
parent
ea4d021b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
20 deletions
+33
-20
QPServiceImpl.java
...rc/main/java/share/system/service/impl/QPServiceImpl.java
+2
-2
SCleanRecordsServiceImpl.java
...a/share/system/service/impl/SCleanRecordsServiceImpl.java
+5
-5
SConsumerCouponServiceImpl.java
...share/system/service/impl/SConsumerCouponServiceImpl.java
+5
-1
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+21
-12
No files found.
share-system/src/main/java/share/system/service/impl/QPServiceImpl.java
View file @
7b39e7a3
...
...
@@ -133,11 +133,11 @@ public class QPServiceImpl implements QPService {
}
});
List
<
SCoupon
>
sCoupons
=
isCouponService
.
selectSCouponByName
(
prepare
.
getDeal_title
());
SCoupon
sCoupon
=
n
ew
SCoupon
()
;
SCoupon
sCoupon
=
n
ull
;
if
(!
CollectionUtils
.
isEmpty
(
sCoupons
))
{
sCoupon
=
isCouponService
.
selectSCouponByName
(
prepare
.
getDeal_title
()).
get
(
0
);
}
if
(
!
ObjectUtils
.
isEmpty
(
sCoupon
))
{
if
(
ObjectUtils
.
isEmpty
(
sCoupon
))
{
sConsumerCoupon
.
setCouponType
(
CouponTypeEnum
.
CASH
.
getCode
());
sConsumerCoupon
.
setStoreType
(
StoreType
.
getCodeList
());
sConsumerCoupon
.
setRoomType
(
RoomType
.
getCodeList
());
...
...
share-system/src/main/java/share/system/service/impl/SCleanRecordsServiceImpl.java
View file @
7b39e7a3
...
...
@@ -151,11 +151,11 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
sCleanRecords
.
setStatus
(
0
);
sCleanRecords
.
setCreateTime
(
DateUtils
.
getNowDate
());
boolean
b
=
0
<
baseMapper
.
insertSCleanRecords
(
sCleanRecords
);
if
(
b
)
{
SStore
store
=
sStoreMapper
.
selectSStoreById
(
storeId
);
SRoom
room
=
sRoomMapper
.
selectSRoomById
(
roomId
);
sendSms
(
storeId
,
store
,
room
);
}
//
if (b) {
//
SStore store = sStoreMapper.selectSStoreById(storeId);
//
SRoom room = sRoomMapper.selectSRoomById(roomId);
//
sendSms(storeId, store, room);
//
}
return
b
;
}
...
...
share-system/src/main/java/share/system/service/impl/SConsumerCouponServiceImpl.java
View file @
7b39e7a3
...
...
@@ -120,7 +120,7 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
List
<
SCoupon
>
sCoupons
=
sCouponService
.
selectSCouponByIds
(
couponIds
);
sCoupons
.
stream
().
forEach
(
item
->
{
//判断ids里的优惠券id是否等于sCoupons里的优惠券id
if
(
Arrays
.
asList
(
couponIds
).
contains
(
item
.
getId
()))
{
if
(
Arrays
.
asList
(
couponIds
).
contains
(
item
.
getId
())
&&
item
.
getCouponType
().
equals
(
CouponTypeEnum
.
DURATION
.
getCode
())
)
{
//优惠券数量加一
item
.
setNumber
(
item
.
getNumber
()
+
1
);
sCouponService
.
updateSCoupon
(
item
);
...
...
@@ -215,6 +215,9 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
if
(
sCoupon
.
getNumber
().
equals
(
ZERO
))
{
throw
new
RuntimeException
(
"优惠券数量为0"
);
}
if
(!
sCoupon
.
getCouponType
().
equals
(
CouponTypeEnum
.
DURATION
.
getCode
()))
{
throw
new
RuntimeException
(
"只能赠送时长劵"
);
}
//创建优惠卷领取记录
SConsumerCoupon
newSConsumerCoupon
=
new
SConsumerCoupon
();
newSConsumerCoupon
.
setCouponId
(
sCoupon
.
getId
());
...
...
@@ -236,6 +239,7 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
newSConsumerCoupon
.
setPlatformType
(
String
.
valueOf
(
sCoupon
.
getPlatformType
()));
newSConsumerCoupon
.
setStartDate
(
sCoupon
.
getStartDate
());
newSConsumerCoupon
.
setEndDate
(
sCoupon
.
getEndDate
());
newSConsumerCoupon
.
setRemark
(
sCoupon
.
getRemark
());
int
insert
=
sConsumerCouponMapper
.
insert
(
newSConsumerCoupon
);
if
(
insert
>
0
)
{
//优惠券数量减一
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
7b39e7a3
...
...
@@ -327,8 +327,14 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if
(
response
.
getStatus
().
equals
(
YesNoEnum
.
yes
.
getFlag
()))
{
if
(
Objects
.
nonNull
(
request
.
getCouponId
())
&&
request
.
getCouponId
()
!=
0
)
{
SConsumerCoupon
byId
=
consumerCouponService
.
getById
(
request
.
getCouponId
());
//验劵
qpService
.
consume
(
byId
.
getCouponCode
(),
1
,
sStore
.
getOpenShopUuid
(),
ConsumerCouponStatusEnum
.
ORDER
.
getCode
());
if
(
StringUtils
.
isNotEmpty
(
byId
.
getCouponCode
()))
{
if
(
byId
.
getUseStatus
().
equals
(
UserStatusEnum
.
UNUSED
.
getCode
()))
{
//验劵
qpService
.
consume
(
byId
.
getCouponCode
(),
1
,
sStore
.
getOpenShopUuid
(),
ConsumerCouponStatusEnum
.
ORDER
.
getCode
());
}
else
{
throw
new
BaseException
(
"优惠券已使用!"
);
}
}
SConsumerCoupon
consumerCoupon
=
new
SConsumerCoupon
();
consumerCoupon
.
setId
(
request
.
getCouponId
());
consumerCoupon
.
setUseStatus
(
UserStatusEnum
.
USED
.
getCode
());
...
...
@@ -361,11 +367,11 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
cn
.
hutool
.
core
.
date
.
DateUtil
.
format
(
new
Date
(),
DatePattern
.
NORM_DATETIME_PATTERN
),
cn
.
hutool
.
core
.
date
.
DateUtil
.
format
(
cn
.
hutool
.
core
.
date
.
DateUtil
.
offsetMinute
(
new
Date
(),
1
),
DatePattern
.
NORM_DATETIME_PATTERN
),
"1"
);
SRoom
sRoom
=
roomService
.
getById
(
sOrder
.
getRoomId
());
//通知保洁人员
sConsumerService
.
selectListByStoreId
(
sOrder
.
getStoreId
()).
stream
().
forEach
(
item
->
{
// 循环发送短信提示门店保洁打扫卫生
smsService
.
sendSmsCleanRecordsStopRemind
(
item
.
getPhone
(),
sStore
,
sRoom
);
});
//
//通知保洁人员
//
sConsumerService.selectListByStoreId(sOrder.getStoreId()).stream().forEach(item -> {
//
// 循环发送短信提示门店保洁打扫卫生
//
smsService.sendSmsCleanRecordsStopRemind(item.getPhone(), sStore, sRoom);
//
});
}
}
Map
<
String
,
String
>
map
=
new
HashMap
<>();
...
...
@@ -723,7 +729,10 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
SConsumerCoupon
consumerCoupon
=
consumerCouponService
.
getById
(
couponId
);
if
(
ObjectUtil
.
isNotEmpty
(
consumerCoupon
))
{
if
(
consumerCoupon
.
getUseStatus
().
equals
(
UserStatusEnum
.
UNUSED
.
getCode
()))
{
qpService
.
consume
(
consumerCoupon
.
getCouponCode
(),
1
,
sStore
.
getOpenShopUuid
(),
ConsumerCouponStatusEnum
.
WECHAT
.
getCode
());
if
(
StringUtils
.
isNotEmpty
(
consumerCoupon
.
getCouponCode
()))
{
//验劵
qpService
.
consume
(
consumerCoupon
.
getCouponCode
(),
1
,
sStore
.
getOpenShopUuid
(),
ConsumerCouponStatusEnum
.
WECHAT
.
getCode
());
}
consumerCoupon
.
setUseStatus
(
UserStatusEnum
.
USED
.
getCode
());
consumerCouponService
.
updateById
(
consumerCoupon
);
}
...
...
@@ -736,10 +745,10 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
cn
.
hutool
.
core
.
date
.
DateUtil
.
format
(
cn
.
hutool
.
core
.
date
.
DateUtil
.
offsetMinute
(
new
Date
(),
1
),
DatePattern
.
NORM_DATETIME_PATTERN
),
"1"
);
SRoom
sRoom
=
roomService
.
getById
(
sOrder
.
getRoomId
());
//通知保洁人员
sConsumerService
.
selectListByStoreId
(
sOrder
.
getStoreId
()).
stream
().
forEach
(
item
->
{
// 循环发送短信提示门店保洁打扫卫生
smsService
.
sendSmsCleanRecordsStopRemind
(
item
.
getPhone
(),
sStore
,
sRoom
);
});
//
sConsumerService.selectListByStoreId(sOrder.getStoreId()).stream().forEach(item -> {
//
// 循环发送短信提示门店保洁打扫卫生
//
smsService.sendSmsCleanRecordsStopRemind(item.getPhone(), sStore, sRoom);
//
});
}
SConsumptionRecords
sConsumptionRecords
=
new
SConsumptionRecords
();
sConsumptionRecords
.
setConsumerId
(
sOrder
.
getConsumerId
());
...
...
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