|
@@ -0,0 +1,44 @@
|
|
|
+package cn.iocoder.yudao.module.crm.controller.admin.customer;
|
|
|
+
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
+import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.CrmCustomerPoolConfigRespVO;
|
|
|
+import cn.iocoder.yudao.module.crm.controller.admin.customer.vo.CrmCustomerPoolConfigUpdateReqVO;
|
|
|
+import cn.iocoder.yudao.module.crm.convert.customer.CrmCustomerConvert;
|
|
|
+import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerPoolConfigDO;
|
|
|
+import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerPoolConfigService;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.validation.Valid;
|
|
|
+
|
|
|
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
+
|
|
|
+@Tag(name = "管理后台 - CRM 客户公海配置")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/crm/customer-pool-config")
|
|
|
+@Validated
|
|
|
+public class CrmCustomerPoolConfigController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private CrmCustomerPoolConfigService customerPoolConfigService;
|
|
|
+
|
|
|
+ @GetMapping("/get")
|
|
|
+ @Operation(summary = "获取客户公海规则设置")
|
|
|
+ @PreAuthorize("@ss.hasPermission('crm:customer-pool-config:query')")
|
|
|
+ public CommonResult<CrmCustomerPoolConfigRespVO> getCustomerPoolConfig() {
|
|
|
+ CrmCustomerPoolConfigDO customerPoolConfig = customerPoolConfigService.getCustomerPoolConfig();
|
|
|
+ return success(CrmCustomerConvert.INSTANCE.convert(customerPoolConfig));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping("/update")
|
|
|
+ @Operation(summary = "更新客户公海规则设置")
|
|
|
+ @PreAuthorize("@ss.hasPermission('crm:customer-pool-config:update')")
|
|
|
+ public CommonResult<Boolean> updateCustomerPoolConfig(@Valid @RequestBody CrmCustomerPoolConfigUpdateReqVO updateReqVO) {
|
|
|
+ customerPoolConfigService.updateCustomerPoolConfig(updateReqVO);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+}
|