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
ba04204a
Commit
ba04204a
authored
Feb 23, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
7f3846ab
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
7 deletions
+14
-7
ChangeTypeEnum.java
...rc/main/java/cn/wisenergy/model/enums/ChangeTypeEnum.java
+2
-2
WorkHolidayServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkHolidayServiceImpl.java
+2
-1
WorkProjectServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
+1
-1
WorkTimeOrderServiceImpl.java
...a/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
+6
-0
WorkTypeServiceImpl.java
...n/java/cn/wisenergy/service/impl/WorkTypeServiceImpl.java
+3
-3
No files found.
wisenergy-model/src/main/java/cn/wisenergy/model/enums/ChangeTypeEnum.java
View file @
ba04204a
...
@@ -5,8 +5,8 @@ package cn.wisenergy.model.enums;
...
@@ -5,8 +5,8 @@ package cn.wisenergy.model.enums;
* @QQ1799796883
* @QQ1799796883
*/
*/
public
enum
ChangeTypeEnum
{
public
enum
ChangeTypeEnum
{
COSTBUDGET
(
1
,
"成本预算"
),
COSTBUDGET
(
1
,
"成本预算
(万元)
"
),
WORKINGHOURSBUDGET
(
2
,
"工时预算"
),
WORKINGHOURSBUDGET
(
2
,
"工时预算
(人/天)
"
),
STARTINGTIME
(
3
,
"预计开始时间"
),
STARTINGTIME
(
3
,
"预计开始时间"
),
ENDTIME
(
4
,
"预计结束时间"
),
ENDTIME
(
4
,
"预计结束时间"
),
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkHolidayServiceImpl.java
View file @
ba04204a
...
@@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -174,7 +175,7 @@ public class WorkHolidayServiceImpl implements WorkHolidayService {
...
@@ -174,7 +175,7 @@ public class WorkHolidayServiceImpl implements WorkHolidayService {
/*if (null == workHoliday.getDayType()) {
/*if (null == workHoliday.getDayType()) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.INPUT_PARAM_IS_NULL);
throw new BaseCustomException(BASE_RESP_CODE_ENUM.INPUT_PARAM_IS_NULL);
}*/
}*/
if
(
null
==
workHoliday
.
getDes
(
))
{
if
(
StringUtils
.
isEmpty
(
workHoliday
.
getDes
()
))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
}
if
(
workHoliday
.
getDayStart
().
compareTo
(
workHoliday
.
getDayEnd
())
>
0
)
{
if
(
workHoliday
.
getDayStart
().
compareTo
(
workHoliday
.
getDayEnd
())
>
0
)
{
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
View file @
ba04204a
...
@@ -99,7 +99,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
...
@@ -99,7 +99,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
}
}
List
<
WorkProject
>
workProjects
=
workProjectMapper
.
getProjectsByIds
(
ids
,
isConclusion
);
List
<
WorkProject
>
workProjects
=
workProjectMapper
.
getProjectsByIds
(
ids
,
isConclusion
);
if
(
CollectionUtils
.
isEmpty
(
workProjects
))
{
if
(
CollectionUtils
.
isEmpty
(
workProjects
))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
MANAGER_NOT_PROJECT
)
;
return
null
;
}
}
return
workProjects
;
return
workProjects
;
}
}
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
View file @
ba04204a
...
@@ -541,13 +541,16 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
...
@@ -541,13 +541,16 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
if
(!
CollectionUtils
.
isEmpty
(
workTypes
))
{
if
(!
CollectionUtils
.
isEmpty
(
workTypes
))
{
projectsDto
.
setWorkTypes
(
workTypes
);
projectsDto
.
setWorkTypes
(
workTypes
);
}
}
// 2.获取可填报的项目
// 2.获取可填报的项目
projectsDto
.
setProjectInfoDto
(
getProjectInfoDto
(
userId
));
projectsDto
.
setProjectInfoDto
(
getProjectInfoDto
(
userId
));
// 3.获取可审批的项目
// 3.获取可审批的项目
List
<
UserRoleLevelDto
>
roleUserLevel
=
UserRoleLevelUtils
.
getRoleUserLevel
(
userId
);
List
<
UserRoleLevelDto
>
roleUserLevel
=
UserRoleLevelUtils
.
getRoleUserLevel
(
userId
);
if
(
CollectionUtils
.
isEmpty
(
roleUserLevel
))
{
if
(
CollectionUtils
.
isEmpty
(
roleUserLevel
))
{
return
projectsDto
;
return
projectsDto
;
}
}
for
(
UserRoleLevelDto
userRoleLevelDto
:
roleUserLevel
)
{
for
(
UserRoleLevelDto
userRoleLevelDto
:
roleUserLevel
)
{
// 如果有审批权限
// 如果有审批权限
if
(
LevelEnum
.
EXAMINE
.
getLevelName
().
equals
(
userRoleLevelDto
.
getLevelName
()))
{
if
(
LevelEnum
.
EXAMINE
.
getLevelName
().
equals
(
userRoleLevelDto
.
getLevelName
()))
{
...
@@ -620,6 +623,9 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
...
@@ -620,6 +623,9 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
List
<
ProjectInfoDto
>
projectList
=
new
ArrayList
<>();
List
<
ProjectInfoDto
>
projectList
=
new
ArrayList
<>();
// 3.获取正在进行中的项目/商机
// 3.获取正在进行中的项目/商机
List
<
WorkProject
>
projects
=
workProjectService
.
getNameByIds
(
projectIds
,
1
);
List
<
WorkProject
>
projects
=
workProjectService
.
getNameByIds
(
projectIds
,
1
);
if
(
CollectionUtils
.
isEmpty
(
projects
))
{
return
projectList
;
}
ProjectInfoDto
projectInfoDto
;
ProjectInfoDto
projectInfoDto
;
List
<
WorkType
>
workTypes
=
workTypeService
.
getAll
();
List
<
WorkType
>
workTypes
=
workTypeService
.
getAll
();
if
(!
CollectionUtils
.
isEmpty
(
workTypes
))
{
if
(!
CollectionUtils
.
isEmpty
(
workTypes
))
{
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTypeServiceImpl.java
View file @
ba04204a
...
@@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
java.util.List
;
import
java.util.List
;
...
@@ -51,11 +52,11 @@ public class WorkTypeServiceImpl implements WorkTypeService {
...
@@ -51,11 +52,11 @@ public class WorkTypeServiceImpl implements WorkTypeService {
@Override
@Override
public
Boolean
addAndModifyWorkType
(
WorkType
workType
)
{
public
Boolean
addAndModifyWorkType
(
WorkType
workType
)
{
log
.
info
(
"WorkTypeServiceImpl[]modifyTypeById[]input.param.workType:{}"
+
workType
);
log
.
info
(
"WorkTypeServiceImpl[]modifyTypeById[]input.param.workType:{}"
+
workType
);
if
(
null
==
workType
||
(
null
==
workType
.
getName
()
&&
null
==
workType
.
getReviewer
()))
{
if
(
null
==
workType
||
(
StringUtils
.
isEmpty
(
workType
.
getName
())
&&
null
==
workType
.
getReviewer
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
}
if
(
null
==
workType
.
getId
())
{
if
(
null
==
workType
.
getId
())
{
if
(
null
==
workType
.
getName
(
)
||
null
==
workType
.
getReviewer
())
{
if
(
StringUtils
.
isEmpty
(
workType
.
getName
()
)
||
null
==
workType
.
getReviewer
())
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
}
int
insert
=
workTypeMapper
.
insert
(
workType
);
int
insert
=
workTypeMapper
.
insert
(
workType
);
...
@@ -65,7 +66,6 @@ public class WorkTypeServiceImpl implements WorkTypeService {
...
@@ -65,7 +66,6 @@ public class WorkTypeServiceImpl implements WorkTypeService {
if
(
i
==
0
)
{
if
(
i
==
0
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
UPDATE_DATA_FAIL
);
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
UPDATE_DATA_FAIL
);
}
}
return
i
>
0
;
return
i
>
0
;
}
}
}
}
...
...
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