| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.safePlatform.targetDuty.repository.TargetDutySummaryRepository; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetDutySummary; |
| | | import com.gkhy.safePlatform.targetDuty.service.CommonService; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetDutySummaryService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import com.gkhy.safePlatform.targetDuty.utils.QueryHelpPlus; |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * (TargetDutySummary)表服务实现类 |
| | |
| | | |
| | | @Autowired |
| | | private TargetDutySummaryRepository targetDutySummaryRepository; |
| | | |
| | | |
| | | @Resource |
| | | private CommonService commonService; |
| | | |
| | | |
| | | @Override |
| | |
| | | QueryHelpPlus.getPredicate(TargetDutySummary.class, pageQuery.getSearchParams())); |
| | | List<TargetDutySummaryDto> respList = BeanCopyUtils.copyBeanList(page.getRecords(), TargetDutySummaryDto.class); |
| | | |
| | | // TODO:获取责任部门名称 |
| | | // --------------------------- 获取部门信息----------------------- |
| | | //收集所用到的部门ID |
| | | Set<Long> collectDepIdSet = new HashSet(); |
| | | respList.forEach(f->{ |
| | | collectDepIdSet.add(f.getDepartmentId()); |
| | | }); |
| | | //获取部门名集合 |
| | | Map<Long,String> depNameMap = commonService.getDepName(collectDepIdSet); |
| | | |
| | | respList.forEach(f->{ |
| | | f.setDepartmentName(depNameMap.get(f.getDepartmentId())); |
| | | }); |
| | | |
| | | return new SearchResultVO<>( |
| | | true, |