package com.imed.costaccount.web; import com.imed.costaccount.common.util.PageUtils; import com.imed.costaccount.common.util.Result; import com.imed.costaccount.common.util.UserContext; import com.imed.costaccount.model.DepartmentProfitFile; import com.imed.costaccount.service.DepartmentProfitFileService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.Arrays; /** * 科室经营报表 * * @author huangrui * @date 2021-08-30 13:40:57 */ @RestController @RequestMapping("/costAccount/departmentprofitfile") @Api(tags = "科室经营报表") public class DepartmentProfitFileController { @Autowired private DepartmentProfitFileService departmentProfitFileService; /** * 分页查询列表 * 查询的是 */ @GetMapping("/list") @ApiOperation("查询科室经营报表记录") @ApiImplicitParams({ @ApiImplicitParam(name = "current",value = "当前页",required = true), @ApiImplicitParam(name = "pageSize",value = "当前页大小",required = true), @ApiImplicitParam(name = "date",value = "年月日 xxx-xx-xx",required = false), @ApiImplicitParam(name = "reportName",value = "报表名称",required = false) }) public Result list(@RequestParam(value = "current", defaultValue = "1") Integer current, @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, @RequestParam(value = "date",required = false) String date, @RequestParam(value = "reportName",required = false) String reportName){ Long hospId = UserContext.getHospId(); PageUtils pageUtils= departmentProfitFileService.queryList(current,pageSize,date,reportName,hospId); return Result.ok(pageUtils); } /** * 计算科室损益记录 */ @PostMapping("addDepartmentProfitFile") @ApiOperation("添加科室损益记录") public Result addDepartmentProfitFile(String date,Integer reportType){ Long hospId = UserContext.getHospId(); departmentProfitFileService.addDepartmentProfitFile(date,reportType,hospId); return Result.ok(); } /** * 信息 */ @RequestMapping("/info/{id}") public Result info(@PathVariable("id") Long id){ DepartmentProfitFile departmentProfitFile = departmentProfitFileService.getById(id); return Result.ok(departmentProfitFile); } /** * 保存 */ @RequestMapping("/save") public Result save(@RequestBody DepartmentProfitFile departmentProfitFile){ departmentProfitFileService.save(departmentProfitFile); return Result.ok(); } /** * 修改 */ @RequestMapping("/update") public Result update(@RequestBody DepartmentProfitFile departmentProfitFile){ departmentProfitFileService.updateById(departmentProfitFile); return Result.ok(); } /** * 删除 */ @RequestMapping("/delete") public Result delete(@RequestBody Long[] ids){ departmentProfitFileService.removeByIds(Arrays.asList(ids)); return Result.ok(); } }