|
@@ -178,3 +178,94 @@ public class YtiotTEfAnalysisServicesImpl implements YtiotTEfAnalysisService {
|
|
|
String company_code = null;
|
|
|
|
|
|
String generation_time=null;//单位名称
|
|
|
+ String V_COMPANY_ADDRESS_0=null;//单位地址_1
|
|
|
+ String I_VERSION=null;//当前记录版本
|
|
|
+ String D_STORETIME=null;//记录存储时间
|
|
|
+ String UQ_ADMIN_ID=null;//信息录入人ID\
|
|
|
+ String E_STATUS=null;//当前状态,0为待开通服务,1为已开通服务,2为服务锁定,3为已注销,4、5留用
|
|
|
+ String V_COMMENT = null;//注册/修改说明
|
|
|
+ String I_ORDER_IDX = null;//序号
|
|
|
+ String Page = null;
|
|
|
+ String Start = null;
|
|
|
+ JSONArray Sort = null;
|
|
|
+ String Limit = null;
|
|
|
+
|
|
|
+ String hqlwhere = null;
|
|
|
+ String order = null;
|
|
|
+ String dir = null;
|
|
|
+ String order_str = null;
|
|
|
+ JSONObject q_json = null;
|
|
|
+ JSONArray jSONArray = new JSONArray();
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("action", "getCompanyList");
|
|
|
+ if(queryJson!=null) {
|
|
|
+ q_json = JSONObject.fromObject(queryJson);
|
|
|
+ company_code= q_json.has("company_code")?q_json.getString("company_code"):null;
|
|
|
+ generation_time = q_json.has("generation_time")?q_json.getString("generation_time"):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);
|
|
|
+ }
|
|
|
+// System.out.println();
|
|
|
+ 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(company_code!=null)
|
|
|
+ hqlwhere = chkhw(hqlwhere) + "u."+fieldname("company_code")+"='"+company_code+"'";
|
|
|
+// if(generation_time!=null)
|
|
|
+// hqlwhere = chkhw(hqlwhere) + "u."+fieldname("generation_time")+"='"+generation_time+"'";
|
|
|
+ int totalCount = ytiotTEfAnalysisDao.getWaterCount(hqlwhere);
|
|
|
+ //System.out.println(totalCount);
|
|
|
+ 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 = ytiotTEfAnalysisDao.queryWater(hqlwhere, order_str, dir, Start, Limit);
|
|
|
+ if(list.size()>0) {
|
|
|
+ for(int i=0;i<list.size();i++) {
|
|
|
+ YtiotTWaterAnalysis o = (YtiotTWaterAnalysis)list.get(i);
|
|
|
+ Map map = new HashMap();
|
|
|
+ map.put("data_statistics", o.getDataStatistics());
|
|
|
+ map.put("dispersion_rate", o.getDispersionRate());
|
|
|
+ map.put("leakage_investigation", o.getLeakageInvestigation());
|
|
|
+ map.put("equipment_list", o.getEquipmentList());
|
|
|
+ map.put("project_situation", o.getProjectSituation());
|
|
|
+ map.put("statistical_period", o.getStatisticalPeriod());
|
|
|
+ map.put("device_association", o.getDeviceAssociation());
|
|
|
+ map.put("data_fluctuation", o.getDataFluctuation());
|
|
|
+ map.put("creat_time", formatter.format(o.getCreatTime()));
|
|
|
+ map.put("generation_time", o.getGenerationTime());
|
|
|
+ JSONObject jSONObject = JSONObject.fromObject(map);
|
|
|
+ jSONArray.add(jSONObject);
|
|
|
+ }
|
|
|
+ json.put("RESULT", jSONArray);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return json.toString();
|
|
|
+ }
|
|
|
+}
|