多媒体中目录下的特殊用户修改或保存配置直接下发
This commit is contained in:
@@ -395,8 +395,6 @@ public class AvController extends BaseController {
|
||||
entity = avCfgService.getAvFileSampleById(Long.parseLong(id), null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
// String oldSrcUrl = entity.getSrcPath();
|
||||
// String oldSampleUrl = entity.getSamplePath();
|
||||
try {
|
||||
@@ -511,8 +509,7 @@ public class AvController extends BaseController {
|
||||
entity = avCfgService.getAvSignSampleById(Long.parseLong(id));
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
|
||||
try {
|
||||
avCfgService.audioAuditAvSignSample(entity, isAudit, false);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
|
||||
@@ -299,14 +299,13 @@ public class FileTransferCfgController extends BaseController {
|
||||
}
|
||||
fileTransferCfgService.saveOrUpdateFileDigestCfg(entity, result, areaCfgIds);
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
if (e instanceof MaatConvertException) {
|
||||
} catch (MaatConvertException e) {
|
||||
logger.error("文件摘要配置下发失败:",e);
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
|
||||
} else {
|
||||
} catch (Exception e) {
|
||||
logger.error("文件摘要配置保存失败:",e);
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath + "/ntc/fileTransfer/fileDigestList?functionId=" + entity.getFunctionId();
|
||||
}
|
||||
|
||||
@@ -343,10 +342,9 @@ public class FileTransferCfgController extends BaseController {
|
||||
HttpServletResponse response, HttpServletRequest request) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
String[] idArray = ids.split(",");
|
||||
Date auditTime = new Date();
|
||||
for (String id : idArray) {
|
||||
try {
|
||||
fileTransferCfgService.auditFileDigestCfg(isAudit, isValid, functionId, id, auditTime);
|
||||
fileTransferCfgService.auditFileDigestCfg(isAudit, isValid, functionId, id,Constants.INSERT_ACTION);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("File Digest配置下发失败", e);
|
||||
|
||||
@@ -87,6 +87,13 @@ public class AvCfgService extends BaseService{
|
||||
public void saveOrUpdateAvFileSample(AvFileSampleCfg entity,MultipartFile srcFile){
|
||||
//设置区域运营商信息
|
||||
setAreaEffectiveIds(entity);
|
||||
|
||||
int isAudit=0;
|
||||
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
|
||||
isAudit=1;
|
||||
}
|
||||
entity.setIsValid(0);
|
||||
entity.setIsAudit(0);
|
||||
if(entity.getCfgId()==null){
|
||||
entity.setCreatorId(UserUtils.getUser().getId());
|
||||
entity.setCreateTime(new Date());
|
||||
@@ -117,6 +124,11 @@ public class AvCfgService extends BaseService{
|
||||
}else{
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
if(isAudit==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditAvFileSample(entity, isAudit);
|
||||
}
|
||||
}else{
|
||||
AvFileSampleCfg oldEntity = this.getAvFileSampleById(entity.getCfgId(),entity.getCompileId());
|
||||
entity.setEditorId(UserUtils.getUser().getId());
|
||||
@@ -133,6 +145,17 @@ public class AvCfgService extends BaseService{
|
||||
}
|
||||
|
||||
avCfgDao.updateAvFileSample(entity);
|
||||
if(isAudit==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
if(StringUtil.isEmpty(entity.getSamplePath())){ // 没有更换上传文件使用旧的
|
||||
entity.setSrcUrl(oldEntity.getSrcUrl());
|
||||
entity.setSampleUrl(oldEntity.getSampleUrl());
|
||||
entity.setSampleMd5(oldEntity.getSampleMd5());
|
||||
entity.setSrcMd5(oldEntity.getSrcMd5());
|
||||
}
|
||||
auditAvFileSample(entity, isAudit);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
@@ -340,6 +363,8 @@ public class AvCfgService extends BaseService{
|
||||
|
||||
}
|
||||
public void auditAvFileSample(AvFileSampleCfg entity,Integer isAudit) throws MaatConvertException{
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
//修改数据库审核状态信息
|
||||
avCfgDao.auditAvFileSample(entity);
|
||||
List<AvFileSampleCfg> list = new ArrayList<AvFileSampleCfg>();
|
||||
@@ -383,6 +408,7 @@ public class AvCfgService extends BaseService{
|
||||
public void audioAuditAvSignSample(AvSignSampleCfg entity,Integer isAudit,boolean init) throws MaatConvertException{
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
|
||||
avCfgDao.auditAvSignSample(entity);
|
||||
List<AvSignSampleCfg> list = new ArrayList<AvSignSampleCfg>();
|
||||
if(isAudit==1){
|
||||
@@ -457,9 +483,21 @@ public class AvCfgService extends BaseService{
|
||||
List<AvSignSampleCfg> list = new ArrayList<AvSignSampleCfg>();
|
||||
entity.setEditTime(new Date());
|
||||
entity.setDescription("0");
|
||||
int isAudit=0;
|
||||
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
|
||||
isAudit=1;
|
||||
}
|
||||
entity.setIsValid(0);
|
||||
entity.setIsAudit(0);
|
||||
list.add(entity);
|
||||
try {
|
||||
avCfgDao.updateAvSignSampleValid(entity);
|
||||
if(isAudit==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
audioAuditAvSignSample(entity, isAudit,false);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -438,6 +438,10 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
//设置区域运营商信息
|
||||
setAreaEffectiveIds(entity);
|
||||
|
||||
int isValid=0;
|
||||
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
|
||||
isValid=1;
|
||||
}
|
||||
entity.setIsValid(0);
|
||||
entity.setIsAudit(0);
|
||||
|
||||
@@ -481,7 +485,11 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
areaIpCfgDao.saveAreaIpCfg(areaIpCfg);
|
||||
}
|
||||
}
|
||||
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditFileDigestCfg(entity.getIsAudit(), isValid,entity.getFunctionId(),entity.getCfgId()+"",Constants.INSERT_ACTION);
|
||||
}
|
||||
}else{
|
||||
|
||||
if(!StringUtil.isEmpty(entity.getCfdsLevel()) && entity.getCfdsLevel() > 0) {
|
||||
@@ -545,7 +553,11 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
areaIpCfgDao.deleteAreaIpCfgByCfgId(areaIpCfg);
|
||||
}
|
||||
}
|
||||
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditFileDigestCfg(entity.getIsAudit(), isValid,entity.getFunctionId(),entity.getCfgId()+"",Constants.UPDATE_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -577,8 +589,9 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
|
||||
}
|
||||
|
||||
public void auditFileDigestCfg(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime) throws MaatConvertException{
|
||||
public void auditFileDigestCfg(Integer isAudit,Integer isValid,Integer functionId,String id, Integer opAction) throws MaatConvertException{
|
||||
FileDigestCfg entity = new FileDigestCfg();
|
||||
Date auditTime = new Date();
|
||||
entity.setCfgId(Long.parseLong(id));
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
@@ -655,7 +668,7 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
maatBean.setAuditTime(auditTime);
|
||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||
maatBean.setOpAction(opAction);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("File Digest配置下发配置参数:"+json);
|
||||
|
||||
@@ -339,6 +339,8 @@ function sampleFileValidate(fileType,fileName){
|
||||
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
||||
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
||||
<input type="hidden" name="functionId" id="functionId" value="${_cfg.functionId}">
|
||||
<input type="hidden" name="isValid" value="${_cfg.isValid}">
|
||||
<input type="hidden" name="isAudit" value="${_cfg.isAudit}">
|
||||
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
|
||||
<input type="hidden" name="picPath" id="picPath" value="">
|
||||
<!-- 配置域类型 -->
|
||||
@@ -567,7 +569,23 @@ function sampleFileValidate(fileType,fileName){
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-md-offset-3 col-md-8">
|
||||
<button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
|
||||
<c:set var="auditPermission" value="false"></c:set>
|
||||
<!-- 拥有配置新增直接生效的功能权限 -->
|
||||
<shiro:hasPermission name="save:audit:permission">
|
||||
<c:set var="auditPermission" value="true"></c:set>
|
||||
</shiro:hasPermission>
|
||||
<c:choose>
|
||||
<c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
|
||||
<button id="audit" type="submit" class="btn green">
|
||||
<spring:message code="submit" />
|
||||
</button>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<button id="save" type="submit" class="btn green">
|
||||
<spring:message code="submit" />
|
||||
</button>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -66,6 +66,9 @@ $(function(){
|
||||
}
|
||||
|
||||
})
|
||||
$("#audit").click(function(){
|
||||
$("span").removeClass("label-success")
|
||||
})
|
||||
$("#cfgFrom").validate({
|
||||
errorPlacement: function(error,element){
|
||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||
@@ -151,7 +154,20 @@ $(function(){
|
||||
<input type="hidden" name="cfgs[${status.index }].isValidOld" value="${_cfg.isValid}">
|
||||
<input type="hidden" id="oldAction" name="cfgs[${status.index }].actionOld" value="${_cfg.action}">
|
||||
<input type="hidden" id="isValid" name="cfgs[${status.index }].isValid" value="1">
|
||||
<c:set var="auditPermission" value="false"></c:set>
|
||||
<!-- 拥有配置新增直接生效的功能权限 -->
|
||||
<shiro:hasPermission name="save:audit:permission">
|
||||
<c:set var="auditPermission" value="true"></c:set>
|
||||
</shiro:hasPermission>
|
||||
<c:choose>
|
||||
<c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
|
||||
<input type="hidden" id="isAudit" name="cfgs[${status.index }].isAudit" value="1">
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<input type="hidden" id="isAudit" name="cfgs[${status.index }].isAudit" value="0">
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
@@ -255,7 +271,23 @@ $(function(){
|
||||
<div class="row">
|
||||
<div class="col-md-offset-3 col-md-8">
|
||||
<shiro:hasPermission name="avSignSample:config">
|
||||
<button id="save" type="submit" class="btn green"><spring:message code="edit"/></button>
|
||||
<c:set var="auditPermission" value="false"></c:set>
|
||||
<!-- 拥有配置新增直接生效的功能权限 -->
|
||||
<shiro:hasPermission name="save:audit:permission">
|
||||
<c:set var="auditPermission" value="true"></c:set>
|
||||
</shiro:hasPermission>
|
||||
<c:choose>
|
||||
<c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
|
||||
<button id="audit" type="submit" class="btn green">
|
||||
<spring:message code="edit" />
|
||||
</button>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<button id="save" type="submit" class="btn green">
|
||||
<spring:message code="edit" />
|
||||
</button>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</shiro:hasPermission>
|
||||
<shiro:hasPermission name="avSignSample:confirm">
|
||||
<div class="btn-group">
|
||||
|
||||
@@ -178,6 +178,8 @@
|
||||
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
||||
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
||||
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
||||
<input type="hidden" name="isValid" value="${_cfg.isValid}">
|
||||
<input type="hidden" name="isAudit" value="${_cfg.isAudit}">
|
||||
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
|
||||
<input type="hidden" id="doLog" name="doLog" value="1">
|
||||
<!-- 配置域类型 -->
|
||||
@@ -268,7 +270,7 @@
|
||||
<select name="cfdsLevel" data-live-search="true" class="selectpicker form-control required">
|
||||
<option value="0" ><spring:message code="selected"/></option>
|
||||
<c:forEach items="${fns:getDictList('CONFIDENCE_INTERVAL')}" var="configdenceC">
|
||||
<option value="${configdenceC.itemCode}" <c:if test="${_cfg.cfdsLevel==configdenceC.itemCode || (_cfg.cfdsLevel==null && configdenceC.itemCode eq 90)}">selected</c:if>><spring:message code="${configdenceC.itemValue}"/></option>
|
||||
<option value="${configdenceC.itemCode}" <c:if test="${(_cfg.cfdsLevel>10?_cfg.cfdsLevel:_cfg.cfdsLevel*10)==configdenceC.itemCode || (_cfg.cfdsLevel==null && configdenceC.itemCode eq 90)}">selected</c:if>><spring:message code="${configdenceC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
@@ -353,9 +355,23 @@
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-md-offset-3 col-md-8">
|
||||
<c:set var="auditPermission" value="false"></c:set>
|
||||
<!-- 拥有配置新增直接生效的功能权限 -->
|
||||
<shiro:hasPermission name="save:audit:permission">
|
||||
<c:set var="auditPermission" value="true"></c:set>
|
||||
</shiro:hasPermission>
|
||||
<c:choose>
|
||||
<c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
|
||||
<button id="audit" type="submit" class="btn green">
|
||||
<spring:message code="submit" />
|
||||
</button>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<button id="save" type="submit" class="btn green">
|
||||
<spring:message code="submit" />
|
||||
</button>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<button id="cancel" type="button" class="btn default">
|
||||
<spring:message code="cancel" />
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user