@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public RespData addLandOwner(CustomerDTO customerDTO) {
try {
Landowner landOwner = new Landowner();
BeanUtils.copyProperties(customerDTO,landOwner);
if(landOwnerMapper.insertSelective(landOwner)<1){
return RespData.fail(RespData.FAIL_CODE,"新增客户失败");
}
//新增成功后 往旧表里落一份数据
syncAddLandOwner(landOwner);
} catch (Exception e) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return RespData.fail("新增客户失败");
}
}