Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
work_service
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
work_service
Commits
acd39d15
Commit
acd39d15
authored
Feb 05, 2021
by
nie'hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
c2fd5480
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
261 additions
and
68 deletions
+261
-68
WorkTimeOrderMapper.java
...rc/main/java/cn/wisenergy/mapper/WorkTimeOrderMapper.java
+19
-5
WorkTimeOrderMapper.xml
...-mapper/src/main/resources/mapper/WorkTimeOrderMapper.xml
+82
-44
ProjectWorkTimeAndType.java
...n/java/cn/wisenergy/model/dto/ProjectWorkTimeAndType.java
+40
-0
UserWorkTimeStatisticsByProject.java
.../wisenergy/model/dto/UserWorkTimeStatisticsByProject.java
+42
-0
StatisticsService.java
...src/main/java/cn/wisenergy/service/StatisticsService.java
+10
-0
StatisticsServiceImpl.java
...java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
+48
-9
StatisticsController.java
...energy/web/admin/controller/app/StatisticsController.java
+20
-10
No files found.
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/WorkTimeOrderMapper.java
View file @
acd39d15
...
@@ -3,6 +3,7 @@ package cn.wisenergy.mapper;
...
@@ -3,6 +3,7 @@ package cn.wisenergy.mapper;
import
cn.wisenergy.model.app.WorkTimeOrder
;
import
cn.wisenergy.model.app.WorkTimeOrder
;
import
cn.wisenergy.model.dto.DayWorkTimeAndType
;
import
cn.wisenergy.model.dto.DayWorkTimeAndType
;
import
cn.wisenergy.model.dto.MonthlyWorkingHoursStatistics
;
import
cn.wisenergy.model.dto.MonthlyWorkingHoursStatistics
;
import
cn.wisenergy.model.dto.UserWorkTimeStatisticsByProject
;
import
cn.wisenergy.model.dto.WorkTimeAndCostCollect
;
import
cn.wisenergy.model.dto.WorkTimeAndCostCollect
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
@@ -24,21 +25,22 @@ public interface WorkTimeOrderMapper extends BaseMapper<WorkTimeOrder> {
...
@@ -24,21 +25,22 @@ public interface WorkTimeOrderMapper extends BaseMapper<WorkTimeOrder> {
/**
/**
* 功能:获取某个月的数据
* 功能:获取某个月的数据
*
* @param userId
* @param userId
* @param workMonth
* @param workMonth
* @return
* @return
*/
*/
List
<
WorkTimeOrder
>
geByMonth
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"workMonth"
)
Date
workMonth
,
@Param
(
"status"
)
Integer
status
);
List
<
WorkTimeOrder
>
geByMonth
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"workMonth"
)
Date
workMonth
,
@Param
(
"status"
)
Integer
status
);
List
<
WorkTimeOrder
>
getByDay
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"workDay"
)
Date
workDay
);
List
<
WorkTimeOrder
>
getByDay
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"workDay"
)
Date
workDay
);
int
save
(
WorkTimeOrder
workTimeOrder
);
int
save
(
WorkTimeOrder
workTimeOrder
);
int
updateByIds
(
@Param
(
"reviewerId"
)
Integer
reviewerId
,
@Param
(
"ids"
)
List
<
Integer
>
ids
);
int
updateByIds
(
@Param
(
"reviewerId"
)
Integer
reviewerId
,
@Param
(
"ids"
)
List
<
Integer
>
ids
);
int
updateStatusById
(
@Param
(
"reviewerId"
)
Integer
reviewerId
,
@Param
(
"id"
)
Integer
id
,
@Param
(
"reason"
)
String
reason
);
int
updateStatusById
(
@Param
(
"reviewerId"
)
Integer
reviewerId
,
@Param
(
"id"
)
Integer
id
,
@Param
(
"reason"
)
String
reason
);
List
<
WorkTimeOrder
>
queryByPage
(
@Param
(
"status"
)
Integer
status
,
@Param
(
"projectId"
)
Integer
projectId
,
@Param
(
"type"
)
Integer
type
,
@Param
(
"deptId"
)
Integer
deptId
);
List
<
WorkTimeOrder
>
queryByPage
(
@Param
(
"status"
)
Integer
status
,
@Param
(
"projectId"
)
Integer
projectId
,
@Param
(
"type"
)
Integer
type
,
@Param
(
"deptId"
)
Integer
deptId
);
/**
/**
* 根据填报项目类型获取次数和工时汇总
* 根据填报项目类型获取次数和工时汇总
...
@@ -67,18 +69,30 @@ public interface WorkTimeOrderMapper extends BaseMapper<WorkTimeOrder> {
...
@@ -67,18 +69,30 @@ public interface WorkTimeOrderMapper extends BaseMapper<WorkTimeOrder> {
*/
*/
Integer
getCountByCondition
(
Map
<
String
,
Object
>
map
);
Integer
getCountByCondition
(
Map
<
String
,
Object
>
map
);
/**
* 获取项目或商机的成本
*
* @param projectIds
* @param firstDayOfMonth
* @return
*/
List
<
WorkTimeAndCostCollect
>
getWorkTimeAndCostCollect
(
@Param
(
"projectIds"
)
List
<
Integer
>
projectIds
,
@Param
(
"firstDayOfMonth"
)
String
firstDayOfMonth
);
List
<
WorkTimeAndCostCollect
>
getWorkTimeAndCostCollect
(
@Param
(
"projectIds"
)
List
<
Integer
>
projectIds
,
@Param
(
"firstDayOfMonth"
)
String
firstDayOfMonth
);
/**
/**
* 获取上班日期集合
* 获取上班日期集合
*
* @param firstDayOfMonth
* @param firstDayOfMonth
* @return
* @return
*/
*/
List
<
Date
>
getDaysByDateAndStatus
(
@Param
(
"firstDayOfMonth"
)
Date
firstDayOfMonth
,
@Param
(
"userId"
)
Integer
userId
);
List
<
Date
>
getDaysByDateAndStatus
(
@Param
(
"firstDayOfMonth"
)
Date
firstDayOfMonth
,
@Param
(
"userId"
)
Integer
userId
);
List
<
WorkTimeOrder
>
getAutoOrder
(
Integer
autoExamine
);
List
<
WorkTimeOrder
>
getAutoOrder
(
Integer
autoExamine
);
int
updateAutoExamine
(
@Param
(
"workIds"
)
List
<
Integer
>
workIds
);
int
updateAutoExamine
(
@Param
(
"workIds"
)
List
<
Integer
>
workIds
);
/**
* 获取人员项目工时
*/
List
<
UserWorkTimeStatisticsByProject
>
getUserProjectWorkTimeStatistics
(
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
,
@Param
(
"status"
)
Integer
status
,
@Param
(
"projectIds"
)
List
<
Integer
>
projectIds
);
}
}
wisenergy-mapper/src/main/resources/mapper/WorkTimeOrderMapper.xml
View file @
acd39d15
This diff is collapsed.
Click to expand it.
wisenergy-model/src/main/java/cn/wisenergy/model/dto/ProjectWorkTimeAndType.java
0 → 100644
View file @
acd39d15
package
cn
.
wisenergy
.
model
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"ProjectWorkTimeAndType"
,
description
=
"人员工时统计中存储项目和工时信息"
)
public
class
ProjectWorkTimeAndType
{
/**
* 项目编号
*/
@ApiModelProperty
(
name
=
"projectId"
,
value
=
"项目编号"
)
private
Integer
projectId
;
/**
* 项目名称
*/
@ApiModelProperty
(
name
=
"projectName"
,
value
=
"项目名称"
)
private
String
projectName
;
/**
* 项目类型
*/
@ApiModelProperty
(
name
=
"projectType"
,
value
=
"项目类型"
)
private
String
projectType
;
/**
* 是否加班
*/
@ApiModelProperty
(
name
=
"isOvertime"
,
value
=
"是否加班"
)
private
String
isOvertime
;
/**
* 总工时
*/
@ApiModelProperty
(
name
=
"workTime"
,
value
=
"总工时"
)
private
String
workTime
;
}
\ No newline at end of file
wisenergy-model/src/main/java/cn/wisenergy/model/dto/UserWorkTimeStatisticsByProject.java
0 → 100644
View file @
acd39d15
package
cn
.
wisenergy
.
model
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* @description: 用户的项目工时统计
* @author: nh
* @create: 2021-02-03 15:45
**/
@Data
@ApiModel
(
value
=
"UserWorkTimeStatisticsByProject"
,
description
=
"用户参与正在进行的项目工时统计"
)
public
class
UserWorkTimeStatisticsByProject
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
4059589583836766681L
;
/**
* 用户主键
*/
@ApiModelProperty
(
name
=
"userId"
,
value
=
"用户主键"
)
private
Integer
userId
;
/**
* 用户名
*/
@ApiModelProperty
(
name
=
"userName"
,
value
=
"用户名"
)
private
String
userName
;
/**
* 项目工时列表
*/
@ApiModelProperty
(
name
=
"projectWorkTimeAndType"
,
value
=
"项目工时列表"
)
private
List
<
ProjectWorkTimeAndType
>
projectWorkTimeAndType
;
}
wisenergy-service/src/main/java/cn/wisenergy/service/StatisticsService.java
View file @
acd39d15
package
cn
.
wisenergy
.
service
;
package
cn
.
wisenergy
.
service
;
import
cn.wisenergy.model.dto.GetMonthlyCollectParam
;
import
cn.wisenergy.model.dto.GetMonthlyCollectParam
;
import
cn.wisenergy.model.dto.UserWorkTimeStatisticsByProject
;
import
cn.wisenergy.model.dto.WorkTimeAndCostCollect
;
import
cn.wisenergy.model.dto.WorkTimeAndCostCollect
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
org.apache.poi.hssf.usermodel.HSSFWorkbook
;
import
org.apache.poi.hssf.usermodel.HSSFWorkbook
;
...
@@ -36,4 +37,13 @@ public interface StatisticsService {
...
@@ -36,4 +37,13 @@ public interface StatisticsService {
* @return
* @return
*/
*/
HSSFWorkbook
exportWorkTimeExcel
(
GetMonthlyCollectParam
param
);
HSSFWorkbook
exportWorkTimeExcel
(
GetMonthlyCollectParam
param
);
/**
* 获取用户所在未结项目的工时统计
* @param startDate
* @param endDate
* @param status
* @return
*/
List
<
UserWorkTimeStatisticsByProject
>
getUserWorkTimeStatisticsReport
(
Integer
userId
,
String
startDate
,
String
endDate
,
Integer
status
);
}
}
wisenergy-service/src/main/java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
View file @
acd39d15
...
@@ -13,10 +13,7 @@ import cn.wisenergy.model.app.WorkHoliday;
...
@@ -13,10 +13,7 @@ import cn.wisenergy.model.app.WorkHoliday;
import
cn.wisenergy.model.app.WorkProject
;
import
cn.wisenergy.model.app.WorkProject
;
import
cn.wisenergy.model.app.WorkUser
;
import
cn.wisenergy.model.app.WorkUser
;
import
cn.wisenergy.model.dto.*
;
import
cn.wisenergy.model.dto.*
;
import
cn.wisenergy.model.enums.HolidayTypeEnum
;
import
cn.wisenergy.model.enums.*
;
import
cn.wisenergy.model.enums.ManagerEnum
;
import
cn.wisenergy.model.enums.WorkOrderStatus
;
import
cn.wisenergy.model.enums.WorkOrderType
;
import
cn.wisenergy.service.StatisticsService
;
import
cn.wisenergy.service.StatisticsService
;
import
cn.wisenergy.service.WorkDeptService
;
import
cn.wisenergy.service.WorkDeptService
;
import
cn.wisenergy.service.WorkProjectService
;
import
cn.wisenergy.service.WorkProjectService
;
...
@@ -24,6 +21,7 @@ import cn.wisenergy.service.WorkUserService;
...
@@ -24,6 +21,7 @@ import cn.wisenergy.service.WorkUserService;
import
com.alibaba.excel.util.StringUtils
;
import
com.alibaba.excel.util.StringUtils
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.util.StringUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.poi.hssf.usermodel.*
;
import
org.apache.poi.hssf.usermodel.*
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.Cell
;
...
@@ -118,7 +116,7 @@ public class StatisticsServiceImpl implements StatisticsService {
...
@@ -118,7 +116,7 @@ public class StatisticsServiceImpl implements StatisticsService {
ArrayList
<
DayWorkTimeAndType
>
dayWorkTimeAndTypes1
=
new
ArrayList
<>();
ArrayList
<
DayWorkTimeAndType
>
dayWorkTimeAndTypes1
=
new
ArrayList
<>();
// 查询出的工时信息遍历
// 查询出的工时信息遍历
Iterator
<
DayWorkTimeAndType
>
workTimeAndTypeIterator
=
dayWorkTimeAndTypes
.
iterator
();
Iterator
<
DayWorkTimeAndType
>
workTimeAndTypeIterator
=
dayWorkTimeAndTypes
.
iterator
();
while
(
workTimeAndTypeIterator
.
hasNext
()){
while
(
workTimeAndTypeIterator
.
hasNext
())
{
DayWorkTimeAndType
dayWorkTimeAndType
=
workTimeAndTypeIterator
.
next
();
DayWorkTimeAndType
dayWorkTimeAndType
=
workTimeAndTypeIterator
.
next
();
if
(
dayWorkTimeAndType
.
getUserId
().
equals
(
statisticsTableDto
.
getUserId
()))
{
if
(
dayWorkTimeAndType
.
getUserId
().
equals
(
statisticsTableDto
.
getUserId
()))
{
dayWorkTimeAndTypes1
.
add
(
dayWorkTimeAndType
);
dayWorkTimeAndTypes1
.
add
(
dayWorkTimeAndType
);
...
@@ -201,11 +199,27 @@ public class StatisticsServiceImpl implements StatisticsService {
...
@@ -201,11 +199,27 @@ public class StatisticsServiceImpl implements StatisticsService {
Integer
countByCondition
=
workTimeOrderMapper
.
getCountByCondition
(
map
);
Integer
countByCondition
=
workTimeOrderMapper
.
getCountByCondition
(
map
);
List
<
MonthlyWorkingHoursStatistics
>
monthlyWorkingHoursStatistics
=
workTimeOrderMapper
.
statisticsByProjectType
(
userId
,
firstDayOfMonth
);
List
<
MonthlyWorkingHoursStatistics
>
monthlyWorkingHoursStatistics
=
workTimeOrderMapper
.
statisticsByProjectType
(
userId
,
firstDayOfMonth
);
// 如果不存在商机或项目其中某项,造对象传前端
while
(
monthlyWorkingHoursStatistics
.
size
()
<
2
)
{
// 获取工时类型(项目或商机)
List
<
String
>
projectTypes
=
monthlyWorkingHoursStatistics
.
stream
().
map
(
MonthlyWorkingHoursStatistics:
:
getProjectType
).
collect
(
Collectors
.
toList
());
MonthlyWorkingHoursStatistics
workingHoursStatistics
=
new
MonthlyWorkingHoursStatistics
();
// 如果不存在项目或商机工时
if
(!
projectTypes
.
contains
(
ProjectTypeEnum
.
PROJECT
.
getTypeName
()))
{
workingHoursStatistics
.
setProjectType
(
ProjectTypeEnum
.
PROJECT
.
getTypeName
());
}
else
if
(!
projectTypes
.
contains
(
ProjectTypeEnum
.
BUSINESS_OPPORTUNITY
.
getTypeName
())){
workingHoursStatistics
.
setProjectType
(
ProjectTypeEnum
.
BUSINESS_OPPORTUNITY
.
getTypeName
());
}
workingHoursStatistics
.
setCount
(
0
);
workingHoursStatistics
.
setWorkTime
(
0
);
monthlyWorkingHoursStatistics
.
add
(
workingHoursStatistics
);
}
// 赋值未填报天数、被驳回未重报天
for
(
MonthlyWorkingHoursStatistics
monthlyWorkingHoursStatistic
:
monthlyWorkingHoursStatistics
)
{
for
(
MonthlyWorkingHoursStatistics
monthlyWorkingHoursStatistic
:
monthlyWorkingHoursStatistics
)
{
monthlyWorkingHoursStatistic
.
setNotFilledCount
(
notFilledCount
);
monthlyWorkingHoursStatistic
.
setNotFilledCount
(
notFilledCount
);
monthlyWorkingHoursStatistic
.
setRejectCount
(
countByCondition
);
monthlyWorkingHoursStatistic
.
setRejectCount
(
countByCondition
);
}
}
objects
.
add
(
monthlyWorkingHoursStatistics
);
objects
.
add
(
monthlyWorkingHoursStatistics
);
}
}
return
objects
;
return
objects
;
...
@@ -217,6 +231,11 @@ public class StatisticsServiceImpl implements StatisticsService {
...
@@ -217,6 +231,11 @@ public class StatisticsServiceImpl implements StatisticsService {
if
(
userId
==
null
)
{
if
(
userId
==
null
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
}
// 时间不为空,赋值当月第一天
if
(
StringUtil
.
isNotEmpty
(
startTime
))
{
Date
currentFirstDayOfMonth
=
DateUtil
.
getCurrentFirstDayOfMonth
();
startTime
=
DateUtil
.
convertDateToYMDStr
(
currentFirstDayOfMonth
);
}
WorkUser
user
=
workUserService
.
getById
(
userId
);
WorkUser
user
=
workUserService
.
getById
(
userId
);
if
(
user
.
getLevel
().
equals
(
ManagerEnum
.
NOT_MANAGER
.
getCode
()))
{
if
(
user
.
getLevel
().
equals
(
ManagerEnum
.
NOT_MANAGER
.
getCode
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
THE_USER_NOT_MANAGER_PLASE_MANAGER_LOGIN
);
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
THE_USER_NOT_MANAGER_PLASE_MANAGER_LOGIN
);
...
@@ -258,9 +277,9 @@ public class StatisticsServiceImpl implements StatisticsService {
...
@@ -258,9 +277,9 @@ public class StatisticsServiceImpl implements StatisticsService {
// 创建一行
// 创建一行
HSSFRow
row1
=
sheet
.
createRow
(
0
);
HSSFRow
row1
=
sheet
.
createRow
(
0
);
// 给第一行赋值
// 给第一行赋值
row1
.
createCell
(
0
).
setCellValue
(
"序号"
);
row1
.
createCell
(
0
).
setCellValue
(
"序号"
);
row1
.
createCell
(
1
).
setCellValue
(
"部门名称"
);
row1
.
createCell
(
1
).
setCellValue
(
"部门名称"
);
row1
.
createCell
(
2
).
setCellValue
(
"姓名"
);
row1
.
createCell
(
2
).
setCellValue
(
"姓名"
);
for
(
int
i
=
1
;
i
<=
dayCount
;
i
++)
{
for
(
int
i
=
1
;
i
<=
dayCount
;
i
++)
{
HSSFCell
cell
=
row1
.
createCell
(
2
+
i
);
HSSFCell
cell
=
row1
.
createCell
(
2
+
i
);
cell
.
setCellValue
(
i
+
"日"
);
cell
.
setCellValue
(
i
+
"日"
);
...
@@ -302,6 +321,26 @@ public class StatisticsServiceImpl implements StatisticsService {
...
@@ -302,6 +321,26 @@ public class StatisticsServiceImpl implements StatisticsService {
return
sheets
;
return
sheets
;
}
}
@Override
public
List
<
UserWorkTimeStatisticsByProject
>
getUserWorkTimeStatisticsReport
(
Integer
userId
,
String
startDate
,
String
endDate
,
Integer
status
)
{
log
.
info
(
"StatisticsServiceImpl[]getUserWorkTimeStatisticsReport[]"
);
// 默认统计截至时间为前一天
if
(
StringUtil
.
isEmpty
(
endDate
))
{
endDate
=
DateUtil
.
convertDateToYMDStr
(
new
Date
());
}
// 获取用户负责项目主键集合
List
<
WorkProject
>
userManageProjects
=
workProjectService
.
getUserManageProjects
(
userId
);
if
(
CollectionUtil
.
isEmpty
(
userManageProjects
))
{
// throw new BaseCustomException(BASE_RESP_CODE_ENUM.MANAGER_NOT_PROJECT);
}
List
<
Integer
>
projectIds
=
userManageProjects
.
stream
().
map
(
WorkProject:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
UserWorkTimeStatisticsByProject
>
userProjectWorkTimeStatistics
=
workTimeOrderMapper
.
getUserProjectWorkTimeStatistics
(
startDate
,
endDate
,
status
,
projectIds
);
return
userProjectWorkTimeStatistics
;
}
//获取本月应上班日期
//获取本月应上班日期
public
List
<
Date
>
currentMonthWorkDays
()
{
public
List
<
Date
>
currentMonthWorkDays
()
{
log
.
info
(
"StatisticsServiceImpl[]currentMonthWorkDays[]input.method"
);
log
.
info
(
"StatisticsServiceImpl[]currentMonthWorkDays[]input.method"
);
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/StatisticsController.java
View file @
acd39d15
...
@@ -5,6 +5,7 @@ import cn.wisenergy.common.utils.exception.BaseCustomException;
...
@@ -5,6 +5,7 @@ import cn.wisenergy.common.utils.exception.BaseCustomException;
import
cn.wisenergy.common.utils.exception.Result
;
import
cn.wisenergy.common.utils.exception.Result
;
import
cn.wisenergy.model.app.WorkDept
;
import
cn.wisenergy.model.app.WorkDept
;
import
cn.wisenergy.model.dto.GetMonthlyCollectParam
;
import
cn.wisenergy.model.dto.GetMonthlyCollectParam
;
import
cn.wisenergy.model.dto.UserWorkTimeStatisticsByProject
;
import
cn.wisenergy.model.dto.WorkTimeAndCostCollect
;
import
cn.wisenergy.model.dto.WorkTimeAndCostCollect
;
import
cn.wisenergy.service.StatisticsService
;
import
cn.wisenergy.service.StatisticsService
;
import
cn.wisenergy.service.WorkDeptService
;
import
cn.wisenergy.service.WorkDeptService
;
...
@@ -52,27 +53,27 @@ public class StatisticsController extends BaseController {
...
@@ -52,27 +53,27 @@ public class StatisticsController extends BaseController {
@ApiOperation
(
value
=
"获取全部部门信息或单条信息"
,
notes
=
"获取全部部门信息或单条信息"
)
@ApiOperation
(
value
=
"获取全部部门信息或单条信息"
,
notes
=
"获取全部部门信息或单条信息"
)
@ApiImplicitParam
(
name
=
"deptId"
,
value
=
"部门主键"
)
@ApiImplicitParam
(
name
=
"deptId"
,
value
=
"部门主键"
)
@GetMapping
(
"/getDeptInfo"
)
@GetMapping
(
"/getDeptInfo"
)
public
List
<
WorkDept
>
getDeptInfo
(
Integer
deptId
)
{
public
List
<
WorkDept
>
getDeptInfo
(
Integer
deptId
)
{
log
.
info
(
"StatisticsController[]getDeptInfo[]input.param"
+
deptId
);
log
.
info
(
"StatisticsController[]getDeptInfo[]input.param"
+
deptId
);
List
<
WorkDept
>
workDepts
=
workDeptService
.
getDeptInfo
(
deptId
);
List
<
WorkDept
>
workDepts
=
workDeptService
.
getDeptInfo
(
deptId
);
return
workDepts
;
return
workDepts
;
}
}
@ApiOperation
(
value
=
"获取负责项目工时汇总"
,
notes
=
"获取负责项目工时汇总"
)
@ApiOperation
(
value
=
"获取负责项目工时汇总"
,
notes
=
"获取负责项目工时汇总"
)
@GetMapping
(
"/getCurrentMonthWorkTimeCollect"
)
@GetMapping
(
"/getCurrentMonthWorkTimeCollect"
)
public
List
<
WorkTimeAndCostCollect
>
getWorkTimeCollect
(
Integer
userId
,
String
startTime
)
{
public
Result
<
List
<
WorkTimeAndCostCollect
>>
getWorkTimeCollect
(
Integer
userId
,
String
startTime
)
{
log
.
info
(
"WorkUserController[]getCurrentMonthWorkTimeCollect[]input.param"
+
userId
,
startTime
);
log
.
info
(
"WorkUserController[]getCurrentMonthWorkTimeCollect[]input.param"
+
userId
,
startTime
);
if
(
userId
==
null
)
{
if
(
userId
==
null
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
}
List
<
WorkTimeAndCostCollect
>
currentMonthWorkTimeCollect
=
statisticsService
.
getCurrentMonthWorkTimeCollect
(
userId
,
startTime
);
List
<
WorkTimeAndCostCollect
>
currentMonthWorkTimeCollect
=
statisticsService
.
getCurrentMonthWorkTimeCollect
(
userId
,
startTime
);
return
currentMonthWorkTimeCollect
;
return
getResult
(
currentMonthWorkTimeCollect
)
;
}
}
@ApiOperation
(
value
=
"获取本月工时统计和审核统计"
,
notes
=
"获取本月"
,
httpMethod
=
"GET"
)
@ApiOperation
(
value
=
"获取本月工时统计和审核统计"
,
notes
=
"获取本月"
,
httpMethod
=
"GET"
)
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户主键"
,
dataType
=
"int"
,
required
=
true
)
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户主键"
,
dataType
=
"int"
,
required
=
true
)
@GetMapping
(
"/getMonthlyWorkingHours"
)
@GetMapping
(
"/getMonthlyWorkingHours"
)
public
Result
<
List
<
Object
>>
getMonthlyWorkingHours
(
Integer
userId
){
public
Result
<
List
<
Object
>>
getMonthlyWorkingHours
(
Integer
userId
)
{
log
.
info
(
"WorkOrderController[]getMonthlyWorkingHours[]input.param"
+
userId
);
log
.
info
(
"WorkOrderController[]getMonthlyWorkingHours[]input.param"
+
userId
);
if
(
userId
==
null
)
{
if
(
userId
==
null
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
...
@@ -110,4 +111,13 @@ public class StatisticsController extends BaseController {
...
@@ -110,4 +111,13 @@ public class StatisticsController extends BaseController {
}
}
}
@ApiOperation
(
value
=
"获取人员工时统计报表"
,
notes
=
"获取人员工时统计报表"
)
@GetMapping
(
"/getUserWorkTimeStatisticsReport"
)
public
Result
<
List
<
UserWorkTimeStatisticsByProject
>>
getUserWorkTimeStatisticsReport
(
Integer
userId
,
String
startDate
,
String
endDate
,
Integer
status
)
{
log
.
info
(
"StatisticsController[]getUserWorkTimeStatisticsReport[]input.param{}"
+
userId
,
startDate
,
endDate
,
status
);
List
<
UserWorkTimeStatisticsByProject
>
userWorkTimeStatisticsByProjects
=
statisticsService
.
getUserWorkTimeStatisticsReport
(
userId
,
startDate
,
endDate
,
status
);
return
getResult
(
userWorkTimeStatisticsByProjects
);
}
}
\ 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