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
7289df2a
Commit
7289df2a
authored
Mar 07, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改优惠卷逻辑删除好查询不到的问题导致订单查询异常
parent
5b315375
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
4 deletions
+36
-4
SConsumerCouponMapper.java
.../main/java/share/system/mapper/SConsumerCouponMapper.java
+7
-1
ISConsumerCouponService.java
...in/java/share/system/service/ISConsumerCouponService.java
+6
-1
SConsumerCouponServiceImpl.java
...share/system/service/impl/SConsumerCouponServiceImpl.java
+10
-0
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+2
-2
SConsumerCouponMapper.xml
...rc/main/resources/mapper/system/SConsumerCouponMapper.xml
+11
-0
No files found.
share-system/src/main/java/share/system/mapper/SConsumerCouponMapper.java
View file @
7289df2a
package
share
.
system
.
mapper
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
share.system.domain.SConsumerCoupon
;
import
java.util.List
;
/**
* 优惠券领取记录Mapper接口
*
...
...
@@ -63,4 +65,8 @@ public interface SConsumerCouponMapper extends BaseMapper<SConsumerCoupon>
int
selectSConsumerCouponConut
(
SConsumerCoupon
sConsumerCoupon
);
List
<
SConsumerCoupon
>
querySConsumerCouponList
(
SConsumerCoupon
sConsumerCoupon
);
SConsumerCoupon
queryById
(
Long
couponId
);
List
<
SConsumerCoupon
>
queryByIds
(
@Param
(
"couponIds"
)
List
<
Long
>
couponIds
);
}
share-system/src/main/java/share/system/service/ISConsumerCouponService.java
View file @
7289df2a
package
share
.
system
.
service
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.system.domain.SConsumerCoupon
;
import
share.system.request.CouponRequest
;
import
java.util.List
;
/**
* 优惠券领取记录Service接口
*
...
...
@@ -73,4 +74,8 @@ public interface ISConsumerCouponService extends IService<SConsumerCoupon>
List
<
SConsumerCoupon
>
availableCouponList
(
CouponRequest
couponRequest
);
int
give
(
SConsumerCoupon
sConsumerCoupon
);
SConsumerCoupon
queryById
(
Long
couponId
);
List
<
SConsumerCoupon
>
queryByIds
(
List
<
Long
>
couponIds
);
}
share-system/src/main/java/share/system/service/impl/SConsumerCouponServiceImpl.java
View file @
7289df2a
...
...
@@ -415,6 +415,16 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
return
insert
;
}
@Override
public
SConsumerCoupon
queryById
(
Long
couponId
)
{
return
baseMapper
.
queryById
(
couponId
);
}
@Override
public
List
<
SConsumerCoupon
>
queryByIds
(
List
<
Long
>
couponIds
)
{
return
baseMapper
.
queryByIds
(
couponIds
);
}
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/SOrderServiceImpl.java
View file @
7289df2a
...
...
@@ -1039,7 +1039,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
vo
.
setManager
(
store
.
getManager
());
vo
.
setPhone
(
store
.
getPhone
());
if
(
ObjectUtil
.
isNotEmpty
(
vo
.
getCouponId
()))
{
SConsumerCoupon
consumerCoupon
=
consumerCouponService
.
get
ById
(
vo
.
getCouponId
());
SConsumerCoupon
consumerCoupon
=
consumerCouponService
.
query
ById
(
vo
.
getCouponId
());
vo
.
setCouponName
(
consumerCoupon
.
getName
());
// 判断是否可以退款
vo
.
setIsRefund
(
isRefund
(
vo
,
consumerCoupon
));
...
...
@@ -1244,7 +1244,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
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
.
list
ByIds
(
couponIds
);
List
<
SConsumerCoupon
>
userCouponList
=
consumerCouponService
.
query
ByIds
(
couponIds
);
List
<
SPack
>
packList
=
packService
.
listByIds
(
packIds
);
orderList
.
stream
().
forEach
(
o
->
{
SOrderVo
vo
=
new
SOrderVo
();
...
...
share-system/src/main/resources/mapper/system/SConsumerCouponMapper.xml
View file @
7289df2a
...
...
@@ -143,6 +143,17 @@
<if
test=
"consumerId != null "
>
and consumer_id = #{consumerId}
</if>
</where>
</select>
<select
id=
"queryById"
resultType=
"share.system.domain.SConsumerCoupon"
>
<include
refid=
"selectSConsumerCouponVo"
/>
where id = #{id}
</select>
<select
id=
"queryByIds"
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