|
@@ -4,13 +4,17 @@ 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;
|
|
|
+import com.benyun.core.utils.CategoryUtil;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.*;
|
|
|
|
|
|
@Service
|
|
@@ -39,6 +43,12 @@ public class BrandServiceImpl implements BrandService {
|
|
|
TypeByDao typeByDao;
|
|
|
@Autowired
|
|
|
WdInfoServiceImpl wdInfoService;
|
|
|
+ @Autowired
|
|
|
+ BrandStoreOpcloseDao storeOpcloseDao;
|
|
|
+ @Autowired
|
|
|
+ CategoryUtil categoryUtil;
|
|
|
+ @Autowired
|
|
|
+ BrandEvolveDao brandEvolveDao;
|
|
|
|
|
|
@Override
|
|
|
public List<BrandSearch> searchByLikeName(String text) {
|
|
@@ -449,4 +459,71 @@ public class BrandServiceImpl implements BrandService {
|
|
|
});
|
|
|
return bos;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<BrandOpcloseVo> searchOpenByMulti(List<String> typeCodes, LocalDateTime startTime, LocalDateTime endTime) {
|
|
|
+ List<String> codes = new ArrayList<>();
|
|
|
+ if (typeCodes != null){
|
|
|
+ for (String code : typeCodes){
|
|
|
+ codes.add(code);
|
|
|
+ List<String> otherTypeBy = categoryUtil.getAllOtherTypeBy(code);
|
|
|
+ codes.addAll(otherTypeBy);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ codes = null;
|
|
|
+ }
|
|
|
+ List<BrandOpcloseVo> vos = storeOpcloseDao.selectOpenByMulti(codes, startTime, endTime);
|
|
|
+ return vos.subList(0, 9);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<BrandOpcloseVo> searchCloseByMulti(List<String> typeCodes, LocalDateTime startTime, LocalDateTime endTime) {
|
|
|
+ List<String> codes = new ArrayList<>();
|
|
|
+ if (typeCodes != null){
|
|
|
+ for (String code : typeCodes){
|
|
|
+ codes.add(code);
|
|
|
+ List<String> otherTypeBy = categoryUtil.getAllOtherTypeBy(code);
|
|
|
+ codes.addAll(otherTypeBy);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ codes = null;
|
|
|
+ }
|
|
|
+ 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;
|
|
|
+ }
|
|
|
}
|