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
8c13667a
Commit
8c13667a
authored
Mar 08, 2021
by
nie'hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善工时统计
parent
8209cac5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
30 deletions
+16
-30
StatisticsServiceImpl.java
...java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
+16
-30
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
View file @
8c13667a
...
...
@@ -169,12 +169,14 @@ public class StatisticsServiceImpl implements StatisticsService {
// 移除查询审批人和状态条件
map
.
remove
(
"reviewerId"
);
map
.
remove
(
"status"
);
map
.
remove
(
"startModifyTime"
);
//待审核包括:新提交和重新提交的
List
<
Integer
>
statusArray
=
new
ArrayList
<>();
statusArray
.
add
(
WorkOrderStatus
.
WAIT_AUDIT
.
getCode
());
statusArray
.
add
(
WorkOrderStatus
.
RE_SUBMIT
.
getCode
());
//本月未审批数量查询
map
.
put
(
"startWorkTime"
,
firstDayOfMonth
);
map
.
put
(
"statusArray"
,
statusArray
);
// 查询用户负责的项目和商机id
...
...
@@ -191,7 +193,7 @@ public class StatisticsServiceImpl implements StatisticsService {
List
<
Integer
>
rank
=
this
.
getUserRank
(
workLevels
,
LevelEnum
.
EXAMINE
.
getLevelName
());
// 查询用户负责审批的除项目合商机的其余类型
Integer
notCompletedCount2
=
0
;
if
(
CollectionUtil
.
isNotEmpty
(
rank
)
&&
rank
.
contains
(
LevelRankEnum
.
DEPARTMENT_LEVEL
.
getRank
()))
{
if
(
rank
.
contains
(
LevelRankEnum
.
DEPARTMENT_LEVEL
.
getRank
()))
{
map
.
remove
(
"projectIdList"
);
List
<
WorkType
>
allType
=
workTypeMapper
.
getAll
();
List
<
Integer
>
type
=
new
ArrayList
<>();
...
...
@@ -817,15 +819,20 @@ public class StatisticsServiceImpl implements StatisticsService {
String
startDate
=
new
String
();
String
endDate
=
new
String
();
if
(
deptId
=
=
null
)
{
if
(
projectId
!
=
null
)
{
// 整个项目所占时间,未结项目截止时间为当月,已结项目截止时间为最后一次统计的时间
startDate
=
projectStatisticsByMonths
.
get
(
0
).
getStatisticsDateAndWorkTimes
().
get
(
0
).
getDate
();
endDate
=
workProjectMapper
.
getLastDate
(
projectId
);
}
else
{
startDate
=
DateUtil
.
convertDateToStr
(
DateUtil
.
getFirstDayOfYear
(
new
Date
()),
"yyyy年M月"
);
endDate
=
DateUtil
.
convertDateToStr
(
new
Date
(),
"yyyy年M月"
);
if
(
year
<
DateUtil
.
getYear
(
new
Date
()))
{
startDate
=
year
+
"年1月"
;
endDate
=
year
+
"年12月"
;
}
else
{
startDate
=
DateUtil
.
convertDateToStr
(
DateUtil
.
getFirstDayOfYear
(
new
Date
()),
"yyyy年M月"
);
endDate
=
DateUtil
.
convertDateToStr
(
new
Date
(),
"yyyy年M月"
);
}
}
// 项目的周期年月集合
List
<
String
>
yearMonthList
=
this
.
getYearMonthList
(
startDate
,
endDate
);
// 部门主键不为空时,日期格式只有某月。为空时,日期格式为某年统计的第一个月为某年某月,其余为某月
...
...
@@ -944,24 +951,16 @@ public class StatisticsServiceImpl implements StatisticsService {
public
void
conversionDateFormat
(
List
<
ProjectStatisticsByMonth
>
projectStatisticsByMonths
,
List
<
String
>
yearMonthList
,
Integer
projectId
)
{
for
(
ProjectStatisticsByMonth
projectStatisticsByMonth
:
projectStatisticsByMonths
)
{
List
<
ProjectStatisticsByMonth
.
StatisticsDateAndWorkTime
>
statisticsDateAndWorkTimes
=
projectStatisticsByMonth
.
getStatisticsDateAndWorkTimes
();
// 部门主键不为空时,日期格式只有某月
// if (deptId != null) {
// for (ProjectStatisticsByMonth.StatisticsDateAndWorkTime statisticsDateAndWorkTime : statisticsDateAndWorkTimes) {
// String date = statisticsDateAndWorkTime.getDate();
// StringBuilder stringBuilder = new StringBuilder(date);
// // 删除年份
// stringBuilder.delete(0, 5);
// statisticsDateAndWorkTime.setDate(stringBuilder.toString());
// }
// } else {
for
(
int
i
=
0
;
i
<
yearMonthList
.
size
();
i
++)
{
String
s
=
yearMonthList
.
get
(
i
);
String
date
=
new
String
();
if
(
i
<
statisticsDateAndWorkTimes
.
size
())
{
date
=
statisticsDateAndWorkTimes
.
get
(
i
).
getDate
();
}
else
{
break
;
}
// 项目统计报表中截至当前月份中如果某个月份没有统计数据,补充当月工时为0
// else {
// break;
// }
// 时间不连续,创建对象
if
(!
s
.
equals
(
date
))
{
ProjectStatisticsByMonth
.
StatisticsDateAndWorkTime
statisticsDateAndWorkTime
=
new
ProjectStatisticsByMonth
.
StatisticsDateAndWorkTime
();
...
...
@@ -989,19 +988,6 @@ public class StatisticsServiceImpl implements StatisticsService {
}
}
// for (int i = statisticsDateAndWorkTimes.size() - 1; i > 0; i--) {
// String date1 = statisticsDateAndWorkTimes.get(i).getDate();
// String date2 = statisticsDateAndWorkTimes.get(i - 1).getDate();
//
// // 如果不为当年统计数据的第一个月,则删除年份
// if (date1.charAt(2) == date2.charAt(2) && date1.charAt(3) == date2.charAt(3)) {
// StringBuilder dateBuilder1 = new StringBuilder(date1);
// // 删除年份
// dateBuilder1.delete(0, 5);
// statisticsDateAndWorkTimes.get(i).setDate(dateBuilder1.toString());
// }
// }
// }
}
}
...
...
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