Commit 1d818538 authored by Quxl's avatar Quxl

x

parent dd12d377
......@@ -71,6 +71,8 @@ public class SI004INVENTORYSyncOutServiceTask {
private void sendData(SI004INVENTORYSyncOut SI004INVENTORYSyncOut) {
Date now = new Date();
String timeString = DateUtil.formatDate(now, "yyyyMMddHHmmssSSS");
String apiName = "SAP库存数据接口";
String apiPath = "/XISOAPAdapter/MessageServlet/si004INVENTORYSyncOut";
Page page = new Page(1L, 1000L, new String[] {"DIS_CODE", "INVENTORY_DATE"});
String sql = "SELECT * FROM t_dis_inventory WHERE SEND_STATUS = 'N'";
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
......@@ -118,6 +120,11 @@ public class SI004INVENTORYSyncOutServiceTask {
isSuccess = false;
throw new XRException(ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString, e);
} finally {
try {
common.saveApiAccessLog(apiName, apiPath, isSuccess ? "S" : "F");
} catch (Exception e1) {
logger.error(timeString, e1);
}
String xmlName = "004_INVENTORY";
try {
String xml = XMLUtil.toXml(mt004INVENTORY);
......
......@@ -71,6 +71,8 @@ public class SI011ACTUALSALESSyncOutServiceTask {
private void sendData(SI011ACTUALSALESSyncOut SI011ACTUALSALESSyncOut) {
Date now = new Date();
String timeString = DateUtil.formatDate(now, "yyyyMMddHHmmssSSS");
String apiName = "SAP库存数据接口";
String apiPath = "/XISOAPAdapter/MessageServlet/si011ACTUALSALESSyncOut";
Page page = new Page(1L, 1000L, new String[] {"DIS_CODE", "SALES_NO"});
String sql = "SELECT * FROM t_dis_sales WHERE SEND_STATUS = 'N'";
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
......@@ -123,8 +125,13 @@ public class SI011ACTUALSALESSyncOutServiceTask {
jdbcTemplate.update(updateSql, idList.toArray());
} catch (Throwable e) {
isSuccess = false;
e.printStackTrace();
throw new XRException(ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString, e);
} finally {
try {
common.saveApiAccessLog(apiName, apiPath, isSuccess ? "S" : "F");
} catch (Exception e1) {
logger.error(timeString, e1);
}
String xmlName = "011_ACTUAL_SALES";
try {
String xml = XMLUtil.toXml(mt011ACTUALSALES);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment