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
72de4466
Commit
72de4466
authored
Mar 19, 2021
by
mlchun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.用户个人信息接口
parent
12d6437e
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
258 additions
and
18 deletions
+258
-18
UserController.java
...-api/src/main/java/io/hmit/controller/UserController.java
+37
-3
UserDao.java
hmit-api/src/main/java/io/hmit/dao/UserDao.java
+6
-0
OldUserInfoDTO.java
hmit-api/src/main/java/io/hmit/dto/OldUserInfoDTO.java
+61
-0
OrgUserInfoDTO.java
hmit-api/src/main/java/io/hmit/dto/OrgUserInfoDTO.java
+38
-0
ServiceUserInfoDTO.java
hmit-api/src/main/java/io/hmit/dto/ServiceUserInfoDTO.java
+68
-0
PensionOldFamilyDTO.java
...io/hmit/modules/serviceOrder/dto/PensionOldFamilyDTO.java
+6
-13
PensionOrganizationDTO.java
...hmit/modules/serviceOrder/dto/PensionOrganizationDTO.java
+3
-0
PensionOrganizationEntity.java
...odules/serviceOrder/entity/PensionOrganizationEntity.java
+5
-0
UserService.java
hmit-api/src/main/java/io/hmit/service/UserService.java
+6
-0
UserServiceImpl.java
...i/src/main/java/io/hmit/service/impl/UserServiceImpl.java
+12
-0
UserDao.xml
hmit-api/src/main/resources/mapper/UserDao.xml
+14
-0
PensionOldFamilyDao.xml
...ain/resources/mapper/serviceOrder/PensionOldFamilyDao.xml
+2
-2
No files found.
hmit-api/src/main/java/io/hmit/controller/UserController.java
View file @
72de4466
...
@@ -5,9 +5,13 @@ import io.hmit.annotation.Login;
...
@@ -5,9 +5,13 @@ import io.hmit.annotation.Login;
import
io.hmit.annotation.LoginUser
;
import
io.hmit.annotation.LoginUser
;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.common.utils.Result
;
import
io.hmit.common.utils.Result
;
import
io.hmit.dto.OrgUserInfoDTO
;
import
io.hmit.dto.ServiceUserInfoDTO
;
import
io.hmit.dto.UserInfoDTO
;
import
io.hmit.dto.UserInfoDTO
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO
;
import
io.hmit.modules.serviceOrder.dto.PensionOrderDTO
;
import
io.hmit.modules.serviceOrder.dto.PensionOrderDTO
;
import
io.hmit.modules.serviceOrder.service.PensionOldFamilyService
;
import
io.hmit.service.UserService
;
import
io.hmit.service.UserService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -19,6 +23,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -19,6 +23,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
springfox.documentation.annotations.ApiIgnore
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.List
;
/**
/**
* @Description :
* @Description :
* @Author : Shen Yuanfeng
* @Author : Shen Yuanfeng
...
@@ -34,11 +40,39 @@ public class UserController {
...
@@ -34,11 +40,39 @@ public class UserController {
@Autowired
@Autowired
private
UserService
userService
;
private
UserService
userService
;
@Autowired
private
PensionOldFamilyService
pensionOldFamilyService
;
@Login
@Login
@GetMapping
(
"
my
info"
)
@GetMapping
(
"
old
info"
)
@ApiOperation
(
"信息"
)
@ApiOperation
(
"
老人个人
信息"
)
public
Result
<
UserInfoDTO
>
get
(
@ApiIgnore
@LoginUser
UserEntity
user
){
public
Result
<
UserInfoDTO
>
get
OldInfo
(
@ApiIgnore
@LoginUser
UserEntity
user
){
UserInfoDTO
userDetails
=
userService
.
getUserDetails
(
user
.
getId
());
UserInfoDTO
userDetails
=
userService
.
getUserDetails
(
user
.
getId
());
return
new
Result
<
UserInfoDTO
>().
ok
(
userDetails
);
return
new
Result
<
UserInfoDTO
>().
ok
(
userDetails
);
}
}
@Login
@GetMapping
(
"oldfamilyinfo"
)
@ApiOperation
(
"老人家属信息"
)
public
Result
<
List
<
PensionOldFamilyDTO
>>
getOldFamilyInfo
(
@ApiIgnore
@LoginUser
UserEntity
user
){
List
<
PensionOldFamilyDTO
>
familyDTOS
=
pensionOldFamilyService
.
findByOldId
(
user
.
getId
());
return
new
Result
<
List
<
PensionOldFamilyDTO
>>().
ok
(
familyDTOS
);
}
@Login
@GetMapping
(
"orginfo"
)
@ApiOperation
(
"机构信息"
)
public
Result
<
OrgUserInfoDTO
>
getOrgUserInfo
(
@ApiIgnore
@LoginUser
UserEntity
user
){
OrgUserInfoDTO
orgUserInfo
=
userService
.
getOrgUserByUserId
(
user
.
getId
());
return
new
Result
<
OrgUserInfoDTO
>().
ok
(
orgUserInfo
);
}
@Login
@GetMapping
(
"serviceinfo"
)
@ApiOperation
(
"服务人员信息"
)
public
Result
<
ServiceUserInfoDTO
>
serviceinfo
(
@ApiIgnore
@LoginUser
UserEntity
user
){
ServiceUserInfoDTO
serviceUser
=
userService
.
getServiceUserByUserId
(
user
.
getId
());
return
new
Result
<
ServiceUserInfoDTO
>().
ok
(
serviceUser
);
}
}
}
hmit-api/src/main/java/io/hmit/dao/UserDao.java
View file @
72de4466
package
io
.
hmit
.
dao
;
package
io
.
hmit
.
dao
;
import
io.hmit.common.dao.BaseDao
;
import
io.hmit.common.dao.BaseDao
;
import
io.hmit.dto.OrgUserInfoDTO
;
import
io.hmit.dto.ServiceUserInfoDTO
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.entity.UserEntity
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
...
@@ -22,4 +24,8 @@ public interface UserDao extends BaseDao<UserEntity> {
...
@@ -22,4 +24,8 @@ public interface UserDao extends BaseDao<UserEntity> {
List
<
Long
>
getAllOrganizationStaff
(
Long
userId
);
List
<
Long
>
getAllOrganizationStaff
(
Long
userId
);
OrgUserInfoDTO
getOrgUserByUserId
(
Long
userId
);
ServiceUserInfoDTO
getServiceUserByUserId
(
Long
userId
);
}
}
hmit-api/src/main/java/io/hmit/dto/OldUserInfoDTO.java
0 → 100644
View file @
72de4466
package
io
.
hmit
.
dto
;
import
io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
/**
* @Description :
* @Author : Shen Yuanfeng
* @Date: 2021/3/18 16:01
*/
@Data
@ApiModel
(
value
=
"老人信息"
)
public
class
OldUserInfoDTO
{
@ApiModelProperty
(
value
=
"用户id"
)
private
Long
id
;
/**
* 用户名
*/
@ApiModelProperty
(
value
=
"用户名"
)
private
String
username
;
/**
* 手机号
*/
@ApiModelProperty
(
value
=
"手机号"
)
private
String
mobile
;
/**
* 性别
*/
@ApiModelProperty
(
value
=
"性别"
)
private
String
gender
;
/**
* 生日
*/
@ApiModelProperty
(
value
=
"生日"
)
private
Date
birthday
;
/**
* 地址_地区
*/
@ApiModelProperty
(
value
=
"地址_地区"
)
private
String
addressArea
;
/**
* 详细地址
*/
@ApiModelProperty
(
value
=
"详细地址"
)
private
String
address
;
@ApiModelProperty
(
value
=
"所属社区名称"
)
private
String
communityName
;
@ApiModelProperty
(
value
=
"身体状态"
)
private
String
healthStatus
;
@ApiModelProperty
(
value
=
"家属信息"
)
private
List
<
PensionOldFamilyDTO
>
pensionOldFamilyDTOList
;
}
hmit-api/src/main/java/io/hmit/dto/OrgUserInfoDTO.java
0 → 100644
View file @
72de4466
package
io
.
hmit
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author Eve
* @email mengmengeve@gmail.com
* @create 2021/1/27
*/
@Data
@ApiModel
(
value
=
"机构信息"
)
public
class
OrgUserInfoDTO
{
@ApiModelProperty
(
value
=
"用户id"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"用户名"
)
private
String
username
;
@ApiModelProperty
(
value
=
"手机号"
)
private
String
mobile
;
@ApiModelProperty
(
value
=
"机构名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"机构图标"
)
private
String
icon
;
@ApiModelProperty
(
value
=
"机构描述"
)
private
String
description
;
@ApiModelProperty
(
value
=
"服务区域"
)
private
String
serviceArea
;
}
hmit-api/src/main/java/io/hmit/dto/ServiceUserInfoDTO.java
0 → 100644
View file @
72de4466
package
io
.
hmit
.
dto
;
import
io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author Eve
* @email mengmengeve@gmail.com
* @create 2021/1/27
*/
@Data
@ApiModel
(
value
=
"用户信息"
)
public
class
ServiceUserInfoDTO
{
@ApiModelProperty
(
value
=
"用户id"
)
private
Long
id
;
/**
* 用户名
*/
@ApiModelProperty
(
value
=
"用户名"
)
private
String
username
;
/**
* 手机号
*/
@ApiModelProperty
(
value
=
"手机号"
)
private
String
mobile
;
/**
* 性别
*/
@ApiModelProperty
(
value
=
"性别"
)
private
String
gender
;
/**
* 生日
*/
@ApiModelProperty
(
value
=
"生日"
)
private
Date
birthday
;
/**
* 地址_地区
*/
@ApiModelProperty
(
value
=
"地址_地区"
)
private
String
addressArea
;
/**
* 详细地址
*/
@ApiModelProperty
(
value
=
"详细地址"
)
private
String
address
;
/**
* 机构ID
*/
@ApiModelProperty
(
value
=
"机构ID"
)
private
String
orgId
;
/**
* 机构名称
*/
@ApiModelProperty
(
value
=
"机构ID"
)
private
String
orgName
;
/**
* 服务区域
*/
@ApiModelProperty
(
value
=
"服务区域"
)
private
String
serviceArea
;
}
hmit-api/src/main/java/io/hmit/modules/serviceOrder/dto/PensionOldFamilyDTO.java
View file @
72de4466
...
@@ -34,20 +34,13 @@ public class PensionOldFamilyDTO implements Serializable {
...
@@ -34,20 +34,13 @@ public class PensionOldFamilyDTO implements Serializable {
@ApiModelProperty
(
value
=
"家属与老人的关系"
)
@ApiModelProperty
(
value
=
"家属与老人的关系"
)
private
String
familyMemberRole
;
private
String
familyMemberRole
;
@ApiModelProperty
(
value
=
"备注"
)
@ApiModelProperty
(
value
=
"手机号"
)
private
String
remark
;
private
String
mobile
;
@ApiModelProperty
(
value
=
"创建者"
)
private
Long
creator
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createDate
;
@ApiModelProperty
(
value
=
"更新者"
)
@ApiModelProperty
(
value
=
"身份证号"
)
private
Long
updater
;
private
String
idCardNo
;
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
updateDate
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
}
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/modules/serviceOrder/dto/PensionOrganizationDTO.java
View file @
72de4466
...
@@ -31,6 +31,9 @@ public class PensionOrganizationDTO implements Serializable {
...
@@ -31,6 +31,9 @@ public class PensionOrganizationDTO implements Serializable {
@ApiModelProperty
(
value
=
"机构描述"
)
@ApiModelProperty
(
value
=
"机构描述"
)
private
String
description
;
private
String
description
;
@ApiModelProperty
(
value
=
"服务区域"
)
private
String
serviceArea
;
@ApiModelProperty
(
value
=
"创建者"
)
@ApiModelProperty
(
value
=
"创建者"
)
private
Long
creator
;
private
Long
creator
;
...
...
hmit-api/src/main/java/io/hmit/modules/serviceOrder/entity/PensionOrganizationEntity.java
View file @
72de4466
...
@@ -31,4 +31,9 @@ public class PensionOrganizationEntity extends BaseEntity {
...
@@ -31,4 +31,9 @@ public class PensionOrganizationEntity extends BaseEntity {
* 机构描述
* 机构描述
*/
*/
private
String
description
;
private
String
description
;
/**
* 服务区域
*/
private
String
serviceArea
;
}
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/service/UserService.java
View file @
72de4466
...
@@ -3,6 +3,8 @@ package io.hmit.service;
...
@@ -3,6 +3,8 @@ package io.hmit.service;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.service.BaseService
;
import
io.hmit.common.service.BaseService
;
import
io.hmit.dto.LoginDTO
;
import
io.hmit.dto.LoginDTO
;
import
io.hmit.dto.OrgUserInfoDTO
;
import
io.hmit.dto.ServiceUserInfoDTO
;
import
io.hmit.dto.UserInfoDTO
;
import
io.hmit.dto.UserInfoDTO
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.modules.serviceOrder.dto.PensionOrderDTO
;
import
io.hmit.modules.serviceOrder.dto.PensionOrderDTO
;
...
@@ -42,4 +44,8 @@ public interface UserService extends BaseService<UserEntity> {
...
@@ -42,4 +44,8 @@ public interface UserService extends BaseService<UserEntity> {
PageData
<
UserEntity
>
getOrganizationAllUsers
(
Map
<
String
,
Object
>
params
,
Long
userId
);
PageData
<
UserEntity
>
getOrganizationAllUsers
(
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 @
72de4466
...
@@ -10,6 +10,8 @@ import io.hmit.common.utils.ConvertUtils;
...
@@ -10,6 +10,8 @@ import io.hmit.common.utils.ConvertUtils;
import
io.hmit.common.validator.AssertUtils
;
import
io.hmit.common.validator.AssertUtils
;
import
io.hmit.dao.UserDao
;
import
io.hmit.dao.UserDao
;
import
io.hmit.dto.LoginDTO
;
import
io.hmit.dto.LoginDTO
;
import
io.hmit.dto.OrgUserInfoDTO
;
import
io.hmit.dto.ServiceUserInfoDTO
;
import
io.hmit.dto.UserInfoDTO
;
import
io.hmit.dto.UserInfoDTO
;
import
io.hmit.entity.TokenEntity
;
import
io.hmit.entity.TokenEntity
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.entity.UserEntity
;
...
@@ -114,4 +116,14 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
...
@@ -114,4 +116,14 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
return
getPageData
(
list
,
page
.
getTotal
(),
UserEntity
.
class
);
return
getPageData
(
list
,
page
.
getTotal
(),
UserEntity
.
class
);
}
}
@Override
public
OrgUserInfoDTO
getOrgUserByUserId
(
Long
userId
)
{
return
userDao
.
getOrgUserByUserId
(
userId
);
}
@Override
public
ServiceUserInfoDTO
getServiceUserByUserId
(
Long
userId
)
{
return
userDao
.
getServiceUserByUserId
(
userId
);
}
}
}
\ No newline at end of file
hmit-api/src/main/resources/mapper/UserDao.xml
View file @
72de4466
...
@@ -20,4 +20,18 @@
...
@@ -20,4 +20,18 @@
WHERE organization_id = (SELECT organization_id FROM pension_organization_user
WHERE organization_id = (SELECT organization_id FROM pension_organization_user
WHERE user_id = #{userId});
WHERE user_id = #{userId});
</select>
</select>
<select
id=
"getOrgUserByUserId"
resultType=
"io.hmit.dto.OrgUserInfoDTO"
>
SELECT tu.id, tu.username, tu.mobile, po.name, po.icon, po.description, po.service_area
FROM tb_user tu, pension_organization_user pou, pension_organization po
WHERE tu.id = pou.user_id AND po.id = pou.organization_id AND tu.id = #{userId};
</select>
<select
id=
"getServiceUserByUserId"
resultType=
"io.hmit.dto.ServiceUserInfoDTO"
>
SELECT tu.id, tu.username, tu.mobile, tu.gender, tu.address_area, tu.address, tu.birthday,
po.id AS orgId, po.name AS orgName, po.service_area
FROM tb_user tu, pension_organization_user pou, pension_organization po
WHERE tu.id = pou.user_id AND po.id = pou.organization_id AND tu.id = #{userId};
</select>
</mapper>
</mapper>
\ No newline at end of file
hmit-api/src/main/resources/mapper/serviceOrder/PensionOldFamilyDao.xml
View file @
72de4466
...
@@ -17,8 +17,8 @@
...
@@ -17,8 +17,8 @@
</resultMap>
</resultMap>
<select
id=
"findByOldId"
resultType=
"io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO"
>
<select
id=
"findByOldId"
resultType=
"io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO"
>
select * from pension_old_family
SELECT * FROM pension_old_family pof, tb_user tu
where
old_id = #{oldId}
WHERE pof.family_member_id = tu.id and pof.
old_id = #{oldId}
</select>
</select>
</mapper>
</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