Browse Source

添加状态

dev
zxc 4 years ago
parent
commit
944702a47b
  1. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
  2. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  3. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java

@ -420,24 +420,18 @@ public class BuildingServiceImpl implements BuildingService {
.registerReadListener(new ImportBuildingInfoListener(formDTO,icHouseRedis,icBuildingDao,neighborHoodService,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();
}
}
ImportResultDTO dto = icHouseRedis.getImportResultDTO(formDTO.getCustomerId(), formDTO.getUserId());
if (null == dto){
return new Result<>();
}
List<Integer> nums = dto.getNums();
Integer num = dto.getNum();
String s = "共%s条数据,导入成功%s条。";
if (nums.size() > NumConstant.ZERO){
Collections.sort(nums);
s = s + "第"+nums.stream().map(String::valueOf).collect(Collectors.joining("、"))+"条导入失败";
return new Result<>().error(9999,String.format(s,num,num - nums.size()));
}
return new Result<>().error(9999,String.format(s,num,num));
return new Result<>();
}
private List<IcBuildingExcel> searchAllBuilding(ListIcNeighborHoodFormDTO formDTO) {

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

@ -18,6 +18,7 @@ import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dao.IcBuildingUnitDao;
import com.epmet.dao.IcHouseDao;
@ -28,6 +29,7 @@ import com.epmet.dto.IcBuildingUnitDTO;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.form.IcHouseFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
@ -367,6 +369,12 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
.registerReadListener(new ImportHouseInfoListener(formDTO,icBuildingDao,icHouseRedis,neighborHoodService,icHouseService,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();

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

@ -414,6 +414,12 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
.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();

Loading…
Cancel
Save