package com.imed.costaccount.web; 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.*; @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()); 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); } }