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));
|
}
|
|
}
|