|
|
|
@ -23,20 +23,27 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
|
import com.epmet.commons.tools.dto.result.OptionResultDTO; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
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.scan.param.ImgScanParamDTO; |
|
|
|
import com.epmet.commons.tools.scan.param.ImgTaskDTO; |
|
|
|
import com.epmet.commons.tools.scan.result.SyncScanResult; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.PidUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.utils.ScanContentUtils; |
|
|
|
import com.epmet.constant.OrgInfoConstant; |
|
|
|
import com.epmet.dao.IcPlacePatrolRecordDao; |
|
|
|
import com.epmet.dao.IcPlacePatrolTeamStaffDao; |
|
|
|
import com.epmet.dto.IcPlacePatrolTeamStaffDTO; |
|
|
|
import com.epmet.dto.SysDictDataDTO; |
|
|
|
import com.epmet.dto.form.AddPlacePatrolRecordFormDTO; |
|
|
|
import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO; |
|
|
|
import com.epmet.dto.result.GetListPlacePatrolRecordResultDTO; |
|
|
|
import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO; |
|
|
|
import com.epmet.dto.result.lingshan.PlaceOrgByTypeResultDTO; |
|
|
|
import com.epmet.entity.IcPlaceAttachmentEntity; |
|
|
|
import com.epmet.entity.IcPlacePatrolRecordEntity; |
|
|
|
import com.epmet.feign.EpmetAdminOpenFeignClient; |
|
|
|
@ -54,6 +61,7 @@ import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.UUID; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@ -264,4 +272,45 @@ public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl<IcPlacePatro |
|
|
|
resultDTO.setList(result.getList()); |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<PlaceOrgByTypeResultDTO> getPlacePatrolRecordByType(String orgId, String orgType, String dictType) { |
|
|
|
//获取字典
|
|
|
|
List<SysDictDataDTO> dtos = epmetAdminOpenFeignClient.dictDataList(dictType).getData(); |
|
|
|
//转换查询参数
|
|
|
|
Map<String, String> dtoMaps = dtos.stream().collect(Collectors.toMap(SysDictDataDTO::getDictValue, SysDictDataDTO::getDictLabel)); |
|
|
|
List<PlaceOrgByTypeResultDTO> resDto = baseDao.getPlacePatrolRecordByType(getOrgPath(orgId, orgType)); |
|
|
|
for (PlaceOrgByTypeResultDTO dto : resDto) { |
|
|
|
dto.setDictLabel(dtoMaps.get(dto.getDictValue())); |
|
|
|
} |
|
|
|
for (String key : dtoMaps.keySet()) { |
|
|
|
for (PlaceOrgByTypeResultDTO dto : resDto) { |
|
|
|
if (dto.getDictValue().equals(key)) { |
|
|
|
dto.setDictLabel(dtoMaps.get(key)); |
|
|
|
break; |
|
|
|
} else { |
|
|
|
PlaceOrgByTypeResultDTO pd = new PlaceOrgByTypeResultDTO(); |
|
|
|
pd.setDictValue(key); |
|
|
|
pd.setDictLabel(dtoMaps.get(key)); |
|
|
|
pd.setTotal(0); |
|
|
|
resDto.add(pd); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
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()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|