|
|
@ -29,12 +29,10 @@ import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.PidUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.constant.OrgInfoConstant; |
|
|
|
import com.epmet.dao.IcPlaceOrgDao; |
|
|
|
import com.epmet.dto.IcPlaceOrgStatistics; |
|
|
|
import com.epmet.dto.SysDictDataDTO; |
|
|
|
import com.epmet.dto.form.AddPlaceOrgFormDTO; |
|
|
|
import com.epmet.dto.form.EditPlaceOrgFormDTO; |
|
|
@ -186,12 +184,11 @@ public class IcPlaceOrgServiceImpl extends BaseServiceImpl<IcPlaceOrgDao, IcPlac |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<PlaceOrgByTypeResultDTO> getPlaceOrgByType(String orgId, String orgType, String dictType) { |
|
|
|
String orgPath = getOrgPath(orgId, orgType); |
|
|
|
//获取字典
|
|
|
|
List<SysDictDataDTO> dtos = epmetAdminOpenFeignClient.dictDataList(dictType).getData(); |
|
|
|
//转换查询参数
|
|
|
|
Map<String, String> dtoMaps = dtos.stream().collect(Collectors.toMap(SysDictDataDTO::getDictValue, SysDictDataDTO::getDictLabel)); |
|
|
|
List<PlaceOrgByTypeResultDTO> resDto = baseDao.getPlaceOrgByType(orgPath); |
|
|
|
List<PlaceOrgByTypeResultDTO> resDto = baseDao.getPlaceOrgByType(orgId, orgType); |
|
|
|
for (PlaceOrgByTypeResultDTO dto : resDto) { |
|
|
|
dto.setDictLabel(dtoMaps.get(dto.getDictValue())); |
|
|
|
} |
|
|
@ -213,17 +210,9 @@ public class IcPlaceOrgServiceImpl extends BaseServiceImpl<IcPlaceOrgDao, IcPlac |
|
|
|
return resDto; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @deprecationg 获取orgPath |
|
|
|
*/ |
|
|
|
private String getOrgPath(String orgId, String orgType) { |
|
|
|
if (OrgInfoConstant.AGENCY.equals(orgType)) { // 行政组织
|
|
|
|
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId); |
|
|
|
return PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids()); |
|
|
|
} else {// 网格
|
|
|
|
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(orgId); |
|
|
|
return PidUtils.convertPid2OrgIdPath(gridInfo.getId(), gridInfo.getPids()); |
|
|
|
} |
|
|
|
@Override |
|
|
|
public IcPlaceOrgStatistics countPlaceOrgByDangerType(String orgId, String orgType) { |
|
|
|
return baseDao.countPlaceOrgByDangerType(orgId, orgType); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|