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
c63a0615
Commit
c63a0615
authored
Feb 23, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://115.159.76.241/haoban3.0/haoban-manage3.0
into developer
parents
68ab5e8e
e5211af3
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
119 additions
and
19 deletions
+119
-19
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+2
-0
StaffDepartmentRelatedMapper.java
...nage/service/dao/mapper/StaffDepartmentRelatedMapper.java
+3
-0
StaffDepartmentRelatedService.java
...manage/service/service/StaffDepartmentRelatedService.java
+2
-0
StaffService.java
...a/com/gic/haoban/manage/service/service/StaffService.java
+2
-0
StaffDepartmentRelatedServiceImpl.java
...rvice/service/impl/StaffDepartmentRelatedServiceImpl.java
+5
-0
WxEnterpriseServiceImpl.java
.../manage/service/service/impl/WxEnterpriseServiceImpl.java
+1
-2
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+10
-3
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+59
-9
StaffDepartmentRelatedMapper.xml
...rc/main/resources/mapper/StaffDepartmentRelatedMapper.xml
+11
-0
DepartmentContoller.java
...gic/haoban/manage/web/controller/DepartmentContoller.java
+7
-0
LoginController.java
...com/gic/haoban/manage/web/controller/LoginController.java
+3
-2
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+14
-3
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
c63a0615
...
...
@@ -33,4 +33,6 @@ public interface StaffApiService {
public
StaffDTO
selectByUserId
(
String
userId
);
public
StaffDepartmentRelatedDTO
getDepartmentIdAndStaffId
(
String
departmentId
,
String
staffId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffDepartmentRelatedMapper.java
View file @
c63a0615
...
...
@@ -34,4 +34,6 @@ public interface StaffDepartmentRelatedMapper {
int
delByUserid
(
@Param
(
"userid"
)
String
userId
);
TabHaobanStaffDepartmentRelated
getDepartmentIdAndStaffId
(
@Param
(
"departmentId"
)
String
departmentId
,
@Param
(
"staffId"
)
String
staffId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffDepartmentRelatedService.java
View file @
c63a0615
...
...
@@ -19,4 +19,6 @@ public interface StaffDepartmentRelatedService {
void
del
(
StaffDepartmentRelatedDTO
related
);
void
delByUserid
(
String
userid
);
TabHaobanStaffDepartmentRelated
getDepartmentIdAndStaffId
(
String
departmentId
,
String
staffId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffService.java
View file @
c63a0615
...
...
@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service;
import
java.util.Set
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated
;
import
com.github.pagehelper.Page
;
public
interface
StaffService
{
...
...
@@ -20,4 +21,5 @@ public interface StaffService {
void
updateByPrimaryKey
(
TabHaobanStaff
tab
);
int
delByuserid
(
String
staffId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffDepartmentRelatedServiceImpl.java
View file @
c63a0615
...
...
@@ -64,5 +64,10 @@ public class StaffDepartmentRelatedServiceImpl implements StaffDepartmentRelated
}
@Override
public
TabHaobanStaffDepartmentRelated
getDepartmentIdAndStaffId
(
String
departmentId
,
String
staffId
)
{
return
mapper
.
getDepartmentIdAndStaffId
(
departmentId
,
staffId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WxEnterpriseServiceImpl.java
View file @
c63a0615
...
...
@@ -34,8 +34,7 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
@Override
public
WxEnterpriseDTO
selectById
(
String
wxEnterpriseId
)
{
//TabHaobanWxEnterprise wx
return
null
;
return
EntityUtil
.
changeEntityByJSON
(
WxEnterpriseDTO
.
class
,
mapper
.
selectByPrimaryKey
(
wxEnterpriseId
));
}
@Override
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
c63a0615
...
...
@@ -11,6 +11,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.gic.api.base.commons.JSONResponse
;
import
com.gic.api.base.commons.Page
;
...
...
@@ -82,6 +83,8 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
String
wxDepartmentId
=
""
;
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
();
...
...
@@ -90,14 +93,18 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
dto
.
setOrder
(
department
.
getSort
());
TabHaobanDepartment
parent
=
departmentService
.
selectById
(
department
.
getParentDepartmentId
());
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
);
if
(
jp
.
getErrorCode
()
!=
1
)
{
logger
.
info
(
"【部门新增】jp = {}"
,
JSON
.
toJSONString
(
jp
));
if
(
jp
.
getErrorCode
()
!=
0
)
{
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信新增部门失败"
);
return
hr
;
}
wxDepartmentId
=
jp
.
getResult
().
toString
();
logger
.
info
(
"【部门新增】wxDepartmentId = {}"
,
wxDepartmentId
);
department
.
setWxDepartmentId
(
wxDepartmentId
);
department
.
setLevel
(
parent
.
getLevel
()
+
1
);
String
departmentId
=
departmentService
.
add
(
department
);
department
.
setDepartmentId
(
departmentId
);
hr
.
setResult
(
department
);
...
...
@@ -124,7 +131,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
TabHaobanDepartment
parent
=
departmentService
.
selectById
(
department
.
getParentDepartmentId
());
dto
.
setParentid
(
Integer
.
valueOf
(
parent
.
getWxDepartmentId
()));
JSONResponse
jp
=
qywxDepartmentApiService
.
updateDepartment
(
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
(),
dto
);
if
(
jp
.
getErrorCode
()
!=
1
)
{
if
(
jp
.
getErrorCode
()
!=
0
)
{
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信修改部门失败"
);
return
hr
;
...
...
@@ -161,7 +168,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
if
(
enterpriseDTO
!=
null
)
{
if
(
application
!=
null
)
{
JSONResponse
jp
=
qywxDepartmentApiService
.
deleteDepartment
(
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
(),
Integer
.
parseInt
(
department
.
getWxDepartmentId
()));
if
(
jp
.
getErrorCode
()
!=
1
)
{
if
(
jp
.
getErrorCode
()
!=
0
)
{
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信删除部门失败"
);
return
hr
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
c63a0615
...
...
@@ -8,11 +8,14 @@ import java.util.Map;
import
java.util.Set
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.JSONResponse
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.EntityUtil
;
...
...
@@ -20,7 +23,6 @@ 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.UuidUtil
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
...
...
@@ -43,6 +45,7 @@ import com.github.pagehelper.PageHelper;
@Service
public
class
StaffApiServiceImpl
implements
StaffApiService
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
StaffApiServiceImpl
.
class
);
@Autowired
StaffService
staffService
;
@Autowired
...
...
@@ -88,13 +91,15 @@ public class StaffApiServiceImpl implements StaffApiService {
if
(
application
!=
null
)
{
UserDTO
userDTO
=
new
UserDTO
();
userDTO
.
setCorpid
(
enterpriseDTO
.
getCorpid
());
List
<
Integer
>
wxDepartmentIdArrIntegers
=
new
ArrayList
<
Integer
>();
String
[]
departmentIdArr
=
departmentIds
.
split
(
","
);
Integer
[]
wxDepartmentIdArrIntegers
=
new
Integer
[
departmentIdArr
.
length
];
int
index
=
0
;
for
(
String
string
:
departmentIdArr
)
{
TabHaobanDepartment
tabs
=
departmentService
.
selectById
(
string
);
wxDepartmentIdArrIntegers
.
add
(
Integer
.
parseInt
(
tabs
.
getWxDepartmentId
()));
wxDepartmentIdArrIntegers
[
0
]
=
Integer
.
parseInt
(
tabs
.
getWxDepartmentId
());
index
++;
}
userDTO
.
setDepartment
(
(
Integer
[])
wxDepartmentIdArrIntegers
.
toArray
()
);
userDTO
.
setDepartment
(
wxDepartmentIdArrIntegers
);
userDTO
.
setGender
(
"女"
);
userDTO
.
setMobile
(
staff
.
getPhoneNumber
());
userDTO
.
setName
(
staff
.
getStaffName
());
...
...
@@ -102,13 +107,15 @@ public class StaffApiServiceImpl implements StaffApiService {
if
(
activeFlag
==
1
)
{
userDTO
.
setTo_invite
(
true
);
}
logger
.
info
(
"【店员新增】userDTO = {}"
,
JSON
.
toJSONString
(
userDTO
));
JSONResponse
jp
=
qywxUserApiService
.
createWorkWxUser
(
userDTO
,
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
());
if
(
jp
.
getErrorCode
()
!=
1
)
{
logger
.
info
(
"【店员新增】jp = {}"
,
JSON
.
toJSONString
(
jp
));
if
(
jp
.
getErrorCode
()
!=
0
)
{
hr
.
setErrorCode
(
0
);
hr
.
setDetailError
(
"微信新增失败"
);
return
hr
;
}
wxUserId
=
jp
.
getResult
().
toString
()
;
wxUserId
=
staffId
;
}
}
...
...
@@ -174,12 +181,27 @@ public class StaffApiServiceImpl implements StaffApiService {
if
(
related
!=
null
)
{
List
<
TabHaobanStaffDepartmentRelated
>
relatedList
=
staffDepartmentRelatedService
.
listStaffDepartmentByStaffId
(
related
.
getStaffId
());
//只在当前门店
if
(
relatedList
.
size
()
<=
1
)
{
//微信接口删除
if
(
relatedList
.
size
()
==
1
)
{
TabHaobanStaff
staff
=
staffService
.
selectById
(
relatedList
.
get
(
0
).
getStaffId
());
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseService
.
selectById
(
staff
.
getWxEnterpriseId
());
TabHaobanWxApplication
application
=
wxApplicationService
.
selectByWxEnterpriseIdAndApplicationType
(
staff
.
getWxEnterpriseId
(),
1
);
if
(
enterpriseDTO
!=
null
)
{
if
(
application
!=
null
)
{
JSONResponse
jp
=
qywxUserApiService
.
deleteWorkWxUser
(
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
(),
staff
.
getWxUserId
());
}
}
staffDepartmentRelatedService
.
del
(
related
);
//走修改流程
}
else
{
String
departmentIds
=
""
;
for
(
TabHaobanStaffDepartmentRelated
tabHaobanStaffDepartmentRelated
:
relatedList
)
{
if
(!
staffDepartmentStaffRelatedId
.
equals
(
tabHaobanStaffDepartmentRelated
.
getStaffDepartmentRelatedId
()))
{
departmentIds
+=
tabHaobanStaffDepartmentRelated
.
getDepartmentId
()
+
","
;
}
}
departmentIds
=
departmentIds
.
substring
(
0
,
departmentIds
.
length
()
-
1
);
TabHaobanStaff
staff
=
staffService
.
selectById
(
relatedList
.
get
(
0
).
getStaffId
());
staffEdit
(
EntityUtil
.
changeEntityByJSON
(
StaffDTO
.
class
,
staff
),
departmentIds
);
}
}
...
...
@@ -263,6 +285,28 @@ public class StaffApiServiceImpl implements StaffApiService {
}
}
}
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseService
.
selectById
(
oldStaff
.
getWxEnterpriseId
());
TabHaobanWxApplication
application
=
wxApplicationService
.
selectByWxEnterpriseIdAndApplicationType
(
oldStaff
.
getWxEnterpriseId
(),
1
);
if
(
enterpriseDTO
!=
null
)
{
if
(
application
!=
null
)
{
UserDTO
userDTO
=
new
UserDTO
();
userDTO
.
setCorpid
(
enterpriseDTO
.
getCorpid
());
List
<
Integer
>
wxDepartmentIdArrIntegers
=
new
ArrayList
<
Integer
>();
String
[]
departmentIdArr
=
departmentIds
.
split
(
","
);
for
(
String
string
:
departmentIdArr
)
{
TabHaobanDepartment
tabs
=
departmentService
.
selectById
(
string
);
wxDepartmentIdArrIntegers
.
add
(
Integer
.
parseInt
(
tabs
.
getWxDepartmentId
()));
}
userDTO
.
setDepartment
((
Integer
[])
wxDepartmentIdArrIntegers
.
toArray
());
userDTO
.
setGender
(
"女"
);
userDTO
.
setMobile
(
staffDTO
.
getPhoneNumber
());
userDTO
.
setName
(
staffDTO
.
getStaffName
());
userDTO
.
setUserid
(
oldStaff
.
getWxUserId
());
JSONResponse
jp
=
qywxUserApiService
.
updateWorkWxUser
(
userDTO
,
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
());
}
}
}
@Override
...
...
@@ -276,4 +320,10 @@ public class StaffApiServiceImpl implements StaffApiService {
return
EntityUtil
.
changeEntityByJSON
(
StaffDTO
.
class
,
staffService
.
selectByUserId
(
userId
));
}
@Override
public
StaffDepartmentRelatedDTO
getDepartmentIdAndStaffId
(
String
departmentId
,
String
staffId
)
{
TabHaobanStaffDepartmentRelated
tab
=
staffDepartmentRelatedService
.
getDepartmentIdAndStaffId
(
departmentId
,
staffId
);
return
EntityUtil
.
changeEntityByJSON
(
StaffDepartmentRelatedDTO
.
class
,
tab
);
}
}
haoban-manage3-service/src/main/resources/mapper/StaffDepartmentRelatedMapper.xml
View file @
c63a0615
...
...
@@ -198,4 +198,14 @@
status_flag = 0
where wx_user_id = #{userid,jdbcType=VARCHAR}
</update>
<select
id=
"getDepartmentIdAndStaffId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_staff_department_related
where staff_id = #{staffId,jdbcType=VARCHAR}
and department_id = #{departmentId}
and status_flag = 1
</select>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/DepartmentContoller.java
View file @
c63a0615
...
...
@@ -6,6 +6,8 @@ import java.util.Map;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -34,6 +36,8 @@ import com.gic.haoban.manage.web.vo.StoreVo;
@RestController
public
class
DepartmentContoller
extends
WebBaseController
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
DepartmentContoller
.
class
);
@Autowired
private
DepartmentApiService
departmentApiService
;
...
...
@@ -45,6 +49,7 @@ public class DepartmentContoller extends WebBaseController{
public
HaobanResponse
departmentList
(
String
parentId
,
BasePageInfo
pageInfo
,
String
keyword
)
{
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getSessionUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
logger
.
info
(
"【部门列表】wxEnterpriseId={}"
,
wxEnterpriseId
);
Page
<
DepartmentDTO
>
page
=
new
Page
<
DepartmentDTO
>();
List
<
DepartmentDTO
>
list
=
new
ArrayList
<
DepartmentDTO
>();
...
...
@@ -71,6 +76,7 @@ public class DepartmentContoller extends WebBaseController{
public
HaobanResponse
departmentLevelList
(
String
parentId
)
{
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getSessionUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
logger
.
info
(
"【部门层级列表】wxEnterpriseId={}"
,
wxEnterpriseId
);
List
<
DepartmentDTO
>
list
=
new
ArrayList
<
DepartmentDTO
>();
if
(
StringUtils
.
isNotBlank
(
parentId
))
{
list
=
departmentApiService
.
listByParentId
(
parentId
);
...
...
@@ -98,6 +104,7 @@ public class DepartmentContoller extends WebBaseController{
department
.
setWxEnterpriseId
(
dto
.
getWxEnterpriseId
());
department
.
setChainId
(
dto
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
dto
.
getDepartmentId
());
department
.
setIsStore
(
0
);
department
.
setLevel
(
dto
.
getLevel
()
+
1
);
departmentApiService
.
add
(
department
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/LoginController.java
View file @
c63a0615
...
...
@@ -39,7 +39,7 @@ public class LoginController extends WebBaseController{
LoginVO
loginVO
=
new
LoginVO
();
StaffDTO
staff
=
staffApiService
.
selectById
(
"1"
);
logger
.
info
(
"【好办登录】staff={}"
,
JSON
.
toJSONString
(
staff
));
loginVO
.
setWxEnterpriseId
(
"1"
);
loginVO
.
setWxEnterpriseId
(
staff
.
getWxEnterpriseId
()
);
loginVO
.
setStaffDTO
(
staff
);
AuthRequestUtil
.
setSessionUser
(
loginVO
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
loginVO
);
...
...
@@ -48,7 +48,8 @@ public class LoginController extends WebBaseController{
@RequestMapping
(
"get-login-qrcode"
)
public
HaobanResponse
getLoginQrcode
(){
String
url
=
qywxCorpApiService
.
getGrantAuthorizationUrl
(
siteId
,
redirectUri
);
String
url
=
"https://open.work.weixin.qq.com/wwopen/sso/3rd_qrConnect?appid=wweac4ef962720aa12&"
+
redirectUri
+
"&state=web_login@gyoss9&usertype=admin"
;
//String url = qywxCorpApiService.getGrantAuthorizationUrl(siteId, redirectUri);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
url
);
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
c63a0615
...
...
@@ -20,6 +20,7 @@ import com.gic.haoban.manage.api.dto.StaffDTO;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.vo.LoginVO
;
...
...
@@ -36,11 +37,12 @@ public class StaffController extends WebBaseController{
@RequestMapping
(
"staff-add"
)
public
HaobanResponse
staffAdd
(
StaffDTO
staffDTO
,
String
departmentIds
){
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
get
AppLogi
nUser
();
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
get
Sessio
nUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
staffName
=
staffDTO
.
getStaffName
();
String
phoneNumber
=
staffDTO
.
getPhoneNumber
();
String
nationcode
=
staffDTO
.
getNationCode
();
staffDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
if
(
StringUtils
.
isBlank
(
staffName
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10004
);
}
...
...
@@ -48,7 +50,7 @@ public class StaffController extends WebBaseController{
if
(
staff
!=
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10005
);
}
HaobanResponse
hr
=
staffApiService
.
add
(
staff
,
departmentIds
);
HaobanResponse
hr
=
staffApiService
.
add
(
staff
DTO
,
departmentIds
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
...
...
@@ -70,9 +72,18 @@ public class StaffController extends WebBaseController{
@RequestMapping
(
"staff-list"
)
public
HaobanResponse
staffList
(
String
departmentId
,
Integer
activeFlag
,
String
keyword
,
BasePageInfo
pageInfo
){
Page
<
StaffDTO
>
page
=
staffApiService
.
pageStaff
(
departmentId
,
activeFlag
,
keyword
,
pageInfo
);
List
<
StaffDTO
>
list
=
page
.
getResult
();
for
(
StaffDTO
staffDTO
:
list
)
{
logger
.
info
(
"【成员列表】departmentId={},staffId={}"
,
departmentId
,
staffDTO
.
getStaffId
());
StaffDepartmentRelatedDTO
related
=
staffApiService
.
getDepartmentIdAndStaffId
(
departmentId
,
staffDTO
.
getStaffId
());
logger
.
info
(
"【成员列表】related={}"
,
JSON
.
toJSONString
(
related
));
if
(
related
!=
null
)
{
staffDTO
.
setStaffDepartmentRelatedId
(
related
.
getStaffDepartmentRelatedId
());
}
}
logger
.
info
(
"【员工列表】page={}"
,
JSON
.
toJSONString
(
page
));
PageResult
<
StaffDTO
>
pageVo
=
new
PageResult
<>();
pageVo
.
setList
(
page
.
getResult
()
);
pageVo
.
setList
(
list
);
pageVo
.
setPageNum
(
page
.
getCurrentPage
());
pageVo
.
setPages
(
page
.
getPages
());
pageVo
.
setPageSize
(
page
.
getPageSize
());
...
...
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