|
|
@ -22,7 +22,6 @@ import cn.afterturn.easypoi.excel.entity.ExportParams; |
|
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
import com.alibaba.excel.ExcelReader; |
|
|
|
import com.alibaba.excel.read.metadata.ReadSheet; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
@ -42,6 +41,7 @@ import com.epmet.commons.tools.redis.common.bean.GridInfoCache; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.constant.CustomerGridConstant; |
|
|
|
import com.epmet.constant.ImportErrorMsgConstants; |
|
|
|
import com.epmet.constants.ImportTaskConstants; |
|
|
|
import com.epmet.dao.CustomerGridDao; |
|
|
|
import com.epmet.dao.IcBuildingDao; |
|
|
@ -50,6 +50,7 @@ import com.epmet.dao.IcPropertyManagementDao; |
|
|
|
import com.epmet.dto.*; |
|
|
|
import com.epmet.dto.form.ImportInfoFormDTO; |
|
|
|
import com.epmet.dto.form.ImportTaskCommonFormDTO; |
|
|
|
import com.epmet.dto.result.ImportResultDTO; |
|
|
|
import com.epmet.dto.result.ImportTaskCommonResultDTO; |
|
|
|
import com.epmet.dto.result.InfoByNamesResultDTO; |
|
|
|
import com.epmet.dto.result.UploadImgResultDTO; |
|
|
@ -61,6 +62,7 @@ import com.epmet.model.ImportNeighborHoodInfoListener; |
|
|
|
import com.epmet.model.NeighborHoodInfoModel; |
|
|
|
import com.epmet.redis.IcHouseRedis; |
|
|
|
import com.epmet.service.*; |
|
|
|
import com.epmet.util.ExcelPoiUtils; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.commons.collections4.ListUtils; |
|
|
@ -93,7 +95,6 @@ import java.util.stream.Collectors; |
|
|
|
*/ |
|
|
|
@Slf4j |
|
|
|
@Service |
|
|
|
@EnableAsync |
|
|
|
public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao, IcNeighborHoodEntity> implements IcNeighborHoodService { |
|
|
|
|
|
|
|
@Autowired |
|
|
@ -248,16 +249,13 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao |
|
|
|
ReadSheet readSheet = EasyExcel.readSheet(0).head(NeighborHoodInfoModel.class) |
|
|
|
.registerReadListener(new ImportNeighborHoodInfoListener(formDTO,icHouseRedis,icBuildingDao,this,propertyManagementDao,epmetCommonServiceOpenFeignClient,importTask.getData().getTaskId())) |
|
|
|
.build(); |
|
|
|
log.info("neighborhoodImport build readSheet num:{}",readSheet.getSheetNo()); |
|
|
|
excelReader.read(readSheet); |
|
|
|
} catch (Exception e){ |
|
|
|
log.error("neighborhoodImport import exception", e); |
|
|
|
ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO(); |
|
|
|
input.setOperatorId(formDTO.getUserId()); |
|
|
|
input.setTaskId(importTask.getData().getTaskId()); |
|
|
|
input.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL); |
|
|
|
Result result = epmetCommonServiceOpenFeignClient.finishImportTask(input); |
|
|
|
log.info("neighborhoodImport finishImportTask result:{]", JSON.toJSONString(result)); |
|
|
|
epmetCommonServiceOpenFeignClient.finishImportTask(input); |
|
|
|
} finally { |
|
|
|
if (excelReader != null) { |
|
|
|
excelReader.finish(); |
|
|
|