|
@@ -110,15 +110,17 @@ public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> i
|
|
|
MerchantDTO merchant = MerchantCopier.INSTANCE.copying(
|
|
|
AssertUtils.available(this.baseMapper.getMerchantById(id, param), "商家不存在")
|
|
|
);
|
|
|
- Category category = this.categoryService.getById(merchant.getMainBusiness());
|
|
|
- if (null != category){
|
|
|
- merchant.setMainBusinessName(category.getName());
|
|
|
- }
|
|
|
- List<Category> categoryList = this.categoryService.getCategories(merchant.getAncillaryBusiness());
|
|
|
- List<String> ancillaryBusinessNames = categoryList.stream()
|
|
|
- .map(Category::getName) //
|
|
|
- .collect(Collectors.toList());
|
|
|
- merchant.setAncillaryBusinessName(ancillaryBusinessNames);
|
|
|
+// Category category = this.categoryService.getById(merchant.getMainBusiness());
|
|
|
+// if (null != category){
|
|
|
+// merchant.setMainBusinessName(category.getName());
|
|
|
+// }
|
|
|
+// List<Category> categoryList = this.categoryService.getCategories(merchant.getAncillaryBusiness());
|
|
|
+// if (!CollectionUtils.isEmpty(categoryList)){
|
|
|
+// List<String> ancillaryBusinessNames = categoryList.stream()
|
|
|
+// .map(Category::getName) //
|
|
|
+// .collect(Collectors.toList());
|
|
|
+// merchant.setAncillaryBusinessName(ancillaryBusinessNames);
|
|
|
+// }
|
|
|
Long userId = SessionContextHolder.getSession().getId();
|
|
|
//查询商家是否被收藏
|
|
|
Integer count = this.baseMapper.merchantFavorite(id, userId);
|
|
@@ -131,9 +133,9 @@ public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> i
|
|
|
id, GoodsQueryParam.builder().size(100).build()
|
|
|
);
|
|
|
// 获取商家商品分类类型列表
|
|
|
- List<Long> idSet = new ArrayList<>();
|
|
|
- idSet.add(merchant.getMainBusiness());
|
|
|
- idSet.addAll(merchant.getAncillaryBusiness());
|
|
|
+ List<Long> idSet = goods.stream()
|
|
|
+ .map(GoodsDTO::getCategoryId) // 将每个Person对象映射到其id
|
|
|
+ .collect(Collectors.toList());
|
|
|
if (idSet.isEmpty()) {
|
|
|
return MerchantDetailDTO.builder().merchant(merchant).goods(goods).build();
|
|
|
}
|
|
@@ -485,4 +487,18 @@ public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> i
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String,Object> getMerchantReportCount(ReportModifyParam param){
|
|
|
+ Integer month = param.getMonth();
|
|
|
+ Integer day = param.getDay();
|
|
|
+ if ("0".equals(param.getType())){
|
|
|
+ month = null;
|
|
|
+ day = null;
|
|
|
+ }else if ("1".equals(param.getType())){
|
|
|
+ day = null;
|
|
|
+ }
|
|
|
+ return this.baseMapper.getAddMerchantReport(param.getYear(),month,day);
|
|
|
+ }
|
|
|
+
|
|
|
}
|