|
|
@ -24,6 +24,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.elink.esua.epdc.commons.mybatis.service.impl.CrudServiceImpl; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.StrConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.exception.RenException; |
|
|
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
@ -34,6 +35,7 @@ import com.elink.esua.epdc.commons.tools.utils.IdentityNoUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.config.QrCodeProperties; |
|
|
|
import com.elink.esua.epdc.dto.CompleteDeptDTO; |
|
|
|
import com.elink.esua.epdc.dto.DeptInfoDTO; |
|
|
|
import com.elink.esua.epdc.dto.UploadToOssDTO; |
|
|
|
import com.elink.esua.epdc.dto.epidemic.DictOptionDTO; |
|
|
|
import com.elink.esua.epdc.dto.house.result.EpdcPopulationErrorResultDTO; |
|
|
@ -493,7 +495,30 @@ public class EpidemicBuildingUnitServiceImpl extends CrudServiceImpl<EpidemicBui |
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=" + downloadFilename); |
|
|
|
ZipOutputStream zip = new ZipOutputStream(response.getOutputStream()); |
|
|
|
|
|
|
|
// 更改为可以下载全部组织的数据,原来的gridId需要查询实际是网格还是社区街道
|
|
|
|
Result<DeptInfoDTO> result = adminVimFeignClient.getDeptInfo(Long.parseLong(formDTO.getGridId())); |
|
|
|
if (result.success()) { |
|
|
|
if (null != result.getData()) { |
|
|
|
if (OrganizationTypeConstant.ORG_TYPE_GRID_PARTY.equals(result.getData().getTypeKey())) { |
|
|
|
formDTO.setGridId(result.getData().getId().toString()); |
|
|
|
} else if (OrganizationTypeConstant.ORG_TYPE_COMMUNITY_PARTY.equals(result.getData().getTypeKey())) { |
|
|
|
formDTO.setCommunityId(result.getData().getId().toString()); |
|
|
|
formDTO.setGridId(null); |
|
|
|
} else if (OrganizationTypeConstant.ORG_TYPE_STREET_PARTY.equals(result.getData().getTypeKey())) { |
|
|
|
formDTO.setStreetId(result.getData().getId().toString()); |
|
|
|
formDTO.setGridId(null); |
|
|
|
} else { |
|
|
|
throw new RenException("查询部门失败"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
throw new RenException("查询部门失败"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
throw new RenException("查询部门失败"); |
|
|
|
} |
|
|
|
|
|
|
|
List<EpidemicBuildingUnitDTO> houseList = baseDao.listUnitHasCode(formDTO); |
|
|
|
|
|
|
|
String urlPre = qrCodeProperties.getPre(); |
|
|
|
|
|
|
|
for (EpidemicBuildingUnitDTO house : houseList) { |
|
|
@ -513,6 +538,7 @@ public class EpidemicBuildingUnitServiceImpl extends CrudServiceImpl<EpidemicBui |
|
|
|
inputStream.close(); |
|
|
|
zip.closeEntry(); |
|
|
|
} catch (IOException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
throw new RenException("组装zip失败"); |
|
|
|
} |
|
|
|
} |
|
|
@ -575,7 +601,7 @@ public class EpidemicBuildingUnitServiceImpl extends CrudServiceImpl<EpidemicBui |
|
|
|
* 获取文件名 |
|
|
|
*/ |
|
|
|
public static String getFileName(EpidemicBuildingUnitDTO house) { |
|
|
|
return house.getPlotName() + File.separator + house.getBuildingName() + File.separator + house.getUnit() + File.separator + house.getRoomNo() + ".png"; |
|
|
|
return house.getGridName() + File.separator + house.getPlotName() + File.separator + house.getBuildingName() + File.separator + house.getUnit() + File.separator + house.getRoomNo() + ".png"; |
|
|
|
} |
|
|
|
|
|
|
|
private void saveOrUpdateOwners(List<EpidemicUnitOwnerDTO> owners, Long unitId) { |
|
|
|