|
@@ -1,31 +1,58 @@
|
|
package com.ozs.base.service.impl;
|
|
package com.ozs.base.service.impl;
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
+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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
-import com.ozs.base.domain.BaseAgency;
|
|
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
import com.ozs.base.domain.BaseExpert;
|
|
import com.ozs.base.domain.BaseExpert;
|
|
import com.ozs.base.domain.BaseUnitInformation;
|
|
import com.ozs.base.domain.BaseUnitInformation;
|
|
|
|
+import com.ozs.base.domain.vo.BaseExpertVo;
|
|
import com.ozs.base.mapper.BaseExpertMapper;
|
|
import com.ozs.base.mapper.BaseExpertMapper;
|
|
-import com.ozs.base.mapper.BaseSupplierMapper;
|
|
|
|
import com.ozs.base.service.BaseExpertService;
|
|
import com.ozs.base.service.BaseExpertService;
|
|
-import com.ozs.common.core.domain.model.LoginUser;
|
|
|
|
|
|
+import com.ozs.common.core.domain.AjaxResult;
|
|
|
|
+import com.ozs.common.enums.*;
|
|
import com.ozs.common.utils.StringUtils;
|
|
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.service.IPmDemandService;
|
|
|
|
+import com.ozs.pm.service.PmDemandExpertRefService;
|
|
|
|
+import com.ozs.system.domain.vo.responseVo.SysDeptResponseVo;
|
|
|
|
+import com.ozs.system.service.ISysDeptService;
|
|
|
|
+import com.ozs.system.service.ISysDictDataService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExpert> implements BaseExpertService {
|
|
public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExpert> implements BaseExpertService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private BaseExpertMapper baseExpertMapper;
|
|
private BaseExpertMapper baseExpertMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private PmDemandExpertRefService pmDemandExpertRefService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IPmDemandService pmDemandService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ISysDeptService deptService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ISysDictDataService dictDataService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public int insertExpert(BaseExpert baseExpert) {
|
|
public int insertExpert(BaseExpert baseExpert) {
|
|
// base_unit_information 单位信息表
|
|
// base_unit_information 单位信息表
|
|
- if(StringUtils.isNotNull(baseExpert.getUnitInformation())) {
|
|
|
|
|
|
+ if (StringUtils.isNotNull(baseExpert.getUnitInformation())) {
|
|
List<BaseUnitInformation> baseUnitInformationList = baseExpertMapper.selectByUnitInformation(baseExpert.getUnitInformation());
|
|
List<BaseUnitInformation> baseUnitInformationList = baseExpertMapper.selectByUnitInformation(baseExpert.getUnitInformation());
|
|
if (baseUnitInformationList.size() <= 0) {
|
|
if (baseUnitInformationList.size() <= 0) {
|
|
BaseUnitInformation baseUnitInformation = new BaseUnitInformation();
|
|
BaseUnitInformation baseUnitInformation = new BaseUnitInformation();
|
|
@@ -48,4 +75,94 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
|
|
.set(BaseExpert::getStatus, baseExpert.getStatus());
|
|
.set(BaseExpert::getStatus, baseExpert.getStatus());
|
|
return baseExpertMapper.update(null, lambdaUpdateWrapper);
|
|
return baseExpertMapper.update(null, lambdaUpdateWrapper);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public AjaxResult selectReviewProject(BaseExpertVo baseExpertVo) {
|
|
|
|
+ // 通过专家ID查询 与专家库关联的采购执行管理ID
|
|
|
|
+ List<Integer> demandIdList = pmDemandExpertRefService.selectByExpertId(baseExpertVo.getId());
|
|
|
|
+ if (demandIdList.size() == 0) {
|
|
|
|
+ return AjaxResult.error("当前专家还有有被抽取!");
|
|
|
|
+ }
|
|
|
|
+ List<PmDemand> pmDemandList = pmDemandService.selectByDemandIdList(demandIdList);
|
|
|
|
+ List<PmDemandResVo> pmDemandResponseVoList = changTo(pmDemandList);
|
|
|
|
+ PageHelper.startPage(baseExpertVo.getPageNum().intValue(), baseExpertVo.getPageSize().intValue());
|
|
|
|
+ PageInfo<PmDemandResVo> pageInfo = new PageInfo<>(pmDemandResponseVoList);
|
|
|
|
+ return AjaxResult.success(pageInfo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public AjaxResult selectExtractionExpert(BaseExpertVo baseExpertVo) {
|
|
|
|
+ List<PmDemand> pmDemandList = pmDemandService.selectExtractionExpert(baseExpertVo);
|
|
|
|
+ List<PmDemandResVo> pmDemandResponseVoList = changTo(pmDemandList);
|
|
|
|
+ PageHelper.startPage(baseExpertVo.getPageNum().intValue(), baseExpertVo.getPageSize().intValue());
|
|
|
|
+ PageInfo<PmDemandResVo> pageInfo = new PageInfo<>(pmDemandResponseVoList);
|
|
|
|
+ return AjaxResult.success(pageInfo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private List<PmDemandResVo> changTo(List<PmDemand> pmDemandList) {
|
|
|
|
+ List<PmDemandResVo> pmDemandResponseVoList = new ArrayList<>();
|
|
|
|
+ if (pmDemandList != null && pmDemandList.size() > 0) {
|
|
|
|
+ for (PmDemand pmDemand1 : pmDemandList) {
|
|
|
|
+ PmDemandResVo vo = new PmDemandResVo();
|
|
|
|
+ BeanUtils.copyProperties(pmDemand1, vo);
|
|
|
|
+ if (vo.getPurchaseDeptId() != null) {
|
|
|
|
+ Map<String, Object> deptMap = deptService.selectDeptById(vo.getPurchaseDeptId());
|
|
|
|
+ if (deptMap != null) {
|
|
|
|
+ SysDeptResponseVo sysDeptResponseVo = (SysDeptResponseVo) deptMap.get("sysDept");
|
|
|
|
+ if (sysDeptResponseVo != null) {
|
|
|
|
+ vo.setPurchaseDeptName(sysDeptResponseVo.getDeptName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ String purchaseServicesName = dictDataService.selectDictLabel("purchase_services", vo.getPurchaseServices());
|
|
|
|
+ if (StringUtils.isNotEmpty(purchaseServicesName)) {
|
|
|
|
+ vo.setPurchaseServicesName(purchaseServicesName);
|
|
|
|
+ }
|
|
|
|
+ //项目类型
|
|
|
|
+ for (ProjectTypes value : ProjectTypes.values()) {
|
|
|
|
+ if (vo.getProjectType() != null && vo.getProjectType().equals(value.getCode())) {
|
|
|
|
+ vo.setProjectTypeName(value.getInfo());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //是否为超限额计划
|
|
|
|
+ for (IsExcess value : IsExcess.values()) {
|
|
|
|
+ if (vo.getIsExcess() != null && vo.getIsExcess().equals(value.getCode())) {
|
|
|
|
+ vo.setIsExcessName(value.getInfo());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //采购方式
|
|
|
|
+ for (PlanPurchaseMode value : PlanPurchaseMode.values()) {
|
|
|
|
+ if (vo.getPurchaseMode() != null && vo.getPurchaseMode().equals(value.getCode())) {
|
|
|
|
+ vo.setPurchaseModeName(value.getInfo());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //项目属性
|
|
|
|
+ for (ProjectAttribute value : ProjectAttribute.values()) {
|
|
|
|
+ if (vo.getProjectAttr() != null && vo.getProjectAttr().equals(value.getCode())) {
|
|
|
|
+ vo.setProjectAttrName(value.getInfo());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //预警状态
|
|
|
|
+ for (WarnStatus value : WarnStatus.values()) {
|
|
|
|
+ if (vo.getWarnStatus() != null && vo.getWarnStatus().equals(value.getCode())) {
|
|
|
|
+ vo.setWarnStatusName(value.getInfo());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //项目状态
|
|
|
|
+ for (PmProjectStatus value : PmProjectStatus.values()) {
|
|
|
|
+ if (vo.getProjectStatus() != null && vo.getProjectStatus().equals(value.getCode())) {
|
|
|
|
+ vo.setProjectStatusName(value.getInfo());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ pmDemandResponseVoList.add(vo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return pmDemandResponseVoList;
|
|
|
|
+ }
|
|
}
|
|
}
|