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
6d5c9477
Commit
6d5c9477
authored
Feb 14, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
8c41a1c3
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
103 additions
and
5 deletions
+103
-5
StaffDTO.java
...src/main/java/com/gic/haoban/manage/api/dto/StaffDTO.java
+20
-0
TabHaobanStaffDepartmentRelated.java
...anage/service/entity/TabHaobanStaffDepartmentRelated.java
+13
-0
StaffDepartmentRelatedService.java
...manage/service/service/StaffDepartmentRelatedService.java
+3
-0
StaffDepartmentRelatedServiceImpl.java
...rvice/service/impl/StaffDepartmentRelatedServiceImpl.java
+18
-1
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+27
-1
StaffDepartmentRelatedMapper.xml
...rc/main/resources/mapper/StaffDepartmentRelatedMapper.xml
+14
-3
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+8
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/StaffDTO.java
View file @
6d5c9477
...
...
@@ -32,6 +32,10 @@ public class StaffDTO implements Serializable{
private
Date
createTime
;
private
Date
updateTime
;
private
String
departmentIds
;
private
String
headImg
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -149,5 +153,21 @@ public class StaffDTO implements Serializable{
this
.
activeFlag
=
activeFlag
;
}
public
String
getDepartmentIds
()
{
return
departmentIds
;
}
public
void
setDepartmentIds
(
String
departmentIds
)
{
this
.
departmentIds
=
departmentIds
;
}
public
String
getHeadImg
()
{
return
headImg
;
}
public
void
setHeadImg
(
String
headImg
)
{
this
.
headImg
=
headImg
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanStaffDepartmentRelated.java
View file @
6d5c9477
...
...
@@ -23,6 +23,8 @@ public class TabHaobanStaffDepartmentRelated implements Serializable {
private
Date
createTime
;
private
Date
updateTime
;
private
String
headImg
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -105,4 +107,14 @@ public class TabHaobanStaffDepartmentRelated implements Serializable {
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
String
getHeadImg
()
{
return
headImg
;
}
public
void
setHeadImg
(
String
headImg
)
{
this
.
headImg
=
headImg
;
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffDepartmentRelatedService.java
View file @
6d5c9477
...
...
@@ -2,10 +2,13 @@ package com.gic.haoban.manage.service.service;
import
java.util.List
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated
;
public
interface
StaffDepartmentRelatedService
{
List
<
TabHaobanStaffDepartmentRelated
>
listByDepartmentId
(
String
departmentId
);
String
add
(
StaffDepartmentRelatedDTO
related
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffDepartmentRelatedServiceImpl.java
View file @
6d5c9477
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
import
java.util.Date
;
import
java.util.List
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated
;
import
com.gic.haoban.manage.service.service.StaffDepartmentRelatedService
;
...
...
@@ -22,4 +26,17 @@ public class StaffDepartmentRelatedServiceImpl implements StaffDepartmentRelated
return
mapper
.
listByDepartmentId
(
departmentId
);
}
@Override
public
String
add
(
StaffDepartmentRelatedDTO
related
)
{
Date
now
=
new
Date
();
related
.
setCreateTime
(
now
);
related
.
setUpdateTime
(
now
);
related
.
setStatusFlag
(
1
);
related
.
setStaffDepartmentRelatedId
(
StringUtil
.
randomUUID
());
TabHaobanStaffDepartmentRelated
tab
=
EntityUtil
.
changeEntityByJSON
(
TabHaobanStaffDepartmentRelated
.
class
,
related
);
mapper
.
insert
(
tab
);
return
related
.
getStaffDepartmentRelatedId
();
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
6d5c9477
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
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.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.service.StaffDepartmentRelatedService
;
import
com.gic.haoban.manage.service.service.StaffService
;
@Service
...
...
@@ -15,6 +18,9 @@ public class StaffApiServiceImpl implements StaffApiService {
@Autowired
StaffService
staffService
;
@Autowired
StaffDepartmentRelatedService
staffDepartmentRelatedService
;
@Override
public
StaffDTO
selectById
(
String
staffId
)
{
...
...
@@ -30,12 +36,32 @@ public class StaffApiServiceImpl implements StaffApiService {
@Override
public
HaobanResponse
add
(
StaffDTO
staff
,
String
departmentIds
)
{
HaobanResponse
hr
=
new
HaobanResponse
();
hr
.
setErrorCode
(
1
);
Integer
activeFlag
=
staff
.
getActiveFlag
();
TabHaobanStaff
tab
=
EntityUtil
.
changeEntityByJSON
(
TabHaobanStaff
.
class
,
staff
);
String
staffId
=
staffService
.
add
(
tab
);
//调接口获取
String
wxUserId
=
""
;
if
(
StringUtils
.
isNotBlank
(
wxUserId
)){
String
[]
departmentIdArr
=
departmentIds
.
split
(
","
);
for
(
String
string
:
departmentIdArr
)
{
StaffDepartmentRelatedDTO
related
=
new
StaffDepartmentRelatedDTO
();
related
.
setDepartmentId
(
string
);
related
.
setNationCode
(
staff
.
getNationCode
());
related
.
setPhoneNumber
(
staff
.
getPhoneNumber
());
related
.
setStaffId
(
staffId
);
related
.
setWxUserId
(
wxUserId
);
staffDepartmentRelatedService
.
add
(
related
);
}
}
else
{
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信端新增失败"
);
}
return
null
;
return
hr
;
}
}
haoban-manage3-service/src/main/resources/mapper/StaffDepartmentRelatedMapper.xml
View file @
6d5c9477
...
...
@@ -10,12 +10,13 @@
<result
column=
"department_id"
property=
"departmentId"
jdbcType=
"VARCHAR"
/>
<result
column=
"status_flag"
property=
"statusFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"clerk_code"
property=
"clerkCode"
jdbcType=
"VARCHAR"
/>
<result
column=
"head_img"
property=
"clerkCode"
jdbcType=
"headImg"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
staff_department_related_id, staff_id, phone_number, nation_code, wx_user_id, department_id,
status_flag, clerk_code, create_time, update_time
status_flag, clerk_code, create_time, update_time
,head_img
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
...
...
@@ -31,11 +32,11 @@
insert into tab_haoban_staff_department_related (staff_department_related_id, staff_id,
phone_number, nation_code, wx_user_id,
department_id, status_flag, clerk_code,
create_time, update_time)
create_time, update_time
,head_img
)
values (#{staffDepartmentRelatedId,jdbcType=VARCHAR}, #{staffId,jdbcType=VARCHAR},
#{phoneNumber,jdbcType=VARCHAR}, #{nationCode,jdbcType=VARCHAR}, #{wxUserId,jdbcType=VARCHAR},
#{departmentId,jdbcType=VARCHAR}, #{statusFlag,jdbcType=INTEGER}, #{clerkCode,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
,#{headImg}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated"
>
insert into tab_haoban_staff_department_related
...
...
@@ -70,6 +71,9 @@
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"headImg != null"
>
head_img,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"staffDepartmentRelatedId != null"
>
...
...
@@ -102,6 +106,9 @@
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"headImg != null"
>
#{headImg,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated"
>
...
...
@@ -134,6 +141,9 @@
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"headImg != null"
>
head_img = #{headImg,jdbcType=VARCHAR},
</if>
</set>
where staff_department_related_id = #{staffDepartmentRelatedId,jdbcType=VARCHAR}
</update>
...
...
@@ -146,6 +156,7 @@
department_id = #{departmentId,jdbcType=VARCHAR},
status_flag = #{statusFlag,jdbcType=INTEGER},
clerk_code = #{clerkCode,jdbcType=VARCHAR},
head_img = #{headImg,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where staff_department_related_id = #{staffDepartmentRelatedId,jdbcType=VARCHAR}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
6d5c9477
...
...
@@ -33,8 +33,16 @@ public class StaffController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_10005
);
}
HaobanResponse
hr
=
staffApiService
.
add
(
staff
,
departmentIds
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
@RequestMapping
(
"staff-sel"
)
public
HaobanResponse
staffSel
(
String
staffId
,
String
staffDepartmentRelatedId
){
StaffDTO
staff
=
staffApiService
.
selectById
(
staffId
);
// HaobanResponse hr = staffApiService.add(staff,departmentIds);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
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