2
0

HospProfitAndLossController.java 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package com.imed.costaccount.web;
  2. import com.imed.costaccount.common.exception.CostException;
  3. import com.imed.costaccount.common.util.PageUtils;
  4. import com.imed.costaccount.common.util.Result;
  5. import com.imed.costaccount.service.HospProfitAndLossService;
  6. import io.swagger.annotations.Api;
  7. import io.swagger.annotations.ApiOperation;
  8. import io.swagger.annotations.ApiParam;
  9. import org.springframework.web.bind.annotation.*;
  10. import javax.servlet.http.HttpServletResponse;
  11. @Api(tags = "全院损益相关")
  12. @RestController
  13. @RequestMapping("/costAccount/hospProfitAndLoss")
  14. public class HospProfitAndLossController extends AbstractController {
  15. private final HospProfitAndLossService hospProfitAndLossService;
  16. public HospProfitAndLossController(HospProfitAndLossService hospProfitAndLossService) {
  17. this.hospProfitAndLossService = hospProfitAndLossService;
  18. }
  19. @ApiOperation("计算全院损益")
  20. @PostMapping("/calc")
  21. public Result calc(@RequestParam @ApiParam(name = "date", value = "yyyy-MM-dd") String date) {
  22. // hospProfitAndLossService.calc(date, getHospId());
  23. hospProfitAndLossService.calcByResponsibility(date, getHospId());
  24. return Result.ok();
  25. }
  26. @ApiOperation("全院损益列表")
  27. @GetMapping("/getHospProfits")
  28. public Result getHospProfits(@RequestParam(value = "current", defaultValue = "1") Integer current,
  29. @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
  30. @RequestParam(value = "date")String date) {
  31. PageUtils pageUtils = hospProfitAndLossService.getHospProfits(current, pageSize, date, getHospId());
  32. return Result.ok(pageUtils);
  33. }
  34. @ApiOperation("全院损益计算输出")
  35. @PostMapping("/report")
  36. public Result hospProfitReport(@RequestParam String date, HttpServletResponse response) {
  37. try {
  38. hospProfitAndLossService.hospProfitReport(date,getHospId(),response);
  39. } catch (Exception e) {
  40. throw new CostException(500,"生成错误");
  41. }
  42. return Result.ok();
  43. }
  44. @ApiOperation("全院经营报表列表")
  45. @GetMapping("/hospReports")
  46. public Result hospReports(@RequestParam(value = "current", defaultValue = "1") Integer current,
  47. @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
  48. @RequestParam(value = "date") String date) {
  49. PageUtils pageUtils = hospProfitAndLossService.hospProfitReports(current, pageSize, getHospId(),date);
  50. return Result.ok(pageUtils);
  51. }
  52. }