Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
package com.nis.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -13,16 +13,11 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.mapping.ResultMap;
|
||||
import org.apache.ibatis.mapping.ResultMapping;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.nis.util.Configurations;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.CookieUtil;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
|
||||
/**
|
||||
* 分页类
|
||||
@@ -52,7 +47,7 @@ public class Page<T> {
|
||||
|
||||
private String orderBy = ""; // 标准查询有效, 实例: updatedate desc, name asc
|
||||
|
||||
private String fields ="";//制定资源的字段
|
||||
private String fields;//制定资源的字段
|
||||
|
||||
private String where;
|
||||
|
||||
@@ -63,10 +58,9 @@ public class Page<T> {
|
||||
private String message = ""; // 设置提示消息,显示在“共n条”之后
|
||||
|
||||
public Page() {
|
||||
this.pageSize = pageSize;
|
||||
this.pageSize = -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
* @param request 传递 repage 参数,来记住页码
|
||||
@@ -74,27 +68,11 @@ public class Page<T> {
|
||||
*/
|
||||
public Page(HttpServletRequest request, HttpServletResponse response){
|
||||
|
||||
this(request, response,Integer.valueOf(Configurations.getIntProperty("page.pageSize", 30)));
|
||||
|
||||
}
|
||||
/**
|
||||
* 构造方法
|
||||
* @param request 传递 repage 参数,来记住页码
|
||||
* @param response 用于设置 Cookie,记住页码
|
||||
*
|
||||
*/
|
||||
public Page(HttpServletRequest request, HttpServletResponse response,Class clazz){
|
||||
|
||||
this(request, response,clazz.getSimpleName(),Integer.valueOf(Configurations.getIntProperty("page.pageSize", 30)));
|
||||
|
||||
}
|
||||
public Page(HttpServletRequest request, HttpServletResponse response,int defaultPageSize){
|
||||
|
||||
this(request, response,"",Integer.valueOf(Configurations.getIntProperty("page.pageSize", 30)));
|
||||
this(request, response, Integer.valueOf(Configurations.getIntProperty("page.pageSize", 30)));
|
||||
|
||||
}
|
||||
|
||||
public Page(HttpServletRequest request, HttpServletResponse response,String className, int defaultPageSize){
|
||||
public Page(HttpServletRequest request, HttpServletResponse response, int defaultPageSize){
|
||||
try {
|
||||
// 设置页码参数(传递repage参数,来记住页码)
|
||||
String no = request.getParameter("pageNo");
|
||||
@@ -111,7 +89,13 @@ public class Page<T> {
|
||||
}
|
||||
|
||||
// 设置页面大小参数(传递repage参数,来记住页码大小)
|
||||
String size = request.getParameter("pageSize");
|
||||
String size = "";
|
||||
if(defaultPageSize==-1){
|
||||
size = "-1";
|
||||
}else{
|
||||
size = request.getParameter("pageSize");
|
||||
|
||||
}
|
||||
if (StringUtils.isNotBlank(size)) {
|
||||
|
||||
if (StringUtils.isNumeric(size) || size.equals("-1")){
|
||||
@@ -126,24 +110,20 @@ public class Page<T> {
|
||||
} else {
|
||||
this.pageSize = defaultPageSize;
|
||||
}
|
||||
//超出每页最大显示条数,取限制的最大条数
|
||||
if(this.pageSize > Constants.MAX_PAGE_SIZE){
|
||||
this.pageSize = Constants.MAX_PAGE_SIZE;
|
||||
}
|
||||
|
||||
String fields = request.getParameter("fields");
|
||||
if (StringUtils.isNotBlank(fields)){
|
||||
fields=getFiledsSql(className, fields);
|
||||
this.setFields(fields);
|
||||
}
|
||||
|
||||
// 设置排序参数
|
||||
String orderBy = request.getParameter("orderBy");
|
||||
if (StringUtils.isNotBlank(orderBy)){
|
||||
orderBy=getOrderBySql(className, orderBy);
|
||||
this.setOrderBy(orderBy);
|
||||
}
|
||||
this.count=Integer.valueOf(Configurations.getIntProperty("page.count", -1));
|
||||
|
||||
this.setWhere(getWhere(request));
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -334,8 +314,8 @@ public class Page<T> {
|
||||
sb.append("<li class=\"disabled controls\"><a href=\"javascript:\">当前 ");
|
||||
sb.append("<input type=\"text\" value=\""+pageNo+"\" onkeypress=\"var e=window.event||this;var c=e.keyCode||e.which;if(c==13)");
|
||||
sb.append(funcName+"(this.value,"+pageSize+",'"+funcParam+"');\" onclick=\"this.select();\"/> / ");
|
||||
sb.append("<input type=\"text\" value=\""+pageSize+"\" onkeypress=\"var e=window.event||this;var c=e.keyCode||e.which;if(c==13)");
|
||||
sb.append(funcName+"("+pageNo+",this.value,'"+funcParam+"');\" onclick=\"this.select();\"/> 条,");
|
||||
sb.append("<input type=\"text\" value=\""+last+"\" onkeypress=\"var e=window.event||this;var c=e.keyCode||e.which;if(c==13)");
|
||||
sb.append(funcName+"("+pageNo+",this.value,'"+funcParam+"');\" onclick=\"this.select();\"/> 页,");
|
||||
sb.append("共 " + count + " 条"+(message!=null?message:"")+"</a></li>\n");
|
||||
|
||||
sb.insert(0,"<ul>\n").append("</ul>\n");
|
||||
@@ -643,138 +623,37 @@ public class Page<T> {
|
||||
public int getMaxResults(){
|
||||
return getPageSize();
|
||||
}
|
||||
/**
|
||||
* @Title: getFiledsSql
|
||||
* @Description: 将fields的属性名称替换为字段名称
|
||||
* @param @param mapName
|
||||
* @param @param fileds
|
||||
* @param @return
|
||||
* @param @throws Exception
|
||||
* @return Map 返回类型
|
||||
* @author (DDM)
|
||||
* @version V1.0
|
||||
*/
|
||||
@JsonIgnore
|
||||
public String getFiledsSql(String mapName,String fileds) throws Exception{
|
||||
String[] fieldsColoumn=null;
|
||||
String orderByStr="";
|
||||
//所有字段名
|
||||
List<String> columnList=new ArrayList<String>();
|
||||
//所有属性名
|
||||
List<String> propertyList=new ArrayList<String>();
|
||||
//属性名称为key,字段名称为value
|
||||
Map<String, String> columnMap=new HashMap<String, String>();
|
||||
|
||||
if(!StringUtil.isBlank(fileds)){
|
||||
//解析Fileds的字段/属性名称
|
||||
fieldsColoumn=fileds.split(",");
|
||||
|
||||
//从resultMap中获取字段名称和属性名称
|
||||
if(fieldsColoumn != null){
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
ResultMap map= sqlSessionFactory.getConfiguration().getResultMap(mapName+"Map");
|
||||
List<ResultMapping> mapping= map.getResultMappings();
|
||||
for(ResultMapping mapp:mapping){
|
||||
columnList.add(mapp.getColumn().toLowerCase());
|
||||
propertyList.add(mapp.getProperty());
|
||||
columnMap.put(mapp.getProperty(), mapp.getColumn());
|
||||
}
|
||||
}
|
||||
if(fieldsColoumn != null){
|
||||
fileds="";
|
||||
for (String column : fieldsColoumn) {
|
||||
if(!StringUtil.isBlank(column)){
|
||||
column=column.trim();
|
||||
if(columnList.contains(column.toLowerCase())){
|
||||
fileds+=","+column;
|
||||
}else if(propertyList.contains(column)){
|
||||
fileds+=","+columnMap.get(column).toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!StringUtil.isBlank(fileds)){
|
||||
fileds=fileds.substring(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return fileds;
|
||||
}
|
||||
/**
|
||||
* @Title: getOrderBySql
|
||||
* @Description: 将orderBy的属性名称替换为字段名称
|
||||
* @param @param mapName
|
||||
* @param @param orderBy
|
||||
* @param @return
|
||||
* @param @throws Exception
|
||||
* @return Map 返回类型
|
||||
* @author (DDM)
|
||||
* @version V1.0
|
||||
*/
|
||||
@JsonIgnore
|
||||
public static String getOrderBySql(String mapName,String orderBy) throws Exception{
|
||||
String[] orderByColoumn=null;
|
||||
//所有字段名
|
||||
List<String> columnList=new ArrayList<String>();
|
||||
//所有属性名
|
||||
List<String> propertyList=new ArrayList<String>();
|
||||
Map<String, String> columnMap=new HashMap<String, String>();
|
||||
|
||||
if(!StringUtil.isBlank(orderBy)){
|
||||
//解析orderBy的字段/属性名称
|
||||
orderByColoumn=orderBy.split(",");
|
||||
//从resultMap中获取字段名称和属性名称
|
||||
if(orderByColoumn != null){
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
ResultMap map= sqlSessionFactory.getConfiguration().getResultMap(mapName+"Map");
|
||||
List<ResultMapping> mapping= map.getResultMappings();
|
||||
for(ResultMapping mapp:mapping){
|
||||
columnList.add(mapp.getColumn().toLowerCase());
|
||||
propertyList.add(mapp.getProperty());
|
||||
columnMap.put(mapp.getProperty(), mapp.getColumn());
|
||||
}
|
||||
}
|
||||
if(orderByColoumn != null){
|
||||
orderBy="";
|
||||
for (String column : orderByColoumn) {
|
||||
if(!StringUtil.isBlank(column)){
|
||||
if(columnList.contains(replaceOrderBy(column))){
|
||||
orderBy+=","+column;
|
||||
}else if(propertyList.contains(replaceOrderBy(column))){
|
||||
//如果是实体类名字则获取对应数据库名字+排序方式
|
||||
orderBy+=","+columnMap.get(replaceOrderBy(column)).toString()
|
||||
+column.replace(replaceOrderBy(column), "");
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!StringUtil.isBlank(orderBy)){
|
||||
orderBy=orderBy.substring(1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return orderBy;
|
||||
}
|
||||
/**
|
||||
* @Title: replaceOrderBy
|
||||
* @Description: 去掉orderBy中的desc和asc
|
||||
* @param @param str
|
||||
* @param @return
|
||||
* @return Map 返回类型
|
||||
* @author (DDM)
|
||||
* @version V1.0
|
||||
*/
|
||||
public static String replaceOrderBy(String str){
|
||||
if(!StringUtil.isBlank(str)){
|
||||
str=str.trim();
|
||||
str=str.replace(" asc","");
|
||||
str=str.replace(" ASC","");
|
||||
str=str.replace(" DESC","");
|
||||
str=str.replace(" desc","");
|
||||
str=str.trim();
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 获取 Spring data JPA 分页对象
|
||||
// */
|
||||
// public Pageable getSpringPage(){
|
||||
// List<Order> orders = new ArrayList<Order>();
|
||||
// if (orderBy!=null){
|
||||
// for (String order : StringUtils.split(orderBy, ",")){
|
||||
// String[] o = StringUtils.split(order, " ");
|
||||
// if (o.length==1){
|
||||
// orders.add(new Order(Direction.ASC, o[0]));
|
||||
// }else if (o.length==2){
|
||||
// if ("DESC".equals(o[1].toUpperCase())){
|
||||
// orders.add(new Order(Direction.DESC, o[0]));
|
||||
// }else{
|
||||
// orders.add(new Order(Direction.ASC, o[0]));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return new PageRequest(this.pageNo - 1, this.pageSize, new Sort(orders));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 设置 Spring data JPA 分页对象,转换为本系统分页对象
|
||||
// */
|
||||
// public void setSpringPage(org.springframework.data.domain.Page<T> page){
|
||||
// this.pageNo = page.getNumber();
|
||||
// this.pageSize = page.getSize();
|
||||
// this.count = page.getTotalElements();
|
||||
// this.list = page.getContent();
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import com.google.gson.GsonBuilder;
|
||||
|
||||
public final class Constants {
|
||||
|
||||
public static final int CFG_PAGE = 0;
|
||||
public static final int AUDIT_PAGE = 1;
|
||||
public static final String DEFAULT_CAPTCHA_PARAM = "captcha";
|
||||
public static final String DEFAULT_MOBILE_PARAM = "mobileLogin";
|
||||
public static final String DEFAULT_MESSAGE_PARAM = "message";
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
package com.nis.web.controller;
|
||||
|
||||
import java.beans.PropertyEditorSupport;
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
package com.nis.web.controller.configuration;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -31,8 +30,9 @@ import com.nis.web.controller.BaseController;
|
||||
public class ComplexStringCfgController extends BaseController{
|
||||
|
||||
@RequestMapping(value = {"list"})
|
||||
public String cfgList(Model model,Integer pageNo,Integer pageSize,String cfgName,@ModelAttribute("cfg")ComplexkeywordCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
public String cfgList(Model model,Integer audit,String cfgName,@ModelAttribute("cfg")ComplexkeywordCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("audit", audit);
|
||||
if(cfg!=null){
|
||||
Integer serviceId=cfg.getServiceId();
|
||||
logger.info("servcice id is "+serviceId);
|
||||
@@ -44,14 +44,7 @@ public class ComplexStringCfgController extends BaseController{
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
logger.info("table name is "+tableName);
|
||||
cfg.setTableName(tableName);
|
||||
Page<ComplexkeywordCfg> searchPage=new Page<ComplexkeywordCfg>(request, response, 1);
|
||||
if(pageNo!=null) searchPage.setPageNo(pageNo);
|
||||
if(pageSize!=null) searchPage.setPageSize(pageSize);
|
||||
if(cfg.getPage()!=null){
|
||||
if(!StringUtils.isBlank(cfg.getPage().getOrderBy()));
|
||||
searchPage.setOrderBy(cfg.getPage().getOrderBy());
|
||||
}
|
||||
Page<ComplexkeywordCfg> page = complexStringCfgService.findPage(searchPage, cfg);
|
||||
Page<ComplexkeywordCfg> page = complexStringCfgService.findPage(new Page<ComplexkeywordCfg>(request, response), cfg);
|
||||
model.addAttribute("page", page);
|
||||
model.addAttribute("action", cfg.getAction());
|
||||
model.addAttribute("tableName", tableName);
|
||||
@@ -79,6 +72,7 @@ public class ComplexStringCfgController extends BaseController{
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
logger.info("sercice id is "+serviceId);
|
||||
if(serviceId!=null){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
@@ -126,6 +120,7 @@ public class ComplexStringCfgController extends BaseController{
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("tableName", tableName);
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
logger.info("table name is "+tableName);
|
||||
ComplexkeywordCfg searchBean=new ComplexkeywordCfg();
|
||||
@@ -183,6 +178,7 @@ public class ComplexStringCfgController extends BaseController{
|
||||
public String saveOrUpdateStringCfg(String cfgName,Model model, ComplexkeywordCfg cfg) {
|
||||
model.addAttribute("cfgName",cfgName);
|
||||
model.addAttribute("cfgType","complex");
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
logger.info("saveOrUpdateStringCfg loaded");
|
||||
if(cfg==null){
|
||||
logger.error("无法保存空的配置!");
|
||||
@@ -253,6 +249,7 @@ public class ComplexStringCfgController extends BaseController{
|
||||
@RequestMapping(value = {"auditCfg"})
|
||||
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())){
|
||||
@@ -269,6 +266,8 @@ public class ComplexStringCfgController extends BaseController{
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
int result=complexStringCfgService.auditStringCfg(cfg);
|
||||
model.addAttribute("serviceId", cfg.getServiceId());
|
||||
model.addAttribute("action", cfg.getAction());
|
||||
}
|
||||
|
||||
}else if(cfg.getServiceId()!=null){
|
||||
@@ -291,13 +290,15 @@ public class ComplexStringCfgController extends BaseController{
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
int result=complexStringCfgService.auditStringCfg(cfg);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", cfg.getAction());
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}
|
||||
return "redirect:" + adminPath + "/cfg/complex/list?serviceId="+cfg.getServiceId()+"&action="+cfg.getAction()+"&cfgName"+cfgName;
|
||||
return "redirect:" + adminPath + "/cfg/complex/list";
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -314,6 +315,7 @@ public class ComplexStringCfgController extends BaseController{
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("cfgType","complex");
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
int audit=complexStringCfgService.getIsAudit(tableName,cfgId);
|
||||
//未审核时可删除
|
||||
|
||||
@@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
@@ -28,21 +29,27 @@ import com.nis.web.controller.BaseController;
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/cfg/ip")
|
||||
public class IpCfgController extends BaseController{
|
||||
|
||||
@RequestMapping(value = {"ipWhiteList"})
|
||||
public String ipWhiteList(Model model,BaseIpCfg baseIpCfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
return "/cfg/ipWhiteList";
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = {"ipWhiteForm"})
|
||||
public String ipWhiteForm() {
|
||||
return "/cfg/ipWhiteForm";
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* ipCfgList(配置列表与审核列表,需要根据参数判断是哪个列表,以便显示隐藏对应的界面菜单,按钮)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @param model
|
||||
* @param audit
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param cfgName
|
||||
* @param ipCfg
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*String
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@RequestMapping(value = {"list"})
|
||||
public String ipCfgList(Model model,Integer pageNo,Integer pageSize,String cfgName,@ModelAttribute("ipCfg")BaseIpCfg ipCfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
public String ipCfgList(Model model,Integer audit,String cfgName,@ModelAttribute("ipCfg")BaseIpCfg ipCfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("audit", audit);
|
||||
if(ipCfg!=null){
|
||||
Integer serviceId=ipCfg.getServiceId();
|
||||
logger.info("servcice id is "+serviceId);
|
||||
@@ -54,14 +61,7 @@ public class IpCfgController extends BaseController{
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
logger.info("table name is "+tableName);
|
||||
ipCfg.setTableName(tableName);
|
||||
Page<BaseIpCfg> searchPage=new Page<BaseIpCfg>(request, response, 1);
|
||||
if(pageNo!=null) searchPage.setPageNo(pageNo);
|
||||
if(pageSize!=null) searchPage.setPageSize(pageSize);
|
||||
if(ipCfg.getPage()!=null){
|
||||
if(!StringUtils.isBlank(ipCfg.getPage().getOrderBy()));
|
||||
searchPage.setOrderBy(ipCfg.getPage().getOrderBy());
|
||||
}
|
||||
Page<BaseIpCfg> page = ipCfgService.findPage(searchPage, ipCfg);
|
||||
Page<BaseIpCfg> page = ipCfgService.findPage(new Page<BaseIpCfg>(request,response), ipCfg);
|
||||
model.addAttribute("page", page);
|
||||
model.addAttribute("action", ipCfg.getAction());
|
||||
model.addAttribute("tableName", tableName);
|
||||
@@ -83,12 +83,27 @@ public class IpCfgController extends BaseController{
|
||||
return "/cfg/ipCfgList";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* ipCfgForm(新增页面初始化,只会在配置界面使用)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @param action
|
||||
* @param cfgName
|
||||
* @param serviceId
|
||||
* @param model
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*String
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@RequestMapping(value = {"form"})
|
||||
public String ipCfgForm(int action,String cfgName,Integer serviceId,Model model,HttpServletRequest request,HttpServletResponse response) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
logger.info("sercice id is "+serviceId);
|
||||
if(serviceId!=null){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
@@ -131,11 +146,30 @@ public class IpCfgController extends BaseController{
|
||||
|
||||
return "/cfg/ipCfgForm";
|
||||
}
|
||||
/**
|
||||
*
|
||||
* updateIpCfgForm(更新配置页面初始化,只会在配置界面出现)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @param tableName
|
||||
* @param action
|
||||
* @param cfgId
|
||||
* @param cfgName
|
||||
* @param serviceId
|
||||
* @param model
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*String
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@RequiresPermissions("sys:cfg:edit")
|
||||
@RequestMapping(value = {"updateForm"})
|
||||
public String updateIpCfgForm(String tableName,int action,long cfgId,String cfgName,Integer serviceId,Model model,HttpServletRequest request,HttpServletResponse response) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("audit",Constants.CFG_PAGE);
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
logger.info("table name is "+tableName);
|
||||
BaseIpCfg searchBean=new BaseIpCfg();
|
||||
@@ -184,7 +218,7 @@ public class IpCfgController extends BaseController{
|
||||
|
||||
/**
|
||||
*
|
||||
* addIpCfg(新增IP配置)
|
||||
* addIpCfg(新增IP配置,后台保存方法)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @return
|
||||
*String
|
||||
@@ -195,6 +229,7 @@ public class IpCfgController extends BaseController{
|
||||
public String saveOrUpdateIpCfg(String cfgName,Model model, BaseIpCfg ipCfg) {
|
||||
model.addAttribute("cfgName",cfgName);
|
||||
model.addAttribute("cfgType", "ip");
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
logger.info("saveOrUpdateIpCfg loaded");
|
||||
if(ipCfg==null){
|
||||
logger.error("无法保存空的配置!");
|
||||
@@ -255,7 +290,7 @@ public class IpCfgController extends BaseController{
|
||||
/**
|
||||
*
|
||||
* auditIpCfg(审核IP配置)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* (审核流程只在审核页面)
|
||||
* @return
|
||||
*String
|
||||
* @exception
|
||||
@@ -264,6 +299,7 @@ public class IpCfgController extends BaseController{
|
||||
@RequestMapping(value = {"auditCfg"})
|
||||
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())){
|
||||
@@ -280,6 +316,8 @@ public class IpCfgController extends BaseController{
|
||||
ipCfg.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();
|
||||
@@ -301,14 +339,15 @@ public class IpCfgController extends BaseController{
|
||||
ipCfg.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
int result=ipCfgService.auditIpCfg(ipCfg);
|
||||
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", ipCfg.getAction());
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}
|
||||
return "redirect:" + adminPath + "/cfg/ip/list?serviceId="+ipCfg.getServiceId()+"&action="+ipCfg.getAction()+"&cfgName"+cfgName;
|
||||
return "redirect:" + adminPath + "/cfg/ip/list";
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -319,12 +358,14 @@ public class IpCfgController extends BaseController{
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@RequiresPermissions("sys:cfg:edit")
|
||||
@RequestMapping(value = {"deleteCfg"})
|
||||
public String deleteIpCfg(String tableName,int action,long cfgId,String cfgName,Integer serviceId,Model model) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("cfgType", "ip");
|
||||
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
int audit=ipCfgService.getIsAudit(tableName,cfgId);
|
||||
//未审核时可删除
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
package com.nis.web.controller.configuration;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -31,8 +30,9 @@ import com.nis.web.controller.BaseController;
|
||||
public class NumCfgController extends BaseController{
|
||||
|
||||
@RequestMapping(value = {"list"})
|
||||
public String cfgList(Model model,Integer pageNo,Integer pageSize,String cfgName,@ModelAttribute("cfg")NumBoundaryCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
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);
|
||||
model.addAttribute("audit", audit);
|
||||
if(cfg!=null){
|
||||
Integer serviceId=cfg.getServiceId();
|
||||
logger.info("servcice id is "+serviceId);
|
||||
@@ -73,6 +73,7 @@ public class NumCfgController extends BaseController{
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
logger.info("sercice id is "+serviceId);
|
||||
if(serviceId!=null){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
@@ -102,6 +103,7 @@ public class NumCfgController extends BaseController{
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
if(serviceId!=null){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
@@ -139,6 +141,7 @@ public class NumCfgController extends BaseController{
|
||||
public String saveOrUpdateStringCfg(String cfgName,Model model, NumBoundaryCfg cfg) {
|
||||
model.addAttribute("cfgName",cfgName);
|
||||
model.addAttribute("cfgType","num");
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
logger.info("saveOrUpdateStringCfg loaded");
|
||||
if(cfg==null){
|
||||
logger.error("无法保存空的配置!");
|
||||
@@ -185,6 +188,7 @@ public class NumCfgController extends BaseController{
|
||||
@RequestMapping(value = {"auditCfg"})
|
||||
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){
|
||||
@@ -204,12 +208,14 @@ public class NumCfgController extends BaseController{
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
int result=numCfgService.auditNumCfg(cfg);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", cfg.getAction());
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}
|
||||
return "redirect:" + adminPath + "/cfg/num/list?serviceId="+cfg.getServiceId()+"&action="+cfg.getAction()+"&cfgName"+cfgName;
|
||||
return "redirect:" + adminPath + "/cfg/num/list";
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -226,6 +232,7 @@ public class NumCfgController extends BaseController{
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("cfgType","num");
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
if(serviceId!=null){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
|
||||
@@ -95,7 +95,7 @@ public class RequestInfoController extends BaseController{
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核
|
||||
* 审核通过
|
||||
* @param requestInfo
|
||||
* @param model
|
||||
* @return
|
||||
@@ -107,6 +107,19 @@ public class RequestInfoController extends BaseController{
|
||||
return "redirect:" + adminPath + "/cfg/request/list?repage";
|
||||
|
||||
}
|
||||
/**
|
||||
* 审核未通过
|
||||
* @param requestInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "requestExamineNo")
|
||||
public String requestExamineNo(RequestInfo requestInfo, Model model,RedirectAttributes redirectAttributes){
|
||||
requestInfoService.requestExamineNo(requestInfo);
|
||||
addMessage(redirectAttributes, "success");
|
||||
return "redirect:" + adminPath + "/cfg/request/list?repage";
|
||||
|
||||
}
|
||||
/**
|
||||
* 取消审核
|
||||
* @param requestInfo
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
package com.nis.web.controller.configuration;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -31,8 +30,9 @@ import com.nis.web.controller.BaseController;
|
||||
public class StringCfgController extends BaseController{
|
||||
|
||||
@RequestMapping(value = {"list"})
|
||||
public String stringCfgList(Model model,Integer pageNo,Integer pageSize,String cfgName,@ModelAttribute("cfg")BaseStringCfg stringCfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
public String stringCfgList(Model model,Integer audit,String cfgName,@ModelAttribute("cfg")BaseStringCfg stringCfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("audit", audit);
|
||||
if(stringCfg!=null){
|
||||
Integer serviceId=stringCfg.getServiceId();
|
||||
logger.info("servcice id is "+serviceId);
|
||||
@@ -44,14 +44,7 @@ public class StringCfgController extends BaseController{
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
logger.info("table name is "+tableName);
|
||||
stringCfg.setTableName(tableName);
|
||||
Page<BaseStringCfg> searchPage=new Page<BaseStringCfg>(request, response, 1);
|
||||
if(pageNo!=null) searchPage.setPageNo(pageNo);
|
||||
if(pageSize!=null) searchPage.setPageSize(pageSize);
|
||||
if(stringCfg.getPage()!=null){
|
||||
if(!StringUtils.isBlank(stringCfg.getPage().getOrderBy()));
|
||||
searchPage.setOrderBy(stringCfg.getPage().getOrderBy());
|
||||
}
|
||||
Page<BaseStringCfg> page = stringCfgService.findPage(searchPage, stringCfg);
|
||||
Page<BaseStringCfg> page = stringCfgService.findPage(new Page<BaseStringCfg>(request,response), stringCfg);
|
||||
model.addAttribute("page", page);
|
||||
model.addAttribute("action", stringCfg.getAction());
|
||||
model.addAttribute("tableName", tableName);
|
||||
@@ -79,6 +72,7 @@ public class StringCfgController extends BaseController{
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
logger.info("sercice id is "+serviceId);
|
||||
if(serviceId!=null){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
@@ -126,6 +120,7 @@ public class StringCfgController extends BaseController{
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("tableName", tableName);
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
logger.info("table name is "+tableName);
|
||||
BaseStringCfg searchBean=new BaseStringCfg();
|
||||
@@ -183,6 +178,7 @@ public class StringCfgController extends BaseController{
|
||||
public String saveOrUpdateStringCfg(String cfgName,Model model, BaseStringCfg stringCfg) {
|
||||
model.addAttribute("cfgName",cfgName);
|
||||
model.addAttribute("cfgType","string");
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
logger.info("saveOrUpdateStringCfg loaded");
|
||||
if(stringCfg==null){
|
||||
logger.error("无法保存空的配置!");
|
||||
@@ -253,6 +249,7 @@ public class StringCfgController extends BaseController{
|
||||
@RequestMapping(value = {"auditCfg"})
|
||||
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())){
|
||||
@@ -269,6 +266,8 @@ public class StringCfgController extends BaseController{
|
||||
stringCfg.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
int result=stringCfgService.auditStringCfg(stringCfg);
|
||||
model.addAttribute("serviceId", stringCfg.getServiceId());
|
||||
model.addAttribute("action", stringCfg.getAction());
|
||||
}
|
||||
|
||||
}else if(stringCfg.getServiceId()!=null){
|
||||
@@ -291,13 +290,15 @@ public class StringCfgController extends BaseController{
|
||||
stringCfg.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
int result=stringCfgService.auditStringCfg(stringCfg);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", stringCfg.getAction());
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}
|
||||
return "redirect:" + adminPath + "/cfg/string/list?serviceId="+stringCfg.getServiceId()+"&action="+stringCfg.getAction()+"&cfgName"+cfgName;
|
||||
return "redirect:" + adminPath + "/cfg/string/list";
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -314,6 +315,7 @@ public class StringCfgController extends BaseController{
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("cfgType","string");
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
int audit=stringCfgService.getIsAudit(tableName,cfgId);
|
||||
//未审核时可删除
|
||||
|
||||
@@ -29,7 +29,15 @@
|
||||
<result property="name" column="name"/>
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="dictResultSimpleMap" type="com.nis.domain.basics.ServiceDictInfo" >
|
||||
<id column="service_dict_id" property="serviceDictId" jdbcType="INTEGER" />
|
||||
<result column="item_type" property="itemType" jdbcType="INTEGER" />
|
||||
<result column="item_code" property="itemCode" jdbcType="INTEGER" />
|
||||
<result column="item_value" property="itemValue" jdbcType="VARCHAR" />
|
||||
<result column="item_desc" property="itemDesc" jdbcType="VARCHAR" />
|
||||
<result column="is_leaf" property="isLeaf" jdbcType="INTEGER" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
</resultMap>
|
||||
<sql id="serviceDictInfoColumns">
|
||||
s.service_dict_id AS serviceDictId,
|
||||
s.item_type AS itemType,
|
||||
@@ -44,6 +52,16 @@
|
||||
s.editor_id AS "serviceDictEditor.id",
|
||||
s.edit_time AS editTime
|
||||
</sql>
|
||||
<sql id="serviceDictInfoColumnsSimple">
|
||||
s.service_dict_id AS serviceDictId,
|
||||
s.item_type AS itemType,
|
||||
s.item_code AS itemCode,
|
||||
s.item_value AS itemValue,
|
||||
s.item_desc AS itemDesc,
|
||||
s.parent_id AS "parent.serviceDictId",
|
||||
s.is_leaf AS isLeaf,
|
||||
s.is_valid AS isValid
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
@@ -260,14 +278,14 @@
|
||||
UPDATE service_dict_info s set s.is_valid = #{isValid} where s.service_dict_id = #{serviceDictId}
|
||||
</update>
|
||||
|
||||
<select id="findItemDict" resultMap="dictResultMap">
|
||||
<select id="findItemDict" resultMap="dictResultSimpleMap">
|
||||
select
|
||||
<include refid="serviceDictInfoColumns" />
|
||||
<include refid="serviceDictInfoColumnsSimple" />
|
||||
from service_dict_info s where s.is_leaf = 0 and s.item_type=#{itemType} and s.is_valid=#{isValid};
|
||||
</select>
|
||||
<select id="findAllItemDict" resultMap="dictResultMap">
|
||||
<select id="findAllItemDict" resultMap="dictResultSimpleMap">
|
||||
select
|
||||
<include refid="serviceDictInfoColumns" />
|
||||
<include refid="serviceDictInfoColumnsSimple" />
|
||||
from service_dict_info s where s.is_leaf = 0 and s.item_type=#{itemType};
|
||||
</select>
|
||||
|
||||
|
||||
@@ -166,9 +166,9 @@
|
||||
left join sys_user e on r.editor_id=e.id
|
||||
left join sys_user u on r.auditor_id=u.id
|
||||
left join request_info ri on r.request_id=ri.id
|
||||
left join service_dict_info sdic on r.classify=sdic.item_code and sdic.item_type=1 and sdic.is_valid=1 and sdic.is_leaf=0
|
||||
left join service_dict_info sdia on r.attribute=sdia.item_code and sdia.item_type=1 and sdia.is_valid=1 and sdia.is_leaf=0
|
||||
left join service_dict_info sdil on r.lable=sdil.item_code and sdil.item_type=1 and sdil.is_valid=1 and sdil.is_leaf=0
|
||||
left join service_dict_info sdic on r.classify=sdic.item_code and sdic.item_type=1 and sdic.is_leaf=0
|
||||
left join service_dict_info sdia on r.attribute=sdia.item_code and sdia.item_type=1 and sdia.is_leaf=0
|
||||
left join service_dict_info sdil on r.lable=sdil.item_code and sdil.item_type=1 and sdil.is_leaf=0
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
|
||||
<if test="page !=null and page.where != null and page.where != ''">
|
||||
|
||||
@@ -246,9 +246,9 @@
|
||||
left join sys_user e on r.editor_id=e.id
|
||||
left join sys_user u on r.auditor_id=u.id
|
||||
left join request_info ri on r.request_id=ri.id
|
||||
left join service_dict_info sdic on r.classify=sdic.item_code and sdic.item_type=1 and sdic.is_valid=1 and sdic.is_leaf=0
|
||||
left join service_dict_info sdia on r.attribute=sdia.item_code and sdia.item_type=1 and sdia.is_valid=1 and sdia.is_leaf=0
|
||||
left join service_dict_info sdil on r.lable=sdil.item_code and sdil.item_type=1 and sdil.is_valid=1 and sdil.is_leaf=0
|
||||
left join service_dict_info sdic on r.classify=sdic.item_code and sdic.item_type=1 and sdic.is_leaf=0
|
||||
left join service_dict_info sdia on r.attribute=sdia.item_code and sdia.item_type=1 and sdia.is_leaf=0
|
||||
left join service_dict_info sdil on r.lable=sdil.item_code and sdil.item_type=1 and sdil.is_leaf=0
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
|
||||
<if test="page !=null and page.where != null and page.where != ''">
|
||||
|
||||
@@ -169,9 +169,9 @@
|
||||
left join sys_user e on r.editor_id=e.id
|
||||
left join sys_user u on r.auditor_id=u.id
|
||||
left join request_info ri on r.request_id=ri.id
|
||||
left join service_dict_info sdic on r.classify=sdic.item_code and sdic.item_type=1 and sdic.is_valid=1 and sdic.is_leaf=0
|
||||
left join service_dict_info sdia on r.attribute=sdia.item_code and sdia.item_type=1 and sdia.is_valid=1 and sdia.is_leaf=0
|
||||
left join service_dict_info sdil on r.lable=sdil.item_code and sdil.item_type=1 and sdil.is_valid=1 and sdil.is_leaf=0
|
||||
left join service_dict_info sdic on r.classify=sdic.item_code and sdic.item_type=1 and sdic.is_leaf=0
|
||||
left join service_dict_info sdia on r.attribute=sdia.item_code and sdia.item_type=1 and sdia.is_leaf=0
|
||||
left join service_dict_info sdil on r.lable=sdil.item_code and sdil.item_type=1 and sdil.is_leaf=0
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
|
||||
<if test="page !=null and page.where != null and page.where != ''">
|
||||
|
||||
@@ -162,5 +162,9 @@
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT} and is_audit !=1
|
||||
</update>
|
||||
|
||||
<select id="findAllList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from request_info
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,303 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.nis.web.dao.configuration.ServiceDictInfoDao" >
|
||||
|
||||
<resultMap id="dictResultMap" type="com.nis.domain.configuration.ServiceDictInfo" >
|
||||
<id column="service_dict_id" property="serviceDictId" jdbcType="INTEGER" />
|
||||
<result column="item_type" property="itemType" jdbcType="INTEGER" />
|
||||
<result column="item_code" property="itemCode" jdbcType="INTEGER" />
|
||||
<result column="item_value" property="itemValue" jdbcType="VARCHAR" />
|
||||
<result column="item_desc" property="itemDesc" jdbcType="VARCHAR" />
|
||||
<result column="is_leaf" property="isLeaf" jdbcType="INTEGER" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
||||
<!-- 父id -->
|
||||
<association property="parent" javaType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
<id column="service_dict_id" property="serviceDictId" jdbcType="INTEGER" />
|
||||
<result column="item_type" property="itemType" jdbcType="INTEGER" />
|
||||
<result column="item_code" property="itemCode" jdbcType="INTEGER" />
|
||||
<result column="item_value" property="itemValue" jdbcType="VARCHAR" />
|
||||
<result column="item_desc" property="itemDesc" jdbcType="VARCHAR" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
</association>
|
||||
<!-- 创建人员 -->
|
||||
<association property="serviceDictCreator" javaType="com.nis.domain.SysUser">
|
||||
<id property="id" column="id"/>
|
||||
<result property="loginId" column="login_id"/>
|
||||
<result property="name" column="name"/>
|
||||
</association>
|
||||
<!-- 修改人员 -->
|
||||
<association property="serviceDictEditor" javaType="com.nis.domain.SysUser">
|
||||
<id property="id" column="id"/>
|
||||
<result property="loginId" column="login_id"/>
|
||||
<result property="name" column="name"/>
|
||||
</association>
|
||||
</resultMap>
|
||||
<resultMap id="dictResultSimpleMap" type="com.nis.domain.configuration.ServiceDictInfo" >
|
||||
<id column="service_dict_id" property="serviceDictId" jdbcType="INTEGER" />
|
||||
<result column="item_type" property="itemType" jdbcType="INTEGER" />
|
||||
<result column="item_code" property="itemCode" jdbcType="INTEGER" />
|
||||
<result column="item_value" property="itemValue" jdbcType="VARCHAR" />
|
||||
<result column="item_desc" property="itemDesc" jdbcType="VARCHAR" />
|
||||
<result column="is_leaf" property="isLeaf" jdbcType="INTEGER" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
</resultMap>
|
||||
<sql id="serviceDictInfoColumns">
|
||||
s.service_dict_id AS serviceDictId,
|
||||
s.item_type AS itemType,
|
||||
s.item_code AS itemCode,
|
||||
s.item_value AS itemValue,
|
||||
s.item_desc AS itemDesc,
|
||||
s.parent_id AS "parent.serviceDictId",
|
||||
s.is_leaf AS isLeaf,
|
||||
s.is_valid AS isValid,
|
||||
s.creator_id AS "serviceDictCreator.id",
|
||||
s.create_time AS createTime,
|
||||
s.editor_id AS "serviceDictEditor.id",
|
||||
s.edit_time AS editTime
|
||||
</sql>
|
||||
<sql id="serviceDictInfoColumnsSimple">
|
||||
s.service_dict_id AS serviceDictId,
|
||||
s.item_type AS itemType,
|
||||
s.item_code AS itemCode,
|
||||
s.item_value AS itemValue,
|
||||
s.item_desc AS itemDesc,
|
||||
s.is_leaf AS isLeaf,
|
||||
s.is_valid AS isValid
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
<!-- 查询顶层分页列表 (==)-->
|
||||
<select id="findTopDictList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND parent_id = 0
|
||||
|
||||
<if test="itemValue != null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type = #{itemType}
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 查询顶层分页列表 (!=)-->
|
||||
<select id="findTopDictListN" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND parent_id = 0
|
||||
|
||||
<if test="itemValue != null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type != #{itemType}
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 查出所有 -->
|
||||
<select id="findAllDictList" resultType="serviceDictInfo">
|
||||
SELECT
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
FROM service_dict_info s
|
||||
<include refid="menuJoins"/>
|
||||
WHERE s.is_valid =1
|
||||
</select>
|
||||
|
||||
<!-- 查询所有非叶子配置 -->
|
||||
<select id="findAllNoLeafDictList" resultType="com.nis.domain.configuration.ServiceDictInfo" parameterType="java.lang.Integer">
|
||||
SELECT
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
FROM service_dict_info s
|
||||
WHERE s.is_valid = 1 AND s.is_leaf = 0 AND item_type = #{itemType}
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 条件查询分页(==) -->
|
||||
<select id="findDictSearchList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type like '%${itemType}%'
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
<if test="itemValue!= null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 条件查询分页(!=) -->
|
||||
<select id="findDictSearchListN" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1
|
||||
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
<if test="itemValue!= null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type != ${itemType}
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 根据主键查询字典详细信息 -->
|
||||
|
||||
<select id="getDictById" resultType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
select
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
from service_dict_info s where s.service_dict_id = #{serviceDictId}
|
||||
</select>
|
||||
|
||||
<!-- 根据上级id选出所有下级 -->
|
||||
|
||||
<select id="getDictByParentId" resultMap="dictResultMap">
|
||||
select *
|
||||
from service_dict_info s where parent_id = #{parentId}
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 根据itemCode查询字典对象列表 -->
|
||||
|
||||
<select id="findByItemCode" resultType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
select
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
from service_dict_info s where s.item_code = #{itemCode}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<!-- 新增字典信息 -->
|
||||
|
||||
<insert id="insertDict" parameterType="com.nis.domain.configuration.ServiceDictInfo" useGeneratedKeys="true" keyProperty="id" >
|
||||
insert into service_dict_info (item_type, item_code, item_value, item_desc, parent_id, is_leaf, is_valid, creator_id, create_time, editor_id, edit_time)
|
||||
values ( #{itemType,jdbcType=INTEGER}, #{itemCode,jdbcType=INTEGER},
|
||||
#{itemValue,jdbcType=VARCHAR}, #{itemDesc,jdbcType=VARCHAR},
|
||||
#{parent.serviceDictId,jdbcType=INTEGER}, #{isLeaf,jdbcType=INTEGER}, #{isValid,jdbcType=INTEGER},
|
||||
#{serviceDictCreator.id,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{serviceDictEditor.id,jdbcType=INTEGER}, #{editTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="update">
|
||||
UPDATE service_dict_info s SET
|
||||
s.service_dict_id = #{serviceDictId},
|
||||
s.item_type = #{itemType},
|
||||
s.item_code = #{itemCode},
|
||||
s.item_value = #{itemValue},
|
||||
s.item_desc = #{itemDesc},
|
||||
s.parent_id = #{parent.serviceDictId},
|
||||
s.is_leaf = #{isLeaf},
|
||||
s.creator_id = #{serviceDictCreator.id},
|
||||
s.editor_id = #{serviceDictEditor.id},
|
||||
s.edit_time = #{editTime}
|
||||
WHERE s.service_dict_id = #{serviceDictId}
|
||||
</update>
|
||||
|
||||
<!-- 删除 -->
|
||||
|
||||
<update id="delete">
|
||||
UPDATE service_dict_info s set s.is_valid = #{isValid} where s.service_dict_id = #{serviceDictId}
|
||||
</update>
|
||||
|
||||
<select id="findItemDict" resultMap="dictResultSimpleMap">
|
||||
select
|
||||
<include refid="serviceDictInfoColumnsSimple" />
|
||||
from service_dict_info s where s.is_leaf = 0 and s.item_type=#{itemType} and s.is_valid=#{isValid};
|
||||
</select>
|
||||
<select id="findAllItemDict" resultMap="dictResultSimpleMap">
|
||||
select
|
||||
<include refid="serviceDictInfoColumnsSimple" />
|
||||
from service_dict_info s where s.is_leaf = 0 and s.item_type=#{itemType};
|
||||
</select>
|
||||
|
||||
<sql id="menuJoins">
|
||||
LEFT JOIN service_dict_info p ON p.service_dict_id = s.parent_id
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -185,9 +185,9 @@
|
||||
left join sys_user e on r.editor_id=e.id
|
||||
left join sys_user u on r.auditor_id=u.id
|
||||
left join request_info ri on r.request_id=ri.id
|
||||
left join service_dict_info sdic on r.classify=sdic.item_code and sdic.item_type=1 and sdic.is_valid=1 and sdic.is_leaf=0
|
||||
left join service_dict_info sdia on r.attribute=sdia.item_code and sdia.item_type=1 and sdia.is_valid=1 and sdia.is_leaf=0
|
||||
left join service_dict_info sdil on r.lable=sdil.item_code and sdil.item_type=1 and sdil.is_valid=1 and sdil.is_leaf=0
|
||||
left join service_dict_info sdic on r.classify=sdic.item_code and sdic.item_type=1 and sdic.is_leaf=0
|
||||
left join service_dict_info sdia on r.attribute=sdia.item_code and sdia.item_type=1 and sdia.is_leaf=0
|
||||
left join service_dict_info sdil on r.lable=sdil.item_code and sdil.item_type=1 and sdil.is_leaf=0
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
|
||||
<if test="page !=null and page.where != null and page.where != ''">
|
||||
|
||||
@@ -74,14 +74,14 @@ public class FormAuthenticationFilter extends org.apache.shiro.web.filter.authc.
|
||||
String className = e.getClass().getName(), message = "";
|
||||
if (IncorrectCredentialsException.class.getName().equals(className)
|
||||
|| UnknownAccountException.class.getName().equals(className)){
|
||||
message = "用户或密码错误, 请重试.";
|
||||
message = "loginName_error";
|
||||
}
|
||||
else if (e.getMessage() != null && StringUtils.startsWith(e.getMessage(), "msg:")){
|
||||
message = StringUtils.replace(e.getMessage(), "msg:", "");
|
||||
}
|
||||
|
||||
else{
|
||||
message = "系统出现点问题,请稍后再试!";
|
||||
message = "system_error";
|
||||
e.printStackTrace(); // 输出到控制台
|
||||
}
|
||||
request.setAttribute(getFailureKeyAttribute(), className);
|
||||
|
||||
@@ -67,6 +67,11 @@ public class RequestInfoService extends BaseService{
|
||||
requestInfoDao.update(requestInfo);
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public void requestExamineNo(RequestInfo requestInfo){
|
||||
requestInfo.setIsAudit(2);//审核未通过
|
||||
requestInfoDao.update(requestInfo);
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public void requestCancelExamine(RequestInfo requestInfo){
|
||||
requestInfo.setIsAudit(3);//取消审核通过
|
||||
int update = requestInfoDao.update(requestInfo);
|
||||
|
||||
Reference in New Issue
Block a user