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
41fca5e1
Commit
41fca5e1
authored
Mar 06, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://115.159.76.241/haoban3.0/haoban-manage3.0.git
into developer
parents
8b9a7887
4b19e745
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
23 deletions
+80
-23
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+1
-0
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+8
-11
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+11
-12
StoreController.java
...com/gic/haoban/manage/web/controller/StoreController.java
+60
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
41fca5e1
...
...
@@ -43,4 +43,5 @@ public interface StaffApiService {
StaffDepartmentRelatedDTO
getDepartmentIdAndCode
(
String
departmentId
,
String
code
);
void
initWxUser
(
String
corpid
,
String
suiteid
,
String
wxEnterpriseId
,
Integer
wxDepartmentId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
41fca5e1
...
...
@@ -9,6 +9,7 @@ import cn.hutool.core.collection.CollectionUtil;
import
com.gic.haoban.base.api.common.Constant
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
...
...
@@ -49,32 +50,26 @@ import com.github.pagehelper.PageHelper;
public
class
DepartmentApiServiceImpl
implements
DepartmentApiService
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
DepartmentApiServiceImpl
.
class
);
@Autowired
private
DepartmentService
departmentService
;
@Autowired
private
StaffDepartmentRelatedService
staffDepartmentService
;
@Autowired
private
DepartmentMapper
departmentMapper
;
@Autowired
private
com
.
gic
.
enterprise
.
api
.
service
.
DepartmentService
gicDepartmentService
;
@Autowired
private
QywxDepartmentApiService
qywxDepartmentApiService
;
@Autowired
private
WxEnterpriseService
wxEnterpriseService
;
@Autowired
private
WxApplicationService
wxApplicationService
;
@Autowired
private
StoreService
storeService
;
@Autowired
private
StoreGroupService
storeGroupService
;
@Autowired
private
StaffApiService
staffApiService
;
@Override
...
...
@@ -480,12 +475,13 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
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
);
this
.
addAllDepartment
(
list
,
0
,
wxEnterpriseId
,
corpid
,
suiteid
);
}
}
private
void
addAllDepartment
(
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
,
Integer
parentId
,
String
wxEnterpriseId
){
private
void
addAllDepartment
(
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
,
Integer
parentId
,
String
wxEnterpriseId
,
String
corpid
,
String
suiteid
){
int
level
=
1
;
String
chainId
=
"0"
;
String
chainName
=
"0"
;
...
...
@@ -515,7 +511,8 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
dto
.
setIsStore
(
0
);
this
.
departmentService
.
add
(
dto
);
}
this
.
addAllDepartment
(
list
,
departmentDTO
.
getId
(),
wxEnterpriseId
);
this
.
addAllDepartment
(
list
,
departmentDTO
.
getId
(),
wxEnterpriseId
,
corpid
,
suiteid
);
this
.
staffApiService
.
initWxUser
(
corpid
,
suiteid
,
wxEnterpriseId
,
departmentDTO
.
getId
());
}
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
41fca5e1
...
...
@@ -7,6 +7,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Set
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -146,9 +147,6 @@ public class StaffApiServiceImpl implements StaffApiService {
wxUserId
=
staffId
;
}
}
if
(
StringUtils
.
isNotBlank
(
wxUserId
)){
String
[]
departmentIdArr
=
departmentIds
.
split
(
","
);
for
(
String
string
:
departmentIdArr
)
{
...
...
@@ -165,9 +163,7 @@ public class StaffApiServiceImpl implements StaffApiService {
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信端新增失败"
);
}
hr
.
setResult
(
staffId
);
return
hr
;
}
...
...
@@ -179,7 +175,6 @@ public class StaffApiServiceImpl implements StaffApiService {
@Override
public
Page
<
StaffDTO
>
pageStaff
(
String
departmentId
,
Integer
activeFlag
,
String
keyword
,
BasePageInfo
pageInfo
)
{
List
<
TabHaobanStaffDepartmentRelated
>
list
=
staffDepartmentRelatedService
.
listByDepartmentId
(
departmentId
);
Set
<
String
>
staffIds
=
new
HashSet
<
String
>();
for
(
TabHaobanStaffDepartmentRelated
tabHaobanStaffDepartmentRelated
:
list
)
{
...
...
@@ -204,7 +199,6 @@ public class StaffApiServiceImpl implements StaffApiService {
}
else
{
return
new
ArrayList
<
StaffDTO
>();
}
}
@Override
...
...
@@ -238,7 +232,6 @@ public class StaffApiServiceImpl implements StaffApiService {
staffEdit
(
EntityUtil
.
changeEntityByJSON
(
StaffDTO
.
class
,
staff
),
departmentIds
);
}
}
}
@Override
...
...
@@ -295,10 +288,7 @@ public class StaffApiServiceImpl implements StaffApiService {
}
}
}
}
}
@Override
...
...
@@ -607,7 +597,6 @@ public class StaffApiServiceImpl implements StaffApiService {
}
this
.
staffEdit
(
staff
,
departmentIds
);
}
}
}
...
...
@@ -616,4 +605,14 @@ public class StaffApiServiceImpl implements StaffApiService {
return
EntityUtil
.
changeEntityByJSON
(
StaffDepartmentRelatedDTO
.
class
,
staffDepartmentRelatedMapper
.
getDepartmentIdAndCode
(
departmentId
,
code
));
}
@Override
public
void
initWxUser
(
String
corpid
,
String
suiteid
,
String
wxEnterpriseId
,
Integer
wxDepartmentId
)
{
List
<
UserDTO
>
list
=
this
.
qywxUserApiService
.
listDepartmentUser
(
corpid
,
suiteid
,
wxDepartmentId
.
toString
(),
0
);
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
for
(
UserDTO
dto
:
list
){
this
.
wxGetAdd
(
dto
.
getUserid
(),
wxEnterpriseId
);
}
}
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StoreController.java
0 → 100644
View file @
41fca5e1
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.gic.api.base.commons.Page
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.dto.StoreSearchDTO
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.PageResult
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
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.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
@RestController
@RequestMapping
(
"/store"
)
public
class
StoreController
extends
WebBaseController
{
@Autowired
private
ClerkService
clerkService
;
@Autowired
private
StaffApiService
staffApiService
;
@Autowired
private
DepartmentApiService
departmentApiService
;
@Autowired
private
StaffDepartmentRelatedApiService
staffDepartmentRelatedApiService
;
@Autowired
private
WxEnterpriseRelatedApiService
wxEnterpriseRelatedApiService
;
@Autowired
private
StoreService
storeService
;
//门店列表
@RequestMapping
(
"/find-simple-page"
)
public
HaobanResponse
storeList
(
String
enterpriseId
,
BasePageInfo
basePageInfo
)
{
Page
page
=
new
Page
<>();
page
.
setCurrentPage
(
basePageInfo
.
getPageNum
());
page
.
setPageSize
(
basePageInfo
.
getPageSize
());
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
enterpriseId
);
Page
<
StoreDTO
>
resultPage
=
storeService
.
storeListPage
(
page
,
storeSearchDTO
);
List
<
StoreDTO
>
resultList
=
resultPage
.
getResult
();
PageResult
<
StoreDTO
>
pageVo
=
new
PageResult
<>();
pageVo
.
setList
(
resultList
);
pageVo
.
setPageNum
(
page
.
getCurrentPage
());
pageVo
.
setPages
(
resultPage
.
getPages
());
pageVo
.
setPageSize
(
page
.
getPageSize
());
pageVo
.
setTotal
(
resultPage
.
getTotalCount
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
pageVo
);
}
}
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