From 482f58537fa3f0cab93b88c6d0bcb803e0431cfc Mon Sep 17 00:00:00 2001
From: houruijun <411269194@kidgrow.com>
Date: Wed, 23 Sep 2020 15:51:08 +0800
Subject: [PATCH] 1.增加后台开通医院/科室的单次支付功能,并自动充入指定套餐 2.新增查询医院科室是否开通单次支付功能的接口 3.新增查询医院科室的支付单价 4.修改扣费业务4个接口,增加支持单次支付的判断与处理 5.增加接口,查看某个诊断的支付状态

---
 kidgrow-business/kidgrow-filecenter/kidgrow-filecenter-server/src/main/java/com/kidgrow/filecenter/controller/FileController.java |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/kidgrow-business/kidgrow-filecenter/kidgrow-filecenter-server/src/main/java/com/kidgrow/filecenter/controller/FileController.java b/kidgrow-business/kidgrow-filecenter/kidgrow-filecenter-server/src/main/java/com/kidgrow/filecenter/controller/FileController.java
index 9d4a3e2..b70149c 100644
--- a/kidgrow-business/kidgrow-filecenter/kidgrow-filecenter-server/src/main/java/com/kidgrow/filecenter/controller/FileController.java
+++ b/kidgrow-business/kidgrow-filecenter/kidgrow-filecenter-server/src/main/java/com/kidgrow/filecenter/controller/FileController.java
@@ -13,6 +13,8 @@
 
 import javax.annotation.Resource;
 import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.util.Map;
 
@@ -88,8 +90,8 @@
     /**
      * byte[]上传
      */
-    @PostMapping(value="byteUplaod",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
-    public FileInfo byteUplaod(@RequestParam("fileName") String fileName,@RequestParam("byte[]") byte[] bytes){
+    @PostMapping(value="byteUplaod")
+    public FileInfo byteUplaod(@RequestParam("fileName") String fileName,@RequestBody byte[] bytes){
         if(bytes.length == 0){
             return null;
         }
@@ -99,6 +101,25 @@
         InputStream inputStream = new ByteArrayInputStream(bytes);
         return fileService.byteUplaod(fileName,inputStream,bytes.length);
     }
+    /**
+     * byte[]上传
+     */
+    @PostMapping(value="byteUplaodTest",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    public FileInfo byteUplaodTest(@RequestParam("fileName") String fileName,@RequestPart("file") MultipartFile file)throws IOException {
+        InputStream inputStream = file.getInputStream();
+        ByteArrayOutputStream bytestream = new ByteArrayOutputStream();
+        byte[] buffer=new byte[1024];
+        int ch;
+        /**
+         *
+         * */
+        while ((ch = inputStream.read(buffer)) != -1) {
+            bytestream.write(buffer,0,ch);
+        }
+        byte[] data = bytestream.toByteArray();
+        InputStream inputStream1 = new ByteArrayInputStream(data);
+        return fileService.byteUplaod(fileName,inputStream,data.length);
+    }
 
     /**
      * 文件删除

--
Gitblit v1.8.0