|
|
@@ -17,7 +17,7 @@ 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.EasyExcelUtil;
|
|
|
+import com.sckw.excel.utils.ExcelUtil;
|
|
|
import com.sckw.product.dao.KwpGoodsMapper;
|
|
|
import com.sckw.product.enums.GoodsStatusEnum;
|
|
|
import com.sckw.product.model.*;
|
|
|
@@ -27,13 +27,13 @@ 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;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import java.io.IOException;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -408,7 +408,7 @@ public class KwpGoodsService {
|
|
|
List<Long> entIds = entList.stream().map(EntCacheResDto::getId).toList();
|
|
|
if (CollectionUtils.isEmpty(entIds)) {
|
|
|
wrapper.like(KwpGoods::getName, params.getKeywords());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
wrapper.and(e -> e.in(KwpGoods::getSupplyEntId, entIds).or().like(KwpGoods::getName, params.getKeywords()));
|
|
|
}
|
|
|
}
|
|
|
@@ -458,7 +458,7 @@ public class KwpGoodsService {
|
|
|
* @Param params:
|
|
|
* @return: void
|
|
|
*/
|
|
|
- public void export(ExportGoodsListParam params) {
|
|
|
+ public void export(ExportGoodsListParam params, HttpServletResponse response) {
|
|
|
PageResult pageResult = select(BeanUtils.copyProperties(params, SelectGoodsListParam.class), false);
|
|
|
List<GoodsList> goodsLists = pageResult.getList();
|
|
|
List<GoodsListExport> list = new ArrayList<>();
|
|
|
@@ -471,8 +471,8 @@ public class KwpGoodsService {
|
|
|
list.add(export);
|
|
|
});
|
|
|
try {
|
|
|
- EasyExcelUtil.writeSingleExcel("商品列表信息", "sheet1", list, GoodsListExport.class);
|
|
|
- } catch (IOException e) {
|
|
|
+ ExcelUtil.download(response, GoodsListExport.class, list);
|
|
|
+ } catch (Exception e) {
|
|
|
throw new BusinessException("导出商品列表异常", e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
@@ -564,7 +564,7 @@ public class KwpGoodsService {
|
|
|
List<Long> entIds = entList.stream().map(EntCacheResDto::getId).toList();
|
|
|
if (CollectionUtils.isNotEmpty(entIds)) {
|
|
|
wrapper.and(e -> e.in(KwpGoods::getSupplyEntId, entIds).or().like(KwpGoods::getName, params.getKeywords()));
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
wrapper.like(KwpGoods::getName, params.getKeywords());
|
|
|
}
|
|
|
}
|