2
0

CostIncomeFileController.java 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. @RequestParam(value = "dateTime",required = false) String dateTime){
  36. Long hospId = UserContext.getHospId();
  37. PageUtils pageUtils = costIncomeFileService.queryList(current,pageSize,fileName,dateTime,hospId);
  38. return Result.ok(pageUtils);
  39. }
  40. /**
  41. * 撤销导入
  42. * 这个文件的Id
  43. */
  44. @PostMapping("/deleteImport")
  45. @ApiOperation("撤销导入")
  46. public Result deleteImport(Long id){
  47. Long hospId = UserContext.getHospId();
  48. costIncomeFileService.deleteImport(id,hospId);
  49. return Result.ok();
  50. }
  51. @GetMapping("/getErrorList")
  52. @ApiOperation("查看错误详情")
  53. public Result getErrorList(Long id){
  54. Long hospId = UserContext.getHospId();
  55. List<IncomeErrorMessage> incomeErrorMessageList = costIncomeFileService.getErrorList(id,hospId);
  56. return Result.ok(incomeErrorMessageList);
  57. }
  58. /**
  59. * 信息
  60. */
  61. @RequestMapping("/info/{id}")
  62. public Result info(@PathVariable("id") Long id){
  63. CostIncomeFile costIncomeFile = costIncomeFileService.getById(id);
  64. return Result.ok(costIncomeFile);
  65. }
  66. /**
  67. * 保存
  68. */
  69. @RequestMapping("/save")
  70. public Result save(@RequestBody CostIncomeFile costIncomeFile){
  71. costIncomeFileService.save(costIncomeFile);
  72. return Result.ok();
  73. }
  74. /**
  75. * 修改
  76. */
  77. @RequestMapping("/update")
  78. public Result update(@RequestBody CostIncomeFile costIncomeFile){
  79. costIncomeFileService.updateById(costIncomeFile);
  80. return Result.ok();
  81. }
  82. /**
  83. * 删除
  84. */
  85. @PostMapping("/delete")
  86. public Result delete(@RequestBody Long[] ids){
  87. costIncomeFileService.deleteByIds(Arrays.asList(ids));
  88. return Result.ok();
  89. }
  90. }