diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/user/MetaUserRegisterRankDTO.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/user/MetaUserRegisterRankDTO.java
new file mode 100644
index 000000000..52f3b7107
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/user/MetaUserRegisterRankDTO.java
@@ -0,0 +1,137 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.dto.user;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 用户注册排行
+ *
+ * @author qu elink@elink-cn.com
+ * @since v1.0.0 2020-03-26
+ */
+@Data
+public class MetaUserRegisterRankDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键
+ */
+ private String id;
+
+ /**
+ * 街道id
+ */
+ private String streetId;
+
+ /**
+ * 街道名称
+ */
+ private String streetName;
+
+ /**
+ * 用户总数
+ */
+ private Integer userCount;
+
+ /**
+ * 党员数
+ */
+ private Integer partyMemberCount;
+
+ /**
+ * 已注册居民
+ */
+ private Integer residentCount;
+
+ /**
+ * 为注册居民
+ */
+ private Integer unAuthorizedCount;
+
+ /**
+ * 年龄超过50岁
+ */
+ private Integer oldCount;
+
+ /**
+ * 老龄化比例
+ */
+ private BigDecimal oldPercent;
+
+ /**
+ * 50岁以下用户数量
+ */
+ private Integer youngCount;
+
+ /**
+ * 年轻化比例
+ */
+ private BigDecimal youngPercent;
+
+ /**
+ * 男
+ */
+ private Integer maleCount;
+
+ /**
+ * 女
+ */
+ private Integer femaleCount;
+
+ /**
+ * 未知性别
+ */
+ private Integer unknownSexCount;
+
+ /**
+ * 删除标记
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 注册时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/controller/MetaUserRegisterRankController.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/controller/MetaUserRegisterRankController.java
new file mode 100644
index 000000000..e3f049e58
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/controller/MetaUserRegisterRankController.java
@@ -0,0 +1,104 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.modules.user.controller;
+
+import com.elink.esua.epdc.commons.tools.page.PageData;
+import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
+import com.elink.esua.epdc.commons.tools.utils.Result;
+import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
+import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
+import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
+import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
+import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
+import com.elink.esua.epdc.dto.user.MetaUserRegisterRankDTO;
+import com.elink.esua.epdc.modules.user.excel.MetaUserRegisterRankExcel;
+import com.elink.esua.epdc.modules.user.service.MetaUserRegisterRankService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 用户注册排行
+ *
+ * @author qu elink@elink-cn.com
+ * @since v1.0.0 2020-03-26
+ */
+@RestController
+@RequestMapping("metauserregisterrank")
+public class MetaUserRegisterRankController {
+
+ @Autowired
+ private MetaUserRegisterRankService metaUserRegisterRankService;
+
+ @GetMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = metaUserRegisterRankService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id){
+ MetaUserRegisterRankDTO data = metaUserRegisterRankService.get(id);
+ return new Result().ok(data);
+ }
+
+ @PostMapping
+ public Result save(@RequestBody MetaUserRegisterRankDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ metaUserRegisterRankService.save(dto);
+ return new Result();
+ }
+
+ @PutMapping
+ public Result update(@RequestBody MetaUserRegisterRankDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ metaUserRegisterRankService.update(dto);
+ return new Result();
+ }
+
+ @DeleteMapping
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ metaUserRegisterRankService.delete(ids);
+ return new Result();
+ }
+
+ @GetMapping("export")
+ public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = metaUserRegisterRankService.list(params);
+ ExcelUtils.exportExcelToTarget(response, null, list, MetaUserRegisterRankExcel.class);
+ }
+ /***
+ * 定时任务用户注册排行导入数据
+ * @param
+ * @return com.elink.esua.epdc.commons.tools.utils.Result
+ * @author qushutong
+ * @date 2020/3/26 13:44
+ */
+ @GetMapping("toLeadUserRegisterRandData")
+ public Result toLeadUserRegisterRandData(){
+ return metaUserRegisterRankService.toLeadUserRegisterRandData();
+ }
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/dao/MetaUserRegisterRankDao.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/dao/MetaUserRegisterRankDao.java
new file mode 100644
index 000000000..f027e96ee
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/dao/MetaUserRegisterRankDao.java
@@ -0,0 +1,33 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.modules.user.dao;
+
+import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
+import com.elink.esua.epdc.modules.user.entity.MetaUserRegisterRankEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 用户注册排行
+ *
+ * @author qu elink@elink-cn.com
+ * @since v1.0.0 2020-03-26
+ */
+@Mapper
+public interface MetaUserRegisterRankDao extends BaseDao {
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/entity/MetaUserRegisterRankEntity.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/entity/MetaUserRegisterRankEntity.java
new file mode 100644
index 000000000..08f60b8be
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/entity/MetaUserRegisterRankEntity.java
@@ -0,0 +1,107 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.modules.user.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 用户注册排行
+ *
+ * @author qu elink@elink-cn.com
+ * @since v1.0.0 2020-03-26
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("meta_epdc_user_register_rank")
+public class MetaUserRegisterRankEntity extends BaseEpdcEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 街道id
+ */
+ private String streetId;
+
+ /**
+ * 街道名称
+ */
+ private String streetName;
+
+ /**
+ * 用户总数
+ */
+ private Integer userCount;
+
+ /**
+ * 党员数
+ */
+ private Integer partyMemberCount;
+
+ /**
+ * 已注册居民
+ */
+ private Integer residentCount;
+
+ /**
+ * 为注册居民
+ */
+ private Integer unAuthorizedCount;
+
+ /**
+ * 年龄超过50岁
+ */
+ private Integer oldCount;
+
+ /**
+ * 老龄化比例
+ */
+ private BigDecimal oldPercent;
+
+ /**
+ * 50岁以下用户数量
+ */
+ private Integer youngCount;
+
+ /**
+ * 年轻化比例
+ */
+ private BigDecimal youngPercent;
+
+ /**
+ * 男
+ */
+ private Integer maleCount;
+
+ /**
+ * 女
+ */
+ private Integer femaleCount;
+
+ /**
+ * 未知性别
+ */
+ private Integer unknownSexCount;
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/excel/MetaUserGridOpiningExcel.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/excel/MetaUserGridOpiningExcel.java
index 2da7a72da..d5eb48161 100644
--- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/excel/MetaUserGridOpiningExcel.java
+++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/excel/MetaUserGridOpiningExcel.java
@@ -31,53 +31,48 @@ import java.util.Date;
@Data
public class MetaUserGridOpiningExcel {
- @Excel(name = "主键")
- private String id;
+ @Excel(name = "网格名称")
+ private String allDeptNames;
- @Excel(name = "网格id")
- private Long gridId;
+ @Excel(name = "网格党建指导员姓名")
+ private String gridLeader;
@Excel(name = "用户总数")
- private String registerCount;
+ private int registerCount;
@Excel(name = "党员数")
- private String partyCount;
+ private int partyCount;
@Excel(name = "已注册居民")
- private String residentCount;
+ private int residentCount;
@Excel(name = "未注册居民")
- private String unAuthorizedCount;
+ private int unAuthorizedCount;
@Excel(name = "新闻发布数")
private String newsCount;
@Excel(name = "社群数")
- private String communityCount;
+ private int communityCount;
@Excel(name = "群成员数")
- private String communityMemberCount;
+ private int communityMemberCount;
@Excel(name = "群话题数")
- private String communityTopicCount;
+ private int communityTopicCount;
@Excel(name = "议题总数")
- private String eventCount;
+ private int eventCount;
@Excel(name = "项目数")
- private String itemCount;
+ private int itemCount;
@Excel(name = "项目已解决数")
- private String itemCloseCount;
+ private int itemCloseCount;
@Excel(name = "好评数")
- private String itemPraiseCount;
+ private int itemPraiseCount;
- @Excel(name = "网格名称")
- private String allDeptNames;
-
- @Excel(name = "网格党建指导员姓名")
- private String gridLeader;
@Excel(name = "删除标记")
private String delFlag;
diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/excel/MetaUserRegisterRankExcel.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/excel/MetaUserRegisterRankExcel.java
new file mode 100644
index 000000000..fba1d7a65
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/excel/MetaUserRegisterRankExcel.java
@@ -0,0 +1,96 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.modules.user.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 用户注册排行
+ *
+ * @author qu elink@elink-cn.com
+ * @since v1.0.0 2020-03-26
+ */
+@Data
+public class MetaUserRegisterRankExcel {
+
+ @Excel(name = "主键")
+ private String id;
+
+ @Excel(name = "街道id")
+ private String streetId;
+
+ @Excel(name = "街道名称")
+ private String streetName;
+
+ @Excel(name = "用户总数")
+ private Integer userCount;
+
+ @Excel(name = "党员数")
+ private Integer partyMemberCount;
+
+ @Excel(name = "已注册居民")
+ private Integer residentCount;
+
+ @Excel(name = "为注册居民")
+ private Integer unAuthorizedCount;
+
+ @Excel(name = "年龄超过50岁")
+ private Integer oldCount;
+
+ @Excel(name = "老龄化比例")
+ private BigDecimal oldPercent;
+
+ @Excel(name = "50岁以下用户数量")
+ private Integer youngCount;
+
+ @Excel(name = "年轻化比例")
+ private BigDecimal youngPercent;
+
+ @Excel(name = "男")
+ private Integer maleCount;
+
+ @Excel(name = "女")
+ private Integer femaleCount;
+
+ @Excel(name = "未知性别")
+ private Integer unknownSexCount;
+
+ @Excel(name = "删除标记")
+ private String delFlag;
+
+ @Excel(name = "乐观锁")
+ private Integer revision;
+
+ @Excel(name = "创建人")
+ private String createdBy;
+
+ @Excel(name = "注册时间")
+ private Date createdTime;
+
+ @Excel(name = "更新人")
+ private String updatedBy;
+
+ @Excel(name = "更新时间")
+ private Date updatedTime;
+
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/MetaUserRegisterRankService.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/MetaUserRegisterRankService.java
new file mode 100644
index 000000000..447a89e68
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/MetaUserRegisterRankService.java
@@ -0,0 +1,105 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.modules.user.service;
+
+import com.elink.esua.epdc.commons.mybatis.service.BaseService;
+import com.elink.esua.epdc.commons.tools.page.PageData;
+import com.elink.esua.epdc.commons.tools.utils.Result;
+import com.elink.esua.epdc.dto.user.MetaUserRegisterRankDTO;
+import com.elink.esua.epdc.modules.user.entity.MetaUserRegisterRankEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 用户注册排行
+ *
+ * @author qu elink@elink-cn.com
+ * @since v1.0.0 2020-03-26
+ */
+public interface MetaUserRegisterRankService extends BaseService {
+
+ /**
+ * 默认分页
+ *
+ * @param params
+ * @return PageData
+ * @author generator
+ * @date 2020-03-26
+ */
+ PageData page(Map params);
+
+ /**
+ * 默认查询
+ *
+ * @param params
+ * @return java.util.List
+ * @author generator
+ * @date 2020-03-26
+ */
+ List list(Map params);
+
+ /**
+ * 单条查询
+ *
+ * @param id
+ * @return MetaUserRegisterRankDTO
+ * @author generator
+ * @date 2020-03-26
+ */
+ MetaUserRegisterRankDTO get(String id);
+
+ /**
+ * 默认保存
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2020-03-26
+ */
+ void save(MetaUserRegisterRankDTO dto);
+
+ /**
+ * 默认更新
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2020-03-26
+ */
+ void update(MetaUserRegisterRankDTO dto);
+
+ /**
+ * 批量删除
+ *
+ * @param ids
+ * @return void
+ * @author generator
+ * @date 2020-03-26
+ */
+ void delete(String[] ids);
+
+ /***
+ * 导入用户注册排行
+ * @param
+ * @return com.elink.esua.epdc.commons.tools.utils.Result
+ * @author qushutong
+ * @date 2020/3/26 13:26
+ */
+ Result toLeadUserRegisterRandData();
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/UserAnalysisService.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/UserAnalysisService.java
index b55a398fb..95bd2edd4 100644
--- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/UserAnalysisService.java
+++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/UserAnalysisService.java
@@ -110,4 +110,13 @@ public interface UserAnalysisService {
* @date 2020/3/25 19:13
*/
List getToLeadGridOpenings(Map params);
+
+ /***
+ * 获取导入用户排行数据
+ * @param params
+ * @return java.util.List
+ * @author qushutong
+ * @date 2020/3/26 13:32
+ */
+ List getToLeadUserRegisterRandData(Map params);
}
diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/impl/MetaUserRegisterRankServiceImpl.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/impl/MetaUserRegisterRankServiceImpl.java
new file mode 100644
index 000000000..f3bdf02b5
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/impl/MetaUserRegisterRankServiceImpl.java
@@ -0,0 +1,118 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.modules.user.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
+import com.elink.esua.epdc.commons.tools.page.PageData;
+import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
+import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
+import com.elink.esua.epdc.commons.tools.utils.Result;
+import com.elink.esua.epdc.datasources.DataSourceNames;
+import com.elink.esua.epdc.datasources.annotation.DataSource;
+import com.elink.esua.epdc.dto.user.MetaUserRegisterRankDTO;
+import com.elink.esua.epdc.dto.user.result.UserDataRankResultDTO;
+import com.elink.esua.epdc.modules.user.dao.MetaUserRegisterRankDao;
+import com.elink.esua.epdc.modules.user.entity.MetaUserRegisterRankEntity;
+import com.elink.esua.epdc.modules.user.service.MetaUserRegisterRankService;
+import com.elink.esua.epdc.modules.user.service.UserAnalysisService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 用户注册排行
+ *
+ * @author qu elink@elink-cn.com
+ * @since v1.0.0 2020-03-26
+ */
+@Service
+public class MetaUserRegisterRankServiceImpl extends BaseServiceImpl implements MetaUserRegisterRankService {
+
+ @Autowired
+ private UserAnalysisService userAnalysisService;
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, MetaUserRegisterRankDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, MetaUserRegisterRankDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params){
+ String id = (String)params.get(FieldConstant.ID_HUMP);
+
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
+
+ return wrapper;
+ }
+
+ @Override
+ public MetaUserRegisterRankDTO get(String id) {
+ MetaUserRegisterRankEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, MetaUserRegisterRankDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(MetaUserRegisterRankDTO dto) {
+ MetaUserRegisterRankEntity entity = ConvertUtils.sourceToTarget(dto, MetaUserRegisterRankEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(MetaUserRegisterRankDTO dto) {
+ MetaUserRegisterRankEntity entity = ConvertUtils.sourceToTarget(dto, MetaUserRegisterRankEntity.class);
+ updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(String[] ids) {
+ // 逻辑删除(@TableLogic 注解)
+ baseDao.deleteBatchIds(Arrays.asList(ids));
+ }
+
+ @Override
+ @DataSource(name = DataSourceNames.TWELVE)
+ public Result toLeadUserRegisterRandData() {
+ // 获取导出数据
+ List toLeadUserRegisterRandData = userAnalysisService.getToLeadUserRegisterRandData(new HashMap<>());
+ // 导入数据
+ List metaUserRegisterRankEntities = ConvertUtils.sourceToTarget(toLeadUserRegisterRandData, MetaUserRegisterRankEntity.class);
+ return insertBatch(metaUserRegisterRankEntities) ? new Result():new Result().error("导入注册用户排行失败");
+ }
+
+}
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/impl/UserAnalysisServiceImpl.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/impl/UserAnalysisServiceImpl.java
index 9815dfa21..6b80a5320 100644
--- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/impl/UserAnalysisServiceImpl.java
+++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/impl/UserAnalysisServiceImpl.java
@@ -143,6 +143,11 @@ public class UserAnalysisServiceImpl extends BaseServiceImpl page = getPage(params);
+ List list = getListUserDataRankResultDro(params);
+ return new PageData<>(list, page.getTotal());
+ }
+
+ private List getListUserDataRankResultDro(Map params) {
List list = baseDao.selectListUserDataRank(params);
if (CollUtil.isNotEmpty(list)) {
@@ -177,7 +182,7 @@ public class UserAnalysisServiceImpl extends BaseServiceImpl(list, page.getTotal());
+ return list;
}
@@ -297,5 +302,10 @@ public class UserAnalysisServiceImpl extends BaseServiceImpl getToLeadUserRegisterRandData(Map params) {
+ return getListUserDataRankResultDro(params);
+ }
+
}
diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/MetaUserRegisterRankDao.xml b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/MetaUserRegisterRankDao.xml
new file mode 100644
index 000000000..d7fd20494
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/MetaUserRegisterRankDao.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/UserAnalysisDao.xml b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/UserAnalysisDao.xml
index 32b76a81e..2ba9cc09a 100644
--- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/UserAnalysisDao.xml
+++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/UserAnalysisDao.xml
@@ -44,6 +44,7 @@
AND uu.CREATED_TIME BETWEEN #{startTime} AND #{endTime}
+ AND ad2.id is NOT NULL
AND ad.id IS NOT NULL
) t GROUP BY t.streetId
) t1