2
0

CostIncomeFileController.java 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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.CostIncomeFile;
  6. import com.imed.costaccount.model.vo.IncomeErrorMessage;
  7. import com.imed.costaccount.service.CostIncomeFileService;
  8. import io.swagger.annotations.Api;
  9. import io.swagger.annotations.ApiOperation;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import org.springframework.web.bind.annotation.*;
  12. import java.util.Arrays;
  13. import java.util.List;
  14. /**
  15. * 文件上传记录
  16. *
  17. * @author KCYG
  18. * @date 2021-08-10 14:42:20
  19. */
  20. @RestController
  21. @RequestMapping("/costAccount/costincomefile")
  22. @Api(tags = "文件记录")
  23. public class CostIncomeFileController {
  24. @Autowired
  25. private CostIncomeFileService costIncomeFileService;
  26. /**
  27. * 分页查询列表
  28. * 查询的是
  29. */
  30. @GetMapping("/list")
  31. @ApiOperation("分页查询记录数据")
  32. public Result list(@RequestParam(value = "current", defaultValue = "1") Integer current,
  33. @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
  34. @RequestParam(value = "fileName",required = false) String fileName){
  35. Long hospId = UserContext.getHospId();
  36. PageUtils pageUtils = costIncomeFileService.queryList(current,pageSize,fileName,hospId);
  37. return Result.ok(pageUtils);
  38. }
  39. /**
  40. * 撤销导入
  41. * 这个文件的Id
  42. */
  43. @PostMapping("/deleteImport")
  44. @ApiOperation("撤销导入")
  45. public Result deleteImport(Long id){
  46. Long hospId = UserContext.getHospId();
  47. costIncomeFileService.deleteImport(id,hospId);
  48. return Result.ok();
  49. }
  50. @GetMapping("/getErrorList")
  51. @ApiOperation("查看错误详情")
  52. public Result getErrorList(Long id){
  53. Long hospId = UserContext.getHospId();
  54. List<IncomeErrorMessage> incomeErrorMessageList = costIncomeFileService.getErrorList(id,hospId);
  55. return Result.ok(incomeErrorMessageList);
  56. }
  57. /**
  58. * 信息
  59. */
  60. @RequestMapping("/info/{id}")
  61. public Result info(@PathVariable("id") Long id){
  62. CostIncomeFile costIncomeFile = costIncomeFileService.getById(id);
  63. return Result.ok(costIncomeFile);
  64. }
  65. /**
  66. * 保存
  67. */
  68. @RequestMapping("/save")
  69. public Result save(@RequestBody CostIncomeFile costIncomeFile){
  70. costIncomeFileService.save(costIncomeFile);
  71. return Result.ok();
  72. }
  73. /**
  74. * 修改
  75. */
  76. @RequestMapping("/update")
  77. public Result update(@RequestBody CostIncomeFile costIncomeFile){
  78. costIncomeFileService.updateById(costIncomeFile);
  79. return Result.ok();
  80. }
  81. /**
  82. * 删除
  83. */
  84. @RequestMapping("/delete")
  85. public Result delete(@RequestBody Long[] ids){
  86. costIncomeFileService.removeByIds(Arrays.asList(ids));
  87. return Result.ok();
  88. }
  89. }