1、配置操作tag增加修改操作;2、音视频文件样例配置列表、表单界面、新增、修改功能涉及到functionService与functionRegion字典使用部分提交。
This commit is contained in:
@@ -17,6 +17,8 @@ import org.springframework.web.bind.WebDataBinder;
|
||||
import org.springframework.web.bind.annotation.InitBinder;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.ServiceConfigInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.basics.SysDictInfo;
|
||||
@@ -28,9 +30,10 @@ import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.NumBoundaryCfg;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.main.ConvertTool;
|
||||
//import com.nis.main.ConvertTool;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtils;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.JsonMapper;
|
||||
import com.nis.web.service.ArchiveServcie;
|
||||
import com.nis.web.service.AreaService;
|
||||
@@ -44,6 +47,7 @@ import com.nis.web.service.UserService;
|
||||
import com.nis.web.service.basics.ServiceDictInfoService;
|
||||
import com.nis.web.service.basics.SysDictInfoService;
|
||||
import com.nis.web.service.configuration.AppCfgService;
|
||||
import com.nis.web.service.configuration.AvCfgService;
|
||||
import com.nis.web.service.configuration.ComplexStringCfgService;
|
||||
import com.nis.web.service.configuration.DnsIpCfgService;
|
||||
import com.nis.web.service.configuration.FtpCfgService;
|
||||
@@ -140,6 +144,8 @@ public class BaseController {
|
||||
protected SpecificServiceCfgService specificServiceCfgService;
|
||||
@Autowired
|
||||
protected SpecificServiceHostCfgService specificServiceHostCfgService;
|
||||
@Autowired
|
||||
protected AvCfgService avCfgService;
|
||||
/**
|
||||
* 管理基础路径
|
||||
*/
|
||||
@@ -272,6 +278,32 @@ public class BaseController {
|
||||
areaIpCfg.initDefaultValue();
|
||||
model.addAttribute("_areaCfg", areaIpCfg);
|
||||
}
|
||||
protected void initFormCondition(Model model,BaseCfg cfg){
|
||||
List<RequestInfo> requestInfos=requestInfoService.getValidRequestInfo();
|
||||
model.addAttribute("requestInfos", requestInfos);
|
||||
List<ServiceDictInfo> fls=serviceDictInfoService.findFlDict();
|
||||
model.addAttribute("fls", fls);
|
||||
List<ServiceDictInfo> xzs=serviceDictInfoService.findXzDict();
|
||||
model.addAttribute("xzs", xzs);
|
||||
List<ServiceDictInfo> lables=serviceDictInfoService.findLableDict();
|
||||
model.addAttribute("lables", lables);
|
||||
List<Integer> itTypeList=new ArrayList<Integer>();
|
||||
itTypeList.add(Constants.ITEM_TYPE_AREA);
|
||||
List<SysDictInfo> areas = sysDictInfoService.findAllSysDictInfo(new SysDictInfo(),itTypeList,null);
|
||||
model.addAttribute("areas", areas);
|
||||
itTypeList.clear();
|
||||
itTypeList.add(Constants.ITEM_TYPE_ISP);
|
||||
List<SysDictInfo> isps = sysDictInfoService.findAllSysDictInfo(new SysDictInfo(),itTypeList,null);
|
||||
model.addAttribute("isps", isps);
|
||||
//初始化一个默认的地域ip给界面
|
||||
AreaIpCfg areaIpCfg=new AreaIpCfg();
|
||||
areaIpCfg.initDefaultValue();
|
||||
model.addAttribute("_areaCfg", areaIpCfg);
|
||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(cfg.getFunctionId());
|
||||
model.addAttribute("regionList", regionList);
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(cfg.getFunctionId());
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
}
|
||||
protected void initUpdateFormCondition(Model model,BaseCfg cfg){
|
||||
//查询配置对应的地域ip
|
||||
List<AreaIpCfg> areaCfgs=ipCfgService.getAreaCfgByCompileId(cfg.getCompileId());
|
||||
@@ -319,6 +351,10 @@ public class BaseController {
|
||||
itTypeList.add(Constants.ITEM_TYPE_ISP);
|
||||
List<SysDictInfo> isps = sysDictInfoService.findAllSysDictInfo(new SysDictInfo(),itTypeList,null);
|
||||
model.addAttribute("isps", isps);
|
||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(cfg.getFunctionId());
|
||||
model.addAttribute("regionList", regionList);
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(cfg.getFunctionId());
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
}
|
||||
protected void setSaveOrUpdateProps(Model model,BaseCfg cfg,String areaCfgIds) throws Exception{
|
||||
String tableName=cfg.getTableName();
|
||||
@@ -363,7 +399,7 @@ public class BaseController {
|
||||
}
|
||||
}
|
||||
if(cfg.getCompileId()==null){
|
||||
int compileId=new ConvertTool().getCompileId().intValue();
|
||||
int compileId=0;
|
||||
cfg.setCompileId(compileId);
|
||||
}
|
||||
Date date=new Date();
|
||||
|
||||
@@ -5,8 +5,16 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.AppIdCfg;
|
||||
import com.nis.domain.configuration.AvFileSampleCfg;
|
||||
import com.nis.domain.configuration.AvSignSampleCfg;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
/**
|
||||
* 处理音视频业务
|
||||
* @author zhangwei
|
||||
@@ -14,36 +22,55 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/ntc/av")
|
||||
public class AvController {
|
||||
public class AvController extends BaseController {
|
||||
|
||||
//音频样例配置列表
|
||||
@RequestMapping(value = {"/sample/audioList"})
|
||||
public String audioList(Model model,HttpServletRequest request,HttpServletResponse response){
|
||||
|
||||
return "/cfg/av/sample/audioList";
|
||||
//音视频文件样例配置列表
|
||||
@RequestMapping(value = {"/sample/fileSampleList"})
|
||||
public String fileSampleList(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")AvFileSampleCfg entity){
|
||||
Page<AvFileSampleCfg> page = avCfgService.getAvFileSampleList(new Page<AvFileSampleCfg>(request, response), entity);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model);
|
||||
return "/cfg/av/fileSampleList";
|
||||
}
|
||||
//视频样例配置列表
|
||||
@RequestMapping(value = {"/sample/vedioList"})
|
||||
public String vedioList(Model model,HttpServletRequest request,HttpServletResponse response){
|
||||
|
||||
return "/cfg/av/sample/vedioList";
|
||||
//音视频标志样例配置列表
|
||||
@RequestMapping(value = {"/sample/signSampleList"})
|
||||
public String signSampleList(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")AvSignSampleCfg entity){
|
||||
Page<AvSignSampleCfg> page = avCfgService.getAvSignSampleList(new Page<AvSignSampleCfg>(request, response), entity);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model);
|
||||
return "/cfg/av/signSampleList";
|
||||
}
|
||||
//图片样例配置列表
|
||||
@RequestMapping(value = {"/sample/pictureList"})
|
||||
public String pictureList(Model model,HttpServletRequest request,HttpServletResponse response){
|
||||
//文件样例配置界面
|
||||
@RequestMapping(value = {"/sample/fileSampleForm"})
|
||||
public String fileSampleForm(Model model,HttpServletRequest request,HttpServletResponse response,String ids,AvFileSampleCfg entity){
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
entity = avCfgService.getAvFileSampleById(Long.parseLong(ids));
|
||||
}
|
||||
|
||||
return "/cfg/av/sample/pictureList";
|
||||
initFormCondition(model,entity);
|
||||
model.addAttribute("_cfg", entity);
|
||||
return "/cfg/av/fileSampleForm";
|
||||
}
|
||||
//voip样例配置列表
|
||||
@RequestMapping(value = {"/sample/voipList"})
|
||||
public String voipList(Model model,HttpServletRequest request,HttpServletResponse response){
|
||||
|
||||
return "/cfg/av/sample/voipList";
|
||||
//标志样例配置界面
|
||||
@RequestMapping(value = {"/sample/signSampleForm"})
|
||||
public String signSampleForm(Model model,HttpServletRequest request,HttpServletResponse response,String ids,AvSignSampleCfg entity){
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
entity = avCfgService.getAvSignSampleById(Long.parseLong(ids));
|
||||
}
|
||||
initFormCondition(model,entity);
|
||||
model.addAttribute("_cfg", entity);
|
||||
return "/cfg/av/signSampleForm";
|
||||
}
|
||||
//色情场景样例配置列表
|
||||
@RequestMapping(value = {"/sample/pornList"})
|
||||
public String pornList(Model model,HttpServletRequest request,HttpServletResponse response){
|
||||
|
||||
return "/cfg/av/sample/pornList";
|
||||
//保存文件样例配置
|
||||
@RequestMapping(value = {"/sample/saveFileSample"})
|
||||
public String saveFileSample(Model model,HttpServletRequest request,HttpServletResponse response,String ids,AvFileSampleCfg entity){
|
||||
avCfgService.saveOrUpdateAvFileSample(entity);
|
||||
return "redirect:" + adminPath +"/ntc/av/sample/fileSampleList?functionId="+entity.getFunctionId();
|
||||
}
|
||||
//保存标志样例配置
|
||||
@RequestMapping(value = {"/sample/saveSignSample"})
|
||||
public String saveSignSample(Model model,HttpServletRequest request,HttpServletResponse response,String ids,AvSignSampleCfg entity){
|
||||
avCfgService.saveOrUpdateAvSignSample(entity);
|
||||
return "redirect:" + adminPath +"/ntc/av/sample/signSampleList?functionId="+entity.getFunctionId();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,5 +6,5 @@ import com.nis.domain.FunctionRegionDict;
|
||||
|
||||
@MyBatisDao
|
||||
public interface FunctionRegionDictDao {
|
||||
List<FunctionRegionDict> getListByFunctionId(Integer functionId);
|
||||
List<FunctionRegionDict> getList(FunctionRegionDict entity);
|
||||
}
|
||||
|
||||
@@ -4,22 +4,29 @@
|
||||
<resultMap id="BaseResultMap" type="com.nis.domain.FunctionRegionDict" >
|
||||
<id column="dict_id" property="dictId" jdbcType="INTEGER" />
|
||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||
<result column="config_region" property="configRegion" jdbcType="VARCHAR" />
|
||||
<result column="config_region_value" property="configRegionValue" jdbcType="VARCHAR" />
|
||||
<result column="config_region_code" property="configRegionCode" jdbcType="INTEGER" />
|
||||
<result column="config_district" property="configDistrict" jdbcType="VARCHAR" />
|
||||
<result column="config_desc" property="configDesc" jdbcType="VARCHAR" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List" >
|
||||
dict_id, function_id, config_region, config_district, config_desc, is_valid
|
||||
dict_id, function_id, config_region_value,config_region_code, config_district, config_desc, is_valid
|
||||
</sql>
|
||||
<select id="getListByFunctionId" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
||||
<select id="getList" resultMap="BaseResultMap" >
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from function_region_dict
|
||||
where function_id = #{functionId,jdbcType=INTEGER} and is_valid=1
|
||||
<if test="configRegion != null and configRegion!=''">
|
||||
AND config_district=#{configRegion,jdbcType=VARCHAR}
|
||||
where is_valid=1
|
||||
<if test="functionId != null">
|
||||
AND function_id = #{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="configRegionValue != null and configRegionValue!=''">
|
||||
AND config_region_value=#{configRegionValue,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="configRegionCode != null">
|
||||
AND config_region_code=#{configRegionCode,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -7,5 +7,5 @@ import com.nis.domain.FunctionServiceDict;
|
||||
@MyBatisDao
|
||||
public interface FunctionServiceDictDao {
|
||||
|
||||
List<FunctionServiceDict> getListByFunctionId(Integer functionId);
|
||||
List<FunctionServiceDict> getList(FunctionServiceDict entity);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||
<result column="protocol_id" property="protocolId" jdbcType="INTEGER" />
|
||||
<result column="action" property="action" jdbcType="INTEGER" />
|
||||
<result column="action_code" property="actionCode" jdbcType="VARCHAR" />
|
||||
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
|
||||
<result column="service_name" property="serviceName" jdbcType="VARCHAR" />
|
||||
<result column="service_desc" property="serviceDesc" jdbcType="VARCHAR" />
|
||||
@@ -13,13 +14,16 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List" >
|
||||
dict_id, function_id, protocol_id, action, service_id, service_name,service_desc,is_valid
|
||||
dict_id, function_id, protocol_id, action,action_code, service_id, service_name,service_desc,is_valid
|
||||
</sql>
|
||||
<select id="getListByFunctionId" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
||||
<select id="getList" resultMap="BaseResultMap" >
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from function_service_dict
|
||||
where function_id = #{functionId,jdbcType=INTEGER} and is_valid=1
|
||||
where is_valid=1
|
||||
<if test="functionId != null">
|
||||
AND function_id = #{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="protocolId != null">
|
||||
AND (protocol_id=#{protocolId,jdbcType=INTEGER} or protocol_id=0)
|
||||
</if>
|
||||
|
||||
@@ -1,8 +1,20 @@
|
||||
package com.nis.web.dao.configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.nis.domain.configuration.AvFileSampleCfg;
|
||||
import com.nis.domain.configuration.AvSignSampleCfg;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@MyBatisDao
|
||||
public interface AvCfgDao {
|
||||
|
||||
public AvFileSampleCfg getAvFileSampleById(Long cfgId);
|
||||
public AvSignSampleCfg getAvSignSampleById(Long cfgId);
|
||||
public List<AvFileSampleCfg> getAvFileSampleList(AvFileSampleCfg entity);
|
||||
public List<AvSignSampleCfg> getAvSignSampleList(AvSignSampleCfg entity);
|
||||
public void insertAvFileSample(AvFileSampleCfg entity);
|
||||
public void insertAvSignSample(AvSignSampleCfg entity);
|
||||
public void updateAvFileSample(AvFileSampleCfg entity);
|
||||
public void updateAvSignSample(AvSignSampleCfg entity);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,249 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.nis.web.dao.configuration.AvCfgDao" >
|
||||
<resultMap id="AvFileSampleMap" type="com.nis.domain.configuration.AvFileSampleCfg" >
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="src_url" property="srcUrl" jdbcType="VARCHAR" />
|
||||
<result column="sample_url" property="sampleUrl" jdbcType="VARCHAR" />
|
||||
<result column="src_md5" property="srcMd5" jdbcType="VARCHAR" />
|
||||
<result column="sample_md5" property="sampleMd5" jdbcType="VARCHAR" />
|
||||
<result column="cfg_type" property="cfgType" 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" />
|
||||
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
||||
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
||||
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
|
||||
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
|
||||
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
|
||||
<result column="request_id" property="requestId" jdbcType="INTEGER" />
|
||||
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
|
||||
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
|
||||
<result column="classify" property="classify" jdbcType="VARCHAR" />
|
||||
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
|
||||
<result column="lable" property="lable" jdbcType="VARCHAR" />
|
||||
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
|
||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
||||
<result column="creator_name" property="creatorName" jdbcType="VARCHAR" />
|
||||
<result column="auditor_name" property="auditorName" jdbcType="VARCHAR" />
|
||||
<result column="editor_name" property="editorName" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="AvFileSample_Column" >
|
||||
a.CFG_ID, a.SRC_URL,a.SAMPLE_URL, a.SRC_MD5,a.SAMPLE_MD5,a.CFG_DESC,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,a.cfg_type,a.cfg_region_code,a.LEVEL
|
||||
</sql>
|
||||
|
||||
<select id="getAvFileSampleById" resultMap="AvFileSampleMap" parameterType="java.lang.Long" >
|
||||
SELECT
|
||||
<include refid="AvFileSample_Column" />
|
||||
FROM av_file_sample_cfg a
|
||||
WHERE a.CFG_ID = #{cfgId,jdbcType=BIGINT}
|
||||
</select>
|
||||
|
||||
<select id="getAvFileSampleList" resultMap="AvFileSampleMap" >
|
||||
SELECT
|
||||
<include refid="AvFileSample_Column" />
|
||||
<trim prefix="," prefixOverrides=",">
|
||||
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
|
||||
,ri.request_title as requestName
|
||||
</trim>
|
||||
FROM av_file_sample_cfg a
|
||||
left join sys_user s on a.creator_id=s.id
|
||||
left join sys_user e on a.editor_id=e.id
|
||||
left join sys_user u on a.auditor_id=u.id
|
||||
left join request_info ri on a.request_id=ri.id
|
||||
left join service_dict_info sdic on a.classify=sdic.item_code and sdic.item_type=1 and sdic.is_leaf=0
|
||||
left join service_dict_info sdia on a.attribute=sdia.item_code and sdia.item_type=2 and sdia.is_leaf=0
|
||||
left join service_dict_info sdil on a.lable=sdil.item_code and sdil.item_type=3 and sdil.is_leaf=0
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="page !=null and page.where != null and page.where != ''">
|
||||
AND ${page.where}
|
||||
</if>
|
||||
<if test="cfgId != null">
|
||||
AND a.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND a.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="action != null">
|
||||
AND a.ACTION=#{action,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
AND a.IS_VALID=#{isValid,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid == null">
|
||||
AND a.IS_VALID != -1
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
AND a.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="creatorName != null and creatorName != ''">
|
||||
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="createTime != null and createTime != ''">
|
||||
AND a.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="editorName != null and editorName != ''">
|
||||
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="editTime != null and editTime != ''">
|
||||
AND a.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="auditorName != null and auditorName != ''">
|
||||
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="auditTime != null and auditTime != ''">
|
||||
AND a.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="serviceId != null">
|
||||
AND a.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
AND a.REQUEST_ID=#{requestId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
AND a.COMPILE_ID=#{compileId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isAreaEffective != null">
|
||||
AND a.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="classify != null and classify != ''">
|
||||
AND a.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="attribute != null and attribute != ''">
|
||||
AND a.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="lable != null and lable != ''">
|
||||
AND a.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="areaEffectiveIds != null and areaEffectiveIds != ''">
|
||||
AND a.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
AND a.function_id=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
</trim>
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY CFG_ID desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<insert id="insertAvFileSample" parameterType="com.nis.domain.configuration.AvFileSampleCfg" >
|
||||
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into av_file_sample_cfg (
|
||||
SRC_URL,SAMPLE_URL, SRC_MD5,SAMPLE_MD5,LEVEL,CFG_DESC,ACTION,IS_VALID,IS_AUDIT,
|
||||
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
|
||||
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
|
||||
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,function_id,cfg_type,cfg_region_code,level
|
||||
)values (
|
||||
#{srcUrl,jdbcType=VARCHAR},#{sampleUrl,jdbcType=VARCHAR},#{srcMd5,jdbcType=VARCHAR},
|
||||
#{sampleMd5,jdbcType=VARCHAR},#{level,jdbcType=INTEGER},#{cfgDesc,jdbcType=VARCHAR},#{action,jdbcType=INTEGER},
|
||||
0,0,#{creatorId,jdbcType=INTEGER},
|
||||
now(),#{editorId,jdbcType=INTEGER},#{editTime,jdbcType=TIMESTAMP},
|
||||
#{auditorId,jdbcType=INTEGER},#{auditTime,jdbcType=TIMESTAMP},#{serviceId,jdbcType=INTEGER},
|
||||
#{requestId,jdbcType=INTEGER},#{compileId,jdbcType=INTEGER},#{isAreaEffective,jdbcType=INTEGER},
|
||||
#{classify,jdbcType=VARCHAR},#{attribute,jdbcType=VARCHAR},#{lable,jdbcType=VARCHAR},
|
||||
#{areaEffectiveIds,jdbcType=VARCHAR},#{functionId,jdbcType=INTEGER},
|
||||
#{cfgType,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER},#{level,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
<update id="updateAvFileSample" parameterType="com.nis.domain.configuration.AvFileSampleCfg" >
|
||||
update av_file_sample_cfg
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
<if test="cfgDesc != null and cfgDesc != ''" >
|
||||
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="srcUrl != null and srcUrl != ''">
|
||||
src_url = #{srcUrl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sampleUrl != null and sampleUrl != ''">
|
||||
sample_url = #{sampleUrl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="action != null" >
|
||||
action = #{action,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isValid != null" >
|
||||
is_valid = #{isValid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAudit != null" >
|
||||
is_audit = #{isAudit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="creatorId != null" >
|
||||
creator_id = #{creatorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null and createTime != ''" >
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="editorId != null" >
|
||||
editor_id = #{editorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
edit_time = now(),
|
||||
<if test="serviceId != null" >
|
||||
service_id = #{serviceId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="requestId != null" >
|
||||
request_id = #{requestId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAreaEffective != null" >
|
||||
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="classify != null and classify != ''" >
|
||||
classify = #{classify,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="attribute != null and attribute != ''" >
|
||||
attribute = #{attribute,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="lable != null and lable != ''" >
|
||||
lable = #{lable,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="areaEffectiveIds != null" >
|
||||
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="functionId != null" >
|
||||
function_id = #{functionId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="cfgRegionCode != null" >
|
||||
cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="cfgType != null" >
|
||||
cfg_type = #{cfgType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="level != null" >
|
||||
level = #{level,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
||||
<update id="updateAvFileSampleValid" parameterType="com.nis.domain.configuration.AvFileSampleCfg" >
|
||||
update av_file_sample_cfg set is_valid = #{isValid,jdbcType=INTEGER},
|
||||
editor_id = #{editorId,jdbcType=INTEGER} ,
|
||||
edit_time = #{editTime,jdbcType=TIMESTAMP} where cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="auditAvFileSample" parameterType="com.nis.domain.configuration.AvFileSampleCfg" >
|
||||
update av_file_sample_cfg set is_audit = #{isAudit,jdbcType=INTEGER},
|
||||
auditor_id = #{auditorId,jdbcType=INTEGER},
|
||||
audit_time = #{auditTime,jdbcType=TIMESTAMP}
|
||||
<if test="isValid != null" >
|
||||
,is_valid = #{isValid,jdbcType=INTEGER}
|
||||
</if>
|
||||
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -1,27 +1,69 @@
|
||||
package com.nis.web.service.configuration;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.AppIdCfg;
|
||||
import com.nis.domain.configuration.AvFileSampleCfg;
|
||||
import com.nis.domain.configuration.AvSignSampleCfg;
|
||||
import com.nis.web.dao.FunctionRegionDictDao;
|
||||
import com.nis.web.dao.FunctionServiceDictDao;
|
||||
import com.nis.web.dao.configuration.AvCfgDao;
|
||||
import com.nis.web.service.BaseService;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.CrudService;
|
||||
|
||||
|
||||
/**
|
||||
* 特定协议相关配置事务类
|
||||
* 音视频配置相关事务类
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class AvCfgService extends BaseService {
|
||||
@Autowired
|
||||
protected FunctionRegionDictDao functionRegionDictDao;
|
||||
@Autowired
|
||||
protected FunctionServiceDictDao functionServiceDictDao;
|
||||
public class AvCfgService {
|
||||
// @Autowired
|
||||
// protected FunctionRegionDictDao functionRegionDictDao;
|
||||
// @Autowired
|
||||
// protected FunctionServiceDictDao functionServiceDictDao;
|
||||
@Autowired
|
||||
protected AvCfgDao avCfgDao;
|
||||
|
||||
public AvFileSampleCfg getAvFileSampleById(Long cfgId){
|
||||
return avCfgDao.getAvFileSampleById(cfgId);
|
||||
}
|
||||
public AvSignSampleCfg getAvSignSampleById(Long cfgId){
|
||||
return avCfgDao.getAvSignSampleById(cfgId);
|
||||
}
|
||||
public Page<AvFileSampleCfg> getAvFileSampleList(Page<AvFileSampleCfg> page, AvFileSampleCfg entity){
|
||||
entity.setPage(page);
|
||||
List<AvFileSampleCfg> list = avCfgDao.getAvFileSampleList(entity);
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
public Page<AvSignSampleCfg> getAvSignSampleList(Page<AvSignSampleCfg> page, AvSignSampleCfg entity){
|
||||
entity.setPage(page);
|
||||
List<AvSignSampleCfg> list = avCfgDao.getAvSignSampleList(entity);
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
public void saveOrUpdateAvFileSample(AvFileSampleCfg entity){
|
||||
if(entity.getCfgId()==null){
|
||||
entity.setCreatorId(UserUtils.getUser().getId());
|
||||
entity.setCompileId(0);
|
||||
avCfgDao.insertAvFileSample(entity);
|
||||
}else{
|
||||
entity.setEditorId(UserUtils.getUser().getId());
|
||||
avCfgDao.updateAvFileSample(entity);
|
||||
}
|
||||
}
|
||||
public void saveOrUpdateAvSignSample(AvSignSampleCfg entity){
|
||||
if(entity.getCfgId()==null){
|
||||
avCfgDao.insertAvSignSample(entity);
|
||||
}else{
|
||||
avCfgDao.updateAvSignSample(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user