CaseErpCustomerGatherDetailController.java 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. package com.xjrsoft.module.erpModel.caseErpCustomer.controller;
  2. import cn.hutool.core.bean.BeanUtil;
  3. import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  4. import com.xjrsoft.common.annotation.XjrLog;
  5. import com.xjrsoft.common.constant.GlobalConstant;
  6. import com.xjrsoft.common.model.result.R;
  7. import com.xjrsoft.module.erpModel.caseErpCustomer.dto.AddCaseErpCustomerGatherDetailDto;
  8. import com.xjrsoft.module.erpModel.caseErpCustomer.dto.AddCaseErpCustomerGatherDto;
  9. import com.xjrsoft.module.erpModel.caseErpCustomer.dto.UpdateCaseErpCustomerGatherDetailDto;
  10. import com.xjrsoft.module.erpModel.caseErpCustomer.dto.UpdateCaseErpCustomerGatherDto;
  11. import com.xjrsoft.module.erpModel.caseErpCustomer.entity.CaseErpCustomerGather;
  12. import com.xjrsoft.module.erpModel.caseErpCustomer.entity.CaseErpCustomerGatherDetail;
  13. import com.xjrsoft.module.erpModel.caseErpCustomer.service.ICaseErpCustomerGatherDetailService;
  14. import com.xjrsoft.module.erpModel.caseErpCustomer.vo.CaseErpCusGatherDetailInfo;
  15. import io.swagger.annotations.Api;
  16. import io.swagger.annotations.ApiOperation;
  17. import lombok.AllArgsConstructor;
  18. import org.springframework.web.bind.annotation.*;
  19. import org.springframework.stereotype.Controller;
  20. import javax.validation.Valid;
  21. /**
  22. * <p>
  23. * 客户回款详情【case_erp_customer_gather_detail】 前端控制器
  24. * </p>
  25. *
  26. * @author hnyyzy
  27. * @since 2023-07-12
  28. */
  29. @RestController
  30. @RequestMapping(GlobalConstant.CASE_ERP_CUSTOMER +"/caseErpCustomerGatherDetail")
  31. @Api(value = GlobalConstant.CASE_ERP_CUSTOMER +"/caseErpCustomerGatherDetail", tags = "客户回款详情")
  32. @AllArgsConstructor
  33. public class CaseErpCustomerGatherDetailController {
  34. private ICaseErpCustomerGatherDetailService caseErpCustomerGatherDetailService;
  35. @PostMapping
  36. @ApiOperation(value = "新增客户回款详情信息")
  37. public R add(@Valid @RequestBody AddCaseErpCustomerGatherDetailDto dto) {
  38. return R.ok(caseErpCustomerGatherDetailService.add(dto));
  39. }
  40. @PutMapping
  41. @ApiOperation(value = "修改客户回款详情信息")
  42. public R update(@Valid @RequestBody UpdateCaseErpCustomerGatherDetailDto dto) {
  43. return R.ok(caseErpCustomerGatherDetailService.edit(dto));
  44. }
  45. @GetMapping(value = "/info")
  46. @ApiOperation(value = "根据id查询客户回款详情信息")
  47. public R info(@RequestParam Long id) {
  48. CaseErpCustomerGatherDetail caseErpCustomerGatherDetail = caseErpCustomerGatherDetailService.getById(id);
  49. if (caseErpCustomerGatherDetail == null) {
  50. R.error("找不到此客户回款详情信息!");
  51. }
  52. return R.ok(BeanUtil.toBean(caseErpCustomerGatherDetail, CaseErpCusGatherDetailInfo.class));
  53. }
  54. @DeleteMapping
  55. @ApiOperation(value = "删除")
  56. @XjrLog(value = "删除客户回款详情信息")
  57. public R delete(@Valid @RequestBody Long id) {
  58. return R.ok(caseErpCustomerGatherDetailService.delete(id));
  59. }
  60. }