|
@@ -27,6 +27,7 @@ import com.storlead.trade.service.LiaisonTradeService;
|
|
|
import com.storlead.trade.service.SysDictService;
|
|
import com.storlead.trade.service.SysDictService;
|
|
|
import com.storlead.trade.vo.CustomerMailThreadVO;
|
|
import com.storlead.trade.vo.CustomerMailThreadVO;
|
|
|
import com.storlead.trade.vo.CustomerSourceDistributionVO;
|
|
import com.storlead.trade.vo.CustomerSourceDistributionVO;
|
|
|
|
|
+import com.storlead.trade.vo.CustomerStatsVO;
|
|
|
import com.storlead.trade.vo.CustomerVO;
|
|
import com.storlead.trade.vo.CustomerVO;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -631,4 +632,44 @@ public class CustomerTradeServiceImpl
|
|
|
});
|
|
});
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CustomerStatsVO getCustomerStats() {
|
|
|
|
|
+ // 统计基准:未删除 + 客户种类=10(客户,区别于线索=11)。
|
|
|
|
|
+ // 各类目均为在该基准上的独立计数(彼此可重叠,如某客户既可重点又可成交)。
|
|
|
|
|
+ Integer notDeleted = CommonConstant.DEL_FLAG_0;
|
|
|
|
|
+ int customerForm = 10;
|
|
|
|
|
+
|
|
|
|
|
+ long totalCustomerCount = this.count(new LambdaQueryWrapper<CustomerEntity>()
|
|
|
|
|
+ .eq(CustomerEntity::getIsDelete, notDeleted)
|
|
|
|
|
+ .eq(CustomerEntity::getCustomerForm, customerForm));
|
|
|
|
|
+
|
|
|
|
|
+ long keyCustomerCount = this.count(new LambdaQueryWrapper<CustomerEntity>()
|
|
|
|
|
+ .eq(CustomerEntity::getIsDelete, notDeleted)
|
|
|
|
|
+ .eq(CustomerEntity::getCustomerForm, customerForm)
|
|
|
|
|
+ .eq(CustomerEntity::getHasFollowCustomer, 1));
|
|
|
|
|
+
|
|
|
|
|
+ long dealCustomerCount = this.count(new LambdaQueryWrapper<CustomerEntity>()
|
|
|
|
|
+ .eq(CustomerEntity::getIsDelete, notDeleted)
|
|
|
|
|
+ .eq(CustomerEntity::getCustomerForm, customerForm)
|
|
|
|
|
+ .eq(CustomerEntity::getHasOrderForm, 1));
|
|
|
|
|
+
|
|
|
|
|
+ long publicCustomerCount = this.count(new LambdaQueryWrapper<CustomerEntity>()
|
|
|
|
|
+ .eq(CustomerEntity::getIsDelete, notDeleted)
|
|
|
|
|
+ .eq(CustomerEntity::getCustomerForm, customerForm)
|
|
|
|
|
+ .eq(CustomerEntity::getHasPublicCustomer, 1));
|
|
|
|
|
+
|
|
|
|
|
+ long invalidCustomerCount = this.count(new LambdaQueryWrapper<CustomerEntity>()
|
|
|
|
|
+ .eq(CustomerEntity::getIsDelete, notDeleted)
|
|
|
|
|
+ .eq(CustomerEntity::getCustomerForm, customerForm)
|
|
|
|
|
+ .eq(CustomerEntity::getHasGarbageCustomer, 1));
|
|
|
|
|
+
|
|
|
|
|
+ CustomerStatsVO vo = new CustomerStatsVO();
|
|
|
|
|
+ vo.setTotalCustomerCount(totalCustomerCount);
|
|
|
|
|
+ vo.setKeyCustomerCount(keyCustomerCount);
|
|
|
|
|
+ vo.setDealCustomerCount(dealCustomerCount);
|
|
|
|
|
+ vo.setPublicCustomerCount(publicCustomerCount);
|
|
|
|
|
+ vo.setInvalidCustomerCount(invalidCustomerCount);
|
|
|
|
|
+ return vo;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|