Skip to content
Snippets Groups Projects

凭证整理

Merged jiangxiaoming requested to merge jiangxiaoming into dev
Compare and
4 files
+ 97
52
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -289,6 +289,9 @@ public class EntryCommandServiceImpl extends BaseControllerImpl implements Entry
Long incomeId = cmd.getIncomeId();
Long voucherId = null;
IncomeAggregate incomeAggregate = incomeRepository.findById(incomeId);
if(incomeAggregate.getReceiptBillVo().getIncomeSpeed().equals(IncomeSpeedEnum.入账.getValue())){
throw new RuntimeException("已经入账的回单不允许再次入账");
}
EntryBillAggregate entryBillAggregate = entryBillRepository.findByIncomeId(incomeId);
List<EntryBillFlowEntity> flowEntityList = new ArrayList<>();
if(StringUtils.isNotEmpty(cmd.getVoucherCode())&& ObjectUtil.isNotEmpty(cmd.getVoucherDate())){
@@ -336,6 +339,9 @@ public class EntryCommandServiceImpl extends BaseControllerImpl implements Entry
//1
Long incomeId = cmd.getIncomeId();
IncomeAggregate incomeAggregate = incomeRepository.findById(incomeId);
if(incomeAggregate.getReceiptBillVo().getIncomeSpeed().equals(IncomeSpeedEnum.入账.getValue())){
throw new RuntimeException("已经入账的回单不允许再次入账");
}
//2 查询发票
List<Long> invoiceIds = incomeInvoiceQueryService.findPreInvoiceIdsWith(incomeId);
if(invoiceIds == null || invoiceIds.isEmpty()){
@@ -395,6 +401,9 @@ public class EntryCommandServiceImpl extends BaseControllerImpl implements Entry
@Override
public void entryIncomeWithInvoice(SuppInvoiceCmd cmd) {
IncomeAggregate incomeAggregate = incomeRepository.findById(cmd.getIncomeId());
if(incomeAggregate.getReceiptBillVo().getIncomeSpeed().equals(IncomeSpeedEnum.入账.getValue())){
throw new RuntimeException("已经入账的回单不允许再次入账");
}
//1.保存发票
InvoiceAggergate aggergate = InvoiceAssembler.toSuppInvoiceAggergate(cmd);
aggergate.setInvoiceType(InvoiceTypeEnum.同步开票.getValue());