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 7973697a
authored
Feb 04, 2026
by
章家宝
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
工资绩效:账户中心查询4s店下面的品牌
1 parent
8233f1fb
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
165 additions
and
17 deletions
platform-merchants-api/src/main/java/cn/com/glsx/merchants/dto/MerchantBrandModelDTO.java
platform-merchants-api/src/main/java/cn/com/glsx/merchants/dto/MerchantPageWithBrandDTO.java
platform-merchants-api/src/main/java/cn/com/glsx/merchants/remote/MerchantRemote.java
platform-merchants-container/src/main/java/cn/com/glsx/merchants/mapper/MerchantMapper.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-container/src/main/resources/META-INF/orm/MerchantMapper.xml
platform-merchants-api/src/main/java/cn/com/glsx/merchants/dto/MerchantBrandModelDTO.java
0 → 100644
View file @
7973697
package
cn
.
com
.
glsx
.
merchants
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.*
;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public
class
MerchantBrandModelDTO
implements
java
.
io
.
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
notes
=
"主品牌id"
)
private
Integer
brandId
;
@ApiModelProperty
(
notes
=
"子品牌id"
)
private
Integer
childId
;
}
platform-merchants-api/src/main/java/cn/com/glsx/merchants/dto/MerchantPageWithBrandDTO.java
0 → 100644
View file @
7973697
package
cn
.
com
.
glsx
.
merchants
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.*
;
import
java.util.List
;
import
java.util.Set
;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public
class
MerchantPageWithBrandDTO
implements
java
.
io
.
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
Set
<
Integer
>
brandIdList
;
private
List
<
Integer
>
merchantIds
;
@ApiModelProperty
(
notes
=
"门店ID"
)
private
Integer
merchantId
;
@ApiModelProperty
(
notes
=
"门店名称"
)
private
String
merchantName
;
@ApiModelProperty
(
name
=
"merchantBrandList"
,
notes
=
"品牌列表"
)
private
List
<
MerchantBrandModelDTO
>
merchantBrandList
;
}
platform-merchants-api/src/main/java/cn/com/glsx/merchants/remote/MerchantRemote.java
View file @
7973697
...
@@ -3,20 +3,17 @@ package cn.com.glsx.merchants.remote;
...
@@ -3,20 +3,17 @@ package cn.com.glsx.merchants.remote;
import
cn.com.glsx.framework.core.annotation.*
;
import
cn.com.glsx.framework.core.annotation.*
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.merchants.dto.merchant.CarBrandProvinceRequestDTO
;
import
cn.com.glsx.merchants.dto.MerchantPageWithBrandDTO
;
import
cn.com.glsx.merchants.dto.merchant.CarBrandRequestDTO
;
import
cn.com.glsx.merchants.dto.merchant.*
;
import
cn.com.glsx.merchants.dto.merchant.CarbrandResponse
;
import
cn.com.glsx.merchants.dto.merchant.StaffPhoneRequestDTO
;
import
cn.com.glsx.merchants.model.request.*
;
import
cn.com.glsx.merchants.model.request.*
;
import
cn.com.glsx.merchants.model.request.merchant.*
;
import
cn.com.glsx.merchants.model.request.merchant.*
;
import
cn.com.glsx.merchants.model.request.serviceCenter.*
;
import
cn.com.glsx.merchants.model.request.serviceCenter.*
;
import
cn.com.glsx.merchants.model.response.*
;
import
cn.com.glsx.merchants.model.response.*
;
import
cn.com.glsx.merchants.model.response.merchant.MerchantBasicInfoListResponse
;
import
cn.com.glsx.merchants.model.response.merchant.*
;
import
cn.com.glsx.merchants.model.response.merchant.MerchantBrandAndProvinceResponse
;
import
cn.com.glsx.merchants.model.response.merchant.MerchantNameResponse
;
import
cn.com.glsx.merchants.model.response.serviceCenter.MerchantDetailResponse
;
import
cn.com.glsx.merchants.model.response.serviceCenter.MerchantDetailResponse
;
import
cn.com.glsx.merchants.model.response.serviceCenter.SearchMerchantRpcResponse
;
import
cn.com.glsx.merchants.model.response.serviceCenter.SearchMerchantRpcResponse
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -549,4 +546,10 @@ public interface MerchantRemote {
...
@@ -549,4 +546,10 @@ 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
(
"分页查询dj门店/品牌/子品牌列表"
)
@ApiParam
(
name
=
"pagination"
,
notes
=
"查询条件"
,
dataType
=
ApiParam
.
DataTypeEnum
.
OBJECT
,
required
=
true
)
@ApiResponse
(
"门店/品牌/子品牌列表"
)
RpcResponse
<
RpcPagination
<
MerchantPageWithBrandDTO
>>
pageListMerchantWithBrand
(
@NotNull
RpcPagination
<
MerchantPageWithBrandDTO
>
pagination
);
}
}
platform-merchants-container/src/main/java/cn/com/glsx/merchants/mapper/MerchantMapper.java
View file @
7973697
package
cn
.
com
.
glsx
.
merchants
.
mapper
;
package
cn
.
com
.
glsx
.
merchants
.
mapper
;
import
cn.com.glsx.merchants.dto.merchant.CarBrandProvinceRequestDTO
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.merchants.dto.merchant.CarBrandRequestDTO
;
import
cn.com.glsx.merchants.dto.MerchantPageWithBrandDTO
;
import
cn.com.glsx.merchants.dto.merchant.MerchantBasicInfo
;
import
cn.com.glsx.merchants.dto.merchant.*
;
import
cn.com.glsx.merchants.dto.merchant.StaffPhoneRequestDTO
;
import
cn.com.glsx.merchants.entity.Merchant
;
import
cn.com.glsx.merchants.entity.Merchant
;
import
cn.com.glsx.merchants.model.request.*
;
import
cn.com.glsx.merchants.model.request.*
;
import
cn.com.glsx.merchants.model.request.merchant.FindBySupMerchantNoRpcRequest
;
import
cn.com.glsx.merchants.model.request.merchant.*
;
import
cn.com.glsx.merchants.model.request.merchant.MerchantBasicInfoRequest
;
import
cn.com.glsx.merchants.model.request.merchant.MerchantListByConditionRpcRequest
;
import
cn.com.glsx.merchants.model.request.merchant.MerchantNoRpcRequest
;
import
cn.com.glsx.merchants.model.request.serviceCenter.SearchMerchantRpcRequest
;
import
cn.com.glsx.merchants.model.request.serviceCenter.SearchMerchantRpcRequest
;
import
cn.com.glsx.merchants.model.request.serviceCenter.UpdateMerchantRpcRequest
;
import
cn.com.glsx.merchants.model.request.serviceCenter.UpdateMerchantRpcRequest
;
import
cn.com.glsx.merchants.model.response.*
;
import
cn.com.glsx.merchants.model.response.*
;
...
@@ -176,4 +172,8 @@ public interface MerchantMapper extends CommonBaseMapper<Merchant> {
...
@@ -176,4 +172,8 @@ public interface MerchantMapper extends CommonBaseMapper<Merchant> {
List
<
MerchantProvinceDTO
>
findMerchantListByBrandIdsProvince
(
CarBrandProvinceRequestDTO
requestDTO
);
List
<
MerchantProvinceDTO
>
findMerchantListByBrandIdsProvince
(
CarBrandProvinceRequestDTO
requestDTO
);
List
<
MerchantProvinceDTO
>
findMerchantProvinceListByIds
(
@Param
(
"merchantIds"
)
List
<
Integer
>
merchantIds
);
List
<
MerchantProvinceDTO
>
findMerchantProvinceListByIds
(
@Param
(
"merchantIds"
)
List
<
Integer
>
merchantIds
);
List
<
Integer
>
pageListMerchantIds
(
RpcPagination
<
MerchantPageWithBrandDTO
>
pagination
);
List
<
MerchantPageWithBrandDTO
>
listMerchantWithBrandByMerchantIds
(
Page
<
Integer
>
idPage
);
}
}
\ No newline at end of file
\ No newline at end of file
platform-merchants-container/src/main/java/cn/com/glsx/merchants/remote/MerchantRemoteImpl.java
View file @
7973697
...
@@ -5,6 +5,7 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
...
@@ -5,6 +5,7 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import
cn.com.glsx.framework.core.enums.DefaultErrorEnum
;
import
cn.com.glsx.framework.core.enums.DefaultErrorEnum
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.util.RpcAssert
;
import
cn.com.glsx.framework.core.util.RpcAssert
;
import
cn.com.glsx.merchants.dto.MerchantPageWithBrandDTO
;
import
cn.com.glsx.merchants.dto.merchant.CarBrandProvinceRequestDTO
;
import
cn.com.glsx.merchants.dto.merchant.CarBrandProvinceRequestDTO
;
import
cn.com.glsx.merchants.dto.merchant.CarBrandRequestDTO
;
import
cn.com.glsx.merchants.dto.merchant.CarBrandRequestDTO
;
import
cn.com.glsx.merchants.dto.merchant.CarbrandResponse
;
import
cn.com.glsx.merchants.dto.merchant.CarbrandResponse
;
...
@@ -935,4 +936,15 @@ public class MerchantRemoteImpl implements MerchantRemote {
...
@@ -935,4 +936,15 @@ public class MerchantRemoteImpl implements MerchantRemote {
return
RpcResponse
.
error
(
e
);
return
RpcResponse
.
error
(
e
);
}
}
}
}
@Override
public
RpcResponse
<
RpcPagination
<
MerchantPageWithBrandDTO
>>
pageListMerchantWithBrand
(
RpcPagination
<
MerchantPageWithBrandDTO
>
pagination
)
{
try
{
return
RpcResponse
.
success
(
RpcPagination
.
copyPage
(
merchantService
.
pageListMerchantWithBrand
(
pagination
)));
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
RpcResponse
.
error
(
e
);
}
}
}
}
platform-merchants-container/src/main/java/cn/com/glsx/merchants/service/MerchantService.java
View file @
7973697
...
@@ -12,8 +12,7 @@ import cn.com.glsx.merchant.facade.remote.MerchantFacadeRemote;
...
@@ -12,8 +12,7 @@ import cn.com.glsx.merchant.facade.remote.MerchantFacadeRemote;
import
cn.com.glsx.merchants.annotation.beisen.BeiSenNotice
;
import
cn.com.glsx.merchants.annotation.beisen.BeiSenNotice
;
import
cn.com.glsx.merchants.config.SystemProperty
;
import
cn.com.glsx.merchants.config.SystemProperty
;
import
cn.com.glsx.merchants.contants.Constants
;
import
cn.com.glsx.merchants.contants.Constants
;
import
cn.com.glsx.merchants.dto.MerchantBrandDTO
;
import
cn.com.glsx.merchants.dto.*
;
import
cn.com.glsx.merchants.dto.MerchantFirstBrandDTO
;
import
cn.com.glsx.merchants.dto.merchant.*
;
import
cn.com.glsx.merchants.dto.merchant.*
;
import
cn.com.glsx.merchants.entity.*
;
import
cn.com.glsx.merchants.entity.*
;
import
cn.com.glsx.merchants.enums.*
;
import
cn.com.glsx.merchants.enums.*
;
...
@@ -2793,4 +2792,36 @@ public class MerchantService {
...
@@ -2793,4 +2792,36 @@ public class MerchantService {
public
List
<
MerchantProvinceDTO
>
findMerchantProvinceListByIds
(
List
<
Integer
>
merchantIds
)
{
public
List
<
MerchantProvinceDTO
>
findMerchantProvinceListByIds
(
List
<
Integer
>
merchantIds
)
{
return
merchantMapper
.
findMerchantProvinceListByIds
(
merchantIds
);
return
merchantMapper
.
findMerchantProvinceListByIds
(
merchantIds
);
}
}
public
Page
<
MerchantPageWithBrandDTO
>
pageListMerchantWithBrand
(
RpcPagination
<
MerchantPageWithBrandDTO
>
pagination
)
{
RpcAssert
.
assertNotNull
(
pagination
,
DefaultErrorEnum
.
DATA_NULL
,
"RpcPagination not be null"
);
try
{
// 1:分页查询商户ID
Page
<
Integer
>
idPage
=
PageHelper
.
startPage
(
pagination
.
getPageNum
(),
pagination
.
getPageSize
(),
pagination
.
isNeedCount
())
.
doSelectPage
(()
->
merchantMapper
.
pageListMerchantIds
(
pagination
));
// 2:空结果处理
if
(
CollectionUtils
.
isEmpty
(
idPage
))
{
Page
<
MerchantPageWithBrandDTO
>
emptyPage
=
new
Page
<>(
pagination
.
getPageNum
(),
pagination
.
getPageSize
(),
pagination
.
isNeedCount
());
emptyPage
.
setTotal
(
0
);
return
emptyPage
;
}
// 3:根据ID查询商户详情
List
<
MerchantPageWithBrandDTO
>
merchantList
=
merchantMapper
.
listMerchantWithBrandByMerchantIds
(
idPage
);
// 4:组装最终分页结果
Page
<
MerchantPageWithBrandDTO
>
resultPage
=
new
Page
<>(
idPage
.
getPageNum
(),
idPage
.
getPageSize
(),
idPage
.
isCount
());
resultPage
.
setTotal
(
idPage
.
getTotal
());
resultPage
.
addAll
(
merchantList
);
resultPage
.
setStartRow
(
idPage
.
getStartRow
());
resultPage
.
setEndRow
(
idPage
.
getEndRow
());
return
resultPage
;
}
catch
(
Exception
e
){
log
.
error
(
"分页查询商户带品牌数据异常"
,
e
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
DATABASE_ERROR
,
e
.
getMessage
());
}
}
}
}
platform-merchants-container/src/main/resources/META-INF/orm/MerchantMapper.xml
View file @
7973697
...
@@ -115,6 +115,21 @@
...
@@ -115,6 +115,21 @@
<result
column=
"created_source"
jdbcType=
"VARCHAR"
property=
"createdSource"
/>
<result
column=
"created_source"
jdbcType=
"VARCHAR"
property=
"createdSource"
/>
<result
column=
"created_account"
jdbcType=
"VARCHAR"
property=
"createdAccount"
/>
<result
column=
"created_account"
jdbcType=
"VARCHAR"
property=
"createdAccount"
/>
</resultMap>
</resultMap>
<resultMap
id=
"MerchantBrandDTOMap"
type=
"cn.com.glsx.merchants.dto.MerchantBrandModelDTO"
>
<result
column=
"brand_id"
property=
"brandId"
jdbcType=
"INTEGER"
/>
<result
column=
"child_id"
property=
"childId"
jdbcType=
"INTEGER"
/>
</resultMap>
<resultMap
id=
"MerchantPageWithBrandDTOMap"
type=
"cn.com.glsx.merchants.dto.MerchantPageWithBrandDTO"
>
<id
column=
"merchant_id"
property=
"merchantId"
jdbcType=
"INTEGER"
/>
<result
column=
"merchant_name"
property=
"merchantName"
jdbcType=
"VARCHAR"
/>
<collection
property=
"merchantBrandList"
ofType=
"cn.com.glsx.merchants.dto.MerchantBrandModelDTO"
resultMap=
"MerchantBrandDTOMap"
fetchType=
"eager"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
<!--
<!--
WARNING - @mbg.generated
WARNING - @mbg.generated
...
@@ -1264,4 +1279,46 @@
...
@@ -1264,4 +1279,46 @@
</if>
</if>
</select>
</select>
<!-- 1. 分页查询商户ID(仅查merchant_id,用于分页) -->
<select
id=
"pageListMerchantIds"
parameterType=
"cn.com.glsx.merchants.dto.MerchantPageWithBrandDTO"
resultType=
"java.lang.Integer"
>
SELECT DISTINCT s.merchantNo as merchantId
FROM platform_merchant s
INNER JOIN platform_merchant_brand m ON s.merchantNo = m.merchant_id
WHERE s.del_flag = 0
AND m.del_flag = 0
<if
test=
"condition.brandIdList != null and condition.brandIdList.size() > 0"
>
AND m.first_brand_id IN
<foreach
collection=
"brandIdList"
item=
"brandId"
open=
"("
separator=
","
close=
")"
>
#{brandId}
</foreach>
</if>
<if
test=
"condition.merchantIds != null and condition.merchantIds.size() > 0"
>
AND s.merchantNo IN
<foreach
collection=
"merchantIds"
item=
"merchantId"
open=
"("
separator=
","
close=
")"
>
#{merchantId}
</foreach>
</if>
ORDER BY s.merchantNo DESC
</select>
<!-- 2. 根据商户ID列表查询带品牌的详情 -->
<select
id=
"listMerchantWithBrandByMerchantIds"
parameterType=
"map"
resultMap=
"MerchantPageWithBrandDTOMap"
>
SELECT DISTINCT s.merchantNo,
s.merchant_name,
IFNULL(m.first_brand_id, 0) AS brand_id,
IFNULL(m.sec_brand_id, 0) AS child_id
FROM platform_merchant s
INNER JOIN platform_merchant_brand m ON s.merchantNo = m.merchant_id
WHERE s.del_flag = 0
AND m.del_flag = 0
AND s.merchantNo IN
<foreach
collection=
"merchantIds"
item=
"merchantId"
open=
"("
separator=
","
close=
")"
>
#{merchantId}
</foreach>
ORDER BY s.merchantNo DESC
</select>
</mapper>
</mapper>
\ No newline at end of file
\ No newline at end of file
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