|
@@ -3847,3 +3847,101 @@ public class YtiotVAlarmServiceImpl implements YtiotVAlarmService {
|
|
|
if((V_LOGINNAME!=null)&&(V_PASSWORD!=null)) {
|
|
|
List list = ytiotTAdminDao.query(" where MD5(u.VLoginname)='"+MD5Util.EncoderByMd5(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());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(E_STATUS==1) {
|
|
|
+ if((clwb!=null)&&(clnr!=null)&&(id!=null)&&(ncmd!=null)&&(device_code!=null)&&(name!=null)&&(confirmAll!=null)) {
|
|
|
+
|
|
|
+ String sqlwhere=null;
|
|
|
+ String hqlwhere=null;
|
|
|
+ //是否离线状态 and 批量
|
|
|
+
|
|
|
+ if(Integer.parseInt(confirmAll)==1) {
|
|
|
+ if (Integer.parseInt(ncmd) == 0) {
|
|
|
+ //离线
|
|
|
+ hqlwhere = " where u.id.deviceCode='"+device_code+"' and u.id.name='"+name+"' and u.id.ncmd='"+ncmd+"' and clzt='0' ";
|
|
|
+ //根据设备编号 状态 名称 进行批量修改
|
|
|
+ sqlwhere = " where device_code='"+device_code+"' and name='"+name+"' and ncmd='"+ncmd+"' and clzt='0' ";
|
|
|
+ System.out.println("hqlwhere==="+hqlwhere);
|
|
|
+ System.out.println("sqlwhere===="+sqlwhere);
|
|
|
+ }else {
|
|
|
+ //在线
|
|
|
+
|
|
|
+ hqlwhere = " where u.id.deviceCode='"+device_code+"' and u.id.name='"+name+"' and u.id.ncmd<>'0' and clzt='0' ";
|
|
|
+ //根据设备编号 状态 名称 进行批量修改
|
|
|
+ sqlwhere = " where device_code='"+device_code+"' and name='"+name+"' and ncmd<> '0' and clzt='0' ";
|
|
|
+ System.out.println("hqlwhere222==="+hqlwhere);
|
|
|
+ System.out.println("sqlwhere222===="+sqlwhere);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ hqlwhere = " where u.id.id="+id+" ";
|
|
|
+ sqlwhere = " where id="+id+" ";
|
|
|
+ }
|
|
|
+ int RowCount = ytiotVAlarmDao.getLiftCount(hqlwhere);
|
|
|
+// System.out.println(sqlwhere);
|
|
|
+ if(RowCount>0) {
|
|
|
+ ytiotVAlarmDao.execSQL(" update ytiot_v_lift2 set clwb='"+clwb+"', clnr='"+clnr+"', clzt=1 , clsj=now(), clr='"+V_LOGINNAME+"' "+sqlwhere);
|
|
|
+ json.put("activerow", RowCount);
|
|
|
+ json.put("success", "true");
|
|
|
+ }else {
|
|
|
+ json.put("success", "false");
|
|
|
+ json.put("MSG", "参数传递错误,请联系系统管理员。");
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ json.put("success", "false");
|
|
|
+ json.put("MSG", "参数传递错误,请联系系统管理员。");
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ json.put("success", "false");
|
|
|
+ json.put("MSG", "用户权限错误,请重新登录后再试。");
|
|
|
+ }
|
|
|
+ return json.toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String updateIndexAlarm(String queryJson) throws Exception {
|
|
|
+ // TODO Auto-generated method stub
|
|
|
+ String V_LOGINNAME = null;
|
|
|
+ String V_PASSWORD = null;
|
|
|
+ int E_STATUS=-1;
|
|
|
+ String clwb = null;
|
|
|
+ String clnr = null;
|
|
|
+ String id = null;
|
|
|
+ String data5 = null;
|
|
|
+ String dwtype = null;
|
|
|
+ String device_code = null;
|
|
|
+ String name = null;
|
|
|
+ String confirmAll = null;
|
|
|
+ String data4 = null;
|
|
|
+ String data2 = null;
|
|
|
+ String sql = null;
|
|
|
+ List list1 = null;
|
|
|
+ JSONObject q_json = null;
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("action", "updateHj");
|
|
|
+ if(queryJson!=null) {
|
|
|
+ q_json = JSONObject.fromObject(queryJson);
|
|
|
+ clwb = q_json.has("clwb")?q_json.getString("clwb"):null;
|
|
|
+ clnr = q_json.has("clnr")?q_json.getString("clnr"):null;
|
|
|
+ id = q_json.has("id")?q_json.getString("id"):null;
|
|
|
+ data5 = q_json.has("data5")?q_json.getString("data5"):null;
|
|
|
+ dwtype = q_json.has("dwtype")?q_json.getString("dwtype"):null;
|
|
|
+ device_code = q_json.has("device_code")?q_json.getString("device_code"):null;
|
|
|
+ name = q_json.has("name")?q_json.getString("name"):null;
|
|
|
+ confirmAll = q_json.has("confirmAll")?q_json.getString("confirmAll"):null;
|
|
|
+ data4 = q_json.has("data4")?q_json.getString("data4"):null;
|
|
|
+ data2 = q_json.has("data2")?q_json.getString("data2"):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;
|
|
|
+ }
|
|
|
+ if((V_LOGINNAME!=null)&&(V_PASSWORD!=null)) {
|
|
|
+ List list = ytiotTAdminDao.query(" where MD5(u.VLoginname)='"+MD5Util.EncoderByMd5(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());
|
|
|
+ }
|
|
|
+ }
|