Переглянути джерело

[物联网大屏统计接口]

wangzhinan 3 роки тому
батько
коміт
aed7aaf025

+ 9 - 1
gateway/ag-basic/src/main/resources/application.yml

@ -29,7 +29,13 @@ spring:
      max-active: 8 # Max number of connections that can be allocated by the pool at a given time. Use a negative value for no limit.
      max-idle: 8 # Max number of "idle" connections in the pool. Use a negative value to indicate an unlimited number of idle connections.
      max-wait: -1 # Maximum amount of time (in milliseconds) a connection allocation should block before throwing an exception when the pool is exhausted. Use a negative value to block indefinitely.
      min-idle: 1 # Target for the minimum number of idle connections to maintain in the pool. This settings only has an effect if it is positive.
      min-idle: 1 # Target for the minimum number of idle connections to maintain in the pool.This settings only has an effect if it is positive.
  http:
    multipart:
      maxFileSize: 100Mb
      maxRequestSize: 1000Mb
hystrix:
  command:
@ -39,6 +45,8 @@ hystrix:
          thread:
            timeoutInMilliseconds: 4800000
#Ribbon
ribbon:
  ReadTimeout: 600000

+ 33 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/open/nologin/ServiceNoLoginEndPoint.java

@ -23,7 +23,10 @@ import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;
@ -245,4 +248,34 @@ public class ServiceNoLoginEndPoint extends EnvelopRestEndpoint {
        return success(deviceService.getDeviceList());
    }
    @RequestMapping("/fileUpload")
    @ApiOperation("文件上传")
    public String handleFileUpload(@RequestParam("file") MultipartFile file) {
        if (file.isEmpty()) {
            return "文件为空";
        }
        // 获取文件名
        String fileName = file.getOriginalFilename();
        System.out.println("上传的文件名为:" + fileName);
        // 获取文件的后缀名
        String suffixName = fileName.substring(fileName.lastIndexOf("."));
        System.out.println("上传的后缀名为:" + suffixName);
        // 文件上传后的路径
        String filePath = "/data/";
        File dest = new File(filePath + fileName);
        // 检测是否存在目录
        if (!dest.getParentFile().exists()) {
            dest.getParentFile().mkdirs();
        }
        try {
            file.transferTo(dest);
            return "上传成功";
        } catch (IllegalStateException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return "上传失败";
    }
}

+ 4 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicineServive.java

@ -11,6 +11,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -25,6 +26,8 @@ public class MedicineServive {
    private HttpClientUtil httpClientUtil;
    @Autowired
    private MediicinedrugsDao mediicinedrugsDao;
    @Value("${medicine.socketUrl}")
    private String socketUrl;
    public void getOrgPhysicDict(String orgCode, String name, String orgName, String physicCode) {
@ -108,7 +111,7 @@ public class MedicineServive {
        param += "?temperatureControl=" + temperatureControl;
        param += "?humidityControl=" + humidityControl;
        param += "?heat=" + heat;
        String res = httpClientUtil.get("http://yik.ab-inbev.vip/c/upws/send"+param,"utf-8");
        String res = httpClientUtil.get(socketUrl+param,"utf-8");
       System.out.println(res);
        /* if (StringUtils.isNoneBlank(res)){
            object =JSONObject.parseObject(res);

+ 7 - 1
svr/svr-base/src/main/resources/application.yml

@ -182,6 +182,9 @@ testPattern:
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
im:
  im_list_get: http://172.26.0.105:3000/
medicine:
  socketUrl: http://yik.ab-inbev.vip/c/upws/send
---
spring:
  profiles: iottest
@ -782,4 +785,7 @@ testPattern: #文件服务器上传配置 0本地,1.I健康,2.内网调用
  sign: 1
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
im:
  im_list_get: http://127.0.0.1:3000/
  im_list_get: http://127.0.0.1:3000/
medicine:
  socketUrl: https://zb.xmtyw.cn/cabinet/medicine/upws/send