Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
xunj
/
festival-activites
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 63e497db
authored
Feb 07, 2021
by
xunj
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
正是上线发布版本
1 parent
e9dc1bb7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
13 deletions
activity-admin/src/main/java/com/polysoft/activity/controller/CattleController.java
activity-admin/src/main/java/com/polysoft/activity/mapper/UserInfoMapper.java
activity-admin/src/main/java/com/polysoft/activity/service/impl/UserInfoServiceImpl.java
activity-admin/src/main/resources/mapper/UserInfoMapper.xml
activity-admin/src/main/java/com/polysoft/activity/controller/CattleController.java
View file @
63e497d
...
...
@@ -57,6 +57,6 @@ public class CattleController {
@ResponseBody
public
ApiResult
getOpenCattleBrandResult
(
@RequestBody
@Validated
ComposeCattleBrandParam
param
)
{
return
cattleBrandService
.
get
TaskStatus
(
param
);
return
cattleBrandService
.
get
OpenCattleBrandResult
(
param
);
}
}
activity-admin/src/main/java/com/polysoft/activity/mapper/UserInfoMapper.java
View file @
63e497d
...
...
@@ -38,4 +38,6 @@ public interface UserInfoMapper {
OpenCattleVO
getCattleAmount
(
@Param
(
"userId"
)
Long
userId
);
BigDecimal
getRedBalanceByUserId
(
@Param
(
"userId"
)
Long
userId
);
List
<
Long
>
getNotSignUserToYesterday
(
@Param
(
"signDate"
)
String
signDate
);
int
updateRedBalaceForFist
(
@Param
(
"userId"
)
Long
userId
,
@Param
(
"redBalance"
)
BigDecimal
redBalance
);
int
updateFirstRedStatus
(
@Param
(
"id"
)
Long
id
);
}
activity-admin/src/main/java/com/polysoft/activity/service/impl/UserInfoServiceImpl.java
View file @
63e497d
...
...
@@ -39,7 +39,9 @@ import java.util.ArrayList;
import
java.util.Date
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Random
;
import
java.util.UUID
;
import
java.util.stream.Collectors
;
@Service
...
...
@@ -258,10 +260,8 @@ public class UserInfoServiceImpl implements UserInfoService {
try
{
List
<
FirstLoginRedVO
>
firstLoginRedVOList
=
mapper
.
queryFirstLoginRed
();
if
(
firstLoginRedVOList
!=
null
&&
firstLoginRedVOList
.
size
()
>
0
){
HashSet
<
Integer
>
set
=
RandomUtils
.
getLuckUser
(
1
,
firstLoginRedVOList
.
size
());
//新增到红包雨表 作为红包基础数据
FirstLoginRedVO
redVO
=
firstLoginRedVOList
.
get
(
0
);
FirstLoginRedVO
redVO
=
firstLoginRedVOList
.
get
(
new
Random
().
nextInt
(
firstLoginRedVOList
.
size
())
);
AddRedRainDto
dto
=
new
AddRedRainDto
();
dto
.
setRedId
(
SnowFlakeUtil
.
nextId
());
dto
.
setUserId
(
userId
);
...
...
@@ -276,18 +276,14 @@ public class UserInfoServiceImpl implements UserInfoService {
throw
new
BusinessException
(
"首次登录新增t_red_rain表异常"
);
}
//更新聚宝盆余额
List
<
UserInfoDto
>
userInfoDtoList
=
new
ArrayList
<>();
UserInfoDto
userInfoDto
=
new
UserInfoDto
();
userInfoDto
.
setUserId
(
userId
);
userInfoDto
.
setRedBalance
(
redVO
.
getAmount
());
userInfoDto
.
setIsFirst
(
"1"
);
userInfoDtoList
.
add
(
userInfoDto
);
int
k2
=
mapper
.
updateRedBalace
(
userInfoDtoList
);
int
k2
=
mapper
.
updateRedBalaceForFist
(
userId
,
redVO
.
getAmount
());
if
(
k2
<
1
){
throw
new
BusinessException
(
"ID@@"
+
userId
+
"@@首次登录更新余额异常"
);
}
//更新首次登录状态
mapper
.
updateFirstLoginStatus
(
userId
);
int
k3
=
mapper
.
updateFirstRedStatus
(
redVO
.
getId
());
if
(
k3
<
1
){
throw
new
BusinessException
(
"ID@@"
+
userId
+
"@@首次登录领取红包异常"
);
}
return
ApiResult
.
ok
(
redVO
.
getAmount
());
}
}
catch
(
Exception
e
)
{
...
...
activity-admin/src/main/resources/mapper/UserInfoMapper.xml
View file @
63e497d
...
...
@@ -57,6 +57,14 @@
</foreach>
</where>
</update>
<update
id=
"updateRedBalaceForFist"
>
update t_user
set red_balance = red_balance+#{redBalance},
is_first = '1'
<where>
user_id=#{userId}
</where>
</update>
<update
id=
"updateFirstLoginRed"
>
update t_first_login_red set is_flag = 1 where id =#{id}
</update>
...
...
@@ -81,6 +89,11 @@
user_id = #{userId}
</where>
</update>
<update
id=
"updateFirstRedStatus"
>
UPDATE t_first_login_red
SET is_flag = '1'
where id = #{id}
</update>
<insert
id=
"saveCattleBrand"
parameterType=
"com.polysoft.activity.model.dto.SaveUserCattleDto"
>
INSERT into t_user_cattle (
id,
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment