|
|
@@ -656,10 +656,11 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
remindPageQuery.setQueryData(remindQuery); |
|
|
remindPageQuery.setQueryData(remindQuery); |
|
|
LambdaQueryWrapper<InvestRemindEntity> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<InvestRemindEntity> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
queryWrapper.eq(InvestRemindEntity::getTenantId,InvestUserContext.getUser().getTenantId()); |
|
|
queryWrapper.eq(InvestRemindEntity::getTenantId,InvestUserContext.getUser().getTenantId()); |
|
|
queryWrapper.apply(Objects.nonNull(params.getRemindDate()), |
|
|
|
|
|
"date_format(begin_date,'%Y-%m-%d') >= {0} AND date_format(end_date,'%Y-%m-%d') < {1}" |
|
|
|
|
|
, getDayStart(params.getRemindDate()) |
|
|
|
|
|
, getDayEnd(params.getRemindDate())); |
|
|
|
|
|
|
|
|
if (Objects.nonNull(params.getRemindDate())) { |
|
|
|
|
|
queryWrapper.apply("date_format(begin_date,'%Y-%m-%d') >= {0} AND date_format(end_date,'%Y-%m-%d') < {1}" |
|
|
|
|
|
, getDayStart(params.getRemindDate()) |
|
|
|
|
|
, getDayEnd(params.getRemindDate())); |
|
|
|
|
|
} |
|
|
queryWrapper.orderByDesc(InvestRemindEntity::getCreateDate); |
|
|
queryWrapper.orderByDesc(InvestRemindEntity::getCreateDate); |
|
|
InvestPageResult<InvestRemindEntity> recordPage = remindService.queryPage(remindPageQuery, queryWrapper); |
|
|
InvestPageResult<InvestRemindEntity> recordPage = remindService.queryPage(remindPageQuery, queryWrapper); |
|
|
if (CollectionUtils.isEmpty(recordPage.getRecords())) { |
|
|
if (CollectionUtils.isEmpty(recordPage.getRecords())) { |
|
|
@@ -816,7 +817,7 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public boolean saveTask(InvestTaskEntity investTaskEntity) { |
|
|
public boolean saveTask(InvestTaskEntity investTaskEntity) { |
|
|
syncTargetStatus(investTaskEntity); |
|
|
|
|
|
|
|
|
//syncTargetStatus(investTaskEntity); |
|
|
return taskService.save(investTaskEntity); |
|
|
return taskService.save(investTaskEntity); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@@ -880,7 +881,10 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
private Map<Long, WxRentContract> getWxRentContractMap(WxShop shop) { |
|
|
private Map<Long, WxRentContract> getWxRentContractMap(WxShop shop) { |
|
|
InvestHelper.notNull(shop, "商铺不存在"); |
|
|
|
|
|
|
|
|
//InvestHelper.notNull(shop, "商铺不存在"); |
|
|
|
|
|
if (Objects.isNull(shop)) { |
|
|
|
|
|
return new HashMap<>(); |
|
|
|
|
|
} |
|
|
return rentContractService.selectRentContractByShopIds(Arrays.asList(shop.getId()), StringUtils.join(shop.getId(), ""), |
|
|
return rentContractService.selectRentContractByShopIds(Arrays.asList(shop.getId()), StringUtils.join(shop.getId(), ""), |
|
|
InvestUserContext.getUser().getTenantId()); |
|
|
InvestUserContext.getUser().getTenantId()); |
|
|
} |
|
|
} |
|
|
@@ -1049,10 +1053,9 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
// return; |
|
|
// return; |
|
|
//} |
|
|
//} |
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(investTaskEntity.getOwner())) { |
|
|
|
|
|
investTaskEntity.setStatus(EnumTaskStatus.CREATED); |
|
|
|
|
|
} else { |
|
|
|
|
|
WxShop shop = shopService.getById(investTaskEntity.getTargetId()); |
|
|
|
|
|
|
|
|
InvestHelper.checkOwner(investTaskEntity); |
|
|
|
|
|
WxShop shop = shopService.getById(investTaskEntity.getTargetId()); |
|
|
|
|
|
if (Objects.nonNull(shop)) { |
|
|
Map<Long, WxRentContract> shopContractMap = getWxRentContractMap(shop); |
|
|
Map<Long, WxRentContract> shopContractMap = getWxRentContractMap(shop); |
|
|
WxRentContract contract = shopContractMap.get(shop.getId()); |
|
|
WxRentContract contract = shopContractMap.get(shop.getId()); |
|
|
if (Objects.nonNull(contract)) { |
|
|
if (Objects.nonNull(contract)) { |
|
|
@@ -1067,8 +1070,6 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
int count = rentContractService.selectContractCountByShopId(contractQuery); |
|
|
int count = rentContractService.selectContractCountByShopId(contractQuery); |
|
|
if (count > 0) { |
|
|
if (count > 0) { |
|
|
investTaskEntity.setStatus(EnumTaskStatus.INTENTION); |
|
|
investTaskEntity.setStatus(EnumTaskStatus.INTENTION); |
|
|
} else { |
|
|
|
|
|
investTaskEntity.setStatus(EnumTaskStatus.NEGOTIATING); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@@ -1213,26 +1214,29 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private List<InvestDemandVo> getTargeInfoList(List<InvestDemandEntity> demandList, Collection<InvestCustomerEntity> customers) { |
|
|
private List<InvestDemandVo> getTargeInfoList(List<InvestDemandEntity> demandList, Collection<InvestCustomerEntity> customers) { |
|
|
Map<Long, InvestDemandEntity> demindsMap = getMap(demandList, InvestDemandEntity::getCustomerId); |
|
|
|
|
|
|
|
|
|
|
|
//3、目标信息 |
|
|
|
|
|
Collection<WxShop> shops = shopService.getByIds(getIds(demandList, InvestDemandEntity::getTargetId)); |
|
|
|
|
|
Map<Long, WxShop> shopsMap = getMap(shops, WxShop::getId); |
|
|
|
|
|
|
|
|
Map<Long, InvestDemandEntity> demindsMap = new HashMap<>(); |
|
|
|
|
|
Map<Long, WxShop> shopsMap = new HashMap<>(); |
|
|
|
|
|
Map<Long, MallUserInfo> usersMap = new HashMap<>(); |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(demandList)) { |
|
|
|
|
|
demindsMap = getMap(demandList, InvestDemandEntity::getCustomerId); |
|
|
|
|
|
//3、目标信息 |
|
|
|
|
|
Collection<WxShop> shops = shopService.getByIds(getIds(demandList, InvestDemandEntity::getTargetId)); |
|
|
|
|
|
shopsMap = getMap(shops, WxShop::getId); |
|
|
|
|
|
//5、用户 |
|
|
|
|
|
usersMap = getMap(userInfoService.getByIds(getIds(demandList, InvestDemandEntity::getOwner)), MallUserInfo::getId); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//4、品牌 |
|
|
//4、品牌 |
|
|
Map<Long, WxBrand> brandMap = getMap(brandService.getByIds(getIds(customers, InvestCustomerEntity::getBrandId)), WxBrand::getId); |
|
|
Map<Long, WxBrand> brandMap = getMap(brandService.getByIds(getIds(customers, InvestCustomerEntity::getBrandId)), WxBrand::getId); |
|
|
//5、用户 |
|
|
|
|
|
Map<Long, MallUserInfo> usersMap = getMap(userInfoService.getByIds(getIds(demandList, InvestDemandEntity::getOwner)), MallUserInfo::getId); |
|
|
|
|
|
|
|
|
|
|
|
List<InvestDemandVo> resultList = new ArrayList<>(); |
|
|
List<InvestDemandVo> resultList = new ArrayList<>(); |
|
|
for (InvestCustomerEntity costomerItem : customers) { |
|
|
for (InvestCustomerEntity costomerItem : customers) { |
|
|
InvestDemandEntity demandItem = demindsMap.get(costomerItem.getId()); |
|
|
InvestDemandEntity demandItem = demindsMap.get(costomerItem.getId()); |
|
|
WxShop shop = null; |
|
|
WxShop shop = null; |
|
|
WxBrand brand = null ; |
|
|
|
|
|
if (Objects.nonNull(demandItem)) { |
|
|
if (Objects.nonNull(demandItem)) { |
|
|
shop = shopsMap.get(demandItem.getTargetId()); |
|
|
shop = shopsMap.get(demandItem.getTargetId()); |
|
|
brand = brandMap.get(costomerItem.getBrandId()); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
WxBrand brand = brandMap.get(costomerItem.getBrandId()); |
|
|
resultList.add(buildDemindItem(demandItem, costomerItem, brand, shop, usersMap)); |
|
|
resultList.add(buildDemindItem(demandItem, costomerItem, brand, shop, usersMap)); |
|
|
} |
|
|
} |
|
|
return resultList; |
|
|
return resultList; |
|
|
|