Commit dc8d3e69 authored by Quxl's avatar Quxl

x

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