Sfoglia il codice sorgente

Merge branch 'xcjk' of http://121.42.8.157:13000/software-l/server into xcjk

zhuyf 2 anni fa
parent
commit
c541072a7a
2 ha cambiato i file con 7 aggiunte e 6 eliminazioni
  1. 2 4
      ant.cpp
  2. 5 2
      net-service.cpp

+ 2 - 4
ant.cpp

@@ -988,12 +988,10 @@ void sit_list_v::init_site(const std::string &ids /*= ""*/)
 	  ,x,y, pdoa_offset, pdoa_direction, isSpecial, down_stream_idx \
 	  FROM dat_reader_v, dat_map where \
 	  dat_reader_v.map_id=dat_map.map_id and state=0";*/
-	std::string sql = "SELECT r.reader_id, r_base.reader_type_id, r_base.map_id, r_base.area_id, r_base.device_type_id, r_base.dimension, m.scale, r.need_power_alarm, r.x, r.y, \
-		r.pdoa_offset, r_base.pdoa_direction, r_base.isSpecial, r_base.down_stream_idx, \
+	std::string sql = "SELECT r.reader_id,  r.device_type_id, \
+		r.need_power_alarm, r.x, r.y, r.pdoa_offset, \
 		rc.plus_dist, rc.plus_card_id, rc.plus_occur_time, rc.minus_dist, rc.minus_card_id, rc.minus_occur_time \
 		FROM dat_reader_v AS r \
-		LEFT JOIN dat_reader AS r_base ON r.reader_id = r_base.reader_id \
-		LEFT JOIN dat_map AS m ON r_base.map_id = m.map_id \
 		LEFT JOIN his_reader_coverage AS rc ON r.reader_id = rc.reader_id \
 		WHERE r.state = 0; ";
 

+ 5 - 2
net-service.cpp

@@ -225,8 +225,11 @@ void net_service::on_message(const std::shared_ptr<client> &clt,const char*data,
                     site_ptr->set_algo(LDT_PDOA);
 
 					const auto& site_ptr_v = sit_list_v::instance()->get(static_cast<int32_t>(site_id));
-					site_ptr_v->set_algo(LDT_PDOA);
-
+					if (site_ptr_v)
+					{
+						site_ptr_v->set_algo(LDT_PDOA);
+					}
+					
                     //log_info("[scale_test] %.2f", site_ptr->m_scale);
                     struct timeval tv;
                     gettimeofday(&tv, NULL);