Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
scrm
/
platform-merchants
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 ca447a70
authored
May 19, 2026
by
zhouhaibao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]v5.8.0版本删除类提交
1 parent
5667dd74
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
433 additions
and
0 deletions
platform-merchants-api/src/main/java/cn/com/glsx/merchants/model/request/CreateMerchantWithPermissionsRequest.java
platform-merchants-api/src/main/java/cn/com/glsx/merchants/model/request/QueryParentMerchantListRequest.java
platform-merchants-api/src/main/java/cn/com/glsx/merchants/model/response/CreateMerchantWithPermissionsResponse.java
platform-merchants-api/src/main/java/cn/com/glsx/merchants/model/response/ParentMerchantInfoResponse.java
platform-merchants-api/src/main/java/cn/com/glsx/merchants/remote/MerchantWithPermissionsRemote.java
platform-merchants-container/src/main/java/cn/com/glsx/merchants/remote/impl/MerchantWithPermissionsRemoteImpl.java
platform-merchants-api/src/main/java/cn/com/glsx/merchants/model/request/CreateMerchantWithPermissionsRequest.java
0 → 100644
View file @
ca447a7
package
cn
.
com
.
glsx
.
merchants
.
model
.
request
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Pattern
;
import
javax.validation.constraints.Size
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 创建园区店商户并分配权限请求DTO
*
* @author glsx
* @version 1.0
* @date 2026-04-20
*/
@Data
@ApiModel
(
value
=
"创建园区店商户并分配权限请求DTO"
,
description
=
"园区店商户创建请求参数"
)
public
class
CreateMerchantWithPermissionsRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 商户类型(园区店=9)
*/
@ApiModelProperty
(
value
=
"商户类型,园区店=9"
,
required
=
true
,
example
=
"9"
)
@NotNull
(
message
=
"商户类型不能为空"
)
private
Integer
merchantType
;
/**
* 账户等级:1-工厂、2-省代、3-市代、4-门店
*/
@ApiModelProperty
(
value
=
"账户等级:1-工厂、2-省代、3-市代、4-门店"
,
required
=
true
,
example
=
"4"
)
@NotNull
(
message
=
"账户等级不能为空"
)
private
Integer
merchantAccountLevel
;
@ApiModelProperty
(
value
=
"开通模式ID,账户等级=工厂时必填"
,
example
=
"1"
)
private
Integer
accessModeId
;
/**
* 上级商户ID(账户等级≠工厂时必填)
*/
@ApiModelProperty
(
value
=
"上级商户ID,账户等级≠工厂时必填"
,
example
=
"1001"
)
private
Integer
parentId
;
/**
* 渠道ID(账户等级=工厂时必填)
*/
@ApiModelProperty
(
value
=
"渠道ID,账户等级=工厂时必填"
,
example
=
"1"
)
@NotNull
(
message
=
"渠道ID不能为空"
)
private
Integer
channelId
;
/**
* 商户名称
*/
@ApiModelProperty
(
value
=
"商户名称"
,
required
=
true
,
example
=
"深圳嘀加店"
)
@NotBlank
(
message
=
"商户名称不能为空"
)
@Size
(
max
=
50
,
message
=
"商户名称最大50个字"
)
private
String
merchantName
;
/**
* 联系电话
*/
@ApiModelProperty
(
value
=
"联系电话"
,
required
=
true
,
example
=
"13800138000"
)
@NotBlank
(
message
=
"联系电话不能为空"
)
@Pattern
(
regexp
=
"^\\d{11}$"
,
message
=
"联系电话必须为11位纯数字"
)
private
String
contactPhone
;
/**
* 省编码
*/
@ApiModelProperty
(
value
=
"省编码"
,
required
=
true
,
example
=
"440000"
)
@NotNull
(
message
=
"省编码不能为空"
)
private
String
provinceCode
;
/**
* 省名称
*/
@ApiModelProperty
(
value
=
"省名称"
,
required
=
true
,
example
=
"广东省"
)
@NotBlank
(
message
=
"省名称不能为空"
)
private
String
provinceName
;
/**
* 市编码
*/
@ApiModelProperty
(
value
=
"市编码"
,
required
=
true
,
example
=
"440100"
)
@NotNull
(
message
=
"市编码不能为空"
)
private
String
cityCode
;
/**
* 市名称
*/
@ApiModelProperty
(
value
=
"市名称"
,
required
=
true
,
example
=
"深圳市"
)
@NotBlank
(
message
=
"市名称不能为空"
)
private
String
cityName
;
/**
* 区县编码
*/
@ApiModelProperty
(
value
=
"区县编码"
,
required
=
true
,
example
=
"440106"
)
@NotNull
(
message
=
"区县编码不能为空"
)
private
String
districtCode
;
/**
* 区县名称
*/
@ApiModelProperty
(
value
=
"区县名称"
,
required
=
true
,
example
=
"南山区"
)
@NotBlank
(
message
=
"区县名称不能为空"
)
private
String
districtName
;
/**
* 详细地址
*/
@ApiModelProperty
(
value
=
"详细地址"
,
required
=
true
,
example
=
"科技园南路88号"
)
@NotBlank
(
message
=
"详细地址不能为空"
)
private
String
detailAddress
;
/**
* 经度
*/
@ApiModelProperty
(
value
=
"经度"
,
example
=
"113.9433"
)
private
Float
longitude
;
/**
* 纬度
*/
@ApiModelProperty
(
value
=
"纬度"
,
example
=
"22.5485"
)
private
Float
latitude
;
/**
* 主营品牌列表
*/
@ApiModelProperty
(
value
=
"主营品牌列表"
,
required
=
true
)
@NotNull
(
message
=
"主营品牌不能为空"
)
private
List
<
MerchantBrandRequest
>
merchantBrandList
;
/**
* 登录账号
*/
@ApiModelProperty
(
value
=
"登录账号"
,
required
=
true
,
example
=
"djstore001"
)
@NotBlank
(
message
=
"登录账号不能为空"
)
@Pattern
(
regexp
=
"^[a-zA-Z0-9]{1,15}$"
,
message
=
"登录账号仅支持字母、数字,最大15位"
)
private
String
loginAccount
;
/**
* 登录密码
*/
@ApiModelProperty
(
value
=
"登录密码"
,
required
=
true
,
example
=
"Dj123456"
)
@NotBlank
(
message
=
"登录密码不能为空"
)
@Pattern
(
regexp
=
"^(?=.*[a-zA-Z])(?=.*\\d)[a-zA-Z\\d]{6,20}$"
,
message
=
"登录密码需6-20个字母+数字"
)
private
String
loginPassword
;
/**
* 创建人
*/
@ApiModelProperty
(
value
=
"创建人"
,
example
=
"admin"
)
@NotBlank
(
message
=
"创建人不能为空"
)
private
String
createdBy
;
/**
* 渠道来源
*/
@ApiModelProperty
(
value
=
"渠道来源"
,
example
=
"1"
)
@NotNull
(
message
=
"渠道来源不能为空"
)
private
String
source
;
/**
* 门店模式
*/
private
Integer
merchantModel
;
}
platform-merchants-api/src/main/java/cn/com/glsx/merchants/model/request/QueryParentMerchantListRequest.java
0 → 100644
View file @
ca447a7
package
cn
.
com
.
glsx
.
merchants
.
model
.
request
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
/**
* 查询上级商户列表请求DTO
*
* @author glsx
* @version 1.0
* @date 2026-04-20
*/
@Data
@ApiModel
(
value
=
"查询上级商户列表请求DTO"
,
description
=
"查询上级商户列表请求参数"
)
public
class
QueryParentMerchantListRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 当前商户的账户等级:1-工厂、2-省代、3-市代、4-门店
*/
@ApiModelProperty
(
value
=
"当前商户的账户等级:1-工厂、2-省代、3-市代、4-门店"
,
required
=
true
,
example
=
"4"
)
@NotNull
(
message
=
"账户等级不能为空"
)
private
Integer
currentAccountLevel
;
/**
* 商户类型:2-4S店、6-园区店、7-服务商
*/
@ApiModelProperty
(
value
=
"商户类型:2-4S店、6-园区店、7-服务商"
,
required
=
true
,
example
=
"6"
)
@NotNull
(
message
=
"商户类型不能为空"
)
private
Integer
merchantType
;
}
platform-merchants-api/src/main/java/cn/com/glsx/merchants/model/response/CreateMerchantWithPermissionsResponse.java
0 → 100644
View file @
ca447a7
package
cn
.
com
.
glsx
.
merchants
.
model
.
response
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 创建园区店商户并分配权限响应DTO
*
* @author glsx
* @version 1.0
* @date 2026-04-20
*/
@Data
@ApiModel
(
value
=
"创建园区店商户并分配权限响应DTO"
,
description
=
"园区店商户创建响应结果"
)
public
class
CreateMerchantWithPermissionsResponse
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 商户ID
*/
@ApiModelProperty
(
value
=
"商户ID"
,
example
=
"10001"
)
private
Integer
merchantId
;
/**
* 商户号
*/
@ApiModelProperty
(
value
=
"商户号"
,
example
=
"100010001"
)
private
Integer
merchantNo
;
/**
* 操作结果:true-成功,false-失败
*/
@ApiModelProperty
(
value
=
"操作结果:true-成功,false-失败"
,
example
=
"true"
)
private
Boolean
success
;
/**
* 提示信息
*/
@ApiModelProperty
(
value
=
"提示信息"
,
example
=
"商户创建成功"
)
private
String
message
;
}
\ No newline at end of file
\ No newline at end of file
platform-merchants-api/src/main/java/cn/com/glsx/merchants/model/response/ParentMerchantInfoResponse.java
0 → 100644
View file @
ca447a7
package
cn
.
com
.
glsx
.
merchants
.
model
.
response
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 上级商户信息响应DTO
*
* @author glsx
* @version 1.0
* @date 2026-04-20
*/
@Data
@ApiModel
(
value
=
"上级商户信息响应DTO"
,
description
=
"上级商户信息"
)
public
class
ParentMerchantInfoResponse
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 商户ID
*/
@ApiModelProperty
(
value
=
"商户ID"
,
example
=
"1001"
)
private
Integer
merchantId
;
/**
* 商户号
*/
@ApiModelProperty
(
value
=
"商户号"
,
example
=
"100010001"
)
private
Integer
merchantNo
;
/**
* 商户名称
*/
@ApiModelProperty
(
value
=
"商户名称"
,
example
=
"广东总代理"
)
private
String
merchantName
;
/**
* 账户等级:1-工厂、2-省代、3-市代、4-门店
*/
@ApiModelProperty
(
value
=
"账户等级:1-工厂、2-省代、3-市代、4-门店"
,
example
=
"2"
)
private
Byte
accountLevel
;
/**
* 商户类型:2-4S店、6-园区店、7-服务商
*/
@ApiModelProperty
(
value
=
"商户类型:2-4S店、6-园区店、7-服务商"
,
example
=
"6"
)
private
String
merchantType
;
}
platform-merchants-api/src/main/java/cn/com/glsx/merchants/remote/MerchantWithPermissionsRemote.java
0 → 100644
View file @
ca447a7
package
cn
.
com
.
glsx
.
merchants
.
remote
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.merchants.model.request.CreateMerchantWithPermissionsRequest
;
import
cn.com.glsx.merchants.model.request.QueryParentMerchantListRequest
;
import
cn.com.glsx.merchants.model.response.CreateMerchantWithPermissionsResponse
;
import
cn.com.glsx.merchants.model.response.ParentMerchantInfoResponse
;
import
java.util.List
;
/**
* 创建商户并分配权限远程接口
*
* @author glsx
* @version 1.0
* @date 2026-04-20
*/
public
interface
MerchantWithPermissionsRemote
{
/**
* 创建园区店商户并分配权限
*
* @param request 创建商户请求参数
* @return 创建结果
*/
RpcResponse
<
CreateMerchantWithPermissionsResponse
>
createMerchantWithPermissions
(
CreateMerchantWithPermissionsRequest
request
);
/**
* 查询上级商户列表
* <p>
* 根据当前商户的账户等级和商户类型,查询账户等级大于当前等级的全部商户
* </p>
*
* @param request 查询参数
* @return 上级商户列表
*/
RpcResponse
<
List
<
ParentMerchantInfoResponse
>>
queryParentMerchantList
(
QueryParentMerchantListRequest
request
);
}
platform-merchants-container/src/main/java/cn/com/glsx/merchants/remote/impl/MerchantWithPermissionsRemoteImpl.java
0 → 100644
View file @
ca447a7
package
cn
.
com
.
glsx
.
merchants
.
remote
.
impl
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.merchants.model.request.CreateMerchantWithPermissionsRequest
;
import
cn.com.glsx.merchants.model.request.QueryParentMerchantListRequest
;
import
cn.com.glsx.merchants.model.response.CreateMerchantWithPermissionsResponse
;
import
cn.com.glsx.merchants.model.response.MerchantResponse
;
import
cn.com.glsx.merchants.model.response.ParentMerchantInfoResponse
;
import
cn.com.glsx.merchants.remote.MerchantWithPermissionsRemote
;
import
cn.com.glsx.merchants.service.MerchantService
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.commons.collections4.CollectionUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.dubbo.config.annotation.DubboService
;
import
org.springframework.beans.factory.annotation.Autowired
;
/**
* 创建商户并分配权限远程接口实现类
*
* @author glsx
* @version 1.0
* @date 2026-04-20
*/
@Slf4j
@DubboService
(
version
=
"1.0.0"
,
timeout
=
30000
)
public
class
MerchantWithPermissionsRemoteImpl
implements
MerchantWithPermissionsRemote
{
@Autowired
private
MerchantService
merchantService
;
@Override
public
RpcResponse
<
CreateMerchantWithPermissionsResponse
>
createMerchantWithPermissions
(
CreateMerchantWithPermissionsRequest
request
)
{
log
.
info
(
"RPC创建园区店商户并分配权限,商户名称:{}"
,
request
.
getMerchantName
());
try
{
CreateMerchantWithPermissionsResponse
response
=
merchantService
.
createMerchantWithPermissions
(
request
);
log
.
info
(
"RPC创建园区店商户成功,商户ID:{}"
,
response
);
return
RpcResponse
.
success
(
response
);
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"RPC创建园区店商户失败:{}"
,
e
.
getMessage
(),
e
);
return
RpcResponse
.
error
(
e
.
getError
(),
e
.
getMessage
());
}
catch
(
Exception
e
)
{
log
.
error
(
"RPC创建园区店商户发生异常:{}"
,
e
.
getMessage
(),
e
);
return
RpcResponse
.
error
(
cn
.
com
.
glsx
.
framework
.
core
.
enums
.
DefaultErrorEnum
.
SERVER_ERROR
,
"系统异常,请稍后重试"
);
}
}
@Override
public
RpcResponse
<
List
<
ParentMerchantInfoResponse
>>
queryParentMerchantList
(
QueryParentMerchantListRequest
request
)
{
log
.
info
(
"RPC查询上级商户列表,当前账户等级:{},商户类型:{}"
,
request
.
getCurrentAccountLevel
(),
request
.
getMerchantType
());
try
{
// 调用MerchantService查询上级商户列表
List
<
MerchantResponse
>
merchantList
=
merchantService
.
queryParentMerchantList
(
request
.
getCurrentAccountLevel
(),
request
.
getMerchantType
()
);
// 转换为ParentMerchantInfoResponse列表
List
<
ParentMerchantInfoResponse
>
responseList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
merchantList
))
{
for
(
MerchantResponse
merchant
:
merchantList
)
{
ParentMerchantInfoResponse
response
=
new
ParentMerchantInfoResponse
();
response
.
setMerchantId
(
merchant
.
getId
());
response
.
setMerchantNo
(
merchant
.
getMerchantNo
());
response
.
setMerchantName
(
merchant
.
getMerchantName
());
response
.
setAccountLevel
(
merchant
.
getMerchantAccountLevel
());
response
.
setMerchantType
(
merchant
.
getAccountType
());
responseList
.
add
(
response
);
}
}
log
.
info
(
"RPC查询上级商户列表成功,返回{}条记录"
,
responseList
.
size
());
return
RpcResponse
.
success
(
responseList
);
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"RPC查询上级商户列表失败:{}"
,
e
.
getMessage
(),
e
);
return
RpcResponse
.
error
(
e
.
getError
(),
e
.
getMessage
());
}
catch
(
Exception
e
)
{
log
.
error
(
"RPC查询上级商户列表发生异常:{}"
,
e
.
getMessage
(),
e
);
return
RpcResponse
.
error
(
cn
.
com
.
glsx
.
framework
.
core
.
enums
.
DefaultErrorEnum
.
SERVER_ERROR
,
"系统异常,请稍后重试"
);
}
}
}
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