czt
2026-02-02 124e7de0dc6dd727677fc04c53774c415e8783db
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
package com.fzzy.igds.api.v1.service;
 
import com.alibaba.fastjson.JSONObject;
import com.fzzy.igds.api.v1.data.ApiV1Req;
import com.fzzy.igds.api.v1.data.ApiV1Resp;
import com.fzzy.igds.api.v1.data.Param3032;
import com.fzzy.igds.domain.GatewaySer;
import com.fzzy.igds.service.FileService;
import com.ruoyi.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
 
/**
 * @Description 出入库抓图解析
 * @Author CZT
 * @Date 2026/1/7 11:09
 */
@Slf4j
@Component
public class ApiV1Service3032 {
 
    @Resource
    private FileService fileService;
 
    /**
     * @param req
     * @param gatewaySer
     * @return
     */
    public ApiV1Resp<Object> analysis(ApiV1Req<Object> req, GatewaySer gatewaySer) {
 
        //转化为对象
        Param3032 param = JSONObject.parseObject(JSONObject.toJSONString(req.getData()), Param3032.class);
 
        if (null == param || StringUtils.isBlank(param.getFileName()) || StringUtils.isEmpty(param.getImgBase64())) {
            return ApiV1Resp.error("抓拍信息为空,不解析!", req);
        }
 
        step1(param);
 
        return ApiV1Resp.success(null, req);
 
    }
 
    /**
     * 异步解析
     *
     * @param param
     */
    @Async
    public void step1(Param3032 param) {
 
 
        //base64转化为图片保存
        String savePath = fileService.getFileSavePath("INOUT");
        String fileName = param.getFileName();
        String filePath = savePath + fileName;
        fileService.baseImg2Disk(filePath, param.getImgBase64());
 
        log.info("质押监管接口V1,3032接口解析完成");
    }
 
}