CostOtherPaymentsController.java 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. package com.imed.costaccount.web;
  2. import com.imed.costaccount.common.util.PageUtils;
  3. import com.imed.costaccount.common.util.Result;
  4. import com.imed.costaccount.common.util.UserContext;
  5. import com.imed.costaccount.model.dto.CostOtherPaymentsEditDto;
  6. import com.imed.costaccount.model.vo.CostOtherPaymentsSaveDto;
  7. import com.imed.costaccount.model.vo.CostOtherPaymentsVO;
  8. import com.imed.costaccount.service.CostOtherPaymentsService;
  9. import io.swagger.annotations.Api;
  10. import io.swagger.annotations.ApiOperation;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.web.bind.annotation.*;
  13. import javax.validation.Valid;
  14. import java.util.Arrays;
  15. /**
  16. * 全院其他收支设置
  17. *
  18. * @author KCYG
  19. * @date 2021-08-09 17:53:22
  20. */
  21. @RestController
  22. @RequestMapping("/costAccount/costotherpayments")
  23. @Api(tags = "全院其他收支设置操作")
  24. public class CostOtherPaymentsController {
  25. @Autowired
  26. private CostOtherPaymentsService costOtherPaymentsService;
  27. /**
  28. * 分页查询列表
  29. * 查询的是
  30. */
  31. @GetMapping("/list")
  32. @ApiOperation("分压查询全院其他收支设置")
  33. public Result list(@RequestParam(value = "current", defaultValue = "1") Integer current,
  34. @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
  35. @RequestParam(value = "name",required = false) String name){
  36. Long hospId = UserContext.getHospId();
  37. PageUtils pageUtils = costOtherPaymentsService.queryList(current,pageSize,name,hospId);
  38. return Result.ok(pageUtils);
  39. }
  40. /**
  41. * 信息
  42. */
  43. @GetMapping("/info/{id}")
  44. @ApiOperation("根据Id查询全院其他收支设置数据")
  45. public Result info(@PathVariable("id") Long id){
  46. CostOtherPaymentsVO costOtherPaymentsVO = costOtherPaymentsService.getByParamsId(id);
  47. return Result.ok(costOtherPaymentsVO);
  48. }
  49. /**
  50. * 保存
  51. */
  52. @PostMapping("/save")
  53. @ApiOperation("保存全院其他收支设置数据")
  54. public Result save(@RequestBody @Valid CostOtherPaymentsSaveDto costOtherPaymentsSaveDto){
  55. costOtherPaymentsService.addOtherPayment(costOtherPaymentsSaveDto);
  56. return Result.ok();
  57. }
  58. /**
  59. * 修改
  60. */
  61. @PostMapping("/update")
  62. @ApiOperation("修改全院其他收支设置数据")
  63. public Result update(@RequestBody @Valid CostOtherPaymentsEditDto costOtherPaymentsEditDto){
  64. costOtherPaymentsService.updateOtherPaymentById(costOtherPaymentsEditDto);
  65. return Result.ok();
  66. }
  67. /**
  68. * 删除
  69. */
  70. @PostMapping("/delete")
  71. @ApiOperation("删除全院其他收支设置数据")
  72. public Result delete(@RequestBody Long[] ids){
  73. costOtherPaymentsService.removeByIds(Arrays.asList(ids));
  74. return Result.ok();
  75. }
  76. }