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 437f0a5a
authored
Jan 23, 2026
by
杨卫
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:新增根据商户id查询商户名称
1 parent
4b48dc4c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
0 deletions
platform-merchants-api/src/main/java/cn/com/glsx/merchants/model/response/MerchantNameDTO.java
platform-merchants-api/src/main/java/cn/com/glsx/merchants/remote/MerchantRemote.java
platform-merchants-container/src/main/java/cn/com/glsx/merchants/remote/MerchantRemoteImpl.java
platform-merchants-container/src/main/java/cn/com/glsx/merchants/service/MerchantService.java
platform-merchants-api/src/main/java/cn/com/glsx/merchants/model/response/MerchantNameDTO.java
0 → 100644
View file @
437f0a5
package
cn
.
com
.
glsx
.
merchants
.
model
.
response
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @author yangwei
* @version 1.0
* @since 2026/01/19 16:00
*/
@Data
public
class
MerchantNameDTO
implements
Serializable
{
/**
* 商户号
*/
private
Integer
merchantId
;
/**
* 商户名称
*/
private
String
merchantName
;
}
platform-merchants-api/src/main/java/cn/com/glsx/merchants/remote/MerchantRemote.java
View file @
437f0a5
...
@@ -554,4 +554,9 @@ public interface MerchantRemote {
...
@@ -554,4 +554,9 @@ public interface MerchantRemote {
RpcResponse
<
List
<
MerchantProvinceDTO
>>
findMerchantListByBrandIdsProvince
(
CarBrandProvinceRequestDTO
requestDTO
);
RpcResponse
<
List
<
MerchantProvinceDTO
>>
findMerchantListByBrandIdsProvince
(
CarBrandProvinceRequestDTO
requestDTO
);
RpcResponse
<
List
<
MerchantProvinceDTO
>>
findMerchantProvinceListByIds
(
List
<
Integer
>
merchantIds
);
RpcResponse
<
List
<
MerchantProvinceDTO
>>
findMerchantProvinceListByIds
(
List
<
Integer
>
merchantIds
);
@ApiMethod
(
"查询商户名称"
)
@ApiParams
({
@ApiParam
(
name
=
"merchantId"
,
notes
=
"查询商户名称"
,
dataType
=
ApiParam
.
DataTypeEnum
.
OBJECT
,
required
=
true
)})
@ApiResponse
(
"查询商户名称"
)
RpcResponse
<
List
<
MerchantNameDTO
>>
getMerchantNameByMerchantIds
(
List
<
Integer
>
merchantIds
);
}
}
platform-merchants-container/src/main/java/cn/com/glsx/merchants/remote/MerchantRemoteImpl.java
View file @
437f0a5
...
@@ -948,4 +948,24 @@ public class MerchantRemoteImpl implements MerchantRemote {
...
@@ -948,4 +948,24 @@ public class MerchantRemoteImpl implements MerchantRemote {
return
RpcResponse
.
error
(
e
);
return
RpcResponse
.
error
(
e
);
}
}
}
}
/**
* 查询商户名称
* @author yangwei
* @since 2026/1/23 16:49
* @param merchantIds 商户id
* @return cn.com.glsx.framework.core.beans.rpc.RpcResponse<java.util.List<cn.com.glsx.merchants.model.response.MerchantNameDTO>>
*/
@Override
public
RpcResponse
<
List
<
MerchantNameDTO
>>
getMerchantNameByMerchantIds
(
List
<
Integer
>
merchantIds
)
{
try
{
return
RpcResponse
.
success
(
merchantService
.
getMerchantNameByMerchantIds
(
merchantIds
));
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"查询商户名称失败"
,
e
);
return
RpcResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"查询商户名称失败:"
,
e
);
return
RpcResponse
.
error
(
e
);
}
}
}
}
platform-merchants-container/src/main/java/cn/com/glsx/merchants/service/MerchantService.java
View file @
437f0a5
...
@@ -61,6 +61,7 @@ import org.springframework.http.*;
...
@@ -61,6 +61,7 @@ import org.springframework.http.*;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
import
tk.mybatis.mapper.entity.Example
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.ByteArrayOutputStream
;
...
@@ -2797,4 +2798,20 @@ public class MerchantService {
...
@@ -2797,4 +2798,20 @@ public class MerchantService {
public
List
<
cn
.
com
.
glsx
.
merchants
.
model
.
response
.
MerchantBrandDTO
>
getBrandByMerchantIds
(
List
<
Integer
>
merchantId
)
{
public
List
<
cn
.
com
.
glsx
.
merchants
.
model
.
response
.
MerchantBrandDTO
>
getBrandByMerchantIds
(
List
<
Integer
>
merchantId
)
{
return
merchantMapper
.
getBrandByMerchantIds
(
merchantId
);
return
merchantMapper
.
getBrandByMerchantIds
(
merchantId
);
}
}
public
List
<
MerchantNameDTO
>
getMerchantNameByMerchantIds
(
List
<
Integer
>
merchantIds
)
{
Example
example
=
new
Example
(
Merchant
.
class
);
example
.
createCriteria
()
.
andIn
(
"merchantNo"
,
merchantIds
);
return
Optional
.
ofNullable
(
merchantMapper
.
selectByExample
(
example
))
.
orElseGet
(
ArrayList:
:
new
)
.
stream
()
.
map
(
element
->
{
MerchantNameDTO
merchantNameDTO
=
new
MerchantNameDTO
();
merchantNameDTO
.
setMerchantId
(
element
.
getMerchantNo
());
merchantNameDTO
.
setMerchantName
(
element
.
getMerchantName
());
return
merchantNameDTO
;
}).
collect
(
Collectors
.
toList
());
}
}
}
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