|
|
|
@@ -758,7 +758,8 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
Long owner = demandEntity.getOwner(); |
|
|
|
if (Objects.nonNull(owner) && !Objects.equals(owner, 0L)) { |
|
|
|
List<Long> ownerArray = Collections.singletonList(owner); |
|
|
|
demandService.saveBatchMessage(ownerArray, EnumInvestMessageType.CUSTOMER_CREATE.getInfo(), EnumInvestMessageTag.CUSTOMER_CREATE, EnumFollowType.DEMAND, customerEntity.getId()); |
|
|
|
demandService.saveBatchMessage(ownerArray, EnumInvestMessageType.CUSTOMER_CREATE.getInfo(), |
|
|
|
EnumInvestMessageTag.CUSTOMER_CREATE, EnumFollowType.DEMAND, customerEntity.getId(),customerEntity.getTenantId()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@@ -948,28 +949,29 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
} |
|
|
|
|
|
|
|
private void syncTargetStatus(InvestTaskEntity investTaskEntity) { |
|
|
|
if (!Objects.equals(investTaskEntity.getTargetType(), EnumInvestType.RENT)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
WxShop shop = shopService.getById(investTaskEntity.getTargetId()); |
|
|
|
Map<Long, WxRentContract> shopContractMap = getWxRentContractMap(shop); |
|
|
|
WxRentContract contract = shopContractMap.get(shop.getId()); |
|
|
|
if (Objects.nonNull(contract)) { |
|
|
|
InvestHelper.addContractId(investTaskEntity.getContent(), contract.getId(), null); |
|
|
|
} else { |
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|
//if (!Objects.equals(investTaskEntity.getTargetType(), EnumInvestType.RENT)) { |
|
|
|
// return; |
|
|
|
//} |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(investTaskEntity.getOwner()) && Objects.equals(EnumTaskStatus.CREATED, investTaskEntity.getStatus())) { |
|
|
|
if (StringUtils.isNotBlank(investTaskEntity.getOwner())) { |
|
|
|
investTaskEntity.setStatus(EnumTaskStatus.NEGOTIATING); |
|
|
|
} else { |
|
|
|
WxShop shop = shopService.getById(investTaskEntity.getTargetId()); |
|
|
|
Map<Long, WxRentContract> shopContractMap = getWxRentContractMap(shop); |
|
|
|
WxRentContract contract = shopContractMap.get(shop.getId()); |
|
|
|
if (Objects.nonNull(contract)) { |
|
|
|
InvestHelper.addContractId(investTaskEntity.getContent(), contract.getId(), null); |
|
|
|
} else { |
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|