简化java代码: List<RegionManageVo> addressList = new ArrayList<>() ; if( dataType!= MyEnums.REGION_MANAGE_VO___DATA_TYPE_ENUM.镇乡档案.toCode() ){ addressList = regionManageService.gainTownCountryAddress(query.getWorkflowOrderId()) ; }else if( dataType!= MyEnums.REGION_MANAGE_VO___DATA_TYPE_ENUM.村庄档案.toCode() ){ addressList = regionManageService.gainVillageAddress(query.getWorkflowOrderId()) ; } if( addressList != null && addressList.size() > 0 ){ if( addressList.size() == 1 ){ RegionManageVo vo = addressList.get(0) ; if( vo!=null ){ String address = vo.getDetailAddress() ; List<RegionManageVo> ifHasAgreedList = new ArrayList<>() ; if( dataType!= MyEnums.REGION_MANAGE_VO___DATA_TYPE_ENUM.镇乡档案.toCode() ){ ifHasAgreedList = regionManageService.gainTownCountryListAgreed( address , MyEnums.REGION_MANAGE_VO_VERIFY_STATUS_ENUM.通过.toCode(), dataType ) ; }else if( dataType!= MyEnums.REGION_MANAGE_VO___DATA_TYPE_ENUM.村庄档案.toCode() ){ ifHasAgreedList = regionManageService.gainVillageListAgreed( address , MyEnums.REGION_MANAGE_VO_VERIFY_STATUS_ENUM.通过.toCode(), dataType ) ; } if(ifHasAgreedList!=null && ifHasAgreedList.size() >0 ){ return ResultVoUtil.success(true) ; } } }else{ log.error("checkIfHasSamePassedRegion -- > should not has this data twice . 工作流订单ID:{} ",query.getWorkflowOrderId()) ; return ResultVoUtil.success(true) ; } }
时间: 2024-02-14 12:23:38 浏览: 85
List<RegionManageVo> addressList = new ArrayList<>();
if(dataType != MyEnums.REGION_MANAGE_VO___DATA_TYPE_ENUM.镇乡档案.toCode()) {
addressList = regionManageService.gainTownCountryAddress(query.getWorkflowOrderId());
} else if(dataType != MyEnums.REGION_MANAGE_VO___DATA_TYPE_ENUM.村庄档案.toCode()) {
addressList = regionManageService.gainVillageAddress(query.getWorkflowOrderId());
}
if(!addressList.isEmpty()) {
RegionManageVo vo = addressList.get(0);
if(vo != null) {
String address = vo.getDetailAddress();
List<RegionManageVo> ifHasAgreedList = new ArrayList<>();
if(dataType != MyEnums.REGION_MANAGE_VO___DATA_TYPE_ENUM.镇乡档案.toCode()) {
ifHasAgreedList = regionManageService.gainTownCountryListAgreed(address, MyEnums.REGION_MANAGE_VO_VERIFY_STATUS_ENUM.通过.toCode(), dataType);
} else if(dataType != MyEnums.REGION_MANAGE_VO___DATA_TYPE_ENUM.村庄档案.toCode()) {
ifHasAgreedList = regionManageService.gainVillageListAgreed(address, MyEnums.REGION_MANAGE_VO_VERIFY_STATUS_ENUM.通过.toCode(), dataType);
}
if(!ifHasAgreedList.isEmpty()) {
return ResultVoUtil.success(true);
}
} else {
log.error("checkIfHasSamePassedRegion -- > should not has this data twice . 工作流订单ID:{} ", query.getWorkflowOrderId());
return ResultVoUtil.success(true);
}
}
阅读全文