Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
attendance-performance-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
attendance-performance-platform
Commits
99abf6a3
Commit
99abf6a3
authored
Jul 14, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部门绩效总分排行榜,个人绩效总分排行榜
parent
068186e1
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
499 additions
and
23 deletions
+499
-23
attendance-performance-manager/src/main/java/com/mortals/xhx/common/code/SummaryTopTypeEnum.java
.../java/com/mortals/xhx/common/code/SummaryTopTypeEnum.java
+65
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dept/dao/DeptPerformStatDao.java
...a/com/mortals/xhx/module/dept/dao/DeptPerformStatDao.java
+20
-1
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dept/dao/ibatis/DeptPerformStatDaoImpl.java
...ls/xhx/module/dept/dao/ibatis/DeptPerformStatDaoImpl.java
+14
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dept/model/vo/DeptSummaryTopQuery.java
...mortals/xhx/module/dept/model/vo/DeptSummaryTopQuery.java
+14
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dept/service/DeptPerformStatService.java
...rtals/xhx/module/dept/service/DeptPerformStatService.java
+13
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dept/service/impl/DeptPerformStatServiceImpl.java
.../module/dept/service/impl/DeptPerformStatServiceImpl.java
+46
-1
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dept/web/DeptPerformStatController.java
...ortals/xhx/module/dept/web/DeptPerformStatController.java
+36
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/dao/StaffPerformStatDao.java
...com/mortals/xhx/module/staff/dao/StaffPerformStatDao.java
+20
-1
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/dao/ibatis/StaffPerformStatDaoImpl.java
.../xhx/module/staff/dao/ibatis/StaffPerformStatDaoImpl.java
+14
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/model/vo/StaffSummaryTopQuery.java
...rtals/xhx/module/staff/model/vo/StaffSummaryTopQuery.java
+24
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/StaffPerformStatService.java
...als/xhx/module/staff/service/StaffPerformStatService.java
+12
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffPerformStatServiceImpl.java
...odule/staff/service/impl/StaffPerformStatServiceImpl.java
+48
-4
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/web/StaffPerformStatController.java
...tals/xhx/module/staff/web/StaffPerformStatController.java
+41
-15
attendance-performance-manager/src/main/resources/sqlmap/module/dept/DeptPerformStatMapperExt.xml
...resources/sqlmap/module/dept/DeptPerformStatMapperExt.xml
+53
-1
attendance-performance-manager/src/main/resources/sqlmap/module/staff/StaffPerformStatMapperExt.xml
...sources/sqlmap/module/staff/StaffPerformStatMapperExt.xml
+79
-0
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/common/code/SummaryTopTypeEnum.java
0 → 100644
View file @
99abf6a3
package
com.mortals.xhx.common.code
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
/***
* 绩效排行榜汇总方式
*/
public
enum
SummaryTopTypeEnum
{
年
(
1
,
"年"
),
月
(
2
,
"月"
),
日
(
3
,
"日"
),
;
private
Integer
value
;
private
String
desc
;
SummaryTopTypeEnum
(
Integer
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
Integer
getValue
()
{
return
this
.
value
;
}
public
String
getDesc
()
{
return
this
.
desc
;
}
public
static
SummaryTopTypeEnum
getByValue
(
Integer
value
)
{
for
(
SummaryTopTypeEnum
item
:
SummaryTopTypeEnum
.
values
())
{
if
(
item
.
getValue
()
==
value
)
{
return
item
;
}
}
return
null
;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public
static
Map
<
String
,
String
>
getEnumMap
(
Integer
...
eItem
)
{
Map
<
String
,
String
>
resultMap
=
new
LinkedHashMap
<>();
for
(
SummaryTopTypeEnum
item
:
SummaryTopTypeEnum
.
values
())
{
try
{
boolean
hasE
=
false
;
for
(
Integer
e
:
eItem
)
{
if
(
item
.
getValue
()
==
e
)
{
hasE
=
true
;
break
;
}
}
if
(!
hasE
)
{
resultMap
.
put
(
item
.
getValue
()
+
""
,
item
.
getDesc
());
}
}
catch
(
Exception
ex
)
{
}
}
return
resultMap
;
}
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dept/dao/DeptPerformStatDao.java
View file @
99abf6a3
...
@@ -2,6 +2,8 @@ package com.mortals.xhx.module.dept.dao;
...
@@ -2,6 +2,8 @@ package com.mortals.xhx.module.dept.dao;
import
com.mortals.framework.dao.ICRUDDao
;
import
com.mortals.framework.dao.ICRUDDao
;
import
com.mortals.xhx.module.dept.model.DeptPerformStatEntity
;
import
com.mortals.xhx.module.dept.model.DeptPerformStatEntity
;
import
com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery
;
import
java.util.List
;
import
java.util.List
;
/**
/**
* 部门绩效分数统计Dao
* 部门绩效分数统计Dao
...
@@ -13,5 +15,22 @@ import java.util.List;
...
@@ -13,5 +15,22 @@ import java.util.List;
public
interface
DeptPerformStatDao
extends
ICRUDDao
<
DeptPerformStatEntity
,
Long
>{
public
interface
DeptPerformStatDao
extends
ICRUDDao
<
DeptPerformStatEntity
,
Long
>{
/**
* 按天top10
* @param query
* @return
*/
List
<
DeptPerformStatEntity
>
getDaySummaryList
(
DeptSummaryTopQuery
query
);
/**
* 按月top10
* @param query
* @return
*/
List
<
DeptPerformStatEntity
>
getMonthSummaryList
(
DeptSummaryTopQuery
query
);
/**
* 按年top10
* @param query
* @return
*/
List
<
DeptPerformStatEntity
>
getYearSummaryList
(
DeptSummaryTopQuery
query
);
}
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dept/dao/ibatis/DeptPerformStatDaoImpl.java
View file @
99abf6a3
package
com.mortals.xhx.module.dept.dao.ibatis
;
package
com.mortals.xhx.module.dept.dao.ibatis
;
import
com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
com.mortals.xhx.module.dept.dao.DeptPerformStatDao
;
import
com.mortals.xhx.module.dept.dao.DeptPerformStatDao
;
import
com.mortals.xhx.module.dept.model.DeptPerformStatEntity
;
import
com.mortals.xhx.module.dept.model.DeptPerformStatEntity
;
...
@@ -17,5 +18,18 @@ import java.util.List;
...
@@ -17,5 +18,18 @@ import java.util.List;
public
class
DeptPerformStatDaoImpl
extends
BaseCRUDDaoMybatis
<
DeptPerformStatEntity
,
Long
>
implements
DeptPerformStatDao
{
public
class
DeptPerformStatDaoImpl
extends
BaseCRUDDaoMybatis
<
DeptPerformStatEntity
,
Long
>
implements
DeptPerformStatDao
{
@Override
public
List
<
DeptPerformStatEntity
>
getDaySummaryList
(
DeptSummaryTopQuery
query
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getDaySummaryList"
),
query
);
}
@Override
public
List
<
DeptPerformStatEntity
>
getMonthSummaryList
(
DeptSummaryTopQuery
query
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getMonthSummaryList"
),
query
);
}
@Override
public
List
<
DeptPerformStatEntity
>
getYearSummaryList
(
DeptSummaryTopQuery
query
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getYearSummaryList"
),
query
);
}
}
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dept/model/vo/DeptSummaryTopQuery.java
View file @
99abf6a3
...
@@ -7,4 +7,18 @@ import lombok.Data;
...
@@ -7,4 +7,18 @@ import lombok.Data;
*/
*/
@Data
@Data
public
class
DeptSummaryTopQuery
{
public
class
DeptSummaryTopQuery
{
/** 汇总方式 1按年,2按月,3按天*/
private
Integer
summaryType
;
/**
* 年
*/
private
Integer
year
;
/**
* 月
*/
private
Integer
month
;
/**
* 日
*/
private
Integer
day
;
}
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dept/service/DeptPerformStatService.java
View file @
99abf6a3
package
com.mortals.xhx.module.dept.service
;
package
com.mortals.xhx.module.dept.service
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.dept.model.DeptPerformStatEntity
;
import
com.mortals.xhx.module.dept.model.DeptPerformStatEntity
;
import
com.mortals.xhx.module.dept.dao.DeptPerformStatDao
;
import
com.mortals.xhx.module.dept.dao.DeptPerformStatDao
;
import
com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery
;
import
java.util.List
;
/**
/**
* DeptPerformStatService
* DeptPerformStatService
*
*
...
@@ -13,4 +18,12 @@ import com.mortals.xhx.module.dept.dao.DeptPerformStatDao;
...
@@ -13,4 +18,12 @@ import com.mortals.xhx.module.dept.dao.DeptPerformStatDao;
public
interface
DeptPerformStatService
extends
ICRUDService
<
DeptPerformStatEntity
,
Long
>{
public
interface
DeptPerformStatService
extends
ICRUDService
<
DeptPerformStatEntity
,
Long
>{
DeptPerformStatDao
getDao
();
DeptPerformStatDao
getDao
();
/**
* 获取部门绩效排行榜
* @param query
* @return
*/
List
<
DeptPerformStatEntity
>
getSummaryTopList
(
DeptSummaryTopQuery
query
)
throws
AppException
;
}
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dept/service/impl/DeptPerformStatServiceImpl.java
View file @
99abf6a3
package
com.mortals.xhx.module.dept.service.impl
;
package
com.mortals.xhx.module.dept.service.impl
;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.xhx.common.code.SummaryTopTypeEnum
;
import
com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
...
@@ -7,6 +10,10 @@ import com.mortals.xhx.module.dept.dao.DeptPerformStatDao;
...
@@ -7,6 +10,10 @@ import com.mortals.xhx.module.dept.dao.DeptPerformStatDao;
import
com.mortals.xhx.module.dept.model.DeptPerformStatEntity
;
import
com.mortals.xhx.module.dept.model.DeptPerformStatEntity
;
import
com.mortals.xhx.module.dept.service.DeptPerformStatService
;
import
com.mortals.xhx.module.dept.service.DeptPerformStatService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
java.time.LocalDate
;
import
java.util.List
;
/**
/**
* DeptPerformStatService
* DeptPerformStatService
* 部门绩效分数统计 service实现
* 部门绩效分数统计 service实现
...
@@ -17,5 +24,43 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -17,5 +24,43 @@ import lombok.extern.slf4j.Slf4j;
@Service
(
"deptPerformStatService"
)
@Service
(
"deptPerformStatService"
)
@Slf4j
@Slf4j
public
class
DeptPerformStatServiceImpl
extends
AbstractCRUDServiceImpl
<
DeptPerformStatDao
,
DeptPerformStatEntity
,
Long
>
implements
DeptPerformStatService
{
public
class
DeptPerformStatServiceImpl
extends
AbstractCRUDServiceImpl
<
DeptPerformStatDao
,
DeptPerformStatEntity
,
Long
>
implements
DeptPerformStatService
{
@Override
public
List
<
DeptPerformStatEntity
>
getSummaryTopList
(
DeptSummaryTopQuery
query
)
throws
AppException
{
LocalDate
now
=
LocalDate
.
now
();
List
<
DeptPerformStatEntity
>
result
=
null
;
if
(
query
==
null
){
query
=
new
DeptSummaryTopQuery
();
query
.
setSummaryType
(
SummaryTopTypeEnum
.
月
.
getValue
());
}
if
(
query
.
getSummaryType
()
==
SummaryTopTypeEnum
.
年
.
getValue
()){
if
(
query
.
getYear
()==
null
){
query
.
setYear
(
now
.
getYear
());
}
result
=
dao
.
getYearSummaryList
(
query
);
}
if
(
query
.
getSummaryType
()
==
SummaryTopTypeEnum
.
月
.
getValue
()){
if
(
query
.
getYear
()==
null
){
query
.
setYear
(
now
.
getYear
());
}
if
(
query
.
getMonth
()==
null
){
query
.
setMonth
(
now
.
getMonthValue
());
}
result
=
dao
.
getMonthSummaryList
(
query
);
}
if
(
query
.
getSummaryType
()
==
SummaryTopTypeEnum
.
日
.
getValue
()){
if
(
query
.
getYear
()==
null
){
query
.
setYear
(
now
.
getYear
());
}
if
(
query
.
getMonth
()==
null
){
query
.
setMonth
(
now
.
getMonthValue
());
}
if
(
query
.
getDay
()==
null
){
query
.
setDay
(
now
.
getDayOfMonth
());
}
result
=
dao
.
getDaySummaryList
(
query
);
}
return
result
;
}
}
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/dept/web/DeptPerformStatController.java
View file @
99abf6a3
package
com.mortals.xhx.module.dept.web
;
package
com.mortals.xhx.module.dept.web
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.Result
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
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
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -47,5 +53,35 @@ public class DeptPerformStatController extends BaseCRUDJsonBodyMappingController
...
@@ -47,5 +53,35 @@ public class DeptPerformStatController extends BaseCRUDJsonBodyMappingController
super
.
init
(
model
,
context
);
super
.
init
(
model
,
context
);
}
}
/**
* 部门绩效排行榜
* @param query
* @return
*/
@PostMapping
({
"summary/top"
})
@UnAuth
public
Rest
<
Object
>
getSummaryTopList
(
@RequestBody
DeptSummaryTopQuery
query
)
{
Rest
<
Object
>
ret
=
new
Rest
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
Context
context
=
this
.
getContext
();
String
busiDesc
=
"查询部门绩效排行榜"
;
int
code
=
1
;
try
{
List
<
DeptPerformStatEntity
>
result
=
this
.
getService
().
getSummaryTopList
(
query
);
model
.
put
(
"data"
,
result
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
if
(!
ObjectUtils
.
isEmpty
(
context
)
&&
!
ObjectUtils
.
isEmpty
(
context
.
getUser
()))
{
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
}
catch
(
Exception
var9
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var9
);
}
this
.
init
(
model
,
context
);
ret
.
setCode
(
code
);
ret
.
setData
(
model
.
get
(
"data"
));
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
return
ret
;
}
}
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/dao/StaffPerformStatDao.java
View file @
99abf6a3
...
@@ -2,6 +2,8 @@ package com.mortals.xhx.module.staff.dao;
...
@@ -2,6 +2,8 @@ package com.mortals.xhx.module.staff.dao;
import
com.mortals.framework.dao.ICRUDDao
;
import
com.mortals.framework.dao.ICRUDDao
;
import
com.mortals.xhx.module.staff.model.StaffPerformStatEntity
;
import
com.mortals.xhx.module.staff.model.StaffPerformStatEntity
;
import
com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery
;
import
java.util.List
;
import
java.util.List
;
/**
/**
* 员工绩效统计Dao
* 员工绩效统计Dao
...
@@ -13,5 +15,22 @@ import java.util.List;
...
@@ -13,5 +15,22 @@ import java.util.List;
public
interface
StaffPerformStatDao
extends
ICRUDDao
<
StaffPerformStatEntity
,
Long
>{
public
interface
StaffPerformStatDao
extends
ICRUDDao
<
StaffPerformStatEntity
,
Long
>{
/**
* 按天top10
* @param query
* @return
*/
List
<
StaffPerformStatEntity
>
getDaySummaryList
(
StaffSummaryTopQuery
query
);
/**
* 按月top10
* @param query
* @return
*/
List
<
StaffPerformStatEntity
>
getMonthSummaryList
(
StaffSummaryTopQuery
query
);
/**
* 按年top10
* @param query
* @return
*/
List
<
StaffPerformStatEntity
>
getYearSummaryList
(
StaffSummaryTopQuery
query
);
}
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/dao/ibatis/StaffPerformStatDaoImpl.java
View file @
99abf6a3
package
com.mortals.xhx.module.staff.dao.ibatis
;
package
com.mortals.xhx.module.staff.dao.ibatis
;
import
com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
com.mortals.xhx.module.staff.dao.StaffPerformStatDao
;
import
com.mortals.xhx.module.staff.dao.StaffPerformStatDao
;
import
com.mortals.xhx.module.staff.model.StaffPerformStatEntity
;
import
com.mortals.xhx.module.staff.model.StaffPerformStatEntity
;
...
@@ -17,5 +18,18 @@ import java.util.List;
...
@@ -17,5 +18,18 @@ import java.util.List;
public
class
StaffPerformStatDaoImpl
extends
BaseCRUDDaoMybatis
<
StaffPerformStatEntity
,
Long
>
implements
StaffPerformStatDao
{
public
class
StaffPerformStatDaoImpl
extends
BaseCRUDDaoMybatis
<
StaffPerformStatEntity
,
Long
>
implements
StaffPerformStatDao
{
@Override
public
List
<
StaffPerformStatEntity
>
getDaySummaryList
(
StaffSummaryTopQuery
query
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getDaySummaryList"
),
query
);
}
@Override
public
List
<
StaffPerformStatEntity
>
getMonthSummaryList
(
StaffSummaryTopQuery
query
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getMonthSummaryList"
),
query
);
}
@Override
public
List
<
StaffPerformStatEntity
>
getYearSummaryList
(
StaffSummaryTopQuery
query
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getYearSummaryList"
),
query
);
}
}
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/model/vo/StaffSummaryTopQuery.java
0 → 100644
View file @
99abf6a3
package
com.mortals.xhx.module.staff.model.vo
;
import
lombok.Data
;
/**
* 个人绩效总分排名统计查询条件
*/
@Data
public
class
StaffSummaryTopQuery
{
/** 汇总方式 1按年,2按月,3按天*/
private
Integer
summaryType
;
/**
* 年
*/
private
Integer
year
;
/**
* 月
*/
private
Integer
month
;
/**
* 日
*/
private
Integer
day
;
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/StaffPerformStatService.java
View file @
99abf6a3
package
com.mortals.xhx.module.staff.service
;
package
com.mortals.xhx.module.staff.service
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.staff.model.StaffPerformStatEntity
;
import
com.mortals.xhx.module.staff.model.StaffPerformStatEntity
;
import
com.mortals.xhx.module.staff.dao.StaffPerformStatDao
;
import
com.mortals.xhx.module.staff.dao.StaffPerformStatDao
;
import
com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery
;
import
java.util.List
;
/**
/**
* StaffPerformStatService
* StaffPerformStatService
*
*
...
@@ -13,4 +18,11 @@ import com.mortals.xhx.module.staff.dao.StaffPerformStatDao;
...
@@ -13,4 +18,11 @@ import com.mortals.xhx.module.staff.dao.StaffPerformStatDao;
public
interface
StaffPerformStatService
extends
ICRUDService
<
StaffPerformStatEntity
,
Long
>{
public
interface
StaffPerformStatService
extends
ICRUDService
<
StaffPerformStatEntity
,
Long
>{
StaffPerformStatDao
getDao
();
StaffPerformStatDao
getDao
();
/**
* 获取部门个人绩效排行榜
* @param query
* @return
*/
List
<
StaffPerformStatEntity
>
getSummaryTopList
(
StaffSummaryTopQuery
query
)
throws
AppException
;
}
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffPerformStatServiceImpl.java
View file @
99abf6a3
package
com.mortals.xhx.module.staff.service.impl
;
package
com.mortals.xhx.module.staff.service.impl
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.xhx.common.code.SummaryTopTypeEnum
;
import
com.mortals.xhx.module.staff.dao.StaffPerformStatDao
;
import
com.mortals.xhx.module.staff.dao.StaffPerformStatDao
;
import
com.mortals.xhx.module.staff.model.StaffPerformStatEntity
;
import
com.mortals.xhx.module.staff.model.StaffPerformStatEntity
;
import
com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery
;
import
com.mortals.xhx.module.staff.service.StaffPerformStatService
;
import
com.mortals.xhx.module.staff.service.StaffPerformStatService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDate
;
import
java.util.List
;
/**
/**
* StaffPerformStatService
* StaffPerformStatService
* 员工绩效统计 service实现
* 员工绩效统计 service实现
...
@@ -17,5 +23,43 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -17,5 +23,43 @@ import lombok.extern.slf4j.Slf4j;
@Service
(
"staffPerformStatService"
)
@Service
(
"staffPerformStatService"
)
@Slf4j
@Slf4j
public
class
StaffPerformStatServiceImpl
extends
AbstractCRUDServiceImpl
<
StaffPerformStatDao
,
StaffPerformStatEntity
,
Long
>
implements
StaffPerformStatService
{
public
class
StaffPerformStatServiceImpl
extends
AbstractCRUDServiceImpl
<
StaffPerformStatDao
,
StaffPerformStatEntity
,
Long
>
implements
StaffPerformStatService
{
@Override
public
List
<
StaffPerformStatEntity
>
getSummaryTopList
(
StaffSummaryTopQuery
query
)
throws
AppException
{
LocalDate
now
=
LocalDate
.
now
();
List
<
StaffPerformStatEntity
>
result
=
null
;
if
(
query
==
null
){
query
=
new
StaffSummaryTopQuery
();
query
.
setSummaryType
(
SummaryTopTypeEnum
.
月
.
getValue
());
}
if
(
query
.
getSummaryType
()
==
SummaryTopTypeEnum
.
年
.
getValue
()){
if
(
query
.
getYear
()==
null
){
query
.
setYear
(
now
.
getYear
());
}
result
=
dao
.
getYearSummaryList
(
query
);
}
if
(
query
.
getSummaryType
()
==
SummaryTopTypeEnum
.
月
.
getValue
()){
if
(
query
.
getYear
()==
null
){
query
.
setYear
(
now
.
getYear
());
}
if
(
query
.
getMonth
()==
null
){
query
.
setMonth
(
now
.
getMonthValue
());
}
result
=
dao
.
getMonthSummaryList
(
query
);
}
if
(
query
.
getSummaryType
()
==
SummaryTopTypeEnum
.
日
.
getValue
()){
if
(
query
.
getYear
()==
null
){
query
.
setYear
(
now
.
getYear
());
}
if
(
query
.
getMonth
()==
null
){
query
.
setMonth
(
now
.
getMonthValue
());
}
if
(
query
.
getDay
()==
null
){
query
.
setDay
(
now
.
getDayOfMonth
());
}
result
=
dao
.
getDaySummaryList
(
query
);
}
return
result
;
}
}
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/web/StaffPerformStatController.java
View file @
99abf6a3
package
com.mortals.xhx.module.staff.web
;
package
com.mortals.xhx.module.staff.web
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.module.staff.model.StaffPerformStatEntity
;
import
com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery
;
import
com.mortals.xhx.module.staff.service.StaffPerformStatService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
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
org.springframework.web.bind.annotation.*
;
import
com.mortals.framework.model.Context
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.module.staff.model.StaffPerformStatEntity
;
import
com.mortals.xhx.module.staff.service.StaffPerformStatService
;
import
org.apache.commons.lang3.ArrayUtils
;
import
com.mortals.framework.util.StringUtils
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.Arrays
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
static
com
.
mortals
.
framework
.
ap
.
SysConstains
.*;
/**
/**
*
*
* 员工绩效统计
* 员工绩效统计
...
@@ -47,5 +43,35 @@ public class StaffPerformStatController extends BaseCRUDJsonBodyMappingControlle
...
@@ -47,5 +43,35 @@ public class StaffPerformStatController extends BaseCRUDJsonBodyMappingControlle
super
.
init
(
model
,
context
);
super
.
init
(
model
,
context
);
}
}
/**
* 部门绩效排行榜
* @param query
* @return
*/
@PostMapping
({
"summary/top"
})
@UnAuth
public
Rest
<
Object
>
getSummaryTopList
(
@RequestBody
StaffSummaryTopQuery
query
)
{
Rest
<
Object
>
ret
=
new
Rest
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
Context
context
=
this
.
getContext
();
String
busiDesc
=
"查询个人绩效排行榜"
;
int
code
=
1
;
try
{
List
<
StaffPerformStatEntity
>
result
=
this
.
getService
().
getSummaryTopList
(
query
);
model
.
put
(
"data"
,
result
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
if
(!
ObjectUtils
.
isEmpty
(
context
)
&&
!
ObjectUtils
.
isEmpty
(
context
.
getUser
()))
{
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
}
catch
(
Exception
var9
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var9
);
}
this
.
init
(
model
,
context
);
ret
.
setCode
(
code
);
ret
.
setData
(
model
.
get
(
"data"
));
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
return
ret
;
}
}
}
\ No newline at end of file
attendance-performance-manager/src/main/resources/sqlmap/module/dept/DeptPerformStatMapperExt.xml
View file @
99abf6a3
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
"mybatis-3-mapper.dtd">
"mybatis-3-mapper.dtd">
<mapper
namespace=
"com.mortals.xhx.module.dept.dao.ibatis.DeptPerformStatDaoImpl"
>
<mapper
namespace=
"com.mortals.xhx.module.dept.dao.ibatis.DeptPerformStatDaoImpl"
>
<!-- 按天top10 -->
<!-- 按天top10 -->
<select
id=
"get
SummaryCheck
List"
parameterType=
"com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery"
resultType=
"com.mortals.xhx.module.dept.model.DeptPerformStatEntity"
>
<select
id=
"get
DaySummary
List"
parameterType=
"com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery"
resultType=
"com.mortals.xhx.module.dept.model.DeptPerformStatEntity"
>
SELECT * FROM (
SELECT * FROM (
SELECT
SELECT
`year`,
`year`,
...
@@ -31,4 +31,56 @@
...
@@ -31,4 +31,56 @@
`day`
`day`
) AS a ORDER BY totalScore DESC LIMIT 10
) AS a ORDER BY totalScore DESC LIMIT 10
</select>
</select>
<!-- 按月top10 -->
<select
id=
"getMonthSummaryList"
parameterType=
"com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery"
resultType=
"com.mortals.xhx.module.dept.model.DeptPerformStatEntity"
>
SELECT * FROM (
SELECT
`year`,
`month`,
deptId,
deptName,
SUM(totalScore) AS totalScore
FROM
mortals_xhx_dept_perform_stat
WHERE 1=1
<if
test=
"year != null"
>
AND `year` = #{year}
</if>
<if
test=
"month != null"
>
AND `month` = #{month}
</if>
GROUP BY
deptId,
`year`,
`month`
) AS a ORDER BY totalScore DESC LIMIT 10
</select>
<!-- 按年top10 -->
<select
id=
"getYearSummaryList"
parameterType=
"com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery"
resultType=
"com.mortals.xhx.module.dept.model.DeptPerformStatEntity"
>
SELECT * FROM (
SELECT
`year`,
deptId,
deptName,
SUM(totalScore) AS totalScore
FROM
mortals_xhx_dept_perform_stat
WHERE 1=1
<if
test=
"year != null"
>
AND `year` = #{year}
</if>
<if
test=
"month != null"
>
AND `month` = #{month}
</if>
<if
test=
"day != null"
>
AND `day` = #{day}
</if>
GROUP BY
deptId,
`year`
) AS a ORDER BY totalScore DESC LIMIT 10
</select>
</mapper>
</mapper>
\ No newline at end of file
attendance-performance-manager/src/main/resources/sqlmap/module/staff/StaffPerformStatMapperExt.xml
0 → 100644
View file @
99abf6a3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper
namespace=
"com.mortals.xhx.module.staff.dao.ibatis.StaffPerformStatDaoImpl"
>
<!-- 按天top10 -->
<select
id=
"getDaySummaryList"
parameterType=
"com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery"
resultType=
"com.mortals.xhx.module.staff.model.StaffPerformStatEntity"
>
SELECT * FROM (
SELECT
`year`,
`month`,
`day`,
staffId,
staffName,
SUM(totalScore) AS totalScore
FROM
mortals_xhx_staff_perform_stat
WHERE 1=1
<if
test=
"year != null"
>
AND `year` = #{year}
</if>
<if
test=
"month != null"
>
AND `month` = #{month}
</if>
<if
test=
"day != null"
>
AND `day` = #{day}
</if>
GROUP BY
staffId,
`year`,
`month`,
`day`
) AS a ORDER BY totalScore DESC LIMIT 10
</select>
<!-- 按月top10 -->
<select
id=
"getMonthSummaryList"
parameterType=
"com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery"
resultType=
"com.mortals.xhx.module.staff.model.StaffPerformStatEntity"
>
SELECT * FROM (
SELECT
`year`,
`month`,
staffId,
staffName,
SUM(totalScore) AS totalScore
FROM
mortals_xhx_staff_perform_stat
WHERE 1=1
<if
test=
"year != null"
>
AND `year` = #{year}
</if>
<if
test=
"month != null"
>
AND `month` = #{month}
</if>
GROUP BY
staffId,
`year`,
`month`
) AS a ORDER BY totalScore DESC LIMIT 10
</select>
<!-- 按年top10 -->
<select
id=
"getYearSummaryList"
parameterType=
"com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery"
resultType=
"com.mortals.xhx.module.staff.model.StaffPerformStatEntity"
>
SELECT * FROM (
SELECT
`year`,
staffId,
staffName,
SUM(totalScore) AS totalScore
FROM
mortals_xhx_staff_perform_stat
WHERE 1=1
<if
test=
"year != null"
>
AND `year` = #{year}
</if>
GROUP BY
staffId,
`year`
) AS a ORDER BY totalScore DESC LIMIT 10
</select>
</mapper>
\ No newline at end of file
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