将生成合同编号,单独放到一个事务中做提交
This commit is contained in:
parent
802e84baed
commit
e69e078855
@ -330,6 +330,7 @@ public class SerialNumberUtil {
|
||||
* **/
|
||||
protected static synchronized String getSerialNumberByDay(String serialNumberPattern,int numberCount,Map<String,String> model,String type,Integer queryYear,Integer queryMonth,Integer queryDay,JBOTransaction tx) throws Exception
|
||||
{
|
||||
JBOTransaction newTx=JBOFactory.createJBOTransaction();
|
||||
String currentDateTime = DateAssistant.getTodayNow();
|
||||
String currentYear = currentDateTime.substring(0,4);
|
||||
String monthStr = currentDateTime.substring(5,7);
|
||||
@ -358,7 +359,7 @@ public class SerialNumberUtil {
|
||||
paramMap.put("minute", minute+"");
|
||||
paramMap.put("second", second+"");
|
||||
|
||||
int maxOrderNumber = getMaxOrderNumberByDay(type, year,month,day, tx);
|
||||
int maxOrderNumber = getMaxOrderNumberByDay(type, year,month,day, newTx);
|
||||
StringBuffer numberFormat = new StringBuffer();
|
||||
for(int i=0;i<numberCount;i++)
|
||||
{
|
||||
@ -373,7 +374,7 @@ public class SerialNumberUtil {
|
||||
}
|
||||
|
||||
String serialNumberString = getSerialNumber(paramMap, serialNumberPattern);
|
||||
|
||||
newTx.commit();
|
||||
return serialNumberString;
|
||||
}
|
||||
//考虑并发情况必须采用同步机制
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user