|
|
|
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.iformall.domain.dto.InvestDemandDto; |
|
|
|
import com.iformall.domain.dto.InvestCustomerDto; |
|
|
|
import com.iformall.domain.po.*; |
|
|
|
import com.iformall.domain.po.invest.InvestCustomerEntity; |
|
|
|
import com.iformall.domain.po.invest.InvestDemandEntity; |
|
|
|
@@ -47,14 +47,19 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
private MallUserInfoService userInfoService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public InvestPageResult<InvestDemandVo> queryPageDemand(InvestPageQuery<InvestDemandDto> params) { |
|
|
|
InvestDemandDto queryDemand = params.getQueryData(); |
|
|
|
public InvestPageResult<InvestDemandVo> queryPageDemand(InvestPageQuery<InvestCustomerDto> params) { |
|
|
|
InvestCustomerDto queryParams = params.getQueryData(); |
|
|
|
InvestDemandEntity queryDemand = null; |
|
|
|
if (Objects.nonNull(queryParams)) { |
|
|
|
queryDemand = new InvestDemandEntity(); |
|
|
|
queryDemand.setOwner(queryParams.getOwner()); |
|
|
|
} |
|
|
|
InvestPageResult<InvestDemandEntity> demandPage = demandService.queryPage(new InvestPageQuery<>(queryDemand)); |
|
|
|
InvestPageResult<InvestDemandVo> investPage = new InvestPageResult<>(); |
|
|
|
if (CollectionUtils.isEmpty(demandPage.getRecords())) { |
|
|
|
return investPage; |
|
|
|
} |
|
|
|
List<InvestDemandVo> resultList = getTargeInfoList(demandPage, queryDemand.getCustomer()); |
|
|
|
List<InvestDemandVo> resultList = getTargeInfoList(demandPage, queryParams); |
|
|
|
BeanUtils.copyProperties(demandPage, investPage); |
|
|
|
investPage.setRecords(resultList); |
|
|
|
return investPage; |
|
|
|
@@ -139,10 +144,10 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public boolean saveCustomerAndDemand(InvestDemandDto demandDto) { |
|
|
|
public boolean saveCustomerAndDemand(InvestCustomerDto demandDto) { |
|
|
|
InvestHelper.notNull(demandDto); |
|
|
|
InvestCustomerEntity customerEntity = demandDto.getCustomer(); |
|
|
|
InvestCustomerEntity customerEntityDB = customerService.getById(demandDto.getCustomerId()); |
|
|
|
InvestCustomerEntity customerEntity = demandDto; |
|
|
|
InvestCustomerEntity customerEntityDB = customerService.getById(demandDto.getId()); |
|
|
|
if (Objects.nonNull(customerEntity)) { |
|
|
|
if (Objects.isNull(customerEntityDB)) { |
|
|
|
customerService.save(customerEntity); |
|
|
|
@@ -158,9 +163,9 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public boolean updateCustomerAndDemand(InvestDemandDto demandDto) { |
|
|
|
InvestHelper.notNull(demandDto, demandDto.getCustomerId()); |
|
|
|
InvestCustomerEntity customerEntity = demandDto.getCustomer(); |
|
|
|
public boolean updateCustomerAndDemand(InvestCustomerDto demandDto) { |
|
|
|
InvestHelper.notNull(demandDto, demandDto.getId()); |
|
|
|
InvestCustomerEntity customerEntity = demandDto; |
|
|
|
InvestHelper.notNull(customerEntity); |
|
|
|
customerService.updateById(customerEntity); |
|
|
|
InvestDemandEntity demandEntity = new InvestDemandEntity(); |
|
|
|
@@ -192,8 +197,7 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
InvestFollowRecordEntity followRecordEntity = followRecordService.getByIdNotNull(id); |
|
|
|
InvestCustomerEntity customerEntity = customerService.getByIdNotNull(followRecordEntity.getCustomerId()); |
|
|
|
WxBrand brand = brandService.getById(customerEntity.getBrandId()); |
|
|
|
InvestFollowRecordVo followRecordVo = buildFollowRecordItem(usersMap, followRecordEntity, customerEntity, brand); |
|
|
|
return followRecordVo; |
|
|
|
return buildFollowRecordItem(usersMap, followRecordEntity, customerEntity, brand); |
|
|
|
} |
|
|
|
|
|
|
|
private InvestFollowRecordVo buildFollowRecordItem(Map<Long, MallUserInfo> usersMap, InvestFollowRecordEntity item, InvestCustomerEntity customerEntity, WxBrand brand) { |
|
|
|
|