记得上下班打卡 | 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
349452ad
Commit
349452ad
authored
Nov 24, 2021
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+API:券详情;
parent
93e68374
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
241 additions
and
91 deletions
+241
-91
AdamMemberVo.java
.../java/com/liquidnet/service/adam/dto/vo/AdamMemberVo.java
+1
-1
CandyMemberCouponBuildParam.java
.../service/candy/dto/admin/CandyMemberCouponBuildParam.java
+1
-1
CandyMgtCouponBuildParam.java
...net/service/candy/dto/admin/CandyMgtCouponBuildParam.java
+2
-2
BaseController.java
...t/client/admin/common/core/controller/BaseController.java
+4
-1
CandyCouponAdminController.java
...controller/zhengzai/candy/CandyCouponAdminController.java
+37
-3
CandyMgtCouponAdminController.java
...troller/zhengzai/candy/CandyMgtCouponAdminController.java
+98
-75
CandyMgtCouponAdminServiceImpl.java
...ai/candy/service/impl/CandyMgtCouponAdminServiceImpl.java
+1
-1
CandyCouponListParam.java
...quidnet/service/candy/dto/admin/CandyCouponListParam.java
+1
-1
CandyCouponTemplateDto.java
...idnet/service/candy/dto/admin/CandyCouponTemplateDto.java
+82
-0
CandyMgtCouponListParam.java
...dnet/service/candy/dto/admin/CandyMgtCouponListParam.java
+1
-1
CandyCoupon.java
.../java/com/liquidnet/service/candy/entity/CandyCoupon.java
+1
-1
db_ln_candy_initialdata.sql
...idnet-service-candy-impl/docu/db_ln_candy_initialdata.sql
+1
-1
PlatformCandyCouponService.java
...atform/service/impl/candy/PlatformCandyCouponService.java
+11
-3
No files found.
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/dto/vo/AdamMemberVo.java
View file @
349452ad
...
...
@@ -126,7 +126,7 @@ public class AdamMemberVo implements java.io.Serializable, Cloneable {
}
public
AdamMemberVo
copy
(
AdamMember
source
)
{
if
(
null
==
this
)
return
this
;
if
(
null
==
source
)
return
this
;
this
.
setMemberId
(
source
.
getMemberId
());
this
.
setName
(
source
.
getName
());
this
.
setTitle
(
source
.
getTitle
());
...
...
liquidnet-bus-api/liquidnet-service-candy-api/src/main/java/com/liquidnet/service/candy/dto/admin/CandyMemberCouponBuildParam.java
View file @
349452ad
...
...
@@ -41,7 +41,7 @@ public class CandyMemberCouponBuildParam {
@ApiModelProperty
(
required
=
true
,
value
=
"券类型[1-代金券|2-满减券|101-优先券]"
,
allowableValues
=
"1,2,101"
)
private
Integer
couType
;
// @NotNull(message = "券领取方式不能为空")
// @ApiModelProperty(required = true, value = "领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换
]", allowableValues = "0,1
")
// @ApiModelProperty(required = true, value = "领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换
|3-发放需领取]", allowableValues = "0,1,2,3
")
// private Integer bindType;
// @ApiModelProperty(required = false, value = "折扣[8折即0.8]", example = "0.8")
// private BigDecimal discount;
...
...
liquidnet-bus-api/liquidnet-service-candy-api/src/main/java/com/liquidnet/service/candy/dto/admin/CandyMgtCouponBuildParam.java
View file @
349452ad
...
...
@@ -25,10 +25,10 @@ public class CandyMgtCouponBuildParam {
@ApiModelProperty
(
required
=
true
,
value
=
"业务类别[0-全场|1-演出|2-商品|3-优先购]"
,
allowableValues
=
"0,1,2,3"
)
private
Integer
busiType
;
@NotNull
(
message
=
"券类型不能为空"
)
@ApiModelProperty
(
required
=
true
,
value
=
"券类型[1-代金券|2-满减券|3-兑换券|4-折扣券
|
101-优先券]"
,
allowableValues
=
"1,2,3,4,101"
)
@ApiModelProperty
(
required
=
true
,
value
=
"券类型[1-代金券|2-满减券|3-兑换券|4-折扣券
|
101-优先券]"
,
allowableValues
=
"1,2,3,4,101"
)
private
Integer
couType
;
@NotNull
(
message
=
"券领取方式不能为空"
)
@ApiModelProperty
(
required
=
true
,
value
=
"领取方式[0-用户输入兑换|1-发放至用户|2-积分
兑换]"
,
allowableValues
=
"0,1,2
"
)
@ApiModelProperty
(
required
=
true
,
value
=
"领取方式[0-用户输入兑换|1-发放至用户|2-积分
商品|3-发送需领取]"
,
allowableValues
=
"0,1,2,3
"
)
private
Integer
bindType
;
@ApiModelProperty
(
required
=
false
,
value
=
"折扣[8折即0.8]"
,
example
=
"0.8"
)
private
BigDecimal
discount
;
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-common/src/main/java/com/liquidnet/client/admin/common/core/controller/BaseController.java
View file @
349452ad
...
...
@@ -56,10 +56,13 @@ public class BaseController
PageDomain
pageDomain
=
TableSupport
.
buildPageRequest
();
Integer
pageNum
=
pageDomain
.
getPageNum
();
Integer
pageSize
=
pageDomain
.
getPageSize
();
String
orderBy
=
SqlUtil
.
escapeOrderBySql
(
pageDomain
.
getOrderBy
());
if
(
StringUtils
.
isNotNull
(
pageNum
)
&&
StringUtils
.
isNotNull
(
pageSize
))
{
String
orderBy
=
SqlUtil
.
escapeOrderBySql
(
pageDomain
.
getOrderBy
());
//
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
PageHelper
.
startPage
(
pageNum
,
pageSize
,
orderBy
);
}
else
{
PageHelper
.
startPage
(
1
,
10
,
orderBy
);
}
}
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/candy/CandyCouponAdminController.java
View file @
349452ad
package
com
.
liquidnet
.
client
.
admin
.
web
.
controller
.
zhengzai
.
candy
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.liquidnet.client.admin.common.core.controller.BaseController
;
import
com.liquidnet.client.admin.common.core.
page.TableDataInfo
;
import
com.liquidnet.client.admin.common.core.
domain.AjaxResult
;
import
com.liquidnet.client.admin.zhengzai.candy.service.ICandyCouponAdminService
;
import
com.liquidnet.client.admin.zhengzai.candy.service.ICandyCouponRuleAdminService
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.candy.dto.admin.CandyCouponListParam
;
import
com.liquidnet.service.candy.dto.admin.CandyCouponTemplateDto
;
import
com.liquidnet.service.candy.entity.CandyCoupon
;
import
com.liquidnet.service.candy.entity.CandyCouponRule
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.List
;
@Api
(
tags
=
"我的券包"
)
@Controller
@RequestMapping
(
"candy/coupon"
)
public
class
CandyCouponAdminController
extends
BaseController
{
@Autowired
ICandyCouponAdminService
candyCouponAdminService
;
@Autowired
ICandyCouponRuleAdminService
candyCouponRuleAdminService
;
@ApiOperation
(
value
=
"券列表"
)
@PostMapping
(
"list"
)
@ResponseBody
public
TableDataInfo
list
(
CandyCouponListParam
listParam
)
{
public
String
list
(
CandyCouponListParam
listParam
)
{
LambdaQueryWrapper
<
CandyCoupon
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
CandyCoupon
.
class
);
queryWrapper
.
select
(
CandyCoupon:
:
getCouponId
,
CandyCoupon:
:
getTitle
);
queryWrapper
.
orderByDesc
(
CandyCoupon:
:
getCreatedAt
);
...
...
@@ -44,6 +58,26 @@ public class CandyCouponAdminController extends BaseController {
}
startPage
();
return
getDataTable
(
candyCouponAdminService
.
list
(
queryWrapper
));
return
JsonUtils
.
toJson
(
getDataTable
(
candyCouponAdminService
.
list
(
queryWrapper
)));
}
@ApiOperation
(
value
=
"券详情"
)
@GetMapping
(
"info"
)
@ResponseBody
public
AjaxResult
info
(
String
couponId
)
{
CandyCouponTemplateDto
couponTemplateDto
=
CandyCouponTemplateDto
.
getNew
();
LambdaQueryWrapper
<
CandyCoupon
>
couponLambdaQueryWrapper
=
Wrappers
.
lambdaQuery
();
couponLambdaQueryWrapper
.
eq
(
CandyCoupon:
:
getCouponId
,
couponId
);
couponLambdaQueryWrapper
.
eq
(
CandyCoupon:
:
getState
,
1
);
CandyCoupon
coupon
=
candyCouponAdminService
.
getOne
(
couponLambdaQueryWrapper
);
LambdaUpdateWrapper
<
CandyCouponRule
>
couponRuleLambdaUpdateWrapper
=
Wrappers
.
lambdaUpdate
(
CandyCouponRule
.
class
);
couponRuleLambdaUpdateWrapper
.
eq
(
CandyCouponRule:
:
getCouponId
,
couponId
);
couponRuleLambdaUpdateWrapper
.
eq
(
CandyCouponRule:
:
getState
,
1
);
List
<
CandyCouponRule
>
couponRuleList
=
candyCouponRuleAdminService
.
list
(
couponRuleLambdaUpdateWrapper
);
couponTemplateDto
.
setUseRules
(
couponRuleList
);
return
AjaxResult
.
success
(
couponTemplateDto
.
copy
(
coupon
));
}
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/candy/CandyMgtCouponAdminController.java
View file @
349452ad
This diff is collapsed.
Click to expand it.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/candy/service/impl/CandyMgtCouponAdminServiceImpl.java
View file @
349452ad
...
...
@@ -73,7 +73,7 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa
initCoupon
.
setExclusive
(
1
);
initCoupon
.
setBusiType
(
parameter
.
getBusiType
());
initCoupon
.
setCouType
(
parameter
.
getCouType
());
initCoupon
.
setBindType
(
1
);
// 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换]
initCoupon
.
setBindType
(
1
);
// 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换
|3-发放需领取
]
//initCoupon.setDiscount();
initCoupon
.
setValFace
(
parameter
.
getValFace
());
initCoupon
.
setValOver
(
parameter
.
getValOver
());
...
...
liquidnet-bus-do/liquidnet-service-candy-do/src/main/java/com/liquidnet/service/candy/dto/admin/CandyCouponListParam.java
View file @
349452ad
...
...
@@ -10,7 +10,7 @@ public class CandyCouponListParam {
*/
private
String
keyword
;
/**
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换]
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换
|3-发放需领取
]
*/
private
Integer
bindType
;
/**
...
...
liquidnet-bus-do/liquidnet-service-candy-do/src/main/java/com/liquidnet/service/candy/dto/admin/CandyCouponTemplateDto.java
0 → 100644
View file @
349452ad
package
com
.
liquidnet
.
service
.
candy
.
dto
.
admin
;
import
com.liquidnet.service.candy.entity.CandyCoupon
;
import
com.liquidnet.service.candy.entity.CandyCouponRule
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.List
;
@Data
public
class
CandyCouponTemplateDto
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
6278406576442685501L
;
/* com.liquidnet.service.candy.entity.CandyCoupon */
private
String
couponId
;
private
Integer
state
;
private
String
title
;
private
String
label
;
private
String
notice
;
private
Integer
exclusive
;
private
Integer
busiType
;
private
Integer
couType
;
private
Integer
bindType
;
private
BigDecimal
discount
;
private
BigDecimal
valFace
;
private
BigDecimal
valOver
;
private
BigDecimal
valMinus
;
private
Integer
overlay
;
private
Integer
overlayLevel
;
private
Integer
validity
;
private
Integer
redeemValidity
;
private
LocalDateTime
redeemStart
;
private
LocalDateTime
redeemStop
;
private
LocalDateTime
effectAt
;
private
LocalDateTime
expireAt
;
//private String operator;
//private LocalDateTime createdAt;
//private LocalDateTime updatedAt;
//private String comment;
/* com.liquidnet.service.candy.entity.CandyCouponRule */
private
List
<
CandyCouponRule
>
useRules
;
private
static
final
CandyCouponTemplateDto
obj
=
new
CandyCouponTemplateDto
();
public
static
CandyCouponTemplateDto
getNew
()
{
try
{
return
(
CandyCouponTemplateDto
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
CandyCouponTemplateDto
();
}
}
public
CandyCouponTemplateDto
copy
(
CandyCoupon
source
)
{
if
(
null
==
source
)
return
this
;
this
.
setCouponId
(
source
.
getCouponId
());
this
.
setState
(
source
.
getState
());
this
.
setTitle
(
source
.
getTitle
());
this
.
setLabel
(
source
.
getLabel
());
this
.
setNotice
(
source
.
getNotice
());
this
.
setExclusive
(
source
.
getExclusive
());
this
.
setBusiType
(
source
.
getBusiType
());
this
.
setCouType
(
source
.
getCouType
());
this
.
setBindType
(
source
.
getBindType
());
this
.
setDiscount
(
source
.
getDiscount
());
this
.
setValFace
(
source
.
getValFace
());
this
.
setValOver
(
source
.
getValOver
());
this
.
setValMinus
(
source
.
getValMinus
());
this
.
setOverlay
(
source
.
getOverlay
());
this
.
setOverlayLevel
(
source
.
getOverlayLevel
());
this
.
setValidity
(
source
.
getValidity
());
this
.
setRedeemValidity
(
source
.
getRedeemValidity
());
this
.
setRedeemStart
(
source
.
getRedeemStart
());
this
.
setRedeemStop
(
source
.
getRedeemStop
());
this
.
setEffectAt
(
source
.
getEffectAt
());
this
.
setExpireAt
(
source
.
getExpireAt
());
return
this
;
}
}
liquidnet-bus-do/liquidnet-service-candy-do/src/main/java/com/liquidnet/service/candy/dto/admin/CandyMgtCouponListParam.java
View file @
349452ad
...
...
@@ -12,7 +12,7 @@ public class CandyMgtCouponListParam {
*/
private
String
keyword
;
/**
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换]
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换
|3-发放需领取
]
*/
private
Integer
bindType
;
/**
...
...
liquidnet-bus-do/liquidnet-service-candy-do/src/main/java/com/liquidnet/service/candy/entity/CandyCoupon.java
View file @
349452ad
...
...
@@ -65,7 +65,7 @@ public class CandyCoupon implements Serializable {
private
Integer
couType
;
/**
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换]
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换
|3-发放需领取
]
*/
private
Integer
bindType
;
...
...
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/docu/db_ln_candy_initialdata.sql
View file @
349452ad
...
...
@@ -39,7 +39,7 @@ create table candy_coupon
exclusive
smallint
comment
'专享标识[0-常规|1-会员礼包]'
,
busi_type
smallint
comment
'业务类别[0-全场|1-演出|2-商品|3-优先购]'
,
cou_type
smallint
comment
'券类型[1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]'
,
bind_type
smallint
comment
'领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换]'
,
bind_type
smallint
comment
'领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换
|3-发放需领取
]'
,
discount
decimal
(
8
,
2
)
comment
'折扣[8折即0.8]'
,
val_face
decimal
(
8
,
2
)
comment
'面值'
,
...
...
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/candy/PlatformCandyCouponService.java
View file @
349452ad
...
...
@@ -55,7 +55,7 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
String
couponInfoDtoKey
=
CandyRedisConst
.
BASIC_COUPON_INFO
.
concat
(
couponInfoDto
.
getCouponId
());
redisDataSourceUtil
.
getRedisCandyUtil
().
set
(
couponInfoDtoKey
,
couponInfoDto
);
switch
(
coupon
.
getBindType
())
{
// 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换]
switch
(
coupon
.
getBindType
())
{
// 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换
|3-发放需领取
]
case
0
:
this
.
processingCouponCode
(
mgtCoupon
,
coupon
);
break
;
...
...
@@ -75,6 +75,7 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
// break;
// }
// break;
case
3
:
// 新增券领取类型(3-发放需领取)处理逻辑同(1-发放至用户|2-积分兑换)
case
2
:
// TODO: 2021/11/9 PM上线前临时加的券领取类型(2-积分兑换),这里`1-发放至用户|2-积分兑换`做同逻辑处理
switch
(
mgtCoupon
.
getEventType
())
{
// 发放类型[1-会员|2-手机号|10-全体用户]
case
1
:
...
...
@@ -209,6 +210,8 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
int
totalCount
=
userMemberCount
,
eventAmt
=
mgtCoupon
.
getEventAmt
();
log
.
info
(
"发放券处理中:目标全体会员[总数:{},发放量:{}]"
,
userMemberCount
,
eventAmt
);
// 会员权益券失效时间duedAt需要同步会员到期时间expiryAt
boolean
isMemberRightsCoupon
=
coupon
.
getExclusive
()
==
1
;
queryWrapper
.
select
(
AdamUserMember:
:
getUid
).
orderByAsc
(
AdamUserMember:
:
getMid
);
while
(
totalCount
>
0
)
{
initUserCouponList
.
clear
();
...
...
@@ -216,7 +219,7 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
LambdaQueryWrapper
<
AdamUserMember
>
userMemberLambdaQueryWrapper
=
queryWrapper
.
clone
();
String
lastLimitSql
=
"LIMIT "
+
(
num
*
pSize
)
+
","
+
pSize
;
userMemberLambdaQueryWrapper
.
last
(
lastLimitSql
);
List
<
AdamUserMember
>
userMemberList
=
platformAdamUserMemberService
.
list
(
q
ueryWrapper
);
List
<
AdamUserMember
>
userMemberList
=
platformAdamUserMemberService
.
list
(
userMemberLambdaQ
ueryWrapper
);
int
userMemberListSize
=
CollectionUtils
.
isEmpty
(
userMemberList
)
?
-
1
:
userMemberList
.
size
();
for
(
int
j
=
0
;
j
<
eventAmt
;
j
++)
{
...
...
@@ -230,7 +233,12 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
userCoupon
.
setCouponId
(
coupon
.
getCouponId
());
userCoupon
.
setState
(
1
);
userCoupon
.
setBindAt
(
coupon
.
getEffectAt
());
userCoupon
.
setDuedAt
(
coupon
.
getExpireAt
());
// userCoupon.setDuedAt(coupon.getExpireAt());
if
(
isMemberRightsCoupon
)
{
userCoupon
.
setDuedAt
(
userMember
.
getExpiryAt
());
}
else
{
userCoupon
.
setDuedAt
(
coupon
.
getExpireAt
());
}
userCoupon
.
setCreatedAt
(
now
);
initUserCouponList
.
add
(
userCoupon
);
...
...
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