|
|
@ -78,8 +78,8 @@ public class InvoiceInterfaceServiceImpl implements InvoiceInterfaceService { |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private StringRedisTemplate stringRedisTemplate; |
|
|
|
private StringRedisTemplate stringRedisTemplate; |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
// @Resource
|
|
|
|
private RedissonClient redisson; |
|
|
|
// private RedissonClient redisson;
|
|
|
|
|
|
|
|
|
|
|
|
private static final String REDIS_KEY = "collect_invoice_"; |
|
|
|
private static final String REDIS_KEY = "collect_invoice_"; |
|
|
|
|
|
|
|
|
|
|
@ -658,8 +658,8 @@ public class InvoiceInterfaceServiceImpl implements InvoiceInterfaceService { |
|
|
|
List<InvoiceLog> logList = new ArrayList<>(); |
|
|
|
List<InvoiceLog> logList = new ArrayList<>(); |
|
|
|
for (InvoiceSelectInfo invoiceSelectInfo : invoicesList) { |
|
|
|
for (InvoiceSelectInfo invoiceSelectInfo : invoicesList) { |
|
|
|
//加分布式锁
|
|
|
|
//加分布式锁
|
|
|
|
String lockKey = REDIS_KEY + invoiceSelectInfo.getUuid(); |
|
|
|
// String lockKey = REDIS_KEY + invoiceSelectInfo.getUuid();
|
|
|
|
RLock lock = redisson.getLock(lockKey); |
|
|
|
// RLock lock = redisson.getLock(lockKey);
|
|
|
|
invoiceSelectInfo.setUuid(invoiceSelectInfo.getInvoiceCode() + invoiceSelectInfo.getInvoiceNo()); |
|
|
|
invoiceSelectInfo.setUuid(invoiceSelectInfo.getInvoiceCode() + invoiceSelectInfo.getInvoiceNo()); |
|
|
|
if ("1".equals(invoiceSelectInfo.getLegalizeState())) { |
|
|
|
if ("1".equals(invoiceSelectInfo.getLegalizeState())) { |
|
|
|
//认证处理状态 0-未认证 1-已勾选未确认,2已确认 3 已发送认证 4 认证成功 5 认证失败
|
|
|
|
//认证处理状态 0-未认证 1-已勾选未确认,2已确认 3 已发送认证 4 认证成功 5 认证失败
|
|
|
@ -668,11 +668,11 @@ public class InvoiceInterfaceServiceImpl implements InvoiceInterfaceService { |
|
|
|
invoiceSelectInfo.setAuthStatus("0"); |
|
|
|
invoiceSelectInfo.setAuthStatus("0"); |
|
|
|
} |
|
|
|
} |
|
|
|
try { |
|
|
|
try { |
|
|
|
boolean isLock = lock.tryLock(); |
|
|
|
// boolean isLock = lock.tryLock();
|
|
|
|
|
|
|
|
|
|
|
|
if(!isLock){ |
|
|
|
// if(!isLock){
|
|
|
|
log.info("当前已有线程获取到锁"); |
|
|
|
// log.info("当前已有线程获取到锁");
|
|
|
|
}else { |
|
|
|
// }else {
|
|
|
|
// 判断库里是否已经存在,存在则只更新发票状态,状态更新时间,认证状态以及相关字段更新
|
|
|
|
// 判断库里是否已经存在,存在则只更新发票状态,状态更新时间,认证状态以及相关字段更新
|
|
|
|
DynamicContextHolder.push(db + DbConstant.BUSINESS_READ); |
|
|
|
DynamicContextHolder.push(db + DbConstant.BUSINESS_READ); |
|
|
|
TDxRecordInvoiceJobEntity entity = tDxRecordInvoiceJobDao.findInvoiceByUUid(invoiceSelectInfo.getUuid()); |
|
|
|
TDxRecordInvoiceJobEntity entity = tDxRecordInvoiceJobDao.findInvoiceByUUid(invoiceSelectInfo.getUuid()); |
|
|
@ -785,13 +785,14 @@ public class InvoiceInterfaceServiceImpl implements InvoiceInterfaceService { |
|
|
|
invoiceLog.setCreateDate(new Date()); |
|
|
|
invoiceLog.setCreateDate(new Date()); |
|
|
|
invoiceLog.setInputName("系统自动"); |
|
|
|
invoiceLog.setInputName("系统自动"); |
|
|
|
logList.add(invoiceLog); |
|
|
|
logList.add(invoiceLog); |
|
|
|
} |
|
|
|
// }
|
|
|
|
}catch (Exception e) { |
|
|
|
}catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
} finally { |
|
|
|
|
|
|
|
//关锁
|
|
|
|
|
|
|
|
lock.unlock(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// finally {
|
|
|
|
|
|
|
|
// //关锁
|
|
|
|
|
|
|
|
// lock.unlock();
|
|
|
|
|
|
|
|
// }
|
|
|
|
} |
|
|
|
} |
|
|
|
httpLog.setStatus("1"); |
|
|
|
httpLog.setStatus("1"); |
|
|
|
httpLog.setTotal(total); |
|
|
|
httpLog.setTotal(total); |
|
|
|