Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
feebe36e
authored
Oct 07, 2023
by
杨伟程
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
子女端子女编辑接口
parent
be687148
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
86 additions
and
16 deletions
server-module/src/main/java/com/makeit/module/controller/children/elder/PlatElderChildrenInfoChildrenController.java
server-module/src/main/java/com/makeit/module/controller/elder/PlatElderChildrenInfoController.java
server-service/src/main/java/com/makeit/dto/platform/elder/children/PlatElderChildrenInfoEditVO.java → server-service/src/main/java/com/makeit/dto/platform/elder/children/PlatElderChildrenInfoDTOVO.java
server-service/src/main/java/com/makeit/dto/platform/elder/children/PlatElderChildrenInfoWechatDTOVO.java
server-service/src/main/java/com/makeit/service/platform/elder/PlatElderChildrenInfoService.java
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderChildrenInfoServiceImpl.java
server-module/src/main/java/com/makeit/module/controller/children/elder/PlatElderChildrenInfoChildrenController.java
View file @
feebe36e
...
@@ -4,11 +4,13 @@ package com.makeit.module.controller.children.elder;
...
@@ -4,11 +4,13 @@ package com.makeit.module.controller.children.elder;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.dto.platform.elder.PlatElderIdDTO
;
import
com.makeit.dto.platform.elder.PlatElderIdDTO
;
import
com.makeit.dto.platform.elder.children.PlatElderChildrenInfoWechatDTOVO
;
import
com.makeit.service.platform.elder.PlatElderChildrenInfoService
;
import
com.makeit.service.platform.elder.PlatElderChildrenInfoService
;
import
com.makeit.vo.wechat.elder.PlatElderChildrenInfoWechatVO
;
import
com.makeit.vo.wechat.elder.PlatElderChildrenInfoWechatVO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -36,6 +38,13 @@ public class PlatElderChildrenInfoChildrenController {
...
@@ -36,6 +38,13 @@ public class PlatElderChildrenInfoChildrenController {
return
ApiResponseUtils
.
success
(
platElderChildrenInfoService
.
view
());
return
ApiResponseUtils
.
success
(
platElderChildrenInfoService
.
view
());
}
}
@ApiOperation
(
"编辑"
)
@PostMapping
(
"edit"
)
public
ApiResponseEntity
<?>
edit
(
@Validated
@RequestBody
PlatElderChildrenInfoWechatDTOVO
dto
)
{
platElderChildrenInfoService
.
wechatEdit
(
dto
);
return
ApiResponseUtils
.
success
();
}
@ApiOperation
(
"绑定"
)
@ApiOperation
(
"绑定"
)
@PostMapping
(
"bind"
)
@PostMapping
(
"bind"
)
public
ApiResponseEntity
<?>
bind
(
@RequestBody
PlatElderIdDTO
dto
)
{
public
ApiResponseEntity
<?>
bind
(
@RequestBody
PlatElderIdDTO
dto
)
{
...
...
server-module/src/main/java/com/makeit/module/controller/elder/PlatElderChildrenInfoController.java
View file @
feebe36e
...
@@ -6,7 +6,7 @@ import com.makeit.common.page.PageReqDTO;
...
@@ -6,7 +6,7 @@ import com.makeit.common.page.PageReqDTO;
import
com.makeit.common.page.PageVO
;
import
com.makeit.common.page.PageVO
;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseEntity
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.dto.platform.elder.children.PlatElderChildrenInfo
Edit
VO
;
import
com.makeit.dto.platform.elder.children.PlatElderChildrenInfo
DTO
VO
;
import
com.makeit.dto.platform.elder.children.PlatElderChildrenInfoQueryDTO
;
import
com.makeit.dto.platform.elder.children.PlatElderChildrenInfoQueryDTO
;
import
com.makeit.service.platform.elder.PlatElderChildrenInfoService
;
import
com.makeit.service.platform.elder.PlatElderChildrenInfoService
;
import
com.makeit.vo.platform.elder.PlatElderChildrenInfoListVO
;
import
com.makeit.vo.platform.elder.PlatElderChildrenInfoListVO
;
...
@@ -51,14 +51,14 @@ public class PlatElderChildrenInfoController {
...
@@ -51,14 +51,14 @@ public class PlatElderChildrenInfoController {
@ApiOperation
(
"编辑"
)
@ApiOperation
(
"编辑"
)
@PostMapping
(
"edit"
)
@PostMapping
(
"edit"
)
public
ApiResponseEntity
<?>
edit
(
@Validated
@RequestBody
PlatElderChildrenInfo
Edit
VO
dto
)
{
public
ApiResponseEntity
<?>
edit
(
@Validated
@RequestBody
PlatElderChildrenInfo
DTO
VO
dto
)
{
platElderChildrenInfoService
.
edit
(
dto
);
platElderChildrenInfoService
.
edit
(
dto
);
return
ApiResponseUtils
.
success
();
return
ApiResponseUtils
.
success
();
}
}
@ApiOperation
(
"详情"
)
@ApiOperation
(
"详情"
)
@PostMapping
(
"view"
)
@PostMapping
(
"view"
)
public
ApiResponseEntity
<
PlatElderChildrenInfo
Edit
VO
>
view
(
@RequestBody
BaseIdDTO
baseIdDTO
)
{
public
ApiResponseEntity
<
PlatElderChildrenInfo
DTO
VO
>
view
(
@RequestBody
BaseIdDTO
baseIdDTO
)
{
return
ApiResponseUtils
.
success
(
platElderChildrenInfoService
.
view
(
baseIdDTO
.
getId
()));
return
ApiResponseUtils
.
success
(
platElderChildrenInfoService
.
view
(
baseIdDTO
.
getId
()));
}
}
...
...
server-service/src/main/java/com/makeit/dto/platform/elder/children/PlatElderChildrenInfo
Edit
VO.java
→
server-service/src/main/java/com/makeit/dto/platform/elder/children/PlatElderChildrenInfo
DTO
VO.java
View file @
feebe36e
...
@@ -20,7 +20,7 @@ import javax.validation.constraints.Size;
...
@@ -20,7 +20,7 @@ import javax.validation.constraints.Size;
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"ElderChildrenInfo对象"
,
description
=
"长者子女账号"
)
@ApiModel
(
value
=
"ElderChildrenInfo对象"
,
description
=
"长者子女账号"
)
public
class
PlatElderChildrenInfo
Edit
VO
extends
BaseTenantDTO
{
public
class
PlatElderChildrenInfo
DTO
VO
extends
BaseTenantDTO
{
@ApiModelProperty
(
value
=
"长者id"
)
@ApiModelProperty
(
value
=
"长者id"
)
private
String
elderId
;
private
String
elderId
;
...
...
server-service/src/main/java/com/makeit/dto/platform/elder/children/PlatElderChildrenInfoWechatDTOVO.java
0 → 100644
View file @
feebe36e
package
com
.
makeit
.
dto
.
platform
.
elder
.
children
;
import
com.makeit.common.dto.BaseTenantDTO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.Size
;
/**
* <p>
* 长者子女账号
* </p>
*
* @author eugene young
* @since 2023-08-29
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"ElderChildrenInfo对象"
,
description
=
"长者子女账号"
)
public
class
PlatElderChildrenInfoWechatDTOVO
extends
BaseTenantDTO
{
@NotBlank
(
message
=
"姓名不能为空"
)
@Size
(
max
=
50
,
message
=
"姓名最长为50个字符"
)
@ApiModelProperty
(
value
=
"姓名"
)
private
String
name
;
@ApiModelProperty
(
value
=
"手机号码"
)
private
String
phone
;
@ApiModelProperty
(
value
=
"微信头像路径"
)
private
String
avatar
;
}
server-service/src/main/java/com/makeit/service/platform/elder/PlatElderChildrenInfoService.java
View file @
feebe36e
...
@@ -3,8 +3,9 @@ package com.makeit.service.platform.elder;
...
@@ -3,8 +3,9 @@ package com.makeit.service.platform.elder;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.makeit.common.page.PageReqDTO
;
import
com.makeit.common.page.PageReqDTO
;
import
com.makeit.common.page.PageVO
;
import
com.makeit.common.page.PageVO
;
import
com.makeit.dto.platform.elder.children.PlatElderChildrenInfo
Edit
VO
;
import
com.makeit.dto.platform.elder.children.PlatElderChildrenInfo
DTO
VO
;
import
com.makeit.dto.platform.elder.children.PlatElderChildrenInfoQueryDTO
;
import
com.makeit.dto.platform.elder.children.PlatElderChildrenInfoQueryDTO
;
import
com.makeit.dto.platform.elder.children.PlatElderChildrenInfoWechatDTOVO
;
import
com.makeit.entity.platform.elder.PlatElderChildrenInfo
;
import
com.makeit.entity.platform.elder.PlatElderChildrenInfo
;
import
com.makeit.vo.platform.elder.PlatElderChildrenInfoListVO
;
import
com.makeit.vo.platform.elder.PlatElderChildrenInfoListVO
;
import
com.makeit.vo.wechat.elder.PlatElderChildrenInfoWechatVO
;
import
com.makeit.vo.wechat.elder.PlatElderChildrenInfoWechatVO
;
...
@@ -25,9 +26,11 @@ public interface PlatElderChildrenInfoService extends IService<PlatElderChildren
...
@@ -25,9 +26,11 @@ public interface PlatElderChildrenInfoService extends IService<PlatElderChildren
List
<
PlatElderChildrenInfoListVO
>
list
(
PlatElderChildrenInfoQueryDTO
dto
);
List
<
PlatElderChildrenInfoListVO
>
list
(
PlatElderChildrenInfoQueryDTO
dto
);
void
edit
(
PlatElderChildrenInfo
Edit
VO
dto
);
void
edit
(
PlatElderChildrenInfo
DTO
VO
dto
);
PlatElderChildrenInfoEditVO
view
(
String
id
);
void
wechatEdit
(
PlatElderChildrenInfoWechatDTOVO
dto
);
PlatElderChildrenInfoDTOVO
view
(
String
id
);
void
del
(
String
id
);
void
del
(
String
id
);
...
...
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderChildrenInfoServiceImpl.java
View file @
feebe36e
...
@@ -6,8 +6,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...
@@ -6,8 +6,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.makeit.common.page.PageReqDTO
;
import
com.makeit.common.page.PageReqDTO
;
import
com.makeit.common.page.PageVO
;
import
com.makeit.common.page.PageVO
;
import
com.makeit.dto.platform.elder.children.PlatElderChildrenInfo
Edit
VO
;
import
com.makeit.dto.platform.elder.children.PlatElderChildrenInfo
DTO
VO
;
import
com.makeit.dto.platform.elder.children.PlatElderChildrenInfoQueryDTO
;
import
com.makeit.dto.platform.elder.children.PlatElderChildrenInfoQueryDTO
;
import
com.makeit.dto.platform.elder.children.PlatElderChildrenInfoWechatDTOVO
;
import
com.makeit.entity.platform.auth.PlatOrg
;
import
com.makeit.entity.platform.auth.PlatOrg
;
import
com.makeit.entity.platform.elder.PlatElder
;
import
com.makeit.entity.platform.elder.PlatElder
;
import
com.makeit.entity.platform.elder.PlatElderChildrenInfo
;
import
com.makeit.entity.platform.elder.PlatElderChildrenInfo
;
...
@@ -25,11 +26,15 @@ import com.makeit.utils.sql.join.JoinUtil;
...
@@ -25,11 +26,15 @@ import com.makeit.utils.sql.join.JoinUtil;
import
com.makeit.utils.user.wechat.WechatUserUtil
;
import
com.makeit.utils.user.wechat.WechatUserUtil
;
import
com.makeit.vo.platform.elder.PlatElderChildrenInfoListVO
;
import
com.makeit.vo.platform.elder.PlatElderChildrenInfoListVO
;
import
com.makeit.vo.wechat.elder.PlatElderChildrenInfoWechatVO
;
import
com.makeit.vo.wechat.elder.PlatElderChildrenInfoWechatVO
;
import
org.springframework.beans.BeanUtils
;
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
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.LinkedHashSet
;
import
java.util.List
;
import
java.util.function.Function
;
import
java.util.function.Function
;
/**
/**
...
@@ -98,7 +103,7 @@ public class PlatElderChildrenInfoServiceImpl extends ServiceImpl<PlatElderChild
...
@@ -98,7 +103,7 @@ public class PlatElderChildrenInfoServiceImpl extends ServiceImpl<PlatElderChild
return
voList
;
return
voList
;
}
}
private
void
check
(
PlatElderChildrenInfo
Edit
VO
dto
)
{
private
void
check
(
PlatElderChildrenInfo
DTO
VO
dto
)
{
if
(
true
)
{
if
(
true
)
{
return
;
return
;
...
@@ -125,19 +130,35 @@ public class PlatElderChildrenInfoServiceImpl extends ServiceImpl<PlatElderChild
...
@@ -125,19 +130,35 @@ public class PlatElderChildrenInfoServiceImpl extends ServiceImpl<PlatElderChild
@Transactional
@Transactional
@Override
@Override
public
void
edit
(
PlatElderChildrenInfo
Edit
VO
dto
)
{
public
void
edit
(
PlatElderChildrenInfo
DTO
VO
dto
)
{
check
(
BeanDtoVoUtils
.
convert
(
dto
,
PlatElderChildrenInfo
Edit
VO
.
class
));
check
(
BeanDtoVoUtils
.
convert
(
dto
,
PlatElderChildrenInfo
DTO
VO
.
class
));
updateById
(
BeanDtoVoUtils
.
convert
(
dto
,
PlatElderChildrenInfo
.
class
));
PlatElderChildrenInfo
db
=
getById
(
dto
.
getId
());
BeanUtils
.
copyProperties
(
dto
,
db
);
updateById
(
db
);
}
}
@Transactional
@Override
public
void
wechatEdit
(
PlatElderChildrenInfoWechatDTOVO
dto
)
{
check
(
BeanDtoVoUtils
.
convert
(
dto
,
PlatElderChildrenInfoDTOVO
.
class
));
PlatElderChildrenInfo
db
=
getById
(
dto
.
getId
());
BeanUtils
.
copyProperties
(
dto
,
db
);
updateById
(
db
);
}
@Override
@Override
public
PlatElderChildrenInfo
Edit
VO
view
(
String
id
)
{
public
PlatElderChildrenInfo
DTO
VO
view
(
String
id
)
{
PlatElderChildrenInfo
EditVO
vo
=
BeanDtoVoUtils
.
convert
(
getById
(
id
),
PlatElderChildrenInfoEdit
VO
.
class
);
PlatElderChildrenInfo
DTOVO
vo
=
BeanDtoVoUtils
.
convert
(
getById
(
id
),
PlatElderChildrenInfoDTO
VO
.
class
);
JoinUtil
.
joinSplit
(
Arrays
.
asList
(
vo
),
platElderService
,
PlatElderChildrenInfo
Edit
VO:
:
getElderId
,
PlatElder:
:
getId
,
(
c
,
e
)
->
{
JoinUtil
.
joinSplit
(
Arrays
.
asList
(
vo
),
platElderService
,
PlatElderChildrenInfo
DTO
VO:
:
getElderId
,
PlatElder:
:
getId
,
(
c
,
e
)
->
{
c
.
setElderName
(
StreamUtil
.
join
(
e
,
PlatElder:
:
getName
));
c
.
setElderName
(
StreamUtil
.
join
(
e
,
PlatElder:
:
getName
));
});
});
...
...
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