|
@@ -11,6 +11,7 @@ import com.steerinfo.dil.service.ITmstruckLeaveFactoryResultService;
|
|
|
import com.steerinfo.dil.util.DataChange;
|
|
|
import com.steerinfo.dil.util.HTTPRequestUtils;
|
|
|
import com.steerinfo.dil.util.getRequestUtils;
|
|
|
+import com.steerinfo.dil.util.newFileTool;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -650,8 +651,37 @@ public class TmstruckLeaveFactoryResultServiceImpl implements ITmstruckLeaveFact
|
|
|
Map<String,Object> jsonObject = new HashMap<>();
|
|
|
jsonObject.remove(token);
|
|
|
jsonObject.putAll(map);
|
|
|
+ //写入文件
|
|
|
+ try{
|
|
|
+ new Thread( new Runnable() {
|
|
|
+ public void run(){
|
|
|
+ try {
|
|
|
+ newFileTool.newFile("发送报文:"+chengJiaSendUrl+":"+jsonObject,"城嘉库报文");
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).start();
|
|
|
+ }catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
String jsonData = null;
|
|
|
jsonData = getRequestUtils.doPostAddHeader(chengJiaSendUrl, jsonObject,token);
|
|
|
+ //写入文件
|
|
|
+ try{
|
|
|
+ String finalJsonData = jsonData;
|
|
|
+ new Thread(new Runnable() {
|
|
|
+ public void run(){
|
|
|
+ try {
|
|
|
+ newFileTool.newFile("接收报文:"+chengJiaSendUrl+":"+ finalJsonData,"城嘉库报文");
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).start();
|
|
|
+ }catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
if(!"null".equals(jsonData)){
|
|
|
System.out.println(jsonData);
|
|
|
HashMap hashMap = JSON.parseObject(jsonData, HashMap.class);
|
|
@@ -675,11 +705,40 @@ public class TmstruckLeaveFactoryResultServiceImpl implements ITmstruckLeaveFact
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.putAll(map);
|
|
|
String jsonData = null;
|
|
|
+ //写入文件
|
|
|
+ try{
|
|
|
+ new Thread( new Runnable() {
|
|
|
+ public void run(){
|
|
|
+ try {
|
|
|
+ newFileTool.newFile("发送报文:"+guoYuanUrl+":"+jsonObject.toJSONString(),"果园库报文");
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).start();
|
|
|
+ }catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
try {
|
|
|
jsonData = HTTPRequestUtils.send(guoYuanUrl, jsonObject, "utf-8");
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
+ //写入文件
|
|
|
+ try{
|
|
|
+ String finalJsonData = jsonData;
|
|
|
+ new Thread(new Runnable() {
|
|
|
+ public void run(){
|
|
|
+ try {
|
|
|
+ newFileTool.newFile("接收报文:"+guoYuanUrl+":"+ finalJsonData,"果园库报文");
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).start();
|
|
|
+ }catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
if(!"null".equals(jsonData)){
|
|
|
System.out.println(jsonData);
|
|
|
try{
|