|
@@ -1,6 +1,7 @@
|
|
|
package com.poteviohealth.cgp.statistics.controller;
|
|
package com.poteviohealth.cgp.statistics.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+import com.aliyun.oss.OSSClient;
|
|
|
import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Maps;
|
|
|
import com.poteviohealth.cgp.common.controller.BaseWebController;
|
|
import com.poteviohealth.cgp.common.controller.BaseWebController;
|
|
|
import com.poteviohealth.cgp.common.exception.BusinessException;
|
|
import com.poteviohealth.cgp.common.exception.BusinessException;
|
|
@@ -10,10 +11,8 @@ import com.poteviohealth.cgp.common.facade.lock.DistributedLock;
|
|
|
import com.poteviohealth.cgp.common.facade.time.MethodTime;
|
|
import com.poteviohealth.cgp.common.facade.time.MethodTime;
|
|
|
import com.poteviohealth.cgp.common.filter.TokenContext;
|
|
import com.poteviohealth.cgp.common.filter.TokenContext;
|
|
|
import com.poteviohealth.cgp.common.filter.repeatSubmit.RepeatSubmit;
|
|
import com.poteviohealth.cgp.common.filter.repeatSubmit.RepeatSubmit;
|
|
|
-import com.poteviohealth.cgp.statistics.model.indto.DishesOrderWebInDTO;
|
|
|
|
|
-import com.poteviohealth.cgp.statistics.model.indto.OrderCostWebInDTO;
|
|
|
|
|
-import com.poteviohealth.cgp.statistics.model.indto.OrderServiceWebInDTO;
|
|
|
|
|
-import com.poteviohealth.cgp.statistics.model.indto.OrderWebInDTO;
|
|
|
|
|
|
|
+import com.poteviohealth.cgp.common.model.VaultsResponse;
|
|
|
|
|
+import com.poteviohealth.cgp.statistics.model.indto.*;
|
|
|
import com.poteviohealth.cgp.statistics.model.outdto.DishesOrderWebOutDTO;
|
|
import com.poteviohealth.cgp.statistics.model.outdto.DishesOrderWebOutDTO;
|
|
|
import com.poteviohealth.cgp.statistics.model.outdto.OrderCostWebOutDTO;
|
|
import com.poteviohealth.cgp.statistics.model.outdto.OrderCostWebOutDTO;
|
|
|
import com.poteviohealth.cgp.statistics.model.outdto.OrderExcelDTO;
|
|
import com.poteviohealth.cgp.statistics.model.outdto.OrderExcelDTO;
|
|
@@ -30,6 +29,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
+import java.io.File;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
@@ -187,4 +187,29 @@ public class OrderController extends BaseWebController {
|
|
|
}
|
|
}
|
|
|
return returnVal;
|
|
return returnVal;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @PostMapping(value = "/uploadArrayFile")
|
|
|
|
|
+ @ApiOperation(httpMethod = "POST", value = "阿里云图片上传")
|
|
|
|
|
+ public VaultsResponse uploadArrayFile(@RequestBody List<PriceUploadDto> list){
|
|
|
|
|
+
|
|
|
|
|
+ log.info(list);
|
|
|
|
|
+ return VaultsResponse.success();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
|
|
+ String endpoint = "oss-cn-beijing.aliyuncs.com";
|
|
|
|
|
+ String accessKeyId = "LTAIKYgOt8D3W9kz";
|
|
|
|
|
+ String accessKeySecret = "yHszJ0sEyQXq90Ad7cxRh4Ake0qfbd";
|
|
|
|
|
+ String bucketName = "ptsubsidy";
|
|
|
|
|
+ String objectName = "yqaa/2408/S232618057175041N-39be3dc7-e478-4414-94bc-c6d4c9e03243.jpg"; // 上传到OSS的文件名
|
|
|
|
|
+ String filePath = "C:\\Users\\86180\\Desktop\\111.jpg"; // 本地文件路径
|
|
|
|
|
+
|
|
|
|
|
+// 创建OSSClient实例。
|
|
|
|
|
+ //OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
|
|
|
|
|
+ OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);
|
|
|
|
|
+ // 文件上传
|
|
|
|
|
+ ossClient.putObject(bucketName, objectName, new File(filePath));
|
|
|
|
|
+ //关闭OSSClient。
|
|
|
|
|
+ ossClient.shutdown();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|