| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.AccountDepartmentService; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.DepInfoRPCRespDTO; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.req.TargetDivideDetailQueryCriteria; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.TargetDivideDetailDto; |
| | | import com.gkhy.safePlatform.targetDuty.repository.TargetMngRepository; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetMng; |
| | | import com.gkhy.safePlatform.targetDuty.service.CommonService; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetDivideDetailService; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetMngService; |
| | | import org.apache.dubbo.config.annotation.DubboReference; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 目标指标(TargetMng)表服务实现类 |
| | |
| | | |
| | | @Resource |
| | | private TargetDivideDetailService targetDivideDetailService; |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private CommonService commonService; |
| | | |
| | | @Override |
| | | public ResultVO queryAll(PageQuery<TargetMngQueryCriteria> pageQuery) { |
| | |
| | | criteria.setTargetId(targetMng.getId()); |
| | | List<TargetDivideDetailDto> respList = BeanCopyUtils.copyBeanList(targetDivideDetailService.queryAll(criteria), TargetDivideDetailDto.class); |
| | | |
| | | //循环获取部门信息 TODO |
| | | // --------------------------- 获取部门信息----------------------- |
| | | //收集所用到的部门ID |
| | | Set<Long> collectDepIdSet = new HashSet(); |
| | | respList.forEach(f->{ |
| | | collectDepIdSet.add(f.getDutyDepartmentId()); |
| | | collectDepIdSet.add(f.getMakerDepartmentId()); |
| | | }); |
| | | //获取部门名集合 |
| | | Map<Long,String> depNameMap = commonService.getDepName(collectDepIdSet); |
| | | |
| | | respList.forEach(f->{ |
| | | f.setDutyDepartmentName(depNameMap.get(f.getDutyDepartmentId())); |
| | | f.setMakerDepartmentName(depNameMap.get(f.getMakerDepartmentId())); |
| | | }); |
| | | |
| | | |
| | | targetMngDto.setTargetDivideDetailList(respList); |
| | | return targetMngDto; |
| | | } |
| | | |
| | | |
| | | } |