From d1c70c3eb5cf0fb4931547e5149f9c6ed102d1bc Mon Sep 17 00:00:00 2001 From: gaojiuqi Date: Mon, 28 Mar 2022 21:41:29 +0800 Subject: [PATCH] ... --- .../controller/ContentController.java | 12 +- .../controller/OssUploadController.java | 2 + src/main/java/com/nbclass/util/Tomcat.java | 25 + src/main/resources/application-dev.yml | 3 +- .../mapper/activity/ContentMapper.xml | 70 ++- .../resources/templates/content/census.html | 27 +- .../resources/templates/content/edit2.html | 487 +++++++++++------- src/main/resources/web.properties | 3 + 8 files changed, 381 insertions(+), 248 deletions(-) create mode 100644 src/main/java/com/nbclass/util/Tomcat.java create mode 100644 src/main/resources/web.properties diff --git a/src/main/java/com/nbclass/activity/controller/ContentController.java b/src/main/java/com/nbclass/activity/controller/ContentController.java index bf1b589..87ddc30 100644 --- a/src/main/java/com/nbclass/activity/controller/ContentController.java +++ b/src/main/java/com/nbclass/activity/controller/ContentController.java @@ -304,12 +304,12 @@ public class ContentController extends BaseController { } } } - if(entity.getAttachment()!=null){ - String s = JSON.toJSONString(entity.getAttachment()); - s = s.replace("[", ""); - s = s.replace("]", ""); - entity.setAttachment(s); - } +// if(entity.getAttachment()!=null){ +// String s = JSON.toJSONString(entity.getAttachment()); +// s = s.replace("[", ""); +// s = s.replace("]", ""); +// entity.setAttachment(s); +// } String desc = null; if(entity.getId()!=null && entity.getId()>0){ service.update(entity); diff --git a/src/main/java/com/nbclass/activity/controller/OssUploadController.java b/src/main/java/com/nbclass/activity/controller/OssUploadController.java index 28a0700..6e07c6d 100644 --- a/src/main/java/com/nbclass/activity/controller/OssUploadController.java +++ b/src/main/java/com/nbclass/activity/controller/OssUploadController.java @@ -6,6 +6,8 @@ import java.util.Arrays; import java.util.Date; import java.util.List; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.nbclass.activity.model.OssFile; import org.apache.commons.lang3.StringUtils; import org.springframework.web.bind.annotation.PostMapping; diff --git a/src/main/java/com/nbclass/util/Tomcat.java b/src/main/java/com/nbclass/util/Tomcat.java new file mode 100644 index 0000000..365f7e7 --- /dev/null +++ b/src/main/java/com/nbclass/util/Tomcat.java @@ -0,0 +1,25 @@ +package com.nbclass.util; + +import javax.servlet.Servlet; +import java.io.FileReader; +import java.util.Properties; +import java.util.Scanner; + +public class Tomcat { + + public static void main(String[] args) throws Exception { + System.out.println("Tomcat服务器正在启动...."); + System.out.println("请输入路径:"); + Scanner scanner = new Scanner(System.in); + String next = scanner.next(); + FileReader reader = new FileReader("web"); + Properties properties = new Properties(); + properties.load(reader); + properties.clone(); + Class aClass = Class.forName(next); + Object o = aClass.newInstance(); + Servlet servlet = (Servlet) o; + servlet.service(null,null); + } + +} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index fbea729..122a283 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -34,7 +34,8 @@ spring: enabled: true # 开启 Elasticsearch仓库(默认值:true) client: reactive: - endpoints: 39.108.110.167:9200 +# endpoints: 39.108.110.167:9200 + endpoints: 127.0.0.1:9200 connection-timeout: 5000 socket-timeout: 5000 diff --git a/src/main/resources/mapper/activity/ContentMapper.xml b/src/main/resources/mapper/activity/ContentMapper.xml index d4bd3dd..02536e2 100644 --- a/src/main/resources/mapper/activity/ContentMapper.xml +++ b/src/main/resources/mapper/activity/ContentMapper.xml @@ -492,8 +492,6 @@ WHERE item.dictid = 26 - GROUP BY - item.id,c.id AND DATE_FORMAT( c.online_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ), '%Y%m' ) @@ -503,27 +501,43 @@ AND YEAR(c.online_time)=YEAR(NOW()) + GROUP BY + item.id,c.id \n" + - " \n" + - " \n" + - " \n" + - " \n" + - "
\n" + - " \n" + - "
\n" ; - //$(".qq-upload-list-selector qq-upload-list").appendChild(liNode); - document.getElementById("ul").appendChild(liNode); - $("#attachment"+i+"").parent().find('input[type="file"]').val(''); // 清空值 - $("#attachment"+i+"").val(JSON.stringify(value)); - $(".a_viewfile"+i+"").attr('href', value.url); - $(".a_viewfile"+i+"").text(value.ori_name); - $('.a_viewfile'+i+"").show(); - }); - } - } - $("#deleteFile2").on("click",function (){ - var value = "qq-file-id-" +$(this).attr("name"); - var msg = "确定删除该文件?"; - Core.confirm(msg, function () { - alert(value) - $("."+value+"").remove(); - $("#attachment"+i+"").val(""); - }); - }); - } + // if($('#dataid').val() > 0){ + // var attachment = '[[${attachment}]]'; + // console.log(attachment) + // if(attachment != null && attachment != undefined){ + // attachment=attachment.replace(new RegExp('"','g'),'"'); + // attachment = attachment.substring(1,attachment.length); + // attachment = attachment.substring(0,attachment.length-1); + // attachment = "["+attachment+"]"; + // console.log(attachment) + // if(attachment!=null && $.trim(attachment)!=''){ + // var jsondata = JSON.parse(attachment); + // console.log(jsondata) + // $.each(jsondata, function (i, value) { + // var liNode=document.createElement("li"); + // liNode.setAttribute("class","qq-file-id-" + i+5 + " qq-file-id=" + i+5 + ""); + // liNode.innerHTML = + // "
\n" + + // "
\n" + + // "
\n" + + // " \n" + + // " " + value.ori_name + "\n" + + // "\n" + + // " \n" + + // " \n" + + // " \n" + + // " \n" + + // "
\n" + + // " \n" + + // "
\n" ; + // //$(".qq-upload-list-selector qq-upload-list").appendChild(liNode); + // document.getElementById("ul").appendChild(liNode); + // $("#attachment"+i+"").parent().find('input[type="file"]').val(''); // 清空值 + // $("#attachment"+i+"").val(JSON.stringify(value)); + // $(".a_viewfile"+i+"").attr('href', value.url); + // $(".a_viewfile"+i+"").text(value.ori_name); + // $('.a_viewfile'+i+"").show(); + // }); + // } + // } + // $("#deleteFile2").on("click",function (){ + // var value = "qq-file-id-" +$(this).attr("name"); + // var msg = "确定删除该文件?"; + // Core.confirm(msg, function () { + // alert(value) + // $("."+value+"").remove(); + // $("#attachment"+i+"").val(""); + // }); + // }); + // } + if($('#dataid').val() > 0){ + attachment(); + } // 加载标签插件数据 @@ -695,7 +784,7 @@ var caseType = [[${caseType}]]; $('.selectpicker').selectpicker('render'); } } - },100) + },100); // 加载图集的table @@ -708,7 +797,6 @@ var caseType = [[${caseType}]]; initKEdit('#desct'); // 初始化编辑器 getDropDownBox(); - if($("#result").val() > 0){ $("#btn_save").hide(); } @@ -727,6 +815,21 @@ var caseType = [[${caseType}]]; } }); + //附件删除 + $(".span22").click(function () { + var attachment = $("#attachment").val(); + + attachment = eval('(' + attachment + ')'); + for(var i in attachment){ + if(attachment[i].url == this.previousSibling){ + attachment.splice(i,1); + $("#attachment").val(JSON.stringify(attachment)); + } + } + this.previousSibling.parentNode.removeChild(this.previousSibling); + this.parentNode.removeChild(this); + }); + // 选择图片自动上传 $("#newsForm").on("change","#listicon_file",function(){ uploadIconFile(this.files); diff --git a/src/main/resources/web.properties b/src/main/resources/web.properties new file mode 100644 index 0000000..8841903 --- /dev/null +++ b/src/main/resources/web.properties @@ -0,0 +1,3 @@ +/aaaa=com.nbclass.util.UserListServlet +/bbbb=com.nbclass.util.UserLoginServlet +/cccc=com.nbclass.util.BankServlet \ No newline at end of file