Ejemplo n.º 1
0
  /**
   * 转换Map 处理记录
   *
   * @param list
   * @param totalCountDay
   * @param pageIndex
   * @return
   */
  public Map<String, Object> getOperatedPagination(
      List<AlarmEntity> list, int totalCount, String pageIndex, String rpNum) {
    List<Object> mapList = new ArrayList<Object>();
    Map<String, Object> mapData = new HashMap<String, Object>();
    for (int i = 0; i < list.size(); i++) {
      AlarmEntity alarm = list.get(i);
      Map<String, Object> cellMap = new LinkedHashMap<String, Object>();
      cellMap.put("id", alarm.getAlarm_id());
      cellMap.put(
          "cell",
          new Object[] {
            alarm.getAlarm_id(),
            alarm.getVehicle_code(),
            alarm.getVehicle_ln(),
            alarm.getDriver_name(),
            alarm.getDriver_tel(),
            alarm.getEffect_time(),
            alarm.getAlarm_time(),
            alarm.getAlarm_end_time(),
            alarm.getUse_time(),
            alarm.getMileage(),
            alarm.getOperate_type(),
            alarm.getOpeerate_desc(),
            alarm.getUser_name(),
            alarm.getConfirm_time(),
            alarm.getAlarm_id()
          });
      mapList.add(cellMap);
    }
    mapData.put("page", pageIndex); // 从前台获取当前第page页
    mapData.put("total", totalCount); // 从数据库获取总记录数
    mapData.put("rows", mapList);

    return mapData;
  }
Ejemplo n.º 2
0
  /** 处理记录导出 */
  public String exportOperatedList() {
    List<AlarmEntity> exportlist;
    UserInfo user = getCurrentUser();

    if (searchVO.getOrganization_id() == null || "".equals(searchVO.getOrganization_id())) {
      searchVO.setOrganization_id(user.getOrganizationID());
    }
    try {
      searchVO.setOperate_state("1"); // 已处理
      exportlist = this.service.getObjects("VehicleCheckManage.getVehicleCheckList", searchVO);
      for (AlarmEntity obj : exportlist) {
        // 处理类型
        if (Constants.VECHICLE_ILLEAGAL_USE.equals(obj.getOperate_type())) {
          obj.setOperate_type("公车私用");
        } else {
          obj.setOperate_type("正常使用");
        }
      }
    } catch (BusinessException e) {
      log.error("Export error:" + e.getMessage(), e);
      return ERROR;
    }
    String title = "异常用车处理记录";
    return exportList(title, "operatedExport", exportlist);
  }