Browse Source

Merge remote-tracking branch 'origin/dev_screen_data_2.0' into dev_screen_data_2.0

dev_shibei_match
yinzuomei 5 years ago
parent
commit
1696468765
  1. 27
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DifficultyIfExistedResultDTO.java
  2. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java
  3. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  4. 28
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java
  5. 27
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java
  6. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  7. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java
  8. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  9. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java
  10. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java
  11. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
  12. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
  13. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java
  14. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java
  15. 12
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  16. 28
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml

27
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DifficultyIfExistedResultDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.screen.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 判断难点赌点是否有数据的返回DTO
* @ClassName DifficultyIfExistedResultDTO
* @Auth wangc
* @Date 2020-09-28 10:45
*/
@Data
public class DifficultyIfExistedResultDTO implements Serializable {
private static final long serialVersionUID = -2278401165059196896L;
/**
* 是否有数据 true false
*/
private boolean ifExisted = false;
/**
* 已经结案的项目Id集合
*/
private List<String> closedIds;
}

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java

@ -1,5 +1,6 @@
package com.epmet.dto.screen.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
@ -18,4 +19,8 @@ public class MaxAndMinBigDecimalResultDTO implements Serializable {
private BigDecimal max;
public MaxAndMinBigDecimalResultDTO() {
this.min = new BigDecimal(NumConstant.ZERO);
this.max = new BigDecimal(NumConstant.ZERO);
}
}

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

@ -180,6 +180,15 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
*/
List<ScreenDifficultyDataEntity> selectDifficultyBaseInfo(@Param("customerId")String customerId,@Param("list")List<String> list);
/**
* @Description 查询评价周期内新立的项目是为了增量新增难点赌点的图片库
* @param customerId
* @param dateId
* @return java.util.List<java.lang.String>
* @author wangc
* @date 2020.09.28 11:15
*/
List<String> selectNewProject(@Param("customerId") String customerId, @Param("dateId")String dateId);
/**
* 网格解决项目数

28
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java

@ -54,4 +54,32 @@ public interface ScreenDifficultyDataDao extends BaseDao<ScreenDifficultyDataEnt
* @Date 10:52 2020-08-18
**/
void batchInsertDifficultyData(@Param("list") List<DifficultyDataDetailFormDTO> list, @Param("customerId")String customerId);
/**
* @Description 根据customerId查询是否有难点赌点的数据
* @param customerId
* @return int
* @author wangc
* @date 2020.09.28 13:29
*/
int selectCountByCustomerId(@Param("customerId")String customerId);
/**
* @Description 查找库中已经存在的结案项目Id
* @param customerId
* @return java.util.List<java.lang.String>
* @author wangc
* @date 2020.09.28 13:44
*/
List<String> selectClosedProjectId(@Param("customerId")String customerId);
/**
* @Description 全量更新DATA_END_TIME
* @param customerId
* @return int
* @author wangc
* @date 2020.09.28 13:46
*/
int updateTime(@Param("customerId")String customerId,@Param("dateId")String dateId);
}

27
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java

@ -0,0 +1,27 @@
package com.epmet.entity.evaluationindex.screen;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @Description 难点赌点 图片列表
* @ClassName ScreenDifficultyImgDataEntity
* @Auth wangc
* @Date 2020-09-28 10:57
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("screen_difficulty_img_data")
public class ScreenDifficultyImgDataEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
private String eventId;
private String eventImgUrl;
private Integer sort;
}

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

@ -24,6 +24,7 @@ import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.mysql.cj.x.protobuf.MysqlxDatatypes;
import java.util.List;
import java.util.Map;
@ -248,4 +249,14 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
* @date 2020.09.28 10:23
*/
List<ScreenDifficultyDataEntity> getDifficultyBaseInfo(String customerId , List<String> list);
/**
* @Description 得到评价周期内新立项的id
* @param customerId
* @param dateId
* @return java.util.List<java.lang.String>
* @author wangc
* @date 2020.09.28 14:10
*/
List<String> getNewProjectId(String customerId,String dateId);
}

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

@ -89,13 +89,12 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl<FactOri
//isFirst
baseDao.deleteBatchMemberByCustomerId(customerId,null,null);
} else {
//删除要插入的组主表数据
baseDao.deleteBatchByGroupId(customerId,originGroupData.stream().map(FactOriginGroupMainDailyDTO :: getId).distinct().collect(Collectors.toList()));
if(StringUtils.isNotBlank(dateId)){
baseDao.deleteBatchMemberByCustomerId(customerId,dateId,"date");
}
}
//删除要插入的组主表数据
baseDao.deleteBatchByGroupId(customerId,originGroupData.stream().map(FactOriginGroupMainDailyDTO :: getId).distinct().collect(Collectors.toList()));
baseDao.insertBatchMain(originGroupData);
baseDao.insertBatchMembers(memberList);
return true;

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

@ -235,6 +235,19 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
*/
@Override
public List<ScreenDifficultyDataEntity> getDifficultyBaseInfo(String customerId, List<String> list) {
return null;
return baseDao.selectDifficultyBaseInfo(customerId,list);
}
/**
* @Description 得到评价周期内新立项的id
* @param customerId
* @param dateId
* @return java.util.List<java.lang.String>
* @author wangc
* @date 2020.09.28 14:10
*/
@Override
public List<String> getNewProjectId(String customerId, String dateId) {
return baseDao.selectNewProject(customerId,dateId);
}
}

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

@ -5,10 +5,13 @@ import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenGrassrootsGovernDataAbsorptionService;
import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService;
import com.epmet.service.evaluationindex.screen.ScreenDifficultyDataService;
import com.epmet.service.evaluationindex.screen.ScreenPartyUserRankDataService;
import com.epmet.service.org.CustomerGridService;
import com.epmet.service.point.UserPointService;
@ -46,6 +49,10 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
private CpcIndexCalculateService cpcIndexCalculateService;
@Autowired
private ScreenPartyUserRankDataService screenPartyUserRankDataService;
@Autowired
private ScreenDifficultyDataService screenDifficultyDataService;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
/**
* @Description 用户积分党员分值数据中转站
* @param param
@ -117,6 +124,16 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
**/
@Override
public void difficultyDataHub(ScreenCentralZoneDataFormDTO param) {
ScreenDifficultyDataEntity entity = new ScreenDifficultyDataEntity();
//验证是否存在
DifficultyIfExistedResultDTO existedMap = screenDifficultyDataService.selectExistedInfo(param.getCustomerId());
//查询数据
List<ScreenDifficultyDataEntity> difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),existedMap.getClosedIds());
if(existedMap.isIfExisted()){
//查询全部项目的图片
}else{
//查询增量项目的图片
List<String> newProjectIds = factOriginProjectMainDailyService.getNewProjectId(param.getCustomerId(),param.getDateId());
}
}
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java

@ -224,8 +224,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
// 社区名义发文数量
List<Map<String, Object>> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL);
if (CollectionUtils.isEmpty(publishArticleCountList)) {
log.error(IndexCalConstant.COMMUNITY_PUBLISH_ARTICLE_LIST_NULL);
}
log.warn(IndexCalConstant.COMMUNITY_PUBLISH_ARTICLE_LIST_NULL);
} else {
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldNameByIndexCode)) {
log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode()));
@ -247,6 +247,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
});
}
}
}
});
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
log.info("communityPartyCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS));
@ -451,11 +452,13 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
* @date 2020/8/27 1:30 下午
*/
public MaxAndMinBigDecimalResultDTO getMaxAndMinBigDecimal(List<BigDecimal> list) {
MaxAndMinBigDecimalResultDTO result = new MaxAndMinBigDecimalResultDTO();
if(!CollectionUtils.isEmpty(list)) {
BigDecimal max = Collections.max(list);
BigDecimal min = Collections.min(list);
MaxAndMinBigDecimalResultDTO result = new MaxAndMinBigDecimalResultDTO();
result.setMax(max);
result.setMin(min);
}
return result;
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java

@ -222,13 +222,13 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
// 区名义发文数量
List<Map<String, Object>> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL);
if (CollectionUtils.isEmpty(publishArticleCountList)) {
log.error(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL);
}
log.warn(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL);
} else {
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldNameByIndexCode)) {
log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode()));
return;
} else{
} else {
List<BigDecimal> decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList());
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList);
List<List<Map<String, Object>>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE);
@ -245,6 +245,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
});
}
}
}
});
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java

@ -226,13 +226,13 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
// 街道名义发文数量
List<Map<String, Object>> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId, IndexCalConstant.STREET_LEVEL);
if (CollectionUtils.isEmpty(mapList)) {
log.error(IndexCalConstant.STREET_PUBLISH_ARTICLE_LIST_NULL);
}
log.warn(IndexCalConstant.STREET_PUBLISH_ARTICLE_LIST_NULL);
} else {
String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldName)) {
log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode()));
return;
}else{
} else {
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(mapList.stream().map(m -> new BigDecimal(m.get(fieldName).toString())).collect(Collectors.toList()));
List<List<Map<String, Object>>> publishArticleList = ListUtils.partition(mapList, IndexCalConstant.PAGE_SIZE);
publishArticleList.forEach(publish -> {
@ -248,6 +248,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
});
}
}
}
});
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);

23
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java

@ -18,7 +18,11 @@
package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity;
import java.util.List;
/**
* 基层治理-难点堵点(耗时最长|设计部门最多|处理次数)
@ -28,4 +32,23 @@ import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
*/
public interface ScreenDifficultyDataService extends BaseService<ScreenDifficultyDataEntity> {
/**
* @Description 查询数据库中是否有该客户下的难点赌点信息
* @param customerId
* @return com.epmet.dto.screen.result.DifficultyIfExistedResultDTO
* @author wangc
* @date 2020.09.28 10:53
*/
DifficultyIfExistedResultDTO selectExistedInfo(String customerId);
/**
* @Description 数据清洗
* @param difficulty
* @return void
* @author wangc
* @date 2020.09.28 11:04
*/
void dataClean(List<ScreenDifficultyDataEntity> difficulty, List<ScreenDifficultyImgDataEntity> img);
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java

@ -18,12 +18,19 @@
package com.epmet.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.ScreenDifficultyDataDao;
import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenDifficultyDataService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 基层治理-难点堵点(耗时最长|设计部门最多|处理次数)
*
@ -31,7 +38,22 @@ import org.springframework.stereotype.Service;
* @since v1.0.0 2020-09-22
*/
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl<ScreenDifficultyDataDao, ScreenDifficultyDataEntity> implements ScreenDifficultyDataService {
@Override
public DifficultyIfExistedResultDTO selectExistedInfo(String customerId) {
int count = baseDao.selectCountByCustomerId(customerId);
DifficultyIfExistedResultDTO existedMap = new DifficultyIfExistedResultDTO();
if(count <= NumConstant.ZERO) {existedMap.setIfExisted(true);}
else{existedMap.setClosedIds(baseDao.selectClosedProjectId(customerId));}
return existedMap;
}
@Override
public void dataClean(List<ScreenDifficultyDataEntity> difficulty,List<ScreenDifficultyImgDataEntity> img) {
}
}

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

@ -403,4 +403,16 @@
</foreach>
</if>
</select>
<!-- 查询当天新立的项目,是为了增量新增难点赌点的图片库 -->
<select id="selectNewProject" resultType="string">
SELECT
ID
FROM
fact_origin_project_main_daily
WHERE
CUSTOMER_ID = #{customerId}
AND
DATE_ID = #{dateId}
</select>
</mapper>

28
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml

@ -70,4 +70,32 @@
</foreach>
</insert>
<!-- 根据customerId查询是否有难点赌点的数据 -->
<select id="selectCountByCustomerId" resultType="int">
SELECT
COUNT(*)
FROM
screen_difficulty_data
WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId}
</select>
<!-- 查找库中已经存在的结案项目Id -->
<select id="selectClosedProjectId" resultType="java.lang.String">
SELECT
PROJECT_ID
FROM
screen_difficulty_data
WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} AND EVENT_STATUS_CODE = 'closed'
</select>
<update id="updateTime">
UPDATE
screen_difficulty_data
SET
DATA_END_TIME = #{dateId}
WHERE
DEL_FLAG = '0'
AND
CUSTOMER_ID = #{customerId}
</update>
</mapper>

Loading…
Cancel
Save