Browse Source

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

dev
zxc 3 years ago
parent
commit
d36b8d1e1a
  1. 6
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/AgencyInfoCache.java
  2. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java
  3. 76
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  4. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml
  5. 1
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java
  6. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml
  7. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java
  8. 9
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java
  9. 8
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseRentFlagEnums.java
  10. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  11. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
  12. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
  13. 35
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  14. 25
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  15. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java
  16. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

6
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/AgencyInfoCache.java

@ -4,6 +4,7 @@ import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Author zxc
@ -59,6 +60,11 @@ public class AgencyInfoCache implements Serializable {
*/
private String areaCode;
/**
* 地区编码全路径例如37,3702,370203,370203005,370203005015
*/
private List<String> areaCodePath;
/**
* 删除标识
*/

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java

@ -22,6 +22,8 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 机关单位信息表
*
@ -74,6 +76,11 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
*/
private String areaCode;
/**
* 地区编码全路径例如37,3702,370203,370203005,370203005015
*/
private List<String> areaCodePath;
/**
* 总人数
*/

76
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java

@ -6,6 +6,7 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import com.alibaba.fastjson.JSON;
import com.dingtalk.api.request.OapiRobotSendRequest;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.DingDingRobotConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
@ -250,41 +251,6 @@ public class GovOrgServiceImpl implements GovOrgService {
return result;
}
public static void main(String[] args) {
List<NextAreaCodeResultDTO> allList = new ArrayList<>();
NextAreaCodeResultDTO m1 = new NextAreaCodeResultDTO();
m1.setAreaCode("1");
m1.setAreaName("a");
allList.add(m1);
NextAreaCodeResultDTO m2 = new NextAreaCodeResultDTO();
m2.setAreaCode("2");
m2.setAreaName("b");
allList.add(m2);
NextAreaCodeResultDTO m3 = new NextAreaCodeResultDTO();
m3.setAreaCode("3");
m3.setAreaName("c");
allList.add(m3);
List<String> stringList = new ArrayList<>();
stringList.add("1");
stringList.add("2");
Iterator<NextAreaCodeResultDTO> iterator = allList.iterator();
while (iterator.hasNext()) {
NextAreaCodeResultDTO next = iterator.next();
for (String usedAreaCode : stringList) {
if (next.getAreaCode().equals(usedAreaCode)) {
iterator.remove();
}
}
}
System.out.println(JSON.toJSONString(allList, true));
}
/**
* @param staffId
* @Author sun
@ -643,7 +609,45 @@ public class GovOrgServiceImpl implements GovOrgService {
*/
@Override
public CustomerAgencyEntity getAgencyInfo(String agencyId) {
return customerAgencyDao.selectById(agencyId);
CustomerAgencyEntity customerAgencyEntity=customerAgencyDao.selectById(agencyId);
//设置行政地区编码全路径
if (StringUtils.isNotBlank(customerAgencyEntity.getAreaCode()) && StringUtils.isNotBlank(customerAgencyEntity.getParentAreaCode())) {
customerAgencyEntity.setAreaCodePath(queryAreaCodePath(customerAgencyEntity));
}
return customerAgencyEntity;
}
private List<String> queryAreaCodePath(CustomerAgencyEntity customerAgencyEntity) {
List<String> areaCodePath = new ArrayList<>();
switch (customerAgencyEntity.getLevel()) {
case Constant.COMMUNITY:
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.TWO));
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.FOUR));
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.SIX));
areaCodePath.add(customerAgencyEntity.getParentAreaCode());
areaCodePath.add(customerAgencyEntity.getAreaCode());
break;
case Constant.STREET:
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.TWO));
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.FOUR));
areaCodePath.add(customerAgencyEntity.getParentAreaCode());
areaCodePath.add(customerAgencyEntity.getAreaCode());
break;
case Constant.DISTRICT:
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.TWO));
areaCodePath.add(customerAgencyEntity.getParentAreaCode());
areaCodePath.add(customerAgencyEntity.getAreaCode());
break;
case Constant.CITY:
areaCodePath.add(customerAgencyEntity.getParentAreaCode());
areaCodePath.add(customerAgencyEntity.getAreaCode());
break;
case Constant.PROVINCE:
areaCodePath.add(customerAgencyEntity.getAreaCode());
break;
}
return areaCodePath;
}
/**

2
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml

@ -163,6 +163,7 @@
WHERE
u.del_flag = '0'
AND PARTY_FLAG = 0
AND u.point_total > 0 <!-- 初心互助中公益达人,0分人员不显示在榜单上 -->
<if test="orgType != null and orgType !=''">
<if test="orgType == 'agency'">
AND u.all_parent_ids LIKE CONCAT('%',#{orgId},'%')
@ -207,6 +208,7 @@
WHERE
u.del_flag = '0'
AND party_flag = '1'<!-- 是否是党员标志:1是。0不是党员 -->
and u.point_total > 0 <!-- 初心互助中党员先锋排行,0分人员不显示在榜单上 -->
<if test="orgType != null and orgType !=''">
<if test="orgType == 'agency'">
AND u.all_parent_ids LIKE CONCAT('%',#{orgId},'%')

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

@ -92,6 +92,7 @@ public class CommunitySelfOrganizationListDTO implements Serializable {
this.longitude = "";
this.latitude = "";
this.orgId = "";
this.remark = "";
this.score = NumConstant.ZERO;
this.organizationPersonnel = new ArrayList<>();
}

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

@ -53,7 +53,8 @@
so.SERVICE_ITEM AS serviceItem,
so.LONGITUDE AS longitude,
so.LATITUDE AS latitude,
so.ID as orgId
so.ID as orgId,
so.remark
FROM ic_community_self_organization so
WHERE so.DEL_FLAG = 0
AND so.ORG_ID = #{agencyId}

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java

@ -79,9 +79,9 @@ public class IcHouseFormDTO implements Serializable {
private String purpose;
/**
* 1出租0未出租
* 1出租 0自住 2闲置
*/
@NotNull(message = "是否出租不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
@NotNull(message = "房屋状态不能为空", groups = {AddShowGroup.class, UpdateShowGroup.class})
private Integer rentFlag;
/**

9
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListIcNeighborHoodFormDTO.java

@ -62,6 +62,10 @@ public class ListIcNeighborHoodFormDTO implements Serializable{
* 房主电话
*/
private String ownerPhone;
/**
* 房屋状态 1出租 0自住 2闲置
*/
private String rentFlag;
/**
* 数据类型小区neighbourHood楼栋building房屋house
*/
@ -81,5 +85,10 @@ public class ListIcNeighborHoodFormDTO implements Serializable{
*/
private String keyword;
/**
* 1出租 0自住 2闲置
*/
private String rentFlag;
}

8
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseRentFlagEnums.java

@ -3,8 +3,12 @@ package com.epmet.enums;
import org.springframework.util.StringUtils;
public enum HouseRentFlagEnums {
YES(1,"是"),
NO(0,"否");
//原有的房屋出租状态是否改为房屋状态【1:出租 0:自住 2:闲置】
/*YES(1,"是"),
NO(0,"否");*/
HOUSE_ZZ(0,"自住"),
HOUSE_CZ(1,"出租"),
HOUSE_XZ(2,"闲置");

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java

@ -94,7 +94,7 @@ public class HouseController implements ResultDataResolver {
IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(null, formDTO.getBuildingId(), formDTO.getOwnerName(),
formDTO.getOwnerPhone(), null,
null, queryScene,
formDTO.getPageNo(), formDTO.getPageSize());
formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getId(),formDTO.getLevel(),formDTO.getRentFlag());
return new Result().ok(icNeighborHoodResultDTO);
}
@ -142,7 +142,7 @@ public class HouseController implements ResultDataResolver {
null);
IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(loginUserDetail.getAgencyId(),null, null, null,
neighborhoodName, buildingName, scene, formDTO.getPageNo(), formDTO.getPageSize());
neighborhoodName, buildingName, scene, formDTO.getPageNo(), formDTO.getPageSize(),null,null,null);
return new Result<IcNeighborHoodResultDTO>().ok(icNeighborHoodResultDTO);
}

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java

@ -38,7 +38,10 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
@Param("ownerPhone") String ownerPhone,
@Param("neighborHoodName") String neighborHoodName,
@Param("buildingName") String buildingName,
@Param("queryScene") String queryScene);
@Param("queryScene") String queryScene,
@Param("id")String id,
@Param("level")String level,
@Param("rentFlag")String rentFlag);
List<IcHouseExcel> searchAllHouse(@Param("house") IcHouseEntity house);

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java

@ -62,7 +62,10 @@ public interface HouseService {
String buildingName,
String queryScene,
Integer pageNo,
Integer pageSize);
Integer pageSize,
String id,
String level,
String rentFlag);
void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception;

35
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -258,7 +258,8 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
String buildingName,
String queryScene,
Integer pageNo,
Integer pageSize) {
Integer pageSize,
String id,String level, String rentFlag) {
IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO();
//如果类型是house 查房屋
//IPage<Map<String, Object>> resultMap = searchHouse(buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, pageNo, pageSize);
@ -266,23 +267,15 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
// 查询pids
String pids = null;
if (StringUtils.isNotBlank(ancestorAgencyId)) {
CustomerAgencyDTO agency = agencyservice.getAgencyById(ancestorAgencyId);
if (agency == null) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询房屋列表】查询当前staff所属组织信息失败");
}
if (NumConstant.ZERO_STR.equals(agency.getPid())) {
pids = ancestorAgencyId;
} else {
pids = agency.getPids().concat(StrConstant.COLON).concat(ancestorAgencyId);
pids = getPids(ancestorAgencyId);
}
if (StringUtils.isNotBlank(level) && level.equals("agency")){
pids = getPids(ancestorAgencyId);
}
IPage<IcHouseEntity> page = new Page<IcHouseEntity>(pageNo,pageSize);
IPage<Map<String, Object>> mapIPage = icHouseDao.searchHouseByPage(page, pids, buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, queryScene);
IPage<Map<String, Object>> mapIPage = icHouseDao.searchHouseByPage(page, pids, buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, queryScene,id,level,rentFlag);
List<Map<String, Object>> records = mapIPage.getRecords();
records.forEach(item->{
item.put("houseType", HouseTypeEnums.getTypeValue(item.get("houseTypeKey")));
@ -293,6 +286,22 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
result.setList(records);
return result;
}
public String getPids(String agencyId){
String pids = null;
CustomerAgencyDTO agency = agencyservice.getAgencyById(agencyId);
if (agency == null) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询房屋列表】查询当前staff所属组织信息失败");
}
if (NumConstant.ZERO_STR.equals(agency.getPid())) {
pids = agencyId;
} else {
pids = agency.getPids().concat(StrConstant.COLON).concat(agencyId);
}
return pids;
}
@Override
public void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception {

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

@ -154,7 +154,7 @@
b.BUILDING_NAME as buildingName,
d.UNIT_NUM as unitNum,
a.DOOR_NAME as doorName,
if(a.RENT_FLAG=1,'是','否') as rentFlag,
if(a.RENT_FLAG=0,'自住',if(a.RENT_FLAG=1,'出租','闲置')) as rentFlag,
a.OWNER_NAME as ownerName,
/*a.RENT_FLAG as rentFlag,
a.PURPOSE as purpose,*/
@ -177,14 +177,24 @@
<where>
a.del_flag = '0'
<if test="pids != null and pids != ''">
and case c.AGENCY_PIDS
when '' then CONCAT(c.AGENCY_ID) like CONCAT(#{pids}, '%')
else CONCAT(c.AGENCY_PIDS, ':', c.AGENCY_ID) like CONCAT(#{pids}, '%')
end
and case c.AGENCY_PIDS when '' then CONCAT(c.AGENCY_ID) like CONCAT(#{pids}, '%')
else CONCAT(c.AGENCY_PIDS, ':', c.AGENCY_ID) like CONCAT(#{pids}, '%') end
</if>
<if test="buildingId != null and buildingId.trim() != ''">
AND a.BUILDING_ID = #{buildingId}
</if>
<if test='level == "grid"'>
AND c.GRID_ID = #{id}
</if>
<if test='level == "neighborHood"'>
AND c.id = #{id}
</if>
<if test='level == "build"'>
AND b.id = #{id}
</if>
<if test="rentFlag != null and rentFlag.trim() != ''">
AND a.RENT_FLAG = #{rentFlag}
</if>
<if test="ownerName != null and ownerName.trim() != ''">
AND a.OWNER_NAME like concat('%',#{ownerName},'%')
</if>
@ -197,6 +207,9 @@
<if test="buildingName != null and buildingName.trim() != ''">
AND b.BUILDING_NAME like CONCAT('%',#{buildingName},'%')
</if>
<if test="rentFlag != null and rentFlag.trim() != ''">
AND a.rent_flag = #{rentFlag}
</if>
</where>
/*排序规则:如果是社区查询则根据小区、楼栋、单元、房屋名字分别升序排序*/
<choose>
@ -220,7 +233,7 @@
a.DOOR_NAME as doorName,
a.HOUSE_TYPE as houseType,
a.PURPOSE as purpose,
if(a.RENT_FLAG=1,'是','否') as rentFlag,
if(a.RENT_FLAG=0,'自住',if(a.RENT_FLAG=1,'出租','闲置')) as rentFlag,
a.OWNER_NAME as ownerName,
a.OWNER_PHONE as ownerPhone,
a.OWNER_ID_CARD as ownerIdCard,

5
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java

@ -92,5 +92,8 @@ public class StaffBasicInfoResultDTO implements Serializable {
*/
private String latitude;
private String areaCode;
/**
* 地区编码全路径例如37,3702,370203,370203005,370203005015
*/
private List<String> areaCodePath;
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -745,7 +745,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
resultDTO.setLongitude(staffInfo.getLongitude());
resultDTO.setLatitude(staffInfo.getLatitude());
AgencyInfoCache agency=CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId());
resultDTO.setAreaCode(null != agency && StringUtils.isNotBlank(agency.getAreaCode()) ? agency.getAreaCode() : StrConstant.EPMETY_STR);
resultDTO.setAreaCodePath(null != agency && !CollectionUtils.isEmpty(agency.getAreaCodePath()) ? agency.getAreaCodePath() : new ArrayList<>());
}
//获取工作人员所属客户名
CustomerDTO dto = new CustomerDTO();

Loading…
Cancel
Save