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
ffaaac0a
Commit
ffaaac0a
authored
May 06, 2021
by
Shen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.添加用户收货地址模块
2.新增查询用户地址接口
parent
4f369cd6
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
789 additions
and
2 deletions
+789
-2
PensionConsigneeController.java
...s/serviceOrder/controller/PensionConsigneeController.java
+116
-0
PensionConsigneeDao.java
...io/hmit/modules/serviceOrder/dao/PensionConsigneeDao.java
+16
-0
PensionConsigneeDTO.java
...io/hmit/modules/serviceOrder/dto/PensionConsigneeDTO.java
+65
-0
PensionConsigneeEntity.java
...t/modules/serviceOrder/entity/PensionConsigneeEntity.java
+70
-0
PensionConsigneeExcel.java
...mit/modules/serviceOrder/excel/PensionConsigneeExcel.java
+45
-0
PensionConsigneeService.java
...modules/serviceOrder/service/PensionConsigneeService.java
+15
-0
PensionConsigneeServiceImpl.java
...erviceOrder/service/impl/PensionConsigneeServiceImpl.java
+34
-0
PensionConsigneeDao.xml
...ain/resources/mapper/serviceOrder/PensionConsigneeDao.xml
+24
-0
SwaggerConfig.java
hmit-api/src/main/java/io/hmit/config/SwaggerConfig.java
+1
-1
UserController.java
...-api/src/main/java/io/hmit/controller/UserController.java
+11
-0
UserDao.java
hmit-api/src/main/java/io/hmit/dao/UserDao.java
+6
-0
PensionConsigneeController.java
...s/serviceOrder/controller/PensionConsigneeController.java
+94
-0
PensionOrderController.java
...dules/serviceOrder/controller/PensionOrderController.java
+1
-1
PensionConsigneeDao.java
...io/hmit/modules/serviceOrder/dao/PensionConsigneeDao.java
+16
-0
PensionConsigneeDTO.java
...io/hmit/modules/serviceOrder/dto/PensionConsigneeDTO.java
+65
-0
UserAddressDTO.java
...java/io/hmit/modules/serviceOrder/dto/UserAddressDTO.java
+32
-0
PensionConsigneeEntity.java
...t/modules/serviceOrder/entity/PensionConsigneeEntity.java
+70
-0
PensionConsigneeService.java
...modules/serviceOrder/service/PensionConsigneeService.java
+15
-0
PensionConsigneeServiceImpl.java
...erviceOrder/service/impl/PensionConsigneeServiceImpl.java
+34
-0
UserService.java
hmit-api/src/main/java/io/hmit/service/UserService.java
+4
-0
UserServiceImpl.java
...i/src/main/java/io/hmit/service/impl/UserServiceImpl.java
+20
-0
UserDao.xml
hmit-api/src/main/resources/mapper/UserDao.xml
+11
-0
PensionConsigneeDao.xml
...ain/resources/mapper/serviceOrder/PensionConsigneeDao.xml
+24
-0
No files found.
hmit-admin/src/main/java/io/hmit/modules/serviceOrder/controller/PensionConsigneeController.java
0 → 100644
View file @
ffaaac0a
package
io
.
hmit
.
modules
.
serviceOrder
.
controller
;
import
io.hmit.common.annotation.LogOperation
;
import
io.hmit.common.constant.Constant
;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.utils.ExcelUtils
;
import
io.hmit.common.utils.Result
;
import
io.hmit.common.validator.AssertUtils
;
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.modules.serviceOrder.dto.PensionConsigneeDTO
;
import
io.hmit.modules.serviceOrder.excel.PensionConsigneeExcel
;
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
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
import
java.util.Map
;
/**
*
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-05-06
*/
@RestController
@RequestMapping
(
"serviceOrder/pensionconsignee"
)
@Api
(
tags
=
""
)
public
class
PensionConsigneeController
{
@Autowired
private
PensionConsigneeService
pensionConsigneeService
;
@GetMapping
(
"page"
)
@ApiOperation
(
"分页"
)
@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"
)
})
@RequiresPermissions
(
"serviceOrder:pensionconsignee:page"
)
public
Result
<
PageData
<
PensionConsigneeDTO
>>
page
(
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
){
PageData
<
PensionConsigneeDTO
>
page
=
pensionConsigneeService
.
page
(
params
);
return
new
Result
<
PageData
<
PensionConsigneeDTO
>>().
ok
(
page
);
}
@GetMapping
(
"{id}"
)
@ApiOperation
(
"信息"
)
@RequiresPermissions
(
"serviceOrder:pensionconsignee:info"
)
public
Result
<
PensionConsigneeDTO
>
get
(
@PathVariable
(
"id"
)
Long
id
){
PensionConsigneeDTO
data
=
pensionConsigneeService
.
get
(
id
);
return
new
Result
<
PensionConsigneeDTO
>().
ok
(
data
);
}
@PostMapping
@ApiOperation
(
"保存"
)
@LogOperation
(
"保存"
)
@RequiresPermissions
(
"serviceOrder:pensionconsignee:save"
)
public
Result
save
(
@RequestBody
PensionConsigneeDTO
dto
){
//校验数据
ValidatorUtils
.
validateEntity
(
dto
,
AddGroup
.
class
,
DefaultGroup
.
class
);
pensionConsigneeService
.
save
(
dto
);
return
new
Result
();
}
@PutMapping
@ApiOperation
(
"修改"
)
@LogOperation
(
"修改"
)
@RequiresPermissions
(
"serviceOrder:pensionconsignee:update"
)
public
Result
update
(
@RequestBody
PensionConsigneeDTO
dto
){
//校验数据
ValidatorUtils
.
validateEntity
(
dto
,
UpdateGroup
.
class
,
DefaultGroup
.
class
);
pensionConsigneeService
.
update
(
dto
);
return
new
Result
();
}
@DeleteMapping
@ApiOperation
(
"删除"
)
@LogOperation
(
"删除"
)
@RequiresPermissions
(
"serviceOrder:pensionconsignee:delete"
)
public
Result
delete
(
@RequestBody
Long
[]
ids
){
//校验数据
AssertUtils
.
isArrayEmpty
(
ids
,
"id"
);
pensionConsigneeService
.
delete
(
ids
);
return
new
Result
();
}
@GetMapping
(
"export"
)
@ApiOperation
(
"导出"
)
@LogOperation
(
"导出"
)
@RequiresPermissions
(
"serviceOrder:pensionconsignee:export"
)
public
void
export
(
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
,
HttpServletResponse
response
)
throws
Exception
{
List
<
PensionConsigneeDTO
>
list
=
pensionConsigneeService
.
list
(
params
);
ExcelUtils
.
exportExcelToTarget
(
response
,
null
,
list
,
PensionConsigneeExcel
.
class
);
}
}
\ No newline at end of file
hmit-admin/src/main/java/io/hmit/modules/serviceOrder/dao/PensionConsigneeDao.java
0 → 100644
View file @
ffaaac0a
package
io
.
hmit
.
modules
.
serviceOrder
.
dao
;
import
io.hmit.common.dao.BaseDao
;
import
io.hmit.modules.serviceOrder.entity.PensionConsigneeEntity
;
import
org.apache.ibatis.annotations.Mapper
;
/**
*
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-05-06
*/
@Mapper
public
interface
PensionConsigneeDao
extends
BaseDao
<
PensionConsigneeEntity
>
{
}
\ No newline at end of file
hmit-admin/src/main/java/io/hmit/modules/serviceOrder/dto/PensionConsigneeDTO.java
0 → 100644
View file @
ffaaac0a
package
io
.
hmit
.
modules
.
serviceOrder
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
*
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-05-06
*/
@Data
@ApiModel
(
value
=
""
)
public
class
PensionConsigneeDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
""
)
private
Long
id
;
@ApiModelProperty
(
value
=
"用户ID"
)
private
Long
userId
;
@ApiModelProperty
(
value
=
"收货人姓名"
)
private
String
consigneeName
;
@ApiModelProperty
(
value
=
"收货人电话"
)
private
String
consigneeMobile
;
@ApiModelProperty
(
value
=
"省份"
)
private
String
consigneeProvince
;
@ApiModelProperty
(
value
=
"城市"
)
private
String
consigneeCity
;
@ApiModelProperty
(
value
=
"区/县"
)
private
String
consigneeDistrict
;
@ApiModelProperty
(
value
=
"详细地址"
)
private
String
consigneeAddress
;
@ApiModelProperty
(
value
=
"邮编"
)
private
String
consigneeZip
;
@ApiModelProperty
(
value
=
"是否为默认地址"
)
private
Integer
ifDefault
;
@ApiModelProperty
(
value
=
"状态"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createDate
;
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
updateDate
;
}
\ No newline at end of file
hmit-admin/src/main/java/io/hmit/modules/serviceOrder/entity/PensionConsigneeEntity.java
0 → 100644
View file @
ffaaac0a
package
io
.
hmit
.
modules
.
serviceOrder
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.hmit.common.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
/**
*
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-05-06
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"pension_consignee"
)
public
class
PensionConsigneeEntity
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 用户ID
*/
private
Long
userId
;
/**
* 收货人姓名
*/
private
String
consigneeName
;
/**
* 收货人电话
*/
private
String
consigneeMobile
;
/**
* 省份
*/
private
String
consigneeProvince
;
/**
* 城市
*/
private
String
consigneeCity
;
/**
* 区/县
*/
private
String
consigneeDistrict
;
/**
* 详细地址
*/
private
String
consigneeAddress
;
/**
* 邮编
*/
private
String
consigneeZip
;
/**
* 是否为默认地址
*/
private
Integer
ifDefault
;
/**
* 状态
*/
private
Integer
status
;
/**
* 备注
*/
private
String
remark
;
/**
* 更新时间
*/
private
Date
updateDate
;
}
\ No newline at end of file
hmit-admin/src/main/java/io/hmit/modules/serviceOrder/excel/PensionConsigneeExcel.java
0 → 100644
View file @
ffaaac0a
package
io
.
hmit
.
modules
.
serviceOrder
.
excel
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
lombok.Data
;
import
java.util.Date
;
/**
*
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-05-06
*/
@Data
public
class
PensionConsigneeExcel
{
@Excel
(
name
=
""
)
private
Long
id
;
@Excel
(
name
=
"用户ID"
)
private
Long
userId
;
@Excel
(
name
=
"收货人姓名"
)
private
String
consigneeName
;
@Excel
(
name
=
"收货人电话"
)
private
String
consigneeMobile
;
@Excel
(
name
=
"省份"
)
private
String
consigneeProvince
;
@Excel
(
name
=
"城市"
)
private
String
consigneeCity
;
@Excel
(
name
=
"区/县"
)
private
String
consigneeDistrict
;
@Excel
(
name
=
"详细地址"
)
private
String
consigneeAddress
;
@Excel
(
name
=
"邮编"
)
private
String
consigneeZip
;
@Excel
(
name
=
"是否为默认地址"
)
private
Integer
ifDefault
;
@Excel
(
name
=
"状态"
)
private
Integer
status
;
@Excel
(
name
=
"备注"
)
private
String
remark
;
@Excel
(
name
=
"创建时间"
)
private
Date
createDate
;
@Excel
(
name
=
"更新时间"
)
private
Date
updateDate
;
}
\ No newline at end of file
hmit-admin/src/main/java/io/hmit/modules/serviceOrder/service/PensionConsigneeService.java
0 → 100644
View file @
ffaaac0a
package
io
.
hmit
.
modules
.
serviceOrder
.
service
;
import
io.hmit.common.service.CrudService
;
import
io.hmit.modules.serviceOrder.dto.PensionConsigneeDTO
;
import
io.hmit.modules.serviceOrder.entity.PensionConsigneeEntity
;
/**
*
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-05-06
*/
public
interface
PensionConsigneeService
extends
CrudService
<
PensionConsigneeEntity
,
PensionConsigneeDTO
>
{
}
\ No newline at end of file
hmit-admin/src/main/java/io/hmit/modules/serviceOrder/service/impl/PensionConsigneeServiceImpl.java
0 → 100644
View file @
ffaaac0a
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.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.stereotype.Service
;
import
java.util.Map
;
/**
*
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-05-06
*/
@Service
public
class
PensionConsigneeServiceImpl
extends
CrudServiceImpl
<
PensionConsigneeDao
,
PensionConsigneeEntity
,
PensionConsigneeDTO
>
implements
PensionConsigneeService
{
@Override
public
QueryWrapper
<
PensionConsigneeEntity
>
getWrapper
(
Map
<
String
,
Object
>
params
){
String
id
=
(
String
)
params
.
get
(
"id"
);
QueryWrapper
<
PensionConsigneeEntity
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
id
),
"id"
,
id
);
return
wrapper
;
}
}
\ No newline at end of file
hmit-admin/src/main/resources/mapper/serviceOrder/PensionConsigneeDao.xml
0 → 100644
View file @
ffaaac0a
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"io.hmit.modules.serviceOrder.dao.PensionConsigneeDao"
>
<resultMap
type=
"io.hmit.modules.serviceOrder.entity.PensionConsigneeEntity"
id=
"pensionConsigneeMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"consigneeName"
column=
"consignee_name"
/>
<result
property=
"consigneeMobile"
column=
"consignee_mobile"
/>
<result
property=
"consigneeProvince"
column=
"consignee_province"
/>
<result
property=
"consigneeCity"
column=
"consignee_city"
/>
<result
property=
"consigneeDistrict"
column=
"consignee_district"
/>
<result
property=
"consigneeAddress"
column=
"consignee_address"
/>
<result
property=
"consigneeZip"
column=
"consignee_zip"
/>
<result
property=
"ifDefault"
column=
"if_default"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"remark"
column=
"remark"
/>
<result
property=
"createDate"
column=
"create_date"
/>
<result
property=
"updateDate"
column=
"update_date"
/>
</resultMap>
</mapper>
\ No newline at end of file
hmit-api/src/main/java/io/hmit/config/SwaggerConfig.java
View file @
ffaaac0a
...
...
@@ -27,7 +27,7 @@ public class SwaggerConfig {
@Bean
public
Docket
createRestApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
host
(
"byyl.zjhmit.com"
)
//
.host("byyl.zjhmit.com")
.
apiInfo
(
apiInfo
())
.
select
()
//加了ApiOperation注解的类,才生成接口文档
...
...
hmit-api/src/main/java/io/hmit/controller/UserController.java
View file @
ffaaac0a
...
...
@@ -14,6 +14,7 @@ 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.PensionOrderEvaluationDTO
;
import
io.hmit.modules.serviceOrder.dto.UserAddressDTO
;
import
io.hmit.modules.serviceOrder.service.PensionOldFamilyService
;
import
io.hmit.service.UserService
;
import
io.swagger.annotations.Api
;
...
...
@@ -98,5 +99,15 @@ public class UserController {
return
new
Result
();
}
@Login
@GetMapping
(
"findUserAdderss"
)
@ApiOperation
(
"根据手机号或用户姓名查找用户地址"
)
public
Result
<
List
<
UserAddressDTO
>>
findUserAdderss
(
@RequestParam
(
"str"
)
String
str
){
if
(
str
.
trim
().
isEmpty
())
{
return
new
Result
<
List
<
UserAddressDTO
>>().
ok
(
null
);
}
List
<
UserAddressDTO
>
userAddressDTOList
=
userService
.
findUserAddressByUsernameOrMobile
(
str
);
return
new
Result
<
List
<
UserAddressDTO
>>().
ok
(
userAddressDTOList
);
}
}
hmit-api/src/main/java/io/hmit/dao/UserDao.java
View file @
ffaaac0a
...
...
@@ -5,6 +5,7 @@ import io.hmit.dto.OrgUserInfoDTO;
import
io.hmit.dto.ServiceUserInfoDTO
;
import
io.hmit.dto.UserRegisterDTO
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.modules.serviceOrder.dto.UserAddressDTO
;
import
io.hmit.modules.serviceOrder.dto.UserRoleInfoDTO
;
import
org.apache.ibatis.annotations.Mapper
;
...
...
@@ -34,4 +35,9 @@ public interface UserDao extends BaseDao<UserEntity> {
UserRegisterDTO
getUserInfoByIdCardNo
(
Long
idCardNo
);
/**
* 根据用户手机号或姓名(模糊)查询用户地址
*/
List
<
UserAddressDTO
>
findUserAddressByUsernameOrMobile
(
String
username
,
String
mobile
);
}
hmit-api/src/main/java/io/hmit/modules/serviceOrder/controller/PensionConsigneeController.java
0 → 100644
View file @
ffaaac0a
package
io
.
hmit
.
modules
.
serviceOrder
.
controller
;
import
io.hmit.common.constant.Constant
;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.utils.Result
;
import
io.hmit.common.validator.AssertUtils
;
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.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
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
import
java.util.Map
;
/**
*
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-05-06
*/
@RestController
@RequestMapping
(
"serviceOrder/pensionconsignee"
)
@Api
(
tags
=
"用户地址"
)
public
class
PensionConsigneeController
{
@Autowired
private
PensionConsigneeService
pensionConsigneeService
;
@GetMapping
(
"page"
)
@ApiOperation
(
"分页"
)
@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"
)
})
public
Result
<
PageData
<
PensionConsigneeDTO
>>
page
(
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
){
PageData
<
PensionConsigneeDTO
>
page
=
pensionConsigneeService
.
page
(
params
);
return
new
Result
<
PageData
<
PensionConsigneeDTO
>>().
ok
(
page
);
}
@GetMapping
(
"{id}"
)
@ApiOperation
(
"信息"
)
public
Result
<
PensionConsigneeDTO
>
get
(
@PathVariable
(
"id"
)
Long
id
){
PensionConsigneeDTO
data
=
pensionConsigneeService
.
get
(
id
);
return
new
Result
<
PensionConsigneeDTO
>().
ok
(
data
);
}
@PostMapping
@ApiOperation
(
"保存"
)
public
Result
save
(
@RequestBody
PensionConsigneeDTO
dto
){
//校验数据
ValidatorUtils
.
validateEntity
(
dto
,
AddGroup
.
class
,
DefaultGroup
.
class
);
pensionConsigneeService
.
save
(
dto
);
return
new
Result
();
}
@PutMapping
@ApiOperation
(
"修改"
)
public
Result
update
(
@RequestBody
PensionConsigneeDTO
dto
){
//校验数据
ValidatorUtils
.
validateEntity
(
dto
,
UpdateGroup
.
class
,
DefaultGroup
.
class
);
pensionConsigneeService
.
update
(
dto
);
return
new
Result
();
}
@DeleteMapping
@ApiOperation
(
"删除"
)
public
Result
delete
(
@RequestBody
Long
[]
ids
){
//校验数据
AssertUtils
.
isArrayEmpty
(
ids
,
"id"
);
pensionConsigneeService
.
delete
(
ids
);
return
new
Result
();
}
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/modules/serviceOrder/controller/PensionOrderController.java
View file @
ffaaac0a
...
...
@@ -176,7 +176,7 @@ public class PensionOrderController {
}
@Login
@
Pu
tMapping
(
"takingOrder/{id}"
)
@
Ge
tMapping
(
"takingOrder/{id}"
)
@ApiOperation
(
"接单(志愿者)"
)
public
Result
takingOrder
(
@ApiIgnore
@LoginUser
UserEntity
user
,
@PathVariable
(
"id"
)
Long
id
){
...
...
hmit-api/src/main/java/io/hmit/modules/serviceOrder/dao/PensionConsigneeDao.java
0 → 100644
View file @
ffaaac0a
package
io
.
hmit
.
modules
.
serviceOrder
.
dao
;
import
io.hmit.common.dao.BaseDao
;
import
io.hmit.modules.serviceOrder.entity.PensionConsigneeEntity
;
import
org.apache.ibatis.annotations.Mapper
;
/**
*
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-05-06
*/
@Mapper
public
interface
PensionConsigneeDao
extends
BaseDao
<
PensionConsigneeEntity
>
{
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/modules/serviceOrder/dto/PensionConsigneeDTO.java
0 → 100644
View file @
ffaaac0a
package
io
.
hmit
.
modules
.
serviceOrder
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
*
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-05-06
*/
@Data
@ApiModel
(
value
=
""
)
public
class
PensionConsigneeDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
""
)
private
Long
id
;
@ApiModelProperty
(
value
=
"用户ID"
)
private
Long
userId
;
@ApiModelProperty
(
value
=
"收货人姓名"
)
private
String
consigneeName
;
@ApiModelProperty
(
value
=
"收货人电话"
)
private
String
consigneeMobile
;
@ApiModelProperty
(
value
=
"省份"
)
private
String
consigneeProvince
;
@ApiModelProperty
(
value
=
"城市"
)
private
String
consigneeCity
;
@ApiModelProperty
(
value
=
"区/县"
)
private
String
consigneeDistrict
;
@ApiModelProperty
(
value
=
"详细地址"
)
private
String
consigneeAddress
;
@ApiModelProperty
(
value
=
"邮编"
)
private
String
consigneeZip
;
@ApiModelProperty
(
value
=
"是否为默认地址"
)
private
Integer
ifDefault
;
@ApiModelProperty
(
value
=
"状态"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createDate
;
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
updateDate
;
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/modules/serviceOrder/dto/UserAddressDTO.java
0 → 100644
View file @
ffaaac0a
package
io
.
hmit
.
modules
.
serviceOrder
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @Description : 提供用户地址信息(非用户收货地址信息)
* @Author : Shen Yuanfeng
* @Date : 2021/5/6 13:30
*/
@Data
@ApiModel
(
value
=
"用户地址信息"
)
public
class
UserAddressDTO
{
@ApiModelProperty
(
value
=
"id"
)
private
String
id
;
@ApiModelProperty
(
value
=
"用户姓名"
)
private
String
username
;
@ApiModelProperty
(
value
=
"用户手机号"
)
private
String
mobile
;
@ApiModelProperty
(
value
=
"用户地址_地区"
)
private
String
addressArea
;
@ApiModelProperty
(
value
=
"用户详细地址"
)
private
String
address
;
}
hmit-api/src/main/java/io/hmit/modules/serviceOrder/entity/PensionConsigneeEntity.java
0 → 100644
View file @
ffaaac0a
package
io
.
hmit
.
modules
.
serviceOrder
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.hmit.common.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
/**
*
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-05-06
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"pension_consignee"
)
public
class
PensionConsigneeEntity
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 用户ID
*/
private
Long
userId
;
/**
* 收货人姓名
*/
private
String
consigneeName
;
/**
* 收货人电话
*/
private
String
consigneeMobile
;
/**
* 省份
*/
private
String
consigneeProvince
;
/**
* 城市
*/
private
String
consigneeCity
;
/**
* 区/县
*/
private
String
consigneeDistrict
;
/**
* 详细地址
*/
private
String
consigneeAddress
;
/**
* 邮编
*/
private
String
consigneeZip
;
/**
* 是否为默认地址
*/
private
Integer
ifDefault
;
/**
* 状态
*/
private
Integer
status
;
/**
* 备注
*/
private
String
remark
;
/**
* 更新时间
*/
private
Date
updateDate
;
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/PensionConsigneeService.java
0 → 100644
View file @
ffaaac0a
package
io
.
hmit
.
modules
.
serviceOrder
.
service
;
import
io.hmit.common.service.CrudService
;
import
io.hmit.modules.serviceOrder.dto.PensionConsigneeDTO
;
import
io.hmit.modules.serviceOrder.entity.PensionConsigneeEntity
;
/**
*
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-05-06
*/
public
interface
PensionConsigneeService
extends
CrudService
<
PensionConsigneeEntity
,
PensionConsigneeDTO
>
{
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/impl/PensionConsigneeServiceImpl.java
0 → 100644
View file @
ffaaac0a
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.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.stereotype.Service
;
import
java.util.Map
;
/**
*
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-05-06
*/
@Service
public
class
PensionConsigneeServiceImpl
extends
CrudServiceImpl
<
PensionConsigneeDao
,
PensionConsigneeEntity
,
PensionConsigneeDTO
>
implements
PensionConsigneeService
{
@Override
public
QueryWrapper
<
PensionConsigneeEntity
>
getWrapper
(
Map
<
String
,
Object
>
params
){
String
id
=
(
String
)
params
.
get
(
"id"
);
QueryWrapper
<
PensionConsigneeEntity
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
id
),
"id"
,
id
);
return
wrapper
;
}
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/service/UserService.java
View file @
ffaaac0a
...
...
@@ -5,7 +5,9 @@ import io.hmit.common.service.BaseService;
import
io.hmit.dto.*
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.modules.serviceOrder.dto.PensionOrderDTO
;
import
io.hmit.modules.serviceOrder.dto.UserAddressDTO
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -49,4 +51,6 @@ public interface UserService extends BaseService<UserEntity> {
void
registerUser
(
UserRegisterDTO
dto
);
List
<
UserAddressDTO
>
findUserAddressByUsernameOrMobile
(
String
str
);
}
hmit-api/src/main/java/io/hmit/service/impl/UserServiceImpl.java
View file @
ffaaac0a
...
...
@@ -12,6 +12,7 @@ import io.hmit.dao.UserDao;
import
io.hmit.dto.*
;
import
io.hmit.entity.TokenEntity
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.modules.serviceOrder.dto.UserAddressDTO
;
import
io.hmit.modules.serviceOrder.dto.UserRoleInfoDTO
;
import
io.hmit.modules.serviceOrder.service.PensionOldFamilyService
;
import
io.hmit.modules.serviceOrder.service.RoleUserService
;
...
...
@@ -24,6 +25,8 @@ import org.springframework.stereotype.Service;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
@Service
...
...
@@ -182,4 +185,21 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
}
}
@Override
public
List
<
UserAddressDTO
>
findUserAddressByUsernameOrMobile
(
String
str
)
{
List
<
UserAddressDTO
>
userAddress
=
null
;
String
mobile
=
null
;
if
(
str
.
length
()==
11
){
String
regex
=
"^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,5-9]))\\d{8}$"
;
Pattern
p
=
Pattern
.
compile
(
regex
);
Matcher
matcher
=
p
.
matcher
(
str
);
if
(
matcher
.
matches
())
{
mobile
=
str
;
str
=
null
;
}
}
userAddress
=
userDao
.
findUserAddressByUsernameOrMobile
(
str
,
mobile
);
return
userAddress
;
}
}
\ No newline at end of file
hmit-api/src/main/resources/mapper/UserDao.xml
View file @
ffaaac0a
...
...
@@ -44,4 +44,15 @@
WHERE tb_user.id_card_no = #{idCardNo};
</select>
<select
id=
"findUserAddressByUsernameOrMobile"
resultType=
"io.hmit.modules.serviceOrder.dto.UserAddressDTO"
>
SELECT tu.id, tu.username, tu.mobile, tu.address_area, tu.address
FROM tb_user tu WHERE
<if
test=
"username != null"
>
tu.username LIKE CONCAT('%', #{username}, '%')
</if>
<if
test=
"mobile != null"
>
tu.mobile = #{mobile}
</if>
</select>
</mapper>
\ No newline at end of file
hmit-api/src/main/resources/mapper/serviceOrder/PensionConsigneeDao.xml
0 → 100644
View file @
ffaaac0a
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"io.hmit.modules.serviceOrder.dao.PensionConsigneeDao"
>
<resultMap
type=
"io.hmit.modules.serviceOrder.entity.PensionConsigneeEntity"
id=
"pensionConsigneeMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"consigneeName"
column=
"consignee_name"
/>
<result
property=
"consigneeMobile"
column=
"consignee_mobile"
/>
<result
property=
"consigneeProvince"
column=
"consignee_province"
/>
<result
property=
"consigneeCity"
column=
"consignee_city"
/>
<result
property=
"consigneeDistrict"
column=
"consignee_district"
/>
<result
property=
"consigneeAddress"
column=
"consignee_address"
/>
<result
property=
"consigneeZip"
column=
"consignee_zip"
/>
<result
property=
"ifDefault"
column=
"if_default"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"remark"
column=
"remark"
/>
<result
property=
"createDate"
column=
"create_date"
/>
<result
property=
"updateDate"
column=
"update_date"
/>
</resultMap>
</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