|
|
|
@@ -105,6 +105,7 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
queryWrapperCustomer.in(CollectionUtils.isNotEmpty(demandList),InvestCustomerEntity::getId, getIds(demandList, InvestDemandEntity::getCustomerId)); |
|
|
|
} |
|
|
|
} |
|
|
|
queryWrapperCustomer.like(StringUtils.isNotBlank(params.getCustomerNo()), InvestCustomerEntity::getCustomerNo, params.getCustomerNo()); |
|
|
|
queryWrapperCustomer.orderByDesc(InvestCustomerEntity::getCreateDate); |
|
|
|
InvestPageResult<InvestCustomerEntity> customers = customerService.queryPage(buildPageQuery(params, null), queryWrapperCustomer); |
|
|
|
List<InvestDemandVo> resultList = getTargeInfoList(demandList, customers.getRecords()); |
|
|
|
@@ -279,12 +280,10 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
return; |
|
|
|
} |
|
|
|
//品牌信息 |
|
|
|
List<WxBrand> brands = brandService.listAsPage(null, 1, Integer.MAX_VALUE).getList(); |
|
|
|
Map<String, WxBrand> brandMap = getMap(brands, WxBrand::getName); |
|
|
|
Map<String, WxBrand> brandMap = getBrandMap(); |
|
|
|
|
|
|
|
//业态信息 |
|
|
|
List<WxBusiness> businesses = businessService.listAsPage(null, 1, Integer.MAX_VALUE).getList(); |
|
|
|
Map<String, WxBusiness> businesseMap = getMap(businesses, WxBusiness::getTitle); |
|
|
|
Map<String, WxBusiness> businesseMap = getBusinessMap(); |
|
|
|
|
|
|
|
//商铺信息 |
|
|
|
List<WxShop> shops = shopService.listAsPage(null, 1, Integer.MAX_VALUE).getList(); |
|
|
|
@@ -337,6 +336,16 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private Map<String, WxBusiness> getBusinessMap() { |
|
|
|
List<WxBusiness> businesses = businessService.listAsPage(null, 1, Integer.MAX_VALUE).getList(); |
|
|
|
return getMap(businesses, WxBusiness::getTitle); |
|
|
|
} |
|
|
|
|
|
|
|
private Map<String, WxBrand> getBrandMap() { |
|
|
|
List<WxBrand> brands = brandService.listAsPage(null, 1, Integer.MAX_VALUE).getList(); |
|
|
|
return getMap(brands, WxBrand::getName); |
|
|
|
} |
|
|
|
|
|
|
|
private InvestDemandDto convetCustomer(InvestCustomerVoT customerVoT, Map<String, WxBrand> brandMap, Map<String, WxBusiness> businesseMap, Map<String, WxShop> shopMap, Map<String, InvestCustomerEntity> customerMap) { |
|
|
|
InvestCustomerEntity customerEntity = new InvestCustomerEntity(); |
|
|
|
if (Objects.isNull(brandMap.get(customerVoT.getBrandName()))) { |
|
|
|
@@ -412,9 +421,9 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
|
|
|
|
private InvestDemandDto doConvertDemand(InvestDemandQuery params) { |
|
|
|
InvestCustomerEntity customerEntity = null; |
|
|
|
if (ObjectUtils.anyNotNull(params.getCustomerId(), params.getCustomerType(), params.getBusinessId())) { |
|
|
|
if (ObjectUtils.anyNotNull(params.getCustomerNo(), params.getCustomerType(), params.getBusinessId())) { |
|
|
|
customerEntity = new InvestCustomerEntity(); |
|
|
|
customerEntity.setId(params.getCustomerId()); |
|
|
|
customerEntity.setCustomerNo(params.getCustomerNo()); |
|
|
|
customerEntity.setType(params.getCustomerType()); |
|
|
|
customerEntity.setBusinessId(params.getBusinessId()); |
|
|
|
} |
|
|
|
@@ -705,12 +714,12 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
private void saveMessage(InvestDemandEntity entity, InvestCustomerEntity customerEntity) { |
|
|
|
if (Objects.isNull(entity)) { |
|
|
|
private void saveMessage(InvestDemandEntity demandEntity, InvestCustomerEntity customerEntity) { |
|
|
|
if (Objects.isNull(demandEntity)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
Long owner = entity.getOwner(); |
|
|
|
if (Objects.nonNull(owner)) { |
|
|
|
Long owner = demandEntity.getOwner(); |
|
|
|
if (Objects.nonNull(owner) && !Objects.equals(owner, 0L)) { |
|
|
|
List<Long> ownerArray = Arrays.asList(owner); |
|
|
|
demandService.saveBatchMessage(ownerArray, EnumInvestMessageType.CUSTOMER_CREATE.getInfo(), EnumInvestMessageTag.CUSTOMER_CREATE, EnumFollowType.DEMAND, customerEntity.getId()); |
|
|
|
} |
|
|
|
@@ -819,6 +828,12 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
Collection<InvestOperateRecordEntity> recordList = entityPageList.getRecords(); |
|
|
|
Map<Long, MallUserInfo> usersMap = getMap(userInfoService.getByIds(getIds(recordList, InvestOperateRecordEntity::getOperator)), MallUserInfo::getId); |
|
|
|
|
|
|
|
//品牌信息 |
|
|
|
Map<String, WxBrand> brandMap = getBrandMap(); |
|
|
|
|
|
|
|
//业态信息 |
|
|
|
Map<String, WxBusiness> businesseMap = getBusinessMap(); |
|
|
|
|
|
|
|
List<InvestOperateRecordVo> resultList = new ArrayList<>(); |
|
|
|
for (InvestOperateRecordEntity recordEntity : recordList) { |
|
|
|
InvestOperateRecordVo itemVo = new InvestOperateRecordVo(); |
|
|
|
@@ -828,7 +843,38 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
itemVo.setOperatorName(userInfo.getName()); |
|
|
|
} |
|
|
|
TableTriple content = JSON.parseObject(recordEntity.getContent(), TableTriple.class); |
|
|
|
itemVo.setRecord(content); |
|
|
|
itemVo.setRecord(convert(content, tableTriple -> { |
|
|
|
Object column = tableTriple.getColumn(); |
|
|
|
if (Objects.equals(column, "businessId")) { |
|
|
|
WxBusiness businessBefore = businesseMap.get(tableTriple.getBefore()) ; |
|
|
|
WxBusiness businessAfter = businesseMap.get(tableTriple.getAfter()) ; |
|
|
|
if (Objects.nonNull(businessBefore)) { |
|
|
|
tableTriple.setBefore(businessBefore.getTitle()); |
|
|
|
} |
|
|
|
if (Objects.nonNull(businessAfter)) { |
|
|
|
tableTriple.setBefore(businessAfter.getTitle()); |
|
|
|
} |
|
|
|
} else if (Objects.equals(column, "brandId")) { |
|
|
|
WxBrand brandBefore = brandMap.get(tableTriple.getBefore()) ; |
|
|
|
WxBrand brandAfter = brandMap.get(tableTriple.getAfter()) ; |
|
|
|
if (Objects.nonNull(brandBefore)) { |
|
|
|
tableTriple.setBefore(brandBefore.getName()); |
|
|
|
} |
|
|
|
if (Objects.nonNull(brandAfter)) { |
|
|
|
tableTriple.setBefore(brandAfter.getName()); |
|
|
|
} |
|
|
|
} else if (Objects.equals(column, "owner")) { |
|
|
|
MallUserInfo userBefore = usersMap.get(tableTriple.getBefore()); |
|
|
|
MallUserInfo userAfter = usersMap.get(tableTriple.getAfter()); |
|
|
|
if (Objects.nonNull(userBefore)) { |
|
|
|
tableTriple.setBefore(userBefore.getName()); |
|
|
|
} |
|
|
|
if (Objects.nonNull(userAfter)) { |
|
|
|
tableTriple.setBefore(userAfter.getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
return tableTriple; |
|
|
|
})); |
|
|
|
resultList.add(itemVo); |
|
|
|
} |
|
|
|
BeanUtils.copyProperties(entityPageList, investPage); |
|
|
|
@@ -908,13 +954,16 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
InvestDemandVo resultItemVo = new InvestDemandVo(); |
|
|
|
BeanUtils.copyProperties(customer, resultItemVo); |
|
|
|
resultItemVo.setBrand(brand); |
|
|
|
resultItemVo.setDemand(item); |
|
|
|
resultItemVo.setTargetInfo(shop); |
|
|
|
if (Objects.nonNull(item)) { |
|
|
|
if (Objects.equals(item.getOwner(), 0L)) { |
|
|
|
item.setOwner(null); |
|
|
|
} |
|
|
|
if (Objects.nonNull(usersMap.get(item.getOwner()))) { |
|
|
|
resultItemVo.setOwnerInfo(usersMap.get(item.getOwner())); |
|
|
|
} |
|
|
|
} |
|
|
|
resultItemVo.setDemand(item); |
|
|
|
return resultItemVo; |
|
|
|
} |
|
|
|
|
|
|
|
|