| | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "客户拜访-分页查询", businessType = BusinessType.OTHER) |
| | | @ApiOperation("客户拜访-分页查询") |
| | | public AjaxResult listPage(Page page, CustomerVisits customerVisits){ |
| | | public AjaxResult listPage(Page page, CustomerVisits customerVisits) { |
| | | IPage<CustomerVisits> listPage = customerVisitsService.listPage(page, customerVisits); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | |
| | | @ApiOperation("客户拜访-添加") |
| | | @PostMapping("/add") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody CustomerVisits customerVisits){ |
| | | public AjaxResult add(@RequestBody CustomerVisits customerVisits) { |
| | | boolean save = customerVisitsService.save(customerVisits); |
| | | if (save){ |
| | | if (save) { |
| | | return AjaxResult.success("添加成功"); |
| | | } |
| | | return AjaxResult.error("添加失败"); |
| | | } |
| | | |
| | | @Log(title = "客户拜访-编辑", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("客户拜访-编辑") |
| | | @PostMapping("update") |
| | | public AjaxResult updateCustomerVisit(@RequestBody CustomerVisits customerVisits) { |
| | | boolean updateResult = customerVisitsService.updateCustomerVisit(customerVisits); |
| | | if (updateResult) { |
| | | return AjaxResult.success("编辑成功"); |
| | | } |
| | | return AjaxResult.error("编辑失败"); |
| | | } |
| | | |
| | | @Log(title = "客户拜访-删除", businessType = BusinessType.DELETE) |
| | | @ApiOperation("客户拜访-删除") |
| | | @DeleteMapping("{customerId}") |
| | | public AjaxResult deleteCustomerVisit(@PathVariable Integer customerId) { |
| | | if (customerId == null) { |
| | | return AjaxResult.error("客户ID不能为空"); |
| | | } |
| | | boolean deleteResult = customerVisitsService.removeById(customerId); |
| | | if (deleteResult) { |
| | | return AjaxResult.success("删除成功"); |
| | | } |
| | | return AjaxResult.error("删除失败"); |
| | | } |
| | | |
| | | } |