package com.watersystem.monitor;
|
|
import java.util.Date;
|
import java.util.HashMap;
|
import java.util.List;
|
import java.util.Map;
|
|
import com.base.Com;
|
import com.sql.MysqlConnPool;
|
|
public class Watersystem_ServerSocket_Thread implements Runnable{
|
public List<Water_inf> winfs;
|
public MysqlConnPool conn_pool;
|
public Map<Integer, Watersystem_SocketClient_Thread> winfthreads;
|
|
public Watersystem_ServerSocket_Thread(MysqlConnPool conn_pool,List<Water_inf> winfs) {
|
this.winfs = winfs;
|
this.conn_pool = conn_pool;
|
this.winfthreads = new HashMap<Integer,Watersystem_SocketClient_Thread>();
|
}
|
|
@Override
|
public void run() {
|
// TODO Auto-generated method stub
|
System.out.println(" Watersystem_ServerSocket_Thread Start at " +Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms));
|
for(int i = 0;i<winfs.size();i++) {
|
//²åÈë»ò¸üÐÂË®ÀäϵͳʵʱÐÅÏ¢±í
|
Water_Task_SQL.replace_water_rt(conn_pool, new Water_rt(winfs.get(i).getWater_id()));
|
//²åÈë»ò¸üÐÂË®Àäϵͳ·Ö֧ʵʱÐÅÏ¢±í
|
Water_Task_SQL.replace_water_brach(conn_pool, new Water_brach(winfs.get(i).getWater_id()));
|
//²åÈë»ò¸üÐÂË®Àäϵͳʵʱ״̬±í
|
Water_Task_SQL.replace_water_state(conn_pool, new Water_state(winfs.get(i).getWater_id()));
|
|
Watersystem_SocketClient_Thread thread = new Watersystem_SocketClient_Thread(winfs.get(i),conn_pool);
|
winfthreads.put(winfs.get(i).water_id, thread);
|
new Thread(thread).start();
|
}
|
}
|
|
}
|