|
@@ -98,6 +98,9 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
|
|
protected SerialNumTplService serialNumTplService;
|
|
protected SerialNumTplService serialNumTplService;
|
|
@Autowired
|
|
@Autowired
|
|
protected WorkProjectNotifyService workProjectNotifyService;
|
|
protected WorkProjectNotifyService workProjectNotifyService;
|
|
|
|
+
|
|
|
|
+ private static byte[] SYN_BYTE = new byte[0];
|
|
|
|
+
|
|
public WorkInvoice getByProcInsId(String procInsId) {
|
|
public WorkInvoice getByProcInsId(String procInsId) {
|
|
return dao.getByProcInsId(procInsId);
|
|
return dao.getByProcInsId(procInsId);
|
|
}
|
|
}
|
|
@@ -184,7 +187,9 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
|
|
public String save(WorkInvoice workInvoice,Map<String, Object> variables,String processInstanceId) {
|
|
public String save(WorkInvoice workInvoice,Map<String, Object> variables,String processInstanceId) {
|
|
long s1=System.currentTimeMillis();
|
|
long s1=System.currentTimeMillis();
|
|
if (StringUtils.isBlank(workInvoice.getNumber())) {
|
|
if (StringUtils.isBlank(workInvoice.getNumber())) {
|
|
- workInvoice.setNumber(serialNumTplService.genSerialNum(UserUtils.getSelectCompany(), WorkInvoice.SERIAL_BIZCODE));
|
|
|
|
|
|
+ synchronized (SYN_BYTE) {
|
|
|
|
+ workInvoice.setNumber(serialNumTplService.genSerialNum(UserUtils.getSelectCompany(), WorkInvoice.SERIAL_BIZCODE));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
long s2=System.currentTimeMillis();
|
|
long s2=System.currentTimeMillis();
|
|
super.save(workInvoice);
|
|
super.save(workInvoice);
|
|
@@ -346,9 +351,11 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
|
|
@Transactional(readOnly = false)
|
|
@Transactional(readOnly = false)
|
|
public String saveBranch(WorkInvoice workInvoice,Map<String, Object> variables,String processInstanceId) {
|
|
public String saveBranch(WorkInvoice workInvoice,Map<String, Object> variables,String processInstanceId) {
|
|
long s1=System.currentTimeMillis();
|
|
long s1=System.currentTimeMillis();
|
|
- if (StringUtils.isBlank(workInvoice.getNumber())) {
|
|
|
|
|
|
+ if (StringUtils.isBlank(workInvoice.getNumber())) {
|
|
|
|
+ synchronized (SYN_BYTE) {
|
|
workInvoice.setNumber(serialNumTplService.genSerialNum(UserUtils.getSelectCompany(), WorkInvoice.SERIAL_BIZCODE));
|
|
workInvoice.setNumber(serialNumTplService.genSerialNum(UserUtils.getSelectCompany(), WorkInvoice.SERIAL_BIZCODE));
|
|
}
|
|
}
|
|
|
|
+ }
|
|
String officeId = UserUtils.getUser().getOffice().getId();
|
|
String officeId = UserUtils.getUser().getOffice().getId();
|
|
Office office = officeService.get(officeId);
|
|
Office office = officeService.get(officeId);
|
|
workInvoice.setOffice(office);
|
|
workInvoice.setOffice(office);
|