Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
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
haoban3.0
haoban-manage3.0
Commits
c0f703f9
Commit
c0f703f9
authored
Mar 18, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
5be5cd8c
96ea0b5c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
7 deletions
+59
-7
DepartmentServiceImpl.java
...an/manage/service/service/impl/DepartmentServiceImpl.java
+59
-7
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/DepartmentServiceImpl.java
View file @
c0f703f9
...
@@ -23,6 +23,7 @@ import org.springframework.stereotype.Service;
...
@@ -23,6 +23,7 @@ import org.springframework.stereotype.Service;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
@Service
@Service
public
class
DepartmentServiceImpl
implements
DepartmentService
{
public
class
DepartmentServiceImpl
implements
DepartmentService
{
...
@@ -76,16 +77,17 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -76,16 +77,17 @@ public class DepartmentServiceImpl implements DepartmentService {
if
(
department
.
getTempFlag
()
==
null
)
{
if
(
department
.
getTempFlag
()
==
null
)
{
department
.
setTempFlag
(
0
);
department
.
setTempFlag
(
0
);
}
}
mapper
.
insert
(
tab
);
mapper
.
insert
(
tab
);
try
{
syncWelcomeSuitDepartment
(
tab
.
getParentDepartmentId
(),
tab
.
getDepartmentId
(),
tab
.
getDepartmentName
(),
tab
.
getWxEnterpriseId
());
syncWelcomeSuitAddDepartment
(
tab
.
getParentDepartmentId
(),
tab
.
getDepartmentId
(),
tab
.
getDepartmentName
(),
tab
.
getWxEnterpriseId
());
}
catch
(
Exception
e
)
{
logger
.
error
(
"同步部门-新增欢迎语适用部门信息异常"
,
e
);
}
return
tab
.
getDepartmentId
();
return
tab
.
getDepartmentId
();
}
}
private
void
syncWelcomeSuitDepartment
(
String
parentDepartmentId
,
String
currentDepartmentId
,
private
void
syncWelcomeSuit
Add
Department
(
String
parentDepartmentId
,
String
currentDepartmentId
,
String
currentDepartmentName
,
String
wxEnterpriseId
)
{
String
currentDepartmentName
,
String
wxEnterpriseId
)
{
logger
.
info
(
"同步欢迎语适用部门, parentDepartmentId:{}, currentDepartmentId:{}, wxEnterpriseId:{}"
,
logger
.
info
(
"同步欢迎语适用部门, parentDepartmentId:{}, currentDepartmentId:{}, wxEnterpriseId:{}"
,
parentDepartmentId
,
currentDepartmentId
,
wxEnterpriseId
);
parentDepartmentId
,
currentDepartmentId
,
wxEnterpriseId
);
...
@@ -130,18 +132,68 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -130,18 +132,68 @@ public class DepartmentServiceImpl implements DepartmentService {
TabHaobanDepartment
tab
=
EntityUtil
.
changeEntityByJSON
(
TabHaobanDepartment
.
class
,
department
);
TabHaobanDepartment
tab
=
EntityUtil
.
changeEntityByJSON
(
TabHaobanDepartment
.
class
,
department
);
tab
.
setUpdateTime
(
now
);
tab
.
setUpdateTime
(
now
);
mapper
.
updateByPrimaryKeySelective
(
tab
);
mapper
.
updateByPrimaryKeySelective
(
tab
);
try
{
syncWelcomeSuitEditDepartment
(
tab
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"同步部门-修改欢迎语适用部门信息异常"
,
e
);
}
}
private
void
syncWelcomeSuitEditDepartment
(
TabHaobanDepartment
tab
)
{
if
(
StringUtils
.
isEmpty
(
tab
.
getWxEnterpriseId
()))
{
return
;
}
// 列举部门被关联的欢迎语
TabHaobanWelcomeSuitRang
query
=
new
TabHaobanWelcomeSuitRang
();
query
.
setWxEnterpriseId
(
tab
.
getWxEnterpriseId
());
query
.
setSuitDepartmentId
(
tab
.
getDepartmentId
());
query
.
setDeleteFlag
(
0
);
List
<
TabHaobanWelcomeSuitRang
>
welcomeSuitRangList
=
welcomeSuitRangMapper
.
queryAll
(
query
);
if
(
CollectionUtils
.
isEmpty
(
welcomeSuitRangList
))
{
logger
.
info
(
"部门查询为空"
);
return
;
}
// 更新名称
welcomeSuitRangList
.
forEach
(
one
->
{
one
.
setUpdateTime
(
new
Date
());
one
.
setSuitDepartmentName
(
tab
.
getDepartmentName
());
welcomeSuitRangMapper
.
update
(
one
);
});
}
}
@Override
@Override
public
void
del
(
String
departmentId
)
{
public
void
del
(
String
departmentId
)
{
TabHaobanDepartment
tab
=
mapper
.
selectByPrimaryKey
(
departmentId
);
TabHaobanDepartment
tab
=
mapper
.
selectByPrimaryKey
(
departmentId
);
if
(
tab
!=
null
)
{
if
(
Objects
.
isNull
(
tab
))
{
return
;
}
tab
.
setStatusFlag
(
0
);
tab
.
setStatusFlag
(
0
);
tab
.
setUpdateTime
(
new
Date
());
tab
.
setUpdateTime
(
new
Date
());
}
mapper
.
updateByPrimaryKeySelective
(
tab
);
mapper
.
updateByPrimaryKeySelective
(
tab
);
try
{
syncWelcomeSuitDeleteDepartment
(
departmentId
,
tab
.
getWxEnterpriseId
());
}
catch
(
Exception
e
)
{
logger
.
error
(
"同步部门-删除欢迎语适用部门信息异常"
,
e
);
}
}
private
void
syncWelcomeSuitDeleteDepartment
(
String
departmentId
,
String
wxEnterperiseId
)
{
// 列举部门被关联的欢迎语
TabHaobanWelcomeSuitRang
query
=
new
TabHaobanWelcomeSuitRang
();
query
.
setWxEnterpriseId
(
wxEnterperiseId
);
query
.
setSuitDepartmentId
(
departmentId
);
query
.
setDeleteFlag
(
0
);
List
<
TabHaobanWelcomeSuitRang
>
welcomeSuitRangList
=
welcomeSuitRangMapper
.
queryAll
(
query
);
if
(
CollectionUtils
.
isEmpty
(
welcomeSuitRangList
))
{
logger
.
info
(
"部门查询为空"
);
return
;
}
// 删除
welcomeSuitRangList
.
forEach
(
one
->
{
one
.
setUpdateTime
(
new
Date
());
one
.
setDeleteFlag
(
1
);
welcomeSuitRangMapper
.
update
(
one
);
});
}
}
@Override
@Override
...
...
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