修改打单套餐功能
This commit is contained in:
-48
@@ -217,54 +217,6 @@ public class LabelPackageController extends BaseController
|
||||
return toAjax(payProductService.removeLabelProducts(priceSetId, productIds));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('price:label:query')")
|
||||
@GetMapping("/{priceSetId}/channels")
|
||||
public AjaxResult listChannels(@PathVariable Long priceSetId)
|
||||
{
|
||||
priceSetService.assertSetCategory(priceSetId, PrcPriceSet.CATEGORY_LABEL);
|
||||
return success(payProductService.listLabelChannels(priceSetId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('price:label:edit')")
|
||||
@Log(title = "打单套餐绑定渠道", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{priceSetId}/channels")
|
||||
public AjaxResult bindChannels(@PathVariable Long priceSetId, @RequestBody Map<String, Object> body)
|
||||
{
|
||||
priceSetService.assertSetCategory(priceSetId, PrcPriceSet.CATEGORY_LABEL);
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
Long productId = null;
|
||||
Object rawProductId = body == null ? null : body.get("productId");
|
||||
if (rawProductId instanceof Number)
|
||||
{
|
||||
productId = ((Number) rawProductId).longValue();
|
||||
}
|
||||
else if (rawProductId != null && !String.valueOf(rawProductId).trim().isEmpty()
|
||||
&& !"null".equalsIgnoreCase(String.valueOf(rawProductId).trim()))
|
||||
{
|
||||
productId = Long.valueOf(String.valueOf(rawProductId).trim());
|
||||
}
|
||||
return success(payProductService.bindLabelChannels(priceSetId, channelIds, productId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('price:label:edit')")
|
||||
@Log(title = "打单套餐解绑渠道", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{priceSetId}/channels/{channelId}")
|
||||
public AjaxResult unbindChannel(@PathVariable Long priceSetId, @PathVariable String channelId)
|
||||
{
|
||||
priceSetService.assertSetCategory(priceSetId, PrcPriceSet.CATEGORY_LABEL);
|
||||
return toAjax(payProductService.unbindLabelChannel(priceSetId, channelId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('price:label:list')")
|
||||
@GetMapping("/customer/list")
|
||||
|
||||
Reference in New Issue
Block a user