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
QianQiXiang
haoban-manage3.0
Commits
42f60320
Commit
42f60320
authored
Mar 27, 2020
by
huangZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增接口,staff信息
parent
88983819
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
110 additions
and
2 deletions
+110
-2
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+2
-0
StaffMapper.java
...com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
+3
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+6
-1
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+8
-0
InfoController.java
.../com/gic/haoban/manage/web/controller/InfoController.java
+32
-1
AppStaffVo.java
...rc/main/java/com/gic/haoban/manage/web/vo/AppStaffVo.java
+59
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
42f60320
...
...
@@ -56,4 +56,6 @@ public interface StaffApiService {
public
String
insertUserLoginLog
(
UserLoginLogDTO
userLoginLogDTO
);
public
int
countByDepartmentIds
(
List
<
String
>
departmentIds
);
public
List
<
StaffDTO
>
listByPhoneNumber
(
String
phoneNumber
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
View file @
42f60320
...
...
@@ -32,4 +32,6 @@ public interface StaffMapper {
TabHaobanStaff
selectByUserIdAndEnterpriseId
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
TabHaobanStaff
selectSuperByWxEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
List
<
TabHaobanStaff
>
listByPhoneNumber
(
@Param
(
"phoneNumber"
)
String
phoneNumber
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
42f60320
...
...
@@ -91,7 +91,12 @@ public class StaffApiServiceImpl implements StaffApiService {
TabHaobanStaff
staff
=
staffService
.
selectById
(
staffId
);
return
EntityUtil
.
changeEntityByJSON
(
StaffDTO
.
class
,
staff
);
}
@Override
public
List
<
StaffDTO
>
listByPhoneNumber
(
String
phoneNumber
)
{
List
<
TabHaobanStaff
>
staffs
=
staffMapper
.
listByPhoneNumber
(
phoneNumber
);
return
EntityUtil
.
changeEntityListByJSON
(
StaffDTO
.
class
,
staffs
);
}
@Override
public
StaffDTO
selectByNationcodeAndPhoneNumber
(
String
wxEnterpriseId
,
String
nationcode
,
String
phoneNumber
)
{
TabHaobanStaff
staff
=
staffService
.
selectByNationcodeAndPhoneNumber
(
wxEnterpriseId
,
nationcode
,
phoneNumber
);
...
...
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
42f60320
...
...
@@ -251,6 +251,14 @@
and status_flag = 1
</select>
<select
id=
"listByPhoneNumber"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_staff
where phone_number = #{phoneNumber}
and status_flag = 1
</select>
<select
id=
"pageStaff"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/InfoController.java
View file @
42f60320
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.UserLoginLogDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.YwWxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.interceptor.WebInterceptor
;
import
com.gic.haoban.manage.web.vo.AppStaffVo
;
import
com.gic.haoban.manage.web.vo.InfoVo
;
import
com.gic.wechat.api.dto.qywx.UserDTO
;
import
com.gic.wechat.api.service.qywx.QywxCorpApiService
;
...
...
@@ -80,5 +91,25 @@ public class InfoController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
@RequestMapping
(
"get-staff-info"
)
public
HaobanResponse
getStaffInfo
(
String
phoneNumber
)
{
if
(
StringUtils
.
isBlank
(
phoneNumber
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
List
<
StaffDTO
>
list
=
staffApiService
.
listByPhoneNumber
(
phoneNumber
);
if
(
CollectionUtil
.
isNotEmpty
(
list
)){
List
<
AppStaffVo
>
staffs
=
EntityUtil
.
changeEntityListByJSON
(
AppStaffVo
.
class
,
list
);
Set
<
String
>
wxEnterpriseIds
=
list
.
stream
().
map
(
s
->
s
.
getWxEnterpriseId
()).
collect
(
Collectors
.
toSet
());
List
<
YwWxEnterpriseDTO
>
enterprises
=
wxEnterpriseApiService
.
listByIds
(
wxEnterpriseIds
);
Map
<
String
,
YwWxEnterpriseDTO
>
map
=
com
.
gic
.
commons
.
util
.
CollectionUtil
.
toMap
(
enterprises
,
"wxEnterpriseId"
);
for
(
AppStaffVo
vo:
staffs
){
String
wxEnterpriseId
=
vo
.
getWxEnterpriseId
();
String
corpName
=
map
.
get
(
wxEnterpriseId
)
==
null
?
""
:
map
.
get
(
wxEnterpriseId
).
getCorpName
();
vo
.
setWxEnterpriseName
(
corpName
);
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/vo/AppStaffVo.java
0 → 100644
View file @
42f60320
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
;
import
java.io.Serializable
;
/**
* Created 2018/10/22.
*
* @author hua
*/
public
class
AppStaffVo
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
private
String
staffId
;
private
String
staffName
;
private
String
nationCode
;
private
String
phoneNumber
;
private
String
wxEnterpriseId
;
private
String
wxEnterpriseName
;
public
String
getStaffId
()
{
return
staffId
;
}
public
void
setStaffId
(
String
staffId
)
{
this
.
staffId
=
staffId
;
}
public
String
getStaffName
()
{
return
staffName
;
}
public
void
setStaffName
(
String
staffName
)
{
this
.
staffName
=
staffName
;
}
public
String
getNationCode
()
{
return
nationCode
;
}
public
void
setNationCode
(
String
nationCode
)
{
this
.
nationCode
=
nationCode
;
}
public
String
getPhoneNumber
()
{
return
phoneNumber
;
}
public
void
setPhoneNumber
(
String
phoneNumber
)
{
this
.
phoneNumber
=
phoneNumber
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getWxEnterpriseName
()
{
return
wxEnterpriseName
;
}
public
void
setWxEnterpriseName
(
String
wxEnterpriseName
)
{
this
.
wxEnterpriseName
=
wxEnterpriseName
;
}
}
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