@RequestMapping(params = "method=delete")
  @ResponseBody
  public JsonResult delete(HttpServletRequest request, String ids) {
    JsonResult result = new JsonResult();

    try {
      String[] array = ids.split(",");

      for (String id : array) {
        MobileAppConfig mobileAppConfig = mobileAppConfigService.get(id);

        if (mobileAppConfig != null) {
          String appCodeName = mobileAppConfig.getCodeName();

          mobileAppService.deleteMobileAppItemByAppCodeName(appCodeName);

          mobileAppConfigService.delete(id);
        }
      }

      result.setMessage(AbstractController.AJAX_SUCCESS_CODE);
    } catch (Exception e) {
      result.setMessage(null);
      log.error("delete MobileAppConfig exception reason:" + e.getMessage());
    }
    return result;
  }
  @SuppressWarnings("rawtypes")
  @RequestMapping(params = "method=getremoveandaddmobileappconfightmloptions")
  @ResponseBody
  public String getRemoveAndAddMobileAppConfigHtmlOptions(String id) {
    String result = "";

    MobileApp mobileApp = mobileAppService.get(id);

    String ownerUri = mobileApp.getOwnerUri();
    String listFileName = mobileApp.getListFileName();

    Map<String, Object> mobileAppConfigMap = mobileAppConfigService.getMobileAppConfigMap();

    Map<String, Object> mobileAppItemParams = new HashMap<String, Object>();
    mobileAppItemParams.put("ownerUri", ownerUri);
    mobileAppItemParams.put("listFileName", listFileName);
    List<MobileAppItem> mobileAppItems = mobileAppItemService.findForUnPage(mobileAppItemParams);

    String listboxAddOptions = "";
    if (mobileAppItems != null && mobileAppItems.size() > 0) {
      for (MobileAppItem mobileAppItem : mobileAppItems) {

        String description = "";
        if (mobileAppConfigMap.containsKey(mobileAppItem.getAppCodeName())) {
          description = mobileAppConfigMap.get(mobileAppItem.getAppCodeName()).toString();

          listboxAddOptions +=
              "<option value='" + mobileAppItem.getAppCodeName() + "'>" + description + "</option>";
        } else {
          mobileAppConfigMap.remove(mobileAppItem.getAppCodeName());
          continue;
        }

        mobileAppConfigMap.remove(mobileAppItem.getAppCodeName());
      }
    }

    String listboxRemoveOptions = "";
    for (Map.Entry entry : mobileAppConfigMap.entrySet()) {

      listboxRemoveOptions +=
          "<option value='" + entry.getKey() + "'>" + entry.getValue() + "</option>";
    }

    result = listboxAddOptions + "&" + listboxRemoveOptions;

    return result;
  }