Browse Source

Merge remote-tracking branch 'remotes/origin/dev' into shibei_master

# Conflicts:
#	epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
release
jianjun 4 years ago
parent
commit
dbe45fdfa7
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java
  2. 37
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/GridLivelyFormDTO.java
  3. 20
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridDateIdResultDTO.java
  4. 33
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridLivelyResultDTO.java
  5. 29
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java
  6. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java
  7. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolRecordDao.java
  8. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java
  9. 72
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/GridLivelyExcel.java
  10. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java
  11. 13
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  12. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java
  13. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  14. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  15. 107
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  16. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
  17. 16
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml
  18. 13
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml
  19. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java
  20. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java
  21. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java
  22. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml
  23. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  24. 38
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  25. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java
  26. 19
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java
  27. 47
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java

@ -95,6 +95,8 @@ public interface StrConstant {
String SPECIAL_CUSTOMER = "150282ed25c14ff0785e7e06283b6283";
//平音客户
String PY_CUSTOMER = "6f203e30de1a65aab7e69c058826cd80";
//平音客户跟组织Id
String PY_ROOT_AGENCY = "53613e1c5de6ed473467f0159a10b135";
/**
* 单位积分,积分上限积分说明积分事件

37
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/GridLivelyFormDTO.java

@ -0,0 +1,37 @@
package com.epmet.dataaggre.dto.govorg.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @Description 网格活跃度-接口入参
* @Author sun
*/
@Data
public class GridLivelyFormDTO implements Serializable {
private static final long serialVersionUID = -3651225675593357002L;
public interface Grid extends CustomerClientShowGroup {
}
/**
* 组织Id
*/
@NotBlank(message = "组织ID不能为空", groups = {Grid.class})
private String agencyId;
/**
* 起始查询时间yyyyMMdd
*/
@NotBlank(message = "起始查询时间不能为空", groups = {Grid.class})
private String startTime;
/**
* 结束查询时间yyyyMMdd
*/
@NotBlank(message = "结束查询时间不能为空", groups = {Grid.class})
private String endTime;
}

20
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridDateIdResultDTO.java

@ -0,0 +1,20 @@
package com.epmet.dataaggre.dto.govorg.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 网格下按天的上报事件或直接立项数据-接口返参
* @Author sun
*/
@Data
public class GridDateIdResultDTO implements Serializable {
private static final long serialVersionUID = -4304356050545598564L;
//网格Id
private String gridId;
//日维度Id
private String dateId;
//网格所属组织的所有上级Id
private String pids;
}

33
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridLivelyResultDTO.java

@ -0,0 +1,33 @@
package com.epmet.dataaggre.dto.govorg.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 网格活跃度-接口返参
* @Author sun
*/
@Data
public class GridLivelyResultDTO implements Serializable {
private static final long serialVersionUID = -4304356050545598564L;
//组织Id
private String agencyId;
//组织名称
private String agencyName;
//组织下所有网格总数
private Integer gridSumNum;
//活跃网格数
private Integer gridLivelyNum;
//活跃网格数占比
private String gridLivelyRatio;
//正常运行网格数
private Integer gridOrdinaryNum;
//正常运行网格数占比
private String gridOrdinaryRatio;
//僵尸网格数
private Integer gridLazyNum;
//僵尸网格数占比
private String gridLazyRatio;
}

29
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java

@ -5,6 +5,7 @@ import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -26,6 +27,7 @@ import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.enums.GridMemberDataAnalysisEnums;
import com.epmet.dataaggre.service.AggreGridService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dto.form.patrol.PcworkRecordListFormDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
@ -373,4 +375,31 @@ public class GovOrgController {
sb.append("的工作统计");
return sb.toString();
}
/**
* @Description 查询组织的直属下级组织下网格活跃度统计查平阴实际是查的下边八个街道的活跃程度
* @author sun
* 网格按运行情况分为活跃网格正常运行网格和僵尸网格三个类别
* 以自然周为计量单位对末级网格运行情况进行考核
* 1周内每个末级网格有5天及5天以上上传事件或开展例行工作的为活跃网格
* 有2天及2天以上5天以下上传事件或开展例行工作的为正常运行网格
* 只有1天上传事件或开展例行工作的为僵尸网格
*/
@PostMapping("gridlively")
public Result<List<GridLivelyResultDTO>> grdiLively(@RequestBody GridLivelyFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GridLivelyFormDTO.Grid.class);
return new Result<List<GridLivelyResultDTO>>().ok(govOrgService.grdiLively(formDTO));
}
/**
* @Author sun
* @Description 查询组织的直属下级组织下网格活跃度统计--文件导出
**/
@NoRepeatSubmit
@PostMapping("export")
public void pcworkRecordListExport(HttpServletResponse response, @RequestBody GridLivelyFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GridLivelyFormDTO.Grid.class);
govOrgService.grdiLivelyExport(response, formDTO);
}
}

8
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java

@ -25,6 +25,8 @@ import com.epmet.dataaggre.dto.datastats.result.*;
import com.epmet.dataaggre.dto.epmetuser.FactIcuserCategoryAnalysisDailyDTO;
import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO;
import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridDateIdResultDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO;
@ -358,4 +360,10 @@ public interface DataStatsDao {
@Param("orgId")String orgId,
@Param("dateId") String dateId,
@Param("configIds") List<String> configIds);
/**
* @Description 查询直属下级组织下网格在查询时间段内存在上报事件(直接立项)数的网格一天一条
* @author sun
*/
List<GridDateIdResultDTO> gridDateProjectIncrList(GridLivelyFormDTO formDTO);
}

8
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolRecordDao.java

@ -22,6 +22,8 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.form.StaffListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.result.StaffListResultDTO;
import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridDateIdResultDTO;
import com.epmet.dataaggre.entity.epmetuser.StaffPatrolRecordEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -60,4 +62,10 @@ public interface StaffPatrolRecordDao extends BaseDao<StaffPatrolRecordEntity> {
* @author sun
*/
List<StaffListResultDTO> gridMemberPatrol(GridMemberPatrolListFormDTO formDTO);
/**
* @Description 查询直属下级组织下网格在查询时间段内存在例行工作次数的网格
* @author sun
*/
List<GridDateIdResultDTO> gridDateRoutineWorkList(GridLivelyFormDTO formDTO);
}

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java

@ -23,8 +23,8 @@ import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
/**
* 机关单位信息表
@ -100,4 +100,9 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
*/
List<String> getOrgList(@Param("staffId") String staffId);
/**
* @Description 查询当前组织的直属下级组织列表及组织下的网格总数
* @author sun
*/
LinkedList<GridLivelyResultDTO> subAgencyListAndGridSumNum(@Param("agencyId") String agencyId);
}

72
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/GridLivelyExcel.java

@ -0,0 +1,72 @@
/**
* 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.epmet.dataaggre.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
/**
* @Description 网格活跃度文件导出-接口返参
* @Author sun
*/
@Data
public class GridLivelyExcel {
@ExcelProperty("组织ID")
@ExcelIgnore
private String agencyId;
//组织名称
@ExcelProperty("组织名称")
@ColumnWidth(15)
private String agencyName;
//组织下所有网格总数
@ExcelProperty("网格总数")
@ColumnWidth(15)
private Integer gridSumNum;
//活跃网格数
@ExcelProperty("活跃网格数")
@ColumnWidth(15)
private Integer gridLivelyNum;
//活跃网格数占比
@ExcelProperty("活跃网格数占比")
@ColumnWidth(15)
private String gridLivelyRatio;
//正常运行网格数
@ExcelProperty("正常运行网格数")
@ColumnWidth(15)
private Integer gridOrdinaryNum;
//正常运行网格数占比
@ExcelProperty("正常运行网格数占比")
@ColumnWidth(15)
private String gridOrdinaryRatio;
//僵尸网格数
@ExcelProperty("僵尸网格数")
@ColumnWidth(15)
private Integer gridLazyNum;
//僵尸网格数占比
@ExcelProperty("僵尸网格数占比")
@ColumnWidth(15)
private String gridLazyRatio;
}

8
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java

@ -6,6 +6,8 @@ import com.epmet.dataaggre.dto.datastats.result.*;
import com.epmet.dataaggre.dto.epmetuser.FactIcuserCategoryAnalysisDailyDTO;
import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO;
import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridDateIdResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectMonthIncrResultDTO;
@ -284,4 +286,10 @@ public interface DataStatsService {
List<FactIcuserCategoryAnalysisDailyDTO> queryGridIcUserCategoryData(String orgId, String dateId, List<String> configIds);
List<FactIcuserCategoryAnalysisDailyDTO> queryAgencyIcUserCategoryData(String gridPids, String orgId,String dateId, List<String> configIds);
/**
* @Description 查询直属下级组织下网格在查询时间段内存在上报事件(直接立项)数的网格一天一条
* @author sun
*/
List<GridDateIdResultDTO> getGridDateProjectIncrList(GridLivelyFormDTO formDTO);
}

13
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java

@ -24,7 +24,9 @@ import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridDateIdResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO;
@ -2187,4 +2189,13 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve
}
return dataStatsDao.queryAgencyIcUserCategoryData(gridPids,orgId,dateId,configIds);
}
/**
* @Description 查询直属下级组织下网格在查询时间段内存在上报事件(直接立项)数的网格一天一条
* @author sun
*/
@Override
public List<GridDateIdResultDTO> getGridDateProjectIncrList(GridLivelyFormDTO formDTO) {
return dataStatsDao.gridDateProjectIncrList(formDTO);
}
}

8
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java

@ -2,8 +2,10 @@ package com.epmet.dataaggre.service.epmetuser;
import com.epmet.dataaggre.dto.epmetuser.form.*;
import com.epmet.dataaggre.dto.epmetuser.result.*;
import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridDateIdResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectAnalysisResultDTO;
import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity;
@ -184,4 +186,10 @@ public interface EpmetUserService {
* @return
*/
List<IcUserCategoryResultDTO> queryIcUserCategoryData(IcUserCategoryFormDTO formDTO);
/**
* @Description 查询直属下级组织下网格在查询时间段内存在例行工作次数的网格
* @author sun
*/
List<GridDateIdResultDTO> getGridDateRoutineWorkList(GridLivelyFormDTO formDTO);
}

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -23,8 +23,10 @@ import com.epmet.dataaggre.dto.epmetuser.result.*;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridDateIdResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffOrgRelationResultDTO;
@ -816,6 +818,14 @@ public class EpmetUserServiceImpl implements EpmetUserService {
return resList;
}
/**
* @Description 查询直属下级组织下网格在查询时间段内存在例行工作次数的网格
* @author sun
*/
@Override
public List<GridDateIdResultDTO> getGridDateRoutineWorkList(GridLivelyFormDTO formDTO) {
return staffPatrolRecordDao.gridDateRoutineWorkList(formDTO);
}
}

18
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java

@ -4,14 +4,12 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.form.NextAreaCodeFormDTO;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.form.SubOrgFormDTO;
import com.epmet.dataaggre.dto.govorg.form.*;
import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@ -172,4 +170,16 @@ public interface GovOrgService {
* @date 2021/11/5 2:57 下午
*/
CustomerGridDTO getGridInfo(String gridId);
/**
* @Description 查询组织的直属下级组织下网格活跃度统计查平阴实际是查的下边八个街道的活跃程度
* @author sun
*/
List<GridLivelyResultDTO> grdiLively(GridLivelyFormDTO formDTO);
/**
* @Author sun
* @Description 查询组织的直属下级组织下网格活跃度统计--文件导出
**/
void grdiLivelyExport(HttpServletResponse response, GridLivelyFormDTO formDTO);
}

107
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java

@ -1,5 +1,8 @@
package com.epmet.dataaggre.service.govorg.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
@ -8,19 +11,20 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.govorg.*;
import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.StaffRoleListResultDTO;
import com.epmet.dataaggre.dto.govorg.*;
import com.epmet.dataaggre.dto.govorg.form.NextAreaCodeFormDTO;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.form.SubOrgFormDTO;
import com.epmet.dataaggre.dto.govorg.form.*;
import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.excel.GridLivelyExcel;
import com.epmet.dataaggre.service.commonservice.AreaCodeService;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dataaggre.service.opercrm.CustomerRelation;
@ -30,6 +34,9 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@ -58,6 +65,8 @@ public class GovOrgServiceImpl implements GovOrgService {
private CustomerStaffGridDao customerStaffGridDao;
@Autowired
private EpmetUserService epmetUserService;
@Autowired
private DataStatsService dataStatsService;
/**
* @param staffId
@ -590,5 +599,95 @@ public class GovOrgServiceImpl implements GovOrgService {
return customerGridDao.getGridInfo(gridId);
}
/**
* @Description 查询组织的直属下级组织下网格活跃度统计查平阴实际是查的下边八个街道的活跃程度
* @author sun
* 网格按运行情况分为活跃网格正常运行网格和僵尸网格三个类别
* 以自然周为计量单位对末级网格运行情况进行考核
* 1周内每个末级网格有5天及5天以上上传事件或开展例行工作的为活跃网格
* 有2天及2天以上5天以下上传事件或开展例行工作的为正常运行网格
* 只有1天上传事件或开展例行工作的为僵尸网格
*/
@Override
public List<GridLivelyResultDTO> grdiLively(GridLivelyFormDTO formDTO) {
//1.查询当前组织的直属下级组织列表及组织下的网格总数
LinkedList<GridLivelyResultDTO> subList = customerAgencyDao.subAgencyListAndGridSumNum(formDTO.getAgencyId());
//2.查询直属下级组织下网格在查询时间段内存在例行工作次数的网格,一天一条
List<GridDateIdResultDTO> workList = epmetUserService.getGridDateRoutineWorkList(formDTO);
//3.查询直属下级组织下网格在查询时间段内存在上报事件(直接立项)数的网格,一天一条
List<GridDateIdResultDTO> projectList = dataStatsService.getGridDateProjectIncrList(formDTO);
//4.汇总数据,一个网格一天只记录一条数据,这条数据可能是例行工作的也可能是上报事件的,也可能某一天两个数都有,但只记录一条
Set<String> map = workList.stream().map(o -> o.getGridId() + o.getDateId()).collect(Collectors.toSet());
projectList.stream().filter(pro -> !map.contains(pro.getGridId() + pro.getDateId())).forEach(p -> workList.add(p));
//5.按组织封装数据
//计算百分比使用,保留小数点后两位
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.TWO);
subList.forEach(sub -> {
Map<String, Integer> hash = new HashMap<>();
workList.forEach(w -> {
if (w.getPids().contains(sub.getAgencyId())) {
if (hash.containsKey(w.getGridId())) {
hash.put(w.getGridId(), hash.get(w.getGridId()) + NumConstant.ONE);
} else {
hash.put(w.getGridId(), NumConstant.ONE);
}
}
});
//活跃网格数、普通网格数、僵尸网格数
int gridLivelyNum = 0;
int gridOrdinaryNum = 0;
for (Integer val : hash.values()) {
if (val >= NumConstant.FIVE) {
gridLivelyNum++;
} else if (val >= NumConstant.TWO && val < NumConstant.FIVE) {
gridOrdinaryNum++;
}
}
sub.setGridLivelyNum(gridLivelyNum);
sub.setGridLivelyRatio((sub.getGridSumNum() == 0 || gridLivelyNum > sub.getGridSumNum()) ? "0%" : numberFormat.format(((float) gridLivelyNum / (float) sub.getGridSumNum()) * 100) + "%");
sub.setGridOrdinaryNum(gridOrdinaryNum);
sub.setGridOrdinaryRatio((sub.getGridSumNum() == 0 || gridOrdinaryNum > sub.getGridSumNum()) ? "0%" : numberFormat.format(((float) gridOrdinaryNum / (float) sub.getGridSumNum()) * 100) + "%");
int gridLazyNum = sub.getGridSumNum() - gridLivelyNum - gridOrdinaryNum;
sub.setGridLazyNum(gridLazyNum < 0 ? 0 : gridLazyNum);
sub.setGridLazyRatio((sub.getGridSumNum() == 0 || gridLazyNum < 0) ? "0%" : numberFormat.format(((float) gridLazyNum / (float) sub.getGridSumNum()) * 100) + "%");
});
return subList;
}
/**
* @Author sun
* @Description 查询组织的直属下级组织下网格活跃度统计--文件导出
**/
@Override
public void grdiLivelyExport(HttpServletResponse response, GridLivelyFormDTO formDTO) {
ExcelWriter excelWriter = null;
try {
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel("网格活跃度统计表.xlsx", response)).build();
WriteSheet writeSheet = EasyExcel.writerSheet(excelSheetName(formDTO)).build();
writeSheet.setClazz(GridLivelyExcel.class);
List<GridLivelyExcel> data = ConvertUtils.sourceToTarget(grdiLively(formDTO), GridLivelyExcel.class);
excelWriter.write(data, writeSheet);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (excelWriter != null) {
excelWriter.finish();
}
}
}
private String excelSheetName(GridLivelyFormDTO formDTO){
StringBuilder name = new StringBuilder();
SimpleDateFormat format1 = new SimpleDateFormat("yyyyMMdd");
SimpleDateFormat format2 = new SimpleDateFormat("yyyy年MM月dd日");
try{
name.append(format2.format(format1.parse(formDTO.getStartTime()))).append("至").append(format2.format(format1.parse(formDTO.getEndTime()))).append("网格活跃度统计");
} catch (Exception e) {
e.printStackTrace();
}
return name.toString();
}
}

15
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml

@ -1146,4 +1146,19 @@
</if>
group by m.CONFIG_ID,m.COLUMN_NAME
</select>
<select id="gridDateProjectIncrList" resultType="com.epmet.dataaggre.dto.govorg.result.GridDateIdResultDTO">
SELECT
grid_id gridId,
date_id dateId,
pids pids
FROM
fact_grid_member_statistics_daily
WHERE del_flag = '0'
AND date_id <![CDATA[ >= ]]> #{startTime}
AND date_id <![CDATA[ <= ]]> #{endTime}
AND project_incr > 0
AND pids LIKE CONCAT('%', #{agencyId}, '%')
GROUP BY grid_id, date_id
</select>
</mapper>

16
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml

@ -141,4 +141,20 @@
GROUP BY staff_id
</select>
<select id="gridDateRoutineWorkList" resultType="com.epmet.dataaggre.dto.govorg.result.GridDateIdResultDTO">
SELECT
grid_id gridId,
date_id dateId,
grid_pids pids
FROM
stats_staff_patrol_record_daily
WHERE
del_flag = '0'
AND date_id <![CDATA[ >= ]]> #{startTime}
AND date_id <![CDATA[ <= ]]> #{endTime}
AND routine_work_count > 0
AND grid_pids LIKE CONCAT('%', #{agencyId}, '%')
GROUP BY grid_id, date_id
</select>
</mapper>

13
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml

@ -286,4 +286,17 @@
AND USER_ID = #{staffId}
</select>
<select id="subAgencyListAndGridSumNum" resultType="com.epmet.dataaggre.dto.govorg.result.GridLivelyResultDTO">
SELECT
ca.id agencyId,
ca.organization_name agencyName,
(select COUNT(0) from customer_grid where del_flag = '0' and pids LIKE CONCAT('%',ca.id,'%')) gridSumNum
FROM
customer_agency ca
WHERE
del_flag = '0'
AND pid = #{agencyId}
ORDER BY created_time ASC
</select>
</mapper>

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java

@ -64,7 +64,7 @@ public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao<FactOriginPr
* @author wangc
* @date 2020.10.19 16:26
*/
void deleteByProjectIds(@Param("list") List<String> list,@Param("customerId") String customerId);
void deleteByProjectIds(@Param("list") List<String> list, @Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Description 批量插入

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java

@ -494,14 +494,17 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
});
if (!CollectionUtils.isEmpty(formattingData)) {
List<String> projectList = new ArrayList<>();
projectList.add(param.getObjectId());
factOriginProjectOrgPeriodDailyDao.deleteByProjectIds(projectList, param.getCustomerId());
if (StringUtils.isNotEmpty(param.getObjectId())) {
projectList.add(param.getObjectId());
}
factOriginProjectOrgPeriodDailyDao.deleteByProjectIds(projectList, param.getCustomerId(), param.getDateId());
Lists.partition(formattingData, NumConstant.ONE_HUNDRED)
.forEach(part -> factOriginProjectOrgPeriodDailyDao.insertBatch(part));
}
}
/**
* @Description 项目节点耗时数据补齐
* @param

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java

@ -3,6 +3,7 @@ package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.DateUtils;
@ -252,7 +253,8 @@ public class StatsUserServiceImpl implements StatsUserService {
m.setSourceType("external");
m.setParentCustomerId(crm.getParentCustomerId());
m.setPid(pid.toString());
m.setPids(pids.toString());
//20220214 上报数据的pids是从街道开始,需要在前边拼接上平阴县的id才能保证后续的查询用like时可以筛选出数据 sun
m.setPids(StrConstant.PY_ROOT_AGENCY + ":" + pids.toString());
} else {
log.warn(String.format("网格员数据分析上报,数据错误,根据agencyId未查询到组织信息,客户Id->%s,组织Id->%s", m.getCustomerId(), m.getAgencyId()));
iterator.remove();

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml

@ -40,6 +40,7 @@
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND (DATE_FORMAT(INFORMED_DATE,"%Y%m%d") &gt;= #{dateId} OR DATE_FORMAT(HANDLED_DATE,"%Y%m%d") &gt;= #{dateId} OR DATE_FORMAT(PERIOD_TILL_REPLY_FIRSTLY,"%Y%m%d") &gt;= #{dateId})
<if test="null != list and list.size() > 0">
<foreach collection="list" open="AND ( " close=" )" separator=" OR " item="item">
PROJECT_ID = #{item}

3
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -237,7 +237,7 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
List<VolunteerDistributionResultDTO.Distribution> listIcResiInfosByUserIds(@Param("userIds") List<String> userIds);
Map<String, String> getCategoryListMap(@Param("icUserId") String icUserId);
Map<String, String> getCategoryListMap(@Param("columns")List<String> columns, @Param("icUserId") String icUserId);
Map<String, String> selectResiInfoMap(@Param("idCard") String idCard);
@ -245,6 +245,7 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
List<String> icUserCustomerIds();
List<Map<String, String>> getIcUserList(@Param("customerId") String customerId, @Param("columns")List<String> columns);
List<Map<String, String>> getIcUserList(@Param("customerId") String customerId);
/**

38
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -18,7 +18,6 @@
package com.epmet.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@ -382,12 +381,15 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
icUserTransferRecordService.add(formDTO);
}
//2.判断类别数据是否修改[类别修改的变更明细里边存修改后的新值,是就存1否就存-1]
Result<List<IcResiCategoryWarnConfigDTO>> resultList = operCustomizeOpenFeignClient.categoryWarnConfigList(tokenDto.getCustomerId());
if (!resultList.success()) {
throw new RuntimeException("居民信息修改,获取客户居民类别预警配置表数据失败");
IcResiCategoryStatsConfigDTO sfdto = new IcResiCategoryStatsConfigDTO();
sfdto.setCustomerId(tokenDto.getCustomerId());
Result<List<IcResiCategoryStatsConfigDTO>> categoryListResult = operCustomizeOpenFeignClient.getCategoryList(sfdto);
if (!categoryListResult.success()){
throw new RenException("居民信息修改,获取客户居民类别预警配置表数据失败");
}
//修改前数据库居民十八类信息值
Map<String, String> hash = icResiUserDao.getCategoryListMap(entity.getId());
List<String> columns = categoryListResult.getData().stream().map(IcResiCategoryStatsConfigDTO::getColumnName).collect(Collectors.toList());
Map<String, String> hash = icResiUserDao.getCategoryListMap(columns, entity.getId());
//封装变更记录和变更明细数据
//变更记录
IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity();
@ -396,7 +398,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
//变更明细
List<IcUserChangeDetailedEntity> list = new ArrayList<>();
IcUserChangeDetailedEntity categoryEntity = null;
for (IcResiCategoryWarnConfigDTO dto : resultList.getData()) {
for (IcResiCategoryStatsConfigDTO dto : categoryListResult.getData()) {
String oldValue = hash.get(dto.getColumnName());
if (map.containsKey(dto.getColumnName()) && !oldValue.equals(map.get(dto.getColumnName()))) {
//类别修改后的值
@ -707,11 +709,27 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
queryDTO.setFormCode(formCode);
//所有的子表
Result<List<SubTableJoinDTO>> subTablesRes=operCustomizeOpenFeignClient.querySubTables(queryDTO);
List<String> subTables=new ArrayList<>();
/*List<String> subTablesBak=new ArrayList<>();
if(subTablesRes.success()&&CollectionUtils.isNotEmpty(subTablesRes.getData())){
subTables =subTablesRes.getData().stream().map(SubTableJoinDTO::getJoinTableSql).collect(Collectors.toList());
}
return baseDao.dynamicQuery(customerId,resultTableName,conditions,subTables,currentStaffAgencyId,staffOrgPath);
subTablesBak =subTablesRes.getData().stream().map(SubTableJoinDTO::getJoinTableSql).collect(Collectors.toList());
}*/
List<SubTableJoinDTO> subTables =subTablesRes.getData();
// log.info("1、所有的子表subTables:"+JSON.toJSONString(subTables,true));
//关联哪些子表:查询条件用到的表名+查询的列对应的表 并集去重
Set<String> whereConditionTables=conditions.stream().map(ResiUserQueryValueDTO::getTableName).collect(Collectors.toSet());
Set<String> tables=new HashSet<>();
tables.addAll(whereConditionTables);
tables.add(resultTableName);
// log.info("2、查询条件+查询列对应的tables并集去重:"+ JSON.toJSONString(tables,true));
//最终关联的子表对应的sql:
List<String> finalSubTables =new ArrayList<>();
subTables.forEach(subTable->{
if(tables.contains(subTable.getTableName())){
finalSubTables.add(subTable.getJoinTableSql());
}
});
return baseDao.dynamicQuery(customerId,resultTableName,conditions,finalSubTables,currentStaffAgencyId,staffOrgPath);
}
/**

16
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java

@ -21,12 +21,13 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcResiUserDao;
import com.epmet.dao.IcUserChangeRecordDao;
import com.epmet.dto.IcResiCategoryWarnConfigDTO;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.IcUserChangeRecordDTO;
import com.epmet.dto.form.IcResiUserChangeRecordFormDTO;
import com.epmet.dto.form.IcUserChangeRecordInitFormDTO;
@ -171,10 +172,13 @@ public class IcUserChangeRecordServiceImpl extends BaseServiceImpl<IcUserChangeR
log.info("开始初始客户下居民的变更记录和变更明细数据,客户Id->"+customerId);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//1.获取客户居民类别预警配置表数据
Result<List<IcResiCategoryWarnConfigDTO>> resultList = operCustomizeOpenFeignClient.categoryWarnConfigList(customerId);
if (!resultList.success()) {
throw new RuntimeException("居民信息修改,获取客户居民类别预警配置表数据失败");
IcResiCategoryStatsConfigDTO sfdto = new IcResiCategoryStatsConfigDTO();
sfdto.setCustomerId(customerId);
Result<List<IcResiCategoryStatsConfigDTO>> categoryListResult = operCustomizeOpenFeignClient.getCategoryList(sfdto);
if (!categoryListResult.success()){
throw new RenException("居民信息修改,获取客户居民类别预警配置表数据失败");
}
List<String> columns = categoryListResult.getData().stream().map(IcResiCategoryStatsConfigDTO::getColumnName).collect(Collectors.toList());
List<IcUserChangeRecordEntity> changeList = new ArrayList<>();
IcUserChangeRecordEntity change = null;
List<IcUserChangeDetailedEntity> detailedList = new ArrayList<>();
@ -187,7 +191,7 @@ public class IcUserChangeRecordServiceImpl extends BaseServiceImpl<IcUserChangeR
do {
//一千条一循环查询客户下居民数据
PageHelper.startPage(pageNo, NumConstant.ONE_THOUSAND);
icUserList = icResiUserDao.getIcUserList(customerId);
icUserList = icResiUserDao.getIcUserList(customerId, columns);
pageNo++;
//3.遍历封装数据
@ -195,7 +199,7 @@ public class IcUserChangeRecordServiceImpl extends BaseServiceImpl<IcUserChangeR
//存放一个人的类别为是的变更明细数据
List<IcUserChangeDetailedEntity> subList = new ArrayList<>();
String changeId = UUID.randomUUID().toString().replaceAll("-", "");
for (IcResiCategoryWarnConfigDTO dto : resultList.getData()){
for (IcResiCategoryStatsConfigDTO dto : categoryListResult.getData()){
if(map.containsKey(dto.getColumnName())&&"1".equals(map.get(dto.getColumnName()))){
detailed = new IcUserChangeDetailedEntity();
detailed.setCustomerId(customerId);

19
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java

@ -27,6 +27,7 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcResiUserDao;
import com.epmet.dao.IcUserTransferRecordDao;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.IcResiCategoryWarnConfigDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.form.IcResiUserOrgMsgFormDTO;
@ -51,6 +52,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 居民调动记录表
@ -173,12 +175,15 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans
changeRecordEntity.setRemark(formDTO.getRemark());
icUserChangeRecordService.insert(changeRecordEntity);
//6-2.变更明细【类别明细迁出组织的-1,迁入组织的1】
Result<List<IcResiCategoryWarnConfigDTO>> resultList = operCustomizeOpenFeignClient.categoryWarnConfigList(formDTO.getCustomerId());
if (!resultList.success()) {
throw new RuntimeException("人员调动,获取客户居民类别预警配置表数据失败");
IcResiCategoryStatsConfigDTO dto = new IcResiCategoryStatsConfigDTO();
dto.setCustomerId(formDTO.getCustomerId());
Result<List<IcResiCategoryStatsConfigDTO>> categoryListResult = operCustomizeOpenFeignClient.getCategoryList(dto);
if (!categoryListResult.success()){
throw new RenException("人员调动,获取客户居民类别预警配置表数据失败");
}
Map<String, String> map = icResiUserDao.getCategoryListMap(formDTO.getIcUserId());
List<IcUserChangeDetailedEntity> changeDetailedEntityList = saveChangeDetailed(resultList.getData(), map, changeRecordEntity.getId(), formDTO, resiUserDTO);
List<String> columns = categoryListResult.getData().stream().map(IcResiCategoryStatsConfigDTO::getColumnName).collect(Collectors.toList());
Map<String, String> map = icResiUserDao.getCategoryListMap(columns, formDTO.getIcUserId());
List<IcUserChangeDetailedEntity> changeDetailedEntityList = saveChangeDetailed(categoryListResult.getData(), map, changeRecordEntity.getId(), formDTO, resiUserDTO);
icUserChangeDetailedService.insertBatch(changeDetailedEntityList);
}
@ -231,7 +236,7 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans
* @Author sun
* @Description 变更明细
**/
private List<IcUserChangeDetailedEntity> saveChangeDetailed(List<IcResiCategoryWarnConfigDTO> configList, Map<String, String> map, String icUserChangeRecordId, IcResiUserTransferFormDTO formDTO, IcResiUserDTO resiUserDTO) {
private List<IcUserChangeDetailedEntity> saveChangeDetailed(List<IcResiCategoryStatsConfigDTO> configList, Map<String, String> map, String icUserChangeRecordId, IcResiUserTransferFormDTO formDTO, IcResiUserDTO resiUserDTO) {
List<IcUserChangeDetailedEntity> list = new ArrayList<>();
IcUserChangeDetailedEntity outEntity = null;
IcUserChangeDetailedEntity inEntity = null;
@ -246,7 +251,7 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans
throw new EpmetException(String.format("查询组织信息失败%s", formDTO.getNewAgencyId()));
}
}
for (IcResiCategoryWarnConfigDTO cf : configList) {
for (IcResiCategoryStatsConfigDTO cf : configList) {
if ("1".equals(map.get(cf.getColumnName()))) {
//迁出
outEntity = new IcUserChangeDetailedEntity();

47
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -518,24 +518,9 @@
<select id="getCategoryListMap" resultType="java.util.Map">
SELECT
IFNULL(is_kc,'0') IS_KC,
IFNULL(is_cj,'0') IS_CJ,
IFNULL(is_ylfn,'0') IS_YLFN,
IFNULL(is_sn,'0') IS_SN,
IFNULL(is_special,'0') IS_SPECIAL,
IFNULL(is_volunteer,'0') IS_VOLUNTEER,
IFNULL(is_unemployed,'0') IS_UNEMPLOYED,
IFNULL(is_mb,'0') IS_MB,
IFNULL(is_sz,'0') IS_SZ,
IFNULL(is_sd,'0') IS_SD,
IFNULL(is_veterans,'0') IS_VETERANS,
IFNULL(is_ensure_house,'0') IS_ENSURE_HOUSE,
IFNULL(is_party,'0') IS_PARTY,
IFNULL(is_old_people,'0') IS_OLD_PEOPLE,
IFNULL(is_xfry,'0')IS_XFRY,
IFNULL(is_united_front,'0') IS_UNITED_FRONT,
IFNULL(is_db,'0') IS_DB,
IFNULL(is_dbh,'0') IS_DBH
<foreach collection="columns" separator="," item="c">
IFNULL(`${c}`,'0') AS `${c}`
</foreach>
FROM
ic_resi_user
WHERE
@ -590,25 +575,13 @@
iru.home_id HOME_ID,
iru.name NAME,
iru.created_by CREATED_BY,
date_format(iru.created_time, '%Y-%m-%d %h:%i:%s') CREATED_TIME,
IFNULL(iru.is_kc,'0') IS_KC,
IFNULL(iru.is_cj,'0') IS_CJ,
IFNULL(iru.is_ylfn,'0') IS_YLFN,
IFNULL(iru.is_sn,'0') IS_SN,
IFNULL(iru.is_special,'0') IS_SPECIAL,
IFNULL(iru.is_volunteer,'0') IS_VOLUNTEER,
IFNULL(iru.is_unemployed,'0') IS_UNEMPLOYED,
IFNULL(iru.is_mb,'0') IS_MB,
IFNULL(iru.is_sz,'0') IS_SZ,
IFNULL(iru.is_sd,'0') IS_SD,
IFNULL(iru.is_veterans,'0') IS_VETERANS,
IFNULL(iru.is_ensure_house,'0') IS_ENSURE_HOUSE,
IFNULL(iru.is_party,'0') IS_PARTY,
IFNULL(iru.is_old_people,'0') IS_OLD_PEOPLE,
IFNULL(iru.is_xfry,'0')IS_XFRY,
IFNULL(iru.is_united_front,'0') IS_UNITED_FRONT,
IFNULL(iru.is_db,'0') IS_DB,
IFNULL(iru.is_dbh,'0') IS_DBH
date_format(iru.created_time, '%Y-%m-%d %h:%i:%s') CREATED_TIME
<if test="columns != null and columns.size() > 0">
,
<foreach collection="columns" separator="," item="c">
IFNULL(`${c}`,'0') AS `${c}`
</foreach>
</if>
FROM
ic_resi_user iru
<!-- 只查询在变更记录表不存在新增节点的居民 -->

Loading…
Cancel
Save