|
@@ -3,6 +3,7 @@ package com.ozs.web.controller.pm;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.ozs.common.core.domain.model.LoginUser;
|
|
|
+import com.ozs.common.utils.StringUtils;
|
|
|
import com.ozs.framework.web.service.TokenService;
|
|
|
import com.ozs.pm.doman.vo.requestVo.PmBookBuildingReqVo;
|
|
|
import com.ozs.pm.doman.vo.requestVo.PmDemandReqVo;
|
|
@@ -10,6 +11,7 @@ import com.ozs.pm.doman.vo.responseVo.PmDemandResVo;
|
|
|
import com.ozs.pm.service.IPmDemandService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import org.apache.poi.util.StringUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -47,11 +49,14 @@ public class PmDemandController extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 获取采购需求详细信息
|
|
|
+ * 查看详情
|
|
|
*/
|
|
|
- @ApiOperation(value = "获取采购需求详细信息", notes = "必传demandId,其他字段不传")
|
|
|
+ @ApiOperation(value = "查看详情", notes = "必传demandId,其他字段不传")
|
|
|
@PostMapping("/view")
|
|
|
public AjaxResult view(@RequestBody PmDemandReqVo pmDemandReqVo) {
|
|
|
+ if(pmDemandReqVo.getDemandId() == null){
|
|
|
+ return AjaxResult.error("demandId不能为空");
|
|
|
+ }
|
|
|
return success(pmDemandService.selectPmDemandByDemandId(pmDemandReqVo.getDemandId()));
|
|
|
}
|
|
|
|
|
@@ -61,6 +66,9 @@ public class PmDemandController extends BaseController {
|
|
|
@ApiOperation(value = "需求建档", notes = "必传demandId,根据项目类型必传pmDemandEngineeringResponseVo、pmDemandEquipResponseVo、pmDemandMaterialsResponseVo、pmDemandServeResponseVo")
|
|
|
@PostMapping("/bookBuilding")
|
|
|
public AjaxResult bookBuilding(@RequestBody PmBookBuildingReqVo pmBookBuildingReqVo, HttpServletRequest request) {
|
|
|
+ if(pmBookBuildingReqVo.getDemandId() == null){
|
|
|
+ return AjaxResult.error("demandId不能为空");
|
|
|
+ }
|
|
|
LoginUser loginUser = tokenService.getLoginUser(request);
|
|
|
pmBookBuildingReqVo.setUpdateBy(String.valueOf(loginUser.getUserId()));
|
|
|
return toAjax(pmDemandService.bookBuilding(pmBookBuildingReqVo));
|
|
@@ -69,6 +77,9 @@ public class PmDemandController extends BaseController {
|
|
|
@ApiOperation(value = "提交采购需求", notes = "必传demandId,其他字段不传")
|
|
|
@PostMapping("/commit")
|
|
|
public AjaxResult commit(@RequestBody PmDemandReqVo pmDemandReqVo, HttpServletRequest request) {
|
|
|
+ if(pmDemandReqVo.getDemandId() == null){
|
|
|
+ return AjaxResult.error("demandId不能为空");
|
|
|
+ }
|
|
|
LoginUser loginUser = tokenService.getLoginUser(request);
|
|
|
pmDemandReqVo.setUpdateBy(String.valueOf(loginUser.getUserId()));
|
|
|
return toAjax(pmDemandService.commit(pmDemandReqVo));
|
|
@@ -80,6 +91,9 @@ public class PmDemandController extends BaseController {
|
|
|
@ApiOperation(value = "查看流程图,获取当前阶段名字", notes = "必传demandId,其他字段不传")
|
|
|
@PostMapping("/viewFlowChart")
|
|
|
public AjaxResult viewFlowChart(@RequestBody PmDemandReqVo pmRequestVo) {
|
|
|
+ if(pmRequestVo.getDemandId() == null){
|
|
|
+ return AjaxResult.error("demandId不能为空");
|
|
|
+ }
|
|
|
return success(pmDemandService.viewFlowChart(pmRequestVo.getDemandId()));
|
|
|
}
|
|
|
|
|
@@ -89,6 +103,12 @@ public class PmDemandController extends BaseController {
|
|
|
@ApiOperation(value = "查看流程图,鼠标移到对应模块后,显示悬浮框提示", notes = "必传demandId,模块名称,其他字段不传")
|
|
|
@PostMapping("/getModuleInfo")
|
|
|
public AjaxResult getModuleInfo(@RequestBody PmDemandReqVo pmRequestVo) {
|
|
|
+ if(pmRequestVo.getDemandId() == null){
|
|
|
+ return AjaxResult.error("demandId不能为空");
|
|
|
+ }
|
|
|
+ if(pmRequestVo.getModuleName() == null){
|
|
|
+ return AjaxResult.error("模块名称不能为空");
|
|
|
+ }
|
|
|
return success(pmDemandService.getModuleInfo(pmRequestVo.getDemandId(),pmRequestVo.getModuleName()));
|
|
|
}
|
|
|
|
|
@@ -106,6 +126,12 @@ public class PmDemandController extends BaseController {
|
|
|
@ApiOperation(value = "审核采购需求通过", notes = "必传demandId和上传附件,其他字段不传")
|
|
|
@PostMapping("/reviewTo")
|
|
|
public AjaxResult reviewTo(@RequestBody PmDemandReqVo pmDemandReqVo, HttpServletRequest request) {
|
|
|
+ if(pmDemandReqVo.getDemandId() == null){
|
|
|
+ return AjaxResult.error("demandId不能为空");
|
|
|
+ }
|
|
|
+ if(pmDemandReqVo.getSysFileRefs() == null || pmDemandReqVo.getSysFileRefs().size() == 0){
|
|
|
+ return AjaxResult.error("上传附件不能为空");
|
|
|
+ }
|
|
|
LoginUser loginUser = tokenService.getLoginUser(request);
|
|
|
pmDemandReqVo.setUpdateBy(String.valueOf(loginUser.getUserId()));
|
|
|
return toAjax(pmDemandService.reviewTo(pmDemandReqVo));
|
|
@@ -114,6 +140,12 @@ public class PmDemandController extends BaseController {
|
|
|
@ApiOperation(value = "审核采购需求退回", notes = "必传demandId和退回原因,其他字段不传")
|
|
|
@PostMapping("/reviewReturn")
|
|
|
public AjaxResult reviewReturn(@RequestBody PmDemandReqVo pmDemandReqVo, HttpServletRequest request) {
|
|
|
+ if(pmDemandReqVo.getDemandId() == null){
|
|
|
+ return AjaxResult.error("demandId不能为空");
|
|
|
+ }
|
|
|
+ if(StringUtils.isEmpty(pmDemandReqVo.getRefuseReason())){
|
|
|
+ return AjaxResult.error("退回原因不能为空");
|
|
|
+ }
|
|
|
LoginUser loginUser = tokenService.getLoginUser(request);
|
|
|
pmDemandReqVo.setUpdateBy(String.valueOf(loginUser.getUserId()));
|
|
|
return toAjax(pmDemandService.reviewReturn(pmDemandReqVo));
|