|
|
|
@@ -705,6 +705,20 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
return queryUserList(EnumInvestUserType.ALL); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Map<String, Object> shopRentInfo(Long shopId) { |
|
|
|
WxShop shop = shopService.getById(shopId); |
|
|
|
InvestHelper.notNull(shop, "shop 不存在"); |
|
|
|
//3、商品合同信息 |
|
|
|
Map<Long, WxRentContract> shopContractMap = rentContractService.selectRentContractByShopIds(Arrays.asList(shop.getId()), StringUtils.join(shop.getId()), InvestUserContext.getUser().getTenantId()); |
|
|
|
WxRentContract contract = shopContractMap.get(shop.getId()); |
|
|
|
InvestHelper.notNull(contract,"合同信息不存在"); |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
map.put("startdate", contract.getRentalStartDate()); |
|
|
|
map.put("enddate", contract.getRentalEndDate()); |
|
|
|
return map; |
|
|
|
} |
|
|
|
|
|
|
|
public List<MallUserInfo> queryUserList(EnumInvestUserType userType) { |
|
|
|
LambdaQueryWrapper<MallUserInfo> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapper.eq(MallUserInfo::getStatus, 1); |
|
|
|
@@ -758,7 +772,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 +963,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); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|