123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982 |
- package cn.com.usky.iot.company.service;
- import java.text.SimpleDateFormat;
- import java.util.ArrayList;
- import java.util.Date;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- import java.util.Calendar;
- import java.text.NumberFormat;
- import cn.com.usky.iot.admin.dao.YtiotTAdminDao;
- import cn.com.usky.iot.admin.dao.YtiotVUserCompanyDao;
- import cn.com.usky.iot.company.dao.YtiotVCompanyDao;
- import cn.com.usky.iot.entity.YtiotTAdmin;
- import cn.com.usky.iot.entity.YtiotTInspectors;
- import cn.com.usky.iot.entity.YtiotVCompany;
- import cn.com.usky.iot.entity.YtiotVCompanyId;
- import cn.com.usky.iot.entity.YtiotVUsercompany;
- import cn.com.usky.iot.entity.YtiotVUsercompanyId;
- import cn.com.usky.iot.entity.YtiotTProjectDetails;
- import cn.com.usky.iot.entity.YtiotTProjectDevice;
- import cn.com.usky.iot.entity.YtiotTProjectMonitor;
- import cn.com.usky.iot.entity.YtiotVEfire;
- import cn.com.usky.iot.entity.YtiotVEfireId;
- import cn.com.usky.iot.entity.YtiotVHj;
- import cn.com.usky.iot.entity.YtiotVHjId;
- import cn.com.usky.iot.entity.YtiotVRtu;
- import cn.com.usky.iot.entity.YtiotVRtuId;
- import cn.com.usky.iot.entity.YtiotVSj;
- import cn.com.usky.iot.entity.YtiotVSjId;
- import cn.com.usky.iot.alarm.dao.YtiotVAlarmDao;
- import cn.com.usky.iot.data.dao.YtiotVDataDao;
- import cn.com.usky.iot.entity.YtiotVEfire;
- import cn.com.usky.iot.entity.YtiotVEfireId;
- import cn.com.usky.iot.entity.YtiotVHj;
- import cn.com.usky.iot.entity.YtiotVHjId;
- import cn.com.usky.iot.entity.YtiotVRtu;
- import cn.com.usky.iot.entity.YtiotVRtuId;
- import cn.com.usky.iot.entity.YtiotVSj;
- import cn.com.usky.iot.entity.YtiotVSjId;
- import cn.com.usky.utils.MD5Util;
- import net.sf.json.JSONArray;
- import net.sf.json.JSONObject;
- import java.math.BigDecimal;
- import java.text.DecimalFormat;
- import java.text.ParseException;
- import java.text.SimpleDateFormat;
- public class YtiotVCompanyServiceImpl implements YtiotVCompanyService {
- private YtiotVCompanyDao ytiotVCompanyDao;
- private YtiotTAdminDao ytiotTAdminDao;
- private YtiotVUserCompanyDao ytiotVUserCompanyDao;
- private YtiotVAlarmDao ytiotVAlarmDao;
- private YtiotVDataDao ytiotVDataDao;
- public YtiotVDataDao getYtiotVDataDao() {
- return ytiotVDataDao;
- }
- public void setYtiotVDataDao(YtiotVDataDao ytiotVDataDao) {
- this.ytiotVDataDao = ytiotVDataDao;
- }
-
- public YtiotVAlarmDao getYtiotVAlarmDao() {
- return ytiotVAlarmDao;
- }
- public void setYtiotVAlarmDao(YtiotVAlarmDao ytiotVAlarmDao) {
- this.ytiotVAlarmDao = ytiotVAlarmDao;
- }
-
- public YtiotVUserCompanyDao getYtiotVUserCompanyDao() {
- return ytiotVUserCompanyDao;
- }
- public void setYtiotVUserCompanyDao(YtiotVUserCompanyDao ytiotVUserCompanyDao) {
- this.ytiotVUserCompanyDao = ytiotVUserCompanyDao;
- }
- public YtiotVCompanyDao getYtiotVCompanyDao() {
- return ytiotVCompanyDao;
- }
- public void setYtiotVCompanyDao(YtiotVCompanyDao ytiotVCompanyDao) {
- this.ytiotVCompanyDao = ytiotVCompanyDao;
- }
- public YtiotTAdminDao getYtiotTAdminDao() {
- return ytiotTAdminDao;
- }
- public void setYtiotTAdminDao(YtiotTAdminDao ytiotTAdminDao) {
- this.ytiotTAdminDao = ytiotTAdminDao;
- }
- public boolean chk_string_param(String param) {
- if(param==null)
- return true;
- if(param.indexOf("=")>=0)
- return false;
- if(param.indexOf("\'")>=0)
- return false;
- if(param.indexOf("\"")>=0)
- return false;
- return true;
- }
-
- public String chkhw(String hqlwhere){
- if(hqlwhere==null)
- return " where ";
- else
- return hqlwhere+" and ";
- }
-
- public String fieldname(String field){
- if(field.equals("building_id"))
- return "buildingId";
- if(field.equals("building_name"))
- return "buildingName";
- if(field.equals("create_man"))
- return "createMan";
- if(field.equals("create_time"))
- return "createTime";
- if(field.equals("owner_address"))
- return "ownerAddress";
- if(field.equals("owner_id"))
- return "ownerId";
- if(field.equals("owner_man"))
- return "ownerMan";
- if(field.equals("owner_name"))
- return "ownerName";
- if(field.equals("owner_office"))
- return "ownerOffice";
- if(field.equals("company_code"))
- return "companyCode";
- return field;
- }
- @Override
- public String getVCompanyList(String queryJson, String page, String start, String limit, String sort)
- throws Exception {
- // TODO Auto-generated method stub
- String addr1=null, addr2=null, addr3=null;
- String addr1list=null, addr2list=null, addr3list=null;
- String address=null, building_id=null, building_name=null, create_man=null;
- String data1=null, data2=null, data3=null, fulladdress=null;
- String h5=null, hls=null, id=null, owner_address=null;
- String owner_id=null, owner_man=null, owner_name=null;
- String owner_id_list=null, building_id_list=null;
- String owner_office=null, rtmp=null, xmlx=null, xmlx_list=null;
- String hqlwhere = null;
- String order = null;
- String dir = null;
- String Start = null;
- String Limit = null;
- String Page = null;
- String order_str = null;
- JSONObject q_json = null;
- JSONArray Sort = null;
- JSONArray jSONArray = new JSONArray();
- JSONObject json = new JSONObject();
- json.put("action", "getVCompanyList");
- if(queryJson!=null) {
- q_json = JSONObject.fromObject(queryJson);
- if(q_json.has("addr1")) {
- if(((JSONObject) q_json.get("addr1")).isArray())
- {
- JSONArray j_tmp = q_json.getJSONArray("addr1");
- for(int i=0;i<j_tmp.size();i++)
- {
- String tmp = j_tmp.getString(i);
- if(i==0)
- addr1list = tmp;
- else
- addr1list += ","+tmp;
- }
- }else
- addr1 = q_json.getString("addr1");
- }
- if(q_json.has("addr2")) {
- if(((JSONObject) q_json.getJSONObject("addr2")).isArray())
- {
- JSONArray j_tmp = q_json.getJSONArray("addr2");
- for(int i=0;i<j_tmp.size();i++)
- {
- String tmp = j_tmp.getString(i);
- if(i==0)
- addr2list = tmp;
- else
- addr2list += ","+tmp;
- }
- }else
- addr2 = q_json.getString("addr2");
- }
- if(q_json.has("addr3")) {
- if(((JSONObject)q_json.getJSONObject("addr3")).isArray())
- {
- JSONArray j_tmp = q_json.getJSONArray("addr3");
- for(int i=0;i<j_tmp.size();i++)
- {
- String tmp = j_tmp.getString(i);
- if(i==0)
- addr3list = tmp;
- else
- addr3list += ","+tmp;
- }
- }else
- addr3 = q_json.getString("addr3");
- }
- address = q_json.has("address")?q_json.getString("address"):null;
- if(q_json.has("building_id")) {
- if(((JSONObject)q_json.getJSONObject("building_id")).isArray())
- {
- JSONArray j_tmp = q_json.getJSONArray("building_id");
- for(int i=0;i<j_tmp.size();i++)
- {
- String tmp = j_tmp.getString(i);
- if(i==0)
- building_id_list = tmp;
- else
- building_id_list += ","+tmp;
- }
- }else
- building_id = q_json.getString("building_id");
- }
- building_name = q_json.has("building_name")?q_json.getString("building_name"):null;
- create_man = q_json.has("create_man")?q_json.getString("create_man"):null;
- data1 = q_json.has("data1")?q_json.getString("data1"):null;
- data2 = q_json.has("data2")?q_json.getString("data2"):null;
- data3 = q_json.has("data3")?q_json.getString("data3"):null;
- fulladdress = q_json.has("fulladdress")?q_json.getString("fulladdress"):null;
- id = q_json.has("id")?q_json.getString("id"):null;
- if(q_json.has("owner_id"))
- {
- if(((JSONObject)q_json.getJSONObject("owner_id")).isArray())
- {
- JSONArray j_tmp = q_json.getJSONArray("owner_id");
- for(int i=0;i<j_tmp.size();i++)
- {
- String tmp = j_tmp.getString(i);
- if(i==0)
- owner_id_list = tmp;
- else
- owner_id_list += ","+tmp;
- }
- }else
- owner_id = q_json.getString("owner_id");
- }
- owner_address = q_json.has("owner_address")?q_json.getString("owner_address"):null;
- owner_office = q_json.has("owner_office")?q_json.getString("owner_office"):null;
- if(q_json.has("xmlx")) {
- if(((JSONObject)q_json.getJSONObject("xmlx")).isArray()) {
- JSONArray j_tmp = q_json.getJSONArray("xmlx");
- for(int i=0;i<j_tmp.size();i++) {
- String tmp = j_tmp.getString(i);
- if(i==0)
- xmlx_list = "'"+tmp+"'";
- else
- xmlx_list += ",'"+tmp+"'";
- }
- }else
- xmlx = q_json.getString("xmlx");
- }
- xmlx = q_json.has("xmlx")?q_json.getString("xmlx"):null;
- order = q_json.has("order")?q_json.getString("order"):null;
- dir = q_json.has("dir")?q_json.getString("dir"):null;
- Start = q_json.has("start")?q_json.getString("start"):(start!=null)?start:"0";
- Limit = q_json.has("limit")?q_json.getString("limit"):(limit!=null)?limit:null;
- Page = q_json.has("page")?q_json.getString("page"):(page!=null)?page:"0";
- json.put("query", queryJson);
- }
- if(sort!=null) {
- Sort = JSONArray.fromObject(sort);
- if((Sort.isArray())&&(Sort.size()>0)) {
- JSONObject s_json = Sort.getJSONObject(0);
- order = s_json.has("property")?s_json.getString("property"):order;
- dir = s_json.has("direction")?s_json.getString("direction"):dir;
- }
- json.put("sort", sort);
- }
- Start = start;
- Limit = limit;
- Page = page;
- if(addr1!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("addr1")+" like '%"+addr1+"%' ";
- if(addr1list!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("addr1")+" in ("+addr1list+") ";
- if(addr2!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("addr2")+" like '%"+addr2+"%' ";
- if(addr2list!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("addr2")+" in ("+addr2list+") ";
- if(addr3!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("addr3")+" like '%"+addr3+"%' ";
- if(addr3list!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("addr3")+" in ("+addr3list+") ";
- if(address!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("address")+" like '%"+address+"%' ";
- if(building_id!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("building_id")+" like '%"+building_id+"%' ";
- if(building_id_list!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("building_id")+" in ("+building_id_list+") ";
- if(building_name!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("building_name")+" like '%"+building_name+"%' ";
- if(create_man!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("create_man")+" like '%"+create_man+"%' ";
- if(data1!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("data1")+" like '%"+data1+"%' ";
- if(data2!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("data2")+" like '%"+data2+"%' ";
- if(data3!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("data3")+" like '%"+data3+"%' ";
- if(fulladdress!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("fulladdress")+" like '%"+fulladdress+"%' ";
- if(id!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("id")+" = '"+id+"' ";
- if(owner_id!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("owner_id")+" = "+owner_id+" ";
- if(owner_id_list!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("owner_id")+" in ("+owner_id_list+") ";
- if(owner_address!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("owner_address")+" like '%"+owner_address+"%' ";
- if(owner_office!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("owner_office")+" like '%"+owner_office+"%' ";
- if(xmlx!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("xmlx")+" like '%"+xmlx+"%' ";
- if(xmlx_list!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("xmlx")+" in ("+xmlx_list+") ";
- if(order!=null)
- order_str = " order by u.id."+fieldname(order);
- else
- order_str = " order by u.id."+fieldname("id");
- int totalCount = ytiotVCompanyDao.getCount(hqlwhere);
- json.put("totalCount", totalCount);
- if(Start!=null){
- if(Integer.parseInt(Start)>totalCount){
- Start = "0";
- Page = "0";
- }
- if(page==null)
- Page="0";
- }else{
- Start = "0";
- Page = "0";
- }
- json.put("page", Page);
- json.put("start", Start);
- json.put("limit", Limit);
- if(totalCount>0) {
- List list = ytiotVCompanyDao.query(hqlwhere, order_str, dir, Start, Limit);
- SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- if(list.size()>0) {
- for(int i=0;i<list.size();i++) {
- YtiotVCompany o = (YtiotVCompany)list.get(i);
- YtiotVCompanyId Id = o.getId();
- Map map = new HashMap();
- map.put("addr1", Id.getAddr1());
- map.put("addr2", Id.getAddr2());
- map.put("addr3", Id.getAddr3());
- map.put("address", Id.getAddress());
- map.put("building_id", Id.getBuildingId());
- map.put("building_name", Id.getBuildingName());
- map.put("create_man", Id.getCreateMan());
- map.put("create_time", df.format(Id.getCreateTime()));
- map.put("data1", Id.getData1());
- map.put("data2", Id.getData2());
- map.put("data3", Id.getData3());
- map.put("fulladdress", Id.getFulladdress());
- map.put("h5", Id.getH5());
- map.put("hls", Id.getHls());
- map.put("id", Id.getId());
- map.put("owner_address", Id.getOwnerAddress());
- map.put("owner_id", Id.getOwnerId());
- map.put("owner_man", Id.getOwnerMan());
- map.put("owner_name", Id.getOwnerName());
- map.put("owner_office", Id.getOwnerOffice());
- map.put("position", Id.getPosition());
- map.put("rtmp", Id.getRtmp());
- map.put("xmlx", Id.getXmlx());
- JSONObject jSONObject = JSONObject.fromObject(map);
- jSONArray.add(jSONObject);
- }
- json.put("RESULT", jSONArray);
- }
- }
- return json.toString();
- }
- @Override
- public String getVCompanyNameList(String queryJson) throws Exception {
- // TODO Auto-generated method stub
- String addr1=null, addr2=null, addr3=null;
- String addr1list=null, addr2list=null, addr3list=null;
- String address=null, building_id=null, building_name=null, create_man=null;
- String data1=null, data2=null, data3=null, fulladdress=null;
- String h5=null, hls=null, id=null, owner_address=null;
- String owner_id=null, owner_man=null, owner_name=null;
- String owner_id_list=null, building_id_list=null;
- String owner_office=null, rtmp=null, xmlx=null, xmlx_list=null;
- String V_LOGINNAME = null;
- String V_PASSWORD = null;
- String owner_id_List = null;
- int E_STATUS=-1;
- String hqlwhere = null;
- JSONObject q_json = null;
- JSONArray Sort = null;
- JSONArray jSONArray = new JSONArray();
- JSONObject json = new JSONObject();
- json.put("action", "getVCompanyNameList");
- if(queryJson!=null) {
- q_json = JSONObject.fromObject(queryJson);
- if(q_json.has("addr1")) {
- if(((JSONObject) q_json.get("addr1")).isArray())
- {
- JSONArray j_tmp = q_json.getJSONArray("addr1");
- for(int i=0;i<j_tmp.size();i++)
- {
- String tmp = j_tmp.getString(i);
- if(i==0)
- addr1list = tmp;
- else
- addr1list += ","+tmp;
- }
- }else
- addr1 = q_json.getString("addr1");
- }
- if(q_json.has("addr2")) {
- if(((JSONObject) q_json.getJSONObject("addr2")).isArray())
- {
- JSONArray j_tmp = q_json.getJSONArray("addr2");
- for(int i=0;i<j_tmp.size();i++)
- {
- String tmp = j_tmp.getString(i);
- if(i==0)
- addr2list = tmp;
- else
- addr2list += ","+tmp;
- }
- }else
- addr2 = q_json.getString("addr2");
- }
- if(q_json.has("addr3")) {
- if(((JSONObject)q_json.getJSONObject("addr3")).isArray())
- {
- JSONArray j_tmp = q_json.getJSONArray("addr3");
- for(int i=0;i<j_tmp.size();i++)
- {
- String tmp = j_tmp.getString(i);
- if(i==0)
- addr3list = tmp;
- else
- addr3list += ","+tmp;
- }
- }else
- addr3 = q_json.getString("addr3");
- }
- address = q_json.has("address")?q_json.getString("address"):null;
- if(q_json.has("building_id")) {
- if(((JSONObject)q_json.getJSONObject("building_id")).isArray())
- {
- JSONArray j_tmp = q_json.getJSONArray("building_id");
- for(int i=0;i<j_tmp.size();i++)
- {
- String tmp = j_tmp.getString(i);
- if(i==0)
- building_id_list = tmp;
- else
- building_id_list += ","+tmp;
- }
- }else
- building_id = q_json.getString("building_id");
- }
- building_name = q_json.has("building_name")?q_json.getString("building_name"):null;
- create_man = q_json.has("create_man")?q_json.getString("create_man"):null;
- data1 = q_json.has("data1")?q_json.getString("data1"):null;
- data2 = q_json.has("data2")?q_json.getString("data2"):null;
- data3 = q_json.has("data3")?q_json.getString("data3"):null;
- fulladdress = q_json.has("fulladdress")?q_json.getString("fulladdress"):null;
- id = q_json.has("id")?q_json.getString("id"):null;
- if(q_json.has("owner_id"))
- {
- if(((JSONObject)q_json.getJSONObject("owner_id")).isArray())
- {
- JSONArray j_tmp = q_json.getJSONArray("owner_id");
- for(int i=0;i<j_tmp.size();i++)
- {
- String tmp = j_tmp.getString(i);
- if(i==0)
- owner_id_list = tmp;
- else
- owner_id_list += ","+tmp;
- }
- }else
- owner_id = q_json.getString("owner_id");
- }
- owner_address = q_json.has("owner_address")?q_json.getString("owner_address"):null;
- owner_office = q_json.has("owner_office")?q_json.getString("owner_office"):null;
- if(q_json.has("xmlx")) {
- if(((JSONObject)q_json.getJSONObject("xmlx")).isArray()) {
- JSONArray j_tmp = q_json.getJSONArray("xmlx");
- for(int i=0;i<j_tmp.size();i++) {
- String tmp = j_tmp.getString(i);
- if(i==0)
- xmlx_list = "'"+tmp+"'";
- else
- xmlx_list += ",'"+tmp+"'";
- }
- }else
- xmlx = q_json.getString("xmlx");
- }
- xmlx = q_json.has("xmlx")?q_json.getString("xmlx"):null;
- json.put("query", 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;
- }
- if((V_LOGINNAME!=null)&&(V_PASSWORD!=null)) {
- List list = ytiotTAdminDao.query(" where u.VLoginname='"+V_LOGINNAME+"' and u.VPassword='"
- +MD5Util.EncoderByMd5(MD5Util.EncoderByMd5(V_PASSWORD))+"' ", null, null, null, null);
- if(list.size()>0) {
- YtiotTAdmin o = (YtiotTAdmin)list.get(0);
- E_STATUS = Integer.parseInt(o.getEStatus());
- }
- String where = " where u.id.agentid='"+V_LOGINNAME+"' ";
- List list1 = ytiotVUserCompanyDao.query(where, null, null, null, null);
- if(list1.size()>0) {
- for(int i=0;i<list1.size();i++) {
- YtiotVUsercompany o = (YtiotVUsercompany)list1.get(i);
- YtiotVUsercompanyId oid = o.getId();
- if(i==0)
- owner_id_List = oid.getOwnerCode();
- else
- owner_id_List += ","+oid.getOwnerCode();
- }
- }
- }
- if(addr1!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("addr1")+" like '%"+addr1+"%' ";
- if(addr1list!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("addr1")+" in ("+addr1list+") ";
- if(owner_id_List!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("owner_id")+" in ("+owner_id_List+") ";
- if(addr2!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("addr2")+" like '%"+addr2+"%' ";
- if(addr2list!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("addr2")+" in ("+addr2list+") ";
- if(addr3!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("addr3")+" like '%"+addr3+"%' ";
- if(addr3list!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("addr3")+" in ("+addr3list+") ";
- if(address!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("address")+" like '%"+address+"%' ";
- if(building_id!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("building_id")+" like '%"+building_id+"%' ";
- if(building_id_list!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("building_id")+" in ("+building_id_list+") ";
- if(building_name!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("building_name")+" like '%"+building_name+"%' ";
- if(create_man!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("create_man")+" like '%"+create_man+"%' ";
- if(data1!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("data1")+" like '%"+data1+"%' ";
- if(data2!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("data2")+" like '%"+data2+"%' ";
- if(data3!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("data3")+" like '%"+data3+"%' ";
- if(fulladdress!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("fulladdress")+" like '%"+fulladdress+"%' ";
- if(id!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("id")+" = '"+id+"' ";
- if(owner_id!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("owner_id")+" = "+owner_id+" ";
- if(owner_id_list!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("owner_id")+" in ("+owner_id_list+") ";
- if(owner_address!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("owner_address")+" like '%"+owner_address+"%' ";
- if(owner_office!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("owner_office")+" like '%"+owner_office+"%' ";
- if(xmlx!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("xmlx")+" like '%"+xmlx+"%' ";
- if(xmlx_list!=null)
- hqlwhere = chkhw(hqlwhere)+"u.id."+fieldname("xmlx")+" in ("+xmlx_list+") ";
- int totalCount = ytiotVCompanyDao.getCount(hqlwhere);
- json.put("totalCount", totalCount);
- if(totalCount>0) {
- List list = ytiotVCompanyDao.query(hqlwhere, null, null, null, null);
- SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- if(list.size()>0) {
- for(int i=0;i<list.size();i++) {
- YtiotVCompany o = (YtiotVCompany)list.get(i);
- YtiotVCompanyId Id = o.getId();
- Map map = new HashMap();
- map.put("owner_id", Id.getOwnerId());
- map.put("owner_name", Id.getOwnerName());
- map.put("xmlx", Id.getXmlx());
- JSONObject jSONObject = JSONObject.fromObject(map);
- jSONArray.add(jSONObject);
- }
- json.put("RESULT", jSONArray);
- }
- }
- return json.toString();
- }
-
-
- @Override
- public String getVBuildingNameList(String queryJson) throws Exception {
- String V_LOGINNAME = null;
- String company_code_list = null;
-
- String hqlwhere = null;
- JSONObject q_json = null;
- JSONArray jSONArray = new JSONArray();
- JSONObject json = new JSONObject();
- // json.put("action", "getPatrolPointList");
- if(queryJson!=null) {
- q_json = JSONObject.fromObject(queryJson);
- V_LOGINNAME = q_json.has("V_LOGINNAME")?q_json.getString("V_LOGINNAME"):null;
- json.put("query", queryJson);
- }
-
- if(V_LOGINNAME!=null) {
- String where1 = " where u.id.agentid='"+V_LOGINNAME+"' ";
- List list1 = ytiotVUserCompanyDao.query(where1, null, null, null, null);
- if(list1.size()>0) {
- for(int i=0;i<list1.size();i++) {
- YtiotVUsercompany o = (YtiotVUsercompany)list1.get(i);
- YtiotVUsercompanyId oid = o.getId();
- if(i==0)
- company_code_list = "'"+oid.getOwnerCode()+"'";
- else
- company_code_list += ",'"+oid.getOwnerCode()+"'";
- }
- }
- }
-
- if(company_code_list!=null)
- hqlwhere = " where u.id.ownerId in ("+company_code_list+")";
- List list = ytiotVCompanyDao.query(hqlwhere, null, null, null, null);
- if(list.size()>0) {
- for(int i=0;i<list.size();i++) {
- YtiotVCompany o = (YtiotVCompany)list.get(i);
- YtiotVCompanyId Id = o.getId();
- Map map = new HashMap();
- map.put("building_id", Id.getBuildingId());
- map.put("building_name", Id.getBuildingName());
- JSONObject jSONObject = JSONObject.fromObject(map);
- jSONArray.add(jSONObject);
- }
- json.put("RESULT", jSONArray);
- }
- return json.toString();
- }
- public static int getDates(Date date1,Date date2) {
- Calendar cal=Calendar.getInstance();
- cal.setTime(date1);
- 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) {
- String result = "100";
- json.put("hjbaifenbi", result);
- }else {
- String result = numberFormat.format((float)clhjtotalCount/(float)hjtotalCount*100);
- json.put("hjbaifenbi", result);
- // int clhjbaifenbi = Integer.parseInt( result );
- // json.put("clhjbaifenbi", clhjbaifenbi);
- }
- if(lxhjtotalCount==0) {
- String result = "100"+"%";
- json.put("lxhjbaifenbi", result);
- }else {
- String result = numberFormat.format((float)cllxhjtotalCount/(float)lxhjtotalCount*100);
- json.put("lxhjbaifenbi", result+"%");
- }
- if(eftotalCount==0) {
- String result = "100";
- json.put("efbaifenbi", result);
- }else {
- String result = numberFormat.format((float)cleftotalCount/(float)eftotalCount*100);
- json.put("efbaifenbi", result);
- }
- if(lxeftotalCount==0) {
- String result = "100"+"%";
- json.put("lxefbaifenbi", result);
- }else {
- String result = numberFormat.format((float)cllxeftotalCount/(float)lxeftotalCount*100);
- json.put("lxefbaifenbi", result+"%");
- }
- if(videototalCount==0) {
- String result = "100";
- json.put("videobaifenbi", result);
- }else {
- String result = numberFormat.format((float)clvideototalCount/(float)videototalCount*100);
- json.put("videobaifenbi", result);
- }
- if(sjtotalCount==0) {
- String result = "100";
- json.put("sjbaifenbi", result);
- }else {
- String result = numberFormat.format((float)clsjtotalCount/(float)sjtotalCount*100);
- json.put("sjbaifenbi", result);
- }
- if(lxsjtotalCount==0) {
- String result = "100"+"%";
- json.put("lxsjbaifenbi", result);
- }else {
- String result = numberFormat.format((float)cllxsjtotalCount/(float)lxsjtotalCount*100);
- json.put("lxsjbaifenbi", result+"%");
- }
- if(rtutotalCount==0) {
- String result = "100";
- json.put("rtubaifenbi", result);
- }else {
- String result = numberFormat.format((float)clrtutotalCount/(float)rtutotalCount*100);
- json.put("rtubaifenbi", result);
- }
- if(lxrtutotalCount==0) {
- String result = "100"+"%";
- json.put("lxrtubaifenbi", result);
- }else {
- String result = numberFormat.format((float)cllxrtutotalCount/(float)lxrtutotalCount*100);
- json.put("lxrtubaifenbi", result+"%");
- }
- if(dwhjtotalCount==0) {
- hjresult = "0";
- lxhjresult = "0";
- }else {
- hjresult = numberFormat.format((float)hjtotalCount/(float)days/(float)dwhjtotalCount);
- lxhjresult = numberFormat.format((float)lxhjtotalCount/(float)days/(float)dwhjtotalCount);
- }
- if(dwsjtotalCount==0) {
- sjresult = "0";
- lxsjresult = "0";
- }else {
- sjresult = numberFormat.format((float)sjtotalCount/(float)days/(float)dwsjtotalCount);
- lxsjresult = numberFormat.format((float)lxsjtotalCount/(float)days/(float)dwsjtotalCount);
- }
- if(dwrtutotalCount==0) {
- rturesult = "0";
- lxrturesult = "0";
- }else {
- rturesult = numberFormat.format((float)rtutotalCount/(float)days/(float)dwrtutotalCount);
- lxrturesult = numberFormat.format((float)lxrtutotalCount/(float)days/(float)dwrtutotalCount);
- }
- if(dweftotalCount==0) {
- efresult = "0";
- lxefresult = "0";
- }else {
- efresult = numberFormat.format((float)eftotalCount/(float)days/(float)dweftotalCount);
- lxefresult = numberFormat.format((float)lxeftotalCount/(float)days/(float)dweftotalCount);
- }
- if(dwvideototalCount==0) {
- videoresult = "0";
- }else {
- videoresult = numberFormat.format((float)videototalCount/(float)days/(float)dwvideototalCount);
- }
- int hjsjrtuCount = hjtotalCount+sjtotalCount+rtutotalCount+eftotalCount+videototalCount;
- String result1 = numberFormat.format((float)hjtotalCount/(float)hjsjrtuCount*100);
- String result2 = numberFormat.format((float)sjtotalCount/(float)hjsjrtuCount*100);
- String result3 = numberFormat.format((float)rtutotalCount/(float)hjsjrtuCount*100);
- String result4 = numberFormat.format((float)eftotalCount/(float)hjsjrtuCount*100);
- String result5 = numberFormat.format((float)videototalCount/(float)hjsjrtuCount*100);
- Map map4 = new HashMap();
- map4.put("lxhjresult", lxhjresult);
- map4.put("lxsjresult", lxsjresult);
- map4.put("lxrturesult", lxrturesult);
- map4.put("lxefresult", lxefresult);
- map4.put("efresult", efresult);
- map4.put("videoresult", videoresult);
- map4.put("dweftotalCount", dweftotalCount);
- map4.put("dwvideototalCount", dwvideototalCount);
- map4.put("eftotalCount", eftotalCount);
- map4.put("cleftotalCount", cleftotalCount);
- map4.put("lxeftotalCount", lxeftotalCount);
- map4.put("cllxeftotalCount", cllxeftotalCount);
- map4.put("videototalCount", videototalCount);
- map4.put("clvideototalCount", clvideototalCount);
- map4.put("result1", result1);
- map4.put("result2", result2);
- map4.put("result3", result3);
- map4.put("result4", result4);
- map4.put("result5", result5);
- // map.put("xmlx", g.getXmlx());
- JSONObject jSONObject4 = JSONObject.fromObject(map4);
- jSONArray4.add(jSONObject4);
- json.put("RESULT4", jSONArray4);
- json.put("hjtotalCount", hjtotalCount);
- json.put("clhjtotalCount", clhjtotalCount);
- json.put("lxhjtotalCount", lxhjtotalCount);
- json.put("cllxhjtotalCount", cllxhjtotalCount);
- json.put("sjtotalCount", sjtotalCount);
- json.put("clsjtotalCount", clsjtotalCount);
- json.put("lxsjtotalCount", lxsjtotalCount);
- json.put("cllxsjtotalCount", cllxsjtotalCount);
- json.put("rtutotalCount", rtutotalCount);
- json.put("clrtutotalCount", clrtutotalCount);
- json.put("lxrtutotalCount", lxrtutotalCount);
- json.put("cllxrtutotalCount", cllxrtutotalCount);
- json.put("dwhjtotalCount", dwhjtotalCount);
- json.put("dwsjtotalCount", dwsjtotalCount);
- json.put("dwrtutotalCount", dwrtutotalCount);
- json.put("days", days);
- json.put("hjresult", hjresult);
- json.put("sjresult", sjresult);
- json.put("rturesult", rturesult);
- List list = ytiotVCompanyDao.query1(hqlwhere, null, null, null, null);
- List list1 = ytiotVCompanyDao.query2(hqlwhere, null, null, null, null);
- List list2 = ytiotVCompanyDao.query3(hqlwhere, null, null, null, null);
- List list3 = ytiotVAlarmDao.HJQuery(hswhere, null, null, null, null);
- List list4 = ytiotVAlarmDao.SJQuery(hswhere, null, null, null, null);
- List list5 = ytiotVAlarmDao.RTUQuery(hswhere, null, null, null, null);
-
- if(list.size()>0) {
- for(int i=0;i<list.size();i++) {
- YtiotTProjectDetails g = (YtiotTProjectDetails)list.get(0);
- // YtiotVCompanyId Id = o.getId();
- Map map = new HashMap();
- map.put("company_name", g.getCompanyName()==null?"":g.getCompanyName());
- map.put("approach_time",g.getApproachTime()==null?"":df.format(g.getApproachTime()));
- map.put("complete_time",g.getCompleteTime()==null?"":df.format(g.getCompleteTime()));
- map.put("check_time", g.getCheckTime()==null?"":df.format(g.getCheckTime()));
- // map.put("xmlx", g.getXmlx());
- JSONObject jSONObject = JSONObject.fromObject(map);
- jSONArray.add(jSONObject);
|