客户编辑添加绑定套餐
This commit is contained in:
+78
@@ -0,0 +1,78 @@
|
||||
package com.ruoyi.web.controller.customer.customerinfo;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.customer.customerinfo.domain.BmsCustomerPriceSet;
|
||||
import com.ruoyi.customer.customerinfo.domain.BmsPriceSetOption;
|
||||
import com.ruoyi.customer.customerinfo.service.IBmsCustomerPriceSetService;
|
||||
|
||||
/**
|
||||
* 客户套餐绑定Controller(客户管理-客户编辑-绑定套餐)
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-09-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/customersupplier/customerinfo/priceset")
|
||||
public class BmsCustomerPriceSetController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBmsCustomerPriceSetService customerPriceSetService;
|
||||
|
||||
/**
|
||||
* 查询客户已绑定的套餐列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:list')")
|
||||
@GetMapping("/bind/list")
|
||||
public AjaxResult bindList(Long customerId)
|
||||
{
|
||||
List<BmsCustomerPriceSet> list = customerPriceSetService.selectBindList(customerId);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询可绑定的生效套餐选项
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:list')")
|
||||
@GetMapping("/option/list")
|
||||
public AjaxResult optionList(BmsPriceSetOption query)
|
||||
{
|
||||
return success(customerPriceSetService.selectOptionList(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存客户套餐绑定(已绑定则更新/更换套餐,未绑定则新增)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:edit')")
|
||||
@Log(title = "客户套餐绑定", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/bind")
|
||||
public AjaxResult saveBind(@RequestBody BmsCustomerPriceSet bind)
|
||||
{
|
||||
bind.setCreateBy(getUsername());
|
||||
bind.setUpdateBy(getUsername());
|
||||
return toAjax(customerPriceSetService.saveBind(bind));
|
||||
}
|
||||
|
||||
/**
|
||||
* 解绑客户套餐
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:edit')")
|
||||
@Log(title = "客户套餐解绑", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/bind/{customerPricesetIds}")
|
||||
public AjaxResult removeBind(@PathVariable Long[] customerPricesetIds)
|
||||
{
|
||||
return toAjax(customerPriceSetService.deleteBindByIds(customerPricesetIds));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user