WS
2023-09-07 99eb091857a72a0defd0a5bdd2185d1d2d8da573
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
package com.fzzy.otherview.gd2022.pr;
 
import com.alibaba.fastjson.JSONObject;
import com.bstek.dorado.annotation.DataProvider;
import com.fzzy.api.entity.ApiInfoData;
import com.fzzy.api.service.ApiCommonService;
import com.fzzy.api.service.ApiPushManager;
import com.fzzy.api.view.repository.ApiInfoDataRep;
import com.fzzy.otherview.gd2022.dto.GdApi1023;
import com.fzzy.otherview.gd2022.dto.GdApi1023Dtl;
import com.fzzy.otherview.gd2022.dto.GdApi1023People;
import com.fzzy.otherview.gd2022.dto.GdApi1023Way;
import com.fzzy.otherview.whhpjl.WhjlConstant;
import com.fzzy.otherview.whhpjl.dto.WhjlApi1101;
import com.fzzy.push.gd2022.ApiCodeConstant;
import org.apache.commons.lang.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
import java.util.*;
 
/**
 * 广东省接口-1023 熏蒸备案
 *
 * @author czt
 * @date 2023/8/17
 */
@Component(value = "gDApi1023PR")
public class GDApi1023PR {
 
    @Autowired
    private ApiCommonService apiCommonService;
    @Autowired
    private ApiPushManager apiPushManager;
    @Autowired
    private ApiInfoDataRep apiInfoDataRep;
 
    /**
     * 获取熏蒸备案主表信息
     * gDApi1023PR#listData
     *
     * @return
     */
    @DataProvider
    public List<GdApi1023> listData(Map<String, Object> param) {
 
        List<ApiInfoData> result = apiInfoDataRep.getDataByInteId(ApiCodeConstant.API_1023);
        if(null == result ||result.isEmpty()){
            return null;
        }
        List<GdApi1023> list = new ArrayList<>();
        GdApi1023 gbApi1023;
        for (ApiInfoData infoData : result) {
            GdApi1023 gdApi1023= JSONObject.parseObject(infoData.getData(), GdApi1023.class);
            list.add(gdApi1023);
        }
        return list;
    }
 
    /**
     * 获取熏蒸作业人员信息表
     * gDApi1023PR#peopleList
     *
     */
    @DataProvider
    public List<GdApi1023People> peopleList(Map<String, Object> param) throws Exception {
        String xzbm = (String) param.get("xzbm");
        String deptId = (String) param.get("deptId");
        String tbrq = DateFormatUtils.format((Date) param.get("tbrq"), "yyyyMMdd");
        String id = xzbm + deptId + tbrq;
 
        List<ApiInfoData> infoData = apiInfoDataRep.getDataByDataId(id);
        if(null == infoData || infoData.isEmpty()){
            return null;
        }
        GdApi1023 gdApi1023= JSONObject.parseObject(infoData.get(0).getData(), GdApi1023.class);
        if(null == gdApi1023){
            return null;
        }
 
        return gdApi1023.getPeoples();
    }
 
    /**
     * 获取熏蒸备案方式表表信息
     * gDApi1023PR#wayList
     *
     */
    @DataProvider
    public List<GdApi1023Way> wayList(Map<String, Object> param) throws Exception {
        String xzbm = (String) param.get("xzbm");
        String deptId = (String) param.get("deptId");
        String tbrq = DateFormatUtils.format((Date) param.get("tbrq"), "yyyyMMdd");
        String id = xzbm + deptId + tbrq;
 
        List<ApiInfoData> infoData = apiInfoDataRep.getDataByDataId(id);
        if(null == infoData || infoData.isEmpty()){
            return null;
        }
        GdApi1023 gdApi1023= JSONObject.parseObject(infoData.get(0).getData(), GdApi1023.class);
        if(null == gdApi1023){
            return null;
        }
 
        return gdApi1023.getWays();
    }
 
    /**
     * 实施熏蒸作业的储粮粮情明细表
     * gDApi1023PR#dtlList
     *
     */
    @DataProvider
    public List<GdApi1023Dtl> dtlList(Map<String, Object> param) throws Exception {
        String xzbm = (String) param.get("xzbm");
        String deptId = (String) param.get("deptId");
        String tbrq = DateFormatUtils.format((Date) param.get("tbrq"), "yyyyMMdd");
        String id = xzbm + deptId + tbrq;
 
        List<ApiInfoData> infoData = apiInfoDataRep.getDataByDataId(id);
        if(null == infoData || infoData.isEmpty()){
            return null;
        }
        GdApi1023 gdApi1023= JSONObject.parseObject(infoData.get(0).getData(), GdApi1023.class);
        if(null == gdApi1023){
            return null;
        }
 
        return gdApi1023.getDtls();
    }
 
}