|
|
@ -35,10 +35,7 @@ import com.epmet.dao.IcUserDemandRecDao; |
|
|
|
import com.epmet.dto.IcCommunitySelfOrganizationDTO; |
|
|
|
import com.epmet.dto.form.*; |
|
|
|
import com.epmet.dto.form.demand.ServiceQueryFormDTO; |
|
|
|
import com.epmet.dto.result.CommunitySelfOrganizationListDTO; |
|
|
|
import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO; |
|
|
|
import com.epmet.dto.result.ServicePointDTO; |
|
|
|
import com.epmet.dto.result.UploadImgResultDTO; |
|
|
|
import com.epmet.dto.result.*; |
|
|
|
import com.epmet.dto.result.demand.OptionDTO; |
|
|
|
import com.epmet.entity.IcCommunitySelfOrganizationEntity; |
|
|
|
import com.epmet.entity.IcCommunitySelfOrganizationPersonnelEntity; |
|
|
@ -709,4 +706,69 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo |
|
|
|
return Collections.EMPTY_LIST; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 多元主体分析-各分类下的社区自组织数量饼图 |
|
|
|
* |
|
|
|
* @param customerId |
|
|
|
* @param staffId |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<SelfOrgCategoryTotalResDTO> querySelfOrgCategoryTotal(String customerId, String staffId) { |
|
|
|
Result<Map<String, String>> dictMapRes = adminOpenFeignClient.dictMap(DictTypeEnum.SELF_ORG_CATEGORY.getCode()); |
|
|
|
if (!dictMapRes.success() || MapUtils.isEmpty(dictMapRes.getData())) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "社区自组织分类查询异常"); |
|
|
|
} |
|
|
|
CustomerStaffInfoCacheResult staffInfo=getStaffInfo(customerId,staffId); |
|
|
|
List<SelfOrgCategoryTotalResDTO> list = baseDao.selectCountGroupByCategory(customerId, staffInfo.getAgencyId()); |
|
|
|
Map<String, Integer> map = list.stream().collect(Collectors.toMap(SelfOrgCategoryTotalResDTO::getCategoryCode, SelfOrgCategoryTotalResDTO::getTotal, (key1, key2) -> key2)); |
|
|
|
List<SelfOrgCategoryTotalResDTO> resultList = new ArrayList<>(); |
|
|
|
for (String key : dictMapRes.getData().keySet()) { |
|
|
|
SelfOrgCategoryTotalResDTO resDTO = new SelfOrgCategoryTotalResDTO(); |
|
|
|
resDTO.setCategoryCode(key); |
|
|
|
resDTO.setCategoryName(dictMapRes.getData().get(key)); |
|
|
|
resDTO.setTotal(map.containsKey(key) ? map.get(key) : NumConstant.ZERO); |
|
|
|
resultList.add(resDTO); |
|
|
|
} |
|
|
|
return resultList; |
|
|
|
} |
|
|
|
|
|
|
|
private CustomerStaffInfoCacheResult getStaffInfo(String customerId, String staffId) { |
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staffId); |
|
|
|
if (null == staffInfo || StringUtils.isBlank(staffInfo.getAgencyId())) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询当前工作人员信息异常"); |
|
|
|
} |
|
|
|
return staffInfo; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 多元主体分析-分类下的社区自组织列表 |
|
|
|
* |
|
|
|
* @param formDTO |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public PageData<CommunitySelfOrganizationListDTO> queryCategoryList(CategorySelfOrgFormDTO formDTO) { |
|
|
|
CustomerStaffInfoCacheResult staffInfo=getStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId()); |
|
|
|
formDTO.setAgencyId(staffInfo.getAgencyId()); |
|
|
|
PageInfo<CommunitySelfOrganizationListDTO> pageInfo= PageHelper.startPage(formDTO.getPageNo(), |
|
|
|
formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.queryCategoryList(formDTO)); |
|
|
|
return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 多元主体分析-地图坐标,及详情 |
|
|
|
* |
|
|
|
* @param formDTO |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public PageData<CommunitySelfOrganizationListDTO> queryCoordinateList(CategorySelfOrgFormDTO formDTO) { |
|
|
|
CustomerStaffInfoCacheResult staffInfo=getStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId()); |
|
|
|
formDTO.setAgencyId(staffInfo.getAgencyId()); |
|
|
|
PageInfo<CommunitySelfOrganizationListDTO> pageInfo= PageHelper.startPage(formDTO.getPageNo(), |
|
|
|
formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.queryCoordinateList(formDTO)); |
|
|
|
return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|