mysql 提交

master
sunxin 7 years ago
parent eaa1c4b3cc
commit de1c2d2f39
  1. 1239
      doc/db-mcms-mysql-4.7.0.sql
  2. 266
      src/main/java/net/mingsoft/cms/action/web/SearchAction.java
  3. 12
      src/main/java/net/mingsoft/cms/util/CmsParserUtil.java
  4. 0
      src/main/webapp/templets/1/shuiwu/about.htm
  5. 0
      src/main/webapp/templets/1/shuiwu/advice.htm
  6. 0
      src/main/webapp/templets/1/shuiwu/case-list.htm
  7. 0
      src/main/webapp/templets/1/shuiwu/contact.htm
  8. 0
      src/main/webapp/templets/1/shuiwu/css/animate.css
  9. 0
      src/main/webapp/templets/1/shuiwu/css/jquery.sinaemotion.css
  10. 0
      src/main/webapp/templets/1/shuiwu/footer.htm
  11. 0
      src/main/webapp/templets/1/shuiwu/head-file.htm
  12. 0
      src/main/webapp/templets/1/shuiwu/head.htm
  13. 0
      src/main/webapp/templets/1/shuiwu/images/00.png
  14. 0
      src/main/webapp/templets/1/shuiwu/images/01.jpg
  15. 0
      src/main/webapp/templets/1/shuiwu/images/02.jpg
  16. 0
      src/main/webapp/templets/1/shuiwu/images/03.jpg
  17. 0
      src/main/webapp/templets/1/shuiwu/images/1471918025445.png
  18. 0
      src/main/webapp/templets/1/shuiwu/images/about_us.jpg
  19. 0
      src/main/webapp/templets/1/shuiwu/images/ad_ctr.png
  20. 0
      src/main/webapp/templets/1/shuiwu/images/alpha.png
  21. 0
      src/main/webapp/templets/1/shuiwu/images/baidu.png
  22. 0
      src/main/webapp/templets/1/shuiwu/images/banner.jpg
  23. 0
      src/main/webapp/templets/1/shuiwu/images/case.png
  24. 0
      src/main/webapp/templets/1/shuiwu/images/code.jpg
  25. 0
      src/main/webapp/templets/1/shuiwu/images/company.png
  26. 0
      src/main/webapp/templets/1/shuiwu/images/contact_us.jpeg
  27. 0
      src/main/webapp/templets/1/shuiwu/images/error.png
  28. 0
      src/main/webapp/templets/1/shuiwu/images/hu1.png
  29. 0
      src/main/webapp/templets/1/shuiwu/images/img-2.png
  30. 0
      src/main/webapp/templets/1/shuiwu/images/level-0.png
  31. 0
      src/main/webapp/templets/1/shuiwu/images/level-1.png
  32. 0
      src/main/webapp/templets/1/shuiwu/images/level-2.png
  33. 0
      src/main/webapp/templets/1/shuiwu/images/level-3.png
  34. 0
      src/main/webapp/templets/1/shuiwu/images/level-4.png
  35. 0
      src/main/webapp/templets/1/shuiwu/images/level-5.png
  36. 0
      src/main/webapp/templets/1/shuiwu/images/loading.gif
  37. 0
      src/main/webapp/templets/1/shuiwu/images/logo.png
  38. 0
      src/main/webapp/templets/1/shuiwu/images/micro-blog.png
  39. 0
      src/main/webapp/templets/1/shuiwu/images/mobile.png
  40. 0
      src/main/webapp/templets/1/shuiwu/images/more.png
  41. 0
      src/main/webapp/templets/1/shuiwu/images/ms.ico
  42. 0
      src/main/webapp/templets/1/shuiwu/images/new-loading.gif
  43. 0
      src/main/webapp/templets/1/shuiwu/images/news.png
  44. 0
      src/main/webapp/templets/1/shuiwu/images/news2.png
  45. 0
      src/main/webapp/templets/1/shuiwu/images/no-comment.png
  46. 0
      src/main/webapp/templets/1/shuiwu/images/no-data.png
  47. 0
      src/main/webapp/templets/1/shuiwu/images/our_company.jpeg
  48. 0
      src/main/webapp/templets/1/shuiwu/images/pexels-photo-583845.jpeg
  49. 0
      src/main/webapp/templets/1/shuiwu/images/pic.png
  50. 0
      src/main/webapp/templets/1/shuiwu/images/pics.png
  51. 0
      src/main/webapp/templets/1/shuiwu/images/search.jpg
  52. 0
      src/main/webapp/templets/1/shuiwu/images/search.png
  53. 0
      src/main/webapp/templets/1/shuiwu/images/talk_online.jpeg
  54. 0
      src/main/webapp/templets/1/shuiwu/images/timg.jpg
  55. 0
      src/main/webapp/templets/1/shuiwu/images/we-chat.png
  56. 0
      src/main/webapp/templets/1/shuiwu/images/weixin.jpg
  57. 0
      src/main/webapp/templets/1/shuiwu/js/demo.js
  58. 0
      src/main/webapp/templets/1/shuiwu/js/jquery.sinaEmotion.js
  59. 0
      src/main/webapp/templets/1/shuiwu/js/slider.js
  60. 0
      src/main/webapp/templets/1/shuiwu/less/about.less
  61. 0
      src/main/webapp/templets/1/shuiwu/less/advice.less
  62. 0
      src/main/webapp/templets/1/shuiwu/less/base.less
  63. 0
      src/main/webapp/templets/1/shuiwu/less/case-list.less
  64. 0
      src/main/webapp/templets/1/shuiwu/less/center.less
  65. 0
      src/main/webapp/templets/1/shuiwu/less/index.less
  66. 0
      src/main/webapp/templets/1/shuiwu/less/login.less
  67. 0
      src/main/webapp/templets/1/shuiwu/less/news-list.less
  68. 0
      src/main/webapp/templets/1/shuiwu/less/news-show.less
  69. 0
      src/main/webapp/templets/1/shuiwu/m/about.htm
  70. 0
      src/main/webapp/templets/1/shuiwu/m/advice.htm
  71. 0
      src/main/webapp/templets/1/shuiwu/m/case-list.htm
  72. 0
      src/main/webapp/templets/1/shuiwu/m/contact.htm
  73. 0
      src/main/webapp/templets/1/shuiwu/m/css/jquery.sinaemotion.css
  74. 0
      src/main/webapp/templets/1/shuiwu/m/css/style.css
  75. 0
      src/main/webapp/templets/1/shuiwu/m/footer.htm
  76. 0
      src/main/webapp/templets/1/shuiwu/m/head-file.htm
  77. 0
      src/main/webapp/templets/1/shuiwu/m/head.htm
  78. 0
      src/main/webapp/templets/1/shuiwu/m/images/01.png
  79. 0
      src/main/webapp/templets/1/shuiwu/m/images/02.png
  80. 0
      src/main/webapp/templets/1/shuiwu/m/images/03.png
  81. 0
      src/main/webapp/templets/1/shuiwu/m/images/04.png
  82. 0
      src/main/webapp/templets/1/shuiwu/m/images/05.png
  83. 0
      src/main/webapp/templets/1/shuiwu/m/images/about.png
  84. 0
      src/main/webapp/templets/1/shuiwu/m/images/case.png
  85. 0
      src/main/webapp/templets/1/shuiwu/m/images/hu1.png
  86. 0
      src/main/webapp/templets/1/shuiwu/m/images/level-0.png
  87. 0
      src/main/webapp/templets/1/shuiwu/m/images/level-1.png
  88. 0
      src/main/webapp/templets/1/shuiwu/m/images/level-2.png
  89. 0
      src/main/webapp/templets/1/shuiwu/m/images/level-3.png
  90. 0
      src/main/webapp/templets/1/shuiwu/m/images/level-4.png
  91. 0
      src/main/webapp/templets/1/shuiwu/m/images/level-5.png
  92. 0
      src/main/webapp/templets/1/shuiwu/m/images/loading.gif
  93. 0
      src/main/webapp/templets/1/shuiwu/m/images/message.png
  94. 0
      src/main/webapp/templets/1/shuiwu/m/images/mo.png
  95. 0
      src/main/webapp/templets/1/shuiwu/m/images/mobile.png
  96. 0
      src/main/webapp/templets/1/shuiwu/m/images/ms.ico
  97. 0
      src/main/webapp/templets/1/shuiwu/m/images/no-data.png
  98. 0
      src/main/webapp/templets/1/shuiwu/m/images/pics.png
  99. 0
      src/main/webapp/templets/1/shuiwu/m/images/timg.jpg
  100. 0
      src/main/webapp/templets/1/shuiwu/m/images/搜索.png
  101. Some files were not shown because too many files have changed in this diff Show More

File diff suppressed because one or more lines are too long

@ -19,8 +19,8 @@ The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net)
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package net.mingsoft.cms.action.web;
package net.mingsoft.cms.action.web;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
@ -56,17 +56,17 @@ import freemarker.template.MalformedTemplateNameException;
import freemarker.template.TemplateNotFoundException;
import net.mingsoft.base.constant.Const;
import net.mingsoft.basic.util.BasicUtil;
import net.mingsoft.mdiy.util.ParserUtil;
import net.mingsoft.mdiy.util.ParserUtil;
/**
* 根据搜索结果动态解析模版内容
* @author 铭飞开源团队-Administrator
* @date 2018年12月18日
*/
@Controller(value = "webSearchAction")
@RequestMapping("/cms")
public class SearchAction extends BaseAction {
*/
@Controller(value = "webSearchAction")
@RequestMapping("/cms")
public class SearchAction extends BaseAction {
/**
* 搜索标签;
*/
@ -76,24 +76,24 @@ public class SearchAction extends BaseAction {
* 搜索的标题;
*/
public static final String BASIC_TITLE = "basic_title";
/**
* 注入文章业务层
*/
@Autowired
private IArticleBiz articleBiz;
/**
* 注入搜索业务层
*/
@Autowired
private ISearchBiz searchBiz;
/**
* 注入栏目业务层
*/
@Autowired
private IColumnBiz columnBiz;
/**
* 注入文章业务层
*/
@Autowired
private IArticleBiz articleBiz;
/**
* 注入搜索业务层
*/
@Autowired
private ISearchBiz searchBiz;
/**
* 注入栏目业务层
*/
@Autowired
private IColumnBiz columnBiz;
/**
* 实现前端页面的文章搜索
*
@ -114,7 +114,7 @@ public class SearchAction extends BaseAction {
if (ObjectUtil.isNull(search)) {
this.outJson(response, false);
}
Map map = BasicUtil.assemblyRequestMap();
Map<String, Object> map = BasicUtil.assemblyRequestMap();
// 读取请求字段
Map<String, String[]> field = request.getParameterMap();
Map<String, String> basicField = getMapByProperties(net.mingsoft.mdiy.constant.Const.BASIC_FIELD);
@ -158,15 +158,17 @@ public class SearchAction extends BaseAction {
map.put(ParserUtil.TOTAL, PageUtil.totalPage(count, 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.URL, BasicUtil.getUrl());
Map searchMap = new HashMap<>();
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(ParserUtil.IS_DO,true);
map.put(ParserUtil.IS_DO,false);
//设置动态请求的模块路径
map.put(ParserUtil.MODEL_NAME, "mcms");
//解析后的内容
@ -184,107 +186,107 @@ public class SearchAction extends BaseAction {
e.printStackTrace();
}
this.outString(response, content);
}
/**
* 动态组织查询where条件 获取查询条件的Map key:字段名 value:List 字段的各种判断值 list[0]:是否为自定义字段
* list[1]:是否为整形 list[2]:是否是等值查询 list[3]:字段的值
*
* @param articleField
* 文章字段
* @param diyFieldName
* 动态字段
* @param fields
* 模型对应的字段类型
* @return
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
private Map<String, List> searchMap(Map<String, Object> articleField, Map<String, String> diyFieldName,
List fields) {
Map<String, List> map = new HashMap<String, List>();
// 遍历文章中的字段
for (Iterator iter = articleField.keySet().iterator(); iter.hasNext();) {
String key = iter.next().toString();
String fieldValue = articleField.get(key).toString();
List list = new ArrayList();
List listValue = new ArrayList();
// 是否为自定义字段
list.add(false);
// 是否是数字类型,true:不是
list.add(true);
// 是否是模糊查询3
list.add(true);
// 字段值
listValue.add(articleField.get(key));
list.add(listValue);
map.put(key, list);
}
// 遍历字段自定义字段
// for (Iterator iter = diyFieldName.keySet().iterator(); iter.hasNext();) {
// String key = iter.next().toString();
// String fieldValue = diyFieldName.get(key);
// // 获取字段实体
// ContentModelFieldEntity field = this.get(key, fields);
// if (field != null) {
// List list = new ArrayList();
// // 是否为自定义字段0
// list.add(0, true);
// List listValue = new ArrayList();
// // 字段的值
// if (field.getFieldType() == IContentModelFieldBiz.INT || field.getFieldType() == IContentModelFieldBiz.FLOAT) {
// // 判断是否为区间查询
//
// if (diyFieldName.get(key).toString().indexOf("-") > 0) {
// String[] values = fieldValue.toString().split("-");
// // 是否是数字类型,false:是
// list.add(false);
// // 是否是区间比较 false:是
// list.add(false);
// // 字段值1
// listValue.add(values[0]);
// listValue.add(values[1]);
// } else {
// // 是否是数字类型,false:是2
// list.add(false);
// // 是否是区间比较 true:不是3
// list.add(true);
// // 字段值 1
// listValue.add(fieldValue);
// }
// } else {
// // 是否是数字类型,true:不是2
// list.add(true);
// list.add(false);
// // 字段值 1
// listValue.add(fieldValue);
// }
// list.add(listValue);
// map.put(key, list);
// }
// }
return map;
}
/**
* 根据字段名称获取字段类型
*
* @param columnName
* 字段名称
* @return 字段实体
*/
private ContentModelFieldEntity get(String columnName, List<ContentModelFieldEntity> fields) {
if (fields == null) {
return null;
}
for (ContentModelFieldEntity field : fields) {
if (field.getFieldFieldName().equals(columnName)) {
return field;
}
}
return null;
}
}
/**
* 动态组织查询where条件 获取查询条件的Map key:字段名 value:List 字段的各种判断值 list[0]:是否为自定义字段
* list[1]:是否为整形 list[2]:是否是等值查询 list[3]:字段的值
*
* @param articleField
* 文章字段
* @param diyFieldName
* 动态字段
* @param fields
* 模型对应的字段类型
* @return
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
private Map<String, List> searchMap(Map<String, Object> articleField, Map<String, String> diyFieldName,
List fields) {
Map<String, List> map = new HashMap<String, List>();
// 遍历文章中的字段
for (Iterator iter = articleField.keySet().iterator(); iter.hasNext();) {
String key = iter.next().toString();
String fieldValue = articleField.get(key).toString();
List list = new ArrayList();
List listValue = new ArrayList();
// 是否为自定义字段
list.add(false);
// 是否是数字类型,true:不是
list.add(true);
// 是否是模糊查询3
list.add(true);
// 字段值
listValue.add(articleField.get(key));
list.add(listValue);
map.put(key, list);
}
// 遍历字段自定义字段
// for (Iterator iter = diyFieldName.keySet().iterator(); iter.hasNext();) {
// String key = iter.next().toString();
// String fieldValue = diyFieldName.get(key);
// // 获取字段实体
// ContentModelFieldEntity field = this.get(key, fields);
// if (field != null) {
// List list = new ArrayList();
// // 是否为自定义字段0
// list.add(0, true);
// List listValue = new ArrayList();
// // 字段的值
// if (field.getFieldType() == IContentModelFieldBiz.INT || field.getFieldType() == IContentModelFieldBiz.FLOAT) {
// // 判断是否为区间查询
//
// if (diyFieldName.get(key).toString().indexOf("-") > 0) {
// String[] values = fieldValue.toString().split("-");
// // 是否是数字类型,false:是
// list.add(false);
// // 是否是区间比较 false:是
// list.add(false);
// // 字段值1
// listValue.add(values[0]);
// listValue.add(values[1]);
// } else {
// // 是否是数字类型,false:是2
// list.add(false);
// // 是否是区间比较 true:不是3
// list.add(true);
// // 字段值 1
// listValue.add(fieldValue);
// }
// } else {
// // 是否是数字类型,true:不是2
// list.add(true);
// list.add(false);
// // 字段值 1
// listValue.add(fieldValue);
// }
// list.add(listValue);
// map.put(key, list);
// }
// }
return map;
}
/**
* 根据字段名称获取字段类型
*
* @param columnName
* 字段名称
* @return 字段实体
*/
private ContentModelFieldEntity get(String columnName, List<ContentModelFieldEntity> fields) {
if (fields == null) {
return null;
}
for (ContentModelFieldEntity field : fields) {
if (field.getFieldFieldName().equals(columnName)) {
return field;
}
}
return null;
}
}

@ -23,6 +23,7 @@ import net.mingsoft.base.constant.Const;
import net.mingsoft.basic.entity.ColumnEntity;
import net.mingsoft.basic.util.BasicUtil;
import net.mingsoft.basic.util.SpringUtil;
import net.mingsoft.basic.util.StringUtil;
import net.mingsoft.cms.bean.ColumnArticleIdBean;
import net.mingsoft.cms.constant.e.ColumnTypeEnum;
import net.mingsoft.mdiy.biz.IContentModelBiz;
@ -42,13 +43,18 @@ public class CmsParserUtil extends ParserUtil {
* @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);
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);
// 生成移动页面
if (ObjectUtil.isNotNull(BasicUtil.getApp().getAppMobileStyle())) {
if (mobileStyle) {
// 手机端m
map.put(ParserUtil.MOBILE, BasicUtil.getApp().getAppMobileStyle());
content = CmsParserUtil.generate(templatePath, map, true);

Before

Width:  |  Height:  |  Size: 520 KiB

After

Width:  |  Height:  |  Size: 520 KiB

Before

Width:  |  Height:  |  Size: 200 KiB

After

Width:  |  Height:  |  Size: 200 KiB

Before

Width:  |  Height:  |  Size: 215 KiB

After

Width:  |  Height:  |  Size: 215 KiB

Before

Width:  |  Height:  |  Size: 159 KiB

After

Width:  |  Height:  |  Size: 159 KiB

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Before

Width:  |  Height:  |  Size: 236 KiB

After

Width:  |  Height:  |  Size: 236 KiB

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 126 KiB

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Before

Width:  |  Height:  |  Size: 675 KiB

After

Width:  |  Height:  |  Size: 675 KiB

Before

Width:  |  Height:  |  Size: 758 KiB

After

Width:  |  Height:  |  Size: 758 KiB

Before

Width:  |  Height:  |  Size: 619 KiB

After

Width:  |  Height:  |  Size: 619 KiB

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Before

Width:  |  Height:  |  Size: 247 KiB

After

Width:  |  Height:  |  Size: 247 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before

Width:  |  Height:  |  Size: 246 KiB

After

Width:  |  Height:  |  Size: 246 KiB

Before

Width:  |  Height:  |  Size: 311 KiB

After

Width:  |  Height:  |  Size: 311 KiB

Before

Width:  |  Height:  |  Size: 295 KiB

After

Width:  |  Height:  |  Size: 295 KiB

Before

Width:  |  Height:  |  Size: 396 KiB

After

Width:  |  Height:  |  Size: 396 KiB

Before

Width:  |  Height:  |  Size: 325 KiB

After

Width:  |  Height:  |  Size: 325 KiB

Before

Width:  |  Height:  |  Size: 337 KiB

After

Width:  |  Height:  |  Size: 337 KiB

Before

Width:  |  Height:  |  Size: 363 KiB

After

Width:  |  Height:  |  Size: 363 KiB

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save