zjs 1 week ago
parent
commit
01d04078e4

+ 6 - 0
src/main/java/com/cn/esermis/CodeMatch.java

@@ -0,0 +1,6 @@
1
+package com.cn.esermis;
2
+
3
+public interface CodeMatch extends CodePattern {
4
+
5
+    boolean match(String code);
6
+}

+ 7 - 0
src/main/java/com/cn/esermis/CodeMean.java

@@ -0,0 +1,7 @@
1
+package com.cn.esermis;
2
+
3
+public interface CodeMean {
4
+
5
+    String code();
6
+    String mean();
7
+}

+ 8 - 0
src/main/java/com/cn/esermis/CodePattern.java

@@ -0,0 +1,8 @@
1
+package com.cn.esermis;
2
+
3
+public interface CodePattern extends CodeMean {
4
+
5
+    String pattern();
6
+
7
+    int order();
8
+}

+ 145 - 0
src/main/java/com/cn/esermis/coding/PollutionCode.java

@@ -0,0 +1,145 @@
1
+package com.cn.esermis.coding;
2
+
3
+
4
+import com.cn.esermis.CodeMean;
5
+
6
+/**
7
+ * Created by xiaoyao9184 on 2018/3/26.
8
+ */
9
+public enum PollutionCode implements CodeMean {
10
+
11
+    _B03("噪声","噪声","dB", "N3.1"),
12
+    _L10("累计百分声级L10","噪声","dB","N3.1"),
13
+    _L5("累计百分声级L5","噪声","dB","N3.1"),
14
+    _L50("累计百分声级L50","噪声","dB","N3.1"),
15
+    _L90("累计百分声计L90","噪声","dB","N3.1"),
16
+    _L95("累计百分声级L95","噪声","dB","N3.1"),
17
+    _Ld("夜间等效声级Ld","噪声","dB","N3.1"),
18
+    _Ldn("昼夜等效声级Ldn","噪声","dB","N3.1"),
19
+    _Leq("30秒等效声级Leq","噪声","dB","N3.1"),
20
+    _LMn("最小的瞬时声级","噪声","dB","N3.1"),
21
+    _LMx("最大的瞬时声级","噪声","dB","N3.1"),
22
+    _Ln("昼间等效声级Ln","噪声","dB","N3.1"),
23
+    _S01("O2 含量","废气","%","N3.1"),
24
+    _S02("烟气流速","废气","m3/h","N5.2"),
25
+    _S03("烟气温度","废气","℃","N3.1"),
26
+    _S04("烟气动压","废气","MPa","N4.2"),
27
+    _S05("烟气湿度","废气","%","N3.1"),
28
+    _S06("制冷温度","废气","℃","N3.1"),
29
+    _S07("烟道截面积","废气","M2","N4.2"),
30
+    _S08("烟气压力","废气","MPa","N4.2"),
31
+    _B02("废气"),
32
+    _01("烟尘","废气","mg/m3","N5.2"),
33
+    _02("二氧化硫","废气","mg/m3","N5.2"),
34
+    _03("氮氧化物","废气","mg/m3","N5.3"),
35
+    _04("一氧化碳","废气","mg/m3","N2.3"),
36
+    _05("硫化氢","废气","mg/m3","N3.2"),
37
+    _06("氟化物","废气","mg/m3","N2.3"),
38
+    _07("氰化物(含氰化氢)","废气","mg/m3","N3.3"),
39
+    _08("氯化氢","废气","mg/m3","N4.3"),
40
+    _09("沥青烟","废气","mg/m3","N4.3"),
41
+    _10("氨","废气","mg/m3","N4.3"),
42
+    _11("氯气","废气","mg/m3","N4.3"),
43
+    _12("二硫化碳","废气","mg/m3","N4.3"),
44
+    _13("硫醇","废气","mg/m3","N4.3"),
45
+    _14("硫酸雾","废气","mg/m3","N4.3"),
46
+    _15("铬酸雾","废气","mg/m3","N2.4"),
47
+    _16("苯系物","废气","mg/m3","N4.2"),
48
+    _17("甲苯","废气","mg/m3","N4.2"),
49
+    _18("二甲苯","废气","mg/m3","N4.2"),
50
+    _19("甲醛","废气","mg/m3","N3.3"),
51
+    _20("苯并(a)芘","废气","mg/m3","N3.6"),
52
+    _21("苯胺类","废气","mg/m3","N4.3"),
53
+    _22("硝基苯类","废气","mg/m3","N3.4"),
54
+    _23("氯苯类","废气","mg/m3","N4.3"),
55
+    _24("光气","废气","mg/m3","N3.3"),
56
+    _25("碳氢化合物(含非甲烷总烃)","废气","mg/m3","N5.2"),
57
+    _26("乙醛","废气","mg/m3","N3.4"),
58
+    _27("酚类","废气","mg/m3","N3.3"),
59
+    _28("甲醇","废气","mg/m3","N5.2"),
60
+    _29("氯乙烯","废气","mg/m3","N4.3"),
61
+    _30("二氧化碳","废气","mg/m3","N4.3"),
62
+    _31("汞及其化合物","废气","mg/m3","N4.4"),
63
+    _32("铅及其化合物","废气","mg/m3","N2.4"),
64
+    _33("镉及其化合物","废气","mg/m3","N3.4"),
65
+    _34("锡及其化合物","废气","mg/m3","N4.3"),
66
+    _35("镍及其化合物","废气","mg/m3","N3.3"),
67
+    _36("铍及其化合物","废气","mg/m3","N4.4"),
68
+    _37("林格曼黑度","废气","N1",""),
69
+    _99("其他气污染物","废气","",""),
70
+    _B01("污水","污水","",""),
71
+    _001("pH","值","污水","N2.1"),
72
+    _002("色度","污水","色度单位","N5.1"),
73
+    _003("悬浮物","污水","mg/l","N5.1"),
74
+    _010("生化需氧量(BOD5)","污水","mg/l","N5.1"),
75
+    _011("化学需氧量(CODcr)","污水","mg/l","N6.1"),
76
+    _015("总有机碳","污水","mg/l","N3.2"),
77
+    _020("总汞","污水","mg/l","N2.3"),
78
+    _021("烷基汞","污水","mg/l","N2.1"),
79
+    _022("总镉","污水","mg/l","N2.2"),
80
+    _023("总铬","污水","mg/l","N3.2"),
81
+    _024("六价铬","污水","mg/l","N2.2"),
82
+    _025("三价铬","污水","mg/l","N3.2"),
83
+    _026("总砷","污水","mg/l","N2.2"),
84
+    _027("总铅","污水","mg/l","N3.2"),
85
+    _028("总镍","污水","mg/l","N3.2"),
86
+    _029("总铜","污水","mg/l","N3.2"),
87
+    _030("总锌","污水","mg/l","N3.2"),
88
+    _031("总锰","污水","mg/l","N3.2"),
89
+    _032("总铁","污水","mg/l","N3.2"),
90
+    _033("总银","污水","mg/l","N2.2"),
91
+    _034("总铍","污水","mg/l","N2.3"),
92
+    _035("总硒","污水","mg/l","N2.2"),
93
+    _036("锡","污水","mg/l","N3.6"),
94
+    _037("硼","污水","mg/l","N3.6"),
95
+    _038("钼","污水","mg/l","N3.6"),
96
+    _039("钡","污水","mg/l","N3.6"),
97
+    _040("钴","污水","mg/l","N3.6"),
98
+    _041("铊","污水","mg/l","N3.6"),
99
+    _060("氨氮","污水","mg/l","N2.3"),
100
+    _061("有机氮","污水","mg/l","N3.2"),
101
+    _065("总氮","污水","mg/l","N3.2"),
102
+    _080("石油类","污水","mg/l","N3.2"),
103
+    _101("总磷","污水","mg/l","N3.2")
104
+    ;
105
+
106
+    private String code;
107
+    private String meaning;
108
+    private String scope;
109
+    private String unit;
110
+    private String type;
111
+
112
+    PollutionCode(String meaning){
113
+        this.code = name().substring(1);
114
+        this.meaning = meaning;
115
+    }
116
+
117
+    PollutionCode(String meaning, String scope, String unit, String type){
118
+        this.code = name().substring(1);
119
+        this.meaning = meaning;
120
+        this.scope = scope;
121
+        this.unit = unit;
122
+        this.type = type;
123
+    }
124
+
125
+    @Override
126
+    public String code() {
127
+        return code;
128
+    }
129
+
130
+    @Override
131
+    public String mean() {
132
+        return meaning;
133
+    }
134
+
135
+    public String scope() {
136
+        return scope;
137
+    }
138
+
139
+    public String unit() {
140
+        return unit;
141
+    }
142
+    public String type() {
143
+        return type;
144
+    }
145
+}

+ 186 - 0
src/main/java/com/cn/esermis/coding/PollutionGas.java

@@ -0,0 +1,186 @@
1
+package com.cn.esermis.coding;
2
+
3
+
4
+import com.cn.esermis.CodeMean;
5
+
6
+/**
7
+ * Created by xiaoyao9184 on 2018/3/26.
8
+ */
9
+public enum PollutionGas implements CodeMean {
10
+
11
+    a00000("废气","B02","立方米/秒","立方米","N6.1"),
12
+    a01001("温度","--","摄氏度","N3.1"),
13
+    a01002("湿度","--","%","N3.1"),
14
+    a01006("气压","--","千帕","N5.3"),
15
+    a01007("风速","--","米/秒","N4.1"),
16
+    a01008("风向","--","[角]度","N4"),
17
+    a01010("林格曼黑度","37","无量纲","N1"),
18
+    a01011("烟气流速","S02","米/秒","N5.2"),
19
+    a01012("烟气温度","S03","摄氏度","N3.1"),
20
+    a01013("烟气压力","S08","千帕","N5.3"),
21
+    a01014("烟气湿度","S05","%","N3.1"),
22
+    a01015("制冷温度","S06","摄氏度","N3.1"),
23
+    a01016("烟道截面积","S07","平方米","N4.2"),
24
+    a01017("烟气动压","S04","千帕","N5.3"),
25
+    a01901("垃圾焚烧炉膛内焚","烧平均温度","--","摄氏度","N4.1"),
26
+    a01902("垃圾焚烧炉膛内DCS","温度","--","摄氏度","N4.1"),
27
+    a05001("二氧化碳","30","毫克/立方米","千克","N3.3"),
28
+    a05002("甲烷","--","纳克/立方米","克","N4.1"),
29
+    a05008("三氯一氟甲烷","--","毫克/立方米","千克","N7.3"),
30
+    a05009("二氯二氟甲烷","--","毫克/立方米","千克","N7.3"),
31
+    a05013("三氯三氟乙烷","--","毫克/立方米","千克","N7.3"),
32
+    a19001("氧气含量","S01","%","N3.1"),
33
+    a20007("砷","--","纳克/立方米","克","N1.6"),
34
+    a20016("铍及其化合物","36","毫克/立方米","千克","N4.4"),
35
+    a20025("镉及其化合物","33","毫克/立方米","千克","N3.4"),
36
+    a20026("镉","--","纳克/立方米","克","N3.3"),
37
+    a20043("铅及其化合物","32","毫克/立方米","千克","N2.4"),
38
+    a20044("铅","--","纳克/立方米","克","N3.3"),
39
+    a20057("汞及其化合物","31","毫克/立方米","千克","N4.4"),
40
+    a20058("汞","--","纳克/立方米","克","N3.2"),
41
+    a20063("镍及其化合物","35","毫克/立方米","千克","N3.3"),
42
+    a20091("锡及其化合物","34","毫克/立方米","千克","N4.3"),
43
+    a21001("氨(氨气)","10","纳克/立方米","克","N4.3"),
44
+    a21002("氮氧化物","03","毫克/立方米","千克","N5.1"),
45
+    a21003("一氧化氮","--","毫克/立方米","千克","N4.1"),
46
+    a21004("二氧化氮","--","毫克/立方米","千克","N4.1"),
47
+    a21005("一氧化碳","04","毫克/立方米","千克","N3.3"),
48
+    a21017("氰化物","07","毫克/立方米","千克","N3.3"),
49
+    a21018("氟化物","06","毫克/立方米","千克","N2.3"),
50
+    a21022("氯气","11","毫克/立方米","千克","N4.3"),
51
+    a21024("氯化氢","08","毫克/立方米","千克","N4.3"),
52
+    a21026("二氧化硫","02","毫克/立方米","千克","N5.2"),
53
+    a21028("硫化氢","05","毫克/立方米","千克","N3.2"),
54
+    a23001("酚类","27","毫克/立方米","千克","N3.3"),
55
+    a24003("二氯甲烷","--","毫克/立方米","千克","N7.3"),
56
+    a24004("三氯甲烷","--","毫克/立方米","千克","N7.3"),
57
+    a24005("四氯甲烷","--","毫克/立方米","千克","N7.3"),
58
+    a24006("二溴一氯甲烷","--","毫克/立方米","千克","N7.3"),
59
+    a24007("一溴二氯甲烷","--","毫克/立方米","千克","N7.3"),
60
+    a24008("溴甲烷","--","毫克/立方米","千克","N7.3"),
61
+    a24009("三溴甲烷","--","毫克/立方米","千克","N7.3"),
62
+    a24015("氯乙烷","--","毫克/立方米","千克","N7.3"),
63
+    a24016("1,1-二氯乙烷","--","毫克/立方米","千克","N7.3"),
64
+    a24017("1,2-二氯乙烷","--","毫克/立方米","千克","N7.3"),
65
+    a24018("1,1,1-三氯乙烷","--","毫克/立方米","千克","N7.3"),
66
+    a24019("1,1,2-三氯乙烷","--","毫克/立方米","千克","N7.3"),
67
+    a24020("1,1,2,2-四氯乙烷","--","毫克/立方米","千克","N7.3"),
68
+    a24027("1,2-二氯丙烷","--","毫克/立方米","千克","N7.3"),
69
+    a24034("1,2-二溴乙烷","--","毫克/立方米","千克","N7.3"),
70
+    a24036("环己烷","--","毫克/立方米","千克","N7.3"),
71
+    a24042("正己烷","--","毫克/立方米","千克","N7.3"),
72
+    a24043("正庚烷","--","毫克/立方米","千克","N7.3"),
73
+    a24046("氯乙烯","29","毫克/立方米","千克","N4.3"),
74
+    a24047("1,1-二氯乙烯","--","毫克/立方米","千克","N7.3"),
75
+    a24049("三氯乙烯","--","毫克/立方米","千克","N7.3"),
76
+    a24050("四氯乙烯","--","毫克/立方米","千克","N7.3"),
77
+    a24053("丙烯","--","毫克/立方米","千克","N7.3"),
78
+    a24054("1,3-二氯丙烯","--","毫克/立方米","千克","N7.3"),
79
+    a24072("1,4-二恶烷","--","毫克/立方米","千克","N7.3"),
80
+    a24078("1,3-丁二烯","--","毫克/立方米","千克","N7.3"),
81
+    a24087("碳氢化合物","25","毫克/立方米","千克","N5.2"),
82
+    a24088("非甲烷总烃","--","毫克/立方米","千克","N7.3"),
83
+    a24099("氯甲烷","--","毫克/立方米","千克","N7.3"),
84
+    a24110("反式-1,2-二氯乙烯","--","毫克/立方米","千克","N7.3"),
85
+    a24111("顺式-1,2-二氯乙烯","--","毫克/立方米","千克","N7.3"),
86
+    a24112("反式-1,3-二氯丙烯","--","毫克/立方米","千克","N7.3"),
87
+    a24113("六氯-1,3-丁二烯","--","毫克/立方米","千克","N7.3"),
88
+    a25002("苯","--","毫克/立方米","千克","N7.3"),
89
+    a25003("甲苯","17","毫克/立方米","千克","N4.2"),
90
+    a25004("乙苯","--","毫克/立方米","千克","N7.3"),
91
+    a25005("二甲苯","18","毫克/立方米","千克","N4.2"),
92
+    a25006("1,2-二甲基苯","--","毫克/立方米","千克","N7.3"),
93
+    a25007("1,3-二甲基苯","--","毫克/立方米","千克","N7.3"),
94
+    a25008("1,4-二甲基苯","--","毫克/立方米","千克","N7.3"),
95
+    a25010("氯苯","23","毫克/立方米","千克","N4.3"),
96
+    a25011("1,2-二氯苯","--","毫克/立方米","千克","N7.3"),
97
+    a25012("1,3-二氯苯","--","毫克/立方米","千克","N7.3"),
98
+    a25013("1,4-二氯苯","--","毫克/立方米","千克","N7.3"),
99
+    a25014("1-乙基-4-甲基苯","--","毫克/立方米","千克","N7.3"),
100
+    a25015("1,2,4-三氯苯","--","毫克/立方米","千克","N7.3"),
101
+    a25019("1,2,4-三甲基苯","--","毫克/立方米","千克","N7.3"),
102
+    a25020("1,2,3-三甲基苯","--","毫克/立方米","千克","N7.3"),
103
+    a25021("1,3,5-三甲基苯","--","毫克/立方米","千克","N7.3"),
104
+    a25023("硝基苯","22","毫克/立方米","千克","N3.4"),
105
+    a25038("乙烯基苯","--","毫克/立方米","千克","N7.3"),
106
+    a25044("苯并[a]芘","20","毫克/立方米","千克","N4.3"),
107
+    a25072("四氢呋喃","--","毫克/立方米","千克","N7.3"),
108
+    a26001("苯胺类","21","毫克/立方米","千克","N4.3"),
109
+    a29017("乙酸乙酯","--","毫克/立方米","千克","N7.3"),
110
+    a29026("乙酸乙烯酯","--","毫克/立方米","千克","N7.3"),
111
+    a30001("甲醇","28","毫克/立方米","千克","N4.3"),
112
+    a30008("异丙醇","--","毫克/立方米","千克","N7.3"),
113
+    a30022("硫醇","13","毫克/立方米","千克","N4.3"),
114
+    a31001("甲醛","19","毫克/立方米","千克","N3.3"),
115
+    a31002("乙醛","26","毫克/立方米","千克","N3.4"),
116
+    a31024("丙酮","--","毫克/立方米","千克","N7.3"),
117
+    a31025("2-丁酮","--","毫克/立方米","千克","N7.3"),
118
+    a31030("甲基异丁基甲酮","--","毫克/立方米","千克","N7.3"),
119
+    a34001("总悬浮颗粒物TSP","--","纳克/立方米","克","N4.3"),
120
+    a34002("可吸入颗粒物PM10","--","纳克/立方米","克","N3.3"),
121
+    a34004("细微颗粒物PM2.5","--","纳克/立方米","克","N3.3"),
122
+    a34005("亚微米颗粒物PM1.0","--","纳克/立方米","克","N3.3"),
123
+    a34011("降尘","--","吨/平方千米•月","",""),
124
+    a34013("烟尘","01","毫克/立方米","千克","N4"),
125
+    a34017("炭黑尘","--","毫克/立方米","千克","N4"),
126
+    a34038("沥青烟","09","毫克/立方米","千克","N4.3"),
127
+    a34039("硫酸雾","14","毫克/立方米","千克","N4.3"),
128
+    a34040("铬酸雾","15","毫克/立方米","千克","N2.3"),
129
+    a99010("丙烯腈","--","毫克/立方米","千克","N7.3"),
130
+    a99049("光气","24","毫克/立方米","千克","N3.3"),
131
+    a99051("二硫化碳","12","毫克/立方米","千克","N4.3")
132
+
133
+    ;
134
+
135
+    private String code;
136
+    private String meaning;
137
+    private String oldCode;
138
+    private String chromaUnit;
139
+    private String amountUnit;
140
+    private String type;
141
+
142
+    PollutionGas(String meaning, String oldCode, String amountUnit, String type){
143
+        this.code = name();
144
+        this.meaning = meaning;
145
+        this.oldCode = oldCode;
146
+        this.amountUnit = amountUnit;
147
+        this.type = type;
148
+    }
149
+
150
+    PollutionGas(String meaning, String oldCode, String chromaUnit, String amountUnit, String type){
151
+        this.code = name();
152
+        this.meaning = meaning;
153
+        this.oldCode = oldCode;
154
+        this.chromaUnit = chromaUnit;
155
+        this.amountUnit = amountUnit;
156
+        this.type = type;
157
+    }
158
+
159
+    @Override
160
+    public String code() {
161
+        return code;
162
+    }
163
+
164
+    @Override
165
+    public String mean() {
166
+        return meaning;
167
+    }
168
+
169
+
170
+    public String oldCode() {
171
+        return oldCode;
172
+    }
173
+    public String chromaUnit() {
174
+        return chromaUnit;
175
+    }
176
+    public String amountUnit() {
177
+        return amountUnit;
178
+    }
179
+
180
+    public String unit() {
181
+        return chromaUnit + " " + amountUnit;
182
+    }
183
+    public String type() {
184
+        return type;
185
+    }
186
+}

+ 8 - 7
src/main/java/com/cn/esermis/dpld/business/MonitorBusiness.java

@@ -103,7 +103,7 @@ public class MonitorBusiness {
103 103
                             throw new RuntimeException(e);
104 104
                         }
105 105
                         try {
106
-                            airMonitorMinuteRecord.setIsExceed(exceptionDataDispose.ExceedData(factorModel.getMN(), x.getFactor(), x.getAvg()!=null?x.getAvg().doubleValue():x.getRtd().doubleValue()));
106
+                            airMonitorMinuteRecord.setIsExceed(exceptionDataDispose.ExceedData(factorModel.getMN(), x.getFactor(), x.getAvg()!=null?x.getAvg().doubleValue():0));
107 107
                             airMonitorMinuteRecord.setIsLose(exceptionDataDispose.LoseData(x.getMax()!=null?x.getMax().doubleValue():0,
108 108
                                     x.getMin()!=null?x.getMin().doubleValue():0,
109 109
                                     x.getAvg()!=null?x.getAvg().doubleValue():0));
@@ -113,6 +113,7 @@ public class MonitorBusiness {
113 113
                                 saveExcepLog(x, airMonitorMinuteRecord);
114 114
                             }
115 115
                         } catch (Exception e) {
116
+//                            throw  new RuntimeException(e);
116 117
                             log.error("调用 ExceptionDataDispose1 方法异常{} 当前参数为:{}",e,airMonitorMinuteRecord);
117 118
                         }
118 119
                         listData.add(airMonitorMinuteRecord);
@@ -147,7 +148,7 @@ public class MonitorBusiness {
147 148
 //                            throw new RuntimeException(e);
148 149
 //                        }
149 150
 //                        try {
150
-//                            airMonitorMinuteRecord.setIsExceed(exceptionDataDispose.ExceedData(factorModel.getMN(), x.getFactor(), x.getAvg()!=null?x.getAvg().doubleValue():x.getRtd().doubleValue()));
151
+//                            airMonitorMinuteRecord.setIsExceed(exceptionDataDispose.ExceedData(factorModel.getMN(), x.getFactor(), x.getAvg()!=null?x.getAvg().doubleValue():0));
151 152
 //                            airMonitorMinuteRecord.setIsLose(exceptionDataDispose.LoseData(x.getMax()!=null?x.getMax().doubleValue():0,
152 153
 //                                    x.getMin()!=null?x.getMin().doubleValue():0,
153 154
 //                                    x.getAvg()!=null?x.getAvg().doubleValue():0));
@@ -193,7 +194,7 @@ public class MonitorBusiness {
193 194
                             throw new RuntimeException(e);
194 195
                         }
195 196
                         try {
196
-                            airMonitorHourRecord.setIsExceed(exceptionDataDispose.ExceedData(factorModel.getMN(), x.getFactor(), x.getAvg()!=null?x.getAvg().doubleValue():x.getRtd().doubleValue()));
197
+                            airMonitorHourRecord.setIsExceed(exceptionDataDispose.ExceedData(factorModel.getMN(), x.getFactor(), x.getAvg()!=null?x.getAvg().doubleValue():0));
197 198
                             airMonitorHourRecord.setIsLose(exceptionDataDispose.LoseData(x.getMax()!=null?x.getMax().doubleValue():0,
198 199
                                     x.getMin()!=null?x.getMin().doubleValue():0,
199 200
                                     x.getAvg()!=null?x.getAvg().doubleValue():0));
@@ -238,7 +239,7 @@ public class MonitorBusiness {
238 239
                             throw new RuntimeException(e);
239 240
                         }
240 241
                         try {
241
-                            waterMonitorMinuteRecord.setIsExceed(exceptionDataDispose.ExceedData(factorModel.getMN(), x.getFactor(), x.getAvg()!=null?x.getAvg().doubleValue():x.getRtd().doubleValue()));
242
+                            waterMonitorMinuteRecord.setIsExceed(exceptionDataDispose.ExceedData(factorModel.getMN(), x.getFactor(), x.getAvg()!=null?x.getAvg().doubleValue():0));
242 243
                             waterMonitorMinuteRecord.setIsLose(exceptionDataDispose.LoseData(x.getMax()!=null?x.getMax().doubleValue():0,
243 244
                                     x.getMin()!=null?x.getMin().doubleValue():0,
244 245
                                     x.getAvg()!=null?x.getAvg().doubleValue():0));
@@ -279,7 +280,7 @@ public class MonitorBusiness {
279 280
 //                            throw new RuntimeException(e);
280 281
 //                        }
281 282
 //                        try {
282
-//                            waterMonitorMinuteRecord.setIsExceed(exceptionDataDispose.ExceedData(factorModel.getMN(), x.getFactor(), x.getAvg()!=null?x.getAvg().doubleValue():x.getRtd().doubleValue()));
283
+//                            waterMonitorMinuteRecord.setIsExceed(exceptionDataDispose.ExceedData(factorModel.getMN(), x.getFactor(), x.getAvg()!=null?x.getAvg().doubleValue():0));
283 284
 //                            waterMonitorMinuteRecord.setIsLose(exceptionDataDispose.LoseData(x.getMax()!=null?x.getMax().doubleValue():0,
284 285
 //                                    x.getMin()!=null?x.getMin().doubleValue():0,
285 286
 //                                    x.getAvg()!=null?x.getAvg().doubleValue():0));
@@ -324,7 +325,7 @@ public class MonitorBusiness {
324 325
                             throw new RuntimeException(e);
325 326
                         }
326 327
                         try {
327
-                            waterMonitorHourRecord.setIsExceed(exceptionDataDispose.ExceedData(factorModel.getMN(), x.getFactor(), x.getAvg()!=null?x.getAvg().doubleValue():x.getRtd().doubleValue()));
328
+                            waterMonitorHourRecord.setIsExceed(exceptionDataDispose.ExceedData(factorModel.getMN(), x.getFactor(), x.getAvg()!=null?x.getAvg().doubleValue():0));
328 329
                             waterMonitorHourRecord.setIsLose(exceptionDataDispose.LoseData(x.getMax()!=null?x.getMax().doubleValue():0,
329 330
                                     x.getMin()!=null?x.getMin().doubleValue():0,
330 331
                                     x.getAvg()!=null?x.getAvg().doubleValue():0));
@@ -344,7 +345,7 @@ public class MonitorBusiness {
344 345
             }
345 346
         } catch (Exception e) {
346 347
 //            throw new RuntimeException(e);
347
-//            log.error("插入数据库异常:"+e);
348
+            log.error("插入数据库异常:"+e);
348 349
         }
349 350
     }
350 351
 

+ 1 - 0
src/main/java/com/cn/esermis/netty/BootNettyChannelInboundHandlerAdapter.java

@@ -202,6 +202,7 @@ public class BootNettyChannelInboundHandlerAdapter extends ChannelInboundHandler
202 202
                     eventType = "设备超时";
203 203
             }
204 204
             log.warn(ctx.channel().id() + " : " + eventType + "---> 关闭该设备");
205
+            dataMap.remove(ctx.channel().id().toString());
205 206
             ctx.channel().close();
206 207
         }
207 208
     }

+ 8 - 1
src/main/java/com/cn/esermis/utils/HJ212MsgUtils.java

@@ -79,7 +79,14 @@ public class HJ212MsgUtils {
79 79
                 // 如果是时间信息,则直接放到外层
80 80
                 if (paramStr.contains("DataTime")) {
81 81
                     data.putAll(JSONObject.parseObject("{\"" + paramStr + "\"}"));
82
-                } else {
82
+                } else if (paramStr.contains("PNUM")){
83
+                    data.putAll(JSONObject.parseObject("{\"" + paramStr + "\"}"));
84
+                }
85
+                else if(paramStr.contains("PNO"))
86
+                {  //PNO
87
+                    data.putAll(JSONObject.parseObject("{\"" + paramStr + "\"}"));
88
+                }
89
+                else {
83 90
                     String[] ele = getPollutionSource(paramStr);
84 91
                     JSONObject jsonObject = JSONObject.parseObject("{\"" + ele[1] + "\"}");
85 92
                     jsonObject.put("factor",ele[0]);

+ 4 - 2
src/main/resources/application.yml

@@ -21,8 +21,10 @@ spring:
21 21
       datasource:
22 22
         master:
23 23
           driver-class-name: com.mysql.cj.jdbc.Driver
24
-          url: jdbc:mysql://39.105.121.97:13306/scy?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false
24
+#          url: jdbc:mysql://39.105.121.97:13306/scy?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false
25
+          url: jdbc:mysql://192.168.3.19:13306/scy?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false
25 26
           username: root
27
+#          password: Eitc@gnhz702
26 28
           password: Eitc@gnhz702
27 29
 
28 30
   # Redis 配置
@@ -39,7 +41,7 @@ spring:
39 41
 #    port: ${REDIS_PORT:6379}
40 42
     port: 16379
41 43
 #    database: ${REDIS_DB:0}
42
-    database: 5
44
+    database: 15
43 45
 #    password: ${REDIS_PWD:}
44 46
 
45 47
 mybatis-plus: