Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop
This commit is contained in:
@@ -15,6 +15,7 @@ public class FunctionRegionDict extends BaseCfg<FunctionRegionDict> {
|
||||
private String configDistrict;
|
||||
private String configDesc;
|
||||
private Integer isMaat;
|
||||
private Integer regionType;
|
||||
public Integer getDictId() {
|
||||
return dictId;
|
||||
}
|
||||
@@ -57,5 +58,11 @@ public class FunctionRegionDict extends BaseCfg<FunctionRegionDict> {
|
||||
public void setIsMaat(Integer isMaat) {
|
||||
this.isMaat = isMaat;
|
||||
}
|
||||
public Integer getRegionType() {
|
||||
return regionType;
|
||||
}
|
||||
public void setRegionType(Integer regionType) {
|
||||
this.regionType = regionType;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class AvController extends BaseController {
|
||||
//音视频文件样例配置列表
|
||||
@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);
|
||||
Page<AvFileSampleCfg> page = avCfgService.getAvFileSampleList(new Page<AvFileSampleCfg>(request, response,"a"), entity);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model);
|
||||
return "/cfg/av/fileSampleList";
|
||||
@@ -41,7 +41,7 @@ public class AvController extends BaseController {
|
||||
//音视频标志样例配置列表
|
||||
@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);
|
||||
Page<AvSignSampleCfg> page = avCfgService.getAvSignSampleList(new Page<AvSignSampleCfg>(request, response,"a"), entity);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model);
|
||||
return "/cfg/av/signSampleList";
|
||||
@@ -86,7 +86,7 @@ public class AvController extends BaseController {
|
||||
File uploadSampleFile = new File(sampleFilePath+sep+sampleFileName);
|
||||
FileCopyUtils.copy(srcFile.getBytes(), uploadSrcFile);
|
||||
FileCopyUtils.copy(sampleFile.getBytes(),uploadSampleFile);
|
||||
String host = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/"+request.getContextPath();
|
||||
String host = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath();
|
||||
String srcUrl = host+"/srcFile/"+uploadSrcFile.getName();
|
||||
String sampleUrl = host+"/sampleFile/"+uploadSampleFile.getName();
|
||||
logger.info("srcUrl:"+srcUrl);
|
||||
|
||||
@@ -10,10 +10,11 @@
|
||||
<result column="config_desc" property="configDesc" jdbcType="VARCHAR" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
<result column="is_maat" property="isMaat" jdbcType="INTEGER" />
|
||||
<result column="region_type" property="regionType" jdbcType="INTEGER" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List" >
|
||||
dict_id, function_id, config_region_value,config_region_code, config_district, config_desc, is_valid,is_maat
|
||||
dict_id, function_id, config_region_value,config_region_code, config_district, config_desc, is_valid,is_maat,region_type
|
||||
</sql>
|
||||
<select id="getList" resultMap="BaseResultMap" >
|
||||
select
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.nis.domain.configuration.AvSignSampleCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.FileUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.configuration.AvCfgDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
@@ -149,44 +150,73 @@ public class AvCfgService extends BaseService{
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
|
||||
String oldSrcUrl = entity.getSrcPath();
|
||||
String oldSampleUrl = entity.getSamplePath();
|
||||
if(isAudit==1){
|
||||
//音视频文件上传接口调用
|
||||
try {
|
||||
File srcFile = new File(entity.getSrcPath());
|
||||
File srcFile = new File(oldSrcUrl);
|
||||
Map<String,Object> srcMap = new HashMap();
|
||||
srcMap.put("filetype", FileUtils.getSuffix(srcFile.getName(), false));
|
||||
srcMap.put("datatype", "dbSystem");//源文件存入数据中心
|
||||
srcMap.put("createTime", entity.getCreateTime());
|
||||
srcMap.put("key",FileUtils.getPrefix(srcFile.getName(), false));
|
||||
srcMap.put("fileName", srcFile.getName());
|
||||
srcMap.put("checksum", entity.getSrcMd5());
|
||||
String result1 = ConfigServiceUtil.postFileCfg(null, srcFile, JSONObject.fromObject(srcMap));
|
||||
logger.info("音视频源文件上传响应信息:"+result1);
|
||||
//获取文件上传响应信息(文件访问路径)
|
||||
//获取文件上传响应信息(新的文件访问路径)
|
||||
Map<String, Object> srcRes = gson.fromJson(result1,Map.class);
|
||||
entity.setSrcUrl(srcRes.get("data").toString());
|
||||
|
||||
File smapleFile = new File(entity.getSamplePath());
|
||||
String srcAccessUrl = null;
|
||||
if(!StringUtil.isEmpty(srcRes.get("data"))){
|
||||
Map<String,Object> data = (Map<String,Object>)srcRes.get("data");
|
||||
if(!StringUtil.isEmpty(data.get("accessUrl"))){
|
||||
srcAccessUrl=data.get("accessUrl").toString();
|
||||
entity.setSrcUrl(srcAccessUrl);
|
||||
// entity.setSrcPath("");
|
||||
}
|
||||
|
||||
}
|
||||
File sampleFile = new File(oldSampleUrl);
|
||||
Map<String,Object> sampleMap = new HashMap();
|
||||
sampleMap.put("filetype", FileUtils.getSuffix(smapleFile.getName(), false));
|
||||
sampleMap.put("filetype", FileUtils.getSuffix(sampleFile.getName(), false));
|
||||
srcMap.put("datatype", "fileSystem");//样例文件存入fastdfs
|
||||
sampleMap.put("createTime", entity.getCreateTime());
|
||||
sampleMap.put("key",FileUtils.getPrefix(smapleFile.getName(), false));
|
||||
sampleMap.put("fileName", smapleFile.getName());
|
||||
sampleMap.put("key",FileUtils.getPrefix(sampleFile.getName(), false));
|
||||
sampleMap.put("fileName", sampleFile.getName());
|
||||
sampleMap.put("checksum", entity.getSampleMd5());
|
||||
String result2 = ConfigServiceUtil.postFileCfg(null, srcFile, JSONObject.fromObject(sampleMap));
|
||||
logger.info("音视频样例文件上传响应信息:"+result2);
|
||||
|
||||
//获取文件上传响应信息(新的文件访问路径)
|
||||
Map<String, Object> sampleRes = gson.fromJson(result1,Map.class);
|
||||
//获取文件上传响应信息(文件访问路径)
|
||||
entity.setSampleUrl(sampleRes.get("data").toString());
|
||||
String sampleAccessUrl = null;
|
||||
if(!StringUtil.isEmpty(sampleRes.get("data"))){
|
||||
Map<String,Object> data = (Map<String,Object>)sampleRes.get("data");
|
||||
if(!StringUtil.isEmpty(data.get("accessUrl"))){
|
||||
sampleAccessUrl = data.get("accessUrl").toString();
|
||||
entity.setSampleUrl(sampleAccessUrl);
|
||||
// entity.setSamplePath("");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("音视频文件样例配置下发失败");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
avCfgDao.auditAvFileSample(entity);
|
||||
avCfgDao.auditAvFileSample(entity);
|
||||
//删除本地源文件和样例文件
|
||||
if(!oldSrcUrl.equals(entity.getSrcUrl())){
|
||||
FileUtils.deleteFile(oldSrcUrl);
|
||||
}
|
||||
if(!oldSampleUrl.equals(entity.getSampleUrl())){
|
||||
FileUtils.deleteFile(oldSampleUrl);
|
||||
}
|
||||
list.add(entity);
|
||||
|
||||
}
|
||||
if(isAudit==1){
|
||||
//调用服务接口下发配置数据
|
||||
|
||||
Reference in New Issue
Block a user