ExcelController.java 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. package com.imed.costaccount.web;
  2. import cn.hutool.core.collection.CollUtil;
  3. import cn.hutool.core.date.DateTime;
  4. import cn.hutool.core.date.DateUtil;
  5. import cn.hutool.core.io.FileUtil;
  6. import cn.hutool.core.io.IoUtil;
  7. import cn.hutool.poi.excel.ExcelReader;
  8. import cn.hutool.poi.excel.ExcelUtil;
  9. import cn.hutool.poi.excel.ExcelWriter;
  10. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  11. import com.imed.costaccount.common.exception.CostException;
  12. import com.imed.costaccount.common.token.JwtUtil;
  13. import com.imed.costaccount.common.token.RedisUtil;
  14. import com.imed.costaccount.common.util.Result;
  15. import com.imed.costaccount.common.util.UserContext;
  16. import com.imed.costaccount.constants.NumberConstant;
  17. import com.imed.costaccount.model.*;
  18. import com.imed.costaccount.service.*;
  19. import com.imed.costaccount.service.impl.DepartmentServiceImpl;
  20. import com.imed.costaccount.service.impl.ProductServiceImpl;
  21. import io.swagger.annotations.Api;
  22. import io.swagger.annotations.ApiOperation;
  23. import lombok.extern.slf4j.Slf4j;
  24. import org.apache.poi.ss.usermodel.Sheet;
  25. import org.apache.shiro.SecurityUtils;
  26. import org.jetbrains.annotations.NotNull;
  27. import org.springframework.util.CollectionUtils;
  28. import org.springframework.web.bind.annotation.*;
  29. import org.springframework.web.multipart.MultipartFile;
  30. import javax.servlet.ServletOutputStream;
  31. import javax.servlet.http.HttpServletResponse;
  32. import java.io.File;
  33. import java.io.IOException;
  34. import java.io.InputStream;
  35. import java.util.*;
  36. import java.util.stream.Collectors;
  37. /**
  38. * 相关导入导出操作
  39. */
  40. @Slf4j
  41. @Api(tags = "excel导入导出")
  42. @RestController
  43. @RequestMapping("/costAccount/excel")
  44. public class ExcelController {
  45. private final JwtUtil jwtUtil;
  46. private final UserService userService;
  47. private final DepartmentServiceImpl departmentService;
  48. private final ProductServiceImpl productService;
  49. private final AccountingService accountingService;
  50. private final AccountingProductService accountingProductService;
  51. private final ResponsibilityDepartmentService responsibilityDepartmentService;
  52. private final CostShareParamService costShareParamService;
  53. private final CostIncomeGroupService costIncomeGroupService;
  54. public ExcelController(UserService userService, DepartmentServiceImpl departmentService, ProductServiceImpl productService, AccountingService accountingService, AccountingProductService accountingProductService, ResponsibilityDepartmentService responsibilityDepartmentService, CostShareParamService costShareParamService, CostIncomeGroupService costIncomeGroupService, RedisUtil redisUtil, JwtUtil jwtUtil) {
  55. this.userService = userService;
  56. this.departmentService = departmentService;
  57. this.productService = productService;
  58. this.accountingService = accountingService;
  59. this.accountingProductService = accountingProductService;
  60. this.responsibilityDepartmentService = responsibilityDepartmentService;
  61. this.costShareParamService = costShareParamService;
  62. this.costIncomeGroupService = costIncomeGroupService;
  63. this.jwtUtil = jwtUtil;
  64. }
  65. @ApiOperation("用户导出模板设置")
  66. @GetMapping("/getcurrentTemplate")
  67. public void getImportUserTemplate(HttpServletResponse response) throws IOException {
  68. User user = (User) SecurityUtils.getSubject().getPrincipal();
  69. // TODO: 2021/7/26 暂时没有登录
  70. String uuid = UUID.randomUUID().toString();
  71. String url = System.getProperty("java.io.tmpdir") + File.separator + uuid + File.separator + uuid + ".xls";
  72. FileUtil.del(FileUtil.file(url));
  73. ExcelWriter writer = new ExcelWriter(url);
  74. // 样式
  75. Sheet sheet = writer.getSheet();
  76. // 内容
  77. writer.merge(0, 1, 0, 4, "为了保证成功导入,请勿修改模板格式", false);
  78. writer.passCurrentRow();
  79. writer.passCurrentRow();
  80. writer.merge(2, 2, 0, 4, "测试医院用户导入", false);
  81. writer.passCurrentRow();
  82. writer.writeRow(Arrays.asList("院区", "姓名", "工号", "密码", "手机号码"));
  83. // 写入响应
  84. response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
  85. response.setHeader("Content-Disposition", "attachment;filename=" + uuid + ".xls");
  86. ServletOutputStream out = null;
  87. out = response.getOutputStream();
  88. writer.flush(out, true);
  89. writer.close();
  90. IoUtil.close(out);
  91. }
  92. @PostMapping("/importUser")
  93. @ApiOperation("导入用户")
  94. public Result importUser(@RequestParam("file") MultipartFile file) {
  95. InputStream in;
  96. try {
  97. in = file.getInputStream();
  98. ExcelReader reader = ExcelUtil.getReader(in);
  99. List<List<Object>> read = reader.read();
  100. log.info("最开始:read={}", read);
  101. log.info("-------------------------------假装我是个分割线------------------------------------");
  102. User user = (User) SecurityUtils.getSubject().getPrincipal();
  103. return userService.importUser(read, user);
  104. } catch (IOException e) {
  105. e.printStackTrace();
  106. throw new CostException(500, "导入失败");
  107. }
  108. }
  109. /**
  110. * 科室模板导出功能设置
  111. */
  112. @ApiOperation("科室导出模板设置")
  113. @GetMapping("/getDepartmentTemplate")
  114. public void getImportDepartmentTemplate(HttpServletResponse response) throws IOException {
  115. User user = (User) SecurityUtils.getSubject().getPrincipal();
  116. String uuid = UUID.randomUUID().toString();
  117. String url = System.getProperty("java.io.tmpdir") + File.separator + uuid + File.separator + uuid + ".xls";
  118. FileUtil.del(FileUtil.file(url));
  119. ExcelWriter writer = new ExcelWriter(url);
  120. // 样式
  121. Sheet sheet = writer.getSheet();
  122. // 内容
  123. writer.merge(0, 1, 0, 2, "为了保证成功导入,请勿修改模板格式", false);
  124. writer.passCurrentRow();
  125. writer.passCurrentRow();
  126. writer.merge(2, 2, 0, 2, "医院科室批量导入", false);
  127. writer.passCurrentRow();
  128. writer.setColumnWidth(0, 20);
  129. writer.setColumnWidth(1, 15);
  130. writer.setColumnWidth(2, 15);
  131. writer.writeRow(Arrays.asList("院区", "科室名称", "科室代码"));
  132. // 写入响应
  133. response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
  134. response.setHeader("Content-Disposition", "attachment;filename=" + uuid + ".xls");
  135. ServletOutputStream out = null;
  136. out = response.getOutputStream();
  137. writer.flush(out, true);
  138. writer.close();
  139. IoUtil.close(out);
  140. }
  141. /**
  142. * 批量导入科室信息
  143. */
  144. @PostMapping("/importDepartment")
  145. @ApiOperation("导入科室信息")
  146. public Result importDepartment(@RequestParam("file") MultipartFile file) {
  147. InputStream in;
  148. try {
  149. in = file.getInputStream();
  150. ExcelReader reader = ExcelUtil.getReader(in);
  151. List<List<Object>> read = reader.read();
  152. log.info("最开始:read={}", read);
  153. log.info("-------------------------------------------------------------------");
  154. User user = (User) SecurityUtils.getSubject().getPrincipal();
  155. Long hospId = user.getHospId();
  156. return departmentService.importDepartment(read, hospId);
  157. } catch (IOException e) {
  158. e.printStackTrace();
  159. ;
  160. throw new CostException(500, "导入失败");
  161. }
  162. }
  163. /**
  164. * 收入成本项目批量导入模板
  165. */
  166. @ApiOperation("成本项目导出模板设置")
  167. @GetMapping("/getImportProductTemplate")
  168. public void getImportProductTemplate(HttpServletResponse response) throws IOException {
  169. User user = (User) SecurityUtils.getSubject().getPrincipal();
  170. String uuid = UUID.randomUUID().toString();
  171. String url = System.getProperty("java.io.tmpdir") + File.separator + uuid + File.separator + uuid + ".xls";
  172. FileUtil.del(FileUtil.file(url));
  173. ExcelWriter writer = new ExcelWriter(url);
  174. // 样式
  175. Sheet sheet = writer.getSheet();
  176. // 内容
  177. writer.merge(0, 1, 0, 2, "为了保证成功导入,请勿修改模板格式", false);
  178. writer.passCurrentRow();
  179. writer.passCurrentRow();
  180. writer.merge(2, 2, 0, 2, "医院成本收入批量导入", false);
  181. writer.passCurrentRow();
  182. writer.setColumnWidth(0, 20);
  183. writer.setColumnWidth(1, 15);
  184. writer.setColumnWidth(2, 15);
  185. writer.writeRow(Arrays.asList("院区", "成本项目名", "成本项目编号"));
  186. // 写入响应
  187. response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
  188. response.setHeader("Content-Disposition", "attachment;filename=" + uuid + ".xls");
  189. ServletOutputStream out = null;
  190. out = response.getOutputStream();
  191. writer.flush(out, true);
  192. writer.close();
  193. IoUtil.close(out);
  194. }
  195. /**
  196. * 收入成本项目批量导入
  197. */
  198. @PostMapping("/importProduct")
  199. @ApiOperation("批量导入成本项目信息")
  200. public Result importProduct(@RequestParam("file") MultipartFile file) {
  201. InputStream in;
  202. try {
  203. in = file.getInputStream();
  204. ExcelReader reader = ExcelUtil.getReader(in);
  205. List<List<Object>> read = reader.read();
  206. log.info("最开始:read={}", read);
  207. log.info("-------------------------------------------------------------------");
  208. User user = (User) SecurityUtils.getSubject().getPrincipal();
  209. Long hospId = user.getHospId();
  210. return productService.importProduct(read, hospId);
  211. } catch (IOException e) {
  212. e.printStackTrace();
  213. ;
  214. throw new CostException(500, "导入失败");
  215. }
  216. }
  217. /**
  218. * 收入成本数据导出模板
  219. */
  220. @ApiOperation("收入数据导出模板设置")
  221. @GetMapping("/getImportIncomeProductAccountTemplate")
  222. public void getImportProductAccountTemplate(HttpServletResponse response,String token) throws IOException {
  223. int userId = jwtUtil.getUserId(token);
  224. User user = userService.getById(userId);
  225. if (Objects.isNull(user)){
  226. throw new CostException(500,"用户不存在");
  227. }
  228. Long hospId = user.getHospId();
  229. String uuid = UUID.randomUUID().toString();
  230. String url = System.getProperty("java.io.tmpdir") + File.separator + uuid + File.separator + uuid + ".xls";
  231. FileUtil.del(FileUtil.file(url));
  232. ExcelWriter writer = new ExcelWriter(url);
  233. // 样式
  234. Sheet sheet = writer.getSheet();
  235. // 内容
  236. writer.merge(0, 1, 0, 16, "为了保证成功导入,请勿修改模板格式", false);
  237. writer.passCurrentRow();
  238. writer.passCurrentRow();
  239. writer.merge(2, 2, 0, 16, "医院收入数据批量导入", false);
  240. writer.passCurrentRow();
  241. // 冻结前四行
  242. writer.setFreezePane(4);
  243. writer.writeRow(Arrays.asList("成本项目代码", "成本项目名称", "开单科室", "开单科室代码", "执行科室", "执行科室代码", "医生编码","开单医生",
  244. "病人ID", "住院号/门诊号", "患者姓名", "病人费别", "收据费别", "数量", "单位", "金额", "费用发生时间"));
  245. int accountType = NumberConstant.ONE;
  246. int column = NumberConstant.FOUR;
  247. getProductByAccountType(hospId, writer, accountType, column);
  248. writer.setColumnWidth(0, 20);
  249. writer.setColumnWidth(1, 20);
  250. writer.setColumnWidth(2, 10);
  251. writer.setColumnWidth(3, 13);
  252. writer.setColumnWidth(4, 10);
  253. writer.setColumnWidth(5, 13);
  254. writer.setColumnWidth(6, 10);
  255. writer.setColumnWidth(7, 10);
  256. writer.setColumnWidth(8, 10);
  257. writer.setColumnWidth(9, 15);
  258. writer.setColumnWidth(10, 10);
  259. writer.setColumnWidth(11, 10);
  260. writer.setColumnWidth(12, 10);
  261. writer.setColumnWidth(13, 10);
  262. writer.setColumnWidth(14, 10);
  263. writer.setColumnWidth(15, 10);
  264. writer.setColumnWidth(16, 15);
  265. response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
  266. response.setHeader("Content-Disposition", "attachment;filename=" + uuid + ".xls");
  267. ServletOutputStream out = null;
  268. out = response.getOutputStream();
  269. writer.flush(out, true);
  270. writer.close();
  271. IoUtil.close(out);
  272. }
  273. /**
  274. * 成本数据导出模板
  275. */
  276. @GetMapping("/getImportCostProductAccountTemplate")
  277. @ApiOperation("成本数据导出模板设置")
  278. public void getImportCostProductAccountTemplate(HttpServletResponse response) throws IOException {
  279. Long hospId = UserContext.getHospId();
  280. String uuid = UUID.randomUUID().toString();
  281. String url = System.getProperty("java.io.tmpdir") + File.separator + uuid + File.separator + uuid + ".xls";
  282. FileUtil.del(FileUtil.file(url));
  283. ExcelWriter writer = new ExcelWriter(url);
  284. // 样式
  285. Sheet sheet = writer.getSheet();
  286. writer.merge(0, 1, 0, 6, "为了保证成功导入,请勿修改模板格式", false);
  287. writer.passCurrentRow();
  288. writer.passCurrentRow();
  289. writer.merge(2, 2, 0, 6, "医院成本数据批量导入", false);
  290. writer.passCurrentRow();
  291. // 所有科室里面对应存在责任中心对应的科室
  292. List<Department> departmentLinkedList = getDepartments(hospId);
  293. // 设置科室的代码集合
  294. List<String> departmentCodeList = departmentLinkedList.stream().map(Department::getDepartmentCode).collect(Collectors.toList());
  295. List<String> departmentNameList = departmentLinkedList.stream().map(Department::getDepartmentName).collect(Collectors.toList());
  296. departmentCodeList.add(0, null);
  297. departmentCodeList.add(1, null);
  298. writer.writeRow(departmentCodeList);
  299. departmentNameList.add(0, "成本项目代码");
  300. departmentNameList.add(1, "成本项目名称");
  301. writer.writeRow(departmentNameList);
  302. // 设置科室名称的集合
  303. writer.setFreezePane(5);
  304. int accountType = NumberConstant.TWO;
  305. int column = NumberConstant.FIVE;
  306. getProductByAccountType(hospId, writer, accountType, column);
  307. writer.setColumnWidth(0, 15);
  308. writer.setColumnWidth(1, 15);
  309. response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
  310. response.setHeader("Content-Disposition", "attachment;filename=" + uuid + ".xls");
  311. ServletOutputStream out = null;
  312. out = response.getOutputStream();
  313. writer.flush(out, true);
  314. writer.close();
  315. IoUtil.close(out);
  316. }
  317. /**
  318. * 获取执行类型的成本项目
  319. *
  320. * @param hospId 医院Id
  321. * @param writer 操作流
  322. * @param accountType 会计科目类型 1 收入 2支出(成本)
  323. * @param column 控制第几列
  324. */
  325. private void getProductByAccountType(Long hospId, ExcelWriter writer, Integer accountType, Integer column) {
  326. // 所有的成本项目
  327. List<Product> productList = productService.list(new QueryWrapper<Product>().lambda().eq(Product::getHospId, hospId));
  328. // 所有成本会计对照数据
  329. List<AccountingProduct> accountingProductList = accountingProductService.list(new QueryWrapper<AccountingProduct>().lambda().eq(AccountingProduct::getHospId, hospId));
  330. // 所有会计科目列表数据
  331. List<Accounting> accountingList = accountingService.list(new QueryWrapper<Accounting>().lambda().eq(Accounting::getHospId, hospId));
  332. List<Product> products = new ArrayList<>();
  333. Map<Long, List<AccountingProduct>> accountProductMap = accountingProductList.stream().collect(Collectors.groupingBy(AccountingProduct::getProductId));
  334. Map<Long, List<Accounting>> accountMap = accountingList.stream().collect(Collectors.groupingBy(Accounting::getId));
  335. productList.forEach(i -> {
  336. Long productId = i.getId();
  337. List<AccountingProduct> accountingProducts = accountProductMap.get(productId);
  338. if (CollUtil.isNotEmpty(accountingProducts)) {
  339. Long accountingId = accountingProducts.get(0).getAccountingId();
  340. List<Accounting> accountings = accountMap.get(accountingId);
  341. if (CollUtil.isNotEmpty(accountings) && accountType.equals(accountings.get(0).getAccountingType())) {
  342. products.add(i);
  343. }
  344. }
  345. });
  346. // 写入响应第一列 第二列的数据
  347. for (int j = 0; j < products.size(); j++) {
  348. writer.writeCellValue(0, j + column, productList.get(j).getProductCode());
  349. writer.writeCellValue(1, j + column, productList.get(j).getProductName());
  350. }
  351. }
  352. /**
  353. * 成本分摊参数导出模板
  354. */
  355. @GetMapping("/getShareParamTemplate")
  356. @ApiOperation("成本分摊参数导出模板")
  357. public void getShareParamTemplate(HttpServletResponse response) throws IOException {
  358. Long hospId = UserContext.getHospId();
  359. String uuid = UUID.randomUUID().toString();
  360. String url = System.getProperty("java.io.tmpdir") + File.separator + uuid + File.separator + uuid + ".xls";
  361. FileUtil.del(FileUtil.file(url));
  362. ExcelWriter writer = new ExcelWriter(url);
  363. // 样式
  364. Sheet sheet = writer.getSheet();
  365. writer.merge(0, 1, 0, 6, "为了保证成功导入,请勿修改模板格式", false);
  366. writer.passCurrentRow();
  367. writer.passCurrentRow();
  368. writer.merge(2, 2, 0, 6, "医院成本分摊参数数据批量导入", false);
  369. writer.passCurrentRow();
  370. // 所有科室里面对应存在责任中心对应的科室进行显示
  371. List<Department> departmentLinkedList = getDepartments(hospId);
  372. // 设置科室的代码集合
  373. List<String> departmentCodeList = departmentLinkedList.stream().map(Department::getDepartmentCode).collect(Collectors.toList());
  374. List<String> departmentNameList = departmentLinkedList.stream().map(Department::getDepartmentName).collect(Collectors.toList());
  375. departmentCodeList.add(0, null);
  376. departmentCodeList.add(1, null);
  377. writer.writeRow(departmentCodeList);
  378. departmentNameList.add(0, "成本分摊参数代码");
  379. departmentNameList.add(1, "成本分摊参数名称");
  380. writer.writeRow(departmentNameList);
  381. // 设置科室名称的集合
  382. writer.setFreezePane(5);
  383. // 为第一列和第二列设置成本分摊参数的列表数据
  384. List<CostShareParam> costShareParamList = costShareParamService.list(new QueryWrapper<CostShareParam>().lambda().eq(CostShareParam::getHospId, hospId));
  385. for (int j = 0; j < costShareParamList.size(); j++) {
  386. writer.writeCellValue(0, j + 5, costShareParamList.get(j).getShareParamCode());
  387. writer.writeCellValue(1, j + 5, costShareParamList.get(j).getShareParamName());
  388. }
  389. writer.setColumnWidth(0, 15);
  390. writer.setColumnWidth(1, 15);
  391. response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
  392. response.setHeader("Content-Disposition", "attachment;filename=" + uuid + ".xls");
  393. ServletOutputStream out = null;
  394. out = response.getOutputStream();
  395. writer.flush(out, true);
  396. writer.close();
  397. IoUtil.close(out);
  398. }
  399. @NotNull
  400. private List<Department> getDepartments(Long hospId) {
  401. List<Department> departmentLinkedList = new LinkedList<>();
  402. List<Department> departmentList = departmentService.list(new QueryWrapper<Department>().lambda().eq(Department::getHospId, hospId).orderByDesc(Department::getCreateTime));
  403. List<ResponsibilityDepartment> responsibilityDepartmentList = responsibilityDepartmentService.list(new QueryWrapper<ResponsibilityDepartment>().lambda()
  404. .eq(ResponsibilityDepartment::getHospId, hospId));
  405. Map<Long, List<ResponsibilityDepartment>> responsibilityDepartmentMap = responsibilityDepartmentList.stream().collect(Collectors.groupingBy(ResponsibilityDepartment::getDepartmentId));
  406. departmentList.forEach(i -> {
  407. Long id = i.getId();
  408. if (!CollectionUtils.isEmpty(responsibilityDepartmentMap.get(id))) {
  409. // TODO 暂时先不考虑关联的责任中心是否存在
  410. departmentLinkedList.add(i);
  411. }
  412. });
  413. return departmentLinkedList;
  414. }
  415. /**
  416. * 导入 收入数据导入
  417. *
  418. * @param
  419. */
  420. @PostMapping("/importDataByFileType")
  421. @ApiOperation("批量导入指定类型数据信息")
  422. public Result importProductAccount(@RequestParam("file") MultipartFile file ,Integer fileType,String dateTime) {
  423. if (Objects.isNull(file)) {
  424. throw new CostException(500, "请选择文件");
  425. }
  426. InputStream in;
  427. // 导入的是收入数据
  428. try {
  429. in = file.getInputStream();
  430. ExcelReader reader = ExcelUtil.getReader(in);
  431. List<List<Object>> read = reader.read();
  432. log.info("最开始:read={}", read);
  433. log.info("-------------------------------------------------------------------");
  434. User user = UserContext.getCurrentUser();
  435. return costIncomeGroupService.importIncomeGroup(read, user, file, dateTime,fileType);
  436. } catch (IOException e) {
  437. e.printStackTrace();
  438. ;
  439. throw new CostException(500, "导入失败");
  440. }
  441. }
  442. // @ApiOperation("excel导入收入数据")
  443. // @PostMapping("/importDataByIncomeData")
  444. // public Result importDataByIncomeData(@RequestParam("file") MultipartFile file, Integer year, Integer month) {
  445. // if (Objects.isNull(year) || Objects.isNull(month)) {
  446. // DateTime dateTime = DateUtil.lastMonth();
  447. // year = DateUtil.year(dateTime);
  448. // month = DateUtil.month(dateTime);
  449. // }
  450. // if (Objects.isNull(file)) {
  451. // throw new CostException(500, "请选择文件");
  452. // }
  453. // InputStream in;
  454. // // 导入的是收入数据
  455. // try {
  456. // in = file.getInputStream();
  457. // ExcelReader reader = ExcelUtil.getReader(in);
  458. // List<List<Object>> read = reader.read();
  459. // log.info("最开始:read={}", read);
  460. // log.info("-------------------------------------------------------------------");
  461. // User user = UserContext.getCurrentUser();
  462. // return costIncomeGroupService.importDataByIncomeData(read, user, file, year, month);
  463. // } catch (IOException e) {
  464. // e.printStackTrace();
  465. // ;
  466. // throw new CostException(500, "导入失败");
  467. // }
  468. //
  469. // }
  470. }