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
87514e92
Commit
87514e92
authored
Apr 29, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改优惠券配置,优惠券领取记录表字段
parent
79d5b30d
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
117 additions
and
107 deletions
+117
-107
QPServiceImplAspect.java
...ain/java/share/framework/aspectj/QPServiceImplAspect.java
+1
-1
CouponRetryTask.java
...artz/src/main/java/share/quartz/task/CouponRetryTask.java
+5
-5
SConsumerCoupon.java
...em/src/main/java/share/system/domain/SConsumerCoupon.java
+2
-2
SCoupon.java
share-system/src/main/java/share/system/domain/SCoupon.java
+2
-2
RoomLabelDto.java
...em/src/main/java/share/system/domain/vo/RoomLabelDto.java
+3
-0
QPServiceImpl.java
...rc/main/java/share/system/service/impl/QPServiceImpl.java
+3
-3
RoomLabelServiceImpl.java
.../java/share/system/service/impl/RoomLabelServiceImpl.java
+0
-1
RoomPackServiceImpl.java
...n/java/share/system/service/impl/RoomPackServiceImpl.java
+8
-8
SConsumerCouponServiceImpl.java
...share/system/service/impl/SConsumerCouponServiceImpl.java
+3
-3
SCouponServiceImpl.java
...in/java/share/system/service/impl/SCouponServiceImpl.java
+2
-2
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+29
-38
SRoomServiceImpl.java
...main/java/share/system/service/impl/SRoomServiceImpl.java
+22
-13
TiktokServiceImpl.java
...ain/java/share/system/service/impl/TiktokServiceImpl.java
+3
-3
RoomLabelMapper.xml
...stem/src/main/resources/mapper/system/RoomLabelMapper.xml
+6
-0
SConsumerCouponMapper.xml
...rc/main/resources/mapper/system/SConsumerCouponMapper.xml
+13
-13
SCouponMapper.xml
...system/src/main/resources/mapper/system/SCouponMapper.xml
+14
-12
SStoreConsumerMapper.xml
...src/main/resources/mapper/system/SStoreConsumerMapper.xml
+1
-1
No files found.
share-framework/src/main/java/share/framework/aspectj/QPServiceImplAspect.java
View file @
87514e92
...
...
@@ -170,7 +170,7 @@ public class QPServiceImplAspect {
couponLog
.
setConsumerId
(
one
.
getConsumerId
());
couponLog
.
setCouponId
(
one
.
getId
());
couponLog
.
setCouponName
(
one
.
getName
());
couponLog
.
setCouponValue
(
one
.
get
Sub
Price
());
couponLog
.
setCouponValue
(
one
.
get
Original
Price
());
// 查询SStore
LambdaQueryWrapper
<
SStore
>
sStoreLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
sStoreLambdaQueryWrapper
.
eq
(
SStore:
:
getOpenShopUuid
,
jsonObject
.
getString
(
"openShopUuid"
));
...
...
share-quartz/src/main/java/share/quartz/task/CouponRetryTask.java
View file @
87514e92
...
...
@@ -152,15 +152,15 @@ public class CouponRetryTask {
public
void
AutoUpdateCouponPromotionPrice
()
{
try
{
LambdaQueryWrapper
<
SCoupon
>
sCouponLambdaQueryWrapper
=
Wrappers
.
lambdaQuery
(
SCoupon
.
class
);
sCouponLambdaQueryWrapper
.
isNotNull
(
SCoupon:
:
get
Promotion
Price
);
sCouponLambdaQueryWrapper
.
isNotNull
(
SCoupon:
:
get
Sub
Price
);
sCouponLambdaQueryWrapper
.
isNotNull
(
SCoupon:
:
get
Sale
Price
);
sCouponLambdaQueryWrapper
.
isNotNull
(
SCoupon:
:
get
Original
Price
);
List
<
SCoupon
>
couponList
=
sCouponService
.
list
(
sCouponLambdaQueryWrapper
);
LambdaQueryWrapper
<
SConsumerCoupon
>
consumerCouponWrapper
=
Wrappers
.
lambdaQuery
(
SConsumerCoupon
.
class
);
consumerCouponWrapper
.
eq
(
SConsumerCoupon:
:
getIsDelete
,
YesNoEnum
.
no
.
getIndex
());
consumerCouponWrapper
.
eq
(
SConsumerCoupon:
:
getUseStatus
,
UserStatusEnum
.
UNUSED
.
getCode
());
consumerCouponWrapper
.
in
(
SConsumerCoupon:
:
getCouponId
,
couponList
.
stream
().
map
(
SCoupon:
:
getId
).
collect
(
Collectors
.
toList
()));
consumerCouponWrapper
.
isNull
(
SConsumerCoupon:
:
get
Promotion
Price
);
consumerCouponWrapper
.
isNull
(
SConsumerCoupon:
:
get
Sale
Price
);
List
<
SConsumerCoupon
>
sConsumerCouponList
=
sConsumerCouponService
.
list
(
consumerCouponWrapper
);
if
(
CollectionUtils
.
isEmpty
(
sConsumerCouponList
))
{
...
...
@@ -193,9 +193,9 @@ public class CouponRetryTask {
}
couponToMatch
.
ifPresent
(
coupon
->
{
consumerCoupon
.
set
PromotionPrice
(
coupon
.
getPromotion
Price
());
consumerCoupon
.
set
SalePrice
(
coupon
.
getSale
Price
());
if
(
PlatformTypeEnum
.
SELF
.
getCode
().
equals
(
consumerCoupon
.
getPlatformType
()))
{
consumerCoupon
.
set
SubPrice
(
coupon
.
getSub
Price
());
consumerCoupon
.
set
OriginalPrice
(
coupon
.
getOriginal
Price
());
}
});
});
...
...
share-system/src/main/java/share/system/domain/SConsumerCoupon.java
View file @
87514e92
...
...
@@ -114,7 +114,7 @@ public class SConsumerCoupon extends BaseEntity
/** 减去金额(满减券单位:元,折扣为系数) */
@Excel
(
name
=
"优惠券原价"
)
private
BigDecimal
sub
Price
;
private
BigDecimal
original
Price
;
/**
* 优惠卷购买金额
...
...
@@ -126,7 +126,7 @@ public class SConsumerCoupon extends BaseEntity
* 优惠券促销金额
*/
@Excel
(
name
=
"优惠券促销金额(单位:元)"
)
private
BigDecimal
promotion
Price
;
private
BigDecimal
sale
Price
;
/** 优惠券来源(1:领取,2:赠送,3:验券) */
...
...
share-system/src/main/java/share/system/domain/SCoupon.java
View file @
87514e92
...
...
@@ -79,7 +79,7 @@ public class SCoupon extends BaseEntity
/** 减去金额(满减券单位:元,折扣为系数) */
@Excel
(
name
=
"优惠券原价"
)
private
BigDecimal
sub
Price
;
private
BigDecimal
original
Price
;
/**
* 优惠卷购买金额
...
...
@@ -91,7 +91,7 @@ public class SCoupon extends BaseEntity
* 优惠券促销金额
*/
@Excel
(
name
=
"优惠券促销金额(单位:元)"
)
private
BigDecimal
promotion
Price
;
private
BigDecimal
sale
Price
;
/**
* 订单类型(0:订房订单,1:续房订单,2:充值订单)
...
...
share-system/src/main/java/share/system/domain/vo/RoomLabelDto.java
View file @
87514e92
...
...
@@ -3,8 +3,11 @@ package share.system.domain.vo;
import
lombok.Data
;
import
share.system.domain.RoomLabel
;
import
java.util.List
;
@Data
public
class
RoomLabelDto
extends
RoomLabel
{
//标签类型 0:预定,1:续费
private
Long
type
;
private
List
<
Long
>
roomIds
;
}
share-system/src/main/java/share/system/service/impl/QPServiceImpl.java
View file @
87514e92
...
...
@@ -129,7 +129,7 @@ public class QPServiceImpl implements QPService {
sConsumerCoupon
.
setUseStatus
(
UserStatusEnum
.
UNUSED
.
getCode
());
sConsumerCoupon
.
setCreateBy
(
String
.
valueOf
(
user
.
getId
()));
sConsumerCoupon
.
setCreateTime
(
new
Date
());
sConsumerCoupon
.
set
Sub
Price
(
BigDecimal
.
valueOf
(
prepare
.
getDeal_marketprice
()));
sConsumerCoupon
.
set
Original
Price
(
BigDecimal
.
valueOf
(
prepare
.
getDeal_marketprice
()));
sConsumerCoupon
.
setCouponPayPrice
(
BigDecimal
.
valueOf
(
prepare
.
getDeal_price
()));
//查询美团团购信息
List
<
TuangouDealQueryShopDealResponseEntity
>
groupActivities
=
queryshopdeal
(
sStore
.
getOpenShopUuid
());
...
...
@@ -173,7 +173,7 @@ public class QPServiceImpl implements QPService {
sConsumerCoupon
.
setMinPrice
(
DEFAULT_MIN_PRICE
);
sConsumerCoupon
.
setCouponTimeStart
(
DEFAULT_START_TIME
);
sConsumerCoupon
.
setCouponTimeEnd
(
DEFAULT_END_TIME
);
sConsumerCoupon
.
set
Promotion
Price
(
sConsumerCoupon
.
getCouponPayPrice
());
sConsumerCoupon
.
set
Sale
Price
(
sConsumerCoupon
.
getCouponPayPrice
());
}
else
{
sConsumerCoupon
.
setCouponId
(
sCoupon
.
getId
());
sConsumerCoupon
.
setCouponType
(
sCoupon
.
getCouponType
());
...
...
@@ -191,7 +191,7 @@ public class QPServiceImpl implements QPService {
sConsumerCoupon
.
setPackIds
(
sCoupon
.
getPackIds
());
sConsumerCoupon
.
setWeeks
(
sCoupon
.
getWeeks
());
sConsumerCoupon
.
setRemark
(
sCoupon
.
getRemark
());
sConsumerCoupon
.
set
PromotionPrice
(
sCoupon
.
getPromotion
Price
());
sConsumerCoupon
.
set
SalePrice
(
sCoupon
.
getSale
Price
());
}
isConsumerCouponService
.
insertSConsumerCoupon
(
sConsumerCoupon
);
//核销美团券
...
...
share-system/src/main/java/share/system/service/impl/RoomLabelServiceImpl.java
View file @
87514e92
...
...
@@ -159,7 +159,6 @@ public class RoomLabelServiceImpl extends ServiceImpl<RoomLabelMapper, RoomLabel
public
TableDataInfo
pageList
(
RoomLabelDto
roomLabel
)
{
List
<
RoomLabel
>
roomLabels
=
roomLabelMapper
.
pageList
(
roomLabel
);
List
<
RoomLabelVo
>
voList
=
doListToVoList
(
roomLabels
);
//正序labelDuration,倒序labelType
PageDomain
pageDomain
=
TableSupport
.
buildPageRequest
();
Integer
pageNum
=
pageDomain
.
getPageNum
();
Integer
pageSize
=
pageDomain
.
getPageSize
();
...
...
share-system/src/main/java/share/system/service/impl/RoomPackServiceImpl.java
View file @
87514e92
package
share
.
system
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.util.CollectionUtils
;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
share.common.utils.DateUtils
;
import
share.system.domain.SRoom
;
import
share.system.mapper.RoomPackMapper
;
import
share.system.domain.SRoomPack
;
import
share.system.mapper.RoomPackMapper
;
import
share.system.mapper.SRoomMapper
;
import
share.system.service.IRoomPackService
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
/**
* 包房套餐关系Service业务层处理
*
...
...
share-system/src/main/java/share/system/service/impl/SConsumerCouponServiceImpl.java
View file @
87514e92
...
...
@@ -203,7 +203,7 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
queryWrapper
.
orderByDesc
(
SConsumerCoupon:
:
getOrderType
);
}
queryWrapper
.
orderByAsc
(
SConsumerCoupon:
:
getEndDate
,
SConsumerCoupon:
:
getCouponType
);
queryWrapper
.
orderByDesc
(
SConsumerCoupon:
:
get
Sub
Price
);
queryWrapper
.
orderByDesc
(
SConsumerCoupon:
:
get
Original
Price
);
//查询用户未使用的优惠券
List
<
SConsumerCoupon
>
sConsumerCoupons
=
baseMapper
.
selectList
(
queryWrapper
);
//计算时长
...
...
@@ -439,9 +439,9 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
newSConsumerCoupon
.
setMinPrice
(
new
BigDecimal
(
0.00
));
newSConsumerCoupon
.
setWeeks
(
sCoupon
.
getWeeks
());
newSConsumerCoupon
.
setStoreIds
(
sCoupon
.
getStoreIds
());
newSConsumerCoupon
.
set
SubPrice
(
sCoupon
.
getSub
Price
());
newSConsumerCoupon
.
set
OriginalPrice
(
sCoupon
.
getOriginal
Price
());
newSConsumerCoupon
.
setCouponPayPrice
(
sCoupon
.
getCouponPayPrice
());
newSConsumerCoupon
.
set
PromotionPrice
(
sCoupon
.
getPromotion
Price
());
newSConsumerCoupon
.
set
SalePrice
(
sCoupon
.
getSale
Price
());
newSConsumerCoupon
.
setMinDuration
(
sCoupon
.
getMinDuration
());
newSConsumerCoupon
.
setMaxDuration
(
sCoupon
.
getMaxDuration
());
newSConsumerCoupon
.
setDuration
(
sCoupon
.
getDuration
());
...
...
share-system/src/main/java/share/system/service/impl/SCouponServiceImpl.java
View file @
87514e92
...
...
@@ -209,7 +209,7 @@ public class SCouponServiceImpl extends ServiceImpl<SCouponMapper, SCoupon> impl
//套餐名称
sCoupon
.
setName
(
item
.
getTitle
());
//套餐原价
sCoupon
.
setSub
Price
(
BigDecimal
.
valueOf
(
item
.
getMarketprice
()));
sCoupon
.
setOriginal
Price
(
BigDecimal
.
valueOf
(
item
.
getMarketprice
()));
sCoupon
.
setCouponPayPrice
(
BigDecimal
.
valueOf
(
item
.
getPrice
()));
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
try
{
...
...
@@ -317,7 +317,7 @@ public class SCouponServiceImpl extends ServiceImpl<SCouponMapper, SCoupon> impl
sCoupon
.
setName
(
sku
.
getStr
(
"sku_name"
));
sCoupon
.
setStartDate
(
new
Date
(
product
.
getInt
(
"sold_start_time"
)
*
1000L
));
sCoupon
.
setEndDate
(
new
Date
(
product
.
getInt
(
"sold_end_time"
)
*
1000L
));
sCoupon
.
setSub
Price
(
sku
.
getBigDecimal
(
"origin_amount"
).
divide
(
new
BigDecimal
(
"100"
)));
sCoupon
.
setOriginal
Price
(
sku
.
getBigDecimal
(
"origin_amount"
).
divide
(
new
BigDecimal
(
"100"
)));
sCoupon
.
setRoomType
(
RoomType
.
getCodeList
());
sCoupon
.
setPlatformType
(
PlatformTypeEnum
.
TIKTOK
.
getCode
());
sCoupon
.
setStoreType
(
StoreType
.
getCodeList
());
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
87514e92
...
...
@@ -1118,7 +1118,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if
(
ObjectUtils
.
isEmpty
(
coupon
))
{
throw
new
BaseException
(
"优惠券异常,联系客服!"
);
}
sOrder
.
setCouponPrice
(
coupon
.
get
Sub
Price
());
sOrder
.
setCouponPrice
(
coupon
.
get
Original
Price
());
}
sOrder
.
setPayPrice
(
request
.
getPayFee
());
sOrder
.
setBuyType
(
request
.
getBuyType
());
...
...
@@ -1557,59 +1557,55 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
private
List
<
SOrderVo
>
convertDosToVos
(
List
<
SOrder
>
orderList
)
{
List
<
SOrderVo
>
voList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
orderList
))
{
List
<
Long
>
storeIds
=
orderList
.
stream
().
map
(
SOrder:
:
getStoreId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
roomIds
=
orderList
.
stream
().
map
(
SOrder:
:
getRoomId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
couponIds
=
orderList
.
stream
().
map
(
SOrder:
:
getCouponId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
packIds
=
orderList
.
stream
().
map
(
SOrder:
:
getPackId
).
collect
(
Collectors
.
toList
());
List
<
SStore
>
storeList
=
storeService
.
listByIds
(
storeIds
);
List
<
SRoom
>
roomList
=
roomService
.
listByIds
(
roomIds
);
List
<
SConsumerCoupon
>
userCouponList
=
consumerCouponService
.
queryByIds
(
couponIds
);
List
<
SPack
>
packList
=
packService
.
listByIds
(
packIds
);
orderList
.
stream
().
forEach
(
o
->
{
// 使用Map缓存查询结果,减少重复查询
Map
<
Long
,
SStore
>
storeMap
=
storeService
.
listByIds
(
orderList
.
stream
().
map
(
SOrder:
:
getStoreId
).
collect
(
Collectors
.
toSet
()))
.
stream
().
collect
(
Collectors
.
toMap
(
SStore:
:
getId
,
s
->
s
));
Map
<
Long
,
SRoom
>
roomMap
=
roomService
.
listByIds
(
orderList
.
stream
().
map
(
SOrder:
:
getRoomId
).
collect
(
Collectors
.
toSet
()))
.
stream
().
collect
(
Collectors
.
toMap
(
SRoom:
:
getId
,
s
->
s
));
Map
<
Long
,
SConsumerCoupon
>
couponMap
=
consumerCouponService
.
queryByIds
(
orderList
.
stream
().
map
(
SOrder:
:
getCouponId
).
distinct
().
collect
(
Collectors
.
toList
()))
.
stream
().
collect
(
Collectors
.
toMap
(
SConsumerCoupon:
:
getId
,
s
->
s
));
Map
<
Long
,
SPack
>
packMap
=
packService
.
listByIds
(
orderList
.
stream
().
map
(
SOrder:
:
getPackId
).
distinct
().
collect
(
Collectors
.
toList
()))
.
stream
().
collect
(
Collectors
.
toMap
(
SPack:
:
getId
,
s
->
s
));
orderList
.
forEach
(
o
->
{
SOrderVo
vo
=
new
SOrderVo
();
BeanUtils
.
copyProperties
(
o
,
vo
);
storeList
.
stream
().
forEach
(
store
->
{
if
(
store
.
getId
().
equals
(
vo
.
getStoreId
())
)
{
SStore
store
=
storeMap
.
get
(
vo
.
getStoreId
());
if
(
store
!=
null
)
{
vo
.
setStoreName
(
store
.
getName
());
vo
.
setAddress
(
store
.
getAddress
());
}
});
roomList
.
stream
().
forEach
(
room
->
{
if
(
room
.
getId
().
equals
(
vo
.
getRoomId
()))
{
SRoom
room
=
roomMap
.
get
(
vo
.
getRoomId
());
if
(
room
!=
null
)
{
vo
.
setRoomName
(
room
.
getName
());
vo
.
setRoomImages
(
room
.
getImages
());
vo
.
setRoomType
(
room
.
getRoomType
());
vo
.
setRoomTypeName
(
RoomType
.
getNameByCode
(
room
.
getRoomType
()));
}
});
if
(
Objects
.
nonNull
(
vo
.
getCouponId
()))
{
userCouponList
.
stream
().
forEach
(
userCoupon
->
{
if
(
userCoupon
.
getId
().
equals
(
vo
.
getCouponId
())
)
{
SConsumerCoupon
userCoupon
=
couponMap
.
get
(
vo
.
getCouponId
());
if
(
userCoupon
!=
null
)
{
// 判断是否可以退款
vo
.
setIsRefund
(
isRefund
(
vo
,
userCoupon
));
vo
.
setCouponName
(
userCoupon
.
getName
());
}
else
{
// 如果优惠券为空,则调用isRefund方法时需要传入null
vo
.
setIsRefund
(
isRefund
(
vo
,
null
));
}
});
}
else
{
// 判断是否可以退款
vo
.
setIsRefund
(
isRefund
(
o
,
null
));
vo
.
setIsRefund
(
isRefund
(
v
o
,
null
));
}
if
(
Objects
.
nonNull
(
vo
.
getPackId
()))
{
packList
.
stream
().
forEach
(
pack
->
{
if
(
pack
.
getId
().
equals
(
vo
.
getPackId
()))
{
SPack
pack
=
packMap
.
get
(
vo
.
getPackId
());
if
(
pack
!=
null
)
{
vo
.
setPackName
(
pack
.
getName
());
}
});
}
voList
.
add
(
vo
);
});
}
return
voList
;
}
@Override
public
String
openDoor
(
String
orderNo
)
{
LambdaQueryWrapper
<
SOrder
>
orderLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
...
...
@@ -1752,16 +1748,11 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
SRoom
room
=
roomService
.
getById
(
request
.
getRoomId
());
BigDecimal
totalPrice
=
computeTotalPrice
(
room
.
getPrice
(),
request
.
getPreStartDate
(),
request
.
getPreEndDate
());
BigDecimal
payPrice
;
BuyTypeEnum
buyTypeEnum
=
BuyTypeEnum
.
getEnumByCode
(
request
.
getBuyType
());
switch
(
buyTypeEnum
)
{
case
TIME:
//小时模式
RoomLabel
roomLabel
=
roomLabelService
.
selectRoomLabelById
(
request
.
getRoomLabelId
());
if
(
ObjectUtils
.
isEmpty
(
roomLabel
.
getPackId
()))
{
payPrice
=
totalPrice
;
break
;
case
PACK:
//套餐模式
payPrice
=
computeTotalPrice
(
request
.
getPackId
(),
totalPrice
);
break
;
default
:
throw
new
BaseException
(
"购买方式类型异常!"
);
}
else
{
payPrice
=
computeTotalPrice
(
roomLabel
.
getPackId
(),
totalPrice
);
}
priceResponse
.
setTotalFee
(
payPrice
);
// 计算优惠券金额
...
...
@@ -1823,7 +1814,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
RoomLabel
roomLabel
=
roomLabelService
.
selectRoomLabelById
(
request
.
getRoomLabelId
());
//(促销价-优惠券促销价)+((时长-促销时长)*单价)
SRoom
room
=
roomService
.
getById
(
request
.
getRoomId
());
BigDecimal
subtract
=
(
roomLabel
.
getPromotionAmount
().
subtract
(
consumerCoupon
.
get
Promotion
Price
())).
BigDecimal
subtract
=
(
roomLabel
.
getPromotionAmount
().
subtract
(
consumerCoupon
.
get
Sale
Price
())).
add
(((
DateUtils
.
differentHour
(
request
.
getPreStartDate
(),
request
.
getPreEndDate
()).
subtract
(
new
BigDecimal
(
roomLabel
.
getPromotionDuration
()))).
multiply
(
room
.
getPrice
())));
//判断是否为负数
if
(
subtract
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
)
{
...
...
share-system/src/main/java/share/system/service/impl/SRoomServiceImpl.java
View file @
87514e92
...
...
@@ -114,6 +114,19 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
* @param roomList
* @return
*/
/**
* 查询房间列表
*
* @param sRoom 房间
* @return 房间
*/
@Override
public
List
<
SRoomVo
>
selectSRoomVoList
(
SRoom
sRoom
)
{
List
<
SRoom
>
roomList
=
baseMapper
.
selectSRoomList
(
sRoom
);
return
convertVoList
(
roomList
);
}
private
List
<
SRoomVo
>
convertVoList
(
List
<
SRoom
>
roomList
)
{
List
<
SRoomVo
>
voList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
roomList
))
{
...
...
@@ -134,6 +147,14 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
wrapper
.
eq
(
SOrder:
:
getStatus
,
OrderStatusEnum
.
INUSE
.
getCode
());
wrapper
.
orderByAsc
(
SOrder:
:
getEndDate
);
List
<
SOrder
>
list
=
orderService
.
list
(
wrapper
);
RoomLabelDto
roomLabel
=
new
RoomLabelDto
();
roomLabel
.
setStoreId
(
roomList
.
get
(
0
).
getStoreId
());
roomLabel
.
setType
(
Long
.
valueOf
(
YesNoEnum
.
no
.
getIndex
()));
roomLabel
.
setRoomIds
(
roomIds
);
List
<
RoomLabel
>
roomLabels
=
roomLabelService
.
selectRoomLabelList
(
roomLabel
);
//转Map
Map
<
Long
,
List
<
RoomLabelVo
>>
roomLabelMap
=
Optional
.
ofNullable
(
roomLabelService
.
doListToVoList
(
roomLabels
))
.
orElse
(
new
ArrayList
<>()).
stream
().
collect
(
Collectors
.
groupingBy
(
RoomLabelVo:
:
getRoomId
));
// 查询每一个房间最后一条预定订单下单时间
// Date now = DateUtil.date();
// SOrder orderQuery = new SOrder();
...
...
@@ -146,6 +167,7 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
SRoomVo
vo
=
new
SRoomVo
();
BeanUtils
.
copyProperties
(
sRoom
,
vo
);
vo
.
setStoreName
(
store
.
getName
());
vo
.
setRoomLabelList
(
roomLabelMap
.
get
(
sRoom
.
getId
()));
vo
.
setRoomStatusList
(
roomStatusMap
.
get
(
sRoom
.
getId
()));
if
(
CollectionUtils
.
isNotEmpty
(
sCleanRecordsList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
recordsMap
.
get
(
vo
.
getId
())))
{
...
...
@@ -194,19 +216,6 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
return
voList
;
}
/**
* 查询房间列表
*
* @param sRoom 房间
* @return 房间
*/
@Override
public
List
<
SRoomVo
>
selectSRoomVoList
(
SRoom
sRoom
)
{
List
<
SRoom
>
roomList
=
baseMapper
.
selectSRoomList
(
sRoom
);
return
convertVoList
(
roomList
);
}
/**
* 新增房间
*
...
...
share-system/src/main/java/share/system/service/impl/TiktokServiceImpl.java
View file @
87514e92
...
...
@@ -395,7 +395,7 @@ public class TiktokServiceImpl implements TiktokService {
sConsumerCoupon
.
setCreateBy
(
String
.
valueOf
(
user
.
getId
()));
sConsumerCoupon
.
setCreateTime
(
new
Date
());
Integer
originalAmount
=
amount
.
getInt
(
"list_market_amount"
);
sConsumerCoupon
.
set
Sub
Price
(
BigDecimal
.
valueOf
(
originalAmount
/
100
));
sConsumerCoupon
.
set
Original
Price
(
BigDecimal
.
valueOf
(
originalAmount
/
100
));
sConsumerCoupon
.
setCouponPayPrice
(
BigDecimal
.
valueOf
(
amount
.
getInt
(
"coupon_pay_amount"
)
/
100
));
//时间戳转年月日时分秒
sConsumerCoupon
.
setEndDate
(
new
Date
(
entries
.
getInt
(
"expire_time"
)
*
1000L
));
...
...
@@ -426,7 +426,7 @@ public class TiktokServiceImpl implements TiktokService {
sConsumerCoupon
.
setMinPrice
(
DEFAULT_MIN_PRICE
);
sConsumerCoupon
.
setCouponTimeStart
(
DEFAULT_START_TIME
);
sConsumerCoupon
.
setCouponTimeEnd
(
DEFAULT_END_TIME
);
sConsumerCoupon
.
set
Promotion
Price
(
sConsumerCoupon
.
getCouponPayPrice
());
sConsumerCoupon
.
set
Sale
Price
(
sConsumerCoupon
.
getCouponPayPrice
());
}
else
{
sConsumerCoupon
.
setCouponId
(
sCoupon
.
getId
());
sConsumerCoupon
.
setCouponType
(
sCoupon
.
getCouponType
());
...
...
@@ -444,7 +444,7 @@ public class TiktokServiceImpl implements TiktokService {
sConsumerCoupon
.
setPackIds
(
sCoupon
.
getPackIds
());
sConsumerCoupon
.
setWeeks
(
sCoupon
.
getWeeks
());
sConsumerCoupon
.
setRemark
(
sCoupon
.
getRemark
());
sConsumerCoupon
.
set
PromotionPrice
(
sCoupon
.
getPromotion
Price
());
sConsumerCoupon
.
set
SalePrice
(
sCoupon
.
getSale
Price
());
}
isConsumerCouponService
.
insertSConsumerCoupon
(
sConsumerCoupon
);
}
catch
(
RuntimeException
e
)
{
...
...
share-system/src/main/resources/mapper/system/RoomLabelMapper.xml
View file @
87514e92
...
...
@@ -79,6 +79,12 @@
</if>
<if
test=
"promotionAmount != null "
>
and r.promotion_amount = #{promotionAmount}
</if>
<if
test=
"type != null "
>
and l.type = #{type}
</if>
<if
test=
"roomIds != null "
>
and r.room_id in
<foreach
item=
"roomIds"
collection=
"roomIds"
open=
"("
separator=
","
close=
")"
>
#{roomIds}
</foreach>
</if>
order by l.duration,l.type desc
</select>
...
...
share-system/src/main/resources/mapper/system/SConsumerCouponMapper.xml
View file @
87514e92
...
...
@@ -23,9 +23,9 @@
<result
property=
"maxDuration"
column=
"max_duration"
/>
<result
property=
"duration"
column=
"duration"
/>
<result
property=
"minPrice"
column=
"min_price"
/>
<result
property=
"
subPrice"
column=
"sub_price"
/>
<result
property=
"
originalPrice"
column=
"original_price"
/>
<result
property=
"couponPayPrice"
column=
"coupon_pay_price"
/>
<result
property=
"
promotionPrice"
column=
"promotion
_price"
/>
<result
property=
"
salePrice"
column=
"sale
_price"
/>
<result
property=
"sourceType"
column=
"source_type"
/>
<result
property=
"roomType"
column=
"room_type"
/>
<result
property=
"storeType"
column=
"store_type"
/>
...
...
@@ -66,9 +66,9 @@
min_duration,
duration,
min_price,
sub
_price,
original
_price,
coupon_pay_price,
promotion
_price,
sale
_price,
source_type,
platform_type,
start_date,
...
...
@@ -110,7 +110,7 @@
<if
test=
"minDuration != null and minDuration != ''"
>
and min_duration = #{minDuration}
</if>
<if
test=
"duration != null and duration != ''"
>
and duration = #{duration}
</if>
<if
test=
"minPrice != null "
>
and min_price = #{minPrice}
</if>
<if
test=
"subPrice != null "
>
and sub_price = #{sub
Price}
</if>
<if
test=
"originalPrice != null "
>
and original_price = #{original
Price}
</if>
<if
test=
"sourceType != null and sourceType != ''"
>
and source_type = #{sourceType}
</if>
<if
test=
"platformType != null and platformType != ''"
>
and platform_type = #{platformType}
</if>
<if
test=
"orderType != null and orderType != ''"
>
and order_type = #{orderType}
</if>
...
...
@@ -124,7 +124,7 @@
<if
test=
"deleteTime != null "
>
and delete_time = #{deleteTime}
</if>
<if
test=
"tiktokSkuId != null "
>
and tiktok_sku_id = #{tiktokSkuId}
</if>
<if
test=
"couponPayPrice != null "
>
and coupon_pay_price = #{couponPayPrice}
</if>
<if
test=
"
promotionPrice != null "
>
and promotion_price = #{promotion
Price}
</if>
<if
test=
"
salePrice != null "
>
and sale_price = #{sale
Price}
</if>
ORDER BY create_time DESC
</select>
...
...
@@ -147,7 +147,7 @@
and end_date >= NOW()
and use_status = '0'
<if
test=
"consumerId != null "
>
and consumer_id = #{consumerId}
</if>
order by coupon_type,end_date,
sub
_price desc
order by coupon_type,end_date,
original
_price desc
</where>
</select>
<select
id=
"queryById"
resultType=
"share.system.domain.SConsumerCoupon"
>
...
...
@@ -182,7 +182,7 @@
<if
test=
"minDuration != null"
>
min_duration,
</if>
<if
test=
"duration != null and duration != ''"
>
duration,
</if>
<if
test=
"minPrice != null"
>
min_price,
</if>
<if
test=
"
subPrice != null"
>
sub
_price,
</if>
<if
test=
"
originalPrice != null"
>
original
_price,
</if>
<if
test=
"sourceType != null"
>
source_type,
</if>
<if
test=
"platformType != null"
>
platform_type,
</if>
<if
test=
"startDate != null"
>
start_date,
</if>
...
...
@@ -206,7 +206,7 @@
<if
test=
"tiktokSkuId != null"
>
tiktok_sku_id,
</if>
<if
test=
"storeIds != null"
>
store_ids,
</if>
<if
test=
"couponPayPrice != null"
>
coupon_pay_price,
</if>
<if
test=
"
promotionPrice != null"
>
promotion
_price,
</if>
<if
test=
"
salePrice != null"
>
sale
_price,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"consumerId != null"
>
#{consumerId},
</if>
...
...
@@ -223,7 +223,7 @@
<if
test=
"minDuration != null"
>
#{minDuration},
</if>
<if
test=
"duration != null and duration != ''"
>
#{duration},
</if>
<if
test=
"minPrice != null"
>
#{minPrice},
</if>
<if
test=
"
subPrice != null"
>
#{sub
Price},
</if>
<if
test=
"
originalPrice != null"
>
#{original
Price},
</if>
<if
test=
"sourceType != null"
>
#{sourceType},
</if>
<if
test=
"platformType != null"
>
#{platformType},
</if>
<if
test=
"startDate != null"
>
#{startDate},
</if>
...
...
@@ -247,7 +247,7 @@
<if
test=
"tiktokSkuId != null"
>
#{tiktokSkuId},
</if>
<if
test=
"storeIds != null"
>
#{storeIds},
</if>
<if
test=
"couponPayPrice != null"
>
#{couponPayPrice},
</if>
<if
test=
"
promotionPrice != null"
>
#{promotion
Price},
</if>
<if
test=
"
salePrice != null"
>
#{sale
Price},
</if>
</trim>
</insert>
...
...
@@ -268,7 +268,7 @@
<if
test=
"minDuration != null"
>
min_duration = #{minDuration},
</if>
<if
test=
"duration != null and duration != ''"
>
duration = #{duration},
</if>
<if
test=
"minPrice != null"
>
min_price = #{minPrice},
</if>
<if
test=
"
subPrice != null"
>
sub_price = #{sub
Price},
</if>
<if
test=
"
originalPrice != null"
>
original_price = #{original
Price},
</if>
<if
test=
"sourceType != null"
>
source_type = #{sourceType},
</if>
<if
test=
"platformType != null"
>
platform_type = #{platformType},
</if>
<if
test=
"startDate != null"
>
start_date = #{startDate},
</if>
...
...
@@ -292,7 +292,7 @@
<if
test=
"tiktokSkuId != null"
>
tiktok_sku_id = #{tiktokSkuId},
</if>
<if
test=
"storeIds != null"
>
store_ids = #{storeIds},
</if>
<if
test=
"couponPayPrice != null"
>
coupon_pay_price = #{couponPayPrice},
</if>
<if
test=
"
promotionPrice != null"
>
promotion_price = #{promotion
Price},
</if>
<if
test=
"
salePrice != null"
>
sale_price = #{sale
Price},
</if>
</trim>
where id = #{id}
</update>
...
...
share-system/src/main/resources/mapper/system/SCouponMapper.xml
View file @
87514e92
...
...
@@ -23,9 +23,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"minDuration"
column=
"min_duration"
/>
<result
property=
"maxDuration"
column=
"max_duration"
/>
<result
property=
"minPrice"
column=
"min_price"
/>
<result
property=
"
subPrice"
column=
"sub_price"
/>
<result
property=
"
originalPrice"
column=
"original_price"
/>
<result
property=
"couponPayPrice"
column=
"coupon_pay_price"
/>
<result
property=
"
promotionPrice"
column=
"promotion
_price"
/>
<result
property=
"
salePrice"
column=
"sale
_price"
/>
<result
property=
"isOverlay"
column=
"is_overlay"
/>
<result
property=
"weeks"
column=
"weeks"
/>
<result
property=
"platformType"
column=
"platform_type"
/>
...
...
@@ -50,9 +50,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
weeks,
store_ids,
coupon_pay_price,
promotion
_price,
sale
_price,
duration,min_duration,max_duration,
min_price,sub_price,is_overlay,
min_price,
original_price,
is_overlay,
platform_type,number,create_by,
create_time,update_by,update_time,
remark from s_coupon
...
...
@@ -78,9 +80,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"minDuration != null and minDuration != ''"
>
and min_duration = #{minDuration}
</if>
<if
test=
"maxDuration != null and maxDuration != ''"
>
and max_duration = #{maxDuration}
</if>
<if
test=
"minPrice != null and minPrice != ''"
>
and min_price = #{minPrice}
</if>
<if
test=
"
subPrice != null and subPrice != ''"
>
and sub_price = #{sub
Price}
</if>
<if
test=
"
originalPrice != null and originalPrice != ''"
>
and original_price = #{original
Price}
</if>
<if
test=
"couponPayPrice != null and couponPayPrice != ''"
>
and coupon_pay_price = #{couponPayPrice}
</if>
<if
test=
"
promotionPrice != null and promotionPrice != ''"
>
and promotion_price = #{promotion
Price}
</if>
<if
test=
"
salePrice != null and salePrice != ''"
>
and sale_price = #{sale
Price}
</if>
<if
test=
"isOverlay != null"
>
and is_overlay = #{isOverlay}
</if>
<if
test=
"platformType != null"
>
and platform_type = #{platformType}
</if>
<if
test=
"weeks != null"
>
and weeks = #{weeks}
</if>
...
...
@@ -141,7 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"minDuration != null and minDuration != ''"
>
min_duration,
</if>
<if
test=
"maxDuration != null and maxDuration != ''"
>
max_duration,
</if>
<if
test=
"minPrice != null"
>
min_price,
</if>
<if
test=
"
subPrice != null"
>
sub
_price,
</if>
<if
test=
"
originalPrice != null"
>
original
_price,
</if>
<if
test=
"isOverlay != null"
>
is_overlay,
</if>
<if
test=
"weeks != null"
>
weeks,
</if>
<if
test=
"platformType != null"
>
platform_type,
</if>
...
...
@@ -155,7 +157,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"tiktokSkuId != null"
>
tiktok_sku_id,
</if>
<if
test=
"storeIds != null"
>
store_ids,
</if>
<if
test=
"couponPayPrice != null"
>
coupon_pay_price,
</if>
<if
test=
"
promotionPrice != null"
>
promotion
_price,
</if>
<if
test=
"
salePrice != null"
>
sale
_price,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"name != null and name != ''"
>
#{name},
</if>
...
...
@@ -170,7 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"minDuration != null and minDuration != ''"
>
#{minDuration},
</if>
<if
test=
"maxDuration != null and maxDuration != ''"
>
#{maxDuration},
</if>
<if
test=
"minPrice != null"
>
#{minPrice},
</if>
<if
test=
"
subPrice != null"
>
#{sub
Price},
</if>
<if
test=
"
originalPrice != null"
>
#{original
Price},
</if>
<if
test=
"isOverlay != null"
>
#{isOverlay},
</if>
<if
test=
"weeks != null"
>
#{weeks},
</if>
<if
test=
"platformType != null"
>
#{platformType},
</if>
...
...
@@ -184,7 +186,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"tiktokSkuId != null"
>
#{tiktokSkuId},
</if>
<if
test=
"storeIds != null"
>
#{storeIds},
</if>
<if
test=
"couponPayPrice != null"
>
#{couponPayPrice},
</if>
<if
test=
"
promotionPrice != null"
>
#{promotion
Price},
</if>
<if
test=
"
salePrice != null"
>
#{sale
Price},
</if>
</trim>
</insert>
...
...
@@ -209,7 +211,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"maxDuration != null and maxDuration != ''"
>
max_duration = #{maxDuration},
</if>
<if
test=
"weeks != null"
>
weeks = #{weeks},
</if>
<if
test=
"minPrice != null and minPrice != ''"
>
min_price = #{minPrice},
</if>
<if
test=
"
subPrice != null and subPrice != ''"
>
sub_price = #{sub
Price},
</if>
<if
test=
"
originalPrice != null and originalPrice != ''"
>
original_price = #{original
Price},
</if>
<if
test=
"isOverlay != null"
>
is_overlay = #{isOverlay},
</if>
<if
test=
"platformType != null"
>
platform_type = #{platformType},
</if>
<if
test=
"number != null"
>
number = #{number},
</if>
...
...
@@ -219,7 +221,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
<if
test=
"remark != null"
>
remark = #{remark},
</if>
<if
test=
"couponPayPrice != null"
>
coupon_pay_price = #{couponPayPrice},
</if>
<if
test=
"
promotionPrice != null"
>
promotion_price = #{promotion
Price},
</if>
<if
test=
"
salePrice != null"
>
sale_price = #{sale
Price},
</if>
</trim>
where id = #{id}
</update>
...
...
share-system/src/main/resources/mapper/system/SStoreConsumerMapper.xml
View file @
87514e92
...
...
@@ -26,7 +26,7 @@
</if>
</select>
<select
id=
"queryByConsumerId"
resultMap=
"SStoreConsumerResult"
>
select store_id,
store
_id, position
select store_id,
consumer
_id, position
from s_store_consumer
where consumer_id = #{consumerId}
</select>
...
...
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