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
315f0fcf
Commit
315f0fcf
authored
Mar 09, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增月度奖金实体类
parent
52b90143
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
230 additions
and
136 deletions
+230
-136
TradeRecordMapper.java
.../src/main/java/cn/wisenergy/mapper/TradeRecordMapper.java
+8
-0
MonthAwardMapper.xml
...rgy-mapper/src/main/resources/mapper/MonthAwardMapper.xml
+28
-28
TradeRecordMapper.xml
...gy-mapper/src/main/resources/mapper/TradeRecordMapper.xml
+16
-0
MonthAward.java
...odel/src/main/java/cn/wisenergy/model/app/MonthAward.java
+20
-21
MonthAwardVo.java
...del/src/main/java/cn/wisenergy/model/vo/MonthAwardVo.java
+57
-0
TradeRecordService.java
...ain/java/cn/wisenergy/service/app/TradeRecordService.java
+25
-0
TradeRecordServiceImpl.java
...cn/wisenergy/service/app/impl/TradeRecordServiceImpl.java
+42
-0
FileUploadController.java
...energy/web/admin/controller/app/FileUploadController.java
+0
-87
TradeRecordController.java
...nergy/web/admin/controller/app/TradeRecordController.java
+34
-0
No files found.
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/TradeRecordMapper.java
View file @
315f0fcf
...
@@ -64,4 +64,12 @@ public interface TradeRecordMapper extends BaseMapper<TradeRecord> {
...
@@ -64,4 +64,12 @@ public interface TradeRecordMapper extends BaseMapper<TradeRecord> {
*/
*/
List
<
WithdrawalRecordVo
>
getWithdrawalRecord
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"yearMonth"
)
Date
yearMonth
);
List
<
WithdrawalRecordVo
>
getWithdrawalRecord
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"yearMonth"
)
Date
yearMonth
);
/**
* 获取月 累计奖金
* @param yearMonth 年月
* @return
*/
Double
queryMonthAward
(
@Param
(
"yearMonth"
)
Date
yearMonth
);
}
}
wisenergy-mapper/src/main/resources/mapper/MonthAwardMapper.xml
View file @
315f0fcf
...
@@ -3,14 +3,14 @@
...
@@ -3,14 +3,14 @@
<mapper
namespace=
"cn.wisenergy.mapper.MonthAwardMapper"
>
<mapper
namespace=
"cn.wisenergy.mapper.MonthAwardMapper"
>
<resultMap
id=
"monthMap"
type=
"cn.wisenergy.model.app.MonthAward"
>
<resultMap
id=
"monthMap"
type=
"cn.wisenergy.model.app.MonthAward"
>
<id
column=
"id"
property=
"id"
/>
<id
column=
"id"
property=
"id"
/>
<result
column=
"
year_month"
property=
"yearMonth
"
/>
<result
column=
"
growth_award"
property=
"growthAward
"
/>
<result
column=
"
month_manure_total"
property=
"monthManure
Total"
/>
<result
column=
"
award_total"
property=
"award
Total"
/>
<result
column=
"month_award_
pool"
property=
"monthAwardPoo
l"
/>
<result
column=
"month_award_
total"
property=
"monthAwardTota
l"
/>
<result
column=
"month_
manure_award"
property=
"monthManureAwar
d"
/>
<result
column=
"month_
increased"
property=
"monthIncrease
d"
/>
<result
column=
"
month_gold_award"
property=
"monthG
oldAward"
/>
<result
column=
"
gold_award"
property=
"g
oldAward"
/>
<result
column=
"
month_farmer_award"
property=
"monthF
armerAward"
/>
<result
column=
"
farmer_award"
property=
"f
armerAward"
/>
<result
column=
"
month_forest_start_award"
property=
"monthF
orestStartAward"
/>
<result
column=
"
forest_start_award"
property=
"f
orestStartAward"
/>
<result
column=
"
month_partner_award"
property=
"monthP
artnerAward"
/>
<result
column=
"
partner_award"
property=
"p
artnerAward"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
</resultMap>
</resultMap>
...
@@ -25,37 +25,37 @@
...
@@ -25,37 +25,37 @@
</sql>
</sql>
<sql
id=
"cols_exclude_id"
>
<sql
id=
"cols_exclude_id"
>
year_month,month_manure_total,month_award_pool,month_manure_award,month_gold_award,month_farmer
_award,
growth_award,award_total,month_award_total,month_increased,gold_award,farmer_award, forest_start
_award,
month_forest_start_award,month_
partner_award,create_time,update_time
partner_award,create_time,update_time
</sql>
</sql>
<sql
id=
"vals"
>
<sql
id=
"vals"
>
#{
yearMonth},#{monthManureTotal},#{monthAwardPool},#{monthManureAward},#{monthGoldAward},#{monthF
armerAward},
#{
growthAward},#{awardTotal},#{monthAwardTotal},#{monthIncreased},#{goldAward},#{f
armerAward},
#{
monthForestStartAward}, #{monthP
artnerAward},now(),now()
#{
forestStartAward}, #{p
artnerAward},now(),now()
</sql>
</sql>
<sql
id=
"updateCondition"
>
<sql
id=
"updateCondition"
>
<if
test=
"
yearMonth != null"
>
year_month =#{yearMonth
},
</if>
<if
test=
"
growthAward != null"
>
growth_award =#{growthAward
},
</if>
<if
test=
"
monthManureTotal != null"
>
month_manure_total = #{monthManure
Total},
</if>
<if
test=
"
awardTotal != null"
>
award_total = #{award
Total},
</if>
<if
test=
"monthAward
Pool != null"
>
month_award_pool = #{monthAwardPoo
l},
</if>
<if
test=
"monthAward
Total != null"
>
month_award_total = #{monthAwardTota
l},
</if>
<if
test=
"month
ManureAward != null"
>
month_manure_award =#{monthManureAwar
d},
</if>
<if
test=
"month
Increased != null"
>
month_increased =#{monthIncrease
d},
</if>
<if
test=
"
monthGoldAward != null"
>
month_gold_award =#{monthG
oldAward},
</if>
<if
test=
"
goldAward != null"
>
gold_award =#{g
oldAward},
</if>
<if
test=
"
monthFarmerAward != null"
>
month_farmer_award =#{monthF
armerAward},
</if>
<if
test=
"
farmerAward != null"
>
farmer_award =#{f
armerAward},
</if>
<if
test=
"
monthForestStartAward != null"
>
month_forest_start_award =#{monthF
orestStartAward},
</if>
<if
test=
"
forestStartAward != null"
>
forest_start_award =#{f
orestStartAward},
</if>
<if
test=
"
monthPartnerAward != null"
>
month_partner_award =#{monthP
artnerAward},
</if>
<if
test=
"
partnerAward != null"
>
partner_award =#{p
artnerAward},
</if>
update_time =now()
update_time =now()
</sql>
</sql>
<sql
id=
"criteria"
>
<sql
id=
"criteria"
>
<if
test=
"id != null"
>
id = #{id}
</if>
<if
test=
"id != null"
>
id = #{id}
</if>
<if
test=
"
yearMonth != null"
>
and year_month =#{yearMonth
}
</if>
<if
test=
"
growthAward != null"
>
and growth_award =#{growthAward
}
</if>
<if
test=
"
monthManureTotal != null"
>
and month_manure_total = #{monthManure
Total}
</if>
<if
test=
"
awardTotal != null"
>
and award_total = #{award
Total}
</if>
<if
test=
"monthAward
Pool != null"
>
and month_award_pool = #{monthAwardPoo
l}
</if>
<if
test=
"monthAward
Total != null"
>
and month_award_total = #{monthAwardTota
l}
</if>
<if
test=
"month
ManureAward != null"
>
and month_manure_award =#{monthManureAwar
d}
</if>
<if
test=
"month
Increased != null"
>
and month_increased =#{monthIncrease
d}
</if>
<if
test=
"
monthGoldAward != null"
>
and month_gold_award =#{monthG
oldAward}
</if>
<if
test=
"
goldAward != null"
>
and gold_award =#{g
oldAward}
</if>
<if
test=
"
monthFarmerAward != null"
>
and month_farmer_award =#{monthF
armerAward}
</if>
<if
test=
"
farmerAward != null"
>
and farmer_award =#{f
armerAward}
</if>
<if
test=
"
monthForestStartAward != null"
>
and month_forest_start_award =#{monthF
orestStartAward}
</if>
<if
test=
"
forestStartAward != null"
>
and forest_start_award =#{f
orestStartAward}
</if>
<if
test=
"
monthPartnerAward != null"
>
and month_partner_award =#{monthP
artnerAward}
</if>
<if
test=
"
partnerAward != null"
>
and partner_award =#{p
artnerAward}
</if>
<if
test=
"createTime != null"
>
and create_time
>
= #{createTime}
</if>
<if
test=
"createTime != null"
>
and create_time
>
= #{createTime}
</if>
<if
test=
"updateTime != null"
>
and #{updateTime}
>
= update_time
</if>
<if
test=
"updateTime != null"
>
and #{updateTime}
>
= update_time
</if>
</sql>
</sql>
...
...
wisenergy-mapper/src/main/resources/mapper/TradeRecordMapper.xml
View file @
315f0fcf
...
@@ -136,4 +136,20 @@
...
@@ -136,4 +136,20 @@
</where>
</where>
</select>
</select>
<select
id=
"queryMonthAward"
resultType=
"java.lang.Double"
>
select
sum(money)
from
<include
refid=
"table"
/>
<where>
(type=2
or status=0)
<if
test=
"yearMonth != null"
>
AND(
YEAR(create_time) = YEAR(#{yearMonth})
AND MONTH(create_time) = MONTH(#{yearMonth}))
</if>
</where>
</select>
</mapper>
</mapper>
\ No newline at end of file
wisenergy-model/src/main/java/cn/wisenergy/model/app/MonthAward.java
View file @
315f0fcf
...
@@ -26,54 +26,53 @@ public class MonthAward implements Serializable {
...
@@ -26,54 +26,53 @@ public class MonthAward implements Serializable {
private
Integer
id
;
private
Integer
id
;
/**
/**
*
年月
*
与上一次比较的增长奖金
*/
*/
@ApiModelProperty
(
name
=
"
yearMonth"
,
value
=
"年月
"
)
@ApiModelProperty
(
name
=
"
growthAward"
,
value
=
"与上一次比较的增长额度
"
)
private
String
yearMonth
;
private
BigDecimal
growthAward
;
/**
/**
*
本月月度肥料
总额
*
历史奖金
总额
*/
*/
@ApiModelProperty
(
value
=
"
本月月度肥料总额"
,
name
=
"monthManure
Total"
)
@ApiModelProperty
(
value
=
"
历史奖金总额"
,
name
=
"award
Total"
)
private
BigDecimal
monthManure
Total
;
private
BigDecimal
award
Total
;
/**
/**
* 本月
进步最大奖励池
* 本月
累计奖金总额(本月新增+上月没有分出去的月度肥料奖金)
*/
*/
@ApiModelProperty
(
value
=
"本月
进步最大奖励池"
,
name
=
"monthAwardPoo
l"
)
@ApiModelProperty
(
value
=
"本月
累计奖金总额"
,
name
=
"monthAwardTota
l"
)
private
BigDecimal
monthAward
Poo
l
;
private
BigDecimal
monthAward
Tota
l
;
/**
/**
*
月度肥料奖励
*
本月新增
*/
*/
@ApiModelProperty
(
value
=
"月度肥料奖励"
,
name
=
"monthManureAward"
)
@ApiModelProperty
(
value
=
"本月新增"
,
name
=
"monthIncreased"
)
private
BigDecimal
monthManureAward
;
private
BigDecimal
monthIncreased
;
/**
/**
* 黄金树月奖励总额
* 黄金树月奖励总额
*/
*/
@ApiModelProperty
(
value
=
"黄金树月奖励总额"
,
name
=
"
monthG
oldAward"
)
@ApiModelProperty
(
value
=
"黄金树月奖励总额"
,
name
=
"
g
oldAward"
)
private
BigDecimal
monthG
oldAward
;
private
BigDecimal
g
oldAward
;
/**
/**
* 农场主月奖励总额
* 农场主月奖励总额
*/
*/
@ApiModelProperty
(
value
=
"农场主月奖励总额"
,
name
=
"
monthF
armerAward"
)
@ApiModelProperty
(
value
=
"农场主月奖励总额"
,
name
=
"
f
armerAward"
)
private
BigDecimal
monthF
armerAward
;
private
BigDecimal
f
armerAward
;
/**
/**
* 森林之星月奖励总额
* 森林之星月奖励总额
*/
*/
@ApiModelProperty
(
value
=
"森林之星月奖励总额"
,
name
=
"
monthF
orestStartAward"
)
@ApiModelProperty
(
value
=
"森林之星月奖励总额"
,
name
=
"
f
orestStartAward"
)
private
BigDecimal
monthF
orestStartAward
;
private
BigDecimal
f
orestStartAward
;
/**
/**
* 森田合伙人月奖励总额
* 森田合伙人月奖励总额
*/
*/
@ApiModelProperty
(
value
=
"森田合伙人月奖励总额"
,
name
=
"
monthP
artnerAward"
)
@ApiModelProperty
(
value
=
"森田合伙人月奖励总额"
,
name
=
"
p
artnerAward"
)
private
BigDecimal
monthP
artnerAward
;
private
BigDecimal
p
artnerAward
;
private
Date
createTime
;
private
Date
createTime
;
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/vo/MonthAwardVo.java
0 → 100644
View file @
315f0fcf
package
cn
.
wisenergy
.
model
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author 86187
* @ Description: 月度奖金页面展示数据Vo
* @ Author : 86187
* @ Date : 2021/3/9 11:09
*/
@ApiModel
(
"MonthAwardVo"
)
@Data
public
class
MonthAwardVo
{
/**
* 历史累计奖金
*/
@ApiModelProperty
(
value
=
"历史累计奖金"
,
name
=
"totalAward"
)
private
Double
totalAward
;
/**
* 本月新增
*/
@ApiModelProperty
(
value
=
"本月新增"
,
name
=
"monthIncreased"
)
private
Double
monthIncreased
;
/**
* 用户-份额
*/
@ApiModelProperty
(
value
=
"用户-份额"
,
name
=
"userMonthAward"
)
private
Double
userMonthAward
;
/**
* 黄金树等级奖金
*/
@ApiModelProperty
(
value
=
"黄金树等级奖金"
,
name
=
"goldAward"
)
private
Double
goldAward
;
/**
* 农场主等级 奖金
*/
@ApiModelProperty
(
value
=
"农场主等级 奖金"
,
name
=
"farmerAward"
)
private
Double
farmerAward
;
/**
* 森林之星等级奖金
*/
@ApiModelProperty
(
value
=
"森林之星等级奖金"
,
name
=
"forestStartAward"
)
private
Double
forestStartAward
;
/**
* 西田森合伙人等级奖金
*/
@ApiModelProperty
(
value
=
"西田森合伙人等级奖金"
,
name
=
"partnerAward"
)
private
Double
partnerAward
;
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/TradeRecordService.java
0 → 100644
View file @
315f0fcf
package
cn
.
wisenergy
.
service
.
app
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.model.vo.MonthAwardVo
;
/**
* @author 86187
*/
public
interface
TradeRecordService
{
/**
* 查询本月累计奖金
*
* @return 本月累计奖金
*/
R
<
Double
>
queryMonthAward
();
/**
* 查询各种月度奖金
*
* @param userId 用户id
* @return 各种月度奖金
*/
R
<
MonthAwardVo
>
queryAllAward
(
String
userId
);
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/TradeRecordServiceImpl.java
0 → 100644
View file @
315f0fcf
package
cn
.
wisenergy
.
service
.
app
.
impl
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.mapper.TradeRecordMapper
;
import
cn.wisenergy.model.app.TradeRecord
;
import
cn.wisenergy.model.vo.MonthAwardVo
;
import
cn.wisenergy.service.app.TradeRecordService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
/**
* @author 86187
*/
@Service
@Slf4j
public
class
TradeRecordServiceImpl
extends
ServiceImpl
<
TradeRecordMapper
,
TradeRecord
>
implements
TradeRecordService
{
@Override
public
R
<
Double
>
queryMonthAward
()
{
log
.
info
(
"shop-mall[]TradeRecordServiceImpl[]queryMonthAward[]input.method"
);
//获取本月累计奖金
Double
award
=
baseMapper
.
queryMonthAward
(
new
Date
());
return
R
.
ok
(
award
);
}
@Override
public
R
<
MonthAwardVo
>
queryAllAward
(
String
userId
)
{
log
.
info
(
"shop-mall[]TradeRecordServiceImpl[]queryAllAward[]input.param.userId:"
+
userId
);
if
(
StringUtils
.
isBlank
(
userId
)){
return
R
.
error
(
"入参为空!"
);
}
return
null
;
}
}
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/FileUploadController.java
deleted
100644 → 0
View file @
52b90143
package
cn
.
wisenergy
.
web
.
admin
.
controller
.
app
;
import
cn.wisenergy.common.utils.R
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.UUID
;
/**
* @author 86187
* @ Description:
* @ Author : 86187
* @ Date : 2021/2/3 17:05
*/
@Api
(
tags
=
"图片上传"
)
@RestController
@RequestMapping
(
"/pic"
)
@Slf4j
public
class
FileUploadController
{
/**
* 请求 url 中的资源映射,不推荐写死在代码中,最好提供可配置,如 /upload_flowChart/**
*/
@Value
(
"${uploadFile.resourceHandler}"
)
private
String
resourceHandler
;
/**
* 上传文件保存的本地目录,使用@Value获取全局配置文件中配置的属性值,如 D:/java/upload_flowChart/
*/
@Value
(
"${uploadFile.location}"
)
private
String
uploadImagesLocation
;
/**
* 允许上传的格式
*/
private
static
final
String
[]
IMAGE_TYPE
=
new
String
[]{
".bmp"
,
".jpg"
,
".jpeg"
,
".gif"
,
".png"
};
@ApiOperation
(
value
=
"文件上传"
,
notes
=
"文件上传"
)
@PostMapping
(
value
=
"/upload"
,
headers
=
"content-type=multipart/form-data"
)
public
R
file
(
@ApiParam
(
required
=
true
,
value
=
"上传文件"
)
@RequestParam
(
"file"
)
MultipartFile
file
,
HttpServletRequest
request
)
{
boolean
isLegal
=
true
;
if
(
file
.
isEmpty
())
{
// 上传文件为空
return
R
.
error
(
"上传文件不能为空"
);
}
for
(
String
type
:
IMAGE_TYPE
)
{
if
(
StringUtils
.
endsWithIgnoreCase
(
file
.
getOriginalFilename
(),
type
))
{
isLegal
=
false
;
break
;
}
}
if
(
isLegal
)
{
return
R
.
error
(
"上传文件类型不符合"
);
}
File
folder
=
new
File
(
uploadImagesLocation
);
if
(!
folder
.
exists
())
{
folder
.
mkdirs
();
}
String
oldName
=
file
.
getOriginalFilename
();
String
newName
=
UUID
.
randomUUID
().
toString
().
substring
(
4
,
9
)
+
oldName
;
try
{
file
.
transferTo
(
new
File
(
folder
,
newName
));
String
url
=
"/upload_flowChart/"
+
newName
;
return
R
.
ok
(
200
,
url
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
R
.
error
(
"上传文件失败!"
);
}
}
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/TradeRecordController.java
0 → 100644
View file @
315f0fcf
package
cn
.
wisenergy
.
web
.
admin
.
controller
.
app
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.service.app.TradeRecordService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author 86187
* @ Description: 月度奖励
* @ Author : 86187
* @ Date : 2021/3/9 11:04
*/
@Api
(
tags
=
"月度奖励接口"
)
@RestController
@RequestMapping
(
"/award"
)
@Slf4j
public
class
TradeRecordController
{
@Autowired
private
TradeRecordService
tradeRecordService
;
@ApiOperation
(
value
=
"本月累计奖金"
,
notes
=
"本月累计奖金"
,
httpMethod
=
"GET"
)
@GetMapping
(
"/queryMonthAward"
)
public
R
<
Double
>
queryMonthAward
()
{
log
.
info
(
"shop-mall[]TradeRecordController[]queryMonthAward[]input.method"
);
return
tradeRecordService
.
queryMonthAward
();
}
}
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