|
|
|
@ -17,7 +17,9 @@
|
|
|
|
|
package com.logpm.basicdata.service.impl; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataStoreBrandEntity; |
|
|
|
|
import com.logpm.basicdata.excel.BasicdataStoreBrandExcel; |
|
|
|
@ -93,15 +95,29 @@ public class BasicdataStoreBrandServiceImpl extends BaseServiceImpl<BasicdataSto
|
|
|
|
|
log.info("接收的参数为=》》{}",basicdataStoreBrand); |
|
|
|
|
Object o1 = basicdataStoreBrand.get("brandName");//品牌名称
|
|
|
|
|
Object o = basicdataStoreBrand.get("ids"); // 客户id
|
|
|
|
|
Object type = basicdataStoreBrand.get("type"); // 客户id
|
|
|
|
|
List<BasicdataStoreBrandVO> voList = new ArrayList<>(); |
|
|
|
|
if(Func.isNotEmpty(o1) && Func.isNotEmpty(o)){ |
|
|
|
|
if(Func.isNotEmpty(o)){ |
|
|
|
|
String o2 = (String) o; |
|
|
|
|
List<String> l = Arrays.asList(o2.split(",")); |
|
|
|
|
List<BasicdataStoreBrandVO> listAll = new ArrayList<>(); |
|
|
|
|
List<BasicdataStoreBrandVO> basicdataStoreBrandVOS = baseMapper.listNameBrand(o1.toString()); // 查询相关品牌信息
|
|
|
|
|
// List<BasicdataStoreBrandVO> listAll = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
//查询客户相关的品牌
|
|
|
|
|
l.forEach(i ->{ |
|
|
|
|
List<BasicdataStoreBrandEntity> basicdataStoreBrandEntities = baseMapper.selectList(Wrappers.<BasicdataStoreBrandEntity>query().lambda() |
|
|
|
|
QueryWrapper<BasicdataStoreBrandEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
if(type.equals("1")){ |
|
|
|
|
//客户
|
|
|
|
|
queryWrapper.apply(ObjectUtils.isNotNull(o1),"lbb.brand_name like concat('%',{0},'%') ",o1); |
|
|
|
|
queryWrapper.apply("lbsb.client_id ={0} ",i); |
|
|
|
|
}else{ |
|
|
|
|
//门店
|
|
|
|
|
//客户
|
|
|
|
|
queryWrapper.apply(ObjectUtils.isNotNull(o1),"lbb.brand_name like concat('%',{0},'%') ",o1); |
|
|
|
|
queryWrapper.apply("lbsb.shop_id ={0} ", i); |
|
|
|
|
} |
|
|
|
|
List<BasicdataStoreBrandVO> basicdataStoreBrandVOS = baseMapper.listNameBrand(queryWrapper ); // 查询相关品牌信息
|
|
|
|
|
voList.addAll(basicdataStoreBrandVOS); |
|
|
|
|
/* List<BasicdataStoreBrandEntity> basicdataStoreBrandEntities = baseMapper.selectList(Wrappers.<BasicdataStoreBrandEntity>query().lambda() |
|
|
|
|
.eq(BasicdataStoreBrandEntity::getClientId, i) |
|
|
|
|
); |
|
|
|
|
if(basicdataStoreBrandEntities.size() > 0){ |
|
|
|
@ -111,9 +127,9 @@ public class BasicdataStoreBrandServiceImpl extends BaseServiceImpl<BasicdataSto
|
|
|
|
|
return b; |
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
listAll.addAll(collect); |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
}); |
|
|
|
|
Map<String, Long> collect = listAll.stream().collect(Collectors.groupingBy(p -> p.getBrandId(), Collectors.counting())); |
|
|
|
|
/* Map<String, Long> collect = listAll.stream().collect(Collectors.groupingBy(p -> p.getBrandId(), Collectors.counting())); |
|
|
|
|
collect.forEach((k, v) -> System.out.println(k + ":" + v)); |
|
|
|
|
|
|
|
|
|
collect.forEach((k,v) ->{ |
|
|
|
@ -128,7 +144,7 @@ public class BasicdataStoreBrandServiceImpl extends BaseServiceImpl<BasicdataSto
|
|
|
|
|
voList.addAll(coll); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
});*/ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return voList; |
|
|
|
|