Commit dc8d3e69 authored by Quxl's avatar Quxl

x

parent 76284ec8
...@@ -15,7 +15,6 @@ import org.springframework.boot.system.ApplicationHome; ...@@ -15,7 +15,6 @@ import org.springframework.boot.system.ApplicationHome;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.egolm.sso.clients.ServiceFactory; import com.egolm.sso.clients.ServiceFactory;
...@@ -58,7 +57,6 @@ public class SI004INVENTORYSyncOutServiceTask { ...@@ -58,7 +57,6 @@ public class SI004INVENTORYSyncOutServiceTask {
this.runTask(); this.runTask();
} }
@Transactional
public void runTask() { public void runTask() {
ApplicationHome home = new ApplicationHome(getClass()); ApplicationHome home = new ApplicationHome(getClass());
File jarFile = home.getSource(); File jarFile = home.getSource();
......
...@@ -15,7 +15,6 @@ import org.springframework.boot.system.ApplicationHome; ...@@ -15,7 +15,6 @@ import org.springframework.boot.system.ApplicationHome;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.egolm.sso.clients.ServiceFactory; import com.egolm.sso.clients.ServiceFactory;
...@@ -58,7 +57,6 @@ public class SI011ACTUALSALESSyncOutServiceTask { ...@@ -58,7 +57,6 @@ public class SI011ACTUALSALESSyncOutServiceTask {
this.runTask(); this.runTask();
} }
@Transactional
public void runTask() { public void runTask() {
ApplicationHome home = new ApplicationHome(getClass()); ApplicationHome home = new ApplicationHome(getClass());
File jarFile = home.getSource(); File jarFile = home.getSource();
......
...@@ -14,7 +14,6 @@ import org.springframework.boot.system.ApplicationHome; ...@@ -14,7 +14,6 @@ import org.springframework.boot.system.ApplicationHome;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import com.egolm.sso.clients.ServiceFactory; import com.egolm.sso.clients.ServiceFactory;
import com.egolm.sso.clients.Z_MI_SD_009_SO_CREATION.ZDTSD009SOCREATION.Header; import com.egolm.sso.clients.Z_MI_SD_009_SO_CREATION.ZDTSD009SOCREATION.Header;
...@@ -55,7 +54,6 @@ public class ZMISD009SOCREATIONServiceTask { ...@@ -55,7 +54,6 @@ public class ZMISD009SOCREATIONServiceTask {
this.runTask(); this.runTask();
} }
@Transactional
public void runTask() { public void runTask() {
ApplicationHome home = new ApplicationHome(getClass()); ApplicationHome home = new ApplicationHome(getClass());
File jarFile = home.getSource(); File jarFile = home.getSource();
......
...@@ -11,6 +11,8 @@ import java.util.Map; ...@@ -11,6 +11,8 @@ import java.util.Map;
import org.bouncycastle.util.encoders.Base64; import org.bouncycastle.util.encoders.Base64;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.dao.DuplicateKeyException; import org.springframework.dao.DuplicateKeyException;
import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
...@@ -27,6 +29,7 @@ import com.egolm.sso.util.SqlUtil.Sql; ...@@ -27,6 +29,7 @@ import com.egolm.sso.util.SqlUtil.Sql;
import com.egolm.sso.util.StringUtil; import com.egolm.sso.util.StringUtil;
@Service @Service
@Scope(value=ConfigurableBeanFactory.SCOPE_SINGLETON)
public class CommonService { public class CommonService {
@Autowired @Autowired
...@@ -57,7 +60,7 @@ public class CommonService { ...@@ -57,7 +60,7 @@ public class CommonService {
private boolean isOpen; private boolean isOpen;
@Transactional(propagation=Propagation.NOT_SUPPORTED) @Transactional(propagation=Propagation.NOT_SUPPORTED)
public Long getNextval(String sName) { public synchronized Long getNextval(String sName) {
try { try {
Map<String, Object> seqMap = jdbcTemplate.queryForMap("select * from x_sequence where name = ?", sName); Map<String, Object> seqMap = jdbcTemplate.queryForMap("select * from x_sequence where name = ?", sName);
Integer id = (Integer)seqMap.get("id"); Integer id = (Integer)seqMap.get("id");
...@@ -75,11 +78,6 @@ public class CommonService { ...@@ -75,11 +78,6 @@ public class CommonService {
if(count == 1) { if(count == 1) {
return value; return value;
} else if(count == 0) { } else if(count == 0) {
try {
Thread.sleep(1000L);
} catch (Throwable e) {
e.printStackTrace();
}
return this.getNextval(sName); return this.getNextval(sName);
} else { } else {
throw new XRException(MessageFormat.format("序列错误[{0}]", sName)); throw new XRException(MessageFormat.format("序列错误[{0}]", sName));
......
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