刘光辉
118 分钟以前 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
package jnpf.dmsController;
 
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.dmsEntity.form.DmsDanganCundangDanganhePrintCallbackForm;
import jnpf.dmsService.DmsDanganCundangDanganhePrintCallbackService;
import jnpf.exception.DataException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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.RestController;
 
import java.util.List;
 
@Slf4j
@Tag(name = "DMS档案盒打印回调接口", description = "档案盒打印完成后的状态更新")
@RestController
@RequestMapping("/biz/dangan/cundang/danganhe")
@RequiredArgsConstructor
public class DmsDanganCundangDanganhePrintCallbackController {
 
    private final DmsDanganCundangDanganhePrintCallbackService printCallbackService;
 
    @Operation(summary = "档案盒打印回调")
    @PostMapping("/print-callback")
    public ActionResult<String> printCallback(
            @RequestBody(required = false) List<DmsDanganCundangDanganhePrintCallbackForm> danganheList) {
        try {
            printCallbackService.markPrinted(danganheList);
            return ActionResult.success("档案盒打印状态更新成功", "档案盒打印状态更新成功");
        } catch (DataException e) {
            log.warn("档案盒打印回调失败:{}", e.getMessage());
            return ActionResult.fail(e.getMessage());
        }
    }
}