|
@ -1,5 +1,6 @@ |
|
|
package com.epmet.opendata.service.impl; |
|
|
package com.epmet.opendata.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
@ -7,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
|
|
|
import com.epmet.commons.tools.dto.result.OptionResultDTO; |
|
|
import com.epmet.commons.tools.enums.OrgTypeEnum; |
|
|
import com.epmet.commons.tools.enums.OrgTypeEnum; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
@ -15,6 +17,7 @@ import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.utils.HttpClientManager; |
|
|
import com.epmet.commons.tools.utils.HttpClientManager; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.dto.CustomerGridDTO; |
|
|
import com.epmet.dto.CustomerGridDTO; |
|
|
|
|
|
import com.epmet.dto.form.GridOptionFormDTO; |
|
|
import com.epmet.dto.result.CustomerStaffGridResultDTO; |
|
|
import com.epmet.dto.result.CustomerStaffGridResultDTO; |
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
@ -118,12 +121,14 @@ public class CaRotatorsServiceImpl extends BaseServiceImpl<CaRotatorsDao, CaRota |
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(dto.getCustomerId(), dto.getUserId()); |
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(dto.getCustomerId(), dto.getUserId()); |
|
|
String agencyId = staffInfo.getAgencyId(); |
|
|
String agencyId = staffInfo.getAgencyId(); |
|
|
// 根据组织id获取gridId网格id
|
|
|
// 根据组织id获取gridId网格id
|
|
|
Result<List<CustomerStaffGridResultDTO>> staffGridList = govOrgOpenFeignClient.getStaffGridList(dto.getCustomerId(), agencyId, OrgTypeEnum.AGENCY.getCode()); |
|
|
GridOptionFormDTO gridOptionFormDTO = new GridOptionFormDTO(); |
|
|
|
|
|
gridOptionFormDTO.setAgencyId(agencyId); |
|
|
|
|
|
gridOptionFormDTO.setPurpose("query"); |
|
|
|
|
|
Result<List<OptionResultDTO>> gridOption = govOrgOpenFeignClient.getGridOption(gridOptionFormDTO); |
|
|
List<String> gridList = new ArrayList<>(); |
|
|
List<String> gridList = new ArrayList<>(); |
|
|
gridList.add(agencyId); |
|
|
gridList.add(agencyId); |
|
|
staffGridList.getData().forEach(item -> { |
|
|
this.packGirdArray(gridOption.getData(), gridList); |
|
|
gridList.add(item.getGridId()); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
PageHelper.startPage(dto.getPage(), dto.getLimit()); |
|
|
PageHelper.startPage(dto.getPage(), dto.getLimit()); |
|
|
List<CaRotatorsResultDTO> result = baseDao.getPage(dto.getRotatorsName(), |
|
|
List<CaRotatorsResultDTO> result = baseDao.getPage(dto.getRotatorsName(), |
|
@ -135,6 +140,15 @@ public class CaRotatorsServiceImpl extends BaseServiceImpl<CaRotatorsDao, CaRota |
|
|
return new PageData<>(result, info.getTotal()); |
|
|
return new PageData<>(result, info.getTotal()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void packGirdArray(List<OptionResultDTO> options, List<String> gridList) { |
|
|
|
|
|
if (CollUtil.isNotEmpty(options)) { |
|
|
|
|
|
for (OptionResultDTO option : options) { |
|
|
|
|
|
gridList.add(option.getValue()); |
|
|
|
|
|
packGirdArray(option.getChildren(), gridList); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 流动人口调用ruoyi接口存储数据 |
|
|
* 流动人口调用ruoyi接口存储数据 |
|
|
* |
|
|
* |
|
|