提交 269eac37 authored 作者: 李炎's avatar 李炎

优化

上级 cb8ecb19
...@@ -21,14 +21,14 @@ public class DownloadController { ...@@ -21,14 +21,14 @@ public class DownloadController {
@RequestMapping("download") @RequestMapping("download")
public ResponseEntity<byte[]> download(HttpServletRequest request) throws IOException { public ResponseEntity<byte[]> download(HttpServletRequest request) throws IOException {
//读取文件 //读取文件
File file = new File("D:/test/DEMO.apk"); File file = new File("storage/DEMO.apk");
byte[] body = null; byte[] body = null;
InputStream is = new FileInputStream(file); InputStream is = new FileInputStream(file);
body = new byte[is.available()]; body = new byte[is.available()];
is.read(body); is.read(body);
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
//设置文件头 //设置文件头
headers.add("Content-Disposition", "attchement;filename=" + new String("火影2.jpg".getBytes("gb2312"), "ISO8859-1")); headers.add("Content-Disposition", "attchement;filename=" + new String("火影2.apk".getBytes("gb2312"), "ISO8859-1"));
HttpStatus statusCode = HttpStatus.OK; HttpStatus statusCode = HttpStatus.OK;
ResponseEntity<byte[]> entity = new ResponseEntity<byte[]>(body, headers, statusCode); ResponseEntity<byte[]> entity = new ResponseEntity<byte[]>(body, headers, statusCode);
return entity; return entity;
......
...@@ -16,6 +16,7 @@ import java.util.Map; ...@@ -16,6 +16,7 @@ import java.util.Map;
@Service @Service
public class GridErrorReturnProcessServiceImpl extends ServiceImpl<GridErrorReturnProcessMapper, GridErrorReturnProcess> implements GridErrorReturnProcessService { public class GridErrorReturnProcessServiceImpl extends ServiceImpl<GridErrorReturnProcessMapper, GridErrorReturnProcess> implements GridErrorReturnProcessService {
public Map<Boolean, String> setGridError(JSONObject jsonObject, String requestJson, Integer BusinessNo) throws ParseException { public Map<Boolean, String> setGridError(JSONObject jsonObject, String requestJson, Integer BusinessNo) throws ParseException {
Boolean complent = true; Boolean complent = true;
Map<Boolean, String> save = new HashMap<>(); Map<Boolean, String> save = new HashMap<>();
......
...@@ -86,6 +86,7 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P ...@@ -86,6 +86,7 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P
JSONObject resultValue = JSONObject.fromObject(jsonObject.get("resultValue")); JSONObject resultValue = JSONObject.fromObject(jsonObject.get("resultValue"));
Object data = resultValue.get("data");//获取返回数据的 data对象 Object data = resultValue.get("data");//获取返回数据的 data对象
List<Map<String, Object>> list = com.alibaba.fastjson.JSONObject.parseObject(data.toString(), List.class);//格式转换 List<Map<String, Object>> list = com.alibaba.fastjson.JSONObject.parseObject(data.toString(), List.class);//格式转换
if (list == null && list.size() == 0) return false;
//记录请求国网的返回信息 //记录请求国网的返回信息
Map<Boolean, String> booleanStringMap = gridErrorService.setGridError(jsonObject, JsonUtil.Mapjson(map), BusinessNo); Map<Boolean, String> booleanStringMap = gridErrorService.setGridError(jsonObject, JsonUtil.Mapjson(map), BusinessNo);
String ReturnProcessId = null; String ReturnProcessId = null;
......
...@@ -36,6 +36,7 @@ public class WebApiLog { ...@@ -36,6 +36,7 @@ public class WebApiLog {
kingdeeJournal.setResponse(JsonUtil.Listjson(setResponse)); kingdeeJournal.setResponse(JsonUtil.Listjson(setResponse));
kingdeeJournal.setBusinessNo(businessNo); kingdeeJournal.setBusinessNo(businessNo);
kingdeeJournal.setCreatetime(new Date()); kingdeeJournal.setCreatetime(new Date());
if (setResponse == null && setResponse.size() == 0) return false;
if (setResponse.size() == 1 && setResponse.get(0).size() == 1 && JSONObject.fromObject(setResponse.get(0)).get("Result") != null) {//判断请求是否错误 if (setResponse.size() == 1 && setResponse.get(0).size() == 1 && JSONObject.fromObject(setResponse.get(0)).get("Result") != null) {//判断请求是否错误
kingdeeJournal.setSynchronization(0); kingdeeJournal.setSynchronization(0);
ny = false; ny = false;
...@@ -44,6 +45,7 @@ public class WebApiLog { ...@@ -44,6 +45,7 @@ public class WebApiLog {
ny = true; ny = true;
} }
WebApiLog.uploadRooms.kingdeeJournalService.save(kingdeeJournal);// WebApiLog.uploadRooms.kingdeeJournalService.save(kingdeeJournal);//
return ny; return ny;
} }
......
server: server:
localip: www.lingqingkeji.com localip: 119.29.114.197
port: 8081 port: 8081
tomcat: tomcat:
max-swallow-size: -1 max-swallow-size: -1
......
...@@ -20,10 +20,10 @@ import java.util.*; ...@@ -20,10 +20,10 @@ import java.util.*;
@Slf4j @Slf4j
@EnableScheduling @EnableScheduling
public class SecurityToolsTest { public class SecurityToolsTest {
static String K3CloudURL = "http://1ar8696937.iok.la/k3cloud/";//指定地址 static String K3CloudURL = "http://192.168.2.243/k3cloud/";//指定地址
static String dbId = "60ef9f7f48f36d"; static String dbId = "608102e4df263c";
static String uid = "Administrator"; static String uid = "Administrator";
static String pwd = "Kingdee$2021"; static String pwd = "888888";
static int lang = 2052; static int lang = 2052;
K3CloudApiClient client = new K3CloudApiClient(K3CloudURL); K3CloudApiClient client = new K3CloudApiClient(K3CloudURL);
@Test @Test
...@@ -132,15 +132,13 @@ public class SecurityToolsTest { ...@@ -132,15 +132,13 @@ public class SecurityToolsTest {
@Test @Test
// @Scheduled(fixedDelay = 5000) // @Scheduled(fixedDelay = 5000)
public void timdsaded() { public void timdsaded() {
String sFormId = "PRD_INSTOCK"; String sFormId = "BD_Customer";
log.info("123"); log.info("123");
List<List<Object>> list = null; List<List<Object>> list = null;
try { try {
Boolean result = client.login(dbId, uid, pwd, lang); Boolean result = client.login(dbId, uid, pwd, lang);
if(result){ if(result){
String content=""; String content="";
List<List<Object>> lists = client.executeBillQuery(content); List<List<Object>> lists = client.executeBillQuery(content);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论