|
|
|
@@ -152,7 +152,8 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
if (CollectionUtils.isNotEmpty(shops)) { |
|
|
|
Collection<Long> shopPointIds = buildShopContractQuery(shops, EnumRentShopType.POINT); |
|
|
|
Collection<Long> shopIds = buildShopContractQuery(shops, EnumRentShopType.SHOP); |
|
|
|
shopContractMap = rentContractService.selectRentContractByShopIds(shopPointIds, StringUtils.join(shopIds, "|")); |
|
|
|
shopContractMap = rentContractService.selectRentContractByShopIds(shopPointIds, StringUtils.join(shopIds, "|"), |
|
|
|
InvestUserContext.getUser().getTenantId()); |
|
|
|
} |
|
|
|
for (WxShop shop : shops) { |
|
|
|
WxRentContract contract = shopContractMap.get(shop.getId()); |
|
|
|
@@ -367,6 +368,18 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
return demandService.updateById(demandEntity); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean saveTask(InvestTaskEntity investTaskEntity) { |
|
|
|
syncTargetStatus(investTaskEntity); |
|
|
|
return taskService.save(investTaskEntity); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean updateTask(InvestTaskEntity investTaskEntity) { |
|
|
|
syncTargetStatus(investTaskEntity); |
|
|
|
return taskService.updateById(investTaskEntity); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public InvestDemandVo findDemandById(Long id) { |
|
|
|
InvestCustomerEntity customerEntity = customerService.getByIdNotNull(id); |
|
|
|
@@ -472,6 +485,21 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
return buildFollowRecordItem(usersMap, followRecordEntity, customerEntity, brand); |
|
|
|
} |
|
|
|
|
|
|
|
private void syncTargetStatus(InvestTaskEntity investTaskEntity) { |
|
|
|
WxRentContract contractQuery = new WxRentContract(); |
|
|
|
contractQuery.setTenantId(InvestUserContext.getUser().getTenantId()); |
|
|
|
contractQuery.setShopId(investTaskEntity.getTargetId()); |
|
|
|
contractQuery.setStatus(EnumRentContractStatus.INTENTION.getCode()); |
|
|
|
int count = rentContractService.selectContractCountByShopId(contractQuery); |
|
|
|
if (count > 0) { |
|
|
|
investTaskEntity.setStatus(EnumTaskStatus.INTENTION); |
|
|
|
} else { |
|
|
|
if (StringUtils.isNotEmpty(investTaskEntity.getOwner())) { |
|
|
|
investTaskEntity.setStatus(EnumTaskStatus.NEGOTIATING); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private InvestFollowRecordVo buildFollowRecordItem(Map<Long, MallUserInfo> usersMap, InvestFollowRecordEntity item, |
|
|
|
InvestCustomerEntity customerEntity, WxBrand brand) { |
|
|
|
List<MallUserInfo> ownerInfo = getMallUserInfos(usersMap, item); |
|
|
|
|