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
750025ed
Commit
750025ed
authored
May 17, 2021
by
Shen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. swagger配置优化
2. 机构人员查询接口(adamin和api)重构 3. 机构服务人员添加状态,100为待审核,101为审核通过
parent
96f69661
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
96 additions
and
8 deletions
+96
-8
SwaggerConfig.java
...in/src/main/java/io/hmit/common/config/SwaggerConfig.java
+5
-1
UserController.java
.../hmit/modules/serviceOrder/controller/UserController.java
+15
-4
UserDao.java
...c/main/java/io/hmit/modules/serviceOrder/dao/UserDao.java
+4
-0
UserDTO.java
...c/main/java/io/hmit/modules/serviceOrder/dto/UserDTO.java
+6
-0
UserEntity.java
.../java/io/hmit/modules/serviceOrder/entity/UserEntity.java
+8
-0
UserService.java
...ava/io/hmit/modules/serviceOrder/service/UserService.java
+3
-0
UserServiceImpl.java
...it/modules/serviceOrder/service/impl/UserServiceImpl.java
+12
-0
application.yml
hmit-admin/src/main/resources/application.yml
+2
-1
UserDao.xml
...-admin/src/main/resources/mapper/serviceOrder/UserDao.xml
+4
-0
UserDao.java
hmit-api/src/main/java/io/hmit/dao/UserDao.java
+2
-0
PensionOrderController.java
...dules/serviceOrder/controller/PensionOrderController.java
+20
-2
UserService.java
hmit-api/src/main/java/io/hmit/service/UserService.java
+2
-0
UserServiceImpl.java
...i/src/main/java/io/hmit/service/impl/UserServiceImpl.java
+7
-0
UserDao.xml
hmit-api/src/main/resources/mapper/UserDao.xml
+6
-0
No files found.
hmit-admin/src/main/java/io/hmit/common/config/SwaggerConfig.java
View file @
750025ed
...
...
@@ -2,6 +2,7 @@ package io.hmit.common.config;
import
io.hmit.common.constant.Constant
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
springfox.documentation.builders.ApiInfoBuilder
;
...
...
@@ -30,10 +31,13 @@ public class SwaggerConfig {
// http://localhost:8080/swagger-ui.html 原路径
// http://localhost:8080/doc.html bootstrap版本路径
@Value
(
"${QR.domain}"
)
private
String
QRPath
;
@Bean
public
Docket
createRestApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
// .host("byyl.zjhmit.com"
)
.
host
(
QRPath
)
.
apiInfo
(
apiInfo
())
.
select
()
//加了ApiOperation注解的类,生成接口文档
...
...
hmit-admin/src/main/java/io/hmit/modules/serviceOrder/controller/UserController.java
View file @
750025ed
...
...
@@ -17,6 +17,7 @@ import io.hmit.common.validator.group.DefaultGroup;
import
io.hmit.common.validator.group.UpdateGroup
;
import
io.hmit.modules.security.user.SecurityUser
;
import
io.hmit.modules.serviceOrder.dto.UserDTO
;
import
io.hmit.modules.serviceOrder.entity.UserEntity
;
import
io.hmit.modules.serviceOrder.excel.UserExcel
;
import
io.hmit.modules.serviceOrder.service.RoleUserService
;
import
io.hmit.modules.serviceOrder.service.UserService
;
...
...
@@ -72,9 +73,22 @@ public class UserController {
return
new
Result
<
PageData
<
UserDTO
>>().
ok
(
page
);
}
@GetMapping
(
"staffPage"
)
@ApiOperation
(
value
=
"根据机构Id获取工作人员"
,
notes
=
"状态为100时为待审核,101为正常"
)
@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"
)
,
@ApiImplicitParam
(
name
=
"orgId"
,
value
=
"机构id"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
public
Result
<
PageData
<
UserDTO
>>
staffPage
(
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
){
PageData
<
UserDTO
>
page
=
userService
.
getOrgStaff
(
params
);
return
new
Result
<
PageData
<
UserDTO
>>().
ok
(
page
);
}
@GetMapping
(
"{id}"
)
@ApiOperation
(
"信息"
)
@RequiresPermissions
(
"serviceOrder:user:info"
)
public
Result
<
UserDTO
>
get
(
@PathVariable
(
"id"
)
Long
id
){
UserDTO
data
=
userService
.
get
(
id
);
data
.
setRoleIdList
(
roleUserService
.
getRoleIdList
(
data
.
getId
()));
...
...
@@ -85,7 +99,6 @@ public class UserController {
@PostMapping
@ApiOperation
(
"保存"
)
@LogOperation
(
"保存"
)
@RequiresPermissions
(
"serviceOrder:user:save"
)
public
Result
save
(
@RequestBody
UserDTO
dto
){
//校验数据
ValidatorUtils
.
validateEntity
(
dto
,
AddGroup
.
class
,
DefaultGroup
.
class
);
...
...
@@ -99,7 +112,6 @@ public class UserController {
@PutMapping
@ApiOperation
(
"修改"
)
@LogOperation
(
"修改"
)
@RequiresPermissions
(
"serviceOrder:user:update"
)
public
Result
update
(
@RequestBody
UserDTO
dto
){
//校验数据
ValidatorUtils
.
validateEntity
(
dto
,
UpdateGroup
.
class
,
DefaultGroup
.
class
);
...
...
@@ -113,7 +125,6 @@ public class UserController {
@DeleteMapping
@ApiOperation
(
"删除"
)
@LogOperation
(
"删除"
)
@RequiresPermissions
(
"serviceOrder:user:delete"
)
public
Result
delete
(
@RequestBody
Long
[]
ids
){
//校验数据
AssertUtils
.
isArrayEmpty
(
ids
,
"id"
);
...
...
hmit-admin/src/main/java/io/hmit/modules/serviceOrder/dao/UserDao.java
View file @
750025ed
...
...
@@ -14,7 +14,11 @@ import java.util.List;
*/
@Mapper
public
interface
UserDao
extends
BaseDao
<
UserEntity
>
{
UserEntity
getUserByUserId
(
Long
userId
);
List
<
Long
>
getAllOrganizationStaff
(
Long
userId
);
List
<
UserEntity
>
getOrgStaff
(
Long
orgId
);
}
hmit-admin/src/main/java/io/hmit/modules/serviceOrder/dto/UserDTO.java
View file @
750025ed
...
...
@@ -53,6 +53,12 @@ public class UserDTO implements Serializable {
@ApiModelProperty
(
value
=
"详细地址"
)
private
String
address
;
@ApiModelProperty
(
value
=
"身份证号"
)
private
Long
idCardNo
;
@ApiModelProperty
(
value
=
"状态"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"角色ID列表"
)
private
List
<
Long
>
roleIdList
;
...
...
hmit-admin/src/main/java/io/hmit/modules/serviceOrder/entity/UserEntity.java
View file @
750025ed
...
...
@@ -55,6 +55,14 @@ public class UserEntity extends BaseEntity {
* 详细地址
*/
private
String
address
;
/**
* 身份证号
*/
private
Long
idCardNo
;
/**
* 状态
*/
private
Integer
status
;
/**
* 所属社区名称
*/
...
...
hmit-admin/src/main/java/io/hmit/modules/serviceOrder/service/UserService.java
View file @
750025ed
...
...
@@ -19,6 +19,9 @@ public interface UserService extends CrudService<UserEntity, UserDTO> {
void
saveOrUpdateUserRole
(
Long
userId
,
List
<
Long
>
roleIdList
);
UserEntity
getUserByUserId
(
Long
userId
);
PageData
<
UserEntity
>
getOrganizationAllUsers
(
Map
<
String
,
Object
>
params
,
Long
userId
);
PageData
<
UserDTO
>
getOrgStaff
(
Map
<
String
,
Object
>
params
);
}
hmit-admin/src/main/java/io/hmit/modules/serviceOrder/service/impl/UserServiceImpl.java
View file @
750025ed
...
...
@@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
io.hmit.common.constant.Constant
;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.service.impl.CrudServiceImpl
;
import
io.hmit.common.utils.SubListForPageUtil
;
import
io.hmit.modules.serviceOrder.dao.UserDao
;
import
io.hmit.modules.serviceOrder.dto.PensionOrderDTO
;
import
io.hmit.modules.serviceOrder.dto.UserDTO
;
import
io.hmit.modules.serviceOrder.entity.UserEntity
;
import
io.hmit.modules.serviceOrder.service.RoleUserService
;
...
...
@@ -29,6 +31,10 @@ public class UserServiceImpl extends CrudServiceImpl<UserDao, UserEntity, UserDT
@Autowired
private
RoleUserService
roleUserService
;
@Autowired
private
UserDao
userDao
;
@Override
public
QueryWrapper
<
UserEntity
>
getWrapper
(
Map
<
String
,
Object
>
params
){
String
id
=
(
String
)
params
.
get
(
"id"
);
...
...
@@ -63,4 +69,10 @@ public class UserServiceImpl extends CrudServiceImpl<UserDao, UserEntity, UserDT
return
getPageData
(
list
,
page
.
getTotal
(),
UserEntity
.
class
);
}
@Override
public
PageData
<
UserDTO
>
getOrgStaff
(
Map
<
String
,
Object
>
params
)
{
List
<
UserEntity
>
list
=
userDao
.
getOrgStaff
(
Long
.
parseLong
(
params
.
get
(
"orgId"
).
toString
()));
return
getPageData
(
SubListForPageUtil
.
getSubList
(
params
,
list
),
list
.
size
(),
UserDTO
.
class
);
}
}
hmit-admin/src/main/resources/application.yml
View file @
750025ed
...
...
@@ -75,4 +75,5 @@ QR:
download-path
:
D:/upload/pension/
# download-path: /home/websoft/java_jar/pension_service/myfile/
# download-path: /home/resourse/bsqzc/ D:/123/ /home/websoft/java_jar/pension_service/myfile/
#此处修改需要在io.hmit.modules.security.config.WebMvcConfig 修改静态资源位置
\ No newline at end of file
domain
:
192.168.10.61:8088
# domain: byyl.zjhmit.com
\ No newline at end of file
hmit-admin/src/main/resources/mapper/serviceOrder/UserDao.xml
View file @
750025ed
...
...
@@ -27,5 +27,9 @@
WHERE pou.user_id = tu.id and tu.user_id = #{userId});
</select>
<select
id=
"getOrgStaff"
resultType=
"io.hmit.modules.serviceOrder.entity.UserEntity"
>
SELECT tu.id, tu.user_id, tu.username, tu.mobile, tu.openid, tu.address_area, tu.address, tu.id_card_no, tu.status
FROM tb_user tu, pension_organization_user pou WHERE tu.id = pou.service_id AND pou.organization_id = #{orgId}
</select>
</mapper>
hmit-api/src/main/java/io/hmit/dao/UserDao.java
View file @
750025ed
...
...
@@ -40,4 +40,6 @@ public interface UserDao extends BaseDao<UserEntity> {
*/
List
<
UserAddressDTO
>
findUserAddressByUsernameOrMobile
(
String
username
,
String
mobile
);
List
<
UserEntity
>
getOrgStaff
(
Long
userId
);
}
hmit-api/src/main/java/io/hmit/modules/serviceOrder/controller/PensionOrderController.java
View file @
750025ed
...
...
@@ -11,6 +11,7 @@ import io.hmit.common.validator.ValidatorUtils;
import
io.hmit.common.validator.group.AddGroup
;
import
io.hmit.common.validator.group.DefaultGroup
;
import
io.hmit.common.validator.group.UpdateGroup
;
import
io.hmit.dto.UserInfoDTO
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.modules.serviceOrder.dto.PensionOrderDTO
;
import
io.hmit.modules.serviceOrder.dto.ReservationDTO
;
...
...
@@ -368,8 +369,9 @@ public class PensionOrderController {
/**
* 本机构全部人员
*/
@Deprecated
@Login
@GetMapping
(
"organizationStaff"
)
@GetMapping
(
"organizationStaff
2
"
)
@ApiOperation
(
value
=
"本机构全部人员(机构)"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
Constant
.
PAGE
,
value
=
"当前页码,从1开始"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)
,
...
...
@@ -377,12 +379,28 @@ public class PensionOrderController {
@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
,
public
Result
<
PageData
<
UserEntity
>>
organizationStaff
2
(
@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
);
}
/**
* 本机构全部人员
*/
@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"
)
})
public
Result
<
PageData
<
UserInfoDTO
>>
organizationStaff
(
@ApiIgnore
@LoginUser
UserEntity
user
,
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
){
PageData
<
UserInfoDTO
>
page
=
userService
.
getOrganizationStaff
(
params
,
user
.
getId
());
return
new
Result
<
PageData
<
UserInfoDTO
>>().
ok
(
page
);
}
/**
* 机构处理
*/
...
...
hmit-api/src/main/java/io/hmit/service/UserService.java
View file @
750025ed
...
...
@@ -43,6 +43,8 @@ public interface UserService extends BaseService<UserEntity> {
PageData
<
UserEntity
>
getOrganizationAllUsers
(
Map
<
String
,
Object
>
params
,
Long
userId
);
PageData
<
UserInfoDTO
>
getOrganizationStaff
(
Map
<
String
,
Object
>
params
,
Long
userId
);
OrgUserInfoDTO
getOrgUserByUserId
(
Long
userId
);
ServiceUserInfoDTO
getServiceUserByUserId
(
Long
userId
);
...
...
hmit-api/src/main/java/io/hmit/service/impl/UserServiceImpl.java
View file @
750025ed
...
...
@@ -7,6 +7,7 @@ import io.hmit.common.exception.HmitException;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.service.impl.BaseServiceImpl
;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.common.utils.SubListForPageUtil
;
import
io.hmit.common.validator.AssertUtils
;
import
io.hmit.dao.UserDao
;
import
io.hmit.dto.*
;
...
...
@@ -124,6 +125,12 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
return
getPageData
(
list
,
page
.
getTotal
(),
UserEntity
.
class
);
}
@Override
public
PageData
<
UserInfoDTO
>
getOrganizationStaff
(
Map
<
String
,
Object
>
params
,
Long
userId
)
{
List
<
UserEntity
>
list
=
userDao
.
getOrgStaff
(
userId
);
return
getPageData
(
SubListForPageUtil
.
getSubList
(
params
,
list
),
list
.
size
(),
UserInfoDTO
.
class
);
}
@Override
public
OrgUserInfoDTO
getOrgUserByUserId
(
Long
userId
)
{
return
userDao
.
getOrgUserByUserId
(
userId
);
...
...
hmit-api/src/main/resources/mapper/UserDao.xml
View file @
750025ed
...
...
@@ -56,4 +56,10 @@
</if>
</select>
<select
id=
"getOrgStaff"
resultType=
"io.hmit.entity.UserEntity"
>
SELECT tu.* FROM tb_user tu, pension_organization_user pou
WHERE tu.id = pou.service_id AND tu.status != 100
AND pou.organization_id = (SELECT pous.organization_id FROM pension_organization_user pous WHERE pous.service_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