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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
package com.ld.igds.drug.view;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import com.ld.igds.inout.InoutConstant;
import com.ld.igds.models.DicTrigger;
import com.ld.igds.util.ContextUtil;
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.bstek.dorado.data.provider.Page;
import com.ld.igds.drug.service.HDrugService;
import com.ld.igds.models.Drug;
 
/**
 * 熏蒸管理的PR
 *
 * @author: andy.jia
 * @description:
 * @version:
 * @data:2020年3月6日
 */
@Component("drugPR")
public class DrugPR {
 
    @Autowired
    private HDrugService drugService;
 
 
    // ${dorado.getDataProvider("drugPR#triggerPackage").getResult()}
    @DataProvider
    public List<DicTrigger> triggerPackage() {
        List<DicTrigger> list = new ArrayList<DicTrigger>();
        list.add(new DicTrigger("1", "瓶装"));
        list.add(new DicTrigger("2", "袋装"));
        list.add(new DicTrigger("3", "其他"));
        return list;
    }
 
    // ${dorado.getDataProvider("drugPR#triggerLocation").getResult()}
    @DataProvider
    public List<DicTrigger> triggerLocation() {
        List<DicTrigger> list = new ArrayList<DicTrigger>();
        list.add(new DicTrigger("1", "药剂库"));
        list.add(new DicTrigger("2", "其他"));
        return list;
    }
 
    // ${dorado.getDataProvider("drugPR#triggerUnit").getResult()}
    @DataProvider
    public List<DicTrigger> triggerUnit() {
        List<DicTrigger> list = new ArrayList<DicTrigger>();
        list.add(new DicTrigger("1", "公斤"));
        list.add(new DicTrigger("2", "克"));
        list.add(new DicTrigger("3", "毫克"));
        return list;
    }
 
    /**
     * ${dorado.getDataProvider("drugPR#listDrug").getResult()}
     *
     * @throws Exception
     */
    @DataProvider
    public List<Drug> listDrug() throws Exception {
        return drugService.listDrug(ContextUtil.getCompanyId(), null);
    }
 
    /**
     * ${dorado.getDataProvider("drugPR#pageDrug").getResult()}
     *
     * @throws Exception
     */
    @DataProvider
    public void pageDrug(Page<Drug> page, Map<String, Object> param) throws Exception {
        drugService.pageDrug(page, param);
    }
 
    /**
     * ${dorado.getDataProvider("drugPR#saveDrug").getResult()}
     *
     * @throws Exception
     */
    @Expose
    public void saveDrug(Drug drug) throws Exception {
        drugService.saveDrug(drug);
    }
 
    /**
     * drugPR#delDrug
     *
     * @param
     * @throws Exception
     */
    @Expose
    public String delDrug(Drug data) throws Exception {
        return drugService.delDrug(data);
    }
 
 
}