刘光辉
12 小时以前 34981c30a78e8bbd7791131059a9210f9928b62c
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
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.DmsDanganCundangShenqingDanganheEntity;
import jnpf.dmsEntity.form.DmsDanganCundangJieshouCheckForm;
import jnpf.dmsEntity.form.DmsDanganCundangJieshouForm;
import jnpf.dmsService.DmsDanganCundangJieshouService;
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;
 
@Slf4j
@Tag(name = "DMS档案存档接收接口", description = "档案存档接收业务操作")
@RestController
@RequestMapping("/biz/dangan/cundang")
@RequiredArgsConstructor
public class DmsDanganCundangJieshouController {
 
    private final DmsDanganCundangJieshouService jieshouService;
 
    @Operation(summary = "接收档案存档申请中的档案盒")
    @PostMapping("/jieshou")
    public ActionResult<String> jieshou(@RequestBody(required = false) DmsDanganCundangJieshouForm form) {
        try {
            jieshouService.jieshou(form);
            return ActionResult.success("档案存档接收成功", "档案存档接收成功");
        } catch (DataException e) {
            log.warn("档案存档接收失败:{}", e.getMessage());
            return ActionResult.fail(e.getMessage());
        }
    }
 
    @Operation(summary = "校验档案盒是否可接收")
    @PostMapping("/jieshou/check")
    public ActionResult<DmsDanganCundangShenqingDanganheEntity> check(
            @RequestBody(required = false) DmsDanganCundangJieshouCheckForm form) {
        try {
            DmsDanganCundangShenqingDanganheEntity danganhe =
                    jieshouService.check(form == null ? null : form.getDanganheBianhao());
            return ActionResult.success("档案盒可接收", danganhe);
        } catch (DataException e) {
            log.warn("档案盒接收校验失败:{}", e.getMessage());
            return ActionResult.fail(e.getMessage());
        }
    }
}