Commit 9beea6e7 authored by wangyangyang's avatar wangyangyang

设计评审:通知+意见 手动启流程接口

parent d3e10e30
......@@ -29,6 +29,15 @@ import org.springframework.stereotype.Controller;
@BasePermission("DCS-REVIEW:ExtDesignReviewNotice")
public class ExtDesignReviewNoticeController<V extends ExtDesignReviewNoticeVO, S extends ExtDesignReviewNoticeService<V>> extends ExtDesignReviewNoticeControllerShadow<V, S> {
@Autowired
private ExtDesignReviewNoticeService extDesignReviewNoticeService;
@ApiOperation("发起审批流程")
@PostMapping({"startWorkflow"})
public ApiResult startWorkflow(@RequestParam("id") Long id) {
return ApiResult.ok(extDesignReviewNoticeService.startWorkflow(id), "流程启动成功");
}
}
......
package com.inet.dcs.document.core.controller;
import com.inet.dcs.document.core.service.ExtDesignReviewNoticeService;
import org.springframework.stereotype.Controller;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
......@@ -27,6 +28,14 @@ import org.springframework.stereotype.Controller;
@Controller(ExtReviewFeedbackController.BEAN_NAME)
public class ExtReviewFeedbackController<V extends ExtReviewFeedbackVO, S extends ExtReviewFeedbackService<V>> extends ExtReviewFeedbackControllerShadow<V, S> {
@Autowired
private ExtReviewFeedbackService extReviewFeedbackService;
@ApiOperation("发起审批流程")
@PostMapping({"startWorkflow"})
public ApiResult startWorkflow(@RequestParam("id") Long id) {
return ApiResult.ok(extReviewFeedbackService.startWorkflow(id), "流程启动成功");
}
}
......
......@@ -10,4 +10,5 @@ import com.inet.dcs.document.core.service.shadow.ExtDesignReviewNoticeServiceSha
**/
public interface ExtDesignReviewNoticeService<V extends ExtDesignReviewNoticeVO> extends ExtDesignReviewNoticeServiceShadow<V> {
ExtDesignReviewNoticeVO startWorkflow(Long id);
}
......@@ -10,4 +10,5 @@ import com.inet.dcs.document.core.service.shadow.ExtReviewFeedbackServiceShadow;
**/
public interface ExtReviewFeedbackService<V extends ExtReviewFeedbackVO> extends ExtReviewFeedbackServiceShadow<V> {
ExtReviewFeedbackVO startWorkflow(Long id);
}
package com.inet.dcs.document.core.service.impl;
import com.inet.dcs.document.common.vo.ExtTransferDocumentVO;
import com.inet.dcs.document.core.constants.Constants;
import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.wfc.feign.api.WfcProcessFeign;
import org.springframework.stereotype.Service;
import io.swagger.annotations.ApiOperation;
import java.util.List;
......@@ -7,6 +11,7 @@ import com.inet.dcs.document.common.vo.ExtDesignReviewNoticeVO;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Autowired;
import lombok.extern.slf4j.Slf4j;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import com.inet.dcs.document.core.service.ExtDesignReviewNoticeService;
import com.inet.dcs.document.core.repository.ExtDesignReviewNoticeRepository;
......@@ -29,6 +34,33 @@ public class ExtDesignReviewNoticeServiceImpl<V extends ExtDesignReviewNoticeVO>
@Autowired
ExtDesignReviewNoticeRepository<ExtDesignReviewNotice> extDesignReviewNoticeRepository;
@Autowired
private WfcProcessFeign wfcProcessFeign;
private static final String START_PROCESS_BY_KEY = "ExtDesignReviewNoticeWF";
/**
* 沟通确认后 在待审阅 pendingReview 节点启动流程(第一个节点) 先启动,后修改状态 审阅中 Reviewing
* @param id
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
public ExtDesignReviewNoticeVO startWorkflow(Long id) {
ExtDesignReviewNoticeVO extDesignReviewNoticeVO = this.get(id);
if (extDesignReviewNoticeVO == null) {
throw new DxBusinessException("500", "获取不到对象");
}
if (!extDesignReviewNoticeVO.getState().equals(Constants.PENDING_REVIEW)) {
throw new DxBusinessException("500", "该对象不是待审阅状态");
}
wfcProcessFeign.startProcessByKey(START_PROCESS_BY_KEY, extDesignReviewNoticeVO);
return this.changeStatus(extDesignReviewNoticeVO.getId(), Constants.REVIEWING, true);
}
}
package com.inet.dcs.document.core.service.impl;
import com.inet.dcs.document.common.vo.ExtDesignReviewNoticeVO;
import com.inet.dcs.document.core.constants.Constants;
import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.wfc.feign.api.WfcProcessFeign;
import org.springframework.stereotype.Service;
import io.swagger.annotations.ApiOperation;
import java.util.List;
......@@ -7,6 +11,7 @@ import com.inet.dcs.document.common.vo.ExtReviewFeedbackVO;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Autowired;
import lombok.extern.slf4j.Slf4j;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import com.inet.dcs.document.core.service.ExtReviewFeedbackService;
import com.inet.dcs.document.core.repository.ExtReviewFeedbackRepository;
......@@ -29,6 +34,32 @@ public class ExtReviewFeedbackServiceImpl<V extends ExtReviewFeedbackVO> impleme
@Autowired
ExtReviewFeedbackRepository<ExtReviewFeedback> extReviewFeedbackRepository;
@Autowired
private WfcProcessFeign wfcProcessFeign;
private static final String START_PROCESS_BY_KEY = "ExtReviewFeedbackWF";
/**
* 沟通确认后 在待审阅 pendingReview 节点启动流程(第一个节点) 先启动,后修改状态 审阅中 Reviewing
* @param id
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
public ExtReviewFeedbackVO startWorkflow(Long id) {
ExtReviewFeedbackVO extReviewFeedbackVO = this.get(id);
if (extReviewFeedbackVO == null) {
throw new DxBusinessException("500", "获取不到对象");
}
if (!extReviewFeedbackVO.getState().equals(Constants.PENDING_REVIEW)) {
throw new DxBusinessException("500", "该对象不是待审阅状态");
}
wfcProcessFeign.startProcessByKey(START_PROCESS_BY_KEY, extReviewFeedbackVO);
return this.changeStatus(extReviewFeedbackVO.getId(), Constants.REVIEWING, true);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment