记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
ef448606
Commit
ef448606
authored
Aug 20, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
暂时提交
parent
e720a65a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
14 deletions
+39
-14
CandyCouponController.java
...idnet/service/candy/controller/CandyCouponController.java
+5
-2
CouponBaseUtil.java
...java/com/liquidnet/service/candy/util/CouponBaseUtil.java
+34
-12
No files found.
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/controller/CandyCouponController.java
View file @
ef448606
...
...
@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.Comparator
;
import
java.util.HashMap
;
...
...
@@ -72,11 +73,13 @@ public class CandyCouponController {
@GetMapping
(
"preUse/performance"
)
@ApiOperation
(
"要使用券列表 - 演出"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"BigDecimal"
,
name
=
"priceTotal"
,
value
=
"待支付总金额"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"performanceId"
,
value
=
"演出id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"timeId"
,
value
=
"场次id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"ticketId"
,
value
=
"票id"
,
required
=
true
),
})
public
ResponseDto
<
CandyMyCouponListVo
>
preUseCoupon
(
@RequestParam
(
"performanceId"
)
String
performanceId
,
public
ResponseDto
<
CandyMyCouponListVo
>
preUseCoupon
(
@RequestParam
(
"priceTotal"
)
BigDecimal
priceTotal
,
@RequestParam
(
"performanceId"
)
String
performanceId
,
@RequestParam
(
"timeId"
)
String
timeId
,
@RequestParam
(
"ticketId"
)
String
ticketId
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
...
...
@@ -86,7 +89,7 @@ public class CandyCouponController {
List
<
CandyCouponVo
>
myCoupon
=
ObjectUtil
.
getCandyCouponVoArrayList
();
for
(
CandyUserCouponBasicDto
dtoItem
:
dtoList
)
{
CandyCouponVo
baseVo
=
CouponBaseUtil
.
getPerformanceCouponUserVo
(
dtoItem
,
performanceId
,
timeId
,
ticketId
);
CandyCouponVo
baseVo
=
CouponBaseUtil
.
getPerformanceCouponUserVo
(
dtoItem
,
priceTotal
,
performanceId
,
timeId
,
ticketId
);
if
(
dtoItem
.
getBusiType
().
equals
(
4
))
{
//会员券
memberCoupon
.
add
(
baseVo
);
}
else
{
//非会员券
...
...
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/util/CouponBaseUtil.java
View file @
ef448606
...
...
@@ -7,6 +7,7 @@ import com.liquidnet.service.candy.dto.CandyUserCouponBasicDto;
import
com.liquidnet.service.candy.vo.CandyCouponRulesVo
;
import
com.liquidnet.service.candy.vo.CandyCouponVo
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.List
;
...
...
@@ -60,6 +61,7 @@ public class CouponBaseUtil {
* @return
*/
public
static
CandyCouponVo
getPerformanceCouponUserVo
(
CandyUserCouponBasicDto
dtoItem
,
BigDecimal
priceTotal
,
String
performanceId
,
String
timeId
,
String
ticketId
)
{
...
...
@@ -85,7 +87,20 @@ public class CouponBaseUtil {
voRules
.
setBusiId
(
ruleItem
.
getBusiId
());
voRules
.
setBusiName
(
ruleItem
.
getBusiName
());
rulesVoList
.
add
(
voRules
);
isTarget
=
isTargetCoupon
(
ruleItem
.
getUseScope
(),
ruleItem
.
getBusiId
());
switch
(
ruleItem
.
getUseScope
())
{
case
90
:
//演出
isTarget
=
isTargetCoupon
(
ruleItem
.
getBusiId
(),
performanceId
,
priceTotal
,
dtoItem
.
getValOver
(),
dtoItem
.
getValMinus
());
break
;
case
91
:
//场次
isTarget
=
isTargetCoupon
(
ruleItem
.
getBusiId
(),
timeId
,
priceTotal
,
dtoItem
.
getValOver
(),
dtoItem
.
getValMinus
());
break
;
case
92
:
//票
isTarget
=
isTargetCoupon
(
ruleItem
.
getBusiId
(),
ticketId
,
priceTotal
,
dtoItem
.
getValOver
(),
dtoItem
.
getValMinus
());
break
;
default
:
isTarget
=
false
;
break
;
}
}
//券类别
if
(
dtoItem
.
getBusiType
().
equals
(
3
))
{
...
...
@@ -94,25 +109,32 @@ public class CouponBaseUtil {
vo
.
setCouType
(
dtoItem
.
getCouType
());
}
int
state
=
getCouponState
(
now
,
dtoItem
.
getExpireAt
(),
dtoItem
.
getState
());
if
(
isTarget
)
{
if
(
isTarget
)
{
vo
.
setState
(
state
);
}
else
{
vo
.
setState
(
state
==
1
?
21
:
state
);
//不在目标范围 如果可用改为不可用21
}
else
{
vo
.
setState
(
state
==
1
?
21
:
state
);
//不在目标范围 如果可用改为不可用21
}
vo
.
setUseRules
(
rulesVoList
);
return
vo
;
}
public
static
Boolean
isTargetCoupon
(
Integer
UseScope
,
String
busiId
){
/**
* @param busiId 适用id
* @param targetId 目标id(例如 演出id,场次id,票种id)
* @param priceTotal 待支付总金额
* @param valOver 满减~满
* @param valMinus 满减~减
* @return
*/
public
static
Boolean
isTargetCoupon
(
String
busiId
,
String
targetId
,
BigDecimal
priceTotal
,
BigDecimal
valOver
,
BigDecimal
valMinus
)
{
boolean
isTarget
=
false
;
switch
(
UseScope
){
case
90
:
//演出
break
;
case
91
:
//场次
break
;
case
92
:
//票
break
;
if
(
busiId
.
equals
(
targetId
))
{
//判断id 对应
}
return
isTarget
;
...
...
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