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
c73eae43
Commit
c73eae43
authored
4 years ago
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
15de52f8
chenqi5.0
chenqi2.0
chenqi3.0
chenqi4.0
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
11 deletions
+34
-11
WorkProjectMapper.xml
...gy-mapper/src/main/resources/mapper/WorkProjectMapper.xml
+3
-1
WorkProjectServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
+31
-10
No files found.
wisenergy-mapper/src/main/resources/mapper/WorkProjectMapper.xml
View file @
c73eae43
...
@@ -91,7 +91,9 @@
...
@@ -91,7 +91,9 @@
<if
test=
"null != projectName"
>
<if
test=
"null != projectName"
>
project_name = #{projectName},
project_name = #{projectName},
</if>
</if>
<if
test=
"isModify !=null"
>
modify_time = now()
modify_time = now()
</if>
</set>
</set>
<where>
<where>
<if
test=
"null != projectId"
>
<if
test=
"null != projectId"
>
...
...
This diff is collapsed.
Click to expand it.
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
View file @
c73eae43
...
@@ -353,6 +353,11 @@ public class WorkProjectServiceImpl implements WorkProjectService {
...
@@ -353,6 +353,11 @@ public class WorkProjectServiceImpl implements WorkProjectService {
if
(
StringUtils
.
isBlank
(
modifyProjectVo
.
getOaProjectId
()))
{
if
(
StringUtils
.
isBlank
(
modifyProjectVo
.
getOaProjectId
()))
{
throw
new
BaseCustomException
(
"666"
,
"请填写项目/商机编号"
);
throw
new
BaseCustomException
(
"666"
,
"请填写项目/商机编号"
);
}
}
if
(!
StringUtils
.
isBlank
(
workProject
.
getOaProjectId
()))
{
if
(
modifyProjectVo
.
getOaProjectId
().
equals
(
workProject
.
getOaProjectId
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
theNewContent_IsEqual_ToTheOriginal_Content
);
}
}
WorkProjectChange
workProjectChange
=
new
WorkProjectChange
();
WorkProjectChange
workProjectChange
=
new
WorkProjectChange
();
workProjectChange
.
setProjectId
(
modifyProjectVo
.
getProjectId
());
workProjectChange
.
setProjectId
(
modifyProjectVo
.
getProjectId
());
workProjectChange
.
setModifyTime
(
new
Date
());
workProjectChange
.
setModifyTime
(
new
Date
());
...
@@ -368,6 +373,11 @@ public class WorkProjectServiceImpl implements WorkProjectService {
...
@@ -368,6 +373,11 @@ public class WorkProjectServiceImpl implements WorkProjectService {
if
(
StringUtils
.
isBlank
(
modifyProjectVo
.
getProjectName
()))
{
if
(
StringUtils
.
isBlank
(
modifyProjectVo
.
getProjectName
()))
{
throw
new
BaseCustomException
(
"666"
,
"请填写项目/商机名称"
);
throw
new
BaseCustomException
(
"666"
,
"请填写项目/商机名称"
);
}
}
if
(!
StringUtils
.
isBlank
(
workProject
.
getProjectName
()))
{
if
(
modifyProjectVo
.
getProjectName
().
equals
(
workProject
.
getProjectName
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
theNewContent_IsEqual_ToTheOriginal_Content
);
}
}
WorkProjectChange
workProjectChange
=
new
WorkProjectChange
();
WorkProjectChange
workProjectChange
=
new
WorkProjectChange
();
workProjectChange
.
setProjectId
(
modifyProjectVo
.
getProjectId
());
workProjectChange
.
setProjectId
(
modifyProjectVo
.
getProjectId
());
workProjectChange
.
setModifyTime
(
new
Date
());
workProjectChange
.
setModifyTime
(
new
Date
());
...
@@ -393,6 +403,8 @@ public class WorkProjectServiceImpl implements WorkProjectService {
...
@@ -393,6 +403,8 @@ public class WorkProjectServiceImpl implements WorkProjectService {
workProjectChange
.
setOperationType
(
2
);
workProjectChange
.
setOperationType
(
2
);
workProjectChange
.
setReviserId
(
modifyProjectVo
.
getReviserId
());
workProjectChange
.
setReviserId
(
modifyProjectVo
.
getReviserId
());
workProjectChanges
.
add
(
workProjectChange
);
workProjectChanges
.
add
(
workProjectChange
);
}
else
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
theNewContent_IsEqual_ToTheOriginal_Content
);
}
}
}
}
if
(!
StringUtils
.
isBlank
(
modifyProjectVo
.
getManagerIdReason
()))
{
if
(!
StringUtils
.
isBlank
(
modifyProjectVo
.
getManagerIdReason
()))
{
...
@@ -407,6 +419,8 @@ public class WorkProjectServiceImpl implements WorkProjectService {
...
@@ -407,6 +419,8 @@ public class WorkProjectServiceImpl implements WorkProjectService {
workProjectChange
.
setOperationType
(
2
);
workProjectChange
.
setOperationType
(
2
);
workProjectChange
.
setReviserId
(
modifyProjectVo
.
getReviserId
());
workProjectChange
.
setReviserId
(
modifyProjectVo
.
getReviserId
());
workProjectChanges
.
add
(
workProjectChange
);
workProjectChanges
.
add
(
workProjectChange
);
}
else
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
theNewContent_IsEqual_ToTheOriginal_Content
);
}
}
}
}
...
@@ -469,7 +483,8 @@ public class WorkProjectServiceImpl implements WorkProjectService {
...
@@ -469,7 +483,8 @@ public class WorkProjectServiceImpl implements WorkProjectService {
workProjectChanges
.
add
(
workProjectChange
);
workProjectChanges
.
add
(
workProjectChange
);
}
}
if
(!
StringUtils
.
isBlank
(
modifyProjectVo
.
getUserIdsReason
()))
{
if
(!
StringUtils
.
isBlank
(
modifyProjectVo
.
getUserIdsReason
()))
{
if
(!
userIds
.
equals
(
modifyProjectVo
.
getUserIds
()))
{
if
(!(
userIds
.
containsAll
(
modifyProjectVo
.
getUserIds
())
&&
modifyProjectVo
.
getUserIds
().
containsAll
(
userIds
)))
{
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"status"
,
1
);
map
.
put
(
"status"
,
1
);
List
<
WorkUser
>
byMap
=
workUserService
.
getByMap
(
map
);
List
<
WorkUser
>
byMap
=
workUserService
.
getByMap
(
map
);
...
@@ -508,6 +523,8 @@ public class WorkProjectServiceImpl implements WorkProjectService {
...
@@ -508,6 +523,8 @@ public class WorkProjectServiceImpl implements WorkProjectService {
workProjectChange
.
setOperationType
(
2
);
workProjectChange
.
setOperationType
(
2
);
workProjectChange
.
setReviserId
(
modifyProjectVo
.
getReviserId
());
workProjectChange
.
setReviserId
(
modifyProjectVo
.
getReviserId
());
workProjectChanges
.
add
(
workProjectChange
);
workProjectChanges
.
add
(
workProjectChange
);
}
else
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
theNewContent_IsEqual_ToTheOriginal_Content
);
}
}
}
}
...
@@ -588,7 +605,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
...
@@ -588,7 +605,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
workProjectChange
.
setOperationType
(
1
);
workProjectChange
.
setOperationType
(
1
);
int
insert1
=
workProjectChangeMapper
.
insert
(
workProjectChange
);
int
insert1
=
workProjectChangeMapper
.
insert
(
workProjectChange
);
return
insert1
>
0
;
return
insert1
>
0
;
}
}
private
OrderChangeDto
getProjevtAndTypeOfDept
(
Integer
userId
,
Boolean
isFillIn
,
Boolean
addProjectOfDept
)
{
private
OrderChangeDto
getProjevtAndTypeOfDept
(
Integer
userId
,
Boolean
isFillIn
,
Boolean
addProjectOfDept
)
{
...
@@ -685,12 +702,17 @@ public class WorkProjectServiceImpl implements WorkProjectService {
...
@@ -685,12 +702,17 @@ public class WorkProjectServiceImpl implements WorkProjectService {
}
}
}
}
if
(!
isAdd
)
{
if
(!
isAdd
)
{
if
(
addProjectOfDept
)
{
projectAndOrderTypes
=
workDeptService
.
getDeptOfProjectAndOrderType
(
null
,
projectOfDeptId
);
projectAndOrderTypes
.
get
(
0
).
getProjectManagerDtos
().
addAll
(
projectManagerDtos
);
}
else
{
DeptOfProjectAndOrderType
projectAndOrderType
=
new
DeptOfProjectAndOrderType
();
DeptOfProjectAndOrderType
projectAndOrderType
=
new
DeptOfProjectAndOrderType
();
projectAndOrderType
.
setDeptId
(
user
.
getDeptId
());
projectAndOrderType
.
setDeptId
(
user
.
getDeptId
());
projectAndOrderType
.
setDeptName
(
dept
.
getDeptName
());
projectAndOrderType
.
setDeptName
(
dept
.
getDeptName
());
projectAndOrderType
.
setProjectManagerDtos
(
projectManagerDtos
);
projectAndOrderType
.
setProjectManagerDtos
(
projectManagerDtos
);
projectAndOrderTypes
.
add
(
projectAndOrderType
);
projectAndOrderTypes
.
add
(
projectAndOrderType
);
}
}
}
// 组织架构
// 组织架构
if
(
isFillIn
)
{
if
(
isFillIn
)
{
List
<
DeptUserDto
>
deptUserDtos
=
workUserService
.
getOrganizationStructureDtos
().
get
(
0
).
getDeptUserDtos
();
List
<
DeptUserDto
>
deptUserDtos
=
workUserService
.
getOrganizationStructureDtos
().
get
(
0
).
getDeptUserDtos
();
...
@@ -881,10 +903,9 @@ public class WorkProjectServiceImpl implements WorkProjectService {
...
@@ -881,10 +903,9 @@ public class WorkProjectServiceImpl implements WorkProjectService {
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
REASON_CANNOT_BE_EMPTY
);
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
REASON_CANNOT_BE_EMPTY
);
}
}
}
}
// 是否存在变更项
// 是否存在变更项
if
((
modifyCount
==
1
&&
StringUtils
.
isBlank
(
modifyProjectVo
.
getUserIdsReason
()))
||
if
((
modifyCount
==
1
&&
StringUtils
.
isBlank
(
modifyProjectVo
.
getUserIdsReason
()))
||
modifyCount
>
1
)
{
modifyCount
>
1
)
{
modifyProjectVo
.
setIsModify
(
1
);
modifyProjectVo
.
setIsModify
(
1
);
}
}
...
...
This diff is collapsed.
Click to expand it.
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