package com.ruoyi.basic.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.basic.dto.CustomerPrivatePoolDto;
import com.ruoyi.basic.pojo.Customer;
import com.ruoyi.basic.pojo.CustomerPrivatePool;
import com.ruoyi.basic.service.CustomerPrivatePoolService;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.domain.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
*
* 前端控制器 客户(私海)
*
*
* @author 芯导软件(江苏)有限公司
* @since 2026-04-16 04:43:00
*/
@RestController
@Api(tags = "客户(私海)")
@RequestMapping("/customerPrivatePool")
public class CustomerPrivatePoolController {
@Autowired
private CustomerPrivatePoolService customerPrivatePoolService;
@GetMapping("/listPage")
@ApiOperation("客户(私海)列表")
public R listPage(CustomerPrivatePoolDto customerPrivatePoolDto, Page page){
//查询当前用户的客户信息
customerPrivatePoolDto.setBoundId(SecurityUtils.getUserId());
IPage listPage = customerPrivatePoolService.listPage(page, customerPrivatePoolDto);
return R.ok(listPage);
}
@PostMapping("/add")
@ApiOperation("分配客户(私海)")
public R add(@RequestBody CustomerPrivatePoolDto customerPrivatePool){
boolean result = customerPrivatePoolService.add(customerPrivatePool);
return R.ok(result);
}
@PutMapping("/update")
public R update(@RequestBody CustomerPrivatePoolDto customerPrivatePoolDto) {
return R.ok(customerPrivatePoolService.updateCustomerPrivatePoolDto(customerPrivatePoolDto));
}
@DeleteMapping("/delete/{id}")
@ApiOperation("删除客户(私海)")
public R delete(@PathVariable Long id){
boolean result = customerPrivatePoolService.deleteCustomerPrivatePool(id);
return R.ok(result);
}
@PostMapping("/together")
@ApiOperation("共享")
public R together( @RequestBody CustomerPrivatePoolDto customerPrivatePool){
boolean result = customerPrivatePoolService.together(customerPrivatePool);
return R.ok(result);
}
@GetMapping("/info/{id}")
@ApiOperation("详情")
public R getInfo(@PathVariable Long id){
CustomerPrivatePoolDto customerPrivatePool = customerPrivatePoolService.getInfo(id);
return R.ok(customerPrivatePool);
}
@GetMapping("/getbyId/{id}")
@ApiOperation("详情")
public R getbyId(@PathVariable Long id){
CustomerPrivatePoolDto customerPrivatePool = customerPrivatePoolService.getbyId(id);
return R.ok(customerPrivatePool);
}
}