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
5b287dad
Commit
5b287dad
authored
Aug 23, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refs/heads/dev-cs' into test
parents
1e1710af
d9286e68
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
261 additions
and
21 deletions
+261
-21
PositionEnum.java
...common/src/main/java/share/common/enums/PositionEnum.java
+3
-2
SOrderController.java
...in/java/share/web/controller/system/SOrderController.java
+5
-3
SStoreController.java
...in/java/share/web/controller/system/SStoreController.java
+6
-0
SConsumerVo.java
...tem/src/main/java/share/system/domain/vo/SConsumerVo.java
+2
-0
SConsumerCouponMapper.java
.../main/java/share/system/mapper/SConsumerCouponMapper.java
+2
-0
OrderStatisticsRequest.java
...ain/java/share/system/request/OrderStatisticsRequest.java
+18
-0
OrderStatisticsResponse.java
...n/java/share/system/response/OrderStatisticsResponse.java
+54
-0
ISConsumerCouponService.java
...in/java/share/system/service/ISConsumerCouponService.java
+2
-0
ISOrderService.java
...em/src/main/java/share/system/service/ISOrderService.java
+3
-5
ISStoreService.java
...em/src/main/java/share/system/service/ISStoreService.java
+2
-0
OrderRefundServiceImpl.java
...ava/share/system/service/impl/OrderRefundServiceImpl.java
+14
-0
SConsumerCouponServiceImpl.java
...share/system/service/impl/SConsumerCouponServiceImpl.java
+5
-0
SConsumerServiceImpl.java
.../java/share/system/service/impl/SConsumerServiceImpl.java
+6
-0
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+119
-11
SStoreServiceImpl.java
...ain/java/share/system/service/impl/SStoreServiceImpl.java
+13
-0
SConsumerCouponMapper.xml
...rc/main/resources/mapper/system/SConsumerCouponMapper.xml
+7
-0
No files found.
share-common/src/main/java/share/common/enums/PositionEnum.java
View file @
5b287dad
...
...
@@ -6,8 +6,9 @@ public enum PositionEnum {
CLEANER
(
1
,
"保洁人员"
),
ADMIN
(
2
,
"管理员"
),
//客服
CUSTOMER_SERVICE
(
3
,
"客服"
);
;
CUSTOMER_SERVICE
(
3
,
"客服"
),
//门店管理
MANAGE
(
4
,
"门店管理"
);
private
Integer
code
;
private
String
name
;
...
...
share-front/src/main/java/share/web/controller/system/SOrderController.java
View file @
5b287dad
...
...
@@ -17,8 +17,10 @@ import share.system.domain.vo.SOrderVo;
import
share.system.request.CreateOrderRequest
;
import
share.system.request.OrderComputedPriceRequest
;
import
share.system.request.OrderRefundRequest
;
import
share.system.request.OrderStatisticsRequest
;
import
share.system.response.ComputedOrderPriceResponse
;
import
share.system.response.OrderPayResultResponse
;
import
share.system.response.OrderStatisticsResponse
;
import
share.system.service.ISOrderService
;
import
javax.validation.constraints.NotBlank
;
...
...
@@ -140,9 +142,9 @@ public class SOrderController extends BaseController
return
R
.
ok
(
sOrderService
.
autoRefund
(
request
));
}
@
Ge
tMapping
(
"/statistics"
)
public
R
<
O
bject
>
statistics
(
)
{
return
R
.
ok
(
sOrderService
.
statistics
());
@
Pos
tMapping
(
"/statistics"
)
public
R
<
O
rderStatisticsResponse
>
statistics
(
@RequestBody
OrderStatisticsRequest
request
)
{
return
R
.
ok
(
sOrderService
.
statistics
(
request
));
}
}
share-front/src/main/java/share/web/controller/system/SStoreController.java
View file @
5b287dad
...
...
@@ -81,6 +81,12 @@ public class SStoreController extends BaseController
return
success
(
sStoreService
.
storeList
());
}
//用户管理的门店
@GetMapping
(
"/manageList"
)
@ApiOperation
(
value
=
"门店管理负责的门店"
)
public
AjaxResult
manageList
()
{
return
success
(
sStoreService
.
manageList
());
}
@PostMapping
(
"/queryByStoreIds"
)
public
R
<
List
<
SStoreVo
>>
queryByStoreIds
(
@RequestBody
SStoreDto
dto
)
{
return
R
.
ok
(
sStoreService
.
queryByStoreIds
(
dto
));
...
...
share-system/src/main/java/share/system/domain/vo/SConsumerVo.java
View file @
5b287dad
...
...
@@ -20,6 +20,8 @@ public class SConsumerVo extends SConsumer {
private
Boolean
isCleaner
;
private
Boolean
isManage
;
private
Boolean
isAdmin
;
private
Long
consumerId
;
...
...
share-system/src/main/java/share/system/mapper/SConsumerCouponMapper.java
View file @
5b287dad
...
...
@@ -77,4 +77,6 @@ public interface SConsumerCouponMapper extends BaseMapper<SConsumerCoupon>
List
<
SConsumerCoupon
>
selectOrderList
();
SConsumerCoupon
sumPayPrice
(
@Param
(
"couponIds"
)
List
<
Long
>
ids
);
List
<
SConsumerCoupon
>
selectByIds
(
@Param
(
"couponIds"
)
List
<
Long
>
ids
);
}
share-system/src/main/java/share/system/request/OrderStatisticsRequest.java
0 → 100644
View file @
5b287dad
package
share
.
system
.
request
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
OrderStatisticsRequest
{
//门店id
private
Long
storeId
;
//开始时间
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
startTime
;
//结束时间
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
endTime
;
}
share-system/src/main/java/share/system/response/OrderStatisticsResponse.java
0 → 100644
View file @
5b287dad
package
share
.
system
.
response
;
import
lombok.Data
;
import
share.system.domain.SOrder
;
import
java.math.BigDecimal
;
import
java.util.List
;
@Data
public
class
OrderStatisticsResponse
{
//累计流水
private
BigDecimal
totalFee
=
BigDecimal
.
ZERO
;
//实际收入
private
BigDecimal
actualFee
=
BigDecimal
.
ZERO
;
//门店交易
private
BigDecimal
storeFee
=
BigDecimal
.
ZERO
;
//门店交易退款
private
BigDecimal
storeRefundFee
=
BigDecimal
.
ZERO
;
//团购金额
private
BigDecimal
groupFee
=
BigDecimal
.
ZERO
;
//团购退款
private
BigDecimal
groupRefundFee
=
BigDecimal
.
ZERO
;
//平台支付
private
BigDecimal
platformFee
=
BigDecimal
.
ZERO
;
//平台退款
private
BigDecimal
platformRefundFee
=
BigDecimal
.
ZERO
;
//用户充值
private
BigDecimal
rechargeFee
=
BigDecimal
.
ZERO
;
//用户充值退款
private
BigDecimal
rechargeRefundFee
=
BigDecimal
.
ZERO
;
//充值余额支付
private
BigDecimal
rechargeBalance
=
BigDecimal
.
ZERO
;
//充值余额退款
private
BigDecimal
rechargeBalanceRefundFee
=
BigDecimal
.
ZERO
;
//其他消费
private
BigDecimal
otherFee
=
BigDecimal
.
ZERO
;
//其他退款
private
BigDecimal
otherRefundFee
=
BigDecimal
.
ZERO
;
//美团团购金额
private
BigDecimal
meituanFee
=
BigDecimal
.
ZERO
;
//美团团购退款
private
BigDecimal
meituanRefundFee
=
BigDecimal
.
ZERO
;
//抖音团购金额
private
BigDecimal
douyinFee
=
BigDecimal
.
ZERO
;
//抖音团购退款
private
BigDecimal
douyinRefundFee
=
BigDecimal
.
ZERO
;
//积分消费
private
BigDecimal
integralFee
=
BigDecimal
.
ZERO
;
//积分退款
private
BigDecimal
integralRefundFee
=
BigDecimal
.
ZERO
;
//订单集合
private
List
<
SOrder
>
orderList
;
}
share-system/src/main/java/share/system/service/ISConsumerCouponService.java
View file @
5b287dad
...
...
@@ -95,4 +95,6 @@ public interface ISConsumerCouponService extends IService<SConsumerCoupon>
List
<
SConsumerCoupon
>
selectOrderList
();
SConsumerCoupon
sumPayPrice
(
List
<
Long
>
ids
);
List
<
SConsumerCoupon
>
selectByIds
(
List
<
Long
>
ids
);
}
share-system/src/main/java/share/system/service/ISOrderService.java
View file @
5b287dad
...
...
@@ -8,12 +8,10 @@ import share.system.domain.SOrder;
import
share.system.domain.vo.SOrderDto
;
import
share.system.domain.vo.SOrderVo
;
import
share.system.domain.vo.SRoomVo
;
import
share.system.request.AdminRefundRequest
;
import
share.system.request.CreateOrderRequest
;
import
share.system.request.OrderComputedPriceRequest
;
import
share.system.request.OrderRefundRequest
;
import
share.system.request.*
;
import
share.system.response.ComputedOrderPriceResponse
;
import
share.system.response.OrderPayResultResponse
;
import
share.system.response.OrderStatisticsResponse
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -216,7 +214,7 @@ public interface ISOrderService extends IService<SOrder>
List
<
SOrder
>
selectSOrderByStoreIdAndMaxTime
(
SOrder
orderQuery
);
O
bject
statistics
(
);
O
rderStatisticsResponse
statistics
(
OrderStatisticsRequest
request
);
List
<
Long
>
couponIds
(
SOrder
sOrder
);
...
...
share-system/src/main/java/share/system/service/ISStoreService.java
View file @
5b287dad
...
...
@@ -115,4 +115,6 @@ public interface ISStoreService extends IService<SStore>
List
<
SStore
>
storeNameByIds
(
List
<
Long
>
ids
);
List
<
SStore
>
manageList
();
}
share-system/src/main/java/share/system/service/impl/OrderRefundServiceImpl.java
View file @
5b287dad
...
...
@@ -157,6 +157,20 @@ public class OrderRefundServiceImpl extends ServiceImpl<SOrderMapper, SOrder> im
}
}
// private boolean rechargeRefundSaobei(OrderRefundRequest request, Recharge recharge){
// WechatPayInfo wechatPayInfo = wechatPayInfoService.getByNo(recharge.getTerminalTrace());
// if (ObjectUtil.isNull(wechatPayInfo)) {
// throw new BaseException("微信订单不存在!");
// }
// SaobeiRefundVo vo = new SaobeiRefundVo();
// vo.setRefund_fee(String.valueOf(request.getAmount().multiply(BigDecimal.TEN).multiply(BigDecimal.TEN).intValue()));
// vo.setTerminal_trace(BaseUtil.getOrderNo("WXNO"));
// vo.setTerminal_time(DateUtil.nowDate(Constants.DATE_TIME_FORMAT_NUM));
// vo.setOut_trade_no(wechatPayInfo.getTransactionId());
// SaobeiTradeRefundResponse response = saobeiService.refund(vo);
// return ObjectUtil.isNotEmpty(response);
// }
/**
* 扫呗退款-微信(人工退款)
* @param request
...
...
share-system/src/main/java/share/system/service/impl/SConsumerCouponServiceImpl.java
View file @
5b287dad
...
...
@@ -610,6 +610,11 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
return
baseMapper
.
sumPayPrice
(
ids
);
}
@Override
public
List
<
SConsumerCoupon
>
selectByIds
(
List
<
Long
>
ids
)
{
return
baseMapper
.
selectByIds
(
ids
);
}
private
void
extracted
(
SConsumerCoupon
item
,
BigDecimal
bigDecimal
,
SRoom
byId
,
BigDecimal
subtract
,
SStore
sStore
)
{
//计算价格
BigDecimal
multiply
=
bigDecimal
.
multiply
(
byId
.
getPrice
());
...
...
share-system/src/main/java/share/system/service/impl/SConsumerServiceImpl.java
View file @
5b287dad
...
...
@@ -246,6 +246,12 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
}
else
{
vo
.
setIsAdmin
(
true
);
}
List
<
Long
>
managerList
=
storeConsumerMapper
.
selectByConsumerId
(
currentUser
.
getId
(),
PositionEnum
.
MANAGE
.
getCode
());
if
(
CollectionUtils
.
isEmpty
(
managerList
))
{
vo
.
setIsManage
(
false
);
}
else
{
vo
.
setIsManage
(
true
);
}
if
(
ObjectUtil
.
isNull
(
currentUser
))
{
throw
new
BaseException
(
"您的登录已过期,请先登录"
);
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
5b287dad
package
share
.
system
.
service
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUnit
;
import
cn.hutool.core.util.ObjectUtil
;
...
...
@@ -43,12 +44,10 @@ import share.system.domain.*;
import
share.system.domain.vo.*
;
import
share.system.mapper.SOrderMapper
;
import
share.system.mapper.SStoreConsumerMapper
;
import
share.system.request.AdminRefundRequest
;
import
share.system.request.CreateOrderRequest
;
import
share.system.request.OrderComputedPriceRequest
;
import
share.system.request.OrderRefundRequest
;
import
share.system.request.*
;
import
share.system.response.ComputedOrderPriceResponse
;
import
share.system.response.OrderPayResultResponse
;
import
share.system.response.OrderStatisticsResponse
;
import
share.system.service.*
;
import
javax.annotation.Resource
;
...
...
@@ -169,6 +168,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
@Autowired
private
MemberProgressLogService
memberProgressLogService
;
@Autowired
private
RechargeService
rechargeService
;
private
final
static
Long
FIVE
=
5L
;
...
...
@@ -1820,7 +1822,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
// @Transactional(rollbackFor = Exception.class)
@Override
public
void
paymentSuccessful
(
SOrder
sOrder
)
{
unLockOrder
(
sOrder
.
getRoomId
());
ConsumerWallet
consumerWallet
=
consumerWalletService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerWallet
>().
eq
(
ConsumerWallet:
:
getConsumerId
,
sOrder
.
getConsumerId
()));
ConsumerMember
consumerMember
=
consumerMemberService
.
getOne
(
new
LambdaQueryWrapper
<
ConsumerMember
>().
eq
(
ConsumerMember:
:
getConsumerId
,
sOrder
.
getConsumerId
()));
logger
.
debug
(
"订单查询预约时间是否干涉"
);
...
...
@@ -1915,6 +1917,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
creatExtracted
(
consumerWallet
,
sOrder
,
consumerMember
);
baseMapper
.
updateSOrder
(
sOrder
);
unLockOrder
(
sOrder
.
getRoomId
());
if
(
sOrder
.
getOrderType
().
equals
(
OrderTypeEnum
.
RENEW
.
getCode
()))
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"orderNo"
,
sOrder
.
getOrderNo
());
...
...
@@ -2556,13 +2559,13 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
ExecutionTime
executionTime
=
ExecutionTime
.
forCron
(
cron
);
boolean
match
=
executionTime
.
isMatch
(
ZonedDateTime
.
ofInstant
(
request
.
getPreStartDate
().
toInstant
(),
ZoneId
.
systemDefault
()));
boolean
match1
=
executionTime
.
isMatch
(
ZonedDateTime
.
ofInstant
(
request
.
getPreEndDate
().
toInstant
(),
ZoneId
.
systemDefault
()));
if
(
match
&&
match1
)
{
if
(
match
&&
match1
&&
priceResponse
.
getDiscount
().
compareTo
(
activity
.
getDiscountRatio
())
==
0
)
{
if
(
consumerWallet
.
getBalance
().
compareTo
(
totalFee
)
>=
0
)
{
priceResponse
.
setBalance
(
totalFee
);
priceResponse
.
setRemainingBalance
(
consumerWallet
.
getBalance
().
subtract
(
totalFee
));
priceResponse
.
setTotalFeeNow
(
totalFee
);
priceResponse
.
setMemberDiscount
(
totalFee
);
priceResponse
.
setDiscount
(
BigDecimal
.
ZERO
);
//
priceResponse.setDiscount(BigDecimal.ZERO);
totalFee
=
new
BigDecimal
(
0
);
}
else
if
(
consumerWallet
.
getBalance
().
compareTo
(
totalFee
)
<
0
)
{
priceResponse
.
setTotalFeeNow
(
totalFee
);
...
...
@@ -2645,12 +2648,12 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
ExecutionTime
executionTime
=
ExecutionTime
.
forCron
(
cron
);
boolean
match
=
executionTime
.
isMatch
(
ZonedDateTime
.
ofInstant
(
request
.
getPreStartDate
().
toInstant
(),
ZoneId
.
systemDefault
()));
boolean
match1
=
executionTime
.
isMatch
(
ZonedDateTime
.
ofInstant
(
request
.
getPreEndDate
().
toInstant
(),
ZoneId
.
systemDefault
()));
if
(
match
&&
match1
)
{
if
(
match
&&
match1
&&
priceResponse
.
getDiscount
().
compareTo
(
activity
.
getDiscountRatio
())
==
0
)
{
if
(
consumerWallet
.
getBalance
().
compareTo
(
totalFee
)
>=
0
)
{
priceResponse
.
setTotalFeeNow
(
totalFee
);
priceResponse
.
setMemberDiscount
(
totalFee
);
priceResponse
.
setBalance
(
totalFee
);
priceResponse
.
setDiscount
(
BigDecimal
.
ZERO
);
//
priceResponse.setDiscount(BigDecimal.ZERO);
priceResponse
.
setRemainingBalance
(
consumerWallet
.
getBalance
().
subtract
(
totalFee
));
totalFee
=
new
BigDecimal
(
0
);
}
else
if
(
consumerWallet
.
getBalance
().
compareTo
(
totalFee
)
<
0
)
{
...
...
@@ -2902,8 +2905,113 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
@Override
public
Object
statistics
()
{
return
null
;
public
OrderStatisticsResponse
statistics
(
OrderStatisticsRequest
request
)
{
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
if
(!
user
.
getRoleType
().
equals
(
RoleTypeEnum
.
CLEANER
.
getCode
()))
{
throw
new
RuntimeException
(
"当前用户不是店员"
);
}
List
<
Long
>
longs
=
storeConsumerMapper
.
selectByConsumerId
(
user
.
getId
(),
PositionEnum
.
MANAGE
.
getCode
());
if
(
CollectionUtils
.
isEmpty
(
longs
))
{
throw
new
RuntimeException
(
"当前用户不是门店管理人员"
);
}
//判断longs是否包含request.getStoreId()
if
(!
longs
.
contains
(
request
.
getStoreId
()))
{
throw
new
RuntimeException
(
"当前用户不是该门店管理人员"
);
}
List
<
Recharge
>
rechargeList
=
rechargeService
.
list
(
new
LambdaQueryWrapper
<
Recharge
>()
.
ge
(
Recharge:
:
getCreateTime
,
request
.
getStartTime
())
.
le
(
Recharge:
:
getCreateTime
,
request
.
getEndTime
())
.
eq
(
Recharge:
:
getStatus
,
YesNoEnum
.
yes
.
getIndex
())
);
Map
<
Long
,
SCoupon
>
sCouponMap
=
sCouponService
.
list
().
stream
().
collect
(
Collectors
.
toMap
(
SCoupon:
:
getId
,
Function
.
identity
()));
BigDecimal
rechargeAmount
=
rechargeList
.
stream
().
map
(
Recharge:
:
getRechargeAmount
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
OrderStatisticsResponse
statisticsResponse
=
new
OrderStatisticsResponse
();
Map
<
Long
,
SConsumerCoupon
>
map
=
new
HashMap
<>();
List
<
SOrder
>
orderList
=
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
SOrder
>()
.
eq
(
SOrder:
:
getStoreId
,
request
.
getStoreId
())
.
eq
(
SOrder:
:
getIsDelete
,
YesNoEnum
.
no
.
getIndex
())
.
eq
(
SOrder:
:
getPayStatus
,
YesNoEnum
.
yes
.
getIndex
())
.
ge
(
SOrder:
:
getCreateTime
,
request
.
getStartTime
())
.
le
(
SOrder:
:
getCreateTime
,
request
.
getEndTime
())
.
orderByDesc
(
SOrder:
:
getCreateTime
)
);
//优惠券id集合,去掉为null的
List
<
Long
>
ids
=
orderList
.
stream
().
map
(
SOrder:
:
getCouponId
).
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
ids
))
{
map
.
putAll
(
consumerCouponService
.
selectByIds
(
ids
).
stream
().
collect
(
Collectors
.
toMap
(
SConsumerCoupon:
:
getId
,
Function
.
identity
())));
}
orderList
.
stream
().
forEach
(
order
->
{
if
(
order
.
getStatus
().
equals
(
OrderStatusEnum
.
CANCEL
.
getCode
())
&&
order
.
getRefundStatus
().
equals
(
RefundStatusEnum
.
REFUNDED
.
getCode
()))
{
if
(!
map
.
isEmpty
())
{
if
(
ObjectUtil
.
isNotEmpty
(
order
.
getCouponId
()))
{
SConsumerCoupon
sConsumerCoupon
=
map
.
get
(
order
.
getCouponId
());
if
(
ObjectUtil
.
isEmpty
(
sConsumerCoupon
))
{
return
;
}
if
(
sConsumerCoupon
.
getCouponType
().
equals
(
CouponTypeEnum
.
CASH
.
getCode
()))
{
if
(
sConsumerCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
MEITUAN
.
getCode
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
sConsumerCoupon
.
getCouponPayPrice
()))
{
statisticsResponse
.
setMeituanRefundFee
(
statisticsResponse
.
getMeituanRefundFee
().
add
(
sConsumerCoupon
.
getCouponPayPrice
()));
}
else
{
SCoupon
sCoupon
=
sCouponMap
.
get
(
sConsumerCoupon
.
getCouponId
());
statisticsResponse
.
setMeituanRefundFee
(
statisticsResponse
.
getMeituanRefundFee
().
add
(
sCoupon
.
getCouponPayPrice
()));
}
}
else
if
(
sConsumerCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
TIKTOK
.
getCode
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
sConsumerCoupon
.
getCouponPayPrice
()))
{
statisticsResponse
.
setDouyinRefundFee
(
statisticsResponse
.
getDouyinRefundFee
().
add
(
sConsumerCoupon
.
getCouponPayPrice
()));
}
else
{
SCoupon
sCoupon
=
sCouponMap
.
get
(
sConsumerCoupon
.
getCouponId
());
statisticsResponse
.
setDouyinRefundFee
(
statisticsResponse
.
getDouyinRefundFee
().
add
(
sCoupon
.
getCouponPayPrice
()));
}
}
}
}
}
statisticsResponse
.
setPlatformRefundFee
(
statisticsResponse
.
getPlatformRefundFee
().
add
(
order
.
getPayPrice
()));
statisticsResponse
.
setRechargeBalanceRefundFee
(
statisticsResponse
.
getRechargeBalanceRefundFee
().
add
(
order
.
getBalance
()));
}
else
{
statisticsResponse
.
setPlatformFee
(
statisticsResponse
.
getPlatformFee
().
add
(
order
.
getPayPrice
()));
statisticsResponse
.
setRechargeBalance
(
statisticsResponse
.
getRechargeBalance
().
add
(
order
.
getBalance
()));
if
(!
map
.
isEmpty
())
{
if
(
ObjectUtil
.
isNotEmpty
(
order
.
getCouponId
()))
{
SConsumerCoupon
sConsumerCoupon
=
map
.
get
(
order
.
getCouponId
());
if
(
sConsumerCoupon
.
getCouponType
().
equals
(
CouponTypeEnum
.
CASH
.
getCode
()))
{
if
(
sConsumerCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
MEITUAN
.
getCode
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
sConsumerCoupon
.
getCouponPayPrice
()))
{
statisticsResponse
.
setMeituanFee
(
statisticsResponse
.
getMeituanFee
().
add
(
sConsumerCoupon
.
getCouponPayPrice
()));
}
else
{
SCoupon
sCoupon
=
sCouponMap
.
get
(
sConsumerCoupon
.
getCouponId
());
statisticsResponse
.
setMeituanFee
(
statisticsResponse
.
getMeituanFee
().
add
(
sCoupon
.
getCouponPayPrice
()));
}
}
else
if
(
sConsumerCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
TIKTOK
.
getCode
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
sConsumerCoupon
.
getCouponPayPrice
()))
{
statisticsResponse
.
setDouyinFee
(
statisticsResponse
.
getDouyinFee
().
add
(
sConsumerCoupon
.
getCouponPayPrice
()));
}
else
{
SCoupon
sCoupon
=
sCouponMap
.
get
(
sConsumerCoupon
.
getCouponId
());
statisticsResponse
.
setDouyinFee
(
statisticsResponse
.
getDouyinFee
().
add
(
sCoupon
.
getCouponPayPrice
()));
}
}
}
}
}
}
});
//用户充值
statisticsResponse
.
setRechargeFee
(
rechargeAmount
);
//美团团购金额+抖音团购金额
statisticsResponse
.
setGroupFee
(
statisticsResponse
.
getMeituanFee
().
add
(
statisticsResponse
.
getDouyinFee
()));
//美团团购退款+抖音团购退款
statisticsResponse
.
setGroupRefundFee
(
statisticsResponse
.
getMeituanRefundFee
().
add
(
statisticsResponse
.
getDouyinRefundFee
()));
//团购金额+平台支付
statisticsResponse
.
setStoreFee
(
statisticsResponse
.
getGroupFee
().
add
(
statisticsResponse
.
getPlatformFee
()));
//团购退款+平台退款
statisticsResponse
.
setStoreRefundFee
(
statisticsResponse
.
getGroupRefundFee
().
add
(
statisticsResponse
.
getPlatformRefundFee
()));
//团购金额+平台支付
statisticsResponse
.
setTotalFee
(
statisticsResponse
.
getGroupFee
().
add
(
statisticsResponse
.
getPlatformFee
()));
//门店交易-门店交易退款
statisticsResponse
.
setActualFee
(
statisticsResponse
.
getStoreFee
().
subtract
(
statisticsResponse
.
getStoreRefundFee
()));
statisticsResponse
.
setOrderList
(
orderList
);
return
statisticsResponse
;
}
@Override
...
...
share-system/src/main/java/share/system/service/impl/SStoreServiceImpl.java
View file @
5b287dad
...
...
@@ -376,6 +376,19 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
return
this
.
list
(
queryWrapper
);
}
@Override
public
List
<
SStore
>
manageList
()
{
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
if
(!
user
.
getRoleType
().
equals
(
RoleTypeEnum
.
CLEANER
.
getCode
()))
{
throw
new
BaseException
(
"当前用户不是店员!"
);
}
List
<
Long
>
storeIdList
=
storeConsumerMapper
.
selectByConsumerId
(
user
.
getId
(),
PositionEnum
.
MANAGE
.
getCode
());
if
(
CollectionUtils
.
isEmpty
(
storeIdList
))
{
throw
new
RuntimeException
(
"当前用户不是门店管理人员"
);
}
return
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
SStore
>().
in
(
SStore:
:
getId
,
storeIdList
));
}
/**
* 门店DO集合转换VO集合,按距离排序
*
...
...
share-system/src/main/resources/mapper/system/SConsumerCouponMapper.xml
View file @
5b287dad
...
...
@@ -181,6 +181,13 @@
#{id}
</foreach>
</select>
<select
id=
"selectByIds"
resultType=
"share.system.domain.SConsumerCoupon"
>
<include
refid=
"selectSConsumerCouponVo"
/>
where id in
<foreach
item=
"id"
collection=
"couponIds"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</select>
<insert
id=
"insertSConsumerCoupon"
parameterType=
"SConsumerCoupon"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into s_consumer_coupon
...
...
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