Browse Source

Merge remote-tracking branch 'origin/dev_bugfix_ljj' into develop

dev
zxc 4 years ago
parent
commit
21a490c024
  1. 10
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenCentralZoneDataFormDTO.java
  2. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  3. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/impl/BizDataStatsServiceImpl.java
  4. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  5. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java
  6. 11
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  7. 15
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java
  8. 24
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java
  9. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganizationSon.java

10
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenCentralZoneDataFormDTO.java

@ -29,4 +29,14 @@ public class ScreenCentralZoneDataFormDTO implements Serializable {
private String endDate; private String endDate;
private String projectId; private String projectId;
/**
* 首次的话 全量拉取
*/
private Boolean isFirst;
/**
* 时间间隔天数 14 就是查询14天内的数据
*/
private String internalDay;
} }

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java

@ -26,6 +26,7 @@ import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO;
import com.epmet.dto.pingyin.result.*; import com.epmet.dto.pingyin.result.*;
import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.entity.evaluationindex.extract.*; import com.epmet.entity.evaluationindex.extract.*;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -400,13 +401,13 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
/** /**
* desc: 获取难点堵点项目数据 * desc: 获取难点堵点项目数据
* *
* @param customerId * @param param
* @param dateId * @param param
* @return java.util.List<com.epmet.entity.evaluationindex.extract.FactOriginProjectMainAndPeriodDTO> * @return java.util.List<com.epmet.entity.evaluationindex.extract.FactOriginProjectMainAndPeriodDTO>
* @author LiuJanJun * @author LiuJanJun
* @date 2021/4/12 1:35 下午 * @date 2021/4/12 1:35 下午
*/ */
List<FactOriginProjectMainAndPeriodDTO> getProjectForDiff(@Param("customerId") String customerId, @Param("offset") int offset, @Param("pageSize") int pageSize); List<FactOriginProjectMainAndPeriodDTO> getProjectForDiff(@Param("param") ScreenCentralZoneDataFormDTO param, @Param("offset") int offset, @Param("pageSize") int pageSize);
/** /**
* desc: 获取难点堵点项目数据耗时 * desc: 获取难点堵点项目数据耗时

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/impl/BizDataStatsServiceImpl.java

@ -302,7 +302,7 @@ public class BizDataStatsServiceImpl implements BizDataStatsService {
daysBetween = DateUtils.getDaysBetween(param.getStartDate(), param.getEndDate()); daysBetween = DateUtils.getDaysBetween(param.getStartDate(), param.getEndDate());
} }
List<String> finalDaysBetween = daysBetween; List<String> finalDaysBetween = daysBetween;
threadPool.submit(() -> {
if (!isRange) { if (!isRange) {
try { try {
//初始化form里的今天的数据 并纠正昨日的数据 //初始化form里的今天的数据 并纠正昨日的数据
@ -320,6 +320,6 @@ public class BizDataStatsServiceImpl implements BizDataStatsService {
log.error("【网格员巡查数据统计】发生异常,参数:" + JSON.toJSONString(param), e); log.error("【网格员巡查数据统计】发生异常,参数:" + JSON.toJSONString(param), e);
} }
} }
});
} }
} }

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

@ -525,7 +525,7 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
@Override @Override
public List<FactOriginProjectMainAndPeriodDTO> getProjectAndPeriodForDiff(ScreenCentralZoneDataFormDTO param, int offset, int pageSize) { public List<FactOriginProjectMainAndPeriodDTO> getProjectAndPeriodForDiff(ScreenCentralZoneDataFormDTO param, int offset, int pageSize) {
return baseDao.getProjectForDiff(param.getCustomerId(),offset,pageSize); return baseDao.getProjectForDiff(param,offset,pageSize);
} }
@Override @Override

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java

@ -155,6 +155,9 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
@Override @Override
public boolean difficultyDataExtract(ScreenCentralZoneDataFormDTO param) { public boolean difficultyDataExtract(ScreenCentralZoneDataFormDTO param) {
try {
//默认查询10天内的数据
param.setInternalDay(DateUtils.getBeforeNDay(NumConstant.TEN));
//获取agency维度 //获取agency维度
List<DimAgencyEntity> agencyList = dimAgencyService.getAgencyListByCustomerId(param.getCustomerId()); List<DimAgencyEntity> agencyList = dimAgencyService.getAgencyListByCustomerId(param.getCustomerId());
Map<String, DimAgencyEntity> agencyMap = agencyList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o, (o1, o2) -> o1)); Map<String, DimAgencyEntity> agencyMap = agencyList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o, (o1, o2) -> o1));
@ -180,7 +183,7 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
Map<String, ProjectDTO> bizProjectInfoMap = bizProjectInfoList.stream().collect(Collectors.toMap(ProjectDTO::getId, o -> o, (o1, o2) -> o1)); Map<String, ProjectDTO> bizProjectInfoMap = bizProjectInfoList.stream().collect(Collectors.toMap(ProjectDTO::getId, o -> o, (o1, o2) -> o1));
int pageNo = NumConstant.ONE; int pageNo = NumConstant.ONE;
int pageSize = NumConstant.FIVE_HUNDRED; int pageSize = NumConstant.ONE_THOUSAND;
List<FactOriginProjectMainAndPeriodDTO> difficultyBaseList; List<FactOriginProjectMainAndPeriodDTO> difficultyBaseList;
do { do {
//1.根据客户Id 获取所有项目数据 //1.根据客户Id 获取所有项目数据
@ -257,13 +260,15 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
} }
log.info("========:" + JSON.toJSONString(diffList)); log.info("========:" + JSON.toJSONString(diffList));
log.info("========:" + JSON.toJSONString(imgDataEntities)); log.info("========:" + JSON.toJSONString(imgDataEntities));
screenDifficultyDataService.dataClean(param.getCustomerId(),diffList,imgDataEntities); screenDifficultyDataService.dataClean(param.getCustomerId(),diffList,imgDataEntities);
log.info("difficultyDataExtract excute pageNo:{}",pageNo);
} while (!CollectionUtils.isEmpty(difficultyBaseList)&&difficultyBaseList.size()==pageSize); } while (!CollectionUtils.isEmpty(difficultyBaseList)&&difficultyBaseList.size()==pageSize);
//log.info("【大屏数据抽取-难点赌点执行完毕】 客户Id{} 难点赌点数据{}", param.getCustomerId(), JSON.toJSONString(diffList));
//3.获取项目的最后操作记录 //3.获取项目的最后操作记录
return true; return true;
} finally {
log.info("【大屏数据抽取-难点赌点执行完毕】 客户Id{}", param.getCustomerId());
}
} }
/** /**

11
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -668,10 +668,19 @@
m.id, m.date_id dateId, m.customer_id, m.issue_id, m.topic_id, m.grid_id, m.id, m.date_id dateId, m.customer_id, m.issue_id, m.topic_id, m.grid_id,
m.pid, m.pids, m.agency_id, m.project_status, m.is_resolved, m.pid, m.pids, m.agency_id, m.project_status, m.is_resolved,
m.topic_creator_id, m.is_party, m.is_overdue, m.finish_org_ids m.topic_creator_id, m.is_party, m.is_overdue, m.finish_org_ids
<if test="param.isFirst == null or !param.isFirst">
, IFNULL(b.DATE_ID, DATE_FORMAT( now(), '%Y%m%d' )) as updateDate
</if>
FROM fact_origin_project_main_daily m FROM fact_origin_project_main_daily m
<if test="param.isFirst == null or !param.isFirst">
LEFT JOIN fact_origin_project_log_daily b ON m.ID = b.PROJECT_ID AND b.ACTION_CODE = 'close'
</if>
WHERE WHERE
m.CUSTOMER_ID = #{customerId} m.CUSTOMER_ID = #{param.customerId}
AND m.DEL_FLAG = '0' AND m.DEL_FLAG = '0'
<if test="param.isFirst == null or !param.isFirst">
HAVING updateDate>= #{param.internalDay}
</if>
LIMIT #{offset} ,#{pageSize} LIMIT #{offset} ,#{pageSize}
</select> </select>
<select id="getProjectPeriodForDiff" resultType="com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity"> <select id="getProjectPeriodForDiff" resultType="com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity">

15
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java

@ -17,11 +17,16 @@
package com.epmet.controller; package com.epmet.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.hutool.poi.excel.ExcelUtil;
import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; 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.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.AssertUtils;
@ -36,7 +41,9 @@ import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO;
import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.excel.ExportCommunitySelfOrganizationExcel; import com.epmet.excel.ExportCommunitySelfOrganizationExcel;
import com.epmet.excel.IcCommunitySelfOrganizationExcel; import com.epmet.excel.IcCommunitySelfOrganizationExcel;
import com.epmet.excel.ImportCommunitySelfOrganizationSon;
import com.epmet.service.IcCommunitySelfOrganizationService; import com.epmet.service.IcCommunitySelfOrganizationService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -113,7 +120,13 @@ public class IcCommunitySelfOrganizationController {
@PostMapping("exportcommunityselforganization") @PostMapping("exportcommunityselforganization")
public void exportCommunitySelfOrganization(HttpServletResponse response,@LoginUser TokenDto tokenDto,@RequestBody CommunitySelfOrganizationListFormDTO formDTO) throws Exception { public void exportCommunitySelfOrganization(HttpServletResponse response,@LoginUser TokenDto tokenDto,@RequestBody CommunitySelfOrganizationListFormDTO formDTO) throws Exception {
CommunitySelfOrganizationListResultDTO resultDTO = icCommunitySelfOrganizationService.communitySelfOrganizationList(tokenDto, formDTO); CommunitySelfOrganizationListResultDTO resultDTO = icCommunitySelfOrganizationService.communitySelfOrganizationList(tokenDto, formDTO);
ExcelUtils.exportExcelToTarget(response, null, resultDTO.getList(), ExportCommunitySelfOrganizationExcel.class); List<ExportCommunitySelfOrganizationExcel> r = ConvertUtils.sourceToTarget(resultDTO.getList(), ExportCommunitySelfOrganizationExcel.class);
r.forEach(c -> {
if (CollectionUtils.isNotEmpty(c.getOrganizationPersonnel())){
c.setOrganizationPersonnel(ConvertUtils.sourceToTarget(c.getOrganizationPersonnel(), ImportCommunitySelfOrganizationSon.class));
}
});
ExcelUtils.exportExcelToTarget(response, null, r, ExportCommunitySelfOrganizationExcel.class);
} }
/** /**

24
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java

@ -1,31 +1,37 @@
package com.epmet.excel; package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.CellStyler;
import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.epmet.dto.IcCommunitySelfOrganizationPersonnelDTO;
import lombok.Data; import lombok.Data;
import java.util.List;
@Data @Data
public class ExportCommunitySelfOrganizationExcel { public class ExportCommunitySelfOrganizationExcel {
@Excel(name = "排序") // @Excel(name = "排序")
private Integer sort; // private Integer sort;
@Excel(name = "组织名称", width = 40) @Excel(name = "组织名称", width = 40, needMerge = true)
private String organizationName; private String organizationName;
@Excel(name = "组织人数", width = 20) @Excel(name = "组织人数", width = 20, needMerge = true)
private Integer organizationPersonCount; private Integer organizationPersonCount;
@Excel(name = "负责人姓名", width = 20) @Excel(name = "负责人", width = 20, needMerge = true)
private String principalName; private String principalName;
@Excel(name = "负责人电话", width = 20) @Excel(name = "联系电话", width = 20, needMerge = true)
private String principalPhone; private String principalPhone;
@Excel(name = "服务事项", width = 60) @Excel(name = "服务事项", width = 60, needMerge = true)
private String serviceItem; private String serviceItem;
@Excel(name = "社区自组织创建时间", width = 20) @Excel(name = "创建时间", width = 20, needMerge = true)
private String organizationCreatedTime; private String organizationCreatedTime;
@ExcelCollection(name = "组织成员")
private List<ImportCommunitySelfOrganizationSon> organizationPersonnel;
} }

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganizationSon.java

@ -14,7 +14,7 @@ public class ImportCommunitySelfOrganizationSon {
@Excel(name = "姓名") @Excel(name = "姓名")
private String personName; private String personName;
@Excel(name = "电话") @Excel(name = "电话", width = 20)
private String personPhone; private String personPhone;
} }

Loading…
Cancel
Save