CostDepartmentProfitController.java 3.2 KB

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