刘光辉
117 分钟以前 06f314545ac3514d7ce28939920866ae8188d31c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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("外来文件新增审核同步成功", "外来文件新增审核同步成功");
    }
 
}