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
8c41a1c3
Commit
8c41a1c3
authored
Feb 13, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
aadae5b5
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
195 additions
and
4 deletions
+195
-4
StaffDTO.java
...src/main/java/com/gic/haoban/manage/api/dto/StaffDTO.java
+45
-1
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+5
-0
StaffMapper.java
...com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
+3
-0
TabHaobanStaff.java
.../com/gic/haoban/manage/service/entity/TabHaobanStaff.java
+13
-0
StaffService.java
...a/com/gic/haoban/manage/service/service/StaffService.java
+4
-0
StaffServiceImpl.java
.../haoban/manage/service/service/impl/StaffServiceImpl.java
+18
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+17
-0
DepartmentMapper.xml
...e3-service/src/main/resources/mapper/DepartmentMapper.xml
+21
-0
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+25
-3
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+40
-0
HaoBanErrCode.java
...java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
+4
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/StaffDTO.java
View file @
8c41a1c3
...
@@ -6,6 +6,8 @@ import java.util.Date;
...
@@ -6,6 +6,8 @@ import java.util.Date;
public
class
StaffDTO
implements
Serializable
{
public
class
StaffDTO
implements
Serializable
{
private
String
staffId
;
private
String
staffId
;
private
String
wxEnterpriseId
;
private
String
wxUserId
;
private
String
wxUserId
;
...
@@ -40,8 +42,50 @@ public class StaffDTO implements Serializable{
...
@@ -40,8 +42,50 @@ public class StaffDTO implements Serializable{
public
void
setStaffId
(
String
staffId
)
{
public
void
setStaffId
(
String
staffId
)
{
this
.
staffId
=
staffId
==
null
?
null
:
staffId
.
trim
();
this
.
staffId
=
staffId
==
null
?
null
:
staffId
.
trim
();
}
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getExtendPostion
()
{
return
extendPostion
;
}
public
void
setExtendPostion
(
String
extendPostion
)
{
this
.
extendPostion
=
extendPostion
;
}
public
Integer
getStatusFlag
()
{
return
statusFlag
;
}
public
void
setStatusFlag
(
Integer
statusFlag
)
{
this
.
statusFlag
=
statusFlag
;
}
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
getWxUserId
()
{
public
String
getWxUserId
()
{
return
wxUserId
;
return
wxUserId
;
}
}
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
8c41a1c3
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
public
interface
StaffApiService
{
public
interface
StaffApiService
{
public
StaffDTO
selectById
(
String
staffId
);
public
StaffDTO
selectById
(
String
staffId
);
public
StaffDTO
selectByNationcodeAndPhoneNumber
(
String
wxEnterpriseId
,
String
nationcode
,
String
phoneNumber
);
public
HaobanResponse
add
(
StaffDTO
staff
,
String
departmentIds
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
View file @
8c41a1c3
...
@@ -14,4 +14,6 @@ public interface StaffMapper {
...
@@ -14,4 +14,6 @@ public interface StaffMapper {
int
updateByPrimaryKeySelective
(
TabHaobanStaff
record
);
int
updateByPrimaryKeySelective
(
TabHaobanStaff
record
);
int
updateByPrimaryKey
(
TabHaobanStaff
record
);
int
updateByPrimaryKey
(
TabHaobanStaff
record
);
TabHaobanStaff
selectByNationcodeAndPhoneNumber
(
String
wxEnterpriseId
,
String
nationcode
,
String
phoneNumber
);
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanStaff.java
View file @
8c41a1c3
...
@@ -17,6 +17,8 @@ public class TabHaobanStaff implements Serializable {
...
@@ -17,6 +17,8 @@ public class TabHaobanStaff implements Serializable {
private
String
nickName
;
private
String
nickName
;
private
Integer
sex
;
private
Integer
sex
;
private
String
wxEnterpriseId
;
private
String
postion
;
private
String
postion
;
...
@@ -135,4 +137,14 @@ public class TabHaobanStaff implements Serializable {
...
@@ -135,4 +137,14 @@ public class TabHaobanStaff implements Serializable {
public
void
setUpdateTime
(
Date
updateTime
)
{
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
this
.
updateTime
=
updateTime
;
}
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffService.java
View file @
8c41a1c3
...
@@ -6,4 +6,8 @@ public interface StaffService {
...
@@ -6,4 +6,8 @@ public interface StaffService {
TabHaobanStaff
selectById
(
String
staffId
);
TabHaobanStaff
selectById
(
String
staffId
);
TabHaobanStaff
selectByNationcodeAndPhoneNumber
(
String
wxEnterpriseId
,
String
nationcode
,
String
phoneNumber
);
String
add
(
TabHaobanStaff
tab
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffServiceImpl.java
View file @
8c41a1c3
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
import
java.util.Date
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.gic.haoban.common.utils.StringUtil
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.service.StaffService
;
import
com.gic.haoban.manage.service.service.StaffService
;
...
@@ -19,4 +22,19 @@ public class StaffServiceImpl implements StaffService {
...
@@ -19,4 +22,19 @@ public class StaffServiceImpl implements StaffService {
return
mapper
.
selectByPrimaryKey
(
id
);
return
mapper
.
selectByPrimaryKey
(
id
);
}
}
@Override
public
TabHaobanStaff
selectByNationcodeAndPhoneNumber
(
String
wxEnterpriseId
,
String
nationcode
,
String
phoneNumber
)
{
return
mapper
.
selectByNationcodeAndPhoneNumber
(
wxEnterpriseId
,
nationcode
,
phoneNumber
);
}
@Override
public
String
add
(
TabHaobanStaff
tab
)
{
Date
now
=
new
Date
();
tab
.
setCreateTime
(
now
);
tab
.
setUpdateTime
(
now
);
tab
.
setStaffId
(
StringUtil
.
randomUUID
());
tab
.
setStatusFlag
(
1
);
return
tab
.
getStaffId
();
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
8c41a1c3
...
@@ -4,6 +4,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -4,6 +4,7 @@ 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.commons.util.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
...
@@ -21,4 +22,20 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -21,4 +22,20 @@ public class StaffApiServiceImpl implements StaffApiService {
return
EntityUtil
.
changeEntityByJSON
(
StaffDTO
.
class
,
staff
);
return
EntityUtil
.
changeEntityByJSON
(
StaffDTO
.
class
,
staff
);
}
}
@Override
public
StaffDTO
selectByNationcodeAndPhoneNumber
(
String
wxEnterpriseId
,
String
nationcode
,
String
phoneNumber
)
{
TabHaobanStaff
staff
=
staffService
.
selectByNationcodeAndPhoneNumber
(
wxEnterpriseId
,
nationcode
,
phoneNumber
);
return
EntityUtil
.
changeEntityByJSON
(
StaffDTO
.
class
,
staff
);
}
@Override
public
HaobanResponse
add
(
StaffDTO
staff
,
String
departmentIds
)
{
Integer
activeFlag
=
staff
.
getActiveFlag
();
TabHaobanStaff
tab
=
EntityUtil
.
changeEntityByJSON
(
TabHaobanStaff
.
class
,
staff
);
String
staffId
=
staffService
.
add
(
tab
);
return
null
;
}
}
}
haoban-manage3-service/src/main/resources/mapper/DepartmentMapper.xml
View file @
8c41a1c3
...
@@ -213,4 +213,24 @@
...
@@ -213,4 +213,24 @@
where related_id = #{relatedId,jdbcType=VARCHAR}
where related_id = #{relatedId,jdbcType=VARCHAR}
and status_flag = 1
and status_flag = 1
</select>
</select>
<select
id=
"pageDepartmentByParams"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_department
where status_flag = 1
<if
test=
"wxEnterpriseId != null and wxEnterpriseId != ''"
>
and wx_enterprise_id = #{wxEnterpriseId}
</if>
<if
test=
"keyword != null and keyword != ''"
>
and department_name like CONCAT('%',#{keyWord},'%')
</if>
<if
test=
"recycleFlag != null"
>
and recycle_flag = #{recycleFlag}
</if>
<if
test=
"storeFlag != null"
>
and is_store = #{storeFlag}
</if>
</select>
</mapper>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
8c41a1c3
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
<resultMap
id=
"BaseResultMap"
type=
"com.gic.haoban.manage.service.entity.TabHaobanStaff"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.haoban.manage.service.entity.TabHaobanStaff"
>
<id
column=
"staff_id"
property=
"staffId"
jdbcType=
"VARCHAR"
/>
<id
column=
"staff_id"
property=
"staffId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_user_id"
property=
"wxUserId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_user_id"
property=
"wxUserId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_enterprise_id"
property=
"wxEnterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"phone_number"
property=
"phoneNumber"
jdbcType=
"VARCHAR"
/>
<result
column=
"phone_number"
property=
"phoneNumber"
jdbcType=
"VARCHAR"
/>
<result
column=
"staff_name"
property=
"staffName"
jdbcType=
"VARCHAR"
/>
<result
column=
"staff_name"
property=
"staffName"
jdbcType=
"VARCHAR"
/>
<result
column=
"nation_code"
property=
"nationCode"
jdbcType=
"VARCHAR"
/>
<result
column=
"nation_code"
property=
"nationCode"
jdbcType=
"VARCHAR"
/>
...
@@ -18,7 +19,7 @@
...
@@ -18,7 +19,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
active_flag, extend_postion, status_flag, create_time, update_time
,wx_enterprise_id
</sql>
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
select
...
@@ -35,12 +36,12 @@
...
@@ -35,12 +36,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)
update_time
,wx_enterprise_id
)
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})
#{updateTime,jdbcType=TIMESTAMP}
,#{wxEnterpriseId}
)
</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
...
@@ -51,6 +52,9 @@
...
@@ -51,6 +52,9 @@
<if
test=
"wxUserId != null"
>
<if
test=
"wxUserId != null"
>
wx_user_id,
wx_user_id,
</if>
</if>
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id,
</if>
<if
test=
"phoneNumber != null"
>
<if
test=
"phoneNumber != null"
>
phone_number,
phone_number,
</if>
</if>
...
@@ -92,6 +96,9 @@
...
@@ -92,6 +96,9 @@
<if
test=
"wxUserId != null"
>
<if
test=
"wxUserId != null"
>
#{wxUserId,jdbcType=VARCHAR},
#{wxUserId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"wxEnterpriseId != null"
>
#{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"phoneNumber != null"
>
<if
test=
"phoneNumber != null"
>
#{phoneNumber,jdbcType=VARCHAR},
#{phoneNumber,jdbcType=VARCHAR},
</if>
</if>
...
@@ -133,6 +140,9 @@
...
@@ -133,6 +140,9 @@
<if
test=
"wxUserId != null"
>
<if
test=
"wxUserId != null"
>
wx_user_id = #{wxUserId,jdbcType=VARCHAR},
wx_user_id = #{wxUserId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"phoneNumber != null"
>
<if
test=
"phoneNumber != null"
>
phone_number = #{phoneNumber,jdbcType=VARCHAR},
phone_number = #{phoneNumber,jdbcType=VARCHAR},
</if>
</if>
...
@@ -172,6 +182,7 @@
...
@@ -172,6 +182,7 @@
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanStaff"
>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanStaff"
>
update tab_haoban_staff
update tab_haoban_staff
set wx_user_id = #{wxUserId,jdbcType=VARCHAR},
set wx_user_id = #{wxUserId,jdbcType=VARCHAR},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
phone_number = #{phoneNumber,jdbcType=VARCHAR},
phone_number = #{phoneNumber,jdbcType=VARCHAR},
staff_name = #{staffName,jdbcType=VARCHAR},
staff_name = #{staffName,jdbcType=VARCHAR},
nation_code = #{nationCode,jdbcType=VARCHAR},
nation_code = #{nationCode,jdbcType=VARCHAR},
...
@@ -185,4 +196,14 @@
...
@@ -185,4 +196,14 @@
update_time = #{updateTime,jdbcType=TIMESTAMP}
update_time = #{updateTime,jdbcType=TIMESTAMP}
where staff_id = #{staffId,jdbcType=VARCHAR}
where staff_id = #{staffId,jdbcType=VARCHAR}
</update>
</update>
<select
id=
"selectByNationcodeAndPhoneNumber"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_staff
where nation_code = #{nationCode}
and phone_number = #{phoneNumber}
and wx_enterprise_id = #{wxEnterpriseId}
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/StaffController.java
0 → 100644
View file @
8c41a1c3
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
org.apache.commons.lang3.StringUtils
;
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.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.vo.LoginVO
;
@RestController
public
class
StaffController
extends
WebBaseController
{
@Autowired
private
StaffApiService
staffApiService
;
@RequestMapping
(
"staff-add"
)
public
HaobanResponse
staffAdd
(
StaffDTO
staffDTO
,
String
departmentIds
){
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getAppLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
staffName
=
staffDTO
.
getStaffName
();
String
phoneNumber
=
staffDTO
.
getPhoneNumber
();
String
nationcode
=
staffDTO
.
getNationCode
();
if
(
StringUtils
.
isBlank
(
staffName
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10004
);
}
StaffDTO
staff
=
staffApiService
.
selectByNationcodeAndPhoneNumber
(
wxEnterpriseId
,
nationcode
,
phoneNumber
);
if
(
staff
!=
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10005
);
}
HaobanResponse
hr
=
staffApiService
.
add
(
staff
,
departmentIds
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
View file @
8c41a1c3
...
@@ -64,6 +64,10 @@ public enum HaoBanErrCode {
...
@@ -64,6 +64,10 @@ public enum HaoBanErrCode {
ERR_10001
(
10001
,
"父部门不存在"
),
ERR_10001
(
10001
,
"父部门不存在"
),
ERR_10002
(
10002
,
"门店类型部门不能新增子节点"
),
ERR_10002
(
10002
,
"门店类型部门不能新增子节点"
),
ERR_10003
(
10003
,
"部门不存在"
),
ERR_10003
(
10003
,
"部门不存在"
),
ERR_10004
(
10004
,
"成员名称不能为空"
),
ERR_10005
(
10005
,
"成员已存在"
),
ERR_DEFINE
(-
888
,
"自定义错误"
),
ERR_DEFINE
(-
888
,
"自定义错误"
),
ERR_OTHER
(-
999
,
"未知错误code"
);
ERR_OTHER
(-
999
,
"未知错误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