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
10e655d5
Commit
10e655d5
authored
Feb 27, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
ddb403b4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
9 deletions
+51
-9
DepartmentApiService.java
...m/gic/haoban/manage/api/service/DepartmentApiService.java
+1
-1
DepartmentService.java
.../gic/haoban/manage/service/service/DepartmentService.java
+1
-1
DepartmentServiceImpl.java
...an/manage/service/service/impl/DepartmentServiceImpl.java
+1
-2
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+46
-3
DepartmentContoller.java
...gic/haoban/manage/web/controller/DepartmentContoller.java
+2
-2
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/DepartmentApiService.java
View file @
10e655d5
...
...
@@ -82,7 +82,7 @@ public interface DepartmentApiService {
* 回收站恢复
* @param departmentId
*/
HaobanResponse
repairRecycle
(
String
departmentId
);
HaobanResponse
repairRecycle
(
String
departmentId
,
String
parentId
);
/**
* 获取根节点
* @param wxEnterpriseId
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/DepartmentService.java
View file @
10e655d5
...
...
@@ -26,7 +26,7 @@ public interface DepartmentService {
Page
<
TabHaobanDepartment
>
pageDepartmentByParams
(
String
wxEnterpriseId
,
String
keyword
,
Integer
storeFlag
,
Integer
recycleFlag
);
void
repairRecycle
(
String
departmentId
);
void
repairRecycle
(
TabHaobanDepartment
tab
);
DepartmentDTO
getRootByEnterpriseId
(
String
wxEnterpriseId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/DepartmentServiceImpl.java
View file @
10e655d5
...
...
@@ -108,8 +108,7 @@ public class DepartmentServiceImpl implements DepartmentService {
}
@Override
public
void
repairRecycle
(
String
departmentId
)
{
TabHaobanDepartment
tab
=
mapper
.
selectByPrimaryKey
(
departmentId
);
public
void
repairRecycle
(
TabHaobanDepartment
tab
)
{
if
(
tab
!=
null
)
{
tab
.
setRecycleFlag
(
0
);
tab
.
setUpdateTime
(
new
Date
());
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
10e655d5
...
...
@@ -89,7 +89,6 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseService
.
selectById
(
department
.
getWxEnterpriseId
());
TabHaobanWxApplication
application
=
wxApplicationService
.
selectByWxEnterpriseIdAndApplicationType
(
department
.
getWxEnterpriseId
(),
1
);
logger
.
info
(
"【部门新增】enterpriseDTO = {}"
,
JSON
.
toJSONString
(
enterpriseDTO
));
logger
.
info
(
"【部门新增】application = {}"
,
JSON
.
toJSONString
(
application
));
if
(
enterpriseDTO
!=
null
)
{
if
(
application
!=
null
)
{
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
dto
=
new
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
();
...
...
@@ -198,6 +197,21 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
public
HaobanResponse
recycle
(
String
departmentId
)
{
HaobanResponse
hr
=
new
HaobanResponse
();
hr
.
setErrorCode
(
1
);
//调微信的新增接口
TabHaobanDepartment
department
=
departmentService
.
selectById
(
departmentId
);
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseService
.
selectById
(
department
.
getWxEnterpriseId
());
TabHaobanWxApplication
application
=
wxApplicationService
.
selectByWxEnterpriseIdAndApplicationType
(
department
.
getWxEnterpriseId
(),
1
);
if
(
enterpriseDTO
!=
null
)
{
if
(
application
!=
null
)
{
JSONResponse
jp
=
qywxDepartmentApiService
.
deleteDepartment
(
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
(),
Integer
.
parseInt
(
department
.
getWxDepartmentId
()));
if
(
jp
.
getErrorCode
()
!=
0
)
{
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信删除部门失败"
);
return
hr
;
}
}
}
departmentService
.
recycle
(
departmentId
);
return
hr
;
}
...
...
@@ -210,10 +224,39 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public
HaobanResponse
repairRecycle
(
String
departmentId
)
{
public
HaobanResponse
repairRecycle
(
String
departmentId
,
String
parentId
)
{
HaobanResponse
hr
=
new
HaobanResponse
();
hr
.
setErrorCode
(
0
);
departmentService
.
repairRecycle
(
departmentId
);
TabHaobanDepartment
tab
=
departmentService
.
selectById
(
departmentId
);
//调微信的新增接口
String
wxDepartmentId
=
""
;
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseService
.
selectById
(
tab
.
getWxEnterpriseId
());
TabHaobanWxApplication
application
=
wxApplicationService
.
selectByWxEnterpriseIdAndApplicationType
(
tab
.
getWxEnterpriseId
(),
1
);
logger
.
info
(
"【部门新增】enterpriseDTO = {}"
,
JSON
.
toJSONString
(
enterpriseDTO
));
if
(
enterpriseDTO
!=
null
)
{
if
(
application
!=
null
)
{
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
dto
=
new
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
();
dto
.
setCorpid
(
enterpriseDTO
.
getCorpid
());
dto
.
setName
(
tab
.
getDepartmentName
());
dto
.
setOrder
(
tab
.
getSort
());
TabHaobanDepartment
parent
=
departmentService
.
selectById
(
parentId
);
dto
.
setParentid
(
Integer
.
valueOf
(
parent
.
getWxDepartmentId
()));
logger
.
info
(
"【部门新增】corpid() = {},siteId={},dto={}"
,
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
(),
JSON
.
toJSONString
(
dto
));
JSONResponse
jp
=
qywxDepartmentApiService
.
createDepartment
(
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
(),
dto
);
logger
.
info
(
"【部门新增】jp = {}"
,
JSON
.
toJSONString
(
jp
));
if
(
jp
.
getErrorCode
()
!=
0
)
{
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信新增部门失败"
);
return
hr
;
}
wxDepartmentId
=
jp
.
getResult
().
toString
();
tab
.
setWxDepartmentId
(
wxDepartmentId
);
tab
.
setParentDepartmentId
(
parentId
);
logger
.
info
(
"【部门新增】wxDepartmentId = {}"
,
wxDepartmentId
);
}
}
departmentService
.
repairRecycle
(
tab
);
return
hr
;
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/DepartmentContoller.java
View file @
10e655d5
...
...
@@ -339,12 +339,12 @@ public class DepartmentContoller extends WebBaseController{
}
@RequestMapping
(
"department-repair"
)
public
HaobanResponse
departmentRepair
(
String
departmentId
)
{
public
HaobanResponse
departmentRepair
(
String
departmentId
,
String
parentId
)
{
DepartmentDTO
dto
=
departmentApiService
.
selectById
(
departmentId
);
if
(
dto
==
null
||
dto
.
getStatusFlag
()
==
0
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10003
);
}
departmentApiService
.
repairRecycle
(
departmentId
);
departmentApiService
.
repairRecycle
(
departmentId
,
parentId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_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