Browse Source

Merge remote-tracking branch 'origin/dev_optimize' into dev_optimize

release
yinzuomei 4 years ago
parent
commit
96c2620451
  1. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java
  2. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java
  3. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java
  4. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java
  5. 1
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java
  6. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java
  7. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml
  8. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java
  9. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java
  10. 65
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
  11. 5
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java

@ -43,7 +43,7 @@ public class LatestActInfoDTO implements Serializable {
* 客户id
*/
private String customerId;
private String gridId;
/**
* 活动标题
*/

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java

@ -46,4 +46,6 @@ public class CommunitySelfOrganizationListFormDTO implements Serializable {
private String customerId;
private String agencyId;
private Integer ranking;
private String remark;
}

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java

@ -28,7 +28,7 @@ public class DraftActInfoFormDTO implements Serializable {
* 活动草稿id,如果是编辑之前的活动草稿此列是有值的
*/
private String actDraftId;
private String gridId;
/**
* 如果是重新发布活动此列是有值的

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java

@ -101,6 +101,9 @@ public class ActPreviewResultDTO implements Serializable {
*/
private String actType;
private String gridId;
private String gridName;
/**
* 联建单位
*/

1
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java

@ -21,6 +21,7 @@ public class LatestDraftActInfoResultDTO implements Serializable {
* 活动草稿id
*/
private String actDraftId;
private String gridId;
/**
* 客户id
*/

11
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java

@ -2,6 +2,8 @@ package com.epmet.service.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.ActConstant;
@ -201,6 +203,13 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList());
actPreviewResultDTO.setUnitIdList(unitIds);
actPreviewResultDTO.setUnitNameList(unitNames);
if (StringUtils.isNotEmpty(actPreviewResultDTO.getGridId())) {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(actPreviewResultDTO.getGridId());
if (null != gridInfo) {
actPreviewResultDTO.setGridName(gridInfo.getGridName());
}
}
}
}
return actPreviewResultDTO;
@ -337,7 +346,7 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
latestActInfoDTO.setActType(formDTO.getActType());
latestActInfoDTO.setTarget(formDTO.getTarget());
latestActInfoDTO.setGridId(formDTO.getGridId());
return latestActInfoDTO;
}

3
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml

@ -62,6 +62,9 @@
<if test="null != organizationName and organizationName != '' ">
AND so.ORGANIZATION_NAME LIKE CONCAT('%',#{organizationName},'%')
</if>
<if test="null != remark and remark != '' ">
AND so.REMARK LIKE CONCAT('%',#{remark},'%')
</if>
<if test=" null != startTime and startTime != '' ">
AND so.ORGANIZATION_CREATED_TIME <![CDATA[ >= ]]> #{startTime}
</if>

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java

@ -118,6 +118,18 @@ public class BuildingController {
List<BuildingTreeLevelDTO> buildingTreeLevelDTOS =buildingService.treeList(tokenDTO.getCustomerId(), tokenDTO.getUserId());
return new Result().ok(buildingTreeLevelDTOS);
}
/**
* Desc: 根据前端方便新开接口只返回树的ID
* @param tokenDTO
* @author zxc
* @date 2022/4/12 15:20
*/
@PostMapping("tree-ids")
public Result treeIds(@LoginUser TokenDto tokenDTO){
List<String> ids =buildingService.treeIds(tokenDTO.getCustomerId(), tokenDTO.getUserId());
return new Result().ok(ids);
}
/**
* 导出模板
* @param response

1
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java

@ -57,6 +57,7 @@ public interface BuildingService {
void addBuilding(String customerId, IcBulidingFormDTO formDTO);
List<BuildingTreeLevelDTO> treeList(String customerId, String staffId);
List<String> treeIds(String customerId, String staffId);
List<Integer> importExcel(String customerId, List<IcBuildingExcel> list, String staffId, List<Integer> numList);

65
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java

@ -261,6 +261,71 @@ public class BuildingServiceImpl implements BuildingService {
}
@Override
public List<String> treeIds(String customerId, String staffId) {
List<String> result = new ArrayList<>();
CustomerStaffInfoCacheResult agency = CustomerStaffRedis.getStaffInfo(customerId, staffId);
if(null == agency || StringUtils.isBlank(agency.getAgencyId())){
log.error("com.epmet.service.impl.BuildingServiceImpl.treeIds,没有找到工作人员所属的机关信息,用户Id:{}",staffId);
return new ArrayList<>();
}
//1.获取所在组织及下级组织
CustomerAgencyEntity customerAgency = customerAgencyDao.selectById(agency.getAgencyId());
List<CustomerAgencyEntity> customerAgencyList = icBuildingDao.selectAgencyChildrenList(agency.getAgencyId());
customerAgencyList.add(customerAgency);
if(CollectionUtils.isEmpty(customerAgencyList)){
return new ArrayList<>();
}
result.addAll(customerAgencyList.stream().map(m -> m.getId()).collect(Collectors.toList()));
List<BuildingTreeLevelDTO> agencyList = customerAgencyList.stream().map(item -> {
BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO();
buildingTreeLevelDTO.setId(item.getId());
buildingTreeLevelDTO.setPId(item.getPid());
buildingTreeLevelDTO.setLabel(item.getOrganizationName());
buildingTreeLevelDTO.setLevel(item.getLevel());
buildingTreeLevelDTO.setLongitude(item.getLongitude());
buildingTreeLevelDTO.setLatitude(item.getLatitude());
buildingTreeLevelDTO.setChildren(new ArrayList<>());
//当前组织有几个下级组织
buildingTreeLevelDTO.setShowNum(StrConstant.EPMETY_STR);
return buildingTreeLevelDTO;
}).collect(Collectors.toList());
//2.获取组织所在网格
List<String> agencyIdList = customerAgencyList.stream().map(BaseEpmetEntity::getId).collect(Collectors.toList());
List<CustomerGridEntity> customerGridList = customerGridDao.selectList(new QueryWrapper<CustomerGridEntity>().lambda().in(CustomerGridEntity::getPid, agencyIdList));
if(CollectionUtils.isEmpty(customerGridList)){
return result;
}
result.addAll(customerGridList.stream().map(m -> m.getId()).collect(Collectors.toList()));
List<BuildingTreeLevelDTO> gridList = customerGridList.stream().map(item -> {
BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO();
buildingTreeLevelDTO.setId(item.getId());
buildingTreeLevelDTO.setLabel(item.getGridName());
buildingTreeLevelDTO.setLevel("grid");
buildingTreeLevelDTO.setPId(item.getPid());
buildingTreeLevelDTO.setLongitude(item.getLongitude());
buildingTreeLevelDTO.setLatitude(item.getLatitude());
buildingTreeLevelDTO.setChildren(new ArrayList<>());
//当前网格下有几个小区
buildingTreeLevelDTO.setShowNum(StrConstant.EPMETY_STR);
return buildingTreeLevelDTO;
}).collect(Collectors.toList());
//3.获取网格下的所有小区
List<String> gridIdList = customerGridList.stream().map(BaseEpmetEntity::getId).collect(Collectors.toList());
LambdaQueryWrapper<IcNeighborHoodEntity> queryWrapper = new QueryWrapper<IcNeighborHoodEntity>().lambda()
.in(IcNeighborHoodEntity::getGridId, gridIdList)
.orderByAsc(IcNeighborHoodEntity::getCreatedTime);
List<IcNeighborHoodEntity> icNeighborHoodList = icNeighborHoodDao.selectList(queryWrapper);
if(CollectionUtils.isEmpty(icNeighborHoodList)){
agencyList.addAll(gridList);
return result;
}
result.addAll(icNeighborHoodList.stream().map(m -> m.getId()).collect(Collectors.toList()));
return result;
}
@Override
@Transactional(rollbackFor = Exception.class)
public List<Integer> importExcel(String customerId, List<IcBuildingExcel> list, String staffId, List<Integer> numList) {

5
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -154,7 +154,10 @@
b.BUILDING_NAME as buildingName,
d.UNIT_NUM as unitNum,
a.DOOR_NAME as doorName,
if(a.RENT_FLAG=0,'自住',if(a.RENT_FLAG=1,'出租','闲置')) as rentFlag,
(case when a.RENT_FLAG = '0' then '自住'
when a.RENT_FLAG = '1' then '出租'
when a.RENT_FLAG = '2' then '闲置'
else '' end) as rentFlag,
a.OWNER_NAME as ownerName,
/*a.RENT_FLAG as rentFlag,
a.PURPOSE as purpose,*/

Loading…
Cancel
Save