Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_ht
Commits
eb238729
Commit
eb238729
authored
Nov 15, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改集点活动和活动配置表
parent
31320231
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
8 deletions
+44
-8
PointActivities.java
...em/src/main/java/share/system/domain/PointActivities.java
+3
-3
PointActivitiesConf.java
...rc/main/java/share/system/domain/PointActivitiesConf.java
+5
-5
PointActivitiesServiceImpl.java
...share/system/service/impl/PointActivitiesServiceImpl.java
+36
-0
No files found.
share-system/src/main/java/share/system/domain/PointActivities.java
View file @
eb238729
...
...
@@ -50,7 +50,7 @@ public class PointActivities extends BaseEntity {
* 已累计点数
*/
@Excel
(
name
=
"已累计点数"
)
private
Long
points
;
private
Integer
points
;
/**
* 上次消费时间
...
...
@@ -63,13 +63,13 @@ public class PointActivities extends BaseEntity {
* 是否可领取
*/
@Excel
(
name
=
"是否可领取"
)
private
Long
isReceive
;
private
Integer
isReceive
;
/**
* 是否已领取优惠券
*/
@Excel
(
name
=
"是否已领取优惠券"
)
private
Long
couponReceived
;
private
Integer
couponReceived
;
/**
* 优惠券领取日期
...
...
share-system/src/main/java/share/system/domain/PointActivitiesConf.java
View file @
eb238729
...
...
@@ -35,13 +35,13 @@ public class PointActivitiesConf extends BaseEntity {
* 集点所需的消费次数
*/
@Excel
(
name
=
"集点所需的消费次数"
)
private
Long
pointsRequired
;
private
Integer
pointsRequired
;
/**
* 每次消费的时间间隔(小时)
*/
@Excel
(
name
=
"每次消费的时间间隔(小时)"
)
private
Long
timeInterval
;
private
Integer
timeInterval
;
/**
* 优惠券Id
...
...
@@ -53,19 +53,19 @@ public class PointActivitiesConf extends BaseEntity {
* 优惠券的领取期限 (天)
*/
@Excel
(
name
=
"优惠券的领取期限 (天)"
)
private
Long
collectionDeadline
;
private
Integer
collectionDeadline
;
/**
* 优惠券的使用期限 (天)
*/
@Excel
(
name
=
"优惠券的使用期限 (天)"
)
private
Long
couponDuration
;
private
Integer
couponDuration
;
/**
* 集点活动的重置周期 (月)
*/
@Excel
(
name
=
"集点活动的重置周期 (月)"
)
private
Long
collectionResetPeriod
;
private
Integer
collectionResetPeriod
;
/**
* 是否开启
...
...
share-system/src/main/java/share/system/service/impl/PointActivitiesServiceImpl.java
View file @
eb238729
package
share
.
system
.
service
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
share.common.enums.YesNoEnum
;
import
share.common.utils.DateUtils
;
import
share.system.domain.PointActivities
;
import
share.system.domain.PointActivitiesConf
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SOrder
;
import
share.system.domain.vo.PointActivitiesVo
;
import
share.system.mapper.PointActivitiesMapper
;
import
share.system.service.PointActivitiesConfService
;
import
share.system.service.PointActivitiesService
;
import
share.system.service.SConsumerService
;
import
java.util.List
;
...
...
@@ -21,6 +29,10 @@ import java.util.List;
public
class
PointActivitiesServiceImpl
extends
ServiceImpl
<
PointActivitiesMapper
,
PointActivities
>
implements
PointActivitiesService
{
@Autowired
private
PointActivitiesMapper
pointActivitiesMapper
;
@Autowired
private
SConsumerService
sConsumerService
;
@Autowired
private
PointActivitiesConfService
pointActivitiesConfService
;
/**
* 查询用户集点活动
...
...
@@ -68,6 +80,30 @@ public class PointActivitiesServiceImpl extends ServiceImpl<PointActivitiesMappe
return
pointActivitiesMapper
.
updatePointActivities
(
pointActivities
);
}
//参与集点活动
public
void
joinPointActivities
(
SOrder
sOrder
)
{
SConsumer
user
=
sConsumerService
.
getInfo
();
PointActivitiesConf
pointActivitiesConf
=
pointActivitiesConfService
.
list
().
get
(
0
);
PointActivities
oldPointActivities
=
pointActivitiesMapper
.
selectOne
(
new
LambdaQueryWrapper
<
PointActivities
>().
eq
(
PointActivities:
:
getConsumerId
,
user
.
getId
()));
if
(
ObjectUtil
.
isNotEmpty
(
oldPointActivities
))
{
oldPointActivities
.
setPoints
(
oldPointActivities
.
getPoints
()
+
YesNoEnum
.
yes
.
getIndex
());
oldPointActivities
.
setLastConsumptionTime
(
sOrder
.
getPayTime
());
if
(
oldPointActivities
.
getPoints
().
equals
(
pointActivitiesConf
.
getPointsRequired
()))
{
oldPointActivities
.
setIsReceive
(
YesNoEnum
.
yes
.
getIndex
());
}
}
else
{
PointActivities
pointActivities
=
new
PointActivities
();
pointActivities
.
setConsumerId
(
user
.
getId
());
pointActivities
.
setConfId
(
pointActivitiesConf
.
getId
());
pointActivities
.
setCouponId
(
pointActivitiesConf
.
getCouponId
());
pointActivities
.
setPoints
(
YesNoEnum
.
yes
.
getIndex
());
pointActivities
.
setLastConsumptionTime
(
sOrder
.
getPayTime
());
pointActivities
.
setIsReceive
(
YesNoEnum
.
no
.
getIndex
());
pointActivities
.
setCouponReceived
(
YesNoEnum
.
no
.
getIndex
());
save
(
pointActivities
);
}
}
/**
* 批量删除用户集点活动
*
...
...
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