fix(智慧超市):库存导入导出适配,增加覆盖导入
This commit is contained in:
1 parent
c7a6a05598
commit
0496bba153
2 files changed
+30
No files matched your search
+22
@@ -275,6 +275,28 @@ public class SmErpSpuController {
|
||||
return smErpSpuService.importErpSpuNew(collect, bindingResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新的导入方法(更新模式)- 允许覆盖现有数据
|
||||
* 参考图片数据结构:商品编码、商品名称、规格、包装单位编码、换算率、是否主单位、辅助条码、条码类型
|
||||
*
|
||||
* @param dtos 导入数据列表
|
||||
* @param bindingResult 错误信息列表
|
||||
* @return R
|
||||
*/
|
||||
@PostMapping("/importNewUpdate")
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_supermarketSpu_import')" )
|
||||
@Idempotent(expireTime = 10, info = "请勿重复导入,10秒后再重新尝试")
|
||||
@Operation(summary = "新的商品导入(更新模式)", description = "支持包装单位、辅助条码等详细信息的导入,允许覆盖现有数据")
|
||||
public R importErpSpuNewUpdate(@RequestExcel List<SmErpSpuImportNewDto> dtos, BindingResult bindingResult) {
|
||||
List<SmErpSpuImportNewDto> collect = dtos.stream()
|
||||
.filter(dto -> StringUtils.isNotBlank(dto.getProductCode()))
|
||||
.collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(collect)) {
|
||||
return R.failed("导入数据不能为空");
|
||||
}
|
||||
return smErpSpuService.importErpSpuNewUpdate(collect, bindingResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 条件查询spu单表 列表信息
|
||||
* @param supermarketSpuQueryDTO 商品spu
|
||||
|
||||
+8
@@ -121,6 +121,14 @@ public interface SmErpSpuService extends IService<SmErpSpuEntity> {
|
||||
*/
|
||||
R importErpSpuNew(List<SmErpSpuImportNewDto> smErpSpuImportNewDtos, BindingResult bindingResult);
|
||||
|
||||
/**
|
||||
* 新的导入方法(更新模式)- 允许覆盖现有数据
|
||||
* @param smErpSpuImportNewDtos
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
R importErpSpuNewUpdate(List<SmErpSpuImportNewDto> smErpSpuImportNewDtos, BindingResult bindingResult);
|
||||
|
||||
|
||||
/**
|
||||
* 导出
|
||||
|
||||
Reference in new issue
Block a user