12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- package com.imed.costaccount.web;
- import com.imed.costaccount.common.exception.CostException;
- import com.imed.costaccount.common.util.PageUtils;
- import com.imed.costaccount.common.util.Result;
- import com.imed.costaccount.service.HospProfitAndLossService;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import io.swagger.annotations.ApiParam;
- import org.springframework.web.bind.annotation.*;
- import javax.servlet.http.HttpServletResponse;
- @Api(tags = "全院损益相关")
- @RestController
- @RequestMapping("/costAccount/hospProfitAndLoss")
- public class HospProfitAndLossController extends AbstractController {
- private final HospProfitAndLossService hospProfitAndLossService;
- public HospProfitAndLossController(HospProfitAndLossService hospProfitAndLossService) {
- this.hospProfitAndLossService = hospProfitAndLossService;
- }
- @ApiOperation("计算全院损益")
- @PostMapping("/calc")
- public Result calc(@RequestParam @ApiParam(name = "date", value = "yyyy-MM-dd") String date) {
- // hospProfitAndLossService.calc(date, getHospId());
- hospProfitAndLossService.calcByResponsibility(date, getHospId());
- return Result.ok();
- }
- @ApiOperation("全院损益列表")
- @GetMapping("/getHospProfits")
- public Result getHospProfits(@RequestParam(value = "current", defaultValue = "1") Integer current,
- @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
- @RequestParam(value = "date")String date) {
- PageUtils pageUtils = hospProfitAndLossService.getHospProfits(current, pageSize, date, getHospId());
- return Result.ok(pageUtils);
- }
- @ApiOperation("全院损益计算输出")
- @PostMapping("/report")
- public Result hospProfitReport(@RequestParam String date, HttpServletResponse response) {
- try {
- hospProfitAndLossService.hospProfitReport(date,getHospId(),response);
- } catch (Exception e) {
- throw new CostException(500,"生成错误");
- }
- return Result.ok();
- }
- @ApiOperation("全院经营报表列表")
- @GetMapping("/hospReports")
- public Result hospReports(@RequestParam(value = "current", defaultValue = "1") Integer current,
- @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
- @RequestParam(value = "date") String date) {
- PageUtils pageUtils = hospProfitAndLossService.hospProfitReports(current, pageSize, getHospId(),date);
- return Result.ok(pageUtils);
- }
- }
|