Пример #1
0
  @Override
  protected JSONObject check(PAppDetail detail) {

    // 新增一个插件的版本
    if (null != detail.getpAppdetailApkactionid()) {
      //			AppDetail oldOne = dDao.getMaxVersionDetail(detail.getApp_apkactionid());
      PAppDetailDao pAppDetailDao = (PAppDetailDao) SpringContextUtil.getBean("pAppDetailDao");

      PAppDetail oldOne = pAppDetailDao.selectOneByActionId(detail.getpAppdetailApkactionid());

      if (null != oldOne) {
        if (detail.getpAppdetailVersion() <= oldOne.getpAppdetailVersion()) {
          return JSONUtil.checkResult(501, "必须高于已发布最新版本!");
        }

        if (!oldOne.getpAppdetailAdminid().equals(super.getAdminId())) {
          return JSONUtil.checkResult(503, "请勿非法操作!");
        }

        if (oldOne.getpAppdetailAuditstate().equals("5")) {
          return JSONUtil.checkResult(501, "插件已经被下线,无法上传新版本!");
        }
      }
    }
    return null;
  }
Пример #2
0
  @Override
  public void check(JSONObject json, ApkinformatonUtil util, PAppDetail detail) {
    if (null == detail.getpAppdetailId() && detail.getpAppdetailApkactionid() != null) {

      String version_check = "";
      String digest_check = "";
      String package_check = "";
      String name_check = "";

      PAppDetailDao pAppDetailDao = (PAppDetailDao) SpringContextUtil.getBean("pAppDetailDao");
      PAppDetail oldOne = pAppDetailDao.selectOneByActionId(detail.getpAppdetailApkactionid());

      if (oldOne != null) {
        if (Integer.parseInt(util.getVersionCode()) <= oldOne.getpAppdetailVersion()) {
          version_check = "必须高于已发布最新版本";
        }

        if (oldOne.getpAppdetailPackagename() != null
            && !oldOne.getpAppdetailPackagename().equals(util.getPackagename())) {
          package_check = "该版本包名与已发布版本不一致";
        }

        if (null == util.getAppname()) {
          name_check = "插件名称不存在";
        } else if (!util.getAppname().equals(oldOne.getpAppdetailName())) {
          name_check = "该版本名称与已发布版本不一致";
        }

        if (oldOne.getpAppdetailCertdigest() != null
            && !oldOne.getpAppdetailCertdigest().equals(util.getDigest())) {
          digest_check = "该版本数字签名与已发布版本不一致";
        }
      }

      json.getAppNode().setVersion_check(version_check);
      json.getAppNode().setPackage_check(package_check);
      json.getAppNode().setName_check(name_check);
      json.getAppNode().setDigest_check(digest_check);
    } else {
      if (next != null) {
        this.next.check(json, util, detail);
      }
    }
  }