Browse Source

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

master
jianjun 5 years ago
parent
commit
016ed7793c
  1. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java
  2. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  3. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java
  4. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java
  5. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  6. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  7. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java
  8. 63
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java
  9. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java
  10. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyUserRankDataService.java
  11. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java
  12. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java
  13. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java
  14. 12
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml
  15. 32
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  16. 10
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml
  17. 41
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml
  18. 10
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  19. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java
  20. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java
  21. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java
  22. 34
      epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml
  23. 20
      epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml

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

@ -61,6 +61,15 @@ public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMain
**/ **/
int selectIfExist(@Param("customerId") String customerId); int selectIfExist(@Param("customerId") String customerId);
/**
* @Description 根据用户Id查询所有组原始数据
* @param customerId
* @return java.util.List<com.epmet.dto.extract.FactOriginGroupMainDailyDTO>
* @author wangc
* @date 2020.11.17 09:56
*/
List<FactOriginGroupMainDailyDTO> selectAllGroupByCustomerId(@Param("customerId") String customerId);
/** /**
* @param customerId * @param customerId
* @return * @return

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

@ -180,12 +180,12 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
/** /**
* @Description 查询难点赌点的基本信息要排除之前已经结案过的项目 * @Description 查询难点赌点的基本信息要排除之前已经结案过的项目
* @param customerId * @param customerId
* @param list
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity> * @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity>
* @author wangc * @author wangc
* @date 2020.09.28 10:19 * @date 2020.09.28 10:19
*/ */
List<ScreenDifficultyDataEntity> selectDifficultyBaseInfo(@Param("customerId")String customerId,@Param("list")List<String> list); List<ScreenDifficultyDataEntity> selectDifficultyBaseInfo(@Param("customerId")String customerId,@Param("thresholdValue") Integer thresholdValue);
/** /**
* @Description 查询评价周期内新立的项目是为了增量新增难点赌点的图片库 * @Description 查询评价周期内新立的项目是为了增量新增难点赌点的图片库

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

@ -91,4 +91,13 @@ public interface ScreenDifficultyDataDao extends BaseDao<ScreenDifficultyDataEnt
int insertBatch(@Param("list") List<ScreenDifficultyDataEntity> list); int insertBatch(@Param("list") List<ScreenDifficultyDataEntity> list);
int insertBatchImg(@Param("list") List<ScreenDifficultyImgDataEntity> list); int insertBatchImg(@Param("list") List<ScreenDifficultyImgDataEntity> list);
/**
* @Description 根据客户Id查出全部的难点赌点的项目Id和网格Id因为需要比对全部的信息然后删除因为删除网格而导致的垃圾数据
* @param customerId
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity>
* @author wangc
* @date 2020.11.17 09:33
*/
List<ScreenDifficultyDataEntity> selectAllDifficultyByCustomerId(@Param("customerId")String customerId);
} }

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java

@ -103,14 +103,5 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
*/ */
String selectParameterValueByKey(@Param("customerId") String customerId); String selectParameterValueByKey(@Param("customerId") String customerId);
/**
* @Description 得到超过阈值滞留的项目Id集合
* 规定只要项目的任何一个负责人(被流转到的自始至终不管有没有处理)超过了自定义或默认的滞留时间就算难点赌点
* @param customerId
* @param exclude
* @return java.util.List<java.lang.String>
* @author wangc
* @date 2020.11.06 14:14
*/
List<String> selectOvertimeProjectIds(@Param("customerId") String customerId,@Param("exclude") List<String> exclude,@Param("value") Integer value);
} }

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

@ -248,12 +248,12 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
/** /**
* @Description 查询难点赌点基础信息 * @Description 查询难点赌点基础信息
* @param customerId * @param customerId
* @param list
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity> * @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity>
* @author wangc * @author wangc
* @date 2020.09.28 10:23 * @date 2020.09.28 10:23
*/ */
List<ScreenDifficultyDataEntity> getDifficultyBaseInfo(String customerId , List<String> list); List<ScreenDifficultyDataEntity> getDifficultyBaseInfo(String customerId ,Integer thresholdValue);
/** /**
* @Description 得到评价周期内新立项的id * @Description 得到评价周期内新立项的id

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

@ -237,15 +237,15 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
/** /**
* @Description 查询难点赌点基础信息 * @Description 查询难点赌点基础信息
* @param customerId * @param customerId
* @param list
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity> * @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity>
* @author wangc * @author wangc
* @date 2020.09.28 10:23 * @date 2020.09.28 10:23
*/ */
@Override @Override
public List<ScreenDifficultyDataEntity> getDifficultyBaseInfo(String customerId, List<String> list) { public List<ScreenDifficultyDataEntity> getDifficultyBaseInfo(String customerId, Integer thresholdValue) {
if(CollectionUtils.isEmpty(list)) return null;
return baseDao.selectDifficultyBaseInfo(customerId,list); return baseDao.selectDifficultyBaseInfo(customerId,thresholdValue);
} }
/** /**

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

@ -66,7 +66,7 @@ public class GroupExtractServiceImpl implements GroupExtractService {
/** /**
* @param param * @param param
* @return * @return
* @Description 业务抽取 - 小组祥光 * @Description 业务抽取 - 小组
* @author wangc * @author wangc
* @date 2020.09.18 21:07 * @date 2020.09.18 21:07
**/ **/
@ -88,21 +88,30 @@ public class GroupExtractServiceImpl implements GroupExtractService {
List<ExtractGroupMemberActionRecordResultDTO> memberList = new LinkedList<>(); List<ExtractGroupMemberActionRecordResultDTO> memberList = new LinkedList<>();
if (!CollectionUtils.isEmpty(originGroupData)) { if (!CollectionUtils.isEmpty(originGroupData)) {
List<GridAttributesResultDTO> gridList = dimGridService.getGridAttributes(param.getCustomerId(),originGroupData.stream().map(FactOriginGroupMainDailyDTO::getGridId).distinct().collect(Collectors.toList())); List<GridAttributesResultDTO> gridList = dimGridService.getGridAttributes(param.getCustomerId(),originGroupData.stream().map(FactOriginGroupMainDailyDTO::getGridId).distinct().collect(Collectors.toList()));
List<String> missingGroups = new LinkedList<>();
if (!CollectionUtils.isEmpty(gridList)) { if (!CollectionUtils.isEmpty(gridList)) {
Map<String, GridAttributesResultDTO> gridMap = Map<String, GridAttributesResultDTO> gridMap =
gridList.stream().collect(Collectors.toMap(GridAttributesResultDTO::getGridId, Function.identity(), (key1, key2) -> key2)); gridList.stream().collect(Collectors.toMap(GridAttributesResultDTO::getGridId, Function.identity(), (key1, key2) -> key2));
//剔除本次要更新数据中的垃圾数据
for(Iterator<FactOriginGroupMainDailyDTO> iter = originGroupData.iterator(); for(Iterator<FactOriginGroupMainDailyDTO> iter = originGroupData.iterator();
iter.hasNext();){
FactOriginGroupMainDailyDTO pointer = iter.next();
if(null == gridMap.get(pointer.getGridId()))iter.remove();
}
//记录全量中的垃圾数
List<String> missingGroups = new LinkedList<>();
List<FactOriginGroupMainDailyDTO> population = factOriginGroupMainDailyDao.selectAllGroupByCustomerId(param.getCustomerId());
if(!CollectionUtils.isEmpty(population)){
for(Iterator<FactOriginGroupMainDailyDTO> iter = population.iterator();
iter.hasNext();){ iter.hasNext();){
FactOriginGroupMainDailyDTO pointer = iter.next(); FactOriginGroupMainDailyDTO pointer = iter.next();
if(null == gridMap.get(pointer.getGridId())){ if(null == gridMap.get(pointer.getGridId())){
missingGroups.add(pointer.getId()); missingGroups.add(pointer.getId());
iter.remove();
} }
} }
}
originGroupData.forEach(group -> { originGroupData.forEach(group -> {
GridAttributesResultDTO attr = gridMap.get(group.getGridId()); GridAttributesResultDTO attr = gridMap.get(group.getGridId());
if (null != attr) { if (null != attr) {

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

@ -100,10 +100,7 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
Map<String, BigDecimal> scoreMap = cpcIndexCalculateService.getCpcScore(param.getCustomerId(),dateId); Map<String, BigDecimal> scoreMap = cpcIndexCalculateService.getCpcScore(param.getCustomerId(),dateId);
//剔除垃圾数据 //剔除垃圾数据
for(Iterator<ScreenPartyUserRankDataEntity> iter = registeredUsers.iterator(); registeredUsers.removeIf(user -> null == gridMap.get(user.getGridId()));
iter.hasNext();){
if(null == gridMap.get(iter.next().getGridId())) iter.remove();
}
//5.整合数据 //5.整合数据
if(!CollectionUtils.isEmpty(registeredUsers)){ if(!CollectionUtils.isEmpty(registeredUsers)){
@ -124,24 +121,8 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
user.setDataEndTime(finalDateId); user.setDataEndTime(finalDateId);
}); });
}
//6.存入数据库
//不按照时间删除,每次插入之前将该客户下的所有历史数据清空
//过滤 统计维度中没有的数据
Set<String> gridIdSet = new HashSet<>();
List<ScreenPartyUserRankDataEntity> newInsertList = registeredUsers.stream()
.filter(o -> {
if (StringUtils.isBlank(o.getGridName())) {
gridIdSet.add(o.getGridId());
return false;
} else {
return true;
} }
}).collect(Collectors.toList()); screenPartyUserRankDataService.dataClean(registeredUsers, param.getCustomerId());
log.warn("userScoreDataHub grids:{} not in DimGrid", JSON.toJSONString(gridIdSet));
screenPartyUserRankDataService.dataClean(newInsertList, param.getCustomerId());
} }
/** /**
@ -153,57 +134,49 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
**/ **/
@Override @Override
public void difficultyDataHub(ScreenCentralZoneDataFormDTO param) { public void difficultyDataHub(ScreenCentralZoneDataFormDTO param) {
//查询难点赌点中有无已结案的项目,若有则保留
List<String> existed = screenDifficultyDataService.selectExistedInfo(param.getCustomerId());
//查询数据 //查询数据
List<ScreenDifficultyDataEntity> difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),projectService.getOvertimeProjectByParameter(param.getCustomerId(),existed)); List<ScreenDifficultyDataEntity> difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),projectService.getOvertimeProjectByParameter(param.getCustomerId()));
if(CollectionUtils.isEmpty(difficulties)) return; if(CollectionUtils.isEmpty(difficulties)) return;
//剔除垃圾数据
//2.查询出客户下网格的相关信息 //2.查询出客户下网格的相关信息
List<GridInfoDTO> gridList = customerGridService.queryGridInfoList(param.getCustomerId()); List<GridInfoDTO> gridList = customerGridService.queryGridInfoList(param.getCustomerId());
Map<String,GridInfoDTO> gridMap = gridList.stream().collect(Collectors.toMap(GridInfoDTO :: getGridId,a -> a,(o, n) -> o)); Map<String,GridInfoDTO> gridMap = gridList.stream().collect(Collectors.toMap(GridInfoDTO :: getGridId,a -> a,(o, n) -> o));
List<String> missing = new LinkedList<>();
for(Iterator<ScreenDifficultyDataEntity> iter = difficulties.iterator(); iter.hasNext();){
ScreenDifficultyDataEntity pointer = iter.next();
if(null == gridMap.get(pointer.getOrgId())){
missing.add(pointer.getEventId());
iter.remove();
}
}
//剔除垃圾数据(本次需要更新的数据集)
//for(Iterator<ScreenDifficultyDataEntity> iter = difficulties.iterator(); iter.hasNext();){
// ScreenDifficultyDataEntity pointer = iter.next();
// if(null == gridMap.get(pointer.getOrgId())){
// iter.remove();
// }
//}
difficulties.removeIf( diff -> null == gridMap.get(diff.getOrgId()));
List<String> projectIds = difficulties.stream().map(ScreenDifficultyDataEntity :: getEventId).distinct().collect(Collectors.toList()); List<String> projectIds = difficulties.stream().map(ScreenDifficultyDataEntity :: getEventId).distinct().collect(Collectors.toList());
//最近一次操作 //最近一次操作
Map<String, ProjectLatestOperationResultDTO> latestOperationMap = projectProcessService.getLatestOperation(projectIds,param.getCustomerId()); Map<String, ProjectLatestOperationResultDTO> latestOperationMap = projectProcessService.getLatestOperation(projectIds,param.getCustomerId());
boolean isOperationNull = CollectionUtils.isEmpty(latestOperationMap) ? true : false;
//图片 //图片
List<ProjectSourceMapFormDTO> projectSourceMap = factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds); List<ProjectSourceMapFormDTO> projectSourceMap = factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds);
Map<String,List<ScreenDifficultyImgDataEntity>> imgMap = Map<String,List<ScreenDifficultyImgDataEntity>> imgMap =
topicService.getTopicImgs(projectSourceMap); topicService.getTopicImgs(projectSourceMap);
boolean isImgNull = CollectionUtils.isEmpty(imgMap) ? true : false;
Map<String,String> contentMap = topicService.getTopicContent(projectSourceMap); Map<String,String> contentMap = topicService.getTopicContent(projectSourceMap);
boolean isContentNull = CollectionUtils.isEmpty(contentMap) ? true : false;
difficulties.forEach( diff -> { difficulties.forEach( diff -> {
if(!isImgNull) { if(!CollectionUtils.isEmpty(imgMap)) {
List<ScreenDifficultyImgDataEntity> figureList = imgMap.get(diff.getEventId()); List<ScreenDifficultyImgDataEntity> figureList = imgMap.get(diff.getEventId());
diff.setEventImgUrl(CollectionUtils.isEmpty(figureList) ? "" : figureList.get(NumConstant.ZERO).getEventImgUrl()); diff.setEventImgUrl(CollectionUtils.isEmpty(figureList) ? "" : figureList.get(NumConstant.ZERO).getEventImgUrl());
} }
if(!isContentNull) { if(!CollectionUtils.isEmpty(contentMap)) {
diff.setEventContent(contentMap.get(diff.getEventId())); diff.setEventContent(contentMap.get(diff.getEventId()));
} }
if(!isOperationNull){ if(! CollectionUtils.isEmpty(latestOperationMap)){
ProjectLatestOperationResultDTO oper = latestOperationMap.get(diff.getEventId()); ProjectLatestOperationResultDTO oper = latestOperationMap.get(diff.getEventId());
if(null != oper){ if(null != oper){
diff.setLatestOperateDesc(oper.getOperationName()); diff.setLatestOperateDesc(oper.getOperationName());
diff.setEventTitle(oper.getTitle()); diff.setEventTitle(oper.getTitle());
diff.setEventCostTime(oper.getCostTime()); diff.setEventCostTime(oper.getCostTime());
} }
} }
diff.setDataEndTime(DateUtils.getBeforeNDay(NumConstant.ONE)); diff.setDataEndTime(DateUtils.getBeforeNDay(NumConstant.ONE));
@ -211,6 +184,6 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
List<ScreenDifficultyImgDataEntity> imgList = new LinkedList<>(); List<ScreenDifficultyImgDataEntity> imgList = new LinkedList<>();
imgMap.values().forEach(list -> {imgList.addAll(list);}); imgMap.values().forEach(list -> {imgList.addAll(list);});
screenDifficultyDataService.dataClean(param.getCustomerId(),difficulties,imgList,missing); screenDifficultyDataService.dataClean(param.getCustomerId(),difficulties,imgList);
} }
} }

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

@ -49,6 +49,14 @@ public interface ScreenDifficultyDataService extends BaseService<ScreenDifficult
* @author wangc * @author wangc
* @date 2020.09.28 11:04 * @date 2020.09.28 11:04
*/ */
void dataClean(String customerId,List<ScreenDifficultyDataEntity> difficulties, List<ScreenDifficultyImgDataEntity> imgs,List<String> missing); void dataClean(String customerId,List<ScreenDifficultyDataEntity> difficulties, List<ScreenDifficultyImgDataEntity> imgs);
/**
* @Description 根据客户Id查出全部的难点赌点的项目Id和网格Id因为需要比对全部的信息然后删除因为删除网格而导致的垃圾数据
* @param customerId
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity>
* @author wangc
* @date 2020.11.17 09:31
*/
List<ScreenDifficultyDataEntity> getAllDifficultyByCustomerId(String customerId);
} }

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyUserRankDataService.java

@ -40,5 +40,4 @@ public interface ScreenPartyUserRankDataService extends BaseService<ScreenPartyU
* @date 2020.09.27 09:44 * @date 2020.09.27 09:44
**/ **/
void dataClean(List<ScreenPartyUserRankDataEntity> dataList,String customerId); void dataClean(List<ScreenPartyUserRankDataEntity> dataList,String customerId);
} }

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

@ -53,19 +53,31 @@ public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl<ScreenDiffi
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void dataClean(String customerId, List<ScreenDifficultyDataEntity> difficulties, List<ScreenDifficultyImgDataEntity> imgs,List<String> missing) { public void dataClean(String customerId, List<ScreenDifficultyDataEntity> difficulties, List<ScreenDifficultyImgDataEntity> imgs) {
if(!CollectionUtils.isEmpty(missing)){ List<ScreenDifficultyDataEntity> orient = baseDao.selectAllDifficultyByCustomerId(customerId);
baseDao.deleteBatchDifficulty(customerId, missing); if(!CollectionUtils.isEmpty(orient)){
baseDao.deleteBatchDifficultyImg(missing); baseDao.deleteBatchDifficultyImg(orient.stream().map(ScreenDifficultyDataEntity::getEventId).distinct().collect(Collectors.toList()));
} }
baseDao.deleteBatchDifficulty(customerId,null);
if (!CollectionUtils.isEmpty(difficulties)) { if (!CollectionUtils.isEmpty(difficulties)) {
baseDao.deleteBatchDifficulty(customerId, difficulties.stream().map(ScreenDifficultyDataEntity::getEventId).distinct().collect(Collectors.toList()));
baseDao.insertBatch(difficulties); baseDao.insertBatch(difficulties);
} }
if (!CollectionUtils.isEmpty(imgs)) { if (!CollectionUtils.isEmpty(imgs)) {
baseDao.deleteBatchDifficultyImg(imgs.stream().map(ScreenDifficultyImgDataEntity::getEventId).distinct().collect(Collectors.toList()));
baseDao.insertBatchImg(imgs); baseDao.insertBatchImg(imgs);
} }
baseDao.updateTime(customerId, DateUtils.getBeforeNDay(NumConstant.ONE)); baseDao.updateTime(customerId, DateUtils.getBeforeNDay(NumConstant.ONE));
} }
/**
* @Description 根据客户Id查出全部的难点赌点的项目Id和网格Id因为需要比对全部的信息然后删除因为删除网格而导致的垃圾数据
* @param customerId
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity>
* @author wangc
* @date 2020.11.17 09:31
*/
@Override
public List<ScreenDifficultyDataEntity> getAllDifficultyByCustomerId(String customerId) {
return baseDao.selectAllDifficultyByCustomerId(customerId);
}
} }

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java

@ -104,10 +104,9 @@ public interface ProjectService extends BaseService<ProjectEntity> {
* @Description 得到超过阈值滞留的项目Id集合 * @Description 得到超过阈值滞留的项目Id集合
* 规定只要项目的任何一个负责人(被流转到的自始至终不管有没有处理)超过了自定义或默认的滞留时间就算难点赌点 * 规定只要项目的任何一个负责人(被流转到的自始至终不管有没有处理)超过了自定义或默认的滞留时间就算难点赌点
* @param customerId * @param customerId
* @param exclude
* @return java.util.List<java.lang.String> * @return java.util.List<java.lang.String>
* @author wangc * @author wangc
* @date 2020.11.06 14:14 * @date 2020.11.06 14:14
*/ */
List<String> getOvertimeProjectByParameter(String customerId,List<String> exclude); Integer getOvertimeProjectByParameter(String customerId);
} }

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java

@ -86,16 +86,15 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
* @Description 得到超过阈值滞留的项目Id集合 * @Description 得到超过阈值滞留的项目Id集合
* 规定只要项目的任何一个负责人(被流转到的自始至终不管有没有处理)超过了自定义或默认的滞留时间就算难点赌点 * 规定只要项目的任何一个负责人(被流转到的自始至终不管有没有处理)超过了自定义或默认的滞留时间就算难点赌点
* @param customerId * @param customerId
* @param exclude
* @return java.util.List<java.lang.String> * @return java.util.List<java.lang.String>
* @author wangc * @author wangc
* @date 2020.11.06 14:14 * @date 2020.11.06 14:14
*/ */
@Override @Override
public List<String> getOvertimeProjectByParameter(String customerId, List<String> exclude) { public Integer getOvertimeProjectByParameter(String customerId) {
String parameter = baseDao.selectParameterValueByKey(customerId); String parameter = baseDao.selectParameterValueByKey(customerId);
if(StringUtils.isBlank(parameter)) parameter = baseDao.selectParameterValueByKey("default"); if(StringUtils.isBlank(parameter)) parameter = baseDao.selectParameterValueByKey("default");
return baseDao.selectOvertimeProjectIds(customerId, exclude, StringUtils.isBlank(parameter) ? NumConstant.FIVE : Integer.parseInt(parameter)); return StringUtils.isBlank(parameter) ? NumConstant.FIVE : Integer.parseInt(parameter);
} }
} }

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

@ -38,6 +38,18 @@
CUSTOMER_ID = #{customerId} CUSTOMER_ID = #{customerId}
</select> </select>
<!-- 根据用户Id查询所有组原始数据 -->
<select id="selectAllGroupByCustomerId" resultType="com.epmet.dto.extract.FactOriginGroupMainDailyDTO">
SELECT
id,grid_id
FROM
fact_origin_group_main_daily
WHERE
del_flag = '0'
AND
customer_id = #{customerId}
</select>
<delete id="deleteBatchByCustomerId" > <delete id="deleteBatchByCustomerId" >
DELETE FROM DELETE FROM
fact_origin_group_main_daily fact_origin_group_main_daily

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

@ -385,11 +385,33 @@
WHERE WHERE
project.DEL_FLAG = '0' project.DEL_FLAG = '0'
AND project.CUSTOMER_ID = #{customerId} AND project.CUSTOMER_ID = #{customerId}
<if test="null != list and list.size() != 0"> AND project.ID IN (
<foreach collection="list" item="projectId" open="AND " separator=" OR " >
project.ID = #{projectId}
</foreach> SELECT DISTINCT
</if> period.project_id
FROM
fact_origin_project_org_period_daily period
LEFT JOIN
(
SELECT
project.ID AS projectId,
IF(project.project_status = 'closed',period.handled_date,NOW()) AS finishDate
FROM fact_origin_project_main_daily project LEFT JOIN fact_origin_project_org_period_daily period
ON project.ID = period.project_id AND period.del_flag = '0' AND period.customer_id = #{customerId}
AND period.operation = 'close'
WHERE project.customer_id = #{customerId} AND project.del_flag = '0'
) projectFinishDate ON projectFinishDate.projectId = period.project_id
WHERE
period.del_flag = '0'
AND period.customer_id = #{customerId}
AND TIMESTAMPDIFF( DAY, period.informed_date, projectFinishDate.finishDate) > #{thresholdValue}
)
</select> </select>
<!-- 查询当天新立的项目,是为了增量新增难点赌点的图片库 --> <!-- 查询当天新立的项目,是为了增量新增难点赌点的图片库 -->

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

@ -219,4 +219,14 @@
</foreach> </foreach>
</insert> </insert>
<select id="selectAllDifficultyByCustomerId" resultType="com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity">
SELECT
org_id,
event_id
FROM
screen_difficulty_data
WHERE
del_flag = '0'
AND customer_id = #{customerId}
</select>
</mapper> </mapper>

41
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml

@ -106,45 +106,4 @@
and PARAMETER_KEY ='detention_days' and PARAMETER_KEY ='detention_days'
</select> </select>
<select id="selectOvertimeProjectIds" resultType="string">
SELECT
DISTINCT
project.ID
FROM
project project
WHERE
project.del_flag = '0'
AND project.customer_id = #{customerId}
<if test="null != exclude and exclude.size() > 0">
<foreach collection="exclude" item="id" open="AND ( " separator=" OR " close=" ) ">
project.ID <![CDATA[ <> ]]> #{id}
</foreach>
</if>
AND EXISTS (
SELECT
stff.ID
FROM
project_staff stff
LEFT JOIN project_org_relation period ON stff.ID = period.PROJECT_STAFF_ID
AND period.DEL_FLAG = '0'
WHERE
stff.DEL_FLAG = '0'
AND stff.CUSTOMER_ID = #{customerId}
AND project.ID = stff.PROJECT_ID
AND ABS(
TIMESTAMPDIFF(
DAY,
period.INFORMED_DATE,
IF
(
period.HANDLED_DATE IS NULL,
IF
( project.`STATUS` = 'closed', project.UPDATED_TIME, NOW( ) ),
period.HANDLED_DATE
)
)
) > #{value}
)
</select>
</mapper> </mapper>

10
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java

@ -18,7 +18,6 @@
package com.epmet.modules.topic.service.impl; package com.epmet.modules.topic.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@ -75,9 +74,9 @@ import com.epmet.resi.group.dto.member.form.RemoveMemberFormDTO;
import com.epmet.resi.group.dto.member.result.ResiGroupMemberInfoRedisResultDTO; import com.epmet.resi.group.dto.member.result.ResiGroupMemberInfoRedisResultDTO;
import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.dto.topic.TopicInfoDTO; import com.epmet.resi.group.dto.topic.TopicInfoDTO;
import com.epmet.resi.group.dto.topic.form.*;
import com.epmet.resi.group.dto.topic.form.CheckTopicPublisherFormDTO; import com.epmet.resi.group.dto.topic.form.CheckTopicPublisherFormDTO;
import com.epmet.resi.group.dto.topic.form.GovTopicIssueInfoFormDTO; import com.epmet.resi.group.dto.topic.form.GovTopicIssueInfoFormDTO;
import com.epmet.resi.group.dto.topic.form.*;
import com.epmet.resi.group.dto.topic.result.*; import com.epmet.resi.group.dto.topic.result.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -1165,8 +1164,11 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
issueInfo.setVotableCount(resiGroupMemberService.gridResiCount(group.getGridId())); issueInfo.setVotableCount(resiGroupMemberService.gridResiCount(group.getGridId()));
//4.调用gov-issue新增议题 //4.调用gov-issue新增议题
Result<String> issueResult = govIssueFeignClient.issueShiftedToTopic(issueInfo); Result<String> issueResult = govIssueFeignClient.issueShiftedToTopic(issueInfo);
if (issueResult == null || !issueResult.success() || StringUtils.isBlank(issueResult.getData())) {
throw new RenException(ModuleConstant.CREATE_ISSUE_ERROR);
}
//5.修改话题shiftIssue字段 //5.修改话题shiftIssue字段
if(issueResult.success() && StringUtils.isNotBlank(issueResult.getData())){
ResiTopicEntity topic2Upd = new ResiTopicEntity(); ResiTopicEntity topic2Upd = new ResiTopicEntity();
topic2Upd.setId(topicTurnIssueFromDTO.getTopicId()); topic2Upd.setId(topicTurnIssueFromDTO.getTopicId());
topic2Upd.setUpdatedBy(topicTurnIssueFromDTO.getUserId()); topic2Upd.setUpdatedBy(topicTurnIssueFromDTO.getUserId());
@ -1196,8 +1198,6 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
resiGroupRedis.set(groupCache); resiGroupRedis.set(groupCache);
} }
logger.warn(ModuleConstant.FAILURE_TO_UPDATE_TOPIC); logger.warn(ModuleConstant.FAILURE_TO_UPDATE_TOPIC);
}
} }
} }

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java

@ -328,4 +328,6 @@ public interface ModuleConstant extends Constant {
String FIELD_OPERATION_TYPE = "OPERATION_TYPE"; String FIELD_OPERATION_TYPE = "OPERATION_TYPE";
String CLOSED_TOPIC_REASON_PREFIX = "话题已关闭:"; String CLOSED_TOPIC_REASON_PREFIX = "话题已关闭:";
String CREATE_ISSUE_ERROR = "创建议题失败";
} }

2
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java

@ -75,4 +75,6 @@ public interface UserWechatDao extends BaseDao<UserWechatEntity>{
**/ **/
List<CustomerUser4PointResultDTO> selectResiAndStrangerInfo(@Param("userIds") List<String> userIds, @Param("realName")String realName); List<CustomerUser4PointResultDTO> selectResiAndStrangerInfo(@Param("userIds") List<String> userIds, @Param("realName")String realName);
//临时用下in
List<UserWechatDTO> selectNotInUserBaseInfoTemp();
} }

12
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java

@ -166,7 +166,7 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl<UserBaseInfoDao, Us
**/ **/
@Override @Override
public void initBaseInfo() { public void initBaseInfo() {
List<UserWechatDTO> userWechatDTOList=userWechatDao.selectAll(); List<UserWechatDTO> userWechatDTOList=userWechatDao.selectNotInUserBaseInfoTemp();
List<String> userIdList=new ArrayList<>(); List<String> userIdList=new ArrayList<>();
for(UserWechatDTO userWechatDTO:userWechatDTOList){ for(UserWechatDTO userWechatDTO:userWechatDTOList){
userIdList.add(userWechatDTO.getUserId()); userIdList.add(userWechatDTO.getUserId());
@ -202,12 +202,12 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl<UserBaseInfoDao, Us
break; break;
} }
} }
UserBaseInfoResultDTO userBaseInfoResultDTO=baseDao.selectListByUserIdList(userBaseInfoEntity.getUserId()); String userBaseInfoId=baseDao.selectIdByUserId(userBaseInfoEntity.getUserId());
if(null==userBaseInfoResultDTO){ if(StringUtils.isNotBlank(userBaseInfoId)){
insert(userBaseInfoEntity); userBaseInfoEntity.setId(userBaseInfoId);
}else{
userBaseInfoEntity.setId(userBaseInfoResultDTO.getId());
updateById(userBaseInfoEntity); updateById(userBaseInfoEntity);
}else{
insert(userBaseInfoEntity);
} }
} }
return; return;

34
epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml

@ -42,34 +42,28 @@
<select id="selectUserResiInfoDTO" parameterType="com.epmet.dto.form.UserResiInfoFormDTO" <select id="selectUserResiInfoDTO" parameterType="com.epmet.dto.form.UserResiInfoFormDTO"
resultType="com.epmet.dto.result.UserResiInfoResultDTO"> resultType="com.epmet.dto.result.UserResiInfoResultDTO">
SELECT SELECT
uri.id, ubi.USER_ID,
uc.USER_ID,
uri.REG_MOBILE, uri.REG_MOBILE,
uri.SURNAME, ubi.SURNAME,
uri.`NAME`, ubi.`NAME`,
uri.STREET, ubi.STREET,
uri.DISTRICT, ubi.DISTRICT,
uri.RESI_VISIT_ID, uri.RESI_VISIT_ID,
uri.BUILDING_ADDRESS, ubi.BUILDING_ADDRESS,
CONCAT( CONCAT(
uri.STREET, ubi.STREET,
'-', '-',
uri.SURNAME, ubi.SURNAME,
( CASE WHEN uw.SEX = '1' THEN '先生' WHEN uw.SEX = '2' THEN '女士' ELSE '先生/女士' END ) ( CASE WHEN ubi.GENDER = '1' THEN '先生' WHEN ubi.GENDER = '2' THEN '女士' ELSE '先生/女士' END )
) AS show_name, ) AS show_name,
uw.HEAD_IMG_URL AS head_photo uw.HEAD_IMG_URL AS head_photo
FROM FROM
user_customer uc user_base_info ubi
LEFT JOIN user_resi_info uri ON ( uc.USER_ID = uri.USER_ID ) LEFT JOIN user_resi_info uri ON ( ubi.USER_ID = uri.USER_ID AND uri.DEL_FLAG = '0' )
LEFT JOIN user_wechat uw ON (uc.USER_ID = uw.USER_ID) LEFT JOIN user_wechat uw ON ( uri.USER_ID = uw.USER_ID AND uw.DEL_FLAG = '0' )
WHERE WHERE
uc.DEL_FLAG = '0' ubi.USER_ID =#{userId}
AND uri.DEL_FLAG = '0' AND ubi.DEL_FLAG = '0'
AND uc.CUSTOMER_ID = #{customerId}
AND uc.USER_ID = #{userId}
AND uw.DEL_FLAG = '0'
AND uw.USER_ID = #{userId}
</select> </select>
<!-- 查询用户注册信息 不按照客户Id查询 --> <!-- 查询用户注册信息 不按照客户Id查询 -->

20
epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml

@ -115,4 +115,24 @@
ORDER BY ORDER BY
base.REAL_NAME , wechat.NICKNAME base.REAL_NAME , wechat.NICKNAME
</select> </select>
<!-- 查询出注册了居民但是不在user_base_info表的-->
<select id="selectNotInUserBaseInfoTemp" resultType="com.epmet.dto.UserWechatDTO">
SELECT
*
FROM
user_wechat uw
WHERE
uw.USER_ID IN (
SELECT DISTINCT
uri.USER_ID
FROM
user_resi_info uri
WHERE
uri.USER_ID NOT IN ( SELECT uri.USER_ID FROM user_base_info uri where uri.DEL_FLAG='0')
AND uri.DEL_FLAG = '0'
)
AND uw.DEL_FLAG = '0'
and uw.NICKNAME is not null
</select>
</mapper> </mapper>

Loading…
Cancel
Save