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 01ccd142
authored
Mar 13, 2025
by
yelq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Merge all from rop-merchant v4.50.0_20250311
1 parent
9a0f03dc
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
70 additions
and
1 deletions
pom.xml
src/main/java/cn/com/glsx/merchants/controller/MerchantCommonController.java
src/main/java/cn/com/glsx/merchants/controller/MerchantController.java
src/main/java/cn/com/glsx/merchants/service/MerchantCommonService.java
src/main/java/cn/com/glsx/merchants/service/MerchantService.java
src/test/java/cn/com/glsx/merchants/controller/OpenControllerTest.java
pom.xml
View file @
01ccd14
...
...
@@ -15,7 +15,7 @@
<dependency>
<groupId>
cn.com.glsx.merchants
</groupId>
<artifactId>
platform-merchants-api
</artifactId>
<version>
4.
49
.0-SNAPSHOT
</version>
<version>
4.
50
.0-SNAPSHOT
</version>
</dependency>
<!--引用GSON,用于打印-->
<dependency>
...
...
src/main/java/cn/com/glsx/merchants/controller/MerchantCommonController.java
View file @
01ccd14
...
...
@@ -20,6 +20,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author zhouhaibao
...
...
@@ -80,4 +81,16 @@ public class MerchantCommonController {
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
@ServiceMethod
(
method
=
"merchants.api.merchantCommon.getCarSeriesAndPowerTypeMap"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"查询全部车系与动力类型关联关系"
)
public
RopResponse
<
Map
<
Integer
,
String
>>
getCarSeriesAndPowerTypeMap
(
AbstractRopRequest
request
){
try
{
return
RopResponse
.
success
(
merchantCommonService
.
getCarSeriesAndPowerTypeMap
());
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantCommonController__invoke__getCarSeriesAndPowerTypeMap__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
src/main/java/cn/com/glsx/merchants/controller/MerchantController.java
View file @
01ccd14
...
...
@@ -58,6 +58,18 @@ public class MerchantController {
}
}
@ServiceMethod
(
method
=
"merchants.api.merchant.saveMerchant.permissions"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"保存商户基础信息(自动创建权限)"
)
public
RopResponse
<
Integer
>
saveMerchantWithPermissions
(
MerchantSaveRequest
merchantSaveRequest
)
{
try
{
Integer
merchant
=
merchantService
.
saveMerchantWithPermissions
(
merchantSaveRequest
);
return
RopResponse
.
success
(
merchant
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantController__invoke__saveMerchantWithPermissions__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
@ServiceMethod
(
method
=
"merchants.api.merchant.saveMerchantAuto"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"保存商户基础信息脚本测试"
)
public
RopResponse
<
Integer
>
saveMerchantAuto
(
BuildMenuParam
merchantSaveRequest
)
{
...
...
src/main/java/cn/com/glsx/merchants/service/MerchantCommonService.java
View file @
01ccd14
...
...
@@ -20,6 +20,7 @@ import org.springframework.stereotype.Service;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -100,4 +101,13 @@ public class MerchantCommonService {
if
(
CollectionUtils
.
isEmpty
(
carTypeIdList
))
return
new
ArrayList
<>();
return
cartypeService
.
getCarTypeInfoById
(
carTypeIdList
);
}
/**
* 查询全部车系与动力类型关联关系
*
* @return
*/
public
Map
<
Integer
,
String
>
getCarSeriesAndPowerTypeMap
()
{
return
cartypeService
.
getCarSeriesAndPowerTypeMap
();
}
}
src/main/java/cn/com/glsx/merchants/service/MerchantService.java
View file @
01ccd14
...
...
@@ -53,6 +53,13 @@ public class MerchantService {
}
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
public
Integer
saveMerchantWithPermissions
(
MerchantSaveRequest
merchantSaveRequest
)
{
RpcResponse
<
Integer
>
booleanRpcResponse
=
merchantRemote
.
saveMerchantWithPermissions
(
converMerchant
(
merchantSaveRequest
));
if
(
booleanRpcResponse
.
isSuccess
())
{
return
booleanRpcResponse
.
getResult
();
}
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
private
MerchantRequest
converMerchant
(
MerchantSaveRequest
merchantSaveRequest
)
{
MerchantRequest
merchantRequest
=
ConvertRequest
.
convertRequest
(
merchantSaveRequest
,
new
MerchantRequest
());
...
...
src/test/java/cn/com/glsx/merchants/controller/OpenControllerTest.java
View file @
01ccd14
...
...
@@ -30,4 +30,31 @@ public class OpenControllerTest extends BaseControllerTest{
System
.
out
.
println
(
post
(
params
));
}
@Test
public
void
saveServiceMerchantPermissionTest
()
throws
Exception
{
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
<
String
,
String
>(
4
);
params
.
add
(
"accounttypeId"
,
"2"
);
params
.
add
(
"merchantAccountLevel"
,
"4"
);
params
.
add
(
"parentId"
,
"49253"
);
params
.
add
(
"channelId"
,
""
);
params
.
add
(
"merchantModel"
,
""
);
params
.
add
(
"merchantName"
,
"lyj第九个鸿蒙4S店"
);
params
.
add
(
"merchantLegalPersonPhone"
,
"15946461232"
);
params
.
add
(
"merchantAddress"
,
"深圳市宝安区宝安大道深圳新锦安海纳公馆"
);
params
.
add
(
"merchantLoginAccount"
,
"lyjtest01"
);
params
.
add
(
"merchantLoginPassword"
,
"a123456"
);
params
.
add
(
"provinceName"
,
"广东省"
);
params
.
add
(
"cityName"
,
"深圳市"
);
params
.
add
(
"lat"
,
"22.5603"
);
params
.
add
(
"lng"
,
"113.9020"
);
params
.
add
(
"merchantBrandListJson"
,
"[{\"cars\":2125,\"merchantBrandId\":[2126]},{\"cars\":2129,\"merchantBrandId\":[2130]}]"
);
params
.
add
(
"status"
,
"2"
);
params
.
add
(
"isloginName"
,
"0"
);
params
.
add
(
"method"
,
"merchants.api.merchant.saveMerchant.permissions"
);
params
.
add
(
"v"
,
"1.0.0"
);
System
.
out
.
println
(
post
(
params
));
}
}
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