lyhzzz hai 1 ano
pai
achega
d8cf7cd248

+ 1 - 1
src/main/java/com/cdf/service/impl/BrandServiceImpl.java

@@ -126,7 +126,7 @@ public class BrandServiceImpl extends ServiceImpl<IBrandMapper, Brand> implement
                     .or()
                     .like(Brand::getEnName,param.getKeyword());
         }
-        wrapper.orderByDesc(Brand::getCreateTime);
+        wrapper.orderByDesc(Brand::getId);
         Page<Brand> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), wrapper);
         List<Integer> outLineIds = page.getRecords().stream().map(Brand::getOutlineId).filter(Objects::nonNull).collect(Collectors.toList());
         HashMap<Integer, HotOutline> map = hotOutlineService.getMapByIds(outLineIds);

+ 4 - 1
src/main/java/com/cdf/service/impl/ExcelService.java

@@ -8,6 +8,7 @@ import com.alibaba.excel.write.metadata.WriteSheet;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.amazonaws.services.ecs.model.Tmpfs;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.cdf.common.CacheUtil;
 import com.cdf.common.ResultCode;
 import com.cdf.entity.*;
@@ -490,7 +491,9 @@ public class ExcelService {
     }
 
     public void downBrandExcel(HttpServletRequest request,HttpServletResponse response) throws Exception {
-        List<Brand> list = brandService.list();
+        LambdaQueryWrapper<Brand> wrapper = new LambdaQueryWrapper<>();
+        wrapper.orderByDesc(Brand::getId);
+        List<Brand> list = brandService.list(wrapper);
         List<BrandExcelVo> voList = new ArrayList<>();
         for (Brand brand : list) {
             BrandExcelVo vo = new BrandExcelVo();