1、修改服务接口异常信息处理,异常信息直接抛出至controller,列表界面显示异常信息.
This commit is contained in:
@@ -90,7 +90,7 @@ public class ConfigServiceUtil {
|
|||||||
* @param type 1是compileid,2是groupid,3是regionid
|
* @param type 1是compileid,2是groupid,3是regionid
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static List<Integer> getId(int type,int num) throws Exception {
|
public static List<Integer> getId(int type,int num) throws MaatConvertException {
|
||||||
String result = null;
|
String result = null;
|
||||||
String url = "";
|
String url = "";
|
||||||
List<Integer> list = new ArrayList();
|
List<Integer> list = new ArrayList();
|
||||||
@@ -133,7 +133,7 @@ public class ConfigServiceUtil {
|
|||||||
* @return
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static ToMaatResult postMaatCfg(String params) throws Exception{
|
public static ToMaatResult postMaatCfg(String params) throws MaatConvertException{
|
||||||
String result = null;
|
String result = null;
|
||||||
ToMaatResult bean = null;
|
ToMaatResult bean = null;
|
||||||
String url = Constants.SERVICE_URL+Constants.MAAT_CFG;
|
String url = Constants.SERVICE_URL+Constants.MAAT_CFG;
|
||||||
@@ -157,7 +157,7 @@ public class ConfigServiceUtil {
|
|||||||
* @return
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static ToMaatResult postCallbackCfg(String params) throws Exception{
|
public static ToMaatResult postCallbackCfg(String params) throws MaatConvertException{
|
||||||
String result = null;
|
String result = null;
|
||||||
ToMaatResult bean = null;
|
ToMaatResult bean = null;
|
||||||
String url = Constants.SERVICE_URL+Constants.CALLBACK_CFG;
|
String url = Constants.SERVICE_URL+Constants.CALLBACK_CFG;
|
||||||
@@ -182,7 +182,7 @@ public class ConfigServiceUtil {
|
|||||||
* @return
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static ToMaatResult postFileCfg(String params,File file,JSONObject fileDesc) throws Exception{
|
public static ToMaatResult postFileCfg(String params,File file,JSONObject fileDesc) throws MaatConvertException{
|
||||||
String result = null;
|
String result = null;
|
||||||
ToMaatResult bean = null;
|
ToMaatResult bean = null;
|
||||||
String url = Constants.SERVICE_URL+Constants.FILE_UPLOAD_CFG;
|
String url = Constants.SERVICE_URL+Constants.FILE_UPLOAD_CFG;
|
||||||
@@ -209,7 +209,7 @@ public class ConfigServiceUtil {
|
|||||||
* @param type,1表示maat配置取消,2表示回调配置取消
|
* @param type,1表示maat配置取消,2表示回调配置取消
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static ToMaatResult delete(String params,Integer type){
|
public static ToMaatResult delete(String params,Integer type) throws MaatConvertException{
|
||||||
String result = null;
|
String result = null;
|
||||||
ToMaatResult bean = null;
|
ToMaatResult bean = null;
|
||||||
String url = Constants.SERVICE_URL;
|
String url = Constants.SERVICE_URL;
|
||||||
@@ -239,7 +239,7 @@ public class ConfigServiceUtil {
|
|||||||
* @param type,1表示maat配置取消,2表示回调配置取消
|
* @param type,1表示maat配置取消,2表示回调配置取消
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static ToMaatResult put(String params,Integer type){
|
public static ToMaatResult put(String params,Integer type) throws MaatConvertException{
|
||||||
String result = null;
|
String result = null;
|
||||||
ToMaatResult bean = null;
|
ToMaatResult bean = null;
|
||||||
String url = Constants.SERVICE_URL;
|
String url = Constants.SERVICE_URL;
|
||||||
@@ -268,7 +268,7 @@ public class ConfigServiceUtil {
|
|||||||
* @return
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static ToMaatResult getFileDigest(String params,File file,Map<String, Object> fileDesc) throws Exception{
|
public static ToMaatResult getFileDigest(String params,File file,Map<String, Object> fileDesc) throws MaatConvertException{
|
||||||
String result = null;
|
String result = null;
|
||||||
ToMaatResult bean = null;
|
ToMaatResult bean = null;
|
||||||
String url = Constants.SERVICE_URL+Constants.FILE_DIGEST_CFG;
|
String url = Constants.SERVICE_URL+Constants.FILE_DIGEST_CFG;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import org.springframework.util.FileCopyUtils;
|
|||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
@@ -147,7 +148,7 @@ public class AvController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"/sample/auditAvFileSample"})
|
@RequestMapping(value = {"/sample/auditAvFileSample"})
|
||||||
public String auditAvFileSample(Integer isAudit,Integer isValid,String ids,Integer functionId){
|
public String auditAvFileSample(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes){
|
||||||
// avCfgService.auditAvFileSample(isAudit,isValid,ids);
|
// avCfgService.auditAvFileSample(isAudit,isValid,ids);
|
||||||
AvFileSampleCfg entity = new AvFileSampleCfg();
|
AvFileSampleCfg entity = new AvFileSampleCfg();
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
@@ -159,9 +160,9 @@ public class AvController extends BaseController {
|
|||||||
entity.setAuditTime(new Date());
|
entity.setAuditTime(new Date());
|
||||||
String oldSrcUrl = entity.getSrcPath();
|
String oldSrcUrl = entity.getSrcPath();
|
||||||
String oldSampleUrl = entity.getSamplePath();
|
String oldSampleUrl = entity.getSamplePath();
|
||||||
|
try {
|
||||||
if(isAudit==1){
|
if(isAudit==1){
|
||||||
//音视频文件上传接口调用
|
//音视频文件上传接口调用
|
||||||
try {
|
|
||||||
File srcFile = new File(oldSrcUrl);
|
File srcFile = new File(oldSrcUrl);
|
||||||
Map<String,Object> srcMap = new HashMap();
|
Map<String,Object> srcMap = new HashMap();
|
||||||
srcMap.put("filetype", FileUtils.getSuffix(srcFile.getName(), false));
|
srcMap.put("filetype", FileUtils.getSuffix(srcFile.getName(), false));
|
||||||
@@ -200,12 +201,6 @@ public class AvController extends BaseController {
|
|||||||
// entity.setSamplePath("");
|
// entity.setSamplePath("");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.info("音视频文件样例配置下发失败");
|
|
||||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
avCfgService.auditAvFileSample(entity,isAudit);
|
avCfgService.auditAvFileSample(entity,isAudit);
|
||||||
//删除本地源文件和样例文件
|
//删除本地源文件和样例文件
|
||||||
@@ -215,6 +210,11 @@ public class AvController extends BaseController {
|
|||||||
if(!oldSampleUrl.equals(entity.getSampleUrl())){
|
if(!oldSampleUrl.equals(entity.getSampleUrl())){
|
||||||
FileUtils.deleteFile(oldSampleUrl);
|
FileUtils.deleteFile(oldSampleUrl);
|
||||||
}
|
}
|
||||||
|
} catch (MaatConvertException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.info("音视频文件样例配置下发失败:"+e.getMessage());
|
||||||
|
addMessage(redirectAttributes, e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return "redirect:" + adminPath +"/ntc/av/sample/fileSampleList?functionId="+functionId;
|
return "redirect:" + adminPath +"/ntc/av/sample/fileSampleList?functionId="+functionId;
|
||||||
}
|
}
|
||||||
@@ -234,7 +234,7 @@ public class AvController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"/sample/auditAvSignSample"})
|
@RequestMapping(value = {"/sample/auditAvSignSample"})
|
||||||
public String auditAvSignSample(Integer isAudit,Integer isValid,String ids,Integer functionId){
|
public String auditAvSignSample(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes){
|
||||||
// avCfgService.auditAvSignSample(isAudit,isValid,ids);
|
// avCfgService.auditAvSignSample(isAudit,isValid,ids);
|
||||||
AvSignSampleCfg entity = new AvSignSampleCfg();
|
AvSignSampleCfg entity = new AvSignSampleCfg();
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
@@ -244,7 +244,13 @@ public class AvController extends BaseController {
|
|||||||
entity.setIsValid(isValid);
|
entity.setIsValid(isValid);
|
||||||
entity.setAuditorId(UserUtils.getUser().getId());
|
entity.setAuditorId(UserUtils.getUser().getId());
|
||||||
entity.setAuditTime(new Date());
|
entity.setAuditTime(new Date());
|
||||||
|
try {
|
||||||
avCfgService.auditAvSignSample(entity,isAudit);
|
avCfgService.auditAvSignSample(entity,isAudit);
|
||||||
|
} catch (MaatConvertException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.info("音视频标识样例配置下发失败:"+e.getMessage());
|
||||||
|
addMessage(redirectAttributes, e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return "redirect:" + adminPath +"/ntc/av/sample/signSampleList?functionId="+functionId;
|
return "redirect:" + adminPath +"/ntc/av/sample/signSampleList?functionId="+functionId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ public class AvCfgService extends BaseService{
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public void auditAvFileSample(AvFileSampleCfg entity,Integer isAudit){
|
public void auditAvFileSample(AvFileSampleCfg entity,Integer isAudit) throws MaatConvertException{
|
||||||
//修改数据库审核状态信息
|
//修改数据库审核状态信息
|
||||||
avCfgDao.auditAvFileSample(entity);
|
avCfgDao.auditAvFileSample(entity);
|
||||||
List<AvFileSampleCfg> list = new ArrayList<AvFileSampleCfg>();
|
List<AvFileSampleCfg> list = new ArrayList<AvFileSampleCfg>();
|
||||||
@@ -152,27 +152,16 @@ public class AvCfgService extends BaseService{
|
|||||||
String json=gsonToJson(list);
|
String json=gsonToJson(list);
|
||||||
logger.info("音视频文件样例下发配置参数:"+json);
|
logger.info("音视频文件样例下发配置参数:"+json);
|
||||||
//调用服务接口下发配置
|
//调用服务接口下发配置
|
||||||
try {
|
|
||||||
ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json);
|
ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json);
|
||||||
logger.info("音视频文件样例配置下发响应信息:"+result.getMsg());
|
logger.info("音视频文件样例配置下发响应信息:"+result.getMsg());
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.info("音视频文件样例配置下发失败");
|
|
||||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
|
||||||
}
|
|
||||||
}else if(isAudit==3){
|
}else if(isAudit==3){
|
||||||
//调用服务接口取消配置
|
//调用服务接口取消配置
|
||||||
String json=gsonToJson(list);
|
String json=gsonToJson(list);
|
||||||
logger.info("音视频文件样例下发配置参数:"+json);
|
logger.info("音视频文件样例下发配置参数:"+json);
|
||||||
//调用服务接口下发配置
|
//调用服务接口下发配置
|
||||||
try {
|
|
||||||
ToMaatResult result = ConfigServiceUtil.put(json,2);
|
ToMaatResult result = ConfigServiceUtil.put(json,2);
|
||||||
logger.info("音视频文件样例取消配置响应信息:"+result.getMsg());
|
logger.info("音视频文件样例取消配置响应信息:"+result.getMsg());
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.info("音视频文件样取消配置失败");
|
|
||||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void updateAvSignSampleValid(Integer isAudit,Integer isValid,String ids){
|
public void updateAvSignSampleValid(Integer isAudit,Integer isValid,String ids){
|
||||||
@@ -187,7 +176,7 @@ public class AvCfgService extends BaseService{
|
|||||||
avCfgDao.updateAvSignSampleValid(entity);
|
avCfgDao.updateAvSignSampleValid(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void auditAvSignSample(AvSignSampleCfg entity,Integer isAudit){
|
public void auditAvSignSample(AvSignSampleCfg entity,Integer isAudit) throws MaatConvertException{
|
||||||
avCfgDao.auditAvSignSample(entity);
|
avCfgDao.auditAvSignSample(entity);
|
||||||
List<AvSignSampleCfg> list = new ArrayList<AvSignSampleCfg>();
|
List<AvSignSampleCfg> list = new ArrayList<AvSignSampleCfg>();
|
||||||
list.add(entity);
|
list.add(entity);
|
||||||
@@ -209,14 +198,8 @@ public class AvCfgService extends BaseService{
|
|||||||
String json=gsonToJson(list);
|
String json=gsonToJson(list);
|
||||||
logger.info("标志样例下发配置参数:"+json);
|
logger.info("标志样例下发配置参数:"+json);
|
||||||
//调用服务接口取消配置
|
//调用服务接口取消配置
|
||||||
try {
|
|
||||||
ToMaatResult result = ConfigServiceUtil.put(json, 2);
|
ToMaatResult result = ConfigServiceUtil.put(json, 2);
|
||||||
logger.info("音视频标志样例配置取消配置响应信息:"+result.getMsg());
|
logger.info("音视频标志样例配置取消配置响应信息:"+result.getMsg());
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.info("音视频标志样例取消配置失败");
|
|
||||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -219,14 +219,14 @@ clusterBStartTime=1503504000725
|
|||||||
isCommit=true
|
isCommit=true
|
||||||
############################################################################################################################################
|
############################################################################################################################################
|
||||||
############################################################################################################################################
|
############################################################################################################################################
|
||||||
httpUrl=http://10.0.6.201:8090/galaxy/service/cfg/v1/
|
httpUrl=http://10.0.6.249:8080/galaxy/service/cfg/v1/
|
||||||
maatCfg=configSources
|
maatCfg=configSources
|
||||||
fileUploadCfg=fileUploadSources
|
fileUploadCfg=fileUploadSources
|
||||||
callbackCfg=commonSources
|
callbackCfg=commonSources
|
||||||
fileDigestCfg=fileDigestSources
|
fileDigestCfg=fileDigestSources
|
||||||
configIdSources=configPzIdSources
|
configIdSources=configPzIdSources
|
||||||
client_connect_timeout=1000
|
client_connect_timeout=300000
|
||||||
client_read_timeout=1000
|
client_read_timeout=300000
|
||||||
#use elasticsearch or not#
|
#use elasticsearch or not#
|
||||||
isUseES=false
|
isUseES=false
|
||||||
|
|
||||||
|
|||||||
@@ -264,6 +264,7 @@
|
|||||||
</form:form>
|
</form:form>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
|
<sys:message content="${message}" />
|
||||||
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
|
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -268,6 +268,7 @@
|
|||||||
</form:form>
|
</form:form>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
|
<sys:message content="${message}" />
|
||||||
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
|
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user