Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
D
data-server
Project
Project
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
licc
data-server
Commits
5ea1c059
Commit
5ea1c059
authored
Mar 01, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
账户表新增年月字段
parent
8d85fa25
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
14 deletions
+17
-14
AccountInfoMapper.xml
...gy-mapper/src/main/resources/mapper/AccountInfoMapper.xml
+6
-5
AccountInfo.java
...del/src/main/java/cn/wisenergy/model/app/AccountInfo.java
+6
-5
AccountServiceImpl.java
...ava/cn/wisenergy/service/app/impl/AccountServiceImpl.java
+5
-4
No files found.
wisenergy-mapper/src/main/resources/mapper/AccountInfoMapper.xml
View file @
5ea1c059
...
...
@@ -5,9 +5,9 @@
<id
column=
"id"
property=
"id"
/>
<result
column=
"user_id"
property=
"userId"
/>
<result
column=
"user_level"
property=
"userLevel"
/>
<result
column=
"year_month"
property=
"yearMonth"
/>
<result
column=
"extract_money"
property=
"extractMoney"
/>
<result
column=
"earnings_month"
property=
"earningsMonth"
/>
<result
column=
"performance_team"
property=
"performanceTeam"
/>
<result
column=
"frozen_money"
property=
"frozenMoney"
/>
<result
column=
"earnings_total"
property=
"earningsTotal"
/>
<result
column=
"create_time"
property=
"createTime"
/>
...
...
@@ -24,20 +24,20 @@
</sql>
<sql
id=
"cols_exclude_id"
>
user_id,user_level,
extract_money,earnings_month,performance_team
,frozen_money,earnings_total,create_time,update_time
user_id,user_level,
year_month,extract_money,earnings_month
,frozen_money,earnings_total,create_time,update_time
</sql>
<sql
id=
"vals"
>
#{userId},#{userLevel},#{
extractMoney},#{earningsMonth},#{performanceTeam
},#{frozenMoney},
#{userId},#{userLevel},#{
yearMonth},#{extractMoney},#{earningsMonth
},#{frozenMoney},
#{earningsTotal},now(),now()
</sql>
<sql
id=
"updateCondition"
>
<if
test=
"userId != null"
>
user_id = #{userId},
</if>
<if
test=
"userLevel != null"
>
user_level = #{userLevel},
</if>
<if
test=
"yearMonth != null"
>
year_month =#{yearMonth},
</if>
<if
test=
"extractMoney != null"
>
extract_money =#{extractMoney},
</if>
<if
test=
"earningsMonth != null"
>
earnings_month =#{earningsMonth},
</if>
<if
test=
"performanceTeam != null"
>
performance_team =#{performanceTeam},
</if>
<if
test=
"frozenMoney != null"
>
frozen_money =#{frozenMoney},
</if>
<if
test=
"earningsTotal != null"
>
earnings_total =#{earningsTotal},
</if>
update_time =now()
...
...
@@ -47,14 +47,15 @@
<if
test=
"id != null"
>
id = #{id}
</if>
<if
test=
"userId != null"
>
and user_id = #{userId}
</if>
<if
test=
"userLevel != null"
>
and user_level = #{userLevel}
</if>
<if
test=
"yearMonth != null"
>
and year_month =#{yearMonth}
</if>
<if
test=
"extractMoney != null"
>
and extract_money =#{extractMoney}
</if>
<if
test=
"earningsMonth != null"
>
and earnings_month =#{earningsMonth}
</if>
<if
test=
"performanceTeam != null"
>
and performance_team =#{performanceTeam}
</if>
<if
test=
"frozenMoney != null"
>
and frozen_money =#{frozenMoney}
</if>
<if
test=
"earningsTotal != null"
>
and earnings_total =#{earningsTotal}
</if>
<if
test=
"createTime != null"
>
and create_time
>
= #{createTime}
</if>
<if
test=
"updateTime != null"
>
and #{updateTime}
>
= update_time
</if>
</sql>
<insert
id=
"add"
parameterType=
"cn.wisenergy.model.app.AccountInfo"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into
<include
refid=
"table"
/>
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/app/AccountInfo.java
View file @
5ea1c059
...
...
@@ -36,6 +36,12 @@ public class AccountInfo implements Serializable {
@ApiModelProperty
(
name
=
"userLevel"
,
value
=
"用户等级"
)
private
Integer
userLevel
;
/**
* 年月
*/
@ApiModelProperty
(
name
=
"yearMonth"
,
value
=
"年月"
)
private
Date
yearMonth
;
/**
* 可提现金额
...
...
@@ -49,11 +55,6 @@ public class AccountInfo implements Serializable {
@ApiModelProperty
(
name
=
"earningsMonth"
,
value
=
"本月收益"
)
private
BigDecimal
earningsMonth
;
/**
* 本月团队业绩
*/
@ApiModelProperty
(
name
=
"performanceTeam"
,
value
=
"本月团队业绩"
)
private
BigDecimal
performanceTeam
;
/**
* 冻结金额
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/AccountServiceImpl.java
View file @
5ea1c059
...
...
@@ -111,7 +111,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
}
}
//遍历订单 订单状态创建时间,小于当前时间 订单当月处理状态 :未处理
//遍历订单 订单状态创建时间,小于当前时间 订单当月
任务
处理状态 :未处理
for
(
OrderInfo
orderInfo
:
list
)
{
long
createTime
=
orderInfo
.
getCreated
().
getTime
();
long
time
=
System
.
currentTimeMillis
();
...
...
@@ -159,6 +159,9 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
//5、获取所有用户,如果会员等级是黄金以上,计算月度收益
List
<
User
>
userList
=
usersMapper
.
getAllGoldUser
();
if
(
CollectionUtils
.
isEmpty
(
userList
))
{
return
R
.
ok
(
0
,
true
);
}
for
(
User
user
:
userList
)
{
monthlyIncome
(
totalMoney
,
user
);
}
...
...
@@ -191,10 +194,9 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
//获取当月所有人业绩总额
Double
totalMoney
=
teamPerformanceMapper
.
countByTime
(
new
Date
());
double
number
=
Math
.
floor
(
totalMoney
/
3980
/
12
);
//2、集合为空 是业绩开始的第一个月
if
(
CollectionUtils
.
isEmpty
(
teamPerformances
))
{
double
number
=
Math
.
floor
(
totalMoney
/
3980
/
12
);
if
(
number
!=
0
)
{
//获取月业绩前20用户
List
<
TeamPerformance
>
list
=
teamPerformanceMapper
.
userTwenty
(
new
Date
());
...
...
@@ -275,7 +277,6 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
//计算前20的总业绩
double
total
=
listVo
.
stream
().
mapToDouble
(
TeamPerformanceSortVo:
:
getMonthPerformance
).
sum
();
double
number
=
Math
.
floor
(
totalMoney
/
3980
/
12
);
if
(
listVo
.
size
()
>=
20
)
{
//取排名前20的
listVo
.
subList
(
0
,
20
);
...
...
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