|
@@ -3,10 +3,8 @@ 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;
|
|
@@ -15,17 +13,16 @@ 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.PmProjectStatus;
|
|
|
import com.ozs.common.enums.SysFileRefEnum;
|
|
|
+import com.ozs.common.utils.RandomUtil;
|
|
|
import com.ozs.common.utils.StringUtils;
|
|
|
+import com.ozs.pm.doman.PmBidWinning;
|
|
|
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;
|
|
|
+import com.ozs.pm.doman.vo.requestVo.*;
|
|
|
import com.ozs.pm.doman.vo.responseVo.PmDemandResVo;
|
|
|
import com.ozs.pm.service.IPmDemandService;
|
|
|
-import com.ozs.pm.service.PmReleaseAnnouncementService;
|
|
|
+import com.ozs.pm.service.PmBidWinningService;
|
|
|
import com.ozs.system.domain.SysFileRef;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -36,6 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.validation.constraints.NotEmpty;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Optional;
|
|
@@ -57,6 +55,7 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
@Autowired
|
|
|
private BaseExpertService baseExpertService;
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 采购执行查询列表
|
|
|
*/
|
|
@@ -105,6 +104,7 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
}
|
|
|
PmDemand pmDemandUpdate = new PmDemand();
|
|
|
pmDemandUpdate.setDemandId(demandId);
|
|
|
+ pmDemandUpdate.setProjectStatus(Long.parseLong(PmProjectStatus.WAIT_UPLOAD_BID_FILE.getCode()));
|
|
|
pmDemandUpdate.setAgencyId(agencyId);
|
|
|
pmDemandUpdate.setExtractAgencyTime(new Date());
|
|
|
pmDemandUpdate.setUpdateTime(pmDemandUpdate.getExtractAgencyTime());
|
|
@@ -127,13 +127,17 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
LambdaQueryWrapper<BaseAgency> lw = new LambdaQueryWrapper<>();
|
|
|
lw.eq(BaseAgency::getCompanyType,pmDemand.getProjectType());
|
|
|
lw.eq(BaseAgency::getStatus,0);
|
|
|
- Optional<BaseAgency> any = baseAgencyService.list(lw).stream().findAny();
|
|
|
- if(ObjectUtils.isEmpty(any)){
|
|
|
+ List<BaseAgency> baseAgencyList = baseAgencyService.list(lw);
|
|
|
+ if (ObjectUtils.isEmpty(baseAgencyList)){
|
|
|
return error("没有符合的招标代理机构,抽取失败!");
|
|
|
}
|
|
|
+
|
|
|
+ BaseAgency any = (BaseAgency)(RandomUtil.getRandomList(baseAgencyList,1).get(0));
|
|
|
+
|
|
|
PmDemand pmDemandUpdate = new PmDemand();
|
|
|
pmDemandUpdate.setDemandId(demandId);
|
|
|
- pmDemandUpdate.setAgencyId(any.get().getId());
|
|
|
+ pmDemandUpdate.setProjectStatus(Long.parseLong(PmProjectStatus.WAIT_UPLOAD_BID_FILE.getCode()));
|
|
|
+ pmDemandUpdate.setAgencyId(any.getId());
|
|
|
pmDemandUpdate.setExtractAgencyTime(new Date());
|
|
|
pmDemandUpdate.setUpdateTime(pmDemandUpdate.getExtractAgencyTime());
|
|
|
pmDemandUpdate.setUpdateBy(getUserId().toString());
|
|
@@ -141,8 +145,8 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "上传招标文件",notes = "采购需求ID和上传附件必传")
|
|
|
- @PostMapping("/upLoadBidFile")
|
|
|
- public AjaxResult upLoadBidFile(@NotEmpty(message = "数据为空") @RequestBody PmPurchaseExecutionReqVo pmPurchaseExecutionReqVo) {
|
|
|
+ @PostMapping("/uploadBidFile")
|
|
|
+ public AjaxResult uploadBidFile(@NotEmpty(message = "数据为空") @RequestBody PmPurchaseExecutionReqVo pmPurchaseExecutionReqVo) {
|
|
|
Long demandId = pmPurchaseExecutionReqVo.getDemandId();
|
|
|
if(ObjectUtils.isEmpty(demandId)){
|
|
|
return error("参数错误");
|
|
@@ -158,9 +162,14 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
return error("参数错误");
|
|
|
}
|
|
|
if (pmDemandService.uploadFile(demandId, SysFileRefEnum.PM_BID_FILE.getType(),sysFileRefs,getUserId().toString())) {
|
|
|
- return AjaxResult.success();
|
|
|
+ PmDemand pmDemandUpdate = new PmDemand();
|
|
|
+ pmDemandUpdate.setDemandId(demandId);
|
|
|
+ pmDemandUpdate.setProjectStatus(Long.parseLong(PmProjectStatus.WAIT_ANNOUNCEMENT.getCode()));
|
|
|
+ pmDemandUpdate.setUpdateTime(new Date());
|
|
|
+ pmDemandUpdate.setUpdateBy(getUserId().toString());
|
|
|
+ return success(pmDemandService.updateById(pmDemandUpdate));
|
|
|
} else {
|
|
|
- return error("上传失败");
|
|
|
+ return error("保存上传附件失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -168,11 +177,20 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
@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.insertPmReleaseAnnouncement(pmReleaseAnnouncementReqVo));
|
|
|
+ try {
|
|
|
+ Long demandId = pmReleaseAnnouncementReqVo.getDemandId();
|
|
|
+ if(ObjectUtils.isEmpty(demandId)){
|
|
|
+ return error("参数错误");
|
|
|
+ }
|
|
|
+ pmReleaseAnnouncementReqVo.setCreateBy(getUserId().toString());
|
|
|
+ pmReleaseAnnouncementReqVo.setCreateTime(new Date());
|
|
|
+ pmReleaseAnnouncementReqVo.setUpdateBy(pmReleaseAnnouncementReqVo.getCreateBy());
|
|
|
+ pmReleaseAnnouncementReqVo.setUpdateTime(pmReleaseAnnouncementReqVo.getCreateTime());
|
|
|
+ return toAjax(pmDemandService.insertPmReleaseAnnouncement(pmReleaseAnnouncementReqVo));
|
|
|
+ } catch (Exception e) {
|
|
|
+ return error(e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取专家身份证号列表")
|
|
@@ -187,8 +205,14 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
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);
|
|
|
+ List<BaseExpert> baseExpertList = baseExpertService.list(lw);
|
|
|
+ List<String> idNumberList = new ArrayList<>();
|
|
|
+ if (!ObjectUtils.isEmpty(baseExpertList)) {
|
|
|
+ for(BaseExpert baseExpert :baseExpertList ){
|
|
|
+ idNumberList.add(baseExpert.getIdNumber());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return success(idNumberList);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "根据身份证号查询专家", notes = "必传 查询条件:身份证号")
|
|
@@ -221,15 +245,190 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
@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("参数错误");
|
|
|
+ public AjaxResult insertExpertBatch(@NotEmpty(message = "参数不能为空") @RequestBody PmBaseExpertFillReqVo pmBaseExpertFillReqVo) {
|
|
|
+
|
|
|
+ try {
|
|
|
+ if (ObjectUtils.isEmpty(pmBaseExpertFillReqVo)
|
|
|
+ || ObjectUtils.isEmpty(pmBaseExpertFillReqVo.getDemandId())
|
|
|
+ || ObjectUtils.isEmpty(pmBaseExpertFillReqVo.getAccessTime())
|
|
|
+ || ObjectUtils.isEmpty(pmBaseExpertFillReqVo.getBaseExpertList())) {
|
|
|
+ return error("参数错误");
|
|
|
+ }
|
|
|
+ pmBaseExpertFillReqVo.setCreateBy(getUserId().toString());
|
|
|
+ pmBaseExpertFillReqVo.setUpdateBy(pmBaseExpertFillReqVo.getCreateBy());
|
|
|
+
|
|
|
+ return toAjax(pmDemandService.insertExpertBatch(pmBaseExpertFillReqVo));
|
|
|
+ } catch (Exception e) {
|
|
|
+ return error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 抽取专家
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "抽取专家",notes = "采购需求ID必传")
|
|
|
+ @PostMapping("/extractExpertBatch")
|
|
|
+ public AjaxResult extractExpertBatch(@NotEmpty(message = "参数不能为空")
|
|
|
+ @RequestBody PmBaseExpertExtractReqVo pmBaseExpertExtractReqVo) {
|
|
|
+
|
|
|
+ try {
|
|
|
+ if (ObjectUtils.isEmpty(pmBaseExpertExtractReqVo)
|
|
|
+ || ObjectUtils.isEmpty(pmBaseExpertExtractReqVo.getDemandId())
|
|
|
+ || ObjectUtils.isEmpty(pmBaseExpertExtractReqVo.getAccessTime())) {
|
|
|
+ return error("参数错误");
|
|
|
+ }
|
|
|
+ return toAjax(pmDemandService.extractExpertBatch(pmBaseExpertExtractReqVo));
|
|
|
+ } catch (Exception e) {
|
|
|
+ return error(e.getMessage());
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "填写开标信息",notes = "采购需求ID必传")
|
|
|
+ @PostMapping("/insertBidOpeningBatch")
|
|
|
+ public AjaxResult insertBidOpeningBatch(@NotEmpty(message = "数据为空")
|
|
|
+ @RequestBody PmBidOpeningFillReqVo pmBidOpeningFillReqVo) {
|
|
|
+
|
|
|
try {
|
|
|
- return toAjax(pmDemandService.insertExpertBatch(pmBaseExpertReqVo));
|
|
|
+ if (ObjectUtils.isEmpty(pmBidOpeningFillReqVo)
|
|
|
+ || ObjectUtils.isEmpty(pmBidOpeningFillReqVo.getDemandId())
|
|
|
+ || ObjectUtils.isEmpty(pmBidOpeningFillReqVo.getPmBidOpeningList())) {
|
|
|
+ return error("参数错误");
|
|
|
+ }
|
|
|
+ pmBidOpeningFillReqVo.setCreateBy(getUserId().toString());
|
|
|
+ pmBidOpeningFillReqVo.setUpdateBy(getUserId().toString());
|
|
|
+ return toAjax(pmDemandService.insertBidOpeningBatch(pmBidOpeningFillReqVo));
|
|
|
} catch (Exception e) {
|
|
|
return error(e.getMessage());
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "中标情况填制",notes = "采购需求ID必传")
|
|
|
+ @PostMapping("/insertPmBidWinning")
|
|
|
+ public AjaxResult insertPmBidWinning(@NotEmpty(message = "数据为空")
|
|
|
+ @RequestBody PmBidWinningReqVo pmBidWinningReqVo) {
|
|
|
+ try {
|
|
|
+ Long demandId = pmBidWinningReqVo.getDemandId();
|
|
|
+ if(ObjectUtils.isEmpty(demandId)){
|
|
|
+ return error("采购需求ID不能为空");
|
|
|
+ }
|
|
|
+ pmBidWinningReqVo.setCreateBy(getUserId().toString());
|
|
|
+ pmBidWinningReqVo.setCreateTime(new Date());
|
|
|
+ pmBidWinningReqVo.setUpdateBy(pmBidWinningReqVo.getCreateBy());
|
|
|
+ pmBidWinningReqVo.setUpdateTime(pmBidWinningReqVo.getCreateTime());
|
|
|
+ return toAjax(pmDemandService.insertPmBidWinning(pmBidWinningReqVo));
|
|
|
+ } catch (Exception e) {
|
|
|
+ return error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "更换中标人",notes = "采购需求ID必传")
|
|
|
+ @PostMapping("/updatePmBidWinning")
|
|
|
+ public AjaxResult updatePmBidWinning(@NotEmpty(message = "数据为空")
|
|
|
+ @RequestBody PmBidWinningReqVo pmBidWinningReqVo) {
|
|
|
+ try {
|
|
|
+ Long demandId = pmBidWinningReqVo.getDemandId();
|
|
|
+ if(ObjectUtils.isEmpty(demandId)){
|
|
|
+ return error("采购需求ID不能为空");
|
|
|
+ }
|
|
|
+ pmBidWinningReqVo.setUpdateBy(getUserId().toString());
|
|
|
+ pmBidWinningReqVo.setUpdateTime(new Date());
|
|
|
+ return toAjax(pmDemandService.updatePmBidWinning(pmBidWinningReqVo));
|
|
|
+ } catch (Exception e) {
|
|
|
+ return error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "流标情况填制",notes = "采购需求ID必传")
|
|
|
+ @PostMapping("/insertPmBidFailure")
|
|
|
+ public AjaxResult insertPmBidFailure(@NotEmpty(message = "数据为空")
|
|
|
+ @RequestBody PmBidFailureReqVo pmBidFailureReqVo) {
|
|
|
+ try {
|
|
|
+ Long demandId = pmBidFailureReqVo.getDemandId();
|
|
|
+ if(ObjectUtils.isEmpty(demandId)){
|
|
|
+ return error("参数错误");
|
|
|
+ }
|
|
|
+ pmBidFailureReqVo.setCreateBy(getUserId().toString());
|
|
|
+ pmBidFailureReqVo.setCreateTime(new Date());
|
|
|
+ pmBidFailureReqVo.setUpdateBy(pmBidFailureReqVo.getCreateBy());
|
|
|
+ pmBidFailureReqVo.setUpdateTime(pmBidFailureReqVo.getCreateTime());
|
|
|
+ return toAjax(pmDemandService.insertPmBidFailure(pmBidFailureReqVo));
|
|
|
+ } catch (Exception e) {
|
|
|
+ return error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "质疑处理",notes = "采购需求ID必传")
|
|
|
+ @PostMapping("/handleCallQuestion")
|
|
|
+ public AjaxResult handleCallQuestion(@NotEmpty(message = "数据为空")
|
|
|
+ @RequestBody PmCallQuestionReqVo pmCallQuestionReqVo) {
|
|
|
+ try {
|
|
|
+ Long demandId = pmCallQuestionReqVo.getDemandId();
|
|
|
+ if(ObjectUtils.isEmpty(demandId)){
|
|
|
+ return error("参数错误");
|
|
|
+ }
|
|
|
+ PmDemand pmDemand = pmDemandService.getById(demandId);
|
|
|
+ if(ObjectUtils.isEmpty(pmDemand)){
|
|
|
+ return error("参数错误");
|
|
|
+ }
|
|
|
+ List<SysFileRef> sysFileRefs = pmCallQuestionReqVo.getSysFileRefs();
|
|
|
+ if(ObjectUtils.isEmpty(sysFileRefs)){
|
|
|
+ return error("参数错误");
|
|
|
+ }
|
|
|
+ if(pmDemandService.uploadFile(demandId, SysFileRefEnum.PM_BID_CALL_QEUSTION_FILE.getType(),sysFileRefs,getUserId().toString())){
|
|
|
+ pmDemand.setCallQuestion(pmCallQuestionReqVo.getCallQuestion());
|
|
|
+ pmDemand.setUpdateBy(getUserId().toString());
|
|
|
+ pmDemand.setUpdateTime(new Date());
|
|
|
+ return toAjax(pmDemandService.updateById(pmDemand));
|
|
|
+ } else {
|
|
|
+ return error("保存上传附件失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ return error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "上传中标通知书",notes = "采购需求ID和上传附件必传")
|
|
|
+ @PostMapping("/uploadBidWinningNotification")
|
|
|
+ public AjaxResult uploadBidWinningNotification(@NotEmpty(message = "数据为空") @RequestBody PmPurchaseExecutionReqVo pmPurchaseExecutionReqVo) {
|
|
|
+ Long demandId = pmPurchaseExecutionReqVo.getDemandId();
|
|
|
+ if(ObjectUtils.isEmpty(demandId)){
|
|
|
+ return error("参数错误");
|
|
|
+ }
|
|
|
+
|
|
|
+ PmDemand pmDemand = pmDemandService.getById(demandId);
|
|
|
+ if(ObjectUtils.isEmpty(pmDemand)){
|
|
|
+ return error("参数错误");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<SysFileRef> sysFileRefs = pmPurchaseExecutionReqVo.getSysFileRefs();
|
|
|
+ if(ObjectUtils.isEmpty(sysFileRefs)){
|
|
|
+ return error("参数错误");
|
|
|
+ }
|
|
|
+ if (pmDemandService.uploadFile(demandId, SysFileRefEnum.PM_BID_WINNING_NOTIFICATION.getType(),sysFileRefs,getUserId().toString())) {
|
|
|
+ PmDemand pmDemandUpdate = new PmDemand();
|
|
|
+ pmDemandUpdate.setDemandId(demandId);
|
|
|
+ pmDemandUpdate.setProjectStatus(Long.parseLong(PmProjectStatus.CONTRACT_WAIT_FILL.getCode()));
|
|
|
+ pmDemandUpdate.setUpdateTime(new Date());
|
|
|
+ pmDemandUpdate.setUpdateBy(getUserId().toString());
|
|
|
+ return success(pmDemandService.updateById(pmDemandUpdate));
|
|
|
+ } else {
|
|
|
+ return error("保存上传附件失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 查看详情
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "查看详情", notes = "必传demandId和详情类型(1项目计划,2需求建档,3任务下达,4中标信息,5合同信息,6建设情况),其他字段不传")
|
|
|
+ @PostMapping("/view")
|
|
|
+ public AjaxResult view(@RequestBody PmDemandReqVo pmDemandReqVo) {
|
|
|
+ if(pmDemandReqVo.getDemandId() == null){
|
|
|
+ return AjaxResult.error("demandId不能为空");
|
|
|
+ }
|
|
|
+ if(StringUtils.isEmpty(pmDemandReqVo.getDetailType())){
|
|
|
+ return AjaxResult.error("详情的类型不能为空");
|
|
|
+ }
|
|
|
+ return success(pmDemandService.selectPmDemandByDemandId(pmDemandReqVo.getDemandId(),pmDemandReqVo.getDetailType()));
|
|
|
}
|
|
|
}
|