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

优化

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