|
|
@ -21,16 +21,19 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
|
import com.epmet.commons.tools.enums.DictTypeEnum; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.dao.IcPartyUnitDao; |
|
|
|
import com.epmet.dto.IcPartyUnitDTO; |
|
|
|
import com.epmet.dto.IcUserDemandRecDTO; |
|
|
|
import com.epmet.dto.form.PartyUnitFormDTO; |
|
|
|
import com.epmet.dto.form.demand.ServiceQueryFormDTO; |
|
|
|
import com.epmet.dto.form.demand.SubCodeFormDTO; |
|
|
@ -177,17 +180,21 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<OptionDTO> queryServiceList(ServiceQueryFormDTO formDTO) { |
|
|
|
List<OptionDTO> resultList=new ArrayList<>(); |
|
|
|
IcUserDemandRecDTO icUserDemandRecDTO=icUserDemandRecService.get(formDTO.getDemandRecId()); |
|
|
|
if(null==icUserDemandRecDTO|| org.springframework.util.StringUtils.isEmpty(icUserDemandRecDTO.getGridPids())){ |
|
|
|
return resultList; |
|
|
|
List<OptionDTO> resultList = new ArrayList<>(); |
|
|
|
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); |
|
|
|
if (null == staffInfoCacheResult || StringUtils.isBlank(staffInfoCacheResult.getAgencyId())) { |
|
|
|
throw new RenException("工作人员所属组织信息查询异常"); |
|
|
|
} |
|
|
|
List<String> agencyIds=new ArrayList<>(); |
|
|
|
if(icUserDemandRecDTO.getGridPids().contains(StrConstant.COLON)){ |
|
|
|
agencyIds.addAll(Arrays.asList(icUserDemandRecDTO.getGridPids().split(StrConstant.COLON))); |
|
|
|
}else{ |
|
|
|
agencyIds.add(icUserDemandRecDTO.getGridPids()); |
|
|
|
List<String> agencyIds = new ArrayList<>(); |
|
|
|
if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { |
|
|
|
if (staffInfoCacheResult.getAgencyPIds().contains(StrConstant.COLON)) { |
|
|
|
agencyIds.addAll(Arrays.asList(staffInfoCacheResult.getAgencyPIds().split(StrConstant.COLON))); |
|
|
|
}else{ |
|
|
|
//当前用户属于第二级组织的人,不会有:
|
|
|
|
agencyIds.add(staffInfoCacheResult.getAgencyPIds()); |
|
|
|
} |
|
|
|
} |
|
|
|
agencyIds.add(staffInfoCacheResult.getAgencyId()); |
|
|
|
resultList=baseDao.selectListByAgencyId(agencyIds,formDTO.getServiceName(),formDTO.getCustomerId()); |
|
|
|
return resultList; |
|
|
|
} |
|
|
|