Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
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
43ce33f1
Commit
43ce33f1
authored
Jan 28, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
c3104827
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
83 additions
and
63 deletions
+83
-63
BASE_RESP_CODE_ENUM.java
...wisenergy/common/utils/exception/BASE_RESP_CODE_ENUM.java
+1
-1
WorkTimeOrderMapper.java
...rc/main/java/cn/wisenergy/mapper/WorkTimeOrderMapper.java
+8
-0
WorkCollectMapper.xml
...gy-mapper/src/main/resources/mapper/WorkCollectMapper.xml
+0
-2
WorkTimeOrderMapper.xml
...-mapper/src/main/resources/mapper/WorkTimeOrderMapper.xml
+20
-0
WorkCollectServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkCollectServiceImpl.java
+0
-1
WorkProjectServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
+4
-5
WorkTimeOrderServiceImpl.java
...a/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
+41
-45
Examine.java
...n/src/main/java/cn/wisenergy/web/config/auto/Examine.java
+9
-9
No files found.
wisenergy-common/src/main/java/cn/wisenergy/common/utils/exception/BASE_RESP_CODE_ENUM.java
View file @
43ce33f1
...
@@ -36,7 +36,7 @@ public enum BASE_RESP_CODE_ENUM {
...
@@ -36,7 +36,7 @@ public enum BASE_RESP_CODE_ENUM {
FILE_INCORRETC_FORMAT
(
"615"
,
"文件格式不正确"
),
FILE_INCORRETC_FORMAT
(
"615"
,
"文件格式不正确"
),
RECORD_WORD_REPEAT
(
"616"
,
"字段名称重复"
),
RECORD_WORD_REPEAT
(
"616"
,
"字段名称重复"
),
WORD_NAME_REPEAT
(
"617"
,
"字段名称请勿重复"
),
WORD_NAME_REPEAT
(
"617"
,
"字段名称请勿重复"
),
QUERY_USER_INFO_FAIL
(
"618"
,
"
获取用户信息失败
"
),
QUERY_USER_INFO_FAIL
(
"618"
,
"
该用户不存在
"
),
WORK_ORDER_ALREADY_COMMIT
(
"619"
,
"工单已填报,不能重复填报"
),
WORK_ORDER_ALREADY_COMMIT
(
"619"
,
"工单已填报,不能重复填报"
),
WORK_TIME_OVER_NOW_DAY
(
"620"
,
"工单日期不能大于当天"
),
WORK_TIME_OVER_NOW_DAY
(
"620"
,
"工单日期不能大于当天"
),
INSERT_WORK_COLLECT_DATA_FAIL
(
"621"
,
"插入工时单汇总信息失败"
),
INSERT_WORK_COLLECT_DATA_FAIL
(
"621"
,
"插入工时单汇总信息失败"
),
...
...
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/WorkTimeOrderMapper.java
View file @
43ce33f1
...
@@ -22,6 +22,14 @@ import java.util.Map;
...
@@ -22,6 +22,14 @@ import java.util.Map;
public
interface
WorkTimeOrderMapper
extends
BaseMapper
<
WorkTimeOrder
>
{
public
interface
WorkTimeOrderMapper
extends
BaseMapper
<
WorkTimeOrder
>
{
/**
* 功能:获取某个月的数据
* @param userId
* @param workMonth
* @return
*/
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
);
...
...
wisenergy-mapper/src/main/resources/mapper/WorkCollectMapper.xml
View file @
43ce33f1
...
@@ -71,8 +71,6 @@
...
@@ -71,8 +71,6 @@
AND DATE_FORMAT(work_day, '%Y%m') = DATE_FORMAT(#{workMonth} ,'%Y%m')
AND DATE_FORMAT(work_day, '%Y%m') = DATE_FORMAT(#{workMonth} ,'%Y%m')
</if>
</if>
</where>
</where>
</select>
</select>
</mapper>
</mapper>
wisenergy-mapper/src/main/resources/mapper/WorkTimeOrderMapper.xml
View file @
43ce33f1
...
@@ -195,5 +195,25 @@
...
@@ -195,5 +195,25 @@
select distinct(work_day)
select distinct(work_day)
from
<include
refid=
"table"
/>
from
<include
refid=
"table"
/>
where work_day >= #{firstDayOfMonth} AND user_id = #{userId}
where work_day >= #{firstDayOfMonth} AND user_id = #{userId}
</select>
<select
id=
"geByMonth"
resultType=
"cn.wisenergy.model.app.WorkTimeOrder"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM
<include
refid=
"table"
/>
<where>
<if
test=
"null != userId"
>
AND user_id = #{userId}
</if>
<if
test=
"null != workMonth"
>
AND DATE_FORMAT(work_day, '%Y%m') = DATE_FORMAT(#{workMonth} ,'%Y%m')
</if>
<if
test=
"null != status"
>
AND status = #{status}
</if>
</where>
</select>
</select>
</mapper>
</mapper>
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkCollectServiceImpl.java
View file @
43ce33f1
...
@@ -64,7 +64,6 @@ public class WorkCollectServiceImpl implements WorkCollectService {
...
@@ -64,7 +64,6 @@ public class WorkCollectServiceImpl implements WorkCollectService {
if
(
null
==
userId
||
StringUtils
.
isEmpty
(
workMonth
))
{
if
(
null
==
userId
||
StringUtils
.
isEmpty
(
workMonth
))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
}
List
<
CalendarDto
>
calendarDtoList
=
workCollectMapper
.
getWorkMonth
(
userId
,
workMonth
);
List
<
CalendarDto
>
calendarDtoList
=
workCollectMapper
.
getWorkMonth
(
userId
,
workMonth
);
if
(
CollectionUtils
.
isEmpty
(
calendarDtoList
))
{
if
(
CollectionUtils
.
isEmpty
(
calendarDtoList
))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
WORK_ORDER_INFO_IS_NULL
);
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
WORK_ORDER_INFO_IS_NULL
);
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
View file @
43ce33f1
...
@@ -72,7 +72,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
...
@@ -72,7 +72,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
public
List
<
WorkProject
>
getNameById
(
List
<
Integer
>
ids
)
{
public
List
<
WorkProject
>
getNameById
(
List
<
Integer
>
ids
)
{
log
.
info
(
"WorkProjectServiceImpl[]getNameById[]input.param.ids:"
+
ids
);
log
.
info
(
"WorkProjectServiceImpl[]getNameById[]input.param.ids:"
+
ids
);
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
)
;
return
null
;
}
}
List
<
WorkProject
>
workProjects
=
workProjectMapper
.
selectBatchIds
(
ids
);
List
<
WorkProject
>
workProjects
=
workProjectMapper
.
selectBatchIds
(
ids
);
if
(
CollectionUtils
.
isEmpty
(
workProjects
))
{
if
(
CollectionUtils
.
isEmpty
(
workProjects
))
{
...
@@ -96,11 +96,10 @@ public class WorkProjectServiceImpl implements WorkProjectService {
...
@@ -96,11 +96,10 @@ public class WorkProjectServiceImpl implements WorkProjectService {
QueryWrapper
<
WorkProject
>
wrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
WorkProject
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"manager_id"
,
id
);
wrapper
.
eq
(
"manager_id"
,
id
);
List
<
WorkProject
>
workProjects
=
workProjectMapper
.
selectList
(
wrapper
);
List
<
WorkProject
>
workProjects
=
workProjectMapper
.
selectList
(
wrapper
);
if
(
CollectionUtils
.
isEmpty
(
workProjects
))
{
if
(
!
CollectionUtils
.
isEmpty
(
workProjects
))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
MANAGER_NOT_PROJECT
);
return
workProjectToDto
(
workProjects
);
}
}
return
null
;
return
workProjectToDto
(
workProjects
);
}
}
// WorkProject转ProjectDto
// WorkProject转ProjectDto
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
View file @
43ce33f1
...
@@ -125,21 +125,33 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
...
@@ -125,21 +125,33 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
// 今日总工时
// 今日总工时
int
totalTime
=
0
;
int
totalTime
=
0
;
// 被驳回原因
// 被驳回原因
String
reason
=
""
;
String
Builder
reason
=
new
StringBuilder
()
;
// 今日被驳回次数
// 今日被驳回次数
int
rejectMonth
=
0
;
int
rejectMonth
=
0
;
subtotalDto
.
setUserId
(
userId
);
subtotalDto
.
setUserId
(
userId
);
subtotalDto
.
setWorkDay
(
workDay
);
subtotalDto
.
setWorkDay
(
workDay
);
for
(
WorkTimeOrder
wto
:
workTimeOrders
)
{
for
(
WorkTimeOrder
wto
:
workTimeOrders
)
{
totalTime
+=
wto
.
getWorkTime
();
totalTime
+=
wto
.
getWorkTime
();
if
(
null
!=
wto
.
getReason
())
{
if
(
null
!=
wto
.
getReason
()
&&
REJECTED
.
equals
(
wto
.
getStatus
())
&&
reason
.
toString
().
equals
(
""
))
{
reason
=
workProjectService
.
getById
(
wto
.
getProjectId
()).
getProjectName
()
+
":"
+
wto
.
getReason
()
+
";"
;
if
(
PROJECT
.
equals
(
wto
.
getType
())
||
BUSINESS_OPPORTUNITY
.
equals
(
wto
.
getType
()))
{
}
reason
.
append
(
workProjectService
.
getById
(
wto
.
getProjectId
()).
getProjectName
()).
append
(
":"
).
append
(
wto
.
getReason
()).
append
(
";"
);
if
(
REJECTED
.
equals
(
wto
.
getStatus
()))
{
}
rejectMonth
+=
1
;
if
(!
PROJECT
.
equals
(
wto
.
getType
())
&&
!
BUSINESS_OPPORTUNITY
.
equals
(
wto
.
getType
()))
{
for
(
ProjectTypeEnum
value
:
ProjectTypeEnum
.
values
())
{
if
(
value
.
getType
().
equals
(
wto
.
getType
()))
{
reason
.
append
(
value
.
getTypeName
()).
append
(
":"
).
append
(
wto
.
getReason
()).
append
(
";"
);
}
}
}
}
}
}
}
subtotalDto
.
setReason
(
reason
);
List
<
WorkTimeOrder
>
timeOrders
=
workTimeOrderMapper
.
geByMonth
(
userId
,
workDay
,
REJECTED
);
if
(!
CollectionUtils
.
isEmpty
(
timeOrders
))
{
rejectMonth
=
timeOrders
.
size
();
}
subtotalDto
.
setReason
(
reason
.
toString
());
subtotalDto
.
setTotalTime
(
totalTime
);
subtotalDto
.
setTotalTime
(
totalTime
);
subtotalDto
.
setRejectMonth
(
rejectMonth
);
subtotalDto
.
setRejectMonth
(
rejectMonth
);
return
subtotalDto
;
return
subtotalDto
;
...
@@ -155,7 +167,6 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
...
@@ -155,7 +167,6 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
@Override
@Override
public
List
<
WorkTimeOrder
>
getByDayToDto
(
Integer
userId
,
Date
workDay
)
{
public
List
<
WorkTimeOrder
>
getByDayToDto
(
Integer
userId
,
Date
workDay
)
{
log
.
info
(
"WorkTimeOrderServiceImpl[]getByDayToDto[]input.param.userId:{},workDay:{}"
+
userId
,
workDay
);
log
.
info
(
"WorkTimeOrderServiceImpl[]getByDayToDto[]input.param.userId:{},workDay:{}"
+
userId
,
workDay
);
List
<
WorkTimeOrder
>
workTimeOrders
=
getByDay
(
userId
,
workDay
);
List
<
WorkTimeOrder
>
workTimeOrders
=
getByDay
(
userId
,
workDay
);
if
(
CollectionUtils
.
isEmpty
(
workTimeOrders
))
{
if
(
CollectionUtils
.
isEmpty
(
workTimeOrders
))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
WORK_ORDER_INFO_IS_NULL
);
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
WORK_ORDER_INFO_IS_NULL
);
...
@@ -239,9 +250,6 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
...
@@ -239,9 +250,6 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
if
(
null
==
dto
.
getStatus
()
||
0
==
dto
.
getStatus
())
{
if
(
null
==
dto
.
getStatus
()
||
0
==
dto
.
getStatus
())
{
dto
.
setStatus
(
COMPLETED
);
dto
.
setStatus
(
COMPLETED
);
}
}
if
(
LEAVE
.
equals
(
type
)
||
COMPENSATORY_LEAVE
.
equals
(
type
))
{
dto
.
setStatus
(
APPROVED
);
}
if
(
null
!=
dto
.
getStatus
()
&&
REJECTED
.
equals
(
dto
.
getStatus
()))
{
if
(
null
!=
dto
.
getStatus
()
&&
REJECTED
.
equals
(
dto
.
getStatus
()))
{
dto
.
setStatus
(
RE_SUBMIT
);
dto
.
setStatus
(
RE_SUBMIT
);
}
}
...
@@ -423,7 +431,6 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
...
@@ -423,7 +431,6 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
if
(
CollectionUtils
.
isEmpty
(
workTimeOrders
))
{
if
(
CollectionUtils
.
isEmpty
(
workTimeOrders
))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
WORK_ORDER_END
);
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
WORK_ORDER_END
);
}
}
return
getDto
(
workTimeOrders
);
return
getDto
(
workTimeOrders
);
}
}
// 部门经理
// 部门经理
...
@@ -440,7 +447,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
...
@@ -440,7 +447,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
}
}
return
getDto
(
workTimeOrders
);
return
getDto
(
workTimeOrders
);
}
}
return
null
;
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
WORK_ORDER_END
)
;
}
}
// 封装可填报的数据
// 封装可填报的数据
...
@@ -564,6 +571,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
...
@@ -564,6 +571,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
QueryWrapper
<
WorkTimeOrder
>
wrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
WorkTimeOrder
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"reviewer_id"
,
userId
);
wrapper
.
eq
(
"reviewer_id"
,
userId
);
wrapper
.
eq
(
"status"
,
REJECTED
);
wrapper
.
eq
(
"status"
,
REJECTED
);
wrapper
.
orderByDesc
(
"work_day"
);
List
<
WorkTimeOrder
>
workTimeOrders
=
workTimeOrderMapper
.
selectList
(
wrapper
);
List
<
WorkTimeOrder
>
workTimeOrders
=
workTimeOrderMapper
.
selectList
(
wrapper
);
if
(
CollectionUtils
.
isEmpty
(
workTimeOrders
))
{
if
(
CollectionUtils
.
isEmpty
(
workTimeOrders
))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
WORK_ORDER_INFO_IS_NULL
);
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
WORK_ORDER_INFO_IS_NULL
);
...
@@ -592,11 +600,13 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
...
@@ -592,11 +600,13 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
if
(
0
!=
user
.
getLevel
())
{
if
(
0
!=
user
.
getLevel
())
{
List
<
ProjectManagerDto
>
projectManagerDtos
=
new
ArrayList
<>();
List
<
ProjectManagerDto
>
projectManagerDtos
=
new
ArrayList
<>();
List
<
ProjectDto
>
projectDtos
=
workProjectService
.
getByManagerId
(
userId
);
List
<
ProjectDto
>
projectDtos
=
workProjectService
.
getByManagerId
(
userId
);
ProjectManagerDto
projectManagerDto
;
if
(!
CollectionUtils
.
isEmpty
(
projectDtos
))
{
for
(
ProjectDto
projectDto
:
projectDtos
)
{
ProjectManagerDto
projectManagerDto
;
projectManagerDto
=
new
ProjectManagerDto
();
for
(
ProjectDto
projectDto
:
projectDtos
)
{
BeanUtils
.
copyProperties
(
projectDto
,
projectManagerDto
);
projectManagerDto
=
new
ProjectManagerDto
();
projectManagerDtos
.
add
(
projectManagerDto
);
BeanUtils
.
copyProperties
(
projectDto
,
projectManagerDto
);
projectManagerDtos
.
add
(
projectManagerDto
);
}
}
}
List
<
WorkType
>
WorkTypes
=
workTypeService
.
getByManagerId
(
userId
);
List
<
WorkType
>
WorkTypes
=
workTypeService
.
getByManagerId
(
userId
);
ProjectManagerDto
projectManagerDto1
;
ProjectManagerDto
projectManagerDto1
;
...
@@ -632,34 +642,23 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
...
@@ -632,34 +642,23 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
for
(
ProjectTypeEnum
value
:
ProjectTypeEnum
.
values
())
{
for
(
ProjectTypeEnum
value
:
ProjectTypeEnum
.
values
())
{
projectInfoDto
=
new
ProjectInfoDto
().
setType
(
value
.
getType
()).
setTypeName
(
value
.
getTypeName
()).
setDeptManagerName
(
deptManagerName
);
projectInfoDto
=
new
ProjectInfoDto
().
setType
(
value
.
getType
()).
setTypeName
(
value
.
getTypeName
()).
setDeptManagerName
(
deptManagerName
);
if
(
1
==
value
.
getReviewer
())
{
if
(
1
==
value
.
getReviewer
())
{
List
<
ProjectDto
>
projectDtos
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
projectIds
))
{
for
(
WorkProject
project
:
projects
)
{
List
<
ProjectDto
>
projectDtos
=
new
ArrayList
<>();
if
(
project
.
getType
().
equals
(
value
.
getType
()))
{
for
(
WorkProject
project
:
projects
)
{
ProjectDto
projectDto
=
new
ProjectDto
();
if
(
project
.
getType
().
equals
(
value
.
getType
()))
{
BeanUtils
.
copyProperties
(
project
,
projectDto
);
ProjectDto
projectDto
=
new
ProjectDto
();
projectDto
.
setManagerName
(
workUserService
.
getById
(
project
.
getManagerId
()).
getName
());
BeanUtils
.
copyProperties
(
project
,
projectDto
);
projectDtos
.
add
(
projectDto
);
projectDto
.
setManagerName
(
workUserService
.
getById
(
project
.
getManagerId
()).
getName
());
projectDtos
.
add
(
projectDto
);
}
}
}
projectInfoDto
.
setProjectDto
(
projectDtos
);
}
}
projectInfoDto
.
setProjectDto
(
projectDtos
);
projectList
.
add
(
projectInfoDto
);
}
}
if
(!
CollectionUtils
.
isEmpty
(
projectIds
))
{
List
<
ProjectDto
>
projectDto1
=
new
ArrayList
<>();
List
<
ProjectDto
>
projectDto2
=
new
ArrayList
<>();
WorkProject
workProject
;
for
(
Integer
projectId
:
projectIds
)
{
workProject
=
workProjectService
.
getById
(
projectId
);
if
(
PROJECT
.
equals
(
workProject
.
getType
()))
{
projectDto1
.
add
(
projectToProjectDto
(
workProject
));
}
if
(
BUSINESS_OPPORTUNITY
.
equals
(
workProject
.
getType
()))
{
projectDto2
.
add
(
projectToProjectDto
(
workProject
));
}
}
}
projectList
.
add
(
projectInfoDto
);
}
}
return
projectList
;
return
projectList
;
}
}
...
@@ -834,7 +833,6 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
...
@@ -834,7 +833,6 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
dto
.
setStatus
(
status
);
dto
.
setStatus
(
status
);
// 如果是请假或者调休直接通过
// 如果是请假或者调休直接通过
if
(
LEAVE
.
equals
(
dto
.
getType
())
||
COMPENSATORY_LEAVE
.
equals
(
dto
.
getType
()))
{
if
(
LEAVE
.
equals
(
dto
.
getType
())
||
COMPENSATORY_LEAVE
.
equals
(
dto
.
getType
()))
{
dto
.
setStatus
(
APPROVED
);
dto
.
setProjectName
(
null
);
dto
.
setProjectName
(
null
);
dto
.
setProjectId
(
null
);
dto
.
setProjectId
(
null
);
}
}
...
@@ -873,9 +871,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
...
@@ -873,9 +871,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
}
}
// 部门经理
// 部门经理
if
(
2
==
level
)
{
if
(
2
==
level
)
{
System
.
out
.
println
(
type
);
types
=
type
==
null
?
Arrays
.
asList
(
5
,
6
,
7
)
:
new
ArrayList
<>(
Collections
.
singletonList
(
type
));
types
=
type
==
null
?
Arrays
.
asList
(
5
,
6
,
7
)
:
new
ArrayList
<>(
Collections
.
singletonList
(
type
));
System
.
out
.
println
(
types
);
workTimeOrders
=
workTimeOrderMapper
.
queryByPage
(
status
,
null
,
types
);
workTimeOrders
=
workTimeOrderMapper
.
queryByPage
(
status
,
null
,
types
);
}
}
List
<
WorkTimeOrderDto
>
workTimeOrderDtos
=
new
ArrayList
<>();
List
<
WorkTimeOrderDto
>
workTimeOrderDtos
=
new
ArrayList
<>();
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/config/auto/Examine.java
View file @
43ce33f1
...
@@ -40,29 +40,29 @@ public class Examine {
...
@@ -40,29 +40,29 @@ public class Examine {
private
WorkCollectService
workCollectService
;
private
WorkCollectService
workCollectService
;
@Autowired
@Autowired
private
WorkSubmitAdoptMapper
workSubmitAdoptMapper
;
private
static
WorkSubmitAdoptMapper
workSubmitAdoptMapper
;
private
final
static
Integer
COMPLETED
=
StatusEnum
.
COMPLETED
.
getCode
();
private
final
static
Integer
COMPLETED
=
StatusEnum
.
COMPLETED
.
getCode
();
private
final
static
Integer
RE_SUBMIT
=
StatusEnum
.
RE_SUBMIT
.
getCode
();
private
final
static
Integer
RE_SUBMIT
=
StatusEnum
.
RE_SUBMIT
.
getCode
();
private
final
static
Integer
AUTOMATIC_AUDIT
=
StatusEnum
.
AUTOMATIC_AUDIT
.
getCode
();
private
final
static
Integer
AUTOMATIC_AUDIT
=
StatusEnum
.
AUTOMATIC_AUDIT
.
getCode
();
// 每天凌晨自动审核
// 每天凌晨自动审核
@Scheduled
(
cron
=
"0 0 0 * * ?"
)
@Scheduled
(
cron
=
"0 0 0 * * ?"
)
public
void
autoExamine
()
{
public
void
autoExamine
()
{
log
.
info
(
"admin[]config[]auto[]Examine[]autoExamine"
);
log
.
info
(
"admin[]config[]auto[]Examine[]autoExamine"
);
// 获取系统默认值
// 获取系统默认值
WorkSubmitAdopt
workSubmitAdopt
=
workSubmitAdoptMapper
.
selectById
(
1
);
WorkSubmitAdopt
workSubmitAdopt
=
workSubmitAdoptMapper
.
selectById
(
1
);
Integer
autoAdopt
=
workSubmitAdopt
.
getAutoAdopt
();
Integer
autoAdopt
=
workSubmitAdopt
.
getSubmitTime
();
// 更新work_time_order表
// 更新work_time_order表
Date
yesterdayDate
=
getAutoExamineDay
(
autoAdopt
);
Date
yesterdayDate
=
getAutoExamineDay
(
autoAdopt
);
Date
now
=
DateUtil
.
getToday
();
Date
now
=
DateUtil
.
getToday
();
QueryWrapper
<
WorkTimeOrder
>
wrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
WorkTimeOrder
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
in
(
"status"
,
COMPLETED
,
RE_SUBMIT
);
wrapper
.
in
(
"status"
,
COMPLETED
,
RE_SUBMIT
);
wrapper
.
le
(
"work_day"
,
yesterdayDate
);
wrapper
.
le
(
"work_day"
,
yesterdayDate
);
List
<
WorkTimeOrder
>
workTimeOrders
=
workTimeOrderMapper
.
selectList
(
wrapper
);
List
<
WorkTimeOrder
>
workTimeOrders
=
workTimeOrderMapper
.
selectList
(
wrapper
);
UpdateWrapper
<
WorkTimeOrder
>
wtoWrapper
=
new
UpdateWrapper
<>();
UpdateWrapper
<
WorkTimeOrder
>
wtoWrapper
=
new
UpdateWrapper
<>();
wtoWrapper
.
in
(
"status"
,
COMPLETED
,
RE_SUBMIT
);
wtoWrapper
.
in
(
"status"
,
COMPLETED
,
RE_SUBMIT
);
wtoWrapper
.
le
(
"work_day"
,
yesterdayDate
);
wtoWrapper
.
le
(
"work_day"
,
yesterdayDate
);
WorkTimeOrder
workTimeOrder1
=
new
WorkTimeOrder
();
WorkTimeOrder
workTimeOrder1
=
new
WorkTimeOrder
();
workTimeOrder1
.
setStatus
(
AUTOMATIC_AUDIT
);
workTimeOrder1
.
setStatus
(
AUTOMATIC_AUDIT
);
...
@@ -79,15 +79,15 @@ public class Examine {
...
@@ -79,15 +79,15 @@ public class Examine {
public
static
Date
getAutoExamineDay
(
Integer
day
)
{
public
static
Date
getAutoExamineDay
(
Integer
day
)
{
day
=
-
(
day
+
1
)
;
day
=
-
day
;
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Calendar
c
=
Calendar
.
getInstance
();
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
new
Date
());
c
.
setTime
(
new
Date
());
c
.
add
(
Calendar
.
DATE
,
day
);
c
.
add
(
Calendar
.
DATE
,
day
);
Date
start
=
c
.
getTime
();
Date
start
=
c
.
getTime
();
String
qyt
=
format
.
format
(
start
);
String
qyt
=
format
.
format
(
start
);
System
.
out
.
println
(
qyt
);
System
.
out
.
println
(
qyt
);
return
DateUtil
.
convertStrToDate
(
qyt
,
"yyyy-MM-dd"
);
return
DateUtil
.
convertStrToDate
(
qyt
,
"yyyy-MM-dd"
);
}
}
...
...
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