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
d70f60aa
Commit
d70f60aa
authored
Mar 05, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
195005bc
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
97 additions
and
13 deletions
+97
-13
DepartmentDTO.java
...ain/java/com/gic/haoban/manage/api/dto/DepartmentDTO.java
+10
-0
DepartmentMapper.java
...ic/haoban/manage/service/dao/mapper/DepartmentMapper.java
+3
-0
TabHaobanDepartment.java
...gic/haoban/manage/service/entity/TabHaobanDepartment.java
+11
-0
DepartmentService.java
.../gic/haoban/manage/service/service/DepartmentService.java
+2
-0
DepartmentServiceImpl.java
...an/manage/service/service/impl/DepartmentServiceImpl.java
+5
-0
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+33
-0
WxEnterpriseRelatedApiServiceImpl.java
...e/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
+4
-9
DepartmentMapper.xml
...e3-service/src/main/resources/mapper/DepartmentMapper.xml
+29
-4
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/DepartmentDTO.java
View file @
d70f60aa
...
...
@@ -46,6 +46,8 @@ public class DepartmentDTO implements Serializable {
private
String
relatedCode
;
private
String
gicEnterpriseName
;
private
String
enterpriseId
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -216,6 +218,14 @@ public class DepartmentDTO implements Serializable {
public
void
setGicEnterpriseName
(
String
gicEnterpriseName
)
{
this
.
gicEnterpriseName
=
gicEnterpriseName
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/DepartmentMapper.java
View file @
d70f60aa
...
...
@@ -49,4 +49,6 @@ public interface DepartmentMapper {
List
<
TabHaobanDepartment
>
listByChainId
(
@Param
(
"chainId"
)
String
chainId
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
Integer
departmentRecycleCount
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
int
countSyncDepartmentByEnterpriseId
(
@Param
(
"enterpriseId"
)
String
enterpriseId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanDepartment.java
View file @
d70f60aa
...
...
@@ -35,6 +35,8 @@ public class TabHaobanDepartment implements Serializable {
private
String
wxEnterpriseId
;
private
String
relatedCode
;
private
String
enterpriseId
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -165,6 +167,14 @@ public class TabHaobanDepartment implements Serializable {
public
void
setRelatedCode
(
String
relatedCode
)
{
this
.
relatedCode
=
relatedCode
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/DepartmentService.java
View file @
d70f60aa
...
...
@@ -38,4 +38,6 @@ public interface DepartmentService {
Integer
departmentRecycleCount
(
String
wxEnterpriseId
);
int
countSyncDepartmentByEnterpriseId
(
String
enterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/DepartmentServiceImpl.java
View file @
d70f60aa
...
...
@@ -149,4 +149,9 @@ public class DepartmentServiceImpl implements DepartmentService {
return
mapper
.
departmentRecycleCount
(
wxEnterpriseId
);
}
@Override
public
int
countSyncDepartmentByEnterpriseId
(
String
enterpriseId
)
{
return
mapper
.
countSyncDepartmentByEnterpriseId
(
enterpriseId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
d70f60aa
...
...
@@ -21,6 +21,10 @@ import com.alibaba.fastjson.JSONArray;
import
com.gic.api.base.commons.JSONResponse
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.api.dto.StoreDTO
;
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
;
...
...
@@ -66,6 +70,12 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
@Autowired
private
WxApplicationService
wxApplicationService
;
@Autowired
private
StoreService
storeService
;
@Autowired
private
StoreGroupService
storeGroupService
;
@Override
public
List
<
DepartmentDTO
>
listByParentId
(
String
parentId
)
{
...
...
@@ -115,6 +125,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
logger
.
info
(
"【部门新增】wxDepartmentId = {}"
,
wxDepartmentId
);
department
.
setWxDepartmentId
(
wxDepartmentId
);
department
.
setLevel
(
parent
.
getLevel
()
+
1
);
setGicEnterpriseId
(
department
);
String
departmentId
=
departmentService
.
add
(
department
);
department
.
setDepartmentId
(
departmentId
);
hr
.
setResult
(
department
);
...
...
@@ -124,6 +135,28 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
return
hr
;
}
private
void
setGicEnterpriseId
(
DepartmentDTO
department
)
{
String
relatedId
=
department
.
getRelatedId
();
if
(
StringUtils
.
isNotBlank
(
relatedId
)){
Integer
storeFlag
=
department
.
getIsStore
();
if
(
storeFlag
==
1
){
StoreDTO
store
=
storeService
.
getStore
(
relatedId
);
if
(
store
!=
null
){
department
.
setEnterpriseId
(
store
.
getEnterpriseId
());
}
}
else
{
com
.
gic
.
enterprise
.
api
.
dto
.
DepartmentDTO
departmentDTO
=
gicDepartmentService
.
getDeptment
(
relatedId
);
if
(
departmentDTO
!=
null
){
department
.
setEnterpriseId
(
departmentDTO
.
getEnterpriseId
());
}
StoreGroupDTO
storeGroup
=
storeGroupService
.
getStoreGroupById
(
relatedId
);
if
(
storeGroup
!=
null
){
department
.
setEnterpriseId
(
storeGroup
.
getEnterpriseId
());
}
}
}
}
@Override
public
HaobanResponse
edit
(
DepartmentDTO
department
)
{
HaobanResponse
hr
=
new
HaobanResponse
();
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
View file @
d70f60aa
...
...
@@ -38,15 +38,10 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
List
<
TabHaobanWxEnterpriseRelated
>
relatedList
=
wxEnterpriseRelatedMapper
.
listByWxenterpriseId
(
wxEnterpriseId
);
List
<
EnterpriseDetailDTO
>
result
=
EntityUtil
.
changeEntityListByJSON
(
EnterpriseDetailDTO
.
class
,
relatedList
);
for
(
EnterpriseDetailDTO
enterpriseDetailDTO
:
result
)
{
// String enterpriseId = enterpriseDetailDTO.getEnterpriseId();
int
nodeCount
=
0
;
// List<GicTreeDTO> departmentList = storeGroupService.listGicTree(enterpriseId,null, null);
// for (GicTreeDTO gicTreeDTO : departmentList) {
// if(departmentService.getByRelatedId(gicTreeDTO.getId()) == null) {
// nodeCount ++;
// }
// nodeCount += getNodeCount(enterpriseId,gicTreeDTO.getId(),gicTreeDTO.getType());
// }
String
enterpriseId
=
enterpriseDetailDTO
.
getEnterpriseId
();
int
gicAllCount
=
storeGroupService
.
gicDepartmentCount
(
enterpriseId
);
int
syncCount
=
departmentService
.
countSyncDepartmentByEnterpriseId
(
enterpriseId
);
int
nodeCount
=
gicAllCount
-
syncCount
;
enterpriseDetailDTO
.
setNodeCount
(
nodeCount
);
}
return
result
;
...
...
haoban-manage3-service/src/main/resources/mapper/DepartmentMapper.xml
View file @
d70f60aa
...
...
@@ -16,12 +16,13 @@
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"wx_department_id"
property=
"wxDepartmentId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_enterprise_id"
property=
"wxEnterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"enterprise_id"
property=
"enterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"sort"
property=
"sort"
jdbcType=
"INTEGER"
/>
<result
column=
"level"
property=
"level"
jdbcType=
"INTEGER"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
department_id, department_name, parent_department_id, related_id, related_code,chain_id, is_store,
status_flag, recycle_flag, create_time, update_time,wx_department_id,sort,level,wx_enterprise_id,chain_name
status_flag, recycle_flag, create_time, update_time,wx_department_id,sort,level,wx_enterprise_id,chain_name
,enterprise_id
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
...
...
@@ -37,11 +38,11 @@
insert into tab_haoban_department (department_id, department_name, parent_department_id,
related_id,related_code, chain_id, is_store,
status_flag, recycle_flag, create_time,
update_time,wx_department_id,sort,level,wx_enterprise_id,chain_name)
update_time,wx_department_id,sort,level,wx_enterprise_id,chain_name
,enterprise_id
)
values (#{departmentId,jdbcType=VARCHAR}, #{departmentName,jdbcType=VARCHAR}, #{parentDepartmentId,jdbcType=VARCHAR},
#{relatedId,jdbcType=VARCHAR},#{relatedCode,jdbcType=VARCHAR}, #{chainId,jdbcType=VARCHAR}, #{isStore,jdbcType=INTEGER},
#{statusFlag,jdbcType=INTEGER}, #{recycleFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},#{wxDepartmentId},#{sort},#{level},#{wxEnterpriseId},#{chainName})
#{updateTime,jdbcType=TIMESTAMP},#{wxDepartmentId},#{sort},#{level},#{wxEnterpriseId},#{chainName}
,#{enterpriseId}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanDepartment"
>
insert into tab_haoban_department
...
...
@@ -85,6 +86,12 @@
<if
test=
"wxDepartmentId != null"
>
wx_department_id,
</if>
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id,
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id,
</if>
<if
test=
"sort != null"
>
sort,
</if>
...
...
@@ -132,6 +139,12 @@
<if
test=
"wxDepartmentId != null"
>
#{wxDepartmentId},
</if>
<if
test=
"wxEnterpriseId != null"
>
#{wxEnterpriseId},
</if>
<if
test=
"enterpriseId != null"
>
#{enterpriseId},
</if>
<if
test=
"sort != null"
>
#{sort},
</if>
...
...
@@ -182,6 +195,9 @@
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"sort != null"
>
sort = #{sort,jdbcType=INTEGER},
</if>
...
...
@@ -208,7 +224,8 @@
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
wx_enterprise_id = #{wxEnterpriseId}
wx_enterprise_id = #{wxEnterpriseId},
enterprise_id = #{enterpriseId}
where department_id = #{departmentId,jdbcType=VARCHAR}
</update>
...
...
@@ -391,4 +408,11 @@
and recycle_flag = 1
</select>
<select
id=
"countSyncDepartmentByEnterpriseId"
resultType=
"java.lang.Integer"
parameterType=
"java.lang.String"
>
select
count(1)
from tab_haoban_department
where enterprise_id = #{enterpriseId}
and status_flag = 1
</select>
</mapper>
\ No newline at end of file
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