|
|
@@ -95,13 +95,13 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
if (CollectionUtils.isEmpty(demandList) && Objects.nonNull(params.getDemandOwner())) { |
|
|
if (CollectionUtils.isEmpty(demandList) && Objects.nonNull(params.getDemandOwner())) { |
|
|
return investPage; |
|
|
return investPage; |
|
|
} else { |
|
|
} else { |
|
|
queryWrapperCustomer.in(CollectionUtils.isNotEmpty(demandList),InvestCustomerEntity::getId, getIds(demandList, InvestDemandEntity::getCustomerId)); |
|
|
|
|
|
|
|
|
queryWrapperCustomer.in(CollectionUtils.isNotEmpty(demandList), InvestCustomerEntity::getId, getIds(demandList, InvestDemandEntity::getCustomerId)); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
if (CollectionUtils.isEmpty(demandList)) { |
|
|
if (CollectionUtils.isEmpty(demandList)) { |
|
|
return investPage; |
|
|
return investPage; |
|
|
} else { |
|
|
} else { |
|
|
queryWrapperCustomer.in(CollectionUtils.isNotEmpty(demandList),InvestCustomerEntity::getId, getIds(demandList, InvestDemandEntity::getCustomerId)); |
|
|
|
|
|
|
|
|
queryWrapperCustomer.in(CollectionUtils.isNotEmpty(demandList), InvestCustomerEntity::getId, getIds(demandList, InvestDemandEntity::getCustomerId)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@@ -381,8 +381,8 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
updateCustomerAndDemand(toImportCustomer); |
|
|
updateCustomerAndDemand(toImportCustomer); |
|
|
} |
|
|
} |
|
|
//记数 |
|
|
//记数 |
|
|
stringRedisTemplate.opsForHash().increment(importKey,"processCount",1); |
|
|
|
|
|
stringRedisTemplate.expire(importKey,10, TimeUnit.SECONDS); |
|
|
|
|
|
|
|
|
stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1); |
|
|
|
|
|
stringRedisTemplate.expire(importKey, 10, TimeUnit.SECONDS); |
|
|
}); |
|
|
}); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
setRedisValue(importKey, "1", "0", "0", "1", true); |
|
|
setRedisValue(importKey, "1", "0", "0", "1", true); |
|
|
@@ -655,7 +655,7 @@ 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()); |
|
|
if (Objects.nonNull(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}" |
|
|
queryWrapper.apply("date_format(begin_date,'%Y-%m-%d') >= {0} AND date_format(end_date,'%Y-%m-%d') < {1}" |
|
|
, getDayStart(params.getRemindDate()) |
|
|
, getDayStart(params.getRemindDate()) |
|
|
@@ -750,7 +750,7 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
//3、商品合同信息 |
|
|
//3、商品合同信息 |
|
|
Map<Long, WxRentContract> shopContractMap = rentContractService.selectRentContractByShopIds(Arrays.asList(shop.getId()), StringUtils.join(shop.getId()), InvestUserContext.getUser().getTenantId()); |
|
|
Map<Long, WxRentContract> shopContractMap = rentContractService.selectRentContractByShopIds(Arrays.asList(shop.getId()), StringUtils.join(shop.getId()), InvestUserContext.getUser().getTenantId()); |
|
|
WxRentContract contract = shopContractMap.get(shop.getId()); |
|
|
WxRentContract contract = shopContractMap.get(shop.getId()); |
|
|
InvestHelper.notNull(contract,"合同信息不存在"); |
|
|
|
|
|
|
|
|
InvestHelper.notNull(contract, "合同信息不存在"); |
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
map.put("startdate", contract.getRentalStartDate()); |
|
|
map.put("startdate", contract.getRentalStartDate()); |
|
|
map.put("enddate", contract.getRentalEndDate()); |
|
|
map.put("enddate", contract.getRentalEndDate()); |
|
|
@@ -811,7 +811,7 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
if (Objects.nonNull(owner) && !Objects.equals(owner, 0L)) { |
|
|
if (Objects.nonNull(owner) && !Objects.equals(owner, 0L)) { |
|
|
List<Long> ownerArray = Collections.singletonList(owner); |
|
|
List<Long> ownerArray = Collections.singletonList(owner); |
|
|
demandService.saveBatchMessage(ownerArray, EnumInvestMessageType.CUSTOMER_CREATE.getInfo(), |
|
|
demandService.saveBatchMessage(ownerArray, EnumInvestMessageType.CUSTOMER_CREATE.getInfo(), |
|
|
EnumInvestMessageTag.CUSTOMER_CREATE, EnumFollowType.DEMAND, customerEntity.getId(),customerEntity.getTenantId()); |
|
|
|
|
|
|
|
|
EnumInvestMessageTag.CUSTOMER_CREATE, EnumFollowType.DEMAND, customerEntity.getId(), customerEntity.getTenantId()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@@ -945,8 +945,8 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
itemVo.setRecord(convert(content, tableTriple -> { |
|
|
itemVo.setRecord(convert(content, tableTriple -> { |
|
|
Object column = tableTriple.getColumn(); |
|
|
Object column = tableTriple.getColumn(); |
|
|
if (Objects.equals(column, "businessId")) { |
|
|
if (Objects.equals(column, "businessId")) { |
|
|
WxBusiness businessBefore = businesseMap.get(tableTriple.getBefore()) ; |
|
|
|
|
|
WxBusiness businessAfter = businesseMap.get(tableTriple.getAfter()) ; |
|
|
|
|
|
|
|
|
WxBusiness businessBefore = businesseMap.get(tableTriple.getBefore()); |
|
|
|
|
|
WxBusiness businessAfter = businesseMap.get(tableTriple.getAfter()); |
|
|
if (Objects.nonNull(businessBefore)) { |
|
|
if (Objects.nonNull(businessBefore)) { |
|
|
tableTriple.setBefore(businessBefore.getTitle()); |
|
|
tableTriple.setBefore(businessBefore.getTitle()); |
|
|
} |
|
|
} |
|
|
@@ -954,8 +954,8 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
tableTriple.setAfter(businessAfter.getTitle()); |
|
|
tableTriple.setAfter(businessAfter.getTitle()); |
|
|
} |
|
|
} |
|
|
} else if (Objects.equals(column, "brandId")) { |
|
|
} else if (Objects.equals(column, "brandId")) { |
|
|
WxBrand brandBefore = brandMap.get(tableTriple.getBefore()) ; |
|
|
|
|
|
WxBrand brandAfter = brandMap.get(tableTriple.getAfter()) ; |
|
|
|
|
|
|
|
|
WxBrand brandBefore = brandMap.get(tableTriple.getBefore()); |
|
|
|
|
|
WxBrand brandAfter = brandMap.get(tableTriple.getAfter()); |
|
|
if (Objects.nonNull(brandBefore)) { |
|
|
if (Objects.nonNull(brandBefore)) { |
|
|
tableTriple.setBefore(brandBefore.getName()); |
|
|
tableTriple.setBefore(brandBefore.getName()); |
|
|
} |
|
|
} |
|
|
@@ -1024,26 +1024,35 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
.ge(InvestTaskEntity::getStatus, EnumTaskStatus.CREATED) |
|
|
.ge(InvestTaskEntity::getStatus, EnumTaskStatus.CREATED) |
|
|
.eq(InvestTaskEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); |
|
|
.eq(InvestTaskEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); |
|
|
result.put("customerTotal", customerService.count(new LambdaQueryWrapper<InvestCustomerEntity>() |
|
|
result.put("customerTotal", customerService.count(new LambdaQueryWrapper<InvestCustomerEntity>() |
|
|
.ge(InvestCustomerEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); |
|
|
|
|
|
|
|
|
.eq(InvestCustomerEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); |
|
|
result.put("taskToday", customerService.count(new LambdaQueryWrapper<InvestCustomerEntity>() |
|
|
result.put("taskToday", customerService.count(new LambdaQueryWrapper<InvestCustomerEntity>() |
|
|
.apply("date_format(create_date,'%Y-%m-%d') = {0}", DateUtils.format(new Date())) |
|
|
.apply("date_format(create_date,'%Y-%m-%d') = {0}", DateUtils.format(new Date())) |
|
|
.eq(InvestCustomerEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); |
|
|
.eq(InvestCustomerEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); |
|
|
result.put("customerImport", customerService.count(new LambdaQueryWrapper<InvestCustomerEntity>() |
|
|
|
|
|
|
|
|
result.put("customerImportant", customerService.count(new LambdaQueryWrapper<InvestCustomerEntity>() |
|
|
.eq(InvestCustomerEntity::getType, EnumCustomerType.INTENTIONAL) |
|
|
.eq(InvestCustomerEntity::getType, EnumCustomerType.INTENTIONAL) |
|
|
.eq(InvestCustomerEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); |
|
|
.eq(InvestCustomerEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); |
|
|
result.put("remindCount", remindService.count(new LambdaQueryWrapper<InvestRemindEntity>() |
|
|
|
|
|
.ge(InvestRemindEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); |
|
|
|
|
|
result.put("taskCreate", taskService.count(new LambdaQueryWrapper<InvestTaskEntity>() |
|
|
|
|
|
|
|
|
result.put("remindTotal", remindService.count(new LambdaQueryWrapper<InvestRemindEntity>() |
|
|
|
|
|
.eq(InvestRemindEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); |
|
|
|
|
|
result.put("taskUnassigned", taskService.count(new LambdaQueryWrapper<InvestTaskEntity>() |
|
|
.eq(InvestTaskEntity::getStatus, EnumTaskStatus.CREATED) |
|
|
.eq(InvestTaskEntity::getStatus, EnumTaskStatus.CREATED) |
|
|
.eq(InvestTaskEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); |
|
|
.eq(InvestTaskEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); |
|
|
//result.put("customerCreate", customerService.count(new LambdaQueryWrapper<InvestCustomerEntity>() |
|
|
|
|
|
// .eq(InvestCustomerEntity::getStatus, EnumTaskStatus.CREATED))); |
|
|
|
|
|
|
|
|
result.put("customerUnassigned", demandService.count(new LambdaQueryWrapper<InvestDemandEntity>() |
|
|
|
|
|
.eq(InvestDemandEntity::getTenantId, InvestUserContext.getUser().getTenantId()) |
|
|
|
|
|
.eq(InvestDemandEntity::getOwner, 0L))); |
|
|
} else { |
|
|
} else { |
|
|
result.put("taskTotal", taskService.count(new LambdaQueryWrapper<InvestTaskEntity>() |
|
|
result.put("taskTotal", taskService.count(new LambdaQueryWrapper<InvestTaskEntity>() |
|
|
.ge(InvestTaskEntity::getStatus, EnumTaskStatus.CREATED) |
|
|
.ge(InvestTaskEntity::getStatus, EnumTaskStatus.CREATED) |
|
|
.apply("`owner` REGEXP {0}", InvestUserContext.getUserId()))); |
|
|
.apply("`owner` REGEXP {0}", InvestUserContext.getUserId()))); |
|
|
result.put("customerTotal", demandService.count(new LambdaQueryWrapper<InvestDemandEntity>() |
|
|
result.put("customerTotal", demandService.count(new LambdaQueryWrapper<InvestDemandEntity>() |
|
|
.ge(InvestDemandEntity::getOwner, InvestUserContext.getUser().getTenantId()))); |
|
|
|
|
|
|
|
|
.eq(InvestDemandEntity::getOwner, InvestUserContext.getUser().getTenantId()))); |
|
|
|
|
|
result.put("taskToday", customerService.count(new LambdaQueryWrapper<InvestCustomerEntity>() |
|
|
|
|
|
.apply("`owner` REGEXP {0}", InvestUserContext.getUserId()) |
|
|
|
|
|
.apply("date_format(create_date,'%Y-%m-%d') = {0}", DateUtils.format(new Date())) |
|
|
|
|
|
.eq(InvestCustomerEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); |
|
|
|
|
|
result.put("customerToday", demandService.count(new LambdaQueryWrapper<InvestDemandEntity>() |
|
|
|
|
|
.eq(InvestDemandEntity::getOwner, InvestUserContext.getUser().getTenantId()) |
|
|
|
|
|
.apply("date_format(create_date,'%Y-%m-%d') = {0}", DateUtils.format(new Date())) |
|
|
|
|
|
.eq(InvestDemandEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); |
|
|
} |
|
|
} |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
@@ -1073,8 +1082,8 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
if (count > 0) { |
|
|
if (count > 0) { |
|
|
investTaskEntity.setStatus(EnumTaskStatus.INTENTION); |
|
|
investTaskEntity.setStatus(EnumTaskStatus.INTENTION); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private InvestFollowRecordVo buildFollowRecordItem(Map<Long, MallUserInfo> usersMap, InvestFollowRecordEntity item, |
|
|
private InvestFollowRecordVo buildFollowRecordItem(Map<Long, MallUserInfo> usersMap, InvestFollowRecordEntity item, |
|
|
@@ -1205,7 +1214,7 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
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 ; |
|
|
|
|
|
|
|
|
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()); |
|
|
brand = brandMap.get(costomerItem.getBrandId()); |
|
|
|