|
@@ -50,6 +50,8 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
@Autowired
|
|
|
private IPmDemandService pmDemandService;
|
|
|
@Autowired
|
|
|
+ private PmDemandHisService pmDemandHisService;
|
|
|
+ @Autowired
|
|
|
private BaseAgencyService baseAgencyService;
|
|
|
@Autowired
|
|
|
private BaseExpertService baseExpertService;
|
|
@@ -113,7 +115,8 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
public AjaxResult selectAgency(@NotEmpty(message = "采购需求ID不能为空")
|
|
|
@RequestParam(value = "demandId", required = true) Long demandId,
|
|
|
@NotEmpty(message = "代理机构ID不能为空")
|
|
|
- @RequestParam(value = "agencyId", required = true) Long agencyId) {
|
|
|
+ @RequestParam(value = "agencyId", required = true) Long agencyId,
|
|
|
+ @RequestParam(value = "purchaseTaskDocumentNumber", required = false) String purchaseTaskDocumentNumber) {
|
|
|
|
|
|
PmDemand pmDemand = pmDemandService.getById(demandId);
|
|
|
if(ObjectUtils.isEmpty(pmDemand)){
|
|
@@ -127,6 +130,7 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
pmDemandUpdate.setDemandId(demandId);
|
|
|
pmDemandUpdate.setProjectStatus(PmProjectStatus.EXPERT_FEEDBACK.getCode());
|
|
|
pmDemandUpdate.setAgencyId(agencyId);
|
|
|
+ pmDemandUpdate.setPurchaseTaskDocumentNumber(purchaseTaskDocumentNumber);
|
|
|
pmDemandUpdate.setExtractAgencyTime(new Date());
|
|
|
pmDemandUpdate.setUpdateTime(pmDemandUpdate.getExtractAgencyTime());
|
|
|
pmDemandUpdate.setUpdateBy(getUserId().toString());
|
|
@@ -141,7 +145,8 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('pm:purchaseExecution:extractAgency')")
|
|
|
@Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.UPDATE)
|
|
|
public AjaxResult extractAgency(@NotEmpty(message = "采购需求id不能为空")
|
|
|
- @RequestParam(value = "demandId", required = true) Long demandId) {
|
|
|
+ @RequestParam(value = "demandId", required = true) Long demandId,
|
|
|
+ @RequestParam(value = "purchaseTaskDocumentNumber", required = false) String purchaseTaskDocumentNumber) {
|
|
|
|
|
|
PmDemand pmDemand = pmDemandService.getById(demandId);
|
|
|
if(ObjectUtils.isEmpty(pmDemand)){
|
|
@@ -161,6 +166,7 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
pmDemandUpdate.setDemandId(demandId);
|
|
|
pmDemandUpdate.setProjectStatus(PmProjectStatus.EXPERT_FEEDBACK.getCode());
|
|
|
pmDemandUpdate.setAgencyId(any.getId());
|
|
|
+ pmDemandUpdate.setPurchaseTaskDocumentNumber(purchaseTaskDocumentNumber);
|
|
|
pmDemandUpdate.setExtractAgencyTime(new Date());
|
|
|
pmDemandUpdate.setUpdateTime(pmDemandUpdate.getExtractAgencyTime());
|
|
|
pmDemandUpdate.setUpdateBy(getUserId().toString());
|
|
@@ -274,10 +280,15 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
if(ObjectUtils.isEmpty(pmDemand)){
|
|
|
return error("参数错误");
|
|
|
}
|
|
|
-
|
|
|
+ if("1".equals(pmCallQuestionReqVo.getCallQuestion())) { //有质疑
|
|
|
+ if (ObjectUtils.isEmpty(pmCallQuestionReqVo.getCallQuestionTime())) {
|
|
|
+ return error("质疑时间不能为空");
|
|
|
+ }
|
|
|
+ }
|
|
|
PmCallQuestion pmCallQuestion = new PmCallQuestion();
|
|
|
BeanUtils.copyProperties(pmCallQuestionReqVo,pmCallQuestion);
|
|
|
pmCallQuestion.setType("0");
|
|
|
+
|
|
|
if(pmCallQuestionService.save(pmCallQuestion)) {
|
|
|
if("1".equals(pmCallQuestion.getCallQuestion())) { //有质疑
|
|
|
List<SysFileRef> sysFileRefs = pmCallQuestionReqVo.getSysFileRefs();
|
|
@@ -531,6 +542,11 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
if(ObjectUtils.isEmpty(pmDemand)){
|
|
|
return error("参数错误");
|
|
|
}
|
|
|
+ if("1".equals(pmCallQuestionReqVo.getCallQuestion())) { //有质疑
|
|
|
+ if (ObjectUtils.isEmpty(pmCallQuestionReqVo.getCallQuestionTime())) {
|
|
|
+ return error("质疑时间不能为空");
|
|
|
+ }
|
|
|
+ }
|
|
|
LambdaQueryWrapper<PmBidFailure> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
lambdaQueryWrapper.eq(PmBidFailure::getDemandId,pmDemand.getDemandId())
|
|
|
.orderByDesc(PmBidFailure::getBidFailureTime)
|
|
@@ -542,12 +558,9 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
PmBidFailure bidFailureUpdate = new PmBidFailure();
|
|
|
bidFailureUpdate.setId(bidFailure.getId());
|
|
|
bidFailureUpdate.setCallQuestion(pmCallQuestionReqVo.getCallQuestion());
|
|
|
+ bidFailureUpdate.setCallQuestionTime(pmCallQuestionReqVo.getCallQuestionTime());
|
|
|
+
|
|
|
if("1".equals(bidFailureUpdate.getCallQuestion())){ //有质疑
|
|
|
- if(!ObjectUtils.isEmpty(pmCallQuestionReqVo.getCallQuestionTime())){
|
|
|
- bidFailureUpdate.setCallQuestionTime(pmCallQuestionReqVo.getCallQuestionTime());
|
|
|
- } else {
|
|
|
- bidFailureUpdate.setCallQuestionTime(new Date());
|
|
|
- }
|
|
|
List<SysFileRef> sysFileRefs = pmCallQuestionReqVo.getSysFileRefs();
|
|
|
pmDemandService.uploadFile(bidFailureUpdate.getId(), SysFileRefEnum.PM_BID_FAILURE_CALL_QUESTION.getType(),sysFileRefs,getUserId().toString());
|
|
|
}
|
|
@@ -568,19 +581,7 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
public AjaxResult returnBidFailure(@NotEmpty(message = "采购需求id不能为空")
|
|
|
@RequestParam(value = "demandId", required = true) Long demandId) {
|
|
|
try {
|
|
|
- PmDemand pmDemand = pmDemandService.getById(demandId);
|
|
|
- if(ObjectUtils.isEmpty(pmDemand)){
|
|
|
- return error("参数错误");
|
|
|
- }
|
|
|
- //TODO 把相关表数据存入历史表,清空相关表数据
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- pmDemand.setProjectStatus(PmProjectStatus.WASTE_BID_RETURN.getCode());
|
|
|
- pmDemand.setUpdateBy(getUserId().toString());
|
|
|
- pmDemand.setUpdateTime(new Date());
|
|
|
- return toAjax(pmDemandService.updateById(pmDemand));
|
|
|
-
|
|
|
+ return toAjax(pmDemandHisService.returnBidFailure(demandId, getUserId().toString()));
|
|
|
} catch (Exception e) {
|
|
|
return error(e.getMessage());
|
|
|
}
|
|
@@ -601,17 +602,14 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
if(ObjectUtils.isEmpty(pmDemand)){
|
|
|
return error("参数错误");
|
|
|
}
|
|
|
-
|
|
|
+ if("1".equals(pmCallQuestionReqVo.getCallQuestion())) { //有质疑
|
|
|
+ if (ObjectUtils.isEmpty(pmCallQuestionReqVo.getCallQuestionTime())) {
|
|
|
+ return error("质疑时间不能为空");
|
|
|
+ }
|
|
|
+ }
|
|
|
PmCallQuestion pmCallQuestion = new PmCallQuestion();
|
|
|
BeanUtils.copyProperties(pmCallQuestionReqVo,pmCallQuestion);
|
|
|
pmCallQuestion.setType("1");
|
|
|
- if("1".equals(pmCallQuestion.getCallQuestion())) { //有质疑
|
|
|
- if (!ObjectUtils.isEmpty(pmCallQuestionReqVo.getCallQuestionTime())) {
|
|
|
- pmCallQuestion.setCallQuestionTime(pmCallQuestionReqVo.getCallQuestionTime());
|
|
|
- } else {
|
|
|
- pmCallQuestion.setCallQuestionTime(new Date());
|
|
|
- }
|
|
|
- }
|
|
|
if(pmCallQuestionService.save(pmCallQuestion)) {
|
|
|
if("1".equals(pmCallQuestion.getCallQuestion())) { //有质疑
|
|
|
List<SysFileRef> sysFileRefs = pmCallQuestionReqVo.getSysFileRefs();
|
|
@@ -677,6 +675,31 @@ public class PmPurchaseExecutionController extends BaseController {
|
|
|
return success(pmDemandService.selectPmDemandByDemandId(pmDemandReqVo.getDemandId(),pmDemandReqVo.getDetailType()));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查看历史详情
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "查看详情", notes = "必传demandId和详情类型(1项目计划,2需求建档,3任务下达,4中标信息,5合同信息,6建设情况),returnOrderNumber(回退序号,0当前/1第一次回退/2第二次回退...),其他字段不传")
|
|
|
+ @PostMapping("/view")
|
|
|
+ @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:view')")
|
|
|
+ @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.QUERY)
|
|
|
+ public AjaxResult viewHis(@RequestBody PmDemandReqVo pmDemandReqVo) {
|
|
|
+ if(pmDemandReqVo.getDemandId() == null){
|
|
|
+ return AjaxResult.error("demandId不能为空");
|
|
|
+ }
|
|
|
+ if(ObjectUtils.isEmpty(pmDemandReqVo.getDetailType())){
|
|
|
+ return AjaxResult.error("详情的类型不能为空");
|
|
|
+ }
|
|
|
+ if(ObjectUtils.isEmpty(pmDemandReqVo.getReturnOrderNumber())){
|
|
|
+ return AjaxResult.error("回退序号不能为空");
|
|
|
+ }
|
|
|
+ if(0 == pmDemandReqVo.getReturnOrderNumber()){
|
|
|
+ return view(pmDemandReqVo);
|
|
|
+ } else {
|
|
|
+ return success(pmDemandHisService.selectPmDemandHisByDemandId(pmDemandReqVo.getDemandId(),pmDemandReqVo.getDetailType(),pmDemandReqVo.getReturnOrderNumber()));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 专家信息查看详情列表
|
|
|
*/
|