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
15de52f8
Commit
15de52f8
authored
Mar 29, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
ed516db8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
ModifyProjectVo.java
.../src/main/java/cn/wisenergy/model/vo/ModifyProjectVo.java
+3
-1
WorkProjectServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
+17
-2
No files found.
wisenergy-model/src/main/java/cn/wisenergy/model/vo/ModifyProjectVo.java
View file @
15de52f8
...
...
@@ -62,6 +62,8 @@ public class ModifyProjectVo {
private
String
projectNameReason
;
//变更人Id
//
变更人Id
private
Integer
reviserId
;
// 是否加入变更项
private
Integer
isModify
;
}
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
View file @
15de52f8
...
...
@@ -336,8 +336,6 @@ public class WorkProjectServiceImpl implements WorkProjectService {
}
}
// 验证项目
verificationItem
(
modifyProjectVo
,
workProject
,
userIds
);
...
...
@@ -755,8 +753,10 @@ public class WorkProjectServiceImpl implements WorkProjectService {
*/
private
void
verificationItem
(
ModifyProjectVo
modifyProjectVo
,
WorkProject
workProject
,
List
<
Integer
>
userIds
)
{
int
modifyCount
=
0
;
// 校验部门
if
(!
workProject
.
getDeptId
().
equals
(
modifyProjectVo
.
getDeptId
()))
{
modifyCount
++;
if
(
StringUtils
.
isBlank
(
modifyProjectVo
.
getDeptIdReason
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
REASON_CANNOT_BE_EMPTY
);
}
...
...
@@ -765,6 +765,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
// 校验开始时间
if
(
null
!=
modifyProjectVo
.
getStartTime
())
{
modifyCount
++;
if
(
StringUtils
.
isBlank
(
modifyProjectVo
.
getStartTimeReason
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
REASON_CANNOT_BE_EMPTY
);
}
...
...
@@ -784,6 +785,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
// 校验结束时间
if
(
null
!=
modifyProjectVo
.
getEndTime
())
{
modifyCount
++;
if
(
StringUtils
.
isBlank
(
modifyProjectVo
.
getEndTimeReason
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
REASON_CANNOT_BE_EMPTY
);
}
...
...
@@ -803,6 +805,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
// 校验成本预算
if
(
null
!=
modifyProjectVo
.
getCostBudget
())
{
modifyCount
++;
if
(
BigDecimal
.
ZERO
.
compareTo
(
modifyProjectVo
.
getCostBudget
())
>
0
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
BUDGET_CANNOT_BELESSTHAN_ZERO
);
}
...
...
@@ -819,6 +822,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
// oa编号验证
if
(!
StringUtils
.
isBlank
(
modifyProjectVo
.
getOaProjectId
()))
{
if
(!
modifyProjectVo
.
getOaProjectId
().
equals
(
workProject
.
getOaProjectId
()))
{
modifyCount
++;
if
(
StringUtils
.
isBlank
(
modifyProjectVo
.
getOaProjectIdReason
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
REASON_CANNOT_BE_EMPTY
);
}
...
...
@@ -828,6 +832,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
// 项目名称验证
if
(!
StringUtils
.
isBlank
(
modifyProjectVo
.
getProjectName
()))
{
if
(!
modifyProjectVo
.
getProjectName
().
equals
(
workProject
.
getProjectName
()))
{
modifyCount
++;
if
(
StringUtils
.
isBlank
(
modifyProjectVo
.
getProjectNameReason
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
REASON_CANNOT_BE_EMPTY
);
}
...
...
@@ -836,6 +841,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
// 校验工时预算
if
(
null
!=
modifyProjectVo
.
getWorkTime
())
{
modifyCount
++;
if
(
BigDecimal
.
ZERO
.
compareTo
(
modifyProjectVo
.
getWorkTime
())
>
0
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
BUDGET_CANNOT_BELESSTHAN_ZERO
);
}
...
...
@@ -852,6 +858,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
// 校验负责人
if
(!
workProject
.
getManagerId
().
equals
(
modifyProjectVo
.
getManagerId
()))
{
modifyCount
++;
if
(
StringUtils
.
isBlank
(
modifyProjectVo
.
getManagerIdReason
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
REASON_CANNOT_BE_EMPTY
);
}
...
...
@@ -869,9 +876,17 @@ public class WorkProjectServiceImpl implements WorkProjectService {
if
(!(
userIds
.
containsAll
(
modifyProjectVo
.
getUserIds
())
&&
modifyProjectVo
.
getUserIds
().
containsAll
(
userIds
)))
{
modifyCount
++;
if
(
StringUtils
.
isBlank
(
modifyProjectVo
.
getUserIdsReason
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
REASON_CANNOT_BE_EMPTY
);
}
}
// 是否存在变更项
if
((
modifyCount
==
1
&&
StringUtils
.
isBlank
(
modifyProjectVo
.
getUserIdsReason
()))||
modifyCount
>
1
)
{
modifyProjectVo
.
setIsModify
(
1
);
}
}
}
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