Browse Source

治理指数-网格调试1

master
yinzuomei 4 years ago
parent
commit
5250204b5c
  1. 22
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFactGridGovernDailyFromDTO.java
  2. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  3. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java
  4. 49
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java
  5. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml

22
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFactGridGovernDailyFromDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.extract.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* 治理指数网格-计算入参
*
* @author yinzuomei@elink-cn.com
* @date 2021/5/27 17:28
*/
@Data
public class ExtractFactGridGovernDailyFromDTO implements Serializable {
private static final long serialVersionUID = -4511693100253244749L;
@NotBlank(message = "customer")
private String customerId;
private String dateId;
private List<String> gridIds;
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -19,6 +19,7 @@ import com.epmet.dao.stats.DimDateDao;
import com.epmet.dao.stats.DimMonthDao;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
@ -534,6 +535,14 @@ public class DemoController {
}
/**
* @return com.epmet.commons.tools.utils.Result
* @param customerId
* @param dateId
* @author yinzuomei
* @description 话题原始表抽取方法
* @Date 2021/5/28 10:23
**/
@PostMapping("inserttopicorigin")
public Result topicDataCleaning(@RequestParam("customerId") String customerId, @RequestParam("dateId")String dateId) {
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) {
@ -903,9 +912,16 @@ public class DemoController {
return new Result();
}
/**
* @return com.epmet.commons.tools.utils.Result
* @param fromDTO
* @author yinzuomei
* @description
* @Date 2021/5/27 17:28
**/
@PostMapping("extractgridgoverndaily")
public Result extractFactGridGovernDaily(@RequestParam("customerId") String customerId,@RequestParam("dateId")String dateId){
factGridGovernDailyService.extractFactGridGovernDaily(customerId,dateId);
public Result extractFactGridGovernDaily(@RequestBody ExtractFactGridGovernDailyFromDTO fromDTO){
factGridGovernDailyService.extractFactGridGovernDaily(fromDTO);
return new Result();
}
}

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java

@ -18,6 +18,7 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO;
import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity;
/**
@ -35,10 +36,9 @@ public interface FactGridGovernDailyService extends BaseService<FactGridGovernDa
* 治理指数-网格相关问题解决总数党群自治占比网格自治占比
*
*
* @param customerId
* @param dateId
* @param fromDTO
* @return
*/
void extractFactGridGovernDaily(String customerId, String dateId);
void extractFactGridGovernDaily(ExtractFactGridGovernDailyFromDTO fromDTO);
}

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

@ -24,6 +24,7 @@ import com.epmet.constant.DimObjectStatusConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.dao.evaluationindex.extract.FactGridGovernDailyDao;
import com.epmet.dto.extract.FactOriginProjectLogDailyDTO;
import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridClosedTotalCommonDTO;
@ -74,12 +75,13 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
/**
* 治理指数-网格相关问题解决总数党群自治占比网格自治占比
*
* @param customerId
* @param dateId
* @param fromDTO
* @return
*/
@Override
public void extractFactGridGovernDaily(String customerId, String dateId) {
public void extractFactGridGovernDaily(ExtractFactGridGovernDailyFromDTO fromDTO) {
String customerId=fromDTO.getCustomerId();
String dateId=fromDTO.getDateId();
log.info("extractFactGridGovernDaily start customerId="+customerId+";dateId="+dateId);
//客户id, dateId不能为空
if(StringUtils.isBlank(customerId)||StringUtils.isBlank(dateId)){
@ -93,7 +95,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
}
List<String> gridIds=gridInfoDTOList.stream().map(GridInfoDTO::getGridId).collect(Collectors.toList());
List<FactGridGovernDailyEntity> insertEntityList=this.constructFactGridGovernDailyEntityList(customerId,dateId,gridInfoDTOList);
// log.info(JSON.toJSONString(insertEntityList,true));
log.info("==========================当前客户下多少个网格? "+insertEntityList.size());
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.SIX);
@ -158,26 +160,27 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
insertEntity.setInGroupTopicUnResolvedCount(inGroupTopicUnResolvedMap.get(insertEntity.getGridId()));
}
// todo
// 11、来源于议题的项目,未出网格结案并且已解决的项目数
insertEntity.setFromIssueResolvedInGridCount(666);
// 12、来源于议题的项目,未出网格结案并且无需解决的项目数
insertEntity.setFromIssueUnResolvedInGridCount(666);
// 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0
insertEntity.setFromAgencyResolvedInGridCount(666);
// 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0
insertEntity.setFromAgencyUnResolvedInGridCount(666);
// 所有网格内结案项目数(未出网格)=来源于议题的项目结案已解决+来源于议题的项目结案无需解决+来源于立项的项目结案已解决+来源于立项的项目结案无需解决
// 15、未出当前网格的,结案项目数=11+12+13+14
insertEntity.setGridSelfGovernProjectTotal(insertEntity.getFromIssueResolvedInGridCount()+insertEntity.getFromIssueUnResolvedInGridCount()+
if (dtoMap.containsKey(insertEntity.getGridId()) && null != dtoMap.get(insertEntity.getGridId())) {
// 11、来源于议题的项目,未出网格结案并且已解决的项目数
insertEntity.setFromIssueResolvedInGridCount(dtoMap.get(insertEntity.getGridId()).getFromIssueResolvedInGridCount());
// 12、来源于议题的项目,未出网格结案并且无需解决的项目数
insertEntity.setFromIssueUnResolvedInGridCount(dtoMap.get(insertEntity.getGridId()).getFromIssueUnResolvedInGridCount());
// 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0
insertEntity.setFromAgencyResolvedInGridCount(dtoMap.get(insertEntity.getGridId()).getFromAgencyResolvedInGridCount());
// 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0
insertEntity.setFromAgencyUnResolvedInGridCount(dtoMap.get(insertEntity.getGridId()).getFromAgencyUnResolvedInGridCount());
// 所有网格内结案项目数(未出网格)=来源于议题的项目结案已解决+来源于议题的项目结案无需解决+来源于立项的项目结案已解决+来源于立项的项目结案无需解决
// 15、未出当前网格的,结案项目数=11+12+13+14
insertEntity.setGridSelfGovernProjectTotal(insertEntity.getFromIssueResolvedInGridCount()+insertEntity.getFromIssueUnResolvedInGridCount()+
insertEntity.getFromAgencyResolvedInGridCount()+insertEntity.getFromAgencyUnResolvedInGridCount());
//当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数
insertEntity.setCommunityClosedCount(666);
//当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
insertEntity.setStreetClosedCount(666);
//当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
insertEntity.setDistrictDeptClosedCount(666);
//当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数
insertEntity.setCommunityClosedCount(dtoMap.get(insertEntity.getGridId()).getCommunityClosedCount());
//当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
insertEntity.setStreetClosedCount(dtoMap.get(insertEntity.getGridId()).getStreetClosedCount());
//当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
insertEntity.setDistrictDeptClosedCount(dtoMap.get(insertEntity.getGridId()).getDistrictDeptClosedCount());
}
//界面展示:1、问题解决总数=1+2+3+4+5+6+7+8
insertEntity.setProblemResolvedCount(insertEntity.getTopicResolvedCount()+insertEntity.getTopicUnResolvedCount()
@ -447,7 +450,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
entity.setCustomerId(customerId);
entity.setDateId(dateId);
entity.setGridId(gridInfoDTO.getGridId());
entity.setPid(gridInfoDTO.getPid());
entity.setPid(gridInfoDTO.getAgencyId());
entity.setPids(gridInfoDTO.getPids());
insertEntityList.add(entity);
}

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml

@ -80,7 +80,8 @@
ca.ORGANIZATION_NAME as ORG_NAME
FROM
customer_grid cg
LEFT JOIN customer_agency ca ON ( cg.PID = CA.ID )
LEFT JOIN customer_agency ca
ON ( cg.PID = CA.ID and ca.del_flag='0')
WHERE
CG.CUSTOMER_ID =#{customerId}
and cg.del_flag='0'

Loading…
Cancel
Save