记得上下班打卡 | 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
b244d600
Commit
b244d600
authored
Dec 12, 2021
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pre' into 'master'
Pre See merge request
!134
parents
b229fd66
6c7fe5c6
Changes
99
Hide whitespace changes
Inline
Side-by-side
Showing
99 changed files
with
3383 additions
and
1261 deletions
+3383
-1261
20210927_member_voucher_refund.sql
docu/20210927_member_voucher_refund.sql
+2
-2
AdamRedisConst.java
...a/com/liquidnet/service/adam/constant/AdamRedisConst.java
+1
-1
CandyMemberCouponBuildParam.java
.../service/candy/dto/admin/CandyMemberCouponBuildParam.java
+1
-1
CandyCouponBasicVo.java
...va/com/liquidnet/service/candy/vo/CandyCouponBasicVo.java
+1
-1
CandyCouponPreviewVo.java
.../com/liquidnet/service/candy/vo/CandyCouponPreviewVo.java
+53
-0
CandyCouponVo.java
...in/java/com/liquidnet/service/candy/vo/CandyCouponVo.java
+1
-1
pom.xml
liquidnet-bus-api/liquidnet-service-sweet-api/pom.xml
+5
-0
StatusConst.java
...ava/com/liquidnet/service/sweet/constant/StatusConst.java
+20
-0
SweetConstant.java
...a/com/liquidnet/service/sweet/constant/SweetConstant.java
+3
-2
SweetIntegralActivityFromParam.java
...sweet/dto/param/admin/SweetIntegralActivityFromParam.java
+10
-0
SweetIntegralActivityPrizeFormParam.java
.../dto/param/admin/SweetIntegralActivityPrizeFormParam.java
+9
-9
SweetIntegralActivityPrizeRelationFormParam.java
...am/admin/SweetIntegralActivityPrizeRelationFormParam.java
+62
-0
IntegralActivityDrawVo.java
...iquidnet/service/sweet/dto/vo/IntegralActivityDrawVo.java
+4
-4
IntegralActivityPrizeApiVo.java
...dnet/service/sweet/dto/vo/IntegralActivityPrizeApiVo.java
+63
-0
IntegralActivityPrizeRelationVo.java
...service/sweet/dto/vo/IntegralActivityPrizeRelationVo.java
+53
-0
IntegralActivityPrizeVo.java
...quidnet/service/sweet/dto/vo/IntegralActivityPrizeVo.java
+87
-0
IntegralActivityVo.java
...om/liquidnet/service/sweet/dto/vo/IntegralActivityVo.java
+15
-2
SweetIntegralActivityPrizeVo.java
...vice/sweet/dto/vo/admin/SweetIntegralActivityPrizeVo.java
+8
-8
SweetIntegralActivityVo.java
...t/service/sweet/dto/vo/admin/SweetIntegralActivityVo.java
+8
-0
SweetStoneIntegralParam.java
...iquidnet/service/sweet/param/SweetStoneIntegralParam.java
+36
-0
ISweetIntegralActivityDrawService.java
...vice/sweet/service/ISweetIntegralActivityDrawService.java
+9
-4
ISweetIntegralActivityService.java
.../service/sweet/service/ISweetIntegralActivityService.java
+4
-0
SweetNewObjectUtil.java
...com/liquidnet/service/sweet/utils/SweetNewObjectUtil.java
+6
-1
BaseController.java
...t/client/admin/common/core/controller/BaseController.java
+15
-5
CandyCouponAdminController.java
...controller/zhengzai/candy/CandyCouponAdminController.java
+25
-39
CandyMgtCouponAdminController.java
...troller/zhengzai/candy/CandyMgtCouponAdminController.java
+3
-3
SweetIntegralActivityDrawController.java
...r/zhengzai/sweet/SweetIntegralActivityDrawController.java
+3
-3
SweetIntegralActivityPrizeRelationController.java
...i/sweet/SweetIntegralActivityPrizeRelationController.java
+85
-0
remote-search-coupon-list.js
...src/main/resources/static/js/remote-search-coupon-list.js
+176
-0
include.html
...lient-admin-web/src/main/resources/templates/include.html
+2
-0
info.html
...c/main/resources/templates/zhengzai/adam/member/info.html
+9
-2
form.html
...urces/templates/zhengzai/sweet/integralActivity/form.html
+932
-522
list.html
...urces/templates/zhengzai/sweet/integralActivity/list.html
+20
-9
list.html
...s/templates/zhengzai/sweet/integralActivityDraw/list.html
+0
-12
ICandyCouponAdminService.java
...dmin/zhengzai/candy/service/ICandyCouponAdminService.java
+6
-0
CandyCouponAdminServiceImpl.java
...ngzai/candy/service/impl/CandyCouponAdminServiceImpl.java
+11
-0
CandyMgtCouponAdminServiceImpl.java
...ai/candy/service/impl/CandyMgtCouponAdminServiceImpl.java
+23
-4
SweetActivityDrawExcelListDao.java
...min/zhengzai/sweet/dto/SweetActivityDrawExcelListDao.java
+2
-25
ISweetIntegralActivityPrizeRelationService.java
...t/service/ISweetIntegralActivityPrizeRelationService.java
+25
-0
SweetIntegralActivityDrawServiceImpl.java
...et/service/impl/SweetIntegralActivityDrawServiceImpl.java
+2
-15
SweetIntegralActivityPrizeRelationServiceImpl.java
...e/impl/SweetIntegralActivityPrizeRelationServiceImpl.java
+173
-0
SweetIntegralActivityServiceImpl.java
.../sweet/service/impl/SweetIntegralActivityServiceImpl.java
+141
-40
SweetObjectAdminUtil.java
...ient/admin/zhengzai/sweet/utils/SweetObjectAdminUtil.java
+10
-0
SweetRedisAdminUtils.java
...ient/admin/zhengzai/sweet/utils/SweetRedisAdminUtils.java
+52
-17
MQConst.java
...ain/java/com/liquidnet/service/base/constant/MQConst.java
+2
-1
application-dev.yml
liquidnet-bus-config/liquidnet-config/application-dev.yml
+1
-1
liquidnet-service-sweet.yml
...t-bus-config/liquidnet-config/liquidnet-service-sweet.yml
+2
-0
CandyCouponRuleDto.java
...a/com/liquidnet/service/candy/dto/CandyCouponRuleDto.java
+11
-0
CandyCouponFilterDto.java
...quidnet/service/candy/dto/admin/CandyCouponFilterDto.java
+11
-8
CandyCouponListParam.java
...quidnet/service/candy/dto/admin/CandyCouponListParam.java
+1
-1
CandyMgtCouponListParam.java
...dnet/service/candy/dto/admin/CandyMgtCouponListParam.java
+1
-1
CandyCoupon.java
.../java/com/liquidnet/service/candy/entity/CandyCoupon.java
+1
-1
CandyMgtCoupon.java
...va/com/liquidnet/service/candy/entity/CandyMgtCoupon.java
+5
-0
CandyCouponMapper.java
...com/liquidnet/service/candy/mapper/CandyCouponMapper.java
+5
-0
CandyCouponMapper.xml
.../com/liquidnet/service/candy/mapper/CandyCouponMapper.xml
+33
-0
CandyMgtCouponMapper.xml
...m/liquidnet/service/candy/mapper/CandyMgtCouponMapper.xml
+1
-1
SweetActivityDrawListDao.java
...liquidnet/service/sweet/dto/SweetActivityDrawListDao.java
+2
-2
SweetIntegralActivityDto.java
...liquidnet/service/sweet/dto/SweetIntegralActivityDto.java
+33
-7
SweetIntegralActivityDrawListSearchParam.java
...t/dto/admin/SweetIntegralActivityDrawListSearchParam.java
+0
-3
SweetIntegralActivity.java
...liquidnet/service/sweet/entity/SweetIntegralActivity.java
+10
-0
SweetIntegralActivityDraw.java
...idnet/service/sweet/entity/SweetIntegralActivityDraw.java
+2
-2
SweetIntegralActivityPrize.java
...dnet/service/sweet/entity/SweetIntegralActivityPrize.java
+12
-14
SweetIntegralActivityPrizeRelation.java
...vice/sweet/entity/SweetIntegralActivityPrizeRelation.java
+68
-0
SweetIntegralActivityDrawMapper.java
...service/sweet/mapper/SweetIntegralActivityDrawMapper.java
+6
-0
SweetIntegralActivityPrizeMapper.java
...ervice/sweet/mapper/SweetIntegralActivityPrizeMapper.java
+3
-0
SweetIntegralActivityPrizeRelationMapper.java
...weet/mapper/SweetIntegralActivityPrizeRelationMapper.java
+16
-0
SweetIntegralActivityDrawMapper.xml
....service.sweet.mapper/SweetIntegralActivityDrawMapper.xml
+28
-5
SweetIntegralActivityMapper.xml
...dnet.service.sweet.mapper/SweetIntegralActivityMapper.xml
+11
-2
SweetIntegralActivityPrizeMapper.xml
...service.sweet.mapper/SweetIntegralActivityPrizeMapper.xml
+20
-0
FeignAdamBaseClient.java
...liquidnet/service/feign/adam/api/FeignAdamBaseClient.java
+3
-0
pom.xml
liquidnet-bus-feign/liquidnet-api-feign-candy/pom.xml
+27
-0
FeignCandyBaseClient.java
...quidnet/service/feign/candy/api/FeignCandyBaseClient.java
+26
-0
FeignSweetTaskClient.java
...uidnet/service/feign/sweet/task/FeignSweetTaskClient.java
+6
-3
pom.xml
liquidnet-bus-feign/pom.xml
+1
-0
db_ln_candy_initialdata.sql
...idnet-service-candy-impl/docu/db_ln_candy_initialdata.sql
+4
-3
CandyRscController.java
...iquidnet/service/candy/controller/CandyRscController.java
+18
-6
ObjectUtil.java
...ain/java/com/liquidnet/service/candy/util/ObjectUtil.java
+12
-3
pom.xml
...ice-consumer-all/liquidnet-service-consumer-sweet/pom.xml
+5
-0
ServiceConsumerSweetApplication.java
...om/liquidnet/service/ServiceConsumerSweetApplication.java
+2
-0
ConsumerSweetOtherApiStreamConfig.java
...sumer/sweet/config/ConsumerSweetOtherApiStreamConfig.java
+108
-0
ConsumerSweetStoneIntegralReceiver.java
...er/sweet/receiver/ConsumerSweetStoneIntegralReceiver.java
+96
-0
SweetTaskHandler.java
...idnet/service/executor/main/handler/SweetTaskHandler.java
+26
-0
KylinPerformancesServiceImpl.java
...vice/kylin/service/impl/KylinPerformancesServiceImpl.java
+0
-1
DataUtils.java
...ain/java/com/liquidnet/service/kylin/utils/DataUtils.java
+0
-5
PlatformCandyCouponService.java
...atform/service/impl/candy/PlatformCandyCouponService.java
+69
-33
db_sweet_integral_activity_20211020.sql
...ervice-sweet/docu/db_sweet_integral_activity_20211020.sql
+41
-20
redis_queue_create.txt
...rvice/liquidnet-service-sweet/docu/redis_queue_create.txt
+3
-0
pom.xml
liquidnet-bus-service/liquidnet-service-sweet/pom.xml
+5
-0
MybatisPlusCodeGenerator.java
.../java/com/liquidnet/service/MybatisPlusCodeGenerator.java
+0
-103
SweetMathUtil.java
...et/src/main/java/com/liquidnet/service/SweetMathUtil.java
+7
-3
SweetMybatisPlusCodeGenerator.java
.../com/liquidnet/service/SweetMybatisPlusCodeGenerator.java
+2
-2
SweetIntegralActivityController.java
...ice/sweet/controller/SweetIntegralActivityController.java
+13
-5
SweetIntegralActivityDrawController.java
...sweet/controller/SweetIntegralActivityDrawController.java
+33
-6
SweetIntegralActivityDrawServiceImpl.java
...et/service/impl/SweetIntegralActivityDrawServiceImpl.java
+245
-124
SweetIntegralActivityServiceImpl.java
.../sweet/service/impl/SweetIntegralActivityServiceImpl.java
+77
-3
SweetWechatLoginServiceImpl.java
...rvice/sweet/service/impl/SweetWechatLoginServiceImpl.java
+2
-1
RedisDataUtils.java
...ava/com/liquidnet/service/sweet/utils/RedisDataUtils.java
+84
-96
errors.properties
...uidnet-service-sweet/src/main/resources/errors.properties
+3
-54
sqlmap.properties
...uidnet-service-sweet/src/main/resources/sqlmap.properties
+4
-9
No files found.
docu/20210927_member_voucher_refund.sql
View file @
b244d600
...
@@ -174,7 +174,7 @@ create table candy_mgt_coupon
...
@@ -174,7 +174,7 @@ create table candy_mgt_coupon
coupon_id
varchar
(
64
)
not
null
comment
'~candy_coupon.coupon_id'
,
coupon_id
varchar
(
64
)
not
null
comment
'~candy_coupon.coupon_id'
,
state
tinyint
comment
'发放状态[0-未发放|1-已发放|2-无效|3-已取消|9-发放中|10-会员礼包初始模版]'
,
state
tinyint
comment
'发放状态[0-未发放|1-已发放|2-无效|3-已取消|9-发放中|10-会员礼包初始模版]'
,
#
bind_type
smallint
comment
'领取方式[0-用户输入兑换|1-发放至用户|2-积分
兑换
]'
,
#
bind_type
smallint
comment
'领取方式[0-用户输入兑换|1-发放至用户|2-积分
商品
]'
,
event_amt
int
comment
'发放量'
,
event_amt
int
comment
'发放量'
,
event_type
tinyint
comment
'发放类型[0-保留|1-会员|2-手机号|10-全体用户]'
,
event_type
tinyint
comment
'发放类型[0-保留|1-会员|2-手机号|10-全体用户]'
,
event_limit
text
comment
'`发放类型`为2-手机号时发放手机号以,分隔'
,
event_limit
text
comment
'`发放类型`为2-手机号时发放手机号以,分隔'
,
...
@@ -203,7 +203,7 @@ create table candy_coupon
...
@@ -203,7 +203,7 @@ create table candy_coupon
exclusive
smallint
comment
'专享标识[0-常规|1-会员礼包]'
,
exclusive
smallint
comment
'专享标识[0-常规|1-会员礼包]'
,
busi_type
smallint
comment
'业务类别[0-全场|1-演出|2-商品|3-优先购]'
,
busi_type
smallint
comment
'业务类别[0-全场|1-演出|2-商品|3-优先购]'
,
cou_type
smallint
comment
'券类型[1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]'
,
cou_type
smallint
comment
'券类型[1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]'
,
bind_type
smallint
comment
'领取方式[0-用户输入兑换|1-发放至用户|2-积分
兑换
]'
,
bind_type
smallint
comment
'领取方式[0-用户输入兑换|1-发放至用户|2-积分
商品
]'
,
discount
decimal
(
8
,
2
)
comment
'折扣[8折即0.8]'
,
discount
decimal
(
8
,
2
)
comment
'折扣[8折即0.8]'
,
val_face
decimal
(
8
,
2
)
comment
'面值'
,
val_face
decimal
(
8
,
2
)
comment
'面值'
,
...
...
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/constant/AdamRedisConst.java
View file @
b244d600
...
@@ -54,7 +54,7 @@ public class AdamRedisConst {
...
@@ -54,7 +54,7 @@ public class AdamRedisConst {
public
static
final
String
INCR_MEMBER_NO
=
PREFIX
.
concat
(
"incr:member_no"
);
public
static
final
String
INCR_MEMBER_NO
=
PREFIX
.
concat
(
"incr:member_no"
);
public
static
final
String
INCR_MEMBER_LIMITATION
=
PREFIX
.
concat
(
"incr:member_limitation"
);
public
static
final
String
INCR_MEMBER_LIMITATION
=
PREFIX
.
concat
(
"incr:member_limitation"
);
public
static
final
String
SWITCH_BUY_MEMBER
=
PREFIX
.
concat
(
"switch:buy:member"
);
//
public static final String SWITCH_BUY_MEMBER = PREFIX.concat("switch:buy:member");
public
static
final
String
SERIAL_NUMBER_MEMBER
=
PREFIX
.
concat
(
"serial_no:"
);
public
static
final
String
SERIAL_NUMBER_MEMBER
=
PREFIX
.
concat
(
"serial_no:"
);
...
...
liquidnet-bus-api/liquidnet-service-candy-api/src/main/java/com/liquidnet/service/candy/dto/admin/CandyMemberCouponBuildParam.java
View file @
b244d600
...
@@ -41,7 +41,7 @@ public class CandyMemberCouponBuildParam {
...
@@ -41,7 +41,7 @@ public class CandyMemberCouponBuildParam {
@ApiModelProperty
(
required
=
true
,
value
=
"券类型[1-代金券|2-满减券|101-优先券]"
,
allowableValues
=
"1,2,101"
)
@ApiModelProperty
(
required
=
true
,
value
=
"券类型[1-代金券|2-满减券|101-优先券]"
,
allowableValues
=
"1,2,101"
)
private
Integer
couType
;
private
Integer
couType
;
// @NotNull(message = "券领取方式不能为空")
// @NotNull(message = "券领取方式不能为空")
// @ApiModelProperty(required = true, value = "领取方式[0-用户输入兑换|1-发放至用户|2-积分
兑换
|3-发放需领取|4-会员专属]", allowableValues = "0,1,2,3,4")
// @ApiModelProperty(required = true, value = "领取方式[0-用户输入兑换|1-发放至用户|2-积分
商品
|3-发放需领取|4-会员专属]", allowableValues = "0,1,2,3,4")
// private Integer bindType;
// private Integer bindType;
// @ApiModelProperty(required = false, value = "折扣[8折即0.8]", example = "0.8")
// @ApiModelProperty(required = false, value = "折扣[8折即0.8]", example = "0.8")
// private BigDecimal discount;
// private BigDecimal discount;
...
...
liquidnet-bus-api/liquidnet-service-candy-api/src/main/java/com/liquidnet/service/candy/vo/CandyCouponBasicVo.java
View file @
b244d600
...
@@ -23,7 +23,7 @@ public class CandyCouponBasicVo implements Serializable, Cloneable {
...
@@ -23,7 +23,7 @@ public class CandyCouponBasicVo implements Serializable, Cloneable {
private
Integer
busiType
;
private
Integer
busiType
;
@ApiModelProperty
(
value
=
"券类型[1-代金券|2-满减券|3-兑换券|4-折扣券 | 101-优先券]"
)
@ApiModelProperty
(
value
=
"券类型[1-代金券|2-满减券|3-兑换券|4-折扣券 | 101-优先券]"
)
private
Integer
couType
;
private
Integer
couType
;
@ApiModelProperty
(
value
=
"[0-用户输入兑换|1-发放至用户|2-积分
兑换
|3-发放需领取|4-会员专属]"
)
@ApiModelProperty
(
value
=
"[0-用户输入兑换|1-发放至用户|2-积分
商品
|3-发放需领取|4-会员专属]"
)
private
Integer
bindType
;
private
Integer
bindType
;
@ApiModelProperty
(
value
=
"折扣"
)
@ApiModelProperty
(
value
=
"折扣"
)
private
BigDecimal
discount
;
private
BigDecimal
discount
;
...
...
liquidnet-bus-api/liquidnet-service-candy-api/src/main/java/com/liquidnet/service/candy/vo/CandyCouponPreviewVo.java
0 → 100644
View file @
b244d600
package
com
.
liquidnet
.
service
.
candy
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.List
;
@Data
@ApiModel
public
class
CandyCouponPreviewVo
implements
Serializable
,
Cloneable
{
/* --- --- --- CandyCoupon */
private
String
couponId
;
@ApiModelProperty
(
value
=
"标题"
)
private
String
title
;
@ApiModelProperty
(
value
=
"标注"
)
private
String
label
;
@ApiModelProperty
(
value
=
"须知"
)
private
String
notice
;
@ApiModelProperty
(
value
=
"业务类别[0-全场|1-演出|2-商品|3-优先购]"
)
private
Integer
busiType
;
@ApiModelProperty
(
value
=
"券类型[1-代金券|2-满减券|3-兑换券|4-折扣券 | 101-优先券]"
)
private
Integer
couType
;
@ApiModelProperty
(
value
=
"[0-用户输入兑换|1-发放至用户|2-积分商品|3-发放需领取|4-会员专属]"
)
private
Integer
bindType
;
@ApiModelProperty
(
value
=
"折扣"
)
private
BigDecimal
discount
;
@ApiModelProperty
(
value
=
"面值"
)
private
BigDecimal
valFace
;
@ApiModelProperty
(
value
=
"满减~满"
)
private
BigDecimal
valOver
;
@ApiModelProperty
(
value
=
"满减~减"
)
private
BigDecimal
valMinus
;
@ApiModelProperty
(
value
=
"有效天数"
)
private
Integer
validity
;
@ApiModelProperty
(
value
=
"兑换有效天数"
)
private
Integer
redeemValidity
;
/* --- --- --- CandyCouponRule */
private
List
<
CandyCouponRulesVo
>
useRules
;
private
static
final
CandyCouponPreviewVo
obj
=
new
CandyCouponPreviewVo
();
public
static
CandyCouponPreviewVo
getNew
()
{
try
{
return
(
CandyCouponPreviewVo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
CandyCouponPreviewVo
();
}
}
}
liquidnet-bus-api/liquidnet-service-candy-api/src/main/java/com/liquidnet/service/candy/vo/CandyCouponVo.java
View file @
b244d600
...
@@ -29,7 +29,7 @@ public class CandyCouponVo implements Serializable, Cloneable {
...
@@ -29,7 +29,7 @@ public class CandyCouponVo implements Serializable, Cloneable {
private
Integer
busiType
;
private
Integer
busiType
;
@ApiModelProperty
(
value
=
"券类型[1-代金券|2-满减券|3-兑换券|4-折扣券 | 101-优先券]"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"券类型[1-代金券|2-满减券|3-兑换券|4-折扣券 | 101-优先券]"
,
example
=
"1"
)
private
Integer
couType
;
private
Integer
couType
;
@ApiModelProperty
(
value
=
"[0-用户输入兑换|1-发放至用户|2-积分
兑换
|3-发放需领取|4-会员专属]"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"[0-用户输入兑换|1-发放至用户|2-积分
商品
|3-发放需领取|4-会员专属]"
,
example
=
"1"
)
private
Integer
bindType
;
private
Integer
bindType
;
@ApiModelProperty
(
value
=
"折扣 可null"
,
example
=
"0.5"
)
@ApiModelProperty
(
value
=
"折扣 可null"
,
example
=
"0.5"
)
private
BigDecimal
discount
;
private
BigDecimal
discount
;
...
...
liquidnet-bus-api/liquidnet-service-sweet-api/pom.xml
View file @
b244d600
...
@@ -35,6 +35,11 @@
...
@@ -35,6 +35,11 @@
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
com.liquidnet
</groupId>
<artifactId>
liquidnet-service-candy-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/constant/StatusConst.java
0 → 100644
View file @
b244d600
package
com
.
liquidnet
.
service
.
sweet
.
constant
;
/**
* <p>
* sweet表状态常量定义
* </p>
*
* @author jiangxiulong
* @since 2021-12-03
*/
public
class
StatusConst
{
// 积分抽奖 奖品类型 1积分 2优惠券 3实物 4登登登VIP 5优先购买券
public
static
final
Integer
PRIZE_TYPE1
=
1
;
public
static
final
Integer
PRIZE_TYPE2
=
2
;
public
static
final
Integer
PRIZE_TYPE3
=
3
;
public
static
final
Integer
PRIZE_TYPE4
=
4
;
public
static
final
Integer
PRIZE_TYPE5
=
5
;
}
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/constant/SweetConstant.java
View file @
b244d600
...
@@ -30,14 +30,15 @@ public class SweetConstant {
...
@@ -30,14 +30,15 @@ public class SweetConstant {
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_LIST
=
"sweet:integralActivity:list"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_LIST
=
"sweet:integralActivity:list"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_INFO
=
"sweet:integralActivity:activityId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_INFO
=
"sweet:integralActivity:activityId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_NUM
=
"sweet:integralActivity:prizeNum:activityId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_NUM
=
"sweet:integralActivity:prizeNum:activityId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_WINNERS_NUM
=
"sweet:integralActivity:prizeWinnersNum:activityId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_ID
=
":prizeId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_ID
=
":prizeId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_ALL_LIST
=
"sweet:integralActivity:Draw:activityId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_ALL_LIST
=
"sweet:integralActivity:Draw:activityId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_USER
=
"sweet:integralActivity:Draw:activityId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_IN_USER
=
"sweet:integralActivity:DrawIn:activityId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_IN_USER
=
"sweet:integralActivity:DrawIn:activityId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_USER_KEY
=
":userId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_USER_KEY
=
":userId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_INFO
=
"sweet:integralActivity:DrawInfo:drawId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_INFO
=
"sweet:integralActivity:DrawInfo:drawId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_LOCK
=
"sweet:integralActivity:lock:userId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_LOCK
=
"sweet:integralActivity:lock:userId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_ESTIMATEDNUM
=
"sweet:integralActivity:estimatedNum:activityId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_TOTAL_PRIZE_NUM
=
"sweet:integralActivity:totalPrizeNum:activityId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_BLACK
=
"sweet:integralActivity:drawBlack"
;
// 答题活动
// 答题活动
public
final
static
String
REDIS_KEY_SWEET_ANSWER_PHONE
=
"sweet:answer:phone:"
;
public
final
static
String
REDIS_KEY_SWEET_ANSWER_PHONE
=
"sweet:answer:phone:"
;
// 城市投票活动
// 城市投票活动
...
...
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/dto/param/admin/SweetIntegralActivityFromParam.java
View file @
b244d600
...
@@ -50,6 +50,10 @@ public class SweetIntegralActivityFromParam implements Serializable, Cloneable {
...
@@ -50,6 +50,10 @@ public class SweetIntegralActivityFromParam implements Serializable, Cloneable {
@NotNull
(
message
=
"activityNum不能为空"
)
@NotNull
(
message
=
"activityNum不能为空"
)
private
Integer
activityNum
;
private
Integer
activityNum
;
@ApiModelProperty
(
required
=
true
,
value
=
"预估玩此活动的总人数"
,
example
=
"1"
)
@NotNull
(
message
=
"estimatedNum不能为空"
)
private
Integer
estimatedNum
;
@ApiModelProperty
(
required
=
true
,
value
=
"活动时间类型 1长期 2开始结束时间"
,
example
=
"1"
)
@ApiModelProperty
(
required
=
true
,
value
=
"活动时间类型 1长期 2开始结束时间"
,
example
=
"1"
)
@NotNull
(
message
=
"timeType不能为空"
)
@Min
(
value
=
1
,
message
=
"timeType无效"
)
@Max
(
value
=
2
,
message
=
"timeType无效"
)
@NotNull
(
message
=
"timeType不能为空"
)
@Min
(
value
=
1
,
message
=
"timeType无效"
)
@Max
(
value
=
2
,
message
=
"timeType无效"
)
private
Integer
timeType
;
private
Integer
timeType
;
...
@@ -68,6 +72,10 @@ public class SweetIntegralActivityFromParam implements Serializable, Cloneable {
...
@@ -68,6 +72,10 @@ public class SweetIntegralActivityFromParam implements Serializable, Cloneable {
@NotBlank
(
message
=
"activityTitle不能为空"
)
@NotBlank
(
message
=
"activityTitle不能为空"
)
private
String
activityRules
;
private
String
activityRules
;
@ApiModelProperty
(
required
=
true
,
value
=
"概率公示"
,
example
=
"这里是概率公示"
)
@NotBlank
(
message
=
"probabilityPublicity不能为空"
)
private
String
probabilityPublicity
;
@ApiModelProperty
(
required
=
true
,
value
=
"是否上线 1未上线 2已上线"
,
example
=
"2"
)
@ApiModelProperty
(
required
=
true
,
value
=
"是否上线 1未上线 2已上线"
,
example
=
"2"
)
@NotNull
(
message
=
"isOnline不能为空"
)
@Min
(
value
=
1
,
message
=
"isOnline无效"
)
@Max
(
value
=
2
,
message
=
"isOnline无效"
)
@NotNull
(
message
=
"isOnline不能为空"
)
@Min
(
value
=
1
,
message
=
"isOnline无效"
)
@Max
(
value
=
2
,
message
=
"isOnline无效"
)
private
Integer
isOnline
;
private
Integer
isOnline
;
...
@@ -95,6 +103,7 @@ public class SweetIntegralActivityFromParam implements Serializable, Cloneable {
...
@@ -95,6 +103,7 @@ public class SweetIntegralActivityFromParam implements Serializable, Cloneable {
sweetIntegralActivity
.
setActivityImg
(
source
.
getActivityImg
());
sweetIntegralActivity
.
setActivityImg
(
source
.
getActivityImg
());
sweetIntegralActivity
.
setActivityType
(
source
.
getActivityType
());
sweetIntegralActivity
.
setActivityType
(
source
.
getActivityType
());
sweetIntegralActivity
.
setActivityNum
(
source
.
getActivityNum
());
sweetIntegralActivity
.
setActivityNum
(
source
.
getActivityNum
());
sweetIntegralActivity
.
setEstimatedNum
(
source
.
getEstimatedNum
());
sweetIntegralActivity
.
setTimeType
(
source
.
getTimeType
());
sweetIntegralActivity
.
setTimeType
(
source
.
getTimeType
());
if
(
null
!=
source
.
getStartTime
()
&&
!
source
.
getStartTime
().
isEmpty
())
{
if
(
null
!=
source
.
getStartTime
()
&&
!
source
.
getStartTime
().
isEmpty
())
{
LocalDateTime
startTime
=
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
parse
(
source
.
getStartTime
());
LocalDateTime
startTime
=
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
parse
(
source
.
getStartTime
());
...
@@ -106,6 +115,7 @@ public class SweetIntegralActivityFromParam implements Serializable, Cloneable {
...
@@ -106,6 +115,7 @@ public class SweetIntegralActivityFromParam implements Serializable, Cloneable {
}
}
sweetIntegralActivity
.
setExpressFeeType
(
source
.
getExpressFeeType
());
sweetIntegralActivity
.
setExpressFeeType
(
source
.
getExpressFeeType
());
sweetIntegralActivity
.
setActivityRules
(
source
.
getActivityRules
());
sweetIntegralActivity
.
setActivityRules
(
source
.
getActivityRules
());
sweetIntegralActivity
.
setProbabilityPublicity
(
source
.
getProbabilityPublicity
());
sweetIntegralActivity
.
setIsOnline
(
source
.
getIsOnline
());
sweetIntegralActivity
.
setIsOnline
(
source
.
getIsOnline
());
return
sweetIntegralActivity
;
return
sweetIntegralActivity
;
}
}
...
...
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/dto/param/admin/SweetIntegralActivityPrizeFormParam.java
View file @
b244d600
...
@@ -35,6 +35,9 @@ public class SweetIntegralActivityPrizeFormParam implements Serializable,Cloneab
...
@@ -35,6 +35,9 @@ public class SweetIntegralActivityPrizeFormParam implements Serializable,Cloneab
@NotBlank
(
message
=
"prizeTitle不能为空"
)
@NotBlank
(
message
=
"prizeTitle不能为空"
)
private
String
prizeTitle
;
private
String
prizeTitle
;
@ApiModelProperty
(
required
=
false
,
value
=
"奖品描述"
,
example
=
"奖品描述"
)
private
String
prizeDescribe
;
@ApiModelProperty
(
required
=
true
,
value
=
"初始展示奖品图片"
,
example
=
"test.png"
)
@ApiModelProperty
(
required
=
true
,
value
=
"初始展示奖品图片"
,
example
=
"test.png"
)
@NotBlank
(
message
=
"prizeImgInit不能为空"
)
@NotBlank
(
message
=
"prizeImgInit不能为空"
)
private
String
prizeImgInit
;
private
String
prizeImgInit
;
...
@@ -43,23 +46,20 @@ public class SweetIntegralActivityPrizeFormParam implements Serializable,Cloneab
...
@@ -43,23 +46,20 @@ public class SweetIntegralActivityPrizeFormParam implements Serializable,Cloneab
@NotBlank
(
message
=
"prizeImgSelect不能为空"
)
@NotBlank
(
message
=
"prizeImgSelect不能为空"
)
private
String
prizeImgSelect
;
private
String
prizeImgSelect
;
@ApiModelProperty
(
required
=
true
,
value
=
"奖品类型 1
谢谢惠顾 2积分 3代金券 4满减券 5优先购买券 6实物
"
,
example
=
"1"
)
@ApiModelProperty
(
required
=
true
,
value
=
"奖品类型 1
积分 2优惠券 3实物 4登登登VIP 5优先购买券
"
,
example
=
"1"
)
@NotNull
(
message
=
"prizeType不能为空"
)
@NotNull
(
message
=
"prizeType不能为空"
)
private
Integer
prizeType
;
private
Integer
prizeType
;
@ApiModelProperty
(
required
=
false
,
value
=
"单次奖励数量如积分 中奖给多少物"
,
example
=
"1"
)
@ApiModelProperty
(
required
=
false
,
value
=
"单次奖励数量如积分 中奖给多少物"
,
example
=
"1"
)
private
Integer
prizeTypeNum
;
private
Integer
prizeTypeNum
;
@ApiModelProperty
(
value
=
"关联id 如商品id 券id 选择奖品的时候必传"
,
example
=
"429803743878963206506461"
)
private
String
relationId
;
@ApiModelProperty
(
required
=
true
,
value
=
"奖品数量"
,
example
=
"100"
)
@ApiModelProperty
(
required
=
true
,
value
=
"奖品数量"
,
example
=
"100"
)
@NotNull
(
message
=
"prizeNum不能为空"
)
@NotNull
(
message
=
"prizeNum不能为空"
)
private
Integer
prizeNum
;
private
Integer
prizeNum
;
@ApiModelProperty
(
required
=
true
,
value
=
"
限制的中奖人数"
,
example
=
"10
"
)
@ApiModelProperty
(
required
=
true
,
value
=
"
是否是无限库存 1有限库存 2无限库存"
,
example
=
"1
"
)
@NotNull
(
message
=
"
winnersNum
不能为空"
)
@NotNull
(
message
=
"
isInfinite
不能为空"
)
private
Integer
winnersNum
;
private
Integer
isInfinite
;
@ApiModelProperty
(
required
=
true
,
value
=
"中奖概率"
,
example
=
"1"
)
@ApiModelProperty
(
required
=
true
,
value
=
"中奖概率"
,
example
=
"1"
)
@NotNull
(
message
=
"winningProbability不能为空"
)
@NotNull
(
message
=
"winningProbability不能为空"
)
...
@@ -81,13 +81,13 @@ public class SweetIntegralActivityPrizeFormParam implements Serializable,Cloneab
...
@@ -81,13 +81,13 @@ public class SweetIntegralActivityPrizeFormParam implements Serializable,Cloneab
sweetIntegralActivityPrize
.
setIntegralActivityId
(
source
.
getIntegralActivityId
());
sweetIntegralActivityPrize
.
setIntegralActivityId
(
source
.
getIntegralActivityId
());
sweetIntegralActivityPrize
.
setPrizeId
(
source
.
getPrizeId
());
sweetIntegralActivityPrize
.
setPrizeId
(
source
.
getPrizeId
());
sweetIntegralActivityPrize
.
setPrizeTitle
(
source
.
getPrizeTitle
());
sweetIntegralActivityPrize
.
setPrizeTitle
(
source
.
getPrizeTitle
());
sweetIntegralActivityPrize
.
setPrizeDescribe
(
source
.
getPrizeDescribe
());
sweetIntegralActivityPrize
.
setPrizeImgInit
(
source
.
getPrizeImgInit
());
sweetIntegralActivityPrize
.
setPrizeImgInit
(
source
.
getPrizeImgInit
());
sweetIntegralActivityPrize
.
setPrizeImgSelect
(
source
.
getPrizeImgSelect
());
sweetIntegralActivityPrize
.
setPrizeImgSelect
(
source
.
getPrizeImgSelect
());
sweetIntegralActivityPrize
.
setPrizeType
(
source
.
getPrizeType
());
sweetIntegralActivityPrize
.
setPrizeType
(
source
.
getPrizeType
());
sweetIntegralActivityPrize
.
setPrizeTypeNum
(
source
.
getPrizeTypeNum
());
sweetIntegralActivityPrize
.
setPrizeTypeNum
(
source
.
getPrizeTypeNum
());
sweetIntegralActivityPrize
.
setRelationId
(
source
.
getRelationId
());
sweetIntegralActivityPrize
.
setPrizeNum
(
source
.
getPrizeNum
());
sweetIntegralActivityPrize
.
setPrizeNum
(
source
.
getPrizeNum
());
sweetIntegralActivityPrize
.
set
WinnersNum
(
source
.
getWinnersNum
());
sweetIntegralActivityPrize
.
set
IsInfinite
(
source
.
getIsInfinite
());
sweetIntegralActivityPrize
.
setWinningProbability
(
source
.
getWinningProbability
());
sweetIntegralActivityPrize
.
setWinningProbability
(
source
.
getWinningProbability
());
return
sweetIntegralActivityPrize
;
return
sweetIntegralActivityPrize
;
}
}
...
...
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/dto/param/admin/SweetIntegralActivityPrizeRelationFormParam.java
0 → 100644
View file @
b244d600
package
com
.
liquidnet
.
service
.
sweet
.
dto
.
param
.
admin
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityPrizeRelation
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
java.io.Serializable
;
/**
* <p>
* SweetIntegralActivityPrizeRelationFormParam
* </p>
*
* @author jiangxiulong
* @since 2021-12-02
*/
@Data
@ApiModel
(
value
=
"SweetIntegralActivityPrizeRelationFormParam"
,
description
=
"积分活动创建奖品入参"
)
public
class
SweetIntegralActivityPrizeRelationFormParam
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
-
4381851476183020667L
;
@ApiModelProperty
(
value
=
"活动主键id"
,
example
=
"429803743878963206506461"
)
@NotBlank
(
message
=
"integralActivityId不能为空"
)
private
String
integralActivityId
;
@ApiModelProperty
(
value
=
"奖品主键id"
,
example
=
"429803743878963206506461"
)
@NotBlank
(
message
=
"prizeId不能为空"
)
private
String
prizeId
;
@ApiModelProperty
(
value
=
"券id"
,
example
=
"429803743878963206506461"
)
@NotBlank
(
message
=
"couponId不能为空"
)
private
String
couponId
;
@ApiModelProperty
(
value
=
"券名称"
,
example
=
"优惠券"
)
@NotBlank
(
message
=
"couponTitle不能为空"
)
private
String
couponTitle
;
private
static
final
SweetIntegralActivityPrizeRelationFormParam
obj
=
new
SweetIntegralActivityPrizeRelationFormParam
();
public
static
SweetIntegralActivityPrizeRelationFormParam
getNew
()
{
try
{
return
(
SweetIntegralActivityPrizeRelationFormParam
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
SweetIntegralActivityPrizeRelationFormParam
();
}
}
public
SweetIntegralActivityPrizeRelation
copy
(
SweetIntegralActivityPrizeRelationFormParam
source
)
{
SweetIntegralActivityPrizeRelation
activityPrizeRelation
=
SweetIntegralActivityPrizeRelation
.
getNew
();
if
(
null
==
source
)
return
null
;
activityPrizeRelation
.
setPrizeId
(
source
.
getPrizeId
());
activityPrizeRelation
.
setCouponId
(
source
.
getCouponId
());
activityPrizeRelation
.
setCouponTitle
(
source
.
getCouponTitle
());
return
activityPrizeRelation
;
}
}
\ No newline at end of file
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/dto/vo/IntegralActivityDrawVo.java
View file @
b244d600
...
@@ -29,7 +29,7 @@ public class IntegralActivityDrawVo implements Serializable, Cloneable {
...
@@ -29,7 +29,7 @@ public class IntegralActivityDrawVo implements Serializable, Cloneable {
@ApiModelProperty
(
value
=
"奖品名称"
)
@ApiModelProperty
(
value
=
"奖品名称"
)
private
String
prizeTitle
;
private
String
prizeTitle
;
@ApiModelProperty
(
value
=
"奖品类型 1
谢谢
惠顾 2积分 3代金券 4满减券 5优先购买券 6实物"
)
@ApiModelProperty
(
value
=
"奖品类型 1
积分 2优惠券 3实物 4登登登VIP 5优先购买券
惠顾 2积分 3代金券 4满减券 5优先购买券 6实物"
)
private
Integer
prizeType
;
private
Integer
prizeType
;
@ApiModelProperty
(
value
=
"关联id 如商品id 券id"
)
@ApiModelProperty
(
value
=
"关联id 如商品id 券id"
)
...
@@ -65,15 +65,15 @@ public class IntegralActivityDrawVo implements Serializable, Cloneable {
...
@@ -65,15 +65,15 @@ public class IntegralActivityDrawVo implements Serializable, Cloneable {
@ApiModelProperty
(
value
=
"adam收货人详细地址"
)
@ApiModelProperty
(
value
=
"adam收货人详细地址"
)
private
String
receivingAddress
;
private
String
receivingAddress
;
@ApiModelProperty
(
value
=
"发放状态 1未发放 2已发放
3无需发放
"
)
@ApiModelProperty
(
value
=
"发放状态 1未发放 2已发放"
)
private
Integer
receivingStatus
;
private
Integer
receivingStatus
;
@ApiModelProperty
(
value
=
"创建时间"
)
@ApiModelProperty
(
value
=
"创建时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
//
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern= DateUtil.DATE_FULL_STR)
private
LocalDateTime
createdAt
;
private
LocalDateTime
createdAt
;
@ApiModelProperty
(
value
=
"更新时间"
)
@ApiModelProperty
(
value
=
"更新时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
//
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern= DateUtil.DATE_FULL_STR)
private
LocalDateTime
updatedAt
;
private
LocalDateTime
updatedAt
;
@ApiModelProperty
(
value
=
"快递费用类型 1包邮 2到付"
)
@ApiModelProperty
(
value
=
"快递费用类型 1包邮 2到付"
)
...
...
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/dto/vo/IntegralActivityPrizeApiVo.java
0 → 100644
View file @
b244d600
package
com
.
liquidnet
.
service
.
sweet
.
dto
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
IntegralActivityPrizeApiVo
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
-
303399210433737206L
;
@ApiModelProperty
(
value
=
"奖品id"
)
private
String
prizeId
;
@ApiModelProperty
(
value
=
"关联活动id"
)
private
String
integralActivityId
;
@ApiModelProperty
(
value
=
"抽奖id"
)
private
String
drawId
;
@ApiModelProperty
(
value
=
"奖品名称"
)
private
String
prizeTitle
;
@ApiModelProperty
(
value
=
"奖品描述"
)
private
String
prizeDescribe
;
@ApiModelProperty
(
value
=
"初始展示奖品图片"
)
private
String
prizeImgInit
;
@ApiModelProperty
(
value
=
"中奖选中奖品图片"
)
private
String
prizeImgSelect
;
@ApiModelProperty
(
value
=
"奖品类型 1积分 2优惠券 3实物 4登登登VIP 5优先购买券"
)
private
Integer
prizeType
;
@ApiModelProperty
(
value
=
"单次奖励数量如积分 中奖给多少物"
)
private
Integer
prizeTypeNum
;
private
static
final
IntegralActivityPrizeApiVo
obj
=
new
IntegralActivityPrizeApiVo
();
public
static
IntegralActivityPrizeApiVo
getNew
()
{
try
{
return
(
IntegralActivityPrizeApiVo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
IntegralActivityPrizeApiVo
();
}
}
public
IntegralActivityPrizeApiVo
copy
(
IntegralActivityPrizeVo
source
)
{
if
(
null
==
this
)
return
this
;
this
.
setIntegralActivityId
(
source
.
getIntegralActivityId
());
this
.
setPrizeId
(
source
.
getPrizeId
());
this
.
setIntegralActivityId
(
source
.
getIntegralActivityId
());
this
.
setPrizeTitle
(
source
.
getPrizeTitle
());
this
.
setPrizeDescribe
(
source
.
getPrizeDescribe
());
this
.
setPrizeImgInit
(
source
.
getPrizeImgInit
());
this
.
setPrizeImgSelect
(
source
.
getPrizeImgSelect
());
this
.
setPrizeType
(
source
.
getPrizeType
());
this
.
setPrizeTypeNum
(
source
.
getPrizeTypeNum
());
return
this
;
}
}
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/dto/vo/IntegralActivityPrizeRelationVo.java
0 → 100644
View file @
b244d600
package
com
.
liquidnet
.
service
.
sweet
.
dto
.
vo
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityPrizeRelation
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
@Data
public
class
IntegralActivityPrizeRelationVo
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
-
303399210433737206L
;
@ApiModelProperty
(
value
=
"prize_relation_id"
)
private
String
prizeRelationId
;
@ApiModelProperty
(
value
=
"prize_id"
)
private
String
prizeId
;
@ApiModelProperty
(
value
=
"券id"
)
private
String
couponId
;
@ApiModelProperty
(
value
=
"券名称"
)
private
String
couponTitle
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
LocalDateTime
createdAt
;
@ApiModelProperty
(
value
=
"更新时间"
)
private
LocalDateTime
updatedAt
;
private
static
final
IntegralActivityPrizeRelationVo
obj
=
new
IntegralActivityPrizeRelationVo
();
public
static
IntegralActivityPrizeRelationVo
getNew
()
{
try
{
return
(
IntegralActivityPrizeRelationVo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
IntegralActivityPrizeRelationVo
();
}
}
public
IntegralActivityPrizeRelationVo
copy
(
SweetIntegralActivityPrizeRelation
source
)
{
if
(
null
==
this
)
return
this
;
this
.
setPrizeRelationId
(
source
.
getPrizeRelationId
());
this
.
setPrizeId
(
source
.
getPrizeId
());
this
.
setCouponId
(
source
.
getCouponId
());
this
.
setCouponTitle
(
source
.
getCouponTitle
());
this
.
setCreatedAt
(
source
.
getCreatedAt
());
this
.
setUpdatedAt
(
source
.
getUpdatedAt
());
return
this
;
}
}
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/dto/vo/IntegralActivityPrizeVo.java
0 → 100644
View file @
b244d600
package
com
.
liquidnet
.
service
.
sweet
.
dto
.
vo
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityPrize
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.List
;
@Data
public
class
IntegralActivityPrizeVo
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
-
303399210433737206L
;
@ApiModelProperty
(
value
=
"奖品id"
)
private
String
prizeId
;
@ApiModelProperty
(
value
=
"关联活动id"
)
private
String
integralActivityId
;
@ApiModelProperty
(
value
=
"奖品名称"
)
private
String
prizeTitle
;
@ApiModelProperty
(
value
=
"奖品描述"
)
private
String
prizeDescribe
;
@ApiModelProperty
(
value
=
"初始展示奖品图片"
)
private
String
prizeImgInit
;
@ApiModelProperty
(
value
=
"中奖选中奖品图片"
)
private
String
prizeImgSelect
;
@ApiModelProperty
(
value
=
"奖品类型 1积分 2优惠券 3实物 4登登登VIP 5优先购买券"
)
private
Integer
prizeType
;
@ApiModelProperty
(
value
=
"单次奖励数量如积分 中奖给多少物"
)
private
Integer
prizeTypeNum
;
@ApiModelProperty
(
value
=
"奖品数量"
)
private
Integer
prizeNum
;
@ApiModelProperty
(
value
=
"是否是无限库存 1有限库存 2无限"
)
private
Integer
isInfinite
;
@ApiModelProperty
(
value
=
"中奖概率"
)
private
BigDecimal
winningProbability
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
LocalDateTime
createdAt
;
@ApiModelProperty
(
value
=
"更新时间"
)
private
LocalDateTime
updatedAt
;
@ApiModelProperty
(
value
=
"券列表"
)
private
List
<
IntegralActivityPrizeRelationVo
>
prizeRelationList
;
private
static
final
IntegralActivityPrizeVo
obj
=
new
IntegralActivityPrizeVo
();
public
static
IntegralActivityPrizeVo
getNew
()
{
try
{
return
(
IntegralActivityPrizeVo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
IntegralActivityPrizeVo
();
}
}
public
IntegralActivityPrizeVo
copy
(
SweetIntegralActivityPrize
source
)
{
if
(
null
==
this
)
return
this
;
this
.
setIntegralActivityId
(
source
.
getIntegralActivityId
());
this
.
setPrizeId
(
source
.
getPrizeId
());
this
.
setIntegralActivityId
(
source
.
getIntegralActivityId
());
this
.
setPrizeTitle
(
source
.
getPrizeTitle
());
this
.
setPrizeDescribe
(
source
.
getPrizeDescribe
());
this
.
setPrizeImgInit
(
source
.
getPrizeImgInit
());
this
.
setPrizeImgSelect
(
source
.
getPrizeImgSelect
());
this
.
setPrizeType
(
source
.
getPrizeType
());
this
.
setPrizeTypeNum
(
source
.
getPrizeTypeNum
());
this
.
setPrizeNum
(
source
.
getPrizeNum
());
this
.
setIsInfinite
(
source
.
getIsInfinite
());
this
.
setWinningProbability
(
source
.
getWinningProbability
());
this
.
setCreatedAt
(
source
.
getCreatedAt
());
this
.
setUpdatedAt
(
source
.
getUpdatedAt
());
return
this
;
}
}
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/dto/vo/IntegralActivityVo.java
View file @
b244d600
package
com
.
liquidnet
.
service
.
sweet
.
dto
.
vo
;
package
com
.
liquidnet
.
service
.
sweet
.
dto
.
vo
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivity
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivity
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityPrize
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -29,6 +28,9 @@ public class IntegralActivityVo implements Serializable, Cloneable {
...
@@ -29,6 +28,9 @@ public class IntegralActivityVo implements Serializable, Cloneable {
@ApiModelProperty
(
value
=
"活动玩一次所需积分"
)
@ApiModelProperty
(
value
=
"活动玩一次所需积分"
)
private
Integer
activityNum
;
private
Integer
activityNum
;
@ApiModelProperty
(
value
=
"预估玩此活动的总人数"
)
private
Integer
estimatedNum
;
@ApiModelProperty
(
value
=
"活动时间类型 1长期 2开始结束时间"
)
@ApiModelProperty
(
value
=
"活动时间类型 1长期 2开始结束时间"
)
private
Integer
timeType
;
private
Integer
timeType
;
...
@@ -44,6 +46,9 @@ public class IntegralActivityVo implements Serializable, Cloneable {
...
@@ -44,6 +46,9 @@ public class IntegralActivityVo implements Serializable, Cloneable {
@ApiModelProperty
(
value
=
"活动规则"
)
@ApiModelProperty
(
value
=
"活动规则"
)
private
String
activityRules
;
private
String
activityRules
;
@ApiModelProperty
(
value
=
"概率公示"
)
private
String
probabilityPublicity
;
@ApiModelProperty
(
value
=
"是否上线 1未上线 2已上线"
)
@ApiModelProperty
(
value
=
"是否上线 1未上线 2已上线"
)
private
Integer
isOnline
;
private
Integer
isOnline
;
...
@@ -54,7 +59,13 @@ public class IntegralActivityVo implements Serializable, Cloneable {
...
@@ -54,7 +59,13 @@ public class IntegralActivityVo implements Serializable, Cloneable {
private
LocalDateTime
updatedAt
;
private
LocalDateTime
updatedAt
;
@ApiModelProperty
(
value
=
"奖品列表"
)
@ApiModelProperty
(
value
=
"奖品列表"
)
private
List
<
SweetIntegralActivityPrize
>
prizeList
;
private
List
<
IntegralActivityPrizeVo
>
prizeList
;
@ApiModelProperty
(
value
=
"奖品列表 积分、券"
)
private
List
<
IntegralActivityPrizeVo
>
prizeList1
;
@ApiModelProperty
(
value
=
"奖品列表 实物、会员、优先购买券"
)
private
List
<
IntegralActivityPrizeVo
>
prizeList2
;
private
static
final
IntegralActivityVo
obj
=
new
IntegralActivityVo
();
private
static
final
IntegralActivityVo
obj
=
new
IntegralActivityVo
();
public
static
IntegralActivityVo
getNew
()
{
public
static
IntegralActivityVo
getNew
()
{
...
@@ -72,11 +83,13 @@ public class IntegralActivityVo implements Serializable, Cloneable {
...
@@ -72,11 +83,13 @@ public class IntegralActivityVo implements Serializable, Cloneable {
this
.
setActivityImg
(
source
.
getActivityImg
());
this
.
setActivityImg
(
source
.
getActivityImg
());
this
.
setActivityType
(
source
.
getActivityType
());
this
.
setActivityType
(
source
.
getActivityType
());
this
.
setActivityNum
(
source
.
getActivityNum
());
this
.
setActivityNum
(
source
.
getActivityNum
());
this
.
setEstimatedNum
(
source
.
getEstimatedNum
());
this
.
setTimeType
(
source
.
getTimeType
());
this
.
setTimeType
(
source
.
getTimeType
());
this
.
setStartTime
(
source
.
getStartTime
());
this
.
setStartTime
(
source
.
getStartTime
());
this
.
setEndTime
(
source
.
getEndTime
());
this
.
setEndTime
(
source
.
getEndTime
());
this
.
setExpressFeeType
(
source
.
getExpressFeeType
());
this
.
setExpressFeeType
(
source
.
getExpressFeeType
());
this
.
setActivityRules
(
source
.
getActivityRules
());
this
.
setActivityRules
(
source
.
getActivityRules
());
this
.
setProbabilityPublicity
(
source
.
getProbabilityPublicity
());
this
.
setIsOnline
(
source
.
getIsOnline
());
this
.
setIsOnline
(
source
.
getIsOnline
());
this
.
setCreatedAt
(
source
.
getCreatedAt
());
this
.
setCreatedAt
(
source
.
getCreatedAt
());
this
.
setUpdatedAt
(
source
.
getUpdatedAt
());
this
.
setUpdatedAt
(
source
.
getUpdatedAt
());
...
...
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/dto/vo/admin/SweetIntegralActivityPrizeVo.java
View file @
b244d600
...
@@ -35,26 +35,26 @@ public class SweetIntegralActivityPrizeVo implements Serializable, Cloneable {
...
@@ -35,26 +35,26 @@ public class SweetIntegralActivityPrizeVo implements Serializable, Cloneable {
@ApiModelProperty
(
value
=
"奖品名称"
)
@ApiModelProperty
(
value
=
"奖品名称"
)
private
String
prizeTitle
;
private
String
prizeTitle
;
@ApiModelProperty
(
value
=
"奖品描述"
)
private
String
prizeDescribe
;
@ApiModelProperty
(
required
=
true
,
value
=
"初始展示奖品图片"
)
@ApiModelProperty
(
required
=
true
,
value
=
"初始展示奖品图片"
)
private
String
prizeImgInit
;
private
String
prizeImgInit
;
@ApiModelProperty
(
required
=
true
,
value
=
"中奖选中奖品图片"
)
@ApiModelProperty
(
required
=
true
,
value
=
"中奖选中奖品图片"
)
private
String
prizeImgSelect
;
private
String
prizeImgSelect
;
@ApiModelProperty
(
value
=
"奖品类型 1
谢谢惠顾 2积分 3代金券 4满减券 5优先购买券 6实物
"
)
@ApiModelProperty
(
value
=
"奖品类型 1
积分 2优惠券 3实物 4登登登VIP 5优先购买券
"
)
private
Integer
prizeType
;
private
Integer
prizeType
;
@ApiModelProperty
(
value
=
"单次奖励数量如积分 中奖给多少物"
)
@ApiModelProperty
(
value
=
"单次奖励数量如积分 中奖给多少物"
)
private
Integer
prizeTypeNum
;
private
Integer
prizeTypeNum
;
@ApiModelProperty
(
value
=
"关联id 如商品id 券id"
)
private
String
relationId
;
@ApiModelProperty
(
value
=
"奖品数量"
)
@ApiModelProperty
(
value
=
"奖品数量"
)
private
Integer
prizeNum
;
private
Integer
prizeNum
;
@ApiModelProperty
(
value
=
"
限制的中奖人数
"
)
@ApiModelProperty
(
value
=
"
是否是无限库存 1有限库存 2无限
"
)
private
Integer
winnersNum
;
private
Integer
isInfinite
;
@ApiModelProperty
(
value
=
"中奖概率"
)
@ApiModelProperty
(
value
=
"中奖概率"
)
private
BigDecimal
winningProbability
;
private
BigDecimal
winningProbability
;
...
@@ -85,13 +85,13 @@ public class SweetIntegralActivityPrizeVo implements Serializable, Cloneable {
...
@@ -85,13 +85,13 @@ public class SweetIntegralActivityPrizeVo implements Serializable, Cloneable {
this
.
setPrizeId
(
source
.
getPrizeId
());
this
.
setPrizeId
(
source
.
getPrizeId
());
this
.
setIntegralActivityId
(
source
.
getIntegralActivityId
());
this
.
setIntegralActivityId
(
source
.
getIntegralActivityId
());
this
.
setPrizeTitle
(
source
.
getPrizeTitle
());
this
.
setPrizeTitle
(
source
.
getPrizeTitle
());
this
.
setPrizeDescribe
(
source
.
getPrizeDescribe
());
this
.
setPrizeImgInit
(
source
.
getPrizeImgInit
());
this
.
setPrizeImgInit
(
source
.
getPrizeImgInit
());
this
.
setPrizeImgSelect
(
source
.
getPrizeImgSelect
());
this
.
setPrizeImgSelect
(
source
.
getPrizeImgSelect
());
this
.
setPrizeType
(
source
.
getPrizeType
());
this
.
setPrizeType
(
source
.
getPrizeType
());
this
.
setPrizeTypeNum
(
source
.
getPrizeTypeNum
());
this
.
setPrizeTypeNum
(
source
.
getPrizeTypeNum
());
this
.
setRelationId
(
source
.
getRelationId
());
this
.
setPrizeNum
(
source
.
getPrizeNum
());
this
.
setPrizeNum
(
source
.
getPrizeNum
());
this
.
set
WinnersNum
(
source
.
getWinnersNum
());
this
.
set
IsInfinite
(
source
.
getIsInfinite
());
this
.
setWinningProbability
(
source
.
getWinningProbability
());
this
.
setWinningProbability
(
source
.
getWinningProbability
());
this
.
setCreatedAt
(
source
.
getCreatedAt
());
this
.
setCreatedAt
(
source
.
getCreatedAt
());
this
.
setUpdatedAt
(
source
.
getUpdatedAt
());
this
.
setUpdatedAt
(
source
.
getUpdatedAt
());
...
...
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/dto/vo/admin/SweetIntegralActivityVo.java
View file @
b244d600
...
@@ -41,6 +41,9 @@ public class SweetIntegralActivityVo implements Serializable, Cloneable {
...
@@ -41,6 +41,9 @@ public class SweetIntegralActivityVo implements Serializable, Cloneable {
@ApiModelProperty
(
value
=
"活动玩一次所需积分"
)
@ApiModelProperty
(
value
=
"活动玩一次所需积分"
)
private
Integer
activityNum
;
private
Integer
activityNum
;
@ApiModelProperty
(
value
=
"预估玩此活动的总人数"
)
private
Integer
estimatedNum
;
@ApiModelProperty
(
value
=
"活动时间类型 1长期 2开始结束时间"
)
@ApiModelProperty
(
value
=
"活动时间类型 1长期 2开始结束时间"
)
private
Integer
timeType
;
private
Integer
timeType
;
...
@@ -56,6 +59,9 @@ public class SweetIntegralActivityVo implements Serializable, Cloneable {
...
@@ -56,6 +59,9 @@ public class SweetIntegralActivityVo implements Serializable, Cloneable {
@ApiModelProperty
(
value
=
"活动规则"
)
@ApiModelProperty
(
value
=
"活动规则"
)
private
String
activityRules
;
private
String
activityRules
;
@ApiModelProperty
(
value
=
"概率公示"
)
private
String
probabilityPublicity
;
@ApiModelProperty
(
value
=
"是否上线 1未上线 2已上线"
)
@ApiModelProperty
(
value
=
"是否上线 1未上线 2已上线"
)
private
Integer
isOnline
;
private
Integer
isOnline
;
...
@@ -87,11 +93,13 @@ public class SweetIntegralActivityVo implements Serializable, Cloneable {
...
@@ -87,11 +93,13 @@ public class SweetIntegralActivityVo implements Serializable, Cloneable {
this
.
setActivityImg
(
source
.
getActivityImg
());
this
.
setActivityImg
(
source
.
getActivityImg
());
this
.
setActivityType
(
source
.
getActivityType
());
this
.
setActivityType
(
source
.
getActivityType
());
this
.
setActivityNum
(
source
.
getActivityNum
());
this
.
setActivityNum
(
source
.
getActivityNum
());
this
.
setEstimatedNum
(
source
.
getEstimatedNum
());
this
.
setTimeType
(
source
.
getTimeType
());
this
.
setTimeType
(
source
.
getTimeType
());
this
.
setStartTime
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
source
.
getStartTime
()));
this
.
setStartTime
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
source
.
getStartTime
()));
this
.
setEndTime
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
source
.
getEndTime
()));
this
.
setEndTime
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
source
.
getEndTime
()));
this
.
setExpressFeeType
(
source
.
getExpressFeeType
());
this
.
setExpressFeeType
(
source
.
getExpressFeeType
());
this
.
setActivityRules
(
source
.
getActivityRules
());
this
.
setActivityRules
(
source
.
getActivityRules
());
this
.
setProbabilityPublicity
(
source
.
getProbabilityPublicity
());
this
.
setIsOnline
(
source
.
getIsOnline
());
this
.
setIsOnline
(
source
.
getIsOnline
());
this
.
setCreatedAt
(
source
.
getCreatedAt
());
this
.
setCreatedAt
(
source
.
getCreatedAt
());
this
.
setUpdatedAt
(
source
.
getUpdatedAt
());
this
.
setUpdatedAt
(
source
.
getUpdatedAt
());
...
...
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/param/SweetStoneIntegralParam.java
0 → 100644
View file @
b244d600
package
com
.
liquidnet
.
service
.
sweet
.
param
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@ApiModel
(
value
=
"SweetStoneIntegralParam"
,
description
=
"添加减少积分入参"
)
@Data
public
class
SweetStoneIntegralParam
implements
Serializable
{
private
static
final
long
serialVersionUID
=
561985919908406636L
;
@ApiModelProperty
(
required
=
true
,
value
=
"用户id"
,
example
=
"34657843445"
)
private
String
uid
;
@ApiModelProperty
(
required
=
true
,
value
=
"积分数量"
,
example
=
"100"
)
private
Integer
score
;
@ApiModelProperty
(
required
=
true
,
value
=
"描述"
,
example
=
"抽奖加积分"
)
private
String
content
;
@ApiModelProperty
(
required
=
true
,
value
=
"增减积分"
,
example
=
"1增积分 2减积分"
)
private
Integer
type
;
private
static
final
SweetStoneIntegralParam
obj
=
new
SweetStoneIntegralParam
();
public
static
SweetStoneIntegralParam
getNew
()
{
try
{
return
(
SweetStoneIntegralParam
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
SweetStoneIntegralParam
();
}
}
}
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/service/ISweetIntegralActivityDrawService.java
View file @
b244d600
package
com
.
liquidnet
.
service
.
sweet
.
service
;
package
com
.
liquidnet
.
service
.
sweet
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.liquidnet.service.base.PagedResult
;
import
com.liquidnet.service.base.PagedResult
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.candy.vo.CandyCouponPreviewVo
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityDrawVo
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityDrawVo
;
import
com.liquidnet.service.sweet.dto.vo.
admin.SweetIntegralActivityPrize
Vo
;
import
com.liquidnet.service.sweet.dto.vo.
IntegralActivityPrizeApi
Vo
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityDraw
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityDraw
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
import
java.util.List
;
...
@@ -19,13 +20,17 @@ import java.util.List;
...
@@ -19,13 +20,17 @@ import java.util.List;
*/
*/
public
interface
ISweetIntegralActivityDrawService
extends
IService
<
SweetIntegralActivityDraw
>
{
public
interface
ISweetIntegralActivityDrawService
extends
IService
<
SweetIntegralActivityDraw
>
{
ResponseDto
<
SweetIntegralActivityPrize
Vo
>
create
(
String
integralActivityId
);
ResponseDto
<
IntegralActivityPrizeApi
Vo
>
create
(
String
integralActivityId
);
ResponseDto
<
PagedResult
<
IntegralActivityDrawVo
>>
drawList
(
Integer
type
,
String
integralActivityId
,
Integer
pageNum
);
ResponseDto
<
PagedResult
<
IntegralActivityDrawVo
>>
drawList
(
String
integralActivityId
,
Integer
pageNum
);
ResponseDto
<
List
<
IntegralActivityDrawVo
>>
winPrizeUser
(
String
integralActivityId
);
ResponseDto
<
List
<
IntegralActivityDrawVo
>>
winPrizeUser
(
String
integralActivityId
);
ResponseDto
perfectAddress
(
String
drawId
,
String
receivingAddressesId
);
ResponseDto
perfectAddress
(
String
drawId
,
String
receivingAddressesId
);
ResponseDto
<
IntegralActivityDrawVo
>
detail
(
String
drawId
);
ResponseDto
<
IntegralActivityDrawVo
>
detail
(
String
drawId
);
ResponseDto
collectCoupon
(
String
couponId
,
String
drawId
);
ResponseDto
<
List
<
CandyCouponPreviewVo
>>
couponList
(
String
prizeId
,
String
integralActivityId
);
}
}
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/service/ISweetIntegralActivityService.java
View file @
b244d600
...
@@ -20,4 +20,8 @@ public interface ISweetIntegralActivityService extends IService<SweetIntegralAct
...
@@ -20,4 +20,8 @@ public interface ISweetIntegralActivityService extends IService<SweetIntegralAct
ResponseDto
<
List
<
IntegralActivityVo
>>
getList
();
ResponseDto
<
List
<
IntegralActivityVo
>>
getList
();
ResponseDto
<
IntegralActivityVo
>
detail
(
String
integralActivityId
);
ResponseDto
<
IntegralActivityVo
>
detail
(
String
integralActivityId
);
ResponseDto
setDrawAllList
(
String
integralActivityId
);
ResponseDto
drawBlack
(
String
uidS
);
}
}
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/utils/SweetNewObjectUtil.java
View file @
b244d600
...
@@ -2,8 +2,8 @@ package com.liquidnet.service.sweet.utils;
...
@@ -2,8 +2,8 @@ package com.liquidnet.service.sweet.utils;
import
com.liquidnet.service.base.PagedResult
;
import
com.liquidnet.service.base.PagedResult
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityDrawVo
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityDrawVo
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityPrizeVo
;
import
com.liquidnet.service.sweet.dto.vo.admin.SweetIntegralActivityPrizeVo
;
import
com.liquidnet.service.sweet.dto.vo.admin.SweetIntegralActivityPrizeVo
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityDraw
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityPrize
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityPrize
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -11,6 +11,7 @@ import java.util.LinkedList;
...
@@ -11,6 +11,7 @@ import java.util.LinkedList;
public
class
SweetNewObjectUtil
{
public
class
SweetNewObjectUtil
{
private
static
final
ArrayList
<
SweetIntegralActivityPrizeVo
>
sweetIntegralActivityPrizeVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
SweetIntegralActivityPrizeVo
>
sweetIntegralActivityPrizeVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
IntegralActivityPrizeVo
>
integralActivityPrizeVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
SweetIntegralActivityPrize
>
sweetIntegralActivityPrizeArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
SweetIntegralActivityPrize
>
sweetIntegralActivityPrizeArrayList
=
new
ArrayList
<>();
private
static
final
LinkedList
<
IntegralActivityDrawVo
>
sweetIntegralActivityDrawVoLinkedList
=
new
LinkedList
<>();
private
static
final
LinkedList
<
IntegralActivityDrawVo
>
sweetIntegralActivityDrawVoLinkedList
=
new
LinkedList
<>();
private
static
final
PagedResult
<
IntegralActivityDrawVo
>
sweetIntegralActivityDrawVoPagedResult
=
new
PagedResult
<>();
private
static
final
PagedResult
<
IntegralActivityDrawVo
>
sweetIntegralActivityDrawVoPagedResult
=
new
PagedResult
<>();
...
@@ -31,4 +32,8 @@ public class SweetNewObjectUtil {
...
@@ -31,4 +32,8 @@ public class SweetNewObjectUtil {
return
(
ArrayList
<
SweetIntegralActivityPrize
>)
sweetIntegralActivityPrizeArrayList
.
clone
();
return
(
ArrayList
<
SweetIntegralActivityPrize
>)
sweetIntegralActivityPrizeArrayList
.
clone
();
}
}
public
static
ArrayList
<
IntegralActivityPrizeVo
>
getIntegralActivityPrizeVoArrayList
()
{
return
(
ArrayList
<
IntegralActivityPrizeVo
>)
integralActivityPrizeVoArrayList
.
clone
();
}
}
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-common/src/main/java/com/liquidnet/client/admin/common/core/controller/BaseController.java
View file @
b244d600
...
@@ -56,13 +56,23 @@ public class BaseController
...
@@ -56,13 +56,23 @@ public class BaseController
PageDomain
pageDomain
=
TableSupport
.
buildPageRequest
();
PageDomain
pageDomain
=
TableSupport
.
buildPageRequest
();
Integer
pageNum
=
pageDomain
.
getPageNum
();
Integer
pageNum
=
pageDomain
.
getPageNum
();
Integer
pageSize
=
pageDomain
.
getPageSize
();
Integer
pageSize
=
pageDomain
.
getPageSize
();
String
orderBy
=
SqlUtil
.
escapeOrderBySql
(
pageDomain
.
getOrderBy
());
// if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
if
(
StringUtils
.
isNotNull
(
pageNum
)
&&
StringUtils
.
isNotNull
(
pageSize
))
// {
{
// String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
// String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
PageHelper
.
startPage
(
pageNum
,
pageSize
,
orderBy
);
// PageHelper.startPage(pageNum, pageSize, orderBy);
// }
String
orderBy
=
SqlUtil
.
escapeOrderBySql
(
pageDomain
.
getOrderBy
());
if
(
StringUtils
.
isNotNull
(
pageNum
)
&&
StringUtils
.
isNotNull
(
pageSize
))
{
}
else
{
}
else
{
PageHelper
.
startPage
(
1
,
10
,
orderBy
);
pageNum
=
1
;
pageSize
=
10
;
}
if
(
StringUtils
.
isEmpty
(
orderBy
))
{
PageHelper
.
startPage
(
pageNum
,
pageSize
);
}
else
{
PageHelper
.
startPage
(
pageNum
,
pageSize
,
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 @
b244d600
...
@@ -3,12 +3,16 @@ package com.liquidnet.client.admin.web.controller.zhengzai.candy;
...
@@ -3,12 +3,16 @@ package com.liquidnet.client.admin.web.controller.zhengzai.candy;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.github.pagehelper.PageHelper
;
import
com.liquidnet.client.admin.common.core.controller.BaseController
;
import
com.liquidnet.client.admin.common.core.controller.BaseController
;
import
com.liquidnet.client.admin.common.core.domain.AjaxResult
;
import
com.liquidnet.client.admin.common.core.domain.AjaxResult
;
import
com.liquidnet.client.admin.common.core.page.PageDomain
;
import
com.liquidnet.client.admin.common.core.page.TableDataInfo
;
import
com.liquidnet.client.admin.common.core.page.TableDataInfo
;
import
com.liquidnet.client.admin.common.core.page.TableSupport
;
import
com.liquidnet.client.admin.common.utils.StringUtils
;
import
com.liquidnet.client.admin.common.utils.sql.SqlUtil
;
import
com.liquidnet.client.admin.zhengzai.candy.service.ICandyCouponAdminService
;
import
com.liquidnet.client.admin.zhengzai.candy.service.ICandyCouponAdminService
;
import
com.liquidnet.client.admin.zhengzai.candy.service.ICandyCouponRuleAdminService
;
import
com.liquidnet.client.admin.zhengzai.candy.service.ICandyCouponRuleAdminService
;
import
com.liquidnet.service.candy.dto.admin.CandyCouponFilterDto
;
import
com.liquidnet.service.candy.dto.admin.CandyCouponListParam
;
import
com.liquidnet.service.candy.dto.admin.CandyCouponListParam
;
import
com.liquidnet.service.candy.dto.admin.CandyCouponTemplateDto
;
import
com.liquidnet.service.candy.dto.admin.CandyCouponTemplateDto
;
import
com.liquidnet.service.candy.entity.CandyCoupon
;
import
com.liquidnet.service.candy.entity.CandyCoupon
;
...
@@ -17,7 +21,6 @@ import io.swagger.annotations.Api;
...
@@ -17,7 +21,6 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
@@ -25,8 +28,6 @@ import org.springframework.web.bind.annotation.PostMapping;
...
@@ -25,8 +28,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
...
@@ -44,47 +45,32 @@ public class CandyCouponAdminController extends BaseController {
...
@@ -44,47 +45,32 @@ public class CandyCouponAdminController extends BaseController {
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"Integer"
,
name
=
"busiType"
,
value
=
"业务类别[0-全场|1-演出|2-商品|3-优先购]"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"Integer"
,
name
=
"busiType"
,
value
=
"业务类别[0-全场|1-演出|2-商品|3-优先购]"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"Integer"
,
name
=
"couType"
,
value
=
"券类型[1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"Integer"
,
name
=
"couType"
,
value
=
"券类型[1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"bindType"
,
value
=
"领取方式[0-用户输入兑换|1-发放至用户|2-积分
兑换
|3-发放需领取|4-会员专属],多种方式则以,分隔入参"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"bindType"
,
value
=
"领取方式[0-用户输入兑换|1-发放至用户|2-积分
商品
|3-发放需领取|4-会员专属],多种方式则以,分隔入参"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"keyword"
,
value
=
"搜索关键字"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"keyword"
,
value
=
"搜索关键字
[支持检索标题title、描述notice、适用描述busiName]
"
),
})
})
@PostMapping
(
"list"
)
@PostMapping
(
"list"
)
@ResponseBody
@ResponseBody
public
TableDataInfo
list
(
CandyCouponListParam
listParam
)
{
public
TableDataInfo
list
(
CandyCouponListParam
listParam
)
{
LambdaQueryWrapper
<
CandyCoupon
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
CandyCoupon
.
class
);
String
bindType
=
listParam
.
getBindType
();
queryWrapper
.
eq
(
CandyCoupon:
:
getState
,
1
);
if
(
StringUtils
.
isNotEmpty
(
bindType
)
&&
!
Pattern
.
matches
(
"^[\\d,]*$"
,
bindType
))
{
queryWrapper
.
select
(
CandyCoupon:
:
getCouponId
,
CandyCoupon:
:
getTitle
);
listParam
.
setBindType
(
null
);
queryWrapper
.
orderByDesc
(
CandyCoupon:
:
getCreatedAt
);
if
(
null
!=
listParam
)
{
if
(
StringUtils
.
isNotBlank
(
listParam
.
getKeyword
()))
{
queryWrapper
.
like
(
CandyCoupon:
:
getTitle
,
listParam
.
getKeyword
());
}
if
(
null
!=
listParam
.
getBusiType
())
{
queryWrapper
.
eq
(
CandyCoupon:
:
getBusiType
,
listParam
.
getBusiType
());
}
if
(
null
!=
listParam
.
getCouType
())
{
queryWrapper
.
eq
(
CandyCoupon:
:
getCouType
,
listParam
.
getCouType
());
}
// if (null != listParam.getBindType()) {
// queryWrapper.eq(CandyCoupon::getBindType, listParam.getBindType());
// }
if
(
null
!=
listParam
.
getBindType
()
&&
Pattern
.
matches
(
"^[\\d,]*$"
,
listParam
.
getBindType
()))
{
String
[]
bindTypeArr
=
listParam
.
getBindType
().
split
(
","
);
if
(
bindTypeArr
.
length
>
0
)
{
queryWrapper
.
in
(
CandyCoupon:
:
getBindType
,
Arrays
.
stream
(
bindTypeArr
).
toArray
());
}
}
}
}
startPage
();
PageDomain
pageDomain
=
TableSupport
.
buildPageRequest
();
List
<
CandyCoupon
>
list
=
candyCouponAdminService
.
list
(
queryWrapper
);
Integer
pageNum
=
pageDomain
.
getPageNum
();
TableDataInfo
dataTable
=
getDataTable
(
list
);
Integer
pageSize
=
pageDomain
.
getPageSize
();
List
<
CandyCouponFilterDto
>
dtoList
=
new
ArrayList
<>();
String
orderBy
=
SqlUtil
.
escapeOrderBySql
(
pageDomain
.
getOrderBy
());
list
.
forEach
(
r
->
{
if
(
com
.
liquidnet
.
client
.
admin
.
common
.
utils
.
StringUtils
.
isNotNull
(
pageNum
)
&&
com
.
liquidnet
.
client
.
admin
.
common
.
utils
.
StringUtils
.
isNotNull
(
pageSize
))
{
dtoList
.
add
(
CandyCouponFilterDto
.
getNew
().
copy
(
r
));
}
else
{
});
pageNum
=
1
;
dataTable
.
setRows
(
dtoList
);
pageSize
=
10
;
return
dataTable
;
}
if
(
StringUtils
.
isEmpty
(
orderBy
))
{
PageHelper
.
startPage
(
pageNum
,
pageSize
,
"cc.created_at desc"
);
}
else
{
PageHelper
.
startPage
(
pageNum
,
pageSize
,
orderBy
);
}
return
getDataTable
(
candyCouponAdminService
.
listForCouponFilterDto
(
listParam
));
}
}
@ApiOperation
(
value
=
"券详情"
)
@ApiOperation
(
value
=
"券详情"
)
...
...
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 @
b244d600
...
@@ -287,7 +287,7 @@ public class CandyMgtCouponAdminController extends BaseController {
...
@@ -287,7 +287,7 @@ public class CandyMgtCouponAdminController extends BaseController {
// }
// }
// }
// }
switch
(
buildParam
.
getBindType
())
{
// 领取方式[0-用户输入兑换|1-发放至用户|2-积分
兑换
|3-发放需领取|4-会员专属]
switch
(
buildParam
.
getBindType
())
{
// 领取方式[0-用户输入兑换|1-发放至用户|2-积分
商品
|3-发放需领取|4-会员专属]
case
0
:
case
0
:
buildParam
.
setEventType
(
0
);
buildParam
.
setEventType
(
0
);
buildParam
.
setEventLimit
(
null
);
buildParam
.
setEventLimit
(
null
);
...
@@ -303,8 +303,8 @@ public class CandyMgtCouponAdminController extends BaseController {
...
@@ -303,8 +303,8 @@ public class CandyMgtCouponAdminController extends BaseController {
}
}
}
}
break
;
break
;
case
4
:
// 新增券领取类型(4-会员专属)处理逻辑同(2-积分
兑换
)
case
4
:
// 新增券领取类型(4-会员专属)处理逻辑同(2-积分
商品
)
case
2
:
// TODO: 2021/11/9 PM上线前临时加的券领取类型(2-积分
兑换
)
case
2
:
// TODO: 2021/11/9 PM上线前临时加的券领取类型(2-积分
商品
)
buildParam
.
setEventType
(
0
);
buildParam
.
setEventType
(
0
);
buildParam
.
setEventLimit
(
null
);
buildParam
.
setEventLimit
(
null
);
break
;
break
;
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/sweet/SweetIntegralActivityDrawController.java
View file @
b244d600
...
@@ -44,7 +44,7 @@ public class SweetIntegralActivityDrawController extends BaseController {
...
@@ -44,7 +44,7 @@ public class SweetIntegralActivityDrawController extends BaseController {
@Autowired
@Autowired
private
ISweetIntegralActivityDrawService
iSweetIntegralActivityDrawService
;
private
ISweetIntegralActivityDrawService
iSweetIntegralActivityDrawService
;
@Log
(
title
=
"积分活动
中
奖列表数据"
,
businessType
=
BusinessType
.
LIST
)
@Log
(
title
=
"积分活动
抽
奖列表数据"
,
businessType
=
BusinessType
.
LIST
)
@RequiresPermissions
(
"sweet:integralActivityDraw:list"
)
@RequiresPermissions
(
"sweet:integralActivityDraw:list"
)
@ApiOperation
(
value
=
"积分活动中奖列表数据"
)
@ApiOperation
(
value
=
"积分活动中奖列表数据"
)
@PostMapping
(
"list"
)
@PostMapping
(
"list"
)
...
@@ -54,8 +54,8 @@ public class SweetIntegralActivityDrawController extends BaseController {
...
@@ -54,8 +54,8 @@ public class SweetIntegralActivityDrawController extends BaseController {
return
getDataTable
(
result
.
getList
());
return
getDataTable
(
result
.
getList
());
}
}
@Log
(
title
=
"积分活动导出
中
奖列表数据"
,
businessType
=
BusinessType
.
EXPORT
)
@Log
(
title
=
"积分活动导出
抽
奖列表数据"
,
businessType
=
BusinessType
.
EXPORT
)
@RequiresPermissions
(
"
kylin
:integralActivityDraw:exportExcel"
)
@RequiresPermissions
(
"
sweet
:integralActivityDraw:exportExcel"
)
@PostMapping
(
"/export"
)
@PostMapping
(
"/export"
)
@ResponseBody
@ResponseBody
public
AjaxResult
export
(
@RequestParam
(
"ids"
)
String
integralActivityId
)
{
public
AjaxResult
export
(
@RequestParam
(
"ids"
)
String
integralActivityId
)
{
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/sweet/SweetIntegralActivityPrizeRelationController.java
0 → 100644
View file @
b244d600
package
com
.
liquidnet
.
client
.
admin
.
web
.
controller
.
zhengzai
.
sweet
;
import
com.liquidnet.client.admin.common.annotation.Log
;
import
com.liquidnet.client.admin.common.core.controller.BaseController
;
import
com.liquidnet.client.admin.common.core.domain.AjaxResult
;
import
com.liquidnet.client.admin.common.enums.BusinessType
;
import
com.liquidnet.client.admin.zhengzai.sweet.service.ISweetIntegralActivityPrizeRelationService
;
import
com.liquidnet.service.sweet.dto.param.admin.SweetIntegralActivityPrizeRelationFormParam
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityPrizeRelation
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.Valid
;
import
java.util.List
;
/**
* <p>
* 积分活动表 前端控制器
* </p>
*
* @author jiangxiulong
* @since 2021-10-20
*/
@Api
(
tags
=
"积分活动管理"
)
@Validated
@Controller
@RequestMapping
(
"/sweet/integralActivityPrizeRelation"
)
public
class
SweetIntegralActivityPrizeRelationController
extends
BaseController
{
@Autowired
private
ISweetIntegralActivityPrizeRelationService
activityPrizeRelationService
;
@Log
(
title
=
"积分活动奖品内部关联券等添加"
,
businessType
=
BusinessType
.
INSERT
)
@RequiresPermissions
(
"sweet:integralActivityPrizeRelation:create"
)
@PostMapping
(
"create"
)
@ApiOperation
(
value
=
"积分活动奖品内部关联券等添加"
)
@ResponseBody
public
AjaxResult
create
(
@Valid
@RequestBody
SweetIntegralActivityPrizeRelationFormParam
param
)
{
Integer
result
=
activityPrizeRelationService
.
createForm
(
param
);
if
(
result
>
0
)
{
return
success
(
"操作成功"
);
}
else
{
return
error
(
"操作失败"
);
}
}
@Log
(
title
=
"积分活动奖品内部关联券等删除"
,
businessType
=
BusinessType
.
DELETE
)
@RequiresPermissions
(
"sweet:integralActivityPrizeRelation:delete"
)
@PutMapping
(
"delete"
)
@ApiOperation
(
value
=
"积分活动奖品内部关联券等删除"
)
@ResponseBody
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"prizeRelationId"
,
value
=
"主键id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"integralActivityId"
,
value
=
"活动主键id"
,
required
=
true
),
})
public
AjaxResult
delete
(
@RequestParam
()
String
prizeRelationId
,
@RequestParam
()
String
integralActivityId
)
{
Integer
result
=
activityPrizeRelationService
.
delete
(
prizeRelationId
,
integralActivityId
);
if
(
result
>
0
)
{
return
success
(
"操作成功"
);
}
else
{
return
error
(
"操作失败"
);
}
}
@Log
(
title
=
"积分活动奖品内部关联券等列表"
,
businessType
=
BusinessType
.
LIST
)
@RequiresPermissions
(
"sweet:integralActivityPrizeRelation:list"
)
@GetMapping
(
"list"
)
@ApiOperation
(
value
=
"积分活动奖品内部关联券等列表"
)
@ResponseBody
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"prizeId"
,
value
=
"奖品主键id"
,
required
=
true
)
})
public
List
<
SweetIntegralActivityPrizeRelation
>
list
(
@RequestParam
()
String
prizeId
)
{
List
<
SweetIntegralActivityPrizeRelation
>
result
=
activityPrizeRelationService
.
list
(
prizeId
);
return
result
;
}
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/static/js/remote-search-coupon-list.js
0 → 100644
View file @
b244d600
;(
function
(
$
)
{
//这里放入插件代码
var
RemoteSearchPerformance
=
function
(
element
,
options
)
{
this
.
$element
=
$
(
element
);
this
.
options
=
$
.
extend
(
true
,
{},
$
.
fn
.
remoteSearchPerformance
.
defaults
,
options
);
this
.
id
=
$
(
element
).
attr
(
'id'
);
this
.
ulID
=
'#'
+
this
.
id
+
'_ul'
;
this
.
ulFoucus
=
false
;
// Method overrides
this
.
render
=
this
.
options
.
render
||
this
.
render
;
this
.
select
=
this
.
options
.
select
||
this
.
select
;
this
.
ajax
=
$
.
extend
({},
$
.
fn
.
remoteSearchPerformance
.
defaults
.
ajax
,
this
.
options
.
ajax
);
this
.
listen
();
}
RemoteSearchPerformance
.
prototype
=
{
listen
:
function
()
{
this
.
$element
.
on
(
'blur'
,
$
.
proxy
(
this
.
blur
,
this
))
.
on
(
'keyup'
,
$
.
proxy
(
this
.
keyup
,
this
));
this
.
$element
.
parent
(
'div.remote_wrapper'
).
on
(
'click'
,
this
.
ulID
,
$
.
proxy
(
this
.
click
,
this
));
},
blur
:
function
(
e
)
{
var
that
=
this
;
e
.
stopPropagation
();
e
.
preventDefault
();
setTimeout
(
function
()
{
if
(
!
that
.
ulFoucus
)
{
that
.
$element
.
val
(
that
.
$element
.
attr
(
'data-name'
));
that
.
hide
();
}
},
150
)
},
keyup
:
function
(
e
)
{
e
.
stopPropagation
();
e
.
preventDefault
();
switch
(
e
.
keyCode
)
{
case
40
:
// down arrow
case
38
:
// up arrow
break
;
case
9
:
// tab
case
13
:
// enter
this
.
ajaxer
();
case
27
:
// escape
break
;
default
:
this
.
ajaxer
();
}
},
hide
:
function
()
{
$
(
this
.
ulID
).
remove
();
return
this
;
},
ajaxer
:
function
()
{
var
that
=
this
,
keyword
=
that
.
$element
.
val
();
busiType
=
window
.
typeRadio
;
couType
=
window
.
typeCoupe
;
// Query changed
that
.
keyword
=
keyword
;
// Cancel last timer if set
if
(
that
.
ajax
.
timerId
)
{
clearTimeout
(
that
.
ajax
.
timerId
);
that
.
ajax
.
timerId
=
null
;
}
// Query is good to send, set a timer
that
.
ajax
.
timerId
=
setTimeout
(
function
()
{
var
params
=
{
keyword
:
keyword
,
busiType
:
busiType
,
couType
:
couType
,
bindType
:
'1,4'
};
var
jAjax
=
$
.
post
;
jAjax
(
that
.
ajax
.
url
,
params
,
function
(
data
){
return
that
.
render
(
data
.
rows
);
});
that
.
ajax
.
timerId
=
null
;
},
that
.
ajax
.
timeout
);
return
that
;
},
render
:
function
(
data
)
{
this
.
ulFoucus
=
false
;
var
liList
=
data
||
[];
var
num
=
this
.
_getNum
();
//添加 ul
if
(
$
(
this
.
ulID
).
length
==
0
)
{
this
.
$element
.
after
(
"<ul id='"
+
this
.
id
+
"_ul' class='remote_search remote_search_top'></ul>"
);
};
//添加li
var
str
=
""
;
if
(
num
)
{
if
(
liList
.
length
)
{
for
(
var
i
=
0
;
i
<
liList
.
length
;
i
++
)
{
str
+=
"<li data-id='"
+
liList
[
i
].
couponId
+
"' data-name='"
+
liList
[
i
].
title
+
"' title='"
+
liList
[
i
].
title
+
"' value='"
+
liList
[
i
].
couponId
+
"'>"
+
liList
[
i
].
title
+
"</li>"
;
}
}
else
{
str
=
"<li data-id='' data-name=''>搜索无数据</li>"
}
}
else
{
this
.
$element
.
attr
(
'data-name'
,
""
);
this
.
$element
.
attr
(
'data-id'
,
""
);
}
$
(
this
.
ulID
).
html
(
str
);
var
bodyHeight
=
$
(
document
.
body
).
height
();
var
offsetTop
=
this
.
$element
.
offset
().
top
;
var
height
=
$
(
this
.
ulID
).
outerHeight
(
true
);
if
(
offsetTop
+
height
>
bodyHeight
){
$
(
this
.
ulID
).
addClass
(
'remote_search_bottom'
).
removeClass
(
'remote_search_top'
);
}
else
{
$
(
this
.
ulID
).
addClass
(
'remote_search_top'
).
removeClass
(
'remote_search_bottom'
);
}
return
this
;
},
click
:
function
(
e
)
{
e
.
stopPropagation
();
e
.
preventDefault
();
var
dataName
=
$
(
e
.
target
).
attr
(
'data-name'
);
var
dataID
=
$
(
e
.
target
).
attr
(
'data-id'
);
this
.
$element
.
val
(
dataName
);
this
.
$element
.
attr
(
'data-name'
,
dataName
);
this
.
$element
.
attr
(
'data-id'
,
dataID
);
this
.
options
.
chose
(
dataName
,
dataID
);
this
.
ulFoucus
=
true
;
return
this
.
hide
();
},
_getNum
:
function
(){
return
this
.
$element
.
val
().
length
;
}
}
$
.
fn
.
remoteSearchPerformance
=
function
(
option
)
{
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
),
data
=
$this
.
data
(
'remoteSearchPerformance'
),
options
=
typeof
option
===
'object'
&&
option
;
if
(
!
data
)
{
$this
.
data
(
'remoteSearchPerformance'
,
(
data
=
new
RemoteSearchPerformance
(
this
,
options
)));
}
if
(
typeof
option
===
'string'
)
{
data
[
option
]();
}
});
}
$
.
fn
.
remoteSearchPerformance
.
defaults
=
{
hiddenVal
:
''
,
chose
:
function
()
{
},
ajax
:
{
url
:
null
,
timeout
:
300
,
method
:
'get'
,
timerId
:
null
},
success
:
function
(
res
){
}
}
$
.
fn
.
remoteSearchPerformance
.
Constructor
=
RemoteSearchPerformance
;
})(
jQuery
);
\ No newline at end of file
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/include.html
View file @
b244d600
...
@@ -43,6 +43,8 @@
...
@@ -43,6 +43,8 @@
<script
th:src=
"@{/ruoyi/js/ry-ui.js?v=4.6.1}"
></script>
<script
th:src=
"@{/ruoyi/js/ry-ui.js?v=4.6.1}"
></script>
<!--远程搜索下拉框-->
<!--远程搜索下拉框-->
<script
th:src=
"@{/js/remote-search-performance.js}"
></script>
<script
th:src=
"@{/js/remote-search-performance.js}"
></script>
<!--远程搜索下拉框:积分抽奖配置使用-->
<script
th:src=
"@{/js/remote-search-coupon-list.js}"
></script>
<script
th:src=
"@{/js/remote-search-coupon.js}"
></script>
<script
th:src=
"@{/js/remote-search-coupon.js}"
></script>
</div>
</div>
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/adam/member/info.html
View file @
b244d600
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
}
}
.interests_item
{
.interests_item
{
width
:
500px
;
width
:
500px
;
height
:
70
0px
;
height
:
95
0px
;
float
:
left
;
float
:
left
;
margin-left
:
126px
!important
;
margin-left
:
126px
!important
;
}
}
...
@@ -92,6 +92,10 @@
...
@@ -92,6 +92,10 @@
background
:
#0d8ddb
;
background
:
#0d8ddb
;
color
:
#fff
;
color
:
#fff
;
}
}
.member-coupes-item
{
max-height
:
300px
;
overflow-y
:
auto
;
}
.member-coupes-item
ul
{
.member-coupes-item
ul
{
padding-left
:
0
;
padding-left
:
0
;
text-align
:
left
;
text-align
:
left
;
...
@@ -138,6 +142,9 @@
...
@@ -138,6 +142,9 @@
.remote_search
{
.remote_search
{
padding-left
:
0
;
padding-left
:
0
;
}
}
.interestsDesc_inner
{
height
:
300px
;
}
</style>
</style>
<body
class=
"gray-bg"
style=
"font: 14px Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif !important;"
>
<body
class=
"gray-bg"
style=
"font: 14px Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif !important;"
>
<section
class=
"section-content"
>
<section
class=
"section-content"
>
...
@@ -290,7 +297,7 @@
...
@@ -290,7 +297,7 @@
</p>
</p>
<input
type=
"text"
class=
"form-control"
id=
"interestsTitle"
name=
"interestsTitle"
placeholder=
"请输入标题"
/>
<input
type=
"text"
class=
"form-control"
id=
"interestsTitle"
name=
"interestsTitle"
placeholder=
"请输入标题"
/>
<input
type=
"text"
class=
"form-control"
id=
"interestsSubTitle"
name=
"interestsSubTitle"
placeholder=
"请输入副标题"
/>
<input
type=
"text"
class=
"form-control"
id=
"interestsSubTitle"
name=
"interestsSubTitle"
placeholder=
"请输入副标题"
/>
<textarea
class=
"form-control"
id=
"interestsDesc"
name=
"interestsDesc"
placeholder=
"详情内容"
></textarea>
<textarea
class=
"form-control
interestsDesc_inner
"
id=
"interestsDesc"
name=
"interestsDesc"
placeholder=
"详情内容"
></textarea>
<div
class=
"member-coupes-item"
>
<div
class=
"member-coupes-item"
>
<ul>
<ul>
<div
class=
"member-coupes-inner"
>
<div
class=
"member-coupes-inner"
>
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/sweet/integralActivity/form.html
View file @
b244d600
<!DOCTYPE html>
<!DOCTYPE html>
<html
lang=
"zh"
xmlns:th=
"http://www.thymeleaf.org"
>
<html
lang=
"zh"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<head>
<th:block
th:include=
"include :: header('添加活动')"
/>
<th:block
th:include=
"include :: header('添加活动')"
/>
<th:block
th:include=
"include :: bootstrap-fileinput-css"
/>
<th:block
th:include=
"include :: bootstrap-fileinput-css"
/>
</head>
<body
class=
"white-bg"
>
<!--奖品项配置表单-->
<form
id=
"form-user-add"
class=
"layui-form"
>
<div>
基础信息
</div>
<div
class=
"main_type"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
活动名称:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"text"
id=
"ActivityName"
autocomplete=
"off"
class=
"layui-input"
placeholder=
"请输入名称"
>
</div>
</div>
<div
class=
"main_type"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
活动类型:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"text"
id=
"ActivityType"
autocomplete=
"off"
class=
"layui-input"
value=
"转盘"
disabled
placeholder=
"请输入类型"
>
</div>
</div>
<input
id=
"ceshi"
class=
"scoreFile"
type=
"file"
name=
"scoreFile"
style=
"display: none;"
>
<input
id=
"selectCeshi"
class=
"scoreFile"
type=
"file"
name=
"scoreFile"
style=
"display: none;"
>
<div
class=
"main_type"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
banner图:
</span>
<div
class=
"layui-input-block"
style=
"display: flex;flex-direction: column;"
>
<img
id=
"viewImg"
src=
""
alt=
""
style=
"max-height:242px;"
>
<div
class=
"ibox-content"
>
<div
class=
"form-group"
>
<div
class=
"file-loading"
>
<input
id=
"fileinput"
type=
"file"
name=
"file"
data-browse-on-zone-click=
"true"
data-theme=
"fas"
>
</div>
</div>
</div>
</div>
</div>
<div
class=
"main_type"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
所需积分:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"text"
id=
"integral"
autocomplete=
"off"
class=
"layui-input"
placeholder=
"请输入所需积分"
>
</div>
</div>
<div
class=
"sendType"
>
<div
style=
"display: flex;align-items: center;"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
活动时间:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"radio"
value=
"1"
name=
"sendType"
checked
><span>
长期
</span>
<input
type=
"radio"
value=
"2"
name=
"sendType"
><span>
选择开始结束时间
</span>
<div
class=
"selectTime"
>
<input
type=
"text"
class=
"layui-input"
id=
"startTime"
autocomplete=
"off"
placeholder=
"请选择起始时间"
>
<span>
~
</span>
<input
type=
"text"
class=
"layui-input"
id=
"endTime"
autocomplete=
"off"
placeholder=
"请选择结束时间"
>
</div>
</div>
</div>
</div>
<div
class=
"selectScore"
>
<p><i
class=
"required"
>
*
</i>
选择商品
</p>
<!-- <button type="button" class="btn btn-primary" onclick="addColumn()">新增商品</button>
<span>最多可上传6个</span> -->
</div>
<!-- <img src="img/select.png" alt=""> -->
<div
class=
"scoreTable"
>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<div
class=
"col-sm-12 select-table table-striped"
>
<table
id=
"bootstrap-table"
></table>
</div>
</div>
</div>
</div>
<div
class=
"main_bottom"
>
<div
class=
"main_type"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
预估玩此活动的总人数:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"text"
id=
"estimatedNum"
autocomplete=
"off"
class=
"layui-input"
placeholder=
"预估玩此活动的总人数"
>
</div>
</div>
<div
class=
"describe"
>
<span
class=
"labelName"
>
<i
class=
"required"
>
*
</i>
活动规则:
</span>
<textarea
id=
"activityRule"
class=
"form-control"
style=
"min-height: 160px;"
></textarea>
</div>
<div
class=
"describe"
>
<span
class=
"labelName"
>
<i
class=
"required"
>
*
</i>
概率公示:
</span>
<textarea
id=
"probabilityPublicity"
class=
"form-control"
style=
"min-height: 160px;"
></textarea>
</div>
<div
class=
"sendTime"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
是否上线:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"radio"
name=
"online"
value=
"1"
checked
><span>
未上线
</span>
<input
type=
"radio"
name=
"online"
value=
"2"
style=
"margin-left: 12px;"
><span>
已上线
</span>
</div>
</div>
<div
class=
"sendTime"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
快递费用:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"radio"
name=
"sex"
value=
"1"
checked
><span>
包邮
</span>
<input
type=
"radio"
name=
"sex"
value=
"2"
style=
"margin-left: 12px;"
><span>
到付
</span>
</div>
<!-- <span style="margin-right:12px;"><p>输入金额</p></span>
<input type="text" id="courierMoney" autocomplete="off" class="layui-input" placeholder="请输入金额"> -->
</div>
<div
class=
"bottom_btn"
>
<!-- <button type="button" class="layui-btn btn btn-primary" lay-filter="formDemo" onclick="create()">创建代金券</button> -->
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"create()"
>
确 定
</button>
</div>
</div>
</form>
<div
id=
"detailsFormList"
class=
"details-form-list"
style=
"display: none"
>
<!--奖品详情-->
<div
class=
"details-pop-inner"
>
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"addCouponShow()"
>
添加优惠券
</button>
<button
type=
"button"
class=
"btn btn-warning"
onclick=
"closeCouponShow()"
>
关闭窗口
</button>
<hr>
<div
class=
"coupon-select"
style=
"display: none"
>
<div
class=
"scope_application"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
选择类别:
</span>
<div
class=
"radio-box"
>
<input
type=
"radio"
name=
"coupeAdd_type"
value=
"2"
checked=
"checked"
/>
商品
</div>
<div
class=
"radio-box"
>
<input
type=
"radio"
name=
"coupeAdd_type"
value=
"3"
/>
优先购买
</div>
</div>
<!--选择优惠券-->
<div
class=
"scope_application"
id=
"scope_application"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
选择优惠券:
</span>
<div
class=
"search_ipt"
style=
"position: relative;display: inline;"
>
<input
type=
"text"
id=
"searchIpt"
autocomplete=
"off"
class=
"layui-input"
placeholder=
"全部"
>
<ul
id=
"dataList"
style=
"position: absolute;"
></ul>
</div>
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"addCouponFun()"
>
确认添加当前优惠券
</button>
</div>
</div>
<hr>
<div
class=
"scoreTable"
>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<div
class=
"col-sm-12 select-table table-striped"
>
<table
id=
"details-table"
></table>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<th:block
th:include=
"include :: footer"
/>
<script
th:src=
"@{/js/jquery.tmpl.js}"
></script>
<th:block
th:include=
"include :: bootstrap-fileinput-js"
/>
<script
type=
"text/javascript"
>
let
platformUrl
=
`[[
${
platformUrl
}
]]`
let
prefix
=
ctx
+
"sweet/sweetIntegralActivity"
;
let
candyfix
=
ctx
+
"candy/coupon"
;
let
showIndex
=
null
;
// 初始化数据, 可以由后台传过来
var
data
=
[];
// 表格内数据集合
let
activityName
=
''
;
// 活动名称
let
activityType
=
''
;
// 活动类型
let
timeType
=
'1'
;
// 活动时间类型
let
startTime
=
''
;
// 开始时间
let
endTime
=
''
;
// 结束时间
let
activityRule
=
''
;
// 活动规则
let
courierType
=
'1'
;
// 快递类型
let
courierMoney
=
''
;
// 快递费用
let
showPicture
=
''
;
// banner
let
online
=
'1'
;
// 是否上线
let
itemId
=
''
;
let
activitySize
=
false
;
let
options
=
{
id
:
"bootstrap-table"
,
data
:
data
,
pagination
:
false
,
showSearch
:
false
,
showRefresh
:
false
,
showToggle
:
false
,
showColumns
:
false
,
sidePagination
:
"client"
,
columns
:
[
{
field
:
'index'
,
align
:
'center'
,
title
:
"序号"
,
formatter
:
function
(
value
,
row
,
index
)
{
return
index
+
1
;
}
},
{
field
:
'prizeTitle'
,
align
:
'center'
,
title
:
'奖品名称'
,
formatter
:
function
(
value
,
row
,
index
)
{
let
str
=
''
;
if
(
data
[
index
].
prizeTitle
)
{
str
=
"<input id='prizeTitle"
+
index
+
"' class='form-control' type='text' name='' value='"
+
data
[
index
].
prizeTitle
+
"'>"
}
else
{
str
=
"<input id='prizeTitle"
+
index
+
"' class='form-control' type='text' name='' value=''>"
}
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
},
{
field
:
'prizeImgInit'
,
align
:
'center'
,
title
:
'商品图片'
,
formatter
:
function
(
value
,
row
,
index
)
{
//
let
str
=
''
;
if
(
data
[
index
].
prizeImgInit
)
{
str
=
`<img id="showPic
${
index
}
" onclick=upFile(
${
index
}
) src="
${
data
[
index
].
prizeImgInit
}
" alt="" style="max-height:50px;">`
}
else
{
str
=
`<img id="showPic
${
index
}
" onclick=upFile(
${
index
}
) src="
${
value
}
" alt="点击上传" style="max-height:50px;">`
}
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
},
{
field
:
'prizeImgSelect'
,
align
:
'center'
,
title
:
'选中图片'
,
formatter
:
function
(
value
,
row
,
index
)
{
//
let
str
=
''
;
if
(
data
[
index
].
prizeImgSelect
)
{
str
=
`<img id="showPicSelect
${
index
}
" onclick=upFileSelect(
${
index
}
) src="
${
data
[
index
].
prizeImgSelect
}
" alt="" style="max-height:50px;">`
}
else
{
str
=
`<img id="showPicSelect
${
index
}
" onclick=upFileSelect(
${
index
}
) src="
${
value
}
" alt="点击上传" style="max-height:50px;">`
}
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
},
{
field
:
'prizeType'
,
align
:
'center'
,
title
:
'奖品类型'
,
formatter
:
function
(
value
,
row
,
index
)
{
let
arr
=
[
'积分'
,
'优惠券'
,
'实物'
,
'登登登VIP'
,
'优先购买券'
];
let
str
=
''
;
arr
.
forEach
((
item
,
i
)
=>
{
i
++
if
(
i
==
data
[
index
].
prizeType
)
{
str
+=
`<option value="
${
i
}
" selected>
${
item
}
</option>`
}
else
{
str
+=
`<option value="
${
i
}
">
${
item
}
</option>`
}
})
let
dom
=
`<select id='prizeType
${
index
}
' class='form-control' name='' onchange="changePrizeType(this,
${
index
}
)">
${
str
}
</select>`
return
dom
;
}
},
{
field
:
'prizeTypeNum'
,
align
:
'center'
,
title
:
'奖励积分数量'
,
formatter
:
function
(
value
,
row
,
index
)
{
let
str
=
''
;
if
(
data
[
index
].
prizeType
===
1
)
{
str
=
`<input id='prizeTypeNum
${
index
}
' class='form-control' type='text' name='' value='
${
data
[
index
].
prizeTypeNum
}
' style="display: block">`
}
else
{
str
=
`<input id='prizeTypeNum
${
index
}
' class='form-control' type='text' name='' value='
${
data
[
index
].
prizeTypeNum
}
' style="display: none">`
}
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
},
{
field
:
'winningProbability'
,
align
:
'center'
,
title
:
'概率'
,
formatter
:
function
(
value
,
row
,
index
)
{
let
str
=
''
;
if
(
data
[
index
].
winningProbability
!==
''
)
{
str
=
`<input id='winningProbability
${
index
}
' class='form-control' type='text' name='' value='
${
data
[
index
].
winningProbability
}
'>`
}
else
{
str
=
`<input id='winningProbability
${
index
}
' class='form-control' type='text' name='' value=''>`
}
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
},
{
field
:
'isInfinite'
,
align
:
'center'
,
title
:
'奖品库存'
,
formatter
:
function
(
value
,
row
,
index
)
{
let
str
=
''
;
if
(
data
[
index
].
isInfinite
===
1
)
{
str
=
`<div class="radio-box"><input type="radio" name="isInfinite
${
index
}
" value="1" checked onclick="changeInfinite(this,
${
index
}
)"/>有限库存</div>
<div class="radio-box"><input type="radio" name="isInfinite
${
index
}
" value="2" onclick="changeInfinite(this,
${
index
}
)"/>无限库存</div>`
}
else
{
str
=
`<div class="radio-box"><input type="radio" name="isInfinite
${
index
}
" value="1" onclick="changeInfinite(this,
${
index
}
)"/>有限库存</div>
<div class="radio-box"><input type="radio" name="isInfinite
${
index
}
" value="2" checked onclick="changeInfinite(this,
${
index
}
)"/>无限库存</div>`
}
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
},
{
field
:
'prizeNum'
,
align
:
'center'
,
title
:
'数量'
,
formatter
:
function
(
value
,
row
,
index
)
{
let
str
=
''
;
if
(
data
[
index
].
prizeNum
!==
''
)
{
if
(
data
[
index
].
isInfinite
===
1
)
{
str
=
`<input id='prizeNum
${
index
}
' class='form-control' type='text' name='' value='
${
data
[
index
].
prizeNum
}
'>`
}
else
{
str
=
`<input id='prizeNum
${
index
}
' class='form-control' type='text' name='' value='
${
data
[
index
].
prizeNum
}
' style="display: none">`
}
}
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
},
{
field
:
'prizeDescribe'
,
align
:
'center'
,
title
:
'奖品描述'
,
formatter
:
function
(
value
,
row
,
index
)
{
let
str
=
''
;
if
(
data
[
index
].
prizeDescribe
!==
''
)
{
str
=
`<input id='prizeDescribe
${
index
}
' class='form-control' type='text' name='' value='
${
data
[
index
].
prizeDescribe
}
'>`
}
else
{
str
=
`<input id='prizeDescribe
${
index
}
' class='form-control' type='text' name='' value=''>`
}
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
},
// {
// field: 'winnersNum',
// align: 'center',
// title: '中奖人数',
// formatter: function(value, row, index) {
// let str = '';
// if (data[index].winnersNum) {
// str = `
<
input
id
=
'winnersNum${index}'
class
=
'form-control'
type
=
'text'
name
=
''
value
=
'${data[index].winnersNum}'
>
`
// } else {
// str = `
<
input
id
=
'winnersNum${index}'
class
=
'form-control'
type
=
'text'
name
=
''
value
=
''
>
`
// }
// var html = $.common.sprintf(str, index, value);
// return html;
// }
// },
{
field: 'winPrizeNum',
align: 'center',
title: '已发出'
},
{
field: 'residue',
align: 'center',
title: '奖品剩余',
formatter: function(value, row, index) {
if (itemId) {
return (row.prizeNum - row.winPrizeNum) || '0'
} else {
return '0'
}
}
},
{
field: '',
align: 'center',
title: '操作',
formatter: function(value, row, index) {
let str = '';
if (data[index].prizeType === 2) {
str = `
<
button
type
=
"button"
class
=
"btn btn-primary"
onclick
=
"showList(` + index + `)"
>
查看列表
<
/button>
`
}
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
}
]
};
let
nowList
=
[];
// 当前编辑的奖品详情列表
let
nowShowData
=
{};
// 当前编辑的奖品信息
let
searchVal
=
''
;
// 优惠券输入框内数据
let
searchData
=
[];
// 优惠券搜索总数据
let
nowCouponSelect
=
{};
// 当前选择的优惠券
let
detailsOptions
=
{
id
:
"details-table"
,
data
:
nowList
,
pagination
:
false
,
showSearch
:
false
,
showRefresh
:
false
,
showToggle
:
false
,
showColumns
:
false
,
sidePagination
:
"client"
,
columns
:
[
{
field
:
'index'
,
align
:
'center'
,
title
:
"序号"
,
formatter
:
function
(
value
,
row
,
index
)
{
return
index
+
1
;
}
},
{
field
:
'couponId'
,
align
:
'center'
,
title
:
"优惠券ID"
,
formatter
:
function
(
value
,
row
,
index
)
{
return
nowList
[
index
].
couponId
;
}
},
{
field
:
'couponTitle'
,
align
:
'center'
,
title
:
"优惠券名称"
,
formatter
:
function
(
value
,
row
,
index
)
{
return
nowList
[
index
].
couponTitle
;
}
},
{
field
:
''
,
align
:
'center'
,
title
:
'操作'
,
formatter
:
function
(
value
,
row
,
index
)
{
let
str
=
''
;
str
=
`<button type="button" class="btn btn-primary" onclick="deleteCoupon(`
+
index
+
`)">删除</button>`
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
}
]
};
$
(
function
()
{
itemId
=
getUrlParms
(
'id'
)
function
getUrlParms
(
name
){
var
reg
=
new
RegExp
(
"(^|&)"
+
name
+
"=([^&]*)(&|$)"
);
var
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
);
if
(
r
!=
null
)
return
unescape
(
r
[
2
]);
return
null
;
}
if
(
itemId
)
{
$
.
ajax
({
type
:
'get'
,
url
:
'/sweet/integralActivity/details'
,
data
:
{
integralActivityId
:
itemId
},
success
:
function
(
e
)
{
if
(
e
.
code
==
0
)
{
let
res
=
e
.
data
;
showPicture
=
res
.
activityImg
;
$
(
"#viewImg"
).
attr
(
'src'
,
showPicture
);
$
(
"#integral"
).
val
(
res
.
activityNum
);
$
(
"#activityRule"
).
val
(
res
.
activityRules
);
$
(
"#ActivityName"
).
val
(
res
.
activityTitle
);
$
(
"#estimatedNum"
).
val
(
res
.
estimatedNum
);
$
(
"#probabilityPublicity"
).
val
(
res
.
probabilityPublicity
);
// activityType: 1,
courierType
=
res
.
expressFeeType
;
if
(
courierType
==
2
)
{
$
(
"input[name='sex'][value='2']"
).
attr
(
'checked'
,
true
).
siblings
().
removeAttr
(
'checked'
);
}
integralActivityId
=
res
.
integralActivityId
;
online
=
res
.
isOnline
;
if
(
online
==
2
)
{
$
(
"input[name='online'][value='2']"
).
attr
(
'checked'
,
true
).
siblings
().
removeAttr
(
'checked'
);
}
timeType
=
res
.
timeType
;
if
(
timeType
==
2
)
{
$
(
"input[name='sendType'][value='2']"
).
attr
(
'checked'
,
true
).
siblings
().
removeAttr
(
'checked'
);
$
(
"#endTime"
).
val
(
$
.
common
.
dateFormat
(
res
.
endTime
,
'yyyy-MM-dd HH:mm:ss'
));
$
(
"#startTime"
).
val
(
$
.
common
.
dateFormat
(
res
.
startTime
,
'yyyy-MM-dd HH:mm:ss'
));
}
else
{
$
(
"#endTime"
).
val
(
""
);
$
(
"#startTime"
).
val
(
""
);
}
data
=
[...
res
.
prizeList
]
options
.
data
=
data
;
setTimeout
(()
=>
{
$
.
table
.
init
(
options
);
},
500
)
}
}
})
}
else
{
let
obj
=
{
prizeId
:
""
,
prizeTitle
:
""
,
prizeImgInit
:
""
,
prizeImgSelect
:
""
,
winPrizeNum
:
""
,
prizeType
:
1
,
prizeTypeNum
:
0
,
isInfinite
:
1
,
prizeNum
:
0
,
winningProbability
:
""
,
prizeDescribe
:
""
,
residue
:
""
};
for
(
var
i
=
0
;
i
<
20
;
i
++
)
{
data
.
push
(
obj
)
}
$
.
table
.
init
(
options
);
}
});
layui
.
use
(
'laydate'
,
function
(){
var
laydate
=
layui
.
laydate
;
//执行一个laydate实例
laydate
.
render
({
elem
:
'#startTime'
,
//指定元素
type
:
'datetime'
});
laydate
.
render
({
elem
:
'#endTime'
,
//指定元素
type
:
'datetime'
});
});
$
(
"#ActivityName"
).
blur
(
function
(
e
)
{
if
(
e
.
target
.
value
.
length
>
20
)
{
activitySize
=
true
;
layer
.
msg
(
'活动名称限制在20个字符以内!'
)
return
}
else
{
activitySize
=
false
;
}
})
$
(
"input[name=sendType]"
).
change
((
e
)
=>
{
timeType
=
e
.
target
.
value
;
if
(
timeType
==
1
)
{
$
(
"#endTime"
).
val
(
""
);
$
(
"#startTime"
).
val
(
""
);
}
})
$
(
"input[name=sex]"
).
change
((
e
)
=>
{
courierType
=
e
.
target
.
value
;
})
$
(
"input[name=online]"
).
change
((
e
)
=>
{
online
=
e
.
target
.
value
;
})
function
upFile
(
e
)
{
showIndex
=
e
;
$
(
"#ceshi"
).
click
();
}
function
upFileSelect
(
e
)
{
showIndex
=
e
;
$
(
"#selectCeshi"
).
click
();
}
$
(
"#ceshi"
).
change
((
e
)
=>
{
if
(
!
e
.
target
.
files
[
0
])
{
return
}
var
formData
=
new
FormData
();
formData
.
append
(
"file"
,
e
.
target
.
files
[
0
]);
$
.
ajax
({
url
:
platformUrl
+
"/platform/basicServices/alOss/upload"
,
//路径是你控制器中上传图片的方法,下面controller里面我会写到
data
:
formData
,
cache
:
false
,
contentType
:
false
,
processData
:
false
,
type
:
'POST'
,
success
:
function
(
res
)
{
$
(
"#showPic"
+
showIndex
).
attr
(
'src'
,
'https://img.zhengzai.tv/'
+
res
.
data
.
ossPath
)
data
[
showIndex
].
prizeImgInit
=
'https://img.zhengzai.tv/'
+
res
.
data
.
ossPath
;
$
(
"#ceshi"
).
val
(
""
);
// $summernote.summernote('insertImage', 'https://img.zhengzai.tv/' + data.data.ossPath)
}
});
})
$
(
"#selectCeshi"
).
change
((
e
)
=>
{
if
(
!
e
.
target
.
files
[
0
])
{
return
}
var
formData
=
new
FormData
();
formData
.
append
(
"file"
,
e
.
target
.
files
[
0
]);
$
.
ajax
({
url
:
platformUrl
+
"/platform/basicServices/alOss/upload"
,
//路径是你控制器中上传图片的方法,下面controller里面我会写到
data
:
formData
,
cache
:
false
,
contentType
:
false
,
processData
:
false
,
type
:
'POST'
,
success
:
function
(
res
)
{
$
(
"#showPicSelect"
+
showIndex
).
attr
(
'src'
,
'https://img.zhengzai.tv/'
+
res
.
data
.
ossPath
)
data
[
showIndex
].
prizeImgInit
=
'https://img.zhengzai.tv/'
+
res
.
data
.
ossPath
;
$
(
"#selectCeshi"
).
val
(
""
);
// $summernote.summernote('insertImage', 'https://img.zhengzai.tv/' + data.data.ossPath)
}
});
})
$
(
"#fileinput"
).
fileinput
({
'theme'
:
'explorer-fas'
,
'uploadUrl'
:
platformUrl
+
"/platform/basicServices/alOss/upload"
,
"uploadExtraData"
:
{
"pathName"
:
"banner"
,
"buckType"
:
1
},
autoReplace
:
true
,
showCaption
:
false
,
showPreview
:
false
,
showRemove
:
false
,
showUpload
:
false
,
showCancel
:
false
,
showClose
:
false
,
autoReplace
:
true
,
dropZoneTitle
:
"请上传文件"
,
maxFileCount
:
1
}).
on
(
"filebatchselected"
,
function
(
event
,
files
)
{
//默认上传
$
(
this
).
fileinput
(
"upload"
);
})
.
on
(
"fileuploaded"
,
function
(
event
,
data
)
{
//上传回调事件
showPicture
=
'https://img.zhengzai.tv/'
+
data
.
response
.
data
.
ossPath
;
$
(
"#viewImg"
).
attr
(
'src'
,
showPicture
)
})
function
create
()
{
if
(
!
$
(
"#ActivityName"
).
val
()
||
!
$
(
"#ActivityType"
).
val
()
||
!
showPicture
||
!
$
(
"#integral"
).
val
()
||
!
$
(
"#activityRule"
).
val
()
||
!
$
(
"#viewImg"
).
attr
(
'src'
)
||
!
$
(
"#estimatedNum"
).
val
()
||
!
$
(
"#probabilityPublicity"
).
val
()
)
{
return
layer
.
msg
(
'请将活动必填信息填写完整!'
)
}
if
(
timeType
==
2
)
{
if
(
!
$
(
"#startTime"
).
val
()
||
!
$
(
"#endTime"
).
val
())
{
return
layer
.
msg
(
'请选择时间!'
)
}
}
else
{
$
(
"#startTime"
).
val
(
""
)
$
(
"#endTime"
).
val
(
""
)
}
if
(
activitySize
)
{
layer
.
msg
(
"活动名称限制在20个字符以内!"
)
return
}
let
flag
=
false
;
let
prizeListArr
=
[]
data
.
forEach
((
item
,
index
)
=>
{
let
temp
=
{};
if
(
!
$
(
"#prizeTitle"
+
index
).
val
()
||
!
$
(
"#showPic"
+
index
).
attr
(
'src'
)
||
!
$
(
"#showPicSelect"
+
index
).
attr
(
'src'
)
||
!
$
(
"#prizeType"
+
index
).
val
()
||
!
$
(
"#winningProbability"
+
index
).
val
()
||
!
$
(
"input[name=isInfinite"
+
index
+
"]:checked"
).
val
()
||
!
$
(
"#prizeNum"
+
index
).
val
()
)
{
flag
=
true
}
else
{
temp
.
prizeId
=
data
[
index
].
prizeId
?
data
[
index
].
prizeId
:
''
;
temp
.
prizeTitle
=
$
(
"#prizeTitle"
+
index
).
val
();
temp
.
prizeImgInit
=
$
(
"#showPic"
+
index
).
attr
(
'src'
);
temp
.
prizeImgSelect
=
$
(
"#showPicSelect"
+
index
).
attr
(
'src'
);
temp
.
prizeType
=
$
(
"#prizeType"
+
index
).
val
();
temp
.
prizeTypeNum
=
temp
.
prizeType
==
'1'
?
$
(
"#prizeTypeNum"
+
index
).
val
()
:
0
;
temp
.
isInfinite
=
$
(
"input[name=isInfinite"
+
index
+
"]:checked"
).
val
();
temp
.
prizeNum
=
temp
.
isInfinite
===
'1'
?
$
(
"#prizeNum"
+
index
).
val
()
:
0
;
temp
.
winningProbability
=
$
(
"#winningProbability"
+
index
).
val
();
temp
.
prizeDescribe
=
$
(
"#prizeDescribe"
+
index
).
val
();
}
prizeListArr
.
push
(
temp
);
});
if
(
flag
)
{
return
layer
.
msg
(
'请将奖品表格内容填写完整!'
)
}
let
datas
=
{
activityImg
:
showPicture
,
activityNum
:
$
(
"#integral"
).
val
(),
activityRules
:
$
(
"#activityRule"
).
val
(),
activityTitle
:
$
(
"#ActivityName"
).
val
(),
activityType
:
1
,
expressFeeType
:
courierType
,
integralActivityId
:
itemId
||
''
,
endTime
:
$
.
common
.
dateFormat
(
$
(
"#endTime"
).
val
(),
'yyyy-MM-dd HH:mm:ss'
)
,
//
isOnline
:
online
,
prizeList
:
prizeListArr
,
startTime
:
$
.
common
.
dateFormat
(
$
(
"#startTime"
).
val
(),
'yyyy-MM-dd HH:mm:ss'
),
timeType
:
timeType
,
estimatedNum
:
$
(
"#estimatedNum"
).
val
(),
probabilityPublicity
:
$
(
"#probabilityPublicity"
).
val
()
}
let
url
=
'/sweet/integralActivity/create'
;
let
type
=
'post'
;
if
(
itemId
)
{
url
=
'/sweet/integralActivity/update'
type
=
'put'
}
$
.
ajax
({
type
,
url
,
contentType
:
"application/json;charset=UTF-8"
,
data
:
JSON
.
stringify
(
datas
),
success
:
function
(
res
)
{
layer
.
msg
(
''
+
res
);
if
(
res
.
code
!=
undefined
&&
res
.
code
!=
web_status
.
SUCCESS
)
{
$
.
modal
.
alertWarning
(
res
.
msg
);
return
;
}
else
if
(
res
.
code
==
web_status
.
SUCCESS
)
{
$
.
operate
.
successTabCallback
(
res
);
closeItem
();
}
}
})
}
// 奖品类型切换
function
changePrizeType
(
item
,
index
)
{
if
(
item
.
value
===
'1'
)
{
$
(
'#prizeTypeNum'
+
index
).
show
();
// 填积分数量
}
else
{
$
(
'#prizeTypeNum'
+
index
).
val
(
0
);
$
(
'#prizeTypeNum'
+
index
).
hide
();
// 不填数量
}
}
// 库存切换
function
changeInfinite
(
item
,
index
)
{
if
(
item
.
value
===
'1'
)
{
$
(
'#prizeNum'
+
index
).
show
();
// 填数量
}
else
if
(
item
.
value
===
'2'
)
{
$
(
'#prizeNum'
+
index
).
val
(
0
);
$
(
'#prizeNum'
+
index
).
hide
();
// 无限库存,不填数量
}
}
// 展示已配置的优惠券列表
function
showList
(
index
)
{
nowShowData
=
data
[
index
];
nowShowData
.
index
=
index
;
nowList
=
[];
detailsOptions
.
data
=
[];
$
.
table
.
destroy
(
"details-table"
);
$
.
ajax
({
type
:
'get'
,
url
:
'/sweet/integralActivityPrizeRelation/list'
,
data
:
{
prizeId
:
nowShowData
[
'prizeId'
]
},
success
:
function
(
res
)
{
nowList
=
res
;
detailsOptions
.
data
=
res
;
setTimeout
(()
=>
{
$
.
table
.
init
(
detailsOptions
);
},
500
)
$
(
"#detailsFormList"
).
show
();
}
});
}
function
addCouponShow
()
{
$
(
".coupon-select"
).
show
();
}
function
closeCouponShow
()
{
$
(
"#detailsFormList"
).
hide
();
}
// 类别
function
changeRadioType
(
val
)
{
console
.
log
(
'changeRadioType'
,
val
);
}
// 添加优惠券
function
addCouponFun
()
{
if
(
!
nowCouponSelect
.
couponId
)
{
this
.
alert
(
'请先选择优惠券'
);
return
;
}
let
postData
=
{
"couponId"
:
nowCouponSelect
.
couponId
,
"couponTitle"
:
nowCouponSelect
.
title
,
"integralActivityId"
:
nowShowData
[
'integralActivityId'
],
"prizeId"
:
nowShowData
[
'prizeId'
]
};
$
.
ajax
({
type
:
'post'
,
url
:
'/sweet/integralActivityPrizeRelation/create'
,
data
:
JSON
.
stringify
(
postData
),
contentType
:
'application/json'
,
success
:
function
(
e
)
{
if
(
e
.
code
==
0
)
{
showList
(
nowShowData
.
index
);
alert
(
'添加成功!'
);
}
}
});
}
// 删除优惠券
function
deleteCoupon
(
index
)
{
let
postData
=
{
"integralActivityId"
:
nowShowData
[
'integralActivityId'
],
"prizeRelationId"
:
nowList
[
index
][
'prizeRelationId'
]
};
$
.
ajax
({
type
:
'put'
,
url
:
'/sweet/integralActivityPrizeRelation/delete'
,
data
:
postData
,
success
:
function
(
e
)
{
if
(
e
.
code
==
0
)
{
showList
(
nowShowData
.
index
);
alert
(
'删除成功!'
);
}
}
});
}
// 远程搜索券
function
getMallList
()
{
let
data
=
{
keyword
:
searchVal
,
busiType
:
parseInt
(
$
(
'input[type=radio][name=coupeAdd_type]:checked'
).
val
()),
pageSize
:
20
,
pageNum
:
1
,
bindType
:
2
}
let
str
=
''
;
promiseMethods
(
candyfix
+
"/list"
,
'post'
,
data
,
'application/x-www-form-urlencoded'
).
then
(
res
=>
{
if
(
res
.
rows
.
length
>
0
)
{
searchData
=
res
.
rows
;
searchData
.
forEach
((
item
,
index
)
=>
{
str
+=
`<li class="selectData" onclick="selectOne('
${
item
.
couponId
}
', 'couponId')">
${
item
.
title
}
</li>`
})
$
(
'#dataList'
).
html
(
str
);
}
else
{
$
(
'#dataList'
).
html
(
'<li style="width:100%;text-align:center;color:#ccc;">--- 暂无数据 ---</li>'
);
}
})
}
function
promiseMethods
(
url
,
type
,
data
,
contentType
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
$
.
ajax
({
url
,
type
,
data
,
contentType
,
success
:
function
(
res
)
{
resolve
(
res
);
}
})
})
}
// 选择优惠券
function
selectOne
(
id
,
name
)
{
searchData
.
some
(
(
item
,
index
)
=>
{
if
(
item
[
name
]
==
id
)
{
nowCouponSelect
=
item
;
return
$
(
"#searchIpt"
).
val
(
item
.
title
);
}
}
)
}
$
(
"#searchIpt"
).
focus
(
function
(){
getMallList
()
$
(
'#dataList'
).
show
()
});
$
(
"#searchIpt"
).
blur
(
function
(){
setTimeout
(()
=>
{
$
(
'#dataList'
).
hide
()
},
500
);
});
$
(
"#searchIpt"
).
keyup
(
function
(){
searchVal
=
$
(
"#searchIpt"
).
val
()
getMallList
()
});
</script>
<style>
<style>
.layui-form
{
.layui-form
{
padding
:
20px
;
padding
:
20px
;
...
@@ -96,525 +962,69 @@
...
@@ -96,525 +962,69 @@
}
}
.scoreTable
{
.scoreTable
{
margin-bottom
:
12px
;
margin-bottom
:
12px
;
overflow-y
:
scroll
;
max-height
:
600px
;
}
}
</style>
.details-form-list
{
</head>
position
:
fixed
;
<body
class=
"white-bg"
>
top
:
0
;
<form
id=
"form-user-add"
class=
"layui-form"
>
left
:
0
;
<div>
width
:
100%
;
基础信息
height
:
100%
;
</div>
background
:
rgba
(
0
,
0
,
0
,
.5
);
<div
class=
"main_type"
>
display
:
flex
;
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
活动名称:
</span>
justify-content
:
center
;
<div
class=
"layui-input-block"
style=
"display: flex"
>
align-items
:
center
;
<input
type=
"text"
id=
"ActivityName"
autocomplete=
"off"
class=
"layui-input"
placeholder=
"请输入名称"
>
</div>
</div>
<div
class=
"main_type"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
活动类型:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"text"
id=
"ActivityType"
autocomplete=
"off"
class=
"layui-input"
value=
"转盘"
disabled
placeholder=
"请输入类型"
>
</div>
</div>
<input
id=
"ceshi"
class=
"scoreFile"
type=
"file"
name=
"scoreFile"
style=
"display: none;"
>
<input
id=
"selectCeshi"
class=
"scoreFile"
type=
"file"
name=
"scoreFile"
style=
"display: none;"
>
<div
class=
"main_type"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
banner图:
</span>
<div
class=
"layui-input-block"
style=
"display: flex;flex-direction: column;"
>
<img
id=
"viewImg"
src=
""
alt=
""
style=
"max-height:242px;"
>
<div
class=
"ibox-content"
>
<div
class=
"form-group"
>
<div
class=
"file-loading"
>
<input
id=
"fileinput"
type=
"file"
name=
"file"
data-browse-on-zone-click=
"true"
data-theme=
"fas"
>
</div>
</div>
</div>
</div>
</div>
<div
class=
"main_type"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
所需积分:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"text"
id=
"integral"
autocomplete=
"off"
class=
"layui-input"
placeholder=
"请输入所需积分"
>
</div>
</div>
<div
class=
"sendType"
>
<div
style=
"display: flex;align-items: center;"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
活动时间:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"radio"
value=
"1"
name=
"sendType"
checked
><span>
长期
</span>
<input
type=
"radio"
value=
"2"
name=
"sendType"
><span>
选择开始结束时间
</span>
<div
class=
"selectTime"
>
<input
type=
"text"
class=
"layui-input"
id=
"startTime"
autocomplete=
"off"
placeholder=
"请选择起始时间"
>
<span>
~
</span>
<input
type=
"text"
class=
"layui-input"
id=
"endTime"
autocomplete=
"off"
placeholder=
"请选择结束时间"
>
</div>
</div>
</div>
</div>
<div
class=
"selectScore"
>
<p><i
class=
"required"
>
*
</i>
选择商品
</p>
<!-- <button type="button" class="btn btn-primary" onclick="addColumn()">新增商品</button>
<span>最多可上传6个</span> -->
</div>
<!-- <img src="img/select.png" alt=""> -->
<div
class=
"scoreTable"
>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<div
class=
"col-sm-12 select-table table-striped"
>
<table
id=
"bootstrap-table"
></table>
</div>
</div>
</div>
</div>
<div
class=
"main_bottom"
>
<div
class=
"describe"
>
<span
class=
"labelName"
>
<i
class=
"required"
>
*
</i>
活动规则:
</span>
<textarea
id=
"activityRule"
class=
"form-control"
style=
"min-height: 160px;"
></textarea>
</div>
<div
class=
"sendTime"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
是否上线:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"radio"
name=
"online"
value=
"1"
checked
><span>
未上线
</span>
<input
type=
"radio"
name=
"online"
value=
"2"
style=
"margin-left: 12px;"
><span>
已上线
</span>
</div>
</div>
<div
class=
"sendTime"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
快递费用:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"radio"
name=
"sex"
value=
"1"
checked
><span>
包邮
</span>
<input
type=
"radio"
name=
"sex"
value=
"2"
style=
"margin-left: 12px;"
><span>
到付
</span>
</div>
<!-- <span style="margin-right:12px;"><p>输入金额</p></span>
<input type="text" id="courierMoney" autocomplete="off" class="layui-input" placeholder="请输入金额"> -->
</div>
<div
class=
"bottom_btn"
>
<!-- <button type="button" class="layui-btn btn btn-primary" lay-filter="formDemo" onclick="create()">创建代金券</button> -->
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"create()"
>
确 定
</button>
</div>
</div>
</form>
<th:block
th:include=
"include :: footer"
/>
<script
th:src=
"@{/js/jquery.tmpl.js}"
></script>
<th:block
th:include=
"include :: bootstrap-fileinput-js"
/>
<script
type=
"text/javascript"
>
var
platformUrl
=
`[[
${
platformUrl
}
]]`
var
prefix
=
ctx
+
"sweet/sweetIntegralActivity"
;
let
showIndex
=
null
;
// 初始化数据, 可以由后台传过来
var
data
=
[];
// 表格内数据集合
let
activityName
=
''
;
// 活动名称
let
activityType
=
''
;
// 活动类型
let
timeType
=
'1'
;
// 活动时间类型
let
startTime
=
''
;
// 开始时间
let
endTime
=
''
;
// 结束时间
let
activityRule
=
''
;
// 活动规则
let
courierType
=
'1'
;
// 快递类型
let
courierMoney
=
''
;
// 快递费用
let
showPicture
=
''
;
// banner
let
online
=
'1'
;
// 是否上线
let
itemId
=
''
;
let
activitySize
=
false
;
var
options
=
{
data
:
data
,
pagination
:
false
,
showSearch
:
false
,
showRefresh
:
false
,
showToggle
:
false
,
showColumns
:
false
,
sidePagination
:
"client"
,
columns
:
[
{
field
:
'index'
,
align
:
'center'
,
title
:
"序号"
,
formatter
:
function
(
value
,
row
,
index
)
{
return
index
+
1
;
}
},
{
field
:
'prizeTitle'
,
align
:
'center'
,
title
:
'奖品名称'
,
formatter
:
function
(
value
,
row
,
index
)
{
let
str
=
''
;
if
(
data
[
index
].
prizeTitle
)
{
str
=
"<input id='prizeTitle"
+
index
+
"' class='form-control' type='text' name='' value='"
+
data
[
index
].
prizeTitle
+
"'>"
}
else
{
str
=
"<input id='prizeTitle"
+
index
+
"' class='form-control' type='text' name='' value=''>"
}
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
},
{
field
:
'prizeImgInit'
,
align
:
'center'
,
title
:
'商品图片'
,
formatter
:
function
(
value
,
row
,
index
)
{
//
let
str
=
''
;
if
(
data
[
index
].
prizeImgInit
)
{
str
=
`<img id="showPic
${
index
}
" onclick=upFile(
${
index
}
) src="
${
data
[
index
].
prizeImgInit
}
" alt="" style="max-height:50px;">`
}
else
{
str
=
`<img id="showPic
${
index
}
" onclick=upFile(
${
index
}
) src="
${
value
}
" alt="点击上传" style="max-height:50px;">`
}
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
},
{
field
:
'prizeImgSelect'
,
align
:
'center'
,
title
:
'选中图片'
,
formatter
:
function
(
value
,
row
,
index
)
{
//
let
str
=
''
;
if
(
data
[
index
].
prizeImgSelect
)
{
str
=
`<img id="showPicSelect
${
index
}
" onclick=upFileSelect(
${
index
}
) src="
${
data
[
index
].
prizeImgSelect
}
" alt="" style="max-height:50px;">`
}
else
{
str
=
`<img id="showPicSelect
${
index
}
" onclick=upFileSelect(
${
index
}
) src="
${
value
}
" alt="点击上传" style="max-height:50px;">`
}
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
},
{
field
:
'prizeType'
,
align
:
'center'
,
title
:
'奖品类型'
,
formatter
:
function
(
value
,
row
,
index
)
{
let
arr
=
[
'谢谢惠顾'
,
'积分'
,
'代金券'
,
'满减券'
,
'优先购买'
,
'实物'
];
let
str
=
''
;
arr
.
forEach
((
item
,
i
)
=>
{
i
++
if
(
i
==
data
[
index
].
prizeType
)
{
str
+=
`<option value="
${
i
}
" selected>
${
item
}
</option>`
}
else
{
str
+=
`<option value="
${
i
}
">
${
item
}
</option>`
}
})
let
dom
=
`<select id='prizeType
${
index
}
' class='form-control' name=''>
${
str
}
</select>`
return
dom
;
}
},
{
field
:
'winningProbability'
,
align
:
'center'
,
title
:
'概率'
,
formatter
:
function
(
value
,
row
,
index
)
{
let
str
=
''
;
if
(
data
[
index
].
winningProbability
)
{
str
=
`<input id='winningProbability
${
index
}
' class='form-control' type='text' name='' value='
${
data
[
index
].
winningProbability
}
'>`
}
else
{
str
=
`<input id='winningProbability
${
index
}
' class='form-control' type='text' name='' value=''>`
}
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
},
{
field
:
'prizeNum'
,
align
:
'center'
,
title
:
'数量'
,
formatter
:
function
(
value
,
row
,
index
)
{
let
str
=
''
;
if
(
data
[
index
].
prizeNum
)
{
str
=
`<input id='prizeNum
${
index
}
' class='form-control' type='text' name='' value='
${
data
[
index
].
prizeNum
}
'>`
}
else
{
str
=
`<input id='prizeNum
${
index
}
' class='form-control' type='text' name='' value=''>`
}
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
},
{
field
:
'winnersNum'
,
align
:
'center'
,
title
:
'中奖人数'
,
formatter
:
function
(
value
,
row
,
index
)
{
let
str
=
''
;
if
(
data
[
index
].
winnersNum
)
{
str
=
`<input id='winnersNum
${
index
}
' class='form-control' type='text' name='' value='
${
data
[
index
].
winnersNum
}
'>`
}
else
{
str
=
`<input id='winnersNum
${
index
}
' class='form-control' type='text' name='' value=''>`
}
var
html
=
$
.
common
.
sprintf
(
str
,
index
,
value
);
return
html
;
}
},
{
field
:
'winPrizeNum'
,
align
:
'center'
,
title
:
'已发出'
},
{
field
:
'residue'
,
align
:
'center'
,
title
:
'奖品剩余'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
itemId
)
{
return
(
row
.
prizeNum
-
row
.
winPrizeNum
)
||
'0'
}
else
{
return
'0'
}
}
}
]
};
layui
.
use
(
'laydate'
,
function
(){
var
laydate
=
layui
.
laydate
;
//执行一个laydate实例
laydate
.
render
({
elem
:
'#startTime'
,
//指定元素
type
:
'datetime'
});
laydate
.
render
({
elem
:
'#endTime'
,
//指定元素
type
:
'datetime'
});
});
$
(
"#ActivityName"
).
blur
(
function
(
e
)
{
if
(
e
.
target
.
value
.
length
>
20
)
{
activitySize
=
true
;
layer
.
msg
(
'活动名称限制在20个字符以内!'
)
return
}
else
{
activitySize
=
false
;
}
})
$
(
function
()
{
itemId
=
getUrlParms
(
'id'
)
function
getUrlParms
(
name
){
var
reg
=
new
RegExp
(
"(^|&)"
+
name
+
"=([^&]*)(&|$)"
);
var
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
);
if
(
r
!=
null
)
return
unescape
(
r
[
2
]);
return
null
;
}
}
if
(
itemId
)
{
.details-pop-inner
{
$
.
ajax
({
width
:
800px
;
type
:
'get'
,
height
:
820px
;
url
:
'/sweet/integralActivity/details'
,
padding
:
10px
;
data
:
{
integralActivityId
:
itemId
},
background
:
#fff
;
success
:
function
(
e
)
{
}
if
(
e
.
code
==
0
)
{
.search_ipt
ul
,
.search_ipt
li
{
let
res
=
e
.
data
;
padding
:
0
;
showPicture
=
res
.
activityImg
;
margin
:
0
;
$
(
"#viewImg"
).
attr
(
'src'
,
showPicture
);
font-style
:
normal
;
$
(
"#integral"
).
val
(
res
.
activityNum
);
list-style
:
none
;
$
(
"#activityRule"
).
val
(
res
.
activityRules
);
}
$
(
"#ActivityName"
).
val
(
res
.
activityTitle
);
.search_ipt
ul
{
// activityType: 1,
display
:
none
;
courierType
=
res
.
expressFeeType
;
position
:
absolute
;
if
(
courierType
==
2
)
{
left
:
0
;
$
(
"input[name='sex'][value='2']"
).
attr
(
'checked'
,
true
).
siblings
().
removeAttr
(
'checked'
);
top
:
26px
;
}
padding
:
5px
0
;
integralActivityId
=
res
.
integralActivityId
;
z-index
:
899
;
online
=
res
.
isOnline
;
min-width
:
200px
;
if
(
online
==
2
)
{
border
:
1px
solid
#eee
;
$
(
"input[name='online'][value='2']"
).
attr
(
'checked'
,
true
).
siblings
().
removeAttr
(
'checked'
);
max-height
:
300px
;
}
overflow-y
:
auto
;
// prizeList: data,
background-color
:
#fff
;
border-radius
:
2px
;
timeType
=
res
.
timeType
;
box-sizing
:
border-box
;
if
(
timeType
==
2
)
{
box-shadow
:
1px
1px
4px
rgb
(
0
0
0
/
8%
);
$
(
"input[name='sendType'][value='2']"
).
attr
(
'checked'
,
true
).
siblings
().
removeAttr
(
'checked'
);
}
$
(
"#endTime"
).
val
(
$
.
common
.
dateFormat
(
res
.
endTime
,
'yyyy-MM-dd HH:mm:ss'
));
.search_ipt
li
{
$
(
"#startTime"
).
val
(
$
.
common
.
dateFormat
(
res
.
startTime
,
'yyyy-MM-dd HH:mm:ss'
));
background-color
:
#fff
;
}
else
{
cursor
:
pointer
;
$
(
"#endTime"
).
val
(
""
);
padding-left
:
10px
!important
;
$
(
"#startTime"
).
val
(
""
);
color
:
#999
;
}
padding
:
0
10px
;
data
=
[...
res
.
prizeList
]
line-height
:
36px
;
options
.
data
=
data
;
white-space
:
nowrap
;
setTimeout
(()
=>
{
overflow
:
hidden
;
$
.
table
.
init
(
options
);
text-overflow
:
ellipsis
;
},
500
)
}
}
.search_ipt
li
:hover
{
}
background
:
#F6F6F6
;
})
}
}
else
{
.search_ipt
.layui-input
{
let
obj
=
{
width
:
200px
;
prizeTitle
:
""
,
}
prizeImgInit
:
""
,
.radio-box
input
[
type
=
radio
]
{
prizeImgSelect
:
""
,
vertical-align
:
middle
;
winnersNum
:
""
,
}
winPrizeNum
:
""
,
prizeType
:
""
,
</style>
winningProbability
:
""
,
residue
:
""
,
prizeNum
:
""
};
for
(
var
i
=
0
;
i
<
12
;
i
++
)
{
data
.
push
(
obj
)
}
$
.
table
.
init
(
options
);
}
});
$
(
"input[name=sendType]"
).
change
((
e
)
=>
{
timeType
=
e
.
target
.
value
;
if
(
timeType
==
1
)
{
$
(
"#endTime"
).
val
(
""
);
$
(
"#startTime"
).
val
(
""
);
}
})
$
(
"input[name=sex]"
).
change
((
e
)
=>
{
courierType
=
e
.
target
.
value
;
})
$
(
"input[name=online]"
).
change
((
e
)
=>
{
online
=
e
.
target
.
value
;
})
function
upFile
(
e
)
{
showIndex
=
e
;
$
(
"#ceshi"
).
click
();
}
function
upFileSelect
(
e
)
{
showIndex
=
e
;
$
(
"#selectCeshi"
).
click
();
}
$
(
"#ceshi"
).
change
((
e
)
=>
{
if
(
!
e
.
target
.
files
[
0
])
{
return
}
var
formData
=
new
FormData
();
formData
.
append
(
"file"
,
e
.
target
.
files
[
0
]);
$
.
ajax
({
url
:
platformUrl
+
"/platform/basicServices/alOss/upload"
,
//路径是你控制器中上传图片的方法,下面controller里面我会写到
data
:
formData
,
cache
:
false
,
contentType
:
false
,
processData
:
false
,
type
:
'POST'
,
success
:
function
(
res
)
{
$
(
"#showPic"
+
showIndex
).
attr
(
'src'
,
'https://img.zhengzai.tv/'
+
res
.
data
.
ossPath
)
data
[
showIndex
].
prizeImgInit
=
'https://img.zhengzai.tv/'
+
res
.
data
.
ossPath
;
$
(
"#ceshi"
).
val
(
""
);
// $summernote.summernote('insertImage', 'https://img.zhengzai.tv/' + data.data.ossPath)
}
});
})
$
(
"#selectCeshi"
).
change
((
e
)
=>
{
if
(
!
e
.
target
.
files
[
0
])
{
return
}
var
formData
=
new
FormData
();
formData
.
append
(
"file"
,
e
.
target
.
files
[
0
]);
$
.
ajax
({
url
:
platformUrl
+
"/platform/basicServices/alOss/upload"
,
//路径是你控制器中上传图片的方法,下面controller里面我会写到
data
:
formData
,
cache
:
false
,
contentType
:
false
,
processData
:
false
,
type
:
'POST'
,
success
:
function
(
res
)
{
$
(
"#showPicSelect"
+
showIndex
).
attr
(
'src'
,
'https://img.zhengzai.tv/'
+
res
.
data
.
ossPath
)
data
[
showIndex
].
prizeImgInit
=
'https://img.zhengzai.tv/'
+
res
.
data
.
ossPath
;
$
(
"#selectCeshi"
).
val
(
""
);
// $summernote.summernote('insertImage', 'https://img.zhengzai.tv/' + data.data.ossPath)
}
});
})
$
(
"#fileinput"
).
fileinput
({
'theme'
:
'explorer-fas'
,
'uploadUrl'
:
platformUrl
+
"/platform/basicServices/alOss/upload"
,
"uploadExtraData"
:
{
"pathName"
:
"banner"
,
"buckType"
:
1
},
autoReplace
:
true
,
showCaption
:
false
,
showPreview
:
false
,
showRemove
:
false
,
showUpload
:
false
,
showCancel
:
false
,
showClose
:
false
,
autoReplace
:
true
,
dropZoneTitle
:
"请上传文件"
,
maxFileCount
:
1
}).
on
(
"filebatchselected"
,
function
(
event
,
files
)
{
//默认上传
$
(
this
).
fileinput
(
"upload"
);
})
.
on
(
"fileuploaded"
,
function
(
event
,
data
)
{
//上传回调事件
showPicture
=
'https://img.zhengzai.tv/'
+
data
.
response
.
data
.
ossPath
;
$
(
"#viewImg"
).
attr
(
'src'
,
showPicture
)
})
function
create
()
{
if
(
!
$
(
"#ActivityName"
).
val
()
||
!
$
(
"#ActivityType"
).
val
()
||
!
showPicture
||
!
$
(
"#integral"
).
val
()
||
!
$
(
"#activityRule"
).
val
()
||
!
$
(
"#viewImg"
).
attr
(
'src'
))
{
return
layer
.
msg
(
'请将必填信息填写完整!'
)
}
if
(
timeType
==
2
)
{
if
(
!
$
(
"#startTime"
).
val
()
||
!
$
(
"#endTime"
).
val
())
{
return
layer
.
msg
(
'请选择时间!'
)
}
}
else
{
$
(
"#startTime"
).
val
(
""
)
$
(
"#endTime"
).
val
(
""
)
}
if
(
activitySize
)
{
layer
.
msg
(
"活动名称限制在20个字符以内!"
)
return
}
let
flag
=
false
;
data
=
data
.
map
((
item
,
index
)
=>
{
if
(
!
$
(
"#prizeTitle"
+
index
).
val
()
||!
$
(
"#showPic"
+
index
).
attr
(
'src'
)
||!
$
(
"#showPicSelect"
+
index
).
attr
(
'src'
)
||!
$
(
"#winnersNum"
+
index
).
val
()
||!
$
(
"#prizeType"
+
index
).
val
()
||!
$
(
"#winningProbability"
+
index
).
val
()
||!
$
(
"#prizeNum"
+
index
).
val
())
{
flag
=
true
}
else
{
item
.
prizeTitle
=
$
(
"#prizeTitle"
+
index
).
val
();
item
.
prizeImgInit
=
$
(
"#showPic"
+
index
).
attr
(
'src'
);
item
.
prizeImgSelect
=
$
(
"#showPicSelect"
+
index
).
attr
(
'src'
);
item
.
winnersNum
=
$
(
"#winnersNum"
+
index
).
val
();
item
.
prizeType
=
$
(
"#prizeType"
+
index
).
val
();
item
.
winningProbability
=
$
(
"#winningProbability"
+
index
).
val
();
item
.
prizeNum
=
$
(
"#prizeNum"
+
index
).
val
();
}
return
{...
item
};
})
if
(
flag
)
{
return
layer
.
msg
(
'请将表格内容填写完整!'
)
}
let
datas
=
{
activityImg
:
showPicture
,
activityNum
:
$
(
"#integral"
).
val
(),
activityRules
:
$
(
"#activityRule"
).
val
(),
activityTitle
:
$
(
"#ActivityName"
).
val
(),
activityType
:
1
,
expressFeeType
:
courierType
,
integralActivityId
:
itemId
||
''
,
endTime
:
$
.
common
.
dateFormat
(
$
(
"#endTime"
).
val
(),
'yyyy-MM-dd HH:mm:ss'
)
,
//
isOnline
:
online
,
prizeList
:
data
,
startTime
:
$
.
common
.
dateFormat
(
$
(
"#startTime"
).
val
(),
'yyyy-MM-dd HH:mm:ss'
),
timeType
:
timeType
}
let
url
=
'/sweet/integralActivity/create'
;
let
type
=
'post'
;
if
(
itemId
)
{
url
=
'/sweet/integralActivity/update'
type
=
'put'
}
$
.
ajax
({
type
,
url
,
contentType
:
"application/json;charset=UTF-8"
,
data
:
JSON
.
stringify
(
datas
),
success
:
function
(
res
)
{
layer
.
msg
(
''
+
res
);
if
(
res
.
code
!=
undefined
&&
res
.
code
!=
web_status
.
SUCCESS
)
{
$
.
modal
.
alertWarning
(
res
.
msg
);
return
[];
}
else
if
(
res
.
code
==
web_status
.
SUCCESS
)
{
$
.
operate
.
successTabCallback
(
res
);
closeItem
();
}
}
})
}
</script>
</body>
</html>
</html>
\ No newline at end of file
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/sweet/integralActivity/list.html
View file @
b244d600
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
var
updateFlag
=
[[
$
{@
permission
.
hasPermi
(
'sweet:integralActivity:create'
)}]];
var
updateFlag
=
[[
$
{@
permission
.
hasPermi
(
'sweet:integralActivity:create'
)}]];
var
isOnlineFlag
=
[[
$
{@
permission
.
hasPermi
(
'sweet:integralActivity:isOnline'
)}]];
var
isOnlineFlag
=
[[
$
{@
permission
.
hasPermi
(
'sweet:integralActivity:isOnline'
)}]];
var
drawListFlag
=
[[
$
{@
permission
.
hasPermi
(
'sweet:integralActivityDraw:list'
)}]];
var
drawListFlag
=
[[
$
{@
permission
.
hasPermi
(
'sweet:integralActivityDraw:list'
)}]];
var
exportExcelFlag
=
[[
$
{@
permission
.
hasPermi
(
'sweet:integralActivityDraw:export'
)}]];
var
exportExcelFlag
=
[[
$
{@
permission
.
hasPermi
(
'sweet:integralActivityDraw:export
Excel
'
)}]];
var
prefix
=
ctx
+
"sweet/integralActivity"
;
var
prefix
=
ctx
+
"sweet/integralActivity"
;
...
@@ -85,20 +85,31 @@
...
@@ -85,20 +85,31 @@
}
}
},
},
{
{
field
:
'prizeNum'
,
field
:
''
,
title
:
'奖品数量'
title
:
'实物数量'
,
formatter
:
function
(
value
,
row
)
{
var
sureTotalPrizeNum
=
row
.
sureTotalPrizeNum
;
var
sureOutPrizeNum
=
row
.
sureOutPrizeNum
;
return
'实物总库存:'
+
sureTotalPrizeNum
+
'<br>'
+
'实物已发放数量:'
+
sureOutPrizeNum
;
}
},
},
{
{
field
:
'drawNum'
,
field
:
''
,
title
:
'已发出'
title
:
'非实物数量'
,
formatter
:
function
(
value
,
row
)
{
var
otherTotalPrizeNum
=
row
.
otherTotalPrizeNum
;
var
otherOutPrizeNum
=
row
.
otherOutPrizeNum
;
return
'非实物总库存:'
+
otherTotalPrizeNum
+
'<br>'
+
'非实物已发放数量:'
+
otherOutPrizeNum
;
}
},
},
{
{
field
:
''
,
field
:
''
,
title
:
'
奖品剩余
'
,
title
:
'
抽奖次数
'
,
formatter
:
function
(
value
,
row
)
{
formatter
:
function
(
value
,
row
)
{
var
prizeNum
=
row
.
prizeNum
;
var
estimatedNum
=
row
.
estimatedNum
;
var
drawNum
=
row
.
drawNum
;
var
totalDrawNum
=
row
.
totalDrawNum
;
return
prizeNum
-
drawNum
;
var
notBlackDrawNum
=
row
.
notBlackDrawNum
;
return
'预计参与人数:'
+
estimatedNum
+
'<br>'
+
'已抽奖次数:'
+
totalDrawNum
+
'<br>'
+
'去除黑名单已抽奖次数:'
+
notBlackDrawNum
;
}
}
},
},
{
{
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/sweet/integralActivityDraw/list.html
View file @
b244d600
...
@@ -38,15 +38,6 @@
...
@@ -38,15 +38,6 @@
<option
value=
""
>
全部
</option>
<option
value=
""
>
全部
</option>
<option
value=
"1"
>
未发放
</option>
<option
value=
"1"
>
未发放
</option>
<option
value=
"2"
>
已发放
</option>
<option
value=
"2"
>
已发放
</option>
<option
value=
"3"
>
无需发放
</option>
</select>
</li>
<li>
<label>
是否中奖:
</label>
<select
name=
"isWin"
>
<option
value=
""
>
全部
</option>
<option
value=
"1"
>
未中奖
</option>
<option
value=
"2"
>
已中奖
</option>
</select>
</select>
</li>
</li>
<li>
<li>
...
@@ -129,9 +120,6 @@
...
@@ -129,9 +120,6 @@
case
2
:
case
2
:
receivingStatus
=
"已发放"
;
receivingStatus
=
"已发放"
;
break
;
break
;
case
3
:
receivingStatus
=
"无需发放"
;
break
;
}
}
return
receivingStatus
;
return
receivingStatus
;
}
}
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/candy/service/ICandyCouponAdminService.java
View file @
b244d600
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
candy
.
service
;
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
candy
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.liquidnet.service.candy.dto.admin.CandyCouponFilterDto
;
import
com.liquidnet.service.candy.dto.admin.CandyCouponListParam
;
import
com.liquidnet.service.candy.entity.CandyCoupon
;
import
com.liquidnet.service.candy.entity.CandyCoupon
;
import
java.util.List
;
public
interface
ICandyCouponAdminService
extends
IService
<
CandyCoupon
>
{
public
interface
ICandyCouponAdminService
extends
IService
<
CandyCoupon
>
{
List
<
CandyCouponFilterDto
>
listForCouponFilterDto
(
CandyCouponListParam
listParam
);
}
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/candy/service/impl/CandyCouponAdminServiceImpl.java
View file @
b244d600
...
@@ -2,11 +2,22 @@ package com.liquidnet.client.admin.zhengzai.candy.service.impl;
...
@@ -2,11 +2,22 @@ package com.liquidnet.client.admin.zhengzai.candy.service.impl;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.client.admin.zhengzai.candy.service.ICandyCouponAdminService
;
import
com.liquidnet.client.admin.zhengzai.candy.service.ICandyCouponAdminService
;
import
com.liquidnet.service.candy.dto.admin.CandyCouponFilterDto
;
import
com.liquidnet.service.candy.dto.admin.CandyCouponListParam
;
import
com.liquidnet.service.candy.entity.CandyCoupon
;
import
com.liquidnet.service.candy.entity.CandyCoupon
;
import
com.liquidnet.service.candy.mapper.CandyCouponMapper
;
import
com.liquidnet.service.candy.mapper.CandyCouponMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
@Service
public
class
CandyCouponAdminServiceImpl
extends
ServiceImpl
<
CandyCouponMapper
,
CandyCoupon
>
implements
ICandyCouponAdminService
{
public
class
CandyCouponAdminServiceImpl
extends
ServiceImpl
<
CandyCouponMapper
,
CandyCoupon
>
implements
ICandyCouponAdminService
{
@Autowired
private
CandyCouponMapper
candyCouponMapper
;
@Override
public
List
<
CandyCouponFilterDto
>
listForCouponFilterDto
(
CandyCouponListParam
listParam
)
{
return
candyCouponMapper
.
selectMultiForCouponFilterDto
(
listParam
);
}
}
}
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 @
b244d600
...
@@ -17,6 +17,9 @@ import com.liquidnet.commons.lang.util.IDGenerator;
...
@@ -17,6 +17,9 @@ import com.liquidnet.commons.lang.util.IDGenerator;
import
com.liquidnet.service.adam.constant.AdamRedisConst
;
import
com.liquidnet.service.adam.constant.AdamRedisConst
;
import
com.liquidnet.service.adam.dto.vo.AdamMemberRightsCouponRuleVo
;
import
com.liquidnet.service.adam.dto.vo.AdamMemberRightsCouponRuleVo
;
import
com.liquidnet.service.adam.dto.vo.AdamMemberRightsCouponVo
;
import
com.liquidnet.service.adam.dto.vo.AdamMemberRightsCouponVo
;
import
com.liquidnet.service.candy.constant.CandyRedisConst
;
import
com.liquidnet.service.candy.dto.CandyCouponInfoDto
;
import
com.liquidnet.service.candy.dto.CandyCouponRuleDto
;
import
com.liquidnet.service.candy.dto.admin.*
;
import
com.liquidnet.service.candy.dto.admin.*
;
import
com.liquidnet.service.candy.entity.CandyCoupon
;
import
com.liquidnet.service.candy.entity.CandyCoupon
;
import
com.liquidnet.service.candy.entity.CandyCouponRule
;
import
com.liquidnet.service.candy.entity.CandyCouponRule
;
...
@@ -25,6 +28,7 @@ import com.liquidnet.service.candy.mapper.CandyCouponMapper;
...
@@ -25,6 +28,7 @@ import com.liquidnet.service.candy.mapper.CandyCouponMapper;
import
com.liquidnet.service.candy.mapper.CandyMgtCouponMapper
;
import
com.liquidnet.service.candy.mapper.CandyMgtCouponMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -74,7 +78,7 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa
...
@@ -74,7 +78,7 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa
// initCoupon.setExclusive(1);
// initCoupon.setExclusive(1);
// initCoupon.setBusiType(parameter.getBusiType());
// initCoupon.setBusiType(parameter.getBusiType());
// initCoupon.setCouType(parameter.getCouType());
// initCoupon.setCouType(parameter.getCouType());
// initCoupon.setBindType(1);// 领取方式[0-用户输入兑换|1-发放至用户|2-积分
兑换
|3-发放需领取|4-会员专属]
// initCoupon.setBindType(1);// 领取方式[0-用户输入兑换|1-发放至用户|2-积分
商品
|3-发放需领取|4-会员专属]
// //initCoupon.setDiscount();
// //initCoupon.setDiscount();
// initCoupon.setValFace(parameter.getValFace());
// initCoupon.setValFace(parameter.getValFace());
// initCoupon.setValOver(parameter.getValOver());
// initCoupon.setValOver(parameter.getValOver());
...
@@ -383,8 +387,10 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa
...
@@ -383,8 +387,10 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa
initCoupon
.
setRedeemStart
(
eventAt
);
initCoupon
.
setRedeemStart
(
eventAt
);
initCoupon
.
setRedeemStop
(
initCoupon
.
getRedeemStart
().
plusDays
(
redeemValidity
).
withHour
(
23
).
withMinute
(
59
).
withSecond
(
59
));
initCoupon
.
setRedeemStop
(
initCoupon
.
getRedeemStart
().
plusDays
(
redeemValidity
).
withHour
(
23
).
withMinute
(
59
).
withSecond
(
59
));
}
}
initCoupon
.
setEffectAt
(
eventAt
);
if
(
parameter
.
getBindType
()
!=
2
&&
parameter
.
getBindType
()
!=
4
)
{
// 券领取方式[2-积分商品|4-会员专属],实际发放至用户时计算有效期
initCoupon
.
setExpireAt
(
initCoupon
.
getEffectAt
().
plusDays
(
parameter
.
getValidity
()).
withHour
(
23
).
withMinute
(
59
).
withSecond
(
59
));
initCoupon
.
setEffectAt
(
eventAt
);
initCoupon
.
setExpireAt
(
initCoupon
.
getEffectAt
().
plusDays
(
parameter
.
getValidity
()).
withHour
(
23
).
withMinute
(
59
).
withSecond
(
59
));
}
initCoupon
.
setOperator
(
ShiroUtils
.
getLoginName
());
initCoupon
.
setOperator
(
ShiroUtils
.
getLoginName
());
initCoupon
.
setCreatedAt
(
nowTime
);
initCoupon
.
setCreatedAt
(
nowTime
);
...
@@ -409,12 +415,13 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa
...
@@ -409,12 +415,13 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa
initMgtCoupon
.
setMcouponId
(
IDGenerator
.
nextMilliId
());
initMgtCoupon
.
setMcouponId
(
IDGenerator
.
nextMilliId
());
initMgtCoupon
.
setCouponId
(
initCoupon
.
getCouponId
());
initMgtCoupon
.
setCouponId
(
initCoupon
.
getCouponId
());
// initMgtCoupon.setState(0);
// initMgtCoupon.setState(0);
// initMgtCoupon.setState(initCoupon.getBindType() == 2 ? 1 : 0);// TODO: 2021/11/9 PM上线前临时加的券领取类型(2-积分
兑换
),这里根据发放类型设置该记录不执行发放
// initMgtCoupon.setState(initCoupon.getBindType() == 2 ? 1 : 0);// TODO: 2021/11/9 PM上线前临时加的券领取类型(2-积分
商品
),这里根据发放类型设置该记录不执行发放
initMgtCoupon
.
setState
(
Arrays
.
asList
(
2
,
4
).
contains
(
initCoupon
.
getBindType
())
?
1
:
0
);
initMgtCoupon
.
setState
(
Arrays
.
asList
(
2
,
4
).
contains
(
initCoupon
.
getBindType
())
?
1
:
0
);
initMgtCoupon
.
setEventAmt
(
parameter
.
getEventAmt
());
initMgtCoupon
.
setEventAmt
(
parameter
.
getEventAmt
());
initMgtCoupon
.
setEventType
(
parameter
.
getEventType
());
initMgtCoupon
.
setEventType
(
parameter
.
getEventType
());
initMgtCoupon
.
setEventLimit
(
parameter
.
getEventLimit
());
initMgtCoupon
.
setEventLimit
(
parameter
.
getEventLimit
());
initMgtCoupon
.
setEventAt
(
eventAt
);
initMgtCoupon
.
setEventAt
(
eventAt
);
initMgtCoupon
.
setEventDriven
(
1
);
initMgtCoupon
.
setOperator
(
initCoupon
.
getOperator
());
initMgtCoupon
.
setOperator
(
initCoupon
.
getOperator
());
initMgtCoupon
.
setCreatedAt
(
nowTime
);
initMgtCoupon
.
setCreatedAt
(
nowTime
);
...
@@ -442,6 +449,18 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa
...
@@ -442,6 +449,18 @@ public class CandyMgtCouponAdminServiceImpl extends ServiceImpl<CandyMgtCouponMa
throw
new
LiquidnetServiceException
();
throw
new
LiquidnetServiceException
();
}
}
List
<
CandyCouponRuleDto
>
couponRuleDtoList
=
new
ArrayList
<>();
initCouponRuleList
.
forEach
(
r
->
{
couponRuleDtoList
.
add
(
CandyCouponRuleDto
.
getNew
().
copy
(
r
));
});
CandyCouponInfoDto
couponInfoDto
=
new
CandyCouponInfoDto
();
BeanUtils
.
copyProperties
(
initCoupon
,
couponInfoDto
);
couponInfoDto
.
setUseRules
(
couponRuleDtoList
);
String
couponInfoDtoKey
=
CandyRedisConst
.
BASIC_COUPON_INFO
.
concat
(
couponInfoDto
.
getCouponId
());
redisDataSourceUtil
.
getRedisCandyUtil
().
set
(
couponInfoDtoKey
,
couponInfoDto
);
// switch (initCoupon.getExclusive()) {
// switch (initCoupon.getExclusive()) {
// case 0:
// case 0:
// break;
// break;
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/sweet/dto/SweetActivityDrawExcelListDao.java
View file @
b244d600
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
sweet
.
dto
;
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
sweet
.
dto
;
import
com.liquidnet.client.admin.common.annotation.Excel
;
import
com.liquidnet.client.admin.common.annotation.Excel
;
import
com.liquidnet.client.admin.common.utils.DictUtils
;
import
com.liquidnet.service.sweet.dto.SweetActivityDrawListDao
;
import
com.liquidnet.service.sweet.dto.SweetActivityDrawListDao
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -54,31 +55,7 @@ public class SweetActivityDrawExcelListDao implements Serializable, Cloneable {
...
@@ -54,31 +55,7 @@ public class SweetActivityDrawExcelListDao implements Serializable, Cloneable {
public
SweetActivityDrawExcelListDao
copy
(
SweetActivityDrawListDao
source
)
{
public
SweetActivityDrawExcelListDao
copy
(
SweetActivityDrawListDao
source
)
{
if
(
null
==
source
)
return
this
;
if
(
null
==
source
)
return
this
;
this
.
setPrizeTitle
(
source
.
getPrizeTitle
());
this
.
setPrizeTitle
(
source
.
getPrizeTitle
());
String
prizeName
=
""
;
this
.
setPrizeName
(
DictUtils
.
getDictLabel
(
"zhengzai_sweet_draw_prize_type"
,
String
.
valueOf
(
source
.
getPrizeType
())));
switch
(
source
.
getPrizeType
())
{
case
1
:
prizeName
=
"谢谢惠顾"
;
break
;
case
2
:
prizeName
=
"积分"
;
break
;
case
3
:
prizeName
=
"代金券"
;
break
;
case
4
:
prizeName
=
"满减券"
;
break
;
case
5
:
prizeName
=
"优先购买券"
;
break
;
case
6
:
prizeName
=
"实物"
;
break
;
default
:
prizeName
=
"-"
;
break
;
}
this
.
setPrizeName
(
prizeName
);
this
.
setPrizeTypeNum
(
source
.
getPrizeTypeNum
());
this
.
setPrizeTypeNum
(
source
.
getPrizeTypeNum
());
this
.
setNickname
(
source
.
getNickname
());
this
.
setNickname
(
source
.
getNickname
());
this
.
setReceivingName
(
source
.
getReceivingName
());
this
.
setReceivingName
(
source
.
getReceivingName
());
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/sweet/service/ISweetIntegralActivityPrizeRelationService.java
0 → 100644
View file @
b244d600
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
sweet
.
service
;
import
com.liquidnet.service.sweet.dto.param.admin.SweetIntegralActivityPrizeRelationFormParam
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityPrizeRelation
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
/**
* <p>
* 积分活动奖品里关联多奖品表 服务类
* </p>
*
* @author jiangxiulong
* @since 2021-12-02
*/
public
interface
ISweetIntegralActivityPrizeRelationService
extends
IService
<
SweetIntegralActivityPrizeRelation
>
{
Integer
createForm
(
SweetIntegralActivityPrizeRelationFormParam
param
);
Integer
delete
(
String
prizeRelationId
,
String
integralActivityId
);
List
<
SweetIntegralActivityPrizeRelation
>
list
(
String
prizeId
);
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/sweet/service/impl/SweetIntegralActivityDrawServiceImpl.java
View file @
b244d600
...
@@ -103,27 +103,14 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
...
@@ -103,27 +103,14 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
);
);
// 更新缓存
// 更新缓存
List
<
SweetIntegralActivityDraw
>
sweetIntegralActivityDrawInList
=
sweetIntegralActivityDrawMapper
.
selectList
(
sweetRedisAdminUtils
.
delIntegralActivityDrawList
(
sweetIntegralActivityDrawNew
.
getIntegralActivityId
(),
sweetIntegralActivityDrawNew
.
getUserId
());
Wrappers
.
lambdaQuery
(
SweetIntegralActivityDraw
.
class
)
.
eq
(
SweetIntegralActivityDraw:
:
getIntegralActivityId
,
sweetIntegralActivityDrawNew
.
getIntegralActivityId
())
.
eq
(
SweetIntegralActivityDraw:
:
getUserId
,
sweetIntegralActivityDrawNew
.
getUserId
())
.
gt
(
SweetIntegralActivityDraw:
:
getPrizeType
,
1
)
.
orderByDesc
(
SweetIntegralActivityDraw:
:
getMid
)
.
last
(
" limit 20 "
)
);
LinkedList
<
IntegralActivityDrawVo
>
activityDrawArrayList
=
SweetNewObjectUtil
.
getSweetIntegralActivityDrawVoLinkedList
();
for
(
SweetIntegralActivityDraw
draw
:
sweetIntegralActivityDrawInList
)
{
IntegralActivityDrawVo
integralActivityDrawVo
=
IntegralActivityDrawVo
.
getNew
().
copy
(
draw
);
activityDrawArrayList
.
add
(
integralActivityDrawVo
);
}
sweetRedisAdminUtils
.
setIntegralActivityDraw
(
activityDrawArrayList
,
sweetIntegralActivityDrawNew
.
getIntegralActivityId
(),
sweetIntegralActivityDrawNew
.
getUserId
());
sweetRedisAdminUtils
.
setIntegralActivityDrawInfo
(
drawId
);
sweetRedisAdminUtils
.
setIntegralActivityDrawInfo
(
drawId
);
mongoTemplate
.
getCollection
(
IntegralActivityDrawVo
.
class
.
getSimpleName
()).
updateOne
(
mongoTemplate
.
getCollection
(
IntegralActivityDrawVo
.
class
.
getSimpleName
()).
updateOne
(
Query
.
query
(
Criteria
.
where
(
"drawId"
).
is
(
drawId
)).
getQueryObject
(),
Query
.
query
(
Criteria
.
where
(
"drawId"
).
is
(
drawId
)).
getQueryObject
(),
new
Document
(
"$set"
,
new
Document
(
"receivingStatus"
,
2
)
new
Document
(
"$set"
,
new
Document
(
"receivingStatus"
,
2
)
.
append
(
"updatedAt"
,
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
LocalDateTime
.
now
()
)))
.
append
(
"updatedAt"
,
LocalDateTime
.
now
(
)))
);
);
return
update
;
return
update
;
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/sweet/service/impl/SweetIntegralActivityPrizeRelationServiceImpl.java
0 → 100644
View file @
b244d600
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
sweet
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.liquidnet.client.admin.zhengzai.sweet.service.ISweetIntegralActivityPrizeRelationService
;
import
com.liquidnet.client.admin.zhengzai.sweet.utils.SweetObjectAdminUtil
;
import
com.liquidnet.client.admin.zhengzai.sweet.utils.SweetRedisAdminUtils
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.sweet.constant.StatusConst
;
import
com.liquidnet.service.sweet.dto.param.admin.SweetIntegralActivityPrizeRelationFormParam
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityPrizeRelationVo
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityPrizeVo
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityVo
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivity
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityPrize
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityPrizeRelation
;
import
com.liquidnet.service.sweet.mapper.SweetIntegralActivityMapper
;
import
com.liquidnet.service.sweet.mapper.SweetIntegralActivityPrizeMapper
;
import
com.liquidnet.service.sweet.mapper.SweetIntegralActivityPrizeRelationMapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
/**
* <p>
* 积分活动奖品里关联多奖品表 服务实现类
* </p>
*
* @author jiangxiulong
* @since 2021-12-02
*/
@Service
public
class
SweetIntegralActivityPrizeRelationServiceImpl
extends
ServiceImpl
<
SweetIntegralActivityPrizeRelationMapper
,
SweetIntegralActivityPrizeRelation
>
implements
ISweetIntegralActivityPrizeRelationService
{
@Autowired
private
SweetIntegralActivityMapper
sweetIntegralActivityMapper
;
@Autowired
private
SweetIntegralActivityPrizeMapper
sweetIntegralActivityPrizeMapper
;
@Autowired
private
SweetIntegralActivityPrizeRelationMapper
relationMapper
;
@Autowired
private
SweetRedisAdminUtils
sweetRedisAdminUtils
;
@Override
public
Integer
createForm
(
SweetIntegralActivityPrizeRelationFormParam
param
)
{
try
{
SweetIntegralActivityPrizeRelation
prizeRelation
=
SweetIntegralActivityPrizeRelationFormParam
.
getNew
().
copy
(
param
);
String
relationId
=
IDGenerator
.
nextSnowId
();
prizeRelation
.
setPrizeRelationId
(
relationId
);
int
insert
=
relationMapper
.
insert
(
prizeRelation
);
// 活动redis处理
this
.
integralActivityList
(
param
.
getIntegralActivityId
());
return
insert
;
}
catch
(
Exception
e
)
{
log
.
error
(
"添加失败 [e:{}]"
,
e
);
return
0
;
}
}
@Override
public
Integer
delete
(
String
prizeRelationId
,
String
integralActivityId
)
{
try
{
int
delete
=
relationMapper
.
delete
(
Wrappers
.
lambdaUpdate
(
SweetIntegralActivityPrizeRelation
.
class
).
eq
(
SweetIntegralActivityPrizeRelation:
:
getPrizeRelationId
,
prizeRelationId
)
);
// 活动redis处理
this
.
integralActivityList
(
integralActivityId
);
return
delete
;
}
catch
(
Exception
e
)
{
log
.
error
(
"删除失败 [e:{}]"
,
e
);
return
0
;
}
}
@Override
public
List
<
SweetIntegralActivityPrizeRelation
>
list
(
String
prizeId
)
{
List
<
SweetIntegralActivityPrizeRelation
>
prizeRelations
=
relationMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetIntegralActivityPrizeRelation
.
class
).
eq
(
SweetIntegralActivityPrizeRelation:
:
getPrizeId
,
prizeId
)
);
return
prizeRelations
;
}
private
void
integralActivityList
(
String
integralActivityId
)
{
// 活动列表
LambdaQueryWrapper
<
SweetIntegralActivity
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
SweetIntegralActivity
.
class
).
eq
(
SweetIntegralActivity:
:
getIsOnline
,
2
);
LocalDateTime
now
=
LocalDateTime
.
now
();
queryWrapper
.
eq
(
SweetIntegralActivity:
:
getTimeType
,
1
).
or
().
eq
(
SweetIntegralActivity:
:
getIsOnline
,
2
).
eq
(
SweetIntegralActivity:
:
getTimeType
,
2
).
gt
(
SweetIntegralActivity:
:
getEndTime
,
now
).
lt
(
SweetIntegralActivity:
:
getStartTime
,
now
);
List
<
SweetIntegralActivity
>
sweetIntegralActivities
=
sweetIntegralActivityMapper
.
selectList
(
queryWrapper
);
List
<
IntegralActivityVo
>
voList
=
SweetObjectAdminUtil
.
getSweetIntegralActivityVoList
();
sweetIntegralActivities
.
forEach
(
r
->
{
IntegralActivityVo
copy
=
IntegralActivityVo
.
getNew
().
copy
(
r
);
voList
.
add
(
copy
);
});
sweetRedisAdminUtils
.
setIntegralActivityList
(
voList
);
// 活动详情
SweetIntegralActivity
sweetIntegralActivity
=
sweetIntegralActivityMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
SweetIntegralActivity
.
class
).
eq
(
SweetIntegralActivity:
:
getIntegralActivityId
,
integralActivityId
)
);
IntegralActivityVo
integralActivityVo
=
IntegralActivityVo
.
getNew
().
copy
(
sweetIntegralActivity
);
// 详情奖品 全部
List
<
SweetIntegralActivityPrize
>
activityPrizes
=
sweetIntegralActivityPrizeMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetIntegralActivityPrize
.
class
).
eq
(
SweetIntegralActivityPrize:
:
getIntegralActivityId
,
integralActivityId
)
);
List
<
IntegralActivityPrizeVo
>
prizeList
=
SweetObjectAdminUtil
.
getSweetIntegralActivityPrizeVoList
();
activityPrizes
.
forEach
(
r
->
{
IntegralActivityPrizeVo
copy
=
IntegralActivityPrizeVo
.
getNew
().
copy
(
r
);
// 奖品券列表
List
<
SweetIntegralActivityPrizeRelation
>
prizeRelations
=
relationMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetIntegralActivityPrizeRelation
.
class
).
eq
(
SweetIntegralActivityPrizeRelation:
:
getPrizeId
,
copy
.
getPrizeId
())
);
ArrayList
<
IntegralActivityPrizeRelationVo
>
prizeRelationVoList
=
SweetObjectAdminUtil
.
getSweetIntegralActivityPrizeRelationVoList
();
if
(!
CollectionUtils
.
isEmpty
(
prizeRelations
))
{
prizeRelations
.
forEach
(
rr
->
{
IntegralActivityPrizeRelationVo
copyR
=
IntegralActivityPrizeRelationVo
.
getNew
().
copy
(
rr
);
prizeRelationVoList
.
add
(
copyR
);
});
}
copy
.
setPrizeRelationList
(
prizeRelationVoList
);
prizeList
.
add
(
copy
);
});
integralActivityVo
.
setPrizeList
(
prizeList
);
// 详情奖品 积分和券
List
<
SweetIntegralActivityPrize
>
activityPrizes1
=
sweetIntegralActivityPrizeMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetIntegralActivityPrize
.
class
).
eq
(
SweetIntegralActivityPrize:
:
getIntegralActivityId
,
integralActivityId
)
.
in
(
SweetIntegralActivityPrize:
:
getPrizeType
,
Arrays
.
asList
(
StatusConst
.
PRIZE_TYPE1
,
StatusConst
.
PRIZE_TYPE2
))
);
List
<
IntegralActivityPrizeVo
>
prizeList1
=
SweetObjectAdminUtil
.
getSweetIntegralActivityPrizeVoList
();
activityPrizes1
.
forEach
(
r
->
{
IntegralActivityPrizeVo
copy
=
IntegralActivityPrizeVo
.
getNew
().
copy
(
r
);
// 奖品券列表
List
<
SweetIntegralActivityPrizeRelation
>
prizeRelations
=
relationMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetIntegralActivityPrizeRelation
.
class
).
eq
(
SweetIntegralActivityPrizeRelation:
:
getPrizeId
,
copy
.
getPrizeId
())
);
ArrayList
<
IntegralActivityPrizeRelationVo
>
prizeRelationVoList
=
SweetObjectAdminUtil
.
getSweetIntegralActivityPrizeRelationVoList
();
if
(!
CollectionUtils
.
isEmpty
(
prizeRelations
))
{
prizeRelations
.
forEach
(
rr
->
{
IntegralActivityPrizeRelationVo
copyR
=
IntegralActivityPrizeRelationVo
.
getNew
().
copy
(
rr
);
prizeRelationVoList
.
add
(
copyR
);
});
}
copy
.
setPrizeRelationList
(
prizeRelationVoList
);
prizeList1
.
add
(
copy
);
});
integralActivityVo
.
setPrizeList1
(
prizeList1
);
// 详情奖品 实物等
List
<
SweetIntegralActivityPrize
>
activityPrizes2
=
sweetIntegralActivityPrizeMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetIntegralActivityPrize
.
class
).
eq
(
SweetIntegralActivityPrize:
:
getIntegralActivityId
,
integralActivityId
)
.
in
(
SweetIntegralActivityPrize:
:
getPrizeType
,
Arrays
.
asList
(
StatusConst
.
PRIZE_TYPE3
,
StatusConst
.
PRIZE_TYPE4
,
StatusConst
.
PRIZE_TYPE5
))
);
List
<
IntegralActivityPrizeVo
>
prizeList2
=
SweetObjectAdminUtil
.
getSweetIntegralActivityPrizeVoList
();
int
totalPrizeNum
=
0
;
for
(
SweetIntegralActivityPrize
prize
:
activityPrizes2
)
{
IntegralActivityPrizeVo
copy
=
IntegralActivityPrizeVo
.
getNew
().
copy
(
prize
);
prizeList2
.
add
(
copy
);
int
prizeNum
=
sweetRedisAdminUtils
.
getIntegralActivityPrizeNum
(
integralActivityId
,
prize
.
getPrizeId
());
totalPrizeNum
+=
prizeNum
;
}
sweetRedisAdminUtils
.
setIntegralActivityTotalPrizeNum
(
integralActivityId
,
totalPrizeNum
);
sweetRedisAdminUtils
.
setIntegralActivityInfo
(
integralActivityVo
);
}
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/sweet/service/impl/SweetIntegralActivityServiceImpl.java
View file @
b244d600
...
@@ -8,26 +8,33 @@ import com.liquidnet.client.admin.zhengzai.sweet.service.ISweetIntegralActivityS
...
@@ -8,26 +8,33 @@ import com.liquidnet.client.admin.zhengzai.sweet.service.ISweetIntegralActivityS
import
com.liquidnet.client.admin.zhengzai.sweet.utils.SweetObjectAdminUtil
;
import
com.liquidnet.client.admin.zhengzai.sweet.utils.SweetObjectAdminUtil
;
import
com.liquidnet.client.admin.zhengzai.sweet.utils.SweetRedisAdminUtils
;
import
com.liquidnet.client.admin.zhengzai.sweet.utils.SweetRedisAdminUtils
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.sweet.constant.StatusConst
;
import
com.liquidnet.service.sweet.dto.SweetIntegralActivityDto
;
import
com.liquidnet.service.sweet.dto.SweetIntegralActivityDto
;
import
com.liquidnet.service.sweet.dto.param.admin.SweetIntegralActivityFromParam
;
import
com.liquidnet.service.sweet.dto.param.admin.SweetIntegralActivityFromParam
;
import
com.liquidnet.service.sweet.dto.param.admin.SweetIntegralActivityListSearchParam
;
import
com.liquidnet.service.sweet.dto.param.admin.SweetIntegralActivityListSearchParam
;
import
com.liquidnet.service.sweet.dto.param.admin.SweetIntegralActivityPrizeFormParam
;
import
com.liquidnet.service.sweet.dto.param.admin.SweetIntegralActivityPrizeFormParam
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityPrizeRelationVo
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityPrizeVo
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityVo
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityVo
;
import
com.liquidnet.service.sweet.dto.vo.admin.SweetIntegralActivityPrizeVo
;
import
com.liquidnet.service.sweet.dto.vo.admin.SweetIntegralActivityPrizeVo
;
import
com.liquidnet.service.sweet.dto.vo.admin.SweetIntegralActivityVo
;
import
com.liquidnet.service.sweet.dto.vo.admin.SweetIntegralActivityVo
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivity
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivity
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityDraw
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityDraw
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityPrize
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityPrize
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityPrizeRelation
;
import
com.liquidnet.service.sweet.mapper.SweetIntegralActivityDrawMapper
;
import
com.liquidnet.service.sweet.mapper.SweetIntegralActivityDrawMapper
;
import
com.liquidnet.service.sweet.mapper.SweetIntegralActivityMapper
;
import
com.liquidnet.service.sweet.mapper.SweetIntegralActivityMapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.service.sweet.mapper.SweetIntegralActivityPrizeMapper
;
import
com.liquidnet.service.sweet.mapper.SweetIntegralActivityPrizeMapper
;
import
com.liquidnet.service.sweet.mapper.SweetIntegralActivityPrizeRelationMapper
;
import
com.liquidnet.service.sweet.utils.SweetNewObjectUtil
;
import
com.liquidnet.service.sweet.utils.SweetNewObjectUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -42,11 +49,13 @@ import java.util.List;
...
@@ -42,11 +49,13 @@ import java.util.List;
public
class
SweetIntegralActivityServiceImpl
extends
ServiceImpl
<
SweetIntegralActivityMapper
,
SweetIntegralActivity
>
implements
ISweetIntegralActivityService
{
public
class
SweetIntegralActivityServiceImpl
extends
ServiceImpl
<
SweetIntegralActivityMapper
,
SweetIntegralActivity
>
implements
ISweetIntegralActivityService
{
@Autowired
@Autowired
SweetIntegralActivityMapper
sweetIntegralActivityMapper
;
private
SweetIntegralActivityMapper
sweetIntegralActivityMapper
;
@Autowired
@Autowired
SweetIntegralActivityPrizeMapper
sweetIntegralActivityPrizeMapper
;
private
SweetIntegralActivityPrizeMapper
sweetIntegralActivityPrizeMapper
;
@Autowired
@Autowired
SweetIntegralActivityDrawMapper
sweetIntegralActivityDrawMapper
;
private
SweetIntegralActivityDrawMapper
sweetIntegralActivityDrawMapper
;
@Autowired
private
SweetIntegralActivityPrizeRelationMapper
relationMapper
;
@Autowired
@Autowired
private
SweetRedisAdminUtils
sweetRedisAdminUtils
;
private
SweetRedisAdminUtils
sweetRedisAdminUtils
;
...
@@ -61,20 +70,21 @@ public class SweetIntegralActivityServiceImpl extends ServiceImpl<SweetIntegralA
...
@@ -61,20 +70,21 @@ public class SweetIntegralActivityServiceImpl extends ServiceImpl<SweetIntegralA
List
<
SweetIntegralActivityPrizeFormParam
>
prizeList
=
param
.
getPrizeList
();
List
<
SweetIntegralActivityPrizeFormParam
>
prizeList
=
param
.
getPrizeList
();
if
(!
CollectionUtils
.
isEmpty
(
prizeList
))
{
if
(!
CollectionUtils
.
isEmpty
(
prizeList
))
{
for
(
SweetIntegralActivityPrizeFormParam
prize
:
prizeList
)
{
for
(
SweetIntegralActivityPrizeFormParam
prize
:
prizeList
)
{
if
(
prize
.
getPrizeType
()
==
2
)
{
prize
.
setPrizeTypeNum
(
100
);
}
else
{
prize
.
setPrizeTypeNum
(
1
);
}
SweetIntegralActivityPrize
sweetIntegralActivityPrize
=
SweetIntegralActivityPrizeFormParam
.
getNew
().
copy
(
prize
);
SweetIntegralActivityPrize
sweetIntegralActivityPrize
=
SweetIntegralActivityPrizeFormParam
.
getNew
().
copy
(
prize
);
sweetIntegralActivityPrize
.
setPrizeId
(
IDGenerator
.
nextSnowId
());
String
prizeId
=
IDGenerator
.
nextSnowId
();
sweetIntegralActivityPrize
.
setPrizeId
(
prizeId
);
sweetIntegralActivityPrize
.
setIntegralActivityId
(
integralActivityId
);
sweetIntegralActivityPrize
.
setIntegralActivityId
(
integralActivityId
);
if
(
prize
.
getIsInfinite
()
==
2
)
{
sweetIntegralActivityPrize
.
setPrizeNum
(
0
);
}
else
{
// 奖品库存
sweetRedisAdminUtils
.
incrIntegralActivityPrizeNum
(
integralActivityId
,
sweetIntegralActivityPrize
.
getPrizeId
(),
sweetIntegralActivityPrize
.
getPrizeNum
());
}
sweetIntegralActivityPrizeMapper
.
insert
(
sweetIntegralActivityPrize
);
sweetIntegralActivityPrizeMapper
.
insert
(
sweetIntegralActivityPrize
);
// 奖品库存和中奖人数redis
sweetRedisAdminUtils
.
incrIntegralActivityPrizeNum
(
integralActivityId
,
sweetIntegralActivityPrize
.
getPrizeId
(),
sweetIntegralActivityPrize
.
getPrizeNum
());
sweetRedisAdminUtils
.
incrIntegralActivityPrizeWinnersNum
(
integralActivityId
,
sweetIntegralActivityPrize
.
getPrizeId
(),
sweetIntegralActivityPrize
.
getWinnersNum
());
}
}
}
}
// 预估人数
sweetRedisAdminUtils
.
incrIntegralActivityEstimatedNum
(
integralActivityId
,
sweetIntegralActivity
.
getEstimatedNum
());
// 活动redis处理
// 活动redis处理
this
.
integralActivityList
(
integralActivityId
);
this
.
integralActivityList
(
integralActivityId
);
return
insert
;
return
insert
;
...
@@ -87,49 +97,54 @@ public class SweetIntegralActivityServiceImpl extends ServiceImpl<SweetIntegralA
...
@@ -87,49 +97,54 @@ public class SweetIntegralActivityServiceImpl extends ServiceImpl<SweetIntegralA
@Override
@Override
public
Integer
updateForm
(
SweetIntegralActivityFromParam
param
)
{
public
Integer
updateForm
(
SweetIntegralActivityFromParam
param
)
{
try
{
try
{
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
SweetIntegralActivity
sweetIntegralActivity
=
SweetIntegralActivityFromParam
.
getNew
().
copy
(
param
);
SweetIntegralActivity
sweetIntegralActivity
=
SweetIntegralActivityFromParam
.
getNew
().
copy
(
param
);
sweetIntegralActivity
.
setUpdatedAt
(
LocalDateTime
.
now
()
);
sweetIntegralActivity
.
setUpdatedAt
(
nowTime
);
String
integralActivityId
=
param
.
getIntegralActivityId
();
String
integralActivityId
=
param
.
getIntegralActivityId
();
SweetIntegralActivity
sweetIntegralActivityOld
=
sweetIntegralActivityMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
SweetIntegralActivity
.
class
).
eq
(
SweetIntegralActivity:
:
getIntegralActivityId
,
integralActivityId
)
);
int
update
=
sweetIntegralActivityMapper
.
update
(
int
update
=
sweetIntegralActivityMapper
.
update
(
sweetIntegralActivity
,
sweetIntegralActivity
,
Wrappers
.
lambdaUpdate
(
SweetIntegralActivity
.
class
).
eq
(
SweetIntegralActivity:
:
getIntegralActivityId
,
integralActivityId
)
Wrappers
.
lambdaUpdate
(
SweetIntegralActivity
.
class
).
eq
(
SweetIntegralActivity:
:
getIntegralActivityId
,
integralActivityId
)
);
);
Integer
estimatedNum
=
sweetIntegralActivityOld
.
getEstimatedNum
();
Integer
estimatedNumNew
=
sweetIntegralActivity
.
getEstimatedNum
();
int
estimatedNumDiff
=
estimatedNumNew
-
estimatedNum
;
if
(
estimatedNumDiff
>
0
)
{
//增加
sweetRedisAdminUtils
.
incrIntegralActivityEstimatedNum
(
integralActivityId
,
estimatedNumDiff
);
}
else
if
(
estimatedNumDiff
<
0
)
{
// 减少
sweetRedisAdminUtils
.
decrIntegralActivityEstimatedNum
(
integralActivityId
,
Math
.
abs
(
estimatedNumDiff
));
}
List
<
SweetIntegralActivityPrizeFormParam
>
prizeList
=
param
.
getPrizeList
();
List
<
SweetIntegralActivityPrizeFormParam
>
prizeList
=
param
.
getPrizeList
();
if
(!
CollectionUtils
.
isEmpty
(
prizeList
))
{
if
(!
CollectionUtils
.
isEmpty
(
prizeList
))
{
for
(
SweetIntegralActivityPrizeFormParam
prize
:
prizeList
)
{
for
(
SweetIntegralActivityPrizeFormParam
prize
:
prizeList
)
{
SweetIntegralActivityPrize
sweetIntegralActivityPrize
=
SweetIntegralActivityPrizeFormParam
.
getNew
().
copy
(
prize
);
SweetIntegralActivityPrize
sweetIntegralActivityPrize
=
SweetIntegralActivityPrizeFormParam
.
getNew
().
copy
(
prize
);
sweetIntegralActivityPrize
.
setUpdatedAt
(
LocalDateTime
.
now
());
sweetIntegralActivityPrize
.
setUpdatedAt
(
nowTime
);
sweetIntegralActivityPrize
.
setIntegralActivityId
(
integralActivityId
);
String
prizeId
=
prize
.
getPrizeId
();
String
prizeId
=
prize
.
getPrizeId
();
if
(
prize
.
getPrizeType
()
==
2
)
{
if
(
prize
.
getIsInfinite
()
==
2
)
{
sweetIntegralActivityPrize
.
setPrizeTypeNum
(
100
);
sweetIntegralActivityPrize
.
setPrizeNum
(
0
);
sweetRedisAdminUtils
.
delIntegralActivityPrizeNum
(
integralActivityId
,
prizeId
);
}
else
{
}
else
{
sweetIntegralActivityPrize
.
setPrizeTypeNum
(
1
);
// 处理奖品库存
SweetIntegralActivityPrize
sweetIntegralActivityPrizeOld
=
sweetIntegralActivityPrizeMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
SweetIntegralActivityPrize
.
class
).
eq
(
SweetIntegralActivityPrize:
:
getPrizeId
,
prizeId
)
);
Integer
prizeNum
=
sweetIntegralActivityPrizeOld
.
getPrizeNum
();
Integer
prizeNumNew
=
sweetIntegralActivityPrize
.
getPrizeNum
();
int
prizeNumDiff
=
prizeNumNew
-
prizeNum
;
if
(
prizeNumDiff
>
0
)
{
//增加库存
sweetRedisAdminUtils
.
incrIntegralActivityPrizeNum
(
integralActivityId
,
prizeId
,
prizeNumDiff
);
}
else
if
(
prizeNumDiff
<
0
)
{
// 减少库存
sweetRedisAdminUtils
.
decrIntegralActivityPrizeNum
(
integralActivityId
,
prizeId
,
Math
.
abs
(
prizeNumDiff
));
}
}
}
// 处理奖品库存
SweetIntegralActivityPrize
sweetIntegralActivityPrizeOld
=
sweetIntegralActivityPrizeMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
SweetIntegralActivityPrize
.
class
).
eq
(
SweetIntegralActivityPrize:
:
getPrizeId
,
prizeId
)
);
sweetIntegralActivityPrizeMapper
.
update
(
sweetIntegralActivityPrizeMapper
.
update
(
sweetIntegralActivityPrize
,
sweetIntegralActivityPrize
,
Wrappers
.
lambdaUpdate
(
SweetIntegralActivityPrize
.
class
).
eq
(
SweetIntegralActivityPrize:
:
getPrizeId
,
prizeId
)
Wrappers
.
lambdaUpdate
(
SweetIntegralActivityPrize
.
class
).
eq
(
SweetIntegralActivityPrize:
:
getPrizeId
,
prizeId
)
);
);
Integer
prizeNum
=
sweetIntegralActivityPrizeOld
.
getPrizeNum
();
Integer
winnersNum
=
sweetIntegralActivityPrizeOld
.
getWinnersNum
();
Integer
prizeNumNew
=
sweetIntegralActivityPrize
.
getPrizeNum
();
Integer
winnersNumNew
=
sweetIntegralActivityPrize
.
getWinnersNum
();
int
prizeNumDiff
=
prizeNumNew
-
prizeNum
;
int
winnersNumDiff
=
winnersNumNew
-
winnersNum
;
if
(
prizeNumDiff
>
0
)
{
//增加库存
sweetRedisAdminUtils
.
incrIntegralActivityPrizeNum
(
integralActivityId
,
prizeId
,
prizeNumDiff
);
}
else
if
(
prizeNumDiff
<
0
)
{
// 减少库存
sweetRedisAdminUtils
.
decrIntegralActivityPrizeNum
(
integralActivityId
,
prizeId
,
Math
.
abs
(
prizeNumDiff
));
}
if
(
winnersNumDiff
>
0
)
{
//增加中奖人数
sweetRedisAdminUtils
.
incrIntegralActivityPrizeWinnersNum
(
integralActivityId
,
prizeId
,
winnersNumDiff
);
}
else
if
(
winnersNumDiff
<
0
)
{
// 减少中奖人数
sweetRedisAdminUtils
.
decrIntegralActivityPrizeWinnersNum
(
integralActivityId
,
prizeId
,
Math
.
abs
(
winnersNumDiff
));
}
}
}
}
}
// 活动redis处理
// 活动redis处理
...
@@ -184,6 +199,31 @@ public class SweetIntegralActivityServiceImpl extends ServiceImpl<SweetIntegralA
...
@@ -184,6 +199,31 @@ public class SweetIntegralActivityServiceImpl extends ServiceImpl<SweetIntegralA
public
PageInfo
<
SweetIntegralActivityDto
>
list
(
SweetIntegralActivityListSearchParam
listParam
)
{
public
PageInfo
<
SweetIntegralActivityDto
>
list
(
SweetIntegralActivityListSearchParam
listParam
)
{
PageHelper
.
startPage
(
listParam
.
getPageNum
(),
listParam
.
getPageSize
());
PageHelper
.
startPage
(
listParam
.
getPageNum
(),
listParam
.
getPageSize
());
List
<
SweetIntegralActivityDto
>
voList
=
sweetIntegralActivityMapper
.
searchActivityList
(
listParam
.
getActivityTitle
());
List
<
SweetIntegralActivityDto
>
voList
=
sweetIntegralActivityMapper
.
searchActivityList
(
listParam
.
getActivityTitle
());
for
(
SweetIntegralActivityDto
activityDto
:
voList
)
{
String
activityId
=
activityDto
.
getIntegralActivityId
();
// 实物总库存、实物已发放数量
int
sureTotalPrizeNum
=
sweetIntegralActivityPrizeMapper
.
sureTotalPrizeNum
(
activityId
);
int
sureOutPrizeNum
=
sweetIntegralActivityDrawMapper
.
sureOutPrizeNum
(
activityId
);
// 总抽奖次数、redis去除黑名单抽奖次数
int
totalDrawNum
=
sweetIntegralActivityDrawMapper
.
totalDrawNum
(
activityId
);
int
diffEstimatedNum
=
sweetRedisAdminUtils
.
getIntegralActivityEstimatedNum
(
activityId
);
int
notBlackDrawNum
=
0
;
if
(
diffEstimatedNum
>
0
)
{
notBlackDrawNum
=
activityDto
.
getEstimatedNum
()
-
diffEstimatedNum
;
}
else
{
notBlackDrawNum
=
activityDto
.
getEstimatedNum
()
+
Math
.
abs
(
diffEstimatedNum
);
}
// 积分和券的总库存、已发放的数量
int
otherTotalPrizeNum
=
sweetIntegralActivityPrizeMapper
.
otherTotalPrizeNum
(
activityId
);
int
otherOutPrizeNum
=
sweetIntegralActivityDrawMapper
.
otherOutPrizeNum
(
activityId
);
activityDto
.
setSureTotalPrizeNum
(
sureTotalPrizeNum
);
activityDto
.
setSureOutPrizeNum
(
sureOutPrizeNum
);
activityDto
.
setTotalDrawNum
(
totalDrawNum
);
activityDto
.
setNotBlackDrawNum
(
notBlackDrawNum
);
activityDto
.
setOtherTotalPrizeNum
(
otherTotalPrizeNum
);
activityDto
.
setOtherOutPrizeNum
(
otherOutPrizeNum
);
}
return
new
PageInfo
(
voList
);
return
new
PageInfo
(
voList
);
}
}
...
@@ -199,15 +239,76 @@ public class SweetIntegralActivityServiceImpl extends ServiceImpl<SweetIntegralA
...
@@ -199,15 +239,76 @@ public class SweetIntegralActivityServiceImpl extends ServiceImpl<SweetIntegralA
voList
.
add
(
copy
);
voList
.
add
(
copy
);
});
});
sweetRedisAdminUtils
.
setIntegralActivityList
(
voList
);
sweetRedisAdminUtils
.
setIntegralActivityList
(
voList
);
// 活动详情
// 活动详情
SweetIntegralActivity
sweetIntegralActivity
=
sweetIntegralActivityMapper
.
selectOne
(
SweetIntegralActivity
sweetIntegralActivity
=
sweetIntegralActivityMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
SweetIntegralActivity
.
class
).
eq
(
SweetIntegralActivity:
:
getIntegralActivityId
,
integralActivityId
)
Wrappers
.
lambdaQuery
(
SweetIntegralActivity
.
class
).
eq
(
SweetIntegralActivity:
:
getIntegralActivityId
,
integralActivityId
)
);
);
IntegralActivityVo
integralActivityVo
=
IntegralActivityVo
.
getNew
().
copy
(
sweetIntegralActivity
);
IntegralActivityVo
integralActivityVo
=
IntegralActivityVo
.
getNew
().
copy
(
sweetIntegralActivity
);
List
<
SweetIntegralActivityPrize
>
sweetIntegralActivityPrizes
=
sweetIntegralActivityPrizeMapper
.
selectList
(
// 详情奖品 全部
List
<
SweetIntegralActivityPrize
>
activityPrizes
=
sweetIntegralActivityPrizeMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetIntegralActivityPrize
.
class
).
eq
(
SweetIntegralActivityPrize:
:
getIntegralActivityId
,
integralActivityId
)
);
List
<
IntegralActivityPrizeVo
>
prizeList
=
SweetObjectAdminUtil
.
getSweetIntegralActivityPrizeVoList
();
activityPrizes
.
forEach
(
r
->
{
IntegralActivityPrizeVo
copy
=
IntegralActivityPrizeVo
.
getNew
().
copy
(
r
);
// 奖品券列表
List
<
SweetIntegralActivityPrizeRelation
>
prizeRelations
=
relationMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetIntegralActivityPrizeRelation
.
class
).
eq
(
SweetIntegralActivityPrizeRelation:
:
getPrizeId
,
copy
.
getPrizeId
())
);
ArrayList
<
IntegralActivityPrizeRelationVo
>
prizeRelationVoList
=
SweetObjectAdminUtil
.
getSweetIntegralActivityPrizeRelationVoList
();
if
(!
CollectionUtils
.
isEmpty
(
prizeRelations
))
{
prizeRelations
.
forEach
(
rr
->
{
IntegralActivityPrizeRelationVo
copyR
=
IntegralActivityPrizeRelationVo
.
getNew
().
copy
(
rr
);
prizeRelationVoList
.
add
(
copyR
);
});
}
copy
.
setPrizeRelationList
(
prizeRelationVoList
);
prizeList
.
add
(
copy
);
});
integralActivityVo
.
setPrizeList
(
prizeList
);
// 详情奖品 积分和券
List
<
SweetIntegralActivityPrize
>
activityPrizes1
=
sweetIntegralActivityPrizeMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetIntegralActivityPrize
.
class
).
eq
(
SweetIntegralActivityPrize:
:
getIntegralActivityId
,
integralActivityId
)
.
in
(
SweetIntegralActivityPrize:
:
getPrizeType
,
Arrays
.
asList
(
StatusConst
.
PRIZE_TYPE1
,
StatusConst
.
PRIZE_TYPE2
))
);
List
<
IntegralActivityPrizeVo
>
prizeList1
=
SweetObjectAdminUtil
.
getSweetIntegralActivityPrizeVoList
();
activityPrizes1
.
forEach
(
r
->
{
IntegralActivityPrizeVo
copy
=
IntegralActivityPrizeVo
.
getNew
().
copy
(
r
);
// 奖品券列表
List
<
SweetIntegralActivityPrizeRelation
>
prizeRelations
=
relationMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetIntegralActivityPrizeRelation
.
class
).
eq
(
SweetIntegralActivityPrizeRelation:
:
getPrizeId
,
copy
.
getPrizeId
())
);
ArrayList
<
IntegralActivityPrizeRelationVo
>
prizeRelationVoList
=
SweetObjectAdminUtil
.
getSweetIntegralActivityPrizeRelationVoList
();
if
(!
CollectionUtils
.
isEmpty
(
prizeRelations
))
{
prizeRelations
.
forEach
(
rr
->
{
IntegralActivityPrizeRelationVo
copyR
=
IntegralActivityPrizeRelationVo
.
getNew
().
copy
(
rr
);
prizeRelationVoList
.
add
(
copyR
);
});
}
copy
.
setPrizeRelationList
(
prizeRelationVoList
);
prizeList1
.
add
(
copy
);
});
integralActivityVo
.
setPrizeList1
(
prizeList1
);
// 详情奖品 实物等
List
<
SweetIntegralActivityPrize
>
activityPrizes2
=
sweetIntegralActivityPrizeMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetIntegralActivityPrize
.
class
).
eq
(
SweetIntegralActivityPrize:
:
getIntegralActivityId
,
integralActivityId
)
Wrappers
.
lambdaQuery
(
SweetIntegralActivityPrize
.
class
).
eq
(
SweetIntegralActivityPrize:
:
getIntegralActivityId
,
integralActivityId
)
.
in
(
SweetIntegralActivityPrize:
:
getPrizeType
,
Arrays
.
asList
(
StatusConst
.
PRIZE_TYPE3
,
StatusConst
.
PRIZE_TYPE4
,
StatusConst
.
PRIZE_TYPE5
))
);
);
integralActivityVo
.
setPrizeList
(
sweetIntegralActivityPrizes
);
List
<
IntegralActivityPrizeVo
>
prizeList2
=
SweetObjectAdminUtil
.
getSweetIntegralActivityPrizeVoList
();
int
totalPrizeNum
=
0
;
for
(
SweetIntegralActivityPrize
prize
:
activityPrizes2
)
{
IntegralActivityPrizeVo
copy
=
IntegralActivityPrizeVo
.
getNew
().
copy
(
prize
);
prizeList2
.
add
(
copy
);
int
prizeNum
=
sweetRedisAdminUtils
.
getIntegralActivityPrizeNum
(
integralActivityId
,
prize
.
getPrizeId
());
totalPrizeNum
+=
prizeNum
;
}
sweetRedisAdminUtils
.
setIntegralActivityTotalPrizeNum
(
integralActivityId
,
totalPrizeNum
);
integralActivityVo
.
setPrizeList2
(
prizeList2
);
sweetRedisAdminUtils
.
setIntegralActivityInfo
(
integralActivityVo
);
sweetRedisAdminUtils
.
setIntegralActivityInfo
(
integralActivityVo
);
}
}
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/sweet/utils/SweetObjectAdminUtil.java
View file @
b244d600
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
sweet
.
utils
;
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
sweet
.
utils
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityPrizeRelationVo
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityPrizeVo
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityVo
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityVo
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
public
class
SweetObjectAdminUtil
{
public
class
SweetObjectAdminUtil
{
private
static
final
ArrayList
<
IntegralActivityVo
>
sweetIntegralActivityVoList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
IntegralActivityVo
>
sweetIntegralActivityVoList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
IntegralActivityPrizeVo
>
sweetIntegralActivityPrizeVoList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
IntegralActivityPrizeVo
>
sweetIntegralActivityPrizeRelationVoList
=
new
ArrayList
<>();
public
static
ArrayList
<
IntegralActivityVo
>
getSweetIntegralActivityVoList
()
{
public
static
ArrayList
<
IntegralActivityVo
>
getSweetIntegralActivityVoList
()
{
return
(
ArrayList
<
IntegralActivityVo
>)
sweetIntegralActivityVoList
.
clone
();
return
(
ArrayList
<
IntegralActivityVo
>)
sweetIntegralActivityVoList
.
clone
();
}
}
public
static
ArrayList
<
IntegralActivityPrizeVo
>
getSweetIntegralActivityPrizeVoList
()
{
return
(
ArrayList
<
IntegralActivityPrizeVo
>)
sweetIntegralActivityPrizeVoList
.
clone
();
}
public
static
ArrayList
<
IntegralActivityPrizeRelationVo
>
getSweetIntegralActivityPrizeRelationVoList
()
{
return
(
ArrayList
<
IntegralActivityPrizeRelationVo
>)
sweetIntegralActivityPrizeRelationVoList
.
clone
();
}
}
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/sweet/utils/SweetRedisAdminUtils.java
View file @
b244d600
...
@@ -5,7 +5,6 @@ import com.liquidnet.service.sweet.constant.SweetConstant;
...
@@ -5,7 +5,6 @@ import com.liquidnet.service.sweet.constant.SweetConstant;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityDrawVo
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityDrawVo
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityVo
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.LinkedList
;
import
java.util.LinkedList
;
...
@@ -14,8 +13,6 @@ import java.util.List;
...
@@ -14,8 +13,6 @@ import java.util.List;
@Component
@Component
public
class
SweetRedisAdminUtils
{
public
class
SweetRedisAdminUtils
{
@Autowired
private
MongoTemplate
mongoTemplate
;
@Autowired
@Autowired
private
RedisDataSourceUtil
redisDataSourceUtil
;
private
RedisDataSourceUtil
redisDataSourceUtil
;
...
@@ -29,6 +26,9 @@ public class SweetRedisAdminUtils {
...
@@ -29,6 +26,9 @@ public class SweetRedisAdminUtils {
boolean
set
=
redisDataSourceUtil
.
getRedisSweetUtil
().
set
(
redisKey
,
integralActivityVo
);
boolean
set
=
redisDataSourceUtil
.
getRedisSweetUtil
().
set
(
redisKey
,
integralActivityVo
);
}
}
/**
* 奖品库存
*/
public
void
incrIntegralActivityPrizeNum
(
String
integralActivityId
,
String
prizeId
,
Integer
num
)
{
public
void
incrIntegralActivityPrizeNum
(
String
integralActivityId
,
String
prizeId
,
Integer
num
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_NUM
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_NUM
.
concat
(
integralActivityId
)
.
concat
(
integralActivityId
)
...
@@ -36,37 +36,46 @@ public class SweetRedisAdminUtils {
...
@@ -36,37 +36,46 @@ public class SweetRedisAdminUtils {
.
concat
(
prizeId
);
.
concat
(
prizeId
);
redisDataSourceUtil
.
getRedisSweetUtil
().
incr
(
redisKey
,
num
);
redisDataSourceUtil
.
getRedisSweetUtil
().
incr
(
redisKey
,
num
);
}
}
public
void
decrIntegralActivityPrizeNum
(
String
integralActivityId
,
String
prizeId
,
Integer
num
)
{
public
void
incrIntegralActivityPrizeWinnersNum
(
String
integralActivityId
,
String
prizeId
,
Integer
num
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_NUM
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_WINNERS_NUM
.
concat
(
integralActivityId
)
.
concat
(
integralActivityId
)
.
concat
(
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_ID
)
.
concat
(
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_ID
)
.
concat
(
prizeId
);
.
concat
(
prizeId
);
redisDataSourceUtil
.
getRedisSweetUtil
().
in
cr
(
redisKey
,
num
);
redisDataSourceUtil
.
getRedisSweetUtil
().
de
cr
(
redisKey
,
num
);
}
}
public
void
delIntegralActivityPrizeNum
(
String
integralActivityId
,
String
prizeId
)
{
public
void
decrIntegralActivityPrizeNum
(
String
integralActivityId
,
String
prizeId
,
Integer
num
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_NUM
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_NUM
.
concat
(
integralActivityId
)
.
concat
(
integralActivityId
)
.
concat
(
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_ID
)
.
concat
(
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_ID
)
.
concat
(
prizeId
);
.
concat
(
prizeId
);
redisDataSourceUtil
.
getRedisSweetUtil
().
de
cr
(
redisKey
,
num
);
redisDataSourceUtil
.
getRedisSweetUtil
().
de
l
(
redisKey
);
}
}
public
void
decrIntegralActivityPrizeWinnersNum
(
String
integralActivityId
,
String
prizeId
,
Integer
num
)
{
public
int
getIntegralActivityPrizeNum
(
String
integralActivityId
,
String
prizeId
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_
WINNERS_
NUM
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_NUM
.
concat
(
integralActivityId
)
.
concat
(
integralActivityId
)
.
concat
(
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_ID
)
.
concat
(
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_ID
)
.
concat
(
prizeId
);
.
concat
(
prizeId
);
redisDataSourceUtil
.
getRedisSweetUtil
().
decr
(
redisKey
,
num
);
Object
obj
=
redisDataSourceUtil
.
getRedisSweetUtil
().
get
(
redisKey
);
if
(
null
==
obj
)
{
return
0
;
}
else
{
return
(
int
)
obj
;
}
}
}
public
void
setIntegralActivityDraw
(
LinkedList
<
IntegralActivityDrawVo
>
sweetIntegralActivityDraws
,
String
integralActivityId
,
String
userId
)
{
public
void
setIntegralActivityTotalPrizeNum
(
String
integralActivityId
,
int
totalPrizeNum
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_TOTAL_PRIZE_NUM
.
concat
(
integralActivityId
);
redisDataSourceUtil
.
getRedisSweetUtil
().
set
(
redisKey
,
totalPrizeNum
);
}
public
void
delIntegralActivityDrawList
(
String
uid
,
String
integralActivityId
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_IN_USER
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_IN_USER
.
concat
(
integralActivityId
)
.
concat
(
integralActivityId
)
.
concat
(
":userId:"
)
.
concat
(
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_USER_KEY
)
.
concat
(
u
serI
d
);
.
concat
(
u
i
d
);
redisDataSourceUtil
.
getRedisSweetUtil
().
set
(
redisKey
,
sweetIntegralActivityDraws
);
redisDataSourceUtil
.
getRedisSweetUtil
().
del
(
redisKey
);
}
}
public
void
setIntegralActivityDrawInfo
(
String
drawId
)
{
public
void
setIntegralActivityDrawInfo
(
String
drawId
)
{
...
@@ -76,4 +85,30 @@ public class SweetRedisAdminUtils {
...
@@ -76,4 +85,30 @@ public class SweetRedisAdminUtils {
info
.
setReceivingStatus
(
2
);
info
.
setReceivingStatus
(
2
);
redisDataSourceUtil
.
getRedisSweetUtil
().
set
(
redisKeyDraw
,
info
);
redisDataSourceUtil
.
getRedisSweetUtil
().
set
(
redisKeyDraw
,
info
);
}
}
/**
* 预估人数
*/
public
void
incrIntegralActivityEstimatedNum
(
String
integralActivityId
,
Integer
num
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_ESTIMATEDNUM
.
concat
(
integralActivityId
);
redisDataSourceUtil
.
getRedisSweetUtil
().
incr
(
redisKey
,
num
);
}
public
void
decrIntegralActivityEstimatedNum
(
String
integralActivityId
,
Integer
num
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_ESTIMATEDNUM
.
concat
(
integralActivityId
);
redisDataSourceUtil
.
getRedisSweetUtil
().
decr
(
redisKey
,
num
);
}
public
int
getIntegralActivityEstimatedNum
(
String
integralActivityId
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_ESTIMATEDNUM
.
concat
(
integralActivityId
);
Object
obj
=
redisDataSourceUtil
.
getRedisSweetUtil
().
get
(
redisKey
);
if
(
null
==
obj
)
{
return
0
;
}
else
{
return
(
int
)
obj
;
}
}
}
}
liquidnet-bus-common/liquidnet-common-service-base/src/main/java/com/liquidnet/service/base/constant/MQConst.java
View file @
b244d600
...
@@ -84,10 +84,11 @@ public class MQConst {
...
@@ -84,10 +84,11 @@ public class MQConst {
SWEET_TEMPLATE_MSG
(
"sweet:stream:rk.sweetTemplateMsg"
,
"group.sweetTemplateMsg"
,
"发送模版消息"
),
SWEET_TEMPLATE_MSG
(
"sweet:stream:rk.sweetTemplateMsg"
,
"group.sweetTemplateMsg"
,
"发送模版消息"
),
SWEET_CITY_VOTE
(
"sweet:stream:rk.cityVote"
,
"group.cityVote"
,
"用户投票记录"
),
SWEET_CITY_VOTE
(
"sweet:stream:rk.cityVote"
,
"group.cityVote"
,
"用户投票记录"
),
SWEET_ANTIGENIC_QUESTION
(
"sweet:stream:rk.antigenicQuestion"
,
"group.antigenicQuestion"
,
"防疫答题"
),
SWEET_ANTIGENIC_QUESTION
(
"sweet:stream:rk.antigenicQuestion"
,
"group.antigenicQuestion"
,
"防疫答题"
),
SWEET_INTEGRAL_ACTIVITY_DRAW
(
"sweet:stream:rk.integralActivityDraw"
,
"group.integralActivityDraw"
,
"积分抽奖"
),
SWEET_POSTER
(
"sweet:stream:rk.userLikeMusician"
,
"group.userLikeMusician"
,
"用户喜欢的音乐人"
),
SWEET_POSTER
(
"sweet:stream:rk.userLikeMusician"
,
"group.userLikeMusician"
,
"用户喜欢的音乐人"
),
SWEET_WECHAT_MAODENG_TEXT_INSERT
(
"sweet:stream:rk.textAndImgInsert"
,
"group.sweetMaoDengInsert"
,
"猫登天空"
),
SWEET_WECHAT_MAODENG_TEXT_INSERT
(
"sweet:stream:rk.textAndImgInsert"
,
"group.sweetMaoDengInsert"
,
"猫登天空"
),
SWEET_INTEGRAL_ACTIVITY_DRAW
(
"sweet:stream:rk.integralActivityDraw"
,
"group.integralActivityDraw"
,
"积分抽奖"
),
SWEET_STONE_INTEGRAL
(
"sweet:stream:rk.stoneIntegral"
,
"group.stoneIntegral"
,
"stone积分处理"
),
;
;
private
final
String
key
;
private
final
String
key
;
...
...
liquidnet-bus-config/liquidnet-config/application-dev.yml
View file @
b244d600
...
@@ -48,7 +48,7 @@ liquidnet:
...
@@ -48,7 +48,7 @@ liquidnet:
database
:
15
database
:
15
host
:
39.107.71.112
host
:
39.107.71.112
port
:
6379
port
:
6379
password
:
PO@B!Iud32
password
:
3Xa%8p
adam
:
adam
:
dbs
:
0,16
dbs
:
0,16
database
:
15
database
:
15
...
...
liquidnet-bus-config/liquidnet-config/liquidnet-service-sweet.yml
View file @
b244d600
...
@@ -112,6 +112,8 @@ global-auth:
...
@@ -112,6 +112,8 @@ global-auth:
-
${liquidnet.info.context}/integralActivityDraw/detail/*
-
${liquidnet.info.context}/integralActivityDraw/detail/*
-
${liquidnet.info.context}/integralActivityDraw/drawList
-
${liquidnet.info.context}/integralActivityDraw/drawList
-
${liquidnet.info.context}/integralActivityDraw/perfectAddress
-
${liquidnet.info.context}/integralActivityDraw/perfectAddress
-
${liquidnet.info.context}/integralActivityDraw/collectCoupon
-
${liquidnet.info.context}/integralActivityDraw/couponList
# 手机号获取是否关注
# 手机号获取是否关注
-
${liquidnet.info.context}/wechatTemplate/followStatusPhone
-
${liquidnet.info.context}/wechatTemplate/followStatusPhone
# 做积分任务
# 做积分任务
...
...
liquidnet-bus-do/liquidnet-service-candy-do/src/main/java/com/liquidnet/service/candy/dto/CandyCouponRuleDto.java
View file @
b244d600
package
com
.
liquidnet
.
service
.
candy
.
dto
;
package
com
.
liquidnet
.
service
.
candy
.
dto
;
import
com.liquidnet.service.candy.entity.CandyCouponRule
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -25,4 +26,14 @@ public class CandyCouponRuleDto implements Serializable, Cloneable {
...
@@ -25,4 +26,14 @@ public class CandyCouponRuleDto implements Serializable, Cloneable {
return
new
CandyCouponRuleDto
();
return
new
CandyCouponRuleDto
();
}
}
}
}
public
CandyCouponRuleDto
copy
(
CandyCouponRule
source
)
{
if
(
null
==
source
)
return
this
;
this
.
setCruleId
(
source
.
getCruleId
());
this
.
setCouponId
(
source
.
getCouponId
());
this
.
setUseScope
(
source
.
getUseScope
());
this
.
setBusiName
(
source
.
getBusiName
());
this
.
setBusiId
(
source
.
getBusiId
());
return
this
;
}
}
}
liquidnet-bus-do/liquidnet-service-candy-do/src/main/java/com/liquidnet/service/candy/dto/admin/CandyCouponFilterDto.java
View file @
b244d600
package
com
.
liquidnet
.
service
.
candy
.
dto
.
admin
;
package
com
.
liquidnet
.
service
.
candy
.
dto
.
admin
;
import
com.liquidnet.service.candy.entity.CandyCoupon
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
@Data
@Data
public
class
CandyCouponFilterDto
implements
Serializable
,
Cloneable
{
public
class
CandyCouponFilterDto
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
-
3287018184399499549L
;
private
static
final
long
serialVersionUID
=
-
3287018184399499549L
;
private
String
couponId
;
private
String
couponId
;
private
String
title
;
private
String
title
;
private
String
notice
;
private
Integer
busiType
;
private
Integer
couType
;
private
Integer
bindType
;
private
BigDecimal
discount
;
private
BigDecimal
valFace
;
private
BigDecimal
valOver
;
private
BigDecimal
valMinus
;
private
String
busiName
;
private
static
final
CandyCouponFilterDto
obj
=
new
CandyCouponFilterDto
();
private
static
final
CandyCouponFilterDto
obj
=
new
CandyCouponFilterDto
();
...
@@ -20,11 +30,4 @@ public class CandyCouponFilterDto implements Serializable, Cloneable {
...
@@ -20,11 +30,4 @@ public class CandyCouponFilterDto implements Serializable, Cloneable {
return
new
CandyCouponFilterDto
();
return
new
CandyCouponFilterDto
();
}
}
}
}
public
CandyCouponFilterDto
copy
(
CandyCoupon
source
)
{
if
(
null
==
source
)
return
this
;
this
.
setCouponId
(
source
.
getCouponId
());
this
.
setTitle
(
source
.
getTitle
());
return
this
;
}
}
}
liquidnet-bus-do/liquidnet-service-candy-do/src/main/java/com/liquidnet/service/candy/dto/admin/CandyCouponListParam.java
View file @
b244d600
...
@@ -10,7 +10,7 @@ public class CandyCouponListParam {
...
@@ -10,7 +10,7 @@ public class CandyCouponListParam {
*/
*/
private
String
keyword
;
private
String
keyword
;
/**
/**
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分
兑换
|3-发放需领取|4-会员专属]
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分
商品
|3-发放需领取|4-会员专属]
* <p>
* <p>
* 多种方式则以,分隔入参
* 多种方式则以,分隔入参
* </p>
* </p>
...
...
liquidnet-bus-do/liquidnet-service-candy-do/src/main/java/com/liquidnet/service/candy/dto/admin/CandyMgtCouponListParam.java
View file @
b244d600
...
@@ -12,7 +12,7 @@ public class CandyMgtCouponListParam {
...
@@ -12,7 +12,7 @@ public class CandyMgtCouponListParam {
*/
*/
private
String
keyword
;
private
String
keyword
;
/**
/**
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分
兑换
|3-发放需领取|4-会员专属]
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分
商品
|3-发放需领取|4-会员专属]
*/
*/
private
Integer
bindType
;
private
Integer
bindType
;
/**
/**
...
...
liquidnet-bus-do/liquidnet-service-candy-do/src/main/java/com/liquidnet/service/candy/entity/CandyCoupon.java
View file @
b244d600
...
@@ -65,7 +65,7 @@ public class CandyCoupon implements Serializable {
...
@@ -65,7 +65,7 @@ public class CandyCoupon implements Serializable {
private
Integer
couType
;
private
Integer
couType
;
/**
/**
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分
兑换
|3-发放需领取|4-会员专属]
* 领取方式[0-用户输入兑换|1-发放至用户|2-积分
商品
|3-发放需领取|4-会员专属]
*/
*/
private
Integer
bindType
;
private
Integer
bindType
;
...
...
liquidnet-bus-do/liquidnet-service-candy-do/src/main/java/com/liquidnet/service/candy/entity/CandyMgtCoupon.java
View file @
b244d600
...
@@ -57,6 +57,11 @@ public class CandyMgtCoupon implements Serializable {
...
@@ -57,6 +57,11 @@ public class CandyMgtCoupon implements Serializable {
*/
*/
private
LocalDateTime
eventAt
;
private
LocalDateTime
eventAt
;
/**
* 任务驱动[0-系统自动,1-人为创建]
*/
private
Integer
eventDriven
;
/**
/**
* 专享标识[0-常规|1-会员专属]
* 专享标识[0-常规|1-会员专属]
* <p>
* <p>
...
...
liquidnet-bus-do/liquidnet-service-candy-do/src/main/java/com/liquidnet/service/candy/mapper/CandyCouponMapper.java
View file @
b244d600
package
com
.
liquidnet
.
service
.
candy
.
mapper
;
package
com
.
liquidnet
.
service
.
candy
.
mapper
;
import
com.liquidnet.service.candy.dto.admin.CandyCouponFilterDto
;
import
com.liquidnet.service.candy.dto.admin.CandyCouponListParam
;
import
com.liquidnet.service.candy.entity.CandyCoupon
;
import
com.liquidnet.service.candy.entity.CandyCoupon
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
java.util.List
;
/**
/**
* <p>
* <p>
* 券基础信息 Mapper 接口
* 券基础信息 Mapper 接口
...
@@ -13,4 +17,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -13,4 +17,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
*/
public
interface
CandyCouponMapper
extends
BaseMapper
<
CandyCoupon
>
{
public
interface
CandyCouponMapper
extends
BaseMapper
<
CandyCoupon
>
{
List
<
CandyCouponFilterDto
>
selectMultiForCouponFilterDto
(
CandyCouponListParam
listParam
);
}
}
liquidnet-bus-do/liquidnet-service-candy-do/src/main/resources/com/liquidnet/service/candy/mapper/CandyCouponMapper.xml
View file @
b244d600
...
@@ -2,4 +2,37 @@
...
@@ -2,4 +2,37 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.liquidnet.service.candy.mapper.CandyCouponMapper"
>
<mapper
namespace=
"com.liquidnet.service.candy.mapper.CandyCouponMapper"
>
<select
id=
"selectMultiForCouponFilterDto"
parameterType=
"com.liquidnet.service.candy.dto.admin.CandyCouponListParam"
resultType=
"com.liquidnet.service.candy.dto.admin.CandyCouponFilterDto"
>
SELECT DISTINCT cc.coupon_id couponId,
cc.title,
cc.notice,
cc.cou_type couType,
cc.busi_type busiType,
cc.bind_type bindType,
cc.val_face valFace,
cc.val_over valOver,
cc.val_minus valMinus,
cc.discount,
ccr.busi_name busiName
FROM candy_coupon cc
LEFT JOIN candy_coupon_rule ccr ON cc.coupon_id = ccr.coupon_id
<where>
cc.state = 1 AND ccr.state = 1
<if
test=
"couType != null"
>
AND cc.cou_type=#{couType,jdbcType=SMALLINT}
</if>
<if
test=
"bindType != null"
>
AND cc.bind_type in (${bindType})
</if>
<if
test=
"busiType != null"
>
AND cc.busi_type = #{busiType,jdbcType=SMALLINT}
</if>
<if
test=
"keyword != null and keyword != ''"
>
AND INSTR(CONCAT(cc.title, cc.notice, ccr.busi_name), #{keyword,jdbcType=VARCHAR})
</if>
</where>
</select>
</mapper>
</mapper>
liquidnet-bus-do/liquidnet-service-candy-do/src/main/resources/com/liquidnet/service/candy/mapper/CandyMgtCouponMapper.xml
View file @
b244d600
...
@@ -119,7 +119,7 @@
...
@@ -119,7 +119,7 @@
FROM candy_mgt_coupon cmc
FROM candy_mgt_coupon cmc
LEFT JOIN candy_coupon cc ON cmc.coupon_id = cc.coupon_id
LEFT JOIN candy_coupon cc ON cmc.coupon_id = cc.coupon_id
WHERE cmc.state
<![CDATA[<>]]>
2
WHERE cmc.state
<![CDATA[<>]]>
2
AND c
c.`exclusive` = 0
AND c
mc.event_driven=1
<if
test=
"mcouponId != null and mcouponId != ''"
>
<if
test=
"mcouponId != null and mcouponId != ''"
>
AND cmc.mcoupon_id = #{mcouponId,jdbcType=VARCHAR}
AND cmc.mcoupon_id = #{mcouponId,jdbcType=VARCHAR}
</if>
</if>
...
...
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/java/com/liquidnet/service/sweet/dto/SweetActivityDrawListDao.java
View file @
b244d600
...
@@ -38,7 +38,7 @@ public class SweetActivityDrawListDao implements Serializable {
...
@@ -38,7 +38,7 @@ public class SweetActivityDrawListDao implements Serializable {
private
String
prizeTitle
;
private
String
prizeTitle
;
/**
/**
* 奖品类型 1
谢谢
惠顾 2积分 3代金券 4满减券 5优先购买券 6实物
* 奖品类型 1
积分 2优惠券 3实物 4登登登VIP 5优先购买券
惠顾 2积分 3代金券 4满减券 5优先购买券 6实物
*/
*/
private
Integer
prizeType
;
private
Integer
prizeType
;
...
@@ -104,7 +104,7 @@ public class SweetActivityDrawListDao implements Serializable {
...
@@ -104,7 +104,7 @@ public class SweetActivityDrawListDao implements Serializable {
private
String
receivingAddressAll
;
private
String
receivingAddressAll
;
/**
/**
* 发放状态 1未发放 2已发放
3无需发放
* 发放状态 1未发放 2已发放
*/
*/
private
Integer
receivingStatus
;
private
Integer
receivingStatus
;
...
...
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/java/com/liquidnet/service/sweet/dto/SweetIntegralActivityDto.java
View file @
b244d600
...
@@ -34,6 +34,11 @@ public class SweetIntegralActivityDto {
...
@@ -34,6 +34,11 @@ public class SweetIntegralActivityDto {
*/
*/
private
Integer
activityNum
;
private
Integer
activityNum
;
/**
* 预估玩此活动的总人数
*/
private
Integer
estimatedNum
;
/**
/**
* 活动时间类型 1长期 2开始结束时间
* 活动时间类型 1长期 2开始结束时间
*/
*/
...
@@ -54,11 +59,6 @@ public class SweetIntegralActivityDto {
...
@@ -54,11 +59,6 @@ public class SweetIntegralActivityDto {
*/
*/
private
Integer
expressFeeType
;
private
Integer
expressFeeType
;
/**
* 活动规则
*/
private
String
activityRules
;
/**
/**
* 是否上线 1未上线 2已上线
* 是否上线 1未上线 2已上线
*/
*/
...
@@ -76,6 +76,32 @@ public class SweetIntegralActivityDto {
...
@@ -76,6 +76,32 @@ public class SweetIntegralActivityDto {
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
updatedAt
;
private
LocalDateTime
updatedAt
;
private
Integer
prizeNum
;
// private Integer prizeNum;
private
Integer
drawNum
;
// private Integer drawNum;
/**
* 实物总库存
*/
private
Integer
sureTotalPrizeNum
;
/**
* 实物已发放数量
*/
private
Integer
sureOutPrizeNum
;
/**
* 已抽奖次数
*/
private
Integer
totalDrawNum
;
/**
* 去除黑名单已抽奖次数
*/
private
Integer
notBlackDrawNum
;
/**
* 非实物总库存
*/
private
Integer
otherTotalPrizeNum
;
/**
* 非实物已发放数量
*/
private
Integer
otherOutPrizeNum
;
}
}
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/java/com/liquidnet/service/sweet/dto/admin/SweetIntegralActivityDrawListSearchParam.java
View file @
b244d600
...
@@ -39,9 +39,6 @@ public class SweetIntegralActivityDrawListSearchParam implements Serializable {
...
@@ -39,9 +39,6 @@ public class SweetIntegralActivityDrawListSearchParam implements Serializable {
@ApiModelProperty
(
value
=
"发放状态"
)
@ApiModelProperty
(
value
=
"发放状态"
)
private
Integer
receivingStatus
;
private
Integer
receivingStatus
;
@ApiModelProperty
(
value
=
"是否中奖"
)
private
Integer
isWin
;
@ApiModelProperty
(
value
=
"页数"
,
example
=
"0"
)
@ApiModelProperty
(
value
=
"页数"
,
example
=
"0"
)
private
Integer
pageSize
;
private
Integer
pageSize
;
...
...
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/java/com/liquidnet/service/sweet/entity/SweetIntegralActivity.java
View file @
b244d600
...
@@ -51,6 +51,11 @@ public class SweetIntegralActivity implements Serializable, Cloneable {
...
@@ -51,6 +51,11 @@ public class SweetIntegralActivity implements Serializable, Cloneable {
*/
*/
private
Integer
activityNum
;
private
Integer
activityNum
;
/**
* 预估玩此活动的总人数
*/
private
Integer
estimatedNum
;
/**
/**
* 活动时间类型 1长期 2开始结束时间
* 活动时间类型 1长期 2开始结束时间
*/
*/
...
@@ -76,6 +81,11 @@ public class SweetIntegralActivity implements Serializable, Cloneable {
...
@@ -76,6 +81,11 @@ public class SweetIntegralActivity implements Serializable, Cloneable {
*/
*/
private
String
activityRules
;
private
String
activityRules
;
/**
* 概率公示
*/
private
String
probabilityPublicity
;
/**
/**
* 是否上线 1未上线 2已上线
* 是否上线 1未上线 2已上线
*/
*/
...
...
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/java/com/liquidnet/service/sweet/entity/SweetIntegralActivityDraw.java
View file @
b244d600
...
@@ -54,7 +54,7 @@ public class SweetIntegralActivityDraw implements Serializable, Cloneable {
...
@@ -54,7 +54,7 @@ public class SweetIntegralActivityDraw implements Serializable, Cloneable {
private
String
prizeTitle
;
private
String
prizeTitle
;
/**
/**
* 奖品类型 1
谢谢
惠顾 2积分 3代金券 4满减券 5优先购买券 6实物
* 奖品类型 1
积分 2优惠券 3实物 4登登登VIP 5优先购买券
惠顾 2积分 3代金券 4满减券 5优先购买券 6实物
*/
*/
private
Integer
prizeType
;
private
Integer
prizeType
;
...
@@ -114,7 +114,7 @@ public class SweetIntegralActivityDraw implements Serializable, Cloneable {
...
@@ -114,7 +114,7 @@ public class SweetIntegralActivityDraw implements Serializable, Cloneable {
private
String
receivingAddress
;
private
String
receivingAddress
;
/**
/**
* 发放状态 1未发放 2已发放
3无需发放
* 发放状态 1未发放 2已发放
*/
*/
private
Integer
receivingStatus
;
private
Integer
receivingStatus
;
...
...
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/java/com/liquidnet/service/sweet/entity/SweetIntegralActivityPrize.java
View file @
b244d600
package
com
.
liquidnet
.
service
.
sweet
.
entity
;
package
com
.
liquidnet
.
service
.
sweet
.
entity
;
import
java.math.BigDecimal
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
/**
/**
* <p>
* <p>
* 积分活动奖品表
* 积分活动奖品表
...
@@ -43,6 +41,11 @@ public class SweetIntegralActivityPrize implements Serializable, Cloneable {
...
@@ -43,6 +41,11 @@ public class SweetIntegralActivityPrize implements Serializable, Cloneable {
*/
*/
private
String
prizeTitle
;
private
String
prizeTitle
;
/**
* 奖品描述
*/
private
String
prizeDescribe
;
/**
/**
* 初始展示奖品图片
* 初始展示奖品图片
*/
*/
...
@@ -54,7 +57,7 @@ public class SweetIntegralActivityPrize implements Serializable, Cloneable {
...
@@ -54,7 +57,7 @@ public class SweetIntegralActivityPrize implements Serializable, Cloneable {
private
String
prizeImgSelect
;
private
String
prizeImgSelect
;
/**
/**
* 奖品类型 1
谢谢惠顾 2积分 3代金券 4满减券 5优先购买券 6实物
* 奖品类型 1
积分 2优惠券 3实物 4登登登VIP
*/
*/
private
Integer
prizeType
;
private
Integer
prizeType
;
...
@@ -63,20 +66,15 @@ public class SweetIntegralActivityPrize implements Serializable, Cloneable {
...
@@ -63,20 +66,15 @@ public class SweetIntegralActivityPrize implements Serializable, Cloneable {
*/
*/
private
Integer
prizeTypeNum
;
private
Integer
prizeTypeNum
;
/**
* 关联id 如商品id 券id
*/
private
String
relationId
;
/**
/**
* 奖品数量
* 奖品数量
*/
*/
private
Integer
prizeNum
;
private
Integer
prizeNum
;
/**
/**
*
限制的中奖人数
*
是否是无限库存 1有限库存 2无限
*/
*/
private
Integer
winnersNum
;
private
Integer
isInfinite
;
/**
/**
* 中奖概率
* 中奖概率
...
...
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/java/com/liquidnet/service/sweet/entity/SweetIntegralActivityPrizeRelation.java
0 → 100644
View file @
b244d600
package
com
.
liquidnet
.
service
.
sweet
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* <p>
* 积分活动奖品里关联多奖品表
* </p>
*
* @author jiangxiulong
* @since 2021-12-02
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
SweetIntegralActivityPrizeRelation
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
3400664786004300429L
;
@TableId
(
value
=
"mid"
,
type
=
IdType
.
AUTO
)
private
Long
mid
;
/**
* prize_relation_id
*/
private
String
prizeRelationId
;
/**
* prize_id
*/
private
String
prizeId
;
/**
* 券id
*/
private
String
couponId
;
/**
* 券名称
*/
private
String
couponTitle
;
/**
* 创建时间
*/
private
LocalDateTime
createdAt
;
/**
* 更新时间
*/
private
LocalDateTime
updatedAt
;
private
static
final
SweetIntegralActivityPrizeRelation
obj
=
new
SweetIntegralActivityPrizeRelation
();
public
static
SweetIntegralActivityPrizeRelation
getNew
()
{
try
{
return
(
SweetIntegralActivityPrizeRelation
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
SweetIntegralActivityPrizeRelation
();
}
}
}
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/java/com/liquidnet/service/sweet/mapper/SweetIntegralActivityDrawMapper.java
View file @
b244d600
...
@@ -21,4 +21,10 @@ public interface SweetIntegralActivityDrawMapper extends BaseMapper<SweetIntegra
...
@@ -21,4 +21,10 @@ public interface SweetIntegralActivityDrawMapper extends BaseMapper<SweetIntegra
List
<
SweetActivityDrawListDao
>
selectExcelList
(
@Param
(
"integralActivityId"
)
String
integralActivityId
);
List
<
SweetActivityDrawListDao
>
selectExcelList
(
@Param
(
"integralActivityId"
)
String
integralActivityId
);
List
<
SweetActivityDrawListDao
>
searchLists
(
SweetIntegralActivityDrawListSearchParam
listParam
);
List
<
SweetActivityDrawListDao
>
searchLists
(
SweetIntegralActivityDrawListSearchParam
listParam
);
int
sureOutPrizeNum
(
String
activityId
);
int
totalDrawNum
(
String
activityId
);
int
otherOutPrizeNum
(
String
activityId
);
}
}
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/java/com/liquidnet/service/sweet/mapper/SweetIntegralActivityPrizeMapper.java
View file @
b244d600
...
@@ -13,4 +13,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -13,4 +13,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
*/
public
interface
SweetIntegralActivityPrizeMapper
extends
BaseMapper
<
SweetIntegralActivityPrize
>
{
public
interface
SweetIntegralActivityPrizeMapper
extends
BaseMapper
<
SweetIntegralActivityPrize
>
{
int
sureTotalPrizeNum
(
String
activityId
);
int
otherTotalPrizeNum
(
String
activityId
);
}
}
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/java/com/liquidnet/service/sweet/mapper/SweetIntegralActivityPrizeRelationMapper.java
0 → 100644
View file @
b244d600
package
com
.
liquidnet
.
service
.
sweet
.
mapper
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityPrizeRelation
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* 积分活动奖品里关联多奖品表 Mapper 接口
* </p>
*
* @author jiangxiulong
* @since 2021-12-02
*/
public
interface
SweetIntegralActivityPrizeRelationMapper
extends
BaseMapper
<
SweetIntegralActivityPrizeRelation
>
{
}
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/resources/com.liquidnet.service.sweet.mapper/SweetIntegralActivityDrawMapper.xml
View file @
b244d600
...
@@ -43,13 +43,36 @@
...
@@ -43,13 +43,36 @@
<if
test=
"receivingStatus != null and receivingStatus != ''"
>
<if
test=
"receivingStatus != null and receivingStatus != ''"
>
and a.receiving_status = #{prizeTyreceivingStatuspe}
and a.receiving_status = #{prizeTyreceivingStatuspe}
</if>
</if>
<if
test=
"isWin == 1"
>
</where>
and a.prize_type = 1
ORDER BY a.mid DESC
</select>
<select
id=
"sureOutPrizeNum"
resultType=
"java.lang.Integer"
>
select COUNT(*)
from sweet_integral_activity_draw
<where>
<if
test=
"integralActivityId != null and integralActivityId != ''"
>
and integral_activity_id = #{integralActivityId}
</if>
</if>
<if
test=
"isWin == 2"
>
and prize_type in (3, 4, 5)
and a.prize_type != 1
</where>
</select>
<select
id=
"totalDrawNum"
resultType=
"java.lang.Integer"
>
select COUNT(*)
from sweet_integral_activity_draw
<where>
<if
test=
"integralActivityId != null and integralActivityId != ''"
>
and integral_activity_id = #{integralActivityId}
</if>
</if>
</where>
</where>
ORDER BY a.mid DESC
</select>
<select
id=
"otherOutPrizeNum"
resultType=
"java.lang.Integer"
>
select COUNT(*)
from sweet_integral_activity_draw
<where>
<if
test=
"integralActivityId != null and integralActivityId != ''"
>
and integral_activity_id = #{integralActivityId}
</if>
and prize_type in (1, 2)
</where>
</select>
</select>
</mapper>
</mapper>
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/resources/com.liquidnet.service.sweet.mapper/SweetIntegralActivityMapper.xml
View file @
b244d600
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<mapper
namespace=
"com.liquidnet.service.sweet.mapper.SweetIntegralActivityMapper"
>
<mapper
namespace=
"com.liquidnet.service.sweet.mapper.SweetIntegralActivityMapper"
>
<select
id=
"searchActivityList"
resultType=
"com.liquidnet.service.sweet.dto.SweetIntegralActivityDto"
>
<select
id=
"searchActivityList"
resultType=
"com.liquidnet.service.sweet.dto.SweetIntegralActivityDto"
>
SELECT
<!--
SELECT
d.*, sum(b.prize_num) AS prize_num
d.*, sum(b.prize_num) AS prize_num
FROM (
FROM (
SELECT a.*, count(c.prize_id) AS draw_num
SELECT a.*, count(c.prize_id) AS draw_num
...
@@ -18,6 +18,15 @@
...
@@ -18,6 +18,15 @@
ORDER BY a.integral_activity_id DESC
ORDER BY a.integral_activity_id DESC
) d
) d
LEFT JOIN sweet_integral_activity_prize AS b ON d.integral_activity_id = b.integral_activity_id
LEFT JOIN sweet_integral_activity_prize AS b ON d.integral_activity_id = b.integral_activity_id
GROUP BY d.integral_activity_id
GROUP BY d.integral_activity_id-->
SELECT
*
FROM sweet_integral_activity
<where>
<if
test=
"activityTitle != null and activityTitle != ''"
>
and activity_title like concat('%', #{activityTitle}, '%')
</if>
</where>
ORDER BY mid DESC
</select>
</select>
</mapper>
</mapper>
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/resources/com.liquidnet.service.sweet.mapper/SweetIntegralActivityPrizeMapper.xml
View file @
b244d600
...
@@ -2,4 +2,24 @@
...
@@ -2,4 +2,24 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.liquidnet.service.sweet.mapper.SweetIntegralActivityPrizeMapper"
>
<mapper
namespace=
"com.liquidnet.service.sweet.mapper.SweetIntegralActivityPrizeMapper"
>
<select
id=
"sureTotalPrizeNum"
resultType=
"java.lang.Integer"
>
select ifnull(SUM(prize_num), 0)
from sweet_integral_activity_prize
<where>
<if
test=
"integralActivityId != null and integralActivityId != ''"
>
and integral_activity_id = #{integralActivityId}
</if>
and prize_type in (3, 4, 5)
</where>
</select>
<select
id=
"otherTotalPrizeNum"
resultType=
"java.lang.Integer"
>
select ifnull(SUM(prize_num), 0)
from sweet_integral_activity_prize
<where>
<if
test=
"integralActivityId != null and integralActivityId != ''"
>
and integral_activity_id = #{integralActivityId}
</if>
and prize_type in (1, 2)
</where>
</select>
</mapper>
</mapper>
liquidnet-bus-feign/liquidnet-api-feign-adam/src/main/java/com/liquidnet/service/feign/adam/api/FeignAdamBaseClient.java
View file @
b244d600
...
@@ -49,4 +49,7 @@ public interface FeignAdamBaseClient {
...
@@ -49,4 +49,7 @@ public interface FeignAdamBaseClient {
@RequestParam
(
value
=
"mobile"
)
String
mobile
,
@RequestParam
(
value
=
"mobile"
)
String
mobile
,
@NotBlank
(
message
=
"临时票据不能为空"
)
@NotBlank
(
message
=
"临时票据不能为空"
)
@RequestParam
(
value
=
"otp"
)
String
otp
);
@RequestParam
(
value
=
"otp"
)
String
otp
);
@GetMapping
(
value
=
"member/check/depth"
,
headers
=
{
"Inner-Required=1"
})
ResponseDto
<
Boolean
>
isMember
(
@NotBlank
(
message
=
"用户ID不能为空"
)
@RequestParam
(
value
=
"uid"
)
String
uid
);
}
}
liquidnet-bus-feign/liquidnet-api-feign-candy/pom.xml
0 → 100644
View file @
b244d600
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
liquidnet-bus-feign
</artifactId>
<groupId>
com.liquidnet
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
liquidnet-api-feign-candy
</artifactId>
<dependencies>
<dependency>
<groupId>
com.liquidnet
</groupId>
<artifactId>
liquidnet-service-candy-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>
8
</maven.compiler.source>
<maven.compiler.target>
8
</maven.compiler.target>
</properties>
</project>
\ No newline at end of file
liquidnet-bus-feign/liquidnet-api-feign-candy/src/main/java/com/liquidnet/service/feign/candy/api/FeignCandyBaseClient.java
0 → 100644
View file @
b244d600
package
com
.
liquidnet
.
service
.
feign
.
candy
.
api
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.candy.vo.CandyCouponPreviewVo
;
import
feign.hystrix.FallbackFactory
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
@Component
@FeignClient
(
name
=
"liquidnet-service-candy"
,
contextId
=
"FeignCandyBaseClient"
,
path
=
""
,
url
=
"${liquidnet.service.candy.url}"
,
fallback
=
FallbackFactory
.
Default
.
class
)
public
interface
FeignCandyBaseClient
{
@PostMapping
(
value
=
"rsc/couinfo"
,
headers
=
{
"Inner-Required=1"
})
ResponseDto
<
List
<
CandyCouponPreviewVo
>>
couponListById
(
@RequestParam
(
"couponIds"
)
@NotNull
@NotBlank
String
couponIds
);
}
\ No newline at end of file
liquidnet-bus-feign/liquidnet-api-feign-sweet/src/main/java/com/liquidnet/service/feign/sweet/task/FeignSweetTaskClient.java
View file @
b244d600
...
@@ -4,17 +4,20 @@ import com.liquidnet.service.base.ResponseDto;
...
@@ -4,17 +4,20 @@ import com.liquidnet.service.base.ResponseDto;
import
feign.hystrix.FallbackFactory
;
import
feign.hystrix.FallbackFactory
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
@Component
@Component
@FeignClient
(
name
=
"liquidnet-service-sweet"
,
@FeignClient
(
name
=
"liquidnet-service-sweet"
,
contextId
=
"FeignSweetTaskClient"
,
path
=
""
,
contextId
=
"FeignSweetTaskClient"
,
path
=
"
sweet
"
,
url
=
"${liquidnet.service.sweet.url}"
,
url
=
"${liquidnet.service.sweet.url}"
,
// url = "",
fallback
=
FallbackFactory
.
Default
.
class
)
fallback
=
FallbackFactory
.
Default
.
class
)
public
interface
FeignSweetTaskClient
{
public
interface
FeignSweetTaskClient
{
@PostMapping
(
"sweet
/sweet
Data/drawLuck/add"
)
@PostMapping
(
"sweetData/drawLuck/add"
)
ResponseDto
<
Boolean
>
drawLuckAdd
();
ResponseDto
<
Boolean
>
drawLuckAdd
();
@GetMapping
(
"integralActivity/setDrawAllList"
)
ResponseDto
<
Boolean
>
setDrawAllList
(
@RequestParam
(
"integralActivityId"
)
String
integralActivityId
);
}
}
liquidnet-bus-feign/pom.xml
View file @
b244d600
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
<module>
liquidnet-api-feign-sweet
</module>
<module>
liquidnet-api-feign-sweet
</module>
<module>
liquidnet-api-feign-chime
</module>
<module>
liquidnet-api-feign-chime
</module>
<module>
liquidnet-api-feign-stone
</module>
<module>
liquidnet-api-feign-stone
</module>
<module>
liquidnet-api-feign-candy
</module>
<!-- <module>liquidnet-api-feign-sequence</module>-->
<!-- <module>liquidnet-api-feign-sequence</module>-->
<!-- <module>liquidnet-api-feign-example</module>-->
<!-- <module>liquidnet-api-feign-example</module>-->
<!-- <module>liquidnet-api-feign-account</module>-->
<!-- <module>liquidnet-api-feign-account</module>-->
...
...
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/docu/db_ln_candy_initialdata.sql
View file @
b244d600
...
@@ -10,7 +10,7 @@ create table candy_mgt_coupon
...
@@ -10,7 +10,7 @@ create table candy_mgt_coupon
coupon_id
varchar
(
64
)
not
null
comment
'~candy_coupon.coupon_id'
,
coupon_id
varchar
(
64
)
not
null
comment
'~candy_coupon.coupon_id'
,
state
tinyint
comment
'发放状态[0-未发放|1-已发放|2-无效|3-已取消|9-发放中|10-会员礼包初始模版]'
,
state
tinyint
comment
'发放状态[0-未发放|1-已发放|2-无效|3-已取消|9-发放中|10-会员礼包初始模版]'
,
#
bind_type
smallint
comment
'领取方式[0-用户输入兑换|1-发放至用户|2-积分
兑换
]'
,
#
bind_type
smallint
comment
'领取方式[0-用户输入兑换|1-发放至用户|2-积分
商品
]'
,
event_amt
int
comment
'发放量'
,
event_amt
int
comment
'发放量'
,
event_type
tinyint
comment
'发放类型[0-保留|1-会员|2-手机号|10-全体用户]'
,
event_type
tinyint
comment
'发放类型[0-保留|1-会员|2-手机号|10-全体用户]'
,
event_limit
text
comment
'`发放类型`为2-手机号时发放手机号以,分隔'
,
event_limit
text
comment
'`发放类型`为2-手机号时发放手机号以,分隔'
,
...
@@ -39,7 +39,7 @@ create table candy_coupon
...
@@ -39,7 +39,7 @@ create table candy_coupon
exclusive
smallint
comment
'专享标识[0-常规|1-会员礼包]'
,
exclusive
smallint
comment
'专享标识[0-常规|1-会员礼包]'
,
busi_type
smallint
comment
'业务类别[0-全场|1-演出|2-商品|3-优先购]'
,
busi_type
smallint
comment
'业务类别[0-全场|1-演出|2-商品|3-优先购]'
,
cou_type
smallint
comment
'券类型[1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]'
,
cou_type
smallint
comment
'券类型[1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]'
,
bind_type
smallint
comment
'领取方式[0-用户输入兑换|1-发放至用户|2-积分
兑换
|3-发放需领取|4-会员专属]'
,
bind_type
smallint
comment
'领取方式[0-用户输入兑换|1-发放至用户|2-积分
商品
|3-发放需领取|4-会员专属]'
,
discount
decimal
(
8
,
2
)
comment
'折扣[8折即0.8]'
,
discount
decimal
(
8
,
2
)
comment
'折扣[8折即0.8]'
,
val_face
decimal
(
8
,
2
)
comment
'面值'
,
val_face
decimal
(
8
,
2
)
comment
'面值'
,
...
@@ -162,7 +162,8 @@ alter table candy_mgt_coupon add exclusively smallint default 0 null comment '
...
@@ -162,7 +162,8 @@ alter table candy_mgt_coupon add exclusively smallint default 0 null comment '
alter
table
candy_user_coupon
add
exclusive
smallint
null
comment
'专享标识[0-常规|1-会员礼包]'
after
coupon_id
;
alter
table
candy_user_coupon
add
exclusive
smallint
null
comment
'专享标识[0-常规|1-会员礼包]'
after
coupon_id
;
alter
table
candy_common_coupon
add
exclusive
smallint
null
comment
'专享标识[0-常规|1-会员礼包]'
after
coupon_id
;
alter
table
candy_common_coupon
add
exclusive
smallint
null
comment
'专享标识[0-常规|1-会员礼包]'
after
coupon_id
;
-- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------|20211208券发放任务表+区分后台人为创建与系统创建标识字段
alter
table
candy_mgt_coupon
add
event_driven
tinyint
default
0
null
comment
'任务驱动[0-系统自动,1-人为创建]'
after
event_at
;
-- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------
...
...
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/controller/CandyRscController.java
View file @
b244d600
...
@@ -2,8 +2,10 @@ package com.liquidnet.service.candy.controller;
...
@@ -2,8 +2,10 @@ package com.liquidnet.service.candy.controller;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.candy.dto.CandyCouponInfoDto
;
import
com.liquidnet.service.candy.dto.CandyCouponInfoDto
;
import
com.liquidnet.service.candy.util.ObjectUtil
;
import
com.liquidnet.service.candy.util.RedisDataUtils
;
import
com.liquidnet.service.candy.util.RedisDataUtils
;
import
com.liquidnet.service.candy.vo.CandyCouponBasicVo
;
import
com.liquidnet.service.candy.vo.CandyCouponBasicVo
;
import
com.liquidnet.service.candy.vo.CandyCouponPreviewVo
;
import
com.liquidnet.service.candy.vo.CandyCouponVo
;
import
com.liquidnet.service.candy.vo.CandyCouponVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
...
@@ -19,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -19,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
@Api
(
tags
=
"@API:RSC"
)
@Api
(
tags
=
"@API:RSC"
)
...
@@ -32,12 +35,21 @@ public class CandyRscController {
...
@@ -32,12 +35,21 @@ public class CandyRscController {
@PostMapping
(
"couinfo"
)
@PostMapping
(
"couinfo"
)
@ApiOperation
(
"券基础详情"
)
@ApiOperation
(
"券基础详情"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"couponId
"
,
value
=
"券ID
"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"couponId
s"
,
value
=
"券ID,多个以,分割
"
,
required
=
true
),
})
})
public
ResponseDto
<
CandyCouponBasicVo
>
couponListById
(
@RequestParam
(
"couponId"
)
@NotNull
@NotBlank
String
couponId
)
{
public
ResponseDto
<
List
<
CandyCouponPreviewVo
>>
couponListById
(
@RequestParam
(
"couponIds"
)
@NotNull
@NotBlank
String
couponIds
)
{
CandyCouponBasicVo
couponBasicVo
=
CandyCouponBasicVo
.
getNew
();
String
[]
couponIdArr
=
couponIds
.
split
(
","
);
CandyCouponInfoDto
couponInfoDto
=
redisDataUtils
.
getCouponInfo
(
couponId
);
ArrayList
<
CandyCouponPreviewVo
>
vos
=
ObjectUtil
.
getCandyCouponPreviewVoArrayList
();
BeanUtils
.
copyProperties
(
couponInfoDto
,
couponBasicVo
);
for
(
String
couponId
:
couponIdArr
)
{
return
ResponseDto
.
success
(
couponBasicVo
);
CandyCouponPreviewVo
couponBasicVo
=
CandyCouponPreviewVo
.
getNew
();
CandyCouponInfoDto
couponInfoDto
=
redisDataUtils
.
getCouponInfo
(
couponId
);
if
(
null
==
couponInfoDto
)
continue
;
BeanUtils
.
copyProperties
(
couponInfoDto
,
couponBasicVo
);
vos
.
add
(
couponBasicVo
);
}
return
ResponseDto
.
success
(
vos
);
}
}
}
}
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/util/ObjectUtil.java
View file @
b244d600
...
@@ -2,11 +2,10 @@ package com.liquidnet.service.candy.util;
...
@@ -2,11 +2,10 @@ package com.liquidnet.service.candy.util;
import
com.liquidnet.service.candy.dto.CandyCommonCouponBasicDto
;
import
com.liquidnet.service.candy.dto.CandyCommonCouponBasicDto
;
import
com.liquidnet.service.candy.dto.CandyUserCouponBasicDto
;
import
com.liquidnet.service.candy.dto.CandyUserCouponBasicDto
;
import
com.liquidnet.service.candy.vo.CandyCouponPreVo
;
import
com.liquidnet.service.candy.vo.*
;
import
com.liquidnet.service.candy.vo.CandyCouponRulesVo
;
import
com.liquidnet.service.candy.vo.CandyCouponVo
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
ObjectUtil
{
public
class
ObjectUtil
{
private
static
final
ArrayList
<
CandyUserCouponBasicDto
>
candyUserCouponBasicDtoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
CandyUserCouponBasicDto
>
candyUserCouponBasicDtoArrayList
=
new
ArrayList
<>();
...
@@ -14,6 +13,8 @@ public class ObjectUtil {
...
@@ -14,6 +13,8 @@ public class ObjectUtil {
private
static
final
ArrayList
<
CandyCouponVo
>
candyCouponVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
CandyCouponVo
>
candyCouponVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
CandyCouponPreVo
>
candyCouponPreVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
CandyCouponPreVo
>
candyCouponPreVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
CandyCouponRulesVo
>
candyCouponRulesVos
=
new
ArrayList
<>();
private
static
final
ArrayList
<
CandyCouponRulesVo
>
candyCouponRulesVos
=
new
ArrayList
<>();
private
static
final
ArrayList
<
CandyCouponBasicVo
>
candyCouponBasicVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
CandyCouponPreviewVo
>
candyCouponPreviewVoArrayList
=
new
ArrayList
<>();
public
static
ArrayList
<
CandyUserCouponBasicDto
>
getCandyUserCouponBasicDtoArrayList
()
{
public
static
ArrayList
<
CandyUserCouponBasicDto
>
getCandyUserCouponBasicDtoArrayList
()
{
return
(
ArrayList
<
CandyUserCouponBasicDto
>)
candyUserCouponBasicDtoArrayList
.
clone
();
return
(
ArrayList
<
CandyUserCouponBasicDto
>)
candyUserCouponBasicDtoArrayList
.
clone
();
...
@@ -34,4 +35,12 @@ public class ObjectUtil {
...
@@ -34,4 +35,12 @@ public class ObjectUtil {
public
static
ArrayList
<
CandyCouponRulesVo
>
getCandyCouponRulesVos
()
{
public
static
ArrayList
<
CandyCouponRulesVo
>
getCandyCouponRulesVos
()
{
return
(
ArrayList
<
CandyCouponRulesVo
>)
candyCouponRulesVos
.
clone
();
return
(
ArrayList
<
CandyCouponRulesVo
>)
candyCouponRulesVos
.
clone
();
}
}
public
static
ArrayList
<
CandyCouponBasicVo
>
getCandyCouponBasicVoArrayList
()
{
return
(
ArrayList
<
CandyCouponBasicVo
>)
candyCouponBasicVoArrayList
.
clone
();
}
public
static
ArrayList
<
CandyCouponPreviewVo
>
getCandyCouponPreviewVoArrayList
()
{
return
(
ArrayList
<
CandyCouponPreviewVo
>)
candyCouponPreviewVoArrayList
.
clone
();
}
}
}
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-sweet/pom.xml
View file @
b244d600
...
@@ -36,6 +36,11 @@
...
@@ -36,6 +36,11 @@
<artifactId>
liquidnet-service-sweet-do
</artifactId>
<artifactId>
liquidnet-service-sweet-do
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.liquidnet
</groupId>
<artifactId>
liquidnet-api-feign-stone
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-sweet/src/main/java/com/liquidnet/service/ServiceConsumerSweetApplication.java
View file @
b244d600
...
@@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.core.env.Environment
;
import
org.springframework.core.env.Environment
;
import
java.net.InetAddress
;
import
java.net.InetAddress
;
...
@@ -15,6 +16,7 @@ import java.util.Arrays;
...
@@ -15,6 +16,7 @@ import java.util.Arrays;
@Slf4j
@Slf4j
@SpringBootApplication
(
scanBasePackages
=
{
"com.liquidnet"
})
@SpringBootApplication
(
scanBasePackages
=
{
"com.liquidnet"
})
@MapperScan
(
basePackages
=
{
"com.liquidnet.service.sweet.mapper"
})
@MapperScan
(
basePackages
=
{
"com.liquidnet.service.sweet.mapper"
})
@EnableFeignClients
public
class
ServiceConsumerSweetApplication
implements
CommandLineRunner
{
public
class
ServiceConsumerSweetApplication
implements
CommandLineRunner
{
@Autowired
@Autowired
private
Environment
environment
;
private
Environment
environment
;
...
...
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-sweet/src/main/java/com/liquidnet/service/consumer/sweet/config/ConsumerSweet
TemplateMsg
StreamConfig.java
→
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-sweet/src/main/java/com/liquidnet/service/consumer/sweet/config/ConsumerSweet
OtherApi
StreamConfig.java
View file @
b244d600
package
com
.
liquidnet
.
service
.
consumer
.
sweet
.
config
;
package
com
.
liquidnet
.
service
.
consumer
.
sweet
.
config
;
import
com.liquidnet.service.consumer.sweet.receiver.ConsumerSweetStoneIntegralReceiver
;
import
com.liquidnet.service.consumer.sweet.receiver.ConsumerSweetTemplateMsgReceiver
;
import
com.liquidnet.service.consumer.sweet.receiver.ConsumerSweetTemplateMsgReceiver
;
import
lombok.var
;
import
lombok.var
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -16,11 +17,14 @@ import org.springframework.data.redis.stream.Subscription;
...
@@ -16,11 +17,14 @@ import org.springframework.data.redis.stream.Subscription;
import
java.time.Duration
;
import
java.time.Duration
;
import
static
com
.
liquidnet
.
service
.
base
.
constant
.
MQConst
.
SweetQueue
.
SWEET_TEMPLATE_MSG
;
import
static
com
.
liquidnet
.
service
.
base
.
constant
.
MQConst
.
SweetQueue
.
SWEET_TEMPLATE_MSG
;
import
static
com
.
liquidnet
.
service
.
base
.
constant
.
MQConst
.
SweetQueue
.
SWEET_STONE_INTEGRAL
;
@Configuration
@Configuration
public
class
ConsumerSweet
TemplateMsg
StreamConfig
{
public
class
ConsumerSweet
OtherApi
StreamConfig
{
@Autowired
@Autowired
ConsumerSweetTemplateMsgReceiver
consumerSweetTemplateMsgReceiver
;
ConsumerSweetTemplateMsgReceiver
consumerSweetTemplateMsgReceiver
;
@Autowired
ConsumerSweetStoneIntegralReceiver
consumerSweetStoneIntegralReceiver
;
private
StreamMessageListenerContainer
<
String
,
MapRecord
<
String
,
String
,
String
>>
buildStreamMessageListenerContainer
(
RedisConnectionFactory
factory
)
{
private
StreamMessageListenerContainer
<
String
,
MapRecord
<
String
,
String
,
String
>>
buildStreamMessageListenerContainer
(
RedisConnectionFactory
factory
)
{
var
options
=
StreamMessageListenerContainer
var
options
=
StreamMessageListenerContainer
...
@@ -32,46 +36,73 @@ public class ConsumerSweetTemplateMsgStreamConfig {
...
@@ -32,46 +36,73 @@ public class ConsumerSweetTemplateMsgStreamConfig {
}
}
/**
/**
* 缺票登记
* 模版消息
*
* @param listenerContainer
* @param t
* @return
*/
*/
private
Subscription
receive
Sql
TemplateMsg
(
StreamMessageListenerContainer
<
String
,
MapRecord
<
String
,
String
,
String
>>
listenerContainer
,
int
t
)
{
private
Subscription
receive
Api
TemplateMsg
(
StreamMessageListenerContainer
<
String
,
MapRecord
<
String
,
String
,
String
>>
listenerContainer
,
int
t
)
{
return
listenerContainer
.
receiveAutoAck
(
return
listenerContainer
.
receiveAutoAck
(
Consumer
.
from
(
SWEET_TEMPLATE_MSG
.
getGroup
(),
SWEET_TEMPLATE_MSG
.
name
()
+
t
),
Consumer
.
from
(
SWEET_TEMPLATE_MSG
.
getGroup
(),
SWEET_TEMPLATE_MSG
.
name
()
+
t
),
StreamOffset
.
create
(
SWEET_TEMPLATE_MSG
.
getKey
(),
ReadOffset
.
lastConsumed
()),
consumerSweetTemplateMsgReceiver
StreamOffset
.
create
(
SWEET_TEMPLATE_MSG
.
getKey
(),
ReadOffset
.
lastConsumed
()),
consumerSweetTemplateMsgReceiver
);
);
}
}
/**
* 增减积分
*/
private
Subscription
receiveApiStoneIntgral
(
StreamMessageListenerContainer
<
String
,
MapRecord
<
String
,
String
,
String
>>
listenerContainer
,
int
t
)
{
return
listenerContainer
.
receiveAutoAck
(
Consumer
.
from
(
SWEET_STONE_INTEGRAL
.
getGroup
(),
SWEET_STONE_INTEGRAL
.
name
()
+
t
),
StreamOffset
.
create
(
SWEET_STONE_INTEGRAL
.
getKey
(),
ReadOffset
.
lastConsumed
()),
consumerSweetStoneIntegralReceiver
);
}
/* —————————————————————————— | —————————————————————————— | —————————————————————————— */
/*----------------------------------------------------------------------------------------------------------------*/
/*------------------模版消息------------------*/
@Bean
public
Subscription
subscriptionApiTemplateMsg
(
RedisConnectionFactory
factory
)
{
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
subscription
=
receiveApiTemplateMsg
(
listenerContainer
,
1
);
listenerContainer
.
start
();
return
subscription
;
}
/* -------------------------------------------------------- | 缺票登记 */
@Bean
public
Subscription
subscriptionApiTemplateMsg2
(
RedisConnectionFactory
factory
)
{
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
subscription
=
receiveApiTemplateMsg
(
listenerContainer
,
1
);
listenerContainer
.
start
();
return
subscription
;
}
@Bean
@Bean
public
Subscription
subscription
SqlTemplateMsg
(
RedisConnectionFactory
factory
)
{
public
Subscription
subscription
ApiTemplateMsg3
(
RedisConnectionFactory
factory
)
{
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
subscription
=
receive
Sql
TemplateMsg
(
listenerContainer
,
1
);
var
subscription
=
receive
Api
TemplateMsg
(
listenerContainer
,
1
);
listenerContainer
.
start
();
listenerContainer
.
start
();
return
subscription
;
return
subscription
;
}
}
/*------------------增减积分------------------*/
@Bean
@Bean
public
Subscription
subscription
SqlTemplateMsg2
(
RedisConnectionFactory
factory
)
{
public
Subscription
subscription
ApiStoneIntgral
(
RedisConnectionFactory
factory
)
{
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
subscription
=
receive
SqlTemplateMsg
(
listenerContainer
,
1
);
var
subscription
=
receive
ApiStoneIntgral
(
listenerContainer
,
1
);
listenerContainer
.
start
();
listenerContainer
.
start
();
return
subscription
;
return
subscription
;
}
}
@Bean
@Bean
public
Subscription
subscription
SqlTemplateMsg3
(
RedisConnectionFactory
factory
)
{
public
Subscription
subscription
ApiStoneIntgral2
(
RedisConnectionFactory
factory
)
{
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
subscription
=
receive
SqlTemplateMsg
(
listenerContainer
,
1
);
var
subscription
=
receive
ApiStoneIntgral
(
listenerContainer
,
1
);
listenerContainer
.
start
();
listenerContainer
.
start
();
return
subscription
;
return
subscription
;
}
}
/* -------------------------------------------------------- | */
@Bean
public
Subscription
subscriptionApiStoneIntgral3
(
RedisConnectionFactory
factory
)
{
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
subscription
=
receiveApiStoneIntgral
(
listenerContainer
,
1
);
listenerContainer
.
start
();
return
subscription
;
}
}
}
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-sweet/src/main/java/com/liquidnet/service/consumer/sweet/receiver/ConsumerSweetStoneIntegralReceiver.java
0 → 100644
View file @
b244d600
package
com
.
liquidnet
.
service
.
consumer
.
sweet
.
receiver
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.feign.stone.api.FeignStoneIntegralClient
;
import
com.liquidnet.service.sweet.param.SweetStoneIntegralParam
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.connection.stream.MapRecord
;
import
org.springframework.data.redis.connection.stream.StreamRecords
;
import
org.springframework.stereotype.Component
;
import
java.util.HashMap
;
@Slf4j
@Component
public
class
ConsumerSweetStoneIntegralReceiver
extends
AbstractSqlRedisReceiver
{
@Autowired
private
FeignStoneIntegralClient
feignStoneIntegralClient
;
@Override
protected
String
getRedisStreamKey
()
{
return
MQConst
.
SweetQueue
.
SWEET_STONE_INTEGRAL
.
getKey
();
}
@Override
protected
String
getRedisStreamGroup
()
{
return
MQConst
.
SweetQueue
.
SWEET_STONE_INTEGRAL
.
getGroup
();
}
@Override
public
void
onMessage
(
MapRecord
<
String
,
String
,
String
>
message
)
{
log
.
debug
(
"CONSUMER SQL[streamKey:{},messageId:{},stream:{},body:{}]"
,
this
.
getRedisStreamKey
(),
message
.
getId
(),
message
.
getStream
(),
message
.
getValue
());
boolean
result
=
this
.
consumerSqlDaoHandler
(
message
.
getValue
().
get
(
"message"
));
log
.
info
(
"CONSUMER SQL RESULT:{} ==> MESSAGE_ID:{}"
,
result
,
message
.
getId
());
try
{
stringRedisTemplate
.
opsForStream
().
acknowledge
(
getRedisStreamGroup
(),
message
);
stringRedisTemplate
.
opsForStream
().
delete
(
this
.
getRedisStreamKey
(),
message
.
getId
());
}
catch
(
Exception
e
)
{
log
.
error
(
"#CONSUMER SQL RESULT:{} ==> DEL_REDIS_QUEUE_MSG_EXCEPTION[MESSAGE_ID:{},MSG:{}]"
,
result
,
message
.
getId
(),
JsonUtils
.
toJson
(
message
),
e
);
}
finally
{
try
{
stringRedisTemplate
.
opsForStream
().
acknowledge
(
getRedisStreamGroup
(),
message
);
stringRedisTemplate
.
opsForStream
().
delete
(
this
.
getRedisStreamKey
(),
message
.
getId
());
}
catch
(
Exception
ignored
)
{
}
}
}
private
boolean
consumerSqlDaoHandler
(
String
msg
)
{
Boolean
aBoolean
=
false
;
try
{
SweetStoneIntegralParam
param
=
JsonUtils
.
fromJson
(
msg
,
SweetStoneIntegralParam
.
class
);
if
(
param
==
null
)
{
aBoolean
=
true
;
}
else
{
ResponseDto
<
String
>
res
=
null
;
if
(
null
==
param
.
getType
())
{
aBoolean
=
true
;
return
true
;
}
if
(
param
.
getType
()
==
1
)
{
res
=
feignStoneIntegralClient
.
in2111
(
param
.
getUid
(),
param
.
getScore
(),
param
.
getContent
()
);
}
else
if
(
param
.
getType
()
==
2
)
{
res
=
feignStoneIntegralClient
.
de2111
(
param
.
getUid
(),
param
.
getScore
(),
param
.
getContent
()
);
}
if
(
null
!=
res
&&
res
.
getCode
().
equals
(
"0"
))
{
aBoolean
=
true
;
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"CONSUMER SQL FAIL ==> {}"
,
e
.
getMessage
(),
e
);
}
finally
{
if
(!
aBoolean
)
{
HashMap
<
String
,
String
>
map
=
CollectionUtil
.
mapStringString
();
map
.
put
(
"message"
,
msg
);
stringRedisTemplate
.
opsForStream
().
add
(
StreamRecords
.
mapBacked
(
map
).
withStreamKey
(
this
.
getRedisStreamKey
()));
}
}
return
aBoolean
;
}
}
liquidnet-bus-service/liquidnet-service-executor-all/liquidnet-service-executor-main/src/main/java/com/liquidnet/service/executor/main/handler/SweetTaskHandler.java
View file @
b244d600
...
@@ -2,6 +2,7 @@ package com.liquidnet.service.executor.main.handler;
...
@@ -2,6 +2,7 @@ package com.liquidnet.service.executor.main.handler;
import
com.liquidnet.service.feign.sweet.task.FeignSweetTaskClient
;
import
com.liquidnet.service.feign.sweet.task.FeignSweetTaskClient
;
import
com.xxl.job.core.biz.model.ReturnT
;
import
com.xxl.job.core.biz.model.ReturnT
;
import
com.xxl.job.core.context.XxlJobHelper
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -33,4 +34,29 @@ public class SweetTaskHandler {
...
@@ -33,4 +34,29 @@ public class SweetTaskHandler {
return
ReturnT
.
FAIL
;
return
ReturnT
.
FAIL
;
}
}
}
}
@XxlJob
(
value
=
"sev-sweet:setDrawAllList"
)
public
ReturnT
<
String
>
setDrawAllListHandler
()
{
try
{
String
jobParam
=
XxlJobHelper
.
getJobParam
();
//执行参数
log
.
info
(
"jobParam = "
+
jobParam
);
String
[]
paramArray
=
jobParam
.
split
(
","
);
ReturnT
<
String
>
success
=
ReturnT
.
SUCCESS
;
for
(
String
id
:
paramArray
)
{
log
.
info
(
"id = "
+
id
);
Boolean
data
=
feignSweetTaskClient
.
setDrawAllList
(
id
).
getData
();
log
.
info
(
"setDrawAllListHandler:结果:{}"
,
data
);
success
.
setMsg
(
String
.
valueOf
(
data
));
}
return
success
;
}
catch
(
Exception
e
)
{
log
.
error
(
"exception of handler:{}"
,
e
.
getMessage
(),
e
);
ReturnT
<
String
>
fail
=
ReturnT
.
FAIL
;
fail
.
setMsg
(
e
.
getLocalizedMessage
());
return
fail
;
}
}
}
}
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/service/impl/KylinPerformancesServiceImpl.java
View file @
b244d600
...
@@ -266,7 +266,6 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService {
...
@@ -266,7 +266,6 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService {
info
.
put
(
"field_name"
,
performancesInfo
.
getFieldName
());
info
.
put
(
"field_name"
,
performancesInfo
.
getFieldName
());
info
.
put
(
"title"
,
performancesInfo
.
getTitle
());
info
.
put
(
"title"
,
performancesInfo
.
getTitle
());
info
.
put
(
"appStatus"
,
performancesInfo
.
getAppStatus
());
info
.
put
(
"appStatus"
,
performancesInfo
.
getAppStatus
());
info
.
put
(
"buySwitch"
,
dataUtils
.
getSwitch
());
HashMap
<
String
,
Object
>
result
=
CollectionUtil
.
mapStringObject
();
HashMap
<
String
,
Object
>
result
=
CollectionUtil
.
mapStringObject
();
result
.
put
(
"performancesInfo"
,
info
);
result
.
put
(
"performancesInfo"
,
info
);
...
...
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/utils/DataUtils.java
View file @
b244d600
...
@@ -572,11 +572,6 @@ public class DataUtils {
...
@@ -572,11 +572,6 @@ public class DataUtils {
}
}
}
}
public
Integer
getSwitch
()
{
Integer
i
=
(
Integer
)
redisUtil
.
get
(
AdamRedisConst
.
SWITCH_BUY_MEMBER
);
return
null
==
i
?
1
:
i
;
}
/**
/**
* 演出订单快递路由
* 演出订单快递路由
*/
*/
...
...
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/candy/PlatformCandyCouponService.java
View file @
b244d600
...
@@ -11,14 +11,16 @@ import com.liquidnet.service.adam.constant.AdamRedisConst;
...
@@ -11,14 +11,16 @@ import com.liquidnet.service.adam.constant.AdamRedisConst;
import
com.liquidnet.service.adam.dto.vo.AdamUserMemberVo
;
import
com.liquidnet.service.adam.dto.vo.AdamUserMemberVo
;
import
com.liquidnet.service.adam.entity.AdamUserMember
;
import
com.liquidnet.service.adam.entity.AdamUserMember
;
import
com.liquidnet.service.candy.constant.CandyRedisConst
;
import
com.liquidnet.service.candy.constant.CandyRedisConst
;
import
com.liquidnet.service.candy.dto.*
;
import
com.liquidnet.service.candy.dto.CandyCommonCouponBasicDto
;
import
com.liquidnet.service.candy.dto.CandyCouponCodeDto
;
import
com.liquidnet.service.candy.dto.CandyCouponRuleDto
;
import
com.liquidnet.service.candy.dto.CandyUserCouponBasicDto
;
import
com.liquidnet.service.candy.entity.*
;
import
com.liquidnet.service.candy.entity.*
;
import
com.liquidnet.service.candy.mapper.CandyCouponMapper
;
import
com.liquidnet.service.candy.mapper.CandyCouponMapper
;
import
com.liquidnet.service.platform.service.impl.adam.PlatformAdamUserMemberService
;
import
com.liquidnet.service.platform.service.impl.adam.PlatformAdamUserMemberService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.RandomStringUtils
;
import
org.apache.commons.lang3.RandomStringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
...
@@ -48,14 +50,15 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
...
@@ -48,14 +50,15 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
private
void
issueCouponProcessing
(
final
CandyMgtCoupon
mgtCoupon
,
final
CandyCoupon
coupon
)
{
private
void
issueCouponProcessing
(
final
CandyMgtCoupon
mgtCoupon
,
final
CandyCoupon
coupon
)
{
List
<
CandyCouponRuleDto
>
couponRuleDtoList
=
platformCandyCouponRuleService
.
listForCouponRuleDto
(
coupon
.
getCouponId
());
List
<
CandyCouponRuleDto
>
couponRuleDtoList
=
platformCandyCouponRuleService
.
listForCouponRuleDto
(
coupon
.
getCouponId
());
CandyCouponInfoDto
couponInfoDto
=
new
CandyCouponInfoDto
();
// 后台创建券时,同步至REDIS,这里不再同步
BeanUtils
.
copyProperties
(
coupon
,
couponInfoDto
);
// CandyCouponInfoDto couponInfoDto = new CandyCouponInfoDto();
couponInfoDto
.
setUseRules
(
couponRuleDtoList
);
// BeanUtils.copyProperties(coupon, couponInfoDto);
// couponInfoDto.setUseRules(couponRuleDtoList);
//
// String couponInfoDtoKey = CandyRedisConst.BASIC_COUPON_INFO.concat(couponInfoDto.getCouponId());
// redisDataSourceUtil.getRedisCandyUtil().set(couponInfoDtoKey, couponInfoDto);
String
couponInfoDtoKey
=
CandyRedisConst
.
BASIC_COUPON_INFO
.
concat
(
couponInfoDto
.
getCouponId
());
switch
(
coupon
.
getBindType
())
{
// 领取方式[0-用户输入兑换|1-发放至用户|2-积分商品|3-发放需领取|4-会员专属]
redisDataSourceUtil
.
getRedisCandyUtil
().
set
(
couponInfoDtoKey
,
couponInfoDto
);
switch
(
coupon
.
getBindType
())
{
// 领取方式[0-用户输入兑换|1-发放至用户|2-积分兑换|3-发放需领取|4-会员专属]
case
0
:
case
0
:
this
.
processingCouponCode
(
mgtCoupon
,
coupon
);
this
.
processingCouponCode
(
mgtCoupon
,
coupon
);
break
;
break
;
...
@@ -75,9 +78,9 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
...
@@ -75,9 +78,9 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
// break;
// break;
// }
// }
// break;
// break;
case
3
:
// 新增券领取类型(3-发放需领取)处理逻辑同(1-发放至用户|2-积分
兑换
)
case
3
:
// 新增券领取类型(3-发放需领取)处理逻辑同(1-发放至用户|2-积分
商品
)
case
4
:
// 新增券领取类型(4-会员专属)处理逻辑同(1-发放至用户|2-积分
兑换
)
case
4
:
// 新增券领取类型(4-会员专属)处理逻辑同(1-发放至用户|2-积分
商品
)
case
2
:
// TODO: 2021/11/9 PM上线前临时加的券领取类型(2-积分
兑换),这里`1-发放至用户|2-积分兑换
`做同逻辑处理
case
2
:
// TODO: 2021/11/9 PM上线前临时加的券领取类型(2-积分
商品),这里`1-发放至用户|2-积分商品
`做同逻辑处理
switch
(
mgtCoupon
.
getEventType
())
{
// 发放类型[1-会员|2-手机号|10-全体用户]
switch
(
mgtCoupon
.
getEventType
())
{
// 发放类型[1-会员|2-手机号|10-全体用户]
case
1
:
case
1
:
this
.
processForAllMember
(
mgtCoupon
,
coupon
,
couponRuleDtoList
);
this
.
processForAllMember
(
mgtCoupon
,
coupon
,
couponRuleDtoList
);
...
@@ -154,18 +157,19 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
...
@@ -154,18 +157,19 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
List
<
CandyCommonCoupon
>
initCommonCouponList
=
new
ArrayList
<>();
List
<
CandyCommonCoupon
>
initCommonCouponList
=
new
ArrayList
<>();
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
now
=
LocalDateTime
.
now
();
String
mcouponId
=
mgtCoupon
.
getMcouponId
();
Integer
eventAmt
=
mgtCoupon
.
getEventAmt
();
Integer
eventAmt
=
mgtCoupon
.
getEventAmt
();
log
.
info
(
"发放券处理中:
目标全体用户[发放量:{}]"
,
eventAmt
);
log
.
info
(
"发放券处理中:
{}-目标全体用户[发放量:{}]"
,
mcouponId
,
eventAmt
);
for
(
int
i
=
0
;
i
<
eventAmt
;
i
++)
{
for
(
int
i
=
0
;
i
<
eventAmt
;
i
++)
{
CandyCommonCoupon
commonCoupon
=
new
CandyCommonCoupon
();
CandyCommonCoupon
commonCoupon
=
new
CandyCommonCoupon
();
commonCoupon
.
setCcouponId
(
IDGenerator
.
nextTimeId2
());
commonCoupon
.
setCcouponId
(
IDGenerator
.
nextTimeId2
());
commonCoupon
.
setMcouponId
(
m
gtCoupon
.
getMcouponId
()
);
commonCoupon
.
setMcouponId
(
m
couponId
);
commonCoupon
.
setCouponId
(
coupon
.
getCouponId
());
commonCoupon
.
setCouponId
(
coupon
.
getCouponId
());
commonCoupon
.
setExclusive
(
mgtCoupon
.
getExclusively
());
commonCoupon
.
setExclusive
(
mgtCoupon
.
getExclusively
());
commonCoupon
.
setState
(
1
);
commonCoupon
.
setState
(
1
);
commonCoupon
.
setRanged
(
mgtCoupon
.
getEventType
());
commonCoupon
.
setRanged
(
mgtCoupon
.
getEventType
());
commonCoupon
.
setOperator
(
"system"
);
commonCoupon
.
setOperator
(
mgtCoupon
.
getOperator
()
);
commonCoupon
.
setCreatedAt
(
now
);
commonCoupon
.
setCreatedAt
(
now
);
initCommonCouponList
.
add
(
commonCoupon
);
initCommonCouponList
.
add
(
commonCoupon
);
...
@@ -186,10 +190,10 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
...
@@ -186,10 +190,10 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
redisCandyUtil
.
set
(
ccKey
,
vos
);
redisCandyUtil
.
set
(
ccKey
,
vos
);
});
});
}
else
{
}
else
{
throw
new
LiquidnetServiceException
(
"-1"
,
String
.
format
(
"券发放失败[mcouponId=%s]"
,
m
gtCoupon
.
getMcouponId
()
));
throw
new
LiquidnetServiceException
(
"-1"
,
String
.
format
(
"券发放失败[mcouponId=%s]"
,
m
couponId
));
}
}
}
}
log
.
info
(
"发放券处理中:
目标全体用户[发放量:{},实际发放:{}]"
,
eventAmt
,
initCommonCouponList
.
size
());
log
.
info
(
"发放券处理中:
{}-目标全体用户[发放量:{},实际发放:{}]"
,
mcouponId
,
eventAmt
,
initCommonCouponList
.
size
());
}
}
/**
/**
...
@@ -204,13 +208,19 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
...
@@ -204,13 +208,19 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
private
void
processForAllMember
(
CandyMgtCoupon
mgtCoupon
,
CandyCoupon
coupon
,
List
<
CandyCouponRuleDto
>
couponRuleDtoList
)
{
private
void
processForAllMember
(
CandyMgtCoupon
mgtCoupon
,
CandyCoupon
coupon
,
List
<
CandyCouponRuleDto
>
couponRuleDtoList
)
{
List
<
CandyUserCoupon
>
initUserCouponList
=
new
ArrayList
<>();
List
<
CandyUserCoupon
>
initUserCouponList
=
new
ArrayList
<>();
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
nowEndTime
=
now
.
withHour
(
23
).
withMinute
(
59
).
withSecond
(
5
9
);
LocalDateTime
nowEndTime
=
now
.
withHour
(
23
).
withMinute
(
59
).
withSecond
(
5
8
);
LambdaQueryWrapper
<
AdamUserMember
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
AdamUserMember
.
class
).
eq
(
AdamUserMember:
:
getState
,
1
)
LambdaQueryWrapper
<
AdamUserMember
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
AdamUserMember
.
class
).
eq
(
AdamUserMember:
:
getState
,
1
)
.
gt
(
AdamUserMember:
:
getExpiryAt
,
nowEndTime
);
.
gt
(
AdamUserMember:
:
getExpiryAt
,
nowEndTime
);
int
userMemberCount
=
platformAdamUserMemberService
.
count
(
queryWrapper
),
num
=
0
,
pSize
=
1000
;
int
userMemberCount
=
platformAdamUserMemberService
.
count
(
queryWrapper
),
num
=
0
,
pSize
=
1000
;
int
totalCount
=
userMemberCount
,
eventAmt
=
mgtCoupon
.
getEventAmt
();
int
totalCount
=
userMemberCount
,
eventAmt
=
mgtCoupon
.
getEventAmt
();
log
.
info
(
"发放券处理中:目标全体会员[总数:{},发放量:{}]"
,
userMemberCount
,
eventAmt
);
log
.
info
(
"发放券处理中:{}-目标全体会员[总数:{},发放量:{}]"
,
mgtCoupon
.
getMcouponId
(),
userMemberCount
,
eventAmt
);
String
mcouponId
=
mgtCoupon
.
getMcouponId
();
String
operator
=
mgtCoupon
.
getOperator
();
String
couponId
=
coupon
.
getCouponId
();
LocalDateTime
couponEffectAt
=
coupon
.
getEffectAt
();
LocalDateTime
couponExpireAt
=
coupon
.
getExpireAt
();
// 会员权益券失效时间duedAt需要同步会员到期时间expiryAt
// 会员权益券失效时间duedAt需要同步会员到期时间expiryAt
Integer
exclusively
=
mgtCoupon
.
getExclusively
();
Integer
exclusively
=
mgtCoupon
.
getExclusively
();
...
@@ -231,18 +241,23 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
...
@@ -231,18 +241,23 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
CandyUserCoupon
userCoupon
=
new
CandyUserCoupon
();
CandyUserCoupon
userCoupon
=
new
CandyUserCoupon
();
userCoupon
.
setUcouponId
(
IDGenerator
.
get32UUID
());
userCoupon
.
setUcouponId
(
IDGenerator
.
get32UUID
());
userCoupon
.
setMcouponId
(
m
gtCoupon
.
getMcouponId
()
);
userCoupon
.
setMcouponId
(
m
couponId
);
userCoupon
.
setUid
(
userMember
.
getUid
());
userCoupon
.
setUid
(
userMember
.
getUid
());
userCoupon
.
setCouponId
(
coupon
.
getCouponId
()
);
userCoupon
.
setCouponId
(
coupon
Id
);
userCoupon
.
setExclusive
(
exclusively
);
userCoupon
.
setExclusive
(
exclusively
);
userCoupon
.
setState
(
1
);
userCoupon
.
setState
(
1
);
userCoupon
.
setBindAt
(
coupon
.
getEffectAt
());
// userCoupon.setBindAt(couponEffectAt);
// userCoupon.setDuedAt(coupon.getExpireAt());
// userCoupon.setDuedAt(couponExpireAt);
userCoupon
.
setBindAt
(
null
==
couponEffectAt
?
now
:
couponEffectAt
);
if
(
isMemberRightsCoupon
)
{
if
(
isMemberRightsCoupon
)
{
userCoupon
.
setDuedAt
(
userMember
.
getExpiryAt
());
userCoupon
.
setDuedAt
(
userMember
.
getExpiryAt
());
}
else
if
(
null
!=
couponExpireAt
&&
couponExpireAt
.
isAfter
(
now
))
{
userCoupon
.
setDuedAt
(
couponExpireAt
);
}
else
{
}
else
{
userCoupon
.
setDuedAt
(
coupon
.
getExpireAt
());
log
.
warn
(
"发放券处理中:{}-目标全体会员,该券生效日期或失效日期无效[couponId:{},effectAt:{},expireAt:{}]"
,
mcouponId
,
couponId
,
couponEffectAt
,
couponExpireAt
);
continue
;
}
}
userCoupon
.
setOperator
(
operator
);
userCoupon
.
setCreatedAt
(
now
);
userCoupon
.
setCreatedAt
(
now
);
initUserCouponList
.
add
(
userCoupon
);
initUserCouponList
.
add
(
userCoupon
);
...
@@ -271,7 +286,7 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
...
@@ -271,7 +286,7 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
num
++;
num
++;
totalCount
-=
pSize
;
totalCount
-=
pSize
;
log
.
info
(
"发放券处理中:
目标全体会员[总数:{},发放量:{},单次处理:{},剩余:{}]"
,
userMemberCount
,
eventAmt
,
lastLimitSql
,
totalCount
);
log
.
info
(
"发放券处理中:
{}-目标全体会员[总数:{},发放量:{},单次处理:{},剩余:{}]"
,
mcouponId
,
userMemberCount
,
eventAmt
,
lastLimitSql
,
totalCount
);
}
}
}
}
...
@@ -291,10 +306,21 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
...
@@ -291,10 +306,21 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
String
eventLimit
=
mgtCoupon
.
getEventLimit
();
String
eventLimit
=
mgtCoupon
.
getEventLimit
();
String
[]
eventLimitArr
=
eventLimit
.
split
(
","
);
String
[]
eventLimitArr
=
eventLimit
.
split
(
","
);
int
eventAmt
=
mgtCoupon
.
getEventAmt
(),
pl
=
0
,
limitSize
=
eventLimitArr
.
length
;
int
eventAmt
=
mgtCoupon
.
getEventAmt
(),
pl
=
0
,
limitSize
=
eventLimitArr
.
length
;
log
.
info
(
"发放券处理中:
目标指定手机号[总数:{},发放量:{}]"
,
limitSize
,
eventAmt
);
log
.
info
(
"发放券处理中:
{}-目标指定手机号[总数:{},发放量:{}]"
,
mgtCoupon
.
getMcouponId
()
,
limitSize
,
eventAmt
);
AbstractRedisUtil
redisAdamUtil
=
redisDataSourceUtil
.
getRedisAdamUtil
();
AbstractRedisUtil
redisAdamUtil
=
redisDataSourceUtil
.
getRedisAdamUtil
();
if
(
coupon
.
getBindType
()
==
2
)
{
// 券领取方式[2-积分商品],实际发放至用户时计算有效期
coupon
.
setEffectAt
(
now
);
coupon
.
setExpireAt
(
coupon
.
getEffectAt
().
plusDays
(
coupon
.
getValidity
()).
withHour
(
23
).
withMinute
(
59
).
withSecond
(
59
));
}
String
mcouponId
=
mgtCoupon
.
getMcouponId
();
String
operator
=
mgtCoupon
.
getOperator
();
String
couponId
=
coupon
.
getCouponId
();
LocalDateTime
couponEffectAt
=
coupon
.
getEffectAt
();
LocalDateTime
couponExpireAt
=
coupon
.
getExpireAt
();
// 指定手机号发放券中,会员权益券失效时间duedAt需要同步会员到期时间expiryAt
// 指定手机号发放券中,会员权益券失效时间duedAt需要同步会员到期时间expiryAt
Integer
exclusively
=
mgtCoupon
.
getExclusively
();
Integer
exclusively
=
mgtCoupon
.
getExclusively
();
boolean
isMemberRightsCoupon
=
exclusively
==
1
;
boolean
isMemberRightsCoupon
=
exclusively
==
1
;
...
@@ -305,19 +331,29 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
...
@@ -305,19 +331,29 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
if
(
StringUtils
.
isNotEmpty
(
uid
))
{
if
(
StringUtils
.
isNotEmpty
(
uid
))
{
CandyUserCoupon
userCoupon
=
new
CandyUserCoupon
();
CandyUserCoupon
userCoupon
=
new
CandyUserCoupon
();
userCoupon
.
setUcouponId
(
IDGenerator
.
get32UUID
());
userCoupon
.
setUcouponId
(
IDGenerator
.
get32UUID
());
userCoupon
.
setMcouponId
(
m
gtCoupon
.
getMcouponId
()
);
userCoupon
.
setMcouponId
(
m
couponId
);
userCoupon
.
setUid
(
uid
);
userCoupon
.
setUid
(
uid
);
userCoupon
.
setCouponId
(
coupon
.
getCouponId
()
);
userCoupon
.
setCouponId
(
coupon
Id
);
userCoupon
.
setExclusive
(
exclusively
);
userCoupon
.
setExclusive
(
exclusively
);
userCoupon
.
setState
(
1
);
userCoupon
.
setState
(
1
);
userCoupon
.
setBindAt
(
coupon
.
getEffectAt
());
// userCoupon.setBindAt(couponEffectAt);
userCoupon
.
setBindAt
(
null
==
couponEffectAt
?
now
:
couponEffectAt
);
if
(
isMemberRightsCoupon
)
{
if
(
isMemberRightsCoupon
)
{
AdamUserMemberVo
vo
=
(
AdamUserMemberVo
)
redisAdamUtil
.
get
(
AdamRedisConst
.
INFO_USER_MEMBER
.
concat
(
uid
));
AdamUserMemberVo
vo
=
(
AdamUserMemberVo
)
redisAdamUtil
.
get
(
AdamRedisConst
.
INFO_USER_MEMBER
.
concat
(
uid
));
userCoupon
.
setDuedAt
(
vo
.
getExpiryAt
());
if
(
null
!=
vo
&&
vo
.
isActive
())
{
userCoupon
.
setDuedAt
(
vo
.
getExpiryAt
());
}
else
{
// 非会员(或无效会员)跳过
log
.
warn
(
"发放券处理中:{}-目标指定手机号,该用户非会员或会员已过期[couponId:{},uid:{}]"
,
mcouponId
,
couponId
,
uid
);
continue
;
}
}
else
if
(
null
!=
couponExpireAt
&&
couponExpireAt
.
isAfter
(
now
))
{
userCoupon
.
setDuedAt
(
couponExpireAt
);
}
else
{
}
else
{
userCoupon
.
setDuedAt
(
coupon
.
getExpireAt
());
log
.
warn
(
"发放券处理中:{}-目标指定手机号,该券生效日期或失效日期无效[couponId:{},effectAt:{},expireAt:{}]"
,
mcouponId
,
couponId
,
couponEffectAt
,
couponExpireAt
);
continue
;
}
}
userCoupon
.
setOperator
(
operator
);
userCoupon
.
setCreatedAt
(
now
);
userCoupon
.
setCreatedAt
(
now
);
initUserCouponList
.
add
(
userCoupon
);
initUserCouponList
.
add
(
userCoupon
);
...
@@ -343,10 +379,10 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
...
@@ -343,10 +379,10 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
redisCandyUtil
.
set
(
uckey
,
vos
);
redisCandyUtil
.
set
(
uckey
,
vos
);
});
});
}
else
{
}
else
{
throw
new
LiquidnetServiceException
(
"-1"
,
String
.
format
(
"券发放失败[mcouponId=%s]"
,
m
gtCoupon
.
getMcouponId
()
));
throw
new
LiquidnetServiceException
(
"-1"
,
String
.
format
(
"券发放失败[mcouponId=%s]"
,
m
couponId
));
}
}
}
}
log
.
info
(
"发放券处理中:
目标指定手机号[总数:{},发放量:{},实际处理:{}]"
,
limitSize
,
eventAmt
,
pl
);
log
.
info
(
"发放券处理中:
{}-目标指定手机号[总数:{},发放量:{},实际处理:{}]"
,
mcouponId
,
limitSize
,
eventAmt
,
pl
);
}
}
/**
/**
...
...
liquidnet-bus-service/liquidnet-service-sweet/docu/db_sweet_integral_activity_20211020.sql
View file @
b244d600
...
@@ -2,20 +2,22 @@
...
@@ -2,20 +2,22 @@
drop
TABLE
if
exists
`sweet_integral_activity`
;
drop
TABLE
if
exists
`sweet_integral_activity`
;
CREATE
TABLE
`sweet_integral_activity`
CREATE
TABLE
`sweet_integral_activity`
(
(
`mid`
bigint
unsigned
NOT
NULL
AUTO_INCREMENT
,
`mid`
bigint
unsigned
NOT
NULL
AUTO_INCREMENT
,
`integral_activity_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'活动id'
,
`integral_activity_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'活动id'
,
`activity_title`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'活动名称'
,
`activity_title`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'活动名称'
,
`activity_img`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'活动图片'
,
`activity_img`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'活动图片'
,
`activity_type`
tinyint
NOT
NULL
DEFAULT
0
COMMENT
'活动类型 1转盘'
,
`activity_type`
tinyint
NOT
NULL
DEFAULT
0
COMMENT
'活动类型 1转盘'
,
`activity_num`
int
NOT
NULL
DEFAULT
0
COMMENT
'活动玩一次所需积分'
,
`activity_num`
int
NOT
NULL
DEFAULT
0
COMMENT
'活动玩一次所需积分'
,
`time_type`
tinyint
NOT
NULL
DEFAULT
0
COMMENT
'活动时间类型 1长期 2开始结束时间'
,
`estimated_num`
int
NOT
NULL
DEFAULT
0
COMMENT
'预估玩此活动的总人数'
,
`start_time`
datetime
NULL
DEFAULT
NULL
COMMENT
'如果活动有时间限制 开始时间'
,
`time_type`
tinyint
NOT
NULL
DEFAULT
0
COMMENT
'活动时间类型 1长期 2开始结束时间'
,
`end_time`
datetime
NULL
DEFAULT
NULL
COMMENT
'如果活动有时间限制 结束时间'
,
`start_time`
datetime
NULL
DEFAULT
NULL
COMMENT
'如果活动有时间限制 开始时间'
,
`express_fee_type`
tinyint
NOT
NULL
DEFAULT
0
COMMENT
'快递费用类型 1包邮 2到付'
,
`end_time`
datetime
NULL
DEFAULT
NULL
COMMENT
'如果活动有时间限制 结束时间'
,
`activity_rules`
text
NULL
DEFAULT
NULL
COMMENT
'活动规则'
,
`express_fee_type`
tinyint
NOT
NULL
DEFAULT
0
COMMENT
'快递费用类型 1包邮 2到付'
,
`is_online`
tinyint
NOT
NULL
DEFAULT
0
COMMENT
'是否上线 1未上线 2已上线'
,
`activity_rules`
text
NULL
DEFAULT
NULL
COMMENT
'活动规则'
,
`created_at`
datetime
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`probability_publicity`
text
NULL
DEFAULT
NULL
COMMENT
'概率公示'
,
`updated_at`
datetime
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'更新时间'
,
`is_online`
tinyint
NOT
NULL
DEFAULT
0
COMMENT
'是否上线 1未上线 2已上线'
,
`created_at`
datetime
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`updated_at`
datetime
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'更新时间'
,
PRIMARY
KEY
(
`mid`
),
PRIMARY
KEY
(
`mid`
),
KEY
`sweet_integral_activity_id`
(
`integral_activity_id`
),
KEY
`sweet_integral_activity_id`
(
`integral_activity_id`
),
KEY
`sweet_integral_activity_title`
(
`activity_title`
)
KEY
`sweet_integral_activity_title`
(
`activity_title`
)
...
@@ -32,13 +34,13 @@ CREATE TABLE `sweet_integral_activity_prize`
...
@@ -32,13 +34,13 @@ CREATE TABLE `sweet_integral_activity_prize`
`prize_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'奖品id'
,
`prize_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'奖品id'
,
`integral_activity_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'关联活动id'
,
`integral_activity_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'关联活动id'
,
`prize_title`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'奖品名称'
,
`prize_title`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'奖品名称'
,
`prize_describe`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'奖品描述'
,
`prize_img_init`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'初始展示奖品图片'
,
`prize_img_init`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'初始展示奖品图片'
,
`prize_img_select`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'中奖选中奖品图片'
,
`prize_img_select`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'中奖选中奖品图片'
,
`prize_type`
tinyint
NOT
NULL
DEFAULT
0
COMMENT
'奖品类型 1谢谢惠顾 2积分 3代金券 4满减券 5优先购买券 6实物'
,
`prize_type`
tinyint
NOT
NULL
DEFAULT
0
COMMENT
'奖品类型 1积分 2优惠券 3实物 4登登登VIP'
,
`relation_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'关联id 如商品id 券id'
,
`prize_type_num`
int
NOT
NULL
DEFAULT
0
COMMENT
'单次奖励数量如积分 中奖给多少'
,
`prize_type_num`
int
NOT
NULL
DEFAULT
0
COMMENT
'单次奖励数量如积分 中奖给多少'
,
`prize_num`
int
NOT
NULL
DEFAULT
0
COMMENT
'奖品数量'
,
`prize_num`
int
NOT
NULL
DEFAULT
0
COMMENT
'奖品数量
库存
'
,
`
winners_num`
int
NOT
NULL
DEFAULT
0
COMMENT
'限制的中奖人数
'
,
`
is_infinite`
tinyint
NOT
NULL
DEFAULT
1
COMMENT
'是否是无限库存 1有限库存 2无限库存
'
,
`winning_probability`
decimal
(
10
,
2
)
NOT
NULL
DEFAULT
0
COMMENT
'中奖概率'
,
`winning_probability`
decimal
(
10
,
2
)
NOT
NULL
DEFAULT
0
COMMENT
'中奖概率'
,
`created_at`
datetime
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`created_at`
datetime
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`updated_at`
datetime
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'更新时间'
,
`updated_at`
datetime
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'更新时间'
,
...
@@ -50,6 +52,25 @@ CREATE TABLE `sweet_integral_activity_prize`
...
@@ -50,6 +52,25 @@ CREATE TABLE `sweet_integral_activity_prize`
COLLATE
utf8mb4_unicode_ci
COLLATE
utf8mb4_unicode_ci
ROW_FORMAT
=
DYNAMIC
COMMENT
'积分活动奖品表'
;
ROW_FORMAT
=
DYNAMIC
COMMENT
'积分活动奖品表'
;
-- 积分活动奖品里关联多奖品表
drop
TABLE
if
exists
`sweet_integral_activity_prize_relation`
;
CREATE
TABLE
`sweet_integral_activity_prize_relation`
(
`mid`
bigint
unsigned
NOT
NULL
AUTO_INCREMENT
,
`prize_relation_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'prize_relation_id'
,
`prize_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'prize_id'
,
`coupon_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'券id'
,
`coupon_title`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'券名称'
,
`created_at`
datetime
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`updated_at`
datetime
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'更新时间'
,
PRIMARY
KEY
(
`mid`
),
KEY
`sweet_prize_relation_id`
(
`prize_relation_id`
),
KEY
`sweet_prize_id`
(
`prize_id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
utf8mb4
COLLATE
utf8mb4_unicode_ci
ROW_FORMAT
=
DYNAMIC
COMMENT
'积分活动奖品里关联多奖品表'
;
-- 积分活动抽奖记录表
-- 积分活动抽奖记录表
drop
TABLE
if
exists
`sweet_integral_activity_draw`
;
drop
TABLE
if
exists
`sweet_integral_activity_draw`
;
CREATE
TABLE
`sweet_integral_activity_draw`
CREATE
TABLE
`sweet_integral_activity_draw`
...
@@ -60,7 +81,7 @@ CREATE TABLE `sweet_integral_activity_draw`
...
@@ -60,7 +81,7 @@ CREATE TABLE `sweet_integral_activity_draw`
`activity_num`
int
NOT
NULL
DEFAULT
0
COMMENT
'活动玩一次所需积分'
,
`activity_num`
int
NOT
NULL
DEFAULT
0
COMMENT
'活动玩一次所需积分'
,
`prize_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'关联奖品id'
,
`prize_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'关联奖品id'
,
`prize_title`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'奖品名称'
,
`prize_title`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'奖品名称'
,
`prize_type`
tinyint
NOT
NULL
DEFAULT
0
COMMENT
'奖品类型 1
谢谢
惠顾 2积分 3代金券 4满减券 5优先购买券 6实物'
,
`prize_type`
tinyint
NOT
NULL
DEFAULT
0
COMMENT
'奖品类型 1
积分 2优惠券 3实物 4登登登VIP 5优先购买券
惠顾 2积分 3代金券 4满减券 5优先购买券 6实物'
,
`prize_type_num`
int
NOT
NULL
DEFAULT
0
COMMENT
'单次奖励数量如积分 中奖给多少'
,
`prize_type_num`
int
NOT
NULL
DEFAULT
0
COMMENT
'单次奖励数量如积分 中奖给多少'
,
`relation_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'关联id 如商品id 券id'
,
`relation_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'关联id 如商品id 券id'
,
`user_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'关联用户id'
,
`user_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'关联用户id'
,
...
@@ -72,7 +93,7 @@ CREATE TABLE `sweet_integral_activity_draw`
...
@@ -72,7 +93,7 @@ CREATE TABLE `sweet_integral_activity_draw`
`receiving_city`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'adam收货人城市'
,
`receiving_city`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'adam收货人城市'
,
`receiving_county`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'adam收货人区县'
,
`receiving_county`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'adam收货人区县'
,
`receiving_address`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'adam收货人详细地址'
,
`receiving_address`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'adam收货人详细地址'
,
`receiving_status`
smallint
NOT
NULL
DEFAULT
1
COMMENT
'发放状态 1未发放 2已发放
3无需发放
'
,
`receiving_status`
smallint
NOT
NULL
DEFAULT
1
COMMENT
'发放状态 1未发放 2已发放'
,
`created_at`
datetime
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`created_at`
datetime
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`updated_at`
datetime
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'更新时间'
,
`updated_at`
datetime
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'更新时间'
,
PRIMARY
KEY
(
`mid`
),
PRIMARY
KEY
(
`mid`
),
...
...
liquidnet-bus-service/liquidnet-service-sweet/docu/redis_queue_create.txt
View file @
b244d600
...
@@ -36,6 +36,9 @@ XGROUP CREATE sweet:stream:rk.antigenicQuestion group.antigenicQuestion 0
...
@@ -36,6 +36,9 @@ XGROUP CREATE sweet:stream:rk.antigenicQuestion group.antigenicQuestion 0
-- 积分抽奖 --
-- 积分抽奖 --
XADD sweet:stream:rk.integralActivityDraw * 0 0
XADD sweet:stream:rk.integralActivityDraw * 0 0
XGROUP CREATE sweet:stream:rk.integralActivityDraw group.integralActivityDraw 0
XGROUP CREATE sweet:stream:rk.integralActivityDraw group.integralActivityDraw 0
-- 积分抽奖积分处理 --
XADD sweet:stream:rk.stoneIntegral * 0 0
XGROUP CREATE sweet:stream:rk.stoneIntegral group.stoneIntegral 0
-- 2021草莓海报活动 --
-- 2021草莓海报活动 --
XADD sweet:stream:rk.userLikeMusician * 0 0
XADD sweet:stream:rk.userLikeMusician * 0 0
...
...
liquidnet-bus-service/liquidnet-service-sweet/pom.xml
View file @
b244d600
...
@@ -106,6 +106,11 @@
...
@@ -106,6 +106,11 @@
<artifactId>
liquidnet-common-third-shumei
</artifactId>
<artifactId>
liquidnet-common-third-shumei
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.liquidnet
</groupId>
<artifactId>
liquidnet-api-feign-candy
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/MybatisPlusCodeGenerator.java
deleted
100644 → 0
View file @
b229fd66
package
com
.
liquidnet
.
service
;
import
com.baomidou.mybatisplus.core.toolkit.StringPool
;
import
com.baomidou.mybatisplus.generator.AutoGenerator
;
import
com.baomidou.mybatisplus.generator.InjectionConfig
;
import
com.baomidou.mybatisplus.generator.config.*
;
import
com.baomidou.mybatisplus.generator.config.po.TableInfo
;
import
com.baomidou.mybatisplus.generator.config.rules.NamingStrategy
;
import
com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
MybatisPlusCodeGenerator
{
/**
* @param moduleRootPath 项目模块根路径 到 /src 之前 ex:E:\projects\trlabs-bus-v1\trlabs-bus-service\trlabs-common\trlabs-mybatis
* @param dsc 数据源
* @param parentName 相当于业务模块名 com.liquidnet.service.adam 全限定类名
* @param tableNames 表名
*/
public
static
void
doGenerator
(
String
moduleRootPath
,
DataSourceConfig
dsc
,
String
parentName
,
String
[]
tableNames
)
{
AutoGenerator
mpg
=
new
AutoGenerator
();
// 全局配置BankMybatisPlusCodeGenerator
GlobalConfig
gc
=
new
GlobalConfig
();
gc
.
setOutputDir
(
moduleRootPath
+
"/src/main/java"
);
gc
.
setAuthor
(
"liquidnet"
);
gc
.
setOpen
(
false
);
// gc.setSwagger2(true); 实体属性 Swagger2 注解
mpg
.
setGlobalConfig
(
gc
);
// 数据源配置
mpg
.
setDataSource
(
dsc
);
// 包配置
PackageConfig
pc
=
new
PackageConfig
();
pc
.
setParent
(
parentName
);
mpg
.
setPackageInfo
(
pc
);
// 自定义配置
InjectionConfig
cfg
=
new
InjectionConfig
()
{
@Override
public
void
initMap
()
{
// to do nothing
}
};
// 如果模板引擎是 freemarker
String
templatePath
=
"/templates/mapper.xml.ftl"
;
// 自定义输出配置
List
<
FileOutConfig
>
focList
=
new
ArrayList
<>();
// 自定义配置会被优先输出
focList
.
add
(
new
FileOutConfig
(
templatePath
)
{
@Override
public
String
outputFile
(
TableInfo
tableInfo
)
{
// 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
return
moduleRootPath
+
"/src/main/resources/com/liquidnet/service/sweet/mapper/"
+
pc
.
getModuleName
()
+
"/"
+
tableInfo
.
getEntityName
()
+
"Mapper"
+
StringPool
.
DOT_XML
;
}
});
cfg
.
setFileOutConfigList
(
focList
);
mpg
.
setCfg
(
cfg
);
// 配置模板
TemplateConfig
templateConfig
=
new
TemplateConfig
();
templateConfig
.
setXml
(
null
);
mpg
.
setTemplate
(
templateConfig
);
// 策略配置
StrategyConfig
strategy
=
new
StrategyConfig
();
strategy
.
setNaming
(
NamingStrategy
.
underline_to_camel
);
strategy
.
setColumnNaming
(
NamingStrategy
.
underline_to_camel
);
// strategy.setSuperEntityClass("你自己的父类实体,没有就不用设置!");
strategy
.
setEntityLombokModel
(
true
);
strategy
.
setRestControllerStyle
(
true
);
strategy
.
setInclude
(
tableNames
);
strategy
.
setControllerMappingHyphenStyle
(
true
);
strategy
.
setTablePrefix
(
pc
.
getModuleName
()
+
"_"
);
mpg
.
setStrategy
(
strategy
);
mpg
.
setTemplateEngine
(
new
FreemarkerTemplateEngine
());
mpg
.
execute
();
}
public
static
void
main
(
String
[]
args
)
{
DataSourceConfig
dsc
=
new
DataSourceConfig
();
// dsc.setSchemaName("public");
dsc
.
setDriverName
(
"com.mysql.cj.jdbc.Driver"
);
dsc
.
setUrl
(
"jdbc:mysql://39.106.122.201:3308/dev_ln_scene?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=CST"
);
dsc
.
setUsername
(
"testmall"
);
dsc
.
setPassword
(
"zhengzai!mYT"
);
String
resourcePath
=
"/Users/hujiachen/Downloads/tmp"
;
String
directory
=
"com.liquidnet.service.stone"
;
String
[]
dbTableArray
=
new
String
[]{
"stone_score_logs"
,
"stone_score_items"
,
"stone_score_user"
,
"stone_score_order"
};
doGenerator
(
resourcePath
,
dsc
,
directory
,
dbTableArray
);
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/
Jxl
MathUtil.java
→
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/
Sweet
MathUtil.java
View file @
b244d600
...
@@ -13,7 +13,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -13,7 +13,7 @@ import lombok.extern.slf4j.Slf4j;
* @date 2021/8/10 18:03
* @date 2021/8/10 18:03
*/
*/
@Slf4j
@Slf4j
public
class
Jxl
MathUtil
{
public
class
Sweet
MathUtil
{
public
static
int
getIndex
(
String
key
){
public
static
int
getIndex
(
String
key
){
log
.
debug
(
"MathUtil.getIndex key:{} hashcode:{}"
,
key
,
key
.
hashCode
());
log
.
debug
(
"MathUtil.getIndex key:{} hashcode:{}"
,
key
,
key
.
hashCode
());
int
defaultDb
=
0
;
int
defaultDb
=
0
;
...
@@ -42,7 +42,7 @@ public class JxlMathUtil {
...
@@ -42,7 +42,7 @@ public class JxlMathUtil {
/*RedisConfig redisConfig = new RedisConfig();
/*RedisConfig redisConfig = new RedisConfig();
redisConfig.getRedisTemplateByDb(MathUtil.getIndex("1"));*/
redisConfig.getRedisTemplateByDb(MathUtil.getIndex("1"));*/
// getIndex("kylin:performances:id:296290722991104003684701");
// getIndex("kylin:performances:id:296290722991104003684701");
getIndex
(
"sweet:integralActivity:prizeNum:activityId:499142611246284803622253:prizeId:499142823268352009440982"
);
//
getIndex("sweet:integralActivity:prizeNum:activityId:499142611246284803622253:prizeId:499142823268352009440982");
// getIndex("kylin:order:coupon:id:397983761946132487870836");
// getIndex("kylin:order:coupon:id:397983761946132487870836");
// getIndex("sweet:integralActivity:list");
// getIndex("sweet:integralActivity:list");
// getIndex("kylin:order:id:325244198036357120519956");
// getIndex("kylin:order:id:325244198036357120519956");
...
@@ -50,7 +50,11 @@ public class JxlMathUtil {
...
@@ -50,7 +50,11 @@ public class JxlMathUtil {
// getIndex("kylin:performances:roadShowId:570");
// getIndex("kylin:performances:roadShowId:570");
// getIndex("kylin:order:refund:address");
// getIndex("kylin:order:refund:address");
// getIndex("basicServices:upushList:IOS");
// getIndex("basicServices:upushList:IOS");
getIndex
(
"jxl-lock-test"
);
// getIndex("jxl-lock-test");
// getIndex("kylin:performances:id:499112736168099840841262");
// getIndex("kylin:performances:id:549875278160650249766815");
// getIndex("sweet:user:applet:mobile:18548596019");
getIndex
(
"sweet:user:service:unionId:oSpYSs_6THPGafL3HqgGQA1uuEoE:type:1"
);
// getIndex("basicServices:upushList:Android");
// getIndex("basicServices:upushList:Android");
// getIndex("basicServices:zhengzaiAppVersionsAndroid");
// getIndex("basicServices:zhengzaiAppVersionsAndroid");
// getIndex("basicServices:zhengzaiAppVersionsIos");
// getIndex("basicServices:zhengzaiAppVersionsIos");
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/
Jxl
MybatisPlusCodeGenerator.java
→
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/
Sweet
MybatisPlusCodeGenerator.java
View file @
b244d600
...
@@ -11,7 +11,7 @@ import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
...
@@ -11,7 +11,7 @@ import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
public
class
Jxl
MybatisPlusCodeGenerator
{
public
class
Sweet
MybatisPlusCodeGenerator
{
/**
/**
* @param moduleRootPath 项目模块根路径 到 /src 之前 ex:E:\projects\trlabs-bus-v1\trlabs-bus-service\trlabs-common\trlabs-mybatis
* @param moduleRootPath 项目模块根路径 到 /src 之前 ex:E:\projects\trlabs-bus-v1\trlabs-bus-service\trlabs-common\trlabs-mybatis
* @param dsc 数据源
* @param dsc 数据源
...
@@ -95,7 +95,7 @@ public class JxlMybatisPlusCodeGenerator {
...
@@ -95,7 +95,7 @@ public class JxlMybatisPlusCodeGenerator {
String
resourcePath
=
"/Users/jiangxiulong/Downloads/tmp"
;
String
resourcePath
=
"/Users/jiangxiulong/Downloads/tmp"
;
String
directory
=
"com.liquidnet.service.sweet"
;
String
directory
=
"com.liquidnet.service.sweet"
;
String
[]
dbTableArray
=
new
String
[]{
"sweet_
strawberry_poster"
,
"sweet_strawberry_poster_lineup
"
};
String
[]
dbTableArray
=
new
String
[]{
"sweet_
integral_activity_prize_relation
"
};
doGenerator
(
resourcePath
,
dsc
,
directory
,
dbTableArray
);
doGenerator
(
resourcePath
,
dsc
,
directory
,
dbTableArray
);
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/controller/SweetIntegralActivityController.java
View file @
b244d600
...
@@ -7,11 +7,7 @@ import com.liquidnet.service.sweet.service.ISweetIntegralActivityService;
...
@@ -7,11 +7,7 @@ import com.liquidnet.service.sweet.service.ISweetIntegralActivityService;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.List
;
...
@@ -41,4 +37,16 @@ public class SweetIntegralActivityController {
...
@@ -41,4 +37,16 @@ public class SweetIntegralActivityController {
public
ResponseDto
<
IntegralActivityVo
>
detail
(
@PathVariable
(
"integralActivityId"
)
String
integralActivityId
)
{
public
ResponseDto
<
IntegralActivityVo
>
detail
(
@PathVariable
(
"integralActivityId"
)
String
integralActivityId
)
{
return
activityService
.
detail
(
integralActivityId
);
return
activityService
.
detail
(
integralActivityId
);
}
}
@GetMapping
(
"setDrawAllList"
)
@ApiOperation
(
"统计最新40条中奖记录"
)
public
ResponseDto
setDrawAllList
(
@RequestParam
String
integralActivityId
)
{
return
activityService
.
setDrawAllList
(
integralActivityId
);
}
@PostMapping
(
"drawBlack"
)
@ApiOperation
(
"抽奖黑名单"
)
public
ResponseDto
drawBlack
(
@RequestParam
String
uidS
)
{
return
activityService
.
drawBlack
(
uidS
);
}
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/controller/SweetIntegralActivityDrawController.java
View file @
b244d600
...
@@ -3,8 +3,9 @@ package com.liquidnet.service.sweet.controller;
...
@@ -3,8 +3,9 @@ package com.liquidnet.service.sweet.controller;
import
com.liquidnet.service.base.PagedResult
;
import
com.liquidnet.service.base.PagedResult
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.candy.vo.CandyCouponPreviewVo
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityDrawVo
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityDrawVo
;
import
com.liquidnet.service.sweet.dto.vo.
admin.SweetIntegralActivityPrize
Vo
;
import
com.liquidnet.service.sweet.dto.vo.
IntegralActivityPrizeApi
Vo
;
import
com.liquidnet.service.sweet.service.ISweetIntegralActivityDrawService
;
import
com.liquidnet.service.sweet.service.ISweetIntegralActivityDrawService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
...
@@ -35,25 +36,23 @@ public class SweetIntegralActivityDrawController {
...
@@ -35,25 +36,23 @@ public class SweetIntegralActivityDrawController {
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"integralActivityId"
,
value
=
"活动id"
,
required
=
true
)
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"integralActivityId"
,
value
=
"活动id"
,
required
=
true
)
})
})
public
ResponseDto
<
SweetIntegralActivityPrize
Vo
>
create
(
public
ResponseDto
<
IntegralActivityPrizeApi
Vo
>
create
(
@RequestParam
(
"integralActivityId"
)
String
integralActivityId
@RequestParam
(
"integralActivityId"
)
String
integralActivityId
)
{
)
{
return
activityDrawService
.
create
(
integralActivityId
);
return
activityDrawService
.
create
(
integralActivityId
);
}
}
@GetMapping
(
"drawList"
)
@GetMapping
(
"drawList"
)
@ApiOperation
(
"用户
(中奖、抽奖)
记录列表"
)
@ApiOperation
(
"用户
抽奖
记录列表"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"Integer"
,
name
=
"type"
,
value
=
"1中奖记录 2抽奖记录"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"integralActivityId"
,
value
=
"活动id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"integralActivityId"
,
value
=
"活动id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"Integer"
,
name
=
"pageNum"
,
value
=
"分页"
,
required
=
true
)
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"Integer"
,
name
=
"pageNum"
,
value
=
"分页"
,
required
=
true
)
})
})
public
ResponseDto
<
PagedResult
<
IntegralActivityDrawVo
>>
drawList
(
public
ResponseDto
<
PagedResult
<
IntegralActivityDrawVo
>>
drawList
(
@RequestParam
(
"type"
)
Integer
type
,
@RequestParam
(
"integralActivityId"
)
String
integralActivityId
,
@RequestParam
(
"integralActivityId"
)
String
integralActivityId
,
@RequestParam
(
"pageNum"
)
Integer
pageNum
@RequestParam
(
"pageNum"
)
Integer
pageNum
)
{
)
{
return
activityDrawService
.
drawList
(
type
,
integralActivityId
,
pageNum
);
return
activityDrawService
.
drawList
(
integralActivityId
,
pageNum
);
}
}
@GetMapping
(
"winPrizeUser"
)
@GetMapping
(
"winPrizeUser"
)
...
@@ -91,4 +90,32 @@ public class SweetIntegralActivityDrawController {
...
@@ -91,4 +90,32 @@ public class SweetIntegralActivityDrawController {
return
activityDrawService
.
perfectAddress
(
drawId
,
receivingAddressesId
);
return
activityDrawService
.
perfectAddress
(
drawId
,
receivingAddressesId
);
}
}
@PostMapping
(
"collectCoupon"
)
@ApiOperation
(
"领取券"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"couponId"
,
value
=
"券id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"drawId"
,
value
=
"抽奖id"
,
required
=
true
)
})
public
ResponseDto
collectCoupon
(
@RequestParam
(
"couponId"
)
String
couponId
,
@RequestParam
(
"drawId"
)
String
drawId
)
{
return
activityDrawService
.
collectCoupon
(
couponId
,
drawId
);
}
@PostMapping
(
"couponList"
)
@ApiOperation
(
"奖品对应的券列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"prizeId"
,
value
=
"奖品id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"integralActivityId"
,
value
=
"活动id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"int"
,
name
=
"pageNum"
,
value
=
"分页"
)
})
public
ResponseDto
<
List
<
CandyCouponPreviewVo
>>
couponList
(
@RequestParam
(
"prizeId"
)
String
prizeId
,
@RequestParam
(
"integralActivityId"
)
String
integralActivityId
,
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"1"
)
int
pageNum
)
{
return
activityDrawService
.
couponList
(
prizeId
,
integralActivityId
);
}
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetIntegralActivityDrawServiceImpl.java
View file @
b244d600
package
com
.
liquidnet
.
service
.
sweet
.
service
.
impl
;
package
com
.
liquidnet
.
service
.
sweet
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.*
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.adam.dto.vo.AdamAddressesVo
;
import
com.liquidnet.service.adam.dto.vo.AdamAddressesVo
;
import
com.liquidnet.service.base.ErrorMapping
;
import
com.liquidnet.service.base.PagedResult
;
import
com.liquidnet.service.base.PagedResult
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.candy.vo.CandyCouponPreviewVo
;
import
com.liquidnet.service.feign.adam.api.FeignAdamBaseClient
;
import
com.liquidnet.service.feign.adam.api.FeignAdamBaseClient
;
import
com.liquidnet.service.feign.candy.api.FeignCandyBaseClient
;
import
com.liquidnet.service.feign.stone.api.FeignStoneIntegralClient
;
import
com.liquidnet.service.feign.stone.api.FeignStoneIntegralClient
;
import
com.liquidnet.service.stone.dto.StoneScoreListDto
;
import
com.liquidnet.service.stone.dto.StoneScoreListDto
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityDrawVo
;
import
com.liquidnet.service.sweet.constant.StatusConst
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityVo
;
import
com.liquidnet.service.sweet.dto.vo.*
;
import
com.liquidnet.service.sweet.dto.vo.admin.SweetIntegralActivityPrizeVo
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityDraw
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityDraw
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityPrize
;
import
com.liquidnet.service.sweet.mapper.SweetIntegralActivityDrawMapper
;
import
com.liquidnet.service.sweet.mapper.SweetIntegralActivityDrawMapper
;
import
com.liquidnet.service.sweet.param.SweetStoneIntegralParam
;
import
com.liquidnet.service.sweet.service.ISweetIntegralActivityDrawService
;
import
com.liquidnet.service.sweet.service.ISweetIntegralActivityDrawService
;
import
com.liquidnet.service.sweet.utils.QueueUtils
;
import
com.liquidnet.service.sweet.utils.QueueUtils
;
import
com.liquidnet.service.sweet.utils.RedisDataUtils
;
import
com.liquidnet.service.sweet.utils.RedisDataUtils
;
...
@@ -39,6 +38,7 @@ import org.springframework.util.CollectionUtils;
...
@@ -39,6 +38,7 @@ import org.springframework.util.CollectionUtils;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
/**
* <p>
* <p>
...
@@ -65,12 +65,13 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
...
@@ -65,12 +65,13 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
private
FeignStoneIntegralClient
feignStoneIntegralClient
;
private
FeignStoneIntegralClient
feignStoneIntegralClient
;
@Autowired
@Autowired
private
FeignAdamBaseClient
feignAdamBaseClient
;
private
FeignAdamBaseClient
feignAdamBaseClient
;
@Autowired
private
FeignCandyBaseClient
feignCandyBaseClient
;
@Override
@Override
public
ResponseDto
<
SweetIntegralActivityPrize
Vo
>
create
(
String
integralActivityId
)
{
public
ResponseDto
<
IntegralActivityPrizeApi
Vo
>
create
(
String
integralActivityId
)
{
Map
tokenClaims
=
CurrentUtil
.
getTokenClaims
();
Map
tokenClaims
=
CurrentUtil
.
getTokenClaims
();
String
userId
=
StringUtils
.
defaultString
((
String
.
valueOf
(
tokenClaims
.
get
(
CurrentUtil
.
TOKEN_SUB
))),
""
);
String
userId
=
StringUtils
.
defaultString
((
String
.
valueOf
(
tokenClaims
.
get
(
CurrentUtil
.
TOKEN_SUB
))),
""
);
String
mobile
=
StringUtils
.
defaultString
((
String
.
valueOf
(
tokenClaims
.
get
(
CurrentUtil
.
TOKEN_MOBILE
))),
""
);
// 加锁
// 加锁
boolean
isLock
=
redisDataUtils
.
setIntegralDrawLock
(
userId
);
boolean
isLock
=
redisDataUtils
.
setIntegralDrawLock
(
userId
);
if
(!
isLock
)
{
if
(!
isLock
)
{
...
@@ -107,108 +108,125 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
...
@@ -107,108 +108,125 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
}
else
{
}
else
{
BigDecimal
scoreRest
=
userInfoData
.
getScoreRest
();
BigDecimal
scoreRest
=
userInfoData
.
getScoreRest
();
if
(
scoreRest
.
compareTo
(
BigDecimal
.
valueOf
(
integralActivity
.
getActivityNum
()))
==
-
1
)
{
if
(
scoreRest
.
compareTo
(
BigDecimal
.
valueOf
(
integralActivity
.
getActivityNum
()))
==
-
1
)
{
return
ResponseDto
.
failure
(
"您的积分账户余额不足!"
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"90082"
)
);
}
}
}
}
}
}
// 如果库存没了 限制的中奖人数到了就从列表剔出 列表为空就都没有库存了
// 如果库存没了就从列表剔出 列表为空就都没有库存了
List
<
SweetIntegralActivityPrize
>
prizeList
=
integralActivity
.
getPrizeList
();
ArrayList
<
IntegralActivityPrizeVo
>
activityPrizeVoArrayList
=
SweetNewObjectUtil
.
getIntegralActivityPrizeVoArrayList
();
ArrayList
<
SweetIntegralActivityPrize
>
sweetIntegralActivityPrizeArrayList
=
SweetNewObjectUtil
.
getSweetIntegralActivityPrizeArrayList
();
// 黑名单只中券 不记录次数
for
(
SweetIntegralActivityPrize
info
:
prizeList
)
{
List
<
String
>
drawBlack
=
redisDataUtils
.
getIntegralActivityDrawBlack
();
int
integralActivityPrizeNum
=
redisDataUtils
.
getIntegralActivityPrizeNum
(
integralActivityId
,
info
.
getPrizeId
());
boolean
isBlack
=
false
;
int
integralActivityPrizeWinnersNum
=
redisDataUtils
.
getIntegralActivityPrizeWinnersNum
(
integralActivityId
,
info
.
getPrizeId
());
if
(
drawBlack
.
contains
(
userId
))
{
if
(
integralActivityPrizeNum
>
0
&&
integralActivityPrizeWinnersNum
>
0
)
{
isBlack
=
true
;
sweetIntegralActivityPrizeArrayList
.
add
(
info
);
}
}
}
if
(
CollectionUtils
.
isEmpty
(
sweetIntegralActivityPrizeArrayList
))
{
// 概率计算
return
ResponseDto
.
failure
(
"活动太火爆了,奖品已经没有库存啦~"
);
boolean
lotteryDraw
=
this
.
lotteryDraw
(
integralActivityId
,
userId
);
if
(
lotteryDraw
&&
!
isBlack
)
{
// 实物
List
<
IntegralActivityPrizeVo
>
prizeList
=
integralActivity
.
getPrizeList2
();
for
(
IntegralActivityPrizeVo
info
:
prizeList
)
{
int
integralActivityPrizeNum
=
redisDataUtils
.
getIntegralActivityPrizeNum
(
integralActivityId
,
info
.
getPrizeId
());
if
(
integralActivityPrizeNum
>
0
)
{
activityPrizeVoArrayList
.
add
(
info
);
}
}
}
}
SweetIntegralActivityPrize
sweetIntegralActivityPrize
=
this
.
lotteryDraw
(
sweetIntegralActivityPrizeArrayList
);
if
(
isBlack
||
!
lotteryDraw
||
CollectionUtils
.
isEmpty
(
activityPrizeVoArrayList
))
{
// 没中实物、实物库存没了、是黑名单中用户 中券
SweetIntegralActivityPrizeVo
sweetIntegralActivityPrizeVo
=
SweetIntegralActivityPrizeVo
.
getNew
().
copy
(
sweetIntegralActivityPrize
);
List
<
IntegralActivityPrizeVo
>
prizeList
=
integralActivity
.
getPrizeList1
();
for
(
IntegralActivityPrizeVo
info
:
prizeList
)
{
// 减库存 顺便判断库存是否够 -1的时候回滚回去
if
(
info
.
getIsInfinite
()
==
1
)
{
long
activityPrizeNum
=
redisDataUtils
.
decrIntegralActivityPrizeNum
(
integralActivityId
,
sweetIntegralActivityPrizeVo
.
getPrizeId
(),
1
);
int
integralActivityPrizeNum
=
redisDataUtils
.
getIntegralActivityPrizeNum
(
integralActivityId
,
info
.
getPrizeId
());
long
activityPrizeWinnersNum
=
redisDataUtils
.
decrIntegralActivityPrizeWinnersNum
(
integralActivityId
,
sweetIntegralActivityPrizeVo
.
getPrizeId
(),
1
);
if
(
integralActivityPrizeNum
==
-
1
||
integralActivityPrizeNum
>
0
)
{
log
.
info
(
"奖品库存情况 activityPrizeNum:{}"
,
activityPrizeNum
);
activityPrizeVoArrayList
.
add
(
info
);
log
.
info
(
"奖品库存情况 activityPrizeWinnersNum:{}"
,
activityPrizeWinnersNum
);
}
if
(
activityPrizeNum
<
0
)
{
// 库存不够了
}
else
{
long
prizeNum
=
redisDataUtils
.
incrIntegralActivityPrizeNum
(
integralActivityId
,
sweetIntegralActivityPrizeVo
.
getPrizeId
(),
1
);
activityPrizeVoArrayList
.
add
(
info
);
log
.
info
(
"奖品库存情况回滚后 prizeNum:{}"
,
prizeNum
);
}
return
ResponseDto
.
failure
(
"活动太火爆了,奖品已经没有库存了!"
);
}
if
(
CollectionUtils
.
isEmpty
(
activityPrizeVoArrayList
))
{
return
ResponseDto
.
failure
(
"活动太火爆了,奖品已经没有库存啦~"
);
}
}
}
if
(
activityPrizeWinnersNum
<
0
)
{
// 库存不够了
long
winnersNum
=
redisDataUtils
.
incrIntegralActivityPrizeWinnersNum
(
integralActivityId
,
sweetIntegralActivityPrizeVo
.
getPrizeId
(),
1
);
IntegralActivityPrizeVo
integralActivityPrizeVo
=
this
.
lotteryDraw1
(
activityPrizeVoArrayList
);
log
.
info
(
"奖品库存情况回滚后 winnersNum:{}"
,
winnersNum
);
return
ResponseDto
.
failure
(
"活动太火爆了,奖品已经没有库存了~"
);
// 减库存 顺便判断库存是否够 无限库存不判断
if
(
integralActivityPrizeVo
.
getIsInfinite
()
==
1
)
{
long
activityPrizeNum
=
redisDataUtils
.
decrIntegralActivityPrizeNum
(
integralActivityId
,
integralActivityPrizeVo
.
getPrizeId
(),
1
);
log
.
info
(
"奖品库存情况 activityPrizeNum:{}"
,
activityPrizeNum
);
if
(
activityPrizeNum
<
0
)
{
// 库存不够了
long
prizeNum
=
redisDataUtils
.
incrIntegralActivityPrizeNum
(
integralActivityId
,
integralActivityPrizeVo
.
getPrizeId
(),
1
);
log
.
info
(
"奖品库存情况回滚后 prizeNum:{}"
,
prizeNum
);
return
ResponseDto
.
failure
(
"活动太火爆了,奖品已经没有库存了!"
);
}
}
}
// 减积分
// 减积分
ResponseDto
<
String
>
de2111
=
feignStoneIntegralClient
.
de2111
(
userId
,
integralActivity
.
getActivityNum
(),
integralActivity
.
getActivityTitle
());
SweetStoneIntegralParam
integralParamDe
=
SweetStoneIntegralParam
.
getNew
();
log
.
info
(
"减积分返回值情况 de2111:{}"
,
de2111
);
integralParamDe
.
setType
(
2
);
integralParamDe
.
setUid
(
userId
);
integralParamDe
.
setScore
(
integralActivity
.
getActivityNum
());
integralParamDe
.
setContent
(
integralActivity
.
getActivityTitle
());
queueUtils
.
sendMsgByRedis
(
MQConst
.
SweetQueue
.
SWEET_STONE_INTEGRAL
.
getKey
(),
JsonUtils
.
toJson
(
integralParamDe
));
// 抽奖入库
// 抽奖入库
String
drawId
=
IDGenerator
.
nextSnowId
();
String
drawId
=
IDGenerator
.
nextSnowId
();
IntegralActivityDrawVo
integralActivityDrawVo
=
IntegralActivityDrawVo
.
getNew
();
IntegralActivityDrawVo
integralActivityDrawVo
=
IntegralActivityDrawVo
.
getNew
();
integralActivityDrawVo
.
setDrawId
(
drawId
);
integralActivityDrawVo
.
setDrawId
(
drawId
);
integralActivityDrawVo
.
setIntegralActivityId
(
integralActivityId
);
integralActivityDrawVo
.
setIntegralActivityId
(
integralActivityId
);
integralActivityDrawVo
.
setActivityNum
(
integralActivity
.
getActivityNum
());
integralActivityDrawVo
.
setActivityNum
(
integralActivity
.
getActivityNum
());
integralActivityDrawVo
.
setPrizeId
(
sweetIntegralActivityPrize
.
getPrizeId
());
integralActivityDrawVo
.
setPrizeId
(
integralActivityPrizeVo
.
getPrizeId
());
integralActivityDrawVo
.
setPrizeTitle
(
sweetIntegralActivityPrize
.
getPrizeTitle
());
integralActivityDrawVo
.
setPrizeTitle
(
integralActivityPrizeVo
.
getPrizeTitle
());
integralActivityDrawVo
.
setPrizeType
(
sweetIntegralActivityPrize
.
getPrizeType
());
integralActivityDrawVo
.
setPrizeType
(
integralActivityPrizeVo
.
getPrizeType
());
integralActivityDrawVo
.
setPrizeTypeNum
(
sweetIntegralActivityPrize
.
getPrizeTypeNum
());
integralActivityDrawVo
.
setPrizeTypeNum
(
integralActivityPrizeVo
.
getPrizeTypeNum
());
integralActivityDrawVo
.
setRelationId
(
sweetIntegralActivityPrize
.
getRelationId
());
integralActivityDrawVo
.
setUserId
(
userId
);
integralActivityDrawVo
.
setUserId
(
userId
);
integralActivityDrawVo
.
setNickname
(
nickname
);
integralActivityDrawVo
.
setNickname
(
nickname
);
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
integralActivityDrawVo
.
setCreatedAt
(
nowTime
);
integralActivityDrawVo
.
setCreatedAt
(
nowTime
);
Integer
receivingStatus
=
1
;
Integer
receivingStatus
=
1
;
Integer
prizeType
=
sweetIntegralActivityPrize
.
getPrizeType
();
Integer
prizeType
=
integralActivityPrizeVo
.
getPrizeType
();
if
(
prizeType
==
2
)
{
// 中奖积分
if
(
prizeType
==
StatusConst
.
PRIZE_TYPE1
)
{
// 中奖积分
// 增加积分
SweetStoneIntegralParam
integralParamIn
=
SweetStoneIntegralParam
.
getNew
();
ResponseDto
<
String
>
in2111
=
feignStoneIntegralClient
.
in2112
(
userId
,
sweetIntegralActivityPrize
.
getPrizeTypeNum
(),
integralActivity
.
getActivityTitle
());
integralParamIn
.
setType
(
1
);
log
.
info
(
"中奖加积分返回值情况 in2111:{}"
,
in2111
);
integralParamIn
.
setUid
(
userId
);
// 发放状态
integralParamIn
.
setScore
(
integralActivityPrizeVo
.
getPrizeTypeNum
());
receivingStatus
=
2
;
integralParamIn
.
setContent
(
integralActivity
.
getActivityTitle
());
}
queueUtils
.
sendMsgByRedis
(
MQConst
.
SweetQueue
.
SWEET_STONE_INTEGRAL
.
getKey
(),
/*if (prizeType == 3 || prizeType == 4 || prizeType == 5) {// 优惠券
JsonUtils
.
toJson
(
integralParamIn
));
// 发放优惠券
LinkedList<String> sqls = CollectionUtil.linkedListString();
LinkedList<Object[]> sqlsDataA = CollectionUtil.linkedListObjectArr();
sqls.add(SqlMapping.get("stone_candy_mgt_coupon.add_for_member"));
sqlsDataA.add(new Object[]{
IDGenerator.nextTimeId2(), sweetIntegralActivityPrize.getRelationId(),
sweetIntegralActivityPrize.getPrizeTypeNum(), mobile, nowTime, "INTEGRAL_ACTIVITY_DRAW_COUPON", nowTime
});
queueUtils.sendMsgByRedis(MQConst.StoneQueue.STONE_ORDER_COUPON.getKey(),
SqlMapping.gets(sqls, sqlsDataA));
// 发放状态
receivingStatus
=
2
;
receivingStatus
=
2
;
}*/
if
(
prizeType
==
1
)
{
// 谢谢惠顾
receivingStatus
=
3
;
}
}
integralActivityDrawVo
.
setReceivingStatus
(
receivingStatus
);
integralActivityDrawVo
.
setReceivingStatus
(
receivingStatus
);
// redis
// redis
redisDataUtils
.
setIntegralActivityDraw
(
integralActivityDrawVo
);
redisDataUtils
.
setIntegralActivityDraw
(
integralActivityDrawVo
);
if
(
prizeType
==
StatusConst
.
PRIZE_TYPE3
||
prizeType
==
StatusConst
.
PRIZE_TYPE4
||
prizeType
==
StatusConst
.
PRIZE_TYPE5
)
{
// 中实物减实物总库存
redisDataUtils
.
decrIntegralActivityTotalPrizeNum
(
integralActivityId
);
}
// mongo
// mongo
mongoTemplate
.
insert
(
integralActivityDrawVo
,
IntegralActivityDrawVo
.
class
.
getSimpleName
());
mongoTemplate
.
insert
(
integralActivityDrawVo
,
IntegralActivityDrawVo
.
class
.
getSimpleName
());
// mysql 抽奖记录
// mysql 抽奖记录
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
Object
[]>
sqlsDataA
=
CollectionUtil
.
linkedListObjectArr
();
LinkedList
<
Object
[]>
sqlsDataA
=
CollectionUtil
.
linkedListObjectArr
();
sqls
.
add
(
SqlMapping
.
get
(
"integral_activity_draw.insert"
));
sqls
.
add
(
SqlMapping
.
get
(
"
sweet_
integral_activity_draw.insert"
));
sqlsDataA
.
add
(
new
Object
[]{
sqlsDataA
.
add
(
new
Object
[]{
drawId
,
integralActivityId
,
integralActivity
.
getActivityNum
(),
drawId
,
integralActivityId
,
integralActivity
.
getActivityNum
(),
sweetIntegralActivityPrize
.
getPrizeId
(),
sweetIntegralActivityPrize
.
getPrizeTitle
(),
sweetIntegralActivityPrize
.
getPrizeType
(),
integralActivityPrizeVo
.
getPrizeId
(),
integralActivityPrizeVo
.
getPrizeTitle
(),
integralActivityPrizeVo
.
getPrizeType
(),
sweetIntegralActivityPrize
.
getPrizeTypeNum
(),
sweetIntegralActivityPrize
.
getRelationId
(),
integralActivityPrizeVo
.
getPrizeTypeNum
(),
userId
,
nickname
,
userId
,
nickname
,
receivingStatus
receivingStatus
});
});
queueUtils
.
sendMsgByRedis
(
MQConst
.
SweetQueue
.
SWEET_INTEGRAL_ACTIVITY_DRAW
.
getKey
(),
queueUtils
.
sendMsgByRedis
(
MQConst
.
SweetQueue
.
SWEET_INTEGRAL_ACTIVITY_DRAW
.
getKey
(),
SqlMapping
.
gets
(
sqls
,
sqlsDataA
));
SqlMapping
.
gets
(
sqls
,
sqlsDataA
));
IntegralActivityPrizeApiVo
activityPrizeApiVo
=
IntegralActivityPrizeApiVo
.
getNew
().
copy
(
integralActivityPrizeVo
);
activityPrizeApiVo
.
setDrawId
(
drawId
);
return
ResponseDto
.
success
(
sweetIntegralActivityPrizeVo
);
// 参与次数
if
(!
isBlack
)
{
redisDataUtils
.
decrIntegralActivityEstimatedNum
(
integralActivityId
,
1
);
}
return
ResponseDto
.
success
(
activityPrizeApiVo
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"积分抽奖异常 e:{}"
,
e
);
log
.
error
(
"积分抽奖异常 e:{}"
,
e
);
return
ResponseDto
.
failure
(
"操作失败,请稍后重试!"
);
return
ResponseDto
.
failure
(
"操作失败,请稍后重试!"
);
...
@@ -220,32 +238,27 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
...
@@ -220,32 +238,27 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
}
}
@Override
@Override
public
ResponseDto
<
PagedResult
<
IntegralActivityDrawVo
>>
drawList
(
Integer
type
,
String
integralActivityId
,
Integer
pageNum
)
{
public
ResponseDto
<
PagedResult
<
IntegralActivityDrawVo
>>
drawList
(
String
integralActivityId
,
Integer
pageNum
)
{
Integer
pageSize
=
20
;
Integer
pageSize
=
20
;
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
PagedResult
<
IntegralActivityDrawVo
>
sweetIntegralActivityDrawPagedResult
=
SweetNewObjectUtil
.
getSweetIntegralActivityDrawVoPagedResult
();
PagedResult
<
IntegralActivityDrawVo
>
sweetIntegralActivityDrawPagedResult
=
SweetNewObjectUtil
.
getSweetIntegralActivityDrawVoPagedResult
();
long
count
=
0
;
//条件
//条件
Query
query
=
Query
.
query
(
Query
query
=
Query
.
query
(
Criteria
.
where
(
"integralActivityId"
).
is
(
integralActivityId
).
and
(
"userId"
).
is
(
currentUid
)
Criteria
.
where
(
"integralActivityId"
).
is
(
integralActivityId
).
and
(
"userId"
).
is
(
currentUid
)
);
);
if
(
type
==
1
)
{
long
count
=
mongoTemplate
.
count
(
query
,
IntegralActivityDrawVo
.
class
,
IntegralActivityDrawVo
.
class
.
getSimpleName
());
query
.
addCriteria
(
Criteria
.
where
(
"prizeType"
).
ne
(
1
));
LinkedList
<
IntegralActivityDrawVo
>
integralActivityDrawList
=
redisDataUtils
.
getIntegralActivityDrawList
(
currentUid
,
integralActivityId
);
}
else
{
if
(
null
==
integralActivityDrawList
||
pageNum
>
1
)
{
query
.
addCriteria
(
Criteria
.
where
(
"prizeType"
).
is
(
1
));
}
if
(
pageNum
<=
1
)
{
LinkedList
<
IntegralActivityDrawVo
>
integralActivityDrawList
=
redisDataUtils
.
getIntegralActivityDrawList
(
type
,
currentUid
,
integralActivityId
);
count
=
mongoTemplate
.
count
(
query
,
IntegralActivityDrawVo
.
class
,
IntegralActivityDrawVo
.
class
.
getSimpleName
());
sweetIntegralActivityDrawPagedResult
.
setList
(
integralActivityDrawList
).
setTotal
(
count
,
pageSize
).
setPageSize
(
pageSize
).
setCurrentPage
(
pageNum
);
}
else
{
// page大于1 去mongo里面取
HashMap
<
String
,
Object
>
info
=
CollectionUtil
.
mapStringObject
();
// 排序 分页
// 排序 分页
Pageable
pageable
=
PageRequest
.
of
(
pageNum
-
1
,
pageSize
,
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"createdAt"
));
Pageable
pageable
=
PageRequest
.
of
(
pageNum
-
1
,
pageSize
,
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"createdAt"
));
count
=
mongoTemplate
.
count
(
query
,
IntegralActivityDrawVo
.
class
,
IntegralActivityDrawVo
.
class
.
getSimpleName
());
query
.
with
(
pageable
);
query
.
with
(
pageable
);
List
<
IntegralActivityDrawVo
>
integralActivityDrawVos
=
mongoTemplate
.
find
(
query
,
IntegralActivityDrawVo
.
class
,
IntegralActivityDrawVo
.
class
.
getSimpleName
());
List
<
IntegralActivityDrawVo
>
integralActivityDrawVos
=
mongoTemplate
.
find
(
query
,
IntegralActivityDrawVo
.
class
,
IntegralActivityDrawVo
.
class
.
getSimpleName
());
sweetIntegralActivityDrawPagedResult
.
setList
(
integralActivityDrawVos
).
setTotal
(
count
,
pageSize
).
setPageSize
(
pageSize
).
setCurrentPage
(
pageNum
);
sweetIntegralActivityDrawPagedResult
.
setList
(
integralActivityDrawVos
).
setTotal
(
count
,
pageSize
).
setPageSize
(
pageSize
).
setCurrentPage
(
pageNum
);
if
(
null
==
integralActivityDrawList
)
{
redisDataUtils
.
setIntegralActivityDrawList
(
currentUid
,
integralActivityId
,
integralActivityDrawVos
);
}
}
else
{
sweetIntegralActivityDrawPagedResult
.
setList
(
integralActivityDrawList
).
setTotal
(
count
,
pageSize
).
setPageSize
(
pageSize
).
setCurrentPage
(
pageNum
);
}
}
return
ResponseDto
.
success
(
sweetIntegralActivityDrawPagedResult
);
return
ResponseDto
.
success
(
sweetIntegralActivityDrawPagedResult
);
}
}
...
@@ -294,43 +307,15 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
...
@@ -294,43 +307,15 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
.
append
(
"receivingCity"
,
receivingCity
)
.
append
(
"receivingCity"
,
receivingCity
)
.
append
(
"receivingCounty"
,
receivingCounty
)
.
append
(
"receivingCounty"
,
receivingCounty
)
.
append
(
"receivingAddress"
,
receivingAddress
)
.
append
(
"receivingAddress"
,
receivingAddress
)
.
append
(
"updatedAt"
,
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
nowTime
)
))
.
append
(
"updatedAt"
,
nowTime
))
);
);
LinkedList
<
IntegralActivityDrawVo
>
integralActivityDrawList
=
redisDataUtils
.
getIntegralActivityDrawList
(
1
,
drawVo
.
getUserId
(),
drawVo
.
getIntegralActivityId
());
redisDataUtils
.
delIntegralActivityDrawList
(
drawVo
.
getUserId
(),
drawVo
.
getIntegralActivityId
());
for
(
IntegralActivityDrawVo
info
:
integralActivityDrawList
)
{
if
(
info
.
getDrawId
().
equals
(
drawId
))
{
info
.
setReceivingAddressesId
(
receivingAddressesId
);
info
.
setReceivingName
(
receivingName
);
info
.
setReceivingPhone
(
receivingPhone
);
info
.
setReceivingProvince
(
receivingProvince
);
info
.
setReceivingCity
(
receivingCity
);
info
.
setReceivingCounty
(
receivingCounty
);
info
.
setReceivingAddress
(
receivingAddress
);
info
.
setUpdatedAt
(
nowTime
);
}
}
redisDataUtils
.
setIntegralActivityDrawInList
(
drawVo
.
getUserId
(),
drawVo
.
getIntegralActivityId
(),
integralActivityDrawList
);
LinkedList
<
IntegralActivityDrawVo
>
integralActivityDrawList2
=
redisDataUtils
.
getIntegralActivityDrawList
(
2
,
drawVo
.
getUserId
(),
drawVo
.
getIntegralActivityId
());
for
(
IntegralActivityDrawVo
info
:
integralActivityDrawList2
)
{
if
(
info
.
getDrawId
().
equals
(
drawId
))
{
info
.
setReceivingAddressesId
(
receivingAddressesId
);
info
.
setReceivingName
(
receivingName
);
info
.
setReceivingPhone
(
receivingPhone
);
info
.
setReceivingProvince
(
receivingProvince
);
info
.
setReceivingCity
(
receivingCity
);
info
.
setReceivingCounty
(
receivingCounty
);
info
.
setReceivingAddress
(
receivingAddress
);
info
.
setUpdatedAt
(
nowTime
);
}
}
redisDataUtils
.
setIntegralActivityDrawList
(
drawVo
.
getUserId
(),
drawVo
.
getIntegralActivityId
(),
integralActivityDrawList2
);
// mysql
// mysql
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
Object
[]>
sqlsDataA
=
CollectionUtil
.
linkedListObjectArr
();
LinkedList
<
Object
[]>
sqlsDataA
=
CollectionUtil
.
linkedListObjectArr
();
sqls
.
add
(
SqlMapping
.
get
(
"integral_activity_draw.update"
));
sqls
.
add
(
SqlMapping
.
get
(
"
sweet_
integral_activity_draw.update"
));
sqlsDataA
.
add
(
new
Object
[]{
sqlsDataA
.
add
(
new
Object
[]{
receivingAddressesId
,
receivingName
,
receivingPhone
,
receivingAddress
,
receivingProvince
,
receivingCity
,
receivingCounty
,
nowTime
,
drawId
receivingAddressesId
,
receivingName
,
receivingPhone
,
receivingAddress
,
receivingProvince
,
receivingCity
,
receivingCounty
,
nowTime
,
drawId
});
});
...
@@ -348,10 +333,77 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
...
@@ -348,10 +333,77 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
return
ResponseDto
.
success
(
drawVo
);
return
ResponseDto
.
success
(
drawVo
);
}
}
@Override
public
ResponseDto
collectCoupon
(
String
couponId
,
String
drawId
)
{
IntegralActivityDrawVo
drawVo
=
redisDataUtils
.
getIntegralActivityDrawInfo
(
drawId
);
Map
tokenClaims
=
CurrentUtil
.
getTokenClaims
();
String
mobile
=
StringUtils
.
defaultString
((
String
.
valueOf
(
tokenClaims
.
get
(
CurrentUtil
.
TOKEN_MOBILE
))),
""
);
String
uid
=
StringUtils
.
defaultString
((
String
.
valueOf
(
tokenClaims
.
get
(
CurrentUtil
.
TOKEN_SUB
))),
""
);
if
(
null
!=
drawVo
&&
drawVo
.
getReceivingStatus
()
==
1
&&
drawVo
.
getUserId
().
equals
(
uid
))
{
// 发放券
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
Object
[]>
sqlsDataA
=
CollectionUtil
.
linkedListObjectArr
();
sqls
.
add
(
SqlMapping
.
get
(
"sweet_integral_activity_draw.get_coupon"
));
sqlsDataA
.
add
(
new
Object
[]{
IDGenerator
.
nextTimeId2
(),
couponId
,
1
,
mobile
,
nowTime
,
"INTEGRAL_DRAW"
,
nowTime
});
queueUtils
.
sendMsgByRedis
(
MQConst
.
StoneQueue
.
STONE_ORDER_COUPON
.
getKey
(),
SqlMapping
.
gets
(
sqls
,
sqlsDataA
));
// 更改发放状态
LinkedList
<
String
>
sqlsB
=
CollectionUtil
.
linkedListString
();
LinkedList
<
Object
[]>
sqlsDataB
=
CollectionUtil
.
linkedListObjectArr
();
sqlsB
.
add
(
SqlMapping
.
get
(
"sweet_integral_activity_draw.updateStatus"
));
sqlsDataB
.
add
(
new
Object
[]{
2
,
couponId
,
nowTime
,
drawId
});
queueUtils
.
sendMsgByRedis
(
MQConst
.
SweetQueue
.
SWEET_INTEGRAL_ACTIVITY_DRAW
.
getKey
(),
SqlMapping
.
gets
(
sqlsB
,
sqlsDataB
));
// 更新缓存
redisDataUtils
.
updateIntegralActivityDrawInfo
(
drawId
,
couponId
);
mongoTemplate
.
getCollection
(
IntegralActivityDrawVo
.
class
.
getSimpleName
()).
updateOne
(
Query
.
query
(
Criteria
.
where
(
"drawId"
).
is
(
drawId
)).
getQueryObject
(),
new
Document
(
"$set"
,
new
Document
(
"receivingStatus"
,
2
)
.
append
(
"relationId"
,
couponId
)
.
append
(
"updatedAt"
,
LocalDateTime
.
now
())
)
);
redisDataUtils
.
delIntegralActivityDrawList
(
drawVo
.
getIntegralActivityId
(),
uid
);
}
return
ResponseDto
.
success
();
}
@Override
public
ResponseDto
<
List
<
CandyCouponPreviewVo
>>
couponList
(
String
prizeId
,
String
integralActivityId
)
{
IntegralActivityVo
integralActivity
=
redisDataUtils
.
getIntegralActivityInfo
(
integralActivityId
);
List
<
IntegralActivityPrizeVo
>
prizeList1
=
integralActivity
.
getPrizeList1
();
List
<
IntegralActivityPrizeRelationVo
>
relationList
=
new
ArrayList
<>();
for
(
IntegralActivityPrizeVo
prize
:
prizeList1
)
{
if
(
prize
.
getPrizeId
().
equals
(
prizeId
))
{
relationList
=
prize
.
getPrizeRelationList
();
break
;
}
}
List
<
CandyCouponPreviewVo
>
couponBasicVos
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
relationList
))
{
try
{
List
<
String
>
couponIds
=
relationList
.
stream
().
map
(
IntegralActivityPrizeRelationVo
->
IntegralActivityPrizeRelationVo
.
getCouponId
()).
collect
(
Collectors
.
toList
());
ResponseDto
<
List
<
CandyCouponPreviewVo
>>
responseDto
=
feignCandyBaseClient
.
couponListById
(
StringUtils
.
join
(
couponIds
.
toArray
(),
","
));
couponBasicVos
=
responseDto
.
getData
();
}
catch
(
Exception
e
)
{
log
.
error
(
"获取券详情失败 e:{}"
,
e
);
}
}
return
ResponseDto
.
success
(
couponBasicVos
);
}
/**
/**
* 抽奖方法
* 抽奖方法
计算中哪一个
*/
*/
private
static
SweetIntegralActivityPrize
lotteryDraw
(
List
<
SweetIntegralActivityPrize
>
prizeList
)
{
private
static
IntegralActivityPrizeVo
lotteryDraw1
(
List
<
IntegralActivityPrizeVo
>
prizeList
)
{
if
(
prizeList
==
null
||
prizeList
.
isEmpty
())
{
if
(
prizeList
==
null
||
prizeList
.
isEmpty
())
{
return
null
;
return
null
;
}
}
...
@@ -360,14 +412,14 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
...
@@ -360,14 +412,14 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
// 计算总概率,这样可以保证不一定总概率是1
// 计算总概率,这样可以保证不一定总概率是1
BigDecimal
sumRate
=
BigDecimal
.
ZERO
;
BigDecimal
sumRate
=
BigDecimal
.
ZERO
;
for
(
SweetIntegralActivityPrize
prize
:
prizeList
)
{
for
(
IntegralActivityPrizeVo
prize
:
prizeList
)
{
sumRate
=
sumRate
.
add
(
prize
.
getWinningProbability
());
sumRate
=
sumRate
.
add
(
prize
.
getWinningProbability
());
}
}
// 计算每个物品在总概率的基础下的概率情况
// 计算每个物品在总概率的基础下的概率情况
List
<
BigDecimal
>
sortOrignalRates
=
new
ArrayList
<>(
size
);
List
<
BigDecimal
>
sortOrignalRates
=
new
ArrayList
<>(
size
);
BigDecimal
tempSumRate
=
BigDecimal
.
ZERO
;
BigDecimal
tempSumRate
=
BigDecimal
.
ZERO
;
for
(
SweetIntegralActivityPrize
prize
:
prizeList
)
{
for
(
IntegralActivityPrizeVo
prize
:
prizeList
)
{
tempSumRate
=
tempSumRate
.
add
(
prize
.
getWinningProbability
());
tempSumRate
=
tempSumRate
.
add
(
prize
.
getWinningProbability
());
sortOrignalRates
.
add
(
tempSumRate
.
divide
(
sumRate
,
4
,
BigDecimal
.
ROUND_HALF_UP
));
sortOrignalRates
.
add
(
tempSumRate
.
divide
(
sumRate
,
4
,
BigDecimal
.
ROUND_HALF_UP
));
}
}
...
@@ -380,8 +432,77 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
...
@@ -380,8 +432,77 @@ public class SweetIntegralActivityDrawServiceImpl extends ServiceImpl<SweetInteg
int
index
=
sortOrignalRates
.
indexOf
(
nextDoubleNew
);
int
index
=
sortOrignalRates
.
indexOf
(
nextDoubleNew
);
SweetIntegralActivityPrize
sweetIntegralActivityPrize
=
prizeList
.
get
(
index
);
IntegralActivityPrizeVo
integralActivityPrizeVo
=
prizeList
.
get
(
index
);
return
sweetIntegralActivityPrize
;
return
integralActivityPrizeVo
;
}
/**
* 抽奖方法 计算中哪个奖池的奖品
*/
/*private boolean lotteryDraw(String integralActivityId, String uid) {
// 随机数
double random = Math.random() * 100;
BigDecimal randomBig = BigDecimal.valueOf(random);
// 剩余总库存 添加编辑的时候冗余的总库存省去计算
int prizeNum = redisDataUtils.getIntegralActivityTotalPrizeNum(integralActivityId);
BigDecimal prizeNumBig = BigDecimal.valueOf(prizeNum);
// 概率
int estimatedNum = redisDataUtils.getIntegralActivityEstimatedNum(integralActivityId);
if (estimatedNum <= 0) { // 此时百分百记录中实物
return true;
}
BigDecimal estimatedNumBig = BigDecimal.valueOf(estimatedNum);
// 会员概率*2
try {
ResponseDto<Boolean> isMemberDto = feignAdamBaseClient.isMember(uid);
Boolean isMember = isMemberDto.getData();
if (isMember) {
estimatedNumBig = estimatedNumBig.divide(BigDecimal.valueOf(2), 2, BigDecimal.ROUND_HALF_UP);
}
} catch (Exception e) {
log.error("获取用户是否是会员失败 [uid:{}, e:{}]", uid, e);
}
BigDecimal multiply = prizeNumBig.divide(estimatedNumBig, 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100));
// 对比大小
if (multiply.compareTo(randomBig) >= 0) {
return true; // 大于等于随机数中实物
} else {
return false;
}
}*/
/**
* 抽奖方法 计算中哪个奖池的奖品
*/
private
boolean
lotteryDraw
(
String
integralActivityId
,
String
uid
)
{
int
estimatedNum
=
redisDataUtils
.
getIntegralActivityEstimatedNum
(
integralActivityId
);
if
(
estimatedNum
<=
0
)
{
// 此时百分百中实物
return
true
;
}
// 剩余总库存 添加编辑的时候冗余的总库存省去计算
int
prizeNum
=
redisDataUtils
.
getIntegralActivityTotalPrizeNum
(
integralActivityId
);
BigDecimal
prizeNumBig
=
BigDecimal
.
valueOf
(
prizeNum
);
// 概率
BigDecimal
estimatedNumBig
=
BigDecimal
.
valueOf
(
estimatedNum
);
// 会员概率*2
try
{
ResponseDto
<
Boolean
>
isMemberDto
=
feignAdamBaseClient
.
isMember
(
uid
);
Boolean
isMember
=
isMemberDto
.
getData
();
if
(
isMember
)
{
estimatedNumBig
=
estimatedNumBig
.
divide
(
BigDecimal
.
valueOf
(
2
),
2
,
BigDecimal
.
ROUND_HALF_UP
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"获取用户是否是会员失败 [uid:{}, e:{}]"
,
uid
,
e
);
}
// 随机数
double
random
=
Math
.
random
();
BigDecimal
randomBig
=
BigDecimal
.
valueOf
(
random
);
BigDecimal
randomBigNew
=
randomBig
.
multiply
(
estimatedNumBig
);
// 对比大小
if
(
randomBigNew
.
compareTo
(
prizeNumBig
)
<=
0
)
{
return
true
;
// 0 - 剩余预估人数的随机数 <= 实物剩余总库存 中实物
}
else
{
return
false
;
}
}
}
/*public static void main(String[] args) {
/*public static void main(String[] args) {
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetIntegralActivityServiceImpl.java
View file @
b244d600
package
com
.
liquidnet
.
service
.
sweet
.
service
.
impl
;
package
com
.
liquidnet
.
service
.
sweet
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityPrizeVo
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityVo
;
import
com.liquidnet.service.sweet.dto.vo.IntegralActivityVo
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivity
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivity
;
import
com.liquidnet.service.sweet.entity.SweetIntegralActivityDraw
;
import
com.liquidnet.service.sweet.mapper.SweetIntegralActivityDrawMapper
;
import
com.liquidnet.service.sweet.mapper.SweetIntegralActivityMapper
;
import
com.liquidnet.service.sweet.mapper.SweetIntegralActivityMapper
;
import
com.liquidnet.service.sweet.service.ISweetIntegralActivityService
;
import
com.liquidnet.service.sweet.service.ISweetIntegralActivityService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.service.sweet.utils.ObjectUtil
;
import
com.liquidnet.service.sweet.utils.ObjectUtil
;
import
com.liquidnet.service.sweet.utils.RedisDataUtils
;
import
com.liquidnet.service.sweet.utils.RedisDataUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.List
;
/**
/**
* <p>
* <p>
...
@@ -29,6 +33,9 @@ public class SweetIntegralActivityServiceImpl extends ServiceImpl<SweetIntegralA
...
@@ -29,6 +33,9 @@ public class SweetIntegralActivityServiceImpl extends ServiceImpl<SweetIntegralA
@Autowired
@Autowired
private
RedisDataUtils
redisDataUtils
;
private
RedisDataUtils
redisDataUtils
;
@Autowired
private
SweetIntegralActivityDrawMapper
drawMapper
;
@Override
@Override
public
ResponseDto
<
List
<
IntegralActivityVo
>>
getList
()
{
public
ResponseDto
<
List
<
IntegralActivityVo
>>
getList
()
{
List
<
IntegralActivityVo
>
integralActivityList
=
redisDataUtils
.
getIntegralActivityList
();
List
<
IntegralActivityVo
>
integralActivityList
=
redisDataUtils
.
getIntegralActivityList
();
...
@@ -57,6 +64,73 @@ public class SweetIntegralActivityServiceImpl extends ServiceImpl<SweetIntegralA
...
@@ -57,6 +64,73 @@ public class SweetIntegralActivityServiceImpl extends ServiceImpl<SweetIntegralA
@Override
@Override
public
ResponseDto
<
IntegralActivityVo
>
detail
(
String
integralActivityId
)
{
public
ResponseDto
<
IntegralActivityVo
>
detail
(
String
integralActivityId
)
{
IntegralActivityVo
integralActivity
=
redisDataUtils
.
getIntegralActivityInfo
(
integralActivityId
);
IntegralActivityVo
integralActivity
=
redisDataUtils
.
getIntegralActivityInfo
(
integralActivityId
);
integralActivity
.
setPrizeList1
(
null
);
integralActivity
.
setPrizeList2
(
null
);
List
<
IntegralActivityPrizeVo
>
prizeList
=
integralActivity
.
getPrizeList
();
if
(!
CollectionUtils
.
isEmpty
(
prizeList
))
{
prizeList
.
forEach
(
r
->
{
r
.
setPrizeNum
(
null
);
r
.
setWinningProbability
(
null
);
r
.
setPrizeRelationList
(
null
);
r
.
setCreatedAt
(
null
);
r
.
setUpdatedAt
(
null
);
});
}
return
ResponseDto
.
success
(
integralActivity
);
return
ResponseDto
.
success
(
integralActivity
);
}
}
@Override
public
ResponseDto
setDrawAllList
(
String
integralActivityId
)
{
List
<
SweetIntegralActivityDraw
>
sweetIntegralActivityDraws
=
drawMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetIntegralActivityDraw
.
class
).
eq
(
SweetIntegralActivityDraw:
:
getIntegralActivityId
,
integralActivityId
)
.
last
(
"limit 0,35"
)
);
List
<
String
>
asList
=
Arrays
.
asList
(
"冯"
,
"陈"
,
"褚"
,
"卫"
,
"蒋"
,
"沈"
,
"韩"
,
"杨"
,
"朱"
,
"秦"
,
"尤"
,
"许"
,
"何"
,
"吕"
,
"施"
,
"张"
,
"孔"
,
"曹"
,
"严"
,
"华"
,
"金"
,
"魏"
,
"陶"
,
"姜"
,
"戚"
,
"谢"
,
"邹"
,
"喻"
,
"柏"
,
"水"
,
"窦"
,
"章"
,
"云"
,
"苏"
,
"潘"
,
"葛"
,
"奚"
,
"范"
,
"彭"
,
"郎"
,
"鲁"
,
"韦"
,
"昌"
,
"马"
,
"苗"
,
"凤"
,
"花"
,
"方"
,
"俞"
,
"任"
,
"袁"
,
"柳"
,
"酆"
,
"鲍"
,
"史"
,
"唐"
,
"费"
,
"廉"
,
"岑"
,
"薛"
,
"雷"
,
"贺"
,
"倪"
,
"汤"
);
ArrayList
<
String
>
asListArr
=
new
ArrayList
(
asList
);
IntegralActivityVo
integralActivityInfo
=
redisDataUtils
.
getIntegralActivityInfo
(
integralActivityId
);
List
<
IntegralActivityPrizeVo
>
prizeList2
=
integralActivityInfo
.
getPrizeList2
();
Random
random
=
new
Random
();
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
String
name
=
asListArr
.
get
(
random
.
nextInt
(
asListArr
.
size
()));
IntegralActivityPrizeVo
activityPrizeVo
=
prizeList2
.
get
(
random
.
nextInt
(
prizeList2
.
size
()));
SweetIntegralActivityDraw
activityDraw
=
SweetIntegralActivityDraw
.
getNew
();
activityDraw
.
setNickname
(
name
);
activityDraw
.
setPrizeTitle
(
activityPrizeVo
.
getPrizeTitle
());
sweetIntegralActivityDraws
.
add
(
activityDraw
);
}
Collections
.
shuffle
(
sweetIntegralActivityDraws
);
redisDataUtils
.
setIntegralActivityDrawAll
(
integralActivityId
,
sweetIntegralActivityDraws
);
return
ResponseDto
.
success
();
}
@Override
public
ResponseDto
drawBlack
(
String
uidS
)
{
String
[]
strings
=
uidS
.
split
(
","
);
List
<
String
>
aList
=
Arrays
.
asList
(
strings
);
redisDataUtils
.
setIntegralActivityDrawBlack
(
aList
);
// boolean contains = aList.contains("11");
return
ResponseDto
.
success
();
}
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetWechatLoginServiceImpl.java
View file @
b244d600
...
@@ -7,6 +7,7 @@ import com.liquidnet.commons.lang.util.DESUtils;
...
@@ -7,6 +7,7 @@ import com.liquidnet.commons.lang.util.DESUtils;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.adam.dto.vo.AdamLoginInfoVo
;
import
com.liquidnet.service.adam.dto.vo.AdamLoginInfoVo
;
import
com.liquidnet.service.adam.dto.vo.AdamUserInfoVo
;
import
com.liquidnet.service.adam.dto.vo.AdamUserInfoVo
;
import
com.liquidnet.service.base.ErrorMapping
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.base.constant.MQConst
;
...
@@ -174,7 +175,7 @@ public class SweetWechatLoginServiceImpl {
...
@@ -174,7 +175,7 @@ public class SweetWechatLoginServiceImpl {
WxMaJscode2SessionResult
sessionResult
=
sweetWechatService
.
sessionInfo
(
jsCode
,
type
);
WxMaJscode2SessionResult
sessionResult
=
sweetWechatService
.
sessionInfo
(
jsCode
,
type
);
SweetAppletUsersVo
sweetAppletUsersVo
=
redisUtils
.
getSweetAppletUsersOfUnionId
(
sessionResult
.
getUnionid
());
SweetAppletUsersVo
sweetAppletUsersVo
=
redisUtils
.
getSweetAppletUsersOfUnionId
(
sessionResult
.
getUnionid
());
if
(
null
==
sweetAppletUsersVo
)
{
if
(
null
==
sweetAppletUsersVo
)
{
return
ResponseDto
.
failure
(
"90081"
,
"获取用户信息失败"
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"90081"
)
);
}
}
String
purePhone
=
sweetAppletUsersVo
.
getPurePhoneNumber
();
String
purePhone
=
sweetAppletUsersVo
.
getPurePhoneNumber
();
String
otp
=
DESUtils
.
DES
().
encrypt
(
purePhone
+
LocalDateTime
.
now
().
toEpochSecond
(
ZoneOffset
.
UTC
));
String
otp
=
DESUtils
.
DES
().
encrypt
(
purePhone
+
LocalDateTime
.
now
().
toEpochSecond
(
ZoneOffset
.
UTC
));
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/utils/RedisDataUtils.java
View file @
b244d600
...
@@ -19,6 +19,7 @@ import com.liquidnet.service.sweet.entity.*;
...
@@ -19,6 +19,7 @@ import com.liquidnet.service.sweet.entity.*;
import
com.liquidnet.service.sweet.mapper.*
;
import
com.liquidnet.service.sweet.mapper.*
;
import
com.liquidnet.service.sweet.param.SweetCityVoteParam
;
import
com.liquidnet.service.sweet.param.SweetCityVoteParam
;
import
com.liquidnet.service.sweet.vo.*
;
import
com.liquidnet.service.sweet.vo.*
;
import
jodd.util.ArraysUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -430,6 +431,7 @@ public class RedisDataUtils {
...
@@ -430,6 +431,7 @@ public class RedisDataUtils {
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_ANSWER_PHONE
.
concat
(
sweetAnswerVo
.
getPhone
());
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_ANSWER_PHONE
.
concat
(
sweetAnswerVo
.
getPhone
());
redisUtil
.
set
(
redisKey
,
sweetAnswerVo
);
redisUtil
.
set
(
redisKey
,
sweetAnswerVo
);
}
}
//草莓音乐节活动海报相关
//草莓音乐节活动海报相关
public
void
setSweetMusician
(
SweetStrawberryParam
sweetStrawberry
)
{
public
void
setSweetMusician
(
SweetStrawberryParam
sweetStrawberry
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_STRAWBERRY_POSTER
.
concat
(
sweetStrawberry
.
getUnionId
());
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_STRAWBERRY_POSTER
.
concat
(
sweetStrawberry
.
getUnionId
());
...
@@ -533,52 +535,11 @@ public class RedisDataUtils {
...
@@ -533,52 +535,11 @@ public class RedisDataUtils {
}
}
public
void
setIntegralActivityDraw
(
IntegralActivityDrawVo
integralActivityDrawVo
)
{
public
void
setIntegralActivityDraw
(
IntegralActivityDrawVo
integralActivityDrawVo
)
{
int
redisListSizeUser
=
20
;
int
redisListSizeAll
=
20
;
Integer
prizeType
=
integralActivityDrawVo
.
getPrizeType
();
String
userId
=
integralActivityDrawVo
.
getUserId
();
String
userId
=
integralActivityDrawVo
.
getUserId
();
String
integralActivityId
=
integralActivityDrawVo
.
getIntegralActivityId
();
String
integralActivityId
=
integralActivityDrawVo
.
getIntegralActivityId
();
if
(
prizeType
>
1
)
{
// 写入中奖列表 1是谢谢惠顾
String
redisKeyIn
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_IN_USER
this
.
delIntegralActivityDrawList
(
userId
,
integralActivityId
);
.
concat
(
integralActivityId
)
.
concat
(
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_USER_KEY
)
.
concat
(
userId
);
LinkedList
<
IntegralActivityDrawVo
>
activityDrawArrayListIn
=
this
.
getIntegralActivityDrawList
(
1
,
userId
,
integralActivityId
);
// 先获取set到redisListSize条
if
(!
CollectionUtil
.
isEmpty
(
activityDrawArrayListIn
))
{
if
(
activityDrawArrayListIn
.
size
()
>=
redisListSizeUser
)
{
activityDrawArrayListIn
.
remove
(
0
);
}
}
activityDrawArrayListIn
.
addFirst
(
integralActivityDrawVo
);
redisUtil
.
set
(
redisKeyIn
,
activityDrawArrayListIn
);
// all用户中奖列表
String
redisKeyAll
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_ALL_LIST
.
concat
(
integralActivityId
);
LinkedList
<
IntegralActivityDrawVo
>
integralActivityDrawAll
=
this
.
getIntegralActivityDrawAll
(
integralActivityId
);
if
(!
CollectionUtil
.
isEmpty
(
integralActivityDrawAll
))
{
if
(
integralActivityDrawAll
.
size
()
>=
redisListSizeAll
)
{
integralActivityDrawAll
.
remove
(
0
);
}
}
integralActivityDrawAll
.
addFirst
(
integralActivityDrawVo
);
redisUtil
.
set
(
redisKeyAll
,
integralActivityDrawAll
);
}
// 是否中奖都写入抽奖列表
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_USER
.
concat
(
integralActivityId
)
.
concat
(
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_USER_KEY
)
.
concat
(
userId
);
LinkedList
<
IntegralActivityDrawVo
>
activityDrawArrayList
=
this
.
getIntegralActivityDrawList
(
2
,
userId
,
integralActivityId
);
// 先获取set到redisListSizeUser条
if
(!
CollectionUtil
.
isEmpty
(
activityDrawArrayList
))
{
if
(
activityDrawArrayList
.
size
()
>=
redisListSizeUser
)
{
activityDrawArrayList
.
remove
(
0
);
}
}
activityDrawArrayList
.
addFirst
(
integralActivityDrawVo
);
redisUtil
.
set
(
redisKey
,
activityDrawArrayList
);
// 抽奖详情
// 抽奖详情
String
redisKeyDraw
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_INFO
String
redisKeyDraw
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_INFO
.
concat
(
integralActivityDrawVo
.
getDrawId
());
.
concat
(
integralActivityDrawVo
.
getDrawId
());
...
@@ -597,42 +558,38 @@ public class RedisDataUtils {
...
@@ -597,42 +558,38 @@ public class RedisDataUtils {
return
collect
;
return
collect
;
}
}
}
}
public
void
setIntegralActivityDrawAll
(
String
integralActivityId
,
List
<
SweetIntegralActivityDraw
>
sweetIntegralActivityDraws
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_ALL_LIST
.
concat
(
integralActivityId
);
redisUtil
.
set
(
redisKey
,
sweetIntegralActivityDraws
);
}
public
LinkedList
<
IntegralActivityDrawVo
>
getIntegralActivityDrawList
(
Integer
type
,
String
uid
,
String
integralActivityId
)
{
public
LinkedList
<
IntegralActivityDrawVo
>
getIntegralActivityDrawList
(
String
uid
,
String
integralActivityId
)
{
String
redisKey
=
""
;
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_IN_USER
if
(
type
==
1
)
{
// 中奖列表
.
concat
(
integralActivityId
)
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_IN_USER
.
concat
(
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_USER_KEY
)
.
concat
(
integralActivityId
)
.
concat
(
uid
);
.
concat
(
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_USER_KEY
)
.
concat
(
uid
);
}
else
{
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_USER
.
concat
(
integralActivityId
)
.
concat
(
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_USER_KEY
)
.
concat
(
uid
);
}
Object
obj
=
redisUtil
.
get
(
redisKey
);
Object
obj
=
redisUtil
.
get
(
redisKey
);
if
(
null
==
obj
)
{
if
(
null
==
obj
)
{
return
SweetNewObjectUtil
.
getSweetIntegralActivityDrawVoLinkedList
()
;
return
null
;
}
else
{
}
else
{
return
(
LinkedList
<
IntegralActivityDrawVo
>)
obj
;
return
(
LinkedList
<
IntegralActivityDrawVo
>)
obj
;
}
}
}
}
public
void
setIntegralActivityDrawList
(
String
uid
,
String
integralActivityId
,
List
<
IntegralActivityDrawVo
>
integralActivityDrawVos
)
{
public
void
setIntegralActivityDrawInList
(
String
uid
,
String
integralActivityId
,
LinkedList
<
IntegralActivityDrawVo
>
integralActivityDrawList
)
{
List
<
IntegralActivityDrawVo
>
myList
=
integralActivityDrawVos
.
stream
().
collect
(
Collectors
.
toCollection
(
LinkedList:
:
new
));
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_IN_USER
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_IN_USER
.
concat
(
integralActivityId
)
.
concat
(
integralActivityId
)
.
concat
(
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_USER_KEY
)
.
concat
(
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_USER_KEY
)
.
concat
(
uid
);
.
concat
(
uid
);
redisUtil
.
set
(
redisKey
,
integralActivityDraw
List
);
redisUtil
.
set
(
redisKey
,
my
List
);
}
}
public
void
delIntegralActivityDrawList
(
String
uid
,
String
integralActivityId
)
{
public
void
setIntegralActivityDrawList
(
String
uid
,
String
integralActivityId
,
LinkedList
<
IntegralActivityDrawVo
>
integralActivityDrawList
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_IN_USER
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_USER
.
concat
(
integralActivityId
)
.
concat
(
integralActivityId
)
.
concat
(
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_USER_KEY
)
.
concat
(
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_USER_KEY
)
.
concat
(
uid
);
.
concat
(
uid
);
redisUtil
.
set
(
redisKey
,
integralActivityDrawList
);
redisUtil
.
del
(
redisKey
);
}
}
public
int
getIntegralActivityPrizeNum
(
String
integralActivityId
,
String
prizeId
)
{
public
int
getIntegralActivityPrizeNum
(
String
integralActivityId
,
String
prizeId
)
{
...
@@ -648,19 +605,6 @@ public class RedisDataUtils {
...
@@ -648,19 +605,6 @@ public class RedisDataUtils {
}
}
}
}
public
int
getIntegralActivityPrizeWinnersNum
(
String
integralActivityId
,
String
prizeId
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_WINNERS_NUM
.
concat
(
integralActivityId
)
.
concat
(
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_ID
)
.
concat
(
prizeId
);
Object
obj
=
redisUtil
.
get
(
redisKey
);
if
(
null
==
obj
)
{
return
0
;
}
else
{
return
(
int
)
obj
;
}
}
public
long
decrIntegralActivityPrizeNum
(
String
integralActivityId
,
String
prizeId
,
int
num
)
{
public
long
decrIntegralActivityPrizeNum
(
String
integralActivityId
,
String
prizeId
,
int
num
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_NUM
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_NUM
.
concat
(
integralActivityId
)
.
concat
(
integralActivityId
)
...
@@ -670,15 +614,6 @@ public class RedisDataUtils {
...
@@ -670,15 +614,6 @@ public class RedisDataUtils {
return
decr
;
return
decr
;
}
}
public
long
decrIntegralActivityPrizeWinnersNum
(
String
integralActivityId
,
String
prizeId
,
int
num
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_WINNERS_NUM
.
concat
(
integralActivityId
)
.
concat
(
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_ID
)
.
concat
(
prizeId
);
long
decr
=
redisUtil
.
decr
(
redisKey
,
num
);
return
decr
;
}
public
long
incrIntegralActivityPrizeNum
(
String
integralActivityId
,
String
prizeId
,
Integer
num
)
{
public
long
incrIntegralActivityPrizeNum
(
String
integralActivityId
,
String
prizeId
,
Integer
num
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_NUM
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_NUM
.
concat
(
integralActivityId
)
.
concat
(
integralActivityId
)
...
@@ -687,12 +622,22 @@ public class RedisDataUtils {
...
@@ -687,12 +622,22 @@ public class RedisDataUtils {
return
redisUtil
.
incr
(
redisKey
,
num
);
return
redisUtil
.
incr
(
redisKey
,
num
);
}
}
public
long
incrIntegralActivityPrizeWinnersNum
(
String
integralActivityId
,
String
prizeId
,
Integer
num
)
{
public
int
getIntegralActivityTotalPrizeNum
(
String
integralActivityId
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_WINNERS_NUM
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_TOTAL_PRIZE_NUM
.
concat
(
integralActivityId
)
.
concat
(
integralActivityId
);
.
concat
(
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_ID
)
Object
obj
=
redisUtil
.
get
(
redisKey
);
.
concat
(
prizeId
);
if
(
null
==
obj
)
{
return
redisUtil
.
incr
(
redisKey
,
num
);
return
0
;
}
else
{
return
(
int
)
obj
;
}
}
public
long
decrIntegralActivityTotalPrizeNum
(
String
integralActivityId
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_TOTAL_PRIZE_NUM
.
concat
(
integralActivityId
);
long
decr
=
redisUtil
.
decr
(
redisKey
,
1
);
return
decr
;
}
}
public
IntegralActivityDrawVo
getIntegralActivityDrawInfo
(
String
drawId
)
{
public
IntegralActivityDrawVo
getIntegralActivityDrawInfo
(
String
drawId
)
{
...
@@ -712,6 +657,30 @@ public class RedisDataUtils {
...
@@ -712,6 +657,30 @@ public class RedisDataUtils {
redisUtil
.
set
(
redisKeyDraw
,
drawVo
);
redisUtil
.
set
(
redisKeyDraw
,
drawVo
);
}
}
public
void
updateIntegralActivityDrawInfo
(
String
drawId
,
String
couponId
)
{
String
redisKeyDraw
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_INFO
.
concat
(
drawId
);
IntegralActivityDrawVo
info
=
(
IntegralActivityDrawVo
)
redisUtil
.
get
(
redisKeyDraw
);
info
.
setReceivingStatus
(
2
);
info
.
setRelationId
(
couponId
);
info
.
setUpdatedAt
(
LocalDateTime
.
now
());
redisUtil
.
set
(
redisKeyDraw
,
info
);
}
public
void
setIntegralActivityDrawBlack
(
List
<
String
>
uidS
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_BLACK
;
redisUtil
.
set
(
redisKey
,
uidS
);
}
public
List
<
String
>
getIntegralActivityDrawBlack
()
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_BLACK
;
Object
obj
=
redisUtil
.
get
(
redisKey
);
if
(
null
==
obj
)
{
return
Arrays
.
asList
();
}
else
{
return
(
List
<
String
>)
obj
;
}
}
public
boolean
setIntegralDrawLock
(
String
userId
)
{
public
boolean
setIntegralDrawLock
(
String
userId
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_LOCK
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_LOCK
.
concat
(
userId
);
.
concat
(
userId
);
...
@@ -759,6 +728,7 @@ public class RedisDataUtils {
...
@@ -759,6 +728,7 @@ public class RedisDataUtils {
/**
/**
* 设置临时banner
* 设置临时banner
*
* @param type
* @param type
* @param vo
* @param vo
*/
*/
...
@@ -769,16 +739,34 @@ public class RedisDataUtils {
...
@@ -769,16 +739,34 @@ public class RedisDataUtils {
/**
/**
* 获取临时banner
* 获取临时banner
*
* @param type
* @param type
* @return
* @return
*/
*/
public
List
<
TempBannerVo
>
getTempBanner
(
Integer
type
)
{
public
List
<
TempBannerVo
>
getTempBanner
(
Integer
type
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_CITY_VOTE_BANNER
.
concat
(
":type:"
+
type
);
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_CITY_VOTE_BANNER
.
concat
(
":type:"
+
type
);
Object
obj
=
redisUtil
.
get
(
redisKey
);
Object
obj
=
redisUtil
.
get
(
redisKey
);
if
(
obj
==
null
)
{
if
(
obj
==
null
)
{
return
null
;
return
null
;
}
else
{
}
else
{
return
(
List
<
TempBannerVo
>)
obj
;
return
(
List
<
TempBannerVo
>)
obj
;
}
}
public
int
getIntegralActivityEstimatedNum
(
String
integralActivityId
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_ESTIMATEDNUM
.
concat
(
integralActivityId
);
Object
obj
=
redisUtil
.
get
(
redisKey
);
if
(
null
==
obj
)
{
return
0
;
}
else
{
return
(
int
)
obj
;
}
}
}
}
public
void
decrIntegralActivityEstimatedNum
(
String
integralActivityId
,
Integer
num
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_ESTIMATEDNUM
.
concat
(
integralActivityId
);
redisUtil
.
decr
(
redisKey
,
num
);
}
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/resources/errors.properties
View file @
b244d600
40001
=
登录信息有误
40001
=
登录信息有误
40002
=
账号已在另一台设备登录
40002
=
账号已在另一台设备登录
40003
=
登录已过期
40003
=
登录已过期
# ------------------------ 4开头错误码作系统保留
# 特殊状态码
90081
=
获取用户信息失败
#APP ERROR
90082
=
您的积分账户余额不足!
20001
=
验证码发送失败
20002
=
验证码无效
20003
=
无权查看
20004
=
参数错误
20005
=
手机号获取失败,请更换登录方式
20006
=
第三方账号未注册
20007
=
数量错误
20008
=
无权购买
20009
=
非会员用户暂不可购买
20010
=
当前不可购买
20011
=
未开始售卖
20012
=
售卖已结束
20013
=
已超过快递票截止时间
20014
=
快递票未填写收货地址
20015
=
入场人数量错误
20016
=
库存不足
20017
=
年龄不符合
20018
=
下单失败
20019
=
申请失败
20020
=
当前状态不可撤回
20021
=
退款金额不能为0
20022
=
申请金额不得小于0
20023
=
请求频繁
20024
=
订单不存在
20025
=
订单已支付
20026
=
订单已关闭
20028
=
订单已失效
20027
=
您已支付请刷新再试
20029
=
未选择支付方式
20030
=
查看失败
#APP JDM
20201
=
# 专业版APP
20601
=
账号不存在
20602
=
密码错误
20603
=
20604
=
20605
=
20606
=
当前账号无关联演出数据
20607
=
当前账号未关联当前演出
20608
=
当前演出还未开放下载
# 演出
20700
=
演出详情获取失败
20701
=
巡演获取失败
20702
=
获取演出场次票种失败
20703
=
获取支付前详情失败
liquidnet-bus-service/liquidnet-service-sweet/src/main/resources/sqlmap.properties
View file @
b244d600
...
@@ -16,13 +16,6 @@ kylin_order_ticket_status.synPay=UPDATE kylin_order_ticket_status SET `status` =
...
@@ -16,13 +16,6 @@ kylin_order_ticket_status.synPay=UPDATE kylin_order_ticket_status SET `status` =
kylin_order_ticket_relation.synPay
=
UPDATE kylin_order_ticket_relations SET updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ?)
kylin_order_ticket_relation.synPay
=
UPDATE kylin_order_ticket_relations SET updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ?)
kylin_order_ticket_entities.synPay
=
UPDATE kylin_order_ticket_entities SET is_payment = ?,updated_at = ?,sys_damai = 1 WHERE order_id = ? and (updated_at <= ? or created_at = ?)
kylin_order_ticket_entities.synPay
=
UPDATE kylin_order_ticket_entities SET is_payment = ?,updated_at = ?,sys_damai = 1 WHERE order_id = ? and (updated_at <= ? or created_at = ?)
# ------------------------订单关闭----------------------------
kylin_order_ticket.close
=
UPDATE kylin_order_tickets SET updated_at = ? WHERE order_tickets_id = ?
kylin_order_ticket_status.close
=
UPDATE kylin_order_ticket_status SET `status` = ?,updated_at = ? WHERE order_id = ?
kylin_order_ticket_relation.close
=
UPDATE kylin_order_ticket_relations SET updated_at = ? WHERE order_id = ?
# ------------------------用户关系----------------------------
# ------------------------用户关系----------------------------
sweet_user_relation.insert
=
INSERT INTO sweet_user_relation (user_id,type,target_id,manual_id,status,created_at) VALUES (?,?,?,?,1,?)
sweet_user_relation.insert
=
INSERT INTO sweet_user_relation (user_id,type,target_id,manual_id,status,created_at) VALUES (?,?,?,?,1,?)
sweet_user_relation.delete
=
DELETE FROM sweet_user_relation WHERE user_id = ? and target_id = ? and manual_id = ? and type = ?
sweet_user_relation.delete
=
DELETE FROM sweet_user_relation WHERE user_id = ? and target_id = ? and manual_id = ? and type = ?
...
@@ -45,8 +38,10 @@ sweet_city_vote_stat.update=UPDATE sweet_city_vote_stat SET vote_num = IFNULL(vo
...
@@ -45,8 +38,10 @@ sweet_city_vote_stat.update=UPDATE sweet_city_vote_stat SET vote_num = IFNULL(vo
# --------------------------防疫答题--------------------------
# --------------------------防疫答题--------------------------
sweet_antigenic_question.insert
=
INSERT INTO sweet_antigenic_question (question_id,type,openId,unionId,nickname,address,phone,urgent_phone,keyword1,keyword11,keyword2,keyword3,keyword4,keyword5,keyword6,keyword7) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
sweet_antigenic_question.insert
=
INSERT INTO sweet_antigenic_question (question_id,type,openId,unionId,nickname,address,phone,urgent_phone,keyword1,keyword11,keyword2,keyword3,keyword4,keyword5,keyword6,keyword7) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
# ------------------------积分抽奖----------------------------
# ------------------------积分抽奖----------------------------
integral_activity_draw.insert
=
INSERT INTO sweet_integral_activity_draw (draw_id,integral_activity_id,activity_num,prize_id,prize_title,prize_type,prize_type_num,relation_id,user_id,nickname,receiving_status) VALUES (?,?,?,?,?,?,?,?,?,?,?)
sweet_integral_activity_draw.insert
=
INSERT INTO sweet_integral_activity_draw (draw_id,integral_activity_id,activity_num,prize_id,prize_title,prize_type,prize_type_num,user_id,nickname,receiving_status) VALUES (?,?,?,?,?,?,?,?,?,?)
integral_activity_draw.update
=
UPDATE sweet_integral_activity_draw SET receiving_addresses_id = ?, receiving_name = ?, receiving_phone = ?, receiving_address = ?, receiving_province = ?, receiving_city = ?, receiving_county = ?, updated_at = ? WHERE draw_id = ?
sweet_integral_activity_draw.update
=
UPDATE sweet_integral_activity_draw SET receiving_addresses_id = ?, receiving_name = ?, receiving_phone = ?, receiving_address = ?, receiving_province = ?, receiving_city = ?, receiving_county = ?, updated_at = ? WHERE draw_id = ?
sweet_integral_activity_draw.updateStatus
=
UPDATE sweet_integral_activity_draw SET receiving_status = ?, relation_id = ?, updated_at = ? WHERE draw_id = ?
sweet_integral_activity_draw.get_coupon
=
INSERT INTO candy_mgt_coupon (mcoupon_id, coupon_id, `state`, event_amt, event_type, event_limit, event_at, `operator`, created_at) VALUES (?, ?, 0, ?, 2, ?, ?, ?, ?)
# --------------------------小程序登录记录用户解密后信息--------------------------
# --------------------------小程序登录记录用户解密后信息--------------------------
sweet_applet_users.insert
=
INSERT INTO sweet_applet_users (applet_user_id,user_id,open_id,union_id,phone_number,pure_phone_number,country_code,type) VALUES (?,?,?,?,?,?,?,?)
sweet_applet_users.insert
=
INSERT INTO sweet_applet_users (applet_user_id,user_id,open_id,union_id,phone_number,pure_phone_number,country_code,type) VALUES (?,?,?,?,?,?,?,?)
...
...
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