|
|
|
@ -18,6 +18,7 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; |
|
|
|
import com.epmet.commons.tools.utils.*; |
|
|
|
import com.epmet.constant.OrgInfoConstant; |
|
|
|
import com.epmet.constants.ImportTaskConstants; |
|
|
|
import com.epmet.dao.IcCoverageCategoryDictDao; |
|
|
|
import com.epmet.dao.IcPublicServiceDao; |
|
|
|
import com.epmet.dto.IcPublicServiceDTO; |
|
|
|
import com.epmet.dto.form.IcPublicServiceAddEditFormDTO; |
|
|
|
@ -61,6 +62,7 @@ import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.UUID; |
|
|
|
import java.util.function.Function; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
@ -87,6 +89,9 @@ public class IcPublicServiceServiceImpl extends BaseServiceImpl<IcPublicServiceD |
|
|
|
@Autowired |
|
|
|
private EpmetAdminOpenFeignClient adminOpenFeignClient; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IcCoverageCategoryDictDao coverageCategoryDictDao; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -345,9 +350,45 @@ public class IcPublicServiceServiceImpl extends BaseServiceImpl<IcPublicServiceD |
|
|
|
@Override |
|
|
|
public List<LingShanScreenPublicServicePlaceListByCateRstDTO> lingshanScreenListByCategory(String orgId, String orgType, String category) { |
|
|
|
|
|
|
|
String orgIdPath; |
|
|
|
if (StringUtils.isAnyBlank(orgType, orgId)) { |
|
|
|
orgIdPath = userRemoteService.getLoginUserDetails().getOrgIdPath(); |
|
|
|
} else { |
|
|
|
if (OrgInfoConstant.AGENCY.equals(orgType)) { |
|
|
|
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId); |
|
|
|
orgIdPath = PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids()); |
|
|
|
} else { |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 查询类别,并且转化为字典,备用
|
|
|
|
Map<String, IcCoverageCategoryDictListResultDTO> categoryAndObj = |
|
|
|
coverageCategoryDictDao.dictMap(EpmetRequestHolder.getLoginUserCustomerId(), "public_service") |
|
|
|
.stream() |
|
|
|
.collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getValue, Function.identity())); |
|
|
|
|
|
|
|
// 查询数据,并且填充内容,返回前端
|
|
|
|
LambdaQueryWrapper<IcPublicServiceEntity> q = new LambdaQueryWrapper<>(); |
|
|
|
q.eq(IcPublicServiceEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId()); |
|
|
|
q.eq(StringUtils.isNotBlank(category), IcPublicServiceEntity::getCategory, category); |
|
|
|
q.likeRight(IcPublicServiceEntity::getAgencyIdPath, orgIdPath); |
|
|
|
|
|
|
|
return baseDao.selectList(q).stream().map(e -> { |
|
|
|
String griderName = null; |
|
|
|
String griderPhone = null; |
|
|
|
|
|
|
|
if (org.apache.commons.lang.StringUtils.isNotBlank(e.getGriderId())) { |
|
|
|
CustomerStaffInfoCacheResult griderInfo = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), e.getGriderId()); |
|
|
|
if (griderInfo != null) { |
|
|
|
griderName = griderInfo.getRealName(); |
|
|
|
griderPhone = griderInfo.getMobile(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|
return new LingShanScreenPublicServicePlaceListByCateRstDTO( |
|
|
|
e.getName(), categoryAndObj.get(e.getCategory()).getLabel(), e.getLongitude(), e.getLatitude(), e.getAddress(), |
|
|
|
e.getPrincipal(), e.getMobile(), e.getPoliceName(), e.getPolicePhone(), griderName, griderPhone); |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
} |