123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- 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.CostIncomeFile;
- import com.imed.costaccount.model.vo.IncomeErrorMessage;
- import com.imed.costaccount.service.CostIncomeFileService;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.util.Arrays;
- import java.util.List;
- /**
- * 文件上传记录
- *
- * @author KCYG
- * @date 2021-08-10 14:42:20
- */
- @RestController
- @RequestMapping("/costAccount/costincomefile")
- @Api(tags = "文件记录")
- public class CostIncomeFileController {
- @Autowired
- private CostIncomeFileService costIncomeFileService;
- /**
- * 分页查询列表
- * 查询的是
- */
- @GetMapping("/list")
- @ApiOperation("分页查询记录数据")
- public Result list(@RequestParam(value = "current", defaultValue = "1") Integer current,
- @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
- @RequestParam(value = "fileName",required = false) String fileName,
- @RequestParam(value = "dateTime",required = false) String dateTime){
- Long hospId = UserContext.getHospId();
- PageUtils pageUtils = costIncomeFileService.queryList(current,pageSize,fileName,dateTime,hospId);
- return Result.ok(pageUtils);
- }
- /**
- * 撤销导入
- * 这个文件的Id
- */
- @PostMapping("/deleteImport")
- @ApiOperation("撤销导入")
- public Result deleteImport(Long id){
- Long hospId = UserContext.getHospId();
- costIncomeFileService.deleteImport(id,hospId);
- return Result.ok();
- }
- @GetMapping("/getErrorList")
- @ApiOperation("查看错误详情")
- public Result getErrorList(Long id){
- Long hospId = UserContext.getHospId();
- List<IncomeErrorMessage> incomeErrorMessageList = costIncomeFileService.getErrorList(id,hospId);
- return Result.ok(incomeErrorMessageList);
- }
- /**
- * 信息
- */
- @RequestMapping("/info/{id}")
- public Result info(@PathVariable("id") Long id){
- CostIncomeFile costIncomeFile = costIncomeFileService.getById(id);
- return Result.ok(costIncomeFile);
- }
- /**
- * 保存
- */
- @RequestMapping("/save")
- public Result save(@RequestBody CostIncomeFile costIncomeFile){
- costIncomeFileService.save(costIncomeFile);
- return Result.ok();
- }
- /**
- * 修改
- */
- @RequestMapping("/update")
- public Result update(@RequestBody CostIncomeFile costIncomeFile){
- costIncomeFileService.updateById(costIncomeFile);
- return Result.ok();
- }
- /**
- * 删除
- */
- @PostMapping("/delete")
- public Result delete(@RequestBody Long[] ids){
- costIncomeFileService.deleteByIds(Arrays.asList(ids));
- return Result.ok();
- }
- }
|