(1)maat配置转换0.0.1版本jar提交,获取编译id可用,审核,取消审核部分报错,待凯歌修复完成测试通过之后更新版本。
(2)基础类配置精简后台代码,加入了从maat转换工具获取编译ID。审核,取消审核目前不可用,等jar包修复完成继续调整。 (3)编译ID字段改为int类型 (4)多域类配置后台提交。查询采用查一张主表,根据主表中的编译ID分开查其他表的方式关联。界面功能尚在调整。
This commit is contained in:
@@ -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