suntianwu пре 2 година
родитељ
комит
5ae8659f23

+ 15 - 4
purchase-admin/src/main/java/com/ozs/web/controller/pm/PmPurchaseExecutionController.java

@@ -37,10 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotEmpty;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Optional;
+import java.util.*;
 
 
 /**
 /**
  * 采购执行Controller
  * 采购执行Controller
@@ -269,6 +266,20 @@ public class PmPurchaseExecutionController extends BaseController {
         }
         }
     }
     }
 
 
+    @ApiOperation(value = "获取回避单位下拉列表")
+    @GetMapping("/getExpertUnitList")
+    public AjaxResult getExpertUnitList() {
+        List<BaseExpert> baseExperts = baseExpertService.list();
+        if(ObjectUtils.isEmpty(baseExperts)){
+            return error("专家列表是空的");
+        }
+        Set<String> set = new HashSet<>();
+        for(BaseExpert baseExpert : baseExperts) {
+            set.add(baseExpert.getUnitInformation());
+        }
+        return success(set);
+    }
+
     /**
     /**
      * 抽取专家
      * 抽取专家
      */
      */

+ 9 - 2
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java

@@ -855,10 +855,16 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
            throw new Exception("参数错误");
            throw new Exception("参数错误");
        }
        }
 
 
+        String needAvoidUnit = pmBaseExpertExtractReqVo.getNeedAvoidUnit();
+        List<String> needAvoidUnitList = null;
+       if(!ObjectUtils.isEmpty(needAvoidUnit)){
+           String[] arr = needAvoidUnit.split(",");
+           needAvoidUnitList = Arrays.asList(arr);
+       }
 
 
-        String localArea = pmBaseExpertExtractReqVo.getLocalArea();
 
 
-       List<String> sysRegionCodeList = new ArrayList<>();
+        String localArea = pmBaseExpertExtractReqVo.getLocalArea();
+        List<String> sysRegionCodeList = new ArrayList<>();
        if(!ObjectUtils.isEmpty(localArea)) {
        if(!ObjectUtils.isEmpty(localArea)) {
            if(!StringUtils.isNumeric(localArea)){
            if(!StringUtils.isNumeric(localArea)){
                throw new Exception("地域必须传数字代码");
                throw new Exception("地域必须传数字代码");
@@ -877,6 +883,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
        LambdaQueryWrapper<BaseExpert> lw = new LambdaQueryWrapper<>();
        LambdaQueryWrapper<BaseExpert> lw = new LambdaQueryWrapper<>();
        lw.eq(BaseExpert::getVarietyPurchase,pmDemand.getProjectType())
        lw.eq(BaseExpert::getVarietyPurchase,pmDemand.getProjectType())
                .eq(BaseExpert::getStatus,NameListType.WHITE.getCode())
                .eq(BaseExpert::getStatus,NameListType.WHITE.getCode())
+                .notIn(!ObjectUtils.isEmpty(needAvoidUnitList),BaseExpert::getUnitInformation,needAvoidUnitList)
                .in(!ObjectUtils.isEmpty(sysRegionCodeList), BaseExpert::getLocalArea,sysRegionCodeList);
                .in(!ObjectUtils.isEmpty(sysRegionCodeList), BaseExpert::getLocalArea,sysRegionCodeList);
 
 
        List<BaseExpert> baseExpertList = baseExpertService.list(lw);
        List<BaseExpert> baseExpertList = baseExpertService.list(lw);