Commit ca707970 by 杜发飞

1

parent bcc380a2
...@@ -25,14 +25,14 @@ public class DailyAlarm implements Serializable { ...@@ -25,14 +25,14 @@ public class DailyAlarm implements Serializable {
private String date; //统计日期 - 当天 private String date; //统计日期 - 当天
@QuerySqlField @QuerySqlField
private Long number; //对应报警数 private Long alarmNumber; //对应报警数
public DailyAlarm(String province, String city, String area, String useNature, String date, Long number) { public DailyAlarm(String province, String city, String area, String useNature, String date, Long alarmNumber) {
this.province = province; this.province = province;
this.city = city; this.city = city;
this.area = area; this.area = area;
this.useNature = useNature; this.useNature = useNature;
this.date = date; this.date = date;
this.number = number; this.alarmNumber = alarmNumber;
} }
} }
...@@ -27,16 +27,16 @@ public class DailyAlarmUpdate implements CacheEntryProcessor<BinaryObject,Binary ...@@ -27,16 +27,16 @@ public class DailyAlarmUpdate implements CacheEntryProcessor<BinaryObject,Binary
if(statisticalDate.isBefore(today)){ //统计时间不是当前日,需要重置 if(statisticalDate.isBefore(today)){ //统计时间不是当前日,需要重置
builder.setField("date",today.toString("yyyy-MM-dd")); builder.setField("date",today.toString("yyyy-MM-dd"));
if(eventDate.equals(today)){ if(eventDate.equals(today)){
builder.setField("number",1L); builder.setField("alarmNumber",1L);
mutableEntry.setValue(builder.build()); mutableEntry.setValue(builder.build());
}else{ }else{
builder.setField("number",0L); builder.setField("alarmNumber",0L);
mutableEntry.setValue(builder.build()); mutableEntry.setValue(builder.build());
} }
}else{ }else{
if(eventDate.equals(today)){ if(eventDate.equals(today)){
Long old = value.<Long>field("number"); Long old = value.<Long>field("alarmNumber");
builder.setField("number",old +1); builder.setField("alarmNumber",old +1);
mutableEntry.setValue(builder.build()); mutableEntry.setValue(builder.build());
} }
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd"> http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean class="org.apache.ignite.configuration.IgniteConfiguration"> <bean class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="igniteInstanceName" value="dff"/> <property name="igniteInstanceName" value="sparkIgnite"/>
<property name="clientMode" value="true"/> <property name="clientMode" value="true"/>
<property name="consistentId" value="node"/> <property name="consistentId" value="node"/>
<property name="peerClassLoadingEnabled" value="true"/> <property name="peerClassLoadingEnabled" value="true"/>
......
...@@ -211,102 +211,8 @@ object IgniteClient { ...@@ -211,102 +211,8 @@ object IgniteClient {
def main(args: Array[String]): Unit = { def main(args: Array[String]): Unit = {
//ignite.cacheNames().asScala.foreach(println(_)) dailyAlarmNumberCache.clear()
/*basicPlatformInfo.destroy()
basicEnterpriseInfo.destroy()
basicVehicleInfo.destroy()
basicAlarmTypeInfo.destroy()*/
/*mileageCache.destroy()
driverNumberCache.destroy()
vehicleNumberCache.destroy()
alarmNumberCache.destroy()*/
/*attachmentCache.destroy()
dailyAlarmNumberCache.destroy()
dailyAlarmDealCache.destroy()
dailyAlarmDetailCache.destroy()*/
/*ignite.destroyCache("DailyAlarmProcess")
IgniteClient.dailyAlarmDealCache.clear()
val value = new DailyAlarmDeal("01","2","","001","2019-10-20 10:00:00",true)
IgniteClient.dailyAlarmDealCache.withKeepBinary().putIfAbsent(getBinaryObject(new PrimaryKey("01","2","001")),value)
val value1 = new DailyAlarmDeal("01","2","","002","2019-10-20 12:00:00",true)
IgniteClient.dailyAlarmDealCache.withKeepBinary().putIfAbsent(getBinaryObject(new PrimaryKey("01","2","002")),value1)
val value2 = new DailyAlarmDeal("01","2","","003","2019-10-20 12:00:00",true)
IgniteClient.dailyAlarmDealCache.withKeepBinary().putIfAbsent(getBinaryObject(new PrimaryKey("01","2","003")),value2)*/
val dailyAlarmDetail = new DailyAlarmDetail(
"33","01","01","01","2","",
"0x00","2019-10-21 10:00:00",119.980300,30.003100,1L,"CES")
IgniteClient.dailyAlarmDetailCache.withKeepBinary().put(getBinaryObject(new PrimaryKey("01","2","2019-10-20 10:00:00")),dailyAlarmDetail)
val attachmentInfo = new AttachmentInfo("100","01","2","1","0x00","2019-10-21 10:00:00","1","2","1","group1/M00/00/04/CsXsyV2pVeCAFrzkAAmT9ee1rNo169.mp4","")
attachmentCache.withKeepBinary().put(getBinaryObject(new PrimaryKey("xxxxxxxxxx1")),attachmentInfo)
val attachmentInfo1 = new AttachmentInfo("100","01","2","1","0x00","2019-10-21 10:00:00","1","2","2","group1/M00/00/00/CsXswl2pVcOAZmznAAD1j-V9mnE916.jpg","")
attachmentCache.withKeepBinary().put(getBinaryObject(new PrimaryKey("xxxxxxxxxx2")),attachmentInfo1)
val dailyAlarmDetail1 = new DailyAlarmDetail(
"33","01","01","01","2","",
"0x00","2019-10-21 10:10:00",119.980300,30.003100,1L,"CES1")
IgniteClient.dailyAlarmDetailCache.withKeepBinary().put(getBinaryObject(new PrimaryKey("01","2","2019-10-21 10:10:00")),dailyAlarmDetail1)
val attachmentInfo2 = new AttachmentInfo("100","01","3","1","0x00","2019-10-21 10:10:00","1","2","1","group1/M00/00/04/CsXsyV2pVeCAFrzkAAmT9ee1rNo169.mp4","")
attachmentCache.withKeepBinary().put(getBinaryObject(new PrimaryKey("xxxxxxxxxx3")),attachmentInfo2)
val attachmentInfo3 = new AttachmentInfo("100","01","4","1","0x00","2019-10-21 10:10:00","1","2","2","group1/M00/00/00/CsXswl2pVcOAZmznAAD1j-V9mnE916.jpg","")
attachmentCache.withKeepBinary().put(getBinaryObject(new PrimaryKey("xxxxxxxxxx4")),attachmentInfo3)
val dailyAlarmDetail2 = new DailyAlarmDetail(
"33","01","01","01","2","",
"0x00","2019-10-21 10:20:00",119.981400,30.103200,1L,"CES2")
IgniteClient.dailyAlarmDetailCache.withKeepBinary().put(getBinaryObject(new PrimaryKey("01","2","2019-10-20 10:20:00")),dailyAlarmDetail2)
val attachmentInfo4 = new AttachmentInfo("100","01","2","1","0x00","2019-10-21 10:20:00","1","2","1","group1/M00/00/04/CsXsyV2pVeCAFrzkAAmT9ee1rNo169.mp4","")
attachmentCache.withKeepBinary().put(getBinaryObject(new PrimaryKey("xxxxxxxxxx5")),attachmentInfo4)
val attachmentInfo5 = new AttachmentInfo("100","01","2","1","0x00","2019-10-21 10:20:00","1","2","2","group1/M00/00/00/CsXswl2pVcOAZmznAAD1j-V9mnE916.jpg","")
attachmentCache.withKeepBinary().put(getBinaryObject(new PrimaryKey("xxxxxxxxxx6")),attachmentInfo5)
val dailyAlarmDetail3 = new DailyAlarmDetail(
"33","01","01","01","2","",
"0x00","2019-10-21 10:30:00",119.990300,30.113100,1L,"CES")
IgniteClient.dailyAlarmDetailCache.withKeepBinary().put(getBinaryObject(new PrimaryKey("01","2","2019-10-21 10:30:00")),dailyAlarmDetail3)
val attachmentInfo6 = new AttachmentInfo("100","01","2","1","0x00","2019-10-21 10:30:00","1","2","1","group1/M00/00/04/CsXsyV2pVeCAFrzkAAmT9ee1rNo169.mp4","")
attachmentCache.withKeepBinary().put(getBinaryObject(new PrimaryKey("xxxxxxxxxx7")),attachmentInfo6)
val attachmentInfo17 = new AttachmentInfo("100","01","2","1","0x00","2019-10-21 10:30:00","1","2","2","group1/M00/00/00/CsXswl2pVcOAZmznAAD1j-V9mnE916.jpg","")
attachmentCache.withKeepBinary().put(getBinaryObject(new PrimaryKey("xxxxxxxxxx8")),attachmentInfo17)
val dailyAlarmDetail4 = new DailyAlarmDetail(
"33","01","01","01","2","",
"0x00","2019-10-21 10:40:00",119.960300,30.113110,1L,"CES")
IgniteClient.dailyAlarmDetailCache.withKeepBinary().put(getBinaryObject(new PrimaryKey("01","2","2019-10-21 10:40:00")),dailyAlarmDetail4)
val attachmentInfo8 = new AttachmentInfo("100","01","2","1","0x00","2019-10-21 10:40:00","1","2","1","group1/M00/00/04/CsXsyV2pVeCAFrzkAAmT9ee1rNo169.mp4","")
attachmentCache.withKeepBinary().put(getBinaryObject(new PrimaryKey("xxxxxxxxxx9")),attachmentInfo8)
val attachmentInfo19 = new AttachmentInfo("100","01","2","1","0x00","2019-10-21 10:40:00","1","2","2","group1/M00/00/00/CsXswl2pVcOAZmznAAD1j-V9mnE916.jpg","")
attachmentCache.withKeepBinary().put(getBinaryObject(new PrimaryKey("xxxxxxxxxx10")),attachmentInfo19)
//val query = new SqlFieldsQuery("select count(*) from DailyAlarmDeal where isDeal = true")
/*val me = new DailyTravel("33","08","01","","2019-10-12",200.00,200.00,"2019-10-20 17:02:00",10.00,1L,"11","22","33")
dailyTravelCache.withKeepBinary().withKeepBinary().put(getBinaryObject(new PrimaryKey("111")),me)
val d = new VehicleNumber("33","01","01","")
vehicleNumberCache.withKeepBinary().put(getBinaryObject(new PrimaryKey("1")),d)*/
ignite.close() ignite.close()
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment