Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
scrm
/
rop-merchant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a3aef103
authored
Jul 27, 2021
by
zhouhb
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]代码提交
1 parent
4e232cac
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
216 additions
and
64 deletions
src/main/java/cn/com/glsx/merchants/controller/MerchantController.java
src/main/java/cn/com/glsx/merchants/convert/ConvertRequest.java
src/main/java/cn/com/glsx/merchants/request/file/FileSaveRequest.java
src/main/java/cn/com/glsx/merchants/request/merchant/AccountTypeTreeRequest.java → src/main/java/cn/com/glsx/merchants/request/merchant/AccountTypeTreeRopRequest.java
src/main/java/cn/com/glsx/merchants/request/merchant/FunctionTreeRequest.java → src/main/java/cn/com/glsx/merchants/request/merchant/FunctionTreeRopRequest.java
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantDetailRequest.java
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantSaveRequest.java
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantSearchResquest.java
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantTreeRopRequest.java
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantUpdateRequest.java
src/main/java/cn/com/glsx/merchants/request/merchant/ProductTreeRequest.java → src/main/java/cn/com/glsx/merchants/request/merchant/ProductTreeRopRequest.java
src/main/java/cn/com/glsx/merchants/request/staff/StaffPageRequest.java
src/main/java/cn/com/glsx/merchants/request/staff/StaffSaveRequest.java
src/main/java/cn/com/glsx/merchants/request/staff/StaffUpdateRequest.java
src/main/java/cn/com/glsx/merchants/response/MerchantRopResponse.java
src/main/java/cn/com/glsx/merchants/response/StaffResponse.java
src/main/java/cn/com/glsx/merchants/service/MerchantService.java
src/main/java/cn/com/glsx/merchants/service/StaffService.java
src/main/java/cn/com/glsx/merchants/controller/MerchantController.java
View file @
a3aef10
...
@@ -17,6 +17,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -17,6 +17,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.ResponseBody
;
import
java.util.List
;
import
java.util.List
;
...
...
src/main/java/cn/com/glsx/merchants/convert/ConvertRequest.java
View file @
a3aef10
...
@@ -3,6 +3,9 @@ package cn.com.glsx.merchants.convert;
...
@@ -3,6 +3,9 @@ package cn.com.glsx.merchants.convert;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
/**
* @author zhouhaibao
* @author zhouhaibao
* @version 1.0
* @version 1.0
...
@@ -25,6 +28,24 @@ public class ConvertRequest {
...
@@ -25,6 +28,24 @@ public class ConvertRequest {
}
}
/**
/**
* 转化请求参数List
*
* @param list 原入参
* @param clazz 转后后的参数
* @param <T> 泛型
* @return
*/
public
static
<
E
,
T
>
List
<
T
>
convertListRequest
(
List
<
E
>
list
,
Class
<
T
>
clazz
)
{
List
<
T
>
tList
=
new
ArrayList
<>();
list
.
forEach
(
index
->
{
T
target
=
BeanUtils
.
instantiateClass
(
clazz
);
BeanUtils
.
copyProperties
(
index
,
target
);
tList
.
add
(
target
);
});
return
tList
;
}
/**
* 分页对象转化参数
* 分页对象转化参数
*
*
* @param old 原入参
* @param old 原入参
...
...
src/main/java/cn/com/glsx/merchants/request/file/FileSaveRequest.java
View file @
a3aef10
package
cn
.
com
.
glsx
.
merchants
.
request
.
file
;
package
cn
.
com
.
glsx
.
merchants
.
request
.
file
;
import
com.rop.AbstractRopRequest
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -17,10 +18,12 @@ public class FileSaveRequest extends AbstractRopRequest implements Serializable
...
@@ -17,10 +18,12 @@ public class FileSaveRequest extends AbstractRopRequest implements Serializable
/**
/**
* 图片路径
* 图片路径
*/
*/
@ApiModelProperty
(
notes
=
"图片路径"
,
required
=
true
)
private
String
fileUrl
;
private
String
fileUrl
;
/**
/**
* 图片名称
* 图片名称
*/
*/
@ApiModelProperty
(
notes
=
"图片名称"
,
required
=
true
)
private
String
fileName
;
private
String
fileName
;
}
}
src/main/java/cn/com/glsx/merchants/request/merchant/AccountTypeTreeRequest.java
→
src/main/java/cn/com/glsx/merchants/request/merchant/AccountTypeTreeR
opR
equest.java
View file @
a3aef10
...
@@ -3,6 +3,7 @@ package cn.com.glsx.merchants.request.merchant;
...
@@ -3,6 +3,7 @@ package cn.com.glsx.merchants.request.merchant;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -12,11 +13,11 @@ import java.util.List;
...
@@ -12,11 +13,11 @@ import java.util.List;
* @date 2021/7/22 9:38
* @date 2021/7/22 9:38
*/
*/
@Data
@Data
public
class
AccountTypeTreeR
equest
{
public
class
AccountTypeTreeR
opRequest
implements
Serializable
{
@ApiModelProperty
(
notes
=
"账户id"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"账户id"
,
required
=
true
)
private
Integer
accountTypeId
;
private
Integer
accountTypeId
;
@ApiModelProperty
(
notes
=
"产品"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"产品"
,
required
=
true
)
private
List
<
ProductTreeRequest
>
products
;
private
List
<
ProductTreeR
opR
equest
>
products
;
}
}
src/main/java/cn/com/glsx/merchants/request/merchant/FunctionTreeRequest.java
→
src/main/java/cn/com/glsx/merchants/request/merchant/FunctionTreeR
opR
equest.java
View file @
a3aef10
...
@@ -3,6 +3,8 @@ package cn.com.glsx.merchants.request.merchant;
...
@@ -3,6 +3,8 @@ package cn.com.glsx.merchants.request.merchant;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
/**
* @author zhouhaibao
* @author zhouhaibao
* @version 1.0
* @version 1.0
...
@@ -10,7 +12,7 @@ import lombok.Data;
...
@@ -10,7 +12,7 @@ import lombok.Data;
* @date 2021/7/22 9:41
* @date 2021/7/22 9:41
*/
*/
@Data
@Data
public
class
FunctionTreeR
equest
{
public
class
FunctionTreeR
opRequest
implements
Serializable
{
@ApiModelProperty
(
notes
=
"功能值"
)
@ApiModelProperty
(
notes
=
"功能值"
)
private
String
functionvalue
;
private
String
functionvalue
;
...
...
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantDetailRequest.java
View file @
a3aef10
...
@@ -4,6 +4,8 @@ import cn.com.glsx.merchants.request.DefaultRequest;
...
@@ -4,6 +4,8 @@ import cn.com.glsx.merchants.request.DefaultRequest;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
/**
* @author zhouhaibao
* @author zhouhaibao
* @version 1.0
* @version 1.0
...
@@ -11,7 +13,7 @@ import lombok.Data;
...
@@ -11,7 +13,7 @@ import lombok.Data;
* @date 2021/7/22 11:14
* @date 2021/7/22 11:14
*/
*/
@Data
@Data
public
class
MerchantDetailRequest
extends
DefaultRequest
{
public
class
MerchantDetailRequest
extends
DefaultRequest
implements
Serializable
{
@ApiModelProperty
(
notes
=
"商户id"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"商户id"
,
required
=
true
)
private
Integer
id
;
private
Integer
id
;
...
...
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantSaveRequest.java
View file @
a3aef10
...
@@ -64,13 +64,19 @@ public class MerchantSaveRequest extends DefaultRequest implements Serializable
...
@@ -64,13 +64,19 @@ public class MerchantSaveRequest extends DefaultRequest implements Serializable
* 营业范围
* 营业范围
*/
*/
@ApiModelProperty
(
notes
=
"营业范围"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"营业范围"
,
required
=
true
)
private
Byte
businessScope
;
private
String
businessScope
;
/**
* 自定义营业范围
*/
@ApiModelProperty
(
notes
=
"自定义营业范围"
)
private
String
businessScopeCustomize
;
/**
/**
* 品牌
* 品牌
*/
*/
@ApiModelProperty
(
notes
=
"品牌"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"品牌"
,
required
=
true
)
private
Byte
merchantBrand
;
private
String
merchantBrand
;
/**
/**
* 登录账户
* 登录账户
...
@@ -110,6 +116,12 @@ public class MerchantSaveRequest extends DefaultRequest implements Serializable
...
@@ -110,6 +116,12 @@ public class MerchantSaveRequest extends DefaultRequest implements Serializable
private
String
residentPhone
;
private
String
residentPhone
;
/**
/**
* 过期时间
*/
@ApiModelProperty
(
notes
=
"过期时间"
)
private
Integer
effectiveTime
;
/**
* 区域
* 区域
*/
*/
@ApiModelProperty
(
notes
=
"区域"
)
@ApiModelProperty
(
notes
=
"区域"
)
...
@@ -146,12 +158,6 @@ public class MerchantSaveRequest extends DefaultRequest implements Serializable
...
@@ -146,12 +158,6 @@ public class MerchantSaveRequest extends DefaultRequest implements Serializable
private
Byte
status
;
private
Byte
status
;
/**
/**
* 有效时间
*/
@ApiModelProperty
(
notes
=
"有效时间"
,
required
=
true
)
private
Integer
effectiveTime
;
/**
* 账户类型
* 账户类型
*/
*/
@ApiModelProperty
(
notes
=
"账户类型"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"账户类型"
,
required
=
true
)
...
...
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantSearchResquest.java
View file @
a3aef10
...
@@ -17,20 +17,20 @@ import java.util.List;
...
@@ -17,20 +17,20 @@ import java.util.List;
@Data
@Data
public
class
MerchantSearchResquest
extends
AbstractRopRequest
{
public
class
MerchantSearchResquest
extends
AbstractRopRequest
{
@ApiModelProperty
(
notes
=
"商户
类型
"
)
@ApiModelProperty
(
notes
=
"商户
名称
"
)
private
String
merchantName
;
private
String
merchantName
;
@ApiModelProperty
(
notes
=
"账户层级"
)
@ApiModelProperty
(
notes
=
"账户层级"
)
private
Integer
merchant
_account_l
evel
;
private
Integer
merchant
AccountL
evel
;
@ApiModelProperty
(
notes
=
"账户状态"
)
@ApiModelProperty
(
notes
=
"账户状态"
)
private
Integer
status
;
private
Byte
status
;
@ApiModelProperty
(
notes
=
"渠道id"
)
@ApiModelProperty
(
notes
=
"渠道id"
)
private
Integer
channel
_i
d
;
private
Integer
channel
I
d
;
@ApiModelProperty
(
notes
=
"登录名"
)
@ApiModelProperty
(
notes
=
"登录名"
)
private
String
merchant
_login_a
ccount
;
private
String
merchant
LoginA
ccount
;
@ApiModelProperty
(
notes
=
"账户类型"
)
@ApiModelProperty
(
notes
=
"账户类型"
)
private
List
<
Integer
>
accounttypeId
;
private
List
<
Integer
>
accounttypeId
;
...
...
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantTreeRopRequest.java
View file @
a3aef10
package
cn
.
com
.
glsx
.
merchants
.
request
.
merchant
;
package
cn
.
com
.
glsx
.
merchants
.
request
.
merchant
;
import
cn.com.glsx.merchants.model.request.AccountTypeTreeRequest
;
import
cn.com.glsx.merchants.request.DefaultRequest
;
import
cn.com.glsx.merchants.request.DefaultRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -13,11 +15,11 @@ import java.util.List;
...
@@ -13,11 +15,11 @@ import java.util.List;
* @date 2021/7/22 9:34
* @date 2021/7/22 9:34
*/
*/
@Data
@Data
public
class
MerchantTreeRopRequest
extends
DefaultRequest
{
public
class
MerchantTreeRopRequest
extends
DefaultRequest
implements
Serializable
{
@ApiModelProperty
(
notes
=
"商户id"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"商户id"
,
required
=
true
)
private
Integer
merchantId
;
private
Integer
merchantId
;
@ApiModelProperty
(
notes
=
"账户类型"
,
required
=
true
)
private
List
<
AccountTypeTreeRequest
>
accountTypes
;
private
List
<
AccountTypeTreeRequest
>
accountTypes
;
}
}
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantUpdateRequest.java
View file @
a3aef10
...
@@ -67,13 +67,13 @@ public class MerchantUpdateRequest extends DefaultRequest implements Serializabl
...
@@ -67,13 +67,13 @@ public class MerchantUpdateRequest extends DefaultRequest implements Serializabl
* 营业范围
* 营业范围
*/
*/
@ApiModelProperty
(
notes
=
"营业范围"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"营业范围"
,
required
=
true
)
private
Byte
businessScope
;
private
String
businessScope
;
/**
/**
* 品牌
* 品牌
*/
*/
@ApiModelProperty
(
notes
=
"品牌"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"品牌"
,
required
=
true
)
private
Byte
merchantBrand
;
private
String
merchantBrand
;
/**
/**
* 登录账户
* 登录账户
...
@@ -154,5 +154,11 @@ public class MerchantUpdateRequest extends DefaultRequest implements Serializabl
...
@@ -154,5 +154,11 @@ public class MerchantUpdateRequest extends DefaultRequest implements Serializabl
@ApiModelProperty
(
notes
=
"文件数据"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"文件数据"
,
required
=
true
)
private
List
<
FileSaveRequest
>
merchantFiles
;
private
List
<
FileSaveRequest
>
merchantFiles
;
/**
* 自定义营业范围
*/
@ApiModelProperty
(
notes
=
"自定义营业范围"
)
private
String
businessScopeCustomize
;
}
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/merchants/request/merchant/ProductTreeRequest.java
→
src/main/java/cn/com/glsx/merchants/request/merchant/ProductTreeR
opR
equest.java
View file @
a3aef10
...
@@ -3,6 +3,7 @@ package cn.com.glsx.merchants.request.merchant;
...
@@ -3,6 +3,7 @@ package cn.com.glsx.merchants.request.merchant;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -12,7 +13,7 @@ import java.util.List;
...
@@ -12,7 +13,7 @@ import java.util.List;
* @date 2021/7/22 9:39
* @date 2021/7/22 9:39
*/
*/
@Data
@Data
public
class
ProductTreeR
equest
{
public
class
ProductTreeR
opRequest
implements
Serializable
{
@ApiModelProperty
(
notes
=
"产品id"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"产品id"
,
required
=
true
)
private
Integer
productId
;
private
Integer
productId
;
...
@@ -21,5 +22,5 @@ public class ProductTreeRequest {
...
@@ -21,5 +22,5 @@ public class ProductTreeRequest {
private
List
<
Integer
>
menuIds
;
private
List
<
Integer
>
menuIds
;
@ApiModelProperty
(
notes
=
"功能"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"功能"
,
required
=
true
)
private
List
<
FunctionTreeRequest
>
functionIds
;
private
List
<
FunctionTreeR
opR
equest
>
functionIds
;
}
}
src/main/java/cn/com/glsx/merchants/request/staff/StaffPageRequest.java
View file @
a3aef10
...
@@ -4,6 +4,8 @@ import com.rop.AbstractRopRequest;
...
@@ -4,6 +4,8 @@ import com.rop.AbstractRopRequest;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
/**
/**
* @author zhouhaibao
* @author zhouhaibao
* @version 1.0
* @version 1.0
...
@@ -24,4 +26,12 @@ public class StaffPageRequest extends AbstractRopRequest {
...
@@ -24,4 +26,12 @@ public class StaffPageRequest extends AbstractRopRequest {
@ApiModelProperty
(
notes
=
"创建人"
)
@ApiModelProperty
(
notes
=
"创建人"
)
private
String
createdAccount
;
private
String
createdAccount
;
@NotNull
@ApiModelProperty
(
notes
=
"分页数"
,
name
=
"pageSize"
,
dataType
=
"Integer"
)
private
Integer
pageSize
;
@NotNull
@ApiModelProperty
(
notes
=
"当前页"
,
name
=
"pageNum"
,
dataType
=
"Integer"
)
private
Integer
pageNum
;
}
}
src/main/java/cn/com/glsx/merchants/request/staff/StaffSaveRequest.java
View file @
a3aef10
...
@@ -29,6 +29,18 @@ public class StaffSaveRequest extends DefaultRequest {
...
@@ -29,6 +29,18 @@ public class StaffSaveRequest extends DefaultRequest {
private
String
staffJob
;
private
String
staffJob
;
/**
/**
* 密码
*/
@ApiModelProperty
(
notes
=
"密码"
,
required
=
true
)
private
String
password
;
/**
* 可见下级商户id
*/
@ApiModelProperty
(
notes
=
"可见下级商户id"
,
required
=
true
)
private
String
visibleInferiorMer
;
/**
* 手机号
* 手机号
*/
*/
@ApiModelProperty
(
notes
=
"手机号"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"手机号"
,
required
=
true
)
...
@@ -52,11 +64,7 @@ public class StaffSaveRequest extends DefaultRequest {
...
@@ -52,11 +64,7 @@ public class StaffSaveRequest extends DefaultRequest {
@ApiModelProperty
(
notes
=
"角色id"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"角色id"
,
required
=
true
)
private
List
<
Integer
>
roleIds
;
private
List
<
Integer
>
roleIds
;
@ApiModelProperty
(
notes
=
"头像"
,
required
=
true
)
private
FileSaveRequest
merchantFileRequest
;
private
FileSaveRequest
merchantFileRequest
;
@ApiModelProperty
(
notes
=
"用户信息"
,
required
=
true
)
private
MerchantUserRopRequest
merchantUserRequest
;
}
}
src/main/java/cn/com/glsx/merchants/request/staff/StaffUpdateRequest.java
View file @
a3aef10
...
@@ -35,12 +35,24 @@ public class StaffUpdateRequest extends DefaultRequest {
...
@@ -35,12 +35,24 @@ public class StaffUpdateRequest extends DefaultRequest {
private
String
staffJob
;
private
String
staffJob
;
/**
/**
* 可见下级商户id
*/
@ApiModelProperty
(
notes
=
"可见下级商户id"
,
required
=
true
)
private
String
visibleInferiorMer
;
/**
* 手机号
* 手机号
*/
*/
@ApiModelProperty
(
notes
=
"手机号"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"手机号"
,
required
=
true
)
private
String
staffPhone
;
private
String
staffPhone
;
/**
/**
* 密码
*/
@ApiModelProperty
(
notes
=
"密码"
,
required
=
true
)
private
String
password
;
/**
* 商户id
* 商户id
*/
*/
@ApiModelProperty
(
notes
=
"商户id"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"商户id"
,
required
=
true
)
...
@@ -58,11 +70,6 @@ public class StaffUpdateRequest extends DefaultRequest {
...
@@ -58,11 +70,6 @@ public class StaffUpdateRequest extends DefaultRequest {
@ApiModelProperty
(
notes
=
"角色id"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"角色id"
,
required
=
true
)
private
List
<
Integer
>
roleIds
;
private
List
<
Integer
>
roleIds
;
@ApiModelProperty
(
notes
=
"头像"
,
required
=
true
)
private
FileSaveRequest
merchantFileRequest
;
private
FileSaveRequest
merchantFileRequest
;
@ApiModelProperty
(
notes
=
"用户信息"
,
required
=
true
)
private
MerchantUserRopRequest
merchantUserRequest
;
}
}
src/main/java/cn/com/glsx/merchants/response/MerchantRopResponse.java
View file @
a3aef10
package
cn
.
com
.
glsx
.
merchants
.
response
;
package
cn
.
com
.
glsx
.
merchants
.
response
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
@Data
@Data
@ApiModel
(
description
=
"商户"
)
public
class
MerchantRopResponse
{
public
class
MerchantRopResponse
{
@ApiModelProperty
(
name
=
"id"
,
notes
=
"商户id"
,
dataType
=
"Integer"
,
required
=
true
,
example
=
"1"
,
value
=
"商户id"
)
@ApiModelProperty
(
name
=
"id"
,
notes
=
"商户id"
,
dataType
=
"Integer"
,
required
=
true
,
example
=
"1"
,
value
=
"商户id"
)
...
@@ -62,18 +63,6 @@ public class MerchantRopResponse {
...
@@ -62,18 +63,6 @@ public class MerchantRopResponse {
private
Byte
isloginName
;
private
Byte
isloginName
;
/**
/**
* 营业范围
*/
@ApiModelProperty
(
name
=
"businessScope"
,
notes
=
"营业范围"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
)
private
String
businessScope
;
/**
* 品牌
*/
@ApiModelProperty
(
name
=
"merchantBrand"
,
notes
=
"品牌"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
)
private
String
merchantBrand
;
/**
* 登录账户
* 登录账户
*/
*/
@ApiModelProperty
(
name
=
"merchantLoginAccount"
,
notes
=
"登录账户"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
)
@ApiModelProperty
(
name
=
"merchantLoginAccount"
,
notes
=
"登录账户"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
)
...
@@ -95,9 +84,9 @@ public class MerchantRopResponse {
...
@@ -95,9 +84,9 @@ public class MerchantRopResponse {
/**
/**
* 创建时间
* 创建时间
*/
*/
@ApiModelProperty
(
name
=
"createdTime"
,
notes
=
"创建时间"
)
@ApiModelProperty
(
name
=
"createdTime"
,
notes
=
"创建时间"
,
dataType
=
"date"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createdTime
;
private
String
createdTime
;
/**
/**
...
@@ -128,22 +117,21 @@ public class MerchantRopResponse {
...
@@ -128,22 +117,21 @@ public class MerchantRopResponse {
* 营业开始时间
* 营业开始时间
*/
*/
@ApiModelProperty
(
name
=
"bussinessBegintime"
,
notes
=
"营业开始时间"
,
dataType
=
"Date"
,
required
=
true
,
example
=
"1"
)
@ApiModelProperty
(
name
=
"bussinessBegintime"
,
notes
=
"营业开始时间"
,
dataType
=
"Date"
,
required
=
true
,
example
=
"1"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
String
bussinessBegintime
;
private
Date
bussinessBegintime
;
/**
/**
* 营业结束时间
* 营业结束时间
*/
*/
@ApiModelProperty
(
name
=
"bussinessEndtime"
,
notes
=
"营业结束时间"
,
dataType
=
"Date"
,
required
=
true
,
example
=
"1"
)
@ApiModelProperty
(
name
=
"bussinessEndtime"
,
notes
=
"营业结束时间"
,
dataType
=
"Date"
,
required
=
true
,
example
=
"1"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
bussinessEndtime
;
private
String
bussinessEndtime
;
/**
/**
* 商户过期时间
* 商户过期时间
*/
*/
@ApiModelProperty
(
name
=
"expireDate"
,
notes
=
"商户过期时间"
,
dataType
=
"Date"
,
required
=
true
,
example
=
"1"
)
@ApiModelProperty
(
name
=
"expireDate"
,
notes
=
"商户过期时间"
,
dataType
=
"Date"
,
required
=
true
,
example
=
"1"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
expireDate
;
private
String
expireDate
;
/**
/**
* 1.草稿 2.发布 3.注销 4.过期
* 1.草稿 2.发布 3.注销 4.过期
...
@@ -160,11 +148,55 @@ public class MerchantRopResponse {
...
@@ -160,11 +148,55 @@ public class MerchantRopResponse {
/**
/**
* 父商户
* 父商户
*/
*/
@ApiModelProperty
(
name
=
"
status
"
,
notes
=
"父商户"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
)
@ApiModelProperty
(
name
=
"
parentMerchant
"
,
notes
=
"父商户"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
)
private
String
parentMerchant
;
private
String
parentMerchant
;
/**
* 商户号
*/
@ApiModelProperty
(
name
=
"merchantNo"
,
notes
=
"商户号"
,
dataType
=
"Integer"
,
required
=
true
,
example
=
"1"
)
private
Integer
merchantNo
;
/**
* 账户层级
*/
@ApiModelProperty
(
name
=
"accountLevelName"
,
notes
=
"账户层级"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
)
private
String
accountLevelName
;
/**
* 账户状态
*/
@ApiModelProperty
(
name
=
"statusName"
,
notes
=
"账户状态"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
)
private
String
statusName
;
/**
* 营业范围
*/
@ApiModelProperty
(
name
=
"businessScopName"
,
notes
=
"营业范围"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
)
private
String
businessScopName
;
/**
* 品牌
*/
@ApiModelProperty
(
name
=
"merchantBrandName"
,
notes
=
"品牌"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
)
private
String
merchantBrandName
;
/**
* 自定义营业范围
*/
@ApiModelProperty
(
name
=
"businessScopeCustomize"
,
notes
=
"自定义营业范围"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
)
private
String
businessScopeCustomize
;
/**
/**
* 关联关系
* 关联关系
*/
*/
private
List
<
AccountTypeTreeRopResponse
>
accountTypes
;
private
List
<
AccountTypeTreeRopResponse
>
accountTypes
;
/**
* 文件
*/
private
List
<
FileResponse
>
merchantFileResponses
;
}
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/merchants/response/StaffResponse.java
View file @
a3aef10
...
@@ -40,7 +40,7 @@ public class StaffResponse implements Serializable {
...
@@ -40,7 +40,7 @@ public class StaffResponse implements Serializable {
/**
/**
* 创建人
* 创建人
*/
*/
@ApiModelProperty
(
name
=
"createdBy"
,
notes
=
"
可见下级商户id
"
,
dataType
=
"Integer"
)
@ApiModelProperty
(
name
=
"createdBy"
,
notes
=
"
创建人
"
,
dataType
=
"Integer"
)
private
Integer
createdBy
;
private
Integer
createdBy
;
/**
/**
...
@@ -86,6 +86,24 @@ public class StaffResponse implements Serializable {
...
@@ -86,6 +86,24 @@ public class StaffResponse implements Serializable {
private
List
<
Integer
>
roleIds
;
private
List
<
Integer
>
roleIds
;
/**
/**
* 密码
*/
@ApiModelProperty
(
name
=
"password"
,
notes
=
"密码"
,
dataType
=
"String"
)
private
String
password
;
/**
* 商户
*/
@ApiModelProperty
(
name
=
"merchantName"
,
notes
=
"商户"
,
dataType
=
"String"
)
private
String
merchantName
;
/**
* 角色名称
*/
@ApiModelProperty
(
name
=
"roleName"
,
notes
=
"商户"
,
dataType
=
"String"
)
private
String
roleName
;
/**
* 文件
* 文件
*/
*/
private
FileResponse
merchantFileResponse
;
private
FileResponse
merchantFileResponse
;
...
...
src/main/java/cn/com/glsx/merchants/service/MerchantService.java
View file @
a3aef10
...
@@ -5,14 +5,13 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
...
@@ -5,14 +5,13 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.merchants.convert.ConvertRequest
;
import
cn.com.glsx.merchants.convert.ConvertRequest
;
import
cn.com.glsx.merchants.convert.ConvertResponse
;
import
cn.com.glsx.merchants.convert.ConvertResponse
;
import
cn.com.glsx.merchants.model.request.MerchantProductRequest
;
import
cn.com.glsx.merchants.model.request.*
;
import
cn.com.glsx.merchants.model.request.MerchantRequest
;
import
cn.com.glsx.merchants.model.request.MerchantTreeRequest
;
import
cn.com.glsx.merchants.model.response.AccountTypeTreeResponse
;
import
cn.com.glsx.merchants.model.response.AccountTypeTreeResponse
;
import
cn.com.glsx.merchants.model.response.MerchantProductResponse
;
import
cn.com.glsx.merchants.model.response.MerchantProductResponse
;
import
cn.com.glsx.merchants.model.response.MerchantResponse
;
import
cn.com.glsx.merchants.model.response.MerchantResponse
;
import
cn.com.glsx.merchants.model.response.MerchantTreeResponse
;
import
cn.com.glsx.merchants.model.response.MerchantTreeResponse
;
import
cn.com.glsx.merchants.remote.MerchantRemote
;
import
cn.com.glsx.merchants.remote.MerchantRemote
;
import
cn.com.glsx.merchants.request.file.FileSaveRequest
;
import
cn.com.glsx.merchants.request.merchant.*
;
import
cn.com.glsx.merchants.request.merchant.*
;
import
cn.com.glsx.merchants.response.*
;
import
cn.com.glsx.merchants.response.*
;
import
cn.com.glsx.merchants.util.Pagination
;
import
cn.com.glsx.merchants.util.Pagination
;
...
@@ -44,12 +43,27 @@ public class MerchantService {
...
@@ -44,12 +43,27 @@ public class MerchantService {
*/
*/
public
void
saveMerchant
(
MerchantSaveRequest
merchantSaveRequest
)
{
public
void
saveMerchant
(
MerchantSaveRequest
merchantSaveRequest
)
{
merchantUserService
.
setUser
(
merchantSaveRequest
);
merchantUserService
.
setUser
(
merchantSaveRequest
);
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantRemote
.
saveMerchantRemote
(
ConvertRequest
.
convertRequest
(
merchantSaveRequest
,
new
MerchantRequest
()
));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantRemote
.
saveMerchantRemote
(
converMerchant
(
merchantSaveRequest
));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
}
}
private
MerchantRequest
converMerchant
(
MerchantSaveRequest
merchantSaveRequest
)
{
MerchantRequest
merchantRequest
=
ConvertRequest
.
convertRequest
(
merchantSaveRequest
,
new
MerchantRequest
());
List
<
FileSaveRequest
>
merchantFiles
=
merchantSaveRequest
.
getMerchantFiles
();
merchantRequest
.
setMerchantFiles
(
ConvertRequest
.
convertListRequest
(
merchantFiles
,
MerchantFileRequest
.
class
));
return
merchantRequest
;
}
private
MerchantRequest
converUpdateMerchant
(
MerchantUpdateRequest
merchantUpdateRequest
)
{
MerchantRequest
merchantRequest
=
ConvertRequest
.
convertRequest
(
merchantUpdateRequest
,
new
MerchantRequest
());
List
<
FileSaveRequest
>
merchantFiles
=
merchantUpdateRequest
.
getMerchantFiles
();
merchantRequest
.
setMerchantFiles
(
ConvertRequest
.
convertListRequest
(
merchantFiles
,
MerchantFileRequest
.
class
));
return
merchantRequest
;
}
/**
/**
* 更新商户
* 更新商户
*
*
...
@@ -57,31 +71,33 @@ public class MerchantService {
...
@@ -57,31 +71,33 @@ public class MerchantService {
*/
*/
public
void
updateMerchant
(
MerchantUpdateRequest
merchantUpdateRequest
)
{
public
void
updateMerchant
(
MerchantUpdateRequest
merchantUpdateRequest
)
{
merchantUserService
.
setUser
(
merchantUpdateRequest
);
merchantUserService
.
setUser
(
merchantUpdateRequest
);
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantRemote
.
saveMerchantRemote
(
ConvertRequest
.
convertRequest
(
merchantUpdateRequest
,
new
MerchantRequest
()
));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantRemote
.
saveMerchantRemote
(
converUpdateMerchant
(
merchantUpdateRequest
));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
}
}
/**
/**
* 保存商户权限
喜喜
* 保存商户权限
*
*
* @param merchantTreeRequest 入参
* @param merchantTreeRequest 入参
*/
*/
public
void
savePermissions
(
MerchantTreeRopRequest
merchantTreeRequest
)
{
public
void
savePermissions
(
MerchantTreeRopRequest
merchantTreeRequest
)
{
MerchantTreeRequest
merchantTreeRequest1
=
ConvertRequest
.
convertRequest
(
merchantTreeRequest
,
new
MerchantTreeRequest
()
);
merchantUserService
.
setUser
(
merchantTreeRequest
);
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantRemote
.
savePermissionsRemote
(
merchantTreeRequest1
);
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantRemote
.
savePermissionsRemote
(
ConvertRequest
.
convertRequest
(
merchantTreeRequest
,
new
MerchantTreeRequest
())
);
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
}
}
/**
/**
* 更新商户权限
* 更新商户权限
*
*
* @param merchantTreeRequest 入参
* @param merchantTreeRequest 入参
*/
*/
public
void
updatePermissions
(
MerchantTreeRopRequest
merchantTreeRequest
)
{
public
void
updatePermissions
(
MerchantTreeRopRequest
merchantTreeRequest
)
{
merchantUserService
.
setUser
(
merchantTreeRequest
);
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantRemote
.
updatePermissionsRemote
(
ConvertRequest
.
convertRequest
(
merchantTreeRequest
,
new
MerchantTreeRequest
()));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantRemote
.
updatePermissionsRemote
(
ConvertRequest
.
convertRequest
(
merchantTreeRequest
,
new
MerchantTreeRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
...
...
src/main/java/cn/com/glsx/merchants/service/StaffService.java
View file @
a3aef10
...
@@ -5,11 +5,13 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
...
@@ -5,11 +5,13 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.merchants.convert.ConvertRequest
;
import
cn.com.glsx.merchants.convert.ConvertRequest
;
import
cn.com.glsx.merchants.convert.ConvertResponse
;
import
cn.com.glsx.merchants.convert.ConvertResponse
;
import
cn.com.glsx.merchants.model.request.MerchantFileRequest
;
import
cn.com.glsx.merchants.model.request.MerchantRequest
;
import
cn.com.glsx.merchants.model.request.MerchantRequest
;
import
cn.com.glsx.merchants.model.request.MerchantStaffRequest
;
import
cn.com.glsx.merchants.model.request.MerchantStaffRequest
;
import
cn.com.glsx.merchants.model.response.MerchantResponse
;
import
cn.com.glsx.merchants.model.response.MerchantResponse
;
import
cn.com.glsx.merchants.model.response.MerchantStaffResponse
;
import
cn.com.glsx.merchants.model.response.MerchantStaffResponse
;
import
cn.com.glsx.merchants.remote.MerchantStaffRemote
;
import
cn.com.glsx.merchants.remote.MerchantStaffRemote
;
import
cn.com.glsx.merchants.request.file.FileSaveRequest
;
import
cn.com.glsx.merchants.request.staff.*
;
import
cn.com.glsx.merchants.request.staff.*
;
import
cn.com.glsx.merchants.response.MerchantRopResponse
;
import
cn.com.glsx.merchants.response.MerchantRopResponse
;
import
cn.com.glsx.merchants.response.StaffResponse
;
import
cn.com.glsx.merchants.response.StaffResponse
;
...
@@ -43,12 +45,26 @@ public class StaffService {
...
@@ -43,12 +45,26 @@ public class StaffService {
*/
*/
public
void
saveStaff
(
StaffSaveRequest
staffSaveRequest
)
{
public
void
saveStaff
(
StaffSaveRequest
staffSaveRequest
)
{
merchantUserService
.
setUser
(
staffSaveRequest
);
merchantUserService
.
setUser
(
staffSaveRequest
);
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantStaffRemote
.
saveStaffRemote
(
ConvertRequest
.
convertRequest
(
staffSaveRequest
,
new
MerchantStaffRequest
()
));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantStaffRemote
.
saveStaffRemote
(
converRequest
(
staffSaveRequest
));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
}
}
private
MerchantStaffRequest
converRequest
(
StaffSaveRequest
staffSaveRequest
)
{
MerchantStaffRequest
merchantStaffRequest
=
ConvertRequest
.
convertRequest
(
staffSaveRequest
,
new
MerchantStaffRequest
());
FileSaveRequest
merchantFileRequest
=
staffSaveRequest
.
getMerchantFileRequest
();
merchantStaffRequest
.
setMerchantFileRequest
(
ConvertRequest
.
convertRequest
(
merchantFileRequest
,
new
MerchantFileRequest
()));
return
merchantStaffRequest
;
}
private
MerchantStaffRequest
converRequest
(
StaffUpdateRequest
staffUpdateRequest
)
{
MerchantStaffRequest
merchantStaffRequest
=
ConvertRequest
.
convertRequest
(
staffUpdateRequest
,
new
MerchantStaffRequest
());
FileSaveRequest
merchantFileRequest
=
staffUpdateRequest
.
getMerchantFileRequest
();
merchantStaffRequest
.
setMerchantFileRequest
(
ConvertRequest
.
convertRequest
(
merchantFileRequest
,
new
MerchantFileRequest
()));
return
merchantStaffRequest
;
}
/**
/**
* 更新员工
* 更新员工
*
*
...
@@ -56,7 +72,7 @@ public class StaffService {
...
@@ -56,7 +72,7 @@ public class StaffService {
*/
*/
public
void
updateStaff
(
StaffUpdateRequest
staffUpdateRequest
)
{
public
void
updateStaff
(
StaffUpdateRequest
staffUpdateRequest
)
{
merchantUserService
.
setUser
(
staffUpdateRequest
);
merchantUserService
.
setUser
(
staffUpdateRequest
);
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantStaffRemote
.
updateStaffRemote
(
ConvertRequest
.
convertRequest
(
staffUpdateRequest
,
new
MerchantStaffRequest
()
));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantStaffRemote
.
updateStaffRemote
(
converRequest
(
staffUpdateRequest
));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
...
@@ -69,7 +85,7 @@ public class StaffService {
...
@@ -69,7 +85,7 @@ public class StaffService {
*/
*/
public
void
deleteStaff
(
StaffDeleteRequest
staffDeleteRequest
)
{
public
void
deleteStaff
(
StaffDeleteRequest
staffDeleteRequest
)
{
merchantUserService
.
setUser
(
staffDeleteRequest
);
merchantUserService
.
setUser
(
staffDeleteRequest
);
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantStaffRemote
.
upda
teStaffRemote
(
ConvertRequest
.
convertRequest
(
staffDeleteRequest
,
new
MerchantStaffRequest
()));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantStaffRemote
.
dele
teStaffRemote
(
ConvertRequest
.
convertRequest
(
staffDeleteRequest
,
new
MerchantStaffRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment