| | |
| | | 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.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | */ |
| | | @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; |
| | | |
| | | /** |
| | | * 查询客户跟进列表 |
| | |
| | | @ApiOperation("查询客户跟进列表") |
| | | public IPage<CustomerFollowUp> list(Page<CustomerFollowUp> page, CustomerFollowUp customerFollowUp) { |
| | | LambdaQueryWrapper<CustomerFollowUp> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(customerFollowUp.getCustomerId() != null, CustomerFollowUp::getCustomerId, customerFollowUp.getCustomerId()) |
| | | queryWrapper.eq(customerFollowUp.getCustomerPrivatePoolId() != null, CustomerFollowUp::getCustomerPrivatePoolId, customerFollowUp.getCustomerPrivatePoolId()) |
| | | .like(customerFollowUp.getFollowerUserName() != null, CustomerFollowUp::getFollowerUserName, customerFollowUp.getFollowerUserName()) |
| | | .orderByDesc(CustomerFollowUp::getFollowUpTime); |
| | | return customerFollowUpService.page(page, queryWrapper); |
| | |
| | | @PostMapping("/upload/{followUpId}") |
| | | @Log(title = "客户跟进-上传附件", businessType = BusinessType.INSERT) |
| | | public AjaxResult uploadFiles(@RequestParam("files") List<MultipartFile> files, @PathVariable Integer followUpId) { |
| | | customerFollowUpService.addFollowUpFiles(files, followUpId); |
| | | return AjaxResult.success(); |
| | | return AjaxResult.success(customerFollowUpService.addFollowUpFiles(files, followUpId)); |
| | | } |
| | | |
| | | /** |
| | | * 上传跟进附件(复用,无ID) |
| | | */ |
| | | @ApiOperation("上传附件(复用)") |
| | | @PostMapping("/upload") |
| | | @Log(title = "上传附件(复用)", businessType = BusinessType.INSERT) |
| | | public AjaxResult uploadFiles(@RequestParam("files") List<MultipartFile> files, @RequestParam(required = false) String name) { |
| | | List<CustomerFollowUpFileDto> uploadedFiles = customerFollowUpService.addFollowUpFiles(files, null); |
| | | return AjaxResult.success(uploadedFiles); |
| | | } |
| | | |
| | | /** |
| | | * 批量查询附件列表 |
| | | */ |
| | | @ApiOperation("批量查询附件列表") |
| | | @PostMapping("/file/list") |
| | | public AjaxResult getFileList(@RequestBody List<Long> ids) { |
| | | return AjaxResult.success(customerFollowUpService.getFollowUpFilesByIds(ids)); |
| | | } |
| | | |
| | | /** |