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 b7aa003e
authored
Dec 01, 2023
by
yelq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Merge all from scrm_v3.21.0_20231131rop-merchant
1 parent
907f17ed
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
142 additions
and
8 deletions
pom.xml
src/main/java/cn/com/glsx/merchants/controller/MerchantController.java
src/main/java/cn/com/glsx/merchants/request/menu/BuildMenuParam.java
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantTreeRopRequest.java
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantUpdatePathRequest.java
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantUpdateRopRequest.java
src/main/java/cn/com/glsx/merchants/request/open/MerchantListOpenRequest.java
src/main/java/cn/com/glsx/merchants/response/MerchantRopResponse.java
src/main/java/cn/com/glsx/merchants/service/MerchantService.java
src/main/java/cn/com/glsx/merchants/service/OpenService.java
pom.xml
View file @
b7aa003
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<dependency>
<dependency>
<groupId>
cn.com.glsx.merchants
</groupId>
<groupId>
cn.com.glsx.merchants
</groupId>
<artifactId>
platform-merchants-api
</artifactId>
<artifactId>
platform-merchants-api
</artifactId>
<version>
3.2
1.2
-SNAPSHOT
</version>
<version>
3.2
2.0
-SNAPSHOT
</version>
</dependency>
</dependency>
<!--引用GSON,用于打印-->
<!--引用GSON,用于打印-->
<dependency>
<dependency>
...
...
src/main/java/cn/com/glsx/merchants/controller/MerchantController.java
View file @
b7aa003
...
@@ -291,7 +291,7 @@ public class MerchantController {
...
@@ -291,7 +291,7 @@ public class MerchantController {
*/
*/
@ServiceMethod
(
method
=
"merchants.api.merchant.updatePermissions"
,
needInSession
=
NeedInSessionType
.
NO
)
@ServiceMethod
(
method
=
"merchants.api.merchant.updatePermissions"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"更新商户权限信息"
)
@ApiOperation
(
"更新商户权限信息"
)
public
RopResponse
<
Boolean
>
updatePermissions
(
@RequestBody
MerchantTreeRopRequest
merchantTreeRequest
)
{
public
RopResponse
<
Boolean
>
updatePermissions
(
MerchantTreeRopRequest
merchantTreeRequest
)
{
try
{
try
{
merchantService
.
updatePermissions
(
merchantTreeRequest
);
merchantService
.
updatePermissions
(
merchantTreeRequest
);
return
RopResponse
.
success
(
true
);
return
RopResponse
.
success
(
true
);
...
@@ -554,4 +554,39 @@ public class MerchantController {
...
@@ -554,4 +554,39 @@ public class MerchantController {
}
}
}
}
@ServiceMethod
(
method
=
"merchants.api.merchant.update.accountType"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"更新商户账户类型"
)
public
RopResponse
<
Boolean
>
updateAccountType
(
MerchantUpdateRopRequest
request
)
{
try
{
return
RopResponse
.
success
(
merchantService
.
updateAccountType
(
request
));
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"updateAccountType_exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
@ServiceMethod
(
method
=
"merchants.api.merchant.update.merchantAccountLevel"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"更新商户层级"
)
public
RopResponse
<
Boolean
>
updateMerchantAccountLevel
(
MerchantUpdateRopRequest
request
)
{
try
{
return
RopResponse
.
success
(
merchantService
.
updateMerchantAccountLevel
(
request
));
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"updateMerchantAccountLevel_exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
@ServiceMethod
(
method
=
"merchants.api.merchant.import"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"批量导入商户"
)
public
RopResponse
<
String
>
importMerchant
(
BuildMenuParam
request
){
try
{
return
RopResponse
.
success
(
merchantService
.
importMerchantExcel
(
request
));
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"merchantImport_exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
}
src/main/java/cn/com/glsx/merchants/request/menu/BuildMenuParam.java
View file @
b7aa003
...
@@ -7,6 +7,6 @@ import lombok.Data;
...
@@ -7,6 +7,6 @@ import lombok.Data;
@Data
@Data
public
class
BuildMenuParam
extends
DefaultRequest
{
public
class
BuildMenuParam
extends
DefaultRequest
{
@ApiModelProperty
(
"
菜单文档
url"
)
@ApiModelProperty
(
"url"
)
private
String
url
;
private
String
url
;
}
}
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantTreeRopRequest.java
View file @
b7aa003
...
@@ -4,6 +4,7 @@ import cn.com.glsx.merchants.request.DefaultRequest;
...
@@ -4,6 +4,7 @@ import cn.com.glsx.merchants.request.DefaultRequest;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.validation.constraints.NotEmpty
;
import
java.io.Serializable
;
import
java.io.Serializable
;
/**
/**
...
@@ -22,4 +23,16 @@ public class MerchantTreeRopRequest extends DefaultRequest implements Serializab
...
@@ -22,4 +23,16 @@ public class MerchantTreeRopRequest extends DefaultRequest implements Serializab
private
String
accountTypes
;
private
String
accountTypes
;
@ApiModelProperty
(
value
=
"商户号source"
)
private
String
merchantNoSource
;
@ApiModelProperty
(
value
=
"商户号target"
)
private
String
merchantNoTarget
;
@ApiModelProperty
(
notes
=
"商户层级"
)
private
Integer
merchantAccountLevel
;
@ApiModelProperty
(
notes
=
"账户类型"
)
private
String
accountType
;
}
}
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantUpdatePathRequest.java
View file @
b7aa003
...
@@ -4,12 +4,16 @@ import com.rop.AbstractRopRequest;
...
@@ -4,12 +4,16 @@ import com.rop.AbstractRopRequest;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.validation.constraints.NotEmpty
;
@Data
@Data
public
class
MerchantUpdatePathRequest
extends
AbstractRopRequest
{
public
class
MerchantUpdatePathRequest
extends
AbstractRopRequest
{
@ApiModelProperty
(
value
=
"商户号source"
)
@ApiModelProperty
(
value
=
"商户号source"
,
required
=
true
)
@NotEmpty
private
String
merchantNoSource
;
private
String
merchantNoSource
;
@ApiModelProperty
(
value
=
"商户号target"
)
@ApiModelProperty
(
value
=
"商户号target"
,
required
=
true
)
@NotEmpty
private
String
merchantNoTarget
;
private
String
merchantNoTarget
;
}
}
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantUpdateRopRequest.java
0 → 100644
View file @
b7aa003
package
cn
.
com
.
glsx
.
merchants
.
request
.
merchant
;
import
cn.com.glsx.merchants.request.DefaultRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
@Data
public
class
MerchantUpdateRopRequest
extends
DefaultRequest
{
@ApiModelProperty
(
notes
=
"商户号"
,
required
=
true
)
@NotNull
private
Integer
merchantNo
;
@ApiModelProperty
(
notes
=
"商户层级"
)
private
Integer
merchantAccountLevel
;
@ApiModelProperty
(
notes
=
"账户类型"
)
private
String
accountType
;
}
src/main/java/cn/com/glsx/merchants/request/open/MerchantListOpenRequest.java
View file @
b7aa003
...
@@ -66,4 +66,10 @@ public class MerchantListOpenRequest extends DefaultRequest {
...
@@ -66,4 +66,10 @@ public class MerchantListOpenRequest extends DefaultRequest {
@ApiModelProperty
(
value
=
"商户号or商户名"
)
@ApiModelProperty
(
value
=
"商户号or商户名"
)
private
String
merchantNoOrName
;
private
String
merchantNoOrName
;
@ApiModelProperty
(
notes
=
"商户企微模式"
)
private
Integer
merchantModel
;
private
Integer
accountLevelUpdate
;
}
}
src/main/java/cn/com/glsx/merchants/response/MerchantRopResponse.java
View file @
b7aa003
...
@@ -391,4 +391,19 @@ public class MerchantRopResponse {
...
@@ -391,4 +391,19 @@ public class MerchantRopResponse {
*/
*/
private
String
createdAccount
;
private
String
createdAccount
;
@ApiModelProperty
(
notes
=
"上级商户号"
)
private
Integer
superiorMerchantNo
;
@ApiModelProperty
(
notes
=
"上级商户名"
)
private
String
superiorMerchantName
;
@ApiModelProperty
(
notes
=
"下级商户号"
)
private
List
<
Integer
>
subMerchantNoList
;
@ApiModelProperty
(
notes
=
"上级商户账户类型"
)
private
String
superiorAccountType
;
@ApiModelProperty
(
notes
=
"下级商户存在的账户类型"
)
private
String
subAccountTypeList
;
}
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/merchants/service/MerchantService.java
View file @
b7aa003
...
@@ -7,9 +7,11 @@ import cn.com.glsx.merchants.convert.ConvertRequest;
...
@@ -7,9 +7,11 @@ 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.*
;
import
cn.com.glsx.merchants.model.request.*
;
import
cn.com.glsx.merchants.model.request.MerchantBrandRequest
;
import
cn.com.glsx.merchants.model.request.MerchantBrandRequest
;
import
cn.com.glsx.merchants.model.request.merchant.MerchantUpdateRpcRequest
;
import
cn.com.glsx.merchants.model.response.*
;
import
cn.com.glsx.merchants.model.response.*
;
import
cn.com.glsx.merchants.remote.MerchantRemote
;
import
cn.com.glsx.merchants.remote.MerchantRemote
;
import
cn.com.glsx.merchants.request.accounttype.AccountTypeSearchRequest
;
import
cn.com.glsx.merchants.request.accounttype.AccountTypeSearchRequest
;
import
cn.com.glsx.merchants.request.menu.BuildMenuParam
;
import
cn.com.glsx.merchants.request.merchant.*
;
import
cn.com.glsx.merchants.request.merchant.*
;
import
cn.com.glsx.merchants.request.role.RoleSearchRequest
;
import
cn.com.glsx.merchants.request.role.RoleSearchRequest
;
import
cn.com.glsx.merchants.response.*
;
import
cn.com.glsx.merchants.response.*
;
...
@@ -315,4 +317,28 @@ public class MerchantService {
...
@@ -315,4 +317,28 @@ public class MerchantService {
}
}
throw
new
RpcServiceException
(
rpcResponse
.
getException
().
getErrId
(),
rpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
rpcResponse
.
getException
().
getErrId
(),
rpcResponse
.
getMessage
());
}
}
public
Boolean
updateMerchantAccountLevel
(
MerchantUpdateRopRequest
request
)
{
RpcResponse
<
Boolean
>
rpcResponse
=
merchantRemote
.
updateMerchantAccountLevel
(
ConvertRequest
.
convertRequest
(
request
,
new
MerchantUpdateRpcRequest
()));
if
(
rpcResponse
.
isSuccess
())
{
return
rpcResponse
.
getResult
();
}
throw
new
RpcServiceException
(
rpcResponse
.
getException
().
getErrId
(),
rpcResponse
.
getMessage
());
}
public
Boolean
updateAccountType
(
MerchantUpdateRopRequest
request
)
{
RpcResponse
<
Boolean
>
rpcResponse
=
merchantRemote
.
updateMerchantAccountLevel
(
ConvertRequest
.
convertRequest
(
request
,
new
MerchantUpdateRpcRequest
()));
if
(
rpcResponse
.
isSuccess
())
{
return
rpcResponse
.
getResult
();
}
throw
new
RpcServiceException
(
rpcResponse
.
getException
().
getErrId
(),
rpcResponse
.
getMessage
());
}
public
String
importMerchantExcel
(
BuildMenuParam
request
)
{
RpcResponse
<
String
>
rpcResponse
=
merchantRemote
.
importMerchantExcel
(
ConvertRequest
.
convertRequest
(
request
,
new
BuildMenuRpcParam
()));
if
(
rpcResponse
.
isSuccess
())
{
return
rpcResponse
.
getResult
();
}
throw
new
RpcServiceException
(
rpcResponse
.
getException
().
getErrId
(),
rpcResponse
.
getMessage
());
}
}
}
src/main/java/cn/com/glsx/merchants/service/OpenService.java
View file @
b7aa003
...
@@ -43,9 +43,7 @@ import org.springframework.beans.BeanUtils;
...
@@ -43,9 +43,7 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.HashSet
;
import
java.util.*
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -231,6 +229,22 @@ public class OpenService {
...
@@ -231,6 +229,22 @@ public class OpenService {
merchantNoSet
.
add
(
Integer
.
valueOf
(
merchantNo
));
merchantNoSet
.
add
(
Integer
.
valueOf
(
merchantNo
));
}
}
}
}
if
(
merchantListOpenRequest
.
getAccountLevelUpdate
()
!=
null
){
switch
(
merchantListOpenRequest
.
getAccountLevelUpdate
()){
case
4
:
openRequest
.
setMerchantAccountLevel
(
Arrays
.
asList
(
1
,
2
,
3
));
break
;
case
3
:
openRequest
.
setMerchantAccountLevel
(
Arrays
.
asList
(
1
,
2
));
break
;
case
2
:
openRequest
.
setMerchantAccountLevel
(
Arrays
.
asList
(
1
));
break
;
default
:
break
;
}
}
if
(
CollectionUtils
.
isNotEmpty
(
merchantNoSet
))
openRequest
.
setMerchantNoSet
(
merchantNoSet
);
if
(
CollectionUtils
.
isNotEmpty
(
merchantNoSet
))
openRequest
.
setMerchantNoSet
(
merchantNoSet
);
return
openRequest
;
return
openRequest
;
}
}
...
...
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