Browse Source

Merge branches 'dev' and 'dev_routine_work' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_routine_work

dev_shibei_match
wangxianzhang 4 years ago
parent
commit
2e39ea6069
  1. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java
  2. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
  3. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  4. 27
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  5. 2
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml
  6. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java

8
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java

@ -1,5 +1,6 @@
package com.epmet.datareport.service.evaluationindex.screen.impl; package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.CommonOperateTypeEnum; import com.epmet.commons.tools.enums.CommonOperateTypeEnum;
@ -12,6 +13,7 @@ import com.epmet.datareport.service.evaluationindex.screen.IndexService;
import com.epmet.evaluationindex.screen.constant.ScreenConstant; import com.epmet.evaluationindex.screen.constant.ScreenConstant;
import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.form.*;
import com.epmet.evaluationindex.screen.dto.result.*; import com.epmet.evaluationindex.screen.dto.result.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -31,6 +33,7 @@ import java.util.stream.Collectors;
* @author yinzuomei@elink-cn.com * @author yinzuomei@elink-cn.com
* @date 2020/8/18 10:21 * @date 2020/8/18 10:21
*/ */
@Slf4j
@Service @Service
@DataSource(DataSourceConstant.EVALUATION_INDEX) @DataSource(DataSourceConstant.EVALUATION_INDEX)
public class IndexServiceImpl implements IndexService { public class IndexServiceImpl implements IndexService {
@ -118,6 +121,7 @@ public class IndexServiceImpl implements IndexService {
List<MonthBarchartResult> monthBarchartResults = screenIndexDataMonthlyDao.selectMonthBarchart(monthBarchartFormDTO.getAgencyId(), List<MonthBarchartResult> monthBarchartResults = screenIndexDataMonthlyDao.selectMonthBarchart(monthBarchartFormDTO.getAgencyId(),
monthBarchartFormDTO.getMonthId(), monthBarchartFormDTO.getMonthId(),
monthBarchartFormDTO.getCustomerId()); monthBarchartFormDTO.getCustomerId());
log.info("monthBarchart selectMonthBarchart return:{}", JSON.toJSONString(monthBarchartFormDTO));
if (monthBarchartResults.size() == NumConstant.ZERO){ if (monthBarchartResults.size() == NumConstant.ZERO){
for (int i = NumConstant.ZERO; i <= NumConstant.TWELVE; i++) { for (int i = NumConstant.ZERO; i <= NumConstant.TWELVE; i++) {
serviceAbilityData.add(NumConstant.ZERO_DOT_ZERO); serviceAbilityData.add(NumConstant.ZERO_DOT_ZERO);
@ -161,6 +165,7 @@ public class IndexServiceImpl implements IndexService {
}else{ }else{
_ymList=dateUtils.getXpro().keySet().stream().collect(Collectors.toList()); _ymList=dateUtils.getXpro().keySet().stream().collect(Collectors.toList());
} }
log.info("monthBarchart _ymList return:{}", _ymList);
//针对集合collect的游标 //针对集合collect的游标
int cursor = NumConstant.ZERO; int cursor = NumConstant.ZERO;
//针对X轴,数据集合不全则进行数据填充 //针对X轴,数据集合不全则进行数据填充
@ -176,6 +181,7 @@ public class IndexServiceImpl implements IndexService {
continue ; continue ;
} }
if(!StringUtils.equals(collect.get(cursor).getMonthId(),_ymList.get(i))){ if(!StringUtils.equals(collect.get(cursor).getMonthId(),_ymList.get(i))){
log.info("monthBarchart cursor not eq return:{}", _ymList.get(i));
//SET DEFAULT //SET DEFAULT
serviceAbilityData.add(NumConstant.ZERO_DOT_ZERO); serviceAbilityData.add(NumConstant.ZERO_DOT_ZERO);
partyDevAbilityData.add(NumConstant.ZERO_DOT_ZERO); partyDevAbilityData.add(NumConstant.ZERO_DOT_ZERO);
@ -192,6 +198,7 @@ public class IndexServiceImpl implements IndexService {
//保持cursor不变 //保持cursor不变
}else{ }else{
MonthBarchartResult data = collect.get(cursor); MonthBarchartResult data = collect.get(cursor);
log.info("monthBarchart collect.get return:{}", JSON.toJSONString(data));
//SET DATA //SET DATA
serviceAbilityData.add(null == data.getServiceAbility() ? NumConstant.ZERO_DOT_ZERO : data.getServiceAbility()); serviceAbilityData.add(null == data.getServiceAbility() ? NumConstant.ZERO_DOT_ZERO : data.getServiceAbility());
partyDevAbilityData.add(null == data.getPartyDevAbility() ? NumConstant.ZERO_DOT_ZERO : data.getPartyDevAbility()); partyDevAbilityData.add(null == data.getPartyDevAbility() ? NumConstant.ZERO_DOT_ZERO : data.getPartyDevAbility());
@ -231,6 +238,7 @@ public class IndexServiceImpl implements IndexService {
result.setServiceOriginScore(serviceOriginData); result.setServiceOriginScore(serviceOriginData);
result.setPartyOriginScore(partyOriginData); result.setPartyOriginScore(partyOriginData);
result.setGovernOriginScore(governOriginData); result.setGovernOriginScore(governOriginData);
log.info("monthBarchart final result:{}", JSON.toJSONString(result));
return result; return result;
} }

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java

@ -96,6 +96,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
wrapper.between(IcPartyActivityEntity::getActivityTime, formDTO.getStartTime(), formDTO.getEndTime()); wrapper.between(IcPartyActivityEntity::getActivityTime, formDTO.getStartTime(), formDTO.getEndTime());
wrapper.orderByDesc(IcPartyActivityEntity::getUpdatedTime); wrapper.orderByDesc(IcPartyActivityEntity::getUpdatedTime);
List<IcPartyActivityEntity> list = baseDao.selectList(wrapper); List<IcPartyActivityEntity> list = baseDao.selectList(wrapper);
PageInfo<IcPartyActivityEntity> pageInfo = new PageInfo<>(list);
List<IcPartyActivityDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyActivityDTO.class); List<IcPartyActivityDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyActivityDTO.class);
IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); IcPartyUnitDTO unitDTO = new IcPartyUnitDTO();
@ -106,7 +107,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
dto.setUnitName(option.get(dto.getUnitId())); dto.setUnitName(option.get(dto.getUnitId()));
}); });
} }
PageInfo<IcPartyActivityDTO> pageInfo = new PageInfo<>(dtoList);
return new PageData<>(dtoList, pageInfo.getTotal()); return new PageData<>(dtoList, pageInfo.getTotal());
} }

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

@ -101,6 +101,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
wrapper.like(StringUtils.isNotBlank(formDTO.getContactMobile()), IcPartyUnitEntity::getContactMobile, formDTO.getContactMobile()); wrapper.like(StringUtils.isNotBlank(formDTO.getContactMobile()), IcPartyUnitEntity::getContactMobile, formDTO.getContactMobile());
wrapper.orderByDesc(IcPartyUnitEntity::getUpdatedTime); wrapper.orderByDesc(IcPartyUnitEntity::getUpdatedTime);
List<IcPartyUnitEntity> list = baseDao.selectList(wrapper); List<IcPartyUnitEntity> list = baseDao.selectList(wrapper);
PageInfo<IcPartyUnitEntity> pageInfo = new PageInfo<>(list);
List<IcPartyUnitDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class); List<IcPartyUnitDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class);
Result<Map<String, String>> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); Result<Map<String, String>> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode());
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
@ -121,7 +122,6 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
item.setSatisfaction(new BigDecimal(item.getSatisfaction()).setScale(2,BigDecimal.ROUND_HALF_UP).toString()); item.setSatisfaction(new BigDecimal(item.getSatisfaction()).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
} }
}); });
PageInfo<IcPartyUnitDTO> pageInfo = new PageInfo<>(dtoList);
return new PageData<>(dtoList, pageInfo.getTotal()); return new PageData<>(dtoList, pageInfo.getTotal());
} }

27
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -25,8 +25,8 @@ import com.epmet.commons.rocketmq.messages.ProjectChangedMQMsg;
import com.epmet.commons.tools.constant.*; import com.epmet.commons.tools.constant.*;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
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.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
@ -58,11 +58,12 @@ import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
import com.epmet.send.SendMqMsgUtil; import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.*; import com.epmet.service.*;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import org.apache.commons.collections4.CollectionUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils; import org.apache.commons.collections4.ListUtils;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -76,7 +77,6 @@ import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -2916,26 +2916,31 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
ProjectDistributionAnalysisRightResultDTO result = new ProjectDistributionAnalysisRightResultDTO(); ProjectDistributionAnalysisRightResultDTO result = new ProjectDistributionAnalysisRightResultDTO();
List<ProjectDistributionAnalysisRightDTO> orgList = new ArrayList<>(); List<ProjectDistributionAnalysisRightDTO> orgList = new ArrayList<>();
Result<List<SonOrgResultDTO>> sonOrgList = govOrgOpenFeignClient.getSonAgencyId(formDTO.getOrgId(), agencyInfo.getLevel()); Result<List<SonOrgResultDTO>> sonOrgList = govOrgOpenFeignClient.getSonAgencyId(formDTO.getOrgId(), agencyInfo.getLevel());
if (!sonOrgList.success() || CollectionUtils.isEmpty(sonOrgList.getData())){ if (!sonOrgList.success()){
throw new EpmetException(String.format("查询组织{%s}的下级组织失败或为空...",formDTO.getOrgId())); throw new EpmetException(String.format("查询组织{%s}的下级组织失败...",formDTO.getOrgId()));
}
if (CollectionUtils.isEmpty(sonOrgList.getData())){
return result;
} }
// 所有子级orgId,并构建全部数据
List<SonOrgResultDTO> orgIds = sonOrgList.getData(); List<SonOrgResultDTO> orgIds = sonOrgList.getData();
if (!agencyInfo.getLevel().equals(ProjectConstant.ORG_LEVEL_COMMUNITY)){
orgList = baseDao.selectProjectCountByOrg(orgIds, formDTO.getStartDate(),formDTO.getEndDate());
}else {
for (SonOrgResultDTO o : orgIds) { for (SonOrgResultDTO o : orgIds) {
ProjectDistributionAnalysisRightDTO dto = new ProjectDistributionAnalysisRightDTO(); ProjectDistributionAnalysisRightDTO dto = new ProjectDistributionAnalysisRightDTO();
dto.setOrgId(o.getOrgId()); dto.setOrgId(o.getOrgId());
orgList.add(dto); orgList.add(dto);
} }
List<ProjectDistributionAnalysisRightDTO> dtos;
if (!agencyInfo.getLevel().equals(ProjectConstant.ORG_LEVEL_COMMUNITY)){
dtos = baseDao.selectProjectCountByOrg(orgIds, formDTO.getStartDate(),formDTO.getEndDate());
}else {
Result<List<ProjectDistributionAnalysisRightDTO>> projectCountByGrid = govIssueOpenFeignClient.getProjectCountByGrid(formDTO); Result<List<ProjectDistributionAnalysisRightDTO>> projectCountByGrid = govIssueOpenFeignClient.getProjectCountByGrid(formDTO);
if (!projectCountByGrid.success()){ if (!projectCountByGrid.success()){
throw new EpmetException("查询网格项目数失败..."); throw new EpmetException("查询网格项目数失败...");
} }
if (CollectionUtils.isNotEmpty(projectCountByGrid.getData())){ dtos = projectCountByGrid.getData();
orgList.stream().forEach(o -> projectCountByGrid.getData().stream().filter(p -> p.getOrgId().equals(o.getOrgId())).forEach(p -> o.setCount(p.getCount())));
} }
if (CollectionUtils.isNotEmpty(dtos)){
orgList.stream().forEach(o -> dtos.stream().filter(p -> p.getOrgId().equals(o.getOrgId())).forEach(p -> o.setCount(p.getCount())));
} }
if (CollectionUtils.isEmpty(orgList)){ if (CollectionUtils.isEmpty(orgList)){
return result; return result;

2
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml

@ -478,7 +478,7 @@
COUNT(ID) AS count COUNT(ID) AS count
FROM project FROM project
WHERE DEL_FLAG = '0' WHERE DEL_FLAG = '0'
AND ORG_ID_PATH LIKE CONCAT(#{o.orgId},'%') AND ORG_ID_PATH LIKE CONCAT(#{o.pids},':',#{o.orgId},'%')
AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') >= #{startDate} AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') >= #{startDate}
AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') <![CDATA[ <= ]]> #{endDate} AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') <![CDATA[ <= ]]> #{endDate}
</foreach> </foreach>

2
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java

@ -185,8 +185,8 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl<IcPartymember
wrapper.like(StringUtils.isNotBlank(formDTO.getName()), IcPartymemberStyleEntity::getName, formDTO.getName()); wrapper.like(StringUtils.isNotBlank(formDTO.getName()), IcPartymemberStyleEntity::getName, formDTO.getName());
wrapper.like(StringUtils.isNotBlank(formDTO.getMainDeed()), IcPartymemberStyleEntity::getMainDeed, formDTO.getMainDeed()); wrapper.like(StringUtils.isNotBlank(formDTO.getMainDeed()), IcPartymemberStyleEntity::getMainDeed, formDTO.getMainDeed());
List<IcPartymemberStyleEntity> list = baseDao.selectList(wrapper); List<IcPartymemberStyleEntity> list = baseDao.selectList(wrapper);
PageInfo<IcPartymemberStyleEntity> pageInfo = new PageInfo<>(list);
List<IcPartymemberStyleDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartymemberStyleDTO.class); List<IcPartymemberStyleDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartymemberStyleDTO.class);
PageInfo<IcPartymemberStyleDTO> pageInfo = new PageInfo<>(dtoList);
//设置网格名 //设置网格名
dtoList.forEach(item -> { dtoList.forEach(item -> {
if (StringUtils.isNotBlank(item.getGridId())) { if (StringUtils.isNotBlank(item.getGridId())) {

Loading…
Cancel
Save