修改套餐导入功能
This commit is contained in:
+11
-4
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user