|
@@ -3,16 +3,23 @@ package com.ozs.web.controller.pm;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.ozs.base.domain.BaseAgency;
|
|
|
+import com.ozs.base.domain.BaseExpert;
|
|
|
+import com.ozs.base.domain.vo.BaseExpertVo;
|
|
|
import com.ozs.base.service.BaseAgencyService;
|
|
|
+import com.ozs.base.service.BaseExpertService;
|
|
|
import com.ozs.common.annotation.Log;
|
|
|
import com.ozs.common.constant.ModularConstans;
|
|
|
import com.ozs.common.core.controller.BaseController;
|
|
|
import com.ozs.common.core.domain.AjaxResult;
|
|
|
import com.ozs.common.enums.BusinessType;
|
|
|
+import com.ozs.common.enums.NameListType;
|
|
|
import com.ozs.common.enums.SysFileRefEnum;
|
|
|
+import com.ozs.common.utils.StringUtils;
|
|
|
import com.ozs.pm.doman.PmDemand;
|
|
|
import com.ozs.pm.doman.PmReleaseAnnouncement;
|
|
|
+import com.ozs.pm.doman.vo.requestVo.PmBaseExpertReqVo;
|
|
|
import com.ozs.pm.doman.vo.requestVo.PmDemandReqVo;
|
|
|
import com.ozs.pm.doman.vo.requestVo.PmPurchaseExecutionReqVo;
|
|
|
import com.ozs.pm.doman.vo.requestVo.PmReleaseAnnouncementReqVo;
|
|
@@ -23,6 +30,7 @@ import com.ozs.system.domain.SysFileRef;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -46,7 +54,8 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
private IPmDemandService pmDemandService;
|
|
|
@Autowired
|
|
|
private BaseAgencyService baseAgencyService;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private BaseExpertService baseExpertService;
|
|
|
|
|
|
/**
|
|
|
* 采购执行查询列表
|
|
@@ -156,14 +165,71 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "发布公告")
|
|
|
- @PostMapping("/insertBaseAgency")
|
|
|
- public AjaxResult insertBaseAgency(@NotEmpty(message = "数据为空")
|
|
|
+ @PostMapping("/insertPmReleaseAnnouncement")
|
|
|
+ public AjaxResult insertPmReleaseAnnouncement(@NotEmpty(message = "数据为空")
|
|
|
@RequestBody PmReleaseAnnouncementReqVo pmReleaseAnnouncementReqVo) {
|
|
|
pmReleaseAnnouncementReqVo.setCreateBy(getUserId().toString());
|
|
|
pmReleaseAnnouncementReqVo.setCreateTime(new Date());
|
|
|
pmReleaseAnnouncementReqVo.setUpdateBy(pmReleaseAnnouncementReqVo.getCreateBy());
|
|
|
pmReleaseAnnouncementReqVo.setUpdateTime(pmReleaseAnnouncementReqVo.getCreateTime());
|
|
|
- return toAjax(pmDemandService.insertBaseAgency(pmReleaseAnnouncementReqVo));
|
|
|
+ return toAjax(pmDemandService.insertPmReleaseAnnouncement(pmReleaseAnnouncementReqVo));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取专家身份证号列表")
|
|
|
+ @PostMapping("/getExpertIdNumberList")
|
|
|
+ public AjaxResult getExpertIdNumberList(@NotEmpty(message = "采购需求id不能为空")
|
|
|
+ @RequestParam(value = "demandId", required = true) Long demandId) {
|
|
|
+ PmDemand pmDemand = pmDemandService.getById(demandId);
|
|
|
+ if(ObjectUtils.isEmpty(pmDemand)){
|
|
|
+ return error("参数错误");
|
|
|
+ }
|
|
|
+
|
|
|
+ LambdaQueryWrapper<BaseExpert> lw = new LambdaQueryWrapper<BaseExpert>();
|
|
|
+ lw.eq(BaseExpert::getVarietyPurchase,pmDemand.getProjectType())
|
|
|
+ .eq(BaseExpert::getStatus,NameListType.WHITE.getCode());
|
|
|
+ BaseExpert baseExpert = baseExpertService.getOne(lw);
|
|
|
+ return success(baseExpert);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "根据身份证号查询专家", notes = "必传 查询条件:身份证号")
|
|
|
+ @PostMapping("/findExpertWithIdNumber")
|
|
|
+ public AjaxResult findExpertWithIdNumber(@NotEmpty(message = "采购需求id不能为空")
|
|
|
+ @RequestParam(value = "demandId", required = true) Long demandId,
|
|
|
+ @NotEmpty(message = "身份证号不能为空")
|
|
|
+ @RequestParam(value = "idNumber", required = true) String idNumber) {
|
|
|
+ PmDemand pmDemand = pmDemandService.getById(demandId);
|
|
|
+ if(ObjectUtils.isEmpty(pmDemand)){
|
|
|
+ return error("参数错误");
|
|
|
+ }
|
|
|
+ LambdaQueryWrapper<BaseExpert> lw = new LambdaQueryWrapper<BaseExpert>();
|
|
|
+ lw.eq(BaseExpert::getIdNumber,idNumber);
|
|
|
+ BaseExpert baseExpert = baseExpertService.getOne(lw);
|
|
|
+ if(baseExpert != null){
|
|
|
+ if(baseExpert.getStatus().equals(NameListType.WHITE.getCode())){
|
|
|
+ return error("该专家属于黑名单");
|
|
|
+ }
|
|
|
+ if(pmDemand.getProjectType().equals(baseExpert.getVarietyPurchase())){
|
|
|
+ return error("该专家所属采购品种和项目类型不匹配");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return success(baseExpert);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value = "填写专家信息批量提交", notes = "必传 采购需求ID和专家信息列表,注意:若该专家已经在库里存在,需要传专家对象BaseExpert的ID")
|
|
|
+ @PostMapping("/insertExpertBatch")
|
|
|
+ @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:insertExpertBatch')")
|
|
|
+ @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.INSERT)
|
|
|
+ public AjaxResult insertExpertBatch(@RequestBody PmBaseExpertReqVo pmBaseExpertReqVo) {
|
|
|
+ if (ObjectUtils.isEmpty(pmBaseExpertReqVo) || ObjectUtils.isEmpty(pmBaseExpertReqVo.getDemandId()) || ObjectUtils.isEmpty(pmBaseExpertReqVo.getBaseExpertList())) {
|
|
|
+ return error("参数错误");
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ return toAjax(pmDemandService.insertExpertBatch(pmBaseExpertReqVo));
|
|
|
+ } catch (Exception e) {
|
|
|
+ return error(e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|