Skip to content
Snippets Groups Projects

Jiangxiaoming

Merged jiangxiaoming requested to merge jiangxiaoming into dev
Compare and
2 files
+ 10
8
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -457,14 +457,16 @@ public class EntryCommandServiceImpl implements EntryCommandService {
throw ExceptionUtil.getException(null,"已线下入账不允许入账:"+incomeAggregate.getIncomeId());
}
EntryBillAggregate entryBillAggregate = entryBillRepository.findByIncomeId(incomeId);
if(entryBillAggregate!=null && entryBillAggregate.getVoucherState().getValue().equals(VoucherStateEnum.已入账.getValue())){
throw new RuntimeException("已经入账的回单不允许再次入账");
}
// 查询凭证 是否有申请中的
VoucherAggregate agg = voucherRepository.findByOutOrderNo(incomeId);
// 查询凭证 是否有申请中的
if(agg.getVoucherState()!=null && agg.getVoucherState().equals(VoucherStateApplyEnum.申请中.getValue())){
throw new RuntimeException("当前回单入账在途中");
}
if(entryBillAggregate!=null && entryBillAggregate.getVoucherState().getValue().equals(VoucherStateEnum.已入账.getValue())
&& agg.getVoucherState().equals(VoucherStateApplyEnum.已入账.getValue())
){
throw new RuntimeException("已经入账的回单不允许再次入账");
}
List<EntryBillFlowEntity> flowEntityList = new ArrayList<>();
Long entryNo = IdUtil.getSnowflakeNextId();
if(StringUtils.isNotEmpty(cmd.getVoucherCode())&& ObjectUtil.isNotEmpty(cmd.getVoucherDate())){