|
|
@ -9,8 +9,8 @@ import com.gxwebsoft.common.system.entity.User; |
|
|
|
import com.gxwebsoft.shop.entity.ShopDealerRecord; |
|
|
|
import com.gxwebsoft.shop.param.ShopDealerRecordParam; |
|
|
|
import com.gxwebsoft.shop.service.ShopDealerRecordService; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
|
import org.springframework.security.access.prepost.PreAuthorize; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
@ -23,40 +23,37 @@ import java.util.List; |
|
|
|
* @author 科技小王子 |
|
|
|
* @since 2025-10-02 12:21:50 |
|
|
|
*/ |
|
|
|
@Api(tags = "客户跟进情况管理") |
|
|
|
@Tag(name = "客户跟进情况管理") |
|
|
|
@RestController |
|
|
|
@RequestMapping("/api/shop/shop-dealer-record") |
|
|
|
public class ShopDealerRecordController extends BaseController { |
|
|
|
@Resource |
|
|
|
private ShopDealerRecordService shopDealerRecordService; |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopDealerRecord:list')") |
|
|
|
@ApiOperation("分页查询客户跟进情况") |
|
|
|
@Operation(summary = "分页查询客户跟进情况") |
|
|
|
@GetMapping("/page") |
|
|
|
public ApiResult<PageResult<ShopDealerRecord>> page(ShopDealerRecordParam param) { |
|
|
|
// 使用关联查询
|
|
|
|
return success(shopDealerRecordService.pageRel(param)); |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopDealerRecord:list')") |
|
|
|
@ApiOperation("查询全部客户跟进情况") |
|
|
|
@Operation(summary = "查询全部客户跟进情况") |
|
|
|
@GetMapping() |
|
|
|
public ApiResult<List<ShopDealerRecord>> list(ShopDealerRecordParam param) { |
|
|
|
// 使用关联查询
|
|
|
|
return success(shopDealerRecordService.listRel(param)); |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopDealerRecord:list')") |
|
|
|
@ApiOperation("根据id查询客户跟进情况") |
|
|
|
@Operation(summary = "根据id查询客户跟进情况") |
|
|
|
@GetMapping("/{id}") |
|
|
|
public ApiResult<ShopDealerRecord> get(@PathVariable("id") Integer id) { |
|
|
|
// 使用关联查询
|
|
|
|
return success(shopDealerRecordService.getByIdRel(id)); |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopDealerRecord:save')") |
|
|
|
@PreAuthorize("hasAuthority('shop:shopDealerApply:save')") |
|
|
|
@OperationLog |
|
|
|
@ApiOperation("添加客户跟进情况") |
|
|
|
@Operation(summary = "添加客户跟进情况") |
|
|
|
@PostMapping() |
|
|
|
public ApiResult<?> save(@RequestBody ShopDealerRecord shopDealerRecord) { |
|
|
|
// 记录当前登录用户id
|
|
|
@ -70,9 +67,9 @@ public class ShopDealerRecordController extends BaseController { |
|
|
|
return fail("添加失败"); |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopDealerRecord:update')") |
|
|
|
@PreAuthorize("hasAuthority('shop:shopDealerApply:update')") |
|
|
|
@OperationLog |
|
|
|
@ApiOperation("修改客户跟进情况") |
|
|
|
@Operation(summary = "修改客户跟进情况") |
|
|
|
@PutMapping() |
|
|
|
public ApiResult<?> update(@RequestBody ShopDealerRecord shopDealerRecord) { |
|
|
|
if (shopDealerRecordService.updateById(shopDealerRecord)) { |
|
|
@ -81,9 +78,9 @@ public class ShopDealerRecordController extends BaseController { |
|
|
|
return fail("修改失败"); |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopDealerRecord:remove')") |
|
|
|
@PreAuthorize("hasAuthority('shop:shopDealerApply:remove')") |
|
|
|
@OperationLog |
|
|
|
@ApiOperation("删除客户跟进情况") |
|
|
|
@Operation(summary = "删除客户跟进情况") |
|
|
|
@DeleteMapping("/{id}") |
|
|
|
public ApiResult<?> remove(@PathVariable("id") Integer id) { |
|
|
|
if (shopDealerRecordService.removeById(id)) { |
|
|
@ -92,9 +89,9 @@ public class ShopDealerRecordController extends BaseController { |
|
|
|
return fail("删除失败"); |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopDealerRecord:save')") |
|
|
|
@PreAuthorize("hasAuthority('shop:shopDealerApply:save')") |
|
|
|
@OperationLog |
|
|
|
@ApiOperation("批量添加客户跟进情况") |
|
|
|
@Operation(summary = "批量添加客户跟进情况") |
|
|
|
@PostMapping("/batch") |
|
|
|
public ApiResult<?> saveBatch(@RequestBody List<ShopDealerRecord> list) { |
|
|
|
if (shopDealerRecordService.saveBatch(list)) { |
|
|
@ -103,9 +100,9 @@ public class ShopDealerRecordController extends BaseController { |
|
|
|
return fail("添加失败"); |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopDealerRecord:update')") |
|
|
|
@PreAuthorize("hasAuthority('shop:shopDealerApply:update')") |
|
|
|
@OperationLog |
|
|
|
@ApiOperation("批量修改客户跟进情况") |
|
|
|
@Operation(summary = "批量修改客户跟进情况") |
|
|
|
@PutMapping("/batch") |
|
|
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<ShopDealerRecord> batchParam) { |
|
|
|
if (batchParam.update(shopDealerRecordService, "id")) { |
|
|
@ -114,9 +111,9 @@ public class ShopDealerRecordController extends BaseController { |
|
|
|
return fail("修改失败"); |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopDealerRecord:remove')") |
|
|
|
@PreAuthorize("hasAuthority('shop:shopDealerApply:remove')") |
|
|
|
@OperationLog |
|
|
|
@ApiOperation("批量删除客户跟进情况") |
|
|
|
@Operation(summary = "批量删除客户跟进情况") |
|
|
|
@DeleteMapping("/batch") |
|
|
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) { |
|
|
|
if (shopDealerRecordService.removeByIds(ids)) { |
|
|
|