修改套餐导入功能

This commit is contained in:
wuweihua
2026-10-10 11:16:03 +08:00
parent 9d7218795a
commit fab2ec7d9c
12 changed files with 578 additions and 127 deletions
@@ -244,9 +244,13 @@ public class PriceSetController extends BaseController
public AjaxResult importDetailPrices(MultipartFile file,
@RequestParam("priceSetId") Long priceSetId,
@RequestParam(value = "psvId", required = false) Long psvId,
@RequestParam(value = "updateOnly", required = false, defaultValue = "false") boolean updateOnly) throws Exception
@RequestParam(value = "updateOnly", required = false, defaultValue = "false") boolean updateOnly,
@RequestParam(value = "replaceByProductCountry", required = false, defaultValue = "false") boolean replaceByProductCountry,
@RequestParam(value = "countryCode", required = false) String countryCode)
throws Exception
{
String taskId = priceSetService.submitImportDetailPricesAsync(priceSetId, psvId, file, getUsername(), updateOnly);
String taskId = priceSetService.submitImportDetailPricesAsync(priceSetId, psvId, file, getUsername(), updateOnly,
replaceByProductCountry, countryCode);
Map<String, Object> payload = new HashMap<String, Object>();
payload.put("taskId", taskId);
return success(payload);
@@ -263,12 +267,15 @@ public class PriceSetController extends BaseController
}
/**
* Preview Excel import (no DB write). Optional detailsJson for updateOnly merge.
* Preview Excel import (no DB write). Optional detailsJson for updateOnly / build-price merge.
* Optional countryCode = single-country dedicated-line Excel (same as product country import).
*/
@PreAuthorize("@ss.hasPermi('price:set:edit') or @ss.hasPermi('price:set:forceEdit') or @ss.hasPermi('price:set:add')")
@PostMapping("/detail/previewImportPrices")
public AjaxResult previewImportPrices(MultipartFile file,
@RequestParam(value = "updateOnly", required = false, defaultValue = "false") boolean updateOnly,
@RequestParam(value = "replaceByProductCountry", required = false, defaultValue = "false") boolean replaceByProductCountry,
@RequestParam(value = "countryCode", required = false) String countryCode,
@RequestParam(value = "detailsJson", required = false) String detailsJson) throws Exception
{
if (file == null || file.isEmpty())
@@ -281,7 +288,7 @@ public class PriceSetController extends BaseController
existing = com.alibaba.fastjson2.JSON.parseArray(detailsJson, PrcPriceSetDetail.class);
}
return success(priceSetService.previewImportDetailPrices(
file.getBytes(), file.getOriginalFilename(), updateOnly, existing));
file.getBytes(), file.getOriginalFilename(), updateOnly, existing, replaceByProductCountry, countryCode));
}
/**