|
@@ -31,12 +31,7 @@ import com.ym.mec.biz.dal.page.GoodsCategoryQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.GoodsQuery;
|
|
import com.ym.mec.biz.dal.page.GoodsQuery;
|
|
|
import com.ym.mec.biz.dal.page.GoodsQueryInfo;
|
|
import com.ym.mec.biz.dal.page.GoodsQueryInfo;
|
|
|
import com.ym.mec.biz.dal.wrapper.GoodsWrapper;
|
|
import com.ym.mec.biz.dal.wrapper.GoodsWrapper;
|
|
|
-import com.ym.mec.biz.service.GoodsCategoryService;
|
|
|
|
|
-import com.ym.mec.biz.service.GoodsService;
|
|
|
|
|
-import com.ym.mec.biz.service.SysConfigService;
|
|
|
|
|
-import com.ym.mec.biz.service.SysMessageService;
|
|
|
|
|
-import com.ym.mec.biz.service.SysTenantConfigService;
|
|
|
|
|
-import com.ym.mec.biz.service.UploadFileService;
|
|
|
|
|
|
|
+import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.dto.BrandDto;
|
|
import com.ym.mec.common.dto.BrandDto;
|
|
|
import com.ym.mec.common.dto.PmsProductDto;
|
|
import com.ym.mec.common.dto.PmsProductDto;
|
|
@@ -90,34 +85,31 @@ import java.util.stream.Collectors;
|
|
|
public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implements GoodsService {
|
|
public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implements GoodsService {
|
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(CourseScheduleTeacherSalaryServiceImpl.class);
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(CourseScheduleTeacherSalaryServiceImpl.class);
|
|
|
|
|
|
|
|
- @Autowired
|
|
|
|
|
|
|
+ @Resource
|
|
|
private GoodsDao goodsDao;
|
|
private GoodsDao goodsDao;
|
|
|
- @Autowired
|
|
|
|
|
|
|
+ @Resource
|
|
|
private UploadFileService uploadFileService;
|
|
private UploadFileService uploadFileService;
|
|
|
- @Autowired
|
|
|
|
|
|
|
+ @Resource
|
|
|
private IdGeneratorService idGeneratorService;
|
|
private IdGeneratorService idGeneratorService;
|
|
|
- @Autowired
|
|
|
|
|
|
|
+ @Resource
|
|
|
private GoodsProcurementDao goodsProcurementDao;
|
|
private GoodsProcurementDao goodsProcurementDao;
|
|
|
- @Autowired
|
|
|
|
|
|
|
+ @Resource
|
|
|
private SysTenantConfigService sysTenantConfigService;
|
|
private SysTenantConfigService sysTenantConfigService;
|
|
|
- @Autowired
|
|
|
|
|
|
|
+ @Resource
|
|
|
private SysMessageService sysMessageService;
|
|
private SysMessageService sysMessageService;
|
|
|
- @Autowired
|
|
|
|
|
|
|
+ @Resource
|
|
|
private TeacherDao teacherDao;
|
|
private TeacherDao teacherDao;
|
|
|
- @Autowired
|
|
|
|
|
|
|
+ @Resource
|
|
|
private SellOrderDao sellOrderDao;
|
|
private SellOrderDao sellOrderDao;
|
|
|
- @Autowired
|
|
|
|
|
|
|
+ @Resource
|
|
|
private OrganizationDao organizationDao;
|
|
private OrganizationDao organizationDao;
|
|
|
@Resource
|
|
@Resource
|
|
|
private MallFeignService mallFeignService;
|
|
private MallFeignService mallFeignService;
|
|
|
-
|
|
|
|
|
- @Autowired
|
|
|
|
|
- private GoodsSubMapper goodsSubMapper;
|
|
|
|
|
-
|
|
|
|
|
- @Autowired
|
|
|
|
|
- private GoodsCategoryService goodsCategoryService;
|
|
|
|
|
-
|
|
|
|
|
- @Autowired
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private GoodsCategoryService goodsCategoryService;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private GoodsSubService goodsSubService;
|
|
|
|
|
+ @Resource
|
|
|
private OssPluginContext ossPluginContext;
|
|
private OssPluginContext ossPluginContext;
|
|
|
@Override
|
|
@Override
|
|
|
public BaseDAO<Integer, Goods> getDAO() {
|
|
public BaseDAO<Integer, Goods> getDAO() {
|
|
@@ -240,10 +232,10 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
goodsDao.insert(goodsRecord);
|
|
goodsDao.insert(goodsRecord);
|
|
|
List<GoodsSub> goodsSubs = JSON.parseArray(JSON.toJSONString(goodsSubList), GoodsSub.class);
|
|
List<GoodsSub> goodsSubs = JSON.parseArray(JSON.toJSONString(goodsSubList), GoodsSub.class);
|
|
|
goodsSubs.forEach(next -> next.setGoodsId(goodsRecord.getId()));
|
|
goodsSubs.forEach(next -> next.setGoodsId(goodsRecord.getId()));
|
|
|
- goodsSubMapper.saveBatch(goodsSubs);
|
|
|
|
|
|
|
+ goodsSubService.saveBatch(goodsSubs);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
|
|
+ /*@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void addGoodsProcurement(GoodsProcurement goodsProcurement) {
|
|
public void addGoodsProcurement(GoodsProcurement goodsProcurement) {
|
|
|
Goods existsGood = goodsDao.get(goodsProcurement.getGoodsId());
|
|
Goods existsGood = goodsDao.get(goodsProcurement.getGoodsId());
|
|
@@ -273,7 +265,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
goodsProcurementDao.insert(goodsProcurement);
|
|
goodsProcurementDao.insert(goodsProcurement);
|
|
|
|
|
|
|
|
sellOrderBatchNoAllot(existsGood.getTenantId());
|
|
sellOrderBatchNoAllot(existsGood.getTenantId());
|
|
|
- }
|
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -321,7 +313,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
// 从管乐迷商城组合的商品
|
|
// 从管乐迷商城组合的商品
|
|
|
QueryWrapper<GoodsSub> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<GoodsSub> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("goods_id_", goodsId);
|
|
queryWrapper.eq("goods_id_", goodsId);
|
|
|
- List<GoodsSub> goodsSubs = goodsSubMapper.selectList(queryWrapper);
|
|
|
|
|
|
|
+ List<GoodsSub> goodsSubs = goodsSubService.getBaseMapper().selectList(queryWrapper);
|
|
|
if (goodsSubs.isEmpty()) {
|
|
if (goodsSubs.isEmpty()) {
|
|
|
return new ArrayList<>();
|
|
return new ArrayList<>();
|
|
|
}
|
|
}
|
|
@@ -398,7 +390,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
return page;
|
|
return page;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
|
|
+/* @Override
|
|
|
@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
|
|
@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
|
|
|
public List<Goods> importGoods(MultipartFile file, Integer operatorId) throws Exception {
|
|
public List<Goods> importGoods(MultipartFile file, Integer operatorId) throws Exception {
|
|
|
Map<String, List<Map<String, Object>>> sheetsListMap = POIUtil.importExcel(new ByteArrayInputStream(file.getBytes()), 2, file.getOriginalFilename());
|
|
Map<String, List<Map<String, Object>>> sheetsListMap = POIUtil.importExcel(new ByteArrayInputStream(file.getBytes()), 2, file.getOriginalFilename());
|
|
@@ -596,7 +588,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
sellOrderBatchNoAllot(TenantContextHolder.getTenantId());
|
|
sellOrderBatchNoAllot(TenantContextHolder.getTenantId());
|
|
|
|
|
|
|
|
return goodsList;
|
|
return goodsList;
|
|
|
- }
|
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -725,10 +717,15 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if ("image".equals(fieldCode) && value instanceof List) { // 图片数组 取第一个
|
|
|
|
|
- Object data = ((List<?>) value).get(0);
|
|
|
|
|
- if (data instanceof PictureData) {
|
|
|
|
|
- value = ((PictureData) data).getData();
|
|
|
|
|
|
|
+ if ("image".equals(fieldCode)) { // 图片数组 取第一个
|
|
|
|
|
+ if (value instanceof List) {
|
|
|
|
|
+ Object data = ((List<?>) value).get(0);
|
|
|
|
|
+ if (data instanceof PictureData) {
|
|
|
|
|
+ value = ((PictureData) data).getData();
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ lineErrList.add("图片格式错误");
|
|
|
|
|
+ continue;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
beforeGoods.put(fieldCode, value);
|
|
beforeGoods.put(fieldCode, value);
|
|
@@ -922,7 +919,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
sub.setGoodsPrice(next.getGoodsPrice());
|
|
sub.setGoodsPrice(next.getGoodsPrice());
|
|
|
return sub;
|
|
return sub;
|
|
|
}).collect(Collectors.toList());
|
|
}).collect(Collectors.toList());
|
|
|
- goodsSubMapper.saveBatch(subList);
|
|
|
|
|
|
|
+ goodsSubService.saveBatch(subList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// goodsGroup.forEach((key, value) -> {
|
|
// goodsGroup.forEach((key, value) -> {
|
|
@@ -983,7 +980,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
|
|
+/* @Override
|
|
|
@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
|
|
@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
|
|
|
public void sellOrderBatchNoAllot(Integer tenantId) {
|
|
public void sellOrderBatchNoAllot(Integer tenantId) {
|
|
|
List<Integer> noneBatchNoSellOrderIds = sellOrderDao.getNoneBatchNoSellOrderIds(tenantId);
|
|
List<Integer> noneBatchNoSellOrderIds = sellOrderDao.getNoneBatchNoSellOrderIds(tenantId);
|
|
@@ -1025,7 +1022,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
if(!CollectionUtils.isEmpty(updateSellOrders)){
|
|
if(!CollectionUtils.isEmpty(updateSellOrders)){
|
|
|
sellOrderDao.batchUpdate(updateSellOrders);
|
|
sellOrderDao.batchUpdate(updateSellOrders);
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
|
|
@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
|
|
@@ -1035,7 +1032,37 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
List<Goods> tempGoodsList = goodsDao.lockGoods(new ArrayList<>(goodsIds));
|
|
List<Goods> tempGoodsList = goodsDao.lockGoods(new ArrayList<>(goodsIds));
|
|
|
- Map<Integer, Goods> idTempGoodsMap = tempGoodsList.stream().collect(Collectors.toMap(Goods::getId, g -> g));
|
|
|
|
|
|
|
+ PmsProductQueryParamDto paramDto = new PmsProductQueryParamDto();
|
|
|
|
|
+ String skuIds = goodsSubService.lambdaQuery().in(GoodsSub::getGoodsId, tempGoodsList.stream().map(Goods::getId).collect(Collectors.toList())).list()
|
|
|
|
|
+ .stream().map(e->e.getSku().toString()).collect(Collectors.joining(","));
|
|
|
|
|
+ paramDto.setSkuStockIds(skuIds);
|
|
|
|
|
+ PageInfo<PmsProductDto> productList = mallFeignService.getProductList(paramDto);
|
|
|
|
|
+ if (CollectionUtils.isEmpty(productList.getRows())) {
|
|
|
|
|
+ throw new BizException("商品不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ Map<Integer,PmsProductDto> skuIdProductMap = productList.getRows().stream().collect(Collectors.toMap(PmsProductDto::getSkuStockId, Function.identity()));
|
|
|
|
|
+ List<SellOrder> sellOrders = new ArrayList<>();
|
|
|
|
|
+ for (Goods goods : tempGoodsList) {
|
|
|
|
|
+ List<GoodsSub> goodsSubs = goodsSubService.lambdaQuery().eq(GoodsSub::getGoodsId, goods.getId()).list();
|
|
|
|
|
+ if(CollectionUtils.isEmpty(goodsSubs)){
|
|
|
|
|
+ throw new BizException("商品["+goods.getName()+"]未设置子商品");
|
|
|
|
|
+ }
|
|
|
|
|
+ for (GoodsSub goodsSub : goodsSubs) {
|
|
|
|
|
+ PmsProductDto productDto = skuIdProductMap.get(goodsSub.getSku());
|
|
|
|
|
+ if(Objects.isNull(productDto)){
|
|
|
|
|
+ throw new BizException("商品["+goods.getName()+"]子商品["+goodsSub.getSku()+"]不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ SellOrder sellOrder = new SellOrder();
|
|
|
|
|
+ sellOrder.setParentGoodsId(goods.getId());
|
|
|
|
|
+ sellOrder.setGoodsSkuId(goodsSub.getSku());
|
|
|
|
|
+ sellOrder.setNum(1);
|
|
|
|
|
+ sellOrder.setGoodsName(productDto.getName());
|
|
|
|
|
+ sellOrder.setAccountType(accountType);
|
|
|
|
|
+ sellOrder.setOrganSellCost(goodsSub.getGoodsPrice());
|
|
|
|
|
+ sellOrders.add(sellOrder);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ /*Map<Integer, Goods> idTempGoodsMap = tempGoodsList.stream().collect(Collectors.toMap(Goods::getId, g -> g));
|
|
|
List<GoodsProcurement> goodsProcurements = new ArrayList<>();
|
|
List<GoodsProcurement> goodsProcurements = new ArrayList<>();
|
|
|
for (Integer goodsId : goodsIds) {
|
|
for (Integer goodsId : goodsIds) {
|
|
|
Goods tempGoods = idTempGoodsMap.get(goodsId);
|
|
Goods tempGoods = idTempGoodsMap.get(goodsId);
|
|
@@ -1150,12 +1177,12 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
}
|
|
}
|
|
|
sellOrders.add(sellOrder);
|
|
sellOrders.add(sellOrder);
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
|
|
return sellOrders;
|
|
return sellOrders;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
|
|
+/* @Override
|
|
|
@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
|
|
@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
|
|
|
public void increaseStock(List<SellOrder> sellOrders, AccountType accountType) {
|
|
public void increaseStock(List<SellOrder> sellOrders, AccountType accountType) {
|
|
|
if(CollectionUtils.isEmpty(sellOrders)){
|
|
if(CollectionUtils.isEmpty(sellOrders)){
|
|
@@ -1189,10 +1216,10 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
}
|
|
}
|
|
|
goods.setSellCount(new AtomicInteger(goods.getSellCount()).addAndGet(-sellOrder.getNum()));
|
|
goods.setSellCount(new AtomicInteger(goods.getSellCount()).addAndGet(-sellOrder.getNum()));
|
|
|
|
|
|
|
|
-// goodsDao.update(goods);
|
|
|
|
|
-// goodsProcurementDao.update(goodsProcurement);
|
|
|
|
|
|
|
+ goodsDao.update(goods);
|
|
|
|
|
+ goodsProcurementDao.update(goodsProcurement);
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<GoodsSellDto> queryGoodsSellDtos(String goodsId) {
|
|
public List<GoodsSellDto> queryGoodsSellDtos(String goodsId) {
|
|
@@ -1253,11 +1280,11 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
goodsInfo.setComplementGoodsIdList(null);
|
|
goodsInfo.setComplementGoodsIdList(null);
|
|
|
UpdateWrapper<GoodsSub> delWrapper = new UpdateWrapper<>();
|
|
UpdateWrapper<GoodsSub> delWrapper = new UpdateWrapper<>();
|
|
|
delWrapper.eq("goods_id_", goods.getId());
|
|
delWrapper.eq("goods_id_", goods.getId());
|
|
|
- goodsSubMapper.delete(delWrapper);
|
|
|
|
|
|
|
+ goodsSubService.getBaseMapper().delete(delWrapper);
|
|
|
|
|
|
|
|
List<GoodsSub> goodsSubs = JSON.parseArray(JSON.toJSONString(goodsSubList), GoodsSub.class);
|
|
List<GoodsSub> goodsSubs = JSON.parseArray(JSON.toJSONString(goodsSubList), GoodsSub.class);
|
|
|
goodsSubs.forEach(next -> next.setGoodsId(goods.getId()));
|
|
goodsSubs.forEach(next -> next.setGoodsId(goods.getId()));
|
|
|
- goodsSubMapper.saveBatch(goodsSubs);
|
|
|
|
|
|
|
+ goodsSubService.saveBatch(goodsSubs);
|
|
|
|
|
|
|
|
BigDecimal organCostPrice = goodsSubList.stream().map(GoodsWrapper.GoodsSub::getGoodsPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
BigDecimal organCostPrice = goodsSubList.stream().map(GoodsWrapper.GoodsSub::getGoodsPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
goodsInfo.setOrganCostPrice(organCostPrice);
|
|
goodsInfo.setOrganCostPrice(organCostPrice);
|
|
@@ -1306,7 +1333,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
List<Integer> skuIds = goodsSubModelList.stream().map(GoodsSubModel::getSkuId).distinct().collect(Collectors.toList());
|
|
List<Integer> skuIds = goodsSubModelList.stream().map(GoodsSubModel::getSkuId).distinct().collect(Collectors.toList());
|
|
|
QueryWrapper<GoodsSub> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<GoodsSub> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.in("sku_", skuIds);
|
|
queryWrapper.in("sku_", skuIds);
|
|
|
- List<GoodsSub> goodsSubs = goodsSubMapper.selectList(queryWrapper);
|
|
|
|
|
|
|
+ List<GoodsSub> goodsSubs = goodsSubService.getBaseMapper().selectList(queryWrapper);
|
|
|
if (CollectionUtils.isEmpty(goodsSubs)) {
|
|
if (CollectionUtils.isEmpty(goodsSubs)) {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
@@ -1320,7 +1347,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
goodsDao.updateStatus(goodIdList, false);
|
|
goodsDao.updateStatus(goodIdList, false);
|
|
|
}
|
|
}
|
|
|
Map<Boolean, List<Integer>> listMap = goodsSubList.stream().collect(Collectors.groupingBy(GoodsSub::getGoodsStatus, Collectors.mapping(GoodsSub::getId, Collectors.toList())));
|
|
Map<Boolean, List<Integer>> listMap = goodsSubList.stream().collect(Collectors.groupingBy(GoodsSub::getGoodsStatus, Collectors.mapping(GoodsSub::getId, Collectors.toList())));
|
|
|
- listMap.forEach((key, values) -> goodsSubMapper.updateStatus(values, key));
|
|
|
|
|
|
|
+ listMap.forEach((key, values) -> goodsSubService.getBaseMapper().updateStatus(values, key));
|
|
|
log.info(Thread.currentThread().getName() + "同步商品状态完成");
|
|
log.info(Thread.currentThread().getName() + "同步商品状态完成");
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
@@ -1340,7 +1367,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
|
|
|
|
|
QueryWrapper<GoodsSub> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<GoodsSub> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.in("sku_", skus);
|
|
queryWrapper.in("sku_", skus);
|
|
|
- List<GoodsSub> goodsSubs = goodsSubMapper.selectList(queryWrapper);
|
|
|
|
|
|
|
+ List<GoodsSub> goodsSubs = goodsSubService.getBaseMapper().selectList(queryWrapper);
|
|
|
if (CollectionUtils.isEmpty(goodsSubs)) {
|
|
if (CollectionUtils.isEmpty(goodsSubs)) {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
@@ -1352,7 +1379,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
|
|
|
|
|
queryWrapper = new QueryWrapper<>();
|
|
queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.in("goods_id_", goodIds);
|
|
queryWrapper.in("goods_id_", goodIds);
|
|
|
- List<GoodsSub> allGoodsSubs = goodsSubMapper.selectList(queryWrapper);
|
|
|
|
|
|
|
+ List<GoodsSub> allGoodsSubs = goodsSubService.getBaseMapper().selectList(queryWrapper);
|
|
|
List<String> allSkuIdList = allGoodsSubs.stream().map(next -> next.getSku().toString()).distinct().collect(Collectors.toList());
|
|
List<String> allSkuIdList = allGoodsSubs.stream().map(next -> next.getSku().toString()).distinct().collect(Collectors.toList());
|
|
|
PmsProductQueryParamDto dto = new PmsProductQueryParamDto();
|
|
PmsProductQueryParamDto dto = new PmsProductQueryParamDto();
|
|
|
dto.setSkuStockIds(String.join(",", allSkuIdList));
|
|
dto.setSkuStockIds(String.join(",", allSkuIdList));
|
|
@@ -1434,7 +1461,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
String format = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
|
|
String format = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
|
|
|
- File file = createImportGoodsTempFile(format + ".csv");
|
|
|
|
|
|
|
+ File file = createImportGoodsTempFile("商品导入回执" + format + ".csv");
|
|
|
try {
|
|
try {
|
|
|
FileOutputStream out = new FileOutputStream(file);
|
|
FileOutputStream out = new FileOutputStream(file);
|
|
|
byte[] uft8bom = {(byte) 0xef, (byte) 0xbb, (byte) 0xbf}; // 处理乱码
|
|
byte[] uft8bom = {(byte) 0xef, (byte) 0xbb, (byte) 0xbf}; // 处理乱码
|