Refactor billing options retrieval to include data permissions and add effective date handling for product imports
This commit is contained in:
+14
-3
@@ -111,21 +111,32 @@ public class BillingController extends BaseController
|
||||
@GetMapping("/bill/orderNos")
|
||||
public AjaxResult orderNoOptions(@RequestParam(value = "keyword", required = false) String keyword)
|
||||
{
|
||||
return success(prcOrderBillService.listOrderNoOptions(keyword));
|
||||
return success(prcOrderBillService.listOrderNoOptions(buildBillOptionQuery(keyword)));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('price:billing:bill')")
|
||||
@GetMapping("/bill/trackingNos")
|
||||
public AjaxResult trackingNoOptions(@RequestParam(value = "keyword", required = false) String keyword)
|
||||
{
|
||||
return success(prcOrderBillService.listTrackingNoOptions(keyword));
|
||||
return success(prcOrderBillService.listTrackingNoOptions(buildBillOptionQuery(keyword)));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('price:billing:bill')")
|
||||
@GetMapping("/bill/transferNos")
|
||||
public AjaxResult transferNoOptions(@RequestParam(value = "keyword", required = false) String keyword)
|
||||
{
|
||||
return success(prcOrderBillService.listTransferNoOptions(keyword));
|
||||
return success(prcOrderBillService.listTransferNoOptions(buildBillOptionQuery(keyword)));
|
||||
}
|
||||
|
||||
/** 下拉搜索:keyword 放入 params,供 @DataScope 与 Mapper 使用 */
|
||||
private PrcOrderBill buildBillOptionQuery(String keyword)
|
||||
{
|
||||
PrcOrderBill query = new PrcOrderBill();
|
||||
if (StringUtils.isNotEmpty(keyword))
|
||||
{
|
||||
query.getParams().put("optionKeyword", keyword.trim());
|
||||
}
|
||||
return query;
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('price:billing:bill')")
|
||||
|
||||
@@ -145,6 +145,15 @@ public class PriceSetController extends BaseController
|
||||
return success(newPsvId);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('price:set:add')")
|
||||
@Log(title = "Price set version create", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/version/create/{priceSetId}")
|
||||
public AjaxResult createVersion(@PathVariable Long priceSetId)
|
||||
{
|
||||
Long newPsvId = priceSetService.createVersion(priceSetId, getUsername());
|
||||
return success(newPsvId);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('price:set:edit')")
|
||||
@Log(title = "Price set version delete", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/version/{psvId}")
|
||||
|
||||
+21
-4
@@ -5,6 +5,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
@@ -49,6 +50,17 @@ public class ProductController extends BaseController
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品下拉选项(非分页)。
|
||||
* 供计费列表、客户绑定等场景选择产品;不做权限控制(仍需登录)。
|
||||
*/
|
||||
@GetMapping("/optionselect")
|
||||
public AjaxResult optionselect(BmsProduct product)
|
||||
{
|
||||
List<BmsProduct> list = productService.selectBmsProductList(product);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('price:product:import')")
|
||||
@GetMapping("/import/task/{taskId}")
|
||||
public AjaxResult getImportTask(@PathVariable String taskId)
|
||||
@@ -114,13 +126,15 @@ public class ProductController extends BaseController
|
||||
|
||||
/**
|
||||
* Async import Weishi B2C workbook. Returns taskId; poll /import/task/{taskId}.
|
||||
* effectiveDate is required: written to product / product_country; previous open rows expire at this date.
|
||||
*/
|
||||
@Log(title = "\u4ea7\u54c1\u5217\u8868", businessType = BusinessType.IMPORT)
|
||||
@PreAuthorize("@ss.hasPermi('price:product:import')")
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport,
|
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date effectiveDate) throws Exception
|
||||
{
|
||||
String taskId = productService.submitImportProductExcelAsync(file, updateSupport, getUsername());
|
||||
String taskId = productService.submitImportProductExcelAsync(file, updateSupport, getUsername(), effectiveDate);
|
||||
Map<String, Object> payload = new HashMap<String, Object>();
|
||||
payload.put("taskId", taskId);
|
||||
return success(payload);
|
||||
@@ -128,13 +142,16 @@ public class ProductController extends BaseController
|
||||
|
||||
/**
|
||||
* Async single-country cost-sheet import. Returns taskId; poll /import/task/{taskId}.
|
||||
* effectiveDate is required: written to product / product_country; previous open rows expire at this date.
|
||||
*/
|
||||
@Log(title = "\u4ea7\u54c1\u5217\u8868", businessType = BusinessType.IMPORT)
|
||||
@PreAuthorize("@ss.hasPermi('price:product:import')")
|
||||
@PostMapping("/importCountryData")
|
||||
public AjaxResult importCountryData(MultipartFile file, String countryCode) throws Exception
|
||||
public AjaxResult importCountryData(MultipartFile file, String countryCode,
|
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date effectiveDate) throws Exception
|
||||
{
|
||||
String taskId = productService.submitImportCountryProductExcelAsync(file, countryCode, getUsername());
|
||||
String taskId = productService.submitImportCountryProductExcelAsync(file, countryCode, getUsername(),
|
||||
effectiveDate);
|
||||
Map<String, Object> payload = new HashMap<String, Object>();
|
||||
payload.put("taskId", taskId);
|
||||
return success(payload);
|
||||
|
||||
Reference in New Issue
Block a user