Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gogirl-miniapp-backend
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
huluobin
gogirl-miniapp-backend
Commits
416aa6c0
Commit
416aa6c0
authored
Nov 12, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
0529b168
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
11 deletions
+38
-11
CouponsGiftServiceImpl.java
...pplication/market/coupon/impl/CouponsGiftServiceImpl.java
+1
-1
CouponsForConsumption.java
...om/gogirl/domain/market/coupon/CouponsForConsumption.java
+1
-0
CouponsForConsumptionMapper.xml
...rces/mapper/market/coupon/CouponsForConsumptionMapper.xml
+2
-10
CouponsGiftServiceImplTest.java
...cation/market/coupon/impl/CouponsGiftServiceImplTest.java
+34
-0
No files found.
src/main/java/com/gogirl/application/market/coupon/impl/CouponsGiftServiceImpl.java
View file @
416aa6c0
...
...
@@ -80,7 +80,7 @@ public class CouponsGiftServiceImpl extends ServiceImpl<CouponsGiftMapper, Coupo
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"行为触发发券失败"
+
e
.
getMessage
());
log
.
error
(
"行为触发发券失败"
+
e
.
getMessage
()
,
e
);
}
}
}
src/main/java/com/gogirl/domain/market/coupon/CouponsForConsumption.java
View file @
416aa6c0
...
...
@@ -50,6 +50,7 @@ public class CouponsForConsumption implements Serializable {
private
String
messageInfo
;
private
Integer
isDelete
;
private
LocalDateTime
deleteDate
;
private
String
deleteUser
;
private
Integer
storeId
;
private
LocalDateTime
createDate
;
...
...
src/main/resources/mapper/market/coupon/CouponsForConsumptionMapper.xml
View file @
416aa6c0
...
...
@@ -8,15 +8,11 @@
LEFT JOIN coupons_for_consumption t2 on t2.order_amount_type = 1
and t1.total_price
<
= t2.order_amount_up
and t1.total_price
>
= t2.order_amount_down
<if
test=
"t2.order_serve_type != null"
>
LEFT JOIN order_serve t3 on t1.id = t3.order_id and t2.order_serve_type = t3.serve_type_id
</if>
LEFT JOIN order_serve t3 on t1.id = t3.order_id and (t2.order_serve_type = t3.serve_type_id or t2.order_serve_type is null)
where t1.id = #{orderId}
and t2.id is not null
and t1.department_id = t2.store_id
<if
test=
"t2.order_serve_type != null"
>
and t3.id is not null
</if>
union
SELECT t2.*
from order_manage t1
...
...
@@ -24,14 +20,10 @@
and t1.total_payment_amount
<
= t2.order_amount_up
and t1.total_payment_amount
>
= t2.order_amount_down
and t1.department_id = t2.store_id
<if
test=
"t2.order_serve_type != null"
>
LEFT JOIN order_serve t3 on t1.id = t3.order_id and t2.order_serve_type = t3.serve_type_id
</if>
LEFT JOIN order_serve t3 on t1.id = t3.order_id and (t2.order_serve_type = t3.serve_type_id or t2.order_serve_type is null)
where t1.id = #{orderId}
and t2.id is not null
<if
test=
"t2.order_serve_type != null"
>
and t3.id is not null
</if>
and t1.department_id = t2.store_id
order by orders
limit 1
...
...
src/test/java/com/gogirl/application/market/coupon/impl/CouponsGiftServiceImplTest.java
0 → 100644
View file @
416aa6c0
package
com
.
gogirl
.
application
.
market
.
coupon
.
impl
;
import
com.gogirl.application.market.coupon.ICouponsGiftService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.ActiveProfiles
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
javax.annotation.Resource
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/11/12 2:00 下午
*/
@ActiveProfiles
(
"prod"
)
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
@Slf4j
public
class
CouponsGiftServiceImplTest
{
@Resource
ICouponsGiftService
couponsGiftService
;
@Test
public
void
sendGift
()
{
couponsGiftService
.
sendGift
(
24383
,
3
,
17707
);
}
}
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