CZT
2023-11-27 c206acfaedc69c390fb67daa81bc686f58a212ef
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
package com.ld.igds.n2.view;
 
import java.util.ArrayList;
import java.util.List;
 
import com.ld.igds.constant.Constant;
import com.ld.igds.models.DicTrigger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.annotation.Expose;
import com.ld.igds.models.N2MacConf;
import com.ld.igds.n2.service.HMacConfService;
import com.ld.igds.util.ContextUtil;
 
/**
 * 制氮机配置管理,不包括远程操作管理
 *
 * @author andy.jia
 */
@Component
public class N2MacPR {
 
    @Autowired
    private HMacConfService n2ConfService;
 
 
    /**
     * n2MacPR#getData
     *
     * @return
     * @throws Exception
     */
    @DataProvider
    public List<N2MacConf> getData() throws Exception {
        String companyId = ContextUtil.getCompanyId();
        return n2ConfService.getConfData(companyId, null);
    }
 
    /**
     * n2MacPR#saveData
     *
     * @param data
     * @return
     */
    @Expose
    public String saveData(N2MacConf data) {
        String msg = n2ConfService.saveData(data);
        return msg;
    }
 
    /**
     * n2MacPR#delData
     *
     * @param data
     * @return
     */
    @Expose
    public String delData(N2MacConf data) {
        String msg = n2ConfService.delData(data);
        return msg;
    }
 
    /**
     * n2MacPR#getDataBySn 根据参数获取当前的制氮机信息
     *
     * @return
     * @throws Exception
     */
    @DataProvider
    public N2MacConf getDataBySn(String sn) throws Exception {
        return n2ConfService.getDataBySn(sn);
    }
 
    /**
     * 
     *${dorado.getDataProvider("n2MacPR#runStatus").getResult()}
     * @return
     * @throws Exception
     */
    @DataProvider
    public List<DicTrigger> runStatus() {
        List<DicTrigger> list = new ArrayList<>();
        list.add(new DicTrigger(Constant.YN_Y, "运行"));
        list.add(new DicTrigger(Constant.YN_N, "停止"));
        return list;
    }
 
}