|
@@ -13,14 +13,17 @@ import com.ozs.base.domain.vo.BaseExpertVo;
|
|
|
import com.ozs.base.mapper.BaseExpertMapper;
|
|
|
import com.ozs.base.service.BaseExpertService;
|
|
|
import com.ozs.common.core.domain.AjaxResult;
|
|
|
+import com.ozs.common.core.domain.entity.SysUser;
|
|
|
+import com.ozs.common.core.domain.model.LoginUser;
|
|
|
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.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.PmDemandExpertRef;
|
|
|
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.PmDemandExpertRefService;
|
|
|
import com.ozs.system.domain.vo.responseVo.SysDeptResponseVo;
|
|
@@ -42,6 +45,8 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
|
|
|
@Autowired
|
|
|
private PmDemandExpertRefService pmDemandExpertRefService;
|
|
|
@Autowired
|
|
|
+ private PmDemandExpertRefMapper expertRefMapper;
|
|
|
+ @Autowired
|
|
|
private IPmDemandService pmDemandService;
|
|
|
@Autowired
|
|
|
private ISysDeptService deptService;
|
|
@@ -97,8 +102,17 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
|
|
|
|
|
|
@Override
|
|
|
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 (!SysUser.isAdmin(loginUser.getUserId())) {
|
|
|
+ //指定部门--以及子单位的超额数据
|
|
|
+ dp.in(PmDemand::getDemandId, pmDemandService.isQueryZD(Math.toIntExact(loginUser.getDeptId())));
|
|
|
+ }
|
|
|
// 查询抽取过专家的项目列表
|
|
|
- List<PmDemand> pmDemandList = pmDemandService.selectExtractionExpert(baseExpertVo);
|
|
|
+ List<PmDemand> pmDemandList = pmDemandService.list(dp);
|
|
|
List<PmDemandResVo> pmDemandResponseVoList = changTo(pmDemandList);
|
|
|
// 遍历项目 查询专家姓名
|
|
|
if (!ObjectUtils.isEmpty(pmDemandResponseVoList) && pmDemandResponseVoList.size() > 0) {
|
|
@@ -109,33 +123,43 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
|
|
|
// 专家ID列表
|
|
|
List<Long> expertList = pmDemandExpertRefList.stream().map(PmDemandExpertRef::getExpertId).collect(Collectors.toList());
|
|
|
// 获取抽取时间(列表中取其中一个时间)
|
|
|
- Date accessTime = pmDemandExpertRefList.get(0).getAccessTime();
|
|
|
- Map<String, String> map = baseExpertMapper.getExpertNameList(expertList);
|
|
|
- if (!ObjectUtils.isEmpty(map)) {
|
|
|
- // 专家名称
|
|
|
- String expertNameStr = map.get("expertName");
|
|
|
- // 采购品种
|
|
|
- String varietyPurchaseStr = map.get("varietyPurchase");
|
|
|
- List<String> list = Arrays.stream(varietyPurchaseStr.split(",")).map(s -> String.valueOf(s.trim())).collect(Collectors.toList());
|
|
|
- List<String> newList = method(list);
|
|
|
- // 查询采购品种 中文
|
|
|
- String varietyPurchaseName = "";
|
|
|
- for (String i : newList) {
|
|
|
- String name = PurchaseType.getCodeToInfo(i);
|
|
|
- if ("".equals(varietyPurchaseName)) {
|
|
|
- varietyPurchaseName = name;
|
|
|
- } else {
|
|
|
- varietyPurchaseName = "," + name;
|
|
|
+
|
|
|
+ if (!ObjectUtils.isEmpty(expertList)) {
|
|
|
+ Date accessTime = pmDemandExpertRefList.get(0).getAccessTime();
|
|
|
+ Map<String, String> map = baseExpertMapper.getExpertNameList(expertList);
|
|
|
+ if (!ObjectUtils.isEmpty(map)) {
|
|
|
+ // 专家名称
|
|
|
+ String expertNameStr = map.get("expertName");
|
|
|
+ // 采购品种
|
|
|
+ String varietyPurchaseStr = map.get("varietyPurchase");
|
|
|
+ List<String> list = Arrays.stream(varietyPurchaseStr.split(",")).map(s -> String.valueOf(s.trim())).collect(Collectors.toList());
|
|
|
+ List<String> newList = method(list);
|
|
|
+ // 查询采购品种 中文
|
|
|
+ String varietyPurchaseName = "";
|
|
|
+ for (String i : newList) {
|
|
|
+ String name = PurchaseType.getCodeToInfo(i);
|
|
|
+ if ("".equals(varietyPurchaseName)) {
|
|
|
+ varietyPurchaseName = name;
|
|
|
+ } else {
|
|
|
+ varietyPurchaseName = "," + name;
|
|
|
+ }
|
|
|
}
|
|
|
+ pmDemandResVo.setExpertNameStr(expertNameStr);
|
|
|
+ pmDemandResVo.setVarietyPurchaseStr(varietyPurchaseName);
|
|
|
}
|
|
|
- pmDemandResVo.setExpertNameStr(expertNameStr);
|
|
|
- pmDemandResVo.setVarietyPurchaseStr(varietyPurchaseName);
|
|
|
+ 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);
|
|
|
+ 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);
|
|
|
}
|
|
|
|