39 测试
This commit is contained in:
+43
-23
@@ -4,6 +4,8 @@ package com.adc.da.slrs.sarStandardsInfo.controller;
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.adc.da.Log.BusinessType;
|
||||
import com.adc.da.Log.EpcLog;
|
||||
import com.adc.da.att.service.IAttFileEOService;
|
||||
import com.adc.da.att.vo.AttFileVo;
|
||||
import com.adc.da.common.FileUnZip;
|
||||
import com.adc.da.common.ReadExcel;
|
||||
import com.adc.da.exception.AdcDaBaseException;
|
||||
@@ -95,6 +97,9 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
|
||||
@Autowired
|
||||
ISarLawsInfoService sarLawsInfoEOService;
|
||||
|
||||
@Autowired
|
||||
IAttFileEOService iAttFileEOService;
|
||||
|
||||
// @ApiOperation(value="SarStandardsInfoEO|反向标准操作")
|
||||
// @GetMapping(value = "/reverseQueryStand")
|
||||
// public void reverseQueryStand(@RequestParam(name="ids",required=true) String ids, String standName, String type) {
|
||||
@@ -1074,36 +1079,37 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
|
||||
//String url = "http://47.92.92.38:8103/url-to-example-document.docx";
|
||||
// String url = "http://47.92.92.38:8103/7.2.1-34/downloadas";
|
||||
String url = "";
|
||||
//"url": "https://127.0.0.1/document/example.docx"
|
||||
|
||||
if(urlInfo.equals("1")){
|
||||
url = "http://39.98.140.126:8889/7.2.1-34/ConvertService.ashx";
|
||||
}
|
||||
if(urlInfo.equals("11")){
|
||||
url = "https://39.98.140.126:8889/7.2.1-34/ConvertService.ashx";
|
||||
url = "http://47.92.92.38:8103/7.2.1-34/ConvertService.ashx";
|
||||
}
|
||||
if(urlInfo.equals("2")){
|
||||
url = "http://39.98.140.126:8889/url-to-example-document.docx";
|
||||
}
|
||||
if(urlInfo.equals("22")){
|
||||
url = "http://39.98.140.126:8889/7.2.1-34/url-to-example-document.docx";
|
||||
}
|
||||
if(urlInfo.equals("222")){
|
||||
url = "https://39.98.140.126:8889/url-to-example-document.docx";
|
||||
}
|
||||
if(urlInfo.equals("2222")){
|
||||
url = "https://39.98.140.126:8889/7.2.1-34/url-to-example-document.docx";
|
||||
url = "http://39.98.140.126:8889/7.2.1-34/ConvertService.ashx";
|
||||
}
|
||||
if(urlInfo.equals("3")){
|
||||
url = "https://39.98.140.126:8889/url-to-example-document.docx";
|
||||
url = "http://10.100.5.116:8088//7.2.1-34/ConvertService.ashx";
|
||||
}
|
||||
|
||||
if(urlInfo.equals("11")){
|
||||
url = "http://47.92.92.38:8103/7.2.1-34/document/example.docx";
|
||||
}
|
||||
if(urlInfo.equals("22")){
|
||||
url = "http://39.98.140.126:8889/7.2.1-34/document/example.docx";
|
||||
}
|
||||
if(urlInfo.equals("33")){
|
||||
url = "http://39.98.140.126:8889/url-to-example-document.docx";
|
||||
url = "http://10.100.5.116:8088//7.2.1-34/document/example.docx";
|
||||
}
|
||||
if(urlInfo.equals("111")){
|
||||
url = "http://47.92.92.38:8103/document/example.docx";
|
||||
}
|
||||
if(urlInfo.equals("222")){
|
||||
url = "http://39.98.140.126:8889/document/example.docx";
|
||||
}
|
||||
if(urlInfo.equals("333")){
|
||||
url = "http://39.98.140.126:8889/7.2.1-34/url-to-example-document.docx";
|
||||
}
|
||||
if(urlInfo.equals("3333")){
|
||||
url = "https://39.98.140.126:8889/7.2.1-34/url-to-example-document.docx";
|
||||
url = "http://10.100.5.116:8088/document/example.docx";
|
||||
}
|
||||
|
||||
//HttpGet httpGet=new HttpGet(url);
|
||||
HttpPost httpPost=new HttpPost(url);
|
||||
JSONObject jsonObject = null;
|
||||
@@ -1113,10 +1119,24 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
|
||||
HttpResponse res = client.execute(httpPost);
|
||||
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
|
||||
// 返回json格式:
|
||||
final String s = EntityUtils.toString(res.getEntity());
|
||||
jsonObject = JSONObject.parseObject(EntityUtils.toString(res.getEntity()));
|
||||
jsonObject.get("fileUrl");
|
||||
|
||||
Object fileUrl = jsonObject.get("fileUrl");
|
||||
logger.info("==============================================================="+jsonObject.toJSONString());
|
||||
if(fileUrl!=null){
|
||||
String urlStr = fileUrl.toString();
|
||||
if(StringUtils.isNotBlank(urlStr)){
|
||||
File file = new File(urlStr);
|
||||
if(file.exists()){
|
||||
AttFileVo attFileVo = iAttFileEOService.saveFileInfo(file);
|
||||
if(attFileVo!=null){
|
||||
logger.info("==============================================================="+attFileVo);
|
||||
}
|
||||
}else {
|
||||
logger.info("===============================================================路径"+urlStr);
|
||||
}
|
||||
}
|
||||
logger.info("==============================================================="+jsonObject.toJSONString());
|
||||
}
|
||||
System.out.println(jsonObject);
|
||||
}else {
|
||||
jsonObject.put("fileUrl","失败!!!!!!");
|
||||
|
||||
Reference in New Issue
Block a user