|
|
@@ -17,7 +17,6 @@ import com.sckw.core.utils.CollectionUtils;
|
|
|
import com.sckw.core.utils.StringUtils;
|
|
|
import com.sckw.core.web.context.LoginUserHolder;
|
|
|
import com.sckw.excel.utils.DateUtil;
|
|
|
-import com.sckw.excel.utils.ExcelUtil;
|
|
|
import com.sckw.product.dao.KwpGoodsMapper;
|
|
|
import com.sckw.product.enums.GoodsStatusEnum;
|
|
|
import com.sckw.product.model.*;
|
|
|
@@ -27,7 +26,6 @@ import com.sckw.system.api.RemoteSystemService;
|
|
|
import com.sckw.system.api.model.dto.res.EntCacheResDto;
|
|
|
import com.sckw.system.api.model.dto.res.SysAreaCacheResDto;
|
|
|
import com.sckw.system.api.model.dto.res.UserCacheResDto;
|
|
|
-import jakarta.servlet.http.HttpServletResponse;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
@@ -458,9 +456,12 @@ public class KwpGoodsService {
|
|
|
* @Param params:
|
|
|
* @return: void
|
|
|
*/
|
|
|
- public void export(ExportGoodsListParam params, HttpServletResponse response) {
|
|
|
+ public List<GoodsListExport> export(ExportGoodsListParam params) {
|
|
|
PageResult pageResult = select(BeanUtils.copyProperties(params, SelectGoodsListParam.class), false);
|
|
|
List<GoodsList> goodsLists = pageResult.getList();
|
|
|
+ if (CollectionUtils.isEmpty(goodsLists)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
List<GoodsListExport> list = new ArrayList<>();
|
|
|
goodsLists.forEach(e -> {
|
|
|
GoodsListExport export = BeanUtils.copyProperties(e, GoodsListExport.class);
|
|
|
@@ -470,11 +471,8 @@ public class KwpGoodsService {
|
|
|
.setAddedTime(Objects.isNull(e.getShelfTime()) ? null : DateUtil.getDateTime(e.getShelfTime()));
|
|
|
list.add(export);
|
|
|
});
|
|
|
- try {
|
|
|
- ExcelUtil.download(response, GoodsListExport.class, list);
|
|
|
- } catch (Exception e) {
|
|
|
- throw new BusinessException("导出商品列表异常", e.getMessage());
|
|
|
- }
|
|
|
+ return list;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|