|
|
@@ -1,6 +1,7 @@
|
|
|
package com.java110.core.smo.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.java110.core.context.Environment;
|
|
|
import com.java110.core.context.IPageData;
|
|
|
import com.java110.core.context.PageData;
|
|
|
import com.java110.core.factory.CallApiServiceFactory;
|
|
|
@@ -9,6 +10,7 @@ import com.java110.dto.app.AppDto;
|
|
|
import com.java110.dto.assetImportLog.AssetImportLogDto;
|
|
|
import com.java110.intf.common.ITransactionLogInnerServiceSMO;
|
|
|
import com.java110.po.transactionLog.TransactionLogPo;
|
|
|
+import com.java110.utils.factory.ApplicationContextFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpMethod;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
@@ -32,6 +34,9 @@ public class SaveTransactionLogSMOImpl implements ISaveTransactionLogSMO {
|
|
|
@Autowired(required = false)
|
|
|
private RestTemplate restTemplate;
|
|
|
|
|
|
+ @Autowired(required = false)
|
|
|
+ private RestTemplate outRestTemplate;
|
|
|
+
|
|
|
@Override
|
|
|
@Async
|
|
|
public void saveLog(TransactionLogPo transactionLogPo) {
|
|
|
@@ -41,11 +46,17 @@ public class SaveTransactionLogSMOImpl implements ISaveTransactionLogSMO {
|
|
|
@Override
|
|
|
@Async
|
|
|
public void saveAssetImportLog(AssetImportLogDto assetImportLogDto) {
|
|
|
+
|
|
|
String apiUrl = "http://api-service/api/assetImportLog/saveAssetImportLog";
|
|
|
+ RestTemplate tmpRestTemplate = restTemplate;
|
|
|
+ if (Environment.isStartBootWay()) {
|
|
|
+ apiUrl = "http://127.0.0.1:8008/api/assetImportLog/saveAssetImportLog";
|
|
|
+ tmpRestTemplate = outRestTemplate;
|
|
|
+ }
|
|
|
IPageData newPd = PageData.newInstance().builder("-1", "批量日志", "", "",
|
|
|
"", "", apiUrl, "",
|
|
|
AppDto.WEB_APP_ID);
|
|
|
|
|
|
- CallApiServiceFactory.callCenterService(restTemplate, newPd, JSONObject.toJSONString(assetImportLogDto), apiUrl, HttpMethod.POST);
|
|
|
+ CallApiServiceFactory.callCenterService(tmpRestTemplate, newPd, JSONObject.toJSONString(assetImportLogDto), apiUrl, HttpMethod.POST);
|
|
|
}
|
|
|
}
|