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
package com.ld.igds.m.view;
 
import java.text.Collator;
import java.util.*;
 
import com.ld.igds.m.service.HInoutCustomerService;
import com.ld.igds.models.InoutCustomer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.annotation.Expose;
 
/**
 * 出入库-往来单位管理
 *
 * @author: andy.jia
 * @description:
 * @version:
 * @data:2020年3月12日
 */
@Component("inoutCustomerPR")
public class InoutCustomerPR {
 
    @Autowired
    private HInoutCustomerService customerService;
 
    /**
     * inoutCustomerPR#queryList 获取所有信息
     *
     * @param parameter
     * @return
     */
    @DataProvider
    public List<InoutCustomer> queryList(Map<String, Object> parameter) {
 
        List<InoutCustomer> list = customerService.queryList(parameter);
        Collections.sort(list, new Comparator<InoutCustomer>() {
            @Override
            public int compare(InoutCustomer a1, InoutCustomer a2) {
                return Collator.getInstance(Locale.CHINESE).compare(a1.getName(), a2.getName());
            }
        });
        return list;
 
    }
 
    /**
     * inoutCustomerPR#queryListByKey
     * 根据关键字查询,可能是ID可能是名称
     *
     * @param
     * @return
     */
    @DataProvider
    public List<InoutCustomer> queryListByKey(Map<String, Object> param) {
        List<InoutCustomer> list = customerService.queryList(param);
        Collections.sort(list, new Comparator<InoutCustomer>() {
            @Override
            public int compare(InoutCustomer a1, InoutCustomer a2) {
                return Collator.getInstance(Locale.CHINESE).compare(a1.getName(), a2.getName());
            }
        });
        return list;
    }
 
    /**
     * inoutCustomerPR#saveData
     */
    @Expose
    public String saveData(InoutCustomer data) {
        return customerService.saveOrUpdateData(data);
    }
 
    /**
     * inoutCustomerPR#delData
     */
    @Expose
    public String delData(InoutCustomer data) {
        return customerService.delData(data);
    }
 
 
    /**
     * inoutCustomerPR#queryListByParam
     * 根据关键字查询,ID
     *
     * @param
     * @return
     */
    @Expose
    public InoutCustomer queryListByParam(String id) {
        Map<String, Object> param = new HashMap<>();
        param.put("id", id);
        List<InoutCustomer> list = customerService.queryList(param);
 
        return list.get(0);
    }
}