Beispiel #1
0
  public static Map<String, Object> convertToMap(ExpBrwModel model, Boolean showDelBtn) {
    if (model == null) {
      return null;
    }

    Map<String, Object> map = new HashMap<String, Object>();

    map.put(ExpBrwConstant.JFN_ID, model.getId());

    map.put(ExpBrwConstant.JFN_REQ_BY, model.getReqBy());

    map.put(ExpBrwConstant.JFN_OBJECTIVE_TYPE, model.getObjectiveType());
    map.put(ExpBrwConstant.JFN_OBJECTIVE, model.getObjective());
    map.put(ExpBrwConstant.JFN_REASON, model.getReason());
    map.put(ExpBrwConstant.JFN_AV_REMARK, model.getAvRemark());
    map.put(ExpBrwConstant.JFN_NOTE, model.getNote());

    map.put(ExpBrwConstant.JFN_BUDGET_CC, model.getBudgetCc());

    map.put(ExpBrwConstant.JFN_FUND_ID, model.getFundId());

    map.put(ExpBrwConstant.JFN_COST_CONTROL_ID, model.getCostControlId());
    map.put(ExpBrwConstant.JFN_COST_CONTROL_TYPE_ID, model.getCostControlTypeId());

    map.put(ExpBrwConstant.JFN_DATE_BACK, model.getDateBack());

    map.put(ExpBrwConstant.JFN_BANK_TYPE, model.getBankType());
    map.put(ExpBrwConstant.JFN_BANK, model.getBank());

    map.put(ExpBrwConstant.JFN_TOTAL, model.getTotal());
    map.put(ExpBrwConstant.JFN_WORKFLOW_INS_ID, model.getWorkflowInsId());
    map.put(ExpBrwConstant.JFN_DOC_REF, model.getDocRef());
    map.put(ExpBrwConstant.JFN_FOLDER_REF, model.getFolderRef());
    map.put(ExpBrwConstant.JFN_WAITING_LEVEL, String.valueOf(model.getWaitingLevel()));
    map.put(ExpBrwConstant.JFN_STATUS, model.getStatus());
    map.put(ExpBrwConstant.JFN_WF_STATUS, model.getWfStatus());
    map.put(ExpBrwConstant.JFN_OVER_DUE, model.getOverDue());
    map.put(
        ExpBrwConstant.JFN_CREATED_TIME_SHOW,
        CommonDateTimeUtil.convertToGridDateTime(model.getCreatedTime()));
    map.put(ExpBrwConstant.JFN_CREATED_TIME, model.getCreatedTime());
    map.put(ExpBrwConstant.JFN_CREATED_BY, model.getCreatedBy());
    map.put(
        ExpBrwConstant.JFN_UPDATED_TIME,
        CommonDateTimeUtil.convertToGridDate(model.getUpdatedTime()));
    map.put(ExpBrwConstant.JFN_UPDATED_BY, model.getUpdatedBy());
    map.put(ExpBrwConstant.JFN_ACTION, getAction(model, showDelBtn));

    return map;
  }
Beispiel #2
0
  public static JSONObject convertToJSONObject(ExpBrwModel model, Boolean showDelBtn)
      throws Exception {
    if (model == null) {
      return null;
    }

    JSONObject jsObj = new JSONObject();

    jsObj.put(ExpBrwConstant.JFN_ID, model.getId());

    jsObj.put(ExpBrwConstant.JFN_REQ_BY, model.getReqBy());

    jsObj.put(ExpBrwConstant.JFN_OBJECTIVE_TYPE, model.getObjectiveType());
    jsObj.put(ExpBrwConstant.JFN_OBJECTIVE_TYPE_NAME, model.getObjectiveTypeName());
    jsObj.put(ExpBrwConstant.JFN_OBJECTIVE, model.getObjective());
    jsObj.put(ExpBrwConstant.JFN_AV_REMARK, model.getAvRemark());
    jsObj.put(ExpBrwConstant.JFN_REASON, model.getReason());
    jsObj.put(ExpBrwConstant.JFN_NOTE, model.getNote());

    jsObj.put(ExpBrwConstant.JFN_BUDGET_CC, model.getBudgetCc());
    jsObj.put(ExpBrwConstant.JFN_BUDGET_CC_NAME, model.getBudgetCcName());
    jsObj.put(ExpBrwConstant.JFN_BUDGET_CC_TYPE, model.getBudgetCcType());
    jsObj.put(ExpBrwConstant.JFN_BUDGET_CC_TYPE_NAME, model.getBudgetCcTypeName());

    jsObj.put(ExpBrwConstant.JFN_FUND_ID, model.getFundId());
    jsObj.put(ExpBrwConstant.JFN_FUND_NAME, model.getFundName());

    jsObj.put(ExpBrwConstant.JFN_COST_CONTROL_ID, model.getCostControlId());
    jsObj.put(ExpBrwConstant.JFN_COST_CONTROL_TYPE_ID, model.getCostControlTypeId());
    jsObj.put(ExpBrwConstant.JFN_COST_CONTROL_NAME, model.getCostControlName());
    jsObj.put(ExpBrwConstant.JFN_COST_CONTROL_TYPE_NAME, model.getCostControlTypeName());

    jsObj.put(
        ExpBrwConstant.JFN_DATE_BACK,
        CommonDateTimeUtil.convertToSenchaFieldDateTime(model.getDateBack()));

    jsObj.put(ExpBrwConstant.JFN_BANK_TYPE, model.getBankType());
    jsObj.put(ExpBrwConstant.JFN_BANK, model.getBank());

    jsObj.put(ExpBrwConstant.JFN_TOTAL, model.getTotal());
    jsObj.put(ExpBrwConstant.JFN_WORKFLOW_INS_ID, model.getWorkflowInsId());
    jsObj.put(ExpBrwConstant.JFN_DOC_REF, model.getDocRef());
    jsObj.put(ExpBrwConstant.JFN_FOLDER_REF, model.getFolderRef());
    jsObj.put(ExpBrwConstant.JFN_WAITING_LEVEL, String.valueOf(model.getWaitingLevel()));
    jsObj.put(ExpBrwConstant.JFN_STATUS, model.getStatus());
    jsObj.put(ExpBrwConstant.JFN_WF_STATUS, model.getWfStatus());
    jsObj.put(ExpBrwConstant.JFN_OVER_DUE, model.getOverDue());
    jsObj.put(
        ExpBrwConstant.JFN_CREATED_TIME_SHOW,
        CommonDateTimeUtil.convertToGridDateTime(model.getCreatedTime()));
    jsObj.put(
        ExpBrwConstant.JFN_CREATED_TIME,
        CommonDateTimeUtil.convertToSenchaFieldDateTime(model.getCreatedTime()));
    jsObj.put(ExpBrwConstant.JFN_CREATED_BY, model.getCreatedBy());
    jsObj.put(
        ExpBrwConstant.JFN_UPDATED_TIME,
        CommonDateTimeUtil.convertToGridDate(model.getUpdatedTime()));
    jsObj.put(ExpBrwConstant.JFN_UPDATED_BY, model.getUpdatedBy());
    jsObj.put(ExpBrwConstant.JFN_ACTION, getAction(model, showDelBtn));

    jsObj.put(
        ExpBrwConstant.JFN_REQUESTED_TIME_SHOW,
        CommonDateTimeUtil.convertToGridDateTime(model.getRequestedTime()));

    return jsObj;
  }