修改文件摘要配置,增加文件URL属性信息。

Signed-off-by: zhangwei <zhangwei@intranet.com>
This commit is contained in:
zhangwei
2018-06-29 16:32:42 +08:00
parent 8ab4fb9eba
commit 6220b1bdc9
8 changed files with 62 additions and 23 deletions

View File

@@ -29,6 +29,7 @@ public class FileDigestCfg extends BaseCfg<FileDigestCfg> {
private Long rawLen;
private String digest;
private Integer cfdsLevel;
private String fileUrl;
public static String getTablename() {
return tableName;
@@ -54,5 +55,11 @@ public class FileDigestCfg extends BaseCfg<FileDigestCfg> {
public void setCfdsLevel(Integer cfdsLevel) {
this.cfdsLevel = cfdsLevel;
}
public String getFileUrl() {
return fileUrl;
}
public void setFileUrl(String fileUrl) {
this.fileUrl = fileUrl;
}
}

View File

@@ -18,8 +18,9 @@ import net.sf.json.JsonConfig;
import org.glassfish.jersey.media.multipart.FormDataMultiPart;
import org.glassfish.jersey.media.multipart.file.FileDataBodyPart;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.jcraft.jsch.Logger;
import com.nis.domain.log.ReportResultLog;
import com.nis.domain.maat.ToMaatResult;
import com.nis.domain.maat.ToMaatResult.ResponseData;
@@ -27,6 +28,7 @@ import com.nis.exceptions.MaatConvertException;
import com.nis.util.httpclient.ClientUtil;
public class ConfigServiceUtil {
private static Logger logger = LoggerFactory.getLogger(ConfigServiceUtil.class);
/*public static class MapTypeAdapter extends TypeAdapter<Object> {
@Override
public Object read(JsonReader in) throws IOException {
@@ -285,6 +287,7 @@ public class ConfigServiceUtil {
Response response= header.post(Entity.entity(formDataMultiPart, formDataMultiPart.getMediaType()));
if( response.getStatus() == 200){
result= response.readEntity(String.class);
logger.info("获取文件摘要响应结果"+result);
JSONObject resObject = JSONObject.fromObject(result);
bean = (ToMaatResult) JSONObject.toBean(resObject,ToMaatResult.class);
}else{

View File

@@ -94,6 +94,7 @@
<result column="raw_len" property="rawLen" jdbcType="BIGINT" />
<result column="digest" property="digest" jdbcType="VARCHAR" />
<result column="cfgds_level" property="cfgdsLevel" jdbcType="INTEGER" />
<result column="file_url" property="fileUrl" jdbcType="VARCHAR" />
<result column="action" property="action" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
@@ -171,7 +172,7 @@
a.expr_type,a.match_method,a.is_hexbin,a.area_effective_ids,a.function_id,a.cfg_region_code
</sql>
<sql id="DigestCfg_Column" >
a.CFG_ID,a.CFG_DESC,a.raw_len,a.digest,a.cfds_level,a.ACTION,a.IS_VALID,a.IS_AUDIT,
a.CFG_ID,a.CFG_DESC,a.raw_len,a.digest,a.cfds_level,a.file_url,a.ACTION,a.IS_VALID,a.IS_AUDIT,
a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME,
a.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY,
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,cfg_type,cfg_region_code
@@ -584,6 +585,7 @@
RAW_LEN,
DIGEST,
CFDS_LEVEL,
FILE_URL,
ACTION,
IS_VALID,
IS_AUDIT,
@@ -609,6 +611,7 @@
#{rawLen,jdbcType=BIGINT},
#{digest,jdbcType=VARCHAR},
#{cfdsLevel,jdbcType=INTEGER},
#{fileUrl,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER},
0,
0,
@@ -812,6 +815,9 @@
</if>
<if test="cfgType != null and cfgType != ''">
CFG_TYPE =#{cfgType,jdbcType=VARCHAR},
</if>
<if test="fileUrl != null and fileUrl != ''">
FILE_URL =#{fileUrl,jdbcType=VARCHAR},
</if>
</trim>
</set>

View File

@@ -94,6 +94,7 @@
<result column="raw_len" property="rawLen" jdbcType="BIGINT" />
<result column="digest" property="digest" jdbcType="VARCHAR" />
<result column="cfgds_level" property="cfgdsLevel" jdbcType="INTEGER" />
<result column="file_url" property="fileUrl" jdbcType="VARCHAR" />
<result column="action" property="action" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
@@ -136,7 +137,7 @@
a.expr_type,a.match_method,a.is_hexbin,a.area_effective_ids,a.function_id,a.cfg_region_code
</sql>
<sql id="DigestCfg_Column" >
a.CFG_ID,a.CFG_DESC,a.raw_len,a.digest,a.cfds_level,a.ACTION,a.IS_VALID,a.IS_AUDIT,
a.CFG_ID,a.CFG_DESC,a.raw_len,a.digest,a.cfds_level,a.file_url,a.ACTION,a.IS_VALID,a.IS_AUDIT,
a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME,
a.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY,
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,cfg_type,cfg_region_code
@@ -579,7 +580,8 @@
AREA_EFFECTIVE_IDS,
function_id,
cfg_type,
cfg_region_code
cfg_region_code,
file_url
)values (
#{cfgDesc,jdbcType=VARCHAR},
#{rawLen,jdbcType=BIGINT},
@@ -604,7 +606,8 @@
#{areaEffectiveIds,jdbcType=VARCHAR},
#{functionId,jdbcType=INTEGER},
#{cfgType,jdbcType=VARCHAR},
#{cfgRegionCode,jdbcType=INTEGER}
#{cfgRegionCode,jdbcType=INTEGER},
#{fileUrl,jdbcType=VARCHAR}
)
</insert>
<!-- 删除mail ip子配置 -->

View File

@@ -345,6 +345,7 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
if(result!=null && result.getData()!=null){
entity.setRawLen(result.getData().getRawLen());
entity.setDigest(result.getData().getDigest());
entity.setFileUrl(result.getData().getAccessUrl());
}
mailCfgDao.saveMailFileDigestCfg(entity);
@@ -364,6 +365,7 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
if(result!=null && result.getData()!=null){
entity.setRawLen(result.getData().getRawLen());
entity.setDigest(result.getData().getDigest());
entity.setFileUrl(result.getData().getAccessUrl());
}
fileTransferCfgDao.updateFileDigestCfg(entity);

View File

@@ -113,6 +113,7 @@ public class MailCfgService extends CrudService<MailCfgDao,CfgIndexInfo> {
if(result!=null && result.getData()!=null){
cfg.setRawLen(result.getData().getRawLen());
cfg.setDigest(result.getData().getDigest());
cfg.setFileUrl(result.getData().getAccessUrl());
}
mailCfgDao.saveMailFileDigestCfg(cfg);
}
@@ -166,6 +167,7 @@ public class MailCfgService extends CrudService<MailCfgDao,CfgIndexInfo> {
if(result!=null && result.getData()!=null){
cfg.setRawLen(result.getData().getRawLen());
cfg.setDigest(result.getData().getDigest());
cfg.setFileUrl(result.getData().getAccessUrl());
}
mailCfgDao.saveMailFileDigestCfg(cfg);
}