Commit 07730e63 authored by 他是超人他会飞's avatar 他是超人他会飞 Committed by 铭飞

!140 SQL更新

Merge pull request !140 from 他是超人他会飞/4.7.0
parents eaa1c4b3 f0ef7e53
ALTER TABLE `model` ADD COLUMN `is_child` varchar(255) COMMENT '扩展业务标记' AFTER `model_parent_ids`; ALTER TABLE `model` ADD COLUMN `is_child` varchar(255) COMMENT '扩展业务标记' AFTER `model_parent_ids`;
ALTER TABLE `mdiy_dict` ADD COLUMN `is_child` varchar(255) COMMENT '扩展业务标记' AFTER `dict_description`; ALTER TABLE `mdiy_dict` ADD COLUMN `is_child` varchar(255) COMMENT '扩展业务标记' AFTER `dict_description`;
ALTER TABLE `role` MODIFY COLUMN `app_id` int(11) COMMENT '应用编号' AFTER `role_managerid`; ALTER TABLE `role` MODIFY COLUMN `app_id` int(11) COMMENT '应用编号' AFTER `role_managerid`;
ALTER TABLE `mdiy_dict` MODIFY COLUMN `dict_value` varchar(100) COMMENT '数据值' AFTER `app_id`;
DROP TABLE IF EXISTS `file`; DROP TABLE IF EXISTS `file`;
CREATE TABLE `file` ( CREATE TABLE `file` (
......
ALTER TABLE [dbo].[model] ADD [is_child] varchar(255) NULL ALTER TABLE [dbo].[model] ADD [is_child] varchar(255) NULL
GO GO
ALTER TABLE [dbo].[mdiy_dict] ALTER COLUMN [dict_value] nvarchar ( 100 ) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
EXEC sp_addextendedproperty EXEC sp_addextendedproperty
'MS_Description', N'扩展业务标记', 'MS_Description', N'扩展业务标记',
'SCHEMA', N'dbo', 'SCHEMA', N'dbo',
......
# 温馨提示,请使用master分支
db-mcms-mysql-4.7.0 最低版本mysql 5.7
db-mcms-sqlserver-4.7.0 最低版本 SQLServer2012
如果使用低与要求版本数据库会出现如下错误
1、导入 mysql文件 datetime时间函数报错,请使用4.6.
2、SQLServer数据库版本 自定义标签 使用了SQLServer2012最新的分页函数 ,
请自行修改mdiy_tag_sql表中的分页函数
数据库类型切换 :修改application.yml中
database-id: mysql、sqlServer、oracle
\ No newline at end of file
This diff is collapsed.
...@@ -125,7 +125,7 @@ public class ColumnAction extends BaseAction{ ...@@ -125,7 +125,7 @@ public class ColumnAction extends BaseAction{
*/ */
private void columnPath(HttpServletRequest request,ColumnEntity column){ private void columnPath(HttpServletRequest request,ColumnEntity column){
StringBuffer columnPath = new StringBuffer(); StringBuffer columnPath = new StringBuffer();
String file = BasicUtil.getRealPath("")+ParserUtil.HTML+File.separator+ column.getAppId(); String file = BasicUtil.getRealPath("","")+ParserUtil.HTML+File.separator+ column.getAppId();
String delFile = ""; String delFile = "";
//修改栏目路径时,删除已存在的文件夹 //修改栏目路径时,删除已存在的文件夹
column = (ColumnEntity) columnBiz.getEntity(column.getCategoryId()); column = (ColumnEntity) columnBiz.getEntity(column.getCategoryId());
......
...@@ -114,7 +114,7 @@ public class SearchAction extends BaseAction { ...@@ -114,7 +114,7 @@ public class SearchAction extends BaseAction {
if (ObjectUtil.isNull(search)) { if (ObjectUtil.isNull(search)) {
this.outJson(response, false); this.outJson(response, false);
} }
Map map = BasicUtil.assemblyRequestMap(); Map<String, Object> map = BasicUtil.assemblyRequestMap();
// 读取请求字段 // 读取请求字段
Map<String, String[]> field = request.getParameterMap(); Map<String, String[]> field = request.getParameterMap();
Map<String, String> basicField = getMapByProperties(net.mingsoft.mdiy.constant.Const.BASIC_FIELD); Map<String, String> basicField = getMapByProperties(net.mingsoft.mdiy.constant.Const.BASIC_FIELD);
...@@ -158,15 +158,17 @@ public class SearchAction extends BaseAction { ...@@ -158,15 +158,17 @@ public class SearchAction extends BaseAction {
map.put(ParserUtil.TOTAL, PageUtil.totalPage(count, size)); map.put(ParserUtil.TOTAL, PageUtil.totalPage(count, size));
//设置页面显示数量 //设置页面显示数量
map.put(ParserUtil.RCOUNT, size); map.put(ParserUtil.RCOUNT, size);
map.put(ParserUtil.SIZE, size);
//设置列表当前页 //设置列表当前页
map.put(ParserUtil.PAGE_NO, BasicUtil.getInt(ParserUtil.PAGE_NO,1)); map.put(ParserUtil.PAGE_NO, BasicUtil.getInt(ParserUtil.PAGE_NO,1));
map.put(ParserUtil.URL, BasicUtil.getUrl()); map.put(ParserUtil.URL, BasicUtil.getUrl());
Map searchMap = new HashMap<>(); Map searchMap = new HashMap<>();
searchMap.put(BASIC_TITLE, BasicUtil.getString(BASIC_TITLE)); searchMap.put(BASIC_TITLE, BasicUtil.getString(BASIC_TITLE));
searchMap.put(ParserUtil.PAGE_NO, BasicUtil.getInt(ParserUtil.PAGE_NO,1));
map.put(SEARCH, searchMap); map.put(SEARCH, searchMap);
//动态解析 //动态解析
map.put(ParserUtil.IS_DO,true); map.put(ParserUtil.IS_DO,false);
//设置动态请求的模块路径 //设置动态请求的模块路径
map.put(ParserUtil.MODEL_NAME, "mcms"); map.put(ParserUtil.MODEL_NAME, "mcms");
//解析后的内容 //解析后的内容
......
...@@ -23,6 +23,7 @@ import net.mingsoft.base.constant.Const; ...@@ -23,6 +23,7 @@ import net.mingsoft.base.constant.Const;
import net.mingsoft.basic.entity.ColumnEntity; import net.mingsoft.basic.entity.ColumnEntity;
import net.mingsoft.basic.util.BasicUtil; import net.mingsoft.basic.util.BasicUtil;
import net.mingsoft.basic.util.SpringUtil; import net.mingsoft.basic.util.SpringUtil;
import net.mingsoft.basic.util.StringUtil;
import net.mingsoft.cms.bean.ColumnArticleIdBean; import net.mingsoft.cms.bean.ColumnArticleIdBean;
import net.mingsoft.cms.constant.e.ColumnTypeEnum; import net.mingsoft.cms.constant.e.ColumnTypeEnum;
import net.mingsoft.mdiy.biz.IContentModelBiz; import net.mingsoft.mdiy.biz.IContentModelBiz;
...@@ -42,13 +43,18 @@ public class CmsParserUtil extends ParserUtil { ...@@ -42,13 +43,18 @@ public class CmsParserUtil extends ParserUtil {
* @throws IOException * @throws IOException
*/ */
public static void generate(String templatePath, String targetPath) throws IOException { public static void generate(String templatePath, String targetPath) throws IOException {
Map map = new HashMap(); Map<String, Object> map = new HashMap<String, Object>();
map.put(IS_DO, false); map.put(IS_DO, false);
String content = CmsParserUtil.generate(templatePath, map, false); boolean mobileStyle = false;
//判断是否有移动端
if (!StringUtil.isBlank(BasicUtil.getApp().getAppMobileStyle())) {
mobileStyle = true;
}
String content = CmsParserUtil.generate(templatePath, map, mobileStyle);
FileUtil.writeString(content, ParserUtil.buildHtmlPath(targetPath), Const.UTF8); FileUtil.writeString(content, ParserUtil.buildHtmlPath(targetPath), Const.UTF8);
// 生成移动页面 // 生成移动页面
if (ObjectUtil.isNotNull(BasicUtil.getApp().getAppMobileStyle())) { if (mobileStyle) {
// 手机端m // 手机端m
map.put(ParserUtil.MOBILE, BasicUtil.getApp().getAppMobileStyle()); map.put(ParserUtil.MOBILE, BasicUtil.getApp().getAppMobileStyle());
content = CmsParserUtil.generate(templatePath, map, true); content = CmsParserUtil.generate(templatePath, map, true);
......
spring: spring:
datasource: datasource:
url: jdbc:mysql://localhost:3306/tag?autoReconnect=true&useUnicode=true&characterEncoding=utf8&useSSL=false url: jdbc:mysql://localhost:3306/db-mcms?autoReconnect=true&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true
username: root username: root
password: root password: root
filters: wall,mergeStat filters: wall,mergeStat
......
spring: spring:
datasource: datasource:
url: jdbc:mysql://localhost:3306/mcms?autoReconnect=true&useUnicode=true&characterEncoding=utf8&useSSL=false driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://localhost:1433;DatabaseName=db-mcms
username: root username: root
password: root password: root
filters: wall,mergeStat filters: wall,mergeStat
......
server: mcms4.7.0 Oracle数据库暂不支持
port: 4000 \ No newline at end of file
servlet.context-path: /
spring:
datasource:
url: jdbc:mysql://172.17.0.4:3306/mcms-4.7.0?autoReconnect=true&useUnicode=true&characterEncoding=utf8&useSSL=false
username: root
password: root
filters: wall,mergeStat
type: com.alibaba.druid.pool.DruidDataSource
\ No newline at end of file
...@@ -13,38 +13,29 @@ ...@@ -13,38 +13,29 @@
<div class="am-gallery-item ms-case-div"> <div class="am-gallery-item ms-case-div">
<a href='[field.source/]'><img class="ms-case-list-img" src="{ms:global.host/}[field.litpic/]" alt="[field.title/]"/></a> <a href='[field.source/]'><img class="ms-case-list-img" src="{ms:global.host/}[field.litpic/]" alt="[field.title/]"/></a>
</div> </div>
<span class="am-hide ms-cur-{ms:page.cur/}-[field.index/]">{ms:page.next/}</span>
</li> </li>
{/ms:arclist} {/ms:arclist}
</ul> </ul>
<!-- <div id="ul{ms:page.cur/}"></div> -->
</div> </div>
<#include "m/footer.htm"/> <#include "m/footer.htm"/>
</body> </body>
</html> </html>
<script> <script>
/*var time = 1; var time = 1;
$(window).scroll(function() {   $(window).scroll(function() {  
var scrollTop = $(this).scrollTop();   var scrollTop = $(this).scrollTop();  
var scrollHeight = $(document).height();  var scrollHeight = $(document).height(); 
var windowHeight = $(this).height();   var windowHeight = $(this).height();  
if(scrollTop + windowHeight == scrollHeight) { if(scrollTop + windowHeight == scrollHeight) {
var time2 = $(".ms-cur-" + time + "-1").text() var time2 = $(".ms-cur-" + time + "-1").text()
if(time == "{ms:page.total/}") {
return;
}
$("#ul" + time).load(time2 + " #ms-ui"); $("#ul" + time).load(time2 + " #ms-ui");
$("#am-active-1").append("<div id=\"ul" + (time + 1) + "\"></div>") $("#am-active-1").append("<div id=\"ul" + (time + 1) + "\"></div>")
time++; time++;
}else if(scrollTop + 56 + windowHeight == scrollHeight){ }else if(scrollTop + 56 + windowHeight == scrollHeight){
var time2 = $(".ms-cur-" + time + "-1").text() var time2 = $(".ms-cur-" + time + "-1").text()
if(time == "{ms:page.total/}") {
return;
}
$("#ul" + time).load(time2 + " #ms-ui"); $("#ul" + time).load(time2 + " #ms-ui");
$("#am-active-1").append("<div id=\"ul" + (time + 1) + "\"></div>") $("#am-active-1").append("<div id=\"ul" + (time + 1) + "\"></div>")
time++; time++;
} }
}); });
*/
</script> </script>
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class="ms-banner"> <div class="ms-banner">
<img src="{ms:global.host/}/{ms:global.style/}/images/search.jpg"> <img src="{ms:global.host/}/{ms:global.style/}/images/search.jpg">
</div> </div>
<div class="ms-content"> <div class="ms-content" id="body">
<div class="ms-content-main-list" id="ms-content-search"> <div class="ms-content-main-list" id="ms-content-search">
<div class="ms-content-main-div"> <div class="ms-content-main-div">
<div class="ms-content-main-div-prompt">您搜索的关键字 <div class="ms-content-main-div-prompt">您搜索的关键字
...@@ -20,17 +20,17 @@ ...@@ -20,17 +20,17 @@
<li> <li>
<a href="{ms:global.url/}/[field.link/]"> <a href="{ms:global.url/}/[field.link/]">
[field.title/] [field.title/]
<span class="ms-content-main-li-time">[field.date?string("yyyy-mm-dd")/]</span> <span class="ms-content-main-li-time">[field.date?string("yyyy-MM-dd")/]</span>
</a> </a>
</li> </li>
{/ms:arclist} {/ms:arclist}
</ul> </ul>
</div> </div>
<div class="ms-content-main-page"> <div class="ms-content-main-page">
<a class="ms-content-main-page-first" href="{ms:page.index/}">首页</a> <a href="jacascript::void(0)" @click="indexAndLast(1)">首页</a>
<a class="ms-content-main-page-upper" href="{ms:page.pre/}">上一页</a> <a href="jacascript::void(0)" @click="search(false)">上一页</a>
<a class="ms-content-main-page-next" href="{ms:page.next/}">下一页</a> <a href="jacascript::void(0)" @click="search(true)">下一页</a>
<a class="ms-content-main-page-last" href="{ms:page.last/}"></a> <a href="jacascript::void(0)" @click="indexAndLast({ms:page.total/})"></a>
</div> </div>
</div> </div>
</div> </div>
...@@ -38,6 +38,30 @@ ...@@ -38,6 +38,30 @@
</body> </body>
</html> </html>
<script> <script>
new Vue({
el: "#body",
data: {
title: '',
list: [],
},
methods: {
search:function(flag){
var pageNo = {ms:search.pageNo/};
var total = {ms:page.total/};
if(flag){
pageNo = pageNo==total ? total : pageNo +1;
}else{
pageNo = pageNo -1==0 ? 1 : pageNo-1;
}
window.location.href="{ms:global.host/}/cms/1/search.do?basic_title={ms:search.basic_title/}&pageNo="+pageNo;
window.event.returnValue=false;
},
indexAndLast:function(pageNo){
window.location.href="{ms:global.host/}/cms/1/search.do?basic_title={ms:search.basic_title/}&pageNo="+pageNo;
window.event.returnValue=false;
},
},
})
if($('.ms-content-main-ul li').length <= 0) { if($('.ms-content-main-ul li').length <= 0) {
$('.ms-content-main-page').remove(); $('.ms-content-main-page').remove();
$('.ms-content-main-ul').before("<div class='ms-content-main-div-nothing'>没找到相关记录</div>") $('.ms-content-main-ul').before("<div class='ms-content-main-div-nothing'>没找到相关记录</div>")
......
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