Browse Source

修改:【社会服务资源】大屏:新增两个接口

master
wxz 3 years ago
parent
commit
2ebbe7fa03
  1. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/LingShanScreenPublicServicePlaceListByCateRstDTO.java
  2. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPublicServiceController.java
  3. 43
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPublicServiceServiceImpl.java

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/LingShanScreenPublicServicePlaceListByCateRstDTO.java

@ -1,8 +1,12 @@
package com.epmet.dto.result.lingshan;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class LingShanScreenPublicServicePlaceListByCateRstDTO {
/**

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPublicServiceController.java

@ -259,7 +259,7 @@ public class IcPublicServiceController implements ResultDataResolver {
@GetMapping("lingshan/screen/listByCategory")
public Result<List<LingShanScreenPublicServicePlaceListByCateRstDTO>> lingshanScreenListByCategory(@RequestParam("orgType") String orgType,
@RequestParam("orgId") String orgId,
@RequestParam("category") String category) {
@RequestParam(value = "category", required = false) String category) {
List<LingShanScreenPublicServicePlaceListByCateRstDTO> rl = icPublicServiceService.lingshanScreenListByCategory(orgId, orgType, category);
return new Result<List<LingShanScreenPublicServicePlaceListByCateRstDTO>>().ok(rl);

43
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPublicServiceServiceImpl.java

@ -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());
}
}
Loading…
Cancel
Save