|
@@ -97,11 +97,13 @@ public class BrandServiceImpl implements BrandService {
|
|
// 先查询品牌id得到industryCode
|
|
// 先查询品牌id得到industryCode
|
|
Brand brand = brandMapper.searchById(brandId);
|
|
Brand brand = brandMapper.searchById(brandId);
|
|
if (brand == null)
|
|
if (brand == null)
|
|
- return null;
|
|
|
|
|
|
+ return new ArrayList<>();
|
|
// 再根据industryCode得到其他品牌的信息
|
|
// 再根据industryCode得到其他品牌的信息
|
|
if (brand.getIndustryCode() == null)
|
|
if (brand.getIndustryCode() == null)
|
|
- return null;
|
|
|
|
|
|
+ return new ArrayList<>();
|
|
List<Brand> brands = brandMapper.searchByIndustryCodeList(brandId, brand.getIndustryCode());
|
|
List<Brand> brands = brandMapper.searchByIndustryCodeList(brandId, brand.getIndustryCode());
|
|
|
|
+ if (brands.isEmpty())
|
|
|
|
+ return new ArrayList<>();
|
|
List<BrandSimilar> similarList = new ArrayList<>();
|
|
List<BrandSimilar> similarList = new ArrayList<>();
|
|
for (Brand b : brands){
|
|
for (Brand b : brands){
|
|
BrandSimilar bs = new BrandSimilar();
|
|
BrandSimilar bs = new BrandSimilar();
|
|
@@ -119,7 +121,7 @@ public class BrandServiceImpl implements BrandService {
|
|
// 查询状态后拆分
|
|
// 查询状态后拆分
|
|
BrandStatistics statistics = brandStatisticsMapper.searchByBrandId(brandId);
|
|
BrandStatistics statistics = brandStatisticsMapper.searchByBrandId(brandId);
|
|
if (statistics == null)
|
|
if (statistics == null)
|
|
- return null;
|
|
|
|
|
|
+ return new ArrayList<>();
|
|
int businessCount = statistics.getBusinessCount();
|
|
int businessCount = statistics.getBusinessCount();
|
|
int pauseBusinessCount = statistics.getPauseBusinessCount();
|
|
int pauseBusinessCount = statistics.getPauseBusinessCount();
|
|
int noBusinessCount = statistics.getNoBusinessCount();
|
|
int noBusinessCount = statistics.getNoBusinessCount();
|
|
@@ -142,8 +144,6 @@ public class BrandServiceImpl implements BrandService {
|
|
status.setCount(noBusinessCount);
|
|
status.setCount(noBusinessCount);
|
|
statuses.add(status);
|
|
statuses.add(status);
|
|
}
|
|
}
|
|
- if (statuses.isEmpty())
|
|
|
|
- return null;
|
|
|
|
return statuses;
|
|
return statuses;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -181,7 +181,7 @@ public class BrandServiceImpl implements BrandService {
|
|
List<BrandProvince> provinces = brandProvinceMapper.searchByBrandId(brandId);
|
|
List<BrandProvince> provinces = brandProvinceMapper.searchByBrandId(brandId);
|
|
BrandStatistics statistics = brandStatisticsMapper.searchByBrandId(brandId);
|
|
BrandStatistics statistics = brandStatisticsMapper.searchByBrandId(brandId);
|
|
if (provinces.isEmpty() || statistics == null)
|
|
if (provinces.isEmpty() || statistics == null)
|
|
- return null;
|
|
|
|
|
|
+ return new ArrayList<>();
|
|
int total = statistics.getTotal();
|
|
int total = statistics.getTotal();
|
|
List<BrandProvinceBo> bpbs = new ArrayList<>();
|
|
List<BrandProvinceBo> bpbs = new ArrayList<>();
|
|
for (BrandProvince bp : provinces){
|
|
for (BrandProvince bp : provinces){
|
|
@@ -190,7 +190,7 @@ public class BrandServiceImpl implements BrandService {
|
|
// bpb.setBrandId(bp.getBrandId());
|
|
// bpb.setBrandId(bp.getBrandId());
|
|
bpb.setCode(bp.getAddrCode());
|
|
bpb.setCode(bp.getAddrCode());
|
|
bpb.setName(bp.getProvince());
|
|
bpb.setName(bp.getProvince());
|
|
- bpb.setLocation(bp.getLatGd().toString() + "," + bp.getLngGd().toString());
|
|
|
|
|
|
+ bpb.setLocation(bp.getLat().toString() + "," + bp.getLng().toString());
|
|
bpb.setCount(disCount);
|
|
bpb.setCount(disCount);
|
|
float ratio = (float) disCount/total;
|
|
float ratio = (float) disCount/total;
|
|
bpb.setRatio((ratio*100) + "%");
|
|
bpb.setRatio((ratio*100) + "%");
|
|
@@ -255,7 +255,7 @@ public class BrandServiceImpl implements BrandService {
|
|
public List<BrandTotal> searchTotal() {
|
|
public List<BrandTotal> searchTotal() {
|
|
List<BrandStatistics> list = brandStatisticsMapper.searchList();
|
|
List<BrandStatistics> list = brandStatisticsMapper.searchList();
|
|
if (list.isEmpty())
|
|
if (list.isEmpty())
|
|
- return null;
|
|
|
|
|
|
+ return new ArrayList<>();
|
|
List<BrandTotal> tList = new ArrayList<>();
|
|
List<BrandTotal> tList = new ArrayList<>();
|
|
for (BrandStatistics bs : list){
|
|
for (BrandStatistics bs : list){
|
|
BrandTotal bt = new BrandTotal();
|
|
BrandTotal bt = new BrandTotal();
|
|
@@ -282,7 +282,7 @@ public class BrandServiceImpl implements BrandService {
|
|
for (BrandZone bz : zones){
|
|
for (BrandZone bz : zones){
|
|
Info info = new Info();
|
|
Info info = new Info();
|
|
info.setAddrCode(bz.getAddrCode());
|
|
info.setAddrCode(bz.getAddrCode());
|
|
- info.setAvgScore(bz.getAverageScore());
|
|
|
|
|
|
+ info.setAvgScore(bz.getAvgScore());
|
|
infos.add(info);
|
|
infos.add(info);
|
|
}
|
|
}
|
|
bStoreData.setInfo(infos);
|
|
bStoreData.setInfo(infos);
|