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
c46efc2b
Commit
c46efc2b
authored
Jan 05, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优惠卷修改问题
parent
6c1ccafa
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
18 deletions
+28
-18
QPServiceImpl.java
...rc/main/java/share/system/service/impl/QPServiceImpl.java
+6
-6
SConsumerCouponServiceImpl.java
...share/system/service/impl/SConsumerCouponServiceImpl.java
+6
-2
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+15
-9
SConsumerCouponMapper.xml
...rc/main/resources/mapper/system/SConsumerCouponMapper.xml
+1
-1
No files found.
share-system/src/main/java/share/system/service/impl/QPServiceImpl.java
View file @
c46efc2b
...
@@ -87,16 +87,16 @@ public class QPServiceImpl implements QPService {
...
@@ -87,16 +87,16 @@ public class QPServiceImpl implements QPService {
queryWrapper
.
eq
(
SConsumerCoupon:
:
getDealId
,
prepare
.
getDeal_id
());
queryWrapper
.
eq
(
SConsumerCoupon:
:
getDealId
,
prepare
.
getDeal_id
());
queryWrapper
.
eq
(
SConsumerCoupon:
:
getCouponCode
,
code
);
queryWrapper
.
eq
(
SConsumerCoupon:
:
getCouponCode
,
code
);
queryWrapper
.
eq
(
SConsumerCoupon:
:
getUseStatus
,
UserStatusEnum
.
UNUSED
.
getCode
());
queryWrapper
.
eq
(
SConsumerCoupon:
:
getUseStatus
,
UserStatusEnum
.
UNUSED
.
getCode
());
SConsumerCoupon
t
wo
=
isConsumerCouponService
.
getOne
(
queryWrapper
);
SConsumerCoupon
couponT
wo
=
isConsumerCouponService
.
getOne
(
queryWrapper
);
if
(
ObjectUtils
.
isNotEmpty
(
t
wo
))
{
if
(
ObjectUtils
.
isNotEmpty
(
couponT
wo
))
{
//判断是否本人领取过
//判断是否本人领取过
if
(!
two
.
getConsumerId
().
equals
(
user
.
getId
()))
{
if
(
couponTwo
.
getConsumerId
().
equals
(
user
.
getId
()))
{
return
null
;
}
else
{
//领取删除原来的
//领取删除原来的
isConsumerCouponService
.
deleteSConsumerCouponById
(
t
wo
.
getId
());
isConsumerCouponService
.
deleteSConsumerCouponById
(
couponT
wo
.
getId
());
//删除redis
//删除redis
redisUtil
.
delete
(
ReceiptRdeisEnum
.
PREPARE
.
getValue
()
+
prepare
.
getReceipt_code
());
redisUtil
.
delete
(
ReceiptRdeisEnum
.
PREPARE
.
getValue
()
+
prepare
.
getReceipt_code
());
}
else
{
return
null
;
}
}
}
}
//根据优惠卷名称查询优惠劵配置
//根据优惠卷名称查询优惠劵配置
...
...
share-system/src/main/java/share/system/service/impl/SConsumerCouponServiceImpl.java
View file @
c46efc2b
...
@@ -136,14 +136,18 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
...
@@ -136,14 +136,18 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
if
(
CollectionUtils
.
isEmpty
(
sConsumerCoupons
))
{
if
(
CollectionUtils
.
isEmpty
(
sConsumerCoupons
))
{
return
sConsumerCoupons
;
return
sConsumerCoupons
;
}
}
//查询所有门店
List
<
SStore
>
sStores
=
sStoreService
.
list
();
//查询所有房间
List
<
SRoom
>
sRooms
=
sRoomService
.
list
();
//迭代
//迭代
sConsumerCoupons
.
forEach
(
item
->
{
sConsumerCoupons
.
forEach
(
item
->
{
if
(
item
.
getStartDate
().
compareTo
(
couponRequest
.
getPreStartDate
())
<=
0
&&
item
.
getEndDate
().
compareTo
(
couponRequest
.
getPreEndDate
())
>=
0
)
{
if
(
item
.
getStartDate
().
compareTo
(
couponRequest
.
getPreStartDate
())
<=
0
&&
item
.
getEndDate
().
compareTo
(
couponRequest
.
getPreEndDate
())
>=
0
)
{
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
"HH:mm"
);
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
"HH:mm"
);
String
proStartTime
=
sdf1
.
format
(
couponRequest
.
getPreStartDate
());
String
proStartTime
=
sdf1
.
format
(
couponRequest
.
getPreStartDate
());
if
(
proStartTime
.
compareTo
(
item
.
getCouponTimeStart
())
>=
0
)
{
if
(
proStartTime
.
compareTo
(
item
.
getCouponTimeStart
())
>=
0
)
{
SStore
sStore
=
sStore
Service
.
getById
(
couponRequest
.
getStoreId
()
);
SStore
sStore
=
sStore
s
.
stream
().
filter
(
store
->
store
.
getId
().
equals
(
couponRequest
.
getStoreId
())).
findFirst
().
orElse
(
null
);
SRoom
byId
=
sRoom
Service
.
getById
(
couponRequest
.
getRoomId
()
);
SRoom
byId
=
sRoom
s
.
stream
().
filter
(
room
->
room
.
getId
().
equals
(
couponRequest
.
getRoomId
())).
findFirst
().
orElse
(
null
);
BigDecimal
subtract
=
new
BigDecimal
(
item
.
getMinDuration
());
BigDecimal
subtract
=
new
BigDecimal
(
item
.
getMinDuration
());
if
(
item
.
getCouponType
().
equals
(
CouponTypeEnum
.
PACKAGE
.
getCode
()))
{
if
(
item
.
getCouponType
().
equals
(
CouponTypeEnum
.
PACKAGE
.
getCode
()))
{
if
(
couponRequest
.
getOrderMode
().
equals
(
BuyTypeEnum
.
PACK
.
getCode
()))
{
if
(
couponRequest
.
getOrderMode
().
equals
(
BuyTypeEnum
.
PACK
.
getCode
()))
{
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
c46efc2b
...
@@ -919,12 +919,22 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -919,12 +919,22 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if
(
Objects
.
isNull
(
sRoomVo
))
{
if
(
Objects
.
isNull
(
sRoomVo
))
{
throw
new
BaseException
(
"房间不存在!"
);
throw
new
BaseException
(
"房间不存在!"
);
}
}
Device
device
=
new
Device
();
LambdaQueryWrapper
<
Device
>
deviceLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>
();
device
.
setRoomId
(
sOrder
.
getRoomId
());
device
LambdaQueryWrapper
.
eq
(
Device:
:
getRoomId
,
sOrder
.
getRoomId
());
device
.
setDevType
(
DeviceType
.
DEVICE_CCEE
.
getCode
());
device
LambdaQueryWrapper
.
in
(
Device:
:
getDevType
,
DeviceType
.
DEVICE_CCEE
.
getCode
(),
DeviceType
.
DEVICE_0001
.
getCode
());
List
<
Device
>
deviceList
=
deviceService
.
selectDeviceList
(
device
);
List
<
Device
>
deviceList
=
deviceService
.
list
(
deviceLambdaQueryWrapper
);
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
throw
new
BaseException
(
"设备不存在!"
);
throw
new
BaseException
(
"房间设备缺失!"
);
}
if
(
deviceList
.
stream
().
filter
(
device
->
device
.
getDevType
().
equals
(
DeviceType
.
DEVICE_CCEE
.
getCode
())
).
collect
(
Collectors
.
toList
()).
isEmpty
())
{
throw
new
BaseException
(
"房间门锁设备不存在!"
);
}
if
(
deviceList
.
stream
().
filter
(
item
->
item
.
getDevType
().
equals
(
DeviceType
.
DEVICE_0001
.
getCode
())
).
collect
(
Collectors
.
toList
()).
isEmpty
())
{
throw
new
BaseException
(
"房间取电设备不存在!"
);
}
}
if
(
sOrder
.
getStatus
().
equals
(
OrderStatusEnum
.
UNUSED
.
getCode
()))
{
if
(
sOrder
.
getStatus
().
equals
(
OrderStatusEnum
.
UNUSED
.
getCode
()))
{
if
(
RoomStatusEnum
.
HOLD
.
getValue
().
compareTo
(
sRoomVo
.
getStatus
())==
0
if
(
RoomStatusEnum
.
HOLD
.
getValue
().
compareTo
(
sRoomVo
.
getStatus
())==
0
...
@@ -956,10 +966,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -956,10 +966,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
Device
device1
=
new
Device
();
Device
device1
=
new
Device
();
device1
.
setRoomId
(
sOrder
.
getRoomId
());
device1
.
setRoomId
(
sOrder
.
getRoomId
());
device1
.
setDevType
(
DeviceType
.
DEVICE_0001
.
getCode
());
device1
.
setDevType
(
DeviceType
.
DEVICE_0001
.
getCode
());
List
<
Device
>
deviceList1
=
deviceService
.
selectDeviceList
(
device1
);
if
(
CollectionUtils
.
isEmpty
(
deviceList1
))
{
throw
new
BaseException
(
"设备不存在!"
);
}
redisUtils
.
delete
(
ReceiptRdeisEnum
.
ORDER_NO
.
getValue
()
+
sOrder
.
getOrderNo
());
redisUtils
.
delete
(
ReceiptRdeisEnum
.
ORDER_NO
.
getValue
()
+
sOrder
.
getOrderNo
());
// wechatNewService.sendMiniSubscribeMessage(sOrder, MessageReminderEnum.START);
// wechatNewService.sendMiniSubscribeMessage(sOrder, MessageReminderEnum.START);
//开门、取电
//开门、取电
...
...
share-system/src/main/resources/mapper/system/SConsumerCouponMapper.xml
View file @
c46efc2b
...
@@ -189,7 +189,7 @@
...
@@ -189,7 +189,7 @@
<trim
prefix=
"SET"
suffixOverrides=
","
>
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"consumerId != null"
>
consumer_id = #{consumerId},
</if>
<if
test=
"consumerId != null"
>
consumer_id = #{consumerId},
</if>
<if
test=
"couponId != null"
>
coupon_id = #{couponId},
</if>
<if
test=
"couponId != null"
>
coupon_id = #{couponId},
</if>
<if
test=
"dealId != null"
>
deal_id = #{dealId}
</if>
<if
test=
"dealId != null"
>
deal_id = #{dealId}
,
</if>
<if
test=
"couponCode != null and couponCode != ''"
>
coupon_code = #{couponCode},
</if>
<if
test=
"couponCode != null and couponCode != ''"
>
coupon_code = #{couponCode},
</if>
<if
test=
"name != null and name != ''"
>
name = #{name},
</if>
<if
test=
"name != null and name != ''"
>
name = #{name},
</if>
<if
test=
"couponType != null"
>
coupon_type = #{couponType},
</if>
<if
test=
"couponType != null"
>
coupon_type = #{couponType},
</if>
...
...
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