@SuppressWarnings("unchecked") public Integer impCrjl(FppsWechat paramFppsWechat) { int i = 0; String str1 = paramFppsWechat.getDevid(); String str2 = paramFppsWechat.getOpentime(); String str3 = paramFppsWechat.getType(); Date date = null; if ((StringUtils.hasText(str2)) && (str2.length() == 14)) { SimpleDateFormat simpledateformat = new SimpleDateFormat("yyyyMMddHHmmss"); try { date = simpledateformat.parse(str2); } catch (ParseException localParseException) { localParseException.printStackTrace(); } } String s3 = paramFppsWechat.getCardno(); Date date1 = new Date(); Crjl crjl = new Crjl(); if (StringUtils.hasText(str1)) { FppsDevice fppsdevice = new FppsDevice(); fppsdevice.setDevMac(str1); List list = this.service.getDeviceByMac(fppsdevice); if (!list.isEmpty()) { Map map = (Map) list.get(0); String str4 = (String) map.get("dev_area_uuid"); String str5 = (String) map.get("dev_uuid"); String str6 = (String) map.get("dev_area_layercode"); crjl.setAreaUuid(str4); crjl.setDevUuid(str5); crjl.setAreaCode(str6); } } crjl.setCreateDate(date1); crjl.setCrjlMac(str1); crjl.setOpenType(StringUtils.hasText(str3) ? str3 : "C"); crjl.setCardNo((String) s3); crjl.setSlideDate(date); if (("00000000000000000000".equals(s3)) || ("V".equalsIgnoreCase(str3))) { i = this.fppsWechatDao.impCrjlB(crjl).intValue(); } else { i = this.fppsWechatDao.impCrjl(crjl).intValue(); } return Integer.valueOf(i); }
@SuppressWarnings("unchecked") public String getqxlb(FppsWechat fppswechat) { String s = fppswechat.getStrXml(); Map map = parseXML(s, null); String s1 = (String) map.get("SeqNo"); String s2 = (String) map.get("DevID"); fppswechat.setStrMap(map); List list = fppsWechatDao.getqxlb(fppswechat); HashMap hashmap = new HashMap(); hashmap.put("SeqNo", s1); Object obj = null; String s3 = "0"; String s5 = "多于一个门锁权限,请选择门锁"; if (list != null && list.size() > 0 && list.get(0) != null) { Object obj1 = new ArrayList(); for (int i = 0; i < list.size(); i++) if (list.get(i) != null) ((List) (obj1)).add(list.get(i)); if (((List) (obj1)).size() == 1) { Map map1 = (Map) ((List) (obj1)).get(0); String s7 = (String) map1.get("DevID"); FppsDevice fppsdevice1 = new FppsDevice(); HashMap hashmap2 = new HashMap(); hashmap2.put("mode", "1"); hashmap2.put("devGwUuid", s7); fppsdevice1.setStrMap(hashmap2); int l = service.proOpenDoor(fppsdevice1).intValue(); s5 = "命令已下发"; hashmap.put("ResultCode", s3); hashmap.put("ResultMessage", s5); return buildResponse(hashmap, null); } if (StringUtils.hasText(s2)) { boolean flag = false; int j = 0; do { if (j >= ((List) (obj1)).size()) break; Map map2 = (Map) ((List) (obj1)).get(j); String s8 = (String) map2.get("DevID"); if (s2.equals(s8)) { flag = true; break; } j++; } while (true); if (flag) { FppsDevice fppsdevice = new FppsDevice(); HashMap hashmap1 = new HashMap(); hashmap1.put("mode", "1"); hashmap1.put("devGwUuid", s2); fppsdevice.setStrMap(hashmap1); int k = service.proOpenDoor(fppsdevice).intValue(); s5 = "命令已下发"; hashmap.put("ResultCode", s3); hashmap.put("ResultMessage", s5); return buildResponse(hashmap, null); } else { s3 = "1"; s5 = "此用户无相应的开门权限"; hashmap.put("ResultCode", s3); hashmap.put("ResultMessage", s5); return buildResponse(hashmap, null); } } else { hashmap.put("ResultCode", s3); hashmap.put("ResultMessage", s5); obj1 = ViewData.getrows(((List) (obj1)), 3); return buildResponse(hashmap, ((List) (obj1))); } } else { String s4 = "1"; String s6 = "此用户无相应的开门权限"; hashmap.put("ResultCode", s4); hashmap.put("ResultMessage", s6); return buildResponse(hashmap, null); } }