Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-dj-pe-analysis
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 ac6300a3
authored
Dec 15, 2025
by
张富康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
省份枚举
1 parent
a096a7dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
24 deletions
rpc-dj-pe-analysis/src/main/java/cn/com/glsx/dj/peanalysis/service/UsedCarDataStatsService.java
rpc-dj-pe-analysis/src/main/java/cn/com/glsx/dj/peanalysis/service/UsedCarDataStatsService.java
View file @
ac6300a
...
@@ -87,10 +87,10 @@ public class UsedCarDataStatsService {
...
@@ -87,10 +87,10 @@ public class UsedCarDataStatsService {
merchantIdList
=
filterMerchantResponse
.
stream
().
map
(
MerchantProvinceDTO:
:
getMerchantId
).
collect
(
Collectors
.
toList
());
merchantIdList
=
filterMerchantResponse
.
stream
().
map
(
MerchantProvinceDTO:
:
getMerchantId
).
collect
(
Collectors
.
toList
());
}
}
// 如果角色为销售大区经理和区域运营大区经理需要取交集
// 如果角色为销售大区经理和区域运营大区经理需要取交集
if
(
leaderBoolean
)
{
if
(
leaderBoolean
&&
filterBoolean
)
{
// 商户id交集 merchantIds merchantIdList
// 商户id交集 merchantIds merchantIdList
merchantId
List
=
merchantIdList
.
stream
().
filter
(
merchantIds
:
:
contains
).
collect
(
Collectors
.
toList
());
merchantId
s
=
merchantIds
.
stream
().
filter
(
merchantIdList
:
:
contains
).
collect
(
Collectors
.
toList
());
if
(
CollUtil
.
isEmpty
(
merchantId
List
))
{
if
(
CollUtil
.
isEmpty
(
merchantId
s
))
{
return
new
OperationStatusRes
();
return
new
OperationStatusRes
();
}
}
}
}
...
@@ -101,7 +101,7 @@ public class UsedCarDataStatsService {
...
@@ -101,7 +101,7 @@ public class UsedCarDataStatsService {
queryDataBiz
.
setBrandIds
(
null
);
queryDataBiz
.
setBrandIds
(
null
);
queryDataBiz
.
setDateType
(
4
);
queryDataBiz
.
setDateType
(
4
);
queryDataBiz
.
setExts
(
null
);
queryDataBiz
.
setExts
(
null
);
queryDataBiz
.
setMerchantIds
(
filterBoolean
?
StrUtil
.
join
(
","
,
merchantId
List
)
:
null
);
queryDataBiz
.
setMerchantIds
(
filterBoolean
?
StrUtil
.
join
(
","
,
merchantId
s
)
:
null
);
queryDataBiz
.
setStartDate
(
"2000-01-01"
);
queryDataBiz
.
setStartDate
(
"2000-01-01"
);
queryDataBiz
.
setEndDate
(
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd"
));
queryDataBiz
.
setEndDate
(
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd"
));
// 在库车辆数-A0004 在库成本-A0005 在库超过7天-A0006 在库超过30天-A0007
// 在库车辆数-A0004 在库成本-A0005 在库超过7天-A0006 在库超过30天-A0007
...
@@ -187,16 +187,16 @@ public class UsedCarDataStatsService {
...
@@ -187,16 +187,16 @@ public class UsedCarDataStatsService {
merchantIdList
=
filterMerchantResponse
.
stream
().
map
(
MerchantProvinceDTO:
:
getMerchantId
).
collect
(
Collectors
.
toList
());
merchantIdList
=
filterMerchantResponse
.
stream
().
map
(
MerchantProvinceDTO:
:
getMerchantId
).
collect
(
Collectors
.
toList
());
}
}
// 如果角色为销售大区经理和区域运营大区经理需要取交集
// 如果角色为销售大区经理和区域运营大区经理需要取交集
if
(
leaderBoolean
)
{
if
(
leaderBoolean
&&
filterBoolean
)
{
// 商户id交集 merchantIds merchantIdList
// 商户id交集 merchantIds merchantIdList
merchantId
List
=
merchantIdList
.
stream
().
filter
(
merchantIds
:
:
contains
).
collect
(
Collectors
.
toList
());
merchantId
s
=
merchantIds
.
stream
().
filter
(
merchantIdList
:
:
contains
).
collect
(
Collectors
.
toList
());
if
(
CollUtil
.
isEmpty
(
merchantId
List
))
{
if
(
CollUtil
.
isEmpty
(
merchantId
s
))
{
return
new
ReceivingCostDistributionRes
();
return
new
ReceivingCostDistributionRes
();
}
}
}
}
// 查询vcp_car_manage_info
// 查询vcp_car_manage_info
List
<
CarManageInfoDTO
>
carManageInfoList
=
carManageInfoMapper
.
queryPurchasePrice
(
merchantId
List
);
List
<
CarManageInfoDTO
>
carManageInfoList
=
carManageInfoMapper
.
queryPurchasePrice
(
merchantId
s
);
// 如果为空则返回空结果
// 如果为空则返回空结果
if
(
CollUtil
.
isEmpty
(
carManageInfoList
))
{
if
(
CollUtil
.
isEmpty
(
carManageInfoList
))
{
return
new
ReceivingCostDistributionRes
();
return
new
ReceivingCostDistributionRes
();
...
@@ -263,10 +263,10 @@ public class UsedCarDataStatsService {
...
@@ -263,10 +263,10 @@ public class UsedCarDataStatsService {
merchantIdList
=
filterMerchantResponse
.
stream
().
map
(
MerchantProvinceDTO:
:
getMerchantId
).
collect
(
Collectors
.
toList
());
merchantIdList
=
filterMerchantResponse
.
stream
().
map
(
MerchantProvinceDTO:
:
getMerchantId
).
collect
(
Collectors
.
toList
());
}
}
// 如果角色为销售大区经理和区域运营大区经理需要取交集
// 如果角色为销售大区经理和区域运营大区经理需要取交集
if
(
leaderBoolean
)
{
if
(
leaderBoolean
&&
filterBoolean
)
{
// 商户id交集 merchantIds merchantIdList
// 商户id交集 merchantIds merchantIdList
merchantId
List
=
merchantIdList
.
stream
().
filter
(
merchantIds
:
:
contains
).
collect
(
Collectors
.
toList
());
merchantId
s
=
merchantIds
.
stream
().
filter
(
merchantIdList
:
:
contains
).
collect
(
Collectors
.
toList
());
if
(
CollUtil
.
isEmpty
(
merchantId
List
))
{
if
(
CollUtil
.
isEmpty
(
merchantId
s
))
{
return
new
CycleDataRes
();
return
new
CycleDataRes
();
}
}
}
}
...
@@ -278,7 +278,7 @@ public class UsedCarDataStatsService {
...
@@ -278,7 +278,7 @@ public class UsedCarDataStatsService {
queryDataBiz
.
setBrandIds
(
null
);
queryDataBiz
.
setBrandIds
(
null
);
queryDataBiz
.
setDateType
(
4
);
queryDataBiz
.
setDateType
(
4
);
queryDataBiz
.
setExts
(
null
);
queryDataBiz
.
setExts
(
null
);
queryDataBiz
.
setMerchantIds
(
filterBoolean
?
StrUtil
.
join
(
","
,
merchantId
List
)
:
null
);
queryDataBiz
.
setMerchantIds
(
filterBoolean
?
StrUtil
.
join
(
","
,
merchantId
s
)
:
null
);
queryDataBiz
.
setStartDate
(
request
.
getStartTime
());
queryDataBiz
.
setStartDate
(
request
.
getStartTime
());
queryDataBiz
.
setEndDate
(
request
.
getEndTime
());
queryDataBiz
.
setEndDate
(
request
.
getEndTime
());
// 二手车产值(当期卖车总产值、环比)-A0001 二手车毛利(当期毛利、环比)-A0002
// 二手车产值(当期卖车总产值、环比)-A0001 二手车毛利(当期毛利、环比)-A0002
...
@@ -434,16 +434,16 @@ public class UsedCarDataStatsService {
...
@@ -434,16 +434,16 @@ public class UsedCarDataStatsService {
merchantIdList
=
filterMerchantResponse
.
stream
().
map
(
MerchantProvinceDTO:
:
getMerchantId
).
collect
(
Collectors
.
toList
());
merchantIdList
=
filterMerchantResponse
.
stream
().
map
(
MerchantProvinceDTO:
:
getMerchantId
).
collect
(
Collectors
.
toList
());
}
}
// 如果角色为销售大区经理和区域运营大区经理需要取交集
// 如果角色为销售大区经理和区域运营大区经理需要取交集
if
(
leaderBoolean
)
{
if
(
leaderBoolean
&&
filterBoolean
)
{
// 商户id交集 merchantIds merchantIdList
// 商户id交集 merchantIds merchantIdList
merchantId
List
=
merchantIdList
.
stream
().
filter
(
merchantIds
:
:
contains
).
collect
(
Collectors
.
toList
());
merchantId
s
=
merchantIds
.
stream
().
filter
(
merchantIdList
:
:
contains
).
collect
(
Collectors
.
toList
());
if
(
CollUtil
.
isEmpty
(
merchantId
List
))
{
if
(
CollUtil
.
isEmpty
(
merchantId
s
))
{
return
new
StockStoreAnalysisRes
();
return
new
StockStoreAnalysisRes
();
}
}
}
}
// 查询dj_car_life_service_merchant_bi
// 查询dj_car_life_service_merchant_bi
List
<
BiRecord
>
biRecords
=
businessIntelligenceMapper
.
getBiRecords
(
5
,
merchantId
List
,
request
.
getStartTime
(),
request
.
getEndTime
());
List
<
BiRecord
>
biRecords
=
businessIntelligenceMapper
.
getBiRecords
(
5
,
merchantId
s
,
request
.
getStartTime
(),
request
.
getEndTime
());
// 如果为空则返回空结果
// 如果为空则返回空结果
if
(
CollUtil
.
isEmpty
(
biRecords
))
{
if
(
CollUtil
.
isEmpty
(
biRecords
))
{
return
new
StockStoreAnalysisRes
();
return
new
StockStoreAnalysisRes
();
...
@@ -452,7 +452,7 @@ public class UsedCarDataStatsService {
...
@@ -452,7 +452,7 @@ public class UsedCarDataStatsService {
// 获取上一个周期的时间返回
// 获取上一个周期的时间返回
Pair
<
String
,
String
>
lastPeriodDates
=
DateUtils
.
getLastPeriodDates
(
request
.
getStartTime
(),
request
.
getEndTime
(),
request
.
getCycleType
());
Pair
<
String
,
String
>
lastPeriodDates
=
DateUtils
.
getLastPeriodDates
(
request
.
getStartTime
(),
request
.
getEndTime
(),
request
.
getCycleType
());
// 获取上一个周期的bi数据
// 获取上一个周期的bi数据
List
<
BiRecord
>
lastPeriodBiRecords
=
businessIntelligenceMapper
.
getBiRecords
(
5
,
merchantId
List
,
lastPeriodDates
.
getKey
(),
lastPeriodDates
.
getValue
());
List
<
BiRecord
>
lastPeriodBiRecords
=
businessIntelligenceMapper
.
getBiRecords
(
5
,
merchantId
s
,
lastPeriodDates
.
getKey
(),
lastPeriodDates
.
getValue
());
// 总开单门店 计算biRecords不同门店id的数量
// 总开单门店 计算biRecords不同门店id的数量
Integer
totalOpenStoreCount
=
(
int
)
biRecords
.
stream
().
map
(
BiRecord:
:
getMerchantId
).
distinct
().
count
();
Integer
totalOpenStoreCount
=
(
int
)
biRecords
.
stream
().
map
(
BiRecord:
:
getMerchantId
).
distinct
().
count
();
// 按门店分组
// 按门店分组
...
@@ -480,9 +480,9 @@ public class UsedCarDataStatsService {
...
@@ -480,9 +480,9 @@ public class UsedCarDataStatsService {
// 多品类门店
// 多品类门店
int
multiCategoryStoreCount
=
countMultiCategoryStores
(
biRecords
);
int
multiCategoryStoreCount
=
countMultiCategoryStores
(
biRecords
);
// 流失门店
// 流失门店
int
lostStoreCount
=
businessIntelligenceMapper
.
countLostMerchant
(
merchantId
List
,
request
.
getStartTime
());
int
lostStoreCount
=
businessIntelligenceMapper
.
countLostMerchant
(
merchantId
s
,
request
.
getStartTime
());
// 历史门店总数
// 历史门店总数
int
totalStoreCount
=
businessIntelligenceMapper
.
countHistoryMerchant
(
merchantId
List
,
request
.
getStartTime
());
int
totalStoreCount
=
businessIntelligenceMapper
.
countHistoryMerchant
(
merchantId
s
,
request
.
getStartTime
());
// 计算环比 ((本周期统计值-上周期统计值)/上周期统计值)*100%,保留百分比两位小数,即xx.xx%
// 计算环比 ((本周期统计值-上周期统计值)/上周期统计值)*100%,保留百分比两位小数,即xx.xx%
if
(
CollUtil
.
isNotEmpty
(
lastPeriodBiRecords
))
{
if
(
CollUtil
.
isNotEmpty
(
lastPeriodBiRecords
))
{
...
@@ -572,7 +572,6 @@ public class UsedCarDataStatsService {
...
@@ -572,7 +572,6 @@ public class UsedCarDataStatsService {
public
RegionDistributionRes
getRegionDistribution
(
RegionDistributionReq
request
)
{
public
RegionDistributionRes
getRegionDistribution
(
RegionDistributionReq
request
)
{
Integer
brandId
=
request
.
getBrandId
();
Integer
brandId
=
request
.
getBrandId
();
Integer
provinceId
=
null
;
Integer
provinceId
=
null
;
// Integer provinceId = request.getProvinceId();
List
<
Integer
>
merchantIds
=
businessAnalysisService
.
getMerchantIds
(
request
.
getRegionId
());
List
<
Integer
>
merchantIds
=
businessAnalysisService
.
getMerchantIds
(
request
.
getRegionId
());
boolean
leaderBoolean
=
ObjectUtil
.
equals
(
request
.
getRole
(),
LoginRoleEnum
.
AREA_SUPERVISION_LEADER
.
getValue
())
boolean
leaderBoolean
=
ObjectUtil
.
equals
(
request
.
getRole
(),
LoginRoleEnum
.
AREA_SUPERVISION_LEADER
.
getValue
())
||
ObjectUtil
.
equals
(
request
.
getRole
(),
LoginRoleEnum
.
SALE_LEADER
.
getValue
());
||
ObjectUtil
.
equals
(
request
.
getRole
(),
LoginRoleEnum
.
SALE_LEADER
.
getValue
());
...
@@ -589,7 +588,6 @@ public class UsedCarDataStatsService {
...
@@ -589,7 +588,6 @@ public class UsedCarDataStatsService {
// 筛选品牌,区域后的商户id
// 筛选品牌,区域后的商户id
CarBrandProvinceRequestDTO
carBrandProvinceRequestDTO
=
new
CarBrandProvinceRequestDTO
();
CarBrandProvinceRequestDTO
carBrandProvinceRequestDTO
=
new
CarBrandProvinceRequestDTO
();
carBrandProvinceRequestDTO
.
setFirstBrandIdList
(
ObjectUtil
.
isNotEmpty
(
brandId
)
?
Collections
.
singletonList
(
brandId
)
:
null
);
carBrandProvinceRequestDTO
.
setFirstBrandIdList
(
ObjectUtil
.
isNotEmpty
(
brandId
)
?
Collections
.
singletonList
(
brandId
)
:
null
);
carBrandProvinceRequestDTO
.
setProvinceIds
(
ObjectUtil
.
isNotEmpty
(
provinceId
)
?
Collections
.
singletonList
(
provinceId
)
:
null
);
RpcResponse
<
List
<
MerchantProvinceDTO
>>
filterMerchantIdsResponse
=
merchantRemote
.
findMerchantListByBrandIdsProvince
(
carBrandProvinceRequestDTO
);
RpcResponse
<
List
<
MerchantProvinceDTO
>>
filterMerchantIdsResponse
=
merchantRemote
.
findMerchantListByBrandIdsProvince
(
carBrandProvinceRequestDTO
);
filterMerchantResponse
=
filterMerchantIdsResponse
.
getResult
();
filterMerchantResponse
=
filterMerchantIdsResponse
.
getResult
();
// 如果为空则返回空结果
// 如果为空则返回空结果
...
@@ -599,10 +597,10 @@ public class UsedCarDataStatsService {
...
@@ -599,10 +597,10 @@ public class UsedCarDataStatsService {
merchantIdList
=
filterMerchantResponse
.
stream
().
map
(
MerchantProvinceDTO:
:
getMerchantId
).
collect
(
Collectors
.
toList
());
merchantIdList
=
filterMerchantResponse
.
stream
().
map
(
MerchantProvinceDTO:
:
getMerchantId
).
collect
(
Collectors
.
toList
());
}
}
// 如果角色为销售大区经理和区域运营大区经理需要取交集
// 如果角色为销售大区经理和区域运营大区经理需要取交集
if
(
leaderBoolean
)
{
if
(
leaderBoolean
&&
filterBoolean
)
{
// 商户id交集 merchantIds merchantIdList
// 商户id交集 merchantIds merchantIdList
merchantId
List
=
merchantIdList
.
stream
().
filter
(
merchantIds
:
:
contains
).
collect
(
Collectors
.
toList
());
merchantId
s
=
merchantIds
.
stream
().
filter
(
merchantIdList
:
:
contains
).
collect
(
Collectors
.
toList
());
if
(
CollUtil
.
isEmpty
(
merchantId
List
))
{
if
(
CollUtil
.
isEmpty
(
merchantId
s
))
{
return
new
RegionDistributionRes
();
return
new
RegionDistributionRes
();
}
}
}
}
...
...
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