chenhj
2026-04-25 2ec6b477938b95608873feefa819c687d69c4a88
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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.service.CustomerPrivatePoolService;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.framework.web.domain.R;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
 
/**
 * <p>
 *  前端控制器 客户(私海)
 * </p>
 *
 * @author 芯导软件(江苏)有限公司
 * @since 2026-04-16 04:43:00
 */
@RestController
@Tag(name = "客户(私海)")
@RequestMapping("/customerPrivatePool")
@AllArgsConstructor
public class CustomerPrivatePoolController {
 
    private final CustomerPrivatePoolService customerPrivatePoolService;
 
 
    @GetMapping("/listPage")
    @Operation(summary = "客户(私海)列表")
    public R listPage(CustomerPrivatePoolDto customerPrivatePoolDto, Page<CustomerPrivatePoolDto> page){
        //查询当前用户的客户信息
        customerPrivatePoolDto.setBoundId(SecurityUtils.getUserId());
        IPage<CustomerPrivatePoolDto> listPage = customerPrivatePoolService.listPage(page, customerPrivatePoolDto);
        return R.ok(listPage);
    }
 
    @PostMapping("/add")
    @Operation(summary = "分配客户(私海)")
    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}")
    @Operation(summary = "删除客户(私海)")
    public R delete(@PathVariable Long id){
        boolean result = customerPrivatePoolService.deleteCustomerPrivatePool(id);
        return R.ok(result);
    }
 
    @PostMapping("/together")
    @Operation(summary = "共享")
    public R together( @RequestBody CustomerPrivatePoolDto customerPrivatePool){
        boolean result = customerPrivatePoolService.together(customerPrivatePool);
        return R.ok(result);
    }
 
    @GetMapping("/info/{id}")
    @Operation(summary = "详情")
    public R getInfo(@PathVariable Long id){
        CustomerPrivatePoolDto customerPrivatePool = customerPrivatePoolService.getInfo(id);
        return R.ok(customerPrivatePool);
    }
 
    @GetMapping("/getbyId/{id}")
    @Operation(summary = "详情")
    public R getbyId(@PathVariable Long id){
        CustomerPrivatePoolDto customerPrivatePool = customerPrivatePoolService.getbyId(id);
        return R.ok(customerPrivatePool);
    }
 
 
 
 
 
}