DepartmentProfitFileController.java 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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.DepartmentProfitFile;
  6. import com.imed.costaccount.service.DepartmentProfitFileService;
  7. import io.swagger.annotations.Api;
  8. import io.swagger.annotations.ApiImplicitParam;
  9. import io.swagger.annotations.ApiImplicitParams;
  10. import io.swagger.annotations.ApiOperation;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.web.bind.annotation.*;
  13. import java.util.Arrays;
  14. /**
  15. * 科室经营报表
  16. *
  17. * @author huangrui
  18. * @date 2021-08-30 13:40:57
  19. */
  20. @RestController
  21. @RequestMapping("/costAccount/departmentprofitfile")
  22. @Api(tags = "科室经营报表")
  23. public class DepartmentProfitFileController {
  24. @Autowired
  25. private DepartmentProfitFileService departmentProfitFileService;
  26. /**
  27. * 分页查询列表
  28. * 查询的是
  29. */
  30. @GetMapping("/list")
  31. @ApiOperation("查询科室经营报表记录")
  32. @ApiImplicitParams({
  33. @ApiImplicitParam(name = "current",value = "当前页",required = true),
  34. @ApiImplicitParam(name = "pageSize",value = "当前页大小",required = true),
  35. @ApiImplicitParam(name = "date",value = "年月日 xxx-xx-xx",required = false),
  36. @ApiImplicitParam(name = "reportName",value = "报表名称",required = false)
  37. })
  38. public Result list(@RequestParam(value = "current", defaultValue = "1") Integer current,
  39. @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
  40. @RequestParam(value = "date",required = false) String date,
  41. @RequestParam(value = "reportName",required = false) String reportName){
  42. Long hospId = UserContext.getHospId();
  43. PageUtils pageUtils= departmentProfitFileService.queryList(current,pageSize,date,reportName,hospId);
  44. return Result.ok(pageUtils);
  45. }
  46. /**
  47. * 计算科室损益记录
  48. */
  49. @PostMapping("addDepartmentProfitFile")
  50. @ApiOperation("添加科室损益记录")
  51. public Result addDepartmentProfitFile(String date,Integer reportType){
  52. Long hospId = UserContext.getHospId();
  53. departmentProfitFileService.addDepartmentProfitFile(date,reportType,hospId);
  54. return Result.ok();
  55. }
  56. /**
  57. * 信息
  58. */
  59. @RequestMapping("/info/{id}")
  60. public Result info(@PathVariable("id") Long id){
  61. DepartmentProfitFile departmentProfitFile = departmentProfitFileService.getById(id);
  62. return Result.ok(departmentProfitFile);
  63. }
  64. /**
  65. * 保存
  66. */
  67. @RequestMapping("/save")
  68. public Result save(@RequestBody DepartmentProfitFile departmentProfitFile){
  69. departmentProfitFileService.save(departmentProfitFile);
  70. return Result.ok();
  71. }
  72. /**
  73. * 修改
  74. */
  75. @RequestMapping("/update")
  76. public Result update(@RequestBody DepartmentProfitFile departmentProfitFile){
  77. departmentProfitFileService.updateById(departmentProfitFile);
  78. return Result.ok();
  79. }
  80. /**
  81. * 删除
  82. */
  83. @RequestMapping("/delete")
  84. public Result delete(@RequestBody Long[] ids){
  85. departmentProfitFileService.removeByIds(Arrays.asList(ids));
  86. return Result.ok();
  87. }
  88. }