|
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.benyun.core.dao.*;
|
|
|
import com.benyun.core.entity.*;
|
|
|
import com.benyun.core.entity.bo.*;
|
|
|
+import com.benyun.core.entity.vo.BrandEvolveVo;
|
|
|
import com.benyun.core.entity.vo.BrandOpcloseVo;
|
|
|
import com.benyun.core.entity.vo.ListQueryBody;
|
|
|
import com.benyun.core.service.BrandService;
|
|
@@ -46,6 +47,8 @@ public class BrandServiceImpl implements BrandService {
|
|
|
BrandStoreOpcloseDao storeOpcloseDao;
|
|
|
@Autowired
|
|
|
CategoryUtil categoryUtil;
|
|
|
+ @Autowired
|
|
|
+ BrandEvolveDao brandEvolveDao;
|
|
|
|
|
|
@Override
|
|
|
public List<BrandSearch> searchByLikeName(String text) {
|
|
@@ -488,4 +491,39 @@ public class BrandServiceImpl implements BrandService {
|
|
|
List<BrandOpcloseVo> vos = storeOpcloseDao.selectCloseByMulti(codes, startTime, endTime);
|
|
|
return vos.subList(0,9);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<BrandEvolveVo> searchEvolveByMulti(List<String> addrCodes, List<String> typeCodes, List<String> brandIds) {
|
|
|
+ List<String> addrs = new ArrayList<>();
|
|
|
+ if (addrCodes != null){
|
|
|
+ for (String code : addrCodes){
|
|
|
+ addrs.add(code);
|
|
|
+ List<String> otherAddrCode = categoryUtil.getAllOtherAddrCode(code);
|
|
|
+ addrs.addAll(otherAddrCode);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ addrs = null;
|
|
|
+ }
|
|
|
+ List<String> types = new ArrayList<>();
|
|
|
+ if (typeCodes != null){
|
|
|
+ for (String code : typeCodes){
|
|
|
+ types.add(code);
|
|
|
+ List<String> otherTypeBy = categoryUtil.getAllOtherTypeBy(code);
|
|
|
+ types.addAll(otherTypeBy);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ types = null;
|
|
|
+ }
|
|
|
+ List<BrandEvolveVo> vos = new ArrayList<>();
|
|
|
+ for (String brandId : brandIds){
|
|
|
+ List<BrandEvolveVo> evolveVos = brandEvolveDao.selectByMulti(addrs, types, brandId);
|
|
|
+ for (int i=0; i<evolveVos.size(); i++){
|
|
|
+ if (i == 0)
|
|
|
+ continue;
|
|
|
+ evolveVos.get(i).setTotal(evolveVos.get(i-1).getTotal()+evolveVos.get(i).getTotal());
|
|
|
+ }
|
|
|
+ vos.addAll(evolveVos);
|
|
|
+ }
|
|
|
+ return vos;
|
|
|
+ }
|
|
|
}
|