Browse Source

获取回避单位下拉列表(抽取专家时,显示与项目类型和专家类型相符的部门)

buzhanyi 2 years ago
parent
commit
a76eebf693

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

@@ -424,6 +424,21 @@ public class PmPurchaseExecutionController extends BaseController {
         return success(set);
     }
 
+    @ApiOperation(value = "获取回避单位下拉列表(抽取专家时,显示与项目类型和专家类型相符的部门)", notes = "查询条件:采购品种")
+    @PostMapping("/getExpertUnitListBC")
+    @Log(title = ModularConstans.professional, businessType = BusinessType.QUERY)
+    public AjaxResult getExpertUnitListBC(@RequestBody BaseUnitInformation unitInformation) {
+        List<BaseUnitInformation> baseUnitInformationList = baseExpertService.getBaseUnitInformationListBC(unitInformation);
+        if (ObjectUtils.isEmpty(baseUnitInformationList)) {
+            return error("专家单位列表是空的");
+        }
+        Set<String> set = new HashSet<>();
+        for (BaseUnitInformation baseUnitInformation : baseUnitInformationList) {
+            set.add(baseUnitInformation.getUnitName());
+        }
+        return success(set);
+    }
+
     /**
      * 抽取专家
      */

+ 6 - 0
purchase-system/src/main/java/com/ozs/base/domain/BaseUnitInformation.java

@@ -29,6 +29,12 @@ public class BaseUnitInformation {
     @TableField("unit_name")
     private String unitName;
 
+    /**
+     * 采购品种
+     */
+    @ApiModelProperty(value = "采购品种")
+    private String varietyPurchase;
+
     /**
      * 创建人
      */

+ 8 - 0
purchase-system/src/main/java/com/ozs/base/mapper/BaseExpertMapper.java

@@ -22,4 +22,12 @@ public interface BaseExpertMapper extends BaseMapper<BaseExpert> {
     Map<String, String> getExpertNameList(@Param("expertList") List<Long> expertList);
 
     List<PmDemandExpertRef> getExpertIdList(@Param("demandId") Long demandId);
+
+    /**
+     * 根据采购品种查询
+     *
+     * @param unitInformation
+     * @return
+     */
+    List<BaseUnitInformation> selectByUnitInformationBC(BaseUnitInformation unitInformation);
 }

+ 3 - 1
purchase-system/src/main/java/com/ozs/base/service/BaseExpertService.java

@@ -9,7 +9,7 @@ import com.ozs.common.core.domain.AjaxResult;
 
 import java.util.List;
 
-public interface BaseExpertService  extends IService<BaseExpert> {
+public interface BaseExpertService extends IService<BaseExpert> {
     int insertExpert(BaseExpertVo baseExpertVo);
 
     int updateSupplierType(BaseExpert baseExpert);
@@ -19,4 +19,6 @@ public interface BaseExpertService  extends IService<BaseExpert> {
     AjaxResult selectExtractionExpert(BaseExpertVo baseExpertVo);
 
     List<BaseUnitInformation> getBaseUnitInformationList();
+
+    List<BaseUnitInformation> getBaseUnitInformationListBC(BaseUnitInformation unitInformation);
 }

+ 13 - 0
purchase-system/src/main/java/com/ozs/base/service/impl/BaseExpertServiceImpl.java

@@ -63,6 +63,7 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
             if (baseUnitInformationList.size() <= 0) {
                 BaseUnitInformation baseUnitInformation = new BaseUnitInformation();
                 baseUnitInformation.setUnitName(baseExpertVo.getUnitInformation());
+                baseUnitInformation.setVarietyPurchase(baseExpertVo.getVarietyPurchase());
                 baseUnitInformation.setCreated(baseExpertVo.getExpertName());
                 baseUnitInformation.setCreateTime(new Date());
                 Integer i = baseExpertMapper.insertBaseUnitInformation(baseUnitInformation);
@@ -186,6 +187,18 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
         return baseUnitInformationList;
     }
 
+    /**
+     * 根据采购品种查询
+     *
+     * @param unitInformation
+     * @return
+     */
+    @Override
+    public List<BaseUnitInformation> getBaseUnitInformationListBC(BaseUnitInformation unitInformation) {
+        List<BaseUnitInformation> baseUnitInformationList = baseExpertMapper.selectByUnitInformationBC(unitInformation);
+        return baseUnitInformationList;
+    }
+
     private List<PmDemandResVo> changTo(List<PmDemand> pmDemandList) {
         List<PmDemandResVo> pmDemandResponseVoList = new ArrayList<>();
         //获取字典数据

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

@@ -1143,6 +1143,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
                     if (baseUnitInformationList.size() <= 0) {
                         BaseUnitInformation baseUnitInformation = new BaseUnitInformation();
                         baseUnitInformation.setUnitName(baseExpert.getUnitInformation());
+                        baseUnitInformation.setVarietyPurchase(baseExpert.getVarietyPurchase());
                         baseUnitInformation.setCreated(baseExpert.getExpertName());
                         baseUnitInformation.setCreateTime(new Date());
                         Integer i = baseExpertMapper.insertBaseUnitInformation(baseUnitInformation);

+ 16 - 0
purchase-system/src/main/resources/mapper/base/BaseExpertMapper.xml

@@ -138,6 +138,9 @@
             <if test="unitName != null and unitName != '' ">
                 unit_name,
             </if>
+            <if test="varietyPurchase != null and varietyPurchase != '' ">
+                variety_purchase,
+            </if>
             <if test="created != null and created != '' ">
                 created,
             </if>
@@ -149,6 +152,9 @@
             <if test="unitName != null and unitName != ''">
                 #{unitName},
             </if>
+            <if test="varietyPurchase != null and varietyPurchase != '' ">
+                #{varietyPurchase},
+            </if>
             <if test="created != null and created != ''">
                 #{created},
             </if>
@@ -170,4 +176,14 @@
         </foreach>
 
     </select>
+
+    <select id="selectByUnitInformationBC" resultType="com.ozs.base.domain.BaseUnitInformation"
+            parameterType="com.ozs.base.domain.BaseUnitInformation">
+        select * from base_unit_information
+        <where>
+            <if test="varietyPurchase != null and varietyPurchase != ''">
+                variety_purchase = #{varietyPurchase}
+            </if>
+        </where>
+    </select>
 </mapper>