package jnpf.dmsController;
|
|
import cn.dev33.satoken.annotation.SaCheckLogin;
|
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
import jakarta.validation.Valid;
|
import jnpf.base.ActionResult;
|
import jnpf.dmsEntity.banben.form.DmsWenjianBanbenQueryForm;
|
import jnpf.dmsEntity.banben.vo.DmsWenjianBanbenQueryVO;
|
import jnpf.dmsEntity.wenjianbianhao.form.DmsFlowEventForm;
|
import jnpf.dmsEntity.banben.vo.DmsWenjianZhongxinBanbenVO;
|
import jnpf.dmsService.DmsWenjianBanbenService;
|
import jnpf.exception.DataException;
|
import lombok.RequiredArgsConstructor;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
@Tag(name = "DMS文件版本控制接口")
|
@RestController
|
@SaCheckLogin
|
@RequiredArgsConstructor
|
@RequestMapping("/biz/wenjian/banben")
|
public class DmsWenjianBanbenController {
|
|
private final DmsWenjianBanbenService service;
|
private final jnpf.dmsService.DmsApprovedFlowService approvedFlow;
|
|
@Operation(summary = "按文件ID和版本号查询业务文件版本")
|
@PostMapping("/query-by-file-and-version")
|
public ActionResult<DmsWenjianBanbenQueryVO> getByWenjianIdAndBanbenhao(
|
@Valid @RequestBody DmsWenjianBanbenQueryForm form) throws DataException {
|
return ActionResult.success(service.getByWenjianIdAndBanbenhao(
|
form.getWenjianId(), form.getBanbenhao()));
|
}
|
|
/**
|
* 根据业务文件版本ID查询对应的文件中心版本ID。
|
*/
|
@Operation(summary = "查询文件中心版本ID")
|
@GetMapping("/file-versions/{fileVersionId}/file-center-version")
|
public ActionResult<DmsWenjianZhongxinBanbenVO> getWenjianZhongxinBanben(
|
@PathVariable("fileVersionId") String fileVersionId) throws DataException {
|
return ActionResult.success(service.getWenjianZhongxinBanben(fileVersionId));
|
}
|
|
@Operation(summary = "同步文件新增审核流程事件")
|
@PostMapping("/xinzeng-shenhe/flow-event")
|
public ActionResult<String> syncNewAuditFlowEvent(
|
@Valid @RequestBody DmsFlowEventForm form) throws DataException {
|
approvedFlow.sync(form, "xinzeng_shenhe");
|
return ActionResult.success("文件新增审核版本同步成功", "文件新增审核版本同步成功");
|
}
|
|
@Operation(summary = "同步文件修订审核流程事件")
|
@PostMapping("/xiuding-shenhe/flow-event")
|
public ActionResult<String> syncRevisionAuditFlowEvent(
|
@Valid @RequestBody DmsFlowEventForm form) throws DataException {
|
approvedFlow.sync(form, "xiuding_shenhe");
|
return ActionResult.success("文件修订审核版本同步成功", "文件修订审核版本同步成功");
|
}
|
|
@Operation(summary = "同步外来文件新增审核流程事件")
|
@PostMapping("/wailai-xinzeng-shenhe/flow-event")
|
public ActionResult<String> syncExternalNewAuditFlowEvent(
|
@Valid @RequestBody DmsFlowEventForm form) throws DataException {
|
approvedFlow.sync(form, "wailai_wenjian_xinzeng_shenhe");
|
return ActionResult.success("外来文件新增审核同步成功", "外来文件新增审核同步成功");
|
}
|
|
}
|