|
|
@ -41,7 +41,8 @@ public class FinanceService implements IFinanceService { |
|
|
|
private PluFinanceCheckMapper pluFinanceCheckMapper; |
|
|
|
@Resource |
|
|
|
private PluFinanceCheckLogMapper pluFinanceCheckLogMapper; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private PluFinanceMapper pluFinanceMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -85,6 +86,15 @@ public class FinanceService implements IFinanceService { |
|
|
|
if (CollectionUtil.isEmpty(proMembers)) { |
|
|
|
throw new BaseException(BasicsCodeError.NOT_MEMBER_SHEET); |
|
|
|
} |
|
|
|
// 查找对应的预算信息
|
|
|
|
PluFinanceExample financeExample = new PluFinanceExample(); |
|
|
|
financeExample.createCriteria().andTaskIdEqualTo(param.getTaskDetailId()); |
|
|
|
financeExample.setOrderByClause("id desc limit 1"); |
|
|
|
List<PluFinance> pluFinances = pluFinanceMapper.selectByExample(financeExample); |
|
|
|
log.info("财务预算信息:{}", pluFinances); |
|
|
|
if (CollectionUtil.isEmpty(pluFinances)) { |
|
|
|
throw new BaseException(BasicsCodeError.FINANCE_NOT_FOUND); |
|
|
|
} |
|
|
|
// 计算总金额和发票金额是否一致
|
|
|
|
if (CollectionUtil.isNotEmpty(param.getInvoiceList())) { |
|
|
|
long invoiceTotal = 0L; |
|
|
@ -100,6 +110,10 @@ public class FinanceService implements IFinanceService { |
|
|
|
BeanUtils.copyProperties(param, apply); |
|
|
|
apply.setId(snowflake.nextId()); |
|
|
|
apply.setMemberId(proMembers.get(0).getId()); |
|
|
|
apply.setTaskId(param.getTaskDetailId()); |
|
|
|
apply.setFinanceId(pluFinances.get(0).getId()); |
|
|
|
apply.setApplyTime(System.currentTimeMillis()); |
|
|
|
apply.setInvoice(CollectionUtil.isEmpty(param.getInvoiceList()) ? BasicsConstant.Finance.INVOICE_UPLOAD_NO : BasicsConstant.Finance.INVOICE_UPLOAD_YES); |
|
|
|
pluFinanceApplyMapper.insertSelective(apply); |
|
|
|
if (CollectionUtil.isNotEmpty(param.getInvoiceList())) { |
|
|
|
List<PluFinanceInvoice> invoices = new ArrayList<>(); |
|
|
@ -153,8 +167,7 @@ public class FinanceService implements IFinanceService { |
|
|
|
} |
|
|
|
// 判断是否已经审核过
|
|
|
|
PluFinanceCheckLogExample logExample = new PluFinanceCheckLogExample(); |
|
|
|
logExample.createCriteria().andCheckIdEqualTo(param.getFinanceCheckId()) |
|
|
|
.andCheckIdEqualTo(check.getCheckerId()); |
|
|
|
logExample.createCriteria().andCheckIdEqualTo(param.getFinanceCheckId()); |
|
|
|
long l = pluFinanceCheckLogMapper.countByExample(logExample); |
|
|
|
log.info("{}关于{}的审核数:{}", check.getCheckerId(), check.getId(), l); |
|
|
|
if (l > 0) { |
|
|
|