Browse Source

用户注册排行导入元数据

feature/dangjian
曲树通 6 years ago
parent
commit
1ee289ee05
  1. 137
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/user/MetaUserRegisterRankDTO.java
  2. 104
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/controller/MetaUserRegisterRankController.java
  3. 33
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/dao/MetaUserRegisterRankDao.java
  4. 107
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/entity/MetaUserRegisterRankEntity.java
  5. 35
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/excel/MetaUserGridOpiningExcel.java
  6. 96
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/excel/MetaUserRegisterRankExcel.java
  7. 105
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/MetaUserRegisterRankService.java
  8. 9
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/UserAnalysisService.java
  9. 118
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/impl/MetaUserRegisterRankServiceImpl.java
  10. 12
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/impl/UserAnalysisServiceImpl.java
  11. 30
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/MetaUserRegisterRankDao.xml
  12. 1
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/UserAnalysisDao.xml

137
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

104
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<PageData<MetaUserRegisterRankDTO>> page(@RequestParam Map<String, Object> params){
PageData<MetaUserRegisterRankDTO> page = metaUserRegisterRankService.page(params);
return new Result<PageData<MetaUserRegisterRankDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<MetaUserRegisterRankDTO> get(@PathVariable("id") String id){
MetaUserRegisterRankDTO data = metaUserRegisterRankService.get(id);
return new Result<MetaUserRegisterRankDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<MetaUserRegisterRankDTO> 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();
}
}

33
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<MetaUserRegisterRankEntity> {
}

107
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

35
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;

96
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

105
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<MetaUserRegisterRankEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<MetaUserRegisterRankDTO>
* @author generator
* @date 2020-03-26
*/
PageData<MetaUserRegisterRankDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<MetaUserRegisterRankDTO>
* @author generator
* @date 2020-03-26
*/
List<MetaUserRegisterRankDTO> list(Map<String, Object> 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();
}

9
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<GridOpeningResultDTO> getToLeadGridOpenings(Map<String, Object> params);
/***
* 获取导入用户排行数据
* @param params
* @return java.util.List<com.elink.esua.epdc.dto.user.result.UserDataRankResultDTO>
* @author qushutong
* @date 2020/3/26 13:32
*/
List<UserDataRankResultDTO> getToLeadUserRegisterRandData(Map<String, Object> params);
}

118
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<MetaUserRegisterRankDao, MetaUserRegisterRankEntity> implements MetaUserRegisterRankService {
@Autowired
private UserAnalysisService userAnalysisService;
@Override
public PageData<MetaUserRegisterRankDTO> page(Map<String, Object> params) {
IPage<MetaUserRegisterRankEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, MetaUserRegisterRankDTO.class);
}
@Override
public List<MetaUserRegisterRankDTO> list(Map<String, Object> params) {
List<MetaUserRegisterRankEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, MetaUserRegisterRankDTO.class);
}
private QueryWrapper<MetaUserRegisterRankEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<MetaUserRegisterRankEntity> 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<UserDataRankResultDTO> toLeadUserRegisterRandData = userAnalysisService.getToLeadUserRegisterRandData(new HashMap<>());
// 导入数据
List<MetaUserRegisterRankEntity> metaUserRegisterRankEntities = ConvertUtils.sourceToTarget(toLeadUserRegisterRandData, MetaUserRegisterRankEntity.class);
return insertBatch(metaUserRegisterRankEntities) ? new Result():new Result().error("导入注册用户排行失败");
}
}

12
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<UserAnalysisDao, Us
UserDetail userDetail = SecurityUser.getUser();
params.put("deptIdList", userDetail.getDeptIdList());
IPage<UserDataRankResultDTO> page = getPage(params);
List<UserDataRankResultDTO> list = getListUserDataRankResultDro(params);
return new PageData<>(list, page.getTotal());
}
private List<UserDataRankResultDTO> getListUserDataRankResultDro(Map<String, Object> params) {
List<UserDataRankResultDTO> list = baseDao.selectListUserDataRank(params);
if (CollUtil.isNotEmpty(list)) {
@ -177,7 +182,7 @@ public class UserAnalysisServiceImpl extends BaseServiceImpl<UserAnalysisDao, Us
}
}
}
return new PageData<>(list, page.getTotal());
return list;
}
@ -297,5 +302,10 @@ public class UserAnalysisServiceImpl extends BaseServiceImpl<UserAnalysisDao, Us
return list;
}
@Override
public List<UserDataRankResultDTO> getToLeadUserRegisterRandData(Map<String, Object> params) {
return getListUserDataRankResultDro(params);
}
}

30
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/MetaUserRegisterRankDao.xml

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.modules.user.dao.MetaUserRegisterRankDao">
<resultMap type="com.elink.esua.epdc.modules.user.entity.MetaUserRegisterRankEntity" id="metaUserRegisterRankMap">
<result property="id" column="ID"/>
<result property="streetId" column="STREET_ID"/>
<result property="streetName" column="STREET_NAME"/>
<result property="userCount" column="USER_COUNT"/>
<result property="partyMemberCount" column="PARTY_MEMBER_COUNT"/>
<result property="residentCount" column="RESIDENT_COUNT"/>
<result property="unAuthorizedCount" column="UN_AUTHORIZED_COUNT"/>
<result property="oldCount" column="OLD_COUNT"/>
<result property="oldPercent" column="OLD_PERCENT"/>
<result property="youngCount" column="YOUNG_COUNT"/>
<result property="youngPercent" column="YOUNG_PERCENT"/>
<result property="maleCount" column="MALE_COUNT"/>
<result property="femaleCount" column="FEMALE_COUNT"/>
<result property="unknownSexCount" column="UNKNOWN_SEX_COUNT"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

1
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/UserAnalysisDao.xml

@ -44,6 +44,7 @@
<if test="startTime != null and endTime != null and endTime != ''">
AND uu.CREATED_TIME BETWEEN #{startTime} AND #{endTime}
</if>
AND ad2.id is NOT NULL
AND ad.id IS NOT NULL
) t GROUP BY t.streetId
) t1

Loading…
Cancel
Save