|
|
@ -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; |
|
|
@ -26,9 +27,9 @@ import com.epmet.dto.form.ImportTaskCommonFormDTO; |
|
|
|
import com.epmet.dto.result.IcCoverageCategoryDictListResultDTO; |
|
|
|
import com.epmet.dto.result.IcPublicServiceListResultDTO; |
|
|
|
import com.epmet.dto.result.UploadImgResultDTO; |
|
|
|
import com.epmet.dto.result.lingshan.StatsByCategoryRstDTO; |
|
|
|
import com.epmet.dto.result.lingshan.LingShanScreenPublicServicePlaceListByCateRstDTO; |
|
|
|
import com.epmet.dto.result.lingshan.LingShanScreenStatsByCategoryRstDTO; |
|
|
|
import com.epmet.entity.IcPublicServiceEntity; |
|
|
|
import com.epmet.entity.IcSuperiorResourceEntity; |
|
|
|
import com.epmet.excel.IcPublicServiceExcel; |
|
|
|
import com.epmet.excel.handler.IcPublicServiceExcelImportListener; |
|
|
|
import com.epmet.feign.EpmetAdminOpenFeignClient; |
|
|
@ -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 |
|
|
@ -100,6 +105,18 @@ public class IcPublicServiceServiceImpl extends BaseServiceImpl<IcPublicServiceD |
|
|
|
//列表/导出查询
|
|
|
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); |
|
|
|
List<IcPublicServiceListResultDTO> list = baseDao.selectPublicServiceList(formDTO); |
|
|
|
|
|
|
|
// 网格员信息填充
|
|
|
|
list.stream().forEach(e -> { |
|
|
|
if (org.apache.commons.lang.StringUtils.isNotBlank(e.getGriderId())) { |
|
|
|
CustomerStaffInfoCacheResult griderInfo = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), e.getGriderId()); |
|
|
|
if (griderInfo != null) { |
|
|
|
e.setGriderName(griderInfo.getRealName()); |
|
|
|
e.setGriderPhone(griderInfo.getMobile()); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
PageInfo<IcPublicServiceListResultDTO> pageInfo = new PageInfo<>(list); |
|
|
|
|
|
|
|
//封装类别数据
|
|
|
@ -312,7 +329,7 @@ public class IcPublicServiceServiceImpl extends BaseServiceImpl<IcPublicServiceD |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<StatsByCategoryRstDTO> lingshanScreenStatsByCategory(String orgType, String orgId) { |
|
|
|
public List<LingShanScreenStatsByCategoryRstDTO> lingshanScreenStatsByCategory(String orgType, String orgId) { |
|
|
|
// 先拿pids
|
|
|
|
String orgIdPath; |
|
|
|
if (StringUtils.isAnyBlank(orgType, orgId)) { |
|
|
@ -329,4 +346,49 @@ public class IcPublicServiceServiceImpl extends BaseServiceImpl<IcPublicServiceD |
|
|
|
// 查询
|
|
|
|
return baseDao.lingshanScreenStatsByCategory(orgIdPath, EpmetRequestHolder.getLoginUserCustomerId()); |
|
|
|
} |
|
|
|
|
|
|
|
@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 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()); |
|
|
|
} |
|
|
|
} |