|
@@ -3,6 +3,7 @@ package com.jzg.organization.service.impl;
|
|
|
import cn.hutool.core.collection.ListUtil;
|
|
import cn.hutool.core.collection.ListUtil;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
import com.alibaba.nacos.common.utils.CollectionUtils;
|
|
import com.alibaba.nacos.common.utils.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
@@ -35,6 +36,8 @@ import com.jzg.organization.service.ReceivableService;
|
|
|
import org.redisson.api.RBucket;
|
|
import org.redisson.api.RBucket;
|
|
|
import org.redisson.api.RKeys;
|
|
import org.redisson.api.RKeys;
|
|
|
import org.redisson.api.RedissonClient;
|
|
import org.redisson.api.RedissonClient;
|
|
|
|
|
+import org.slf4j.Logger;
|
|
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
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;
|
|
@@ -63,10 +66,13 @@ import java.util.stream.Collectors;
|
|
|
/**
|
|
/**
|
|
|
* @author tz
|
|
* @author tz
|
|
|
* @description 财务应收模块Service实现
|
|
* @description 财务应收模块Service实现
|
|
|
- * @createDate 2024-06-26 10:49:31
|
|
|
|
|
|
|
+ * @date 2024-06-26 10:49:31
|
|
|
*/
|
|
*/
|
|
|
@Service
|
|
@Service
|
|
|
public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyIncome> implements ReceivableService {
|
|
public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyIncome> implements ReceivableService {
|
|
|
|
|
+
|
|
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(ReceivableServiceImpl.class);
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private RedissonClient redissonClient;
|
|
private RedissonClient redissonClient;
|
|
|
|
|
|
|
@@ -319,6 +325,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public boolean settlement(SettlementVo settlementVo) {
|
|
public boolean settlement(SettlementVo settlementVo) {
|
|
|
|
|
+ log.info("结算:settlementVo=[{}]", JSONUtil.toJsonStr(settlementVo));
|
|
|
try {
|
|
try {
|
|
|
// 获取应收的金额
|
|
// 获取应收的金额
|
|
|
InsPlyIncomeInvoice insPlyIncomeInvoice = insPlyIncomeInvoiceMapper.selectById(settlementVo.getInvoicingId());
|
|
InsPlyIncomeInvoice insPlyIncomeInvoice = insPlyIncomeInvoiceMapper.selectById(settlementVo.getInvoicingId());
|
|
@@ -370,8 +377,10 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
|
|
|
|
|
return true;
|
|
return true;
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
|
+ log.error("结算异常. settlementVo=[{}]",JSONUtil.toJsonStr(settlementVo), e);
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
- return false;
|
|
|
|
|
|
|
+ throw new RuntimeException(e.getMessage());
|
|
|
|
|
+ // return false;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|