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
7424b565
Commit
7424b565
authored
May 06, 2021
by
Shen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修改用户地址实体类
2.添加根据用户id查询收货地址接口 3.添加本人收货地址查询接口
parent
ffaaac0a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
1 deletion
+59
-1
PensionConsigneeEntity.java
...t/modules/serviceOrder/entity/PensionConsigneeEntity.java
+10
-0
WebMvcConfig.java
hmit-api/src/main/java/io/hmit/config/WebMvcConfig.java
+1
-0
PensionConsigneeController.java
...s/serviceOrder/controller/PensionConsigneeController.java
+21
-0
PensionConsigneeEntity.java
...t/modules/serviceOrder/entity/PensionConsigneeEntity.java
+11
-1
PensionConsigneeService.java
...modules/serviceOrder/service/PensionConsigneeService.java
+4
-0
PensionConsigneeServiceImpl.java
...erviceOrder/service/impl/PensionConsigneeServiceImpl.java
+12
-0
No files found.
hmit-admin/src/main/java/io/hmit/modules/serviceOrder/entity/PensionConsigneeEntity.java
View file @
7424b565
package
io
.
hmit
.
modules
.
serviceOrder
.
entity
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.hmit.common.entity.BaseEntity
;
import
lombok.Data
;
...
...
@@ -19,6 +22,8 @@ import java.util.Date;
public
class
PensionConsigneeEntity
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
private
Long
id
;
/**
* 用户ID
*/
...
...
@@ -63,6 +68,11 @@ public class PensionConsigneeEntity extends BaseEntity {
* 备注
*/
private
String
remark
;
/**
* 创建时间
*/
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Date
createDate
;
/**
* 更新时间
*/
...
...
hmit-api/src/main/java/io/hmit/config/WebMvcConfig.java
View file @
7424b565
...
...
@@ -42,6 +42,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
registry
.
addInterceptor
(
authorizationInterceptor
).
addPathPatterns
(
"/api/**"
);
registry
.
addInterceptor
(
authorizationInterceptor
).
addPathPatterns
(
"/serviceOrder/pensionorder/**"
);
registry
.
addInterceptor
(
authorizationInterceptor
).
addPathPatterns
(
"/serviceOrder/pensionservicetype/**"
);
registry
.
addInterceptor
(
authorizationInterceptor
).
addPathPatterns
(
"/serviceOrder/pensionconsignee/**"
);
}
@Override
...
...
hmit-api/src/main/java/io/hmit/modules/serviceOrder/controller/PensionConsigneeController.java
View file @
7424b565
package
io
.
hmit
.
modules
.
serviceOrder
.
controller
;
import
io.hmit.annotation.Login
;
import
io.hmit.annotation.LoginUser
;
import
io.hmit.common.constant.Constant
;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.utils.Result
;
...
...
@@ -8,12 +10,14 @@ 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.entity.UserEntity
;
import
io.hmit.modules.serviceOrder.dto.PensionConsigneeDTO
;
import
io.hmit.modules.serviceOrder.service.PensionConsigneeService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
...
...
@@ -29,6 +33,7 @@ import java.util.Map;
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-05-06
*/
@Slf4j
@RestController
@RequestMapping
(
"serviceOrder/pensionconsignee"
)
@Api
(
tags
=
"用户地址"
)
...
...
@@ -91,4 +96,20 @@ public class PensionConsigneeController {
return
new
Result
();
}
@GetMapping
(
"findByUserId"
)
@ApiOperation
(
"根据用户id查询用户收货地址"
)
public
Result
<
List
<
PensionConsigneeDTO
>>
findAddressByUserId
(
@RequestParam
(
"userId"
)
Long
userId
){
List
<
PensionConsigneeDTO
>
pensionConsigneeDTOList
=
pensionConsigneeService
.
findByUserId
(
userId
);
return
new
Result
<
List
<
PensionConsigneeDTO
>>().
ok
(
pensionConsigneeDTOList
);
}
@Login
@GetMapping
(
"findMyAddress"
)
@ApiOperation
(
"查询本人收货地址"
)
public
Result
<
List
<
PensionConsigneeDTO
>>
findMyAddress
(
@ApiIgnore
@LoginUser
UserEntity
user
){
log
.
info
(
"user={}"
,
user
);
List
<
PensionConsigneeDTO
>
pensionConsigneeDTOList
=
pensionConsigneeService
.
findByUserId
(
user
.
getId
());
return
new
Result
<
List
<
PensionConsigneeDTO
>>().
ok
(
pensionConsigneeDTOList
);
}
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/modules/serviceOrder/entity/PensionConsigneeEntity.java
View file @
7424b565
package
io
.
hmit
.
modules
.
serviceOrder
.
entity
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.hmit.common.entity.BaseEntity
;
import
lombok.Data
;
...
...
@@ -16,9 +19,11 @@ import java.util.Date;
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"pension_consignee"
)
public
class
PensionConsigneeEntity
extends
BaseEntity
{
public
class
PensionConsigneeEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
private
Long
id
;
/**
* 用户ID
*/
...
...
@@ -63,6 +68,11 @@ public class PensionConsigneeEntity extends BaseEntity {
* 备注
*/
private
String
remark
;
/**
* 创建时间
*/
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Date
createDate
;
/**
* 更新时间
*/
...
...
hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/PensionConsigneeService.java
View file @
7424b565
...
...
@@ -4,6 +4,8 @@ import io.hmit.common.service.CrudService;
import
io.hmit.modules.serviceOrder.dto.PensionConsigneeDTO
;
import
io.hmit.modules.serviceOrder.entity.PensionConsigneeEntity
;
import
java.util.List
;
/**
*
*
...
...
@@ -12,4 +14,6 @@ import io.hmit.modules.serviceOrder.entity.PensionConsigneeEntity;
*/
public
interface
PensionConsigneeService
extends
CrudService
<
PensionConsigneeEntity
,
PensionConsigneeDTO
>
{
List
<
PensionConsigneeDTO
>
findByUserId
(
Long
userId
);
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/impl/PensionConsigneeServiceImpl.java
View file @
7424b565
...
...
@@ -2,13 +2,16 @@ package io.hmit.modules.serviceOrder.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
io.hmit.common.service.impl.CrudServiceImpl
;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.modules.serviceOrder.dao.PensionConsigneeDao
;
import
io.hmit.modules.serviceOrder.dto.PensionConsigneeDTO
;
import
io.hmit.modules.serviceOrder.entity.PensionConsigneeEntity
;
import
io.hmit.modules.serviceOrder.service.PensionConsigneeService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -30,5 +33,14 @@ public class PensionConsigneeServiceImpl extends CrudServiceImpl<PensionConsigne
return
wrapper
;
}
@Autowired
private
PensionConsigneeDao
pensionConsigneeDao
;
@Override
public
List
<
PensionConsigneeDTO
>
findByUserId
(
Long
userId
)
{
QueryWrapper
<
PensionConsigneeEntity
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"user_id"
,
userId
);
List
<
PensionConsigneeEntity
>
platformPayInfoEntityList
=
pensionConsigneeDao
.
selectList
(
queryWrapper
);
return
ConvertUtils
.
sourceToTarget
(
platformPayInfoEntityList
,
PensionConsigneeDTO
.
class
);
}
}
\ 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