Selaa lähdekoodia

收入数据与成本分摊参数模板的导出

ljx 4 vuotta sitten
vanhempi
commit
b9cda9e90d
1 muutettua tiedostoa jossa 22 lisäystä ja 23 poistoa
  1. 22 23
      src/main/java/com/imed/costaccount/web/ExcelController.java

+ 22 - 23
src/main/java/com/imed/costaccount/web/ExcelController.java

@@ -267,29 +267,6 @@ public class ExcelController {
         writer.close();
         IoUtil.close(out);
     }
-
-
-
-    /**
-     *  收入成本项目批量导入
-     */
-    @PostMapping("/importProductAccount")
-    @ApiOperation("批量导入收入数据信息")
-    public Result importProductAccount(@RequestParam("file") MultipartFile file){
-        InputStream in;
-        try {
-            in = file.getInputStream();
-            ExcelReader reader = ExcelUtil.getReader(in);
-            List<List<Object>> read = reader.read();
-            log.info("最开始:read={}",read);
-            log.info("-------------------------------------------------------------------");
-            Long hospId = UserContext.getHospId();
-            return productService.importProduct(read, hospId);
-        }catch (IOException e){
-            e.printStackTrace();;
-            throw new CostException(500, "导入失败");
-        }
-    }
     /**
      * 成本数据导出模板
      */
@@ -434,4 +411,26 @@ public class ExcelController {
         });
         return departmentLinkedList;
     }
+    /**
+     *  导入 收入/成本/成本分摊参数数据导入
+     * @param file 导入的文件
+     * @param fileType 文件类型 1 成本分摊数据  2 收入数据 3 成本数据
+     */
+    @PostMapping("/importProductAccount")
+    @ApiOperation("批量导入收入数据信息")
+    public Result importProductAccount(@RequestParam("file") MultipartFile file,Integer fileType){
+        InputStream in;
+        try {
+            in = file.getInputStream();
+            ExcelReader reader = ExcelUtil.getReader(in);
+            List<List<Object>> read = reader.read();
+            log.info("最开始:read={}",read);
+            log.info("-------------------------------------------------------------------");
+            Long hospId = UserContext.getHospId();
+            return productService.importProduct(read, hospId);
+        }catch (IOException e){
+            e.printStackTrace();;
+            throw new CostException(500, "导入失败");
+        }
+    }
 }