Commit c088d334 authored by Quxl's avatar Quxl

x

parent 1b5e3f59
package com.egolm.sso; package com.egolm.sso;
import java.util.TimeZone;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
...@@ -14,6 +16,8 @@ public class SapServiceApplication { ...@@ -14,6 +16,8 @@ public class SapServiceApplication {
private static ApplicationContext applicationContext; private static ApplicationContext applicationContext;
public static void main(String[] args) { public static void main(String[] args) {
TimeZone.setDefault(TimeZone.getTimeZone("GMT+8"));
System.out.println(TimeZone.getDefault());
applicationContext = SpringApplication.run(SapServiceApplication.class, args); applicationContext = SpringApplication.run(SapServiceApplication.class, args);
} }
......
...@@ -3,8 +3,13 @@ package com.egolm.sso.services.confirm_quotation; ...@@ -3,8 +3,13 @@ package com.egolm.sso.services.confirm_quotation;
import javax.jws.WebMethod; import javax.jws.WebMethod;
import javax.jws.WebService; import javax.jws.WebService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@WebService(targetNamespace = "http://confirm_quotation.sso.egolm.com") @WebService(targetNamespace = "http://confirm_quotation.sso.egolm.com")
public interface ConfirmQuotationService { public interface ConfirmQuotationService {
Log logger = LogFactory.getLog(ConfirmQuotationService.class);
@WebMethod @WebMethod
public void execute(Z_MT_SD_008_SO_CONFIRM_QUOTATION Z_MT_SD_008_SO_CONFIRM_QUOTATION); public void execute(Z_MT_SD_008_SO_CONFIRM_QUOTATION Z_MT_SD_008_SO_CONFIRM_QUOTATION);
......
...@@ -170,7 +170,7 @@ public class ConfirmQuotationServiceImpl implements ConfirmQuotationService { ...@@ -170,7 +170,7 @@ public class ConfirmQuotationServiceImpl implements ConfirmQuotationService {
common.saveApiAccessLog("execute", "/confirm_quotation", "SUCCESS"); common.saveApiAccessLog("execute", "/confirm_quotation", "SUCCESS");
common.saveOrderTracking(TRACE_NO, "SoConfirmQuotation", VBELN, KUNNR, "U", "SUCCESS", null); common.saveOrderTracking(TRACE_NO, "SoConfirmQuotation", VBELN, KUNNR, "U", "SUCCESS", null);
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); logger.error(timeString, e);
} }
} catch (Exception e) { } catch (Exception e) {
isSuccess = false; isSuccess = false;
...@@ -178,7 +178,7 @@ public class ConfirmQuotationServiceImpl implements ConfirmQuotationService { ...@@ -178,7 +178,7 @@ public class ConfirmQuotationServiceImpl implements ConfirmQuotationService {
common.saveApiAccessLog("execute", "/confirm_quotation", "ERROR"); common.saveApiAccessLog("execute", "/confirm_quotation", "ERROR");
common.saveOrderTracking(TRACE_NO, "SoConfirmQuotation", VBELN, KUNNR, "U", "ERROR", ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString); common.saveOrderTracking(TRACE_NO, "SoConfirmQuotation", VBELN, KUNNR, "U", "ERROR", ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString);
} catch (Throwable e1) { } catch (Throwable e1) {
e1.printStackTrace(); logger.error(timeString, e1);
} }
throw new XRException(ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString, e); throw new XRException(ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString, e);
} finally { } finally {
......
...@@ -3,9 +3,14 @@ package com.egolm.sso.services.dn_deletion; ...@@ -3,9 +3,14 @@ package com.egolm.sso.services.dn_deletion;
import javax.jws.WebMethod; import javax.jws.WebMethod;
import javax.jws.WebService; import javax.jws.WebService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@WebService(targetNamespace = "http://dn_deletion.sso.egolm.com") @WebService(targetNamespace = "http://dn_deletion.sso.egolm.com")
public interface DNDeletionService { public interface DNDeletionService {
Log logger = LogFactory.getLog(DNDeletionService.class);
@WebMethod @WebMethod
public void execute(DELETED_DOCUMENTS DELETED_DOCUMENTS); public void execute(DELETED_DOCUMENTS DELETED_DOCUMENTS);
......
...@@ -79,7 +79,7 @@ public class DNDeletionServiceImpl implements DNDeletionService { ...@@ -79,7 +79,7 @@ public class DNDeletionServiceImpl implements DNDeletionService {
common.saveApiAccessLog("execute", "/dn_deletion", "SUCCESS"); common.saveApiAccessLog("execute", "/dn_deletion", "SUCCESS");
common.saveOrderTracking(TRACE_NO, "SODNDeletion", null, SOLD_TO, "U", "SUCCESS", null); common.saveOrderTracking(TRACE_NO, "SODNDeletion", null, SOLD_TO, "U", "SUCCESS", null);
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); logger.error(timeString, e);
} }
} catch (Exception e) { } catch (Exception e) {
isSuccess = false; isSuccess = false;
...@@ -87,7 +87,7 @@ public class DNDeletionServiceImpl implements DNDeletionService { ...@@ -87,7 +87,7 @@ public class DNDeletionServiceImpl implements DNDeletionService {
common.saveApiAccessLog("execute", "/dn_deletion", "ERROR"); common.saveApiAccessLog("execute", "/dn_deletion", "ERROR");
common.saveOrderTracking(TRACE_NO, "SODNDeletion", null, SOLD_TO, "U", "ERROR", ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString); common.saveOrderTracking(TRACE_NO, "SODNDeletion", null, SOLD_TO, "U", "ERROR", ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString);
} catch (Throwable e1) { } catch (Throwable e1) {
e1.printStackTrace(); logger.error(timeString, e1);
} }
throw new XRException(ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString, e); throw new XRException(ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString, e);
} finally { } finally {
......
...@@ -3,9 +3,14 @@ package com.egolm.sso.services.material_master; ...@@ -3,9 +3,14 @@ package com.egolm.sso.services.material_master;
import javax.jws.WebMethod; import javax.jws.WebMethod;
import javax.jws.WebService; import javax.jws.WebService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@WebService(targetNamespace = "http://material_master.sso.egolm.com") @WebService(targetNamespace = "http://material_master.sso.egolm.com")
public interface MaterialMasterService { public interface MaterialMasterService {
Log logger = LogFactory.getLog(MaterialMasterService.class);
@WebMethod @WebMethod
public void execute(Z_MT_SD_001_MATERIAL_MASTER Z_MT_SD_001_MATERIAL_MASTER); public void execute(Z_MT_SD_001_MATERIAL_MASTER Z_MT_SD_001_MATERIAL_MASTER);
......
...@@ -126,7 +126,7 @@ public class MaterialMasterServiceImpl implements MaterialMasterService { ...@@ -126,7 +126,7 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
common.saveApiAccessLog("execute", "/material_master", "SUCCESS"); common.saveApiAccessLog("execute", "/material_master", "SUCCESS");
common.saveOrderTracking(TRACE_NO, "MaterialMaster", null, DIS_CODE, "U", "SUCCESS", null); common.saveOrderTracking(TRACE_NO, "MaterialMaster", null, DIS_CODE, "U", "SUCCESS", null);
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); logger.error(timeString, e);
} }
} catch (Exception e) { } catch (Exception e) {
isSuccess = false; isSuccess = false;
...@@ -134,7 +134,7 @@ public class MaterialMasterServiceImpl implements MaterialMasterService { ...@@ -134,7 +134,7 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
common.saveApiAccessLog("execute", "/material_master", "ERROR"); common.saveApiAccessLog("execute", "/material_master", "ERROR");
common.saveOrderTracking(TRACE_NO, "MaterialMaster", null, DIS_CODE, "U", "ERROR", ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString); common.saveOrderTracking(TRACE_NO, "MaterialMaster", null, DIS_CODE, "U", "ERROR", ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString);
} catch (Throwable e1) { } catch (Throwable e1) {
e1.printStackTrace(); logger.error(timeString, e1);
} }
throw new XRException(ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString, e); throw new XRException(ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString, e);
} finally { } finally {
......
...@@ -3,9 +3,14 @@ package com.egolm.sso.services.prforma_invoice; ...@@ -3,9 +3,14 @@ package com.egolm.sso.services.prforma_invoice;
import javax.jws.WebMethod; import javax.jws.WebMethod;
import javax.jws.WebService; import javax.jws.WebService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@WebService(targetNamespace = "http://prforma_invoice.sso.egolm.com") @WebService(targetNamespace = "http://prforma_invoice.sso.egolm.com")
public interface PrformaInvoiceService { public interface PrformaInvoiceService {
Log logger = LogFactory.getLog(PrformaInvoiceService.class);
@WebMethod @WebMethod
public void execute(Z_MT_SD_005_PERFORM_INVOICE Z_MT_SD_005_PERFORM_INVOICE); public void execute(Z_MT_SD_005_PERFORM_INVOICE Z_MT_SD_005_PERFORM_INVOICE);
......
...@@ -253,7 +253,7 @@ public class PrformaInvoiceServiceImpl implements PrformaInvoiceService { ...@@ -253,7 +253,7 @@ public class PrformaInvoiceServiceImpl implements PrformaInvoiceService {
common.saveApiAccessLog("execute", "/prforma_invoice", "SUCCESS"); common.saveApiAccessLog("execute", "/prforma_invoice", "SUCCESS");
common.saveOrderTracking(TRACE_NO, "ProFormaInvoice", null, BATCH_CODE, "U", "SUCCESS", null); common.saveOrderTracking(TRACE_NO, "ProFormaInvoice", null, BATCH_CODE, "U", "SUCCESS", null);
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); logger.error(timeString, e);
} }
} catch (Exception e) { } catch (Exception e) {
isSuccess = false; isSuccess = false;
...@@ -261,7 +261,7 @@ public class PrformaInvoiceServiceImpl implements PrformaInvoiceService { ...@@ -261,7 +261,7 @@ public class PrformaInvoiceServiceImpl implements PrformaInvoiceService {
common.saveApiAccessLog("execute", "/prforma_invoice", "ERROR"); common.saveApiAccessLog("execute", "/prforma_invoice", "ERROR");
common.saveOrderTracking(TRACE_NO, "ProFormaInvoice", null, BATCH_CODE, "U", "ERROR", ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString); common.saveOrderTracking(TRACE_NO, "ProFormaInvoice", null, BATCH_CODE, "U", "ERROR", ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString);
} catch (Throwable e1) { } catch (Throwable e1) {
e1.printStackTrace(); logger.error(timeString, e1);
} }
throw new XRException(ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString, e); throw new XRException(ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString, e);
} finally { } finally {
......
...@@ -3,9 +3,14 @@ package com.egolm.sso.services.price_list; ...@@ -3,9 +3,14 @@ package com.egolm.sso.services.price_list;
import javax.jws.WebMethod; import javax.jws.WebMethod;
import javax.jws.WebService; import javax.jws.WebService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@WebService(targetNamespace = "http://price_list.sso.egolm.com") @WebService(targetNamespace = "http://price_list.sso.egolm.com")
public interface PriceListService { public interface PriceListService {
Log logger = LogFactory.getLog(PriceListService.class);
@WebMethod @WebMethod
public void execute(Z_MT_SD_002_PRICE_LIST Z_MT_SD_002_PRICE_LIST); public void execute(Z_MT_SD_002_PRICE_LIST Z_MT_SD_002_PRICE_LIST);
......
...@@ -109,7 +109,7 @@ public class PriceListServiceImpl implements PriceListService { ...@@ -109,7 +109,7 @@ public class PriceListServiceImpl implements PriceListService {
common.saveApiAccessLog("execute", "/price_list", "SUCCESS"); common.saveApiAccessLog("execute", "/price_list", "SUCCESS");
common.saveOrderTracking(TRACE_NO, "PriceList", null, KUNNR, "U", "SUCCESS", null); common.saveOrderTracking(TRACE_NO, "PriceList", null, KUNNR, "U", "SUCCESS", null);
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); logger.error(timeString, e);
} }
} catch (Exception e) { } catch (Exception e) {
isSuccess = false; isSuccess = false;
...@@ -117,7 +117,7 @@ public class PriceListServiceImpl implements PriceListService { ...@@ -117,7 +117,7 @@ public class PriceListServiceImpl implements PriceListService {
common.saveApiAccessLog("execute", "/price_list", "ERROR"); common.saveApiAccessLog("execute", "/price_list", "ERROR");
common.saveOrderTracking(TRACE_NO, "PriceList", null, KUNNR, "U", "ERROR", ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString); common.saveOrderTracking(TRACE_NO, "PriceList", null, KUNNR, "U", "ERROR", ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString);
} catch (Throwable e1) { } catch (Throwable e1) {
e1.printStackTrace(); logger.error(timeString, e1);
} }
throw new XRException(ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString, e); throw new XRException(ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString, e);
} finally { } finally {
......
...@@ -3,9 +3,14 @@ package com.egolm.sso.services.shipping_notfirmation; ...@@ -3,9 +3,14 @@ package com.egolm.sso.services.shipping_notfirmation;
import javax.jws.WebMethod; import javax.jws.WebMethod;
import javax.jws.WebService; import javax.jws.WebService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@WebService(targetNamespace = "http://shipping_notfirmation.sso.egolm.com") @WebService(targetNamespace = "http://shipping_notfirmation.sso.egolm.com")
public interface ShippingNotificationService { public interface ShippingNotificationService {
Log logger = LogFactory.getLog(ShippingNotificationService.class);
@WebMethod @WebMethod
public void execute(Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE); public void execute(Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE);
......
...@@ -178,7 +178,7 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ ...@@ -178,7 +178,7 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ
common.saveApiAccessLog("execute", "/shipping_notfirmation", "SUCCESS"); common.saveApiAccessLog("execute", "/shipping_notfirmation", "SUCCESS");
common.saveOrderTracking(TRACE_NO, "ShippingNotification", null, BATCH_CODE, "U", "SUCCESS", null); common.saveOrderTracking(TRACE_NO, "ShippingNotification", null, BATCH_CODE, "U", "SUCCESS", null);
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); logger.error(timeString, e);
} }
} catch (Exception e) { } catch (Exception e) {
isSuccess = false; isSuccess = false;
...@@ -186,7 +186,7 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ ...@@ -186,7 +186,7 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ
common.saveApiAccessLog("execute", "/shipping_notfirmation", "ERROR"); common.saveApiAccessLog("execute", "/shipping_notfirmation", "ERROR");
common.saveOrderTracking(TRACE_NO, "ShippingNotification", null, BATCH_CODE, "U", "ERROR", ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString); common.saveOrderTracking(TRACE_NO, "ShippingNotification", null, BATCH_CODE, "U", "ERROR", ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString);
} catch (Throwable e1) { } catch (Throwable e1) {
e1.printStackTrace(); logger.error(timeString, e1);
} }
throw new XRException(ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString, e); throw new XRException(ThrowableUtil.getCaused(e).getMessage() + " -- " + timeString, e);
} finally { } finally {
......
...@@ -30,12 +30,12 @@ public class DateUtil { ...@@ -30,12 +30,12 @@ public class DateUtil {
} }
} }
public static final DateFormat format_HHmmss = new SimpleDateFormat("HHmmss");
public static Date parseTime_HHmmss(String timeString) { public static Date parseTime_HHmmss(String timeString) {
if (timeString == null || timeString.trim().length() == 0) { if (timeString == null || timeString.trim().length() == 0) {
return null; return null;
} else { } else {
try { try {
DateFormat format_HHmmss = new SimpleDateFormat("HHmmss");
return format_HHmmss.parse(timeString); return format_HHmmss.parse(timeString);
} catch (Throwable e) { } catch (Throwable e) {
throw new XRException("Error time value " + timeString, e); throw new XRException("Error time value " + timeString, e);
......
...@@ -7,11 +7,11 @@ schneider: ...@@ -7,11 +7,11 @@ schneider:
cronSap009: 0 0 0 * * ? cronSap009: 0 0 0 * * ?
dataTracking: dataTracking:
isOpen: false isOpen: false
tokenExpireMinute: 30 tokenExpireMinute: 60
appId: schneider appId: schneider-api
appSecret: SGVsbG8yQ2xpZW50IQ== appSecret: SGVsbG8yQ2xpZW50IQ
username: schneider username: trance
baseUrl: http://xxx baseUrl: http://10.204.15.3:8083/uat/etc/schneider-api
uri: uri:
token: /v1/token token: /v1/token
insertOrderTracking: /v1/insertOrderTracking insertOrderTracking: /v1/insertOrderTracking
......
...@@ -12,7 +12,6 @@ public class MaterialMasterServiceTest { ...@@ -12,7 +12,6 @@ public class MaterialMasterServiceTest {
// String wsdlLocation = "http://localhost:8080/api/services/material_master?wsdl"; // String wsdlLocation = "http://localhost:8080/api/services/material_master?wsdl";
String namespace = "http://material_master.sso.egolm.com"; String namespace = "http://material_master.sso.egolm.com";
String serviceName = "MaterialMasterService"; String serviceName = "MaterialMasterService";
//MaterialMasterService service = ServiceFactory.create(MaterialMasterService.class, wsdlLocation, namespace, serviceName, "test", "78258c537d6e4d5fb210a57d05619fb6", PasswordType.PasswordText);
MaterialMasterService service = ServiceFactory.create(MaterialMasterService.class, wsdlLocation, namespace, serviceName); MaterialMasterService service = ServiceFactory.create(MaterialMasterService.class, wsdlLocation, namespace, serviceName);
//String XML = StringUtil.readText("C:\\Users\\Quxl\\Desktop\\SSP3A250F7R.xml"); //String XML = StringUtil.readText("C:\\Users\\Quxl\\Desktop\\SSP3A250F7R.xml");
//String XML = StringUtil.readText("D:/data/sso/001.XML"); //String XML = StringUtil.readText("D:/data/sso/001.XML");
......
package test;
import java.util.Date;
import java.util.TimeZone;
import com.egolm.sso.util.DateUtil;
public class Test {
public static void main(String[] args) {
TimeZone.setDefault(TimeZone.getTimeZone("GMT+8"));
System.out.println(TimeZone.getDefault());
System.out.println(DateUtil.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss"));
}
}
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