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
a86ca16b
Commit
a86ca16b
authored
Feb 15, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
e088c87a
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
142 additions
and
9 deletions
+142
-9
DepartmentDTO.java
...ain/java/com/gic/haoban/manage/api/dto/DepartmentDTO.java
+10
-0
StaffDTO.java
...src/main/java/com/gic/haoban/manage/api/dto/StaffDTO.java
+10
-0
DepartmentApiService.java
...m/gic/haoban/manage/api/service/DepartmentApiService.java
+6
-0
DepartmentMapper.java
...ic/haoban/manage/service/dao/mapper/DepartmentMapper.java
+3
-0
TabHaobanDepartment.java
...gic/haoban/manage/service/entity/TabHaobanDepartment.java
+11
-0
TabHaobanStaff.java
.../com/gic/haoban/manage/service/entity/TabHaobanStaff.java
+11
-0
DepartmentService.java
.../gic/haoban/manage/service/service/DepartmentService.java
+2
-0
DepartmentServiceImpl.java
...an/manage/service/service/impl/DepartmentServiceImpl.java
+6
-0
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+6
-0
DepartmentMapper.xml
...e3-service/src/main/resources/mapper/DepartmentMapper.xml
+23
-3
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+15
-4
DepartmentContoller.java
...gic/haoban/manage/web/controller/DepartmentContoller.java
+39
-2
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/DepartmentDTO.java
View file @
a86ca16b
...
@@ -14,6 +14,8 @@ public class DepartmentDTO implements Serializable {
...
@@ -14,6 +14,8 @@ public class DepartmentDTO implements Serializable {
private
String
relatedId
;
private
String
relatedId
;
private
String
chainId
;
private
String
chainId
;
private
String
chainName
;
private
Integer
isStore
;
private
Integer
isStore
;
...
@@ -146,6 +148,14 @@ public class DepartmentDTO implements Serializable {
...
@@ -146,6 +148,14 @@ public class DepartmentDTO implements Serializable {
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
}
public
String
getChainName
()
{
return
chainName
;
}
public
void
setChainName
(
String
chainName
)
{
this
.
chainName
=
chainName
;
}
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/StaffDTO.java
View file @
a86ca16b
...
@@ -38,6 +38,8 @@ public class StaffDTO implements Serializable{
...
@@ -38,6 +38,8 @@ public class StaffDTO implements Serializable{
private
String
headImg
;
private
String
headImg
;
private
Integer
sort
;
private
List
<
DepartmentDTO
>
departmentList
;
private
List
<
DepartmentDTO
>
departmentList
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
@@ -180,5 +182,13 @@ public class StaffDTO implements Serializable{
...
@@ -180,5 +182,13 @@ public class StaffDTO implements Serializable{
this
.
departmentList
=
departmentList
;
this
.
departmentList
=
departmentList
;
}
}
public
Integer
getSort
()
{
return
sort
;
}
public
void
setSort
(
Integer
sort
)
{
this
.
sort
=
sort
;
}
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/DepartmentApiService.java
View file @
a86ca16b
...
@@ -69,5 +69,11 @@ public interface DepartmentApiService {
...
@@ -69,5 +69,11 @@ public interface DepartmentApiService {
* @param departmentId
* @param departmentId
*/
*/
HaobanResponse
repairRecycle
(
String
departmentId
);
HaobanResponse
repairRecycle
(
String
departmentId
);
/**
* 获取根节点
* @param wxEnterpriseId
* @return
*/
DepartmentDTO
getRootByEnterpriseId
(
String
wxEnterpriseId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/DepartmentMapper.java
View file @
a86ca16b
...
@@ -31,4 +31,6 @@ public interface DepartmentMapper {
...
@@ -31,4 +31,6 @@ public interface DepartmentMapper {
Page
<
TabHaobanDepartment
>
pageDepartmentByParams
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"keyword"
)
String
keyword
,
Page
<
TabHaobanDepartment
>
pageDepartmentByParams
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"storeFlag"
)
Integer
storeFlag
,
@Param
(
"recycleFlag"
)
Integer
recycleFlag
);
@Param
(
"storeFlag"
)
Integer
storeFlag
,
@Param
(
"recycleFlag"
)
Integer
recycleFlag
);
TabHaobanDepartment
getRootByEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanDepartment.java
View file @
a86ca16b
...
@@ -13,6 +13,8 @@ public class TabHaobanDepartment implements Serializable {
...
@@ -13,6 +13,8 @@ public class TabHaobanDepartment implements Serializable {
private
String
relatedId
;
private
String
relatedId
;
private
String
chainId
;
private
String
chainId
;
private
String
chainName
;
private
Integer
isStore
;
private
Integer
isStore
;
...
@@ -145,6 +147,14 @@ public class TabHaobanDepartment implements Serializable {
...
@@ -145,6 +147,14 @@ public class TabHaobanDepartment implements Serializable {
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
}
public
String
getChainName
()
{
return
chainName
;
}
public
void
setChainName
(
String
chainName
)
{
this
.
chainName
=
chainName
;
}
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanStaff.java
View file @
a86ca16b
...
@@ -33,6 +33,8 @@ public class TabHaobanStaff implements Serializable {
...
@@ -33,6 +33,8 @@ public class TabHaobanStaff implements Serializable {
private
Date
updateTime
;
private
Date
updateTime
;
private
String
headImg
;
private
String
headImg
;
private
Integer
sort
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
@@ -155,6 +157,14 @@ public class TabHaobanStaff implements Serializable {
...
@@ -155,6 +157,14 @@ public class TabHaobanStaff implements Serializable {
public
void
setHeadImg
(
String
headImg
)
{
public
void
setHeadImg
(
String
headImg
)
{
this
.
headImg
=
headImg
;
this
.
headImg
=
headImg
;
}
}
public
Integer
getSort
()
{
return
sort
;
}
public
void
setSort
(
Integer
sort
)
{
this
.
sort
=
sort
;
}
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/DepartmentService.java
View file @
a86ca16b
...
@@ -26,4 +26,6 @@ public interface DepartmentService {
...
@@ -26,4 +26,6 @@ public interface DepartmentService {
void
repairRecycle
(
String
departmentId
);
void
repairRecycle
(
String
departmentId
);
DepartmentDTO
getRootByEnterpriseId
(
String
wxEnterpriseId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/DepartmentServiceImpl.java
View file @
a86ca16b
...
@@ -104,4 +104,10 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -104,4 +104,10 @@ public class DepartmentServiceImpl implements DepartmentService {
}
}
@Override
public
DepartmentDTO
getRootByEnterpriseId
(
String
wxEnterpriseId
)
{
TabHaobanDepartment
tab
=
mapper
.
getRootByEnterpriseId
(
wxEnterpriseId
);
return
EntityUtil
.
changeEntityByJSON
(
DepartmentDTO
.
class
,
tab
);
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
a86ca16b
...
@@ -150,4 +150,10 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
...
@@ -150,4 +150,10 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
return
EntityUtil
.
changeEntityListByJSON
(
DepartmentDTO
.
class
,
list
);
return
EntityUtil
.
changeEntityListByJSON
(
DepartmentDTO
.
class
,
list
);
}
}
@Override
public
DepartmentDTO
getRootByEnterpriseId
(
String
wxEnterpriseId
)
{
return
departmentService
.
getRootByEnterpriseId
(
wxEnterpriseId
);
}
}
}
haoban-manage3-service/src/main/resources/mapper/DepartmentMapper.xml
View file @
a86ca16b
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
<result
column=
"parent_department_id"
property=
"parentDepartmentId"
jdbcType=
"VARCHAR"
/>
<result
column=
"parent_department_id"
property=
"parentDepartmentId"
jdbcType=
"VARCHAR"
/>
<result
column=
"related_id"
property=
"relatedId"
jdbcType=
"VARCHAR"
/>
<result
column=
"related_id"
property=
"relatedId"
jdbcType=
"VARCHAR"
/>
<result
column=
"chain_id"
property=
"chainId"
jdbcType=
"VARCHAR"
/>
<result
column=
"chain_id"
property=
"chainId"
jdbcType=
"VARCHAR"
/>
<result
column=
"chain_name"
property=
"chainName"
jdbcType=
"VARCHAR"
/>
<result
column=
"is_store"
property=
"isStore"
jdbcType=
"INTEGER"
/>
<result
column=
"is_store"
property=
"isStore"
jdbcType=
"INTEGER"
/>
<result
column=
"status_flag"
property=
"statusFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"status_flag"
property=
"statusFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"recycle_flag"
property=
"recycleFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"recycle_flag"
property=
"recycleFlag"
jdbcType=
"INTEGER"
/>
...
@@ -19,7 +20,7 @@
...
@@ -19,7 +20,7 @@
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
department_id, department_name, parent_department_id, related_id, chain_id, is_store,
department_id, department_name, parent_department_id, related_id, chain_id, is_store,
status_flag, recycle_flag, create_time, update_time,wx_department_id,sort,level,wx_enterprise_id
status_flag, recycle_flag, create_time, update_time,wx_department_id,sort,level,wx_enterprise_id
,chain_name
</sql>
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
select
...
@@ -35,11 +36,11 @@
...
@@ -35,11 +36,11 @@
insert into tab_haoban_department (department_id, department_name, parent_department_id,
insert into tab_haoban_department (department_id, department_name, parent_department_id,
related_id, chain_id, is_store,
related_id, chain_id, is_store,
status_flag, recycle_flag, create_time,
status_flag, recycle_flag, create_time,
update_time,wx_department_id,sort,level,wx_enterprise_id)
update_time,wx_department_id,sort,level,wx_enterprise_id
,chain_name
)
values (#{departmentId,jdbcType=VARCHAR}, #{departmentName,jdbcType=VARCHAR}, #{parentDepartmentId,jdbcType=VARCHAR},
values (#{departmentId,jdbcType=VARCHAR}, #{departmentName,jdbcType=VARCHAR}, #{parentDepartmentId,jdbcType=VARCHAR},
#{relatedId,jdbcType=VARCHAR}, #{chainId,jdbcType=VARCHAR}, #{isStore,jdbcType=INTEGER},
#{relatedId,jdbcType=VARCHAR}, #{chainId,jdbcType=VARCHAR}, #{isStore,jdbcType=INTEGER},
#{statusFlag,jdbcType=INTEGER}, #{recycleFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{statusFlag,jdbcType=INTEGER}, #{recycleFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},#{wxDepartmentId},#{sort},#{level},#{wxEnterpriseId})
#{updateTime,jdbcType=TIMESTAMP},#{wxDepartmentId},#{sort},#{level},#{wxEnterpriseId}
,#{chainName}
)
</insert>
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanDepartment"
>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanDepartment"
>
insert into tab_haoban_department
insert into tab_haoban_department
...
@@ -59,6 +60,9 @@
...
@@ -59,6 +60,9 @@
<if
test=
"chainId != null"
>
<if
test=
"chainId != null"
>
chain_id,
chain_id,
</if>
</if>
<if
test=
"chainName != null"
>
chain_name,
</if>
<if
test=
"isStore != null"
>
<if
test=
"isStore != null"
>
is_store,
is_store,
</if>
</if>
...
@@ -100,6 +104,9 @@
...
@@ -100,6 +104,9 @@
<if
test=
"chainId != null"
>
<if
test=
"chainId != null"
>
#{chainId,jdbcType=VARCHAR},
#{chainId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"chainName != null"
>
#{chainName,jdbcType=VARCHAR},
</if>
<if
test=
"isStore != null"
>
<if
test=
"isStore != null"
>
#{isStore,jdbcType=INTEGER},
#{isStore,jdbcType=INTEGER},
</if>
</if>
...
@@ -141,6 +148,9 @@
...
@@ -141,6 +148,9 @@
<if
test=
"chainId != null"
>
<if
test=
"chainId != null"
>
chain_id = #{chainId,jdbcType=VARCHAR},
chain_id = #{chainId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"chainName != null"
>
chain_name = #{chainName,jdbcType=VARCHAR},
</if>
<if
test=
"isStore != null"
>
<if
test=
"isStore != null"
>
is_store = #{isStore,jdbcType=INTEGER},
is_store = #{isStore,jdbcType=INTEGER},
</if>
</if>
...
@@ -177,6 +187,7 @@
...
@@ -177,6 +187,7 @@
parent_department_id = #{parentDepartmentId,jdbcType=VARCHAR},
parent_department_id = #{parentDepartmentId,jdbcType=VARCHAR},
related_id = #{relatedId,jdbcType=VARCHAR},
related_id = #{relatedId,jdbcType=VARCHAR},
chain_id = #{chainId,jdbcType=VARCHAR},
chain_id = #{chainId,jdbcType=VARCHAR},
chain_name = #{chainName,jdbcType=VARCHAR},
wx_department_id = #{wxDepartmentId,jdbcType=VARCHAR},
wx_department_id = #{wxDepartmentId,jdbcType=VARCHAR},
is_store = #{isStore,jdbcType=INTEGER},
is_store = #{isStore,jdbcType=INTEGER},
status_flag = #{statusFlag,jdbcType=INTEGER},
status_flag = #{statusFlag,jdbcType=INTEGER},
...
@@ -248,4 +259,12 @@
...
@@ -248,4 +259,12 @@
</if>
</if>
</select>
</select>
<select
id=
"getRootByEnterpriseId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_department
where level = 0
and wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1
</select>
</mapper>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
a86ca16b
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
<result
column=
"head_img"
property=
"headImg"
jdbcType=
"VARCHAR"
/>
<result
column=
"head_img"
property=
"headImg"
jdbcType=
"VARCHAR"
/>
<result
column=
"postion"
property=
"postion"
jdbcType=
"VARCHAR"
/>
<result
column=
"postion"
property=
"postion"
jdbcType=
"VARCHAR"
/>
<result
column=
"active_flag"
property=
"activeFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"active_flag"
property=
"activeFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"sort"
property=
"sort"
jdbcType=
"INTEGER"
/>
<result
column=
"extend_postion"
property=
"extendPostion"
jdbcType=
"VARCHAR"
/>
<result
column=
"extend_postion"
property=
"extendPostion"
jdbcType=
"VARCHAR"
/>
<result
column=
"status_flag"
property=
"statusFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"status_flag"
property=
"statusFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
...
@@ -20,7 +21,7 @@
...
@@ -20,7 +21,7 @@
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
staff_id, wx_user_id, phone_number, staff_name, nation_code, nick_name, sex, postion,
staff_id, wx_user_id, phone_number, staff_name, nation_code, nick_name, sex, postion,
active_flag, extend_postion, status_flag, create_time, update_time,wx_enterprise_id,head_img
active_flag, extend_postion, status_flag, create_time, update_time,wx_enterprise_id,head_img
,sort
</sql>
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
select
...
@@ -37,12 +38,12 @@
...
@@ -37,12 +38,12 @@
staff_name, nation_code, nick_name,
staff_name, nation_code, nick_name,
sex, postion, active_flag,
sex, postion, active_flag,
extend_postion, status_flag, create_time,
extend_postion, status_flag, create_time,
update_time,wx_enterprise_id,head_img)
update_time,wx_enterprise_id,head_img
,sort
)
values (#{staffId,jdbcType=VARCHAR}, #{wxUserId,jdbcType=VARCHAR}, #{phoneNumber,jdbcType=VARCHAR},
values (#{staffId,jdbcType=VARCHAR}, #{wxUserId,jdbcType=VARCHAR}, #{phoneNumber,jdbcType=VARCHAR},
#{staffName,jdbcType=VARCHAR}, #{nationCode,jdbcType=VARCHAR}, #{nickName,jdbcType=VARCHAR},
#{staffName,jdbcType=VARCHAR}, #{nationCode,jdbcType=VARCHAR}, #{nickName,jdbcType=VARCHAR},
#{sex,jdbcType=INTEGER}, #{postion,jdbcType=VARCHAR}, #{activeFlag,jdbcType=INTEGER},
#{sex,jdbcType=INTEGER}, #{postion,jdbcType=VARCHAR}, #{activeFlag,jdbcType=INTEGER},
#{extendPostion,jdbcType=VARCHAR}, #{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{extendPostion,jdbcType=VARCHAR}, #{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},#{wxEnterpriseId},#{headImg})
#{updateTime,jdbcType=TIMESTAMP},#{wxEnterpriseId},#{headImg}
,#{sort}
)
</insert>
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanStaff"
>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanStaff"
>
insert into tab_haoban_staff
insert into tab_haoban_staff
...
@@ -92,6 +93,9 @@
...
@@ -92,6 +93,9 @@
<if
test=
"updateTime != null"
>
<if
test=
"updateTime != null"
>
update_time,
update_time,
</if>
</if>
<if
test=
"sort != null"
>
sort,
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"staffId != null"
>
<if
test=
"staffId != null"
>
...
@@ -139,6 +143,9 @@
...
@@ -139,6 +143,9 @@
<if
test=
"updateTime != null"
>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},
</if>
</if>
<if
test=
"sort != null"
>
#{sort,jdbcType=INTEGER},
</if>
</trim>
</trim>
</insert>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanStaff"
>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanStaff"
>
...
@@ -186,6 +193,9 @@
...
@@ -186,6 +193,9 @@
<if
test=
"updateTime != null"
>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</if>
<if
test=
"sort != null"
>
sort = #{sort,jdbcType=INTEGER},
</if>
</set>
</set>
where staff_id = #{staffId,jdbcType=VARCHAR}
where staff_id = #{staffId,jdbcType=VARCHAR}
</update>
</update>
...
@@ -204,7 +214,8 @@
...
@@ -204,7 +214,8 @@
head_img = #{headImg,jdbcType=VARCHAR},
head_img = #{headImg,jdbcType=VARCHAR},
status_flag = #{statusFlag,jdbcType=INTEGER},
status_flag = #{statusFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
update_time = #{updateTime,jdbcType=TIMESTAMP},
sort = #{sort}
where staff_id = #{staffId,jdbcType=VARCHAR}
where staff_id = #{staffId,jdbcType=VARCHAR}
</update>
</update>
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/DepartmentContoller.java
View file @
a86ca16b
...
@@ -14,7 +14,7 @@ import com.gic.enterprise.api.dto.GicTreeDTO;
...
@@ -14,7 +14,7 @@ import com.gic.enterprise.api.dto.GicTreeDTO;
import
com.gic.enterprise.api.service.StoreGroupService
;
import
com.gic.enterprise.api.service.StoreGroupService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.Constant
;
import
com.gic.haoban.base.api.common.Constant
;
import
com.gic.haoban.
common.utils
.AuthRequestUtil
;
import
com.gic.haoban.
manage.web.auth
.AuthRequestUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
...
@@ -33,7 +33,15 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -33,7 +33,15 @@ public class DepartmentContoller extends WebBaseController{
@RequestMapping
(
"department-list"
)
@RequestMapping
(
"department-list"
)
public
HaobanResponse
departmentList
(
String
parentId
)
{
public
HaobanResponse
departmentList
(
String
parentId
)
{
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getAppLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
DepartmentDTO
>
list
=
departmentApiService
.
listByParentId
(
parentId
);
List
<
DepartmentDTO
>
list
=
departmentApiService
.
listByParentId
(
parentId
);
if
(
StringUtils
.
isNotBlank
(
parentId
))
{
list
=
departmentApiService
.
listByParentId
(
parentId
);
}
else
{
DepartmentDTO
dto
=
departmentApiService
.
getRootByEnterpriseId
(
wxEnterpriseId
);
list
.
add
(
dto
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
...
@@ -122,6 +130,7 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -122,6 +130,7 @@ public class DepartmentContoller extends WebBaseController{
department
.
setWxDepartmentId
(
dto
.
getWxDepartmentId
());
department
.
setWxDepartmentId
(
dto
.
getWxDepartmentId
());
department
.
setDepartmentName
(
departmentAddQO
.
getDepartmentName
());
department
.
setDepartmentName
(
departmentAddQO
.
getDepartmentName
());
department
.
setChainId
(
dto
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
dto
.
getDepartmentId
());
department
.
setChainId
(
dto
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
dto
.
getDepartmentId
());
department
.
setChainName
(
dto
.
getChainName
()
+
Constant
.
NAME_SEPARATOR
+
dto
.
getDepartmentName
());
department
.
setIsStore
(
0
);
department
.
setIsStore
(
0
);
department
.
setIsStore
(
departmentAddQO
.
getStoreFlag
());
department
.
setIsStore
(
departmentAddQO
.
getStoreFlag
());
department
.
setLevel
(
dto
.
getLevel
()
+
1
);
department
.
setLevel
(
dto
.
getLevel
()
+
1
);
...
@@ -150,7 +159,10 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -150,7 +159,10 @@ public class DepartmentContoller extends WebBaseController{
department
.
setParentDepartmentId
(
parentId
);
department
.
setParentDepartmentId
(
parentId
);
department
.
setDepartmentName
(
departmentQO
.
getDepartmentName
());
department
.
setDepartmentName
(
departmentQO
.
getDepartmentName
());
department
.
setChainId
(
parent
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
parent
.
getDepartmentId
());
department
.
setChainId
(
parent
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
parent
.
getDepartmentId
());
department
.
setChainName
(
parent
.
getChainName
()
+
Constant
.
NAME_SEPARATOR
+
parent
.
getDepartmentName
());
department
.
setLevel
(
parent
.
getLevel
()
+
1
);
department
.
setLevel
(
parent
.
getLevel
()
+
1
);
handerSonDepartment
(
departmentQO
.
getCurrDepartment
());
HaobanResponse
hr
=
departmentApiService
.
edit
(
department
);
HaobanResponse
hr
=
departmentApiService
.
edit
(
department
);
}
}
...
@@ -176,6 +188,25 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -176,6 +188,25 @@ public class DepartmentContoller extends WebBaseController{
}
}
/**
* 修改子孙部门
* @param departmentId
*/
private
void
handerSonDepartment
(
String
departmentId
)
{
DepartmentDTO
department
=
departmentApiService
.
selectById
(
departmentId
);
List
<
DepartmentDTO
>
list
=
departmentApiService
.
listByParentId
(
departmentId
);
if
(!
list
.
isEmpty
())
{
for
(
DepartmentDTO
departmentDTO
:
list
)
{
departmentDTO
.
setChainId
(
department
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
department
.
getDepartmentId
());
departmentDTO
.
setChainName
(
department
.
getChainName
()
+
Constant
.
NAME_SEPARATOR
+
department
.
getDepartmentName
());
departmentDTO
.
setLevel
(
department
.
getLevel
());
departmentApiService
.
edit
(
departmentDTO
);
}
}
}
@RequestMapping
(
"unbind-department-list"
)
@RequestMapping
(
"unbind-department-list"
)
public
HaobanResponse
unbindDepartmentList
(
String
departmentId
,
String
enterpriseId
,
Integer
type
)
{
public
HaobanResponse
unbindDepartmentList
(
String
departmentId
,
String
enterpriseId
,
Integer
type
)
{
List
<
String
>
list
=
new
ArrayList
<
String
>();
List
<
String
>
list
=
new
ArrayList
<
String
>();
...
@@ -221,7 +252,11 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -221,7 +252,11 @@ public class DepartmentContoller extends WebBaseController{
}
}
/**
* 处理子节点
* @param sonDepartment
* @param parentId
*/
private
void
handler
(
String
sonDepartment
,
String
parentId
)
{
private
void
handler
(
String
sonDepartment
,
String
parentId
)
{
if
(
StringUtils
.
isNotBlank
(
sonDepartment
))
{
if
(
StringUtils
.
isNotBlank
(
sonDepartment
))
{
List
<
DepartmentAddQO
>
list
=
JSONArray
.
parseArray
(
sonDepartment
,
DepartmentAddQO
.
class
);
List
<
DepartmentAddQO
>
list
=
JSONArray
.
parseArray
(
sonDepartment
,
DepartmentAddQO
.
class
);
...
@@ -243,6 +278,7 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -243,6 +278,7 @@ public class DepartmentContoller extends WebBaseController{
department
.
setWxEnterpriseId
(
dto
.
getWxEnterpriseId
());
department
.
setWxEnterpriseId
(
dto
.
getWxEnterpriseId
());
department
.
setDepartmentName
(
departmentAddQO
.
getDepartmentName
());
department
.
setDepartmentName
(
departmentAddQO
.
getDepartmentName
());
department
.
setChainId
(
dto
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
dto
.
getDepartmentId
());
department
.
setChainId
(
dto
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
dto
.
getDepartmentId
());
department
.
setChainName
(
dto
.
getChainName
()
+
Constant
.
NAME_SEPARATOR
+
dto
.
getDepartmentName
());
department
.
setIsStore
(
0
);
department
.
setIsStore
(
0
);
department
.
setIsStore
(
departmentAddQO
.
getStoreFlag
());
department
.
setIsStore
(
departmentAddQO
.
getStoreFlag
());
department
.
setLevel
(
dto
.
getLevel
()
+
1
);
department
.
setLevel
(
dto
.
getLevel
()
+
1
);
...
@@ -263,6 +299,7 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -263,6 +299,7 @@ public class DepartmentContoller extends WebBaseController{
department
.
setParentDepartmentId
(
parentId
);
department
.
setParentDepartmentId
(
parentId
);
department
.
setDepartmentName
(
departmentAddQO
.
getDepartmentName
());
department
.
setDepartmentName
(
departmentAddQO
.
getDepartmentName
());
department
.
setChainId
(
dto
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
dto
.
getDepartmentId
());
department
.
setChainId
(
dto
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
dto
.
getDepartmentId
());
department
.
setChainName
(
dto
.
getChainName
()
+
Constant
.
NAME_SEPARATOR
+
dto
.
getDepartmentName
());
HaobanResponse
hr
=
departmentApiService
.
edit
(
department
);
HaobanResponse
hr
=
departmentApiService
.
edit
(
department
);
if
(
hr
.
getErrorCode
()
!=
1
)
{
if
(
hr
.
getErrorCode
()
!=
1
)
{
continue
;
continue
;
...
...
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