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
efb19673
Commit
efb19673
authored
Jan 13, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
团购劵管理一个美团优惠券应该只能绑定一个规则
parent
84a49b51
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
SCouponMapper.java
...stem/src/main/java/share/system/mapper/SCouponMapper.java
+2
-0
SCouponServiceImpl.java
...in/java/share/system/service/impl/SCouponServiceImpl.java
+12
-3
SCouponMapper.xml
...system/src/main/resources/mapper/system/SCouponMapper.xml
+4
-0
No files found.
share-system/src/main/java/share/system/mapper/SCouponMapper.java
View file @
efb19673
...
...
@@ -66,4 +66,6 @@ public interface SCouponMapper
List
<
SCoupon
>
listDuration
(
SCoupon
sCoupon
);
List
<
SCoupon
>
selectSCouponByDealgroupId
(
Long
dealgroupId
);
SCoupon
selectByDealgroupId
(
Long
dealgroupId
);
}
share-system/src/main/java/share/system/service/impl/SCouponServiceImpl.java
View file @
efb19673
...
...
@@ -95,8 +95,12 @@ public class SCouponServiceImpl implements ISCouponService {
sCoupon
.
setMaxDuration
(
DEFAULT_MAX_DURATION
);
sCoupon
.
setMinPrice
(
new
BigDecimal
(
"0.00"
));
sCoupon
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
sCouponMapper
.
insertSCoupon
(
sCoupon
);
SCoupon
sCouponList
=
sCouponMapper
.
selectByDealgroupId
(
sCoupon
.
getDealgroupId
());
if
(
ObjectUtils
.
isEmpty
(
sCouponList
))
{
return
sCouponMapper
.
insertSCoupon
(
sCoupon
);
}
else
{
throw
new
RuntimeException
(
"该团购已存在"
);
}
}
/**
...
...
@@ -108,7 +112,12 @@ public class SCouponServiceImpl implements ISCouponService {
@Override
public
int
updateSCoupon
(
SCoupon
sCoupon
)
{
sCoupon
.
setUpdateTime
(
DateUtils
.
getNowDate
());
return
sCouponMapper
.
updateSCoupon
(
sCoupon
);
SCoupon
sCouponList
=
sCouponMapper
.
selectByDealgroupId
(
sCoupon
.
getDealgroupId
());
if
(
ObjectUtils
.
isEmpty
(
sCouponList
))
{
return
sCouponMapper
.
updateSCoupon
(
sCoupon
);
}
else
{
throw
new
RuntimeException
(
"该团购已存在"
);
}
}
/**
...
...
share-system/src/main/resources/mapper/system/SCouponMapper.xml
View file @
efb19673
...
...
@@ -105,6 +105,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include
refid=
"selectSCouponVo"
/>
where dealgroup_id = #{dealgroupId}
</select>
<select
id=
"selectByDealgroupId"
resultMap=
"SCouponResult"
>
<include
refid=
"selectSCouponVo"
/>
where dealgroup_id = #{dealgroupId}
</select>
<insert
id=
"insertSCoupon"
parameterType=
"SCoupon"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into s_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