CostOtherPaymentsController.java 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. import java.util.List;
  16. /**
  17. * 全院其他收支设置
  18. *
  19. * @author KCYG
  20. * @date 2021-08-09 17:53:22
  21. */
  22. @RestController
  23. @RequestMapping("/costAccount/costotherpayments")
  24. @Api(tags = "全院其他收支设置操作")
  25. public class CostOtherPaymentsController {
  26. @Autowired
  27. private CostOtherPaymentsService costOtherPaymentsService;
  28. /**
  29. * 分页查询列表
  30. * 查询的是
  31. */
  32. @GetMapping("/list")
  33. @ApiOperation("分压查询全院其他收支设置")
  34. public Result list(@RequestParam(value = "current", defaultValue = "1") Integer current,
  35. @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
  36. @RequestParam(value = "name",required = false) String name){
  37. Long hospId = UserContext.getHospId();
  38. PageUtils pageUtils = costOtherPaymentsService.queryList(current,pageSize,name,hospId);
  39. return Result.ok(pageUtils);
  40. }
  41. /**
  42. * 信息
  43. */
  44. @GetMapping("/info/{id}")
  45. @ApiOperation("根据Id查询全院其他收支设置数据")
  46. public Result info(@PathVariable("id") Long id){
  47. CostOtherPaymentsVO costOtherPaymentsVO = costOtherPaymentsService.getByParamsId(id);
  48. return Result.ok(costOtherPaymentsVO);
  49. }
  50. /**
  51. * 查询全院其他收支设置数据列表
  52. */
  53. @GetMapping("/getAll")
  54. @ApiOperation("查询全院其他收支设置列表")
  55. public Result getAll(){
  56. Long hospId = UserContext.getHospId();
  57. List<CostOtherPaymentsVO> costOtherPaymentsVOList = costOtherPaymentsService.getAll(hospId);
  58. return Result.ok(costOtherPaymentsVOList);
  59. }
  60. /**
  61. * 保存
  62. */
  63. @PostMapping("/save")
  64. @ApiOperation("保存全院其他收支设置数据")
  65. public Result save(@RequestBody @Valid CostOtherPaymentsSaveDto costOtherPaymentsSaveDto){
  66. costOtherPaymentsService.addOtherPayment(costOtherPaymentsSaveDto);
  67. return Result.ok();
  68. }
  69. /**
  70. * 修改
  71. */
  72. @PostMapping("/update")
  73. @ApiOperation("修改全院其他收支设置数据")
  74. public Result update(@RequestBody @Valid CostOtherPaymentsEditDto costOtherPaymentsEditDto){
  75. costOtherPaymentsService.updateOtherPaymentById(costOtherPaymentsEditDto);
  76. return Result.ok();
  77. }
  78. /**
  79. * 删除
  80. */
  81. @PostMapping("/delete")
  82. @ApiOperation("删除全院其他收支设置数据")
  83. public Result delete(@RequestBody Long[] ids){
  84. costOtherPaymentsService.deleteByIds(Arrays.asList(ids));
  85. return Result.ok();
  86. }
  87. }