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
c75af4eb
Commit
c75af4eb
authored
Mar 22, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增团队业绩接口
parent
049b4d2c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
227 additions
and
1 deletion
+227
-1
TeamPerformanceMapper.java
.../main/java/cn/wisenergy/mapper/TeamPerformanceMapper.java
+16
-1
TeamPerformanceMapper.xml
...apper/src/main/resources/mapper/TeamPerformanceMapper.xml
+31
-0
TeamQueryDto.java
...el/src/main/java/cn/wisenergy/model/dto/TeamQueryDto.java
+44
-0
TeamPerformanceService.java
...java/cn/wisenergy/service/app/TeamPerformanceService.java
+20
-0
TeamPerformanceServiceImpl.java
...isenergy/service/app/impl/TeamPerformanceServiceImpl.java
+80
-0
TeamController.java
...cn/wisenergy/web/admin/controller/app/TeamController.java
+36
-0
No files found.
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/TeamPerformanceMapper.java
View file @
c75af4eb
...
...
@@ -4,8 +4,8 @@ import cn.wisenergy.model.app.TeamPerformance;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author 86187
...
...
@@ -85,4 +85,19 @@ public interface TeamPerformanceMapper extends BaseMapper<TeamPerformance> {
*/
Double
monthUserTeamByuserId
(
@Param
(
"userid"
)
String
userId
,
@Param
(
"yearMonth"
)
String
yearMonth
);
/**
* 统计团队业绩总记录数
*
* @param map 入参
* @return 结果
*/
int
count
(
Map
<
String
,
Object
>
map
);
/**
* 获取团队业绩流水列表
* @param map 入参
* @return 结果集
*/
List
<
TeamPerformance
>
getList
(
Map
<
String
,
Object
>
map
);
}
wisenergy-mapper/src/main/resources/mapper/TeamPerformanceMapper.xml
View file @
c75af4eb
...
...
@@ -173,4 +173,35 @@
and `year_month` = #{yearMonth}
</where>
</select>
<select
id=
"count"
resultType=
"java.lang.Integer"
>
select count(1)
from
<include
refid=
"table"
/>
<where>
<if
test=
"userId != null and userId != ''"
>
user_id=#{userId}
</if>
<if
test=
"queryTime != null and queryTime != ''"
>
and `year_month` = #{queryTime}
</if>
</where>
</select>
<select
id=
"getList"
resultType=
"cn.wisenergy.model.app.TeamPerformance"
>
select
<include
refid=
"cols_all"
/>
from
<include
refid=
"table"
/>
<where>
<if
test=
"userId != null and userId != ''"
>
user_id=#{userId}
</if>
<if
test=
"queryTime != null and queryTime != ''"
>
and `year_month` = #{queryTime}
</if>
</where>
order by create_time desc
limit #{startNum},#{endNum}
</select>
</mapper>
\ No newline at end of file
wisenergy-model/src/main/java/cn/wisenergy/model/dto/TeamQueryDto.java
0 → 100644
View file @
c75af4eb
package
cn
.
wisenergy
.
model
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
*@ Description: 团队业绩查询Dto
*@ Author : 86187
*@ Date : 2021/3/22 16:26
* @author 86187
*/
@Data
@ApiModel
(
"TeamQueryDto"
)
public
class
TeamQueryDto
{
/**
* 用户id
*/
@ApiModelProperty
(
value
=
"用户id"
,
name
=
"userId"
)
private
String
userId
;
/**
* 查询时间 格式(yyyy-MM-dd)
*/
@ApiModelProperty
(
value
=
"查询时间 格式(yyyy-MM-dd)"
,
name
=
"queryTime"
)
private
String
queryTime
;
/**
* 页码
*/
@ApiModelProperty
(
value
=
"页码"
,
name
=
"pageNo"
)
private
Integer
pageNo
;
/**
* 页条数
*/
@ApiModelProperty
(
value
=
"页条数"
,
name
=
"pageSize"
)
private
Integer
pageSize
;
private
Integer
startNum
;
private
Integer
endNum
;
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/TeamPerformanceService.java
0 → 100644
View file @
c75af4eb
package
cn
.
wisenergy
.
service
.
app
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.model.app.TeamPerformance
;
import
cn.wisenergy.model.dto.TeamQueryDto
;
import
com.github.pagehelper.PageInfo
;
/**
* @author 86187
*/
public
interface
TeamPerformanceService
{
/**
* 查询团队业绩列表
*
* @param queryDto 查询参数
* @return 列表
*/
R
<
PageInfo
<
TeamPerformance
>>
getList
(
TeamQueryDto
queryDto
);
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/TeamPerformanceServiceImpl.java
0 → 100644
View file @
c75af4eb
package
cn
.
wisenergy
.
service
.
app
.
impl
;
import
cn.wisenergy.common.constant.CommonAttributes
;
import
cn.wisenergy.common.utils.DateUtil
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.mapper.TeamPerformanceMapper
;
import
cn.wisenergy.model.app.TeamPerformance
;
import
cn.wisenergy.model.dto.TeamQueryDto
;
import
cn.wisenergy.service.app.TeamPerformanceService
;
import
com.github.pagehelper.PageInfo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author 86187
*/
@Slf4j
@Service
public
class
TeamPerformanceServiceImpl
implements
TeamPerformanceService
{
@Autowired
private
TeamPerformanceMapper
teamPerformanceMapper
;
@Override
public
R
<
PageInfo
<
TeamPerformance
>>
getList
(
TeamQueryDto
query
)
{
log
.
info
(
"shop-mall[]TeamPerformanceServiceImpl[]getList[]input.param.query:"
+
query
);
if
(
null
==
query
)
{
return
R
.
error
(
"入参不能为空!"
);
}
pageHandle
(
query
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>(
8
);
map
.
put
(
"userId"
,
query
.
getUserId
());
if
(!
StringUtils
.
isBlank
(
query
.
getQueryTime
()))
{
Date
date
=
DateUtil
.
convertStrToDate
(
query
.
getQueryTime
(),
"yyyy-MM-dd"
);
map
.
put
(
"queryTime"
,
date
);
}
int
total
=
teamPerformanceMapper
.
count
(
map
);
map
.
put
(
"startNum"
,
query
.
getStartNum
());
map
.
put
(
"endNum"
,
query
.
getEndNum
());
List
<
TeamPerformance
>
list
=
teamPerformanceMapper
.
getList
(
map
);
PageInfo
<
TeamPerformance
>
info
=
new
PageInfo
<>();
info
.
setPageSize
(
query
.
getPageSize
());
info
.
setPageNum
(
query
.
getPageNo
());
info
.
setTotal
(
total
);
info
.
setList
(
list
);
return
R
.
ok
(
info
);
}
/**
* 分页处理方法
*
* @param schemeVo 参数
*/
private
void
pageHandle
(
TeamQueryDto
schemeVo
)
{
Integer
pageNum
=
schemeVo
.
getPageNo
();
Integer
pageSize
=
schemeVo
.
getPageSize
();
if
(
null
==
pageSize
||
pageSize
==
0
)
{
pageSize
=
10
;
}
if
(
null
==
pageNum
||
pageNum
==
0
)
{
pageNum
=
1
;
}
Integer
endNum
=
pageSize
;
Integer
startNum
=
(
pageNum
-
CommonAttributes
.
NUM_ONE
)
*
pageSize
;
schemeVo
.
setEndNum
(
endNum
);
schemeVo
.
setStartNum
(
startNum
);
schemeVo
.
setPageNo
(
pageNum
);
schemeVo
.
setPageSize
(
pageSize
);
}
}
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/TeamController.java
0 → 100644
View file @
c75af4eb
package
cn
.
wisenergy
.
web
.
admin
.
controller
.
app
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.model.app.TeamPerformance
;
import
cn.wisenergy.model.dto.TeamQueryDto
;
import
cn.wisenergy.service.app.TeamPerformanceService
;
import
com.github.pagehelper.PageInfo
;
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
*/
@Api
(
tags
=
"团队业绩--后台管理"
)
@RestController
@RequestMapping
(
"/team"
)
@Slf4j
public
class
TeamController
{
@Autowired
private
TeamPerformanceService
teamPerformanceService
;
@ApiOperation
(
value
=
"团队业绩列表"
,
notes
=
"团队业绩列表"
,
httpMethod
=
"GET"
)
@ApiImplicitParam
(
name
=
"query"
,
value
=
"查询参数"
,
dataType
=
"TeamQueryDto"
)
@GetMapping
(
"/queryList"
)
public
R
<
PageInfo
<
TeamPerformance
>>
queryList
(
TeamQueryDto
query
)
{
log
.
info
(
"shop-mall[]TeamController[]queryList[]input.param.query:"
+
query
);
return
teamPerformanceService
.
getList
(
query
);
}
}
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