|
@@ -657,3 +657,161 @@ public class YtiotVCompanyServiceImpl implements YtiotVCompanyService {
|
|
|
long time1 = cal.getTimeInMillis();
|
|
|
cal.setTime(date2);
|
|
|
long time2 = cal.getTimeInMillis();
|
|
|
+ long between_days=(time2-time1)/(1000*3600*24);
|
|
|
+ return Integer.parseInt(String.valueOf(between_days));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String getVProjectNameList(String queryJson) throws Exception {
|
|
|
+ // TODO Auto-generated method stub
|
|
|
+ String V_LOGINNAME = null;
|
|
|
+ String V_PASSWORD = null;
|
|
|
+ String start_data = null;
|
|
|
+ String end_data = null;
|
|
|
+ String company_code = null;
|
|
|
+ String device_type = null;
|
|
|
+ String video_type = null;
|
|
|
+ int E_STATUS=-1;
|
|
|
+ int m=0;
|
|
|
+ int q=0;
|
|
|
+ int x=0;
|
|
|
+ long days2=0;
|
|
|
+ long days5=0;
|
|
|
+ long days8=0;
|
|
|
+ String hqlwhere = null;
|
|
|
+ String hhwhere = null;
|
|
|
+ String hswhere = null;
|
|
|
+ String hrwhere = null;
|
|
|
+ String hewhere = null;
|
|
|
+ String efwhere = null;
|
|
|
+ String efrwhere = null;
|
|
|
+ String videowhere = null;
|
|
|
+ String videorwhere = null;
|
|
|
+ String sjwhere = null;
|
|
|
+ String sjrwhere = null;
|
|
|
+ String rtuwhere = null;
|
|
|
+ String rturwhere = null;
|
|
|
+ String dwwhere = null;
|
|
|
+ String dwsjwhere = null;
|
|
|
+ String dwrtuwhere = null;
|
|
|
+ String dwefwhere = null;
|
|
|
+ String dwvideowhere = null;
|
|
|
+ String hjresult = null;
|
|
|
+ String lxhjresult = null;
|
|
|
+ String sjresult = null;
|
|
|
+ String lxsjresult = null;
|
|
|
+ String rturesult = null;
|
|
|
+ String lxrturesult = null;
|
|
|
+ String efresult = null;
|
|
|
+ String lxefresult = null;
|
|
|
+ String videoresult = null;
|
|
|
+ JSONObject q_json = null;
|
|
|
+ JSONArray Sort = null;
|
|
|
+ JSONArray jSONArray = new JSONArray();
|
|
|
+ JSONArray jSONArray1 = new JSONArray();
|
|
|
+ JSONArray jSONArray2 = new JSONArray();
|
|
|
+ JSONArray jSONArray4 = new JSONArray();
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("action", "getVProjectNameList");
|
|
|
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ if(queryJson!=null) {
|
|
|
+ q_json = JSONObject.fromObject(queryJson);
|
|
|
+// V_LOGINNAME = q_json.has("V_LOGINNAME")?q_json.getString("V_LOGINNAME"):null;
|
|
|
+// V_PASSWORD = q_json.has("V_PASSWORD")?q_json.getString("V_PASSWORD"):null;
|
|
|
+ start_data = q_json.has("start_data")?q_json.getString("start_data"):null;
|
|
|
+ end_data = q_json.has("end_data")?q_json.getString("end_data"):null;
|
|
|
+ company_code = q_json.has("build_code")?q_json.getString("build_code"):null;
|
|
|
+ json.put("query", queryJson);
|
|
|
+ }
|
|
|
+
|
|
|
+ Date startData = null;
|
|
|
+ Date endData = null;
|
|
|
+ startData=df.parse(start_data);
|
|
|
+ endData=df.parse(end_data);
|
|
|
+ int days= getDates(startData,endData)+1;
|
|
|
+ hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("company_code")+" = "+company_code+" ";
|
|
|
+ hhwhere = chkhw(hhwhere)+"u.id."+fieldname("company_code")+" = "+company_code+" ";
|
|
|
+ hswhere = chkhw(hswhere)+"u.id."+fieldname("company_code")+" = "+company_code+" ";
|
|
|
+ hrwhere = chkhw(hrwhere)+"u.id."+fieldname("company_code")+" = "+company_code+" ";
|
|
|
+ hewhere = chkhw(hewhere)+"u.id."+fieldname("company_code")+" = "+company_code+" ";
|
|
|
+ efwhere = chkhw(efwhere)+"u.id."+fieldname("company_code")+" = "+company_code+" ";
|
|
|
+ efrwhere = chkhw(efrwhere)+"u.id."+fieldname("company_code")+" = "+company_code+" ";
|
|
|
+ sjwhere = chkhw(sjwhere)+"u.id."+fieldname("company_code")+" = "+company_code+" ";
|
|
|
+ sjrwhere = chkhw(sjrwhere)+"u.id."+fieldname("company_code")+" = "+company_code+" ";
|
|
|
+ rtuwhere = chkhw(rtuwhere)+"u.id."+fieldname("company_code")+" = "+company_code+" ";
|
|
|
+ rturwhere = chkhw(rturwhere)+"u.id."+fieldname("company_code")+" = "+company_code+" ";
|
|
|
+ dwwhere = chkhw(dwwhere)+"u.id."+fieldname("company_code")+" = "+company_code+" ";
|
|
|
+ dwsjwhere = chkhw(dwsjwhere)+"u.id."+fieldname("company_code")+" = "+company_code+" ";
|
|
|
+ dwrtuwhere = chkhw(dwrtuwhere)+"u.id."+fieldname("company_code")+" = "+company_code+" ";
|
|
|
+ dwefwhere = chkhw(dwefwhere)+"u.id."+fieldname("company_code")+" = "+company_code+" ";
|
|
|
+ dwvideowhere = chkhw(dwvideowhere)+"u.id."+fieldname("company_code")+" = "+company_code+" ";
|
|
|
+ hswhere = chkhw(hswhere)+"u.id."+fieldname("clzt")+" = "+1+" ";
|
|
|
+ hewhere = chkhw(hewhere)+"u.id."+fieldname("clzt")+" = "+1+" ";
|
|
|
+ efwhere = chkhw(efwhere)+"u.id."+fieldname("clzt")+" = "+1+" ";
|
|
|
+ sjwhere = chkhw(sjwhere)+"u.id."+fieldname("clzt")+" = "+1+" ";
|
|
|
+ rtuwhere = chkhw(rtuwhere)+"u.id."+fieldname("clzt")+" = "+1+" ";
|
|
|
+ dwwhere = chkhw(dwwhere)+"u.id."+fieldname("dwtype")+" = "+1+" ";
|
|
|
+ dwsjwhere = chkhw(dwsjwhere)+"( u.id.dwtype = 2 or u.id.dwtype = 5 ) ";
|
|
|
+ dwrtuwhere = chkhw(dwrtuwhere)+"u.id."+fieldname("dwtype")+" = "+6+" ";
|
|
|
+ dwefwhere = chkhw(dwefwhere)+"u.id."+fieldname("dwtype")+" = "+7+" ";
|
|
|
+ dwvideowhere = chkhw(dwvideowhere)+"u.id."+fieldname("dwtype")+" = "+16+" ";
|
|
|
+ hrwhere = chkhw(hrwhere)+" u.id.data1 = 'U44' ";
|
|
|
+ hewhere = chkhw(hewhere)+" u.id.data1 = 'U44' ";
|
|
|
+ efwhere = chkhw(efwhere)+" u.id.data1 = 'EF9' ";
|
|
|
+ efrwhere = chkhw(efrwhere)+" u.id.data1 = 'EF9' ";
|
|
|
+ videorwhere = chkhw(videorwhere)+" u.id.data1 = 'EF9' ";
|
|
|
+ sjwhere = chkhw(sjwhere)+"( u.id.data1 = 'WP4' or u.id.data1 = 'LL4' ) ";
|
|
|
+ sjrwhere = chkhw(sjrwhere)+"( u.id.data1 = 'WP4' or u.id.data1 = 'LL4' ) ";
|
|
|
+ rtuwhere = chkhw(rtuwhere)+" u.id.data1 = '44' ";
|
|
|
+ rturwhere = chkhw(rturwhere)+" u.id.data1 = '44' ";
|
|
|
+ if(start_data!=null)
|
|
|
+ hhwhere = chkhw(hhwhere)+"u.id."+fieldname("time")+" > '"+start_data+"' ";
|
|
|
+ hswhere = chkhw(hswhere)+"u.id."+fieldname("time")+" > '"+start_data+"' ";
|
|
|
+ hrwhere = chkhw(hrwhere)+"u.id."+fieldname("time")+" > '"+start_data+"' ";
|
|
|
+ hewhere = chkhw(hewhere)+"u.id."+fieldname("time")+" > '"+start_data+"' ";
|
|
|
+ efwhere = chkhw(efwhere)+"u.id."+fieldname("time")+" > '"+start_data+"' ";
|
|
|
+ efrwhere = chkhw(efrwhere)+"u.id."+fieldname("time")+" > '"+start_data+"' ";
|
|
|
+ videorwhere = chkhw(videorwhere)+"u.id."+fieldname("time")+" > '"+start_data+"' ";
|
|
|
+ sjwhere = chkhw(sjwhere)+"u.id."+fieldname("time")+" > '"+start_data+"' ";
|
|
|
+ sjrwhere = chkhw(sjrwhere)+"u.id."+fieldname("time")+" > '"+start_data+"' ";
|
|
|
+ rtuwhere = chkhw(rtuwhere)+"u.id."+fieldname("time")+" > '"+start_data+"' ";
|
|
|
+ rturwhere = chkhw(rturwhere)+"u.id."+fieldname("time")+" > '"+start_data+"' ";
|
|
|
+ if(end_data!=null)
|
|
|
+ hhwhere = chkhw(hhwhere)+"u.id."+fieldname("time")+" < '"+end_data+"' ";
|
|
|
+ hswhere = chkhw(hswhere)+"u.id."+fieldname("time")+" < '"+end_data+"' ";
|
|
|
+ hrwhere = chkhw(hrwhere)+"u.id."+fieldname("time")+" < '"+end_data+"' ";
|
|
|
+ hewhere = chkhw(hewhere)+"u.id."+fieldname("time")+" < '"+end_data+"' ";
|
|
|
+ efwhere = chkhw(efwhere)+"u.id."+fieldname("time")+" < '"+end_data+"' ";
|
|
|
+ efrwhere = chkhw(efrwhere)+"u.id."+fieldname("time")+" < '"+end_data+"' ";
|
|
|
+ videorwhere = chkhw(videorwhere)+"u.id."+fieldname("time")+" < '"+end_data+"' ";
|
|
|
+ sjwhere = chkhw(sjwhere)+"u.id."+fieldname("time")+" < '"+end_data+"' ";
|
|
|
+ sjrwhere = chkhw(sjrwhere)+"u.id."+fieldname("time")+" < '"+end_data+"' ";
|
|
|
+ rtuwhere = chkhw(rtuwhere)+"u.id."+fieldname("time")+" < '"+end_data+"' ";
|
|
|
+ rturwhere = chkhw(rturwhere)+"u.id."+fieldname("time")+" < '"+end_data+"' ";
|
|
|
+
|
|
|
+ int hjtotalCount = ytiotVAlarmDao.getHJCount(hhwhere);
|
|
|
+ int clhjtotalCount = ytiotVAlarmDao.getHJCount(hswhere);
|
|
|
+ int lxhjtotalCount = ytiotVAlarmDao.getHJCount(hrwhere);
|
|
|
+ int cllxhjtotalCount = ytiotVAlarmDao.getHJCount(hewhere);
|
|
|
+ int eftotalCount = ytiotVAlarmDao.getEFireCount(hhwhere);
|
|
|
+ int cleftotalCount = ytiotVAlarmDao.getEFireCount(hswhere);
|
|
|
+ int lxeftotalCount = ytiotVAlarmDao.getEFireCount(efrwhere);
|
|
|
+ int cllxeftotalCount = ytiotVAlarmDao.getEFireCount(efwhere);
|
|
|
+ int sjtotalCount = ytiotVAlarmDao.getSJCount(hhwhere);
|
|
|
+ int clsjtotalCount = ytiotVAlarmDao.getSJCount(hswhere);
|
|
|
+ int lxsjtotalCount = ytiotVAlarmDao.getSJCount(sjrwhere);
|
|
|
+ int cllxsjtotalCount = ytiotVAlarmDao.getSJCount(sjwhere);
|
|
|
+ int rtutotalCount = ytiotVAlarmDao.getRTUCount(hhwhere);
|
|
|
+ int clrtutotalCount = ytiotVAlarmDao.getRTUCount(hswhere);
|
|
|
+ int lxrtutotalCount = ytiotVAlarmDao.getRTUCount(rturwhere);
|
|
|
+ int cllxrtutotalCount = ytiotVAlarmDao.getRTUCount(rtuwhere);
|
|
|
+ int dwhjtotalCount = ytiotVDataDao.getSyncStatusCount1(dwwhere);
|
|
|
+ int dwsjtotalCount = ytiotVDataDao.getSyncStatusCount1(dwsjwhere);
|
|
|
+ int dwrtutotalCount = ytiotVDataDao.getSyncStatusCount1(dwrtuwhere);
|
|
|
+ int dweftotalCount = ytiotVDataDao.getSyncStatusCount1(dwefwhere);
|
|
|
+ int dwvideototalCount = ytiotVDataDao.getSyncStatusCount1(dwvideowhere);
|
|
|
+ int videototalCount = ytiotVAlarmDao.getCount("ytiot_v_video2017",hhwhere);
|
|
|
+ int clvideototalCount = ytiotVAlarmDao.getCount("ytiot_v_video2017",hswhere);
|
|
|
+ NumberFormat numberFormat = NumberFormat.getInstance();
|
|
|
+ numberFormat.setMaximumFractionDigits(2);
|
|
|
+ if(hjtotalCount==0) {
|