Browse Source

[招商]adjust

release_toaliyun_real
Burce 6 years ago
parent
commit
e3320c7d6a
4 changed files with 42 additions and 22 deletions
  1. +10
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestController.java
  2. +2
    -0
      mallinkService/src/main/java/com/iformall/service/invest/InvestHelper.java
  3. +30
    -21
      mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java
  4. +0
    -1
      mallinkService/src/main/java/com/iformall/service/invest/impl/InvestTaskServiceImpl.java

+ 10
- 0
mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestController.java View File

@@ -47,4 +47,14 @@ public class InvestController extends InvestBaseController {
return execute(shopId, p -> bizService.shopRentInfo(p));
}

/**
* 招商概览
*/
@ApiOperation("招商概览")
@SystemControllerLog(description = "招商概览")
@GetMapping("/overview")
public InvestResultData<Map> statistics() {
return execute(null, p -> bizService.statistics());
}

}

+ 2
- 0
mallinkService/src/main/java/com/iformall/service/invest/InvestHelper.java View File

@@ -2,6 +2,7 @@ package com.iformall.service.invest;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.Multimaps;
@@ -9,6 +10,7 @@ import com.iformall.common.ErrorCode;
import com.iformall.domain.po.invest.InvestBaseEntity;
import com.iformall.domain.po.invest.InvestTaskEntity;
import com.iformall.domain.vo.invest.InvestPageQuery;
import com.iformall.domain.vo.invest.InvestUserContext;
import com.iformall.enums.EnumTaskStatus;
import com.iformall.exception.MallinkException;
import com.iformall.utils.JsonUtil;


+ 30
- 21
mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java View File

@@ -95,13 +95,13 @@ public class InvestBizServiceImpl implements InvestBizService {
if (CollectionUtils.isEmpty(demandList) && Objects.nonNull(params.getDemandOwner())) {
return investPage;
} else {
queryWrapperCustomer.in(CollectionUtils.isNotEmpty(demandList),InvestCustomerEntity::getId, getIds(demandList, InvestDemandEntity::getCustomerId));
queryWrapperCustomer.in(CollectionUtils.isNotEmpty(demandList), InvestCustomerEntity::getId, getIds(demandList, InvestDemandEntity::getCustomerId));
}
} else {
if (CollectionUtils.isEmpty(demandList)) {
return investPage;
} 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);
}
//记数
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) {
setRedisValue(importKey, "1", "0", "0", "1", true);
@@ -655,7 +655,7 @@ public class InvestBizServiceImpl implements InvestBizService {
}
remindPageQuery.setQueryData(remindQuery);
LambdaQueryWrapper<InvestRemindEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(InvestRemindEntity::getTenantId,InvestUserContext.getUser().getTenantId());
queryWrapper.eq(InvestRemindEntity::getTenantId, InvestUserContext.getUser().getTenantId());
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())
@@ -750,7 +750,7 @@ public class InvestBizServiceImpl implements InvestBizService {
//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,"合同信息不存在");
InvestHelper.notNull(contract, "合同信息不存在");
Map<String, Object> map = new HashMap<>();
map.put("startdate", contract.getRentalStartDate());
map.put("enddate", contract.getRentalEndDate());
@@ -811,7 +811,7 @@ public class InvestBizServiceImpl implements InvestBizService {
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(),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 -> {
Object column = tableTriple.getColumn();
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)) {
tableTriple.setBefore(businessBefore.getTitle());
}
@@ -954,8 +954,8 @@ public class InvestBizServiceImpl implements InvestBizService {
tableTriple.setAfter(businessAfter.getTitle());
}
} 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)) {
tableTriple.setBefore(brandBefore.getName());
}
@@ -1024,26 +1024,35 @@ public class InvestBizServiceImpl implements InvestBizService {
.ge(InvestTaskEntity::getStatus, EnumTaskStatus.CREATED)
.eq(InvestTaskEntity::getTenantId, InvestUserContext.getUser().getTenantId())));
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>()
.apply("date_format(create_date,'%Y-%m-%d') = {0}", DateUtils.format(new Date()))
.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::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::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 {
result.put("taskTotal", taskService.count(new LambdaQueryWrapper<InvestTaskEntity>()
.ge(InvestTaskEntity::getStatus, EnumTaskStatus.CREATED)
.apply("`owner` REGEXP {0}", InvestUserContext.getUserId())));
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;
}
@@ -1073,8 +1082,8 @@ public class InvestBizServiceImpl implements InvestBizService {
if (count > 0) {
investTaskEntity.setStatus(EnumTaskStatus.INTENTION);
}
}
}
}
}

private InvestFollowRecordVo buildFollowRecordItem(Map<Long, MallUserInfo> usersMap, InvestFollowRecordEntity item,
@@ -1205,7 +1214,7 @@ public class InvestBizServiceImpl implements InvestBizService {
for (InvestCustomerEntity costomerItem : customers) {
InvestDemandEntity demandItem = demindsMap.get(costomerItem.getId());
WxShop shop = null;
WxBrand brand = null ;
WxBrand brand = null;
if (Objects.nonNull(demandItem)) {
shop = shopsMap.get(demandItem.getTargetId());
brand = brandMap.get(costomerItem.getBrandId());


+ 0
- 1
mallinkService/src/main/java/com/iformall/service/invest/impl/InvestTaskServiceImpl.java View File

@@ -15,7 +15,6 @@ import com.iformall.service.MallUserInfoService;
import com.iformall.service.WxShopService;
import com.iformall.service.invest.InvestHelper;
import com.iformall.service.invest.InvestTaskService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


Loading…
Cancel
Save