diff --git a/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestCustomerEntity.java b/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestCustomerEntity.java index 4954c2b65..76c828ec0 100755 --- a/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestCustomerEntity.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestCustomerEntity.java @@ -1,8 +1,6 @@ package com.iformall.domain.po.invest; import cn.afterturn.easypoi.excel.annotation.Excel; -import com.baomidou.mybatisplus.annotation.FieldStrategy; -import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; @@ -11,7 +9,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.iformall.common.LogColumn; import com.iformall.enums.EnumCustomerRatingType; import com.iformall.enums.EnumCustomerType; -import com.iformall.enums.EnumInvestChannel; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java b/mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java index 2e305d9fc..482822591 100644 --- a/mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java @@ -63,4 +63,6 @@ public interface InvestBizService { InvestFollowRecordVo findFollowRecordById(Long id) ; + Map statistics(); + } diff --git a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java index 539a4dd01..549651893 100644 --- a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java @@ -1009,6 +1009,38 @@ public class InvestBizServiceImpl implements InvestBizService { return buildFollowRecordItem(usersMap, followRecordEntity, customerEntity, brand); } + @Override + public Map statistics() { + Map result = new HashMap<>(); + if (Objects.isNull(InvestUserContext.getDataUser())) { + result.put("taskTotal", taskService.count(new LambdaQueryWrapper() + .ge(InvestTaskEntity::getStatus, EnumTaskStatus.CREATED) + .eq(InvestTaskEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); + result.put("customerTotal", customerService.count(new LambdaQueryWrapper() + .ge(InvestCustomerEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); + result.put("taskToday", customerService.count(new LambdaQueryWrapper() + .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() + .eq(InvestCustomerEntity::getType, EnumCustomerType.INTENTIONAL) + .eq(InvestCustomerEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); + result.put("remindCount", remindService.count(new LambdaQueryWrapper() + .ge(InvestRemindEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); + result.put("taskCreate", taskService.count(new LambdaQueryWrapper() + .eq(InvestTaskEntity::getStatus, EnumTaskStatus.CREATED) + .eq(InvestTaskEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); + //result.put("customerCreate", customerService.count(new LambdaQueryWrapper() + // .eq(InvestCustomerEntity::getStatus, EnumTaskStatus.CREATED))); + } else { + result.put("taskTotal", taskService.count(new LambdaQueryWrapper() + .ge(InvestTaskEntity::getStatus, EnumTaskStatus.CREATED) + .apply("`owner` REGEXP {0}", InvestUserContext.getUserId()))); + result.put("customerTotal", demandService.count(new LambdaQueryWrapper() + .ge(InvestDemandEntity::getOwner, InvestUserContext.getUser().getTenantId()))); + } + return result; + } + private void syncTargetStatus(InvestTaskEntity investTaskEntity) { //if (!Objects.equals(investTaskEntity.getTargetType(), EnumInvestType.RENT)) { // return;