Commit b8da9e82 authored by wei's avatar wei 🎱

移交单归档流程发起接口

parent f6c1edd0
...@@ -28,6 +28,14 @@ import org.springframework.stereotype.Controller; ...@@ -28,6 +28,14 @@ import org.springframework.stereotype.Controller;
public class ExtTransferDocumentController<V extends ExtTransferDocumentVO, S extends ExtTransferDocumentService<V>> extends ExtTransferDocumentControllerShadow<V, S> { public class ExtTransferDocumentController<V extends ExtTransferDocumentVO, S extends ExtTransferDocumentService<V>> extends ExtTransferDocumentControllerShadow<V, S> {
@Autowired
private ExtTransferDocumentService extTransferDocumentService;
@ApiOperation("发起审批流程")
@PostMapping({"startWorkflow"})
public ApiResult startWorkflow(@RequestParam("id") Long id) {
return ApiResult.ok(extTransferDocumentService.startWorkflow(id), "流程启动成功");
}
} }
...@@ -10,4 +10,5 @@ import com.inet.dcs.document.core.service.shadow.ExtTransferDocumentServiceShado ...@@ -10,4 +10,5 @@ import com.inet.dcs.document.core.service.shadow.ExtTransferDocumentServiceShado
**/ **/
public interface ExtTransferDocumentService<V extends ExtTransferDocumentVO> extends ExtTransferDocumentServiceShadow<V> { public interface ExtTransferDocumentService<V extends ExtTransferDocumentVO> extends ExtTransferDocumentServiceShadow<V> {
ExtTransferDocumentVO startWorkflow(Long id);
} }
package com.inet.dcs.document.core.service.impl; package com.inet.dcs.document.core.service.impl;
import org.springframework.stereotype.Service;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import com.inet.dcs.document.common.vo.ExtTransferDocumentVO; import com.inet.dcs.document.common.vo.ExtTransferDocumentVO;
import org.springframework.beans.factory.annotation.Qualifier; import com.inet.dcs.document.core.constants.Constants;
import org.springframework.beans.factory.annotation.Autowired;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import com.inet.dcs.document.core.service.ExtTransferDocumentService;
import com.inet.dcs.document.core.repository.ExtTransferDocumentRepository; import com.inet.dcs.document.core.repository.ExtTransferDocumentRepository;
import com.inet.dcs.document.core.service.ExtTransferDocumentService;
import com.inet.dcs.document.entity.po.ExtTransferDocument; import com.inet.dcs.document.entity.po.ExtTransferDocument;
import javax.annotation.Resource; import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.wfc.feign.api.WfcProcessFeign;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/** /**
* @description: ExtTransferDocument-ServiceImpl * @description: ExtTransferDocument-ServiceImpl
* @author: dexadmin * @author: dexadmin
* @version: V * @version: V
* @date: 2024-10-29 10:30:50 * @date: 2024-10-29 10:30:50
**/ **/
@Slf4j @Slf4j
@Service(ExtTransferDocumentServiceImpl.BEAN_NAME) @Service(ExtTransferDocumentServiceImpl.BEAN_NAME)
public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> implements ExtTransferDocumentService<V>{ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> implements ExtTransferDocumentService<V> {
public static final String BEAN_NAME = "extTransferDocumentServiceImpl"; public static final String BEAN_NAME = "extTransferDocumentServiceImpl";
...@@ -29,6 +27,23 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp ...@@ -29,6 +27,23 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
@Autowired @Autowired
ExtTransferDocumentRepository<ExtTransferDocument> extTransferDocumentRepository; ExtTransferDocumentRepository<ExtTransferDocument> extTransferDocumentRepository;
@Autowired
private WfcProcessFeign wfcProcessFeign;
private static final String START_PROCESS_BY_KEY = "ExtTransferDocWF";
@Override
public ExtTransferDocumentVO startWorkflow(Long id) {
ExtTransferDocumentVO extTransferDocumentVO = this.get(id);
if (extTransferDocumentVO == null) {
throw new DxBusinessException("500", "获取不到对象");
}
if (!extTransferDocumentVO.getState().equals(Constants.EDIT)) {
throw new DxBusinessException("500", "该对象不是编制状态");
}
wfcProcessFeign.startProcessByKey(START_PROCESS_BY_KEY, extTransferDocumentVO);
return this.changeStatus(extTransferDocumentVO.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