Selaa lähdekoodia

修复:连锁品牌近期开关店情况转递大类返回空数据的问题

云殇忆 1 vuosi sitten
vanhempi
säilyke
80c7a627f9

+ 25 - 2
benyun-core/src/main/java/com/benyun/core/service/impl/BrandServiceImpl.java

@@ -7,6 +7,7 @@ import com.benyun.core.entity.bo.*;
 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;
@@ -43,6 +44,8 @@ public class BrandServiceImpl implements BrandService {
     WdInfoServiceImpl wdInfoService;
     @Autowired
     BrandStoreOpcloseDao storeOpcloseDao;
+    @Autowired
+    CategoryUtil categoryUtil;
 
     @Override
     public List<BrandSearch> searchByLikeName(String text) {
@@ -456,13 +459,33 @@ public class BrandServiceImpl implements BrandService {
 
     @Override
     public List<BrandOpcloseVo> searchOpenByMulti(List<String> typeCodes, LocalDateTime startTime, LocalDateTime endTime) {
-        List<BrandOpcloseVo> vos = storeOpcloseDao.selectOpenByMulti(typeCodes, startTime, 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<BrandOpcloseVo> vos = storeOpcloseDao.selectCloseByMulti(typeCodes, startTime, 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);
     }
 }