|
|
@ -2,6 +2,7 @@ package com.epmet.model; |
|
|
|
|
|
|
|
import com.alibaba.excel.context.AnalysisContext; |
|
|
|
import com.alibaba.excel.event.AnalysisEventListener; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
|
@ -23,6 +24,7 @@ import com.epmet.entity.IcPropertyManagementEntity; |
|
|
|
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; |
|
|
|
import com.epmet.redis.IcHouseRedis; |
|
|
|
import com.epmet.service.IcNeighborHoodService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
@ -38,6 +40,7 @@ import java.util.stream.Collectors; |
|
|
|
* @DateTime 2022/2/15 2:16 下午 |
|
|
|
* @DESC |
|
|
|
*/ |
|
|
|
@Slf4j |
|
|
|
public class ImportNeighborHoodInfoListener extends AnalysisEventListener<NeighborHoodInfoModel> { |
|
|
|
|
|
|
|
List<Integer> nums = new ArrayList<>(); |
|
|
@ -83,6 +86,7 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb |
|
|
|
} |
|
|
|
info = data; |
|
|
|
num = num + NumConstant.ONE; |
|
|
|
log.info("读数据"+num); |
|
|
|
if (StringUtils.isBlank(data.getNeighborHoodName()) || |
|
|
|
StringUtils.isBlank(data.getGridName()) || StringUtils.isBlank(data.getAgencyName()) || StringUtils.isBlank(data.getAddress())){ |
|
|
|
nums.add(num); |
|
|
@ -121,6 +125,7 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb |
|
|
|
if (num%NumConstant.ONE_HUNDRED == NumConstant.ZERO){ |
|
|
|
finalDispose(); |
|
|
|
} |
|
|
|
log.info("读数据"+num+"完毕"); |
|
|
|
} |
|
|
|
|
|
|
|
public void finalDispose(){ |
|
|
@ -336,6 +341,7 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb |
|
|
|
icHouseRedis.delTemporaryCacheHouses(formDTO.getCustomerId(), formDTO.getUserId()); |
|
|
|
// 放结果
|
|
|
|
icHouseRedis.setImportResultDTO(formDTO.getCustomerId(), formDTO.getUserId(), new ImportResultDTO(nums,num)); |
|
|
|
log.info("数据处理完毕,开始更新任务状态"); |
|
|
|
ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO(); |
|
|
|
input.setOperatorId(formDTO.getUserId()); |
|
|
|
input.setTaskId(taskId); |
|
|
@ -354,6 +360,8 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb |
|
|
|
} |
|
|
|
} |
|
|
|
epmetCommonServiceOpenFeignClient.finishImportTask(input); |
|
|
|
log.info("任务状态更新完毕"); |
|
|
|
} |
|
|
|
log.info("任务DTO"+JSON.toJSONString(input)); |
|
|
|
} |
|
|
|
} |
|
|
|