|
@@ -13,14 +13,16 @@ import com.ozs.base.domain.vo.BaseExpertVo;
|
|
import com.ozs.base.mapper.BaseExpertMapper;
|
|
import com.ozs.base.mapper.BaseExpertMapper;
|
|
import com.ozs.base.service.BaseExpertService;
|
|
import com.ozs.base.service.BaseExpertService;
|
|
import com.ozs.common.core.domain.AjaxResult;
|
|
import com.ozs.common.core.domain.AjaxResult;
|
|
|
|
+import com.ozs.common.core.domain.model.LoginUser;
|
|
import com.ozs.common.enums.*;
|
|
import com.ozs.common.enums.*;
|
|
|
|
+import com.ozs.common.utils.PageUtils;
|
|
|
|
+import com.ozs.common.utils.SecurityUtils;
|
|
import com.ozs.common.utils.StringUtils;
|
|
import com.ozs.common.utils.StringUtils;
|
|
import com.ozs.common.utils.bean.BeanUtils;
|
|
import com.ozs.common.utils.bean.BeanUtils;
|
|
-import com.ozs.plan.doman.PlanQuarter;
|
|
|
|
-import com.ozs.plan.doman.ProvisionalPlan;
|
|
|
|
import com.ozs.pm.doman.PmDemand;
|
|
import com.ozs.pm.doman.PmDemand;
|
|
import com.ozs.pm.doman.PmDemandExpertRef;
|
|
import com.ozs.pm.doman.PmDemandExpertRef;
|
|
import com.ozs.pm.doman.vo.responseVo.PmDemandResVo;
|
|
import com.ozs.pm.doman.vo.responseVo.PmDemandResVo;
|
|
|
|
+import com.ozs.pm.mapper.PmDemandExpertRefMapper;
|
|
import com.ozs.pm.service.IPmDemandService;
|
|
import com.ozs.pm.service.IPmDemandService;
|
|
import com.ozs.pm.service.PmDemandExpertRefService;
|
|
import com.ozs.pm.service.PmDemandExpertRefService;
|
|
import com.ozs.system.domain.vo.responseVo.SysDeptResponseVo;
|
|
import com.ozs.system.domain.vo.responseVo.SysDeptResponseVo;
|
|
@@ -42,6 +44,8 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
|
|
@Autowired
|
|
@Autowired
|
|
private PmDemandExpertRefService pmDemandExpertRefService;
|
|
private PmDemandExpertRefService pmDemandExpertRefService;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private PmDemandExpertRefMapper expertRefMapper;
|
|
|
|
+ @Autowired
|
|
private IPmDemandService pmDemandService;
|
|
private IPmDemandService pmDemandService;
|
|
@Autowired
|
|
@Autowired
|
|
private ISysDeptService deptService;
|
|
private ISysDeptService deptService;
|
|
@@ -97,8 +101,19 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public AjaxResult selectExtractionExpert(BaseExpertVo baseExpertVo) {
|
|
public AjaxResult selectExtractionExpert(BaseExpertVo baseExpertVo) {
|
|
|
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
|
+ LambdaQueryWrapper<PmDemand> dp = new LambdaQueryWrapper<>();
|
|
|
|
+ //PmDemandExpertRef项目专家关联表
|
|
|
|
+ List<PmDemandExpertRef> list1 = expertRefMapper.selectList(new LambdaQueryWrapper<>());
|
|
|
|
+ List<Long> collect = list1.stream().map(PmDemandExpertRef::getDemandId).collect(Collectors.toList());
|
|
|
|
+ if (loginUser.getUsername().equals("admin")) {
|
|
|
|
+ dp.in(PmDemand::getDemandId, collect);
|
|
|
|
+ } else {
|
|
|
|
+ dp.in(PmDemand::getDemandId, collect);
|
|
|
|
+ dp.eq(PmDemand::getPurchaseDeptId, loginUser.getDeptId());
|
|
|
|
+ }
|
|
// 查询抽取过专家的项目列表
|
|
// 查询抽取过专家的项目列表
|
|
- List<PmDemand> pmDemandList = pmDemandService.selectExtractionExpert(baseExpertVo);
|
|
|
|
|
|
+ List<PmDemand> pmDemandList = pmDemandService.list(dp);
|
|
List<PmDemandResVo> pmDemandResponseVoList = changTo(pmDemandList);
|
|
List<PmDemandResVo> pmDemandResponseVoList = changTo(pmDemandList);
|
|
// 遍历项目 查询专家姓名
|
|
// 遍历项目 查询专家姓名
|
|
if (!ObjectUtils.isEmpty(pmDemandResponseVoList) && pmDemandResponseVoList.size() > 0) {
|
|
if (!ObjectUtils.isEmpty(pmDemandResponseVoList) && pmDemandResponseVoList.size() > 0) {
|
|
@@ -134,8 +149,15 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
|
|
pmDemandResVo.setAccessTime(accessTime);
|
|
pmDemandResVo.setAccessTime(accessTime);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //PageHelper.startPage(baseExpertVo.getPageNum().intValue(), baseExpertVo.getPageSize().intValue());
|
|
|
|
|
|
+ Page pages = PageUtils.getPages(baseExpertVo.getPageNum().intValue(), baseExpertVo.getPageSize().intValue(), pmDemandResponseVoList);
|
|
PageInfo<PmDemandResVo> pageInfo = new PageInfo<>(pmDemandResponseVoList);
|
|
PageInfo<PmDemandResVo> pageInfo = new PageInfo<>(pmDemandResponseVoList);
|
|
|
|
+ if (!ObjectUtils.isEmpty(pages) && pages.getRecords().size() > 0) {
|
|
|
|
+ pageInfo.setList(pages.getRecords());
|
|
|
|
+ pageInfo.setSize(Math.toIntExact(pages.getSize()));
|
|
|
|
+ pageInfo.setPageNum(Math.toIntExact(pages.getCurrent()));
|
|
|
|
+ pageInfo.setTotal(pages.getTotal());
|
|
|
|
+ pageInfo.setPages(Integer.parseInt(pages.getPages() + ""));
|
|
|
|
+ }
|
|
return AjaxResult.success(pageInfo);
|
|
return AjaxResult.success(pageInfo);
|
|
}
|
|
}
|
|
|
|
|