| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.dto.CustomerFollowUpFileDto; |
| | | import com.ruoyi.basic.pojo.CustomerFollowUp; |
| | | import com.ruoyi.basic.pojo.CustomerReturnVisit; |
| | | import com.ruoyi.basic.service.CustomerFollowUpService; |
| | |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.ruoyi.basic.dto.CustomerFollowUpFileDto; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/basic/customer-follow") |
| | | @AllArgsConstructor |
| | | public class CustomerFollowUpController extends BaseController { |
| | | |
| | | @Autowired |
| | | private CustomerFollowUpService customerFollowUpService; |
| | | private final CustomerFollowUpService customerFollowUpService; |
| | | |
| | | @Autowired |
| | | private CustomerReturnVisitService customerReturnVisitService; |
| | | private final CustomerReturnVisitService customerReturnVisitService; |
| | | |
| | | /** |
| | | * 查询客户跟进列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation("查询客户跟进列表") |
| | | @Operation(summary = "查询客户跟进列表") |
| | | public IPage<CustomerFollowUp> list(Page<CustomerFollowUp> page, CustomerFollowUp customerFollowUp) { |
| | | LambdaQueryWrapper<CustomerFollowUp> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(customerFollowUp.getCustomerPrivatePoolId() != null, CustomerFollowUp::getCustomerPrivatePoolId, customerFollowUp.getCustomerPrivatePoolId()) |
| | |
| | | /** |
| | | * 获取客户跟进详细信息 |
| | | */ |
| | | @ApiOperation("获取客户跟进详细信息") |
| | | @Operation(summary = "获取客户跟进详细信息") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Integer id) { |
| | | return AjaxResult.success(customerFollowUpService.getFollowUpWithFiles(id)); |
| | |
| | | * 新增客户跟进 |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("新增客户跟进") |
| | | @Operation(summary = "新增客户跟进") |
| | | @Log(title = "客户跟进-新增", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody CustomerFollowUp customerFollowUp) { |
| | | return toAjax(customerFollowUpService.insertCustomerFollowUp(customerFollowUp)); |
| | |
| | | * 修改客户跟进 |
| | | */ |
| | | @PutMapping("/edit") |
| | | @ApiOperation("修改客户跟进") |
| | | @Operation(summary = "修改客户跟进") |
| | | @Log(title = "客户跟进-修改", businessType = BusinessType.UPDATE) |
| | | public AjaxResult edit(@RequestBody CustomerFollowUp customerFollowUp) { |
| | | return toAjax(customerFollowUpService.updateCustomerFollowUp(customerFollowUp)); |
| | |
| | | /** |
| | | * 上传跟进附件 |
| | | */ |
| | | @ApiOperation("上传跟进附件") |
| | | @Operation(summary = "上传跟进附件") |
| | | @PostMapping("/upload/{followUpId}") |
| | | @Log(title = "客户跟进-上传附件", businessType = BusinessType.INSERT) |
| | | public AjaxResult uploadFiles(@RequestParam("files") List<MultipartFile> files, @PathVariable Integer followUpId) { |
| | |
| | | /** |
| | | * 上传跟进附件(复用,无ID) |
| | | */ |
| | | @ApiOperation("上传附件(复用)") |
| | | @Operation(summary = "上传附件(复用)") |
| | | @PostMapping("/upload") |
| | | @Log(title = "上传附件(复用)", businessType = BusinessType.INSERT) |
| | | public AjaxResult uploadFiles(@RequestParam("files") List<MultipartFile> files, @RequestParam(required = false) String name) { |
| | |
| | | /** |
| | | * 批量查询附件列表 |
| | | */ |
| | | @ApiOperation("批量查询附件列表") |
| | | @Operation(summary = "批量查询附件列表") |
| | | @PostMapping("/file/list") |
| | | public AjaxResult getFileList(@RequestBody List<Long> ids) { |
| | | return AjaxResult.success(customerFollowUpService.getFollowUpFilesByIds(ids)); |
| | |
| | | /** |
| | | * 删除跟进附件 |
| | | */ |
| | | @ApiOperation("删除跟进附件") |
| | | @Operation(summary = "删除跟进附件") |
| | | @DeleteMapping("/file/{fileId}") |
| | | @Log(title = "客户跟进-删除附件", businessType = BusinessType.DELETE) |
| | | public AjaxResult deleteFile(@PathVariable Integer fileId) { |
| | |
| | | /** |
| | | * 删除客户跟进 |
| | | */ |
| | | @ApiOperation("删除客户跟进") |
| | | @Operation(summary = "删除客户跟进") |
| | | @DeleteMapping("/{id}") |
| | | @Log(title = "客户跟进-删除", businessType = BusinessType.DELETE) |
| | | public AjaxResult remove(@PathVariable Integer id) { |
| | |
| | | /** |
| | | * 新增/更新回访提醒 |
| | | */ |
| | | @ApiOperation("新增/更新回访提醒") |
| | | @Operation(summary = "新增/更新回访提醒") |
| | | @PostMapping("/return-visit") |
| | | @Log(title = "回访提醒-新增/更新", businessType = BusinessType.UPDATE) |
| | | public AjaxResult saveReturnVisit(@RequestBody CustomerReturnVisit customerReturnVisit) { |
| | |
| | | /** |
| | | * 获取回访提醒详情 |
| | | */ |
| | | @ApiOperation("获取回访提醒详情") |
| | | @Operation(summary = "获取回访提醒详情") |
| | | @GetMapping("/return-visit/{customerId}") |
| | | public AjaxResult getReturnVisit(@PathVariable Integer customerId) { |
| | | return AjaxResult.success(customerReturnVisitService.getByCustomerId(customerId)); |
| | |
| | | /** |
| | | * 标记回访提醒已读 |
| | | */ |
| | | @ApiOperation("标记回访提醒已读") |
| | | @Operation(summary = "标记回访提醒已读") |
| | | @PutMapping("/return-visit/read/{id}") |
| | | @Log(title = "回访提醒-标记已读", businessType = BusinessType.UPDATE) |
| | | public AjaxResult markAsRead(@PathVariable Long id) { |