Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop
This commit is contained in:
@@ -30,7 +30,14 @@ public class SpecificServiceCfg extends BaseEntity<SpecificServiceCfg>{
|
||||
private Date beginDate; // 开始日期
|
||||
private Date endDate; // 结束日期
|
||||
private String showSequence; //显示序号
|
||||
private String businessType;
|
||||
|
||||
public String getBusinessType() {
|
||||
return businessType;
|
||||
}
|
||||
public void setBusinessType(String businessType) {
|
||||
this.businessType = businessType;
|
||||
}
|
||||
public Integer getParentType() {
|
||||
return parentType;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.nis.domain.configuration.AppIpCfg;
|
||||
import com.nis.domain.configuration.AppPolicyCfg;
|
||||
import com.nis.domain.configuration.AppSslCertCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
import com.nis.domain.specific.SpecificServiceCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
@@ -102,6 +103,15 @@ public class AppCfgController extends BaseController {
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
||||
@@ -18,7 +18,9 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.AppPolicyCfg;
|
||||
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.Constants;
|
||||
import com.nis.web.controller.BaseController;
|
||||
@@ -72,7 +74,16 @@ public class BasicProtocolController extends BaseController {
|
||||
}
|
||||
}
|
||||
}
|
||||
model.addAttribute("_cfg", cfg);
|
||||
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/basicprotocol/ipList";
|
||||
@@ -115,9 +126,16 @@ public class BasicProtocolController extends BaseController {
|
||||
entity.setAppCode(specificService.getSpecServiceCode());
|
||||
}
|
||||
appCfgService.saveOrUpdateAppPolicyCfg(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
logger.error("基础协议信息保存失败",e);
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
// addMessage(redirectAttributes,e.getMessage());
|
||||
addMessage(redirectAttributes,"request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basicprotocol/list?functionId="+entity.getFunctionId();
|
||||
@@ -146,10 +164,18 @@ public class BasicProtocolController extends BaseController {
|
||||
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL);
|
||||
try {
|
||||
appCfgService.auditAppPolicyCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("app策略配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
addMessage(redirectAttributes,"audit_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,"audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/basicprotocol/list?functionId="+functionId;
|
||||
@@ -163,8 +189,20 @@ public class BasicProtocolController extends BaseController {
|
||||
*/
|
||||
@RequestMapping(value = {"updateValid"})
|
||||
@RequiresPermissions(value={"basicprotocol:config"})
|
||||
public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId) {
|
||||
appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId);
|
||||
public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId);
|
||||
addMessage(redirectAttributes,"delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("基础协议信息保存失败",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 +"/basicprotocol/list?functionId="+functionId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,9 @@ import com.nis.domain.Page;
|
||||
import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.configuration.AppPolicyCfg;
|
||||
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.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
@@ -96,6 +98,15 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
@@ -139,9 +150,15 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
||||
entity.setAppCode(specificService.getSpecServiceCode());
|
||||
}
|
||||
appCfgService.saveOrUpdateAppPolicyCfg(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
logger.error("加密隧道信息保存失败",e);
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+entity.getFunctionId();
|
||||
@@ -170,10 +187,17 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
||||
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR);
|
||||
try {
|
||||
appCfgService.auditAppPolicyCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("app策略配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
addMessage(redirectAttributes,"audit_success");
|
||||
} catch (Exception e) {
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.info("加密隧道配置下发失败:"+e.getMessage());;
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
logger.error("加密隧道配置下发失败",e);
|
||||
addMessage(redirectAttributes,"audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+functionId;
|
||||
@@ -187,8 +211,19 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
||||
*/
|
||||
@RequestMapping(value = {"updateValid"})
|
||||
@RequiresPermissions(value={"encryptedtunnelbehav:config"})
|
||||
public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId) {
|
||||
appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId);
|
||||
public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId);
|
||||
} catch (Exception e) {
|
||||
logger.error("加密隧道协议保存失败",e);
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
e.printStackTrace();
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"delete_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+functionId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,8 +94,15 @@ public class AvContentController extends BaseController {
|
||||
avContentCfgService.saveOrUpdateAvVoip(cfg);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("voip IP信息保存失败",e);
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.error("voip IP信息保存失败",e);
|
||||
addMessage(redirectAttributes,"request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
logger.error("voip IP信息保存失败",e);
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
@@ -107,8 +114,15 @@ public class AvContentController extends BaseController {
|
||||
avContentCfgService.saveOrUpdateAvVoipAccount(cfg);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("voip Account信息保存失败",e);
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.error("voip Account信息保存失败",e);
|
||||
addMessage(redirectAttributes,"request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
logger.error("voip Account信息保存失败",e);
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
@@ -155,7 +169,19 @@ public class AvContentController extends BaseController {
|
||||
public String updateVoipValid(Integer isAudit,String compileIds,Integer isValid,String ids,Integer functionId
|
||||
,RedirectAttributes redirectAttributes
|
||||
) {
|
||||
avContentCfgService.updateAvVoipValid(isAudit,isValid,compileIds,functionId);
|
||||
try {
|
||||
avContentCfgService.updateAvVoipValid(isAudit,isValid,compileIds,functionId);
|
||||
} catch (Exception e) {
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.error("voip IP信息审核失败",e);
|
||||
addMessage(redirectAttributes,"request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
logger.error("voip IP信息审核失败",e);
|
||||
addMessage(redirectAttributes,"audit_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+functionId;
|
||||
}
|
||||
//修改VOIP account配置状态
|
||||
@@ -164,7 +190,19 @@ public class AvContentController extends BaseController {
|
||||
public String updateVoipAccountValid(Integer isAudit,String compileIds,Integer isValid,String ids,Integer functionId
|
||||
,RedirectAttributes redirectAttributes
|
||||
) {
|
||||
avContentCfgService.updateAvVoipAccountValid(isAudit,isValid,compileIds,functionId);
|
||||
try {
|
||||
avContentCfgService.updateAvVoipAccountValid(isAudit,isValid,compileIds,functionId);
|
||||
} catch (Exception e) {
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.error("voip Account信息审核失败",e);
|
||||
addMessage(redirectAttributes,"request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
logger.error("voip Account信息审核失败",e);
|
||||
addMessage(redirectAttributes,"audit_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+functionId;
|
||||
}
|
||||
//修改VOIP IP配置审核状态
|
||||
@@ -180,8 +218,16 @@ public class AvContentController extends BaseController {
|
||||
try {
|
||||
avContentCfgService.auditAvVoip(isAudit,isValid,functionId,id,auditTime);
|
||||
} catch (MaatConvertException e) {
|
||||
logger.error("VOIP配置下发失败",e);
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.info("VOIP配置下发失败:"+e.getMessage());;
|
||||
addMessage(redirectAttributes,"request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
logger.error("VOIP配置下发失败",e);
|
||||
addMessage(redirectAttributes,"audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,8 +247,15 @@ public class AvContentController extends BaseController {
|
||||
try {
|
||||
avContentCfgService.auditAvVoipAccount(isAudit,isValid,functionId,id,auditTime);
|
||||
} catch (MaatConvertException e) {
|
||||
logger.error("VOIP Account配置下发失败",e);
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.info("VOIPAccount配置下发失败:"+e.getMessage());;
|
||||
addMessage(redirectAttributes,"request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
logger.error("VOIPAccount配置下发失败",e);
|
||||
addMessage(redirectAttributes,"audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public class FileTransferCfgController extends BaseController{
|
||||
}
|
||||
@RequestMapping(value = {"ftpForm"})
|
||||
@RequiresPermissions(value={"fileTransfer:ftp:config"})
|
||||
public String ftpForm(Model model,String ids,CfgIndexInfo entity) {
|
||||
public String ftpForm(Model model,String compileIds,String ids,CfgIndexInfo entity) {
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
entity = fileTransferCfgService.getFtpCfg(Long.parseLong(ids));
|
||||
initUpdateFormCondition(model,entity);
|
||||
@@ -74,8 +74,21 @@ public class FileTransferCfgController extends BaseController{
|
||||
@RequestMapping(value = {"saveFtpCfg"})
|
||||
@RequiresPermissions(value={"fileTransfer:ftp:config"})
|
||||
public String saveFtpCfg(Model model,HttpServletRequest request,HttpServletResponse response,String ids,
|
||||
CfgIndexInfo entity) {
|
||||
fileTransferCfgService.saveFtpCfg(entity);
|
||||
CfgIndexInfo entity,RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
fileTransferCfgService.saveFtpCfg(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
} catch (Exception e) {
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.error("ftp信息保存失败",e);
|
||||
addMessage(redirectAttributes,"request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
logger.error("ftp信息保存失败",e);
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/fileTransfer/ftpList?functionId="+entity.getFunctionId();
|
||||
}
|
||||
@RequestMapping(value = {"ajaxFtpSubList"})
|
||||
@@ -100,15 +113,45 @@ public class FileTransferCfgController extends BaseController{
|
||||
}
|
||||
}
|
||||
}
|
||||
//查询关键字
|
||||
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/ftpSubList";
|
||||
}
|
||||
/**
|
||||
* 做删除操作
|
||||
* @param isValid
|
||||
* @param ids
|
||||
* @param functionId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"updateFtpCfgValid"})
|
||||
@RequiresPermissions(value={"fileTransfer:ftp:config"})
|
||||
public String updateFtpCfgValid(Integer isValid,String ids,Integer functionId) {
|
||||
fileTransferCfgService.updateFtpCfgValid(isValid,ids,functionId);
|
||||
public String updateFtpCfgValid(Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
fileTransferCfgService.updateFtpCfgValid(isValid,ids,functionId);
|
||||
addMessage(redirectAttributes,"delete_success");
|
||||
} catch (Exception e) {
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.info("ftp配置删除失败:"+e.getMessage());;
|
||||
addMessage(redirectAttributes,"request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
logger.error("ftp配置删除失败",e);
|
||||
addMessage(redirectAttributes,"delete_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/fileTransfer/ftpList?functionId="+functionId;
|
||||
}
|
||||
@RequestMapping(value = {"auditFtpCfg"})
|
||||
@@ -125,10 +168,17 @@ public class FileTransferCfgController extends BaseController{
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
fileTransferCfgService.auditFtpCfg(entity,isAudit);
|
||||
addMessage(redirectAttributes,"audit_success");
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("ftp配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.info("ftp配置下发失败:"+e.getMessage());;
|
||||
addMessage(redirectAttributes,"request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
logger.error("ftp配置下发失败",e);
|
||||
addMessage(redirectAttributes,"audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/fileTransfer/ftpList?functionId="+functionId;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.nis.web.controller.specific;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -18,7 +20,9 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
import com.google.common.collect.Lists;
|
||||
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.util.DictUtils;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@@ -198,9 +202,29 @@ public class SpecificServiceCfgController extends BaseController {
|
||||
map2.put("id", 0);
|
||||
map2.put("pId", 0);
|
||||
map2.put("type",0);
|
||||
map2.put("business",-2);
|
||||
map2.put("name","root_node");
|
||||
//map2.put("placeholder","0");
|
||||
mapList.add(map2);
|
||||
Properties props=this.getMsgProp();
|
||||
List<SysDataDictionaryItem> businessTypeList=Lists.newArrayList();
|
||||
if(cfgType==1) {
|
||||
businessTypeList=DictUtils.getDictList("APP_BUSINESS_TYPE");
|
||||
}else if(cfgType==3) {
|
||||
businessTypeList=DictUtils.getDictList("BASIC_PROTOCOL_BUSINESS_TYPE");
|
||||
}
|
||||
List<Map<String, Object>> businessList = Lists.newArrayList();
|
||||
for(SysDataDictionaryItem dict:businessTypeList) {
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
map.put("id", "businessType"+dict.getItemCode());
|
||||
map.put("pId", 0);
|
||||
map.put("name",props.getProperty(dict.getItemValue(), dict.getItemValue()));
|
||||
map.put("serviceType",cfgType);
|
||||
map.put("businessType","-1");
|
||||
map.put("nodes", new ArrayList<Map<String, Object>>());
|
||||
businessList.add(map);
|
||||
}
|
||||
mapList.addAll(businessList);
|
||||
List<SpecificServiceCfg> list = specificServiceCfgService.findAllSpecificServiceCfg(new SpecificServiceCfg(),"");
|
||||
for (int i=0; i<list.size(); i++){
|
||||
SpecificServiceCfg specificServiceCfg = list.get(i);
|
||||
@@ -210,14 +234,57 @@ public class SpecificServiceCfgController extends BaseController {
|
||||
(cfgType.intValue()!=0&&specificServiceCfg.getCfgType().intValue()!=cfgType)){
|
||||
continue;
|
||||
}
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
map.put("id", specificServiceCfg.getSpecServiceId());
|
||||
map.put("pId", specificServiceCfg.getParent().getSpecServiceId());
|
||||
map.put("name",specificServiceCfg.getSpecServiceName());
|
||||
map.put("type",specificServiceCfg.getCfgType());
|
||||
mapList.add(map);
|
||||
if(businessTypeList.size()>0) {
|
||||
for(SysDataDictionaryItem business:businessTypeList) {
|
||||
if(String.valueOf(business.getItemCode()).equals(specificServiceCfg.getBusinessType())) {
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
map.put("id", specificServiceCfg.getSpecServiceId());
|
||||
map.put("pId", "businessType"+business.getItemCode());
|
||||
map.put("name",specificServiceCfg.getSpecServiceName());
|
||||
map.put("serviceType",specificServiceCfg.getCfgType());
|
||||
map.put("businessType",specificServiceCfg.getBusinessType());
|
||||
mapList.add(map);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else {
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
map.put("id", specificServiceCfg.getSpecServiceId());
|
||||
map.put("pId", specificServiceCfg.getParent().getSpecServiceId());
|
||||
map.put("name",specificServiceCfg.getSpecServiceName());
|
||||
map.put("serviceType",specificServiceCfg.getCfgType());
|
||||
mapList.add(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// List<SpecificServiceCfg> list = specificServiceCfgService.findAllSpecificServiceCfg(new SpecificServiceCfg(),"");
|
||||
//
|
||||
// for (int i=0; i<list.size(); i++){
|
||||
// SpecificServiceCfg specificServiceCfg = list.get(i);
|
||||
// if(StringUtils.isBlank(extId)||(extId!=null&&!extId.equals(specificServiceCfg.getSpecServiceId().toString()))){
|
||||
// if(specificServiceCfg.getIsValid().equals(0)||
|
||||
// (!isLeafShow && specificServiceCfg.getIsLeaf().equals(1))||
|
||||
// (cfgType.intValue()!=0&&specificServiceCfg.getCfgType().intValue()!=cfgType)){
|
||||
// continue;
|
||||
// }
|
||||
// for(Map<String, Object> business:businessList) {
|
||||
// if(String.valueOf(business.get("id")).equals(specificServiceCfg.getBusinessType())) {
|
||||
// Map<String, Object> map = Maps.newHashMap();
|
||||
// map.put("id", specificServiceCfg.getSpecServiceId());
|
||||
// map.put("pId", specificServiceCfg.getParent().getSpecServiceId());
|
||||
// map.put("name",specificServiceCfg.getSpecServiceName());
|
||||
// map.put("type",specificServiceCfg.getCfgType());
|
||||
// map.put("business",specificServiceCfg.getBusinessType());
|
||||
// ((List<Map<String, Object>>)business.get("nodes")).add(map);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// map2.put("nodes", businessList);
|
||||
return mapList;
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -28,13 +28,13 @@
|
||||
<result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" />
|
||||
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
|
||||
<result column="ratelimit" property="ratelimit" jdbcType="INTEGER" />
|
||||
<result column="do_log" property="doLog" jdbcType="INTEGER" />
|
||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||
<result column="user_region1" property="userRegion1" jdbcType="VARCHAR" />
|
||||
<result column="user_region2" property="userRegion2" jdbcType="VARCHAR" />
|
||||
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
||||
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
|
||||
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
|
||||
<result column="do_log" property="doLog" jdbcType="INTEGER" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="AppIpCfgMap" type="com.nis.domain.configuration.AppIpCfg" >
|
||||
@@ -300,7 +300,7 @@
|
||||
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
|
||||
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,
|
||||
r.CFG_TYPE,r.CFG_REGION_CODE,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.USER_REGION1,r.USER_REGION2,
|
||||
r.USER_REGION3,r.USER_REGION4,r.USER_REGION5
|
||||
r.USER_REGION3,r.USER_REGION4,r.USER_REGION5,r.do_log
|
||||
</sql>
|
||||
|
||||
<sql id="AppIpCfg_Column" >
|
||||
@@ -477,6 +477,9 @@
|
||||
</if>
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
AND r.COMPILE_ID=#{compileId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
@@ -1318,12 +1321,12 @@
|
||||
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
|
||||
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,
|
||||
CFG_TYPE,CFG_REGION_CODE,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,USER_REGION1
|
||||
,USER_REGION2,USER_REGION3,USER_REGION4,USER_REGION5
|
||||
,USER_REGION2,USER_REGION3,USER_REGION4,USER_REGION5,DO_LOG
|
||||
)values (
|
||||
<include refid="AppCommonCfg_Value_List" />,
|
||||
#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER}
|
||||
,#{userRegion1,jdbcType=VARCHAR} ,#{userRegion2,jdbcType=VARCHAR} ,#{userRegion3,jdbcType=VARCHAR}
|
||||
,#{userRegion4,jdbcType=VARCHAR} ,#{userRegion5,jdbcType=VARCHAR}
|
||||
,#{userRegion4,jdbcType=VARCHAR} ,#{userRegion5,jdbcType=VARCHAR} ,#{doLog,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertAppIpCfg" parameterType="com.nis.domain.configuration.AppIpCfg" >
|
||||
@@ -1607,6 +1610,7 @@
|
||||
<if test="userRegion5 != null and userRegion5 != ''"> -->
|
||||
USER_REGION1 =#{userRegion5,jdbcType=VARCHAR},
|
||||
<!-- </if> -->
|
||||
DO_LOG=#{doLog,jdbcType=INTEGER}
|
||||
</trim>
|
||||
</set>
|
||||
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
|
||||
@@ -209,6 +209,9 @@
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
AND r.compile_id=#{compileId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<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="do_log" property="doLog" jdbcType="INTEGER" />
|
||||
</resultMap>
|
||||
<resultMap id="ipPortMap" type="com.nis.domain.configuration.IpPortCfg" >
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
@@ -260,6 +261,9 @@
|
||||
<if test="functionId != null">
|
||||
AND a.function_id=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="doLog != null">
|
||||
AND a.do_log=#{doLog,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="ipPort!=null">
|
||||
AND a.compile_id in (select t.compile_id from ip_port_cfg t
|
||||
<where>
|
||||
@@ -279,6 +283,18 @@
|
||||
</where>
|
||||
)
|
||||
</if>
|
||||
<if test="ntcSubscribeIdCfg != null">
|
||||
AND r.compile_id in (select f.compile_id from ntc_subscribe_id_cfg f
|
||||
<where>
|
||||
<if test="ntcSubscribeIdCfg.cfgKeywords != null and ntcSubscribeIdCfg.cfgKeywords != ''">
|
||||
and f.cfg_keywords like concat(concat('%',#{ntcSubscribeIdCfg.cfgKeywords,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
and f.compile_id =#{compileId,jdbcType=INTEGER}
|
||||
</if>
|
||||
</where>
|
||||
)
|
||||
</if>
|
||||
<!-- <if test="ftp!=null">
|
||||
AND a.compile_id in (select f.compile_id from ftp_keyword_cfg f
|
||||
<where>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<result column="is_leaf" property="isLeaf" jdbcType="INTEGER" />
|
||||
<result column="group_id" property="groupId" jdbcType="INTEGER" />
|
||||
<result column="cfg_type" property="cfgType" jdbcType="INTEGER" />
|
||||
<result column="business_type" property="businessType" jdbcType="VARCHAR" />
|
||||
<!-- 父id -->
|
||||
<association property="parent" javaType="com.nis.domain.specific.SpecificServiceCfg">
|
||||
<id column="parent_id" property="specServiceId" jdbcType="INTEGER" />
|
||||
@@ -28,7 +29,8 @@
|
||||
s.parent_id AS "parent.specServiceId",
|
||||
s.is_leaf AS isLeaf,
|
||||
s.group_id AS groupId,
|
||||
s.cfg_type AS cfgType
|
||||
s.cfg_type AS cfgType,
|
||||
s.business_type AS businessType
|
||||
</sql>
|
||||
|
||||
|
||||
@@ -73,6 +75,9 @@
|
||||
<if test="cfgType != null and cfgType != '' ">
|
||||
AND cfg_type =#{cfgType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="businessType != null and businessType != '' ">
|
||||
AND business_type =#{businessType,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="beginDate != null" >
|
||||
AND s.op_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
@@ -138,6 +143,9 @@
|
||||
<if test="specificServiceCfg.isLeaf != null and specificServiceCfg.isLeaf != '' ">
|
||||
AND is_leaf = #{specificServiceCfg.isLeaf}
|
||||
</if>
|
||||
<if test="specificServiceCfg.businessType != null and specificServiceCfg.businessType != '' ">
|
||||
AND business_type =#{specificServiceCfg.businessType}
|
||||
</if>
|
||||
<if test="specificServiceCfg.beginDate != null">
|
||||
AND op_time > #{specificServiceCfg.beginDate}
|
||||
</if>
|
||||
@@ -171,7 +179,8 @@
|
||||
s.parent_id = #{parent.specServiceId},
|
||||
s.is_leaf = #{isLeaf},
|
||||
s.group_id = #{groupId},
|
||||
s.cfg_type = #{cfgType}
|
||||
s.cfg_type = #{cfgType},
|
||||
s.business_type = #{businessType}
|
||||
WHERE s.spec_service_id = #{specServiceId}
|
||||
</update>
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.dao.configuration.AppCfgDao;
|
||||
import com.nis.web.dao.configuration.AreaIpCfgDao;
|
||||
import com.nis.web.dao.configuration.StringCfgDao;
|
||||
@@ -146,12 +147,22 @@ public class AppCfgService extends BaseService {
|
||||
entity.setIsAudit(0);
|
||||
appCfgDao.insertAppPolicyCfg(entity);
|
||||
//保存策略IP配置
|
||||
if(entity.getIpPortList()!=null){
|
||||
if(entity!=null&&entity.getIpPortList()!=null){
|
||||
for(IpPortCfg cfg:entity.getIpPortList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
appCfgDao.insertAppPolicyIpCfg(cfg);
|
||||
}
|
||||
}
|
||||
//保存关键字配置
|
||||
if(entity!=null&&entity.getNtcSubscribeIdCfgList()!=null){
|
||||
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
entity.setCfgKeywords(cfg.getCfgKeywords());
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
stringcfgDao.saveSubscribeIdCfg(cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null){
|
||||
for(AreaIpCfg cfg:entity.getAreaCfg()){
|
||||
@@ -173,6 +184,12 @@ public class AppCfgService extends BaseService {
|
||||
appCfgDao.updateAppPolicyCfg(entity);
|
||||
|
||||
appCfgDao.deleteAppPolicyIpCfg(entity);
|
||||
if(entity!=null&&entity.getNtcSubscribeIdCfgList()!=null&&entity.getNtcSubscribeIdCfgList().size()>0){
|
||||
for (NtcSubscribeIdCfg ntcSubscribeIdCfg : entity.getNtcSubscribeIdCfgList()) {
|
||||
ntcSubscribeIdCfg.setCompileId(entity.getCompileId());
|
||||
stringcfgDao.deleteSubscribeIdCfg(ntcSubscribeIdCfg);
|
||||
}
|
||||
}
|
||||
//删除旧的区域IP,新增新的区域IP
|
||||
AreaIpCfg area = new AreaIpCfg();
|
||||
area.setCompileId(entity.getCompileId());
|
||||
@@ -188,6 +205,15 @@ public class AppCfgService extends BaseService {
|
||||
appCfgDao.insertAppPolicyIpCfg(cfg);
|
||||
}
|
||||
}
|
||||
if(entity!=null&&entity.getNtcSubscribeIdCfgList()!=null){
|
||||
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
entity.setCfgKeywords(cfg.getCfgKeywords());
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
stringcfgDao.saveSubscribeIdCfg(cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null){
|
||||
@@ -494,7 +520,19 @@ public class AppCfgService extends BaseService {
|
||||
List<DigestCfg> digestRegionList = new ArrayList();
|
||||
List<IpCfg> areaIpRegionList = new ArrayList();
|
||||
entity.setTableName(AppPolicyCfg.getTablename());
|
||||
List <NtcSubscribeIdCfg> ntcList = new ArrayList();
|
||||
appCfgDao.auditCfg(entity);
|
||||
//更新关键字表状态
|
||||
if(entity.getCompileId()!=null){
|
||||
NtcSubscribeIdCfg ntc = new NtcSubscribeIdCfg();
|
||||
ntc.setCompileId(entity.getCompileId());
|
||||
ntc.setIsAudit(entity.getIsAudit());
|
||||
ntc.setIsValid(entity.getIsValid());
|
||||
ntc.setAuditorId(UserUtils.getUser().getId());
|
||||
ntc.setAuditTime(entity.getAuditTime());
|
||||
stringcfgDao.updateSubscribeIdCfg(ntc);
|
||||
}
|
||||
|
||||
if(isAudit==1){
|
||||
StringBuffer cfgKeywords=new StringBuffer();
|
||||
if(entity.getBehavCode()!=null){
|
||||
@@ -534,10 +572,17 @@ public class AppCfgService extends BaseService {
|
||||
groupRelationList=map.get("groupList");
|
||||
ipRegionList=map.get("dstList");
|
||||
if(map.get("numRegionList")!=null){
|
||||
numRegionList.addAll(map.get("numRegionList"));
|
||||
numRegionList.addAll(map.get("numRegionList"));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(entity.getNtcSubscribeIdCfgList()!=null&&entity.getNtcSubscribeIdCfgList().size()>0){
|
||||
if(isAudit==1){
|
||||
Map<String,List> ntcMap = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList);
|
||||
groupRelationList=ntcMap.get("groupList");
|
||||
strRegionList=ntcMap.get("dstList");
|
||||
}
|
||||
}
|
||||
|
||||
//保存区域IP信息
|
||||
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
|
||||
@@ -1048,6 +1093,12 @@ public class AppCfgService extends BaseService {
|
||||
cfg.setTableName(IpPortCfg.getTablename());
|
||||
appCfgDao.updateCfgValid(cfg);
|
||||
}
|
||||
//删除关键字
|
||||
if(entity.getNtcSubscribeIdCfgList()!=null&&entity.getNtcSubscribeIdCfgList().size()>0){
|
||||
NtcSubscribeIdCfg ntcSubscribeIdCfg = new NtcSubscribeIdCfg();
|
||||
BeanUtils.copyProperties(entity, ntcSubscribeIdCfg, new String[]{"cfgId"});
|
||||
stringcfgDao.deleteSubscribeIdCfg(ntcSubscribeIdCfg);
|
||||
}
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
|
||||
AreaIpCfg cfg = new AreaIpCfg();
|
||||
|
||||
@@ -54,7 +54,7 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
|
||||
if(!StringUtil.isEmpty(compileIds)){
|
||||
compileId = compileIds.get(0);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
@@ -79,7 +79,7 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
|
||||
}
|
||||
|
||||
}else{
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>: compileId is 0");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.configuration.AreaIpCfgDao;
|
||||
import com.nis.web.dao.configuration.FileTransferCfgDao;
|
||||
import com.nis.web.dao.configuration.MailCfgDao;
|
||||
import com.nis.web.dao.configuration.StringCfgDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.CrudService;
|
||||
|
||||
@@ -59,6 +60,9 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
protected AreaIpCfgDao areaIpCfgDao;
|
||||
@Autowired
|
||||
protected MailCfgDao mailCfgDao;
|
||||
@Autowired
|
||||
protected StringCfgDao stringCfgDao;
|
||||
|
||||
public Page<CfgIndexInfo> getFtpList(Page<CfgIndexInfo> page, CfgIndexInfo entity){
|
||||
// 生成数据权限过滤条件(dsf为dataScopeFilter的简写,在xml中使用 ${sqlMap.dsf}调用权限SQL)
|
||||
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
|
||||
@@ -71,6 +75,13 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
CfgIndexInfo entity = fileTransferCfgDao.getCfgIndexInfo(cfgId);
|
||||
List<IpPortCfg> ipPortList = fileTransferCfgDao.getIpPortList(entity);
|
||||
List<BaseStringCfg> keywordList = fileTransferCfgDao.getFtpKeywordList(entity);
|
||||
//设置关键字
|
||||
if(entity.getCompileId()!=null){
|
||||
NtcSubscribeIdCfg ntcSubscribeIdCfg = new NtcSubscribeIdCfg();
|
||||
ntcSubscribeIdCfg.setCompileId(entity.getCompileId());
|
||||
List<NtcSubscribeIdCfg> ntcList = stringCfgDao.findSubscribeIdCfgList(ntcSubscribeIdCfg);
|
||||
entity.setNtcSubscribeIdCfgList(ntcList);
|
||||
}
|
||||
entity.setIpPortList(ipPortList);
|
||||
entity.setStringList(keywordList);
|
||||
return entity;
|
||||
@@ -83,6 +94,8 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
public void saveFtpCfg(CfgIndexInfo entity){
|
||||
//设置区域运营商信息
|
||||
setAreaEffectiveIds(entity);
|
||||
entity.setIsValid(0);
|
||||
entity.setIsAudit(0);
|
||||
if(entity.getCfgId()==null){
|
||||
Integer compileId = 0;
|
||||
try {
|
||||
@@ -108,6 +121,15 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
}
|
||||
}
|
||||
}
|
||||
if(entity.getNtcSubscribeIdCfgList()!=null){
|
||||
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
// entity.setNtcSubscribeIdCfg(cfg);
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
stringCfgDao.saveSubscribeIdCfg(cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null){
|
||||
for(AreaIpCfg cfg:entity.getAreaCfg()){
|
||||
@@ -123,11 +145,19 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
}
|
||||
|
||||
}else{
|
||||
entity.setEditorId(entity.getCurrentUser().getId());
|
||||
entity.setEditTime(new Date());
|
||||
fileTransferCfgDao.updateCfgIndex(entity);
|
||||
//无效子配置后,再新增子配置
|
||||
fileTransferCfgDao.deleteFtpIpCfg(entity);
|
||||
fileTransferCfgDao.deleteFtpKeywordCfg(entity);
|
||||
fileTransferCfgDao.deleteFileDigestCfg(entity);
|
||||
//删除关键字配置后再新增
|
||||
if(entity!=null&&entity.getCompileId()!=null){
|
||||
NtcSubscribeIdCfg ntcSubscribeIdCfg = new NtcSubscribeIdCfg();
|
||||
ntcSubscribeIdCfg.setCompileId(entity.getCompileId());
|
||||
stringCfgDao.deleteSubscribeIdCfg(ntcSubscribeIdCfg);
|
||||
}
|
||||
AreaIpCfg area = new AreaIpCfg();
|
||||
area.setCompileId(entity.getCompileId());
|
||||
area.setFunctionId(entity.getFunctionId());
|
||||
@@ -148,6 +178,14 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
}
|
||||
}
|
||||
}
|
||||
if(entity!=null&&entity.getNtcSubscribeIdCfgList()!=null){
|
||||
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
stringCfgDao.saveSubscribeIdCfg(cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null){
|
||||
for(AreaIpCfg cfg:entity.getAreaCfg()){
|
||||
@@ -184,6 +222,14 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
cfg.setTableName(FtpKeywordCfg.getTablename());
|
||||
fileTransferCfgDao.updateCfgValid(cfg);
|
||||
}
|
||||
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0)
|
||||
{
|
||||
NtcSubscribeIdCfg ntc = new NtcSubscribeIdCfg();
|
||||
BeanUtils.copyProperties(entity, ntc, new String[]{"cfgId"});
|
||||
ntc.setTableName(ntc.getTablename());
|
||||
stringCfgDao.updateSubscribeIdCfg(ntc);
|
||||
}
|
||||
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
|
||||
AreaIpCfg cfg = new AreaIpCfg();
|
||||
@@ -237,6 +283,18 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
}
|
||||
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0)
|
||||
{
|
||||
NtcSubscribeIdCfg ntc = new NtcSubscribeIdCfg();
|
||||
BeanUtils.copyProperties(entity, ntc, new String[]{"cfgId"});
|
||||
ntc.setTableName(ntc.getTablename());
|
||||
stringCfgDao.updateSubscribeIdCfg(ntc);
|
||||
if(isAudit==1){
|
||||
Map<String,List> ntcMap = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList);
|
||||
groupRelationList=ntcMap.get("groupList");
|
||||
strRegionList=ntcMap.get("dstList");
|
||||
}
|
||||
}
|
||||
if(entity.getDigestList()!=null && entity.getDigestList().size()>0){
|
||||
FileDigestCfg cfg = new FileDigestCfg();
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
|
||||
@@ -66,7 +66,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
if(!StringUtil.isEmpty(compileIds)){
|
||||
compileId = compileIds.get(0);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
@@ -86,7 +86,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
}
|
||||
ipCfgDao.insert(cfg);
|
||||
}else{
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>: compileId is 0");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ package com.nis.web.service.specific;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -13,9 +11,7 @@ import com.beust.jcommander.internal.Lists;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.domain.specific.SpecificServiceCfg;
|
||||
import com.nis.main.ConvertTool;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.specific.SpecificServiceCfgDao;
|
||||
import com.nis.web.service.BaseService;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user