|
|
|
@@ -1,6 +1,7 @@ |
|
|
|
package com.iformall.service.invest.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.iformall.domain.dto.InvestDemandDto; |
|
|
|
import com.iformall.domain.po.*; |
|
|
|
import com.iformall.domain.vo.invest.*; |
|
|
|
import com.iformall.service.MallUserInfoService; |
|
|
|
@@ -128,13 +129,19 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public boolean saveCustomerAndDemand(InvestDemandVo customerDemandVo) { |
|
|
|
InvestHelper.allNotNull(customerDemandVo); |
|
|
|
InvestHelper.allNotNull(customerDemandVo.getBrand(), customerDemandVo.getCustomer()); |
|
|
|
InvestCustomerEntity customerEntity = customerDemandVo.getCustomer(); |
|
|
|
customerService.save(customerEntity); |
|
|
|
public boolean saveCustomerAndDemand(InvestDemandDto customerDemandDto) { |
|
|
|
InvestHelper.allNotNull(customerDemandDto, customerDemandDto.getCustomerId()); |
|
|
|
InvestCustomerEntity customerEntity = customerDemandDto.getCustomer(); |
|
|
|
InvestCustomerEntity customerEntityDB = customerService.getById(customerDemandDto.getCustomerId()); |
|
|
|
if (Objects.nonNull(customerEntity)) { |
|
|
|
if (Objects.isNull(customerEntityDB)) { |
|
|
|
customerService.save(customerEntity); |
|
|
|
} else { |
|
|
|
customerService.updateById(customerEntity); |
|
|
|
} |
|
|
|
} |
|
|
|
InvestDemandEntity demandEntity = new InvestDemandEntity(); |
|
|
|
BeanUtils.copyProperties(customerDemandVo, demandEntity); |
|
|
|
BeanUtils.copyProperties(customerDemandDto, demandEntity); |
|
|
|
return demandService.save(demandEntity); |
|
|
|
} |
|
|
|
|
|
|
|
|