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
9078ddd0
Commit
9078ddd0
authored
Mar 26, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
cb82f8ca
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
87 additions
and
91 deletions
+87
-91
pom.xml
haoban-manage3-api/pom.xml
+0
-5
QywxCallBackDTO.java
...n/java/com/gic/haoban/manage/api/dto/QywxCallBackDTO.java
+0
-1
DepartmentApiService.java
...m/gic/haoban/manage/api/service/DepartmentApiService.java
+9
-9
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+2
-2
WxEnterpriseApiService.java
...gic/haoban/manage/api/service/WxEnterpriseApiService.java
+0
-1
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+45
-44
MessageApiServiceImpl.java
...anage/service/service/out/impl/MessageApiServiceImpl.java
+3
-3
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+9
-9
DepartmentContoller.java
...gic/haoban/manage/web/controller/DepartmentContoller.java
+15
-14
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+4
-3
No files found.
haoban-manage3-api/pom.xml
View file @
9078ddd0
...
...
@@ -52,11 +52,6 @@
<artifactId>
haoban-base-api
</artifactId>
<version>
${haoban-base-api}
</version>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
haoban-common
</artifactId>
<version>
${haoban-common}
</version>
</dependency>
</dependencies>
<build>
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/QywxCallBackDTO.java
View file @
9078ddd0
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
java.io.Serializable
;
/**
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/DepartmentApiService.java
View file @
9078ddd0
...
...
@@ -4,7 +4,7 @@ import java.util.List;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.
common.utils.Haoban
Response
;
import
com.gic.haoban.
base.api.common.Service
Response
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
public
interface
DepartmentApiService
{
...
...
@@ -47,19 +47,19 @@ public interface DepartmentApiService {
* @param department
* @return
*/
Haoban
Response
add
(
DepartmentDTO
department
);
Service
Response
add
(
DepartmentDTO
department
);
/**
* 修改部门
* @param department
* @return
*/
Haoban
Response
edit
(
DepartmentDTO
department
);
Service
Response
edit
(
DepartmentDTO
department
);
/**
* 删除部门
* @param departmentId
* @return
*/
Haoban
Response
del
(
String
departmentId
);
Service
Response
del
(
String
departmentId
);
/**
* 根据关联id 获取部门
* @param departId
...
...
@@ -71,7 +71,7 @@ public interface DepartmentApiService {
* @param departmentId
* @return
*/
Haoban
Response
recycle
(
String
departmentId
);
Service
Response
recycle
(
String
departmentId
);
/**
* 根据参数查询
...
...
@@ -88,7 +88,7 @@ public interface DepartmentApiService {
* 回收站恢复
* @param departmentId
*/
Haoban
Response
repairRecycle
(
String
departmentId
,
String
parentId
);
Service
Response
repairRecycle
(
String
departmentId
,
String
parentId
);
/**
* 获取根节点
* @param wxEnterpriseId
...
...
@@ -132,13 +132,13 @@ public interface DepartmentApiService {
* @param departmentId
* @return
*/
Haoban
Response
wxCallBackDel
(
String
departmentId
);
Service
Response
wxCallBackDel
(
String
departmentId
);
/**
* 微信回调放回收站
* @param departmentId
* @return
*/
Haoban
Response
wxCallBackrecycle
(
String
departmentId
);
Service
Response
wxCallBackrecycle
(
String
departmentId
);
/**
* 判断节点下面有没有子节点
* @param departmentId
...
...
@@ -149,6 +149,6 @@ public interface DepartmentApiService {
* gic回调删除部门
* @param departmentId
*/
Haoban
Response
gicDel
(
String
departmentId
);
Service
Response
gicDel
(
String
departmentId
);
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
9078ddd0
...
...
@@ -4,7 +4,7 @@ import java.util.List;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.
common.utils.Haoban
Response
;
import
com.gic.haoban.
base.api.common.Service
Response
;
import
com.gic.haoban.manage.api.dto.GicClerkDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
...
...
@@ -21,7 +21,7 @@ public interface StaffApiService {
public
StaffDTO
selectByNationcodeAndPhoneNumber
(
String
wxEnterpriseId
,
String
nationcode
,
String
phoneNumber
);
public
Haoban
Response
add
(
StaffDTO
staff
,
String
departmentIds
);
public
Service
Response
add
(
StaffDTO
staff
,
String
departmentIds
);
public
List
<
StaffDepartmentRelatedDTO
>
listStaffDepartmentByStaffId
(
String
staffId
);
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/WxEnterpriseApiService.java
View file @
9078ddd0
...
...
@@ -7,7 +7,6 @@ import com.gic.haoban.base.api.common.BasePageInfo;
import
com.gic.haoban.manage.api.dto.QywxCorpInfoSimpleDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.YwWxEnterpriseDTO
;
import
com.github.pagehelper.Page
;
public
interface
WxEnterpriseApiService
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
9078ddd0
...
...
@@ -8,6 +8,7 @@ import java.util.Map;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.gic.haoban.base.api.common.Constant
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
org.apache.commons.collections.CollectionUtils
;
...
...
@@ -27,7 +28,6 @@ import com.gic.enterprise.api.dto.StoreGroupDTO;
import
com.gic.enterprise.api.service.StoreGroupService
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.common.utils.StringUtil
;
import
com.gic.haoban.contacts.manage.api.dto.SyncJsonColumnDTO
;
...
...
@@ -86,9 +86,9 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public
Haoban
Response
add
(
DepartmentDTO
department
)
{
HaobanResponse
hr
=
new
Haoban
Response
();
hr
.
set
Error
Code
(
1
);
public
Service
Response
add
(
DepartmentDTO
department
)
{
ServiceResponse
hr
=
new
Service
Response
();
hr
.
setCode
(
1
);
//调微信的新增接口
String
wxDepartmentId
=
""
;
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseService
.
selectById
(
department
.
getWxEnterpriseId
());
...
...
@@ -112,7 +112,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
JSONResponse
jp
=
qywxDepartmentApiService
.
createDepartment
(
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
(),
dto
);
logger
.
info
(
"【部门新增】jp = {}"
,
JSON
.
toJSONString
(
jp
));
if
(
jp
.
getErrorCode
()
!=
0
)
{
hr
.
set
Error
Code
(
0
);
hr
.
setCode
(
0
);
hr
.
setMessage
(
"微信新增部门失败"
);
return
hr
;
}
...
...
@@ -153,14 +153,14 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public
Haoban
Response
edit
(
DepartmentDTO
department
)
{
HaobanResponse
hr
=
new
Haoban
Response
();
hr
.
set
Error
Code
(
1
);
public
Service
Response
edit
(
DepartmentDTO
department
)
{
ServiceResponse
hr
=
new
Service
Response
();
hr
.
setCode
(
1
);
hr
.
setResult
(
department
);
//调微信的修改接口
TabHaobanDepartment
tab
=
departmentService
.
selectById
(
department
.
getDepartmentId
());
if
(
tab
==
null
){
hr
.
set
Error
Code
(
0
);
hr
.
setCode
(
0
);
hr
.
setMessage
(
"部门不存在"
);
return
hr
;
}
...
...
@@ -179,7 +179,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
JSONResponse
jp
=
qywxDepartmentApiService
.
updateDepartment
(
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
(),
dto
);
logger
.
info
(
"【部门修改】jp={}"
,
JSON
.
toJSONString
(
jp
));
if
(
jp
.
getErrorCode
()
!=
0
)
{
hr
.
set
Error
Code
(
0
);
hr
.
setCode
(
0
);
hr
.
setMessage
(
"微信修改部门失败"
);
return
hr
;
}
...
...
@@ -191,14 +191,14 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public
Haoban
Response
del
(
String
departmentId
)
{
HaobanResponse
hr
=
new
Haoban
Response
();
hr
.
set
Error
Code
(
1
);
public
Service
Response
del
(
String
departmentId
)
{
ServiceResponse
hr
=
new
Service
Response
();
hr
.
setCode
(
1
);
List
<
TabHaobanDepartment
>
list
=
departmentService
.
listByParentId
(
departmentId
);
logger
.
info
(
"【部门删除】list.size={}"
,
list
.
size
());
if
(!
list
.
isEmpty
())
{
hr
.
set
Error
Code
(
0
);
hr
.
setCode
(
0
);
hr
.
setMessage
(
"存在子部门,删除部门失败"
);
return
hr
;
}
...
...
@@ -206,14 +206,14 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
List
<
TabHaobanStaffDepartmentRelated
>
staffList
=
staffDepartmentService
.
listByDepartmentId
(
departmentId
);
logger
.
info
(
"【部门删除】staffList.size={}"
,
staffList
.
size
());
if
(!
staffList
.
isEmpty
())
{
hr
.
set
Error
Code
(
0
);
hr
.
setCode
(
0
);
hr
.
setMessage
(
"存在成员,删除部门失败"
);
return
hr
;
}
//调微信的删除接口
TabHaobanDepartment
department
=
departmentService
.
selectById
(
departmentId
);
if
(
department
==
null
){
hr
.
set
Error
Code
(
0
);
hr
.
setCode
(
0
);
hr
.
setMessage
(
"不存在部门,删除部门失败"
);
return
hr
;
}
...
...
@@ -223,7 +223,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
if
(
application
!=
null
)
{
JSONResponse
jp
=
qywxDepartmentApiService
.
deleteDepartment
(
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
(),
Integer
.
parseInt
(
department
.
getWxDepartmentId
()));
if
(
jp
.
getErrorCode
()
!=
0
)
{
hr
.
set
Error
Code
(
0
);
hr
.
setCode
(
0
);
hr
.
setMessage
(
"微信删除部门失败"
);
return
hr
;
}
...
...
@@ -235,14 +235,14 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public
Haoban
Response
wxCallBackDel
(
String
departmentId
){
HaobanResponse
hr
=
new
Haoban
Response
();
hr
.
set
Error
Code
(
1
);
public
Service
Response
wxCallBackDel
(
String
departmentId
){
ServiceResponse
hr
=
new
Service
Response
();
hr
.
setCode
(
1
);
List
<
TabHaobanDepartment
>
list
=
departmentService
.
listByParentId
(
departmentId
);
logger
.
info
(
"【部门删除】list.size={}"
,
list
.
size
());
if
(!
list
.
isEmpty
())
{
hr
.
set
Error
Code
(
0
);
hr
.
setCode
(
0
);
hr
.
setMessage
(
"存在子部门,删除部门失败"
);
return
hr
;
}
...
...
@@ -250,7 +250,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
List
<
TabHaobanStaffDepartmentRelated
>
staffList
=
staffDepartmentService
.
listByDepartmentId
(
departmentId
);
logger
.
info
(
"【部门删除】staffList.size={}"
,
staffList
.
size
());
if
(!
staffList
.
isEmpty
())
{
hr
.
set
Error
Code
(
0
);
hr
.
setCode
(
0
);
hr
.
setMessage
(
"存在成员,删除部门失败"
);
return
hr
;
}
...
...
@@ -265,14 +265,14 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public
Haoban
Response
recycle
(
String
departmentId
)
{
HaobanResponse
hr
=
new
Haoban
Response
();
hr
.
set
Error
Code
(
1
);
public
Service
Response
recycle
(
String
departmentId
)
{
ServiceResponse
hr
=
new
Service
Response
();
hr
.
setCode
(
1
);
List
<
TabHaobanDepartment
>
list
=
departmentService
.
listByParentId
(
departmentId
);
logger
.
info
(
"【部门删除】list.size={}"
,
list
.
size
());
if
(!
list
.
isEmpty
())
{
hr
.
set
Error
Code
(
0
);
hr
.
setCode
(
0
);
hr
.
setMessage
(
"存在子部门,删除部门失败"
);
return
hr
;
}
...
...
@@ -280,7 +280,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
List
<
TabHaobanStaffDepartmentRelated
>
staffList
=
staffDepartmentService
.
listByDepartmentId
(
departmentId
);
logger
.
info
(
"【部门删除】staffList.size={}"
,
staffList
.
size
());
if
(!
staffList
.
isEmpty
())
{
hr
.
set
Error
Code
(
0
);
hr
.
setCode
(
0
);
hr
.
setMessage
(
"存在成员,删除部门失败"
);
return
hr
;
}
...
...
@@ -292,7 +292,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
if
(
application
!=
null
)
{
JSONResponse
jp
=
qywxDepartmentApiService
.
deleteDepartment
(
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
(),
Integer
.
parseInt
(
department
.
getWxDepartmentId
()));
if
(
jp
.
getErrorCode
()
!=
0
)
{
hr
.
set
Error
Code
(
0
);
hr
.
setCode
(
0
);
hr
.
setMessage
(
"微信删除部门失败"
);
return
hr
;
}
...
...
@@ -304,14 +304,14 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public
Haoban
Response
wxCallBackrecycle
(
String
departmentId
)
{
HaobanResponse
hr
=
new
Haoban
Response
();
hr
.
set
Error
Code
(
1
);
public
Service
Response
wxCallBackrecycle
(
String
departmentId
)
{
ServiceResponse
hr
=
new
Service
Response
();
hr
.
setCode
(
1
);
List
<
TabHaobanDepartment
>
list
=
departmentService
.
listByParentId
(
departmentId
);
logger
.
info
(
"【部门删除】list.size={}"
,
list
.
size
());
if
(!
list
.
isEmpty
())
{
hr
.
set
Error
Code
(
0
);
hr
.
setCode
(
0
);
hr
.
setMessage
(
"存在子部门,删除部门失败"
);
return
hr
;
}
...
...
@@ -319,7 +319,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
List
<
TabHaobanStaffDepartmentRelated
>
staffList
=
staffDepartmentService
.
listByDepartmentId
(
departmentId
);
logger
.
info
(
"【部门删除】staffList.size={}"
,
staffList
.
size
());
if
(!
staffList
.
isEmpty
())
{
hr
.
set
Error
Code
(
0
);
hr
.
setCode
(
0
);
hr
.
setMessage
(
"存在成员,删除部门失败"
);
return
hr
;
}
...
...
@@ -336,9 +336,9 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public
Haoban
Response
repairRecycle
(
String
departmentId
,
String
parentId
)
{
HaobanResponse
hr
=
new
Haoban
Response
();
hr
.
set
Error
Code
(
0
);
public
Service
Response
repairRecycle
(
String
departmentId
,
String
parentId
)
{
ServiceResponse
hr
=
new
Service
Response
();
hr
.
setCode
(
0
);
TabHaobanDepartment
tab
=
departmentService
.
selectById
(
departmentId
);
//调微信的新增接口
String
wxDepartmentId
=
""
;
...
...
@@ -357,7 +357,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
JSONResponse
jp
=
qywxDepartmentApiService
.
createDepartment
(
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
(),
dto
);
logger
.
info
(
"【部门新增】jp = {}"
,
JSON
.
toJSONString
(
jp
));
if
(
jp
.
getErrorCode
()
!=
0
)
{
hr
.
set
Error
Code
(
0
);
hr
.
setCode
(
0
);
hr
.
setMessage
(
"微信新增部门失败"
);
return
hr
;
}
...
...
@@ -491,6 +491,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
@Override
public
void
initwxDepartment
(
String
corpid
,
String
suiteid
,
String
wxEnterpriseId
)
{
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
=
this
.
qywxDepartmentApiService
.
listDepartment
(
corpid
,
suiteid
,
null
);
logger
.
info
(
"企业所有部门数据:{}"
,
JSON
.
toJSONString
(
list
));
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
this
.
addAllDepartment
(
list
,
0
,
wxEnterpriseId
,
corpid
,
suiteid
);
...
...
@@ -509,7 +510,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
if
(
parent
!=
null
){
level
=
parent
.
getLevel
()
+
1
;
chainId
=
parent
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
parent
.
getDepartmentId
();
chainName
=
parent
.
getChainName
()
+
Constant
.
NAME_SEPARATOR
+
parent
.
get
Chain
Name
();
chainName
=
parent
.
getChainName
()
+
Constant
.
NAME_SEPARATOR
+
parent
.
get
Department
Name
();
pId
=
parent
.
getDepartmentId
();
}
}
...
...
@@ -551,14 +552,14 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public
Haoban
Response
gicDel
(
String
departmentId
)
{
HaobanResponse
hr
=
new
Haoban
Response
();
hr
.
set
Error
Code
(
1
);
public
Service
Response
gicDel
(
String
departmentId
)
{
ServiceResponse
hr
=
new
Service
Response
();
hr
.
setCode
(
1
);
List
<
TabHaobanDepartment
>
list
=
departmentService
.
listByParentId
(
departmentId
);
logger
.
info
(
"【部门删除】list.size={}"
,
list
.
size
());
if
(!
list
.
isEmpty
())
{
hr
.
set
Error
Code
(
0
);
hr
.
setCode
(
0
);
hr
.
setMessage
(
"存在子部门,删除部门失败"
);
//return hr;
TabHaobanDepartment
department
=
departmentService
.
selectById
(
departmentId
);
...
...
@@ -571,7 +572,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
List
<
TabHaobanStaffDepartmentRelated
>
staffList
=
staffDepartmentService
.
listByDepartmentId
(
departmentId
);
logger
.
info
(
"【部门删除】staffList.size={}"
,
staffList
.
size
());
if
(!
staffList
.
isEmpty
())
{
hr
.
set
Error
Code
(
0
);
hr
.
setCode
(
0
);
hr
.
setMessage
(
"存在成员,删除部门失败"
);
//return hr;
TabHaobanDepartment
department
=
departmentService
.
selectById
(
departmentId
);
...
...
@@ -588,7 +589,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
if
(
application
!=
null
)
{
JSONResponse
jp
=
qywxDepartmentApiService
.
deleteDepartment
(
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
(),
Integer
.
parseInt
(
department
.
getWxDepartmentId
()));
if
(
jp
.
getErrorCode
()
!=
0
)
{
hr
.
set
Error
Code
(
0
);
hr
.
setCode
(
0
);
hr
.
setMessage
(
"微信删除部门失败"
);
return
hr
;
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MessageApiServiceImpl.java
View file @
9078ddd0
...
...
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.haoban.base.api.common.Constant
;
import
com.gic.haoban.
common.utils.Haoban
Response
;
import
com.gic.haoban.
base.api.common.Service
Response
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.GicMessageDTO
;
import
com.gic.haoban.manage.api.dto.QywxCallBackDTO
;
...
...
@@ -105,12 +105,12 @@ public class MessageApiServiceImpl implements MessageApiService {
}
departmentDTO
.
setWxEnterpriseId
(
enterprise
.
getWxEnterpriseId
());
if
(
dto
.
getChangeType
()
==
GicEditType
.
ADD
.
getCode
()){
Haoban
Response
response
=
this
.
departmentApiService
.
add
(
departmentDTO
);
Service
Response
response
=
this
.
departmentApiService
.
add
(
departmentDTO
);
log
.
info
(
"添加结果:{}"
,
JSON
.
toJSONString
(
response
));
}
else
if
(
dto
.
getChangeType
()
==
GicEditType
.
UPDATE
.
getCode
()){
TabHaobanDepartment
department
=
this
.
departmentService
.
selectByRelatedId
(
dto
.
getId
());
if
(
department
==
null
){
Haoban
Response
response
=
this
.
departmentApiService
.
add
(
departmentDTO
);
Service
Response
response
=
this
.
departmentApiService
.
add
(
departmentDTO
);
log
.
info
(
"添加结果:{}"
,
JSON
.
toJSONString
(
response
));
}
else
{
departmentDTO
.
setDepartmentId
(
department
.
getDepartmentId
());
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
9078ddd0
...
...
@@ -33,7 +33,7 @@ import com.gic.enterprise.api.dto.StoreGroupDTO;
import
com.gic.enterprise.api.service.StoreGroupService
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.
common.utils.Haoban
Response
;
import
com.gic.haoban.
base.api.common.Service
Response
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.common.utils.StringUtil
;
import
com.gic.haoban.common.utils.UuidUtil
;
...
...
@@ -99,9 +99,9 @@ public class StaffApiServiceImpl implements StaffApiService {
}
@Override
public
Haoban
Response
add
(
StaffDTO
staff
,
String
departmentIds
)
{
HaobanResponse
hr
=
new
Haoban
Response
();
hr
.
set
Error
Code
(
1
);
public
Service
Response
add
(
StaffDTO
staff
,
String
departmentIds
)
{
ServiceResponse
hr
=
new
Service
Response
();
hr
.
setCode
(
1
);
Integer
activeFlag
=
staff
.
getActiveFlag
();
staff
.
setActiveFlag
(
0
);
Integer
syncPostionFlag
=
staff
.
getSyncPostionFlag
();
...
...
@@ -142,8 +142,8 @@ public class StaffApiServiceImpl implements StaffApiService {
JSONResponse
jp
=
qywxUserApiService
.
createWorkWxUser
(
userDTO
,
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
());
logger
.
info
(
"【店员新增】jp = {}"
,
JSON
.
toJSONString
(
jp
));
if
(
jp
.
getErrorCode
()
!=
0
)
{
hr
.
set
Error
Code
(
0
);
hr
.
set
DetailError
(
"微信新增失败"
);
hr
.
setCode
(
0
);
hr
.
set
Message
(
"微信新增失败"
);
return
hr
;
}
staffService
.
add
(
tab
);
...
...
@@ -164,7 +164,7 @@ public class StaffApiServiceImpl implements StaffApiService {
staffDepartmentRelatedService
.
add
(
related
);
}
}
else
{
hr
.
set
Error
Code
(
0
);
hr
.
setCode
(
0
);
hr
.
setMessage
(
"微信端新增失败"
);
}
hr
.
setResult
(
staffId
);
...
...
@@ -636,8 +636,8 @@ public class StaffApiServiceImpl implements StaffApiService {
isCodeExist
.
setClerkCode
(
null
);
staffDepartmentRelatedMapper
.
updateByPrimaryKey
(
EntityUtil
.
changeEntityByJSON
(
TabHaobanStaffDepartmentRelated
.
class
,
isCodeExist
));
}
Haoban
Response
hr
=
this
.
add
(
staff
,
department
.
getDepartmentId
());
if
(
hr
.
get
Error
Code
()
==
1
){
Service
Response
hr
=
this
.
add
(
staff
,
department
.
getDepartmentId
());
if
(
hr
.
getCode
()
==
1
){
StaffDepartmentRelatedDTO
staffRelated
=
this
.
getDepartmentIdAndStaffId
(
departmentId
,
hr
.
getResult
().
toString
());
logger
.
info
(
"【gic导购新增】staffRelated={}"
,
JSON
.
toJSONString
(
staffRelated
));
//绑定
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/DepartmentContoller.java
View file @
9078ddd0
...
...
@@ -34,6 +34,7 @@ import com.gic.enterprise.api.service.StoreService;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.Constant
;
import
com.gic.haoban.base.api.common.PageResult
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.web.anno.IgnoreLogin
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
...
...
@@ -185,8 +186,8 @@ public class DepartmentContoller extends WebBaseController{
department
.
setChainId
(
dto
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
dto
.
getDepartmentId
());
department
.
setIsStore
(
0
);
department
.
setLevel
(
dto
.
getLevel
()
+
1
);
Haoban
Response
hr
=
departmentApiService
.
add
(
department
);
if
(
hr
.
get
Error
Code
()
!=
1
){
Service
Response
hr
=
departmentApiService
.
add
(
department
);
if
(
hr
.
getCode
()
!=
1
){
return
resultResponse
(
HaoBanErrCode
.
ERR_DEFINE
,
hr
.
getMessage
(),
null
,
hr
.
getMessage
());
}
...
...
@@ -236,14 +237,14 @@ public class DepartmentContoller extends WebBaseController{
if
(
dto
==
null
||
dto
.
getStatusFlag
()
==
0
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10003
);
}
Haoban
Response
hr
;
Service
Response
hr
;
if
(
StringUtils
.
isBlank
(
dto
.
getRelatedId
()))
{
hr
=
departmentApiService
.
del
(
departmentId
);
}
else
{
hr
=
departmentApiService
.
recycle
(
departmentId
);
}
if
(
hr
.
get
Error
Code
()
==
0
)
{
if
(
hr
.
getCode
()
==
0
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_0
,
hr
.
getMessage
(),
null
,
hr
.
getMessage
());
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
...
...
@@ -432,8 +433,8 @@ public class DepartmentContoller extends WebBaseController{
department
.
setRelatedId
(
departmentAddQO
.
getRelatedId
());
department
.
setRelatedCode
(
storeCode
);
department
.
setSort
(
maxSort
-
sort
);
Haoban
Response
hr
=
departmentApiService
.
add
(
department
);
if
(
hr
.
get
Error
Code
()
!=
1
)
{
Service
Response
hr
=
departmentApiService
.
add
(
department
);
if
(
hr
.
getCode
()
!=
1
)
{
continue
;
}
DepartmentDTO
departmentAdd
=
(
DepartmentDTO
)
hr
.
getResult
();
...
...
@@ -473,7 +474,7 @@ public class DepartmentContoller extends WebBaseController{
logger
.
info
(
"【部门修改】department={}"
,
JSON
.
toJSONString
(
department
));
handerSonDepartment
(
departmentQO
.
getCurrDepartment
());
Haoban
Response
hr
=
departmentApiService
.
edit
(
department
);
Service
Response
hr
=
departmentApiService
.
edit
(
department
);
String
sonDepartment
=
departmentQO
.
getChildren
();
handler
(
sonDepartment
,
department
.
getDepartmentId
());
...
...
@@ -636,8 +637,8 @@ public class DepartmentContoller extends WebBaseController{
}
department
.
setRelatedId
(
departmentAddQO
.
getRelatedId
());
department
.
setRelatedCode
(
storeCode
);
Haoban
Response
hr
=
departmentApiService
.
add
(
department
);
if
(
hr
.
get
Error
Code
()
!=
1
)
{
Service
Response
hr
=
departmentApiService
.
add
(
department
);
if
(
hr
.
getCode
()
!=
1
)
{
continue
;
}
DepartmentDTO
departmentAdd
=
(
DepartmentDTO
)
hr
.
getResult
();
...
...
@@ -657,8 +658,8 @@ public class DepartmentContoller extends WebBaseController{
department
.
setChainId
(
dto
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
dto
.
getDepartmentId
());
department
.
setChainName
(
dto
.
getChainName
()
+
Constant
.
NAME_SEPARATOR
+
dto
.
getDepartmentName
());
department
.
setSort
(
departmentAddQO
.
getSort
());
Haoban
Response
hr
=
departmentApiService
.
edit
(
department
);
if
(
hr
.
get
Error
Code
()
!=
1
)
{
Service
Response
hr
=
departmentApiService
.
edit
(
department
);
if
(
hr
.
getCode
()
!=
1
)
{
continue
;
}
DepartmentDTO
departmentEdit
=
(
DepartmentDTO
)
hr
.
getResult
();
...
...
@@ -711,8 +712,8 @@ public class DepartmentContoller extends WebBaseController{
}
staff
.
setSyncPostionFlag
(
1
);
Haoban
Response
hr
=
staffApiService
.
add
(
staff
,
departmentId
);
if
(
hr
.
get
Error
Code
()
==
1
){
Service
Response
hr
=
staffApiService
.
add
(
staff
,
departmentId
);
if
(
hr
.
getCode
()
==
1
){
StaffDepartmentRelatedDTO
staffRelated
=
staffApiService
.
getDepartmentIdAndStaffId
(
departmentId
,
hr
.
getResult
().
toString
());
StaffDepartmentRelatedDTO
isCodeExist
=
staffApiService
.
getDepartmentIdAndCode
(
departmentId
,
clerkCode
);
if
(
staffRelated
!=
null
&&
isCodeExist
==
null
){
...
...
@@ -766,7 +767,7 @@ public class DepartmentContoller extends WebBaseController{
public
HaobanResponse
departmentBatchDel
(
String
departmentIds
)
{
String
[]
departmentIdArr
=
departmentIds
.
split
(
","
);
for
(
String
departmentId
:
departmentIdArr
)
{
Haoban
Response
hr
;
Service
Response
hr
;
hr
=
departmentApiService
.
del
(
departmentId
);
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
9078ddd0
...
...
@@ -14,6 +14,7 @@ import com.alibaba.fastjson.JSON;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.PageResult
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
...
...
@@ -64,9 +65,9 @@ public class StaffController extends WebBaseController{
if
(
staff
!=
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10005
);
}
Haoban
Response
hr
=
staffApiService
.
add
(
staffDTO
,
departmentIds
);
if
(
hr
.
get
Error
Code
()
==
0
){
return
resultResponse
(
HaoBanErrCode
.
ERR_DEFINE
,
hr
.
get
DetailError
(),
null
,
hr
.
getDetailError
());
Service
Response
hr
=
staffApiService
.
add
(
staffDTO
,
departmentIds
);
if
(
hr
.
getCode
()
==
0
){
return
resultResponse
(
HaoBanErrCode
.
ERR_DEFINE
,
hr
.
get
Message
(),
null
,
hr
.
getMessage
());
}
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