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
24f953a3
Commit
24f953a3
authored
May 07, 2021
by
Shen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.用户地址 添加”查询个人及家人收货地址“接口
parent
a5a3d57f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
PensionConsigneeController.java
...s/serviceOrder/controller/PensionConsigneeController.java
+9
-1
PensionConsigneeService.java
...modules/serviceOrder/service/PensionConsigneeService.java
+2
-0
PensionConsigneeServiceImpl.java
...erviceOrder/service/impl/PensionConsigneeServiceImpl.java
+19
-0
No files found.
hmit-api/src/main/java/io/hmit/modules/serviceOrder/controller/PensionConsigneeController.java
View file @
24f953a3
...
@@ -92,7 +92,7 @@ public class PensionConsigneeController {
...
@@ -92,7 +92,7 @@ public class PensionConsigneeController {
public
Result
delete
(
@RequestBody
Long
[]
ids
){
public
Result
delete
(
@RequestBody
Long
[]
ids
){
//校验数据
//校验数据
AssertUtils
.
isArrayEmpty
(
ids
,
"id"
);
AssertUtils
.
isArrayEmpty
(
ids
,
"id"
);
//查询是否默认地址,如果删除的地址是默认地址,应将某个地址设为默认地址
pensionConsigneeService
.
delete
(
ids
);
pensionConsigneeService
.
delete
(
ids
);
return
new
Result
();
return
new
Result
();
...
@@ -113,6 +113,14 @@ public class PensionConsigneeController {
...
@@ -113,6 +113,14 @@ public class PensionConsigneeController {
return
new
Result
<
List
<
PensionConsigneeDTO
>>().
ok
(
pensionConsigneeDTOList
);
return
new
Result
<
List
<
PensionConsigneeDTO
>>().
ok
(
pensionConsigneeDTOList
);
}
}
@Login
@GetMapping
(
"findMyFamilyAddress"
)
@ApiOperation
(
"查询个人及家人收货地址"
)
public
Result
<
List
<
PensionConsigneeDTO
>>
findMyFamilyAddress
(
@ApiIgnore
@LoginUser
UserEntity
user
){
List
<
PensionConsigneeDTO
>
pensionConsigneeDTOList
=
pensionConsigneeService
.
findMyFamilyAddress
(
user
.
getId
());
return
new
Result
<
List
<
PensionConsigneeDTO
>>().
ok
(
pensionConsigneeDTOList
);
}
@Login
@Login
@PostMapping
(
"addMyAddress"
)
@PostMapping
(
"addMyAddress"
)
@ApiOperation
(
"添加我的收货地址"
)
@ApiOperation
(
"添加我的收货地址"
)
...
...
hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/PensionConsigneeService.java
View file @
24f953a3
...
@@ -17,6 +17,8 @@ public interface PensionConsigneeService extends CrudService<PensionConsigneeEnt
...
@@ -17,6 +17,8 @@ public interface PensionConsigneeService extends CrudService<PensionConsigneeEnt
List
<
PensionConsigneeDTO
>
findByUserId
(
Long
userId
);
List
<
PensionConsigneeDTO
>
findByUserId
(
Long
userId
);
List
<
PensionConsigneeDTO
>
findMyFamilyAddress
(
Long
userId
);
void
addUserAddress
(
Map
<
String
,
Object
>
params
);
void
addUserAddress
(
Map
<
String
,
Object
>
params
);
}
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/impl/PensionConsigneeServiceImpl.java
View file @
24f953a3
...
@@ -6,8 +6,10 @@ import io.hmit.common.utils.ConvertUtils;
...
@@ -6,8 +6,10 @@ import io.hmit.common.utils.ConvertUtils;
import
io.hmit.modules.serviceOrder.dao.PensionConsigneeDao
;
import
io.hmit.modules.serviceOrder.dao.PensionConsigneeDao
;
import
io.hmit.modules.serviceOrder.dto.PensionConsigneeAddDTO
;
import
io.hmit.modules.serviceOrder.dto.PensionConsigneeAddDTO
;
import
io.hmit.modules.serviceOrder.dto.PensionConsigneeDTO
;
import
io.hmit.modules.serviceOrder.dto.PensionConsigneeDTO
;
import
io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO
;
import
io.hmit.modules.serviceOrder.entity.PensionConsigneeEntity
;
import
io.hmit.modules.serviceOrder.entity.PensionConsigneeEntity
;
import
io.hmit.modules.serviceOrder.service.PensionConsigneeService
;
import
io.hmit.modules.serviceOrder.service.PensionConsigneeService
;
import
io.hmit.modules.serviceOrder.service.PensionOldFamilyService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -39,6 +41,9 @@ public class PensionConsigneeServiceImpl extends CrudServiceImpl<PensionConsigne
...
@@ -39,6 +41,9 @@ public class PensionConsigneeServiceImpl extends CrudServiceImpl<PensionConsigne
@Autowired
@Autowired
private
PensionConsigneeDao
pensionConsigneeDao
;
private
PensionConsigneeDao
pensionConsigneeDao
;
@Autowired
private
PensionOldFamilyService
pensionOldFamilyService
;
@Override
@Override
public
List
<
PensionConsigneeDTO
>
findByUserId
(
Long
userId
)
{
public
List
<
PensionConsigneeDTO
>
findByUserId
(
Long
userId
)
{
QueryWrapper
<
PensionConsigneeEntity
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
PensionConsigneeEntity
>
queryWrapper
=
new
QueryWrapper
<>();
...
@@ -47,6 +52,20 @@ public class PensionConsigneeServiceImpl extends CrudServiceImpl<PensionConsigne
...
@@ -47,6 +52,20 @@ public class PensionConsigneeServiceImpl extends CrudServiceImpl<PensionConsigne
return
ConvertUtils
.
sourceToTarget
(
platformPayInfoEntityList
,
PensionConsigneeDTO
.
class
);
return
ConvertUtils
.
sourceToTarget
(
platformPayInfoEntityList
,
PensionConsigneeDTO
.
class
);
}
}
@Override
public
List
<
PensionConsigneeDTO
>
findMyFamilyAddress
(
Long
userId
)
{
//查询个人及家庭的userId
List
<
PensionOldFamilyDTO
>
familyDTOS
=
pensionOldFamilyService
.
findByOldId
(
userId
);
List
<
PensionConsigneeDTO
>
userAddressList
=
findByUserId
(
userId
);
for
(
PensionOldFamilyDTO
pensionOldFamilyDTO
:
familyDTOS
)
{
List
<
PensionConsigneeDTO
>
address
=
findByUserId
(
pensionOldFamilyDTO
.
getFamilyMemberId
());
if
(
address
.
size
()
>=
1
)
{
userAddressList
.
addAll
(
address
);
}
}
return
userAddressList
;
}
@Override
@Override
public
void
addUserAddress
(
Map
<
String
,
Object
>
params
)
{
public
void
addUserAddress
(
Map
<
String
,
Object
>
params
)
{
Integer
ifDefault
=
1
;
Integer
ifDefault
=
1
;
...
...
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