- 私有方法出错,事务回滚
@Override
@Transactional
public void addContract() {
ContractEntity contract = new ContractEntity();
contract.setContractType(ContractTypeEnum.PURCHASE_CONTRACT);
contract.setContractStatus(ContractStatusEnum.APPROVED);
contract.setDealerCode(7000001);
contract.setCreateBy("test01");
contract.setCreateTime(LocalDateTime.now());
contractDomain.save(contract);
addQuotation();
}
private void addQuotation() {
QuotationEntity quotationEntity = new QuotationEntity();
quotationEntity.setDealerCode(7000320);
quotationEntity.setCompanyCode("123");
quotationEntity.setStatus(QuotationStatusEnum.NEW);
quotationEntity.setQuotationType(STOCK_QUOTATION);
quotationEntity.setExtraPrice(new BigDecimal("100"));
quotationEntity.setCashDiscountPrice(new BigDecimal("100"));
quotationEntity.setSaleTotalPrice(new BigDecimal("100"));
quotationEntity.setCreateBy("test02");
quotationEntity.setCreateTime(LocalDateTime.now());
quotationDomain.save(quotationEntity);
}