Browse Source

Merge branch 'master' of http://101.133.214.75:3000/lixinru/YtIoT

yq 4 years ago
parent
commit
eb3ca13468

+ 169 - 112
WebRoot/WEB-INF/hibernate.cfg.xml

@@ -1,120 +1,177 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
-                                         "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
 
 <hibernate-configuration>
 
 
+    <session-factory name="">
+        <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
+        <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
+        <property name="hibernate.connection.password">uskyIOT</property>
+        <property name="hibernate.connection.url">jdbc:mysql://47.98.201.187:3306/ytIoT?useUnicode=true&amp;characterEncoding=UTF-8&amp;autoReconnect=true&amp;autoReconnectForPools=true&amp;zeroDateTimeBehavior=convertToNull</property>
+        <property name="hibernate.connection.username">uskyIOT</property>
+        <property name="hibernate.connection.autocommit">true</property>
+        <property name="hibernate.connection.release_mode">after_statement</property>
+        <property name="hibernate.dialect">cn.com.usky.utils.DialectForInkfish</property>
+        <property name="hibernate.show_sql">true</property>
+        <property name="hibernate.format_sql">true</property>
+        <property name="hibernate.c3p0.max_size">10</property>
+        <property name="hibernate.c3p0.min_size">3</property>
+        <property name="hibernate.c3p0.timeout">1800</property>
+        <property name="hibernate.c3p0.max_statements">100</property>
+        <!--根据实体自动创建表-->
+        <property name="hbm2ddl.auto">update</property>
+        <!-- 最大执行的命令格个数 -->
+        <property name="hibernate.c3p0.idle_test_period">30000</property>
+        <!-- 空闲测试时间 -->
+        <property name="hibernate.c3p0.acquire_increment">2</property>
+        <!-- 连接不够用时,每次增加的个数 -->
+        <mapping class="cn.com.usky.iot.entity.YtiotTOrder" resource="cn/com/usky/iot/entity/YtiotTOrder.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTRelationCompanyAdmin"
+                 resource="cn/com/usky/iot/entity/YtiotTRelationCompanyAdmin.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTRelationverCompanyAdmin"
+                 resource="cn/com/usky/iot/entity/YtiotTRelationverCompanyAdmin.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTAdmin" resource="cn/com/usky/iot/entity/YtiotTAdmin.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTAdminVer"
+                 resource="cn/com/usky/iot/entity/YtiotTAdminVer.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTArea" resource="cn/com/usky/iot/entity/YtiotTArea.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTAreaver" resource="cn/com/usky/iot/entity/YtiotTAreaver.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTCompany" resource="cn/com/usky/iot/entity/YtiotTCompany.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTCompanyVer"
+                 resource="cn/com/usky/iot/entity/YtiotTCompanyVer.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTBuilding"
+                 resource="cn/com/usky/iot/entity/YtiotTBuilding.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTBuildingver"
+                 resource="cn/com/usky/iot/entity/YtiotTBuildingver.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTPoint" resource="cn/com/usky/iot/entity/YtiotTPoint.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTPointver"
+                 resource="cn/com/usky/iot/entity/YtiotTPointver.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTUnit" resource="cn/com/usky/iot/entity/YtiotTUnit.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTUnitver" resource="cn/com/usky/iot/entity/YtiotTUnitver.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotVCompany" resource="cn/com/usky/iot/entity/YtiotVCompany.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotVHj" resource="cn/com/usky/iot/entity/YtiotVHj.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotVEfire" resource="cn/com/usky/iot/entity/YtiotVEfire.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotVRtu" resource="cn/com/usky/iot/entity/YtiotVRtu.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotVLift" resource="cn/com/usky/iot/entity/YtiotVLift.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotVSj" resource="cn/com/usky/iot/entity/YtiotVSj.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotVSync" resource="cn/com/usky/iot/entity/YtiotVSync.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotVSyncData"
+                 resource="cn/com/usky/iot/entity/YtiotVSyncData.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotVSyncStatus"
+                 resource="cn/com/usky/iot/entity/YtiotVSyncStatus.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotVUsercompany"
+                 resource="cn/com/usky/iot/entity/YtiotVUsercompany.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotVUserphone"
+                 resource="cn/com/usky/iot/entity/YtiotVUserphone.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTQrcodeAnalysis"
+                 resource="cn/com/usky/iot/entity/YtiotTQrcodeAnalysis.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTPatrolPlan"
+                 resource="cn/com/usky/iot/entity/YtiotTPatrolPlan.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTInspectors"
+                 resource="cn/com/usky/iot/entity/YtiotTInspectors.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTInspectionRecord"
+                 resource="cn/com/usky/iot/entity/YtiotTInspectionRecord.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTRoute" resource="cn/com/usky/iot/entity/YtiotTRoute.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTPatrolPoint"
+                 resource="cn/com/usky/iot/entity/YtiotTPatrolPoint.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTcAlarmPackages"
+                 resource="cn/com/usky/iot/entity/YtiotTcAlarmPackages.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTcAlarmPackagesZb"
+                 resource="cn/com/usky/iot/entity/YtiotTcAlarmPackagesZb.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTcOutgoingAlarm"
+                 resource="cn/com/usky/iot/entity/YtiotTcOutgoingAlarm.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotVVideoalarm"
+                 resource="cn/com/usky/iot/entity/YtiotVVideoalarm.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTInterface"
+                 resource="cn/com/usky/iot/entity/YtiotTInterface.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTInterfaceU"
+                 resource="cn/com/usky/iot/entity/YtiotTInterfaceU.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTInterfaceUc"
+                 resource="cn/com/usky/iot/entity/YtiotTInterfaceUc.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotVObject" resource="cn/com/usky/iot/entity/YtiotVObject.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTQrcodeAnalysis2"
+                 resource="cn/com/usky/iot/entity/YtiotTQrcodeAnalysis2.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTMaintenance"
+                 resource="cn/com/usky/iot/entity/YtiotTMaintenance.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTRoute2" resource="cn/com/usky/iot/entity/YtiotTRoute2.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTMaintenancePerson"
+                 resource="cn/com/usky/iot/entity/YtiotTMaintenancePerson.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTMaintenancePlan"
+                 resource="cn/com/usky/iot/entity/YtiotTMaintenancePlan.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTMaintenanceRecord"
+                 resource="cn/com/usky/iot/entity/YtiotTMaintenanceRecord.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotXjInspectionPoints"
+                 resource="cn/com/usky/iot/entity/YtiotXjInspectionPoints.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotXjInspectors"
+                 resource="cn/com/usky/iot/entity/YtiotXjInspectors.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotXjInspectorsCompany"
+                 resource="cn/com/usky/iot/entity/YtiotXjInspectorsCompany.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotXjOperationRecordPhotos"
+                 resource="cn/com/usky/iot/entity/YtiotXjOperationRecordPhotos.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotXjPlanChild"
+                 resource="cn/com/usky/iot/entity/YtiotXjPlanChild.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotXjPlanMaster"
+                 resource="cn/com/usky/iot/entity/YtiotXjPlanMaster.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotXjPlanSpot"
+                 resource="cn/com/usky/iot/entity/YtiotXjPlanSpot.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotXjPlanTeam"
+                 resource="cn/com/usky/iot/entity/YtiotXjPlanTeam.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotXjSpotEquipment"
+                 resource="cn/com/usky/iot/entity/YtiotXjSpotEquipment.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotXjSpotOperationRecord"
+                 resource="cn/com/usky/iot/entity/YtiotXjSpotOperationRecord.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotXjTeamPersonnel"
+                 resource="cn/com/usky/iot/entity/YtiotXjTeamPersonnel.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTProjectDetails"
+                 resource="cn/com/usky/iot/entity/YtiotTProjectDetails.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTProjectDevice"
+                 resource="cn/com/usky/iot/entity/YtiotTProjectDevice.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTProjectMonitor"
+                 resource="cn/com/usky/iot/entity/YtiotTProjectMonitor.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotVDeviceStatus"
+                 resource="cn/com/usky/iot/entity/YtiotVDeviceStatus.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotXjEventProcessing"
+                 resource="cn/com/usky/iot/entity/YtiotXjEventProcessing.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotXjToExamine"
+                 resource="cn/com/usky/iot/entity/YtiotXjToExamine.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotXjToExamine1"
+                 resource="cn/com/usky/iot/entity/YtiotXjToExamine1.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotYyPzb" resource="cn/com/usky/iot/entity/YtiotYyPzb.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotYyPzb2" resource="cn/com/usky/iot/entity/YtiotYyPzb2.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotYySjjl" resource="cn/com/usky/iot/entity/YtiotYySjjl.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotYyCzjl" resource="cn/com/usky/iot/entity/YtiotYyCzjl.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotYyXhconfig"
+                 resource="cn/com/usky/iot/entity/YtiotYyXhconfig.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotVideoAlarm"
+                 resource="cn/com/usky/iot/entity/YtiotVideoAlarm.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotVideoAlarm2" resource="cn/com/usky/iot/entity/YtiotVideo2.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotVideoOffline"
+                 resource="cn/com/usky/iot/entity/YtiotVideoOffline.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.MqttBean" resource="cn/com/usky/iot/entity/MqttBean.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.MqttBeanAlarm" resource="cn/com/usky/iot/entity/MqttBeanAlarm.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.Hj2017Bean" resource="cn/com/usky/iot/entity/Hj2017Bean.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.Sp_owner" resource="cn/com/usky/iot/entity/Sp_owner.xml"/>
+        <mapping class="cn.com.usky.iot.entity.Sp_owner_phone" resource="cn/com/usky/iot/entity/Sp_owner_phone.xml"/>
+        <mapping class="cn.com.usky.iot.entity.MonthReport" resource="cn/com/usky/iot/entity/MonthRepor.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YearReport" resource="cn/com/usky/iot/entity/YearReport.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.firestation.YtiotFireStationEntity"
+                 resource="cn/com/usky/iot/entity/firestation/YtiotFireStationEntity.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.contract.YtiotContractEntity"
+                 resource="cn/com/usky/iot/entity/contract/YtiotContractEntity.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.group.YtTGroupEntity"
+                 resource="cn/com/usky/iot/entity/group/YtTGroupEntity.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTControlroom"
+                 resource="cn/com/usky/iot/entity/YtiotTControlroom.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.group.YtiotVDeviceEntity"
+                 resource="cn/com/usky/iot/entity/group/YtiotVDeviceEntity.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTEfAnalysis"
+                 resource="cn/com/usky/iot/entity/YtiotTEfAnalysis.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTWaterAnalysis"
+                 resource="cn/com/usky/iot/entity/YtiotTWaterAnalysis.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.YtiotTAdminStateEntity"
+                 resource="cn/com/usky/iot/entity/YtiotTAdminStateEntity.hbm.xml"/>
+        <mapping class="cn.com.usky.iot.entity.sys.SysLogDTO" resource="cn/com/usky/iot/entity/sys/SysLogDTO.hbm.xml"/>
 
- <session-factory name="">
-  <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
-  <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
-  <property name="hibernate.connection.password">uskyIOT</property>
-  <property name="hibernate.connection.url">jdbc:mysql://47.98.201.187:3306/ytIoT?useUnicode=true&amp;characterEncoding=UTF-8&amp;autoReconnect=true&amp;autoReconnectForPools=true&amp;zeroDateTimeBehavior=convertToNull</property>
-  <property name="hibernate.connection.username">uskyIOT</property>
-  <property name="hibernate.connection.autocommit">true</property>
-  <property name="hibernate.connection.release_mode">after_statement</property>
-  <property name="hibernate.dialect">cn.com.usky.utils.DialectForInkfish</property>
-  <property name="hibernate.show_sql">true</property>
-  <property name="hibernate.format_sql">true</property>
-  <property name="hibernate.c3p0.max_size">10</property>
-  <property name="hibernate.c3p0.min_size">3</property>
-  <property name="hibernate.c3p0.timeout">1800</property>
-  <property name="hibernate.c3p0.max_statements">100</property>
-  <!--根据实体自动创建表-->
-  <property name="hbm2ddl.auto">update</property>
-  <!-- 最大执行的命令格个数 -->
-  <property name="hibernate.c3p0.idle_test_period">30000</property>
-  <!-- 空闲测试时间 -->
-  <property name="hibernate.c3p0.acquire_increment">2</property>
-  <!-- 连接不够用时,每次增加的个数 -->
-  <mapping class="cn.com.usky.iot.entity.YtiotTOrder" resource="cn/com/usky/iot/entity/YtiotTOrder.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTRelationCompanyAdmin" resource="cn/com/usky/iot/entity/YtiotTRelationCompanyAdmin.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTRelationverCompanyAdmin" resource="cn/com/usky/iot/entity/YtiotTRelationverCompanyAdmin.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTAdmin" resource="cn/com/usky/iot/entity/YtiotTAdmin.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTAdminVer" resource="cn/com/usky/iot/entity/YtiotTAdminVer.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTArea" resource="cn/com/usky/iot/entity/YtiotTArea.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTAreaver" resource="cn/com/usky/iot/entity/YtiotTAreaver.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTCompany" resource="cn/com/usky/iot/entity/YtiotTCompany.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTCompanyVer" resource="cn/com/usky/iot/entity/YtiotTCompanyVer.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTBuilding" resource="cn/com/usky/iot/entity/YtiotTBuilding.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTBuildingver" resource="cn/com/usky/iot/entity/YtiotTBuildingver.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTPoint" resource="cn/com/usky/iot/entity/YtiotTPoint.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTPointver" resource="cn/com/usky/iot/entity/YtiotTPointver.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTUnit" resource="cn/com/usky/iot/entity/YtiotTUnit.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTUnitver" resource="cn/com/usky/iot/entity/YtiotTUnitver.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotVCompany" resource="cn/com/usky/iot/entity/YtiotVCompany.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotVHj" resource="cn/com/usky/iot/entity/YtiotVHj.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotVEfire" resource="cn/com/usky/iot/entity/YtiotVEfire.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotVRtu" resource="cn/com/usky/iot/entity/YtiotVRtu.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotVLift" resource="cn/com/usky/iot/entity/YtiotVLift.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotVSj" resource="cn/com/usky/iot/entity/YtiotVSj.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotVSync" resource="cn/com/usky/iot/entity/YtiotVSync.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotVSyncData" resource="cn/com/usky/iot/entity/YtiotVSyncData.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotVSyncStatus" resource="cn/com/usky/iot/entity/YtiotVSyncStatus.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotVUsercompany" resource="cn/com/usky/iot/entity/YtiotVUsercompany.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotVUserphone" resource="cn/com/usky/iot/entity/YtiotVUserphone.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTQrcodeAnalysis" resource="cn/com/usky/iot/entity/YtiotTQrcodeAnalysis.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTPatrolPlan" resource="cn/com/usky/iot/entity/YtiotTPatrolPlan.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTInspectors" resource="cn/com/usky/iot/entity/YtiotTInspectors.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTInspectionRecord" resource="cn/com/usky/iot/entity/YtiotTInspectionRecord.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTRoute" resource="cn/com/usky/iot/entity/YtiotTRoute.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTPatrolPoint" resource="cn/com/usky/iot/entity/YtiotTPatrolPoint.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTcAlarmPackages" resource="cn/com/usky/iot/entity/YtiotTcAlarmPackages.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTcAlarmPackagesZb" resource="cn/com/usky/iot/entity/YtiotTcAlarmPackagesZb.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTcOutgoingAlarm" resource="cn/com/usky/iot/entity/YtiotTcOutgoingAlarm.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotVVideoalarm" resource="cn/com/usky/iot/entity/YtiotVVideoalarm.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTInterface" resource="cn/com/usky/iot/entity/YtiotTInterface.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTInterfaceU" resource="cn/com/usky/iot/entity/YtiotTInterfaceU.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTInterfaceUc" resource="cn/com/usky/iot/entity/YtiotTInterfaceUc.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotVObject" resource="cn/com/usky/iot/entity/YtiotVObject.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTQrcodeAnalysis2" resource="cn/com/usky/iot/entity/YtiotTQrcodeAnalysis2.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTMaintenance" resource="cn/com/usky/iot/entity/YtiotTMaintenance.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTRoute2" resource="cn/com/usky/iot/entity/YtiotTRoute2.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTMaintenancePerson" resource="cn/com/usky/iot/entity/YtiotTMaintenancePerson.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTMaintenancePlan" resource="cn/com/usky/iot/entity/YtiotTMaintenancePlan.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTMaintenanceRecord" resource="cn/com/usky/iot/entity/YtiotTMaintenanceRecord.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotXjInspectionPoints" resource="cn/com/usky/iot/entity/YtiotXjInspectionPoints.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotXjInspectors" resource="cn/com/usky/iot/entity/YtiotXjInspectors.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotXjInspectorsCompany" resource="cn/com/usky/iot/entity/YtiotXjInspectorsCompany.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotXjOperationRecordPhotos" resource="cn/com/usky/iot/entity/YtiotXjOperationRecordPhotos.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotXjPlanChild" resource="cn/com/usky/iot/entity/YtiotXjPlanChild.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotXjPlanMaster" resource="cn/com/usky/iot/entity/YtiotXjPlanMaster.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotXjPlanSpot" resource="cn/com/usky/iot/entity/YtiotXjPlanSpot.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotXjPlanTeam" resource="cn/com/usky/iot/entity/YtiotXjPlanTeam.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotXjSpotEquipment" resource="cn/com/usky/iot/entity/YtiotXjSpotEquipment.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotXjSpotOperationRecord" resource="cn/com/usky/iot/entity/YtiotXjSpotOperationRecord.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotXjTeamPersonnel" resource="cn/com/usky/iot/entity/YtiotXjTeamPersonnel.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTProjectDetails" resource="cn/com/usky/iot/entity/YtiotTProjectDetails.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTProjectDevice" resource="cn/com/usky/iot/entity/YtiotTProjectDevice.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTProjectMonitor" resource="cn/com/usky/iot/entity/YtiotTProjectMonitor.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotVDeviceStatus" resource="cn/com/usky/iot/entity/YtiotVDeviceStatus.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotXjEventProcessing" resource="cn/com/usky/iot/entity/YtiotXjEventProcessing.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotXjToExamine" resource="cn/com/usky/iot/entity/YtiotXjToExamine.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotXjToExamine1" resource="cn/com/usky/iot/entity/YtiotXjToExamine1.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotYyPzb" resource="cn/com/usky/iot/entity/YtiotYyPzb.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotYyPzb2" resource="cn/com/usky/iot/entity/YtiotYyPzb2.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotYySjjl" resource="cn/com/usky/iot/entity/YtiotYySjjl.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotYyCzjl" resource="cn/com/usky/iot/entity/YtiotYyCzjl.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotYyXhconfig" resource="cn/com/usky/iot/entity/YtiotYyXhconfig.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotVideoAlarm" resource="cn/com/usky/iot/entity/YtiotVideoAlarm.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotVideoAlarm2" resource="cn/com/usky/iot/entity/YtiotVideo2.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotVideoOffline" resource="cn/com/usky/iot/entity/YtiotVideoOffline.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.MqttBean" resource="cn/com/usky/iot/entity/MqttBean.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.MqttBeanAlarm" resource="cn/com/usky/iot/entity/MqttBeanAlarm.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.Hj2017Bean" resource="cn/com/usky/iot/entity/Hj2017Bean.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.Sp_owner" resource="cn/com/usky/iot/entity/Sp_owner.xml"/>
-  <mapping class="cn.com.usky.iot.entity.Sp_owner_phone" resource="cn/com/usky/iot/entity/Sp_owner_phone.xml"/>
-  <mapping class="cn.com.usky.iot.entity.MonthReport" resource="cn/com/usky/iot/entity/MonthRepor.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YearReport" resource="cn/com/usky/iot/entity/YearReport.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.firestation.YtiotFireStationEntity" resource="cn/com/usky/iot/entity/firestation/YtiotFireStationEntity.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.contract.YtiotContractEntity" resource="cn/com/usky/iot/entity/contract/YtiotContractEntity.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.group.YtTGroupEntity" resource="cn/com/usky/iot/entity/group/YtTGroupEntity.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTControlroom" resource="cn/com/usky/iot/entity/YtiotTControlroom.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.group.YtiotVDeviceEntity" resource="cn/com/usky/iot/entity/group/YtiotVDeviceEntity.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTEfAnalysis" resource="cn/com/usky/iot/entity/YtiotTEfAnalysis.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTWaterAnalysis" resource="cn/com/usky/iot/entity/YtiotTWaterAnalysis.hbm.xml"/>
-  <mapping class="cn.com.usky.iot.entity.YtiotTAdminStateEntity" resource="cn/com/usky/iot/entity/YtiotTAdminStateEntity.hbm.xml"/>
-
- </session-factory>
+    </session-factory>
 </hibernate-configuration>

BIN
WebRoot/WEB-INF/lib/aspectjrt-1.6.2.jar


BIN
WebRoot/WEB-INF/lib/aspectjweaver-1.9.2.jar


BIN
WebRoot/WEB-INF/lib/c3p0-0.9.5.2-sources.jar


+ 40 - 9
WebRoot/WEB-INF/spring-servlet.xml

@@ -4,16 +4,15 @@
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:mvc="http://www.springframework.org/schema/mvc"
+       xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
 
-       xsi:schemaLocation="
-    http://www.springframework.org/schema/beans
-    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-    http://www.springframework.org/schema/context
-    http://www.springframework.org/schema/context/spring-context-3.0.xsd
-    http://www.springframework.org/schema/task  
-	http://www.springframework.org/schema/task/spring-task-3.0.xsd
-    http://www.springframework.org/schema/mvc  
-    http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+   http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/mvc
+        http://www.springframework.org/schema/mvc/spring-mvc.xsd
+        http://www.springframework.org/schema/context
+        http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
+   ">
     <!-- 默认的注解映射的支持 -->
     <mvc:annotation-driven/>
     <!--启用自动扫描  -->
@@ -24,6 +23,17 @@
     <task:annotation-driven scheduler="qbScheduler" mode="proxy"/>
     <task:scheduler id="qbScheduler" pool-size="10"/>
 
+    <aop:config>
+        <!-- 切面 -->
+        <aop:aspect ref="AutoLogAspect">
+            <!-- 定义切点 -->
+            <aop:pointcut expression="@annotation(cn.com.usky.iot.annotion.AutoLog)" id="pt"/>
+            <!-- 声明环绕通知 -->
+            <aop:around method="around" pointcut-ref="pt"/>
+        </aop:aspect>
+    </aop:config>
+
+
     <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
         <property name="prefix" value="/opt/"/>
         <property name="suffix" value=".jsp"/>
@@ -1345,6 +1355,14 @@
             <ref bean="daoQuery"/>
         </property>
     </bean>
+
+    <bean id="LogServiceImpl" class="cn.com.usky.log.LogServiceImpl">
+        <property name="hibernateTemplate">
+            <ref bean="hibernateTemplate"/>
+        </property>
+
+    </bean>
+
     <bean id="ytiotTAdminStateEntityService"
           class="cn.com.usky.iot.userstatus.service.YtiotTAdminStateEntityServicesImpl">
         <property name="ytiotTAdminStateEntityDao">
@@ -1357,4 +1375,17 @@
             <ref bean="ytiotTEfAnalysisDao"/>
         </property>
     </bean>
+
+
+    <bean id="AutoLogAspect"
+          class="cn.com.usky.iot.aspect.AutoLogAspect">
+        <property name="TokenAuthService">
+            <ref bean="TokenAuthService"/>
+        </property>
+        <property name="LogServiceImpl">
+            <ref bean="LogServiceImpl"/>
+        </property>
+
+    </bean>
+
 </beans>

+ 74 - 72
WebRoot/WEB-INF/web.xml

@@ -1,76 +1,78 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
-  <display-name>YtIoT</display-name>
-   <filter>
-  <display-name>SetCharacterEncoding</display-name>
-  <filter-name>SetCharacterEncoding</filter-name>
-  <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
-  <init-param>
-   <param-name>encoding</param-name>
-   <param-value>utf-8</param-value>
-  </init-param>
-  <init-param>
-   <param-name>forceEncoding</param-name>
-   <param-value>true</param-value>
-  </init-param>
- </filter>
- <filter-mapping>
-  <filter-name>SetCharacterEncoding</filter-name>
-  <url-pattern>/*</url-pattern>
- </filter-mapping>
- <servlet>
-  <servlet-name>mvc</servlet-name>
-  <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
-  <init-param>
-   <param-name>contextConfigLocation</param-name>
-   <param-value>WEB-INF/spring-servlet.xml</param-value>
-  </init-param>
-  <load-on-startup>1</load-on-startup>
- </servlet>
- <servlet>
-  <servlet-name>default</servlet-name>
-  <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
-  <init-param>
-   <param-name>debug</param-name>
-   <param-value>0</param-value>
-  </init-param>
-  <init-param>
-   <param-name>listings</param-name>
-   <param-value>false</param-value>
-  </init-param>
-  <load-on-startup>1</load-on-startup>
- </servlet>
- <servlet-mapping>
-  <servlet-name>mvc</servlet-name>
-  <url-pattern>/</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
-  <servlet-name>default</servlet-name>
-  <url-pattern>*.js</url-pattern>
-  <url-pattern>*.css</url-pattern>
-  <url-pattern>*.jpg</url-pattern>
-  <url-pattern>*.jpeg</url-pattern>
-  <url-pattern>*.gif</url-pattern>
-  <url-pattern>*.png</url-pattern>
-  <url-pattern>*.xls</url-pattern>
-  <url-pattern>*.html</url-pattern>
-  
- </servlet-mapping>
- <session-config>
-  <session-timeout>15</session-timeout>
- </session-config>
-  <welcome-file-list>
-    <welcome-file>index.html</welcome-file>
-    <welcome-file>index.htm</welcome-file>
-    <welcome-file>index.jsp</welcome-file>
-    <welcome-file>default.html</welcome-file>
-    <welcome-file>default.htm</welcome-file>
-    <welcome-file>default.jsp</welcome-file>
-  </welcome-file-list>
-  <error-page>
-		<error-code>404</error-code>
-		<location>/err/404.jsp</location>
-	</error-page>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+         id="WebApp_ID" version="3.0">
+    <display-name>YtIoT</display-name>
+    <filter>
+        <display-name>SetCharacterEncoding</display-name>
+        <filter-name>SetCharacterEncoding</filter-name>
+        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
+        <init-param>
+            <param-name>encoding</param-name>
+            <param-value>utf-8</param-value>
+        </init-param>
+        <init-param>
+            <param-name>forceEncoding</param-name>
+            <param-value>true</param-value>
+        </init-param>
+    </filter>
+    <filter-mapping>
+        <filter-name>SetCharacterEncoding</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+    <servlet>
+        <servlet-name>mvc</servlet-name>
+        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+        <init-param>
+            <param-name>contextConfigLocation</param-name>
+            <param-value>WEB-INF/spring-servlet.xml</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet>
+        <servlet-name>default</servlet-name>
+        <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
+        <init-param>
+            <param-name>debug</param-name>
+            <param-value>0</param-value>
+        </init-param>
+        <init-param>
+            <param-name>listings</param-name>
+            <param-value>false</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>mvc</servlet-name>
+        <url-pattern>/</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>default</servlet-name>
+        <url-pattern>*.js</url-pattern>
+        <url-pattern>*.css</url-pattern>
+        <url-pattern>*.jpg</url-pattern>
+        <url-pattern>*.jpeg</url-pattern>
+        <url-pattern>*.gif</url-pattern>
+        <url-pattern>*.png</url-pattern>
+        <url-pattern>*.xls</url-pattern>
+        <url-pattern>*.html</url-pattern>
+
+    </servlet-mapping>
+    <session-config>
+        <session-timeout>15</session-timeout>
+    </session-config>
+    <welcome-file-list>
+        <welcome-file>index.html</welcome-file>
+        <welcome-file>index.htm</welcome-file>
+        <welcome-file>index.jsp</welcome-file>
+        <welcome-file>default.html</welcome-file>
+        <welcome-file>default.htm</welcome-file>
+        <welcome-file>default.jsp</welcome-file>
+    </welcome-file-list>
+    <error-page>
+        <error-code>404</error-code>
+        <location>/err/404.jsp</location>
+    </error-page>
 
     <filter>
         <filter-name>XssSqlFilter</filter-name>

+ 2 - 1
WebRoot/view/frontpage/js/index.js

@@ -282,7 +282,8 @@
                 qobj.V_COMPANYID = company_code;
                 qobj.I_COMMAND = 4;
                 var qdata = "queryJson=" + JSON.stringify(qobj);
-                var qurl = 'https://iot.usky.cn/YtIoT/cgi-bin/WebAction2.cgi';
+            //    var qurl = 'https://iot.usky.cn/YtIoT/cgi-bin/WebAction2.cgi';
+                var qurl = 'http://47.103.74.123:8080/YtIoT/cgi-bin/WebAction.cgi';
                 $.ajax({
                     type: 'POST',
                     url: qurl,

+ 4 - 2
WebRoot/view/frontpage/js/map.js

@@ -286,7 +286,8 @@ var showInfo = function(e){
 			qobj.V_COMPANYID = company_code;
 			qobj.I_COMMAND = 4;
 			var qdata = "queryJson="+JSON.stringify(qobj);
-			var qurl = 'https://iot.usky.cn/YtIoT/cgi-bin/WebAction2.cgi';
+		//	var qurl = 'https://iot.usky.cn/YtIoT/cgi-bin/WebAction2.cgi';
+			var qurl = 'http://47.103.74.123:8080/YtIoT/cgi-bin/WebAction.cgi';
 			$.ajax({
 				type:'POST',
 				url: qurl,
@@ -1501,7 +1502,8 @@ var showOperat = function(){
 		qobj.V_COMPANYID = company_code;
 		qobj.I_COMMAND = 4;
 		var qdata = "queryJson="+JSON.stringify(qobj);
-		var qurl = 'https://47.103.74.123:8080/YtIoT/cgi-bin/WebAction2.cgi';
+	//	var qurl = 'https://47.103.74.123:8080/YtIoT/cgi-bin/WebAction2.cgi';
+		var qurl = 'http://47.103.74.123:8080/YtIoT/cgi-bin/WebAction.cgi';
 		for(var i=0;i<StatusStore.length;i++){
 			var obj = StatusStore[i];
 			d1  += obj.d1;

+ 10 - 10
WebRoot/view/frontpage/scripts/company.js

@@ -295,7 +295,7 @@ var draw_buinding = function () {
         $("#company_building").removeClass('company_building');
         $("#company_building").addClass('company_building_on');
         var company_building = document.getElementById('company_building');
-        company_building.innerHTML = '<iframe id="myIframe" name="thingjs" src="https://www.thingjs.com/s/b11227d4fd5505106989737c?params=105b0f77fd24654d4eebc434e9" style="width:146%;height:123%;border:1px solid #0082ff;"></iframe>';
+        company_building.innerHTML = '<iframe id="myIframe" name="thingjs" src="http://www.thingjs.com/s/b11227d4fd5505106989737c?params=105b0f77fd24654d4eebc434e9" style="width:146%;height:123%;border:1px solid #0082ff;"></iframe>';
 
         var t1 = window.setTimeout(function () {
             //     console.log(buildingStore);
@@ -1959,7 +1959,7 @@ var show_userinfo_detail = function (devId) {
                 query.CMD = 91;
                 query.LIMIT = 10;
                 var qjson = Ext.JSON.encode(query);
-                var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
+                var url = ((company_code == "10012") ? "https://fire.usky.cn:8443/YtIoT/cgi-bin/DPAction2.cgi?t=" : "https://fire.usky.cn:8443/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
                 $.ajax({
                     type: 'POST',
                     url: url,
@@ -1982,7 +1982,7 @@ var show_userinfo_detail = function (devId) {
                 query.CMD = 92;
                 query.LIMIT = 0;
                 var qjson = Ext.JSON.encode(query);
-                var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
+                var url = ((company_code == "10012") ? "https://fire.usky.cn:8443/YtIoT/cgi-bin/DPAction2.cgi?t=" : "https://fire.usky.cn:8443/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
                 $.ajax({
                     type: 'POST',
                     url: url,
@@ -2007,7 +2007,7 @@ var show_userinfo_detail = function (devId) {
                 query.CMD = 93;
                 query.PARAM = 0;
                 var qjson = Ext.JSON.encode(query);
-                var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
+                var url = ((company_code == "10012") ? "https://fire.usky.cn:8443/YtIoT/cgi-bin/DPAction2.cgi?t=" : "https://fire.usky.cn:8443/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
                 $.ajax({
                     type: 'POST',
                     url: url,
@@ -2067,7 +2067,7 @@ var show_userinfo_detail = function (devId) {
                                 query.CMD = 95;
                                 query.PARAM = pushtts ? 1 : 0;
                                 var qjson = Ext.JSON.encode(query);
-                                var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
+                                var url = ((company_code == "10012") ? "https://fire.usky.cn:8443/YtIoT/cgi-bin/DPAction2.cgi?t=" : "https://fire.usky.cn:8443/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
                                 $.ajax({
                                     type: 'POST',
                                     url: url,
@@ -2099,7 +2099,7 @@ var show_userinfo_detail = function (devId) {
                                 query.CMD = 93;
                                 query.PARAM = 0;
                                 var qjson = Ext.JSON.encode(query);
-                                var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
+                                var url = ((company_code == "10012") ? "https://fire.usky.cn:8443/YtIoT/cgi-bin/DPAction2.cgi?t=" : "https://fire.usky.cn:8443/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
                                 $.ajax({
                                     type: 'POST',
                                     url: url,
@@ -2156,7 +2156,7 @@ var show_userinfo_detail = function (devId) {
                                 query.CMD = 94;
                                 query.PARAM = pushalarm ? 1 : 0;
                                 var qjson = Ext.JSON.encode(query);
-                                var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
+                                var url = ((company_code == "10012") ? "https://fire.usky.cn:8443/YtIoT/cgi-bin/DPAction2.cgi?t=" : "https://fire.usky.cn:8443/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
                                 $.ajax({
                                     type: 'POST',
                                     url: url,
@@ -2188,7 +2188,7 @@ var show_userinfo_detail = function (devId) {
                                 query.CMD = 93;
                                 query.PARAM = 0;
                                 var qjson = Ext.JSON.encode(query);
-                                var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
+                                var url = ((company_code == "10012") ? "https://fire.usky.cn:8443/YtIoT/cgi-bin/DPAction2.cgi?t=" : "https://fire.usky.cn:8443/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
                                 $.ajax({
                                     type: 'POST',
                                     url: url,
@@ -2216,7 +2216,7 @@ var show_userinfo_detail = function (devId) {
     query.CMD = 93;
     query.PARAM = 0;
     var qjson = Ext.JSON.encode(query);
-    var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
+    var url = ((company_code == "10012") ? "https://fire.usky.cn:8443/YtIoT/cgi-bin/DPAction2.cgi?t=" : "https://fire.usky.cn:8443/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
     $.ajax({
         type: 'POST',
         url: url,
@@ -2859,4 +2859,4 @@ Ext.onReady(function () {
         body_resize();
     });
     body_resize();
-});
+});

+ 2862 - 0
WebRoot/view/frontpage/scripts/company.js.bak

@@ -0,0 +1,2862 @@
+/**
+ * company.js
+ */
+
+var basePath;
+var company_code;
+var V_LOGINNAME;
+var V_PASSWORD;
+var storeTime = 60000;
+var buildingStore = null,
+    companyStore = null,
+    devicesStore = null;
+var building_name;
+var max_level = 0;
+var min_level = 0;
+var top_level = 0;
+var default_check = 65535;
+var myMask;
+var show_project_info = true;
+var start = 0;
+var end = 360;
+var theme;
+var vAlarmInfoWin;
+var online_video = false;
+var onair_video = false;
+var ConfirmStore;
+var modifywin;
+var had_play = false;
+var fillvalue = false;
+
+
+Ext.Loader.setConfig({
+    enabled: true
+});
+
+Ext.Loader.setPath('Ext.ux', '../../res/extjs/examples/ux');
+
+Ext.require([
+    'Ext.grid.*',
+    'Ext.data.*',
+    'Ext.ux.RowExpander',
+    'Ext.selection.CheckboxModel'
+]);
+
+var bak_to_front = function () {
+    location.href = basePath + 'view/frontpage/map.jsp?company_code=' + company_code;
+}
+
+var staSortBypoint = function (a, b) {
+    return a.point_code - b.point_code;
+    ;
+}
+
+var body_resize = function () {
+    $("#company_bg_mm").css('display', 'none');
+    if ($(document).innerWidth() >= 1820) {
+        $("#company_bg_tm").css('display', 'block');
+        $("#company_bg_tm").css('width', ($(document).innerWidth() - 1820) + 'px');
+        $("#company_bg_bm").css('display', 'block');
+        $("#company_bg_bm").css('width', ($(document).innerWidth() - 1820) + 'px');
+    } else {
+        $("#company_bg_tm").css('display', 'none');
+        $("#company_bg_bm").css('display', 'none');
+    }
+    if ($(document).innerHeight() >= 932) {
+        $("#company_bg_ml").css('display', 'block');
+        $("#company_bg_mr").css('display', 'block');
+        $("#company_bg_ml").css('height', ($(document).innerHeight() - 932) + 'px');
+        $("#company_bg_mr").css('height', ($(document).innerHeight() - 932) + 'px');
+        if ($(document).innerWidth() >= 1820) {
+            $("#company_bg_mm").css('display', 'block');
+            $("#company_bg_mm").css('height', ($(document).innerHeight() - 932) + 'px');
+            $("#company_bg_mm").css('width', ($(document).innerWidth() - 1820) + 'px');
+        }
+    } else {
+        $("#company_bg_ml").css('display', 'none');
+        $("#company_bg_mr").css('display', 'none');
+    }
+    $("#company_building").css('height', ($(document).innerHeight() - 328) + 'px');
+    $("#history_alarm_list").css('width', ($(document).innerWidth() - 975) + 'px');
+    $("#history_alarm_list").css('height', ($(document).innerHeight() - 616) + 'px');
+    $("#project_info_bar").css('width', ($(document).innerWidth() - 975) + 'px');
+}
+
+var chk_click_big = function (obj) {
+    location.href = basePath + 'view/3dBig/index.jsp?theme=' + theme + '&company_code=' + ($("#company_code").val());
+}
+
+
+var chk_click = function (obj) {
+    if ((obj.id == 'dev_all_checkbox') || (obj.id == 'dev_all_checklabel')) {
+        if (default_check != 65535)
+            default_check = 65535;
+        else
+            default_check = 0;
+    } else if ((obj.id == 'dev_ui_checkbox') || (obj.id == 'dev_ui_checklabel')) {
+        if ((default_check & 1) == 1)
+            default_check = (default_check & 65534);
+        else
+            default_check = (default_check | 1);
+    } else if ((obj.id == 'dev_fc_checkbox') || (obj.id == 'dev_fc_checklabel')) {
+        if ((default_check & 2) == 2)
+            default_check = (default_check & 65533);
+        else
+            default_check = (default_check | 2);
+    } else if ((obj.id == 'dev_ef_checkbox') || (obj.id == 'dev_ef_checklabel')) {
+        if ((default_check & 4) == 4)
+            default_check = (default_check & 65531);
+        else
+            default_check = (default_check | 4);
+    } else if ((obj.id == 'dev_wp_checkbox') || (obj.id == 'dev_wp_checklabel')) {
+        if ((default_check & 8) == 8)
+            default_check = (default_check & 65527);
+        else
+            default_check = (default_check | 8);
+    } else if ((obj.id == 'dev_ll_checkbox') || (obj.id == 'dev_ll_checklabel')) {
+        if ((default_check & 16) == 16)
+            default_check = (default_check & 65519);
+        else
+            default_check = (default_check | 16);
+    } else if ((obj.id == 'dev_ci_checkbox') || (obj.id == 'dev_ci_checklabel')) {
+        if ((default_check & 32) == 32)
+            default_check = (default_check & 65503);
+        else
+            default_check = (default_check | 32);
+    } else if ((obj.id == 'dev_va_checkbox') || (obj.id == 'dev_va_checklabel')) {
+        if ((default_check & 64) == 64)
+            default_check = (default_check & 65471);
+        else
+            default_check = (default_check | 64);
+    } else if ((obj.id == 'dev_ot_checkbox') || (obj.id == 'dev_ot_checklabel')) {
+        if ((default_check & 128) == 128)
+            default_check = (default_check & 65407);
+        else
+            default_check = (default_check | 128);
+    } else if ((obj.id == 'dev_sm_checkbox') || (obj.id == 'dev_sm_checklabel')) {
+        if ((default_check & 256) == 256)
+            default_check = (default_check & 65279);
+        else
+            default_check = (default_check | 256);
+    }
+    if (default_check == 0) {
+        $("#dev_all_checkbox").removeClass('dev_checkbox');
+        $("#dev_all_checkbox").removeClass('dev_few_checkbox');
+        $("#dev_all_checkbox").addClass('dev_uncheckbox');
+    } else if (default_check == 65535) {
+        $("#dev_all_checkbox").removeClass('dev_uncheckbox');
+        $("#dev_all_checkbox").removeClass('dev_few_checkbox');
+        $("#dev_all_checkbox").addClass('dev_checkbox');
+    } else {
+        $("#dev_all_checkbox").removeClass('dev_uncheckbox');
+        $("#dev_all_checkbox").removeClass('dev_checkbox');
+        $("#dev_all_checkbox").addClass('dev_few_checkbox');
+    }
+    if ((default_check & 1) == 1) {
+        $("#dev_ui_checkbox").removeClass('dev_uncheckbox');
+        $("#dev_ui_checkbox").addClass('dev_checkbox');
+    } else {
+        $("#dev_ui_checkbox").removeClass('dev_checkbox');
+        $("#dev_ui_checkbox").addClass('dev_uncheckbox');
+    }
+    if ((default_check & 2) == 2) {
+        $("#dev_fc_checkbox").removeClass('dev_uncheckbox');
+        $("#dev_fc_checkbox").addClass('dev_checkbox');
+    } else {
+        $("#dev_fc_checkbox").removeClass('dev_checkbox');
+        $("#dev_fc_checkbox").addClass('dev_uncheckbox');
+    }
+    if ((default_check & 4) == 4) {
+        $("#dev_ef_checkbox").removeClass('dev_uncheckbox');
+        $("#dev_ef_checkbox").addClass('dev_checkbox');
+    } else {
+        $("#dev_ef_checkbox").removeClass('dev_checkbox');
+        $("#dev_ef_checkbox").addClass('dev_uncheckbox');
+    }
+    if ((default_check & 8) == 8) {
+        $("#dev_wp_checkbox").removeClass('dev_uncheckbox');
+        $("#dev_wp_checkbox").addClass('dev_checkbox');
+    } else {
+        $("#dev_wp_checkbox").removeClass('dev_checkbox');
+        $("#dev_wp_checkbox").addClass('dev_uncheckbox');
+    }
+    if ((default_check & 16) == 16) {
+        $("#dev_ll_checkbox").removeClass('dev_uncheckbox');
+        $("#dev_ll_checkbox").addClass('dev_checkbox');
+    } else {
+        $("#dev_ll_checkbox").removeClass('dev_checkbox');
+        $("#dev_ll_checkbox").addClass('dev_uncheckbox');
+    }
+    if ((default_check & 32) == 32) {
+        $("#dev_ci_checkbox").removeClass('dev_uncheckbox');
+        $("#dev_ci_checkbox").addClass('dev_checkbox');
+    } else {
+        $("#dev_ci_checkbox").removeClass('dev_checkbox');
+        $("#dev_ci_checkbox").addClass('dev_uncheckbox');
+    }
+    if ((default_check & 64) == 64) {
+        $("#dev_va_checkbox").removeClass('dev_uncheckbox');
+        $("#dev_va_checkbox").addClass('dev_checkbox');
+    } else {
+        $("#dev_va_checkbox").removeClass('dev_checkbox');
+        $("#dev_va_checkbox").addClass('dev_uncheckbox');
+    }
+    if ((default_check & 128) == 128) {
+        $("#dev_ot_checkbox").removeClass('dev_uncheckbox');
+        $("#dev_ot_checkbox").addClass('dev_checkbox');
+    } else {
+        $("#dev_ot_checkbox").removeClass('dev_checkbox');
+        $("#dev_ot_checkbox").addClass('dev_uncheckbox');
+    }
+    if ((default_check & 256) == 256) {
+        $("#dev_sm_checkbox").removeClass('dev_uncheckbox');
+        $("#dev_sm_checkbox").addClass('dev_checkbox');
+    } else {
+        $("#dev_sm_checkbox").removeClass('dev_checkbox');
+        $("#dev_sm_checkbox").addClass('dev_uncheckbox');
+    }
+    bak_reset();
+}
+
+var clear_append_form = function () {
+
+    Ext.getCmp('fa_company_code').setValue("");
+    Ext.getCmp('fa_userfile').setValue("");
+    Ext.getCmp('FactoryListPageToolbar').moveFirst();
+
+}
+
+
+var sc = function () {
+    modifywin();
+}
+
+
+var chk_empty_level = function (level) {
+    for (var i = 0; i < buildingStore.length; i++) {
+        if (buildingStore[i].min_level == level) {
+            if (((default_check & 1) == 1) && (buildingStore[i].dwtype == 'YTUI'))
+                return false;
+            else if (((default_check & 2) == 2) && (buildingStore[i].dwtype == 'YTFC'))
+                return false;
+            else if (((default_check & 4) == 4) && (buildingStore[i].dwtype == 'YTEF'))
+                return false;
+            else if (((default_check & 8) == 8) && (buildingStore[i].dwtype == 'YTWP'))
+                return false;
+            else if (((default_check & 16) == 16) && (buildingStore[i].dwtype == 'YTLL'))
+                return false;
+            else if (((default_check & 32) == 32) && (buildingStore[i].dwtype == 'YTCI'))
+                return false;
+            else if (((default_check & 64) == 64) && (buildingStore[i].dwtype == 'YTVA'))
+                return false;
+            else if (((default_check & 128) == 128) && (buildingStore[i].dwtype == 'YTWC'))
+                return false;
+            else if (((default_check & 256) == 256) && (buildingStore[i].dwtype == 'YTSM'))
+                return false;
+        }
+    }
+    return true;
+}
+
+var draw_buinding = function () {
+    var building_icon_height = 0;
+    $("#building_level_count").html(max_level);
+
+    let array = ["10309", "10308", "10307", "10306", "10305", "10304", "10303", "10302", "10301", "10300", "10299", "10298", "10297", "10296", "10295", "10294", "10293", "10292", "10291", "10290", "10289", "10288", "10287", "10286", "10285", "10284", "10283", "10282", "10281", "10280", "10279", "10278", "10277", "10276", "10275", "10274", "10273", "10272", "10271", "10270", "10269", "10268", "10267", "10266", "10265", "10264", "10263", "10262", "10261", "10260", "10259", "10258", "10257", "10256", "10255", "10254", "10253", "10252", "10251", "10250", "10249", "10248", "10246", "10245", "10244", "10243", "10242", "10241", "10240", "10239", "10238", "10237", "10236", "10234"]
+    //  10244,10243,10242,10238 16层
+
+
+    if (array.includes(company_code)) {
+        //    $("#dev_big_checklabel").addClass('dev_big_checklabel');
+        //   var dev_big_checklabel = document.getElementById('dev_big_checklabel');
+        //     dev_big_checklabel.innerHTML = '最大化';
+        $("#company_bg_tl").removeClass('company_bg_tl');
+        $("#company_bg_tl").addClass('company_bg_YP');
+        $("#dev_all_checkbox").hide();
+        $("#dev_all_checklabel").hide();
+        $("#dev_ui_checkbox").hide();
+        $("#dev_ui_checklabel").hide();
+        $("#dev_sm_checkbox").hide();
+        $("#dev_sm_checklabel").hide();
+        $("#dev_fc_checkbox").hide();
+        $("#dev_fc_checklabel").hide();
+        $("#dev_ef_checkbox").hide();
+        $("#dev_ef_checklabel").hide();
+        $("#dev_wp_checkbox").hide();
+        $("#dev_wp_checklabel").hide();
+        $("#dev_ll_checkbox").hide();
+        $("#dev_ll_checklabel").hide();
+        $("#dev_ci_checkbox").hide();
+        $("#dev_ci_checklabel").hide();
+        $("#dev_va_checkbox").hide();
+        $("#dev_va_checklabel").hide();
+        $("#dev_ot_checkbox").hide();
+        $("#dev_ot_checklabel").hide();
+        $("#company_building").removeClass('company_building');
+        $("#company_building").addClass('company_building_on');
+        var company_building = document.getElementById('company_building');
+        company_building.innerHTML = '<iframe id="myIframe" name="thingjs" src="https://www.thingjs.com/s/b11227d4fd5505106989737c?params=105b0f77fd24654d4eebc434e9" style="width:146%;height:123%;border:1px solid #0082ff;"></iframe>';
+
+        var t1 = window.setTimeout(function () {
+            //     console.log(buildingStore);
+            //    debugger;
+            callFuncInThingJS("userListener", buildingStore, top_level, company_code);
+
+
+            window.clearTimeout(t1);
+
+        }, 10000)
+
+
+    } else if (company_code == 10311) {
+        // 武汉
+
+        $.ajax({
+            //TODO 局域网内三位建筑模型IP
+           url: 'http://172.16.120.79',
+            type: 'GET',
+            complete: function (response) {
+                if (response.status == 200) {
+                    //    $("#dev_big_checklabel").addClass('dev_big_checklabel');
+                    //   var dev_big_checklabel = document.getElementById('dev_big_checklabel');
+                    //     dev_big_checklabel.innerHTML = '最大化';
+                    $("#company_bg_tl").removeClass('company_bg_tl');
+                    $("#company_bg_tl").addClass('company_bg_YP');
+                    $("#dev_all_checkbox").hide();
+                    $("#dev_all_checklabel").hide();
+                    $("#dev_ui_checkbox").hide();
+                    $("#dev_ui_checklabel").hide();
+                    $("#dev_sm_checkbox").hide();
+                    $("#dev_sm_checklabel").hide();
+                    $("#dev_fc_checkbox").hide();
+                    $("#dev_fc_checklabel").hide();
+                    $("#dev_ef_checkbox").hide();
+                    $("#dev_ef_checklabel").hide();
+                    $("#dev_wp_checkbox").hide();
+                    $("#dev_wp_checklabel").hide();
+                    $("#dev_ll_checkbox").hide();
+                    $("#dev_ll_checklabel").hide();
+                    $("#dev_ci_checkbox").hide();
+                    $("#dev_ci_checklabel").hide();
+                    $("#dev_va_checkbox").hide();
+                    $("#dev_va_checklabel").hide();
+                    $("#dev_ot_checkbox").hide();
+                    $("#dev_ot_checklabel").hide();
+                    $("#company_building").removeClass('company_building');
+                    $("#company_building").addClass('company_building_on');
+                    var company_building = document.getElementById('company_building');
+
+                    company_building.innerHTML = '<iframe id="myIframe" name="thingjs" src="https://www.thingjs.com/s/926e4e080bdb6c2213316caf" style="width:146%;height:123%;border:1px solid #0082ff;"></iframe>';
+
+                    var t1 = window.setTimeout(function () {
+                        //     console.log(buildingStore);
+                        //    debugger;
+                        callFuncInThingJS("userListener", buildingStore, top_level, company_code);
+
+
+                        window.clearTimeout(t1);
+
+                    }, 10000)
+                } else {
+                    /*-----------------------------------------------------*/
+                    var company_building = document.getElementById('company_building');
+                    company_building.innerHTML = '';
+                    var currett_build = document.createElement('div');
+                    company_building.appendChild(currett_build)
+                    var building_top = document.createElement('div');
+                    building_top.setAttribute('class', 'building_top');
+                    building_top.style.top = '0px';
+                    currett_build.appendChild(building_top);
+                    building_icon_height += 120;
+                    var top_info = document.createElement('div');
+                    top_info.id = "building_top_info";
+                    top_info.setAttribute('class', 'building_top_label');
+                    top_info.innerHTML = 'RF';
+                    building_top.appendChild(top_info);
+                    var top_icon = document.createElement('div');
+                    top_icon.setAttribute('class', 'building_top_icon');
+                    building_top.appendChild(top_icon);
+                    if (max_level > 0) {
+                        var last_empty = max_level + 2;
+                        var first_empty = max_level + 2;
+                        for (var i = max_level; i > 0; i--) {
+                            if (chk_empty_level(i)) {
+                                if (last_empty != (i + 1)) {
+                                    first_empty = i;
+                                    last_empty = i;
+                                    var build_level = document.createElement('div');
+                                    build_level.setAttribute('class', 'building_level');
+                                    build_level.style.top = (building_icon_height - 60) + 'px';
+                                    currett_build.appendChild(build_level);
+                                    building_icon_height += 48;
+                                    var level_info = document.createElement('div');
+                                    level_info.id = "building_empty_level_info_" + i;
+                                    level_info.setAttribute('class', 'building_level_info')
+                                    level_info.innerHTML = i + 'F';
+                                    build_level.appendChild(level_info);
+                                    var level_icon = document.createElement('div');
+                                    level_icon.setAttribute('class', 'building_empty_level_icon');
+                                    build_level.appendChild(level_icon);
+                                } else {
+                                    var level_info = document.getElementById('building_empty_level_info_' + first_empty);
+                                    if (level_info != undefined)
+                                        level_info.innerHTML = i + 'F~' + first_empty + 'F';
+                                    last_empty = i;
+                                }
+                            } else {
+                                var build_level = document.createElement('div');
+                                build_level.setAttribute('class', 'building_level');
+                                build_level.style.top = (building_icon_height - 60) + 'px';
+                                currett_build.appendChild(build_level);
+                                building_icon_height += 48;
+                                var level_info = document.createElement('div');
+                                level_info.id = "building_level_info_" + i;
+                                level_info.setAttribute('class', 'building_level_info')
+                                level_info.innerHTML = i + 'F';
+                                build_level.appendChild(level_info);
+                                var level_icon = document.createElement('div');
+                                level_icon.setAttribute('class', 'building_level_icon');
+                                build_level.appendChild(level_icon);
+                            }
+                        }
+                    }
+                    if (min_level < 0) {
+                        for (var i = -1; i >= min_level; i--) {
+                            var base_level = document.createElement('div');
+                            base_level.setAttribute('class', 'building_base');
+                            base_level.style.top = (building_icon_height - 60) + 'px';
+                            currett_build.appendChild(base_level);
+                            building_icon_height += 48;
+                            var base_info = document.createElement('div');
+                            base_info.id = 'building_base_info_' + (0 - i);
+                            base_info.setAttribute('class', 'building_base_info');
+                            base_info.innerHTML = 'B' + (0 - i) + 'F';
+                            base_level.appendChild(base_info);
+                            var base_icon = document.createElement('div');
+                            base_icon.setAttribute('class', 'building_base_icon');
+                            base_level.appendChild(base_icon);
+                        }
+                    }
+                    $("#company_building").css('height', ($(document).innerHeight() - 402) + 'px');
+                    building_icon_height += 60;
+                    currett_build.style.marginLeft = '59px';
+                    currett_build.style.marginRight = '59px';
+                    currett_build.style.width = '536px';
+
+                    if ((buildingStore != null) && (buildingStore.length > 0)) {
+                        for (var i = 0; i < buildingStore.length; i++) {
+                            var iconid = buildingStore[i].dwtype + '_' + buildingStore[i].min_level;
+                            var icon = document.getElementById(iconid);
+                            if (icon == undefined) {
+                                icon = document.createElement('div');
+                                icon.id = buildingStore[i].dwtype + '_' + buildingStore[i].min_level;
+                                icon.dwtype = buildingStore[i].dwtype;
+                                icon.level = buildingStore[i].min_level;
+                                icon.owner_code = buildingStore[i].owner_code;
+                                icon.style.position = 'absolute';
+                                icon.style.width = '62px';
+                                icon.style.height = '62px';
+                                icon.style.cursor = 'pointer';
+                                icon.setAttribute('onclick', 'icon_click(this)');
+                                currett_build.appendChild(icon);
+                                var this_min_level = buildingStore[i].min_level;
+                                var level_label = document.getElementById("building_level_info_" + this_min_level);
+                                if (this_min_level == top_level) {
+                                    level_label = document.getElementById('building_top_info');
+                                } else if (this_min_level < 0) {
+                                    level_label = document.getElementById('building_base_info_' + (0 - this_min_level));
+                                }
+                                if (level_label != null) {
+                                    if (buildingStore[i].dwtype == 'YTUI') {
+                                        if ((default_check & 1) == 1) {
+                                            icon.title = '用户传输装置';
+                                            icon.style.top = (level_label.offsetParent.offsetTop + 1) + 'px'
+                                            icon.style.left = (level_label.offsetParent.offsetLeft + 28) + 'px';
+                                            icon.style.backgroundImage = 'url(../../res/img/icons/ui_icon.png)';
+                                        }
+                                    } else if (buildingStore[i].dwtype == 'YTFC') {
+                                        if ((default_check & 2) == 2) {
+                                            icon.title = '消防控制柜';
+                                            icon.style.top = (level_label.offsetParent.offsetTop + 15) + 'px'
+                                            icon.style.left = (level_label.offsetParent.offsetLeft + 68) + 'px';
+                                            icon.style.backgroundImage = 'url(../../res/img/icons/fc_icon.png)';
+                                        }
+                                    } else if (buildingStore[i].dwtype == 'YTEF') {
+                                        if ((default_check & 4) == 4) {
+                                            icon.title = '电气火灾';
+                                            icon.style.top = (level_label.offsetParent.offsetTop + 29) + 'px'
+                                            icon.style.left = (level_label.offsetParent.offsetLeft + 108) + 'px';
+                                            icon.style.backgroundImage = 'url(../../res/img/icons/ef_icon.png)';
+                                        }
+                                    } else if (buildingStore[i].dwtype == 'YTWP') {
+                                        if ((default_check & 8) == 8) {
+                                            icon.title = '水压';
+                                            icon.style.top = (level_label.offsetParent.offsetTop + 43) + 'px'
+                                            icon.style.left = (level_label.offsetParent.offsetLeft + 148) + 'px';
+                                            icon.style.backgroundImage = 'url(../../res/img/icons/wp0_icon.png)';
+                                        }
+                                    } else if (buildingStore[i].dwtype == 'YTLL') {
+                                        if ((default_check & 16) == 16) {
+                                            icon.title = '液位';
+                                            icon.style.top = (level_label.offsetParent.offsetTop + 48) + 'px'
+                                            icon.style.left = (level_label.offsetParent.offsetLeft + 188) + 'px';
+                                            icon.style.backgroundImage = 'url(../../res/img/icons/ll_icon.png)';
+                                        }
+                                    } else if (buildingStore[i].dwtype == 'YTCI') {
+                                        if ((default_check & 32) == 32) {
+                                            icon.title = '环境监测';
+                                            icon.style.top = (level_label.offsetParent.offsetTop + 43) + 'px'
+                                            icon.style.left = (level_label.offsetParent.offsetLeft + 228) + 'px';
+                                            icon.style.backgroundImage = 'url(../../res/img/icons/ci_icon.png)';
+                                        }
+                                    } else if (buildingStore[i].dwtype == 'YTVA') {
+                                        if ((default_check & 64) == 64) {
+                                            icon.title = '视频监控';
+                                            icon.style.top = (level_label.offsetParent.offsetTop + 29) + 'px'
+                                            icon.style.left = (level_label.offsetParent.offsetLeft + 268) + 'px';
+                                            icon.style.backgroundImage = 'url(../../res/img/icons/va_icon.png)';
+                                        }
+                                    } else if (buildingStore[i].dwtype == 'YTWC') {
+                                        if ((default_check & 128) == 128) {
+                                            icon.title = '风机控制柜';
+                                            icon.style.top = (level_label.offsetParent.offsetTop + 15) + 'px'
+                                            icon.style.left = (level_label.offsetParent.offsetLeft + 308) + 'px';
+                                            icon.style.backgroundImage = 'url(../../res/img/icons/wc_icon.png)';
+                                        }
+                                    } else if (buildingStore[i].dwtype == 'YTSM') {
+                                        if ((default_check & 256) == 256) {
+                                            icon.title = '烟感';
+                                            icon.style.top = (level_label.offsetParent.offsetTop + 1) + 'px';
+                                            icon.style.left = (level_label.offsetParent.offsetLeft + 348) + 'px';
+                                            icon.style.backgroundImage = 'url(../../res/img/icons/sm_icon.png)';
+                                        }
+                                    }
+                                }
+                            } else
+                                icon.owner_code = "";
+                        }
+                    }
+
+
+                    /*====================================*/
+                }
+            }
+        });
+
+
+    } else {
+        var company_building = document.getElementById('company_building');
+        company_building.innerHTML = '';
+        var currett_build = document.createElement('div');
+        company_building.appendChild(currett_build)
+        var building_top = document.createElement('div');
+        building_top.setAttribute('class', 'building_top');
+        building_top.style.top = '0px';
+        currett_build.appendChild(building_top);
+        building_icon_height += 120;
+        var top_info = document.createElement('div');
+        top_info.id = "building_top_info";
+        top_info.setAttribute('class', 'building_top_label');
+        top_info.innerHTML = 'RF';
+        building_top.appendChild(top_info);
+        var top_icon = document.createElement('div');
+        top_icon.setAttribute('class', 'building_top_icon');
+        building_top.appendChild(top_icon);
+        if (max_level > 0) {
+            var last_empty = max_level + 2;
+            var first_empty = max_level + 2;
+            for (var i = max_level; i > 0; i--) {
+                if (chk_empty_level(i)) {
+                    if (last_empty != (i + 1)) {
+                        first_empty = i;
+                        last_empty = i;
+                        var build_level = document.createElement('div');
+                        build_level.setAttribute('class', 'building_level');
+                        build_level.style.top = (building_icon_height - 60) + 'px';
+                        currett_build.appendChild(build_level);
+                        building_icon_height += 48;
+                        var level_info = document.createElement('div');
+                        level_info.id = "building_empty_level_info_" + i;
+                        level_info.setAttribute('class', 'building_level_info')
+                        level_info.innerHTML = i + 'F';
+                        build_level.appendChild(level_info);
+                        var level_icon = document.createElement('div');
+                        level_icon.setAttribute('class', 'building_empty_level_icon');
+                        build_level.appendChild(level_icon);
+                    } else {
+                        var level_info = document.getElementById('building_empty_level_info_' + first_empty);
+                        if (level_info != undefined)
+                            level_info.innerHTML = i + 'F~' + first_empty + 'F';
+                        last_empty = i;
+                    }
+                } else {
+                    var build_level = document.createElement('div');
+                    build_level.setAttribute('class', 'building_level');
+                    build_level.style.top = (building_icon_height - 60) + 'px';
+                    currett_build.appendChild(build_level);
+                    building_icon_height += 48;
+                    var level_info = document.createElement('div');
+                    level_info.id = "building_level_info_" + i;
+                    level_info.setAttribute('class', 'building_level_info')
+                    level_info.innerHTML = i + 'F';
+                    build_level.appendChild(level_info);
+                    var level_icon = document.createElement('div');
+                    level_icon.setAttribute('class', 'building_level_icon');
+                    build_level.appendChild(level_icon);
+                }
+            }
+        }
+        if (min_level < 0) {
+            for (var i = -1; i >= min_level; i--) {
+                var base_level = document.createElement('div');
+                base_level.setAttribute('class', 'building_base');
+                base_level.style.top = (building_icon_height - 60) + 'px';
+                currett_build.appendChild(base_level);
+                building_icon_height += 48;
+                var base_info = document.createElement('div');
+                base_info.id = 'building_base_info_' + (0 - i);
+                base_info.setAttribute('class', 'building_base_info');
+                base_info.innerHTML = 'B' + (0 - i) + 'F';
+                base_level.appendChild(base_info);
+                var base_icon = document.createElement('div');
+                base_icon.setAttribute('class', 'building_base_icon');
+                base_level.appendChild(base_icon);
+            }
+        }
+        $("#company_building").css('height', ($(document).innerHeight() - 402) + 'px');
+        building_icon_height += 60;
+        currett_build.style.marginLeft = '59px';
+        currett_build.style.marginRight = '59px';
+        currett_build.style.width = '536px';
+
+        if ((buildingStore != null) && (buildingStore.length > 0)) {
+            for (var i = 0; i < buildingStore.length; i++) {
+                var iconid = buildingStore[i].dwtype + '_' + buildingStore[i].min_level;
+                var icon = document.getElementById(iconid);
+                if (icon == undefined) {
+                    icon = document.createElement('div');
+                    icon.id = buildingStore[i].dwtype + '_' + buildingStore[i].min_level;
+                    icon.dwtype = buildingStore[i].dwtype;
+                    icon.level = buildingStore[i].min_level;
+                    icon.owner_code = buildingStore[i].owner_code;
+                    icon.style.position = 'absolute';
+                    icon.style.width = '62px';
+                    icon.style.height = '62px';
+                    icon.style.cursor = 'pointer';
+                    icon.setAttribute('onclick', 'icon_click(this)');
+                    currett_build.appendChild(icon);
+                    var this_min_level = buildingStore[i].min_level;
+                    var level_label = document.getElementById("building_level_info_" + this_min_level);
+                    if (this_min_level == top_level) {
+                        level_label = document.getElementById('building_top_info');
+                    } else if (this_min_level < 0) {
+                        level_label = document.getElementById('building_base_info_' + (0 - this_min_level));
+                    }
+                    if (level_label != null) {
+                        if (buildingStore[i].dwtype == 'YTUI') {
+                            if ((default_check & 1) == 1) {
+                                icon.title = '用户传输装置';
+                                icon.style.top = (level_label.offsetParent.offsetTop + 1) + 'px'
+                                icon.style.left = (level_label.offsetParent.offsetLeft + 28) + 'px';
+                                icon.style.backgroundImage = 'url(../../res/img/icons/ui_icon.png)';
+                            }
+                        } else if (buildingStore[i].dwtype == 'YTFC') {
+                            if ((default_check & 2) == 2) {
+                                icon.title = '消防控制柜';
+                                icon.style.top = (level_label.offsetParent.offsetTop + 15) + 'px'
+                                icon.style.left = (level_label.offsetParent.offsetLeft + 68) + 'px';
+                                icon.style.backgroundImage = 'url(../../res/img/icons/fc_icon.png)';
+                            }
+                        } else if (buildingStore[i].dwtype == 'YTEF') {
+                            if ((default_check & 4) == 4) {
+                                icon.title = '电气火灾';
+                                icon.style.top = (level_label.offsetParent.offsetTop + 29) + 'px'
+                                icon.style.left = (level_label.offsetParent.offsetLeft + 108) + 'px';
+                                icon.style.backgroundImage = 'url(../../res/img/icons/ef_icon.png)';
+                            }
+                        } else if (buildingStore[i].dwtype == 'YTWP') {
+                            if ((default_check & 8) == 8) {
+                                icon.title = '水压';
+                                icon.style.top = (level_label.offsetParent.offsetTop + 43) + 'px'
+                                icon.style.left = (level_label.offsetParent.offsetLeft + 148) + 'px';
+                                icon.style.backgroundImage = 'url(../../res/img/icons/wp0_icon.png)';
+                            }
+                        } else if (buildingStore[i].dwtype == 'YTLL') {
+                            if ((default_check & 16) == 16) {
+                                icon.title = '液位';
+                                icon.style.top = (level_label.offsetParent.offsetTop + 48) + 'px'
+                                icon.style.left = (level_label.offsetParent.offsetLeft + 188) + 'px';
+                                icon.style.backgroundImage = 'url(../../res/img/icons/ll_icon.png)';
+                            }
+                        } else if (buildingStore[i].dwtype == 'YTCI') {
+                            if ((default_check & 32) == 32) {
+                                icon.title = '环境监测';
+                                icon.style.top = (level_label.offsetParent.offsetTop + 43) + 'px'
+                                icon.style.left = (level_label.offsetParent.offsetLeft + 228) + 'px';
+                                icon.style.backgroundImage = 'url(../../res/img/icons/ci_icon.png)';
+                            }
+                        } else if (buildingStore[i].dwtype == 'YTVA') {
+                            if ((default_check & 64) == 64) {
+                                icon.title = '视频监控';
+                                icon.style.top = (level_label.offsetParent.offsetTop + 29) + 'px'
+                                icon.style.left = (level_label.offsetParent.offsetLeft + 268) + 'px';
+                                icon.style.backgroundImage = 'url(../../res/img/icons/va_icon.png)';
+                            }
+                        } else if (buildingStore[i].dwtype == 'YTWC') {
+                            if ((default_check & 128) == 128) {
+                                icon.title = '风机控制柜';
+                                icon.style.top = (level_label.offsetParent.offsetTop + 15) + 'px'
+                                icon.style.left = (level_label.offsetParent.offsetLeft + 308) + 'px';
+                                icon.style.backgroundImage = 'url(../../res/img/icons/wc_icon.png)';
+                            }
+                        } else if (buildingStore[i].dwtype == 'YTSM') {
+                            if ((default_check & 256) == 256) {
+                                icon.title = '烟感';
+                                icon.style.top = (level_label.offsetParent.offsetTop + 1) + 'px';
+                                icon.style.left = (level_label.offsetParent.offsetLeft + 348) + 'px';
+                                icon.style.backgroundImage = 'url(../../res/img/icons/sm_icon.png)';
+                            }
+                        }
+                    }
+                } else
+                    icon.owner_code = "";
+            }
+        }
+    }
+
+
+    if (show_project_info) {
+        var project_info_bar = document.getElementById('project_info_bar');
+        project_info_bar.innerHTML = '';
+        var project_label = document.createElement('div');
+        project_label.setAttribute('class', 'project_label');
+        project_label.style.position = 'absolute';
+        project_label.style.top = '30px';
+        project_label.style.left = '50px';
+        project_label.innerHTML = '项目名称';
+        project_info_bar.appendChild(project_label);
+        var project_info = document.createElement('div');
+        //  ;
+        project_info.setAttribute('class', 'project_info');
+        project_info.style.position = 'absolute';
+        project_info.style.top = '60px';
+        project_info.style.left = '50px';
+        project_info.innerHTML = companyStore.company_name;
+        project_info_bar.appendChild(project_info);
+        project_label = document.createElement('div');
+        project_label.setAttribute('class', 'project_label');
+        project_label.style.position = 'absolute';
+        project_label.style.top = '110px';
+        project_label.style.left = '50px';
+        project_label.innerHTML = '项目地址';
+        project_info_bar.appendChild(project_label);
+        project_info = document.createElement('div');
+        ;
+        project_info.setAttribute('class', 'project_info');
+        project_info.style.position = 'absolute';
+        project_info.style.top = '140px';
+        project_info.style.left = '50px';
+        project_info.innerHTML = companyStore.address;
+        project_info_bar.appendChild(project_info);
+        project_label = document.createElement('div');
+        project_label.setAttribute('class', 'project_label');
+        project_label.style.position = 'absolute';
+        project_label.style.top = '190px';
+        project_label.style.left = '50px';
+        project_label.innerHTML = '项目坐标';
+        project_info_bar.appendChild(project_label);
+        project_info = document.createElement('div');
+        ;
+        project_info.setAttribute('class', 'project_info');
+        project_info.style.position = 'absolute';
+        project_info.style.top = '220px';
+        project_info.style.left = '50px';
+        project_info.innerHTML = companyStore.lng + ',' + companyStore.lat;
+        project_info_bar.appendChild(project_info);
+        project_label = document.createElement('div');
+        project_label.setAttribute('class', 'project_label');
+        project_label.style.position = 'absolute';
+        project_label.style.top = '30px';
+        project_label.style.left = '480px';
+        project_label.innerHTML = '联系人';
+        project_info_bar.appendChild(project_label);
+        project_info = document.createElement('div');
+        ;
+        project_info.setAttribute('class', 'project_info');
+        project_info.style.position = 'absolute';
+        project_info.style.top = '60px';
+        project_info.style.left = '480px';
+        project_info.innerHTML = companyStore.username;
+        project_info_bar.appendChild(project_info);
+        project_label = document.createElement('div');
+        project_label.setAttribute('class', 'project_label');
+        project_label.style.position = 'absolute';
+        project_label.style.top = '110px';
+        project_label.style.left = '480px';
+        project_label.innerHTML = '联系电话';
+        project_info_bar.appendChild(project_label);
+        project_info = document.createElement('div');
+        ;
+        project_info.setAttribute('class', 'project_info');
+        project_info.style.position = 'absolute';
+        project_info.style.top = '140px';
+        project_info.style.left = '480px';
+        project_info.innerHTML = companyStore.phone;
+        project_info_bar.appendChild(project_info);
+        var history_alarm_list = document.getElementById('history_alarm_list');
+        history_alarm_list.innerHTML = '';
+        var table = document.createElement('table');
+        table.width = '100%';
+        history_alarm_list.appendChild(table);
+        var tr = document.createElement('tr');
+        table.appendChild(tr);
+        var dwtypelist = [1, 7, 2, 6, 16, 17];
+        for (var i = 0; i < 6; i++) {
+            var td = document.createElement('td');
+            td.setAttribute('colspan', '2');
+            td.setAttribute('style', 'width:128px;');
+            td.setAttribute('class', 'data_bar_title');
+            td.style.textAlign = 'center';
+            td.style.paddingTop = '15px';
+            td.setAttribute('onclick', 'show_alarm_list("' + company_code + '","' + dwtypelist[i] + '")');
+            if (i == 0)
+                td.innerHTML = '火灾监控';
+            else if (i == 1)
+                td.innerHTML = '电气火灾监控';
+            else if (i == 2)
+                td.innerHTML = '水系统监控';
+            else if (i == 3)
+                td.innerHTML = 'RTU监控';
+            else if (i == 4)
+                td.innerHTML = '视频告警监控'
+            else
+                td.innerHTML = '电梯告警监控'
+            tr.appendChild(td);
+        }
+        tr = document.createElement('tr');
+        table.appendChild(tr);
+        for (var i = 0; i < 6; i++) {
+            var td = document.createElement('td');
+            td.setAttribute('class', 'data_bar_total_label');
+            td.style.textAlign = 'right';
+            td.width = '10%';
+            td.innerHTML = '设备总数';
+            td.setAttribute('onclick', 'show_alarm_list("' + company_code + '","' + dwtypelist[i] + '")');
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'data_bar_total_number');
+            td.style.textAlign = 'left';
+            td.style.paddingLeft = '10px';
+            td.setAttribute('onclick', 'show_alarm_list("' + company_code + '","' + dwtypelist[i] + '")');
+            if (i == 0)
+                td.innerHTML = companyStore.d1;
+            else if (i == 1)
+                td.innerHTML = companyStore.d7;
+            else if (i == 2)
+                td.innerHTML = companyStore.d2;
+            else if (i == 3)
+                td.innerHTML = companyStore.d6;
+            else if (i == 4)
+                td.innerHTML = companyStore.d16;
+            else
+                //td.innerHTML=companyStore.d17;
+                td.innerHTML = 0;
+            tr.appendChild(td);
+        }
+        tr = document.createElement('tr');
+        table.appendChild(tr);
+        for (var i = 0; i < 6; i++) {
+            var td = document.createElement('td');
+            td.setAttribute('class', 'data_bar_total_label');
+            td.style.textAlign = 'right';
+            td.width = '10%';
+            td.innerHTML = '已处理';
+            td.setAttribute('onclick', 'show_alarm_list("' + company_code + '","' + dwtypelist[i] + '")');
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'device_confirm_num1');
+            td.style.textAlign = 'left';
+            td.style.paddingLeft = '10px';
+            td.setAttribute('onclick', 'show_alarm_list("' + company_code + '","' + dwtypelist[i] + '")');
+            if (i == 0)
+                td.innerHTML = companyStore.d1ac;
+            else if (i == 1)
+                td.innerHTML = companyStore.d7ac;
+            else if (i == 2)
+                td.innerHTML = companyStore.d2ac;
+            else if (i == 3)
+                td.innerHTML = companyStore.d6ac;
+            else if (i == 4)
+                td.innerHTML = companyStore.d16ac;
+            else
+                //td.innerHTML=companyStore.d17ac;
+                td.innerHTML = 0;
+            tr.appendChild(td);
+        }
+        tr = document.createElement('tr');
+        table.appendChild(tr);
+        for (var i = 0; i < 6; i++) {
+            var td = document.createElement('td');
+            td.setAttribute('class', 'data_bar_total_label');
+            td.style.textAlign = 'right';
+            td.width = '10%';
+            td.innerHTML = '待处理';
+            td.setAttribute('onclick', 'show_alarm_list("' + company_code + '","' + dwtypelist[i] + '")');
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'device_confirm_num2');
+            td.style.textAlign = 'left';
+            td.style.paddingLeft = '10px';
+            td.setAttribute('onclick', 'show_alarm_list("' + company_code + '","' + dwtypelist[i] + '")');
+            if (i == 0)
+                td.innerHTML = companyStore.d1a - companyStore.d1ac;
+            else if (i == 1)
+                td.innerHTML = companyStore.d7a - companyStore.d7ac;
+            else if (i == 2)
+                td.innerHTML = companyStore.d2a - companyStore.d2ac;
+            else if (i == 3)
+                td.innerHTML = companyStore.d6a - companyStore.d6ac;
+            else if (i == 4)
+                td.innerHTML = companyStore.d16a - companyStore.d16ac;
+            else
+                //td.innerHTML=companyStore.d17a-companyStore.d17ac;
+                td.innerHTML = 0;
+            tr.appendChild(td);
+        }
+        tr = document.createElement('tr');
+        table.appendChild(tr);
+        for (var i = 0; i < 6; i++) {
+            var td = document.createElement('td');
+            td.setAttribute('colspan', '2');
+            tr.appendChild(td);
+            var div = document.createElement('div');
+            div.id = 'alarm_pie_' + i;
+            div.style.margin = '10px auto 10px auto';
+            div.style.width = '110px';
+            td.setAttribute('onclick', 'show_alarm_list("' + company_code + '","' + dwtypelist[i] + '")');
+            td.appendChild(div);
+        }
+        draw_pie('alarm_pie_0', companyStore.d1a, companyStore.d1ac);
+        draw_pie('alarm_pie_1', companyStore.d7a, companyStore.d7ac);
+        draw_pie('alarm_pie_2', companyStore.d2a, companyStore.d2ac);
+        draw_pie('alarm_pie_3', companyStore.d6a, companyStore.d6ac);
+        draw_pie('alarm_pie_4', companyStore.d16a, companyStore.d16ac);
+        //draw_pie('alarm_pie_5',companyStore.d17a,companyStore.d17ac);
+        draw_pie('alarm_pie_5', 0);
+    } else {
+        var project_info_bar = document.getElementById('project_info_bar');
+        project_info_bar.innerHTML = '';
+        var history_alarm_list = document.getElementById('history_alarm_list');
+        history_alarm_list.innerHTML = '';
+    }
+}
+
+
+function callFuncInThingJS(funcName, data, top_level, company_code) {
+    var iframe = $('#myIframe')[0];
+    var msg = {data, top_level, company_code}
+    var message = {
+        'funcName': funcName,
+        'param': msg
+    }
+    iframe.contentWindow.postMessage(message, '*');
+}
+
+function myaleart() {
+    alert("wwwwwwwwwwwwwwwwwww");
+}
+
+window.addEventListener('message', function (e) {
+    var data = e.data;
+    var funcName = data.funcName;
+    var param = data.param;
+    if (window[funcName]) window[funcName](param);
+});
+
+var show_alarm_list = function (company_code, dwtype) {
+    $("#company_detail_title").removeClass('device_status_title_icon');
+    $("#company_detail_title").addClass('history_alarm_title_icon');
+    $("#bak_reset2").removeClass('hiden');
+    $("#bak_reset2").addClass('shown');
+    var history_alarm_list = document.getElementById('history_alarm_list');
+    history_alarm_list.innerHTML = '<iframe name="queryPage" src="' + basePath + 'view/frontpage/query.jsp?theme=' + theme + '&dwtype=' + dwtype + '&company_code=' + company_code + '" style="width:100%;height:100%;" frameborder="0"></iframe>';
+    //	alert(company_code+','+dwtype);
+}
+
+var bak_reset = function () {
+    $("#company_detail_title").removeClass('history_alarm_title_icon');
+    $("#company_detail_title").addClass('device_status_title_icon');
+    $("#company_page_title").removeClass('realtime_title_icon');
+    $("#company_page_title").addClass('project_title_icon');
+    $("#bak_reset").removeClass('shown');
+    $("#bak_reset").addClass('hiden');
+    $("#bak_reset2").removeClass('shown');
+    $("#bak_reset2").addClass('hiden');
+    //	$("#history_alarm_list").css('overflow-y','auto');
+    var v_reset = document.getElementById('v_reset');
+    if (v_reset != undefined) {
+        document.body.removeChild(v_reset);
+    }
+    var big_view = document.getElementById('big_view');
+    if (big_view != undefined) {
+        document.body.removeChild(big_view);
+    }
+    show_project_info = true;
+    draw_buinding();
+}
+
+var dev_click = function (obj) {
+    var dwtype = obj.dwtype;
+    var level = obj.level;
+    var id = obj.owner_code;
+    var idx = obj.idx;
+    show_project_info = false;
+    //	var history_alarm_list = document.getElementById('history_alarm_list');
+    //	history_alarm_list.innerHTML='<iframe name="queryPage" src="'+basePath+'view/frontpage/query.jsp?theme='+theme+'&dwtype='+dwtype+'&level='+level+'&objid='+id+'" style="width:100%;height:100%;" frameborder="0"></iframe>';
+    show_realtime_status(idx);
+    if (dwtype == 'YTVA') {
+        onair_video = false;
+        chk_cideo();
+    }
+}
+
+var icon_click = function (obj) {
+    debugger;
+    var dwtype = obj.dwtype;
+    var level = obj.level;
+    var id = obj.owner_code;
+    show_project_info = false;
+    //	$("#company_detail_title").removeClass('device_status_title_icon');
+    //	$("#company_detail_title").addClass('history_alarm_title_icon');
+    $("#company_page_title").removeClass('project_title_icon');
+    $("#company_page_title").addClass('realtime_title_icon');
+    $("#bak_reset").removeClass('hiden');
+    $("#bak_reset").addClass('shown');
+    var project_info_bar = document.getElementById('project_info_bar');
+    project_info_bar.innerHTML = '';
+    var query = new Object();
+    query.dwtype = dwtype;
+    query.level = level;
+    query.V_LOGINNAME = V_LOGINNAME;
+    query.COMPANY_CODE = company_code;
+    $.ajax({
+        type: 'POST',
+        url: basePath + "iot/frontpage/getCurrentStatus",
+        data: {
+            queryJson: Ext.JSON.encode(query)
+        },
+        success: function (result) {
+            var json = eval('(' + result + ')');
+            if (json.action == 'getCurrentStatus') {
+                if (json.check == true) {
+                    if (json.devices != undefined) {
+                        devicesStore = json.devices;
+                        drawCurrentStatus();
+                    }
+                } else {
+                    Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function () {
+                        window.parent.document.location = basePath;
+                    });
+                }
+            }
+            myMask.hide();
+        }
+    });
+    //	var history_alarm_list = document.getElementById('history_alarm_list');
+    //	history_alarm_list.style.overflowY='hidden';
+    //	history_alarm_list.innerHTML='<iframe name="queryPage" src="'+basePath+'view/frontpage/query.jsp?theme='+theme+'&dwtype='+dwtype+'&level='+level+'&objid='+id+'&company_code='+company_code+'" style="width:100%;height:100%;" frameborder="0"></iframe>';
+    if (dwtype == 'YTVA') {
+        onair_video = false;
+        chk_cideo();
+    }
+}
+
+var draw_pie = function (id, total, num) {
+    var mColor = '#34abf5';
+    var percent = 100;
+    if (total > 0)
+        percent = Number(((num * 100) / total).toString().match(/^\d+(?:\.\d{0,2})?/));
+    if (percent < 60)
+        mColor = '#f66167';
+    else if (percent < 80)
+        mColor = '#DDDF0D';
+    Highcharts.getOptions().colors = Highcharts.map(['#f66167', '#34abf5', '#DDDF0D', '#ff2e95', '#39b54a', '#ffb163', '#c233ac', '#9dffad', '#c77051'], function (color) {
+        return {
+            radialGradient: {cx: 0.5, cy: 0.3, r: 0.7},
+            stops: [
+                [0, color],
+                [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
+            ]
+        };
+    });
+    Highcharts.chart(id, {
+        chart: {
+            type: 'pie',
+            backgroundColor: 'rgba(0,0,0,0)',
+            height: '100%',
+            options3d: {
+                enabled: true,
+                alpha: 45,
+                beta: 0
+            }
+        },
+        title: {
+            text: '处置率:' + percent + '%',
+            floating: true,
+            y: 95,
+            style: {fontSize: '12px', color: '#ffffff'}
+        },
+        exporting: {
+            enabled: false
+        },
+        credits: {
+            enabled: false
+        },
+        tooltip: {
+            //	      enabled: false
+            pointFormat: '{point.percentage:.2f}%'
+        },
+        plotOptions: {
+            pie: {
+                allowPointSelect: true,
+
+                cursor: 'pointer',
+                depth: 15,
+                dataLabels: {
+                    enabled: false,
+                    format: '{point.name}'
+                }
+            }
+        },
+        series: [{
+            type: 'pie',
+            name: '处置率',
+            startAngle: 90,
+            data: [{
+                name: '待处理',
+                y: 100 - percent,
+                sliced: true,
+                selected: true
+            },
+                ['已处理', percent]
+            ]
+        }]
+    });
+}
+
+var drawCurrentStatus = function () {
+    if ((devicesStore != null) && (devicesStore.length > 0)) {
+        if (onair_video) {
+            onair_video = false;
+            chk_cideo();
+        }
+        var project_info_bar = document.getElementById('project_info_bar');
+        var device_icon = document.createElement('img');
+        if (devicesStore[0].dwtype == 'YTUI') {
+            device_icon.setAttribute('class', 'device_large_icon');
+            device_icon.src = basePath + 'res/img/icons/ui_large_icon.gif';
+        } else if (devicesStore[0].dwtype == 'YTFC') {
+            device_icon.setAttribute('class', 'device_large_icon');
+            device_icon.src = basePath + 'res/img/icons/fc_large_icon.gif';
+        } else if (devicesStore[0].dwtype == 'YTCI') {
+            device_icon.setAttribute('class', 'device_large_icon');
+            device_icon.src = basePath + 'res/img/icons/ci_large_icon.gif';
+        } else if (devicesStore[0].dwtype == 'YTWP') {
+            device_icon.setAttribute('class', 'device_large_icon');
+            device_icon.src = basePath + 'res/img/icons/wp1_large_icon.gif';
+        } else if (devicesStore[0].dwtype == 'YTLL') {
+            device_icon.setAttribute('class', 'device_large_icon');
+            device_icon.src = basePath + 'res/img/icons/ll_large_icon.gif';
+        } else if (devicesStore[0].dwtype == 'YTVA') {
+            device_icon.setAttribute('class', 'device_large_icon');
+            device_icon.src = basePath + 'res/img/icons/va_large_icon.gif';
+        } else if (devicesStore[0].dwtype == 'YTEF') {
+            device_icon.setAttribute('class', 'device_large_icon');
+            device_icon.src = basePath + 'res/img/icons/ef_large_icon.gif';
+        } else if (devicesStore[0].dwtype == 'YTWC') {
+            device_icon.setAttribute('class', 'device_large_icon');
+            device_icon.src = basePath + 'res/img/icons/wc_large_icon.gif';
+        } else if (devicesStore[0].dwtype == 'YTSM') {
+            device_icon.setAttribute('class', 'device_large_icon');
+            device_icon.src = basePath + 'res/img/icons/sm_large_icon.gif';
+        }
+        //		var device_icon = document.createElement('div');
+        //		if(devicesStore[0].dwtype=='YTUI'){
+        //			device_icon.setAttribute('class','device_large_icon ui_large_icon');
+        //		}else if(devicesStore[0].dwtype=='YTFC'){
+        //			device_icon.setAttribute('class','device_large_icon fc_large_icon');
+        //		}else if(devicesStore[0].dwtype=='YTCI'){
+        //			device_icon.setAttribute('class','device_large_icon ci_large_icon');
+        //		}else if(devicesStore[0].dwtype=='YTWP'){
+        //			device_icon.setAttribute('class','device_large_icon wp1_large_icon');
+        //		}else if(devicesStore[0].dwtype=='YTLL'){
+        //			device_icon.setAttribute('class','device_large_icon ll_large_icon');
+        //		}else if(devicesStore[0].dwtype=='YTVA'){
+        //			device_icon.setAttribute('class','device_large_icon va_large_icon');
+        //		}else if(devicesStore[0].dwtype=='YTEF'){
+        //			device_icon.setAttribute('class','device_large_icon ef_large_icon');
+        //		}
+        project_info_bar.appendChild(device_icon);
+        var device_count_label = document.createElement('div');
+        device_count_label.id = 'device_count_label';
+        device_count_label.setAttribute('class', 'device_count_label');
+        project_info_bar.appendChild(device_count_label);
+        var device_list_bar = document.createElement('div');
+        device_list_bar.setAttribute('class', 'device_list_bar');
+        project_info_bar.appendChild(device_list_bar);
+        var status_list_bar = document.createElement('div');
+        status_list_bar.id = 'status_list_bar';
+        status_list_bar.setAttribute('status', '');
+        status_list_bar.setAttribute('class', 'status_list_bar');
+        status_list_bar.style.width = ($(document).innerWidth() - 1528) + 'px';
+        project_info_bar.appendChild(status_list_bar);
+        for (var i = 0; i < devicesStore.length; i++) {
+            var dev = document.createElement('div');
+            dev.owner_code = devicesStore[i].owner_code;
+            dev.id = "device_list_bar_sub_" + i;
+            dev.dwtype = devicesStore[i].dwtype;
+            dev.level = devicesStore[i].level;
+            dev.style.margin = '10px';
+            dev.style.padding = '10px';
+            dev.style.width = '300px';
+            dev.style.cursor = 'pointer';
+            dev.idx = i;
+            dev.setAttribute('onclick', 'dev_click(this)');
+            device_list_bar.appendChild(dev);
+            $("#device_list_bar_sub_" + i).mouseover(function () {
+                $(this).css('background', 'rgba(64,85,98,0.7)');
+            });
+            $("#device_list_bar_sub_" + i).mouseout(function () {
+                $(this).css('background', 'rgba(0,0,0,0)');
+            });
+            var dev_name_label = document.createElement('div');
+            dev_name_label.setAttribute('class', 'project_label');
+            dev_name_label.style.marginTop = '6px';
+            dev_name_label.innerHTML = '设备名称';
+            dev.appendChild(dev_name_label);
+            var dev_name_info = document.createElement('div');
+            dev_name_info.setAttribute('class', 'project_info');
+            dev_name_info.style.marginTop = '12px';
+            dev_name_info.innerHTML = devicesStore[i].device_name;
+            dev.appendChild(dev_name_info);
+            var dev_code_label = document.createElement('div');
+            dev_code_label.setAttribute('class', 'project_label');
+            dev_code_label.style.marginTop = '14px';
+            dev_code_label.innerHTML = '设备编号';
+            dev.appendChild(dev_code_label);
+            var dev_code_info = document.createElement('div');
+            dev_code_info.setAttribute('class', 'project_info');
+            dev_code_info.style.marginTop = '12px';
+            dev_code_info.innerHTML = devicesStore[i].owner_code;
+            dev.appendChild(dev_code_info);
+            var dev_OBJ_label = document.createElement('div');
+            dev_OBJ_label.setAttribute('class', 'project_label');
+            dev_OBJ_label.style.marginTop = '14px';
+            dev_OBJ_label.innerHTML = '监测对象';
+            dev.appendChild(dev_OBJ_label);
+            var dev_OBJ_info = document.createElement('div');
+            dev_OBJ_info.setAttribute('class', 'project_info');
+            dev_OBJ_info.style.marginTop = '12px';
+            dev_OBJ_info.innerHTML = devicesStore[i].object_name;
+            dev.appendChild(dev_OBJ_info);
+            var dev_time_label = document.createElement('div');
+            dev_time_label.setAttribute('class', 'project_label');
+            dev_time_label.style.marginTop = '14px';
+            dev_time_label.innerHTML = '数据更新时间';
+            dev.appendChild(dev_time_label);
+            var dev_time_info = document.createElement('div');
+            dev_time_info.setAttribute('class', 'project_info');
+            dev_time_info.style.marginTop = '12px';
+            dev_time_info.style.marginBottom = '12px';
+            dev_time_info.innerHTML = (devicesStore[i].status_time == '1970-01-01 08:00:00') ? '-' : devicesStore[i].status_time;
+            dev.appendChild(dev_time_info);
+        }
+    }
+    show_realtime_status(0);
+}
+
+var big_view_win = function (obj) {
+    Ext.create('Ext.window.Window', {
+        id: 'big_view_win',
+        title: '监控视频',
+        height: 680,
+        width: 800,
+        layout: 'fit',
+        modal: true,
+        maximizable: true,
+        buttons: [{
+            text: '关闭',
+            handler: function () {
+                Ext.getCmp('big_view_win').destroy();
+            }
+        }],
+        closeAction: 'destroy',
+        html: '<iframe width="99%" height="99%" frameborder=0 allowtransparency="true" scrolling=auto src="' + basePath + 'view/frontpage/video.jsp?videoId=' + obj.owner_code + '"></iframe>'
+    }).show();
+
+}
+
+var reset_video = function (obj) {
+    var query = {
+        CMD: 3,
+        BODY: {
+            DEVICE: obj.owner_code,
+            ACTION: 0,
+            IDX: 0
+        }
+    }
+    var status_list_bar = document.getElementById('status_list_bar');
+    status_list_bar.setAttribute('status', 'connecting');
+    status_list_bar.innerHTML = '<div style="margin-top:120px;">连接中,请稍候...</div>';
+    $.ajax({
+        type: 'POST',
+        url: 'https://fire.usky.cn:8443/YtIoT/cgi-bin/demo2.cgi',
+        data: 'queryJson:' + JSON.stringify(query),
+        success: function (result) {
+        }
+    });
+    onair_video = false;
+    setTimeout(chk_cideo, 5000);
+}
+
+var open_video = function (obj) {
+    var query = {
+        CMD: 3,
+        BODY: {
+            DEVICE: obj.getAttribute('owner_code'),
+            ACTION: 1,
+            IDX: 7
+        }
+    }
+    var status_list_bar = document.getElementById('status_list_bar');
+    status_list_bar.setAttribute('status', 'connecting');
+    status_list_bar.innerHTML = '<div style="margin-top:120px;">连接中,请稍候...</div>';
+    $.ajax({
+        type: 'POST',
+        url: 'https://fire.usky.cn:8443/YtIoT/cgi-bin/demo2.cgi',
+        data: 'queryJson:' + JSON.stringify(query),
+        success: function (result) {
+        }
+    });
+    onair_video = false;
+    //	setTimeout(chk_cideo,5000);
+}
+
+var chk_cideo = function () {
+    if (onair_video)
+        return;
+    var query = {
+        CMD: 1
+    }
+    $.ajax({
+        type: 'POST',
+        url: 'https://fire.usky.cn:8443/YtIoT/cgi-bin/demo2.cgi',
+        data: 'queryJson:' + JSON.stringify(query),
+        success: function (result) {
+            var json = eval('(' + result + ')');
+            var v_reset = document.getElementById('v_reset');
+            if (v_reset != undefined) {
+                var found = false;
+                if (json.RESULT.LIST != undefined) {
+                    if (json.RESULT.LIST.length > 0) {
+                        for (var i = 0; i < json.RESULT.LIST.length; i++) {
+                            if (json.RESULT.LIST[i].DEVICE == v_reset.owner_code) {
+                                found = true;
+                                online_video = json.RESULT.LIST[i].LIVEONLINE;
+                                if ((json.RESULT.LIST[i].ONAIR) && (!onair_video)) {
+                                    $("#v_reset").css('display', 'block');
+                                    $("#big_view").css('display', 'block');
+                                    onair_video = true;
+                                    var status_list_bar = document.getElementById('status_list_bar');
+                                    status_list_bar.setAttribute('status', '');
+                                    status_list_bar.innerHTML = '<iframe width="99%" height="99%" frameborder=0 allowtransparency="true" scrolling=auto src="' + basePath + 'view/frontpage/video.jsp?videoId=' + json.RESULT.LIST[i].DEVICE + '"></iframe>';
+                                } else if (!json.RESULT.LIST[i].ONAIR) {
+                                    if (json.RESULT.LIST[i].ALIVEVALUE == 3) {
+                                        onair_video = false;
+                                        var status_list_bar = document.getElementById('status_list_bar');
+                                        if (status_list_bar.getAttribute('status') == '')
+                                            status_list_bar.innerHTML = '<div style="margin-top:120px;cursor:pointer;" owner_code="' + json.RESULT.LIST[i].DEVICE + '" onclick="open_video(this)">设备在线,点击加载视频</div>';
+                                    } else if (json.RESULT.LIST[i].ALIVEVALUE == 2) {
+                                        onair_video = false;
+                                        var status_list_bar = document.getElementById('status_list_bar');
+                                        status_list_bar.setAttribute('status', '');
+                                        status_list_bar.innerHTML = '<div style="margin-top:120px;">设备重连中,请稍候...</div>';
+                                    } else {
+                                        onair_video = false;
+                                        var status_list_bar = document.getElementById('status_list_bar');
+                                        status_list_bar.setAttribute('status', '');
+                                        status_list_bar.innerHTML = '<div style="margin-top:120px;">设备未连线,尝试连接。请稍候...</div>';
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    });
+    setTimeout(chk_cideo, 5000);
+}
+
+var show_realtime_status = function (idx) {
+    $("#device_count_label").html('');
+    if ((devicesStore != null) && (devicesStore.length > idx)) {
+        $("#device_count_label").html('[ ' + devicesStore.length + '-' + (idx + 1) + ' ]');
+        var status_list_bar = document.getElementById('status_list_bar');
+        status_list_bar.setAttribute('status', '');
+        status_list_bar.innerHTML = '';
+        var title = document.createElement('div');
+        title.id = 'device_list_status_title';
+        title.style.textAlign = 'center';
+        title.style.fontSize = '16px';
+        title.style.fontWeight = 'bold';
+        title.innerHTML = devicesStore[idx].device_name;
+        status_list_bar.appendChild(title);
+        var sta = document.createElement('table');
+        sta.style.marginTop = '10px';
+        sta.width = '100%';
+        sta.idx = i;
+        status_list_bar.appendChild(sta);
+        var v_reset = document.getElementById('v_reset');
+        if (v_reset != undefined) {
+            document.body.removeChild(v_reset);
+        }
+        var big_view = document.getElementById('big_view');
+        if (big_view != undefined) {
+            document.body.removeChild(big_view);
+        }
+        $("#status_list_bar").removeClass('status_list_bar_video');
+        if (devicesStore[idx].dwtype == 'YTVA') {
+            online_video = false;
+            if (onair_video) {
+                onair_video = false;
+                chk_cideo();
+            }
+            v_reset = document.createElement('div');
+            v_reset.id = 'v_reset';
+            v_reset.owner_code = devicesStore[idx].owner_code;
+            v_reset.setAttribute('class', 'v_reset');
+            v_reset.setAttribute('onclick', 'reset_video(this)');
+            v_reset.title = '视频重载';
+            document.body.appendChild(v_reset);
+            $("#v_reset").css('display', 'none');
+            big_view = document.createElement('div');
+            big_view.id = 'big_view';
+            big_view.owner_code = devicesStore[idx].owner_code;
+            big_view.setAttribute('class', 'big_view');
+            big_view.setAttribute('onclick', 'big_view_win(this)');
+            big_view.title = '视频放大';
+            document.body.appendChild(big_view);
+            $("#big_view").css('display', 'none');
+            $("#status_list_bar").addClass('status_list_bar_video');
+            $("#status_list_bar").html('<div style="margin-top:120px;">连接中,请稍候...</div>');
+        } else if (devicesStore[idx].dwtype == 'YTFC') {
+            var tr = document.createElement('tr');
+            sta.appendChild(tr);
+            var td = document.createElement('td');
+            td.width = '30%';
+            td.setAttribute('class', 'point_label project_label');
+            td.style.paddingTop = '14px';
+            td.id = 'PowerAlarmLabel';
+            td.innerHTML = '电源故障状态';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.id = 'PowerAlarm';
+            td.width = '20%';
+            td.setAttribute('class', 'project_info');
+            td.style.paddingTop = '12px';
+            tr.appendChild(td);
+            var td = document.createElement('td');
+            td.setAttribute('class', 'point_label project_label');
+            td.style.paddingTop = '14px';
+            td.width = '30%';
+            td.id = 'ManualActLabel';
+            td.innerHTML = '手自动状态';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.width = '20%';
+            td.id = 'ManualAct';
+            td.setAttribute('class', 'project_info');
+            td.style.paddingTop = '12px';
+            tr.appendChild(td);
+            tr = document.createElement('tr');
+            sta.appendChild(tr);
+            var td = document.createElement('td');
+            td.setAttribute('class', 'point_label project_label');
+            td.style.paddingTop = '14px';
+            td.id = 'DevWorking01Label';
+            td.innerHTML = '1#设备运行状态';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.id = 'DevWorking01';
+            td.setAttribute('class', 'project_info');
+            td.style.paddingTop = '12px';
+            tr.appendChild(td);
+            var td = document.createElement('td');
+            td.setAttribute('class', 'point_label project_label');
+            td.style.paddingTop = '14px';
+            td.id = 'DevWorking02Label';
+            td.innerHTML = '2#设备运行状态';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.id = 'DevWorking02';
+            td.setAttribute('class', 'project_info');
+            td.style.paddingTop = '12px';
+            tr.appendChild(td);
+            tr = document.createElement('tr');
+            sta.appendChild(tr);
+            var td = document.createElement('td');
+            td.setAttribute('class', 'point_label project_label');
+            td.style.paddingTop = '14px';
+            td.id = 'DevAlarm01Label';
+            td.innerHTML = '1#设备故障状态';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.id = 'DevAlarm01';
+            td.setAttribute('class', 'project_info');
+            td.style.paddingTop = '12px';
+            tr.appendChild(td);
+            var td = document.createElement('td');
+            td.setAttribute('class', 'point_label project_label');
+            td.style.paddingTop = '14px';
+            td.id = 'DevAlarm02Label';
+            td.innerHTML = '2#设备故障状态';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.id = 'DevAlarm02';
+            td.setAttribute('class', 'project_info');
+            td.style.paddingTop = '12px';
+            tr.appendChild(td);
+            tr = document.createElement('tr');
+            sta.appendChild(tr);
+            var td = document.createElement('td');
+            td.setAttribute('class', 'point_label project_label');
+            td.style.paddingTop = '14px';
+            td.id = 'FireAutoActLabel';
+            td.innerHTML = '消防联动状态';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.id = 'FireAutoAct';
+            td.setAttribute('class', 'project_info');
+            td.style.paddingTop = '12px';
+            tr.appendChild(td);
+            var status_list = devicesStore[idx].status_list;
+            status_list.sort(staSortBypoint);
+            for (var i = 0; i < status_list.length; i++) {
+                var words = status_list[i].content.split(" ");
+                if (words.length > 0) {
+                    if (status_list[i].point_code == 1) {
+                        $("#PowerAlarmLabel").html(status_list[i].point_name);
+                        $("#PowerAlarm").html(words[0]);
+                    } else if (status_list[i].point_code == 2) {
+                        $("#ManualActLabel").html(status_list[i].point_name);
+                        $("#ManualAct").html(words[0]);
+                    } else if (status_list[i].point_code == 3) {
+                        $("#DevWorking01Label").html(status_list[i].point_name);
+                        $("#DevWorking01").html(words[0]);
+                    } else if (status_list[i].point_code == 4) {
+                        $("#DevWorking02Label").html(status_list[i].point_name);
+                        $("#DevWorking02").html(words[0]);
+                    } else if (status_list[i].point_code == 5) {
+                        $("#DevAlarm01Label").html(status_list[i].point_name);
+                        $("#DevAlarm01").html(words[0]);
+                    } else if (status_list[i].point_code == 6) {
+                        $("#DevAlarm02Label").html(status_list[i].point_name);
+                        $("#DevAlarm02").html(words[0]);
+                    } else if (status_list[i].point_code == 7) {
+                        $("#FireAutoActLabel").html(status_list[i].point_name);
+                        $("#FireAutoAct").html(words[0]);
+                    }
+                }
+            }
+        } else if (devicesStore[idx].dwtype == 'YTWC') {
+            var status_list = devicesStore[idx].status_list;
+            status_list.sort(staSortBypoint);
+            for (var i = 0; i < status_list.length; i++) {
+
+                var tr = document.createElement('tr');
+                sta.appendChild(tr);
+                var td = document.createElement('td');
+                td.width = '30%';
+                td.setAttribute('class', 'point_label project_label');
+                td.style.paddingTop = '14px';
+                td.innerHTML = status_list[i].point_name;
+                tr.appendChild(td);
+                td = document.createElement('td');
+                td.innerHTML = (status_list[i].content).substring(0, 2);
+                td.width = '20%';
+                td.setAttribute('class', 'project_info');
+                td.style.paddingTop = '12px';
+                tr.appendChild(td);
+            }
+        } else if (devicesStore[idx].dwtype == 'YTEF') {
+            var tr = document.createElement('tr');
+            sta.appendChild(tr);
+            var td = document.createElement('td');
+            td.setAttribute('class', 'project_label');
+            td.innerHTML = '供电过压状态';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_label');
+            td.innerHTML = '供电低压状态';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_label');
+            td.innerHTML = '供电过流状态';
+            tr.appendChild(td);
+            tr = document.createElement('tr');
+            sta.appendChild(tr);
+            td = document.createElement('td');
+            td.id = 'HighVoltageAlarm'
+            td.setAttribute('class', 'project_info');
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.id = 'LowVoltageAlarm'
+            td.setAttribute('class', 'project_info');
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.id = 'HighCurrentAlarm'
+            td.setAttribute('class', 'project_info');
+            tr.appendChild(td);
+            tr = document.createElement('tr');
+            sta.appendChild(tr);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_label');
+            td.innerHTML = '漏电报警状态';
+            tr.appendChild(td);
+            tr = document.createElement('tr');
+            sta.appendChild(tr);
+            td = document.createElement('td');
+            td.id = 'ElectricityLeakage'
+            td.setAttribute('class', 'project_info');
+            tr.appendChild(td);
+            tr = document.createElement('tr');
+            sta.appendChild(tr);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_label');
+            td.innerHTML = 'A相线缆高温状态';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_label');
+            td.innerHTML = 'B相线缆高温状态';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_label');
+            td.innerHTML = 'C相线缆高温状态';
+            tr.appendChild(td);
+            tr = document.createElement('tr');
+            sta.appendChild(tr);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_info');
+            td.id = 'HighTemperatureA';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_info');
+            td.id = 'HighTemperatureB';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_info');
+            td.id = 'HighTemperatureC';
+            tr.appendChild(td);
+            tr = document.createElement('tr');
+            sta.appendChild(tr);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_label');
+            td.innerHTML = 'A相电压';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_label');
+            td.innerHTML = 'B相电压';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_label');
+            td.innerHTML = 'C相电压';
+            tr.appendChild(td);
+            tr = document.createElement('tr');
+            sta.appendChild(tr);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_info');
+            td.id = 'VoltageA';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_info');
+            td.id = 'VoltageB';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_info');
+            td.id = 'VoltageC';
+            tr.appendChild(td);
+            tr = document.createElement('tr');
+            sta.appendChild(tr);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_label');
+            td.innerHTML = 'A相电流';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_label');
+            td.innerHTML = 'B相电流';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_label');
+            td.innerHTML = 'C相电流';
+            tr.appendChild(td);
+            tr = document.createElement('tr');
+            sta.appendChild(tr);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_info');
+            td.id = 'CurrentA';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_info');
+            td.id = 'CurrentB';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_info');
+            td.id = 'CurrentC';
+            tr.appendChild(td);
+            tr = document.createElement('tr');
+            sta.appendChild(tr);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_label');
+            td.innerHTML = 'A相温度';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_label');
+            td.innerHTML = 'B相温度';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_label');
+            td.innerHTML = 'C相温度';
+            tr.appendChild(td);
+            tr = document.createElement('tr');
+            sta.appendChild(tr);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_info');
+            td.id = 'TemperatureA';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_info');
+            td.id = 'TemperatureB';
+            tr.appendChild(td);
+            td = document.createElement('td');
+            td.setAttribute('class', 'project_info');
+            td.id = 'TemperatureC';
+            tr.appendChild(td);
+            var status_list = devicesStore[idx].status_list;
+            status_list.sort(staSortBypoint);
+            for (var i = 0; i < status_list.length; i++) {
+                if (status_list[i].point_code == 1) {
+                    $("#HighVoltageAlarm").html((status_list[i].point_data == '0') ? '正常' : '告警');
+                } else if (status_list[i].point_code == 2) {
+                    $("#LowVoltageAlarm").html((status_list[i].point_data == '0') ? '正常' : '告警');
+                } else if (status_list[i].point_code == 3) {
+                    $("#HighCurrentAlarm").html((status_list[i].point_data == '0') ? '正常' : '告警');
+                } else if (status_list[i].point_code == 4) {
+                    $("#ElectricityLeakage").html((status_list[i].point_data == '0') ? '正常' : '告警');
+                } else if (status_list[i].point_code == 5) {
+                    $("#HighTemperatureA").html((status_list[i].point_data == '0') ? '正常' : '告警');
+                } else if (status_list[i].point_code == 6) {
+                    $("#HighTemperatureB").html((status_list[i].point_data == '0') ? '正常' : '告警');
+                } else if (status_list[i].point_code == 7) {
+                    $("#HighTemperatureC").html((status_list[i].point_data == '0') ? '正常' : '告警');
+                } else if (status_list[i].point_code == 65) {
+                    if (status_list[i].point_data.length > 0)
+                        $("#VoltageA").html(status_list[i].point_data + '<img class="detail_data_btn" src="' + basePath + 'res/img/common/famicons/chart_curve.png" onclick="show_detail_data(' + devicesStore[idx].owner_code + ',' + status_list[i].point_code + ',\'' + status_list[i].point_name + '\')"/>');
+                } else if (status_list[i].point_code == 66) {
+                    if (status_list[i].point_data.length > 0)
+                        $("#VoltageB").html(status_list[i].point_data + '<img class="detail_data_btn" src="' + basePath + 'res/img/common/famicons/chart_curve.png" onclick="show_detail_data(' + devicesStore[idx].owner_code + ',' + status_list[i].point_code + ',\'' + status_list[i].point_name + '\')"/>');
+                } else if (status_list[i].point_code == 67) {
+                    if (status_list[i].point_data.length > 0)
+                        $("#VoltageC").html(status_list[i].point_data + '<img class="detail_data_btn" src="' + basePath + 'res/img/common/famicons/chart_curve.png" onclick="show_detail_data(' + devicesStore[idx].owner_code + ',' + status_list[i].point_code + ',\'' + status_list[i].point_name + '\')"/>');
+                } else if (status_list[i].point_code == 68) {
+                    if (status_list[i].point_data.length > 0)
+                        $("#CurrentA").html(status_list[i].point_data + '<img class="detail_data_btn" src="' + basePath + 'res/img/common/famicons/chart_curve.png" onclick="show_detail_data(' + devicesStore[idx].owner_code + ',' + status_list[i].point_code + ',\'' + status_list[i].point_name + '\')"/>');
+                } else if (status_list[i].point_code == 69) {
+                    if (status_list[i].point_data.length > 0)
+                        $("#CurrentB").html(status_list[i].point_data + '<img class="detail_data_btn" src="' + basePath + 'res/img/common/famicons/chart_curve.png" onclick="show_detail_data(' + devicesStore[idx].owner_code + ',' + status_list[i].point_code + ',\'' + status_list[i].point_name + '\')"/>');
+                } else if (status_list[i].point_code == 70) {
+                    if (status_list[i].point_data.length > 0)
+                        $("#CurrentC").html(status_list[i].point_data + '<img class="detail_data_btn" src="' + basePath + 'res/img/common/famicons/chart_curve.png" onclick="show_detail_data(' + devicesStore[idx].owner_code + ',' + status_list[i].point_code + ',\'' + status_list[i].point_name + '\')"/>');
+                } else if (status_list[i].point_code == 71) {
+                    if (status_list[i].point_data.length > 0)
+                        $("#TemperatureA").html(status_list[i].point_data + '<img class="detail_data_btn" src="' + basePath + 'res/img/common/famicons/chart_curve.png" onclick="show_detail_data(' + devicesStore[idx].owner_code + ',' + status_list[i].point_code + ',\'' + status_list[i].point_name + '\')"/>');
+                } else if (status_list[i].point_code == 72) {
+                    if (status_list[i].point_data.length > 0)
+                        $("#TemperatureB").html(status_list[i].point_data + '<img class="detail_data_btn" src="' + basePath + 'res/img/common/famicons/chart_curve.png" onclick="show_detail_data(' + devicesStore[idx].owner_code + ',' + status_list[i].point_code + ',\'' + status_list[i].point_name + '\')"/>');
+                } else if (status_list[i].point_code == 73) {
+                    if (status_list[i].point_data.length > 0)
+                        $("#TemperatureC").html(status_list[i].point_data + '<img class="detail_data_btn" src="' + basePath + 'res/img/common/famicons/chart_curve.png" onclick="show_detail_data(' + devicesStore[idx].owner_code + ',' + status_list[i].point_code + ',\'' + status_list[i].point_name + '\')"/>');
+                }
+            }
+        } else if (devicesStore[idx].dwtype == 'YTSM') {
+            var status_list = devicesStore[idx].status_list;
+            status_list.sort(staSortBypoint);
+            for (var i = 0; i < status_list.length; i++) {
+                if (((status_list[i].point_code > 0) && (status_list[i].point_code < 5) && (status_list[i].point_name != '') && (status_list[i].point_code != 3)) ||
+                    ((status_list[i].point_code == 3) && (status_list[i].point_data != 0))) {
+                    var tr = document.createElement('tr');
+                    sta.appendChild(tr);
+                    var sta_name = document.createElement('td');
+                    sta_name.width = "40%";
+                    sta_name.setAttribute('class', 'point_label project_label');
+                    sta_name.style.paddingTop = '14px';
+                    sta_name.innerHTML = status_list[i].point_name;
+                    tr.appendChild(sta_name);
+                    var sta_value = document.createElement('td');
+                    sta_value.setAttribute('class', 'project_info');
+                    sta_value.style.paddingTop = '12px';
+                    if (status_list[i].point_code == 1)
+                        sta_value.innerHTML = status_list[i].content;
+                    else
+                        sta_value.innerHTML = status_list[i].point_data + '<img class="detail_data_btn" src="' + basePath + 'res/img/common/famicons/chart_curve.png" onclick="show_detail_data(' + devicesStore[idx].owner_code + ',' + (status_list[i].point_code + ((devicesStore[idx].start_port > 0) ? (devicesStore[idx].start_port + 63) : 0)) + ',\'' + status_list[i].point_name + '\')"/>';
+                    tr.appendChild(sta_value);
+                }
+            }
+        } else {
+            var status_list = devicesStore[idx].status_list;
+            status_list.sort(staSortBypoint);
+            for (var i = 0; i < status_list.length; i++) {
+                if (status_list[i].point_code > 0) {
+                    var tr = document.createElement('tr');
+                    sta.appendChild(tr);
+                    var sta_name = document.createElement('td');
+                    sta_name.width = "40%";
+                    sta_name.setAttribute('class', 'point_label project_label');
+                    sta_name.style.paddingTop = '14px';
+                    sta_name.innerHTML = status_list[i].point_name;
+                    tr.appendChild(sta_name);
+                    var sta_value = document.createElement('td');
+                    sta_value.setAttribute('class', 'project_info');
+                    sta_value.style.paddingTop = '12px';
+                    //					sta_value.style.paddingBottom='12px';
+                    if (devicesStore[idx].dwtype == 'YTUI') {
+                        if (V_LOGINNAME == 'admin')
+                            sta_value.innerHTML = status_list[i].content + '<img class="detail_data_btn" src="' + basePath + 'res/img/common/famicons/chart_curve.png" onclick="show_userinfo_detail(' + devicesStore[idx].owner_code + ')"/>';
+                        else
+                            sta_value.innerHTML = status_list[i].content;
+                    } else if ((devicesStore[idx].dwtype == 'YTWP') || (devicesStore[idx].dwtype == 'YTLL')) {
+                        if (status_list[i].point_name.indexOf('状态') >= 0) {
+                            if ((status_list[i].point_data == 0) || (status_list[i].point_data == '00'))
+                                sta_value.innerHTML = '正常';
+                            else
+                                sta_value.innerHTML = '--';
+                        } else if (status_list[i].point_data.length > 0)
+                            sta_value.innerHTML = status_list[i].point_data + '<img class="detail_data_btn" src="' + basePath + 'res/img/common/famicons/chart_curve.png" onclick="show_detail_data(' + devicesStore[idx].owner_code + ',' + (status_list[i].point_code + ((devicesStore[idx].start_port > 0) ? (devicesStore[idx].start_port + 63) : 0)) + ',\'' + status_list[i].point_name + '\')"/>';
+                    } else if (status_list[i].point_data.length > 0)
+                        sta_value.innerHTML = status_list[i].point_data + '<img class="detail_data_btn" src="' + basePath + 'res/img/common/famicons/chart_curve.png" onclick="show_detail_data(' + devicesStore[idx].owner_code + ',' + (status_list[i].point_code + ((devicesStore[idx].start_port > 0) ? (devicesStore[idx].start_port + 63) : 0)) + ',\'' + status_list[i].point_name + '\')"/>';
+                    tr.appendChild(sta_value);
+                }
+            }
+        }
+    }
+}
+
+var fill_uiwin = function (json) {
+    fillvalue = true;
+    Ext.getCmp('userinfo_pushalarm').setValue(json.PUSH_WX == 1);
+    Ext.getCmp('userinfo_pushtts').setValue(json.PUSH_TTS == 1);
+    fillvalue = false;
+    var data = new Array();
+    for (var i = 0; i < json.LIST.length; i++) {
+        var obj = new Array();
+        if (json.LIST[i].id == 1)
+            obj.push('故障');
+        else if (json.LIST[i].id == 2)
+            obj.push('告警');
+        else if (json.LIST[i].id == 3)
+            obj.push('反馈');
+        else if (json.LIST[i].id == 4)
+            obj.push('监管');
+        else if (json.LIST[i].id == 5)
+            obj.push('启动');
+        else if (json.LIST[i].id == 6)
+            obj.push('自检');
+        else if (json.LIST[i].id == 7)
+            obj.push('屏蔽');
+        else if (json.LIST[i].id == 8)
+            obj.push('复位');
+        else if (json.LIST[i].id == 9)
+            obj.push('消音');
+        obj.push(json.LIST[i].count);
+        data.push(obj);
+    }
+    var themecolor = ((theme == '') || (theme == 'access')) ? '#ffffff' : '#000000';
+    Highcharts.chart('detail_area', {
+        chart: {
+            type: 'column',
+            backgroundColor: 'rgba(0,0,0,0)'
+        },
+        title: {
+            text: '用户传输装置报告类型统计',
+            style: {fontSize: '14px', color: themecolor, fontWeight: 'bold'},
+        },
+        xAxis: {
+            type: 'category',
+            labels: {
+                style: {fontSize: '12px', color: themecolor, fontWeight: 'bold'}
+            }
+        },
+        yAxis: {
+            title: {
+                text: '报告计次',
+                style: {fontSize: '14px', color: themecolor, fontWeight: 'bold'}
+            },
+            labels: {
+                style: {fontSize: '12px', color: themecolor, fontWeight: 'bold'}
+            }
+        },
+        legend: {
+            enabled: false
+        },
+        exporting: {
+            enabled: false
+        },
+        credits: {
+            enabled: false
+        },
+        series: [{
+            name: '报告计次',
+            data: data,
+            dataLabels: {
+                enabled: true,
+                rotation: -90,
+                align: 'right',
+                format: '{point.y}',
+                style: {fontSize: '14px', color: themecolor, fontWeight: 'bold'},
+                y: 10
+            },
+            colorByPoint: true
+        }]
+
+    });
+}
+
+var show_userinfo_detail = function (devId) {
+    var device_id = devId;
+    Ext.create('Ext.window.Window', {
+        id: 'detail_userinfo_win',
+        title: '<div id="detail_userinfo_title">用户传输装置信息</div>',
+        bodyStyle: 'background-color:rgba(0,0,0,0.0);',
+        height: 400,
+        width: 1110,
+        modal: true,
+        layout: {
+            type: 'table',
+            columns: 6,
+            tableAttrs: {
+                style: {
+                    width: '100%'
+                }
+            }
+        },
+        buttons: [{
+            text: '查岗',
+            handler: function () {
+                var query = new Object();
+                query.V_LOGINNAME = V_LOGINNAME;
+                query.V_PASSWORD = V_PASSWORD;
+                query.DEVICE_ID = devId;
+                query.CMD = 91;
+                query.LIMIT = 10;
+                var qjson = Ext.JSON.encode(query);
+                var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
+                $.ajax({
+                    type: 'POST',
+                    url: url,
+                    data: qjson,
+                    success: function (result) {
+                        var json = eval('(' + result + ')');
+                        if (json.RESULT == '1') {
+                            Ext.Msg.alert('操作信息', '命令已下发');
+                        }
+                    }
+                });
+            }
+        }, {
+            text: '清空',
+            handler: function () {
+                var query = new Object();
+                query.V_LOGINNAME = V_LOGINNAME;
+                query.V_PASSWORD = V_PASSWORD;
+                query.DEVICE_ID = devId;
+                query.CMD = 92;
+                query.LIMIT = 0;
+                var qjson = Ext.JSON.encode(query);
+                var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
+                $.ajax({
+                    type: 'POST',
+                    url: url,
+                    data: qjson,
+                    success: function (result) {
+                        var json = eval('(' + result + ')');
+                        if (json.RESULT == '1') {
+                            Ext.Msg.alert('操作信息', '命令已下发');
+                            fill_uiwin(json);
+                        }
+
+                    }
+                });
+            }
+        }, {
+            text: '查询',
+            handler: function () {
+                var query = new Object();
+                query.V_LOGINNAME = V_LOGINNAME;
+                query.V_PASSWORD = V_PASSWORD;
+                query.DEVICE_ID = devId;
+                query.CMD = 93;
+                query.PARAM = 0;
+                var qjson = Ext.JSON.encode(query);
+                var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
+                $.ajax({
+                    type: 'POST',
+                    url: url,
+                    data: qjson,
+                    success: function (result) {
+                        var json = eval('(' + result + ')');
+                        if (json.RESULT == '1') {
+                            fill_uiwin(json);
+                        }
+                    }
+                });
+            }
+        }, {
+            text: '关闭',
+            handler: function () {
+                Ext.getCmp('detail_userinfo_win').destroy();
+            }
+        }],
+        tbar: ['->', {
+            xtype: 'checkbox',
+            boxLabel: '语音推送',
+            id: 'userinfo_pushtts',
+            checked: true,
+            hidden: true,
+            handler: function () {
+                if (!fillvalue) {
+                    var pushtts = Ext.getCmp('userinfo_pushtts').getValue();
+                    Ext.create('Ext.window.Window', {
+                        id: 'detail_userinfo_pushset_win',
+                        title: '请验证身份',
+                        width: 320,
+                        height: 240,
+                        modal: true,
+                        closable: false,
+                        items: [{
+                            xtype: 'textfield',
+                            name: 'v_loginname',
+                            fieldLabel: '登录名',
+                            id: 'v_loginname',
+                            allowBlank: false
+                        }, {
+                            xtype: 'textfield',
+                            name: 'v_password',
+                            fieldLabel: '密  码',
+                            id: 'v_password',
+                            inputType: 'password',
+                            allowBlank: false
+                        }],
+                        bbar: ['->', {
+                            xtype: 'button',
+                            text: '提交',
+                            handler: function () {
+                                var query = new Object();
+                                query.V_LOGINNAME = V_LOGINNAME;
+                                query.V_PASSWORD = V_PASSWORD;
+                                query.DEVICE_ID = devId;
+                                query.CMD = 95;
+                                query.PARAM = pushtts ? 1 : 0;
+                                var qjson = Ext.JSON.encode(query);
+                                var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
+                                $.ajax({
+                                    type: 'POST',
+                                    url: url,
+                                    data: qjson,
+                                    success: function (result) {
+                                        var json = eval('(' + result + ')');
+                                        if (json.RESULT == '1') {
+                                            Ext.Msg.alert('操作信息', '命令已下发');
+
+                                        }
+                                    }
+                                });
+                                this.up("window").close();
+                            }
+                        }, {
+                            xtype: 'button',
+                            text: '关闭',
+                            handler: function () {
+                                this.up("window").close();
+                            }
+                        }],
+                        closeAction: 'destroy',
+                        listeners: {
+                            close: function () {
+                                var query = new Object();
+                                query.V_LOGINNAME = V_LOGINNAME;
+                                query.V_PASSWORD = V_PASSWORD;
+                                query.DEVICE_ID = devId;
+                                query.CMD = 93;
+                                query.PARAM = 0;
+                                var qjson = Ext.JSON.encode(query);
+                                var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
+                                $.ajax({
+                                    type: 'POST',
+                                    url: url,
+                                    data: qjson,
+                                    success: function (result) {
+                                        var json = eval('(' + result + ')');
+                                        if (json.RESULT == '1') {
+                                            fill_uiwin(json);
+                                        }
+                                    }
+                                });
+                            }
+                        }
+                    }).show();
+                }
+            }
+        }, '-', {
+            xtype: 'checkbox',
+            boxLabel: '微信推送',
+            id: 'userinfo_pushalarm',
+            checked: true,
+            handler: function () {
+                if (!fillvalue) {
+                    var pushalarm = Ext.getCmp('userinfo_pushalarm').getValue();
+                    Ext.create('Ext.window.Window', {
+                        id: 'detail_userinfo_pushset_win',
+                        title: '请验证身份',
+                        width: 320,
+                        height: 240,
+                        modal: true,
+                        closable: false,
+                        items: [{
+                            xtype: 'textfield',
+                            name: 'v_loginname',
+                            fieldLabel: '登录名',
+                            id: 'v_loginname',
+                            allowBlank: false
+                        }, {
+                            xtype: 'textfield',
+                            name: 'v_password',
+                            fieldLabel: '密  码',
+                            id: 'v_password',
+                            inputType: 'password',
+                            allowBlank: false
+                        }],
+                        bbar: ['->', {
+                            xtype: 'button',
+                            text: '提交',
+                            handler: function () {
+                                var query = new Object();
+                                query.V_LOGINNAME = V_LOGINNAME;
+                                query.V_PASSWORD = V_PASSWORD;
+                                query.DEVICE_ID = devId;
+                                query.CMD = 94;
+                                query.PARAM = pushalarm ? 1 : 0;
+                                var qjson = Ext.JSON.encode(query);
+                                var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
+                                $.ajax({
+                                    type: 'POST',
+                                    url: url,
+                                    data: qjson,
+                                    success: function (result) {
+                                        var json = eval('(' + result + ')');
+                                        if (json.RESULT == '1') {
+                                            Ext.Msg.alert('操作信息', '命令已下发');
+
+                                        }
+                                    }
+                                });
+                                this.up("window").close();
+                            }
+                        }, {
+                            xtype: 'button',
+                            text: '关闭',
+                            handler: function () {
+                                this.up("window").close();
+                            }
+                        }],
+                        closeAction: 'destroy',
+                        listeners: {
+                            close: function () {
+                                var query = new Object();
+                                query.V_LOGINNAME = V_LOGINNAME;
+                                query.V_PASSWORD = V_PASSWORD;
+                                query.DEVICE_ID = devId;
+                                query.CMD = 93;
+                                query.PARAM = 0;
+                                var qjson = Ext.JSON.encode(query);
+                                var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
+                                $.ajax({
+                                    type: 'POST',
+                                    url: url,
+                                    data: qjson,
+                                    success: function (result) {
+                                        var json = eval('(' + result + ')');
+                                        if (json.RESULT == '1') {
+                                            fill_uiwin(json);
+                                        }
+                                    }
+                                });
+                            }
+                        }
+                    }).show();
+                }
+            }
+        }],
+        closeAction: 'destroy',
+        html: '<div id="detail_background" class="detail_background"><div id="detail_area" class="detail_area" style="height:304px;"></div></div>'
+    }).show();
+    var query = new Object();
+    query.V_LOGINNAME = V_LOGINNAME;
+    query.V_PASSWORD = V_PASSWORD;
+    query.DEVICE_ID = devId;
+    query.CMD = 93;
+    query.PARAM = 0;
+    var qjson = Ext.JSON.encode(query);
+    var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
+    $.ajax({
+        type: 'POST',
+        url: url,
+        data: qjson,
+        success: function (result) {
+            var json = eval('(' + result + ')');
+            if (json.RESULT == '1') {
+                fill_uiwin(json);
+            }
+        }
+    });
+}
+
+var show_detail_data = function (devId, ponitId, name) {
+    var device_id = devId;
+    var point_code = ponitId;
+    Ext.create('Ext.window.Window', {
+        id: 'detail_data_win',
+        title: '<div id="detail_win_title">详细数据</div>',
+        height: 400,
+        width: 1110,
+        layout: 'fit',
+        modal: true,
+        buttons: [{
+            text: '导出',
+            handler: function exportbtn_click(device_id, point_code) {
+                var fields = '';
+                var array = ['id', 'device_id', 'name', 'point_code', 'point_data', 'company', 'data_time'];
+                var name = ['编号', '设备编号', '设备名称', '端口号', '数据值', '公司名称', '添加时间'];
+                for (var i = 0; i < 7; i++) {
+                    if (i > 0)
+                        fields += ',';
+                    fields += '{id:"' + array[i] + '",title:"' + name[i] + '",shown:"' + true + '"}';
+                }
+                var query = new Object();
+                query.device_id = devId;
+                query.point_code = ponitId;
+                query.EXPORT_FILE = '折线图数据监控列表';
+                query.fields = '[' + fields + ']';
+                $.ajax({
+                    type: 'POST',
+                    url: basePath + "iot/excel/view/Exportexl",
+                    data: {
+                        queryJson: Ext.JSON.encode(query)
+                    },
+                    success: function (result) {
+                        var json = eval('(' + result + ')');
+                        if (json.action == 'dormExport') {
+                            ConfirmStore = json.RESULT;
+                            var elemIF = document.createElement("iframe");
+                            elemIF.src = basePath + json.filename;
+                            elemIF.style.display = "none";
+                            document.body.appendChild(elemIF);
+                        }
+                    }
+                });
+            }
+        }, {
+            text: '关闭',
+            handler: function () {
+                Ext.getCmp('detail_data_win').destroy();
+            }
+        }],
+        closeAction: 'destroy',
+        html: '<div id="detail_background" class="detail_background"><div id="detail_area" class="detail_area"></div></div>'
+    }).show();
+    var query = new Object();
+    query.V_LOGINNAME = V_LOGINNAME;
+    query.V_PASSWORD = V_PASSWORD;
+    query.device_id = devId;
+    query.point_code = ponitId;
+
+    $.ajax({
+        type: 'POST',
+        url: basePath + "iot/data/view/getSyncDataQList",
+        data: {
+            queryJson: Ext.JSON.encode(query)
+        },
+        success: function (result) {
+            var json = eval('(' + result + ')');
+            if (json.action == 'getSyncDataVList') {
+                ConfirmStore = json.RESULT;
+                draw_confirm(name);
+            }
+        }
+    });
+}
+
+var draw_confirm = function (name) {
+    if ((ConfirmStore != undefined) && (ConfirmStore.length > 0)) {
+        var themecolor = ((theme == '') || (theme == 'access')) ? '#ffffff' : '#000000';
+        if ((V_LOGINNAME == 'guest') && (ConfirmStore[0].device_id == '865462043119730')) {
+            ConfirmStore[0].company = '博华广场';
+            ConfirmStore[0].name = '独立烟感';
+        }
+        $("#detail_win_title").html(ConfirmStore[0].company + '_' + ConfirmStore[0].name + '_' + name + ' 一周数据');
+        var data_0 = new Array();
+        var d_time = new Array();
+        var max = 0,
+            min = 0;
+        ;
+        for (var i = 0; i < ConfirmStore.length; i++) {
+            var rec = ConfirmStore[i];
+            var tmp = parseFloat(rec.point_data);
+            var tmp_t = rec.data_time;
+            if (i == 0) {
+                max = tmp;
+                min = tmp;
+            } else {
+                if (max < tmp)
+                    max = tmp;
+                if (min > tmp)
+                    min = tmp;
+            }
+            data_0.push(tmp);
+            d_time.push(tmp_t);
+        }
+        Highcharts.chart('detail_area', {
+            chart: {
+                type: 'area',
+                zoomType: 'xy',
+                backgroundColor: 'rgba(0,0,0,0)'
+            },
+            title: {
+                text: ConfirmStore[0].company + '_' + ConfirmStore[0].name + '_' + name + ' 一周数据',
+                float: true,
+                style: {fontSize: '14px', color: themecolor, fontWeight: 'bold'},
+                enabled: false
+            },
+            legend: {
+                floating: true,
+                x: 410,
+                y: -280,
+                itemStyle: {fontSize: '12px', color: themecolor, fontWeight: 'bold'}
+            },
+            exporting: {
+                enabled: false
+            },
+            credits: {
+                enabled: false
+            },
+            xAxis: [{
+                categories: d_time,
+                labels: {
+                    enabled: false
+                },
+                crosshair: true
+            }],
+            yAxis: [{
+                title: {
+                    text: name,
+                    style: {fontSize: '10px', color: themecolor, fontWeight: 'bold'}
+                },
+                gridLineColor: 'rgba(0,0,0,0.2)',
+                labels: {
+                    format: '{value}',
+                    style: {fontSize: '10px', color: themecolor, fontWeight: 'bold'}
+                },
+                max: max + max * 0.3,
+                min: 0
+            }],
+            tooltip: {
+                shared: true
+            },
+            plotOptions: {
+                area: {
+                    stackiung: 'normal',
+                    marker: {
+                        lineWidth: 0,
+                        enabled: false,
+                        radius: 0
+                    }
+                }
+            },
+            series: [{
+                name: name,
+                type: 'area',
+                data: data_0,
+                lineWidth: 1,
+                tooltip: {
+                    valueSuffix: ' '
+                },
+                fillColor: {
+                    linearGradient: {
+                        x1: 0,
+                        y1: 0,
+                        x2: 0,
+                        y2: 1
+                    },
+                    stops: [
+                        [0, '#34abf5'],
+                        [1, Highcharts.Color('#34abf5').setOpacity(0.0).get('rgba')]
+                    ]
+                }
+            }]
+        });
+    }
+}
+
+var show_alarm_pic = function (url) {
+    var status_list_bar = document.getElementById('status_list_bar');
+    status_list_bar.setAttribute('status', '');
+    status_list_bar.innerHTML = '';
+    var pic = document.createElement('div');
+    pic.style.width = '360px';
+    pic.style.height = '270px';
+    status_list_bar.appendChild(pic);
+    var img = document.createElement('img');
+    img.width = 360;
+    img.height = 270;
+    img.src = url;
+    pic.appendChild(img);
+}
+
+var show_alarm_info = function (dwtype, status, id, name, device_code, company_code, company_name, fullname, time, data, data2, clzt, clwb, clr_name, clnr, clsj) {
+    vAlarmInfoWin.show();
+    if ((dwtype == 'YTVA') || (dwtype == '16')) {
+        vAlarmInfoWin.setWidth(780);
+        Ext.getCmp('picPanel').setWidth(360);
+        Ext.getCmp('picPanel').setHeight(270);
+        var img = document.createElement('img');
+        img.width = 360;
+        img.height = 270;
+        img.src = data2;
+        var alarm_pic = document.getElementById('alarm_pic');
+        alarm_pic.innerHTML = '';
+        alarm_pic.appendChild(img);
+    } else {
+        vAlarmInfoWin.setWidth(400);
+        Ext.getCmp('picPanel').setWidth(0);
+        Ext.getCmp('picPanel').setHeight(0);
+    }
+    $("#VInfoWin_Title").html(data);
+    Ext.getCmp('uf_company_name').setValue(company_name);
+    Ext.getCmp('uf_name').setValue(name);
+    Ext.getCmp('uf_device_code').setValue(device_code);
+    Ext.getCmp('uf_fullname').setValue(fullname);
+    Ext.getCmp('uf_clr').setValue(clr_name);
+    Ext.getCmp('uf_clsj').setValue(clsj);
+    Ext.getCmp('uf_clnr').setValue(clnr);
+    Ext.getCmp('uf_id').setValue(id);
+    Ext.getCmp('uf_clwb').setValue(clwb == '1' ? '误报' : '告警');
+    Ext.getCmp('uf_status').setValue(status);
+    Ext.getCmp('uf_dwtype').setValue(dwtype);
+    if (clzt == '已处理') {
+        vAlarmInfoWin.setHeight(460);
+        Ext.getCmp('uf_clwb').setVisible(true);
+        Ext.getCmp('uf_r_clwb').setVisible(false);
+        Ext.getCmp('uf_r_clfw').setVisible(false);
+        Ext.getCmp('confirmBtn').setVisible(false);
+        Ext.getCmp('uf_clr').setVisible(true);
+        Ext.getCmp('uf_clsj').setVisible(true);
+        if (dwtype == 'YTVA')
+            vAlarmInfoWin.setPosition(
+                ($(document).innerWidth() - 780) / 2,
+                ($(document).innerHeight() - 460) / 2);
+        else
+            vAlarmInfoWin.setPosition(
+                ($(document).innerWidth() - 400) / 2,
+                ($(document).innerHeight() - 460) / 2);
+    } else {
+        vAlarmInfoWin.setHeight(400);
+        Ext.getCmp('uf_clwb').setVisible(false);
+        Ext.getCmp('uf_r_clwb').setVisible(true);
+        Ext.getCmp('uf_r_clfw').setVisible(true);
+        Ext.getCmp('confirmBtn').setVisible(true);
+        Ext.getCmp('uf_clr').setVisible(false);
+        Ext.getCmp('uf_clsj').setVisible(false);
+        if ((dwtype == 'YTVA') || (dwtype == '16'))
+            vAlarmInfoWin.setPosition(
+                ($(document).innerWidth() - 780) / 2,
+                ($(document).innerHeight() - 400) / 2);
+        else
+            vAlarmInfoWin.setPosition(
+                ($(document).innerWidth() - 400) / 2,
+                ($(document).innerHeight() - 400) / 2);
+    }
+}
+
+var getCompanyInfo = function () {
+    var query = new Object();
+    query.V_LOGINNAME = V_LOGINNAME;
+    query.V_PASSWORD = V_PASSWORD;
+    query.COMPANY_CODE = company_code;
+    query.COMMSTATUS = "NO";
+    var qdata = 'queryJson=' + Ext.JSON.encode(query);
+    myMask.show();
+    $.ajax({
+        type: 'POST',
+        url: basePath + "iot/frontpage/getCurrentObjectListByCompanyId",
+        data: qdata,
+        success: function (result) {
+            var json = eval('(' + result + ')');
+            if (json.action == 'getCurrentObjectListByCompanyId') {
+                if (json.check == true) {
+                    if (json.LIST != undefined) {
+                        max_level = json.max_level;
+                        min_level = json.min_level;
+                        top_level = json.top_level;
+                        building_name = json.buinding;
+                        companyStore = json.COMPANY;
+                        buildingStore = json.LIST;
+                    }
+                    draw_buinding();
+                } else {
+                    Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function () {
+                        window.parent.document.location = basePath;
+                    });
+                }
+            }
+            myMask.hide();
+        }
+    });
+    //	setTimeout(getCompanyInfo,storeTime);
+}
+
+
+Ext.onReady(function () {
+    basePath = $("#basePath").val();
+    $("#V_LOGINNAME").val(sessionStorage.getItem('V_LOGINNAME'));
+    $("#V_PASSWORD").val(sessionStorage.getItem('V_PASSWORD'));
+    V_LOGINNAME = $("#V_LOGINNAME").val();
+    V_PASSWORD = $("#V_PASSWORD").val();
+    company_code = $("#company_code").val();
+    theme = $("#theme").val();
+    parent.window.keep_menu();
+    myMask = new Ext.LoadMask(Ext.getBody(), {
+        msg: '查询中,请稍后!',
+        cls: 'toplevel',
+        removeMask: true //完成后移除
+    });
+    Ext.define('CompanyComboStore1', {
+        extend: 'Ext.data.Model',
+        fields: [
+            {name: 'owner_name', type: 'string'},
+            {name: 'owner_id', type: 'string'}
+        ]
+    });
+    var qobj = new Object();
+    qobj.V_LOGINNAME = $("#V_LOGINNAME").val();
+    qobj.V_PASSWORD = $("#V_PASSWORD").val();
+
+    var CompanyStory = Ext.create('Ext.data.Store', {
+        model: 'CompanyComboStore1',
+        proxy: {
+            type: 'ajax',
+            actionMethods: {
+                create: 'POST',
+                read: 'POST', // by default GET
+                update: 'POST',
+                destroy: 'POST'
+            },
+            url: basePath + 'iot/company/view/getNameList',
+            reader: {
+                type: 'json',
+                root: 'RESULT',
+                totalProperty: 'totalCount'
+            },
+            extraParams: {
+                queryJson: Ext.JSON.encode(qobj)
+            }
+        }
+    });
+
+    var ModifyForm = Ext.create('Ext.form.Panel', {
+        id: 'CompanyFactoryUpdateForm',
+        labelWidth: 55,
+        //		url: basePath+'devicemodel/updateDeviceModel',
+        defaultType: 'textfield',
+        bodyPadding: 15,
+        items: [{
+            xtype: 'combo',
+            fieldLabel: '单位',
+            id: 'fa_company_code',
+            name: 'company_code',
+            displayField: 'owner_name',
+            valueField: 'owner_id',
+            editable: false,
+            anchor: '85%',
+            store: CompanyStory
+        }, {
+            xtype: 'textfield',
+            fieldLabel: '文件上传',
+            name: 'file',
+            id: 'fa_userfile',
+            inputType: 'file',
+            blankText: 'File can\'t not empty.',
+            anchor: '100%' // anchor width by percentage
+        }, {
+            xtype: 'textfield',
+            id: 'fa_factory_queryJson',
+            name: 'queryJson',
+            hidden: true
+        }],
+        buttons: [{
+            text: '保存',
+            iconCls: 'ok_btn',
+            handler: function () {
+                var form = this.up('form').getForm();
+                if (form.isValid()) {
+                    var query = new Object();
+                    query.company_code = Ext.getCmp('fa_company_code').getValue();
+                    var jsonstr = Ext.JSON.encode(query);
+                    Ext.getCmp('fa_factory_queryJson').setValue(jsonstr);
+                    Ext.Msg.alert('操作成功', '已保存', function (btn, txt) {
+                        //					clear_modify_form();
+                    });
+                    //					form.submit({
+                    //						method:'post',
+                    //						success: function(form, action) {
+                    //							Ext.Msg.alert('操作成功', '已保存', function(btn,txt){
+                    ////								clear_modify_form();
+                    //							});
+                    //						},
+                    //						failure: function(form, action) {
+                    //							Ext.Msg.alert('操作成功', '已保存', function(btn,txt){
+                    ////								clear_modify_form();
+                    //							});
+                    //
+                    ////							Ext.Msg.alert('操作失败', action.Msg , function(btn,txt){
+                    ////								clear_modify_form();
+                    ////							});
+                    //						}
+                    //					});
+                    this.up('window').hide();
+                }
+            }
+        }, {
+            text: '关闭',
+            iconCls: 'cancel_btn',
+            handler: function () {
+                this.up('window').hide();
+            }
+        }]
+    });
+
+    modifywin = function () {
+        Ext.create('Ext.window.Window', {
+            title: '楼层平面图上传',
+            height: 250,
+            width: 400,
+            modal: true,
+            layout: 'fit',
+            items: ModifyForm,
+            closeAction: 'hide'
+        }).show();
+    }
+    var radiogroup = new Ext.create('Ext.form.RadioGroup', {
+        fieldLabel: '误报',
+        id: 'uf_r_clwb',
+        width: 300,
+        items: [{
+            name: 'uf_r_clwb',
+            inputValue: '1',
+            boxLabel: '是'
+        }, {
+            name: 'uf_r_clwb',
+            inputValue: '0',
+            boxLabel: '否',
+            checked: true
+        }]
+    });
+    var radiogroup2 = new Ext.create('Ext.form.RadioGroup', {
+        fieldLabel: '处理范围',
+        id: 'uf_r_clfw',
+        width: 300,
+        items: [{
+            name: 'uf_r_clfw',
+            inputValue: '1',
+            boxLabel: '批量'
+        }, {
+            name: 'uf_r_clfw',
+            inputValue: '0',
+            boxLabel: '单一',
+            checked: true
+        }]
+    });
+    var clear_modify_form = function () {
+        Ext.getCmp('uf_company_name').setValue('');
+        Ext.getCmp('uf_name').setValue('');
+        Ext.getCmp('uf_device_code').setValue('');
+        Ext.getCmp('uf_id').setValue('');
+        Ext.getCmp('uf_status').setValue('');
+        Ext.getCmp('uf_dwtype').setValue('');
+        Ext.getCmp('uf_fullname').setValue('');
+        Ext.getCmp('uf_clwb').setValue('');
+        Ext.getCmp('uf_clr').setValue('');
+        Ext.getCmp('uf_clsj').setValue('');
+        Ext.getCmp('uf_clnr').setValue('');
+    }
+    //	var picPanel = Ext.create('Ext.panel.Panel',{
+    //		id:'picPanel',
+    //		region:'left',
+    //		width:300,
+    //		html:'<div id="alarm_pic"></div>'
+    //	});
+    var alarmInfoForm = Ext.create('Ext.form.Panel', {
+        id: 'alarmInfoForm',
+        //		width:400,
+        labelWidth: 55,
+        url: basePath + 'iot/frontpage/updateAlarm',
+        region: 'center',
+        defaultType: 'textfield',
+        bodyPadding: 15,
+        items: [{
+            fieldLabel: '单位名称',
+            id: 'uf_company_name',
+            name: 'uf_company_name',
+            anchor: '90%'
+        }, {
+            fieldLabel: '监控设备',
+            id: 'uf_name',
+            name: 'uf_name',
+            anchor: '100%'
+        }, {
+            fieldLabel: '设备编号',
+            id: 'uf_device_code',
+            name: 'uf_device_code',
+            hidden: true
+        }, {
+            fieldLabel: '记录编号',
+            id: 'uf_id',
+            name: 'uf_id',
+            hidden: true
+        }, {
+            fieldLabel: '设备编号',
+            id: 'uf_status',
+            name: 'uf_status',
+            hidden: true
+        }, {
+            fieldLabel: '设备类型',
+            id: 'uf_dwtype',
+            name: 'uf_dwtype',
+            hidden: true
+        }, {
+            fieldLabel: '报告信息',
+            id: 'uf_fullname',
+            name: 'uf_fullname',
+            xtype: 'textareafield',
+            maxLength: 250,
+            cols: 4,
+            anchor: '100%'
+        }, {
+            fieldLabel: '误报',
+            id: 'uf_clwb',
+            name: 'uf_clwb',
+            maxLength: 200,
+            anchor: '65%'
+        }, radiogroup, radiogroup2, {
+            fieldLabel: '处理人',
+            id: 'uf_clr',
+            name: 'uf_clr',
+            maxLength: 120,
+            anchor: '65%'
+        }, {
+            fieldLabel: '处理时间',
+            id: 'uf_clsj',
+            name: 'uf_clsj',
+            maxLength: 200,
+            anchor: '80%'
+        }, {
+            fieldLabel: '处理内容',
+            id: 'uf_clnr',
+            name: 'uf_clnr',
+            xtype: 'textareafield',
+            maxLength: 250,
+            cols: 4,
+            anchor: '100%'
+        }, {
+            id: 'fm_queryJson',
+            name: 'queryJson',
+            hidden: true
+        }],
+        buttons: [{
+            text: '处理',
+            id: 'confirmBtn',
+            disabled: (V_LOGINNAME == 'guest' ? true : false),
+            iconCls: 'ok_btn',
+            handler: function () {
+                var form = this.up('form').getForm();
+                if (form.isValid()) {
+                    var queryJson = new Object();
+                    queryJson.V_LOGINNAME = V_LOGINNAME;
+                    queryJson.V_PASSWORD = V_PASSWORD;
+                    queryJson.dwtype = Ext.getCmp('uf_dwtype').getValue();
+                    ;
+                    queryJson.id = Ext.getCmp('uf_id').getValue();
+                    queryJson.status = Ext.getCmp('uf_status').getValue();
+                    queryJson.name = Ext.getCmp('uf_name').getValue();
+                    queryJson.device_code = Ext.getCmp('uf_device_code').getValue();
+                    queryJson.confirmAll = Ext.getCmp('uf_r_clfw').getChecked()[0].boxLabel == '单一' ? '0' : '1';
+                    queryJson.clwb = Ext.getCmp('uf_r_clwb').getChecked()[0].boxLabel == '否' ? '0' : '1';
+                    queryJson.clnr = Ext.getCmp('uf_clnr').getValue();
+                    var jsonstr = Ext.JSON.encode(queryJson);
+                    Ext.getCmp('fm_queryJson').setValue(jsonstr);
+                    form.submit({
+                        method: 'post',
+                        success: function (form, action) {
+                            Ext.Msg.alert('操作成功', '已确认' + action.result.activerow + '条记录', function (btn, txt) {
+                                clear_modify_form();
+                                var div = window.top.$("#history_alarm_list").content;
+                                div.storeReload2();
+                            });
+                        },
+                        failure: function (form, action) {
+                            Ext.Msg.alert('操作失败', action.Msg, function (btn, txt) {
+                                clear_modify_form();
+                            });
+                        }
+                    });
+                    this.up('window').close();
+                }
+            }
+        }, {
+            text: '关闭',
+            iconCls: 'cancel_btn',
+            handler: function () {
+                this.up('window').close();
+            }
+        }]
+    });
+    vAlarmInfoWin = Ext.create('Ext.window.Window', {
+        id: 'VAlarmInfoWin',
+        title: '详细信息: <span id="VInfoWin_Title"></span>',
+        height: 400,
+        width: 400,
+        layout: 'border',
+        closable: false,
+        modal: true,
+        closeAction: 'hide',
+        items: [{
+            id: 'picPanel',
+            region: 'west',
+            width: 300,
+            html: '<div id="alarm_pic"></div>'
+        }, alarmInfoForm]
+    }).hide();
+    getCompanyInfo();
+    $(window).resize(function () {
+        body_resize();
+    });
+    body_resize();
+});

+ 2 - 1
WebRoot/view/frontpage/scripts/map.js

@@ -1145,7 +1145,8 @@ var showInfo = function(e) {
             qobj.V_COMPANYID = company_code;
             qobj.I_COMMAND = 4;
             var qdata = "queryJson=" + JSON.stringify(qobj);
-            var qurl = 'https://aiot.usky.cn:8443/YtIoT/cgi-bin/WebAction2.cgi';
+        //    var qurl = 'https://aiot.usky.cn:8443/YtIoT/cgi-bin/WebAction2.cgi';
+            var qurl = 'http://47.103.74.123:8080/YtIoT/cgi-bin/WebAction.cgi';
             $.ajax({
                 type: 'POST',
                 url: qurl,

+ 20 - 0
src/cn/com/usky/filter/XssFilter.java

@@ -1,5 +1,8 @@
 package cn.com.usky.filter;
 
+import cn.com.usky.iot.auth.TokenAuthBO;
+import cn.com.usky.iot.controller.login.Constants;
+
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
@@ -9,6 +12,7 @@ import javax.servlet.FilterConfig;
 import javax.servlet.ServletException;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
+import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
@@ -46,6 +50,22 @@ public class XssFilter implements Filter
     {
         HttpServletRequest req = (HttpServletRequest) request;
         HttpServletResponse resp = (HttpServletResponse) response;
+
+
+        StringBuilder token = new StringBuilder(256);
+        Cookie[] cookies = req.getCookies();
+        for (Cookie c : cookies) {
+            if (Constants.RESPONSE_TOKEN.equals(c.getName())) {
+                token.append(c.getValue());
+                break;
+            }
+        }
+
+
+
+
+
+
         if (handleExcludeURL(req, resp))
         {
             chain.doFilter(request, response);

+ 38 - 0
src/cn/com/usky/iot/annotion/AutoLog.java

@@ -0,0 +1,38 @@
+package cn.com.usky.iot.annotion;
+
+import cn.com.usky.iot.controller.login.CommonConstant;
+import cn.com.usky.iot.controller.login.Constants;
+
+import java.lang.annotation.*;
+
+/**
+ * 系统日志注解
+ *
+ * @author laowo
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface AutoLog {
+
+    /**
+     * 日志内容
+     *
+     * @return
+     */
+    String value() default "";
+
+    /**
+     * 日志类型
+     *
+     * @return 0:操作日志;1:登录日志;2:定时任务;
+     */
+    int logType() default CommonConstant.LOG_TYPE_2;
+
+    /**
+     * 操作日志类型
+     *
+     * @return (1查询,2添加,3修改,4删除)
+     */
+    int operateType() default 0;
+}

+ 193 - 0
src/cn/com/usky/iot/aspect/AutoLogAspect.java

@@ -0,0 +1,193 @@
+package cn.com.usky.iot.aspect;
+
+import cn.com.usky.iot.annotion.AutoLog;
+import cn.com.usky.iot.auth.TokenAuthBO;
+import cn.com.usky.iot.auth.TokenAuthService;
+import cn.com.usky.iot.controller.login.CommonConstant;
+import cn.com.usky.iot.controller.login.Constants;
+import cn.com.usky.iot.entity.YtiotTAdmin;
+import cn.com.usky.iot.entity.sys.SysLogDTO;
+import cn.com.usky.log.LogServiceImpl;
+import cn.com.usky.utils.HttpServletRequestUtils;
+import cn.com.usky.utils.IPUtils;
+import cn.com.usky.utils.SpringContextUtils;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.PropertyFilter;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import java.lang.reflect.Method;
+import java.sql.Timestamp;
+
+
+/**
+ * @author laowo
+ * @version v1.0
+ * @date 2020/11/10 14:41
+ * @description 系统日志切面类
+ **/
+//@Aspect
+//@Component
+public class AutoLogAspect {
+    public TokenAuthService getTokenAuthService() {
+        return tokenAuthService;
+    }
+
+    public void setTokenAuthService(TokenAuthService tokenAuthService) {
+        this.tokenAuthService = tokenAuthService;
+    }
+
+    private TokenAuthService tokenAuthService;
+
+    private LogServiceImpl logService;
+    public LogServiceImpl getLogService() {
+        return logService;
+    }
+    public void setLogServiceImpl(LogServiceImpl logService) {
+        this.logService = logService;
+    }
+  //  @Pointcut("@annotation(cn.com.usky.iot.annotion.AutoLog)")
+    public void logPointCut() {
+    }
+  //  @Around("logPointCut()")
+    public Object around(ProceedingJoinPoint point) throws Throwable {
+        long beginTime = System.currentTimeMillis();
+        //执行方法
+        Object result = point.proceed();
+        //执行时长(毫秒)
+        long time = System.currentTimeMillis() - beginTime;
+        //保存日志
+        saveSysLog(point, time, result);
+        return result;
+    }
+
+    private void saveSysLog(ProceedingJoinPoint joinPoint, long time, Object obj) {
+        MethodSignature signature = (MethodSignature) joinPoint.getSignature();
+        Method method = signature.getMethod();
+        SysLogDTO dto = new SysLogDTO();
+        AutoLog syslog = method.getAnnotation(AutoLog.class);
+        if (syslog != null) {
+            //update-begin-author:taoyan date:
+            String content = syslog.value();
+            //注解上的描述,操作日志内容
+            dto.setLogType(syslog.logType());
+            dto.setLogContent(content);
+        }
+        //请求的方法名
+        String className = joinPoint.getTarget().getClass().getName();
+        String methodName = signature.getName();
+        dto.setMethod(className + "." + methodName + "()");
+        //设置操作类型
+        if (dto.getLogType() == CommonConstant.LOG_TYPE_2) {
+            dto.setOperateType(getOperateType(methodName, syslog.operateType()));
+        }
+        //获取request
+        HttpServletRequest request = SpringContextUtils.getHttpServletRequest();
+        TokenAuthBO tokenAuthBO = HttpServletRequestUtils.tokenAuthForYT(request, tokenAuthService);
+        boolean isAuth = tokenAuthBO.isAuthState();
+        //请求的参数
+        dto.setRequestType(request.getMethod());
+        dto.setRequestParam(getReqestParams(request, joinPoint));
+        //设置IP地址
+        dto.setIp(IPUtils.getIpAddr(request));
+        if (!isAuth) {
+            return;
+        }
+        YtiotTAdmin o = (YtiotTAdmin) tokenAuthBO.getData().get(Constants.USER_INFO);
+        dto.setUserid(o.getVLoginname());
+        dto.setUsername(o.getUqAdminId());
+        //耗时
+        dto.setCostTime(time);
+        dto.setCreateTime(new Timestamp(System.currentTimeMillis()));
+        //保存系统日志
+        logService.addLog(dto);
+    }
+
+
+    /**
+     * 获取操作类型
+     */
+    private int getOperateType(String methodName, int operateType) {
+        if (operateType > 0) {
+            return operateType;
+        }
+        if (methodName.startsWith("list")) {
+            return CommonConstant.OPERATE_TYPE_1;
+        }
+        if (methodName.startsWith("add")) {
+            return CommonConstant.OPERATE_TYPE_2;
+        }
+        if (methodName.startsWith("edit")) {
+            return CommonConstant.OPERATE_TYPE_3;
+        }
+        if (methodName.startsWith("delete")) {
+            return CommonConstant.OPERATE_TYPE_4;
+        }
+        if (methodName.startsWith("import")) {
+            return CommonConstant.OPERATE_TYPE_5;
+        }
+        if (methodName.startsWith("export")) {
+            return CommonConstant.OPERATE_TYPE_6;
+        }
+        return CommonConstant.OPERATE_TYPE_1;
+    }
+
+    /**
+     * 请求参数获取
+     *
+     * @param request
+     * @param joinPoint
+     * @return
+     */
+    private String getReqestParams(HttpServletRequest request, JoinPoint joinPoint) {
+        String httpMethod = request.getMethod();
+        String params = "";
+        if ("POST".equals(httpMethod) || "PUT".equals(httpMethod) || "PATCH".equals(httpMethod)) {
+            Object[] paramsArray = joinPoint.getArgs();
+            // java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncStarted() returns false)
+            //  https://my.oschina.net/mengzhang6/blog/2395893
+            Object[] arguments = new Object[paramsArray.length];
+            for (int i = 0; i < paramsArray.length; i++) {
+                if (paramsArray[i] instanceof BindingResult || paramsArray[i] instanceof ServletRequest || paramsArray[i] instanceof ServletResponse || paramsArray[i] instanceof MultipartFile) {
+                    //ServletRequest不能序列化,从入参里排除,否则报异常:java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncStarted() returns false)
+                    //ServletResponse不能序列化 从入参里排除,否则报异常:java.lang.IllegalStateException: getOutputStream() has already been called for this response
+                    continue;
+                }
+                arguments[i] = paramsArray[i];
+            }
+            //update-begin-author:taoyan date:20200724 for:日志数据太长的直接过滤掉
+            PropertyFilter profilter = new PropertyFilter() {
+                @Override
+                public boolean apply(Object o, String name, Object value) {
+                    if (value != null && value.toString().length() > 500) {
+                        return false;
+                    }
+                    return true;
+                }
+            };
+            params = JSONObject.toJSONString(arguments, profilter);
+            //update-end-author:taoyan date:20200724 for:日志数据太长的直接过滤掉
+        } else {
+            MethodSignature signature = (MethodSignature) joinPoint.getSignature();
+            Method method = signature.getMethod();
+            // 请求的方法参数值
+            Object[] args = joinPoint.getArgs();
+            // 请求的方法参数名称
+            LocalVariableTableParameterNameDiscoverer u = new LocalVariableTableParameterNameDiscoverer();
+            String[] paramNames = u.getParameterNames(method);
+            if (args != null && paramNames != null) {
+                for (int i = 0; i < args.length; i++) {
+                    params += "  " + paramNames[i] + ": " + args[i];
+                }
+            }
+        }
+        return params;
+    }
+}

+ 2 - 0
src/cn/com/usky/iot/controller/FrontpageController.java

@@ -5,6 +5,7 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import cn.com.usky.iot.annotion.AutoLog;
 import cn.com.usky.iot.auth.TokenAuthBO;
 import cn.com.usky.iot.auth.TokenAuthService;
 import cn.com.usky.iot.controller.login.Constants;
@@ -51,6 +52,7 @@ public class FrontpageController {
         return mav;
     }
 
+    @AutoLog("单位详情页数据获取")
     @RequestMapping(value = "/getCurrentObjectListByCompanyId", method = {RequestMethod.GET, RequestMethod.POST})
     public ModelAndView getCurrentObjectListByCompanyId(
             @RequestParam(value = "queryJson", required = false) String queryJson,

+ 81 - 0
src/cn/com/usky/iot/controller/login/CommonConstant.java

@@ -0,0 +1,81 @@
+package cn.com.usky.iot.controller.login;
+
+public interface CommonConstant {
+
+	/**
+	 * 正常状态
+	 */
+	public static final Integer STATUS_NORMAL = 0;
+
+	/**
+	 * 禁用状态
+	 */
+	public static final Integer STATUS_DISABLE = -1;
+
+	/**
+	 * 删除标志
+	 */
+	public static final Integer DEL_FLAG_1 = 1;
+
+	/**
+	 * 未删除
+	 */
+	public static final Integer DEL_FLAG_0 = 0;
+
+	/**
+	 * 系统日志类型: 登录
+	 */
+	public static final int LOG_TYPE_1 = 1;
+	
+	/**
+	 * 系统日志类型: 操作
+	 */
+	public static final int LOG_TYPE_2 = 2;
+
+	/**
+	 * 操作日志类型: 查询
+	 */
+	public static final int OPERATE_TYPE_1 = 1;
+	
+	/**
+	 * 操作日志类型: 添加
+	 */
+	public static final int OPERATE_TYPE_2 = 2;
+	
+	/**
+	 * 操作日志类型: 更新
+	 */
+	public static final int OPERATE_TYPE_3 = 3;
+	
+	/**
+	 * 操作日志类型: 删除
+	 */
+	public static final int OPERATE_TYPE_4 = 4;
+	
+	/**
+	 * 操作日志类型: 导入
+	 */
+	public static final int OPERATE_TYPE_5 = 5;
+	
+	/**
+	 * 操作日志类型: 导出
+	 */
+	public static final int OPERATE_TYPE_6 = 6;
+	
+	
+	/** {@code 500 Server Error} (HTTP/1.0 - RFC 1945) */
+    public static final Integer SC_INTERNAL_SERVER_ERROR_500 = 500;
+    /** {@code 200 OK} (HTTP/1.0 - RFC 1945) */
+    public static final Integer SC_OK_200 = 200;
+
+	/**
+	 * 首页天气地址
+	 */
+
+	public static final String TOP_WEATHER_HOST  = "https://weather01.market.alicloudapi.com";
+	public static final String TOP_WEATHER_PATH  = "/area-to-weather";
+	public static final String TOP_WEATHER_METHOD  = "GET";
+	public static final String TOP_WEATHER_APPCODE  = "0f2b7fce6e104ba8835358b7b59b4fb6";
+
+
+}

+ 2 - 27
src/cn/com/usky/iot/controller/login/LoginController.java

@@ -1,5 +1,6 @@
 package cn.com.usky.iot.controller.login;
 
+import cn.com.usky.iot.annotion.AutoLog;
 import cn.com.usky.iot.auth.TokenAuthBO;
 import cn.com.usky.iot.auth.TokenAuthService;
 import cn.com.usky.utils.CheckNumber;
@@ -38,6 +39,7 @@ public class LoginController extends BaseReController {
 
     @RequestMapping("tolgin")
     @ResponseBody
+    @AutoLog("用户登录")
     public String login(@RequestParam("queryJson") String queryJson) {
         String sessionCheckNumber = (String) session.getAttribute("checkNumber");
         JSONObject jsonObject = JSONObject.fromObject(queryJson);
@@ -62,7 +64,6 @@ public class LoginController extends BaseReController {
         String V_PASSWORD = jsonObject.has("V_PASSWORD") ? jsonObject.getString("V_PASSWORD") : null;
         return loginService.tologin(V_LOGINNAME, V_PASSWORD, response, request);
     }
-
     @RequestMapping(value = "getCheckNumber")
     public void getCheckNumber(HttpServletResponse response, HttpServletRequest request) throws IOException {
         //创建对象
@@ -78,30 +79,4 @@ public class LoginController extends BaseReController {
         ImageIO.write(image, "JPEG", response.getOutputStream());
     }
 
-
-    //    @RequestMapping("/checkNumber/{userCaptcha}")
-//    @ResponseBody
-//    public Map checkNumber(@PathVariable("userCaptcha") String userCaptcha, HttpServletRequest request) throws IOException{
-//        //获取用户输入的校验码并进行比较
-//        System.out.println("开始校验contl");
-//        Map<String, String> map = new HashMap<>();
-//        HttpSession session = request.getSession();
-//        String sessionCheckNumber = (String) this.session.getAttribute("checkNumber");
-//        System.out.println(userCaptcha +":"+ sessionCheckNumber);
-//        if (sessionCheckNumber.equalsIgnoreCase(userCaptcha)) {
-//            msg.setCode(ResponseMessage.SUCCESS_CODE);
-//            return msg;
-//        }
-//        msg.setCode(ResponseMessage.ERROR_CODE);
-//        msg.setMessage("验证码输入有误!请重新输入!");
-//        return msg;
-//    }
-    @RequestMapping("test")
-    @ResponseBody
-    public void tett() {
-        TokenAuthBO tokenAuthBO = HttpServletRequestUtils.tokenAuthForPC(request, tokenAuthService);
-        boolean isAuth = tokenAuthBO.isAuthState();
-        System.out.println("isAuth = " + isAuth);
-    }
-
 }

+ 23 - 0
src/cn/com/usky/iot/entity/sys/SysLogDTO.hbm.xml

@@ -0,0 +1,23 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+    <class name="cn.com.usky.iot.entity.sys.SysLogDTO" table="sys_log" schema="ytIoT">
+        <id name="id" column="id"/>
+        <property name="logType" column="log_type"/>
+        <property name="logContent" column="log_content"/>
+        <property name="operateType" column="operate_type"/>
+        <property name="userid" column="userid"/>
+        <property name="username" column="username"/>
+        <property name="ip" column="ip"/>
+        <property name="method" column="method"/>
+        <property name="requestUrl" column="request_url"/>
+        <property name="requestParam" column="request_param"/>
+        <property name="requestType" column="request_type"/>
+        <property name="costTime" column="cost_time"/>
+        <property name="createBy" column="create_by"/>
+        <property name="createTime" column="create_time"/>
+        <property name="updateBy" column="update_by"/>
+        <property name="updateTime" column="update_time"/>
+    </class>
+</hibernate-mapping>

+ 205 - 0
src/cn/com/usky/iot/entity/sys/SysLogDTO.java

@@ -0,0 +1,205 @@
+package cn.com.usky.iot.entity.sys;
+
+import javax.persistence.*;
+import java.sql.Timestamp;
+import java.util.Objects;
+
+/**
+ * @author laowo
+ * @version v1.0
+ * @date 2021/8/5 16:21
+ * @description TODO
+ **/
+@Entity
+@Table(name = "sys_log", schema = "ytIoT", catalog = "")
+public class SysLogDTO {
+    private int id;
+    private Integer logType;
+    private String logContent;
+    private Integer operateType;
+    private String userid;
+    private String username;
+    private String ip;
+    private String method;
+    private String requestUrl;
+    private String requestParam;
+    private String requestType;
+    private Long costTime;
+    private String createBy;
+    private Timestamp createTime;
+    private String updateBy;
+    private Timestamp updateTime;
+
+    @Id
+    @Column(name = "id")
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    @Basic
+    @Column(name = "log_type")
+    public Integer getLogType() {
+        return logType;
+    }
+
+    public void setLogType(Integer logType) {
+        this.logType = logType;
+    }
+
+    @Basic
+    @Column(name = "log_content")
+    public String getLogContent() {
+        return logContent;
+    }
+
+    public void setLogContent(String logContent) {
+        this.logContent = logContent;
+    }
+
+    @Basic
+    @Column(name = "operate_type")
+    public Integer getOperateType() {
+        return operateType;
+    }
+
+    public void setOperateType(Integer operateType) {
+        this.operateType = operateType;
+    }
+
+    @Basic
+    @Column(name = "userid")
+    public String getUserid() {
+        return userid;
+    }
+
+    public void setUserid(String userid) {
+        this.userid = userid;
+    }
+
+    @Basic
+    @Column(name = "username")
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    @Basic
+    @Column(name = "ip")
+    public String getIp() {
+        return ip;
+    }
+
+    public void setIp(String ip) {
+        this.ip = ip;
+    }
+
+    @Basic
+    @Column(name = "method")
+    public String getMethod() {
+        return method;
+    }
+
+    public void setMethod(String method) {
+        this.method = method;
+    }
+
+    @Basic
+    @Column(name = "request_url")
+    public String getRequestUrl() {
+        return requestUrl;
+    }
+
+    public void setRequestUrl(String requestUrl) {
+        this.requestUrl = requestUrl;
+    }
+
+    @Basic
+    @Column(name = "request_param")
+    public String getRequestParam() {
+        return requestParam;
+    }
+
+    public void setRequestParam(String requestParam) {
+        this.requestParam = requestParam;
+    }
+
+    @Basic
+    @Column(name = "request_type")
+    public String getRequestType() {
+        return requestType;
+    }
+
+    public void setRequestType(String requestType) {
+        this.requestType = requestType;
+    }
+
+    @Basic
+    @Column(name = "cost_time")
+    public Long getCostTime() {
+        return costTime;
+    }
+
+    public void setCostTime(Long costTime) {
+        this.costTime = costTime;
+    }
+
+    @Basic
+    @Column(name = "create_by")
+    public String getCreateBy() {
+        return createBy;
+    }
+
+    public void setCreateBy(String createBy) {
+        this.createBy = createBy;
+    }
+
+    @Basic
+    @Column(name = "create_time")
+    public Timestamp getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Timestamp createTime) {
+        this.createTime = createTime;
+    }
+
+    @Basic
+    @Column(name = "update_by")
+    public String getUpdateBy() {
+        return updateBy;
+    }
+
+    public void setUpdateBy(String updateBy) {
+        this.updateBy = updateBy;
+    }
+
+    @Basic
+    @Column(name = "update_time")
+    public Timestamp getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Timestamp updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        SysLogDTO sysLogDTO = (SysLogDTO) o;
+        return id == sysLogDTO.id && Objects.equals(logType, sysLogDTO.logType) && Objects.equals(logContent, sysLogDTO.logContent) && Objects.equals(operateType, sysLogDTO.operateType) && Objects.equals(userid, sysLogDTO.userid) && Objects.equals(username, sysLogDTO.username) && Objects.equals(ip, sysLogDTO.ip) && Objects.equals(method, sysLogDTO.method) && Objects.equals(requestUrl, sysLogDTO.requestUrl) && Objects.equals(requestParam, sysLogDTO.requestParam) && Objects.equals(requestType, sysLogDTO.requestType) && Objects.equals(costTime, sysLogDTO.costTime) && Objects.equals(createBy, sysLogDTO.createBy) && Objects.equals(createTime, sysLogDTO.createTime) && Objects.equals(updateBy, sysLogDTO.updateBy) && Objects.equals(updateTime, sysLogDTO.updateTime);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, logType, logContent, operateType, userid, username, ip, method, requestUrl, requestParam, requestType, costTime, createBy, createTime, updateBy, updateTime);
+    }
+}

+ 7 - 0
src/cn/com/usky/log/LogService.java

@@ -0,0 +1,7 @@
+package cn.com.usky.log;
+
+import cn.com.usky.iot.entity.sys.SysLogDTO;
+
+public interface LogService {
+    void addLog(SysLogDTO dto);
+}

+ 30 - 0
src/cn/com/usky/log/LogServiceImpl.java

@@ -0,0 +1,30 @@
+package cn.com.usky.log;
+
+
+import cn.com.usky.iot.entity.sys.SysLogDTO;
+import org.springframework.orm.hibernate3.HibernateTemplate;
+
+/**
+ * @author laowo
+ * @version v1.0
+ * @date 2021/7/14 14:10
+ * @description TODO
+ **/
+
+public class LogServiceImpl implements LogService {
+    private HibernateTemplate hibernateTemplate;
+
+    public HibernateTemplate getHibernateTemplate() {
+        return hibernateTemplate;
+    }
+
+    public void setHibernateTemplate(HibernateTemplate hibernateTemplate) {
+        this.hibernateTemplate = hibernateTemplate;
+    }
+
+    @Override
+    public void addLog(SysLogDTO dto) {
+        hibernateTemplate.save(dto);
+
+    }
+}

+ 1 - 1
src/cn/com/usky/utils/HttpServletRequestUtils.java

@@ -8,7 +8,7 @@ import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 
 /**
- * @author laowo PC版本token认证辅助类
+ * @author laowo token认证辅助类
  **/
 public final class HttpServletRequestUtils {
 

+ 58 - 0
src/cn/com/usky/utils/IPUtils.java

@@ -0,0 +1,58 @@
+
+package cn.com.usky.utils;
+
+
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * IP地址
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+public class IPUtils {
+    private static Logger logger = LoggerFactory.getLogger(IPUtils.class);
+
+    /**
+     * 获取IP地址
+     * <p>
+     * 使用Nginx等反向代理软件, 则不能通过request.getRemoteAddr()获取IP地址
+     * 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址,X-Forwarded-For中第一个非unknown的有效IP字符串,则为真实IP地址
+     */
+    public static String getIpAddr(HttpServletRequest request) {
+        String ip = null;
+        try {
+            ip = request.getHeader("x-forwarded-for");
+            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("Proxy-Client-IP");
+            }
+            if (StringUtils.isEmpty(ip) || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("WL-Proxy-Client-IP");
+            }
+            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("HTTP_CLIENT_IP");
+            }
+            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("HTTP_X_FORWARDED_FOR");
+            }
+            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getRemoteAddr();
+            }
+        } catch (Exception e) {
+            logger.error("IPUtils ERROR ", e);
+        }
+
+        //使用代理,则获取第一个IP地址
+        if (StringUtils.isEmpty(ip) && ip.length() > 15) {
+            if (ip.indexOf(",") > 0) {
+                ip = ip.substring(0, ip.indexOf(","));
+            }
+        }
+
+        return ip;
+    }
+
+}

+ 79 - 0
src/cn/com/usky/utils/SpringContextUtils.java

@@ -0,0 +1,79 @@
+package cn.com.usky.utils;
+
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+
+@Component
+public class SpringContextUtils implements ApplicationContextAware {
+
+	/**
+	 * 上下文对象实例
+	 */
+	private static ApplicationContext applicationContext;
+
+	@Override
+	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+		SpringContextUtils.applicationContext = applicationContext;
+	}
+
+	/**
+	 * 获取applicationContext
+	 *
+	 * @return
+	 */
+	public static ApplicationContext getApplicationContext() {
+		return applicationContext;
+	}
+
+	/**
+	  * 获取HttpServletRequest
+	 */
+	public static HttpServletRequest getHttpServletRequest() {
+		return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+	}
+
+
+	public static String getOrigin(){
+		HttpServletRequest request = getHttpServletRequest();
+		return request.getHeader("Origin");
+	}
+	
+	/**
+	 * 通过name获取 Bean.
+	 *
+	 * @param name
+	 * @return
+	 */
+	public static Object getBean(String name) {
+		return getApplicationContext().getBean(name);
+	}
+
+	/**
+	 * 通过class获取Bean.
+	 *
+	 * @param clazz
+	 * @param       <T>
+	 * @return
+	 */
+	public static <T> T getBean(Class<T> clazz) {
+		return getApplicationContext().getBean(clazz);
+	}
+
+	/**
+	 * 通过name,以及Clazz返回指定的Bean
+	 *
+	 * @param name
+	 * @param clazz
+	 * @param       <T>
+	 * @return
+	 */
+	public static <T> T getBean(String name, Class<T> clazz) {
+		return getApplicationContext().getBean(name, clazz);
+	}
+}