刘光辉
4 小时以前 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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.recordprint.form.DmsRecordPrintHuishouForm;
import jnpf.dmsEntity.recordprint.form.DmsRecordPrintIssueForm;
import jnpf.dmsEntity.recordprint.form.DmsRecordPrintPiliangChazhaoForm;
import jnpf.dmsEntity.recordprint.vo.DmsRecordPrintSerialVO;
import jnpf.dmsService.DmsRecordPrintService;
import jnpf.exception.DataException;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.ArrayList;
import java.util.List;
 
/**
 * DMS 记录打印流水查询接口。
 */
@Tag(name = "DMS记录打印流水查询接口", description = "根据流水号查询记录文件信息")
@RestController
@SaCheckLogin
@RequiredArgsConstructor
@RequestMapping("/biz/jilu/liushui")
public class DmsJiluLiushuiController {
 
    private final DmsRecordPrintService service;
 
    /**
     * 根据流水号查询尚未发放的打印记录和文件信息。
     *
     * @param liushuihao 打印流水号
     * @return 流水号、流水记录主键、文件名称和版本号
     * @throws DataException 流水号无效或该条码已经签收/发放
     */
    @Operation(summary = "根据流水号查询记录文件信息")
    @GetMapping("/chazhao")
    public ActionResult<DmsRecordPrintSerialVO> findBySerialNumber(
            @RequestParam("liushuihao") String liushuihao, @RequestParam("chazhao_leixing") String chazhao_leixing) throws DataException {
        return ActionResult.success(service.findBySerialNumber(liushuihao, chazhao_leixing));
    }
 
    /**
     * 根据多个流水号查询尚未发放的打印记录和文件信息。
     * @param form 请求参数
     * @return 各流水号对应的流水记录和文件信息
     * @throws DataException 流水号无效或任一条码已经签收/发放
     */
    @Operation(summary = "根据多个流水号查询记录文件信息")
    @PostMapping("/piliang-chazhao")
    public ActionResult<List<DmsRecordPrintSerialVO>> findBySerialNumbers(
            @Valid @RequestBody DmsRecordPrintPiliangChazhaoForm form) throws DataException {
        List<DmsRecordPrintSerialVO> result = new ArrayList<>(form.getLiushuihao().size());
        for (String serialNumber : form.getLiushuihao()) {
            result.add(service.findBySerialNumber(serialNumber, form.getChazhaoLeixing()));
        }
        return ActionResult.success(result);
    }
 
    /**
     * 批量发放记录打印流水,并同时登记接收信息。
     *
     * @param form 电子签名及发放明细
     * @return 发放结果
     * @throws DataException 参数无效、流水不存在或条码已经发放
     */
    @Operation(summary = "批量发放记录打印流水")
    @PostMapping("/fafang")
    public ActionResult<String> issue(
            @Valid @RequestBody DmsRecordPrintIssueForm form) throws DataException {
        service.issue(form);
        return ActionResult.success("发放成功", "发放成功");
    }
 
    /**
     * 批量发放记录打印流水,并同时登记接收信息。
     *
     * @param form 电子签名及发放明细
     * @return 发放结果
     * @throws DataException 参数无效、流水不存在或条码已经发放
     */
    @Operation(summary = "批量回收记录打印流水")
    @PostMapping("/huishou")
    public ActionResult<String> huishou(
            @Valid @RequestBody DmsRecordPrintHuishouForm form) throws DataException {
        service.huishou(form);
        return ActionResult.success("回收成功", "回收成功");
    }
}