Browse Source

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

master
wxz 2 years ago
parent
commit
0e18844166
  1. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseListResultDTO.java
  2. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseChangeEnums.java
  3. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/LingshanPartyCenterHouseLianhuDao.java
  4. 38
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  5. 23
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java
  6. 3
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  7. 8
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/LingshanPartyCenterHouseLianhuDao.xml
  8. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/ICWarnStatsEventListener.java
  9. 22
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/ResiImportDyzxhPostProcessor.java
  10. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java
  11. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcHouseListResultDTO.java

@ -89,5 +89,8 @@ public class IcHouseListResultDTO implements Serializable {
*/ */
private String houseCode; private String houseCode;
/**
* 灵山项目是否党员中心户1是0不是
*/
private String partyCenterHouseFlag;
} }

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseChangeEnums.java

@ -14,8 +14,9 @@ public enum HouseChangeEnums {
RENT_FLAG("RENT_FLAG","房屋状态"), RENT_FLAG("RENT_FLAG","房屋状态"),
OWNER_NAME("OWNER_NAME","房主姓名"), OWNER_NAME("OWNER_NAME","房主姓名"),
OWNER_PHONE("OWNER_PHONE","房主电话"), OWNER_PHONE("OWNER_PHONE","房主电话"),
OWNER_ID_CARD("OWNER_ID_CARD","房主身份证"); OWNER_ID_CARD("OWNER_ID_CARD","房主身份证"),
// 灵山项目:是否党员中心户:1是;0不是
PARTY_CENTER_HOUSE_FLAG("PARTY_CENTER_HOUSE_FLAG", "党员中心户");
private String column; private String column;
private String columnName; private String columnName;

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/LingshanPartyCenterHouseLianhuDao.java

@ -14,4 +14,6 @@ import org.apache.ibatis.annotations.Mapper;
public interface LingshanPartyCenterHouseLianhuDao extends BaseDao<LingshanPartyCenterHouseLianhuEntity> { public interface LingshanPartyCenterHouseLianhuDao extends BaseDao<LingshanPartyCenterHouseLianhuEntity> {
int deleteByPartyCenterHouseId(String partyCenterHouseId); int deleteByPartyCenterHouseId(String partyCenterHouseId);
LingshanPartyCenterHouseLianhuEntity selectByHouseId(String houseId);
} }

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

@ -356,6 +356,44 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
e.setChangeBefore(StringUtils.isNotBlank(entity.getOwnerIdCard()) ? entity.getOwnerIdCard() : "无"); e.setChangeBefore(StringUtils.isNotBlank(entity.getOwnerIdCard()) ? entity.getOwnerIdCard() : "无");
entityList.add(e); entityList.add(e);
} }
if (StringUtils.isNotBlank(entity.getPartyCenterHouseFlag())) {
if(!entity.getPartyCenterHouseFlag().equals(houseDTO.getPartyCenterHouseFlag())){
String originName=NumConstant.ZERO_STR.equals(entity.getPartyCenterHouseFlag())?"否":"是";
String nowName="";
if(NumConstant.ZERO_STR.equals(houseDTO.getPartyCenterHouseFlag())){
nowName="否";
}else if(NumConstant.ONE_STR.equals(houseDTO.getPartyCenterHouseFlag())){
nowName="是";
}else{
nowName="-";
}
sbAfter.append(HouseChangeEnums.PARTY_CENTER_HOUSE_FLAG.getColumnName()).append(":").append(nowName).append(";");
sbBefore.append(HouseChangeEnums.PARTY_CENTER_HOUSE_FLAG.getColumnName()).append(":").append(originName).append(";");
IcHouseChangeDetailEntity e = new IcHouseChangeDetailEntity();
e.setChangeCol(HouseChangeEnums.PARTY_CENTER_HOUSE_FLAG.getColumn());
e.setChangeAfter(nowName);
e.setChangeBefore(originName);
entityList.add(e);
}
} else {
// 原来不确定是否是党员中心户
String nowName="";
if(NumConstant.ZERO_STR.equals(houseDTO.getPartyCenterHouseFlag())){
nowName="否";
}else if(NumConstant.ONE_STR.equals(houseDTO.getPartyCenterHouseFlag())){
nowName="是";
}else{
nowName="-";
}
sbAfter.append(HouseChangeEnums.PARTY_CENTER_HOUSE_FLAG.getColumnName()).append(":").append(nowName).append(";");
sbBefore.append(HouseChangeEnums.PARTY_CENTER_HOUSE_FLAG.getColumnName()).append(":").append("-").append(";");
IcHouseChangeDetailEntity e = new IcHouseChangeDetailEntity();
e.setChangeCol(HouseChangeEnums.PARTY_CENTER_HOUSE_FLAG.getColumn());
e.setChangeAfter(nowName);
e.setChangeBefore("-");
entityList.add(e);
}
if (StringUtils.isNotBlank(sbAfter)) { if (StringUtils.isNotBlank(sbAfter)) {
String before = sbBefore.substring(NumConstant.ZERO, sbBefore.length() - NumConstant.ONE); String before = sbBefore.substring(NumConstant.ZERO, sbBefore.length() - NumConstant.ONE);
String after = sbAfter.substring(NumConstant.ZERO, sbAfter.length() - NumConstant.ONE); String after = sbAfter.substring(NumConstant.ZERO, sbAfter.length() - NumConstant.ONE);

23
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java

@ -39,6 +39,7 @@ import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.redis.IcHouseRedis; import com.epmet.redis.IcHouseRedis;
import com.epmet.service.CustomerGridService; import com.epmet.service.CustomerGridService;
import com.epmet.service.HouseService;
import com.epmet.service.IcHouseService; import com.epmet.service.IcHouseService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
@ -445,6 +446,7 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
* @param partyCenterHouseId * @param partyCenterHouseId
* @param lianHuHouseList * @param lianHuHouseList
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public void bingLianHu(String partyCenterHouseId, List<PartyCenterHouseBindLianHuDetailDTO> lianHuHouseList) { public void bingLianHu(String partyCenterHouseId, List<PartyCenterHouseBindLianHuDetailDTO> lianHuHouseList) {
IcHouseEntity partyCenterHouse=baseDao.selectById(partyCenterHouseId); IcHouseEntity partyCenterHouse=baseDao.selectById(partyCenterHouseId);
@ -470,9 +472,11 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
} }
if(CollectionUtils.isNotEmpty(list)){ if(CollectionUtils.isNotEmpty(list)){
for(IcHouseEntity houseEntity:list){ for(IcHouseEntity houseEntity:list){
LingshanPartyCenterHouseLianhuEntity entity=new LingshanPartyCenterHouseLianhuEntity(); LingshanPartyCenterHouseLianhuEntity existedEntiy=partyCenterHouseLianhuDao.selectByHouseId(houseEntity.getId());
if (null == existedEntiy) {
LingshanPartyCenterHouseLianhuEntity entity = new LingshanPartyCenterHouseLianhuEntity();
entity.setPartyCenterHouseId(partyCenterHouseId); entity.setPartyCenterHouseId(partyCenterHouseId);
//目前只能绑定同一个网格下的房屋 // 目前只能绑定同一个网格下的房屋
entity.setCustomerId(neighborHoodEntity.getCustomerId()); entity.setCustomerId(neighborHoodEntity.getCustomerId());
entity.setAgencyId(neighborHoodEntity.getAgencyId()); entity.setAgencyId(neighborHoodEntity.getAgencyId());
entity.setGridId(neighborHoodEntity.getGridId()); entity.setGridId(neighborHoodEntity.getGridId());
@ -485,6 +489,7 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
partyCenterHouseLianhuDao.insert(entity); partyCenterHouseLianhuDao.insert(entity);
} }
} }
}
}); });
} }
@ -541,13 +546,21 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
*/ */
@Override @Override
public void updatePartyCenterHouse(String houseId, String partyCenterHouseFlag) { public void updatePartyCenterHouse(String houseId, String partyCenterHouseFlag) {
LambdaUpdateWrapper<IcHouseEntity> update = new LambdaUpdateWrapper<>();
update.set(IcHouseEntity::getPartyCenterHouseFlag, partyCenterHouseFlag).eq(IcHouseEntity::getId, houseId);
baseDao.update(null, update);
if(NumConstant.ZERO_STR.equals(partyCenterHouseFlag)){ if(NumConstant.ZERO_STR.equals(partyCenterHouseFlag)){
//房屋如果不是党员中心户,自动删除绑定的联户 //房屋如果不是党员中心户,自动删除绑定的联户
partyCenterHouseLianhuDao.deleteByPartyCenterHouseId(houseId); partyCenterHouseLianhuDao.deleteByPartyCenterHouseId(houseId);
} }
//加一条变更记录吧。。 就当留痕了
IcHouseEntity origin = baseDao.selectById(houseId);
IcHouseDTO icHouseDTO = ConvertUtils.sourceToTarget(origin, IcHouseDTO.class);
icHouseDTO.setPartyCenterHouseFlag(partyCenterHouseFlag);
SpringContextUtils.getBean(HouseService.class).houseChangeRecord(houseId, icHouseDTO.getCustomerId(), icHouseDTO);
//修改
LambdaUpdateWrapper<IcHouseEntity> update = new LambdaUpdateWrapper<>();
update.set(IcHouseEntity::getPartyCenterHouseFlag, partyCenterHouseFlag)
.set(IcHouseEntity::getUpdatedTime,new Date())
.eq(IcHouseEntity::getId, houseId);
baseDao.update(null, update);
} }

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

@ -118,7 +118,8 @@
gr.GRID_NAME, gr.GRID_NAME,
IFNULL(a.sort,0) as sort, IFNULL(a.sort,0) as sort,
IFNULL(a.REMARK,'') AS remark, IFNULL(a.REMARK,'') AS remark,
a.CUSTOMER_ID a.CUSTOMER_ID,
a.PARTY_CENTER_HOUSE_FLAG as partyCenterHouseFlag
from ic_house a from ic_house a
LEFT JOIN ic_building b on a.BUILDING_ID = b.ID and b.DEL_FLAG = '0' LEFT JOIN ic_building b on a.BUILDING_ID = b.ID and b.DEL_FLAG = '0'
LEFT JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0' LEFT JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0'

8
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/LingshanPartyCenterHouseLianhuDao.xml

@ -26,4 +26,12 @@
<delete id="deleteByPartyCenterHouseId" parameterType="java.lang.String"> <delete id="deleteByPartyCenterHouseId" parameterType="java.lang.String">
delete from lingshan_party_center_house_lianhu where PARTY_CENTER_HOUSE_ID=#{partyCenterHouseId} delete from lingshan_party_center_house_lianhu where PARTY_CENTER_HOUSE_ID=#{partyCenterHouseId}
</delete> </delete>
<select id="selectByHouseId" parameterType="java.lang.String" resultType="com.epmet.entity.LingshanPartyCenterHouseLianhuEntity">
select
*
from lingshan_party_center_house_lianhu
where DEL_FLAG='0'
and HOUSE_ID = #{houseId}
</select>
</mapper> </mapper>

5
epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/ICWarnStatsEventListener.java

@ -15,6 +15,7 @@ import com.epmet.constant.SystemMessageType;
import com.epmet.service.IcNatService; import com.epmet.service.IcNatService;
import com.epmet.service.IcResiUserService; import com.epmet.service.IcResiUserService;
import com.epmet.service.StatsResiWarnService; import com.epmet.service.StatsResiWarnService;
import com.epmet.service.impl.IcResiUserServiceImpl;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
@ -77,6 +78,10 @@ public class ICWarnStatsEventListener implements MessageListenerConcurrently {
if (!updateIcNatResiFlag(tags, obj)){ if (!updateIcNatResiFlag(tags, obj)){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"消费失败,等待重新消费"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"消费失败,等待重新消费");
} }
//灵山需求:如果放屋里的人,有党员中心户, 将ic_house.party_center_house_flag置为1,说明该房屋是党员中心户
SpringContextUtils.getBean(IcResiUserServiceImpl.class).syncHousePartyCenterHouse(null,obj.getIcResiUser());
} catch (RenException e) { } catch (RenException e) {
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
logger.error("【开放数据事件监听器】-居民信息变动MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e))); logger.error("【开放数据事件监听器】-居民信息变动MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e)));

22
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/ResiImportDyzxhPostProcessor.java

@ -1,13 +1,35 @@
package com.epmet.processor; package com.epmet.processor;
import com.epmet.commons.rocketmq.messages.IcResiUserAddMQMsg;
import com.epmet.constant.SystemMessageType;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Map; import java.util.Map;
@Slf4j
@Component @Component
public class ResiImportDyzxhPostProcessor extends ResiImportPostProcessor{ public class ResiImportDyzxhPostProcessor extends ResiImportPostProcessor{
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Override @Override
public void consume(Map<String, String> resiInfoMap) { public void consume(Map<String, String> resiInfoMap) {
System.out.println(resiInfoMap); System.out.println(resiInfoMap);
String customerId=resiInfoMap.get("CUSTOMER_ID");
// String userId=resiInfoMap.get("ID");
String userId=resiInfoMap.get("IC_RESI_USER");
//推送MQ事件
IcResiUserAddMQMsg mqMsg = new IcResiUserAddMQMsg();
mqMsg.setCustomerId(customerId);
mqMsg.setIcResiUser(userId);
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.IC_RESI_USER_ADD);
form.setContent(mqMsg);
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
} }
} }

11
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java

@ -13,7 +13,6 @@ import com.epmet.bean.ResiImportChangedData;
import com.epmet.bean.ResiImportResiCategoryChangedCache; import com.epmet.bean.ResiImportResiCategoryChangedCache;
import com.epmet.commons.rocketmq.messages.PartymemberSyncMQMsg; import com.epmet.commons.rocketmq.messages.PartymemberSyncMQMsg;
import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
@ -41,7 +40,6 @@ import com.epmet.dto.form.HouseFormDTO;
import com.epmet.dto.form.IcResiUserOrgMsgFormDTO; import com.epmet.dto.form.IcResiUserOrgMsgFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.dto.result.lingshan.ConfigPartyCenterHouseFormDTO;
import com.epmet.entity.*; import com.epmet.entity.*;
import com.epmet.enums.IcResiUserTableEnum; import com.epmet.enums.IcResiUserTableEnum;
import com.epmet.excel.handler.IcResiImportDynamicExcelListener; import com.epmet.excel.handler.IcResiImportDynamicExcelListener;
@ -63,7 +61,6 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType; import org.apache.http.entity.ContentType;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.commons.CommonsMultipartFile; import org.springframework.web.multipart.commons.CommonsMultipartFile;
@ -589,8 +586,6 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
categoryData = null; categoryData = null;
} }
// 居民信息导入后置处理器回调
resiImportPostProcessors.forEach(p -> p.consume(columnAndValues));
} catch (Exception e) { } catch (Exception e) {
String errorMsg; String errorMsg;
@ -770,6 +765,12 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
// 将成功的居民的身份证号添加到列表中 // 将成功的居民的身份证号添加到列表中
successIdCards.add(row.get(ID_CARD_COLUMN_NO)); successIdCards.add(row.get(ID_CARD_COLUMN_NO));
// 居民信息-党员信息导入后置处理器回调
LinkedHashMap<String, String> finalColumnAndValues = columnAndValues;
resiImportPostProcessors.forEach(p -> {
p.consume(finalColumnAndValues);
});
} catch (Exception e) { } catch (Exception e) {
String errorMsg; String errorMsg;
if (e instanceof RenException || e instanceof EpmetException) { if (e instanceof RenException || e instanceof EpmetException) {

6
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -219,8 +219,6 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
SpringContextUtils.getBean(DataSyncRecordDisabilityService.class).deleteByIcResiUserId(formDTO.getIcResiUserId()); SpringContextUtils.getBean(DataSyncRecordDisabilityService.class).deleteByIcResiUserId(formDTO.getIcResiUserId());
SpringContextUtils.getBean(DataSyncRecordDeathService.class).deleteByIcResiUserId(formDTO.getIcResiUserId()); SpringContextUtils.getBean(DataSyncRecordDeathService.class).deleteByIcResiUserId(formDTO.getIcResiUserId());
} }
//灵山需求:如果放屋里的人,有党员中心户, 将ic_house.party_center_house_flag置为1,说明该房屋是党员中心户
syncHousePartyCenterHouse(origin.getHomeId(),null);
} }
/** /**
@ -452,8 +450,6 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
} }
//3.变更记录表和变更记录明细表新增数据 //3.变更记录表和变更记录明细表新增数据
saveUserChangeRecord(tokenDto, map, resiUserId, name); saveUserChangeRecord(tokenDto, map, resiUserId, name);
//灵山需求:如果放屋里的人,有党员中心户, 将ic_house.party_center_house_flag置为1,说明该房屋是党员中心户
syncHousePartyCenterHouse(null,resiUserId);
return resiUserId; return resiUserId;
} }
@ -792,8 +788,6 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
} }
} }
CustomerResiUserRedis.delIcResiUserInfo(resiUserId); CustomerResiUserRedis.delIcResiUserInfo(resiUserId);
//灵山需求:如果放屋里的人,有党员中心户, 将ic_house.party_center_house_flag置为1,说明该房屋是党员中心户
syncHousePartyCenterHouse(entity.getHomeId(),null);
return resiUserId; return resiUserId;
} }

Loading…
Cancel
Save