Ejemplo n.º 1
0
 // http://super.lvmama.com/clutter/ck/addDevice.do?deviceCode=&deviceName=&memo=
 @Action("/ck/addDevice")
 public void addDevice() throws UnsupportedEncodingException {
   CkDeviceInfo cd = new CkDeviceInfo();
   cd.setCkDeviceCode(deviceCode);
   String name = new String(deviceName.getBytes("ISO-8859-1"), "UTF-8");
   cd.setCkDeviceName(name);
   cd.setMemo(memo);
   deviceService.addDevice(cd);
   sendAjaxMsg("success");
 }
Ejemplo n.º 2
0
 // http://super.lvmama.com/clutter/ck/queryDevice.do?ckId=29&deviceCode=&deviceName=&start=&end=
 @Action("/ck/queryDevice")
 public void queryDevice() throws UnsupportedEncodingException {
   String name = null;
   if (deviceName != null) {
     name = new String(deviceName.getBytes("ISO-8859-1"), "UTF-8");
   }
   Map<String, Object> parameterObject = new HashMap<String, Object>();
   parameterObject.put("ckDeviceCode", deviceCode);
   parameterObject.put("ckDeviceName", name);
   parameterObject.put("start", start != null ? start : 0);
   parameterObject.put("end", end != null ? end : 100);
   List<CkDeviceInfo> cd = deviceService.selectDeviceByParams(parameterObject);
   StringBuffer str = new StringBuffer();
   if (cd != null) {
     for (CkDeviceInfo device : cd) {
       str.append(device.toString()).append("<br/>");
     }
   }
   sendAjaxMsg(str.toString());
 }