Commit 8b7c0f86 authored by Quxl's avatar Quxl

x

parent d94d6ff0
......@@ -4,3 +4,4 @@
/.project
/application.properties
/bin/
/logs/
package com.schneider_distributor;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.SimpleDateFormat;
......@@ -8,7 +9,7 @@ import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.system.ApplicationHome;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
......@@ -22,16 +23,18 @@ public class ZMISD009SOCREATIONTask {
@Autowired
private JdbcTemplate jdbcTemplate;
@Value("${SAP.NO009.WSDL}")
private String wsdlLocaltion;
@Scheduled(cron="${SAP.NO009.CRON}")
public void execute() throws Exception {
this.runTask();
}
public void runTask() throws MalformedURLException {
ZMISD009SOCREATIONService service = new ZMISD009SOCREATIONService(new URL(wsdlLocaltion));
ApplicationHome home = new ApplicationHome(getClass());
File jarFile = home.getSource();
File folder = jarFile.getParentFile();
String absolutePath = folder.getAbsolutePath();
String wsdlLocation = "file:///" + absolutePath + "/WSDL/Z_MI_SD_009_SO_CREATION.wsdl";
ZMISD009SOCREATIONService service = new ZMISD009SOCREATIONService(new URL(wsdlLocation));
this.sendData(service.getZMISD009SOCREATIONPort());
}
......@@ -85,4 +88,12 @@ public class ZMISD009SOCREATIONTask {
}
}
}
public static void main(String[] args) {
String osName = System.getProperty("os.name");
if(osName.toLowerCase().contains("windows")) {
System.out.println(true);
}
System.out.println(osName);
}
}
......@@ -2,7 +2,6 @@ wsUsername: test
wsPassword: 78258c537d6e4d5fb210a57d05619fb6
SAP:
NO009:
WSDL: http://schneider-distributor.com/Z_MI_SD_009_SO_CREATION.wsdl
CRON: 0 0 0 * * ?
spring:
datasource:
......
......@@ -2,7 +2,6 @@ wsUsername: schneider
wsPassword: f14d4a80f823438a875b1924384c944c
SAP:
NO009:
WSDL: http://schneider-distributor.com/Z_MI_SD_009_SO_CREATION.wsdl
CRON: 0 0 0 * * ?
spring:
datasource:
......
......@@ -2,7 +2,6 @@ wsUsername: test
wsPassword: 78258c537d6e4d5fb210a57d05619fb6
SAP:
NO009:
WSDL: http://schneider-distributor.com/Z_MI_SD_009_SO_CREATION.wsdl
CRON: 0 0 0 * * ?
spring:
datasource:
......
package test;
import java.io.File;
import java.net.URL;
import org.springframework.boot.system.ApplicationHome;
import com.schneider_distributor.ZDTSD009SOCREATION;
import com.schneider_distributor.ZMISD009SOCREATION;
import com.schneider_distributor.ZMISD009SOCREATIONService;
public class OSCreationServiceTest {
public static void main(String[] args) {
ZMISD009SOCREATIONService service = new ZMISD009SOCREATIONService();
public static void main(String[] args) throws Exception {
ApplicationHome home = new ApplicationHome(OSCreationServiceTest.class);
File jarFile = home.getSource();
File folder = jarFile.getParentFile();
String absolutePath = folder.getAbsolutePath();
String wsdlLocation = "file://////" + absolutePath + "/wsdl/Z_MI_SD_009_SO_CREATION.wsdl";
System.out.println(wsdlLocation);
ZMISD009SOCREATIONService service = new ZMISD009SOCREATIONService(new URL(wsdlLocation));
ZMISD009SOCREATION ZMISD009SOCREATION = service.getZMISD009SOCREATIONPort();
ZMISD009SOCREATION.zMISD009SOCREATION(getZMTSD009SOCREATION());
}
......
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