APP策略、文件摘要doLog CompileId

This commit is contained in:
zhangwenqing
2018-08-23 10:08:55 +08:00
parent 82664d2f21
commit 38d9da2693
10 changed files with 267 additions and 169 deletions

View File

@@ -248,6 +248,8 @@ public class FileTransferCfgController extends BaseController{
logger.info("获取文件摘要响应信息:"+result);
}
fileTransferCfgService.saveOrUpdateFileDigestCfg(entity,result,areaCfgIds);
} catch (MaatConvertException e) {
addMessage(redirectAttributes, e.getMessage());
} catch (IOException e) {
e.printStackTrace();
}

View File

@@ -300,7 +300,7 @@
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,
r.CFG_TYPE,r.CFG_REGION_CODE,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.USER_REGION1,r.USER_REGION2,
r.USER_REGION3,r.USER_REGION4,r.USER_REGION5,r.do_log
r.USER_REGION3,r.USER_REGION4,r.USER_REGION5,r.DO_LOG
</sql>
<sql id="AppIpCfg_Column" >

View File

@@ -121,6 +121,7 @@
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap>
<resultMap id="stringCfgMap" type="com.nis.domain.configuration.BaseStringCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
@@ -187,7 +188,7 @@
<sql id="DigestCfg_Column" >
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.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY,a.DO_LOG,
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,cfg_type,cfg_region_code
</sql>
<select id="getFtpList" resultMap="CfgIndexInfoMap" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
@@ -1225,6 +1226,9 @@
</if>
<if test="fileUrl != null and fileUrl != ''">
FILE_URL =#{fileUrl,jdbcType=VARCHAR},
</if>
<if test="doLog != null">
do_log =#{doLog,jdbcType=INTEGER},
</if>
</trim>
</set>

View File

@@ -581,7 +581,8 @@
function_id,
cfg_type,
cfg_region_code,
file_url
file_url,
do_log
)values (
#{cfgDesc,jdbcType=VARCHAR},
#{rawLen,jdbcType=BIGINT},
@@ -607,7 +608,8 @@
#{functionId,jdbcType=INTEGER},
#{cfgType,jdbcType=VARCHAR},
#{cfgRegionCode,jdbcType=INTEGER},
#{fileUrl,jdbcType=VARCHAR}
#{fileUrl,jdbcType=VARCHAR},
#{doLog,jdbcType=VARCHAR}
)
</insert>
<!-- 删除mail ip子配置 -->

View File

@@ -402,12 +402,16 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
}
entity.setCompileId(compileId);
entity.setCreatorId(entity.getCurrentUser().getId());
if(result!=null && result.getData()!=null){
entity.setRawLen(result.getData().getRawLen());
entity.setDigest(result.getData().getDigest());
Long rawLen = result.getData().getRawLen();
String digest = result.getData().getDigest();
if((result!=null && result.getData()!=null) && (rawLen != null && digest!= null)){
entity.setRawLen(rawLen);
entity.setDigest(digest);
entity.setFileUrl(result.getData().getAccessUrl());
}
}else {
logger.info("获取文件摘要属性有误");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+null);
}
mailCfgDao.saveMailFileDigestCfg(entity);
//保存区域IP信息
@@ -619,11 +623,16 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
// 设置区域运营商信息
setAreaEffectiveIds(entity);
if(entity.getCfgId()==null){
Integer compileId = 0;
try {
List<Integer> idList = ConfigServiceUtil.getId(1, 1);
if(idList!=null && idList.size()>0){
compileId = idList.get(0);
Integer compileId = 0;
try {
List<Integer> idList = ConfigServiceUtil.getId(1, 1);
if(idList!=null && idList.size()>0){
compileId = idList.get(0);
}
} catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
}
entity.setCompileId(compileId);
entity.setCreateTime(new Date());
@@ -674,11 +683,7 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
} catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
}
}else{
// 审核未通过状态的配置 修改后状态改为未审核