| | |
| | | package com.gkhy.safePlatform.equipment.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.AccountDepartmentService; |
| | | import com.gkhy.safePlatform.equipment.entity.*; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.*; |
| | | import com.gkhy.safePlatform.equipment.repository.EquipmentTypeMngRepository; |
| | | import com.gkhy.safePlatform.equipment.repository.KeypointEquipmentInfoRepository; |
| | | import com.gkhy.safePlatform.equipment.service.*; |
| | | import org.apache.dubbo.config.annotation.DubboReference; |
| | |
| | | @Autowired |
| | | private EquipmentInfoService equipmentInfoService; |
| | | |
| | | @Autowired |
| | | private EquipmentTypeMngRepository equipmentTypeMngRepository; |
| | | |
| | | @Override |
| | | public ResultVO queryAll(PageQuery<KeypointEquipmentInfoQueryCriteria> pageQuery) { |
| | | Long pageIndex = pageQuery.getPageIndex(); |
| | |
| | | QueryHelpPlus.getPredicate(KeypointEquipmentInfo.class, pageQuery.getSearchParams())); |
| | | List<KeypointEquipmentInfoDto> respList = BeanCopyUtils.copyBeanList(page.getRecords(), KeypointEquipmentInfoDto.class); |
| | | |
| | | Set<Long> collectTypeIdSet = new HashSet(); |
| | | //获取额外信息 |
| | | respList.forEach(f->{ |
| | | //设备保养 |
| | |
| | | List<EquipmentRepairDetail> repairDetailList = equipmentRepairDetailService.queryAll(criteria2); |
| | | f.setRepaireDetailList(repairDetailList); |
| | | |
| | | // --------------------------- 获取设备设施类型管理ID----------------------- |
| | | collectTypeIdSet.add(f.getEquipmentTypeId()); |
| | | |
| | | // --------------------------- 获取部门信息----------------------- |
| | | //收集所用到的部门ID |
| | |
| | | checkDetailList.forEach(info->{info.setTestPersonDepartmentName(depNameMap.get(info.getTestPersonDepartmentId()));}); |
| | | repairDetailList.forEach(info->{info.setRepairPersonDepartmentName(depNameMap.get(info.getRepairPersonDepartmentId()));}); |
| | | }); |
| | | |
| | | |
| | | //获取设备设施类型名称 |
| | | if(!collectTypeIdSet.isEmpty()){ |
| | | List<EquipmentTypeMng> typeMngList = equipmentTypeMngRepository.selectList(new QueryWrapper<EquipmentTypeMng>().in("id",collectTypeIdSet)); |
| | | Map<Long, String> typePool = new HashMap<>(); |
| | | typeMngList.forEach(f->{ |
| | | typePool.put(f.getId(),f.getTypeName()); |
| | | }); |
| | | respList.forEach(f->{ |
| | | f.setEquipmentTypeName(typePool.get(f.getEquipmentTypeId())); |
| | | }); |
| | | } |
| | | |
| | | return new SearchResultVO<>( |
| | | true, |
| | | pageIndex, |
| | |
| | | checkDetailList.forEach(info->{info.setTestPersonDepartmentName(depNameMap.get(info.getTestPersonDepartmentId()));}); |
| | | repairDetailList.forEach(info->{info.setRepairPersonDepartmentName(depNameMap.get(info.getRepairPersonDepartmentId()));}); |
| | | |
| | | EquipmentTypeMng typeMng = equipmentTypeMngRepository.selectOne(new QueryWrapper<EquipmentTypeMng>().eq("id",infoDto.getEquipmentTypeId())); |
| | | if(typeMng != null){ |
| | | infoDto.setEquipmentTypeName(typeMng.getTypeName()); |
| | | } |
| | | return infoDto; |
| | | } |
| | | |