Пример #1
0
 public void ProcessTableTList(List<TableT> list) {
   rows.clear();
   for (Iterator it = list.iterator(); it.hasNext(); ) {
     TableT tt = (TableT) it.next();
     // if("0".equals(tt.get))
     if ("0".equals(tt.getTablestate())) {
       tt.setTablestate("<div style='background:green;height:10px'>空</div>");
     } else {
       tt.setTablestate("<div style='background:red;height:10px'>使用中</div>");
     }
     Map<String, Object> cellMap = new HashMap<String, Object>();
     cellMap.put("id", tt.getTableid());
     cellMap.put(
         "cell",
         new Object[] {
           tt.getTableNumber(),
           tt.getRoomName(),
           tt.getFloor(),
           tt.getTablestate(),
           BaseTools.formateDbDate(tt.getCreatetime()),
           tt.getCreatorid(),
           tt.getNop(),
           tt.getRnop(),
           tt.getNote(),
           tt.getAndroidDevicesCount()
         });
     rows.add(cellMap);
   }
 }
Пример #2
0
  /**
   * 更新餐桌
   *
   * @return
   */
  @Action(
      value = "updateTableT",
      results = {@Result(name = "json", type = "json")})
  public String updateTableT() {
    if (Validate.StrisNull(this.getTableid())
        && Validate.StrisNull(this.getTableNumber())
        && Validate.StrisNull(this.getRoomName())) {
      this.setSucflag(false);
      return "json";
    }
    if (this.getTableTService().findTableBytableid(this.getTableid()) != null) {
      TableT tt = new TableT();
      tt.setTableid(this.getTableid());
      tt.setTableNumber(this.getTableNumber());
      tt.setRoomName(this.getRoomName());
      tt.setFloor(this.getFloor());
      tt.setNop(this.getNop());
      tt.setNote(this.getNote());
      tt.setCreatetime(BaseTools.systemtime());
      tt.setCreatorid(BaseTools.adminCreateId());
      tt.setTablestate(this.getTablestate());

      this.getTableTService().updateTableT(tt);
      this.setSucflag(true);
      return "json";
    } else {
      this.setSucflag(false);
      return "json";
    }
  }
Пример #3
0
  /** 增加餐桌 */
  @Action(
      value = "addTableT",
      results = {@Result(name = "json", type = "json")})
  public String addTableT() {

    if (Validate.StrisNull(this.getTableNumber()) && Validate.StrisNull(this.getRoomName())) {
      this.setSucflag(false);
      return "json";
    }
    TableT tt = new TableT();
    tt.setTableid(this.getSerial().Serialid(Serial.ELECTABLE));
    tt.setTableNumber(this.getTableNumber().trim());
    tt.setRoomName(this.getRoomName().trim());
    tt.setFloor(this.getFloor());
    tt.setNop(this.getNop());
    tt.setCreatetime(BaseTools.systemtime());
    tt.setCreatorid(BaseTools.adminCreateId());
    tt.setTablestate("0");

    if (this.getTableTService().addTableT(tt) > 0) {
      this.setSucflag(true);
      return "json";
    } else {
      this.setSucflag(false);
      return "json";
    }
  }