123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428 |
- package cn.com.usky.iot.xjeventprocessing.service;
- import java.text.SimpleDateFormat;
- import java.util.Date;
- import java.util.HashMap;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import cn.com.usky.iot.entity.YtiotXjEventProcessing;
- import cn.com.usky.iot.xjeventprocessing.dao.YtiotXjEventProcessingDao;
- import cn.com.usky.iot.entity.YtiotXjToExamine1;
- import cn.com.usky.iot.xjtoexamine1.dao.YtiotXjToExamine1Dao;
- import cn.com.usky.iot.entity.YtiotXjSpotOperationRecord;
- import cn.com.usky.iot.xjspotoperationrecord.dao.YtiotXjSpotOperationRecordDao;
- import cn.com.usky.iot.entity.YtiotXjInspectors;
- import cn.com.usky.iot.xjinspectors.dao.YtiotXjInspectorsDao;
- import cn.com.usky.iot.entity.YtiotXjOperationRecordPhotos;
- import cn.com.usky.iot.xjoperationrecordphotos.dao.YtiotXjOperationRecordPhotosDao;
- import cn.com.usky.iot.entity.YtiotXjInspectionPoints;
- import cn.com.usky.iot.xjinspectionpoints.dao.YtiotXjInspectionPointsDao;
- //import cn.com.usky.iot.entity.YtiotVUsercompany;
- //import cn.com.usky.iot.entity.YtiotVUsercompanyId;
- //import cn.com.usky.iot.admin.dao.YtiotVUserCompanyDao;
- import cn.com.usky.utils.DaoResult;
- import net.sf.json.JSONArray;
- import net.sf.json.JSONObject;
- public class YtiotXjEventProcessingServicesImpl implements YtiotXjEventProcessingService {
- private YtiotXjEventProcessingDao ytiotXjEventProcessingDao;
- private YtiotXjToExamine1Dao ytiotXjToExamine1Dao;
- private YtiotXjSpotOperationRecordDao ytiotXjSpotOperationRecordDao;
- private YtiotXjOperationRecordPhotosDao ytiotXjOperationRecordPhotosDao;
- private YtiotXjInspectorsDao ytiotXjInspectorsDao;
- private YtiotXjInspectionPointsDao ytiotXjInspectionPointsDao;
- // private YtiotVUserCompanyDao ytiotVUserCompanyDao;
-
-
- public YtiotXjEventProcessingDao getYtiotXjEventProcessingDao() {
- return ytiotXjEventProcessingDao;
- }
- public void setYtiotXjEventProcessingDao(YtiotXjEventProcessingDao ytiotXjEventProcessingDao) {
- this.ytiotXjEventProcessingDao = ytiotXjEventProcessingDao;
- }
-
- public YtiotXjToExamine1Dao getYtiotXjToExamine1Dao() {
- return ytiotXjToExamine1Dao;
- }
- public void setYtiotXjToExamine1Dao(YtiotXjToExamine1Dao ytiotXjToExamine1Dao) {
- this.ytiotXjToExamine1Dao = ytiotXjToExamine1Dao;
- }
-
- public YtiotXjSpotOperationRecordDao getYtiotXjSpotOperationRecordDao() {
- return ytiotXjSpotOperationRecordDao;
- }
- public void setYtiotXjSpotOperationRecordDao(YtiotXjSpotOperationRecordDao ytiotXjSpotOperationRecordDao) {
- this.ytiotXjSpotOperationRecordDao = ytiotXjSpotOperationRecordDao;
- }
-
- public YtiotXjOperationRecordPhotosDao getYtiotXjOperationRecordPhotosDao() {
- return ytiotXjOperationRecordPhotosDao;
- }
- public void setYtiotXjOperationRecordPhotosDao(YtiotXjOperationRecordPhotosDao ytiotXjOperationRecordPhotosDao) {
- this.ytiotXjOperationRecordPhotosDao = ytiotXjOperationRecordPhotosDao;
- }
-
- public YtiotXjInspectorsDao getYtiotXjInspectorsDao() {
- return ytiotXjInspectorsDao;
- }
- public void setYtiotXjInspectorsDao(YtiotXjInspectorsDao ytiotXjInspectorsDao) {
- this.ytiotXjInspectorsDao = ytiotXjInspectorsDao;
- }
-
- public YtiotXjInspectionPointsDao getYtiotXjInspectionPointsDao() {
- return ytiotXjInspectionPointsDao;
- }
- public void setYtiotXjInspectionPointsDao(YtiotXjInspectionPointsDao ytiotXjInspectionPointsDao) {
- this.ytiotXjInspectionPointsDao = ytiotXjInspectionPointsDao;
- }
- // public YtiotVUserCompanyDao getYtiotVUserCompanyDao() {
- // return ytiotVUserCompanyDao;
- // }
- //
- // public void setYtiotVUserCompanyDao(YtiotVUserCompanyDao ytiotVUserCompanyDao) {
- // this.ytiotVUserCompanyDao = ytiotVUserCompanyDao;
- // }
- 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("cl_type"))
- return "clType";
- if(field.equals("cl_time"))
- return "clTime";
- if(field.equals("user_name"))
- return "userName";
- if(field.equals("zn"))
- return "zn";
- if(field.equals("id"))
- return "id";
- if(field.equals("dwjl_id"))
- return "dwjlId";
- if(field.equals("sj_type"))
- return "sjType";
- if(field.equals("y_complete_time"))
- return "YCompleteTime";
- if(field.equals("p_remarks"))
- return "pRemarks";
- if(field.equals("user_name`"))
- return "userName`";
- if(field.equals("data1"))
- return "data1";
- if(field.equals("data1"))
- return "data1";
- if(field.equals("data2"))
- return "data2";
- if(field.equals("data3"))
- return "data3";
- if(field.equals("team_id"))
- return "teamId";
- if(field.equals("people_id"))
- return "peopleId";
- if(field.equals("person_liable_id"))
- return "personLiableId";
- if(field.equals("person_liable"))
- return "personLiable";
- if(field.equals("event_processing_id"))
- return "eventProcessingId";
- return null;
- }
- @Override
- public String updateEventProcessingzp(String queryJson) throws Exception {
- // TODO Auto-generated method stub
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- String id = null;
- String sj_type = null;
- String person_liable = null;
- String y_complete_time = null;
- String zp_remarks = null;
- String V_LOGINNAME = null;
-
-
- JSONObject q_json = null;
- JSONArray jSONArray = new JSONArray();
- JSONObject json = new JSONObject();
- json.put("action", "updateEventProcessingzp");
- if(queryJson!=null) {
- q_json = JSONObject.fromObject(queryJson);
- id = q_json.has("id")?q_json.getString("id"):null;
-
- sj_type = q_json.has("sj_type")?q_json.getString("sj_type"):null;
- person_liable = q_json.has("person_liable")?q_json.getString("person_liable"):null;
- y_complete_time = q_json.has("y_complete_time")?q_json.getString("y_complete_time"):null;
- zp_remarks = q_json.has("zp_remarks")?q_json.getString("zp_remarks"):null;
- V_LOGINNAME = q_json.has("V_LOGINNAME")?q_json.getString("V_LOGINNAME"):null;
- // System.out.println(q_json);
- json.put("query", queryJson);
- }
- if(chk_string_param(id)&&chk_string_param(sj_type)&&chk_string_param(person_liable)
- &&chk_string_param(y_complete_time)&&chk_string_param(zp_remarks)&&chk_string_param(V_LOGINNAME)) {
- if(id!=null) {
- List list = ytiotXjEventProcessingDao.query(" where u."+fieldname("id")+" ='"+id+"' ", null, null, null, null);
- if(list.size()>0) {
- YtiotXjEventProcessing o = (YtiotXjEventProcessing) list.get(0);
- if(sj_type!=null)
- o.setSjType(Integer.parseInt(sj_type));
- if(person_liable!=null)
- o.setPersonLiable(Integer.parseInt(person_liable));
- if(y_complete_time!=null)
- o.setYCompleteTime(formatter.parse(y_complete_time));
- if(zp_remarks!=null)
- o.setZpRemarks(zp_remarks);
- o.setClType(1);
- // System.out.println("测试000000"+o.getWxName());
- // System.out.println("测试000000"+o.getShTime());
- o.setShTime(formatter.parse("1970-01-01 08:00:00.00"));
- o.setClTime(formatter.parse("1970-01-01 08:00:00.00"));
- o.setData1("0");
- if(V_LOGINNAME!=null)
- o.setUserName(V_LOGINNAME);
- DaoResult ret = ytiotXjEventProcessingDao.update(o);
- System.out.println("测试000001"+ret.isSuccess());
- System.out.println("测试000002"+ret.getResult());
- json.put("success", ret.isSuccess());
- json.put("MSG", ret.getResult());
- }else {
- json.put("success", false);
- json.put("MSG", "需要编辑的权限记录不存在");
- }
- }else {
- json.put("success", false);
- json.put("MSG", "记录ID不能为空");
- }
- }else {
- json.put("success", false);
- json.put("MSG", "参数验证错误");
- }
- return json.toString();
- }
-
- @Override
- public String updateEventProcessingsh(String queryJson) throws Exception {
- // TODO Auto-generated method stub
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- String id = null;
- String cl_type = null;
- String sh_remarks = null;
- String sh_time = null;
- String V_LOGINNAME = null;
-
-
- JSONObject q_json = null;
- JSONArray jSONArray = new JSONArray();
- JSONObject json = new JSONObject();
- json.put("action", "updateEventProcessingsh");
- if(queryJson!=null) {
- q_json = JSONObject.fromObject(queryJson);
- id = q_json.has("id")?q_json.getString("id"):null;
-
- cl_type = q_json.has("cl_type")?q_json.getString("cl_type"):null;
- sh_remarks = q_json.has("sh_remarks")?q_json.getString("sh_remarks"):null;
- V_LOGINNAME = q_json.has("V_LOGINNAME")?q_json.getString("V_LOGINNAME"):null;
- json.put("query", queryJson);
- }
- if(chk_string_param(id)&&chk_string_param(cl_type)&&chk_string_param(sh_remarks)&&chk_string_param(V_LOGINNAME)) {
- if(id!=null) {
- List list = ytiotXjEventProcessingDao.query(" where u."+fieldname("id")+" ="+id, null, null, null, null);
- if(list.size()>0) {
- YtiotXjEventProcessing o = (YtiotXjEventProcessing) list.get(0);
- if(cl_type!=null)
- o.setClType(Integer.parseInt(cl_type));
- if(sh_remarks!=null)
- o.setShRemarks(sh_remarks);
- if(V_LOGINNAME!=null)
- o.setUserName(V_LOGINNAME);
- // if(sh_time!=null)
- o.setShTime(new Date());
- if(Integer.parseInt(cl_type)==3) {
- o.setData1("0");
- }
- DaoResult ret = ytiotXjEventProcessingDao.updatesh(o);
- json.put("success", ret.isSuccess());
- json.put("MSG", ret.getResult());
- }else {
- json.put("success", false);
- json.put("MSG", "需要编辑的权限记录不存在");
- }
- }else {
- json.put("success", false);
- json.put("MSG", "记录ID不能为空");
- }
- }else {
- json.put("success", false);
- json.put("MSG", "参数验证错误");
- }
- return json.toString();
- }
-
- @Override
- public String getEventProcessingList(String queryJson, String page, String start, String limit, String sort) throws Exception {
- // TODO Auto-generated method stub
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
- SimpleDateFormat formatter1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- String id = null;
- String dwjl_id = null;
- String sj_type = null;
- String y_complete_time = null;
- String V_LOGINNAME = null;
- String V_PASSWORD = null;
- String person_liable = null;
- String zp_remarks = null;
- String user_name = null;
- String data1 = null;
- String data2 = null;
- String data3 = null;
- String cl_type = null;
- String cl_time = null;
- String wx_name = null;
-
- int xh = 0;
- String dwsb_remarks = null;
- String cl_time_k = null;
- String cl_time_k1 = null;
- String cl_time_j = null;
- String cl_time_j1 = null;
- String event_processing_id_list = null;
- String event_processing_id_list1 = null;
- String dwjl_id_list = null;
- String hehe = "1970-01-01 08:00:00";
- String hehe00 = "0000-00-00 00:00:00";
- String dqsj = formatter.format(new Date());
-
- String cl_sql=null;
- String sql=null;
- String cl_sql1=null;
- String dwjl_sql = null;
- String dwjl_sql1 = null;
- String hqlwhere = null;
- String hqlwhere1 = null;
- String clsj_sql = null;
- String zrr_sql = null;
- String zsl_hqlwhere = null;
- String jrrw_hqlwhere = null;
- String csrw_hqlwhere = null;
- String jrjj_hqlwhere = null;
- String dz_sql = null;
-
- String Page = null;
- String Start = null;
- JSONArray Sort = null;
- String Limit = null;
-
- String order = null;
- String dir = null;
- String order_str = null;
- JSONObject q_json = null;
- JSONArray jSONArray = new JSONArray();
- JSONArray jSONArray1 = new JSONArray();
- JSONArray jSONArray3 = new JSONArray();
- JSONObject json = new JSONObject();
- json.put("action", "getEventProcessingList");
- if(queryJson!=null) {
- q_json = JSONObject.fromObject(queryJson);
- id = q_json.has("id")?q_json.getString("id"):null;
-
- sj_type = q_json.has("sj_type")?q_json.getString("sj_type"):null;
- cl_type = q_json.has("cl_type")?q_json.getString("cl_type"):null;
- cl_time_k = q_json.has("cl_time_k")?q_json.getString("cl_time_k"):null;
- cl_time_j = q_json.has("cl_time_j")?q_json.getString("cl_time_j"):null;
- person_liable = q_json.has("person_liable")?q_json.getString("person_liable"):null;
- wx_name = q_json.has("wx_name")?q_json.getString("wx_name"):null;
-
-
- 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;
-
- 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;
-
- hqlwhere = chkhw(hqlwhere) + "u.userName='"+V_LOGINNAME+"'";
- if(sj_type!=null&&Integer.parseInt(sj_type)!=0)
- hqlwhere = chkhw(hqlwhere) + "u.sjType = "+sj_type;
- if(person_liable!=null&&person_liable.length()>0&&Integer.parseInt(person_liable)!=0)
- hqlwhere = chkhw(hqlwhere) + "u."+fieldname("person_liable")+" = "+person_liable;
- if(cl_type!=null&&Integer.parseInt(cl_type)!=0)
- hqlwhere = chkhw(hqlwhere) + "u."+fieldname("cl_type")+"="+cl_type;
- if(cl_time_k!=null) {
- cl_time_k1=cl_time_k+" 00:01:00";
- hqlwhere = chkhw(hqlwhere) + "u.clTime >='"+cl_time_k1+"'";
- }
-
- if(cl_time_j!=null) {
- cl_time_j1 = cl_time_j+" 23:59:00";
- hqlwhere = chkhw(hqlwhere) + "u.clTime <='"+cl_time_j1+"'";
- }
-
- if(wx_name!=null)
- hqlwhere = chkhw(hqlwhere) + "u.wxName like '%"+wx_name+"%'";
-
- if(order!=null)
- order_str = " order by u."+fieldname(order);
- else
- order_str = " order by u."+fieldname("id");
-
- int totalCount = ytiotXjEventProcessingDao.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);
-
- hqlwhere1 = chkhw(hqlwhere1) + "u.zn in ('4','5','6','7')";
- if(V_LOGINNAME!=null)
- hqlwhere1 = chkhw(hqlwhere1) + "u.data2='"+V_LOGINNAME+"'";
-
- sql="";
- List list_zrrxlk = ytiotXjInspectorsDao.query(hqlwhere1, null, null, null, null);
- if(list_zrrxlk.size()>0) {
- for(int i=0;i<list_zrrxlk.size();i++) {
- YtiotXjInspectors zrrxlk_o = (YtiotXjInspectors)list_zrrxlk.get(i);
- Map map1 = new HashMap();
- map1.put("zrrid", zrrxlk_o.getId());
- map1.put("name", zrrxlk_o.getName());
- JSONObject jSONObject1 = JSONObject.fromObject(map1);
- jSONArray1.add(jSONObject1);
- }
- json.put("RESULT1", jSONArray1);
- }
- // System.out.println("测试88888888"+hqlwhere);
- if(totalCount>0) {
- List list = ytiotXjEventProcessingDao.query(hqlwhere, order_str, dir, Start, Limit);
- if(list.size()>0) {
- for(int i=0;i<list.size();i++) {
- YtiotXjEventProcessing o = (YtiotXjEventProcessing)list.get(i);
- Map map = new HashMap();
- xh=i+1;
- map.put("xh", xh);
- map.put("id", o.getId());
- map.put("wx_name", o.getWxName());
-
- if(String.valueOf(o.getDwjlId())!=null) {
- dwjl_sql1 = " where u.id="+o.getDwjlId();
- List dwjl_list1 = ytiotXjSpotOperationRecordDao.query(dwjl_sql1, null, null, null, null);
- if(dwjl_list1.size()>0) {
- YtiotXjSpotOperationRecord dwjl_o1 = (YtiotXjSpotOperationRecord)dwjl_list1.get(0);
- if(String.valueOf(dwjl_o1.getSpotId())!=null) {
- dz_sql=" where u.id="+dwjl_o1.getSpotId();
- List dz_list = ytiotXjInspectionPointsDao.query(dz_sql, null, null, null, null);
- if( dz_list.size()>0) {
- YtiotXjInspectionPoints dz_o = (YtiotXjInspectionPoints)dz_list.get(0);
- map.put("spot_address", dz_o.getSpotAddress());
- }
-
- }
- }
- }
- // System.out.println("测试000666故障"+o.getSjType());
- if(o.getSjType()==1) {
- map.put("sj_type_name", "故障");
- // System.out.println("测试000666故障");
- }else if(o.getSjType()==2) {
- map.put("sj_type_name", "隐患");
- // System.out.println("测试000666四大");
- }else if(o.getSjType()==3) {
- map.put("sj_type_name", "其他");
- // System.out.println("测试000666发鬼地方");
- }else{
- // System.out.println("测试000666打算");
- map.put("sj_type_name", "--");
- }
-
- if(o.getYCompleteTime()!=null) {
- if(formatter1.format(o.getYCompleteTime()).equals(hehe)||formatter1.format(o.getYCompleteTime()).equals(hehe00)) {
- map.put("y_complete_time", "--");
- }else {
- map.put("y_complete_time", formatter1.format(o.getYCompleteTime()));
- }
- }else {
- map.put("y_complete_time", "--");
- }
-
-
- if(o.getClType()==2) {
- // map.put("cl_type_name", "< a href='javascript:void(0)' onclick=\"modifywin1(0," + o.getId() + ")\" style='color:#59c24a'>未审核</ a>");
- map.put("cl_type_name", "<a href='javascript:void(0)' onclick=\"examineStatus(0," + o.getId() + ")\" style='color:#59c24a'>"+"未审核"+"</a>");
- map.put("cl_time", "--");
- }else if(o.getClType()==3) {
- // map.put("cl_type_name", "< a href='javascript:void(0)' onclick=\"modifywin1(0," + o.getId() + ")\" style='color:#ff9254'>审核未通过</ a>");
- map.put("cl_type_name", "<a href='javascript:void(0)' onclick=\"examineStatus(1," + o.getId() + ")\" style='color:#ff9254'>"+"审核未通过"+"</a>");
- map.put("cl_time", "--");
- }else if(o.getClType()==4) {
- // map.put("cl_type_name", "< a href='javascript:void(0)' onclick=\"modifywin1(0," + o.getId() + ")\" style='color:#0082ff'>已完成</ a>");
- map.put("cl_type_name", "<a href='javascript:void(0)' onclick=\"examineStatus(2," + o.getId() + ")\" style='color:#0082ff'>"+"已完成 "+"</a>");
- map.put("cl_time", formatter1.format(o.getClTime()));
- }else if(o.getClType()==5) {
- // map.put("cl_type_name", "< a href='javascript:void(0)' onclick=\"modifywin1(0," + o.getId() + ")\" style='color:#ff9254'>超时完成 </ a>");
- map.put("cl_type_name", "<a href='javascript:void(0)' onclick=\"examineStatus(3," + o.getId() + ")\" style='color:#ff9254'>"+"超时完成 "+"</a>");
- map.put("cl_time", formatter1.format(o.getClTime()));
- }else if(o.getClType()==1) {
- map.put("cl_type_name", "<span style='color:#ff0000'>"+"未处理"+"</span>");
- map.put("cl_time", "--");
- }else if(o.getClType()==0) {
- map.put("cl_type_name", "<span style='color:#ff0000'>"+"未处理"+"</span>");
- map.put("cl_time", "--");
- }
- // System.out.println("测试000"+o.getPersonLiable());
- if(o.getPersonLiable()!=null) {
- // map.put("dqzt", "< a href='javascript:void(0)' onclick=\"modifywin1(0," + o.getId() + ")\" style='color:#0082ff'>已指派</ a>");
- map.put("dqzt", "<a href='javascript:void(0)' onclick=\"editMaintenancePresentation(1," + o.getId() + ")\" style='color:#0082ff'>"+"已指派"+"</a>");
- }else {
- // map.put("dqzt", "< a href='javascript:void(0)' onclick=\"modifywin1(0," + o.getId() + ")\" style='color:#ff0000'>未指派</ a>");
- map.put("dqzt", "<a href='javascript:void(0)' onclick=\"editMaintenancePresentation(0," + o.getId() + ")\" style='color:#ff0000'>"+"未指派"+"</a>");
- }
-
- if(o.getPersonLiable()!=null) {
- zrr_sql = " where u.id="+o.getPersonLiable();
- List zrr_list = ytiotXjInspectorsDao.query(zrr_sql, null, null, null, null);
- if(zrr_list .size()>0) {
- YtiotXjInspectors zrr_o = (YtiotXjInspectors)zrr_list.get(0);
- map.put("person_liable_name", zrr_o.getName());
- map.put("phone", zrr_o.getPhone());
- }
- }else {
- map.put("person_liable_name", "--");
- map.put("phone", "--");
- }
-
- JSONObject jSONObject = JSONObject.fromObject(map);
- jSONArray.add(jSONObject);
- }
- json.put("RESULT", jSONArray);
-
- }
- }
- Map map3 = new HashMap();
- //人员总数量
- if(V_LOGINNAME!=null) {
- zsl_hqlwhere = " where u."+fieldname("data2")+"='"+V_LOGINNAME+"' and u."+fieldname("zn")+" in (4,5,6,7)";
- // System.out.println(xjrysl_hqlwhere);
- int zrs = ytiotXjInspectorsDao.getCount(zsl_hqlwhere);
- // System.out.println(xjrysl);
- map3.put("zrs", zrs);
- // System.out.println("测试0"+zrs);
- }
- //今日事件
- if(dqsj!=null) {
- jrrw_hqlwhere = " where u."+fieldname("y_complete_time")+" like '%"+dqsj+"%' and u."+fieldname("user_name")+"='"+V_LOGINNAME+"'";
- // System.out.println(jrrw_hqlwhere);
- int jrsj = ytiotXjEventProcessingDao.getCount(jrrw_hqlwhere);
- // System.out.println("总数"+jrsj);
- map3.put("jrsj", jrsj);
- }else {
- map3.put("jrsj", 0);
- }
- //超时事件
- if(V_LOGINNAME!=null) {
- csrw_hqlwhere = " where u."+fieldname("user_name")+"='"+V_LOGINNAME+"' and u.clType=5";
- // System.out.println(jrrw_hqlwhere);
- int cssj = ytiotXjEventProcessingDao.getCount(csrw_hqlwhere);
- map3.put("cssj", cssj);
- }else {
- map3.put("cssj", 0);
- }
- //今日解决
- if(V_LOGINNAME!=null&&dqsj!=null) {
- jrjj_hqlwhere = " where u."+fieldname("user_name")+"='"+V_LOGINNAME+"' and u.clType=4 and u.shTime like '%"+dqsj+"%'";
- // System.out.println(jrrw_hqlwhere);
- int jrjj = ytiotXjEventProcessingDao.getCount(jrjj_hqlwhere);
- map3.put("jrjj", jrjj);
- }else {
- map3.put("jrjj", 0);
- }
- JSONObject jSONObject3 = JSONObject.fromObject(map3);
- jSONArray3.add(jSONObject3);
- json.put("RESULT2", jSONArray3);
- return json.toString();
- }
-
-
- @Override
- public String getReportDetailsList(String queryJson) throws Exception {
- // TODO Auto-generated method stub
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- String id = null;
- String hehe = "0002-11-30 00:00:00";
- String V_LOGINNAME = null;
- String V_PASSWORD = null;
-
-
- String name_sql=null;
- String hqlwhere = null;
- String dwjl_sql = null;
- String tp_sql = null;
-
- // String Page = null;
- // String Start = null;
- // JSONArray Sort = null;
- // String Limit = 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", "getReportDetailsList");
- if(queryJson!=null) {
- q_json = JSONObject.fromObject(queryJson);
- id = q_json.has("id")?q_json.getString("id"):null;
-
- 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;
-
- order = q_json.has("order")?q_json.getString("order"):null;
- dir = q_json.has("dir")?q_json.getString("dir"):null;
- json.put("query", queryJson);
- }
-
-
- // System.out.println();
-
- if(id!=null)
- hqlwhere = chkhw(hqlwhere) + "u."+fieldname("id")+"="+id;
- if(order!=null)
- order_str = " order by u."+fieldname(order);
- else
- order_str = " order by u."+fieldname("id");
- int totalCount = ytiotXjEventProcessingDao.getCount(hqlwhere);
- json.put("totalCount", totalCount);
- if(totalCount>0) {
- List list = ytiotXjEventProcessingDao.query(hqlwhere, null, null, null, null);
- if(list.size()>0) {
- YtiotXjEventProcessing o = (YtiotXjEventProcessing)list.get(0);
- Map map = new HashMap();
- map.put("id", o.getId());
- if(String.valueOf(o.getDwjlId())!=null) {
- dwjl_sql = " where u.id="+o.getDwjlId();
- List dwjl_list = ytiotXjSpotOperationRecordDao.query(dwjl_sql, null, null, null, null);
- if(dwjl_list.size()>0) {
- YtiotXjSpotOperationRecord dwjl_o = (YtiotXjSpotOperationRecord)dwjl_list.get(0);
- if(dwjl_o.getWbrId()!=null) {
- name_sql=" where u.id="+dwjl_o.getWbrId();
- List name_list = ytiotXjInspectorsDao.query(name_sql, null, null, null, null);
- if(name_list.size()>0) {
- YtiotXjInspectors name_o = (YtiotXjInspectors)name_list.get(0);
- map.put("name", name_o.getName());
- // map.put("phone", name_o.getPhone());
- }
- }
-
- if(formatter.format(dwjl_o.getWcTime()).equals(hehe)) {
- map.put("sbsj", "--");
- }else {
- map.put("sbsj", formatter.format(dwjl_o.getWcTime()));
- }
-
- map.put("dwsb_remarks", dwjl_o.getDwsbRemarks());
-
- if(dwjl_o.getId()!=null) {
- tp_sql=" where u.dwczjlId="+dwjl_o.getId();
- List tp_list = ytiotXjOperationRecordPhotosDao.query(tp_sql, null, null, null, null);
- if(tp_list.size()>0) {
- YtiotXjOperationRecordPhotos tp_o = (YtiotXjOperationRecordPhotos)tp_list.get(0);
- map.put("report_photos", tp_o.getReportPhotos());
- }
- }
- }
-
- }
-
- JSONObject jSONObject = JSONObject.fromObject(map);
- jSONArray.add(jSONObject);
- json.put("RESULT", jSONArray);
-
- }
- }
- return json.toString();
- }
-
- @Override
- public String getAssignJlList(String queryJson) throws Exception {
- // TODO Auto-generated method stub
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- String id = null;
- String hehe = "0000-00-00 00:00:00";
- String hehe00 = "1970-01-01 08:00:00";
- String hehe1 = "0002-11-30 00:00:00";
- String V_LOGINNAME = null;
- String V_PASSWORD = null;
-
-
- String name_sql=null;
- String name_sql2=null;
- String hqlwhere = null;
- String dwjl_sql = null;
- String tp_sql = null;
-
- // String Page = null;
- // String Start = null;
- // JSONArray Sort = null;
- // String Limit = 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", "getAssignJlList");
- if(queryJson!=null) {
- q_json = JSONObject.fromObject(queryJson);
- id = q_json.has("id")?q_json.getString("id"):null;
-
- 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;
-
- order = q_json.has("order")?q_json.getString("order"):null;
- dir = q_json.has("dir")?q_json.getString("dir"):null;
- json.put("query", queryJson);
- }
-
-
- // System.out.println();
-
- if(id!=null)
- hqlwhere = chkhw(hqlwhere) + "u."+fieldname("id")+"="+id;
- if(order!=null)
- order_str = " order by u."+fieldname(order);
- else
- order_str = " order by u."+fieldname("id");
- int totalCount = ytiotXjEventProcessingDao.getCount(hqlwhere);
- json.put("totalCount", totalCount);
- if(totalCount>0) {
- List list = ytiotXjEventProcessingDao.query(hqlwhere, null, null, null, null);
- if(list.size()>0) {
- YtiotXjEventProcessing o = (YtiotXjEventProcessing)list.get(0);
- Map map = new HashMap();
- map.put("id", o.getId());
- if(o.getSjType()==1) {
- map.put("sj_tytpe_name", "故障");
- }else if(o.getSjType()==2) {
- map.put("sj_tytpe_name", "隐患");
- }else if(o.getSjType()==3) {
- map.put("sj_tytpe_name", "其他");
- }
-
- if(o.getPersonLiable()!=null) {
- name_sql2=" where u.id="+o.getPersonLiable();
- List name_list2 = ytiotXjInspectorsDao.query(name_sql2, null, null, null, null);
- if(name_list2.size()>0) {
- YtiotXjInspectors name_o2 = (YtiotXjInspectors)name_list2.get(0);
- map.put("name", name_o2.getName());
- }
- }
-
- if(String.valueOf(o.getDwjlId())!=null) {
- dwjl_sql = " where u.id="+o.getDwjlId();
- List dwjl_list = ytiotXjSpotOperationRecordDao.query(dwjl_sql, null, null, null, null);
- if(dwjl_list.size()>0) {
- YtiotXjSpotOperationRecord dwjl_o = (YtiotXjSpotOperationRecord)dwjl_list.get(0);
- if(dwjl_o.getWbrId()!=null) {
- name_sql=" where u.id="+dwjl_o.getWbrId();
- List name_list = ytiotXjInspectorsDao.query(name_sql, null, null, null, null);
- if(name_list.size()>0) {
- YtiotXjInspectors name_o = (YtiotXjInspectors)name_list.get(0);
- map.put("phone", name_o.getPhone());
- }
- }
-
- if(formatter.format(dwjl_o.getWcTime()).equals(hehe1)) {
- map.put("sbsj", "--");
- }else {
- map.put("sbsj", formatter.format(dwjl_o.getWcTime()));
- }
-
- }
-
- }
- if(o.getYCompleteTime()!=null) {
- if(formatter.format(o.getYCompleteTime()).equals(hehe)||formatter.format(o.getYCompleteTime()).equals(hehe00)) {
- map.put("y_complete_time", "");
- }else {
- map.put("y_complete_time", formatter.format(o.getYCompleteTime()));
- }
- }else {
- map.put("y_complete_time", "");
- }
-
- // System.out.println("测试00"+formatter.format(o.getYCompleteTime()));
- map.put("zp_remarks", o.getZpRemarks());
- JSONObject jSONObject = JSONObject.fromObject(map);
- jSONArray.add(jSONObject);
- json.put("RESULT", jSONArray);
-
- }
- }
- return json.toString();
- }
-
- @Override
- public String getNotAudited(String queryJson) throws Exception {
- // TODO Auto-generated method stub
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- String id = null;
- String hehe = "0000-00-00 00:00:00";
- String hehe1 = "0002-11-30 00:00:00";
- String V_LOGINNAME = null;
- String hehe00 = "1970-01-01 08:00:00";
- String V_PASSWORD = null;
-
-
- String name_sql=null;
- String name_sql2=null;
- String hqlwhere = null;
- String dwjl_sql = null;
- String tp_sql = null;
- String zt_sql = null;
-
- // String Page = null;
- // String Start = null;
- // JSONArray Sort = null;
- // String Limit = 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", "getNotAudited");
- if(queryJson!=null) {
- q_json = JSONObject.fromObject(queryJson);
- id = q_json.has("id")?q_json.getString("id"):null;
-
- 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;
-
- order = q_json.has("order")?q_json.getString("order"):null;
- dir = q_json.has("dir")?q_json.getString("dir"):null;
- json.put("query", queryJson);
- }
-
-
- // System.out.println();
-
- if(id!=null)
- hqlwhere = chkhw(hqlwhere) + "u."+fieldname("id")+"="+id;
- if(order!=null)
- order_str = " order by u."+fieldname(order);
- else
- order_str = " order by u."+fieldname("id");
- int totalCount = ytiotXjEventProcessingDao.getCount(hqlwhere);
- json.put("totalCount", totalCount);
- if(totalCount>0) {
- List list = ytiotXjEventProcessingDao.query(hqlwhere, null, null, null, null);
- if(list.size()>0) {
- YtiotXjEventProcessing o = (YtiotXjEventProcessing)list.get(0);
- Map map = new HashMap();
- map.put("id", o.getId());
-
- if( o.getId()!=null) {
- // zt_sql=" where u.eventProcessingId="+ o.getId()+" order by u.clTime desc";
- // List zt_list = ytiotXjToExamineDao.query(zt_sql, null, null, null, null);
- // if(zt_list.size()>0) {
- // YtiotXjToExamine zt_o = (YtiotXjToExamine)zt_list.get(0);
- map.put("cl_type", o.getClType());
- if(o.getClType()==2) {
- map.put("cl_type_name", "<span style='color:#59c24a'>"+"未审核"+"</span>");
- map.put("sh_time", "无");
- }else if(o.getClType()==3) {
- map.put("cl_type_name", "<span style='color:#ff9254'>"+"审核未通过"+"</span>");
- map.put("sh_time", formatter.format(o.getShTime()));
- }else if(o.getClType()==4) {
- map.put("cl_type_name", "<span style='color:#0082ff'>"+"已完成"+"</span>");
- map.put("sh_time", formatter.format(o.getShTime()));
- }else if(o.getClType()==5) {
- map.put("cl_type_name", "<span style='color:#ff9254'>"+"超时完成"+"</span>");
- map.put("sh_time", formatter.format(o.getShTime()));
- }else if(o.getClType()==1) {
- map.put("cl_type_name", "<span style='color:#ff0000'>"+"未处理"+"</span>");
- }
-
- map.put("picture_path", o.getPicturePath());
- map.put("cl_time", formatter.format(o.getClTime()));
- map.put("jg_remarks", o.getJgRemarks());
- map.put("data1", o.getData1());
-
- // if(formatter.format(o.getShTime()).equals(hehe)) {
- // map.put("sh_time", "无");
- // }else {
- // map.put("sh_time", formatter.format(o.getShTime()));
- // }
- if(o.getShRemarks()!=null) {
- map.put("sh_remarks", o.getShRemarks());
- }else {
- map.put("sh_remarks", "无");
- }
- // }
- }
-
- if(o.getYCompleteTime()!=null) {
- if(formatter.format(o.getYCompleteTime()).equals(hehe)||formatter.format(o.getYCompleteTime()).equals(hehe00)) {
- map.put("y_complete_time", "");
- }else {
- map.put("y_complete_time", formatter.format(o.getYCompleteTime()));
- }
- }else {
- map.put("y_complete_time", "");
- }
-
-
-
-
- if(o.getPersonLiable()!=null) {
- name_sql2=" where u.id="+o.getPersonLiable();
- List name_list2 = ytiotXjInspectorsDao.query(name_sql2, null, null, null, null);
- if(name_list2.size()>0) {
- YtiotXjInspectors name_o2 = (YtiotXjInspectors)name_list2.get(0);
- map.put("person_liable_name", name_o2.getName());
- }
- }
-
- if(String.valueOf(o.getDwjlId())!=null) {
- dwjl_sql = " where u.id="+o.getDwjlId();
- List dwjl_list = ytiotXjSpotOperationRecordDao.query(dwjl_sql, null, null, null, null);
- if(dwjl_list.size()>0) {
- YtiotXjSpotOperationRecord dwjl_o = (YtiotXjSpotOperationRecord)dwjl_list.get(0);
- if(dwjl_o.getWbrId()!=null) {
- name_sql=" where u.id="+dwjl_o.getWbrId();
- List name_list = ytiotXjInspectorsDao.query(name_sql, null, null, null, null);
- if(name_list.size()>0) {
- YtiotXjInspectors name_o = (YtiotXjInspectors)name_list.get(0);
- map.put("phone", name_o.getPhone());
- }
- }
-
- if(formatter.format(dwjl_o.getWcTime()).equals(hehe1)) {
- map.put("sbsj", "--");
- }else {
- map.put("sbsj", formatter.format(dwjl_o.getWcTime()));
- }
-
- }
-
- }
-
-
- JSONObject jSONObject = JSONObject.fromObject(map);
- jSONArray.add(jSONObject);
- json.put("RESULT", jSONArray);
-
- }
- }
- return json.toString();
- }
-
-
- @Override
- public String getFeedback(String queryJson) throws Exception {
- // TODO Auto-generated method stub
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- String id = null;
- String event_processing_id = null;
- String hehe = "0000-00-00 00:00:00";
- String hehe1 = "0002-11-30 00:00:00";
- String hehe00 = "1970-01-01 08:00:00";
- String V_LOGINNAME = null;
- String V_PASSWORD = null;
-
-
- String name_sql=null;
- String name_sql2=null;
- String hqlwhere = null;
- String dwjl_sql = null;
- String tp_sql = null;
- String zt_sql = null;
-
- // String Page = null;
- // String Start = null;
- // JSONArray Sort = null;
- // String Limit = 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", "getFeedback");
- if(queryJson!=null) {
- q_json = JSONObject.fromObject(queryJson);
- event_processing_id = q_json.has("event_processing_id")?q_json.getString("event_processing_id"):null;
-
- 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;
-
- order = q_json.has("order")?q_json.getString("order"):null;
- dir = q_json.has("dir")?q_json.getString("dir"):null;
- json.put("query", queryJson);
- }
-
-
- // System.out.println();
-
- if(event_processing_id!=null)
- hqlwhere = chkhw(hqlwhere) + "u."+fieldname("event_processing_id")+"="+event_processing_id+" order by u.clTime asc";
- // if(order!=null)
- // order_str = " order by u."+fieldname(order);
- // else
- // order_str = " order by u."+fieldname("id");
- // System.out.println("测试666666"+hqlwhere);
- int totalCount = ytiotXjToExamine1Dao.getCount(hqlwhere);
- json.put("totalCount", totalCount);
- if(totalCount>0) {
- List list = ytiotXjToExamine1Dao.query(hqlwhere, null, null, null, null);
- if(list.size()>0) {
- for(int i=0;i<list.size();i++) {
- YtiotXjToExamine1 o = (YtiotXjToExamine1)list.get(i);
- Map map = new HashMap();
- map.put("id", o.getId());
- map.put("picture_path", o.getPicturePath());
- map.put("cl_time", formatter.format(o.getClTime()));
- map.put("jg_remarks", o.getJgRemarks());
- if(o.getClType()==2) {
- map.put("cl_type_name", "<span style='color:#59c24a'>"+"未审核"+"</span>");
- }else if(o.getClType()==3) {
- map.put("cl_type_name", "<span style='color:#ff9254'>"+"审核未通过"+"</span>");
- }else if(o.getClType()==4) {
- map.put("cl_type_name", "<span style='color:#0082ff'>"+"已完成"+"</span>");
- }else if(o.getClType()==5) {
- map.put("cl_type_name", "<span style='color:#ff9254'>"+"超时完成"+"</span>");
- }else if(o.getClType()==0) {
- map.put("cl_type_name", "无");
- }else if(o.getClType()==1) {
- map.put("cl_type_name", "<span style='color:#ff0000'>"+"未处理"+"</span>");
- }
-
- if(o.getPersonLiable()!=null) {
- name_sql2=" where u.id="+o.getPersonLiable();
- List name_list2 = ytiotXjInspectorsDao.query(name_sql2, null, null, null, null);
- if(name_list2.size()>0) {
- YtiotXjInspectors name_o2 = (YtiotXjInspectors)name_list2.get(0);
- map.put("person_liable_name", name_o2.getName());
- }
- }
-
- if(String.valueOf(o.getDwjlId())!=null) {
- dwjl_sql = " where u.id="+o.getDwjlId();
- List dwjl_list = ytiotXjSpotOperationRecordDao.query(dwjl_sql, null, null, null, null);
- if(dwjl_list.size()>0) {
- YtiotXjSpotOperationRecord dwjl_o = (YtiotXjSpotOperationRecord)dwjl_list.get(0);
- if(dwjl_o.getWbrId()!=null) {
- name_sql=" where u.id="+dwjl_o.getWbrId();
- List name_list = ytiotXjInspectorsDao.query(name_sql, null, null, null, null);
- if(name_list.size()>0) {
- YtiotXjInspectors name_o = (YtiotXjInspectors)name_list.get(0);
- map.put("phone", name_o.getPhone());
- }
- }
-
- if(formatter.format(dwjl_o.getWcTime()).equals(hehe1)) {
- map.put("sbsj", "--");
- }else {
- map.put("sbsj", formatter.format(dwjl_o.getWcTime()));
- }
-
- }
-
- }
-
- if(o.getYCompleteTime()!=null) {
- if(formatter.format(o.getYCompleteTime()).equals(hehe)||formatter.format(o.getYCompleteTime()).equals(hehe00)) {
- map.put("y_complete_time", "");
- }else {
- map.put("y_complete_time", formatter.format(o.getYCompleteTime()));
- }
- }else {
- map.put("y_complete_time", "");
- }
-
-
- if(o.getShTime()!=null) {
- if(formatter.format(o.getShTime()).equals(hehe)||formatter.format(o.getShTime()).equals(hehe00)) {
- map.put("sh_time", "无");
- }else {
- map.put("sh_time", formatter.format(o.getShTime()));
- }
- }else {
- map.put("sh_time", "无");
- }
-
-
- if(o.getShRemarks()!=null) {
- map.put("sh_remarks", o.getShRemarks());
- }else {
- map.put("sh_remarks", "无");
- }
- JSONObject jSONObject = JSONObject.fromObject(map);
- jSONArray.add(jSONObject);
- }
-
- json.put("RESULT", jSONArray);
-
- }
- }
- return json.toString();
- }
-
-
-
-
- // 维修责任人
- @Override
- public String getwxzrr(String queryJson) throws Exception {
- // TODO Auto-generated method stub
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- String id = null;
- String name = null;
- String phone = null;
- String company_code = null;
- String V_LOGINNAME = null;
- String V_PASSWORD = null;
- String company_code_list = null;
- String remarks = null;
- String inspect_role = null;
- int xh=0;
- String tdry_hqlwhere=null;
- String hqlwhere = null;
- String zrr_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", "getwxzrr");
- if(queryJson!=null) {
- q_json = JSONObject.fromObject(queryJson);
- V_LOGINNAME = q_json.has("V_LOGINNAME")?q_json.getString("V_LOGINNAME"):null;
-
- order = q_json.has("order")?q_json.getString("order"):null;
- dir = q_json.has("dir")?q_json.getString("dir"):null;
- json.put("query", queryJson);
- }
- // System.out.println("测试"+id);
- // System.out.println();
-
-
- hqlwhere = chkhw(hqlwhere) + "zn in ('4','5','6','7')";
- if(V_LOGINNAME!=null)
- hqlwhere = chkhw(hqlwhere) + "data2='"+V_LOGINNAME+"'";
- //
- // if(order!=null)
- // order_str = " order by u."+fieldname(order);
- // else
- // order_str = " order by u."+fieldname("id");
-
- List list = ytiotXjInspectorsDao.query(hqlwhere, order_str, null, null, null);
- if(list.size()>0) {
- for(int i=0;i<list.size();i++) {
- YtiotXjInspectors o = (YtiotXjInspectors)list.get(i);
- Map map = new HashMap();
- map.put("zrrid", o.getId());
- map.put("name", o.getName());
- // xh=i+1;
- // map.put("xh", xh);
- // System.out.println("测试四"+o.getName());
-
- JSONObject jSONObject = JSONObject.fromObject(map);
- jSONArray.add(jSONObject);
- }
-
- json.put("RESULT", jSONArray);
- }
-
- return json.toString();
- }
- @Override
- public String getEventProcessingExcelList(String queryJson) throws Exception {
- // TODO Auto-generated method stub
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- SimpleDateFormat formatter1 = new SimpleDateFormat("yyyy-MM-dd");
- String id = null;
- String dwjl_id = null;
- String sj_type = null;
- String y_complete_time = null;
- String V_LOGINNAME = null;
- String V_PASSWORD = null;
- String person_liable = null;
- String zp_remarks = null;
- String user_name = null;
- String data1 = null;
- String data2 = null;
- String data3 = null;
- String cl_type = null;
- String cl_time = null;
- String wx_name = null;
- String cl_time_k1 = null;
- String cl_time_j1 = null;
- String hehe = "1970-01-01 08:00:00";
-
- int xh = 0;
- String dwsb_remarks = null;
- String cl_time_k = null;
- String cl_time_j = null;
- String event_processing_id_list = null;
- String event_processing_id_list1 = null;
- String dwjl_id_list = null;
- String hehe00= "0000-00-00 00:00:00";
- String dqsj = formatter.format(new Date());
-
- String cl_sql=null;
- String cl_sql1=null;
- String dwjl_sql = null;
- String dwjl_sql1 = null;
- String hqlwhere = null;
- String clsj_sql = null;
- String zrr_sql = null;
- String zsl_hqlwhere = null;
- String jrrw_hqlwhere = null;
- String csrw_hqlwhere = null;
- String jrjj_hqlwhere = null;
- String dz_sql = null;
-
- String Page = null;
- String Start = null;
- JSONArray Sort = null;
- String Limit = 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", "getEventProcessingList");
- if(queryJson!=null) {
- q_json = JSONObject.fromObject(queryJson);
- id = q_json.has("id")?q_json.getString("id"):null;
-
- sj_type = q_json.has("sj_type")?q_json.getString("sj_type"):null;
- cl_type = q_json.has("cl_type")?q_json.getString("cl_type"):null;
- cl_time_k = q_json.has("cl_time_k")?q_json.getString("cl_time_k"):null;
- cl_time_j = q_json.has("cl_time_j")?q_json.getString("cl_time_j"):null;
- person_liable = q_json.has("person_liable")?q_json.getString("person_liable"):null;
- wx_name = q_json.has("wx_name")?q_json.getString("wx_name"):null;
-
-
- 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;
-
- order = q_json.has("order")?q_json.getString("order"):null;
- dir = q_json.has("dir")?q_json.getString("dir"):null;
- json.put("query", queryJson);
- }
-
-
- // System.out.println();
- hqlwhere = chkhw(hqlwhere) + "u.userName='"+V_LOGINNAME+"'";
- if(sj_type!=null && sj_type.length()>0&&Integer.parseInt(sj_type)!=0)
- hqlwhere = chkhw(hqlwhere) + "u.sjType = "+sj_type;
- if(person_liable!=null && person_liable.length()>0&&Integer.parseInt(person_liable)!=0)
- hqlwhere = chkhw(hqlwhere) + "u."+fieldname("person_liable")+" = "+person_liable;
- if(cl_type!=null && cl_type.length()>0&&Integer.parseInt(cl_type)!=0)
- hqlwhere = chkhw(hqlwhere) + "u."+fieldname("cl_type")+"="+cl_type;
- if(cl_time_k!=null && cl_time_k.length()>0) {
- cl_time_k1=cl_time_k+" 00:01:00";
- hqlwhere = chkhw(hqlwhere) + "u.clTime >='"+cl_time_k1+"'";
- }
-
- if(cl_time_j!=null && cl_time_j.length()>0) {
- cl_time_j1 = cl_time_j+" 23:59:00";
- hqlwhere = chkhw(hqlwhere) + "u.clTime <='"+cl_time_j1+"'";
- }
- if(wx_name!=null && wx_name.length()>0)
- hqlwhere = chkhw(hqlwhere) + "u.wxName like '%"+wx_name+"%'";
-
-
- // System.out.println(hqlwhere);
- // if(order!=null)
- // order_str = " order by u."+fieldname(order);
- // else
- // order_str = " order by u."+fieldname("id");
-
- int totalCount = ytiotXjEventProcessingDao.getCount(hqlwhere);
- json.put("totalCount", totalCount);
- if(totalCount>0) {
- List list = ytiotXjEventProcessingDao.query(hqlwhere, null, null, null, null);
- if(list.size()>0) {
- for(int i=0;i<list.size();i++) {
- YtiotXjEventProcessing o = (YtiotXjEventProcessing)list.get(i);
- Map map = new HashMap();
- xh=i+1;
- map.put("xh", xh);
- // map.put("id", o.getId());
- map.put("wx_name", o.getWxName());
- if(String.valueOf(o.getDwjlId())!=null) {
- dwjl_sql1 = " where u.id="+o.getDwjlId();
- List dwjl_list1 = ytiotXjSpotOperationRecordDao.query(dwjl_sql1, null, null, null, null);
- if(dwjl_list1.size()>0) {
- YtiotXjSpotOperationRecord dwjl_o1 = (YtiotXjSpotOperationRecord)dwjl_list1.get(0);
- // map.put("dwsb_remarks", dwjl_o1.getDwsbRemarks());
- if(String.valueOf(dwjl_o1.getSpotId())!=null) {
- dz_sql=" where u.id="+dwjl_o1.getSpotId();
- List dz_list = ytiotXjInspectionPointsDao.query(dz_sql, null, null, null, null);
- if( dz_list.size()>0) {
- YtiotXjInspectionPoints dz_o = (YtiotXjInspectionPoints)dz_list.get(0);
- map.put("spot_address", dz_o.getSpotAddress());
- }
-
- }
- }
- }
-
- if(o.getSjType()==1) {
- map.put("sj_type_name", "故障");
- }else if(o.getSjType()==2) {
- map.put("sj_type_name", "隐患");
- }else if(o.getSjType()==3) {
- map.put("sj_type_name", "其他");
- }else{
- map.put("sj_type_name", "--");
- }
-
- if(o.getYCompleteTime()!=null) {
- if(formatter.format(o.getYCompleteTime()).equals(hehe)||formatter.format(o.getYCompleteTime()).equals(hehe00)) {
- map.put("y_complete_time", "--");
- }else {
- map.put("y_complete_time", formatter.format(o.getYCompleteTime()));
- }
- }else {
- map.put("y_complete_time", "--");
- }
-
- // if(formatter.format(o.getYCompleteTime()).equals(hehe)) {
- // map.put("y_complete_time", "--");
- // }else {
- // map.put("y_complete_time", formatter.format(o.getYCompleteTime()));
- // }
-
- // if(formatter.format(o.getYCompleteTime()).equals(hehe)) {
- // map.put("cl_time", "--");
- // }else {
- // map.put("cl_time", formatter.format(o.getClTime()));
- // }
-
- // map.put("cl_time", formatter.format(o.getClTime()));
- if(o.getClType()==2) {
- map.put("clzt", "未审核");
- map.put("cl_time", "--");
- }else if(o.getClType()==3) {
- map.put("clzt", "审核未通过");
- map.put("cl_time", "--");
- }else if(o.getClType()==4) {
- map.put("cl_time", formatter.format(o.getClTime()));
- map.put("clzt", "已完成");
- }else if(o.getClType()==5) {
- map.put("cl_time", formatter.format(o.getClTime()));
- map.put("clzt", "超时完成 ");
- }else if(o.getClType()==1) {
- map.put("clzt", "未处理");
- map.put("cl_time", "--");
- }else if(o.getClType()==0) {
- map.put("clzt", "未处理");
- map.put("cl_time", "--");
- }
- if(o.getPersonLiable()!=null) {
- map.put("dqzt", "已指派");
- zrr_sql = " where u.id="+o.getPersonLiable();
- List zrr_list = ytiotXjInspectorsDao.query(zrr_sql, null, null, null, null);
- if(zrr_list .size()>0) {
- YtiotXjInspectors zrr_o = (YtiotXjInspectors)zrr_list.get(0);
- map.put("person_liable_name", zrr_o.getName());
- map.put("phone", zrr_o.getPhone());
- }
- }else {
- map.put("dqzt", "未指派");
- map.put("person_liable_name", "--");
- map.put("phone", "--");
- }
- JSONObject jSONObject = JSONObject.fromObject(map);
- jSONArray.add(jSONObject);
- }
-
- json.put("result", jSONArray);
- }
- }
- return json.toString();
- }
-
- }
|