Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop
This commit is contained in:
@@ -13,10 +13,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.ServiceConfigInfo;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.main.ConvertTool;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@@ -74,44 +75,39 @@ public class ComplexStringCfgController extends BaseController{
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
logger.info("sercice id is "+serviceId);
|
||||
if(serviceId!=null){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
String tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
logger.info("table name is "+tableName);
|
||||
String className=complexStringCfgService.getClassName(tableName);
|
||||
logger.info("class name is "+className);
|
||||
String packageName=ComplexkeywordCfg.class.getPackage().getName();
|
||||
try {
|
||||
//通过反射获得ComplexkeywordCfg的子类的实例,并调用子类的initDefaultValue初始化默认值
|
||||
Class clazz=Class.forName(packageName+"."+className);
|
||||
ComplexkeywordCfg cfg=(ComplexkeywordCfg)clazz.newInstance();
|
||||
cfg.setTableName(tableName);
|
||||
cfg.initDefaultValue();
|
||||
cfg.setAction(action);
|
||||
cfg.setServiceId(serviceId);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("tableName", tableName);
|
||||
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);
|
||||
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
|
||||
// TODO Auto-generated catch block
|
||||
logger.error("打开新增IP窗口失败",e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
String tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
logger.info("table name is "+tableName);
|
||||
String className=complexStringCfgService.getClassName(tableName);
|
||||
logger.info("class name is "+className);
|
||||
String packageName=ComplexkeywordCfg.class.getPackage().getName();
|
||||
try {
|
||||
//通过反射获得ComplexkeywordCfg的子类的实例,并调用子类的initDefaultValue初始化默认值
|
||||
Class clazz=Class.forName(packageName+"."+className);
|
||||
ComplexkeywordCfg cfg=(ComplexkeywordCfg)clazz.newInstance();
|
||||
cfg.setTableName(tableName);
|
||||
cfg.initDefaultValue();
|
||||
cfg.setAction(action);
|
||||
cfg.setServiceId(serviceId);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("tableName", tableName);
|
||||
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);
|
||||
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
|
||||
// TODO Auto-generated catch block
|
||||
logger.error("打开新增IP窗口失败",e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.error("未获取到正确的serviceId");
|
||||
}
|
||||
|
||||
return "/cfg/complexCfgForm";
|
||||
}
|
||||
@RequestMapping(value = {"updateForm"})
|
||||
@@ -121,7 +117,13 @@ public class ComplexStringCfgController extends BaseController{
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("tableName", tableName);
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
try{
|
||||
if(StringUtils.isBlank(tableName)){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
}
|
||||
}
|
||||
logger.info("table name is "+tableName);
|
||||
ComplexkeywordCfg searchBean=new ComplexkeywordCfg();
|
||||
searchBean.setCfgId(cfgId);
|
||||
@@ -136,32 +138,9 @@ public class ComplexStringCfgController extends BaseController{
|
||||
model.addAttribute("xzs", xzs);
|
||||
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
|
||||
model.addAttribute("lables", lables);
|
||||
}else if(serviceId!=null){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
logger.info("table name is "+tableName);
|
||||
ComplexkeywordCfg searchBean=new ComplexkeywordCfg();
|
||||
searchBean.setCfgId(cfgId);
|
||||
searchBean.setTableName(tableName);
|
||||
ComplexkeywordCfg cfg=complexStringCfgService.getStringCfgById(searchBean);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
List<RequestInfo> requestInfos=requestInfoService.getAllRequestInfo();
|
||||
model.addAttribute("requestInfos", requestInfos);
|
||||
List<ServiceDictInfo> fls=serviceDictInfoService.findAllFlDict();
|
||||
model.addAttribute("fls", fls);
|
||||
List<ServiceDictInfo> xzs=serviceDictInfoService.findAllXzDict();
|
||||
model.addAttribute("xzs", xzs);
|
||||
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
|
||||
model.addAttribute("lables", lables);
|
||||
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.error("未获取到正确的表名");
|
||||
}catch(Exception e){
|
||||
logger.error("发生异常", e);
|
||||
}
|
||||
|
||||
return "/cfg/complexCfgForm";
|
||||
}
|
||||
|
||||
@@ -179,15 +158,21 @@ public class ComplexStringCfgController extends BaseController{
|
||||
model.addAttribute("cfgName",cfgName);
|
||||
model.addAttribute("cfgType","complex");
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
model.addAttribute("serviceId",cfg.getServiceId());
|
||||
model.addAttribute("action",cfg.getAction());
|
||||
logger.info("saveOrUpdateStringCfg loaded");
|
||||
if(cfg==null){
|
||||
logger.error("无法保存空的配置!");
|
||||
addMessage(model,"保存失败!");
|
||||
}else if(!StringUtils.isBlank(cfg.getTableName())){
|
||||
try {
|
||||
String tableName=cfg.getTableName();
|
||||
int serviceId=cfg.getServiceId();
|
||||
long compileId=getCompileId(cfg);
|
||||
// cfg.setCreatorId(cfg.getCurrentUser().getId());
|
||||
// cfg.setCreateTime(new Date());
|
||||
if(StringUtils.isBlank(cfg.getTableName())){
|
||||
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
cfg.setTableName(tableName);
|
||||
}
|
||||
}
|
||||
int compileId = new ConvertTool().getCompileId();
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
cfg.setCompileId(compileId);
|
||||
@@ -200,41 +185,13 @@ public class ComplexStringCfgController extends BaseController{
|
||||
cfg.setEditTime(new Date());
|
||||
complexStringCfgService.updateStringCfg(cfg);
|
||||
}
|
||||
model.addAttribute("serviceId",serviceId);
|
||||
model.addAttribute("action",cfg.getAction());
|
||||
addMessage(model,"保存成功,正在为您跳转页面...");
|
||||
}else if(cfg.getServiceId()!=null){
|
||||
int serviceId=cfg.getServiceId();
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
String tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
long compileId=getCompileId(cfg);
|
||||
cfg.setTableName(tableName);
|
||||
// cfg.setCreatorId(cfg.getCurrentUser().getId());
|
||||
// cfg.setCreateTime(new Date());
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
cfg.setCompileId(compileId);
|
||||
if(cfg.getCfgId()==null){
|
||||
cfg.setCreatorId(cfg.getCurrentUser().getId());
|
||||
cfg.setCreateTime(new Date());
|
||||
complexStringCfgService.addStringCfg(cfg);
|
||||
}else{
|
||||
cfg.setEditorId(cfg.getCurrentUser().getId());
|
||||
cfg.setEditTime(new Date());
|
||||
complexStringCfgService.updateStringCfg(cfg);
|
||||
}
|
||||
model.addAttribute("serviceId",serviceId);
|
||||
model.addAttribute("action",cfg.getAction());
|
||||
addMessage(model,"保存成功,正在为您跳转页面...");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
logger.error("保存失败!",e);
|
||||
addMessage(model,"保存失败!");
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}
|
||||
return "/cfg/resultPage";//StringEscapeUtils.escapeHtml4("?serviceId="+cfg.getServiceId()+"&action="+cfg.getAction()+"&cfgName="+cfgName);
|
||||
return "/cfg/resultPage";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -250,53 +207,47 @@ public class ComplexStringCfgController extends BaseController{
|
||||
public String auditStringCfg(String cfgName,ComplexkeywordCfg cfg,Model model) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
||||
if(cfg==null){
|
||||
logger.error("无法审核空的配置!");
|
||||
}else if(!StringUtils.isBlank(cfg.getTableName())){
|
||||
int audit=complexStringCfgService.getIsAudit(cfg);
|
||||
model.addAttribute("serviceId", cfg.getServiceId());
|
||||
model.addAttribute("action", cfg.getAction());
|
||||
try{
|
||||
String tableName=cfg.getTableName();
|
||||
String maatTable=null;
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(cfg.getServiceId());
|
||||
if(serviceConfigInfo!=null){
|
||||
if(StringUtils.isBlank(tableName)){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
cfg.setTableName(tableName);
|
||||
}
|
||||
maatTable=serviceConfigInfo.getMaatTable();
|
||||
}
|
||||
ComplexkeywordCfg bean=complexStringCfgService.getStringCfgById(cfg);
|
||||
bean.setTableName(tableName);
|
||||
int audit=bean.getIsAudit().intValue();
|
||||
if(audit==Constants.AUDIT_YES&&cfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
|
||||
logger.error("审核通过的配置只能取消审核通过!");
|
||||
}else{
|
||||
cfg.setAuditorId(cfg.getCurrentUser().getId());
|
||||
cfg.setAuditTime(new Date());
|
||||
|
||||
bean.setIsAudit(cfg.getIsAudit());
|
||||
if(cfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
bean.setIsValid(Constants.VALID_NO);
|
||||
bean.setMaatTable(maatTable);
|
||||
}else if(cfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
bean.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
int result=complexStringCfgService.auditStringCfg(cfg);
|
||||
model.addAttribute("serviceId", cfg.getServiceId());
|
||||
model.addAttribute("action", cfg.getAction());
|
||||
}
|
||||
|
||||
}else if(cfg.getServiceId()!=null){
|
||||
int serviceId=cfg.getServiceId();
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
String tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
cfg.setTableName(tableName);
|
||||
int audit=complexStringCfgService.getIsAudit(cfg);
|
||||
if(audit==Constants.AUDIT_YES&&cfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
|
||||
logger.error("审核通过的配置只能取消审核通过!");
|
||||
}else{
|
||||
cfg.setAuditorId(cfg.getCurrentUser().getId());
|
||||
cfg.setAuditTime(new Date());
|
||||
|
||||
if(cfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
}else if(cfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
int result=complexStringCfgService.auditStringCfg(cfg);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", cfg.getAction());
|
||||
}
|
||||
int result=complexStringCfgService.auditStringCfg(bean,cfg);
|
||||
if(result!=0){
|
||||
addMessage(model,"审核成功!");
|
||||
}else{
|
||||
addMessage(model,"审核失败!");
|
||||
}
|
||||
|
||||
}
|
||||
}else{
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}catch(Exception e){
|
||||
logger.error("发生异常",e);
|
||||
addMessage(model,"审核失败!");
|
||||
}
|
||||
return "redirect:" + adminPath + "/cfg/complex/list";
|
||||
}
|
||||
@@ -316,7 +267,13 @@ public class ComplexStringCfgController extends BaseController{
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("cfgType","complex");
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
try{
|
||||
if(StringUtils.isBlank(tableName)){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
}
|
||||
}
|
||||
int audit=complexStringCfgService.getIsAudit(tableName,cfgId);
|
||||
//未审核时可删除
|
||||
if(audit!=Constants.AUDIT_YES){
|
||||
@@ -332,29 +289,9 @@ public class ComplexStringCfgController extends BaseController{
|
||||
logger.error("通过审核的配置不能删除!");
|
||||
}
|
||||
|
||||
}else if(serviceId!=null){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
ComplexkeywordCfg cfg=new ComplexkeywordCfg();
|
||||
cfg.setCfgId(cfgId);
|
||||
cfg.setTableName(tableName);
|
||||
int audit=complexStringCfgService.getIsAudit(cfg);
|
||||
//未审核时可删除
|
||||
if(audit!=Constants.AUDIT_YES){
|
||||
cfg.setEditorId(cfg.getCurrentUser().getId());
|
||||
cfg.setEditTime(new Date());
|
||||
cfg.setIsValid(Constants.VALID_DEL);
|
||||
int result=complexStringCfgService.deleteStringCfg(cfg);
|
||||
addMessage(model,"删除成功,正在为您跳转页面...");
|
||||
}else{
|
||||
logger.error("通过审核的配置不能删除!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}catch(Exception e){
|
||||
logger.error("删除失败", e);
|
||||
addMessage(model,"删除失败!");
|
||||
}
|
||||
return "/cfg/resultPage";
|
||||
}
|
||||
@@ -367,7 +304,14 @@ public class ComplexStringCfgController extends BaseController{
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected long getCompileId(BaseCfg cfg){
|
||||
return 0;
|
||||
protected long getCompileId(ComplexkeywordCfg cfg){
|
||||
long compileId=0l;
|
||||
try {
|
||||
compileId = cfg.getCompileId()==null?new ConvertTool().getCompileId():cfg.getCompileId();
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
return compileId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.nis.domain.ServiceConfigInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.main.ConvertTool;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@@ -123,7 +124,6 @@ public class IpCfgController extends BaseController{
|
||||
ipcfg.setAction(action);
|
||||
ipcfg.setServiceId(serviceId);
|
||||
model.addAttribute("_cfg", ipcfg);
|
||||
long compileId=this.getCompileId();
|
||||
model.addAttribute("tableName", tableName);
|
||||
List<RequestInfo> requestInfos=requestInfoService.getValidRequestInfo();
|
||||
model.addAttribute("requestInfos", requestInfos);
|
||||
@@ -230,13 +230,21 @@ public class IpCfgController extends BaseController{
|
||||
model.addAttribute("cfgName",cfgName);
|
||||
model.addAttribute("cfgType", "ip");
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
model.addAttribute("serviceId",ipCfg.getServiceId());
|
||||
model.addAttribute("action",ipCfg.getAction());
|
||||
model.addAttribute("tableName", ipCfg.getTableName());
|
||||
logger.info("saveOrUpdateIpCfg loaded");
|
||||
if(ipCfg==null){
|
||||
logger.error("无法保存空的配置!");
|
||||
addMessage(model,"保存失败!");
|
||||
}else if(!StringUtils.isBlank(ipCfg.getTableName())){
|
||||
try{
|
||||
String tableName=ipCfg.getTableName();
|
||||
int serviceId=ipCfg.getServiceId();
|
||||
long compileId=getCompileId();
|
||||
if(StringUtils.isBlank(tableName)){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
ipCfg.setTableName(tableName);
|
||||
}
|
||||
}
|
||||
int compileId=new ConvertTool().getCompileId().intValue();
|
||||
ipCfg.setIsValid(Constants.VALID_NO);
|
||||
ipCfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
ipCfg.setCompileId(compileId);
|
||||
@@ -249,42 +257,12 @@ public class IpCfgController extends BaseController{
|
||||
ipCfg.setEditTime(new Date());
|
||||
ipCfgService.updateIpCfg(ipCfg);
|
||||
}
|
||||
model.addAttribute("serviceId",serviceId);
|
||||
model.addAttribute("action",ipCfg.getAction());
|
||||
model.addAttribute("tableName", ipCfg.getTableName());
|
||||
addMessage(model,"保存成功,正在为您跳转页面...");
|
||||
}else if(ipCfg.getServiceId()!=null){
|
||||
int serviceId=ipCfg.getServiceId();
|
||||
model.addAttribute("serviceId",serviceId);
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
String tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
long compileId=getCompileId();
|
||||
ipCfg.setTableName(tableName);
|
||||
// ipCfg.setCreatorId(ipCfg.getCurrentUser().getId());
|
||||
// ipCfg.setCreateTime(new Date());
|
||||
ipCfg.setIsValid(Constants.VALID_NO);
|
||||
ipCfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
ipCfg.setCompileId(compileId);
|
||||
if(ipCfg.getCfgId()==null){
|
||||
ipCfg.setCreatorId(ipCfg.getCurrentUser().getId());
|
||||
ipCfg.setCreateTime(new Date());
|
||||
}else{
|
||||
ipCfg.setEditorId(ipCfg.getCurrentUser().getId());
|
||||
ipCfg.setEditTime(new Date());
|
||||
ipCfgService.updateIpCfg(ipCfg);
|
||||
}
|
||||
model.addAttribute("action",ipCfg.getAction());
|
||||
model.addAttribute("tableName", ipCfg.getTableName());
|
||||
addMessage(model,"保存成功,正在为您跳转页面...");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
}catch(Exception e){
|
||||
logger.error("保存失败",e);
|
||||
addMessage(model,"保存失败!");
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}
|
||||
return "/cfg/resultPage";//StringEscapeUtils.escapeHtml4("?serviceId="+ipCfg.getServiceId()+"&action="+ipCfg.getAction()+"&cfgName="+cfgName);
|
||||
return "/cfg/resultPage";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -300,52 +278,47 @@ public class IpCfgController extends BaseController{
|
||||
public String auditIpCfg(String cfgName,BaseIpCfg ipCfg,Model model) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
||||
if(ipCfg==null){
|
||||
logger.error("无法审核空的配置!");
|
||||
}else if(!StringUtils.isBlank(ipCfg.getTableName())){
|
||||
int audit=ipCfgService.getIsAudit(ipCfg);
|
||||
model.addAttribute("serviceId", ipCfg.getServiceId());
|
||||
model.addAttribute("action", ipCfg.getAction());
|
||||
try{
|
||||
String tableName=ipCfg.getTableName();
|
||||
String maatTable=null;
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(ipCfg.getServiceId());
|
||||
if(serviceConfigInfo!=null){
|
||||
if(StringUtils.isBlank(tableName)){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
ipCfg.setTableName(tableName);
|
||||
}
|
||||
maatTable=serviceConfigInfo.getMaatTable();
|
||||
}
|
||||
BaseIpCfg bean=ipCfgService.getIpCfgById(ipCfg);
|
||||
bean.setTableName(tableName);
|
||||
int audit=bean.getIsAudit().intValue();
|
||||
if(audit==Constants.AUDIT_YES&&ipCfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
|
||||
logger.error("审核通过的配置只能取消审核通过!");
|
||||
}else{
|
||||
ipCfg.setAuditorId(ipCfg.getCurrentUser().getId());
|
||||
ipCfg.setAuditTime(new Date());
|
||||
|
||||
bean.setIsAudit(ipCfg.getIsAudit());
|
||||
if(ipCfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||
ipCfg.setIsValid(Constants.VALID_NO);
|
||||
bean.setIsValid(Constants.VALID_NO);
|
||||
bean.setMaatTable(maatTable);
|
||||
}else if(ipCfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
ipCfg.setIsValid(Constants.VALID_YES);
|
||||
bean.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
int result=ipCfgService.auditIpCfg(ipCfg);
|
||||
model.addAttribute("serviceId", ipCfg.getServiceId());
|
||||
model.addAttribute("action", ipCfg.getAction());
|
||||
}
|
||||
}else if(ipCfg.getServiceId()!=null){
|
||||
int serviceId=ipCfg.getServiceId();
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
String tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
ipCfg.setTableName(tableName);
|
||||
int audit=ipCfgService.getIsAudit(ipCfg);
|
||||
if(audit==Constants.AUDIT_YES&&ipCfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
|
||||
logger.error("审核通过的配置只能取消审核通过!");
|
||||
}else{
|
||||
ipCfg.setAuditorId(ipCfg.getCurrentUser().getId());
|
||||
ipCfg.setAuditTime(new Date());
|
||||
|
||||
if(ipCfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||
ipCfg.setIsValid(Constants.VALID_NO);
|
||||
}else if(ipCfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
ipCfg.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
int result=ipCfgService.auditIpCfg(ipCfg);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", ipCfg.getAction());
|
||||
}
|
||||
int result=ipCfgService.auditIpCfg(bean,ipCfg);
|
||||
if(result!=0){
|
||||
addMessage(model,"审核成功!");
|
||||
}else{
|
||||
addMessage(model, "审核失败");
|
||||
}
|
||||
|
||||
}
|
||||
}else{
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}catch(Exception e){
|
||||
logger.error("审核失败", e);
|
||||
addMessage(model, "审核失败");
|
||||
}
|
||||
return "redirect:" + adminPath + "/cfg/ip/list";
|
||||
}
|
||||
@@ -366,7 +339,13 @@ public class IpCfgController extends BaseController{
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("cfgType", "ip");
|
||||
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
try{
|
||||
if(StringUtils.isBlank(tableName)){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
}
|
||||
}
|
||||
int audit=ipCfgService.getIsAudit(tableName,cfgId);
|
||||
//未审核时可删除
|
||||
if(audit!=Constants.AUDIT_YES){
|
||||
@@ -381,32 +360,11 @@ public class IpCfgController extends BaseController{
|
||||
addMessage(model,"删除成功,正在为您跳转页面...");
|
||||
}else{
|
||||
logger.error("通过审核的配置不能删除!");
|
||||
addMessage(model,"删除失败!");
|
||||
}
|
||||
|
||||
}else if(serviceId!=null){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
BaseIpCfg ipCfg=new BaseIpCfg();
|
||||
ipCfg.setCfgId(cfgId);
|
||||
ipCfg.setTableName(tableName);
|
||||
int audit=ipCfgService.getIsAudit(ipCfg);
|
||||
//未审核时可删除
|
||||
if(audit!=Constants.AUDIT_YES){
|
||||
ipCfg.setEditorId(ipCfg.getCurrentUser().getId());
|
||||
ipCfg.setEditTime(new Date());
|
||||
ipCfg.setIsValid(Constants.VALID_DEL);
|
||||
int result=ipCfgService.deleteIpCfg(ipCfg);
|
||||
model.addAttribute("tableName", tableName);
|
||||
addMessage(model,"删除成功,正在为您跳转页面...");
|
||||
}else{
|
||||
logger.error("通过审核的配置不能删除!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}catch(Exception e){
|
||||
logger.error("删除失败", e);
|
||||
addMessage(model,"删除失败!");
|
||||
}
|
||||
return "/cfg/resultPage";
|
||||
}
|
||||
@@ -419,7 +377,14 @@ public class IpCfgController extends BaseController{
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected long getCompileId(){
|
||||
return 0;
|
||||
protected long getCompileId(BaseIpCfg cfg){
|
||||
long compileId=0l;
|
||||
try {
|
||||
compileId = cfg.getCompileId()==null?new ConvertTool().getCompileId():cfg.getCompileId();
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
return compileId;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -13,9 +13,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.ServiceConfigInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
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.util.Constants;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@@ -27,7 +28,6 @@ import com.nis.web.controller.BaseController;
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/cfg/num")
|
||||
public class NumCfgController extends BaseController{
|
||||
|
||||
@RequestMapping(value = {"list"})
|
||||
public String cfgList(Model model,Integer audit,Integer pageNo,Integer pageSize,String cfgName,@ModelAttribute("cfg")NumBoundaryCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
@@ -136,16 +136,11 @@ public class NumCfgController extends BaseController{
|
||||
model.addAttribute("cfgType","num");
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
logger.info("saveOrUpdateStringCfg loaded");
|
||||
if(cfg==null){
|
||||
logger.error("无法保存空的配置!");
|
||||
addMessage(model,"保存失败!");
|
||||
}else if(cfg.getServiceId()!=null){
|
||||
try{
|
||||
int serviceId=cfg.getServiceId();
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
long compileId=getCompileId(cfg);
|
||||
// cfg.setCreatorId(cfg.getCurrentUser().getId());
|
||||
// cfg.setCreateTime(new Date());
|
||||
int compileId=new ConvertTool().getCompileId();
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
cfg.setCompileId(compileId);
|
||||
@@ -162,11 +157,11 @@ public class NumCfgController extends BaseController{
|
||||
model.addAttribute("action",cfg.getAction());
|
||||
addMessage(model,"保存成功,正在为您跳转页面...");
|
||||
}
|
||||
}else{
|
||||
}catch(Exception e){
|
||||
logger.error("保存失败", e);
|
||||
addMessage(model,"保存失败!");
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}
|
||||
return "/cfg/resultPage";//StringEscapeUtils.escapeHtml4("?serviceId="+cfg.getServiceId()+"&action="+cfg.getAction()+"&cfgName="+cfgName);
|
||||
return "/cfg/resultPage";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -182,31 +177,42 @@ public class NumCfgController extends BaseController{
|
||||
public String auditStringCfg(String cfgName,NumBoundaryCfg cfg,Model model) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
||||
if(cfg==null){
|
||||
logger.error("无法审核空的配置!");
|
||||
}else if(cfg.getServiceId()!=null){
|
||||
model.addAttribute("serviceId", cfg.getServiceId());
|
||||
model.addAttribute("action", cfg.getAction());
|
||||
try{
|
||||
int serviceId=cfg.getServiceId();
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
int audit=numCfgService.getIsAudit(cfg);
|
||||
NumBoundaryCfg bean=numCfgService.getNumCfgById(cfg);
|
||||
bean.setTableName(serviceConfigInfo.getTableName());
|
||||
int audit=bean.getIsAudit().intValue();
|
||||
if(audit==Constants.AUDIT_YES&&cfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
|
||||
logger.error("审核通过的配置只能取消审核通过!");
|
||||
}else{
|
||||
cfg.setAuditorId(cfg.getCurrentUser().getId());
|
||||
cfg.setAuditTime(new Date());
|
||||
|
||||
bean.setIsAudit(cfg.getIsAudit());
|
||||
if(cfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
bean.setIsValid(Constants.VALID_NO);
|
||||
bean.setMaatTable(serviceConfigInfo.getMaatTable());
|
||||
}else if(cfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
bean.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
int result=numCfgService.auditNumCfg(cfg);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", cfg.getAction());
|
||||
int result=numCfgService.auditNumCfg(bean,cfg);
|
||||
if(result!=0){
|
||||
addMessage(model, "审核成功");
|
||||
}else{
|
||||
addMessage(model, "审核失败");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
logger.error("审核失败",e);
|
||||
addMessage(model, "审核失败");
|
||||
}
|
||||
return "redirect:" + adminPath + "/cfg/num/list";
|
||||
}
|
||||
@@ -257,7 +263,14 @@ public class NumCfgController extends BaseController{
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected long getCompileId(BaseCfg cfg){
|
||||
return 0;
|
||||
protected long getCompileId(NumBoundaryCfg cfg){
|
||||
long compileId=0l;
|
||||
try {
|
||||
compileId = cfg.getCompileId()==null?new ConvertTool().getCompileId():cfg.getCompileId();
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
return compileId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,9 +14,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.ServiceConfigInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.main.ConvertTool;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@@ -121,7 +122,13 @@ public class StringCfgController extends BaseController{
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("tableName", tableName);
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
try{
|
||||
if(StringUtils.isBlank(tableName)){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
}
|
||||
}
|
||||
logger.info("table name is "+tableName);
|
||||
BaseStringCfg searchBean=new BaseStringCfg();
|
||||
searchBean.setCfgId(cfgId);
|
||||
@@ -136,32 +143,10 @@ public class StringCfgController extends BaseController{
|
||||
model.addAttribute("xzs", xzs);
|
||||
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
|
||||
model.addAttribute("lables", lables);
|
||||
}else if(serviceId!=null){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
logger.info("table name is "+tableName);
|
||||
BaseStringCfg searchBean=new BaseStringCfg();
|
||||
searchBean.setCfgId(cfgId);
|
||||
searchBean.setTableName(tableName);
|
||||
BaseStringCfg stringCfg=stringCfgService.getStringCfgById(searchBean);
|
||||
model.addAttribute("_cfg", stringCfg);
|
||||
List<RequestInfo> requestInfos=requestInfoService.getAllRequestInfo();
|
||||
model.addAttribute("requestInfos", requestInfos);
|
||||
List<ServiceDictInfo> fls=serviceDictInfoService.findAllFlDict();
|
||||
model.addAttribute("fls", fls);
|
||||
List<ServiceDictInfo> xzs=serviceDictInfoService.findAllXzDict();
|
||||
model.addAttribute("xzs", xzs);
|
||||
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
|
||||
model.addAttribute("lables", lables);
|
||||
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.error("未获取到正确的表名");
|
||||
}catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
logger.error("发生异常",e);
|
||||
}
|
||||
|
||||
return "/cfg/stringCfgForm";
|
||||
}
|
||||
|
||||
@@ -179,15 +164,20 @@ public class StringCfgController extends BaseController{
|
||||
model.addAttribute("cfgName",cfgName);
|
||||
model.addAttribute("cfgType","string");
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
model.addAttribute("serviceId",stringCfg.getServiceId());
|
||||
model.addAttribute("action",stringCfg.getAction());
|
||||
logger.info("saveOrUpdateStringCfg loaded");
|
||||
if(stringCfg==null){
|
||||
logger.error("无法保存空的配置!");
|
||||
addMessage(model,"保存失败!");
|
||||
}else if(!StringUtils.isBlank(stringCfg.getTableName())){
|
||||
try{
|
||||
String tableName=stringCfg.getTableName();
|
||||
int serviceId=stringCfg.getServiceId();
|
||||
long compileId=getCompileId(stringCfg);
|
||||
// stringCfg.setCreatorId(stringCfg.getCurrentUser().getId());
|
||||
// stringCfg.setCreateTime(new Date());
|
||||
if(StringUtils.isBlank(stringCfg.getTableName())){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
stringCfg.setTableName(tableName);
|
||||
}
|
||||
}
|
||||
int compileId=new ConvertTool().getCompileId();
|
||||
stringCfg.setIsValid(Constants.VALID_NO);
|
||||
stringCfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
stringCfg.setCompileId(compileId);
|
||||
@@ -200,41 +190,13 @@ public class StringCfgController extends BaseController{
|
||||
stringCfg.setEditTime(new Date());
|
||||
stringCfgService.updateStringCfg(stringCfg);
|
||||
}
|
||||
model.addAttribute("serviceId",serviceId);
|
||||
model.addAttribute("action",stringCfg.getAction());
|
||||
addMessage(model,"保存成功,正在为您跳转页面...");
|
||||
}else if(stringCfg.getServiceId()!=null){
|
||||
int serviceId=stringCfg.getServiceId();
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
String tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
long compileId=getCompileId(stringCfg);
|
||||
stringCfg.setTableName(tableName);
|
||||
// stringCfg.setCreatorId(stringCfg.getCurrentUser().getId());
|
||||
// stringCfg.setCreateTime(new Date());
|
||||
stringCfg.setIsValid(Constants.VALID_NO);
|
||||
stringCfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
stringCfg.setCompileId(compileId);
|
||||
if(stringCfg.getCfgId()==null){
|
||||
stringCfg.setCreatorId(stringCfg.getCurrentUser().getId());
|
||||
stringCfg.setCreateTime(new Date());
|
||||
stringCfgService.addStringCfg(stringCfg);
|
||||
}else{
|
||||
stringCfg.setEditorId(stringCfg.getCurrentUser().getId());
|
||||
stringCfg.setEditTime(new Date());
|
||||
stringCfgService.updateStringCfg(stringCfg);
|
||||
}
|
||||
model.addAttribute("serviceId",serviceId);
|
||||
model.addAttribute("action",stringCfg.getAction());
|
||||
addMessage(model,"保存成功,正在为您跳转页面...");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
addMessage(model,"保存失败!");
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
logger.error("保存失败!",e);
|
||||
addMessage(model,"保存失败!");
|
||||
}
|
||||
return "/cfg/resultPage";//StringEscapeUtils.escapeHtml4("?serviceId="+stringCfg.getServiceId()+"&action="+stringCfg.getAction()+"&cfgName="+cfgName);
|
||||
return "/cfg/resultPage";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -250,53 +212,50 @@ public class StringCfgController extends BaseController{
|
||||
public String auditStringCfg(String cfgName,BaseStringCfg stringCfg,Model model) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
||||
if(stringCfg==null){
|
||||
logger.error("无法审核空的配置!");
|
||||
}else if(!StringUtils.isBlank(stringCfg.getTableName())){
|
||||
int audit=stringCfgService.getIsAudit(stringCfg);
|
||||
model.addAttribute("serviceId", stringCfg.getServiceId());
|
||||
model.addAttribute("action", stringCfg.getAction());
|
||||
try{
|
||||
String tableName=stringCfg.getTableName();
|
||||
int serviceId=stringCfg.getServiceId();
|
||||
String maatTable=null;
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
if(StringUtils.isBlank(tableName)){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
stringCfg.setTableName(tableName);
|
||||
}
|
||||
maatTable=serviceConfigInfo.getMaatTable();
|
||||
}
|
||||
|
||||
BaseStringCfg bean=stringCfgService.getStringCfgById(stringCfg);
|
||||
bean.setTableName(tableName);
|
||||
int audit=bean.getIsAudit().intValue();
|
||||
if(audit==Constants.AUDIT_YES&&stringCfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
|
||||
logger.error("审核通过的配置只能取消审核通过!");
|
||||
}else{
|
||||
stringCfg.setAuditorId(stringCfg.getCurrentUser().getId());
|
||||
stringCfg.setAuditTime(new Date());
|
||||
|
||||
bean.setIsAudit(stringCfg.getIsAudit());
|
||||
if(stringCfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||
stringCfg.setIsValid(Constants.VALID_NO);
|
||||
bean.setIsValid(Constants.VALID_NO);
|
||||
bean.setMaatTable(maatTable);
|
||||
}else if(stringCfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
stringCfg.setIsValid(Constants.VALID_YES);
|
||||
bean.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
int result=stringCfgService.auditStringCfg(stringCfg);
|
||||
model.addAttribute("serviceId", stringCfg.getServiceId());
|
||||
model.addAttribute("action", stringCfg.getAction());
|
||||
}
|
||||
|
||||
}else if(stringCfg.getServiceId()!=null){
|
||||
int serviceId=stringCfg.getServiceId();
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
String tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
stringCfg.setTableName(tableName);
|
||||
int audit=stringCfgService.getIsAudit(stringCfg);
|
||||
if(audit==Constants.AUDIT_YES&&stringCfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
|
||||
logger.error("审核通过的配置只能取消审核通过!");
|
||||
}else{
|
||||
stringCfg.setAuditorId(stringCfg.getCurrentUser().getId());
|
||||
stringCfg.setAuditTime(new Date());
|
||||
|
||||
if(stringCfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||
stringCfg.setIsValid(Constants.VALID_NO);
|
||||
}else if(stringCfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
stringCfg.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
int result=stringCfgService.auditStringCfg(stringCfg);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", stringCfg.getAction());
|
||||
}
|
||||
int result=stringCfgService.auditStringCfg(bean,stringCfg);
|
||||
if(result!=0){
|
||||
addMessage(model,"审核成功!");
|
||||
}else{
|
||||
addMessage(model,"审核失败!");
|
||||
}
|
||||
|
||||
}
|
||||
}else{
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
logger.error("审核失败", e);
|
||||
addMessage(model,"审核失败!");
|
||||
}
|
||||
return "redirect:" + adminPath + "/cfg/string/list";
|
||||
}
|
||||
@@ -316,7 +275,13 @@ public class StringCfgController extends BaseController{
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("cfgType","string");
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
try{
|
||||
if(StringUtils.isBlank(tableName)){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
}
|
||||
}
|
||||
int audit=stringCfgService.getIsAudit(tableName,cfgId);
|
||||
//未审核时可删除
|
||||
if(audit!=Constants.AUDIT_YES){
|
||||
@@ -332,42 +297,10 @@ public class StringCfgController extends BaseController{
|
||||
logger.error("通过审核的配置不能删除!");
|
||||
}
|
||||
|
||||
}else if(serviceId!=null){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
BaseStringCfg stringCfg=new BaseStringCfg();
|
||||
stringCfg.setCfgId(cfgId);
|
||||
stringCfg.setTableName(tableName);
|
||||
int audit=stringCfgService.getIsAudit(stringCfg);
|
||||
//未审核时可删除
|
||||
if(audit!=Constants.AUDIT_YES){
|
||||
stringCfg.setEditorId(stringCfg.getCurrentUser().getId());
|
||||
stringCfg.setEditTime(new Date());
|
||||
stringCfg.setIsValid(Constants.VALID_DEL);
|
||||
int result=stringCfgService.deleteStringCfg(stringCfg);
|
||||
addMessage(model,"删除成功,正在为您跳转页面...");
|
||||
}else{
|
||||
logger.error("通过审核的配置不能删除!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}catch(Exception e){
|
||||
logger.error("删除失败",e);
|
||||
addMessage(model,"删除失败!");
|
||||
}
|
||||
return "/cfg/resultPage";
|
||||
}
|
||||
/**
|
||||
*
|
||||
* getCompileId(获取编译ID)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @return
|
||||
*long
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected long getCompileId(BaseCfg cfg){
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user