Commit d3e10e30 authored by wei's avatar wei 🎱

发起借阅单流程接口

parent 375364b9
......@@ -27,6 +27,14 @@ import org.springframework.stereotype.Controller;
@Controller(ExtBorrowingFormController.BEAN_NAME)
public class ExtBorrowingFormController<V extends ExtBorrowingFormVO, S extends ExtBorrowingFormService<V>> extends ExtBorrowingFormControllerShadow<V, S> {
@Autowired
private ExtBorrowingFormService extBorrowingFormService;
@ApiOperation("发起审批流程")
@PostMapping({"startWorkflow"})
public ApiResult startWorkflow(@RequestParam("id") Long id) {
return ApiResult.ok(extBorrowingFormService.startWorkflow(id), "流程启动成功");
}
}
......
......@@ -10,4 +10,5 @@ import com.inet.dcs.document.core.service.shadow.ExtBorrowingFormServiceShadow;
**/
public interface ExtBorrowingFormService<V extends ExtBorrowingFormVO> extends ExtBorrowingFormServiceShadow<V> {
ExtBorrowingFormVO 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;
......@@ -29,6 +33,23 @@ public class ExtBorrowingFormServiceImpl<V extends ExtBorrowingFormVO> implement
@Autowired
ExtBorrowingFormRepository<ExtBorrowingForm> extBorrowingFormRepository;
@Autowired
private WfcProcessFeign wfcProcessFeign;
private static final String START_PROCESS_BY_KEY = "ExtBorrowingFormWF";
@Override
public ExtBorrowingFormVO startWorkflow(Long id) {
ExtBorrowingFormVO extBorrowingFormVO = this.get(id);
if (extBorrowingFormVO == null) {
throw new DxBusinessException("500", "获取不到对象");
}
if (!extBorrowingFormVO.getState().equals(Constants.EDIT)) {
throw new DxBusinessException("500", "该对象不是编制状态");
}
wfcProcessFeign.startProcessByKey(START_PROCESS_BY_KEY, extBorrowingFormVO);
return this.changeStatus(extBorrowingFormVO.getId(), Constants.SUBMIT_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