Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
pension
Project
Project
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
mengmeng
pension
Commits
52522226
Commit
52522226
authored
Mar 11, 2021
by
mlchun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.添加查询本机构全部服务人员接口
parent
f757e30d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
0 deletions
+59
-0
UserDao.java
hmit-api/src/main/java/io/hmit/dao/UserDao.java
+5
-0
PensionOrderController.java
...dules/serviceOrder/controller/PensionOrderController.java
+22
-0
UserService.java
hmit-api/src/main/java/io/hmit/service/UserService.java
+5
-0
UserServiceImpl.java
...i/src/main/java/io/hmit/service/impl/UserServiceImpl.java
+21
-0
UserDao.xml
hmit-api/src/main/resources/mapper/UserDao.xml
+6
-0
No files found.
hmit-api/src/main/java/io/hmit/dao/UserDao.java
View file @
52522226
...
...
@@ -4,6 +4,8 @@ import io.hmit.common.dao.BaseDao;
import
io.hmit.entity.UserEntity
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* 用户
*
...
...
@@ -15,4 +17,7 @@ public interface UserDao extends BaseDao<UserEntity> {
UserEntity
getUserByMobile
(
String
mobile
);
UserEntity
getUserByUserId
(
Long
userId
);
List
<
Long
>
getAllOrganizationStaff
(
Long
userId
);
}
hmit-api/src/main/java/io/hmit/modules/serviceOrder/controller/PensionOrderController.java
View file @
52522226
...
...
@@ -15,6 +15,7 @@ import io.hmit.entity.UserEntity;
import
io.hmit.modules.serviceOrder.dto.PensionOrderDTO
;
import
io.hmit.modules.serviceOrder.dto.ReservationDTO
;
import
io.hmit.modules.serviceOrder.service.PensionOrderService
;
import
io.hmit.service.UserService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
...
...
@@ -39,6 +40,9 @@ public class PensionOrderController {
@Autowired
private
PensionOrderService
pensionOrderService
;
@Autowired
private
UserService
userService
;
@Login
@GetMapping
(
"page"
)
@ApiOperation
(
"全部订单(志愿者)"
)
...
...
@@ -298,4 +302,22 @@ public class PensionOrderController {
return
new
Result
();
}
/**
* 机构全部人员
*/
@Login
@GetMapping
(
"organizationStaff"
)
@ApiOperation
(
value
=
"机构全部人员(机构)"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
Constant
.
PAGE
,
value
=
"当前页码,从1开始"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)
,
@ApiImplicitParam
(
name
=
Constant
.
LIMIT
,
value
=
"每页显示记录数"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)
,
@ApiImplicitParam
(
name
=
Constant
.
ORDER_FIELD
,
value
=
"排序字段"
,
paramType
=
"query"
,
dataType
=
"String"
)
,
@ApiImplicitParam
(
name
=
Constant
.
ORDER
,
value
=
"排序方式,可选值(asc、desc)"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
public
Result
<
PageData
<
UserEntity
>>
organizationStaff
(
@ApiIgnore
@LoginUser
UserEntity
user
,
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
){
PageData
<
UserEntity
>
page
=
userService
.
getOrganizationAllUsers
(
params
,
user
.
getId
());
return
new
Result
<
PageData
<
UserEntity
>>().
ok
(
page
);
}
}
hmit-api/src/main/java/io/hmit/service/UserService.java
View file @
52522226
package
io
.
hmit
.
service
;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.service.BaseService
;
import
io.hmit.dto.LoginDTO
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.modules.serviceOrder.dto.PensionOrderDTO
;
import
java.util.Map
;
...
...
@@ -24,4 +26,7 @@ public interface UserService extends BaseService<UserEntity> {
* @return 返回登录信息
*/
Map
<
String
,
Object
>
login
(
LoginDTO
dto
);
PageData
<
UserEntity
>
getOrganizationAllUsers
(
Map
<
String
,
Object
>
params
,
Long
userId
);
}
hmit-api/src/main/java/io/hmit/service/impl/UserServiceImpl.java
View file @
52522226
package
io
.
hmit
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
io.hmit.common.constant.Constant
;
import
io.hmit.common.exception.ErrorCode
;
import
io.hmit.common.exception.HmitException
;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.service.impl.BaseServiceImpl
;
import
io.hmit.common.validator.AssertUtils
;
import
io.hmit.dao.UserDao
;
...
...
@@ -14,7 +17,9 @@ import org.apache.commons.codec.digest.DigestUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Service
...
...
@@ -23,6 +28,9 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
@Autowired
private
TokenService
tokenService
;
@Autowired
private
UserDao
userDao
;
@Override
public
UserEntity
getByMobile
(
String
mobile
)
{
return
baseDao
.
getUserByMobile
(
mobile
);
...
...
@@ -54,4 +62,17 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
return
map
;
}
@Override
public
PageData
<
UserEntity
>
getOrganizationAllUsers
(
Map
<
String
,
Object
>
params
,
Long
userId
)
{
IPage
<
UserEntity
>
page
=
getPage
(
params
,
Constant
.
CREATE_DATE
,
false
);
List
<
Long
>
serviceIds
=
userDao
.
getAllOrganizationStaff
(
userId
);
List
<
UserEntity
>
list
=
new
ArrayList
<>();
for
(
Long
id
:
serviceIds
)
{
UserEntity
userEntity
=
userDao
.
selectById
(
id
);
list
.
add
(
userEntity
);
}
page
.
setTotal
(
list
.
size
());
return
getPageData
(
list
,
page
.
getTotal
(),
UserEntity
.
class
);
}
}
\ No newline at end of file
hmit-api/src/main/resources/mapper/UserDao.xml
View file @
52522226
...
...
@@ -10,4 +10,10 @@
<select
id=
"getUserByUserId"
resultType=
"io.hmit.entity.UserEntity"
>
select * from tb_user where id = #{value}
</select>
<select
id=
"getAllOrganizationStaff"
resultType=
"Long"
>
SELECT user_id FROM pension_organization_user
WHERE organization_id = (SELECT organization_id FROM pension_organization_user
WHERE user_id = #{userId});
</select>
</mapper>
\ No newline at end of file
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