|
|
|
@@ -129,10 +129,10 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public boolean saveCustomerAndDemand(InvestDemandDto customerDemandDto) { |
|
|
|
InvestHelper.allNotNull(customerDemandDto, customerDemandDto.getCustomerId()); |
|
|
|
InvestCustomerEntity customerEntity = customerDemandDto.getCustomer(); |
|
|
|
InvestCustomerEntity customerEntityDB = customerService.getById(customerDemandDto.getCustomerId()); |
|
|
|
public boolean saveCustomerAndDemand(InvestDemandDto demandDto) { |
|
|
|
InvestHelper.allNotNull(demandDto, demandDto.getCustomerId()); |
|
|
|
InvestCustomerEntity customerEntity = demandDto.getCustomer(); |
|
|
|
InvestCustomerEntity customerEntityDB = customerService.getById(demandDto.getCustomerId()); |
|
|
|
if (Objects.nonNull(customerEntity)) { |
|
|
|
if (Objects.isNull(customerEntityDB)) { |
|
|
|
customerService.save(customerEntity); |
|
|
|
@@ -141,19 +141,19 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
} |
|
|
|
} |
|
|
|
InvestDemandEntity demandEntity = new InvestDemandEntity(); |
|
|
|
BeanUtils.copyProperties(customerDemandDto, demandEntity); |
|
|
|
BeanUtils.copyProperties(demandDto, demandEntity); |
|
|
|
return demandService.save(demandEntity); |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public boolean updateCustomerAndDemand(InvestDemandVo customerDemandVo) { |
|
|
|
InvestHelper.allNotNull(customerDemandVo); |
|
|
|
InvestHelper.allNotNull(customerDemandVo.getBrand(), customerDemandVo.getCustomer()); |
|
|
|
InvestCustomerEntity customerEntity = customerDemandVo.getCustomer(); |
|
|
|
public boolean updateCustomerAndDemand(InvestDemandDto demandDto) { |
|
|
|
InvestHelper.allNotNull(demandDto, demandDto.getCustomerId()); |
|
|
|
InvestCustomerEntity customerEntity = demandDto.getCustomer(); |
|
|
|
InvestHelper.allNotNull(customerEntity); |
|
|
|
customerService.updateById(customerEntity); |
|
|
|
InvestDemandEntity demandEntity = new InvestDemandEntity(); |
|
|
|
BeanUtils.copyProperties(customerDemandVo, demandEntity); |
|
|
|
BeanUtils.copyProperties(demandDto, demandEntity); |
|
|
|
return demandService.updateById(demandEntity); |
|
|
|
} |
|
|
|
|
|
|
|
|