Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
shop-Mall
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
shop-Mall
Commits
79a6efd6
Commit
79a6efd6
authored
Apr 09, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定数任务优化
parent
b56b10bd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
12 deletions
+37
-12
MemberPercentMapper.java
...rc/main/java/cn/wisenergy/mapper/MemberPercentMapper.java
+6
-0
MemberPercentMapper.xml
...-mapper/src/main/resources/mapper/MemberPercentMapper.xml
+10
-1
DayTaskServiceImpl.java
...ava/cn/wisenergy/service/app/impl/DayTaskServiceImpl.java
+4
-9
MonthTaskServiceImpl.java
...a/cn/wisenergy/service/app/impl/MonthTaskServiceImpl.java
+6
-2
DayTaskController.java
...wisenergy/web/admin/controller/app/DayTaskController.java
+11
-0
No files found.
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/MemberPercentMapper.java
View file @
79a6efd6
...
@@ -55,4 +55,10 @@ public interface MemberPercentMapper extends BaseMapper<MemberPercent> {
...
@@ -55,4 +55,10 @@ public interface MemberPercentMapper extends BaseMapper<MemberPercent> {
* @return 列表
* @return 列表
*/
*/
List
<
MemberPercent
>
getList
(
Map
<
String
,
Object
>
map
);
List
<
MemberPercent
>
getList
(
Map
<
String
,
Object
>
map
);
/**
* 获取黄金等级及以上月度肥料比例之和
* @return
*/
Double
getGoldUpSum
();
}
}
wisenergy-mapper/src/main/resources/mapper/MemberPercentMapper.xml
View file @
79a6efd6
...
@@ -71,7 +71,6 @@
...
@@ -71,7 +71,6 @@
</delete>
</delete>
<select
id=
"getByLevelAndType"
resultType=
"cn.wisenergy.model.app.MemberPercent"
>
<select
id=
"getByLevelAndType"
resultType=
"cn.wisenergy.model.app.MemberPercent"
>
select
select
<include
refid=
"cols_all"
/>
<include
refid=
"cols_all"
/>
...
@@ -98,4 +97,14 @@
...
@@ -98,4 +97,14 @@
limit #{startNum},#{endNum}
limit #{startNum},#{endNum}
</select>
</select>
<select
id=
"getGoldUpSum"
resultType=
"java.lang.Double"
>
select sum(percent)
from
<include
refid=
"table"
/>
<where>
type=2
and user_level>3
</where>
</select>
</mapper>
</mapper>
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/DayTaskServiceImpl.java
View file @
79a6efd6
...
@@ -360,16 +360,11 @@ public class DayTaskServiceImpl implements DayTaskService {
...
@@ -360,16 +360,11 @@ public class DayTaskServiceImpl implements DayTaskService {
public
void
getUser
(
List
<
User
>
list
,
String
userId
)
{
public
void
getUser
(
List
<
User
>
list
,
String
userId
)
{
User
user
=
usersMapper
.
getByUserId
(
userId
);
User
user
=
usersMapper
.
getByUserId
(
userId
);
list
.
add
(
user
);
if
(
null
!=
user
&&
!
StringUtils
.
isBlank
(
user
.
getBeInvitedCode
())
&&
if
(
null
!=
user
&&
!
StringUtils
.
isBlank
(
user
.
getBeInvitedCode
()))
{
!
"1"
.
equals
(
user
.
getBeInvitedCode
())
&&
!
"88888888"
.
equals
(
user
.
getBeInvitedCode
()))
{
user
=
usersMapper
.
getByBeInvitedCode
(
user
.
getBeInvitedCode
());
user
=
usersMapper
.
getByBeInvitedCode
(
user
.
getBeInvitedCode
());
if
(
null
!=
user
)
{
list
.
add
(
user
);
//todo 被邀请码=1 或 888888
getUser
(
list
,
user
.
getUserId
());
if
(
user
.
getBeInvitedCode
().
equals
(
user
.
getInviteCode
()))
{
return
;
}
getUser
(
list
,
user
.
getUserId
());
}
}
}
}
}
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/MonthTaskServiceImpl.java
View file @
79a6efd6
...
@@ -178,9 +178,13 @@ public class MonthTaskServiceImpl implements MonthTaskService {
...
@@ -178,9 +178,13 @@ public class MonthTaskServiceImpl implements MonthTaskService {
//5、获取所有用户,如果会员等级是黄金以上,计算月度收益
//5、获取所有用户,如果会员等级是黄金以上,计算月度收益
List
<
User
>
userList
=
usersMapper
.
getAllGoldUser
();
List
<
User
>
userList
=
usersMapper
.
getAllGoldUser
();
if
(
CollectionUtils
.
isEmpty
(
userList
))
{
if
(
CollectionUtils
.
isEmpty
(
userList
))
{
//添加月度肥料剩余奖金 todo /3980/12*3980*(黄金以上比列相加)
//获取黄金以上等级月度肥料收益比列之和
Double
memberSum
=
memberPercentMapper
.
getGoldUpSum
();
//添加月度肥料剩余奖金 总业绩 /3980/12*3980*(黄金以上比列相加)
double
manureMoney
=
Math
.
floor
(
totalMoney
.
doubleValue
()
/
3980
/
12
*
3980
*
memberSum
);
MonthManure
monthManure
=
new
MonthManure
();
MonthManure
monthManure
=
new
MonthManure
();
monthManure
.
setManureAward
(
totalMoney
.
doubleValue
()
);
monthManure
.
setManureAward
(
manureMoney
);
monthManure
.
setYearMonth
(
yearMonth
);
monthManure
.
setYearMonth
(
yearMonth
);
int
count
=
monthManureMapper
.
add
(
monthManure
);
int
count
=
monthManureMapper
.
add
(
monthManure
);
if
(
count
==
0
)
{
if
(
count
==
0
)
{
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/DayTaskController.java
View file @
79a6efd6
package
cn
.
wisenergy
.
web
.
admin
.
controller
.
app
;
package
cn
.
wisenergy
.
web
.
admin
.
controller
.
app
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.model.app.User
;
import
cn.wisenergy.service.app.DayTaskService
;
import
cn.wisenergy.service.app.DayTaskService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -10,6 +12,8 @@ import org.springframework.web.bind.annotation.GetMapping;
...
@@ -10,6 +12,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
/**
* @author 86187
* @author 86187
*/
*/
...
@@ -40,4 +44,11 @@ public class DayTaskController {
...
@@ -40,4 +44,11 @@ public class DayTaskController {
public
R
<
Boolean
>
growAward
()
{
public
R
<
Boolean
>
growAward
()
{
return
dayTaskService
.
progressPrizeCount
();
return
dayTaskService
.
progressPrizeCount
();
}
}
@ApiOperation
(
value
=
"获取用户的上级"
,
notes
=
"获取用户的上级"
,
httpMethod
=
"GET"
)
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户userId"
,
dataType
=
"String"
)
@GetMapping
(
"/getByList"
)
public
List
<
User
>
growAward
(
String
userId
)
{
return
dayTaskService
.
getByList
(
userId
);
}
}
}
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