Commit 85fe6228 by 丁伟

1、迁移初始提交

parent 43b3e44e
...@@ -5,12 +5,13 @@ services: ...@@ -5,12 +5,13 @@ services:
mysql: mysql:
environment: environment:
MYSQL_ROOT_PASSWORD: root MYSQL_ROOT_PASSWORD: root
image: itc/mysql:5.5 image: itc/mariadb:10.2
volumes: volumes:
- ./mysql/data:/var/lib/mysql - /dockerv/ccpit.org/itc/sfzx/database:/var/lib/mysql
- ./mysql/log:/var/log/mysql
command: mysqld --lower_case_table_names=1 command: mysqld --lower_case_table_names=1
networks:
hx_net:
ipv4_address: 172.40.0.3
web: web:
depends_on: depends_on:
- mysql - mysql
...@@ -18,6 +19,16 @@ services: ...@@ -18,6 +19,16 @@ services:
volumes: volumes:
- ./web:/usr/local/tomcat/webapps/ROOT - ./web:/usr/local/tomcat/webapps/ROOT
- ./logs:/logs - ./logs:/logs
- ./upload:/upload - ./upload.co.ccpit.org:/data/vhosts/upload.co.ccpit.org
ports: ports:
- "30128:8080" - "30128:8080"
networks:
hx_net:
ipv4_address: 172.40.0.4
networks:
hx_net:
driver: bridge
ipam:
config:
- subnet: 172.40.0.0/24
...@@ -22,7 +22,6 @@ import ccpit.base.logManage.LogInfoService; ...@@ -22,7 +22,6 @@ import ccpit.base.logManage.LogInfoService;
import ccpit.base.user.User; import ccpit.base.user.User;
import ccpit.base.utils.DateConvert; import ccpit.base.utils.DateConvert;
import ccpit.base.utils.StringUtil; import ccpit.base.utils.StringUtil;
import ccpit.base.utils.lucene.LuceneUtil;
import ccpit.base.utils.page.PageUtil; import ccpit.base.utils.page.PageUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -38,8 +37,7 @@ public class CoApplicationInfoService { ...@@ -38,8 +37,7 @@ public class CoApplicationInfoService {
@Autowired @Autowired
private LogInfoService logInfoService; private LogInfoService logInfoService;
@Autowired
private LuceneUtil<CoApplicationInfo> luceneUtil;
public boolean addOrUpdateCoApplicationInfo(CoApplicationInfo coApplicationInfo, String operate, public boolean addOrUpdateCoApplicationInfo(CoApplicationInfo coApplicationInfo, String operate,
String coApplicationInfoId, User user, HttpServletRequest request) { String coApplicationInfoId, User user, HttpServletRequest request) {
boolean flag = false; boolean flag = false;
...@@ -48,7 +46,6 @@ public class CoApplicationInfoService { ...@@ -48,7 +46,6 @@ public class CoApplicationInfoService {
coApplicationInfo.setCreator(user); coApplicationInfo.setCreator(user);
flag = coApplicationInfoDao.save(coApplicationInfo); flag = coApplicationInfoDao.save(coApplicationInfo);
if (flag) { if (flag) {
luceneUtil.createIndex(createCoApplicationInfosIndex(coApplicationInfo));
// 记录用户操作日志信息 // 记录用户操作日志信息
logInfoService.recordLog(request, "新增CO数据信息"); logInfoService.recordLog(request, "新增CO数据信息");
} }
...@@ -60,8 +57,6 @@ public class CoApplicationInfoService { ...@@ -60,8 +57,6 @@ public class CoApplicationInfoService {
flag = coApplicationInfoDao.update(coApplicationInfo1); flag = coApplicationInfoDao.update(coApplicationInfo1);
if (flag) { if (flag) {
// 记录用户操作日志信息 // 记录用户操作日志信息
luceneUtil.deleteIndex("n" + coApplicationInfoId);
luceneUtil.createIndex(createCoApplicationInfosIndex(coApplicationInfo1));
logInfoService.recordLog(request, "修改CO数据信息"); logInfoService.recordLog(request, "修改CO数据信息");
} }
} }
...@@ -81,9 +76,8 @@ public class CoApplicationInfoService { ...@@ -81,9 +76,8 @@ public class CoApplicationInfoService {
flag = coApplicationInfoDao.save(coApplicationInfo); flag = coApplicationInfoDao.save(coApplicationInfo);
if (flag) { if (flag) {
//luceneUtil.createIndex(createCoApplicationInfosIndex(coApplicationInfo));
// 记录用户操作日志信息 // 记录用户操作日志信息
//logInfoService.recordLog(request, "新增CO数据信息"); logInfoService.recordLog(request, "新增CO数据信息");
} }
return flag; return flag;
...@@ -98,7 +92,6 @@ public class CoApplicationInfoService { ...@@ -98,7 +92,6 @@ public class CoApplicationInfoService {
.valueOf(metadataId))); .valueOf(metadataId)));
coApplicationInfo.setDeleted(true); coApplicationInfo.setDeleted(true);
flag = coApplicationInfoDao.update(coApplicationInfo); flag = coApplicationInfoDao.update(coApplicationInfo);
luceneUtil.deleteIndex("n" + metadataId.toString());
} }
return flag; return flag;
} }
......
...@@ -32,7 +32,6 @@ import ccpit.base.logManage.LogInfoService; ...@@ -32,7 +32,6 @@ import ccpit.base.logManage.LogInfoService;
import ccpit.base.user.User; import ccpit.base.user.User;
import ccpit.base.utils.DateConvert; import ccpit.base.utils.DateConvert;
import ccpit.base.utils.StringUtil; import ccpit.base.utils.StringUtil;
import ccpit.base.utils.lucene.LuceneUtil;
import ccpit.base.utils.page.PageUtil; import ccpit.base.utils.page.PageUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -58,8 +57,6 @@ public class NewsInfoService { ...@@ -58,8 +57,6 @@ public class NewsInfoService {
@Autowired @Autowired
private LogInfoService logInfoService; private LogInfoService logInfoService;
@Autowired
private LuceneUtil<NewsInfo> luceneUtil;
public boolean addOrUpdateNewsInfo(NewsInfo newsInfo, String operate, public boolean addOrUpdateNewsInfo(NewsInfo newsInfo, String operate,
String newsInfoId, User user, HttpServletRequest request) { String newsInfoId, User user, HttpServletRequest request) {
...@@ -69,7 +66,6 @@ public class NewsInfoService { ...@@ -69,7 +66,6 @@ public class NewsInfoService {
newsInfo.setCreator(user); newsInfo.setCreator(user);
flag = newsInfoDao.save(newsInfo); flag = newsInfoDao.save(newsInfo);
if (flag) { if (flag) {
luceneUtil.createIndex(createNewsInfosIndex(newsInfo));
// 记录用户操作日志信息 // 记录用户操作日志信息
logInfoService.recordLog(request, "新增新闻数据信息"); logInfoService.recordLog(request, "新增新闻数据信息");
} }
...@@ -80,9 +76,7 @@ public class NewsInfoService { ...@@ -80,9 +76,7 @@ public class NewsInfoService {
newsInfo1.setModifyBy(user); newsInfo1.setModifyBy(user);
flag = newsInfoDao.update(newsInfo1); flag = newsInfoDao.update(newsInfo1);
if (flag) { if (flag) {
// 记录用户操作日志信息
luceneUtil.deleteIndex("n" + newsInfoId);
luceneUtil.createIndex(createNewsInfosIndex(newsInfo1));
logInfoService.recordLog(request, "修改新闻数据信息"); logInfoService.recordLog(request, "修改新闻数据信息");
} }
} }
...@@ -98,7 +92,6 @@ public class NewsInfoService { ...@@ -98,7 +92,6 @@ public class NewsInfoService {
.valueOf(metadataId))); .valueOf(metadataId)));
newsInfo.setDeleted(true); newsInfo.setDeleted(true);
flag = newsInfoDao.update(newsInfo); flag = newsInfoDao.update(newsInfo);
luceneUtil.deleteIndex("n" + metadataId.toString());
} }
return flag; return flag;
} }
......
...@@ -59,7 +59,6 @@ public class NoticeService { ...@@ -59,7 +59,6 @@ public class NoticeService {
Notice.setCreator(user); Notice.setCreator(user);
flag = noticeDao.save(Notice); flag = noticeDao.save(Notice);
if (flag) { if (flag) {
// luceneUtil.createIndex(createNoticesIndex(Notice));
// 记录用户操作日志信息 // 记录用户操作日志信息
logInfoService.recordLog(request, "新增通知公告数据信息"); logInfoService.recordLog(request, "新增通知公告数据信息");
} }
...@@ -71,8 +70,6 @@ public class NoticeService { ...@@ -71,8 +70,6 @@ public class NoticeService {
flag = noticeDao.update(Notice1); flag = noticeDao.update(Notice1);
if (flag) { if (flag) {
// 记录用户操作日志信息 // 记录用户操作日志信息
// luceneUtil.deleteIndex("n" + NoticeId);
// luceneUtil.createIndex(createNoticesIndex(Notice1));
logInfoService.recordLog(request, "修改通知公告数据信息"); logInfoService.recordLog(request, "修改通知公告数据信息");
} }
} }
...@@ -93,7 +90,6 @@ public class NoticeService { ...@@ -93,7 +90,6 @@ public class NoticeService {
.valueOf(metadataId))); .valueOf(metadataId)));
Notice.setDeleted(true); Notice.setDeleted(true);
flag = noticeDao.update(Notice); flag = noticeDao.update(Notice);
// luceneUtil.deleteIndex("n" + metadataId.toString());
} }
return flag; return flag;
} }
......
...@@ -38,7 +38,6 @@ public class QuestionService { ...@@ -38,7 +38,6 @@ public class QuestionService {
question.setCreator(user); question.setCreator(user);
flag = questionDao.save(question); flag = questionDao.save(question);
if (flag) { if (flag) {
// luceneUtil.createIndex(createQuestionsIndex(Question));
// 记录用户操作日志信息 // 记录用户操作日志信息
logInfoService.recordLog(request, "新增问题数据信息"); logInfoService.recordLog(request, "新增问题数据信息");
} }
...@@ -50,8 +49,6 @@ public class QuestionService { ...@@ -50,8 +49,6 @@ public class QuestionService {
flag = questionDao.update(question1); flag = questionDao.update(question1);
if (flag) { if (flag) {
// 记录用户操作日志信息 // 记录用户操作日志信息
// luceneUtil.deleteIndex("n" + QuestionId);
// luceneUtil.createIndex(createQuestionsIndex(Question1));
logInfoService.recordLog(request, "修改问题数据信息"); logInfoService.recordLog(request, "修改问题数据信息");
} }
} }
...@@ -67,7 +64,6 @@ public class QuestionService { ...@@ -67,7 +64,6 @@ public class QuestionService {
.valueOf(metadataId))); .valueOf(metadataId)));
question.setDeleted(true); question.setDeleted(true);
flag = questionDao.update(question); flag = questionDao.update(question);
// luceneUtil.deleteIndex("n" + metadataId.toString());
} }
return flag; return flag;
} }
......
...@@ -25,7 +25,6 @@ import ccpit.base.logManage.LogInfoService; ...@@ -25,7 +25,6 @@ import ccpit.base.logManage.LogInfoService;
import ccpit.base.user.User; import ccpit.base.user.User;
import ccpit.base.utils.DateConvert; import ccpit.base.utils.DateConvert;
import ccpit.base.utils.StringUtil; import ccpit.base.utils.StringUtil;
import ccpit.base.utils.lucene.LuceneUtil;
import ccpit.base.utils.page.PageUtil; import ccpit.base.utils.page.PageUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -36,8 +35,6 @@ public class VisaAgencyService { ...@@ -36,8 +35,6 @@ public class VisaAgencyService {
private VisaAgencyDao visaAgencyDao; private VisaAgencyDao visaAgencyDao;
@Autowired @Autowired
private LogInfoService logInfoService; private LogInfoService logInfoService;
@Autowired
private LuceneUtil<VisaAgency> luceneUtil;
public boolean addOrUpdateVisaAgency(VisaAgency visaAgency, String operate, public boolean addOrUpdateVisaAgency(VisaAgency visaAgency, String operate,
String visaAgencyId, User user, HttpServletRequest request) { String visaAgencyId, User user, HttpServletRequest request) {
...@@ -47,7 +44,6 @@ public class VisaAgencyService { ...@@ -47,7 +44,6 @@ public class VisaAgencyService {
visaAgency.setCreator(user); visaAgency.setCreator(user);
flag = visaAgencyDao.save(visaAgency); flag = visaAgencyDao.save(visaAgency);
if (flag) { if (flag) {
luceneUtil.createIndex(createVisaAgencysIndex(visaAgency));
// 记录用户操作日志信息 // 记录用户操作日志信息
logInfoService.recordLog(request, "新增签证机构数据信息"); logInfoService.recordLog(request, "新增签证机构数据信息");
} }
...@@ -59,8 +55,6 @@ public class VisaAgencyService { ...@@ -59,8 +55,6 @@ public class VisaAgencyService {
flag = visaAgencyDao.update(visaAgency1); flag = visaAgencyDao.update(visaAgency1);
if (flag) { if (flag) {
// 记录用户操作日志信息 // 记录用户操作日志信息
luceneUtil.deleteIndex("n" + visaAgencyId);
luceneUtil.createIndex(createVisaAgencysIndex(visaAgency1));
logInfoService.recordLog(request, "修改签证机构数据信息"); logInfoService.recordLog(request, "修改签证机构数据信息");
} }
} }
...@@ -76,7 +70,6 @@ public class VisaAgencyService { ...@@ -76,7 +70,6 @@ public class VisaAgencyService {
.valueOf(metadataId))); .valueOf(metadataId)));
visaAgency.setDeleted(true); visaAgency.setDeleted(true);
flag = visaAgencyDao.update(visaAgency); flag = visaAgencyDao.update(visaAgency);
luceneUtil.deleteIndex("n" + metadataId.toString());
} }
return flag; return flag;
} }
......
...@@ -25,7 +25,6 @@ import ccpit.base.controller.Page; ...@@ -25,7 +25,6 @@ import ccpit.base.controller.Page;
import ccpit.base.controller.PageRequest; import ccpit.base.controller.PageRequest;
import ccpit.base.controller.ValidateCodeController; import ccpit.base.controller.ValidateCodeController;
import ccpit.base.user.User; import ccpit.base.user.User;
import ccpit.base.utils.lucene.LuceneUtil;
import ccpit.business.coApplication.CoApplicationInfo; import ccpit.business.coApplication.CoApplicationInfo;
import ccpit.business.coApplication.CoApplicationInfoService; import ccpit.business.coApplication.CoApplicationInfoService;
import ccpit.business.noticeManage.Notice; import ccpit.business.noticeManage.Notice;
...@@ -66,8 +65,7 @@ public class IndexController extends BaseController { ...@@ -66,8 +65,7 @@ public class IndexController extends BaseController {
private QuestionService questionService; private QuestionService questionService;
@Autowired @Autowired
private CoApplicationInfoService coApplicationInfoService; private CoApplicationInfoService coApplicationInfoService;
@Autowired
private LuceneUtil luceneUtil;
@Autowired @Autowired
private TaxableGoodsService taxableGoodsService; private TaxableGoodsService taxableGoodsService;
...@@ -263,13 +261,6 @@ public class IndexController extends BaseController { ...@@ -263,13 +261,6 @@ public class IndexController extends BaseController {
return mv; return mv;
} }
String[] searchFields = { "title" }; String[] searchFields = { "title" };
List<Map<String, Object>> lst = luceneUtil.SearchIndex(queryString,
searchFields);
List<String> result = new LinkedList<String>();
lst.stream().forEach(map -> {
// result.add(indexService.convertResult(map));
});
mv.addObject("result", result);
return mv; return mv;
} }
......
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
......
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
......
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
......
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html> <html>
<head> <head>
......
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html> <html>
<head> <head>
......
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html> <html>
<head> <head>
......
<%@ page language="java" contentType="text/html; charset=UTF-8" <%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%> pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
......
<%@ page language="java" contentType="text/html; charset=UTF-8" <%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%> pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
......
<%@ page language="java" contentType="text/html; charset=UTF-8" <%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%> pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
......
<%@ page language="java" contentType="text/html; charset=UTF-8" <%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%> pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
......
<%@ page language="java" contentType="text/html; charset=UTF-8" <%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%> pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
......
...@@ -6,8 +6,8 @@ var bodyWidth = 0; ...@@ -6,8 +6,8 @@ var bodyWidth = 0;
var bodyHeight = 0; var bodyHeight = 0;
var editor = null; var editor = null;
var dataType_infoStatus = "通知类型"; var dataType_infoStatus = "通知类型";
var operation=""; var operation = "";
$(function() { $(function () {
divHeight = $("#queryDiv2").height(); divHeight = $("#queryDiv2").height();
dataGridWidth = document.documentElement.clientWidth; dataGridWidth = document.documentElement.clientWidth;
clientHeight = document.documentElement.clientHeight; clientHeight = document.documentElement.clientHeight;
...@@ -20,142 +20,145 @@ $(function() { ...@@ -20,142 +20,145 @@ $(function() {
/** /**
* 初始化各输入框宽度 * 初始化各输入框宽度
*/ */
function initInputWidth(){ function initInputWidth() {
editor = UE.getEditor('noticeContentId', { editor = UE.getEditor('noticeContentId', {
initialFrameWidth : fixLongWidth(), initialFrameWidth: fixLongWidth(),
initialFrameHeight : 400 initialFrameHeight: 400
}); });
$("#titleId").attr("style","width:"+ (fixLongWidth()-2)+"px"); $("#titleId").attr("style", "width:" + (fixLongWidth() - 2) + "px");
$("#titleId00").attr("style","width:"+ fixShortWidth()+"px"); $("#titleId00").attr("style", "width:" + fixShortWidth() + "px");
$("#noticeTypeId").combobox({ $("#noticeTypeId").combobox({
url : '/admin/metadataManage/getMetadatasList?dataType='+encodeURI(encodeURI(dataType_infoStatus)), url: '/admin/metadataManage/getMetadatasList?dataType=' + encodeURI(encodeURI(dataType_infoStatus)),
width : fixShortWidth() + 4, width: fixShortWidth() + 4,
panelHeight : 'auto', panelHeight: 'auto',
panelHeight : 'auto', panelHeight: 'auto',
valueField : 'id', valueField: 'id',
textField : 'text', textField: 'text',
onLoadSuccess : function() { onLoadSuccess: function () {
$("#infotatusId").combobox("select", "编辑中"); $("#infotatusId").combobox("select", "编辑中");
$("#infotatusId").combobox("setValue", 0); $("#infotatusId").combobox("setValue", 0);
} }
}); });
} }
//js时间戳格式化成日期格式 //js时间戳格式化成日期格式
function timestampformat(timestamp) { function timestampformat(timestamp) {
var date = new Date(timestamp); var date = new Date(timestamp);
var year = date.getFullYear(); var year = date.getFullYear();
var month = date.getMonth()+1; var month = date.getMonth() + 1;
var day = date.getDate(); var day = date.getDate();
return year+"-"+month+"-"+day; return year + "-" + month + "-" + day;
} }
function initDataTable(){ function initDataTable() {
$("#noticeTable").datagrid({ $("#noticeTable").datagrid({
height:clientHeight-divHeight-27, height: clientHeight - divHeight - 27,
nowrap : true, nowrap: true,
striped : true, striped: true,
pagination : true, pagination: true,
rownumbers : true, rownumbers: true,
pageList : [10,20,30,40,50], pageList: [10, 20, 30, 40, 50],
autoRowHeight : false, autoRowHeight: false,
fitColumns : false, fitColumns: false,
singleSelect : false, //单选 singleSelect: false, //单选
checkOnSelect : true, checkOnSelect: true,
selectOnCheck : true, selectOnCheck: true,
remoteSort : true, remoteSort: true,
url : '/business/noticeManage/queryAllNotice', url: '/business/noticeManage/queryAllNotice',
columns : [ [ { columns: [[{
field : 'ck', field: 'ck',
title : 'id', title: 'id',
width : 15, width: 15,
checkbox : true checkbox: true
},{ }, {
field : 'noticeTitle', field: 'noticeTitle',
title : '标题', title: '标题',
width : '700', width: '700',
align : 'center', align: 'center',
formatter : dataStyle formatter: dataStyle
},{ }, {
field : 'noticeType', field: 'noticeType',
title : '类型', title: '类型',
width : '200', width: '200',
align : 'center' align: 'center'
},{
field : 'createTime',
title : '发布日期',
width : '200',
align : 'center'
}, { }, {
field : 'creator', field: 'createTime',
title : '发布人', title: '发布日期',
width : '200', width: '200',
align : 'center' align: 'center'
},{ }, {
field : 'clickVolume', field: 'creator',
title : '点击量', title: '发布人',
width : '200', width: '200',
align : 'center' align: 'center'
}, {
field: 'clickVolume',
title: '点击量',
width: '200',
align: 'center'
} }
] ] ]]
}); });
} }
//打开查看窗口 打开tab页
function viewData(id){ //打开查看窗口 打开tab页
$.getJSON("/business/noticeManage/queryNoticeById/" + id, function(data) { function viewData(id) {
$.getJSON("/business/noticeManage/queryNoticeById/" + id, function (data) {
$("#addCentralNoticeForm").form('load', data); $("#addCentralNoticeForm").form('load', data);
editor.setContent(data.noticeContent); editor.setContent(data.noticeContent);
}); });
$("#main_area").height((bodyHeight/5)*4); $("#main_area").height((bodyHeight / 5) * 4);
$("#addCentralNoticeWinId").window({ $("#addCentralNoticeWinId").window({
title : '查看通知公告信息', title: '查看通知公告信息',
width : addWinWidth, width: addWinWidth,
height : addWinHeight, height: addWinHeight,
left : (dataGridWidth - addWinWidth)/2, left: (dataGridWidth - addWinWidth) / 2,
top : (bodyHeight - addWinHeight)/2, top: (bodyHeight - addWinHeight) / 2,
closable : true, // 否显示关闭按钮 closable: true, // 否显示关闭按钮
collapsible : false, // 是否显示折叠按钮 collapsible: false, // 是否显示折叠按钮
minimizable : false, // 是否显示最小化按钮 minimizable: false, // 是否显示最小化按钮
maximizable : false, // 是否显示最大化按钮 maximizable: false, // 是否显示最大化按钮
close : true, // 初始是否关闭 close: true, // 初始是否关闭
modal : true modal: true
}); });
$("#buttonId01").hide(); $("#buttonId01").hide();
$("#buttonId02").hide(); $("#buttonId02").hide();
$("#addCentralNoticeWinId").window('open'); $("#addCentralNoticeWinId").window('open');
} }
function dataStyle(val, row) { function dataStyle(val, row) {
return '<a class="" href="#" onclick="viewData(\'' + row.id + '\')">'+ row.noticeTitle + '</a>'; return '<a class="" href="#" onclick="viewData(\'' + row.id + '\')">' + row.noticeTitle + '</a>';
} }
function doSearch(value){
function doSearch(value) {
var queryParams = null; var queryParams = null;
$("#CentralNoticeManageTable").datagrid({ $("#CentralNoticeManageTable").datagrid({
queryParams : { queryParams: {
queryValue : value queryValue: value
} }
}); });
} }
/** /**
* 打开新增窗口 基本信息 * 打开新增窗口 基本信息
*/ */
function openAddWin(){ function openAddWin() {
initInputWidth(); initInputWidth();
operation = "add"; operation = "add";
$("#main_area").height(); $("#main_area").height();
$("#addCentralNoticeWinId").window({ $("#addCentralNoticeWinId").window({
title : '新增通知公告信息', title: '新增通知公告信息',
width : addWinWidth, width: addWinWidth,
height : addWinHeight, height: addWinHeight,
left : (dataGridWidth - addWinWidth)/2, left: (dataGridWidth - addWinWidth) / 2,
top : (bodyHeight - addWinHeight)/2, top: (bodyHeight - addWinHeight) / 2,
closable : true, // 否显示关闭按钮 closable: true, // 否显示关闭按钮
collapsible : false, // 是否显示折叠按钮 collapsible: false, // 是否显示折叠按钮
minimizable : false, // 是否显示最小化按钮 minimizable: false, // 是否显示最小化按钮
maximizable : false, // 是否显示最大化按钮 maximizable: false, // 是否显示最大化按钮
close : true, // 初始是否关闭 close: true, // 初始是否关闭
modal : true modal: true
}); });
$("#addCentralNoticeForm").form('clear'); $("#addCentralNoticeForm").form('clear');
$("#buttonId01").show(); $("#buttonId01").show();
...@@ -167,54 +170,55 @@ function openAddWin(){ ...@@ -167,54 +170,55 @@ function openAddWin(){
/** /**
* 打开修改窗口 基本信息 * 打开修改窗口 基本信息
*/ */
function openEditWin(){ function openEditWin() {
$("#addCentralNoticeWinId").form('clear'); $("#addCentralNoticeWinId").form('clear');
operation = "edit"; operation = "edit";
var rows = $('#noticeTable').datagrid('getSelections'); var rows = $('#noticeTable').datagrid('getSelections');
if(rows.length == 1){ if (rows.length == 1) {
var row = $('#noticeTable').datagrid('getSelected'); var row = $('#noticeTable').datagrid('getSelected');
$.getJSON("/business/noticeManage/queryNoticeById/" + row.id, function(data) { $.getJSON("/business/noticeManage/queryNoticeById/" + row.id, function (data) {
$("#addCentralNoticeForm").form('load', data); $("#addCentralNoticeForm").form('load', data);
editor.setContent(data.noticeContent); editor.setContent(data.noticeContent);
}); });
$("#main_area").height((bodyHeight/5)*4); $("#main_area").height((bodyHeight / 5) * 4);
$("#addCentralNoticeWinId").window({ $("#addCentralNoticeWinId").window({
title : '修改信息', title: '修改信息',
width : addWinWidth, width: addWinWidth,
height : addWinHeight, height: addWinHeight,
left : (dataGridWidth - addWinWidth)/2, left: (dataGridWidth - addWinWidth) / 2,
top : (bodyHeight - addWinHeight)/2, top: (bodyHeight - addWinHeight) / 2,
closable : true, // 否显示关闭按钮 closable: true, // 否显示关闭按钮
collapsible : false, // 是否显示折叠按钮 collapsible: false, // 是否显示折叠按钮
minimizable : false, // 是否显示最小化按钮 minimizable: false, // 是否显示最小化按钮
maximizable : false, // 是否显示最大化按钮 maximizable: false, // 是否显示最大化按钮
close : true, // 初始是否关闭 close: true, // 初始是否关闭
modal : true modal: true
}); });
$("#buttonId01").show(); $("#buttonId01").show();
$("#buttonId02").show(); $("#buttonId02").show();
$("#addCentralNoticeWinId").window('open'); $("#addCentralNoticeWinId").window('open');
}else { } else {
$.messager.alert('提示', '请选中一条记录 ', 'info'); $.messager.alert('提示', '请选中一条记录 ', 'info');
} }
} }
function openQueryWin(row){
function openQueryWin(row) {
var data = row var data = row
$("#addCentralNoticeForm").form('load', data); $("#addCentralNoticeForm").form('load', data);
editor.setContent(data.noticeContent); editor.setContent(data.noticeContent);
$("#main_area").height((bodyHeight/5)*4); $("#main_area").height((bodyHeight / 5) * 4);
$("#addCentralNoticeWinId").window({ $("#addCentralNoticeWinId").window({
title : '查看通知公告信息', title: '查看通知公告信息',
width : addWinWidth, width: addWinWidth,
height : addWinHeight, height: addWinHeight,
left : (dataGridWidth - addWinWidth)/2, left: (dataGridWidth - addWinWidth) / 2,
top : (bodyHeight - addWinHeight)/2, top: (bodyHeight - addWinHeight) / 2,
closable : true, // 否显示关闭按钮 closable: true, // 否显示关闭按钮
collapsible : false, // 是否显示折叠按钮 collapsible: false, // 是否显示折叠按钮
minimizable : false, // 是否显示最小化按钮 minimizable: false, // 是否显示最小化按钮
maximizable : false, // 是否显示最大化按钮 maximizable: false, // 是否显示最大化按钮
close : true, // 初始是否关闭 close: true, // 初始是否关闭
modal : true modal: true
}); });
$("#buttonId01").hide(); $("#buttonId01").hide();
$("#buttonId02").show(); $("#buttonId02").show();
...@@ -222,53 +226,54 @@ function openQueryWin(row){ ...@@ -222,53 +226,54 @@ function openQueryWin(row){
} }
$("#professorNameId").combobox({ $("#professorNameId").combobox({
width:fixShortWidth()+4 width: fixShortWidth() + 4
}) })
//保存数据 //保存数据
function saveData(){ function saveData() {
var centralNoticeTitle = $("#titleId").val(); var centralNoticeTitle = $("#titleId").val();
if('add' == operation){ if ('add' == operation) {
$.getJSON("/business/noticeManage/isExistNotice?noticeTitle="+encodeURI(encodeURI(centralNoticeTitle)),function(json){ $.getJSON("/business/noticeManage/isExistNotice?noticeTitle=" + encodeURI(encodeURI(centralNoticeTitle)), function (json) {
if(json.flag){ if (json.flag) {
$.messager.alert('提示', json.info, 'error'); $.messager.alert('提示', json.info, 'error');
}else { } else {
url = "/business/noticeManage/addOrUpdateNotice?operate="+operation; url = "/business/noticeManage/addOrUpdateNotice?operate=" + operation;
$('#addCentralNoticeForm').form('submit',{ $('#addCentralNoticeForm').form('submit', {
url: url, url: url,
onSubmit: function(){ onSubmit: function () {
return $(this).form('validate'); return $(this).form('validate');
}, },
success: function(data){ success: function (data) {
var data = eval("("+data+")"); var data = eval("(" + data + ")");
if (data.flag){ if (data.flag) {
$.messager.alert('提示', data.info, 'ok'); $.messager.alert('提示', data.info, 'ok');
closeWindow(); closeWindow();
initDataTable(); initDataTable();
} else { } else {
$.messager.alert("提示",data.info,'error'); $.messager.alert("提示", data.info, 'error');
} }
} }
}); });
} }
}) })
} }
if('edit' == operation){ if ('edit' == operation) {
var row = $('#noticeTable').datagrid('getSelected'); var row = $('#noticeTable').datagrid('getSelected');
url = "/business/noticeManage/addOrUpdateNotice?operate="+operation+"&noticeId="+row.id; url = "/business/noticeManage/addOrUpdateNotice?operate=" + operation + "&noticeId=" + row.id;
$('#addCentralNoticeForm').form('submit',{ $('#addCentralNoticeForm').form('submit', {
url: url, url: url,
onSubmit: function(){ onSubmit: function () {
return $(this).form('validate'); return $(this).form('validate');
}, },
success: function(data){ success: function (data) {
var data = eval("("+data+")") var data = eval("(" + data + ")")
if (data.flag){ if (data.flag) {
$.messager.alert('提示',data.info, 'ok'); $.messager.alert('提示', data.info, 'ok');
closeWindow(); closeWindow();
initDataTable(); initDataTable();
} else { } else {
$.messager.alert("提示",data.info,'error'); $.messager.alert("提示", data.info, 'error');
} }
} }
}); });
...@@ -276,32 +281,34 @@ function saveData(){ ...@@ -276,32 +281,34 @@ function saveData(){
} }
//删除 //删除
function deleteNotice(){ function deleteNotice() {
var rows = $('#noticeTable').datagrid('getChecked'); var rows = $('#noticeTable').datagrid('getChecked');
if (rows.length !=0 ){ if (rows.length != 0) {
var jsonIds = arrayTojson(rows); var jsonIds = arrayTojson(rows);
$.messager.confirm("删除","确定删除?",function(r){ $.messager.confirm("删除", "确定删除?", function (r) {
if (r){ if (r) {
var postUrl = '/business/noticeManage/deleteNotices'; var postUrl = '/business/noticeManage/deleteNotices';
$.post(postUrl,{ $.post(postUrl, {
"ids":jsonIds},function(result){ "ids": jsonIds
if (result.flag){ }, function (result) {
$.messager.alert('提示',result.info,'ok'); if (result.flag) {
$.messager.alert('提示', result.info, 'ok');
initDataTable(); initDataTable();
} else { } else {
$.messager.alert('提示',result.info,'error'); $.messager.alert('提示', result.info, 'error');
initDataTable(); initDataTable();
return; return;
} }
},'json'); }, 'json');
} }
}); });
}else{ } else {
$.messager.alert('提示', '请选中一条要删除记录', 'info'); $.messager.alert('提示', '请选中一条要删除记录', 'info');
} }
} }
//关闭窗口 基础信息 //关闭窗口 基础信息
function closeWindow(){ function closeWindow() {
$("#addCentralNoticeWinId").window('close'); $("#addCentralNoticeWinId").window('close');
} }
...@@ -310,7 +317,7 @@ function closeWindow(){ ...@@ -310,7 +317,7 @@ function closeWindow(){
*/ */
function arrayTojson(arr) { function arrayTojson(arr) {
var jsonIds = "["; var jsonIds = "[";
for ( var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
if (i == arr.length - 1) { if (i == arr.length - 1) {
jsonIds += arr[i].id; jsonIds += arr[i].id;
} else { } else {
...@@ -321,16 +328,18 @@ function arrayTojson(arr) { ...@@ -321,16 +328,18 @@ function arrayTojson(arr) {
return jsonIds; return jsonIds;
} }
//查询 //查询
function queryData() { function queryData() {
var noticeTitle = $("#titleId00").val(); var noticeTitle = $("#titleId00").val();
var queryParams = null; var queryParams = null;
$("#noticeTable").datagrid({ $("#noticeTable").datagrid({
queryParams : { queryParams: {
noticeTitle : noticeTitle noticeTitle: noticeTitle
} }
}); });
} }
// 清空查询条件框 // 清空查询条件框
function clearQueryForm() { function clearQueryForm() {
$("#queryFormId2").form('clear'); $("#queryFormId2").form('clear');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment