| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | */ |
| | | @Operation(summary = "获取客户跟进详细信息") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Integer id) { |
| | | return AjaxResult.success(customerFollowUpService.getFollowUpWithFiles(id)); |
| | | public R getInfo(@PathVariable("id") Integer id) { |
| | | return R.ok(customerFollowUpService.getFollowUpWithFiles(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "新增客户跟进") |
| | | @Log(title = "客户跟进-新增", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody CustomerFollowUp customerFollowUp) { |
| | | return toAjax(customerFollowUpService.insertCustomerFollowUp(customerFollowUp)); |
| | | public R<?> add(@RequestBody CustomerFollowUp customerFollowUp) { |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PutMapping("/edit") |
| | | @Operation(summary = "修改客户跟进") |
| | | @Log(title = "客户跟进-修改", businessType = BusinessType.UPDATE) |
| | | public AjaxResult edit(@RequestBody CustomerFollowUp customerFollowUp) { |
| | | return toAjax(customerFollowUpService.updateCustomerFollowUp(customerFollowUp)); |
| | | public R<?> edit(@RequestBody CustomerFollowUp customerFollowUp) { |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Operation(summary = "上传跟进附件") |
| | | @PostMapping("/upload/{followUpId}") |
| | | @Log(title = "客户跟进-上传附件", businessType = BusinessType.INSERT) |
| | | public AjaxResult uploadFiles(@RequestParam("files") List<MultipartFile> files, @PathVariable Integer followUpId) { |
| | | return AjaxResult.success(customerFollowUpService.addFollowUpFiles(files, followUpId)); |
| | | public R uploadFiles(@RequestParam("files") List<MultipartFile> files, @PathVariable Integer followUpId) { |
| | | return R.ok(customerFollowUpService.addFollowUpFiles(files, followUpId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Operation(summary = "上传附件(复用)") |
| | | @PostMapping("/upload") |
| | | @Log(title = "上传附件(复用)", businessType = BusinessType.INSERT) |
| | | public AjaxResult uploadFiles(@RequestParam("files") List<MultipartFile> files, @RequestParam(required = false) String name) { |
| | | public R uploadFiles(@RequestParam("files") List<MultipartFile> files, @RequestParam(required = false) String name) { |
| | | List<CustomerFollowUpFileDto> uploadedFiles = customerFollowUpService.addFollowUpFiles(files, null); |
| | | return AjaxResult.success(uploadedFiles); |
| | | return R.ok(uploadedFiles); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Operation(summary = "批量查询附件列表") |
| | | @PostMapping("/file/list") |
| | | public AjaxResult getFileList(@RequestBody List<Long> ids) { |
| | | return AjaxResult.success(customerFollowUpService.getFollowUpFilesByIds(ids)); |
| | | public R getFileList(@RequestBody List<Long> ids) { |
| | | return R.ok(customerFollowUpService.getFollowUpFilesByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Operation(summary = "删除跟进附件") |
| | | @DeleteMapping("/file/{fileId}") |
| | | @Log(title = "客户跟进-删除附件", businessType = BusinessType.DELETE) |
| | | public AjaxResult deleteFile(@PathVariable Integer fileId) { |
| | | public R deleteFile(@PathVariable Integer fileId) { |
| | | customerFollowUpService.deleteFollowUpFile(fileId); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Operation(summary = "删除客户跟进") |
| | | @DeleteMapping("/{id}") |
| | | @Log(title = "客户跟进-删除", businessType = BusinessType.DELETE) |
| | | public AjaxResult remove(@PathVariable Integer id) { |
| | | return toAjax(customerFollowUpService.deleteCustomerFollowUpById(id)); |
| | | public R remove(@PathVariable Integer id) { |
| | | return R.ok(customerFollowUpService.deleteCustomerFollowUpById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Operation(summary = "新增/更新回访提醒") |
| | | @PostMapping("/return-visit") |
| | | @Log(title = "回访提醒-新增/更新", businessType = BusinessType.UPDATE) |
| | | public AjaxResult saveReturnVisit(@RequestBody CustomerReturnVisit customerReturnVisit) { |
| | | return toAjax(customerReturnVisitService.saveOrUpdateReturnVisit(customerReturnVisit)); |
| | | public R saveReturnVisit(@RequestBody CustomerReturnVisit customerReturnVisit) { |
| | | return R.ok(customerReturnVisitService.saveOrUpdateReturnVisit(customerReturnVisit)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Operation(summary = "获取回访提醒详情") |
| | | @GetMapping("/return-visit/{customerId}") |
| | | public AjaxResult getReturnVisit(@PathVariable Integer customerId) { |
| | | return AjaxResult.success(customerReturnVisitService.getByCustomerId(customerId)); |
| | | public R getReturnVisit(@PathVariable Integer customerId) { |
| | | return R.ok(customerReturnVisitService.getByCustomerId(customerId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Operation(summary = "标记回访提醒已读") |
| | | @PutMapping("/return-visit/read/{id}") |
| | | @Log(title = "回访提醒-标记已读", businessType = BusinessType.UPDATE) |
| | | public AjaxResult markAsRead(@PathVariable Long id) { |
| | | public R markAsRead(@PathVariable Long id) { |
| | | customerReturnVisitService.markAsRead(id); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |