新增打单产品渠道查询与替换功能
This commit is contained in:
+33
@@ -208,6 +208,39 @@ public class LabelPackageController extends BaseController
|
||||
return success(payProductService.selectPayProductDetail(productId));
|
||||
}
|
||||
|
||||
/** 查询打单产品已绑定渠道(默认应收 AR) */
|
||||
@PreAuthorize("@ss.hasPermi('price:label:query')")
|
||||
@GetMapping("/product/{productId}/channels")
|
||||
public AjaxResult productChannels(@PathVariable Long productId,
|
||||
@RequestParam(value = "payType", required = false) String payType)
|
||||
{
|
||||
String type = (payType == null || payType.trim().isEmpty()) ? "AR" : payType.trim();
|
||||
return success(payProductService.listProductChannelBinds(productId, type));
|
||||
}
|
||||
|
||||
/** 覆盖保存打单产品渠道绑定,写入 srv_channel_product_map */
|
||||
@PreAuthorize("@ss.hasPermi('price:label:edit')")
|
||||
@Log(title = "打单产品绑定渠道", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/product/{productId}/channels")
|
||||
public AjaxResult replaceProductChannels(@PathVariable Long productId, @RequestBody Map<String, Object> body)
|
||||
{
|
||||
String payType = body == null || body.get("payType") == null ? "AR" : String.valueOf(body.get("payType")).trim();
|
||||
List<String> channelIds = new ArrayList<String>();
|
||||
Object rawIds = body == null ? null : body.get("channelIds");
|
||||
if (rawIds instanceof List<?>)
|
||||
{
|
||||
for (Object item : (List<?>) rawIds)
|
||||
{
|
||||
if (item != null && !String.valueOf(item).trim().isEmpty())
|
||||
{
|
||||
channelIds.add(String.valueOf(item).trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
String msg = payProductService.replaceProductChannelBinds(productId, payType, channelIds);
|
||||
return AjaxResult.success(msg);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('price:label:remove')")
|
||||
@Log(title = "打单套餐移除产品", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{priceSetId}/products/{productIds}")
|
||||
|
||||
Reference in New Issue
Block a user