Commit f37a11b3 authored by wei's avatar wei 🎱

文档提交审阅启动流程

parent 3f96fec0
...@@ -130,6 +130,12 @@ public class Constants { ...@@ -130,6 +130,12 @@ public class Constants {
* 编制 * 编制
*/ */
public static final String EDIT = "edit"; public static final String EDIT = "edit";
/**
* 待审阅
*/
public static final String SUBMIT_REVIEWING = "submitReviewing";
/** /**
* 修改中 * 修改中
*/ */
......
...@@ -34,6 +34,12 @@ public class ExtDxDocumentController<V extends DxDocumentVO, S extends ExtDxDocu ...@@ -34,6 +34,12 @@ public class ExtDxDocumentController<V extends DxDocumentVO, S extends ExtDxDocu
return ApiResult.ok(service.getDocAndFolder(dxContextId, parentId,dxDocumentFolderId), "查询成功"); return ApiResult.ok(service.getDocAndFolder(dxContextId, parentId,dxDocumentFolderId), "查询成功");
} }
@ApiOperation("发起审批流程")
@PostMapping({"startWorkflow"})
public ApiResult startWorkflow(@RequestParam("id") Long id) {
return ApiResult.ok(service.startWorkflow(id), "操作完成");
}
// //
// /** // /**
// * 自动任务 这块弃用 // * 自动任务 这块弃用
......
...@@ -30,4 +30,12 @@ public interface ExtDxDocumentService<V extends DxDocumentVO> extends ExtDxDocum ...@@ -30,4 +30,12 @@ public interface ExtDxDocumentService<V extends DxDocumentVO> extends ExtDxDocum
* @return * @return
*/ */
DxDocumentVO generateCatalog(Long docId); DxDocumentVO generateCatalog(Long docId);
/**
* 流程启动
*
* @param id
* @return
*/
DxDocumentVO startWorkflow(Long id);
} }
...@@ -11,14 +11,17 @@ import com.inet.dcs.document.core.excel.ExtCatalogExcelVO; ...@@ -11,14 +11,17 @@ import com.inet.dcs.document.core.excel.ExtCatalogExcelVO;
import com.inet.dcs.document.core.service.ExtDxDocumentFolderService; import com.inet.dcs.document.core.service.ExtDxDocumentFolderService;
import com.inet.dcs.document.core.service.expand.ExtDxDocumentService; import com.inet.dcs.document.core.service.expand.ExtDxDocumentService;
import com.inet.dcs.document.core.util.*; import com.inet.dcs.document.core.util.*;
import com.yonde.dcs.plan.common.vo.ExtSupplierManageVO;
import com.yonde.dex.basedata.data.search.SearchItem; import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchItems; import com.yonde.dex.basedata.data.search.SearchItems;
import com.yonde.dex.basedata.data.search.SearchQueryBuilder; import com.yonde.dex.basedata.data.search.SearchQueryBuilder;
import com.yonde.dex.basedata.data.search.SearchQueryCondition; import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.data.DxPageImpl; import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.basedata.entity.data.OperatorType; import com.yonde.dex.basedata.entity.data.OperatorType;
import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.dfs.feign.FileManagerFeignService; import com.yonde.dex.dfs.feign.FileManagerFeignService;
import com.yonde.dex.dfs.vo.RepoFileVO; import com.yonde.dex.dfs.vo.RepoFileVO;
import com.yonde.dex.wfc.feign.api.WfcProcessFeign;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import org.springframework.mock.web.MockMultipartFile; import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -59,6 +62,9 @@ public class ExtDxDocumentServiceImpl<V extends DxDocumentVO> extends DocumentSe ...@@ -59,6 +62,9 @@ public class ExtDxDocumentServiceImpl<V extends DxDocumentVO> extends DocumentSe
@Autowired @Autowired
private FileManagerFeignService fileManagerFeignService; private FileManagerFeignService fileManagerFeignService;
@Autowired
private WfcProcessFeign wfcProcessFeign;
@Override @Override
public void beforeSave(Collection<V> target) { public void beforeSave(Collection<V> target) {
for (V v : target) { for (V v : target) {
...@@ -81,6 +87,19 @@ public class ExtDxDocumentServiceImpl<V extends DxDocumentVO> extends DocumentSe ...@@ -81,6 +87,19 @@ public class ExtDxDocumentServiceImpl<V extends DxDocumentVO> extends DocumentSe
} }
} }
@Override
public DxDocumentVO startWorkflow(Long id) {
DxDocumentVO dxDocumentVO = this.get(id);
if (dxDocumentVO == null) {
throw new DxBusinessException("500", "获取不到对象");
}
if (!dxDocumentVO.getState().equals("edit")) {
throw new DxBusinessException("500", "该对象不是编制状态");
}
wfcProcessFeign.startProcessByKey("ExtDocWF", dxDocumentVO);
return this.changeStatus(dxDocumentVO.getId(), Constants.SUBMIT_REVIEWING, true);
}
@Override @Override
public Map<String, DxPageImpl> getDocAndFolder(Long dxContextId, Long parentId,Long dxDocumentFolderId) { public Map<String, DxPageImpl> getDocAndFolder(Long dxContextId, Long parentId,Long dxDocumentFolderId) {
Map<String, DxPageImpl> result = new HashMap<>(); Map<String, DxPageImpl> result = new HashMap<>();
......
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