コード例 #1
0
  /**
   * 保存/更新动态脆弱点
   *
   * @param paraMap 参数Map
   * @param dynaVulnPoint 动态脆弱点
   */
  public void saveOrUpdate(Map paraMap, AsseKnowDynaVuln dynaVulnPoint) {

    String assetCode = (String) paraMap.get("assetCode");
    AsseInfoAsse asseInfoAsse = assetDao.find(assetCode);
    dynaVulnPoint.setAsse(asseInfoAsse);
    dynaVulnPoint.setAsseInfoBusiId(asseInfoAsse.getAsseInfoBusiId());
    vulnAnalDao.saveOrUpdate(dynaVulnPoint);
  }
コード例 #2
0
  /**
   * 批量保存/更新动态脆弱点
   *
   * @param paraMaps 参数Map
   * @param asseInfoProj 测评项目
   */
  public void batchSaveOrUpdate(Map paraMaps, AsseInfoProj asseInfoProj) {

    List<AsseKnowDynaVuln> dynaVulnPoints = new ArrayList<AsseKnowDynaVuln>();
    String[] dynaVulnPoinIds = (String[]) paraMaps.get("dynaVulnPoinIds");
    String assetCode = (String) paraMaps.get("assetCode");
    AsseInfoAsse asseInfoAsse = assetDao.find(assetCode);
    for (int i = 0; i < dynaVulnPoinIds.length; i++) {
      AsseKnowDynaVuln dynaVulnPoint = vulnAnalDao.find(new Integer(dynaVulnPoinIds[i]));
      dynaVulnPoint.setAsseInfoProjId(asseInfoProj.getId());
      dynaVulnPoint.setAsse(asseInfoAsse);
      dynaVulnPoint.setAsseInfoBusiId(asseInfoAsse.getAsseInfoBusiId());
      dynaVulnPoints.add(dynaVulnPoint);
    }
    vulnAnalDao.batchSaveOrUpdate(dynaVulnPoints);
  }