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
1fb2e031
Commit
1fb2e031
authored
Mar 16, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
卡券修改
parent
975a46c9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
8 deletions
+14
-8
MarketServiceImpl.java
...com/gogirl/application/market/impl/MarketServiceImpl.java
+6
-4
CouponCustomerRelevance.java
.../gogirl/domain/market/coupon/CouponCustomerRelevance.java
+2
-4
ScheduleServe.java
...ain/java/com/gogirl/domain/order/serve/ScheduleServe.java
+2
-0
CouponCustomerRelevanceController.java
...rl/interfaces/user/CouponCustomerRelevanceController.java
+4
-0
No files found.
src/main/java/com/gogirl/application/market/impl/MarketServiceImpl.java
View file @
1fb2e031
...
...
@@ -35,7 +35,6 @@ import java.util.stream.Collectors;
@Service
@Slf4j
@Transactional
public
class
MarketServiceImpl
implements
MarketService
{
@Resource
...
...
@@ -65,6 +64,7 @@ public class MarketServiceImpl implements MarketService {
private
TimesCardCustomerRelevanceService
timesCardCustomerRelevanceService
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
setUpInnerCoupon
(
SetUpInnerCouponCommand
cmd
)
{
...
...
@@ -81,10 +81,10 @@ public class MarketServiceImpl implements MarketService {
setterCouponCustomerRelevanceList
.
forEach
(
couponCustomerRelevance
->
{
couponCustomerRelevance
.
setOrderId
(
null
);
couponCustomerRelevance
.
setState
(
1
);
couponCustomerRelevanceMapper
.
updateById
(
couponCustomerRelevance
);
});
if
(
ListUtil
.
isNotEmpty
(
setterCouponCustomerRelevanceList
))
{
couponCustomerRelevanceService
.
updateBatchById
(
setterCouponCustomerRelevanceList
);
//删除这些卡券对应的卡券订单折扣详情
couponOrderRelevanceService
.
remove
(
new
LambdaQueryWrapper
<
CouponOrderRelevance
>()
...
...
@@ -94,7 +94,7 @@ public class MarketServiceImpl implements MarketService {
}
//设置卡券关联
if
(
ListUtil
.
isNotEmpty
(
cmd
.
getInnerCouponCustomerRelevanceIds
()))
{
if
(
ListUtil
.
isNotEmpty
(
cmd
.
getInnerCouponCustomerRelevanceIds
()))
{
List
<
CouponCustomerRelevance
>
couponCustomerRelevanceList
=
(
List
<
CouponCustomerRelevance
>)
couponCustomerRelevanceService
.
listByIds
(
cmd
.
getInnerCouponCustomerRelevanceIds
());
if
(
ListUtil
.
isNotEmpty
(
couponCustomerRelevanceList
))
{
couponCustomerRelevanceList
.
forEach
(
couponCustomerRelevance
->
{
...
...
@@ -253,6 +253,7 @@ public class MarketServiceImpl implements MarketService {
*
* @param orderId
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
setterOrder
(
Integer
orderId
)
{
...
...
@@ -363,8 +364,9 @@ public class MarketServiceImpl implements MarketService {
//在从服务上折扣的钱
BigDecimal
leftServeDiscountAmount
=
timesCardUsedRecord
.
getDiscountAmount
().
subtract
(
serveDiscountAmount
);
BigDecimal
actualSupportServeDiscountAmount
=
leftServeDiscountAmount
.
min
(
supportServe
.
getPayPrice
());
if
(
supportServe
!=
null
&&
leftServeDiscountAmount
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
BigDecimal
actualSupportServeDiscountAmount
=
leftServeDiscountAmount
.
min
(
supportServe
.
getPayPrice
());
TimesCardOrderServeDetail
supportTimesCardOrderServeDetail
=
new
TimesCardOrderServeDetail
();
supportTimesCardOrderServeDetail
.
setDiscountAmount
(
actualSupportServeDiscountAmount
);
supportTimesCardOrderServeDetail
.
setOrderServeId
(
supportServe
.
getId
());
...
...
src/main/java/com/gogirl/domain/market/coupon/CouponCustomerRelevance.java
View file @
1fb2e031
package
com
.
gogirl
.
domain
.
market
.
coupon
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.*
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.gogirl.domain.user.customer.Customer
;
import
io.swagger.annotations.ApiModel
;
...
...
@@ -84,6 +81,7 @@ public class CouponCustomerRelevance implements Serializable {
@ApiModelProperty
(
"卡券来源id"
)
private
String
sourceFromId
;
@TableField
(
strategy
=
FieldStrategy
.
IGNORED
)
private
Integer
orderId
;
@ApiModelProperty
(
"1-计算 2-不计算"
)
...
...
src/main/java/com/gogirl/domain/order/serve/ScheduleServe.java
View file @
1fb2e031
...
...
@@ -167,9 +167,11 @@ public class ScheduleServe implements Serializable {
private
List
<
LinkedHashMap
>
listTechnician
;
@ApiModelProperty
(
"实际开始时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
actualStartTime
;
@ApiModelProperty
(
"实际结束时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
actualEndTime
;
@TableField
(
exist
=
false
)
...
...
src/main/java/com/gogirl/interfaces/user/CouponCustomerRelevanceController.java
View file @
1fb2e031
...
...
@@ -16,6 +16,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -66,8 +67,11 @@ public class CouponCustomerRelevanceController {
return
JsonResult
.
success
();
}
private
final
MarketService
marketService
;
@Transactional
@ApiOperation
(
value
=
"用户提交优惠券"
)
@PostMapping
(
value
=
"/customer/submitCoupons"
)
public
JsonResult
<
Void
>
submitCoupons
(
@RequestParam
Integer
orderId
,
...
...
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