wuzeyu
2024-06-11 a3b3610216dfeb82c729c914dbb2018da7eb54ef
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
package com.dy.pipIrrGlobal.util;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
public class Constant {
    /**
     * 是与否
     */
    public static final Integer yes = 1 ;
    public static final Integer no = 0 ;
    public static final String YES = "1" ;
    public static final String NO = "0" ;
 
    // 项目编号
    public static final Integer projectCode_ym = 100;
    public static final Integer projectCode_pj = 101;
 
    // 协议列表
    public static final String[] protocol = {"DYJS_2023", "DYJS_2024"};
 
    public static List<String[]> yesNo(){
        List<String[]> list = new ArrayList<>() ;
        list.add(new String[]{YES , "是"}) ;
        list.add(new String[]{NO , "否"}) ;
        return list ;
    }
 
    public static String getYesNo(Integer flag){
        if(flag != null){
            if(flag.intValue() == yes.intValue()){
                return "是" ;
            }else
            if(flag.intValue() == no.intValue()){
                return "否" ;
            }
        }
        return null ;
    }
 
    public static String getYesNo(String flag){
        if(flag != null){
            if(flag.equals(YES)){
                return "是" ;
            }else
            if(flag.equals(NO)){
                return "否" ;
            }
        }
        return null ;
    }
 
    // 1、刷卡开阀;2刷卡关阀;3、中心站开阀;4、中心站关阀;5、欠费关阀;
    // 6、流量计故障关阀;7、紧急关阀;8、用户远程开阀;9、用户远程关阀;
    // 16,用户开阀后管道内没有水,自动关阀。管道不出水自动关阀
    public static final Integer valveOpenByIC = 1 ;//刷卡开阀
    public static final Integer valveCloseByIC = 2 ;//刷卡关阀
    public static final Integer valveOpenByCenter = 3 ;//中心站开阀
    public static final Integer valveCloseByCenter = 4 ;//中心站关阀
    public static final Integer valveCloseByFee = 5 ;//欠费关阀
    public static final Integer valveCloseByFlowMeterFault = 6 ;//流量计故障关阀
    public static final Integer valveCloseByEmergency = 7 ;//紧急关阀
    public static final Integer valveOpenByRemoteUser = 8 ;//用户远程开阀
    public static final Integer valveCloseByRemoteUser = 9 ;//用户远程关阀;
    public static final Integer valveCloseByNoWater = 16 ;//管道无水自动关阀;
 
    public static Map<Integer, String> openCloseValveTypes(){
        Map<Integer, String> map = new HashMap<>() ;
        map.put(valveOpenByIC, "刷卡开阀");
        map.put(valveCloseByIC , "刷卡关阀") ;
        map.put(valveOpenByCenter , "中心站开阀") ;
        map.put(valveCloseByCenter , "中心站关阀") ;
        map.put(valveCloseByFee , "欠费关阀") ;
        map.put(valveCloseByFlowMeterFault , "流量计故障关阀") ;
        map.put(valveCloseByEmergency , "紧急关阀") ;
        map.put(valveOpenByRemoteUser , "用户远程开阀") ;
        map.put(valveCloseByRemoteUser , "用户远程关阀") ;
        map.put(valveCloseByNoWater , "管道无水自动关阀") ;
        return map ;
    }
    public static String openCloseValveTypeName(Integer type){
        if(type != null){
            return switch (type.intValue()) {
                case 1 -> "刷卡开阀";
                case 2 -> "刷卡关阀";
                case 3 -> "中心站开阀";
                case 4 -> "中心站关阀";
                case 5 -> "欠费关阀";
                case 6 -> "流量计故障关阀";
                case 7 -> "紧急关阀";
                case 8 -> "用户远程开阀";
                case 9 -> "用户远程关阀";
                case 16 -> "管道无水自动关阀";
                default -> "未知";
            };
        }
        return null ;
    }
 
}