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
0b8225c2
Commit
0b8225c2
authored
Feb 12, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部门相关
parent
79fc354a
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
426 additions
and
110 deletions
+426
-110
pom.xml
haoban-manage3-api/pom.xml
+5
-0
DepartmentDTO.java
...ain/java/com/gic/haoban/manage/api/dto/DepartmentDTO.java
+120
-0
DepartmentApiService.java
...m/gic/haoban/manage/api/service/DepartmentApiService.java
+31
-0
DepartmentMapper.java
...ic/haoban/manage/service/dao/mapper/DepartmentMapper.java
+5
-0
TabHaobanDepartment.java
...gic/haoban/manage/service/entity/TabHaobanDepartment.java
+13
-0
DepartmentService.java
.../gic/haoban/manage/service/service/DepartmentService.java
+15
-0
DepartmentApiServiceImpl.java
...manage/service/service/impl/DepartmentApiServiceImpl.java
+74
-0
DepartmentServiceImpl.java
...anage/service/service/out/impl/DepartmentServiceImpl.java
+52
-0
DepartmentMapper.xml
...e3-service/src/main/resources/mapper/DepartmentMapper.xml
+23
-3
DepartmentContoller.java
...gic/haoban/manage/web/controller/DepartmentContoller.java
+85
-0
HaoBanErrCode.java
...java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
+3
-107
No files found.
haoban-manage3-api/pom.xml
View file @
0b8225c2
...
@@ -52,6 +52,11 @@
...
@@ -52,6 +52,11 @@
<artifactId>
haoban-base-api
</artifactId>
<artifactId>
haoban-base-api
</artifactId>
<version>
${haoban-base-api}
</version>
<version>
${haoban-base-api}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
haoban-common
</artifactId>
<version>
${haoban-common}
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/DepartmentDTO.java
0 → 100644
View file @
0b8225c2
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
public
class
DepartmentDTO
implements
Serializable
{
private
String
departmentId
;
private
String
departmentName
;
private
String
parentDepartmentId
;
private
String
relatedId
;
private
String
chainId
;
private
Integer
isStore
;
private
Integer
statusFlag
;
private
Integer
recycleFlag
;
private
Date
createTime
;
private
Date
updateTime
;
private
String
wxDepartmentId
;
private
static
final
long
serialVersionUID
=
1L
;
public
String
getDepartmentId
()
{
return
departmentId
;
}
public
void
setDepartmentId
(
String
departmentId
)
{
this
.
departmentId
=
departmentId
==
null
?
null
:
departmentId
.
trim
();
}
public
String
getDepartmentName
()
{
return
departmentName
;
}
public
void
setDepartmentName
(
String
departmentName
)
{
this
.
departmentName
=
departmentName
==
null
?
null
:
departmentName
.
trim
();
}
public
String
getParentDepartmentId
()
{
return
parentDepartmentId
;
}
public
void
setParentDepartmentId
(
String
parentDepartmentId
)
{
this
.
parentDepartmentId
=
parentDepartmentId
==
null
?
null
:
parentDepartmentId
.
trim
();
}
public
String
getRelatedId
()
{
return
relatedId
;
}
public
void
setRelatedId
(
String
relatedId
)
{
this
.
relatedId
=
relatedId
==
null
?
null
:
relatedId
.
trim
();
}
public
String
getChainId
()
{
return
chainId
;
}
public
void
setChainId
(
String
chainId
)
{
this
.
chainId
=
chainId
==
null
?
null
:
chainId
.
trim
();
}
public
Integer
getIsStore
()
{
return
isStore
;
}
public
void
setIsStore
(
Integer
isStore
)
{
this
.
isStore
=
isStore
;
}
public
Integer
getStatusFlag
()
{
return
statusFlag
;
}
public
void
setStatusFlag
(
Integer
statusFlag
)
{
this
.
statusFlag
=
statusFlag
;
}
public
Integer
getRecycleFlag
()
{
return
recycleFlag
;
}
public
void
setRecycleFlag
(
Integer
recycleFlag
)
{
this
.
recycleFlag
=
recycleFlag
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
String
getWxDepartmentId
()
{
return
wxDepartmentId
;
}
public
void
setWxDepartmentId
(
String
wxDepartmentId
)
{
this
.
wxDepartmentId
=
wxDepartmentId
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/DepartmentApiService.java
View file @
0b8225c2
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
import
java.util.List
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
public
interface
DepartmentApiService
{
public
interface
DepartmentApiService
{
List
<
DepartmentDTO
>
listByParentId
(
String
parentId
);
/**
* 根据部门id查询部门
* @param departmentId
* @return
*/
DepartmentDTO
selectById
(
String
departmentId
);
/**
* 新增部门
* @param department
* @return
*/
HaobanResponse
add
(
DepartmentDTO
department
);
/**
* 修改部门
* @param department
* @return
*/
HaobanResponse
edit
(
DepartmentDTO
department
);
/**
* 删除部门
* @param departmentId
* @return
*/
HaobanResponse
del
(
String
departmentId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/DepartmentMapper.java
View file @
0b8225c2
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
import
java.util.List
;
import
com.gic.haoban.manage.service.entity.TabHaobanDepartment
;
import
com.gic.haoban.manage.service.entity.TabHaobanDepartment
;
public
interface
DepartmentMapper
{
public
interface
DepartmentMapper
{
...
@@ -14,4 +16,6 @@ public interface DepartmentMapper {
...
@@ -14,4 +16,6 @@ public interface DepartmentMapper {
int
updateByPrimaryKeySelective
(
TabHaobanDepartment
record
);
int
updateByPrimaryKeySelective
(
TabHaobanDepartment
record
);
int
updateByPrimaryKey
(
TabHaobanDepartment
record
);
int
updateByPrimaryKey
(
TabHaobanDepartment
record
);
List
<
TabHaobanDepartment
>
listByParentId
(
String
parentId
);
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanDepartment.java
View file @
0b8225c2
...
@@ -24,6 +24,8 @@ public class TabHaobanDepartment implements Serializable {
...
@@ -24,6 +24,8 @@ public class TabHaobanDepartment implements Serializable {
private
Date
updateTime
;
private
Date
updateTime
;
private
String
wxDepartmentId
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
public
String
getDepartmentId
()
{
public
String
getDepartmentId
()
{
...
@@ -105,4 +107,14 @@ public class TabHaobanDepartment implements Serializable {
...
@@ -105,4 +107,14 @@ public class TabHaobanDepartment implements Serializable {
public
void
setUpdateTime
(
Date
updateTime
)
{
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
this
.
updateTime
=
updateTime
;
}
}
public
String
getWxDepartmentId
()
{
return
wxDepartmentId
;
}
public
void
setWxDepartmentId
(
String
wxDepartmentId
)
{
this
.
wxDepartmentId
=
wxDepartmentId
;
}
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/DepartmentService.java
View file @
0b8225c2
package
com
.
gic
.
haoban
.
manage
.
service
.
service
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
;
import
java.util.List
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.service.entity.TabHaobanDepartment
;
public
interface
DepartmentService
{
public
interface
DepartmentService
{
List
<
TabHaobanDepartment
>
listByParentId
(
String
parentId
);
TabHaobanDepartment
selectById
(
String
departmentId
);
String
add
(
DepartmentDTO
department
);
void
edit
(
DepartmentDTO
department
);
void
del
(
String
departmentId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/DepartmentApiServiceImpl.java
View file @
0b8225c2
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
import
java.util.Date
;
import
java.util.List
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.StringUtil
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.service.entity.TabHaobanDepartment
;
import
com.gic.haoban.manage.service.service.DepartmentService
;
@Service
@Service
public
class
DepartmentApiServiceImpl
implements
DepartmentApiService
{
public
class
DepartmentApiServiceImpl
implements
DepartmentApiService
{
@Autowired
private
DepartmentService
departmentService
;
@Override
public
List
<
DepartmentDTO
>
listByParentId
(
String
parentId
)
{
List
<
TabHaobanDepartment
>
list
=
departmentService
.
listByParentId
(
parentId
);
return
EntityUtil
.
changeEntityListByJSON
(
DepartmentDTO
.
class
,
list
);
}
@Override
public
DepartmentDTO
selectById
(
String
departmentId
)
{
TabHaobanDepartment
tab
=
departmentService
.
selectById
(
departmentId
);
return
EntityUtil
.
changeEntityByJSON
(
DepartmentDTO
.
class
,
tab
);
}
@Override
public
HaobanResponse
add
(
DepartmentDTO
department
)
{
HaobanResponse
hr
=
new
HaobanResponse
();
hr
.
setErrorCode
(
1
);
//调微信的新增接口
String
wxDepartmentId
=
""
;
if
(
StringUtils
.
isBlank
(
wxDepartmentId
))
{
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信新增部门失败"
);
return
hr
;
}
department
.
setWxDepartmentId
(
wxDepartmentId
);
departmentService
.
add
(
department
);
return
hr
;
}
@Override
public
HaobanResponse
edit
(
DepartmentDTO
department
)
{
HaobanResponse
hr
=
new
HaobanResponse
();
hr
.
setErrorCode
(
1
);
//调微信的修改接口
String
wxDepartmentId
=
""
;
if
(
StringUtils
.
isBlank
(
wxDepartmentId
))
{
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信修改部门失败"
);
return
hr
;
}
departmentService
.
edit
(
department
);
return
hr
;
}
@Override
public
HaobanResponse
del
(
String
departmentId
)
{
HaobanResponse
hr
=
new
HaobanResponse
();
hr
.
setErrorCode
(
1
);
//调微信的新增接口
String
wxDepartmentId
=
""
;
if
(
StringUtils
.
isBlank
(
wxDepartmentId
))
{
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信删除部门失败"
);
return
hr
;
}
departmentService
.
del
(
departmentId
);
return
hr
;
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentServiceImpl.java
View file @
0b8225c2
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
java.util.Date
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.common.utils.StringUtil
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.service.dao.mapper.DepartmentMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanDepartment
;
import
com.gic.haoban.manage.service.service.DepartmentService
;
import
com.gic.haoban.manage.service.service.DepartmentService
;
@Service
@Service
public
class
DepartmentServiceImpl
implements
DepartmentService
{
public
class
DepartmentServiceImpl
implements
DepartmentService
{
@Autowired
private
DepartmentMapper
mapper
;
@Override
public
List
<
TabHaobanDepartment
>
listByParentId
(
String
parentId
)
{
return
mapper
.
listByParentId
(
parentId
);
}
@Override
public
TabHaobanDepartment
selectById
(
String
departmentId
)
{
return
mapper
.
selectByPrimaryKey
(
departmentId
);
}
@Override
public
String
add
(
DepartmentDTO
department
)
{
Date
now
=
new
Date
();
TabHaobanDepartment
tab
=
EntityUtil
.
changeEntityByJSON
(
TabHaobanDepartment
.
class
,
department
);
tab
.
setCreateTime
(
now
);
tab
.
setUpdateTime
(
now
);
tab
.
setStatusFlag
(
1
);
tab
.
setDepartmentId
(
StringUtil
.
randomUUID
());
mapper
.
insert
(
tab
);
return
tab
.
getDepartmentId
();
}
@Override
public
void
edit
(
DepartmentDTO
department
)
{
Date
now
=
new
Date
();
TabHaobanDepartment
tab
=
EntityUtil
.
changeEntityByJSON
(
TabHaobanDepartment
.
class
,
department
);
tab
.
setUpdateTime
(
now
);
mapper
.
updateByPrimaryKeySelective
(
tab
);
}
@Override
public
void
del
(
String
departmentId
)
{
mapper
.
deleteByPrimaryKey
(
departmentId
);
}
}
}
haoban-manage3-service/src/main/resources/mapper/DepartmentMapper.xml
View file @
0b8225c2
...
@@ -12,10 +12,11 @@
...
@@ -12,10 +12,11 @@
<result
column=
"recycle_flag"
property=
"recycleFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"recycle_flag"
property=
"recycleFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"wx_department_id"
property=
"wxDepartmentId"
jdbcType=
"VARCHAR"
/>
</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
status_flag, recycle_flag, create_time, update_time
,wx_department_id
</sql>
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
select
...
@@ -31,11 +32,11 @@
...
@@ -31,11 +32,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)
update_time
,wx_department_id
)
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})
#{updateTime,jdbcType=TIMESTAMP}
,#{wxDepartmentId}
)
</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
...
@@ -70,6 +71,9 @@
...
@@ -70,6 +71,9 @@
<if
test=
"updateTime != null"
>
<if
test=
"updateTime != null"
>
update_time,
update_time,
</if>
</if>
<if
test=
"wxDepartmentId != null"
>
wx_department_id,
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"departmentId != null"
>
<if
test=
"departmentId != null"
>
...
@@ -102,6 +106,9 @@
...
@@ -102,6 +106,9 @@
<if
test=
"updateTime != null"
>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},
</if>
</if>
<if
test=
"wxDepartmentId != null"
>
#{wxDepartmentId},
</if>
</trim>
</trim>
</insert>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanDepartment"
>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanDepartment"
>
...
@@ -134,6 +141,9 @@
...
@@ -134,6 +141,9 @@
<if
test=
"updateTime != null"
>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</if>
<if
test=
"wxDepartmentId != null"
>
wx_department_id = #{wxDepartmentId,jdbcType=VARCHAR},
</if>
</set>
</set>
where department_id = #{departmentId,jdbcType=VARCHAR}
where department_id = #{departmentId,jdbcType=VARCHAR}
</update>
</update>
...
@@ -143,6 +153,7 @@
...
@@ -143,6 +153,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},
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},
recycle_flag = #{recycleFlag,jdbcType=INTEGER},
recycle_flag = #{recycleFlag,jdbcType=INTEGER},
...
@@ -150,4 +161,12 @@
...
@@ -150,4 +161,12 @@
update_time = #{updateTime,jdbcType=TIMESTAMP}
update_time = #{updateTime,jdbcType=TIMESTAMP}
where department_id = #{departmentId,jdbcType=VARCHAR}
where department_id = #{departmentId,jdbcType=VARCHAR}
</update>
</update>
<select
id=
"listByParentId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_department
where parent_department_id = #{parentId,jdbcType=VARCHAR}
and status_flag = 1
</select>
</mapper>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/DepartmentContoller.java
0 → 100644
View file @
0b8225c2
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.haoban.base.api.common.Constant
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
@RestController
public
class
DepartmentContoller
extends
WebBaseController
{
@Autowired
private
DepartmentApiService
departmentApiService
;
@RequestMapping
(
"department-list"
)
public
HaobanResponse
departmentList
(
String
parentId
)
{
List
<
DepartmentDTO
>
list
=
departmentApiService
.
listByParentId
(
parentId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
}
@RequestMapping
(
"department-add"
)
public
HaobanResponse
departmentAdd
(
String
parentId
,
String
departmentName
)
{
DepartmentDTO
dto
=
departmentApiService
.
selectById
(
parentId
);
if
(
dto
==
null
||
dto
.
getStatusFlag
()
==
0
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10001
);
}
if
(
dto
.
getIsStore
()
==
1
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10002
);
}
DepartmentDTO
department
=
new
DepartmentDTO
();
department
.
setParentDepartmentId
(
parentId
);
department
.
setDepartmentName
(
departmentName
);
department
.
setChainId
(
dto
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
dto
.
getDepartmentId
());
department
.
setIsStore
(
0
);
departmentApiService
.
add
(
department
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
@RequestMapping
(
"department-edit"
)
public
HaobanResponse
departmentEdit
(
String
departmentId
,
String
departmentName
)
{
DepartmentDTO
dto
=
departmentApiService
.
selectById
(
departmentId
);
if
(
dto
==
null
||
dto
.
getStatusFlag
()
==
0
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10001
);
}
dto
.
setDepartmentName
(
dto
.
getDepartmentName
());
departmentApiService
.
edit
(
dto
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
@RequestMapping
(
"department-sel"
)
public
HaobanResponse
departmentSel
(
String
departmentId
)
{
DepartmentDTO
dto
=
departmentApiService
.
selectById
(
departmentId
);
if
(
dto
==
null
||
dto
.
getStatusFlag
()
==
0
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10003
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
dto
);
}
@RequestMapping
(
"department-del"
)
public
HaobanResponse
departmentDel
(
String
departmentId
)
{
DepartmentDTO
dto
=
departmentApiService
.
selectById
(
departmentId
);
if
(
dto
==
null
||
dto
.
getStatusFlag
()
==
0
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10003
);
}
departmentApiService
.
del
(
departmentId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
View file @
0b8225c2
...
@@ -61,114 +61,10 @@ public enum HaoBanErrCode {
...
@@ -61,114 +61,10 @@ public enum HaoBanErrCode {
*/
*/
ERR_12
(
12
,
"验证码校验失败"
),
ERR_12
(
12
,
"验证码校验失败"
),
/**
ERR_10001
(
10001
,
"父部门不存在"
),
* 员工档案模块
ERR_10002
(
10002
,
"门店类型部门不能新增子节点"
),
*/
ERR_10003
(
10003
,
"部门不存在"
),
ERR_400001
(
400001
,
"通讯录中不存在"
),
ERR_400002
(
400002
,
"企业不存在"
),
ERR_400003
(
400003
,
"品牌不存在"
),
ERR_400004
(
400004
,
"excel文件格式有问题"
),
ERR_400005
(
400005
,
"选择文件错误"
),
ERR_400006
(
400006
,
"模板内容为空"
),
ERR_400007
(
400007
,
"总列数与模板不一致"
),
ERR_400008
(
400008
,
"导入的title跟模板title描述不匹配"
),
ERR_400009
(
400009
,
"共享企业或取得共享企业已达最大数量"
),
ERR_400010
(
400010
,
"不是该企业无权限添加"
),
ERR_400011
(
400011
,
"添加共享企业重复"
),
ERR_400012
(
400012
,
"员工档案不存在"
),
ERR_400013
(
400013
,
"没有查看共享通讯录的权限"
),
ERR_400014
(
400014
,
"仅支持认证企业建立企业通讯录共享"
),
ERR_400015
(
400015
,
"数据为空"
),
ERR_400016
(
400016
,
"提交人不存在"
),
/**
* 文件不存在
*/
ERR_20001
(
201
,
"文件不存在"
),
/**
* 文件格式错误
*/
ERR_20002
(
202
,
"文件格式错误"
),
/**
* 文件读取失败
*/
ERR_20003
(
203
,
"文件读取失败"
),
/**
* 文件列数错误
*/
ERR_20004
(
204
,
"文件列数错误"
),
//登录权限
ERR_30001
(
30001
,
"请添加权限"
),
ERR_30002
(
30002
,
"二维码超时,请刷新二维码"
),
ERR_30003
(
30003
,
"您没有管理员权限"
),
ERR_30004
(
30004
,
"登录超时,请重新登录"
),
ERR_30005
(
30005
,
"用户不存在"
),
ERR_30006
(
30006
,
"用户名或密码错误"
),
ERR_30007
(
30007
,
"未设置密码,请先设置密码"
),
ERR_30008
(
30008
,
"超级管理员不存在"
),
//角色
ERR_40001
(
40001
,
"角色异常"
),
ERR_500002
(
500002
,
"角色下存在管理员,请移除管理员!"
),
/**
* 办理离职
*/
ERR_100001
(
100001
,
"办理离职成功"
),
ERR_100002
(
100002
,
"正在等待审核"
),
ERR_100003
(
100003
,
"办理转正成功"
),
ERR_100004
(
100004
,
"已经离职"
),
ERR_100005
(
100005
,
"已经转正"
),
ERR_100006
(
100006
,
"店长不能办理离职"
),
ERR_100007
(
100007
,
"管理员不能办理离职"
),
ERR_100008
(
100008
,
"与gic关联不能办理离职"
),
/**
* 通讯录模块
*/
ERR_111111
(
111111
,
"用户已存在"
),
ERR_111112
(
111112
,
"层级不能超过6"
),
ERR_111113
(
111113
,
"店铺已存在"
),
ERR_111114
(
111114
,
"该员工已在行政架构下"
),
ERR_111115
(
1111115
,
"该员工已在门店架构下"
),
ERR_111116
(
111116
,
"code不能为空"
),
ERR_111117
(
111117
,
"code已存在"
),
ERR_111118
(
111118
,
"部门不能为空"
),
ERR_111119
(
111119
,
"门店不能为空"
),
ERR_111120
(
111120
,
"手机不能为空"
),
ERR_111121
(
111121
,
"姓名不能为空"
),
ERR_111122
(
111122
,
"门店名称不能为空"
),
ERR_111123
(
111123
,
"店长名称不能为空"
),
ERR_111124
(
111124
,
"店长电话不能为空"
),
ERR_111125
(
111125
,
"门店编号不能为空"
),
ERR_111126
(
111126
,
"门店编号已存在"
),
ERR_111127
(
111127
,
"该部门下存在部门不让删除"
),
ERR_111128
(
111128
,
"该部门下存在店铺不让删除"
),
ERR_111129
(
111129
,
"该部门下存在人员不让删除"
),
ERR_111130
(
111130
,
"品牌不能修改"
),
ERR_111131
(
111131
,
"店长不能删除"
),
ERR_111132
(
111132
,
"管理员不能删除"
),
ERR_111133
(
111133
,
"品牌名称不能重复"
),
ERR_111134
(
111134
,
"未认证企业只能导入30家门店"
),
ERR_111135
(
111135
,
"未认证企业只能导入200个用户"
),
ERR_111136
(
111136
,
"部门名称不能重复"
),
ERR_111137
(
111137
,
"其他管理员正在导入"
),
ERR_111138
(
111138
,
"企业每次最多只能导入800个用户"
),
ERR_111139
(
111134
,
"未认证企业只能导入200家门店"
),
ERR_111140
(
111140
,
"已经与gic关联,无法操作"
),
ERR_111141
(
111141
,
"门店面积不能超过999999"
),
ERR_111142
(
111142
,
"品牌不能为空"
),
ERR_111143
(
111143
,
"code或者手机号码已存在"
),
ERR_111144
(
111144
,
"该企业或品牌已关联"
),
// 企业设置
ERR_200001
(
200001
,
"员工不存在"
),
ERR_200002
(
200002
,
"非当前登录企业员工"
),
ERR_500001
(
500001
,
"该企业没关联好办"
),
ERR_DEFINE
(-
888
,
"自定义错误"
),
ERR_DEFINE
(-
888
,
"自定义错误"
),
ERR_OTHER
(-
999
,
"未知错误code"
);
ERR_OTHER
(-
999
,
"未知错误code"
);
private
int
code
;
private
int
code
;
...
...
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