Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -7,6 +7,8 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.nis.web.security.UserUtils;
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/tag")
|
||||
@@ -26,7 +28,9 @@ public class TagController extends BaseController {
|
||||
model.addAttribute("selectIds", request.getParameter("selectIds")); // 指定默认选中的ID
|
||||
model.addAttribute("isAll", request.getParameter("isAll")); // 是否读取全部数据,不进行权限过滤
|
||||
model.addAttribute("module", request.getParameter("module")); // 过滤栏目模型(仅针对CMS的Category树)
|
||||
model.addAttribute("title", request.getParameter("title"));
|
||||
model.addAttribute("title", request.getParameter("title"));//根节点替换文本
|
||||
model.addAttribute("enableAddBtn", request.getParameter("enableAddBtn"));//节点是否可编辑
|
||||
model.addAttribute("userId", UserUtils.getUser().getId());//如果启用了addBtn,则使用userId判断是否是用户自己创建的,用户自己创建的节点可删除
|
||||
return "/sys/tagTreeselect";
|
||||
}
|
||||
|
||||
|
||||
@@ -24,13 +24,18 @@ import com.nis.domain.configuration.AppHttpCfg;
|
||||
import com.nis.domain.configuration.AppIpCfg;
|
||||
import com.nis.domain.configuration.AppPolicyCfg;
|
||||
import com.nis.domain.configuration.AppSslCertCfg;
|
||||
import com.nis.domain.configuration.AppTcpCfg;
|
||||
import com.nis.domain.configuration.AppTopicDomainCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
import com.nis.domain.specific.SpecificServiceCfg;
|
||||
import com.nis.exceptions.CallExternalProceduresException;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.CodeDicUtils;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeResult;
|
||||
import com.nis.web.security.UserUtils;
|
||||
|
||||
/**
|
||||
@@ -755,6 +760,126 @@ public class AppCfgController extends BaseController {
|
||||
appCfgService.updateAppSslCfgValid(isValid,ids,functionId);
|
||||
return "redirect:" + adminPath +"/app/sslCfgList?functionId="+functionId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* APP TCP会话字节数特征 列表
|
||||
* @param model
|
||||
* @param cfg
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"tcpCfgList"})
|
||||
public String tcpCfgList(Model model,@ModelAttribute("cfg")AppTcpCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
Page<AppTcpCfg> searchPage=new Page<AppTcpCfg>(request,response,"r");
|
||||
Page<AppTcpCfg> page = appCfgService.findAppTcpList(searchPage, cfg);
|
||||
for(AppTcpCfg entity:page.getList()){
|
||||
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
entity.setAppName(app.getSpecServiceName());
|
||||
}
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
return "/cfg/app/appTcpCfgList";
|
||||
}
|
||||
|
||||
/**
|
||||
* APP TCP会话字节数特征表单(新增/修改)
|
||||
* @param model
|
||||
* @param ids
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"tcpCfgForm"})
|
||||
@RequiresPermissions(value={"app:tcp:config"})
|
||||
public String tcpCfgForm(Model model,String ids,AppTcpCfg entity) {
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
entity = appCfgService.getAppTcpCfg(Long.parseLong(ids));
|
||||
initUpdateFormCondition(model,entity);
|
||||
}else{
|
||||
initFormCondition(model,entity);
|
||||
}
|
||||
model.addAttribute("_cfg", entity);
|
||||
return "/cfg/app/appTcpCfgForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* APP TCP会话字节数特征配置(新增/修改)提交
|
||||
* @param model
|
||||
* @param request
|
||||
* @param response
|
||||
* @param entity
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"saveAppTcpCfg"})
|
||||
@RequiresPermissions(value={"app:tcp:config"})
|
||||
public String saveAppTcpCfg(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
AppTcpCfg entity,RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
if(specificService!=null){
|
||||
entity.setAppCode(specificService.getSpecServiceCode());
|
||||
}
|
||||
appCfgService.saveOrUpdateAppTcpeCfg(entity);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/app/tcpCfgList?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
/**
|
||||
* APP TCP会话字节数特征配置删除
|
||||
* @param isValid
|
||||
* @param ids
|
||||
* @param functionId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"updateAppTcpCfgValid"})
|
||||
@RequiresPermissions(value={"app:tcp:config"})
|
||||
public String updateAppTcpCfgValid(Integer isValid,String ids,Integer functionId) {
|
||||
appCfgService.updateAppTcpCfgValid(isValid,ids,functionId);
|
||||
return "redirect:" + adminPath +"/app/tcpCfgList?functionId="+functionId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* APP TCP会话字节数特征配置 审核
|
||||
* @param isAudit
|
||||
* @param isValid
|
||||
* @param ids
|
||||
* @param functionId
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"auditAppTcpCfg"})
|
||||
@RequiresPermissions(value={"app:tcp:confirm"})
|
||||
public String auditAppTcpCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
AppTcpCfg entity = new AppTcpCfg();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = appCfgService.getAppTcpCfg(Long.parseLong(id));
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
appCfgService.auditAppTcpCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("app SSL配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/app/tcpCfgList?functionId="+functionId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* APP header特征配置 列表
|
||||
* @param model
|
||||
@@ -864,4 +989,150 @@ public class AppCfgController extends BaseController {
|
||||
appCfgService.updateAppHeaderCfgValid(isValid,ids,functionId);
|
||||
return "redirect:" + adminPath +"/app/headerCfgList?functionId="+functionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 主题网站配置列表
|
||||
* @param model
|
||||
* @param cfg
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"topicDomainCfgList"})
|
||||
public String TopicDomainCfgList(Model model,@ModelAttribute("cfg")AppTopicDomainCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
Page<AppTopicDomainCfg> searchPage=new Page<AppTopicDomainCfg>(request,response,"r");
|
||||
Page<AppTopicDomainCfg> page = appCfgService.findAppTopicDomainList(searchPage, cfg);
|
||||
// for(AppTopicDomainCfg entity:page.getList()){
|
||||
// SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
// entity.setAppName(app.getSpecServiceName());
|
||||
// }
|
||||
//设置topic主题
|
||||
for (AppTopicDomainCfg entity:page.getList()) {
|
||||
List<CodeResult> codeList = CodeDicUtils.getCodeList("serviceCode");
|
||||
for (CodeResult codeResult : codeList) {
|
||||
if(null!=entity.getTopic()&&codeResult.getCode().equals(entity.getTopic())){
|
||||
entity.setAppName(codeResult.getItem());
|
||||
}
|
||||
}
|
||||
}
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
return "/cfg/app/appTopicDomainCfgList";
|
||||
}
|
||||
/**
|
||||
* app主题网站配置表单
|
||||
* @param model
|
||||
* @param ids
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"topicDomainCfgForm"})
|
||||
@RequiresPermissions(value={"app:topic:config"})
|
||||
public String topicDomainCfgForm(Model model,String ids,@ModelAttribute("_cfg")AppTopicDomainCfg entity) {
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
entity = appCfgService.getAppTopicDomainCfg(Long.parseLong(ids));
|
||||
initUpdateFormCondition(model,entity);
|
||||
}else{
|
||||
initFormCondition(model,entity);
|
||||
}
|
||||
model.addAttribute("_cfg", entity);
|
||||
return "/cfg/app/appTopicDomainCfgForm";
|
||||
}
|
||||
/**
|
||||
* app主题网站配置新增修改
|
||||
* @param model
|
||||
* @param request
|
||||
* @param response
|
||||
* @param entity
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"saveAppTopicDomainCfg"})
|
||||
@RequiresPermissions(value={"app:topic:config"})
|
||||
public String saveAppTopicDomainCfg(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
AppTopicDomainCfg entity,RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
// SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
// if(specificService!=null){
|
||||
// entity.setAppCode(specificService.getSpecServiceCode());
|
||||
// }
|
||||
appCfgService.saveOrUpdateAppTopicDomainCfg(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
} catch (Exception e) {
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.info("app主题网站配置下发失败:"+e.getMessage());;
|
||||
addMessage(redirectAttributes,"request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
logger.error("app主题网站配置下发失败",e);
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/app/topicDomainCfgList?functionId="+entity.getFunctionId();
|
||||
}
|
||||
/**
|
||||
* domain配置审核
|
||||
* @param isAudit
|
||||
* @param isValid
|
||||
* @param ids
|
||||
* @param functionId
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"auditAppTopicDomainCfg"})
|
||||
// @RequiresPermissions(value={"app:domain:confirm"})
|
||||
public String auditAppTopicDomainCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
AppTopicDomainCfg entity = new AppTopicDomainCfg();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = appCfgService.getAppTopicDomainCfg(Long.parseLong(id));
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
appCfgService.auditAppTopicDomainCfg(entity,isAudit);
|
||||
addMessage(redirectAttributes,"audit_success");
|
||||
} catch (MaatConvertException e) {
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.info("app主题网站配置下发失败:"+e.getMessage());;
|
||||
addMessage(redirectAttributes,"request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
logger.error("app主题网站配置下发失败",e);
|
||||
addMessage(redirectAttributes,"audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/app/topicDomainCfgList?functionId="+functionId;
|
||||
}
|
||||
/**
|
||||
* 网站主题配置删除
|
||||
* @param isValid
|
||||
* @param ids
|
||||
* @param functionId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"updateAppTopicDomainCfgValid"})
|
||||
@RequiresPermissions(value={"app:topic:config"})
|
||||
public String updateAppTopicDomainCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
appCfgService.updateAppTopicDomainCfgValid(isValid,ids,functionId);
|
||||
addMessage(redirectAttributes,"delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("app主题网站删除失败",e);
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"delete_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/app/topicDomainCfgList?functionId="+functionId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ public class FileTransferCfgController extends BaseController{
|
||||
entity.setCreateTime(date);
|
||||
fileTime=entity.getCreateTime();
|
||||
}
|
||||
ToMaatResult result = null;
|
||||
ToMaatResult result = new ToMaatResult();
|
||||
if(file!=null && file.getSize()>0 && entity!=null){
|
||||
String sep = System.getProperty("file.separator");
|
||||
String digestFilePath = request.getRealPath("/")+"digestFile";
|
||||
@@ -245,6 +245,10 @@ public class FileTransferCfgController extends BaseController{
|
||||
String md5 = DigestUtils.md5Hex(file.getBytes());
|
||||
fileMap.put("checksum", md5);
|
||||
result = ConfigServiceUtil.getFileDigest(null, uploadFile, JsonMapper.toJsonString(fileMap));
|
||||
if((result.getData().getRawLen() == null) || (result.getData().getDigest() == null)) {
|
||||
logger.info("文件摘要信息获取有误!");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+null);
|
||||
}
|
||||
logger.info("获取文件摘要响应信息:"+result);
|
||||
}
|
||||
fileTransferCfgService.saveOrUpdateFileDigestCfg(entity,result,areaCfgIds);
|
||||
@@ -282,6 +286,25 @@ public class FileTransferCfgController extends BaseController{
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/fileTransfer/fileDigestList?functionId="+functionId;
|
||||
}
|
||||
@RequestMapping(value = {"ajaxFileDigestSubIdList"})
|
||||
public String ajaxFileDigestSubIdList(Model model,Long cfgId,Integer index) {
|
||||
FileDigestCfg cfg = fileTransferCfgService.getFileDigestSubIdCfg(cfgId);
|
||||
List<String[]> tabList = new ArrayList();
|
||||
//查询SubscribeId域配置
|
||||
if(cfg.getNtcSubscribeIdCfgList()!=null){
|
||||
String cfgType = null;
|
||||
for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){
|
||||
if(!ntc.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"2",ntc.getCfgType()});
|
||||
cfgType = ntc.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("index", index);
|
||||
model.addAttribute("tabList", tabList);
|
||||
return "/cfg/fileTransfer/fileDigestSubList";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"p2pList"})
|
||||
public String p2pList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
@@ -104,6 +105,15 @@ public class XmppController extends BaseController {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(cfg.getNtcSubscribeIdCfgList()!=null){
|
||||
String cfgType = null;
|
||||
for(NtcSubscribeIdCfg keyword:cfg.getNtcSubscribeIdCfgList()){
|
||||
if(!keyword.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"2",keyword.getCfgType()});
|
||||
cfgType = keyword.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("index", index);
|
||||
model.addAttribute("tabList", tabList);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.nis.web.controller.specific;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
@@ -13,6 +12,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
@@ -22,6 +22,8 @@ import com.google.common.collect.Maps;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.specific.SpecificServiceCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
@@ -201,8 +203,9 @@ public class SpecificServiceCfgController extends BaseController {
|
||||
Map<String, Object> map2 = Maps.newHashMap();
|
||||
map2.put("id", 0);
|
||||
map2.put("pId", 0);
|
||||
map2.put("type",0);
|
||||
map2.put("serviceType",0);
|
||||
map2.put("business",-2);
|
||||
map2.put("groupId",0);
|
||||
map2.put("name","root_node");
|
||||
//map2.put("placeholder","0");
|
||||
mapList.add(map2);
|
||||
@@ -222,6 +225,7 @@ public class SpecificServiceCfgController extends BaseController {
|
||||
map.put("name",props.getProperty(dict.getItemValue(), dict.getItemValue()));
|
||||
map.put("serviceType",cfgType);
|
||||
map.put("businessType","-1");
|
||||
map.put("groupId",0);
|
||||
businessList.add(map);
|
||||
}
|
||||
mapList.addAll(businessList);
|
||||
@@ -242,7 +246,12 @@ public class SpecificServiceCfgController extends BaseController {
|
||||
map.put("pId", "businessType"+business.getItemCode());
|
||||
map.put("name",specificServiceCfg.getSpecServiceName());
|
||||
map.put("serviceType",specificServiceCfg.getCfgType());
|
||||
map.put("serviceCode",specificServiceCfg.getSpecServiceCode());
|
||||
map.put("businessType",specificServiceCfg.getBusinessType());
|
||||
map.put("groupId",specificServiceCfg.getGroupId());
|
||||
if(specificServiceCfg.getAddFlag()!=null) {
|
||||
map.put("user",specificServiceCfg.getAddFlag());
|
||||
}
|
||||
mapList.add(map);
|
||||
break;
|
||||
}
|
||||
@@ -253,6 +262,7 @@ public class SpecificServiceCfgController extends BaseController {
|
||||
map.put("pId", specificServiceCfg.getParent().getSpecServiceId());
|
||||
map.put("name",specificServiceCfg.getSpecServiceName());
|
||||
map.put("serviceType",specificServiceCfg.getCfgType());
|
||||
map.put("groupId",specificServiceCfg.getGroupId());
|
||||
mapList.add(map);
|
||||
}
|
||||
}
|
||||
@@ -272,6 +282,10 @@ public class SpecificServiceCfgController extends BaseController {
|
||||
map.put("pId", specificServiceCfg.getParent().getSpecServiceId());
|
||||
map.put("name",specificServiceCfg.getSpecServiceName());
|
||||
map.put("type",specificServiceCfg.getCfgType());
|
||||
map.put("groupId",specificServiceCfg.getGroupId());
|
||||
if(specificServiceCfg.getAddFlag()!=null) {
|
||||
map.put("user",specificServiceCfg.getAddFlag());
|
||||
}
|
||||
mapList.add(map);
|
||||
}
|
||||
}
|
||||
@@ -380,5 +394,70 @@ public class SpecificServiceCfgController extends BaseController {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "ajaxSaveOrUpdateApp",method=RequestMethod.POST )
|
||||
public Map<String,Object> ajaxSaveOrUpdateApp(@RequestParam(required=true,value="specServiceId")String specServiceId,@RequestParam(required=false,value="specServiceCode")String specServiceCode,@RequestParam(required=true,value="specServiceName") String specServiceName,
|
||||
@RequestParam(required=true,value="cfgType") String cfgType, @RequestParam(required=true,value="businessType")String businessType,@RequestParam(required=false,value="addFlag")String addFlag,
|
||||
@RequestParam(required=false,value="groupId")String groupId){
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
//校验是真ID还是假ID,假的Id以manual开头无法转换成数字
|
||||
boolean isTrueId=false;
|
||||
try {
|
||||
Long.parseLong(specServiceId);
|
||||
isTrueId=true;
|
||||
}catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
}
|
||||
try{
|
||||
SpecificServiceCfg cfg=new SpecificServiceCfg();
|
||||
if(isTrueId) {
|
||||
cfg.setSpecServiceId(Integer.parseInt(specServiceId));
|
||||
}
|
||||
if(StringUtils.isNotBlank(specServiceCode)) {
|
||||
cfg.setSpecServiceCode(Integer.parseInt(specServiceCode));
|
||||
}
|
||||
cfg.setAddFlag(Integer.parseInt(addFlag));
|
||||
cfg.setSpecServiceName(specServiceName);
|
||||
cfg.setBusinessType(businessType);
|
||||
cfg.setCfgType(Integer.parseInt(cfgType));
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
if(StringUtils.isNotBlank(groupId)) {
|
||||
cfg.setGroupId(Integer.parseInt(groupId));
|
||||
}
|
||||
|
||||
SpecificServiceCfg parent=new SpecificServiceCfg();
|
||||
parent.setSpecServiceId(0);
|
||||
cfg.setParent(parent);
|
||||
specificServiceCfgService.saveOrUpdate(cfg);
|
||||
cfg=specificServiceCfgService.getBySpecServiceId(cfg.getSpecServiceId());
|
||||
map.put("id", cfg.getSpecServiceId());
|
||||
map.put("pId", "businessType"+cfg.getBusinessType());
|
||||
map.put("name",cfg.getSpecServiceName());
|
||||
map.put("serviceType",cfg.getCfgType());
|
||||
map.put("businessType",cfg.getBusinessType());
|
||||
map.put("groupId",cfg.getGroupId());
|
||||
return map;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
map.put("errTip", "request_service_failed");
|
||||
}else {
|
||||
map.put("errTip", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "ajaxRemoveApp",method=RequestMethod.POST )
|
||||
public boolean ajaxRemoveApp(@RequestParam(required=true,value="specServiceId")Integer specServiceId){
|
||||
try{
|
||||
specificServiceCfgService.delete(String.valueOf(specServiceId));
|
||||
return true;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user