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
2feb3817
Commit
2feb3817
authored
Jul 19, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化订单查询接口
parent
8187d59e
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
354 additions
and
123 deletions
+354
-123
SOrderController.java
...in/java/share/web/controller/system/SOrderController.java
+4
-1
logback.xml
share-admin/src/main/resources/logback.xml
+2
-2
logback.xml
share-front/src/main/resources/logback.xml
+2
-2
SConsumerCouponMapper.java
.../main/java/share/system/mapper/SConsumerCouponMapper.java
+2
-0
SOrderMapper.java
...ystem/src/main/java/share/system/mapper/SOrderMapper.java
+5
-0
IPackService.java
...stem/src/main/java/share/system/service/IPackService.java
+4
-2
ISConsumerCouponService.java
...in/java/share/system/service/ISConsumerCouponService.java
+4
-0
ISOrderService.java
...em/src/main/java/share/system/service/ISOrderService.java
+1
-1
ISRoomService.java
...tem/src/main/java/share/system/service/ISRoomService.java
+2
-0
ISStoreService.java
...em/src/main/java/share/system/service/ISStoreService.java
+2
-0
PackServiceImpl.java
.../main/java/share/system/service/impl/PackServiceImpl.java
+16
-7
SConsumerCouponServiceImpl.java
...share/system/service/impl/SConsumerCouponServiceImpl.java
+16
-0
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+136
-108
SRoomServiceImpl.java
...main/java/share/system/service/impl/SRoomServiceImpl.java
+10
-0
SStoreServiceImpl.java
...ain/java/share/system/service/impl/SStoreServiceImpl.java
+10
-0
SConsumerCouponMapper.xml
...rc/main/resources/mapper/system/SConsumerCouponMapper.xml
+8
-0
SOrderMapper.xml
...-system/src/main/resources/mapper/system/SOrderMapper.xml
+130
-0
No files found.
share-admin/src/main/java/share/web/controller/system/SOrderController.java
View file @
2feb3817
...
@@ -43,7 +43,10 @@ public class SOrderController extends BaseController
...
@@ -43,7 +43,10 @@ public class SOrderController extends BaseController
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfoVo
list
(
SOrder
sOrder
)
public
TableDataInfoVo
list
(
SOrder
sOrder
)
{
{
return
sOrderService
.
pageList
(
sOrder
);
startPage
();
List
<
SOrder
>
list
=
sOrderService
.
selectSOrderList
(
sOrder
);
TableDataInfo
dataTable
=
getDataTable
(
list
);
return
sOrderService
.
pageList
(
dataTable
,
sOrder
);
}
}
@GetMapping
(
"/queryList"
)
@GetMapping
(
"/queryList"
)
...
...
share-admin/src/main/resources/logback.xml
View file @
2feb3817
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<configuration>
<!-- 日志存放路径 -->
<!-- 日志存放路径 -->
<property
name=
"log.path"
value=
"
/Users/liwenjun/logs/share"
/>
<property
name=
"log.path"
value=
"
/var/gxpt/logs/admin"
/>
<!-- 日志输出格式 -->
<!-- 日志输出格式 -->
<property
name=
"log.pattern"
value=
"%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"
/>
<property
name=
"log.pattern"
value=
"%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"
/>
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
</encoder>
</encoder>
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<!-- 过滤的级别 -->
<!-- 过滤的级别 -->
<level>
INFO
</level>
<level>
DEBUG
</level>
<!-- 匹配时的操作:接收(记录) -->
<!-- 匹配时的操作:接收(记录) -->
<onMatch>
ACCEPT
</onMatch>
<onMatch>
ACCEPT
</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<!-- 不匹配时的操作:拒绝(不记录) -->
...
...
share-front/src/main/resources/logback.xml
View file @
2feb3817
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<configuration>
<!-- 日志存放路径 -->
<!-- 日志存放路径 -->
<property
name=
"log.path"
value=
"/home/gxpt/logs"
/>
<property
name=
"log.path"
value=
"/var/gxpt/logs/front"
/>
<!-- 日志输出格式 -->
<!-- 日志输出格式 -->
<property
name=
"log.pattern"
value=
"%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"
/>
<property
name=
"log.pattern"
value=
"%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"
/>
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
</encoder>
</encoder>
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<!-- 过滤的级别 -->
<!-- 过滤的级别 -->
<level>
INFO
</level>
<level>
DEBUG
</level>
<!-- 匹配时的操作:接收(记录) -->
<!-- 匹配时的操作:接收(记录) -->
<onMatch>
ACCEPT
</onMatch>
<onMatch>
ACCEPT
</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<!-- 不匹配时的操作:拒绝(不记录) -->
...
...
share-system/src/main/java/share/system/mapper/SConsumerCouponMapper.java
View file @
2feb3817
...
@@ -73,4 +73,6 @@ public interface SConsumerCouponMapper extends BaseMapper<SConsumerCoupon>
...
@@ -73,4 +73,6 @@ public interface SConsumerCouponMapper extends BaseMapper<SConsumerCoupon>
List
<
SConsumerCoupon
>
queryList
();
List
<
SConsumerCoupon
>
queryList
();
int
removeByIdList
(
@Param
(
"couponIds"
)
List
<
Long
>
expiredCoupons
);
int
removeByIdList
(
@Param
(
"couponIds"
)
List
<
Long
>
expiredCoupons
);
SConsumerCoupon
sumPayPrice
(
@Param
(
"couponIds"
)
List
<
Long
>
ids
);
}
}
share-system/src/main/java/share/system/mapper/SOrderMapper.java
View file @
2feb3817
...
@@ -3,6 +3,7 @@ package share.system.mapper;
...
@@ -3,6 +3,7 @@ package share.system.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
share.system.domain.SOrder
;
import
share.system.domain.SOrder
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -70,4 +71,8 @@ public interface SOrderMapper extends BaseMapper<SOrder>
...
@@ -70,4 +71,8 @@ public interface SOrderMapper extends BaseMapper<SOrder>
List
<
SOrder
>
selectSOrderByMaxTime
(
SOrder
order
);
List
<
SOrder
>
selectSOrderByMaxTime
(
SOrder
order
);
List
<
SOrder
>
selectSOrderByStoreIdAndMaxTime
(
SOrder
order
);
List
<
SOrder
>
selectSOrderByStoreIdAndMaxTime
(
SOrder
order
);
HashMap
<
String
,
Object
>
sumPrice
(
SOrder
sOrder
);
List
<
Long
>
couponIds
(
SOrder
sOrder
);
}
}
share-system/src/main/java/share/system/service/IPackService.java
View file @
2feb3817
package
share
.
system
.
service
;
package
share
.
system
.
service
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.system.domain.SPack
;
import
share.system.domain.SPack
;
import
java.util.List
;
/**
/**
* 套餐Service接口
* 套餐Service接口
*
*
...
@@ -65,4 +65,6 @@ public interface IPackService extends IService<SPack> {
...
@@ -65,4 +65,6 @@ public interface IPackService extends IService<SPack> {
Long
addPack
(
SPack
sPack
);
Long
addPack
(
SPack
sPack
);
List
<
SPack
>
pageList
(
SPack
sPack
);
List
<
SPack
>
pageList
(
SPack
sPack
);
List
<
SPack
>
packNameByIds
(
List
<
Long
>
longs
);
}
}
share-system/src/main/java/share/system/service/ISConsumerCouponService.java
View file @
2feb3817
...
@@ -89,4 +89,8 @@ public interface ISConsumerCouponService extends IService<SConsumerCoupon>
...
@@ -89,4 +89,8 @@ public interface ISConsumerCouponService extends IService<SConsumerCoupon>
int
removeByIdList
(
List
<
Long
>
expiredCoupons
);
int
removeByIdList
(
List
<
Long
>
expiredCoupons
);
SConsumerCoupon
selectSConsumerCouponByCode
(
String
code
);
SConsumerCoupon
selectSConsumerCouponByCode
(
String
code
);
SConsumerCoupon
sumPayPrice
(
List
<
Long
>
couponIds
);
List
<
SConsumerCoupon
>
couponNameByIds
(
List
<
Long
>
longs
);
}
}
share-system/src/main/java/share/system/service/ISOrderService.java
View file @
2feb3817
...
@@ -194,7 +194,7 @@ public interface ISOrderService extends IService<SOrder>
...
@@ -194,7 +194,7 @@ public interface ISOrderService extends IService<SOrder>
int
modifyOrder
(
SOrderDto
sOrderDto
);
int
modifyOrder
(
SOrderDto
sOrderDto
);
TableDataInfoVo
pageList
(
SOrder
sOrder
);
TableDataInfoVo
pageList
(
TableDataInfo
dataTable
,
SOrder
sOrder
);
/**
/**
* 订单退款(人工退款)
* 订单退款(人工退款)
...
...
share-system/src/main/java/share/system/service/ISRoomService.java
View file @
2feb3817
...
@@ -108,4 +108,6 @@ public interface ISRoomService extends IService<SRoom>
...
@@ -108,4 +108,6 @@ public interface ISRoomService extends IService<SRoom>
List
<
SRoom
>
selectByStoreIds
(
List
<
Long
>
storeIds
);
List
<
SRoom
>
selectByStoreIds
(
List
<
Long
>
storeIds
);
List
<
SRoomVo
>
convertDoListToVoList
(
List
<
SRoom
>
roomList
);
List
<
SRoomVo
>
convertDoListToVoList
(
List
<
SRoom
>
roomList
);
List
<
SRoom
>
roomNameByIds
(
List
<
Long
>
longs
);
}
}
share-system/src/main/java/share/system/service/ISStoreService.java
View file @
2feb3817
...
@@ -112,4 +112,6 @@ public interface ISStoreService extends IService<SStore>
...
@@ -112,4 +112,6 @@ public interface ISStoreService extends IService<SStore>
int
updateStoreConsumers
(
SStoreConsumerVo
storeConsumer
);
int
updateStoreConsumers
(
SStoreConsumerVo
storeConsumer
);
SConsumerVo
queryBySStoreConsumer
(
SStoreConsumerVo
dto
);
SConsumerVo
queryBySStoreConsumer
(
SStoreConsumerVo
dto
);
List
<
SStore
>
storeNameByIds
(
List
<
Long
>
longs
);
}
}
share-system/src/main/java/share/system/service/impl/PackServiceImpl.java
View file @
2feb3817
package
share
.
system
.
service
.
impl
;
package
share
.
system
.
service
.
impl
;
import
java.util.*
;
import
java.util.Arrays
;
import
java.util.stream.Collectors
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
share.common.enums.YesNoEnum
;
import
share.common.enums.YesNoEnum
;
import
share.common.exception.base.BaseException
;
import
share.common.exception.base.BaseException
;
import
share.common.utils.DateUtils
;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SOrder
;
import
share.system.domain.SOrder
;
import
share.system.mapper.PackMapper
;
import
share.system.domain.SPack
;
import
share.system.domain.SPack
;
import
share.system.mapper.PackMapper
;
import
share.system.service.IPackService
;
import
share.system.service.IPackService
;
import
share.system.service.ISOrderService
;
import
share.system.service.ISOrderService
;
import
share.system.service.SConsumerService
;
import
share.system.service.SConsumerService
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
/**
* 套餐Service业务层处理
* 套餐Service业务层处理
*
*
...
@@ -158,4 +157,14 @@ public class PackServiceImpl extends ServiceImpl<PackMapper, SPack> implements I
...
@@ -158,4 +157,14 @@ public class PackServiceImpl extends ServiceImpl<PackMapper, SPack> implements I
public
List
<
SPack
>
pageList
(
SPack
sPack
)
{
public
List
<
SPack
>
pageList
(
SPack
sPack
)
{
return
baseMapper
.
selectPackList
(
sPack
);
return
baseMapper
.
selectPackList
(
sPack
);
}
}
@Override
public
List
<
SPack
>
packNameByIds
(
List
<
Long
>
longs
)
{
LambdaQueryWrapper
<
SPack
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
select
(
SPack:
:
getId
,
SPack:
:
getName
);
if
(
org
.
apache
.
commons
.
collections4
.
CollectionUtils
.
isNotEmpty
(
longs
))
{
queryWrapper
.
in
(
SPack:
:
getId
,
longs
);
}
return
this
.
list
(
queryWrapper
);
}
}
}
share-system/src/main/java/share/system/service/impl/SConsumerCouponServiceImpl.java
View file @
2feb3817
...
@@ -574,6 +574,22 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
...
@@ -574,6 +574,22 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
return
baseMapper
.
selectOne
(
new
LambdaQueryWrapper
<>(
SConsumerCoupon
.
class
).
eq
(
SConsumerCoupon:
:
getCouponCode
,
code
));
return
baseMapper
.
selectOne
(
new
LambdaQueryWrapper
<>(
SConsumerCoupon
.
class
).
eq
(
SConsumerCoupon:
:
getCouponCode
,
code
));
}
}
@Override
public
SConsumerCoupon
sumPayPrice
(
List
<
Long
>
couponIds
)
{
return
baseMapper
.
sumPayPrice
(
couponIds
);
}
@Override
public
List
<
SConsumerCoupon
>
couponNameByIds
(
List
<
Long
>
longs
)
{
LambdaQueryWrapper
<
SConsumerCoupon
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
select
(
SConsumerCoupon:
:
getId
,
SConsumerCoupon:
:
getName
,
SConsumerCoupon:
:
getCouponPayPrice
,
SConsumerCoupon:
:
getPlatformType
,
SConsumerCoupon:
:
getDealgroupId
,
SConsumerCoupon:
:
getTiktokSkuId
);
if
(
org
.
apache
.
commons
.
collections4
.
CollectionUtils
.
isNotEmpty
(
longs
))
{
queryWrapper
.
in
(
SConsumerCoupon:
:
getId
,
longs
);
}
return
this
.
list
(
queryWrapper
);
}
private
void
extracted
(
SConsumerCoupon
item
,
BigDecimal
bigDecimal
,
SRoom
byId
,
BigDecimal
subtract
,
SStore
sStore
)
{
private
void
extracted
(
SConsumerCoupon
item
,
BigDecimal
bigDecimal
,
SRoom
byId
,
BigDecimal
subtract
,
SStore
sStore
)
{
//计算价格
//计算价格
BigDecimal
multiply
=
bigDecimal
.
multiply
(
byId
.
getPrice
());
BigDecimal
multiply
=
bigDecimal
.
multiply
(
byId
.
getPrice
());
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
2feb3817
...
@@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
...
@@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
share.common.constant.Constants
;
import
share.common.constant.Constants
;
import
share.common.constant.HttpStatus
;
import
share.common.core.page.PageDomain
;
import
share.common.core.page.PageDomain
;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.page.TableSupport
;
import
share.common.core.page.TableSupport
;
...
@@ -47,6 +48,7 @@ import share.system.service.*;
...
@@ -47,6 +48,7 @@ import share.system.service.*;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -309,60 +311,49 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -309,60 +311,49 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
return
baseMapper
.
updateSOrder
(
sOrder
);
return
baseMapper
.
updateSOrder
(
sOrder
);
}
}
@Override
public
TableDataInfoVo
pageList
(
TableDataInfo
dataTable
,
SOrder
sOrder
)
{
public
TableDataInfoVo
pageList
(
SOrder
sOrder
)
{
List
<
SOrder
>
list
=
(
List
<
SOrder
>)
dataTable
.
getRows
();
List
<
SOrder
>
sOrders
=
selectSOrderList
(
sOrder
);
TableDataInfoVo
tableDataInfo
=
new
TableDataInfoVo
();
List
<
SOrderVo
>
sOrderVos
=
convertDosToVos
(
sOrders
);
tableDataInfo
.
setCode
(
HttpStatus
.
SUCCESS
);
BigDecimal
totalAmount
=
new
BigDecimal
(
"0.00"
);
tableDataInfo
.
setMsg
(
"查询成功"
);
BigDecimal
amount
=
new
BigDecimal
(
"0.00"
);
tableDataInfo
.
setTotal
(
dataTable
.
getTotal
());
//优惠卷售卖总金额
List
<
SOrderVo
>
sOrderVos
=
convertDosToVos
(
list
);
final
BigDecimal
[]
totalSalesAmount
=
{
new
BigDecimal
(
"0.00"
)};
HashMap
<
String
,
Object
>
summedPrice
=
baseMapper
.
sumPrice
(
sOrder
);
//申请退款总金额
Map
<
Long
,
SConsumerCoupon
>
couponMap
=
consumerCouponService
.
listByIds
(
sOrderVos
.
stream
().
map
(
SOrderVo:
:
getCouponId
).
collect
(
Collectors
.
toList
()))
BigDecimal
totalRefundAmount
=
new
BigDecimal
(
"0.00"
);
.
stream
().
collect
(
Collectors
.
toMap
(
SConsumerCoupon:
:
getId
,
s
->
s
));
//实际退款总金额
List
<
Long
>
couponIds
=
couponIds
(
sOrder
);
BigDecimal
totalRealRefundAmount
=
new
BigDecimal
(
"0.00"
);
SConsumerCoupon
sConsumerCoupon
=
consumerCouponService
.
sumPayPrice
(
couponIds
);
List
<
SConsumerCoupon
>
sConsumerCoupons
=
consumerCouponService
.
queryList
();
if
(
CollectionUtils
.
isNotEmpty
(
sOrderVos
))
{
if
(
CollectionUtils
.
isNotEmpty
(
sOrderVos
))
{
for
(
SOrderVo
item
:
sOrderVos
)
{
sOrderVos
.
stream
().
forEach
(
item
->
{
totalAmount
=
totalAmount
.
add
(
item
.
getTotalPrice
());
if
(
Objects
.
nonNull
(
item
.
getCouponId
()))
{
amount
=
amount
.
add
(
item
.
getPayPrice
());
SConsumerCoupon
userCoupon
=
couponMap
.
get
(
item
.
getCouponId
());
sConsumerCoupons
.
stream
().
filter
(
sConsumerCoupon
->
sConsumerCoupon
.
getId
().
equals
(
item
.
getCouponId
())).
findFirst
().
ifPresent
(
sConsumerCoupon
->
{
if
(
userCoupon
!=
null
)
{
item
.
setCouponPayPrice
(
sConsumerCoupon
.
getCouponPayPrice
());
item
.
setCouponPayPrice
(
userCoupon
.
getCouponPayPrice
());
item
.
setPlatformType
(
sConsumerCoupon
.
getPlatformType
());
item
.
setPlatformType
(
userCoupon
.
getPlatformType
());
if
(
sConsumerCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
MEITUAN
.
getCode
()))
{
if
(
userCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
MEITUAN
.
getCode
()))
{
item
.
setCouponSkuId
(
String
.
valueOf
(
sConsumerCoupon
.
getDealgroupId
()));
item
.
setCouponSkuId
(
String
.
valueOf
(
userCoupon
.
getDealgroupId
()));
}
else
if
(
sConsumerCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
TIKTOK
.
getCode
()))
{
}
else
if
(
userCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
TIKTOK
.
getCode
()))
{
item
.
setCouponSkuId
(
String
.
valueOf
(
sConsumerCoupon
.
getTiktokSkuId
()));
item
.
setCouponSkuId
(
String
.
valueOf
(
userCoupon
.
getTiktokSkuId
()));
}
}
}
totalSalesAmount
[
0
]
=
totalSalesAmount
[
0
].
add
(
ObjectUtil
.
isEmpty
(
sConsumerCoupon
.
getCouponPayPrice
())
?
new
BigDecimal
(
"0.00"
)
:
sConsumerCoupon
.
getCouponPayPrice
());
});
if
(
item
.
getPayStatus
().
equals
(
YesNoEnum
.
yes
.
getIndex
())
&&
item
.
getRefundStatus
().
equals
(
RefundStatusEnum
.
REFUNDED
.
getCode
()))
{
totalRefundAmount
=
totalRefundAmount
.
add
(
ObjectUtil
.
isEmpty
(
item
.
getPayPrice
())
?
new
BigDecimal
(
"0.00"
)
:
item
.
getPayPrice
());
totalRealRefundAmount
=
totalRealRefundAmount
.
add
(
ObjectUtil
.
isEmpty
(
item
.
getRefundPrice
())
?
new
BigDecimal
(
"0.00"
)
:
item
.
getRefundPrice
());
}
}
}
}
);
}
}
sOrderVos
.
sort
(
Comparator
.
comparing
(
SOrderVo:
:
getCreateTime
).
reversed
());
sOrderVos
.
sort
(
Comparator
.
comparing
(
SOrderVo:
:
getCreateTime
).
reversed
());
PageDomain
pageDomain
=
TableSupport
.
buildPageRequest
();
tableDataInfo
.
setRows
(
sOrderVos
);
Integer
pageNum
=
pageDomain
.
getPageNum
();
tableDataInfo
.
setTotalAmount
((
BigDecimal
)
summedPrice
.
get
(
"totalPrice"
));
Integer
pageSize
=
pageDomain
.
getPageSize
();
tableDataInfo
.
setAmount
((
BigDecimal
)
summedPrice
.
get
(
"payPrice"
));
int
start
=
(
pageNum
-
1
)
*
pageSize
;
tableDataInfo
.
setTotalSalesAmount
(
sConsumerCoupon
.
getCouponPayPrice
());
int
end
=
Math
.
min
(
start
+
pageSize
,
sOrderVos
.
size
());
tableDataInfo
.
setTotalRefundAmount
((
BigDecimal
)
summedPrice
.
get
(
"totalRealRefundAmount"
));
List
<
SOrderVo
>
pagedList
=
sOrderVos
.
subList
(
start
,
end
);
tableDataInfo
.
setTotalRealRefundAmount
((
BigDecimal
)
summedPrice
.
get
(
"refundPrice"
));
TableDataInfoVo
tableDataInfo
=
new
TableDataInfoVo
();
tableDataInfo
.
setRows
(
pagedList
);
tableDataInfo
.
setTotal
(
sOrderVos
.
size
());
tableDataInfo
.
setCode
(
200
);
tableDataInfo
.
setMsg
(
"查询成功"
);
tableDataInfo
.
setTotalAmount
(
totalAmount
);
tableDataInfo
.
setAmount
(
amount
);
tableDataInfo
.
setTotalSalesAmount
(
totalSalesAmount
[
0
]);
tableDataInfo
.
setTotalRefundAmount
(
totalRefundAmount
);
tableDataInfo
.
setTotalRealRefundAmount
(
totalRealRefundAmount
);
return
tableDataInfo
;
return
tableDataInfo
;
}
}
private
List
<
Long
>
couponIds
(
SOrder
sOrder
)
{
return
baseMapper
.
couponIds
(
sOrder
);
}
/**
/**
* 订单退款(管理系统人工退款)
* 订单退款(管理系统人工退款)
* @param request 请求参数
* @param request 请求参数
...
@@ -680,36 +671,41 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -680,36 +671,41 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
List
<
SOrder
>
sOrders
=
selectSOrderList
(
sOrder
);
List
<
SOrder
>
sOrders
=
selectSOrderList
(
sOrder
);
List
<
SOrderVo
>
sOrderVos
=
convertDosToVos
(
sOrders
);
List
<
SOrderVo
>
sOrderVos
=
convertDosToVos
(
sOrders
);
List
<
SaobeiApiLog
>
saobeiApiLogs
=
saobeiApiLogService
.
list
();
List
<
SaobeiApiLog
>
saobeiApiLogs
=
saobeiApiLogService
.
list
();
//list转HashMap
List
<
SConsumerCoupon
>
sConsumerCoupons
=
consumerCouponService
.
queryList
();
List
<
SConsumerCoupon
>
sConsumerCoupons
=
consumerCouponService
.
queryList
();
Map
<
Long
,
SConsumerCoupon
>
map
=
sConsumerCoupons
.
stream
().
collect
(
Collectors
.
toMap
(
SConsumerCoupon:
:
getId
,
Function
.
identity
()));
List
<
SCoupon
>
list
=
sCouponService
.
list
();
List
<
SCoupon
>
list
=
sCouponService
.
list
();
Map
<
Long
,
SCoupon
>
sCouponMap
=
list
.
stream
().
collect
(
Collectors
.
toMap
(
SCoupon:
:
getId
,
Function
.
identity
()));
if
(
CollectionUtils
.
isNotEmpty
(
sOrderVos
))
{
if
(
CollectionUtils
.
isNotEmpty
(
sOrderVos
))
{
for
(
SOrderVo
item
:
sOrderVos
)
{
sOrderVos
.
stream
().
forEach
(
item
->
{
sConsumerCoupons
.
stream
().
filter
(
sConsumerCoupon
->
sConsumerCoupon
.
getId
().
equals
(
item
.
getCouponId
())).
findFirst
().
ifPresent
(
sConsumerCoupon
->
{
if
(
ObjectUtil
.
isNotEmpty
(
item
.
getCouponId
()))
{
item
.
setCouponPayPrice
(
sConsumerCoupon
.
getCouponPayPrice
());
SConsumerCoupon
sConsumerCoupon
=
map
.
get
(
item
.
getCouponId
());
item
.
setPlatformType
(
sConsumerCoupon
.
getPlatformType
());
if
(
ObjectUtil
.
isNotEmpty
(
sConsumerCoupon
))
{
if
(
sConsumerCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
MEITUAN
.
getCode
()))
{
item
.
setCouponPayPrice
(
sConsumerCoupon
.
getCouponPayPrice
());
if
(!
ObjectUtils
.
isEmpty
(
sConsumerCoupon
.
getDealgroupId
()))
{
item
.
setPlatformType
(
sConsumerCoupon
.
getPlatformType
());
item
.
setCouponSkuId
(
String
.
valueOf
(
sConsumerCoupon
.
getDealgroupId
()));
if
(
sConsumerCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
MEITUAN
.
getCode
()))
{
}
else
{
if
(!
ObjectUtils
.
isEmpty
(
sConsumerCoupon
.
getDealgroupId
()))
{
list
.
stream
().
filter
(
sCoupon
->
sCoupon
.
getId
().
equals
(
sConsumerCoupon
.
getCouponId
())).
findFirst
().
ifPresent
(
sConsumer
->
{
item
.
setCouponSkuId
(
String
.
valueOf
(
sConsumerCoupon
.
getDealgroupId
()));
item
.
setCouponSkuId
(
String
.
valueOf
(
sConsumer
.
getDealgroupId
()));
}
else
{
});
item
.
setCouponSkuId
(
String
.
valueOf
(
sCouponMap
.
get
(
sConsumerCoupon
.
getCouponId
()).
getDealgroupId
()));
}
}
}
else
if
(
sConsumerCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
TIKTOK
.
getCode
()))
{
}
else
if
(
sConsumerCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
TIKTOK
.
getCode
()))
{
if
(!
ObjectUtils
.
isEmpty
(
sConsumerCoupon
.
getTiktokSkuId
()))
{
if
(!
ObjectUtils
.
isEmpty
(
sConsumerCoupon
.
getTiktokSkuId
()))
{
item
.
setCouponSkuId
(
sConsumerCoupon
.
getTiktokSkuId
());
item
.
setCouponSkuId
(
sConsumerCoupon
.
getTiktokSkuId
());
}
else
{
}
else
{
list
.
stream
().
filter
(
sCoupon
->
sCoupon
.
getId
().
equals
(
sConsumerCoupon
.
getCouponId
())).
findFirst
().
ifPresent
(
sConsumer
->
{
item
.
setCouponSkuId
(
sCouponMap
.
get
(
sConsumerCoupon
.
getCouponId
()).
getTiktokSkuId
());
item
.
setCouponSkuId
(
sConsumer
.
getTiktokSkuId
());
}
});
}
}
}
}
}
);
}
if
(
StringUtils
.
isNoneEmpty
(
item
.
getOutTradeNo
()))
{
if
(
StringUtils
.
isNoneEmpty
(
item
.
getOutTradeNo
()))
{
item
.
setOutTradeNo
(
saobeiApiLogs
.
stream
().
filter
(
s
->
s
.
getTerminalTrace
().
equals
(
item
.
getOutTradeNo
())).
findFirst
().
orElse
(
null
).
getOutTradeNo
());
item
.
setOutTradeNo
(
// saobeiApiLogMap.get(item.getOutTradeNo()).getOutTradeNo()
saobeiApiLogs
.
stream
().
filter
(
saobeiApiLog
->
saobeiApiLog
.
getTerminalTrace
().
equals
(
item
.
getOutTradeNo
())).
findFirst
().
orElse
(
null
).
getOutTradeNo
()
);
}
}
}
}
);
}
}
sOrderVos
.
sort
(
Comparator
.
comparing
(
SOrderVo:
:
getCreateTime
).
reversed
());
sOrderVos
.
sort
(
Comparator
.
comparing
(
SOrderVo:
:
getCreateTime
).
reversed
());
return
sOrderVos
;
return
sOrderVos
;
...
@@ -1599,51 +1595,83 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -1599,51 +1595,83 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
private
List
<
SOrderVo
>
convertDosToVos
(
List
<
SOrder
>
orderList
)
{
private
List
<
SOrderVo
>
convertDosToVos
(
List
<
SOrder
>
orderList
)
{
List
<
SOrderVo
>
voList
=
new
ArrayList
<>();
List
<
SOrderVo
>
voList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
orderList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
orderList
))
{
// 使用Map缓存查询结果,减少重复查询
try
{
Map
<
Long
,
SStore
>
storeMap
=
storeService
.
listByIds
(
orderList
.
stream
().
map
(
SOrder:
:
getStoreId
).
collect
(
Collectors
.
toSet
()))
// 使用Map缓存查询结果,减少重复查询
.
stream
().
collect
(
Collectors
.
toMap
(
SStore:
:
getId
,
s
->
s
));
// 合并查询逻辑以减少N+1查询问题
Map
<
Long
,
SRoom
>
roomMap
=
roomService
.
listByIds
(
orderList
.
stream
().
map
(
SOrder:
:
getRoomId
).
collect
(
Collectors
.
toSet
()))
Set
<
Long
>
storeIds
=
orderList
.
stream
().
map
(
SOrder:
:
getStoreId
).
collect
(
Collectors
.
toSet
());
.
stream
().
collect
(
Collectors
.
toMap
(
SRoom:
:
getId
,
s
->
s
));
Set
<
Long
>
roomIds
=
orderList
.
stream
().
map
(
SOrder:
:
getRoomId
).
distinct
().
collect
(
Collectors
.
toSet
());
Map
<
Long
,
SConsumerCoupon
>
couponMap
=
consumerCouponService
.
queryByIds
(
orderList
.
stream
().
map
(
SOrder:
:
getCouponId
).
distinct
().
collect
(
Collectors
.
toList
()))
Set
<
Long
>
couponIds
=
orderList
.
stream
().
map
(
SOrder:
:
getCouponId
).
distinct
().
collect
(
Collectors
.
toSet
());
.
stream
().
collect
(
Collectors
.
toMap
(
SConsumerCoupon:
:
getId
,
s
->
s
));
Set
<
Long
>
packIds
=
orderList
.
stream
().
map
(
SOrder:
:
getPackId
).
distinct
().
collect
(
Collectors
.
toSet
());
Map
<
Long
,
SPack
>
packMap
=
packService
.
listByIds
(
orderList
.
stream
().
map
(
SOrder:
:
getPackId
).
distinct
().
collect
(
Collectors
.
toList
()))
.
stream
().
collect
(
Collectors
.
toMap
(
SPack:
:
getId
,
s
->
s
));
Map
<
Long
,
SStore
>
storeMap
;
if
(!
storeIds
.
isEmpty
())
{
orderList
.
forEach
(
o
->
{
List
<
SStore
>
stores
=
storeService
.
storeNameByIds
(
new
ArrayList
<>(
storeIds
));
SOrderVo
vo
=
new
SOrderVo
();
storeMap
=
stores
.
stream
().
collect
(
Collectors
.
toMap
(
SStore:
:
getId
,
s
->
s
));
BeanUtils
.
copyProperties
(
o
,
vo
);
}
else
{
SStore
store
=
storeMap
.
get
(
vo
.
getStoreId
());
storeMap
=
new
HashMap
<>();
if
(
store
!=
null
)
{
vo
.
setStoreName
(
store
.
getName
());
vo
.
setAddress
(
store
.
getAddress
());
}
}
SRoom
room
=
roomMap
.
get
(
vo
.
getRoomId
());
if
(
room
!=
null
)
{
Map
<
Long
,
SRoom
>
roomMap
;
vo
.
setRoomName
(
room
.
getName
());
if
(!
roomIds
.
isEmpty
())
{
vo
.
setRoomImages
(
room
.
getImages
());
List
<
SRoom
>
rooms
=
roomService
.
roomNameByIds
(
new
ArrayList
<>(
roomIds
));
vo
.
setRoomType
(
room
.
getRoomType
());
roomMap
=
rooms
.
stream
().
collect
(
Collectors
.
toMap
(
SRoom:
:
getId
,
s
->
s
));
vo
.
setRoomTypeName
(
RoomType
.
getNameByCode
(
room
.
getRoomType
()));
}
else
{
roomMap
=
new
HashMap
<>();
}
}
if
(
Objects
.
nonNull
(
vo
.
getCouponId
()))
{
SConsumerCoupon
userCoupon
=
couponMap
.
get
(
vo
.
getCouponId
());
Map
<
Long
,
SConsumerCoupon
>
couponMap
;
if
(
userCoupon
!=
null
)
{
if
(!
couponIds
.
isEmpty
())
{
// 判断是否可以退款
List
<
SConsumerCoupon
>
coupons
=
consumerCouponService
.
couponNameByIds
(
new
ArrayList
<>(
couponIds
));
vo
.
setIsRefund
(
isRefund
(
vo
,
userCoupon
));
couponMap
=
coupons
.
stream
().
collect
(
Collectors
.
toMap
(
SConsumerCoupon:
:
getId
,
s
->
s
));
vo
.
setCouponName
(
userCoupon
.
getName
());
}
else
{
// 如果优惠券为空,则调用isRefund方法时需要传入null
vo
.
setIsRefund
(
isRefund
(
vo
,
null
));
}
}
else
{
}
else
{
// 判断是否可以退款
couponMap
=
new
HashMap
<>();
vo
.
setIsRefund
(
isRefund
(
vo
,
null
));
}
}
SPack
pack
=
packMap
.
get
(
vo
.
getPackId
());
if
(
pack
!=
null
)
{
Map
<
Long
,
SPack
>
packMap
;
vo
.
setPackName
(
pack
.
getName
());
if
(!
packIds
.
isEmpty
())
{
List
<
SPack
>
packs
=
packService
.
packNameByIds
(
new
ArrayList
<>(
packIds
));
packMap
=
packs
.
stream
().
collect
(
Collectors
.
toMap
(
SPack:
:
getId
,
s
->
s
));
}
else
{
packMap
=
new
HashMap
<>();
}
}
voList
.
add
(
vo
);
});
orderList
.
forEach
(
o
->
{
SOrderVo
vo
=
new
SOrderVo
();
BeanUtils
.
copyProperties
(
o
,
vo
);
SStore
store
=
storeMap
.
get
(
vo
.
getStoreId
());
if
(
store
!=
null
)
{
vo
.
setStoreName
(
store
.
getName
());
vo
.
setAddress
(
store
.
getAddress
());
}
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
()))
{
SConsumerCoupon
userCoupon
=
couponMap
.
get
(
vo
.
getCouponId
());
if
(
userCoupon
!=
null
)
{
vo
.
setIsRefund
(
isRefund
(
vo
,
userCoupon
));
vo
.
setCouponName
(
userCoupon
.
getName
());
}
else
{
vo
.
setIsRefund
(
isRefund
(
vo
,
null
));
}
}
else
{
vo
.
setIsRefund
(
isRefund
(
vo
,
null
));
}
SPack
pack
=
packMap
.
get
(
vo
.
getPackId
());
if
(
pack
!=
null
)
{
vo
.
setPackName
(
pack
.
getName
());
}
voList
.
add
(
vo
);
});
}
catch
(
Exception
e
)
{
// 记录日志并处理异常,例如返回错误信息或执行其他错误处理逻辑
// log.error("订单数据转换异常", e);
throw
new
RuntimeException
(
"订单数据转换异常"
,
e
);
}
}
}
return
voList
;
return
voList
;
}
}
...
...
share-system/src/main/java/share/system/service/impl/SRoomServiceImpl.java
View file @
2feb3817
...
@@ -475,4 +475,14 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
...
@@ -475,4 +475,14 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
return
voList
;
return
voList
;
}
}
@Override
public
List
<
SRoom
>
roomNameByIds
(
List
<
Long
>
longs
)
{
LambdaQueryWrapper
<
SRoom
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
select
(
SRoom:
:
getId
,
SRoom:
:
getName
,
SRoom:
:
getImages
,
SRoom:
:
getRoomType
);
if
(
CollectionUtils
.
isNotEmpty
(
longs
))
{
queryWrapper
.
in
(
SRoom:
:
getId
,
longs
);
}
return
this
.
list
(
queryWrapper
);
}
}
}
share-system/src/main/java/share/system/service/impl/SStoreServiceImpl.java
View file @
2feb3817
...
@@ -366,6 +366,16 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
...
@@ -366,6 +366,16 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
return
storeConsumerMapper
.
queryBySStoreConsumer
(
dto
);
return
storeConsumerMapper
.
queryBySStoreConsumer
(
dto
);
}
}
@Override
public
List
<
SStore
>
storeNameByIds
(
List
<
Long
>
ids
)
{
LambdaQueryWrapper
<
SStore
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
select
(
SStore:
:
getId
,
SStore:
:
getName
,
SStore:
:
getAddress
);
if
(
CollectionUtils
.
isNotEmpty
(
ids
))
{
queryWrapper
.
in
(
SStore:
:
getId
,
ids
);
}
return
this
.
list
(
queryWrapper
);
}
/**
/**
* 门店DO集合转换VO集合,按距离排序
* 门店DO集合转换VO集合,按距离排序
*
*
...
...
share-system/src/main/resources/mapper/system/SConsumerCouponMapper.xml
View file @
2feb3817
...
@@ -164,6 +164,14 @@
...
@@ -164,6 +164,14 @@
<select
id=
"queryList"
resultType=
"share.system.domain.SConsumerCoupon"
>
<select
id=
"queryList"
resultType=
"share.system.domain.SConsumerCoupon"
>
<include
refid=
"selectSConsumerCouponVo"
/>
<include
refid=
"selectSConsumerCouponVo"
/>
</select>
</select>
<select
id=
"sumPayPrice"
resultType=
"share.system.domain.SConsumerCoupon"
>
select sum(ifnull(coupon_pay_price,0)) AS couponPayPrice
from s_consumer_coupon
where id in
<foreach
item=
"id"
collection=
"couponIds"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</select>
<insert
id=
"insertSConsumerCoupon"
parameterType=
"SConsumerCoupon"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insertSConsumerCoupon"
parameterType=
"SConsumerCoupon"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into s_consumer_coupon
insert into s_consumer_coupon
...
...
share-system/src/main/resources/mapper/system/SOrderMapper.xml
View file @
2feb3817
...
@@ -250,6 +250,136 @@
...
@@ -250,6 +250,136 @@
and create_time >= #{createTime}
and create_time >= #{createTime}
group by store_id) t on t.id = s.id
group by store_id) t on t.id = s.id
</select>
</select>
<select
id=
"sumPrice"
resultType=
"java.util.HashMap"
>
select sum(ifnull(total_price,0)) as totalPrice,
sum(ifnull(pay_price,0)) as payPrice ,
SUM( CASE WHEN
pay_status=1 AND refund_status = 3
THEN ifnull( pay_price,0) ELSE 0 END
) AS totalRealRefundAmount,
SUM( CASE WHEN
pay_status=1 AND refund_status = 3
THEN ifnull(refund_price,0) ELSE 0 END
) AS refundPrice
from s_order
where pay_status = 1
and is_delete = 0
<if
test=
"orderNo != null and orderNo != ''"
>
and order_no = #{orderNo}
</if>
<if
test=
"historicalOrderNo != null and historicalOrderNo != ''"
>
and historical_order_no =
#{historicalOrderNo}
</if>
<if
test=
"outTradeNo != null and outTradeNo != ''"
>
and out_trade_no = #{outTradeNo}
</if>
<if
test=
"orderType != null and orderType != ''"
>
and order_type = #{orderType}
</if>
<if
test=
"payType != null and payType != ''"
>
and pay_type = #{payType}
</if>
<!-- <if test="payStatus != null and payStatus != ''">and pay_status = #{payStatus}</if>-->
<if
test=
"storeId != null and storeId != ''"
>
and store_id = #{storeId}
</if>
<if
test=
"roomId != null and roomId != ''"
>
and room_id = #{roomId}
</if>
<if
test=
"consumerId != null and consumerId != ''"
>
and consumer_id = #{consumerId}
</if>
<if
test=
"consumerName != null and consumerName != ''"
>
and consumer_name = #{consumerName}
</if>
<if
test=
"consumerPhone != null and consumerPhone != ''"
>
and consumer_phone = #{consumerPhone}
</if>
<if
test=
"packId != null and packId != ''"
>
and pack_id = #{packId}
</if>
<if
test=
"packPrice != null and packPrice != ''"
>
and pack_price = #{packPrice}
</if>
<if
test=
"couponId != null and couponId != ''"
>
and coupon_id = #{couponId}
</if>
<if
test=
"couponPrice != null and couponPrice != ''"
>
and coupon_price = #{couponPrice}
</if>
<if
test=
"totalPrice != null and totalPrice != ''"
>
and total_price = #{totalPrice}
</if>
<if
test=
"payPrice != null and payPrice != ''"
>
and pay_price = #{payPrice}
</if>
<if
test=
"startPayTime != null"
>
and DATE_FORMAT(pay_time, '%Y-%m-%d')
>
= DATE_FORMAT(#{startPayTime}, '%Y-%m-%d')
</if>
<if
test=
"endPayTime != null"
>
and DATE_FORMAT(pay_time, '%Y-%m-%d')
<
= DATE_FORMAT(#{endPayTime}, '%Y-%m-%d')
</if>
<if
test=
"payTime != null and payTime != ''"
>
and pay_time = #{payTime}
</if>
<if
test=
"timeLong != null and timeLong != ''"
>
and time_long = #{timeLong}
</if>
<if
test=
"preStartDate != null"
>
and DATE_FORMAT(pre_start_date, '%Y-%m-%d')
>
= DATE_FORMAT(#{preStartDate}, '%Y-%m-%d')
</if>
<if
test=
"preEndDate != null"
>
and DATE_FORMAT(pre_end_date, '%Y-%m-%d')
<
= DATE_FORMAT(#{preEndDate}, '%Y-%m-%d')
</if>
<if
test=
"startDate != null"
>
and DATE_FORMAT(create_time, '%Y-%m-%d')
>
= DATE_FORMAT(#{startDate}, '%Y-%m-%d')
</if>
<if
test=
"endDate != null"
>
and DATE_FORMAT(create_time, '%Y-%m-%d')
<
= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
</if>
<if
test=
"status != null and status != '' or status==0"
>
and status = #{status}
</if>
<if
test=
"refundStatus != null and refundStatus != ''"
>
and refund_status = #{refundStatus}
</if>
<if
test=
"refundReason != null and refundReason != ''"
>
and refund_reason = #{refundReason}
</if>
<if
test=
"refundReasonTime != null"
>
and refund_reason_time =
#{refundReasonTime}
</if>
<if
test=
"refundPrice != null and refundPrice != ''"
>
and refund_price = #{refundPrice}
</if>
<if
test=
"isDelete != null and isDelete != ''"
>
and is_delete = #{isDelete}
</if>
<if
test=
"createBy != null and createBy != ''"
>
and create_by = #{createBy}
</if>
<if
test=
"createTime != null and createTime != ''"
>
and create_time = #{createTime}
</if>
<if
test=
"updateBy != null and updateBy != ''"
>
and update_by = #{updateBy}
</if>
<if
test=
"updateTime != null and updateTime != ''"
>
and update_time = #{updateTime}
</if>
<if
test=
"arrivalTime != null and arrivalTime != ''"
>
and arrival_time = #{arrivalTime}
</if>
<if
test=
"remark != null and remark != ''"
>
and remark = #{remark}
</if>
</select>
<select
id=
"couponIds"
resultType=
"java.lang.Long"
>
select consumer_id
from s_order
where pay_status = 1
and is_delete = 0
<if
test=
"orderNo != null and orderNo != ''"
>
and order_no = #{orderNo}
</if>
<if
test=
"historicalOrderNo != null and historicalOrderNo != ''"
>
and historical_order_no =
#{historicalOrderNo}
</if>
<if
test=
"outTradeNo != null and outTradeNo != ''"
>
and out_trade_no = #{outTradeNo}
</if>
<if
test=
"orderType != null and orderType != ''"
>
and order_type = #{orderType}
</if>
<if
test=
"payType != null and payType != ''"
>
and pay_type = #{payType}
</if>
<!-- <if test="payStatus != null and payStatus != ''">and pay_status = #{payStatus}</if>-->
<if
test=
"storeId != null and storeId != ''"
>
and store_id = #{storeId}
</if>
<if
test=
"roomId != null and roomId != ''"
>
and room_id = #{roomId}
</if>
<if
test=
"consumerId != null and consumerId != ''"
>
and consumer_id = #{consumerId}
</if>
<if
test=
"consumerName != null and consumerName != ''"
>
and consumer_name = #{consumerName}
</if>
<if
test=
"consumerPhone != null and consumerPhone != ''"
>
and consumer_phone = #{consumerPhone}
</if>
<if
test=
"packId != null and packId != ''"
>
and pack_id = #{packId}
</if>
<if
test=
"packPrice != null and packPrice != ''"
>
and pack_price = #{packPrice}
</if>
<if
test=
"couponId != null and couponId != ''"
>
and coupon_id = #{couponId}
</if>
<if
test=
"couponPrice != null and couponPrice != ''"
>
and coupon_price = #{couponPrice}
</if>
<if
test=
"totalPrice != null and totalPrice != ''"
>
and total_price = #{totalPrice}
</if>
<if
test=
"payPrice != null and payPrice != ''"
>
and pay_price = #{payPrice}
</if>
<if
test=
"startPayTime != null"
>
and DATE_FORMAT(pay_time, '%Y-%m-%d')
>
= DATE_FORMAT(#{startPayTime}, '%Y-%m-%d')
</if>
<if
test=
"endPayTime != null"
>
and DATE_FORMAT(pay_time, '%Y-%m-%d')
<
= DATE_FORMAT(#{endPayTime}, '%Y-%m-%d')
</if>
<if
test=
"payTime != null and payTime != ''"
>
and pay_time = #{payTime}
</if>
<if
test=
"timeLong != null and timeLong != ''"
>
and time_long = #{timeLong}
</if>
<if
test=
"preStartDate != null"
>
and DATE_FORMAT(pre_start_date, '%Y-%m-%d')
>
= DATE_FORMAT(#{preStartDate}, '%Y-%m-%d')
</if>
<if
test=
"preEndDate != null"
>
and DATE_FORMAT(pre_end_date, '%Y-%m-%d')
<
= DATE_FORMAT(#{preEndDate}, '%Y-%m-%d')
</if>
<if
test=
"startDate != null"
>
and DATE_FORMAT(create_time, '%Y-%m-%d')
>
= DATE_FORMAT(#{startDate}, '%Y-%m-%d')
</if>
<if
test=
"endDate != null"
>
and DATE_FORMAT(create_time, '%Y-%m-%d')
<
= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
</if>
<if
test=
"status != null and status != '' or status==0"
>
and status = #{status}
</if>
<if
test=
"refundStatus != null and refundStatus != ''"
>
and refund_status = #{refundStatus}
</if>
<if
test=
"refundReason != null and refundReason != ''"
>
and refund_reason = #{refundReason}
</if>
<if
test=
"refundReasonTime != null"
>
and refund_reason_time =
#{refundReasonTime}
</if>
<if
test=
"refundPrice != null and refundPrice != ''"
>
and refund_price = #{refundPrice}
</if>
<if
test=
"isDelete != null and isDelete != ''"
>
and is_delete = #{isDelete}
</if>
<if
test=
"createBy != null and createBy != ''"
>
and create_by = #{createBy}
</if>
<if
test=
"createTime != null and createTime != ''"
>
and create_time = #{createTime}
</if>
<if
test=
"updateBy != null and updateBy != ''"
>
and update_by = #{updateBy}
</if>
<if
test=
"updateTime != null and updateTime != ''"
>
and update_time = #{updateTime}
</if>
<if
test=
"arrivalTime != null and arrivalTime != ''"
>
and arrival_time = #{arrivalTime}
</if>
<if
test=
"remark != null and remark != ''"
>
and remark = #{remark}
</if>
</select>
<insert
id=
"insertSOrder"
parameterType=
"SOrder"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insertSOrder"
parameterType=
"SOrder"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into s_order
insert into s_order
...
...
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