DELL
2025-02-11 b885f89b291e583f274d7e250a947801095bf259
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
package com.dev.lock.data;
 
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
 
import com.base.Com;
 
public class ElectLock_Report {
    
    public int lock_id;            //锁具ID号',
    public int record_year;        //统计年份',
    public int month1;            //1月开锁次数',
    public int month2;            //2月开锁次数',
    public int month3;            //3月开锁次数',
    public int month4;            //4月开锁次数',
    public int month5;            //5月开锁次数',
    public int month6;            //6月开锁次数',
    public int month7;            //7月开锁次数',
    public int month8;            //8月开锁次数',
    public int month9;            //9月开锁次数',
    public int month10;            //10月开锁次数',
    public int month11;            //11月开锁次数',
    public int month12;            //12月开锁次数',
    public int quarter1;        //第一季度开锁次数',
    public int quarter2;        //第二季度开锁次数',
    public int quarter3;        //第三季度开锁次数',
    public int quarter4;        //第四季度开锁次数',
    public int year_count;        //本年开锁次数',
    
    public void initNewYear(int nowYear) {
        this.record_year = nowYear;        //统计年份',
        this.month1 = 0;                //1月开锁次数',
        this.month2 = 0;                //2月开锁次数',
        this.month3 = 0;                //3月开锁次数',
        this.month4 = 0;                //4月开锁次数',
        this.month5 = 0;                //5月开锁次数',
        this.month6 = 0;                //6月开锁次数',
        this.month7 = 0;                //7月开锁次数',
        this.month8 = 0;                //8月开锁次数',
        this.month9 = 0;                //9月开锁次数',
        this.month10 = 0;                //10月开锁次数',
        this.month11 = 0;                //11月开锁次数',
        this.month12 = 0;                //12月开锁次数',
        this.quarter1 = 0;                //第一季度开锁次数',
        this.quarter2 = 0;                //第二季度开锁次数',
        this.quarter3 = 0;                //第三季度开锁次数',
        this.quarter4 = 0;                //第四季度开锁次数',
        this.year_count = 0;            //本年开锁次数',
    }
    
    public ElectLock_Report clone() {
        
        ElectLock_Report temp = new ElectLock_Report();
        temp.record_year = this.record_year;    //统计年份',
        temp.month1 = this.month1;                //1月开锁次数',
        temp.month2 = this.month2;                //2月开锁次数',
        temp.month3 = this.month3;                //3月开锁次数',
        temp.month4 = this.month4;                //4月开锁次数',
        temp.month5 = this.month5;                //5月开锁次数',
        temp.month6 = this.month6;                //6月开锁次数',
        temp.month7 = this.month7;                //7月开锁次数',
        temp.month8 = this.month8;                //8月开锁次数',
        temp.month9 = this.month9;                //9月开锁次数',
        temp.month10 = this.month10;            //10月开锁次数',
        temp.month11 = this.month11;            //11月开锁次数',
        temp.month12 = this.month12;            //12月开锁次数',
        temp.quarter1 = this.quarter1;            //第一季度开锁次数',
        temp.quarter2 = this.quarter2;            //第二季度开锁次数',
        temp.quarter3 = this.quarter3;            //第三季度开锁次数',
        temp.quarter4 = this.quarter4;            //第四季度开锁次数',
        temp.year_count = this.year_count;        //本年开锁次数',
        return temp;
    }
    
    public void calNewOpenEvent(Date time) {
        //统计当前事件数据信息
        Calendar calendar = new GregorianCalendar();
        calendar.setTime(time);
 
        // 你还可以从Calendar对象中获取年、月、日等信息
        int year = calendar.get(Calendar.YEAR);                //年份
        int month = calendar.get(Calendar.MONTH) + 1;         //月份从0开始,所以加1
        
        this.record_year = year;
        switch(month) {
            case 1:{
                this.month1 ++;
                this.quarter1 ++;
            }break;
            case 2:{
                this.month2 ++;
                this.quarter1 ++;
            }break;
            case 3:{
                this.month3 ++;
                this.quarter1 ++;
            }break;
            case 4:{
                this.month4 ++;
                this.quarter2 ++;
            }break;
            case 5:{
                this.month5 ++;
                this.quarter2 ++;
            }break;
            case 6:{
                this.month6 ++;
                this.quarter2 ++;
            }break;
            case 7:{
                this.month7 ++;
                this.quarter3 ++;
            }break;
            case 8:{
                this.month8 ++;
                this.quarter3 ++;
            }break;
            case 9:{
                this.month9 ++;
                this.quarter3 ++;
            }break;
            case 10:{
                this.month10 ++;
                this.quarter4 ++;
            }break;
            case 11:{
                this.month11 ++;
                this.quarter4 ++;
            }break;
            case 12:{
                this.month12 ++;
                this.quarter4 ++;
            }break;
        }
        this.year_count ++;
    }
    
    public int getLock_id() {
        return lock_id;
    }
    public int getRecord_year() {
        return record_year;
    }
    public int getMonth1() {
        return month1;
    }
    public int getMonth2() {
        return month2;
    }
    public int getMonth3() {
        return month3;
    }
    public int getMonth4() {
        return month4;
    }
    public int getMonth5() {
        return month5;
    }
    public int getMonth6() {
        return month6;
    }
    public int getMonth7() {
        return month7;
    }
    public int getMonth8() {
        return month8;
    }
    public int getMonth9() {
        return month9;
    }
    public int getMonth10() {
        return month10;
    }
    public int getMonth11() {
        return month11;
    }
    public int getMonth12() {
        return month12;
    }
    public int getQuarter1() {
        return quarter1;
    }
    public int getQuarter2() {
        return quarter2;
    }
    public int getQuarter3() {
        return quarter3;
    }
    public int getQuarter4() {
        return quarter4;
    }
    public int getYear_count() {
        return year_count;
    }
    public void setLock_id(int lock_id) {
        this.lock_id = lock_id;
    }
    public void setRecord_year(int record_year) {
        this.record_year = record_year;
    }
    public void setMonth1(int month1) {
        this.month1 = month1;
    }
    public void setMonth2(int month2) {
        this.month2 = month2;
    }
    public void setMonth3(int month3) {
        this.month3 = month3;
    }
    public void setMonth4(int month4) {
        this.month4 = month4;
    }
    public void setMonth5(int month5) {
        this.month5 = month5;
    }
    public void setMonth6(int month6) {
        this.month6 = month6;
    }
    public void setMonth7(int month7) {
        this.month7 = month7;
    }
    public void setMonth8(int month8) {
        this.month8 = month8;
    }
    public void setMonth9(int month9) {
        this.month9 = month9;
    }
    public void setMonth10(int month10) {
        this.month10 = month10;
    }
    public void setMonth11(int month11) {
        this.month11 = month11;
    }
    public void setMonth12(int month12) {
        this.month12 = month12;
    }
    public void setQuarter1(int quarter1) {
        this.quarter1 = quarter1;
    }
    public void setQuarter2(int quarter2) {
        this.quarter2 = quarter2;
    }
    public void setQuarter3(int quarter3) {
        this.quarter3 = quarter3;
    }
    public void setQuarter4(int quarter4) {
        this.quarter4 = quarter4;
    }
    public void setYear_count(int year_count) {
        this.year_count = year_count;
    }
 
    
    
    public static void main(String[] args) {
        Date time = new Date();
        System.out.println(Com.getDateTimeFormat(time, Com.DTF_YMDhms) + "===" + "-" + (time.getMonth()+1));
    }
    
}