Browse Source

位置调整

master
zxc 4 years ago
parent
commit
57a0c30b9a
  1. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java
  2. 32
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java

@ -129,7 +129,7 @@ public interface IcNeighborHoodService extends BaseService<IcNeighborHoodEntity>
* @author zxc * @author zxc
* @date 2022/2/12 11:11 上午 * @date 2022/2/12 11:11 上午
*/ */
void neighborhoodImport(ImportInfoFormDTO formDTO, MultipartFile file,Result<ImportTaskCommonResultDTO> importTask) throws IOException; Result neighborhoodImport(ImportInfoFormDTO formDTO, MultipartFile file,Result<ImportTaskCommonResultDTO> importTask) throws IOException;
/** /**
* 获取导入小区楼栋单元ID * 获取导入小区楼栋单元ID

32
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java

@ -234,8 +234,36 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
*/ */
@Override @Override
@Async @Async
public void neighborhoodImport(ImportInfoFormDTO formDTO, MultipartFile file,Result<ImportTaskCommonResultDTO> importTask) throws IOException { public Result neighborhoodImport(ImportInfoFormDTO formDTO, MultipartFile file,Result<ImportTaskCommonResultDTO> importTask) throws IOException {
importNeighbor(formDTO,file,importTask); // importNeighbor(formDTO,file,importTask);
ExcelReader excelReader = null;
try {
InputStream inputStream = null;
try {
inputStream = file.getInputStream();
} catch (IOException e) {
return new Result<String>().error("读取文件失败");
}
excelReader = EasyExcel.read(inputStream).build();
// 这里为了简单 所以注册了 同样的head 和Listener 自己使用功能必须不同的Listener
ReadSheet readSheet = EasyExcel.readSheet(0).head(NeighborHoodInfoModel.class)
.registerReadListener(new ImportNeighborHoodInfoListener(formDTO,icHouseRedis,icBuildingDao,this,propertyManagementDao,epmetCommonServiceOpenFeignClient,importTask.getData().getTaskId()))
.build();
excelReader.read(readSheet);
} catch (Exception e){
ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO();
input.setOperatorId(formDTO.getUserId());
input.setTaskId(importTask.getData().getTaskId());
input.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
epmetCommonServiceOpenFeignClient.finishImportTask(input);
} finally {
if (excelReader != null) {
excelReader.finish();
}
}
return new Result<>();
} }
/** /**

Loading…
Cancel
Save