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
32080dba
Commit
32080dba
authored
Feb 20, 2020
by
huangZW
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
6d435e5c
c4e20d48
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
108 additions
and
17 deletions
+108
-17
DepartmentApiService.java
...m/gic/haoban/manage/api/service/DepartmentApiService.java
+7
-0
pom.xml
haoban-manage3-service/pom.xml
+7
-2
DepartmentMapper.java
...ic/haoban/manage/service/dao/mapper/DepartmentMapper.java
+3
-0
DepartmentService.java
.../gic/haoban/manage/service/service/DepartmentService.java
+2
-0
WxEnterpriseService.java
...ic/haoban/manage/service/service/WxEnterpriseService.java
+2
-0
DepartmentServiceImpl.java
...an/manage/service/service/impl/DepartmentServiceImpl.java
+5
-0
WxEnterpriseServiceImpl.java
.../manage/service/service/impl/WxEnterpriseServiceImpl.java
+6
-0
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+29
-8
dubbo-haoban-manage-service.xml
...ervice/src/main/resources/dubbo-haoban-manage-service.xml
+3
-0
DepartmentMapper.xml
...e3-service/src/main/resources/mapper/DepartmentMapper.xml
+16
-0
DepartmentContoller.java
...gic/haoban/manage/web/controller/DepartmentContoller.java
+28
-7
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/DepartmentApiService.java
View file @
32080dba
...
@@ -99,5 +99,12 @@ public interface DepartmentApiService {
...
@@ -99,5 +99,12 @@ public interface DepartmentApiService {
* @param fieldListString
* @param fieldListString
*/
*/
void
syncGicDepartment
(
String
fieldListString
);
void
syncGicDepartment
(
String
fieldListString
);
/**
* 分页查询
* @param parentId
* @param pageInfo
* @return
*/
Page
<
DepartmentDTO
>
pageByParentId
(
String
parentId
,
String
keyword
,
BasePageInfo
pageInfo
);
}
}
haoban-manage3-service/pom.xml
View file @
32080dba
...
@@ -85,8 +85,13 @@
...
@@ -85,8 +85,13 @@
<artifactId>
haoban-message-api
</artifactId>
<artifactId>
haoban-message-api
</artifactId>
<version>
${haoban-message-api}
</version>
<version>
${haoban-message-api}
</version>
</dependency>
</dependency>
</dependencies>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-wechat-api
</artifactId>
<version>
${gic-wechat-api}
</version>
</dependency>
</dependencies>
<build>
<build>
<finalName>
haoban-manage3-service
</finalName>
<finalName>
haoban-manage3-service
</finalName>
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/DepartmentMapper.java
View file @
32080dba
...
@@ -39,4 +39,6 @@ public interface DepartmentMapper {
...
@@ -39,4 +39,6 @@ public interface DepartmentMapper {
Page
<
TabHaobanDepartment
>
pageFullStoreByWxEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"search"
)
String
search
,
@Param
(
"minCount"
)
int
minCount
);
Page
<
TabHaobanDepartment
>
pageFullStoreByWxEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"search"
)
String
search
,
@Param
(
"minCount"
)
int
minCount
);
TabHaobanDepartment
getByRelatedId
(
@Param
(
"relatedId"
)
String
relatedId
);
TabHaobanDepartment
getByRelatedId
(
@Param
(
"relatedId"
)
String
relatedId
);
Page
<
TabHaobanDepartment
>
pageByParentId
(
@Param
(
"parentId"
)
String
parentId
,
@Param
(
"keyword"
)
String
keyword
);
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/DepartmentService.java
View file @
32080dba
...
@@ -30,4 +30,6 @@ public interface DepartmentService {
...
@@ -30,4 +30,6 @@ public interface DepartmentService {
DepartmentDTO
getByRelatedId
(
String
storeId
);
DepartmentDTO
getByRelatedId
(
String
storeId
);
Page
<
TabHaobanDepartment
>
pageByParentId
(
String
parentId
,
String
keyword
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/WxEnterpriseService.java
View file @
32080dba
...
@@ -6,4 +6,6 @@ public interface WxEnterpriseService {
...
@@ -6,4 +6,6 @@ public interface WxEnterpriseService {
String
add
(
WxEnterpriseDTO
wxDTO
);
String
add
(
WxEnterpriseDTO
wxDTO
);
WxEnterpriseDTO
selectById
(
String
wxEnterpriseId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/DepartmentServiceImpl.java
View file @
32080dba
...
@@ -116,4 +116,9 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -116,4 +116,9 @@ public class DepartmentServiceImpl implements DepartmentService {
return
EntityUtil
.
changeEntityByJSON
(
DepartmentDTO
.
class
,
tab
);
return
EntityUtil
.
changeEntityByJSON
(
DepartmentDTO
.
class
,
tab
);
}
}
@Override
public
Page
<
TabHaobanDepartment
>
pageByParentId
(
String
parentId
,
String
keyword
)
{
return
mapper
.
pageByParentId
(
parentId
,
keyword
);
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WxEnterpriseServiceImpl.java
View file @
32080dba
...
@@ -28,4 +28,10 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
...
@@ -28,4 +28,10 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
}
}
@Override
public
WxEnterpriseDTO
selectById
(
String
wxEnterpriseId
)
{
//TabHaobanWxEnterprise wx
return
null
;
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
32080dba
...
@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.gic.api.base.commons.JSONResponse
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
...
@@ -20,6 +21,7 @@ import com.gic.haoban.common.utils.PageUtil;
...
@@ -20,6 +21,7 @@ import com.gic.haoban.common.utils.PageUtil;
import
com.gic.haoban.common.utils.StringUtil
;
import
com.gic.haoban.common.utils.StringUtil
;
import
com.gic.haoban.contacts.manage.api.dto.SyncJsonColumnDTO
;
import
com.gic.haoban.contacts.manage.api.dto.SyncJsonColumnDTO
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.service.dao.mapper.DepartmentMapper
;
import
com.gic.haoban.manage.service.dao.mapper.DepartmentMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanDepartment
;
import
com.gic.haoban.manage.service.entity.TabHaobanDepartment
;
...
@@ -27,6 +29,8 @@ import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated;
...
@@ -27,6 +29,8 @@ import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated
;
import
com.gic.haoban.manage.service.service.DepartmentService
;
import
com.gic.haoban.manage.service.service.DepartmentService
;
import
com.gic.haoban.manage.service.service.StaffDepartmentRelatedService
;
import
com.gic.haoban.manage.service.service.StaffDepartmentRelatedService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.wechat.api.service.qywx.QywxDepartmentApiService
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
@Service
@Service
...
@@ -45,6 +49,12 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
...
@@ -45,6 +49,12 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
@Autowired
@Autowired
private
com
.
gic
.
enterprise
.
api
.
service
.
DepartmentService
gicDepartmentService
;
private
com
.
gic
.
enterprise
.
api
.
service
.
DepartmentService
gicDepartmentService
;
@Autowired
private
QywxDepartmentApiService
qywxDepartmentApiService
;
@Autowired
private
WxEnterpriseService
wxEnterpriseService
;
@Override
@Override
public
List
<
DepartmentDTO
>
listByParentId
(
String
parentId
)
{
public
List
<
DepartmentDTO
>
listByParentId
(
String
parentId
)
{
...
@@ -65,15 +75,20 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
...
@@ -65,15 +75,20 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
hr
.
setErrorCode
(
1
);
hr
.
setErrorCode
(
1
);
//调微信的新增接口
//调微信的新增接口
String
wxDepartmentId
=
""
;
String
wxDepartmentId
=
""
;
if
(
StringUtils
.
isBlank
(
wxDepartmentId
))
{
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseService
.
selectById
(
department
.
getWxEnterpriseId
());
hr
.
setErrorCode
(
0
);
if
(
enterpriseDTO
!=
null
)
{
hr
.
setMessage
(
"微信新增部门失败"
);
//JSONResponse jp = qywxDepartmentApiService.createDepartment(enterpriseDTO.getCorpid(), enterpriseDTO.getsi, departmentDTO);
return
hr
;
if
(
StringUtils
.
isBlank
(
wxDepartmentId
))
{
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信新增部门失败"
);
return
hr
;
}
department
.
setWxDepartmentId
(
wxDepartmentId
);
String
departmentId
=
departmentService
.
add
(
department
);
department
.
setDepartmentId
(
departmentId
);
hr
.
setResult
(
department
);
}
}
department
.
setWxDepartmentId
(
wxDepartmentId
);
String
departmentId
=
departmentService
.
add
(
department
);
department
.
setDepartmentId
(
departmentId
);
hr
.
setResult
(
department
);
return
hr
;
return
hr
;
}
}
...
@@ -244,4 +259,10 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
...
@@ -244,4 +259,10 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
}
@Override
public
Page
<
DepartmentDTO
>
pageByParentId
(
String
parentId
,
String
keyword
,
BasePageInfo
pageInfo
)
{
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
return
PageUtil
.
changePageHelperToCurrentPage
(
departmentService
.
pageByParentId
(
parentId
,
keyword
),
DepartmentDTO
.
class
);
}
}
}
haoban-manage3-service/src/main/resources/dubbo-haoban-manage-service.xml
View file @
32080dba
...
@@ -30,4 +30,6 @@
...
@@ -30,4 +30,6 @@
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.WxEnterpriseApiService"
ref=
"wxEnterpriseApiServiceImpl"
timeout=
"10000"
/>
<dubbo:service
interface=
"com.gic.haoban.manage.api.service.WxEnterpriseApiService"
ref=
"wxEnterpriseApiServiceImpl"
timeout=
"10000"
/>
<dubbo:reference
interface=
"com.gic.enterprise.api.service.DepartmentService"
id=
"gicDepartmentService"
/>
<dubbo:reference
interface=
"com.gic.enterprise.api.service.DepartmentService"
id=
"gicDepartmentService"
/>
<dubbo:reference
interface=
"com.gic.wechat.api.service.qywx.QywxDepartmentApiService"
id=
"qywxDepartmentApiService"
/>
</beans>
</beans>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/DepartmentMapper.xml
View file @
32080dba
...
@@ -307,4 +307,19 @@
...
@@ -307,4 +307,19 @@
and status_flag = 1
and status_flag = 1
</select>
</select>
<select
id=
"pageByParentId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_department
where status_flag = 1
<if
test=
"parentId != null and parentId != ''"
>
and parent_department_id = #{parentId}
</if>
<if
test=
"keyword != null and keyword != ''"
>
and (department_name like CONCAT('%',#{keyWord},'%') or department_id like CONCAT('%',#{keyWord},'%'))
</if>
</select>
</mapper>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/DepartmentContoller.java
View file @
32080dba
...
@@ -3,7 +3,6 @@ package com.gic.haoban.manage.web.controller;
...
@@ -3,7 +3,6 @@ package com.gic.haoban.manage.web.controller;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collector
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
...
@@ -11,7 +10,6 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -11,7 +10,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
...
@@ -26,14 +24,11 @@ import com.gic.haoban.manage.web.anno.IgnoreLogin;
...
@@ -26,14 +24,11 @@ import com.gic.haoban.manage.web.anno.IgnoreLogin;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.qo.DepartmentAddQO
;
import
com.gic.haoban.manage.web.qo.DepartmentAddQO
;
import
com.gic.haoban.manage.web.qo.DepartmentEditQO
;
import
com.gic.haoban.manage.web.qo.DepartmentEditQO
;
import
com.gic.haoban.manage.web.utils.ListUtils
;
import
com.gic.haoban.manage.web.vo.LoginVO
;
import
com.gic.haoban.manage.web.vo.LoginVO
;
import
com.gic.haoban.manage.web.vo.StoreVo
;
import
com.gic.haoban.manage.web.vo.StoreVo
;
...
@@ -47,7 +42,33 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -47,7 +42,33 @@ public class DepartmentContoller extends WebBaseController{
@Autowired
@Autowired
private
StoreService
storeService
;
private
StoreService
storeService
;
@RequestMapping
(
"department-list"
)
@RequestMapping
(
"department-list"
)
public
HaobanResponse
departmentList
(
String
parentId
)
{
public
HaobanResponse
departmentList
(
String
parentId
,
BasePageInfo
pageInfo
,
String
keyword
)
{
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getSessionUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
Page
<
DepartmentDTO
>
page
=
new
Page
<
DepartmentDTO
>();
List
<
DepartmentDTO
>
list
=
new
ArrayList
<
DepartmentDTO
>();
if
(
StringUtils
.
isNotBlank
(
parentId
))
{
page
=
departmentApiService
.
pageByParentId
(
parentId
,
keyword
,
pageInfo
);
}
else
{
DepartmentDTO
dto
=
departmentApiService
.
getRootByEnterpriseId
(
wxEnterpriseId
);
list
.
add
(
dto
);
page
.
setTotalPage
(
1
);
page
.
setTotalCount
(
1
);
page
.
setResult
(
list
);
}
PageResult
<
DepartmentDTO
>
pageVo
=
new
PageResult
<>();
pageVo
.
setList
(
page
.
getResult
());
pageVo
.
setPageNum
(
page
.
getCurrentPage
());
pageVo
.
setPages
(
page
.
getPages
());
pageVo
.
setPageSize
(
page
.
getPageSize
());
pageVo
.
setTotal
(
page
.
getTotalCount
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
pageVo
);
}
@RequestMapping
(
"department-level-list"
)
public
HaobanResponse
departmentLevelList
(
String
parentId
)
{
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getSessionUser
();
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getSessionUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
DepartmentDTO
>
list
=
new
ArrayList
<
DepartmentDTO
>();
List
<
DepartmentDTO
>
list
=
new
ArrayList
<
DepartmentDTO
>();
...
@@ -74,7 +95,7 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -74,7 +95,7 @@ public class DepartmentContoller extends WebBaseController{
DepartmentDTO
department
=
new
DepartmentDTO
();
DepartmentDTO
department
=
new
DepartmentDTO
();
department
.
setParentDepartmentId
(
parentId
);
department
.
setParentDepartmentId
(
parentId
);
department
.
setDepartmentName
(
departmentName
);
department
.
setDepartmentName
(
departmentName
);
department
.
setWxEnterpriseId
(
dto
.
getWx
Department
Id
());
department
.
setWxEnterpriseId
(
dto
.
getWx
Enterprise
Id
());
department
.
setChainId
(
dto
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
dto
.
getDepartmentId
());
department
.
setChainId
(
dto
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
dto
.
getDepartmentId
());
department
.
setIsStore
(
0
);
department
.
setIsStore
(
0
);
departmentApiService
.
add
(
department
);
departmentApiService
.
add
(
department
);
...
...
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