liuyuqiang 2 年之前
父節點
當前提交
e55839eccb

+ 24 - 17
sooka-admin/src/main/resources/templates/main.html

@@ -4,7 +4,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <!--360浏览器优先以webkit内核解析-->
-    <title>首佳介绍</title>
+    <title>学区查询</title>
     <link rel="shortcut icon" href="favicon.ico">
     <link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
     <link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
@@ -42,7 +42,7 @@
 				</div>
 			</div>
 			<div class="form-group">
-				<label class="col-sm-3 control-label is-required">学校:</label>
+				<label class="col-sm-3 control-label">学校:</label>
 				<div id="schoolId" class="col-sm-8"></div>
 			</div>
 		</form>
@@ -57,17 +57,23 @@
 	<script th:src="@{/ajax/libs/select2/select2.min.js?v=4.0.13}"></script>
     <script type="text/javascript">
 		function submitHandler() {
-			$.post("/schooldistrict/index/list", {
-				schoolType: $("#schoolType").val(),
-				pId: $("#pId").val(),
-				vId: $("#vId").val()
-			}, function(result) {
-				var name = "";
-				$.each(result.rows, function (i, item) {
-					name += item.schoolName + ",";
-				})
-				$("#schoolId").empty().append(name.substring(0, name.length-1));
-			});
+			if ($.validate.form('form-pv-add')) {
+				$.post("/schooldistrict/index/list", {
+					schoolType: $("#schoolType").val(),
+					pId: $("#pId").val(),
+					vId: $("#vId").val()
+				}, function(result) {
+					var name = "";
+					if (result.rows.length == 0) {
+						name += "暂无学区 ";
+					} else {
+						$.each(result.rows, function (i, item) {
+							name += item.schoolName + ",";
+						})
+					}
+					$("#schoolId").empty().append(name.substring(0, name.length-1));
+				});
+			}
 		}
 
 		function getData(array) {
@@ -81,24 +87,25 @@
 		$(function() {
 			$('#pId').select2({
 				placeholder: "请选择派出所",
-				allowClear: true
+				allowClear: false
 			}).on('select2:select', function (e) {
 				//处理自己的业务
 				$.get("/schooldistrict/policestationvillage/getAllByParentId?parentId=" + this.value, function(result) {
 					$('#vId').empty().select2({
 						data: getData(result),
 						placeholder: "请选择委(村)",
-						allowClear: true
+						allowClear: false
 					});
 				});
 			});
 			$('#vId').select2({
 				placeholder: "请选择委(村)",
-				allowClear: true
+				allowClear: false
 			});
 			$('#schoolType').select2({
 				placeholder: "请选择中、小学",
-				allowClear: true
+				allowClear: false,
+				minimumResultsForSearch: -1
 			});
 		})
     </script>

+ 4 - 0
sooka-admin/src/main/resources/templates/schooldistrict/index/index.html

@@ -95,6 +95,10 @@
                     title: '学校',
                 },
                 {
+                    field: 'schoolType',
+                    title: '学校类型',
+                },
+                {
                     title: '操作',
                     align: 'center',
                     formatter: function(value, row, index) {

+ 15 - 2
sooka-admin/src/main/resources/templates/system/notice/edit.html

@@ -22,13 +22,21 @@
 	                </select>
 				</div>
 			</div>
-            <div class="form-group">	
+            <div id="remark" class="form-group">
                 <label class="col-sm-2 control-label">公告内容:</label>
                 <div class="col-sm-10">
                     <input id="noticeContent" name="noticeContent" th:field="*{noticeContent}" type="hidden">
                     <div id="editor" class="summernote"></div>
                 </div>
             </div>
+            <div id="openTime" class="form-group" style="display: none">
+                <label class="col-sm-2 control-label">开放时间:</label>
+                <div class="col-sm-10">
+                    <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
+                    <span>-</span>
+                    <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
+                </div>
+            </div>
             <div class="form-group" style="display: none">
 				<label class="col-sm-2 control-label">公告状态:</label>
 				<div class="col-sm-10">
@@ -44,7 +52,12 @@
     <th:block th:include="include :: summernote-js" />
     <script type="text/javascript">
         var prefix = ctx + "system/notice";
-    
+        if ('[[${notice.noticeId}]]' == 10) {
+            $("#startTime").val('[[${notice.noticeContent}]]'.split(",")[0]);
+            $("#endTime").val('[[${notice.noticeContent}]]'.split(",")[1]);
+            $("#remark").hide(), $("#openTime").show();
+        }
+
 	    $(function() {
 		    $('.summernote').summernote({
 		    	placeholder: '请输入公告内容',

+ 1 - 1
sooka-admin/src/main/resources/templates/system/notice/notice.html

@@ -106,7 +106,7 @@
 		            formatter: function(value, row, index) {
 		            	var actions = [];
 		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editFull(\'' + row.noticeId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
-                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.noticeId + '\')"><i class="fa fa-remove"></i>删除</a>');
+                        // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.noticeId + '\')"><i class="fa fa-remove"></i>删除</a>');
 						return actions.join('');
 		            }
 		        }]

+ 1 - 1
sooka-business/src/main/resources/mapper/schooldistrict/BtpSchoolPvMapper.xml

@@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
 
     <select id="selectBtpSchoolPvList" parameterType="BtpSchoolPv" resultMap="BtpSchoolPvResult">
-        select group_concat(a.v_id) id, a.p_id, b.pv_name p_name, group_concat(c.pv_name) v_name, a.school_id, d.school_name
+        select group_concat(a.v_id) id, a.p_id, b.pv_name p_name, group_concat(c.pv_name) v_name, a.school_id, d.school_name, d.school_type
         from btp_school_pv a
         left join btp_policestation_village b on b.pv_id = a.p_id
         left join btp_policestation_village c on c.pv_id = a.v_id

+ 7 - 0
sooka-system/src/main/java/com/sooka/system/service/impl/SysNoticeServiceImpl.java

@@ -2,9 +2,11 @@ package com.sooka.system.service.impl;
 
 import java.util.List;
 
+import com.sooka.common.utils.StringUtils;
 import com.sooka.system.domain.SysNotice;
 import com.sooka.system.mapper.SysNoticeMapper;
 import com.sooka.system.service.ISysNoticeService;
+import org.apache.commons.collections4.MapUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.sooka.common.core.text.Convert;
@@ -66,6 +68,11 @@ public class SysNoticeServiceImpl implements ISysNoticeService
     @Override
     public int updateNotice(SysNotice notice)
     {
+        String beginTime = MapUtils.getString(notice.getParams(),"beginTime");
+        String endTime = MapUtils.getString(notice.getParams(),"endTime");
+        if (StringUtils.isNotBlank(beginTime) && StringUtils.isNotBlank(endTime)) {
+            notice.setNoticeContent(beginTime + "," + endTime);
+        }
         return noticeMapper.updateNotice(notice);
     }