소스 검색

专家库--项目评审--抽取专家

sunhh 2 년 전
부모
커밋
5e19bd5be0

+ 12 - 0
purchase-admin/src/main/java/com/ozs/web/controller/base/BaseExpertController.java

@@ -100,4 +100,16 @@ public class BaseExpertController extends BaseController {
 //        }
         return toAjax(baseExpertService.updateSupplierType(baseExpert));
     }
+
+    @ApiOperation(value = "评审项目", notes = "非必传 查询条件:品目名称")
+    @PostMapping("/selectReviewProject")
+    public AjaxResult selectReviewProject(@RequestBody BaseExpertVo baseExpertVo) {
+        if (StringUtils.isNull(baseExpertVo)
+                || StringUtils.isNull(baseExpertVo.getPageNum())
+                || StringUtils.isNull(baseExpertVo.getPageSize())
+                || StringUtils.isNull(baseExpertVo.getId())) {
+            return error("专家ID、分页 不能为空");
+        }
+        return baseExpertService.selectReviewProject(baseExpertVo);
+    }
 }

+ 4 - 0
purchase-system/src/main/java/com/ozs/base/service/BaseExpertService.java

@@ -3,9 +3,13 @@ package com.ozs.base.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ozs.base.domain.BaseAgency;
 import com.ozs.base.domain.BaseExpert;
+import com.ozs.base.domain.vo.BaseExpertVo;
+import com.ozs.common.core.domain.AjaxResult;
 
 public interface BaseExpertService  extends IService<BaseExpert> {
     int insertExpert(BaseExpert baseExpert);
 
     int updateSupplierType(BaseExpert baseExpert);
+
+    AjaxResult selectReviewProject(BaseExpertVo baseExpertVo);
 }

+ 30 - 3
purchase-system/src/main/java/com/ozs/base/service/impl/BaseExpertServiceImpl.java

@@ -1,17 +1,27 @@
 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.extension.plugins.pagination.Page;
 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.BaseUnitInformation;
+import com.ozs.base.domain.vo.BaseExpertVo;
 import com.ozs.base.mapper.BaseExpertMapper;
-import com.ozs.base.mapper.BaseSupplierMapper;
 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.utils.StringUtils;
+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.service.IPmDemandService;
+import com.ozs.pm.service.PmDemandExpertRefService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.ObjectUtils;
 
 import java.util.Date;
 import java.util.List;
@@ -21,6 +31,10 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
 
     @Autowired
     private BaseExpertMapper baseExpertMapper;
+    @Autowired
+    private PmDemandExpertRefService pmDemandExpertRefService;
+    @Autowired
+    private IPmDemandService pmDemandService;
 
     @Override
     public int insertExpert(BaseExpert baseExpert) {
@@ -48,4 +62,17 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
                 .set(BaseExpert::getStatus, baseExpert.getStatus());
         return baseExpertMapper.update(null, lambdaUpdateWrapper);
     }
+
+    @Override
+    public AjaxResult selectReviewProject(BaseExpertVo baseExpertVo) {
+        // 通过专家ID查询 与专家库关联的采购执行管理ID
+        List<Integer> demandIdList = pmDemandExpertRefService.selectByExpertId(baseExpertVo.getId());
+        if (StringUtils.isNull(demandIdList) && demandIdList.size() <=0) {
+            return AjaxResult.error("当前专家还有有被抽取!");
+        }
+        List<PmDemand> pmDemandList = pmDemandService.selectByDemandIdList(demandIdList);
+        PageHelper.startPage(baseExpertVo.getPageNum().intValue(), baseExpertVo.getPageSize().intValue());
+        PageInfo<PmDemand> pageInfo = new PageInfo<>(pmDemandList);
+        return AjaxResult.success(pageInfo);
+    }
 }

+ 4 - 0
purchase-system/src/main/java/com/ozs/pm/mapper/PmDemandExpertRefMapper.java

@@ -2,6 +2,9 @@ package com.ozs.pm.mapper;
 
 import com.ozs.pm.doman.PmDemandExpertRef;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 
 /**
@@ -12,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface PmDemandExpertRefMapper extends BaseMapper<PmDemandExpertRef> {
 
+    List<Integer> selectByExpertId(@Param("expertId") Integer expertId);
 }

+ 7 - 1
purchase-system/src/main/java/com/ozs/pm/mapper/PmDemandMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ozs.plan.doman.PlanYears;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ozs.pm.doman.PmDemand;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -48,5 +49,10 @@ public interface PmDemandMapper extends BaseMapper<PmDemand>
      */
     public int updatePmDemand(PmDemand pmDemand);
 
-
+    /**
+     * 通过需求ID列表,查询采购执行列表
+     * @param demandIdList
+     * @return
+     */
+    List<PmDemand> selectByDemandIdList(@Param("demandIdList") List<Integer> demandIdList);
 }

+ 6 - 0
purchase-system/src/main/java/com/ozs/pm/service/IPmDemandService.java

@@ -118,4 +118,10 @@ public interface IPmDemandService extends IService<PmDemand>
 
     boolean insertExpertBatch(PmBaseExpertReqVo pmBaseExpertReqVo) throws Exception;
 
+    /**
+     * 通过需求ID列表 查询采购执行列表 sunhh
+     * @param demandIdList
+     * @return
+     */
+    List<PmDemand> selectByDemandIdList(List<Integer> demandIdList);
 }

+ 3 - 0
purchase-system/src/main/java/com/ozs/pm/service/PmDemandExpertRefService.java

@@ -3,6 +3,8 @@ package com.ozs.pm.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ozs.pm.doman.PmDemandExpertRef;
 
+import java.util.List;
+
 /**
  * 项目专家关联表(PmDemandExpertRef)表服务接口
  *
@@ -11,4 +13,5 @@ import com.ozs.pm.doman.PmDemandExpertRef;
  */
 public interface PmDemandExpertRefService extends IService<PmDemandExpertRef> {
 
+    List<Integer> selectByExpertId(Integer id);
 }

+ 10 - 0
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandExpertRefServiceImpl.java

@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ozs.pm.mapper.PmDemandExpertRefMapper;
 import com.ozs.pm.doman.PmDemandExpertRef;
 import com.ozs.pm.service.PmDemandExpertRefService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * 项目专家关联表(PmDemandExpertRef)表服务实现类
  *
@@ -15,4 +18,11 @@ import org.springframework.stereotype.Service;
 @Service
 public class PmDemandExpertRefServiceImpl extends ServiceImpl<PmDemandExpertRefMapper, PmDemandExpertRef> implements PmDemandExpertRefService {
 
+    @Autowired
+    private PmDemandExpertRefMapper pmDemandExpertRefMapper;
+
+    @Override
+    public List<Integer> selectByExpertId(Integer expertId) {
+        return pmDemandExpertRefMapper.selectByExpertId(expertId);
+    }
 }

+ 5 - 0
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java

@@ -826,4 +826,9 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
           }
 
     }
+
+    @Override
+    public List<PmDemand> selectByDemandIdList(List<Integer> demandIdList) {
+        return pmDemandMapper.selectByDemandIdList(demandIdList);
+    }
 }

+ 3 - 0
purchase-system/src/main/resources/mapper/pm/PmDemandExpertRefMapper.xml

@@ -2,5 +2,8 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ozs.pm.mapper.PmDemandExpertRefMapper">
 
+    <select id="selectByExpertId" resultType="java.lang.Integer" parameterType="java.lang.Integer">
+        select demand_id from pm_demand_expert_ref where expert_id = #{expertId}
+    </select>
 
 </mapper>

+ 4 - 0
purchase-system/src/main/resources/mapper/pm/PmDemandMapper.xml

@@ -190,4 +190,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where demand_id = #{demandId}
     </update>
 
+    <select id="selectByDemandIdList" parameterType="java.util.ArrayList" resultMap="PmDemandResult">
+        <include refid="selectPmDemandVo"/>
+        where demand_id in #{demandIdList}
+    </select>
 </mapper>