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
fd178bdd
Commit
fd178bdd
authored
Feb 14, 2020
by
huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
39fc1461
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
102 additions
and
2 deletions
+102
-2
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+3
-0
StaffMapper.java
...com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
+5
-1
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+18
-1
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+14
-0
ClerkController.java
...com/gic/haoban/manage/web/controller/ClerkController.java
+49
-0
ClerkController.java
...com/gic/haoban/manage/web/controller/ClerkController.java
+13
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
fd178bdd
...
@@ -11,7 +11,10 @@ import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
...
@@ -11,7 +11,10 @@ import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
public
interface
StaffApiService
{
public
interface
StaffApiService
{
public
StaffDTO
selectById
(
String
staffId
);
public
StaffDTO
selectById
(
String
staffId
);
public
List
<
StaffDTO
>
listByIds
(
List
<
String
>
staffIds
);
public
StaffDTO
selectByNationcodeAndPhoneNumber
(
String
wxEnterpriseId
,
String
nationcode
,
String
phoneNumber
);
public
StaffDTO
selectByNationcodeAndPhoneNumber
(
String
wxEnterpriseId
,
String
nationcode
,
String
phoneNumber
);
public
HaobanResponse
add
(
StaffDTO
staff
,
String
departmentIds
);
public
HaobanResponse
add
(
StaffDTO
staff
,
String
departmentIds
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
View file @
fd178bdd
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Set
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
@@ -21,6 +22,8 @@ public interface StaffMapper {
...
@@ -21,6 +22,8 @@ public interface StaffMapper {
int
updateByPrimaryKey
(
TabHaobanStaff
record
);
int
updateByPrimaryKey
(
TabHaobanStaff
record
);
TabHaobanStaff
selectByNationcodeAndPhoneNumber
(
String
wxEnterpriseId
,
String
nationcode
,
String
phoneNumber
);
TabHaobanStaff
selectByNationcodeAndPhoneNumber
(
String
wxEnterpriseId
,
String
nationcode
,
String
phoneNumber
);
List
<
TabHaobanStaff
>
listByIds
(
@Param
(
"staffIds"
)
List
<
String
>
staffIds
);
Page
<
TabHaobanStaff
>
pageStaff
(
@Param
(
"staffIds"
)
Set
<
String
>
staffIds
,
@Param
(
"activeFlag"
)
Integer
activeFlag
,
@Param
(
"keyword"
)
String
keyword
);
Page
<
TabHaobanStaff
>
pageStaff
(
@Param
(
"staffIds"
)
Set
<
String
>
staffIds
,
@Param
(
"activeFlag"
)
Integer
activeFlag
,
@Param
(
"keyword"
)
String
keyword
);
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
fd178bdd
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
java.util.ArrayList
;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Set
;
...
@@ -8,6 +9,8 @@ import org.apache.commons.lang.StringUtils;
...
@@ -8,6 +9,8 @@ import org.apache.commons.lang.StringUtils;
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
cn.hutool.core.collection.CollectionUtil
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
...
@@ -17,6 +20,7 @@ import com.gic.haoban.manage.api.dto.DepartmentDTO;
...
@@ -17,6 +20,7 @@ import com.gic.haoban.manage.api.dto.DepartmentDTO;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
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.entity.TabHaobanStaffDepartmentRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated
;
import
com.gic.haoban.manage.service.service.StaffDepartmentRelatedService
;
import
com.gic.haoban.manage.service.service.StaffDepartmentRelatedService
;
...
@@ -28,7 +32,8 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -28,7 +32,8 @@ public class StaffApiServiceImpl implements StaffApiService {
@Autowired
@Autowired
StaffService
staffService
;
StaffService
staffService
;
@Autowired
StaffMapper
staffMapper
;
@Autowired
@Autowired
StaffDepartmentRelatedService
staffDepartmentRelatedService
;
StaffDepartmentRelatedService
staffDepartmentRelatedService
;
...
@@ -92,4 +97,16 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -92,4 +97,16 @@ public class StaffApiServiceImpl implements StaffApiService {
return
PageUtil
.
changePageHelperToCurrentPage
(
staffService
.
pageStaff
(
staffIds
,
activeFlag
,
keyword
),
StaffDTO
.
class
);
return
PageUtil
.
changePageHelperToCurrentPage
(
staffService
.
pageStaff
(
staffIds
,
activeFlag
,
keyword
),
StaffDTO
.
class
);
}
}
@Override
public
List
<
StaffDTO
>
listByIds
(
List
<
String
>
staffIds
)
{
List
<
TabHaobanStaff
>
staffs
=
staffMapper
.
listByIds
(
staffIds
);
if
(
CollectionUtil
.
isNotEmpty
(
staffs
)){
List
<
StaffDTO
>
resultList
=
EntityUtil
.
changeEntityListByJSON
(
StaffDTO
.
class
,
staffs
);
return
resultList
;
}
else
{
return
new
ArrayList
<
StaffDTO
>();
}
}
}
}
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
fd178bdd
...
@@ -225,4 +225,17 @@
...
@@ -225,4 +225,17 @@
</foreach>
</foreach>
</if>
</if>
</select>
</select>
<select
id=
"listByIds"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_staff
where status_flag = 1
<if
test=
"staffIds != null and staffIds.size() > 0"
>
and staff_id IN
<foreach
collection=
"staffIds"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id,jdbcType=VARCHAR}
</foreach>
</if>
</select>
</mapper>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/ClerkController.java
0 → 100644
View file @
fd178bdd
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.util.Date
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
@RestController
public
class
ClerkController
extends
WebBaseController
{
@Autowired
private
ClerkService
clerkService
;
@Autowired
private
StaffDepartmentRelatedApiService
staffDepartmentRelatedApiService
;
//成员绑定
@RequestMapping
(
"/staff-bind"
)
public
HaobanResponse
staffBind
(
String
clerkCode
,
String
staffDepartmentRelatedId
)
{
StaffDepartmentRelatedDTO
dto
=
new
StaffDepartmentRelatedDTO
();
dto
.
setStaffDepartmentRelatedId
(
staffDepartmentRelatedId
);
dto
.
setClerkCode
(
clerkCode
);
dto
.
setUpdateTime
(
new
Date
());
staffDepartmentRelatedApiService
.
updateById
(
dto
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
//成员换绑定
@RequestMapping
(
"/clerk-unbind"
)
public
HaobanResponse
clerkUnbind
(
String
clerkCode
,
String
staffDepartmentRelatedId
)
{
StaffDepartmentRelatedDTO
one
=
staffDepartmentRelatedApiService
.
getOneByClerkCode
(
clerkCode
);
if
(
one
!=
null
){
//存在,则先置空
one
.
setClerkCode
(
null
);
one
.
setUpdateTime
(
new
Date
());
staffDepartmentRelatedApiService
.
deleteCode
(
one
);
}
//不存在,则更新
StaffDepartmentRelatedDTO
dto
=
new
StaffDepartmentRelatedDTO
();
dto
.
setStaffDepartmentRelatedId
(
staffDepartmentRelatedId
);
dto
.
setClerkCode
(
clerkCode
);
dto
.
setUpdateTime
(
new
Date
());
staffDepartmentRelatedApiService
.
updateById
(
dto
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/ClerkController.java
View file @
fd178bdd
...
@@ -15,7 +15,9 @@ import com.gic.clerk.api.dto.ClerkDTO;
...
@@ -15,7 +15,9 @@ import com.gic.clerk.api.dto.ClerkDTO;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
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.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.vo.ClerkVo
;
import
com.gic.haoban.manage.web.vo.ClerkVo
;
...
@@ -25,6 +27,8 @@ public class ClerkController extends WebBaseController{
...
@@ -25,6 +27,8 @@ public class ClerkController extends WebBaseController{
@Autowired
@Autowired
private
ClerkService
clerkService
;
private
ClerkService
clerkService
;
@Autowired
@Autowired
private
StaffApiService
staffApiService
;
@Autowired
private
StaffDepartmentRelatedApiService
staffDepartmentRelatedApiService
;
private
StaffDepartmentRelatedApiService
staffDepartmentRelatedApiService
;
@RequestMapping
(
"/clerk-list"
)
@RequestMapping
(
"/clerk-list"
)
...
@@ -66,6 +70,15 @@ public class ClerkController extends WebBaseController{
...
@@ -66,6 +70,15 @@ public class ClerkController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
result
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
result
);
}
}
//选择成员列表
@RequestMapping
(
"/staff-list"
)
public
HaobanResponse
staffList
(
String
departmentId
)
{
List
<
StaffDepartmentRelatedDTO
>
list
=
staffDepartmentRelatedApiService
.
listByDepartmentId
(
departmentId
);
List
<
String
>
staffIds
=
list
.
stream
().
map
(
s
->
s
.
getStaffId
()).
collect
(
Collectors
.
toList
());
List
<
StaffDTO
>
resultlist
=
staffApiService
.
listByIds
(
staffIds
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
resultlist
);
}
//成员绑定
//成员绑定
@RequestMapping
(
"/staff-bind"
)
@RequestMapping
(
"/staff-bind"
)
public
HaobanResponse
staffBind
(
String
clerkCode
,
String
staffDepartmentRelatedId
)
{
public
HaobanResponse
staffBind
(
String
clerkCode
,
String
staffDepartmentRelatedId
)
{
...
...
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