Browse Source

Merge remote-tracking branch 'origin/dev'

dev
zxc 4 years ago
parent
commit
7d1852d6b5
  1. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
  2. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  3. 27
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  4. 2
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml
  5. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java

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