Browse Source

跑马灯设置模块开发完成

ZhangWenQiang 6 years ago
parent
commit
91aceba1eb

+ 37 - 0
src/main/java/com/jeeplus/modules/hpadvertisement/entity/HpBroadcast.java

@@ -0,0 +1,37 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.hpadvertisement.entity;
+
+
+import com.jeeplus.core.persistence.DataEntity;
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+
+/**
+ * 通知公告Entity
+ * @author zwq
+ * @version 2019-08-23
+ */
+public class HpBroadcast extends DataEntity<HpBroadcast> {
+	
+	private static final long serialVersionUID = 1L;
+	private String content;		// 通知内容
+	
+	public HpBroadcast() {
+		super();
+	}
+
+	public HpBroadcast(String id){
+		super(id);
+	}
+
+	@ExcelField(title="通知内容", align=2, sort=7)
+	public String getContent() {
+		return content;
+	}
+
+	public void setContent(String content) {
+		this.content = content;
+	}
+	
+}

+ 18 - 0
src/main/java/com/jeeplus/modules/hpadvertisement/mapper/HpBroadcastMapper.java

@@ -0,0 +1,18 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.hpadvertisement.mapper;
+
+import com.jeeplus.core.persistence.BaseMapper;
+import com.jeeplus.core.persistence.annotation.MyBatisMapper;
+import com.jeeplus.modules.hpadvertisement.entity.HpBroadcast;
+
+/**
+ * 通知公告MAPPER接口
+ * @author zwq
+ * @version 2019-08-23
+ */
+@MyBatisMapper
+public interface HpBroadcastMapper extends BaseMapper<HpBroadcast> {
+	
+}

+ 119 - 0
src/main/java/com/jeeplus/modules/hpadvertisement/mapper/xml/HpBroadcastMapper.xml

@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.modules.hpadvertisement.mapper.HpBroadcastMapper">
+    
+	<sql id="hpBroadcastColumns">
+		a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.remarks AS "remarks",
+		a.del_flag AS "delFlag",
+		a.content AS "content",
+		u.name AS "updateBy.name"
+	</sql>
+	
+	<sql id="hpBroadcastJoins">
+		LEFT JOIN sys_user u ON u.id = a.update_by
+	</sql>
+	
+    
+	<select id="get" resultType="HpBroadcast" >
+		SELECT 
+			<include refid="hpBroadcastColumns"/>
+		FROM hp_broadcast a
+		<include refid="hpBroadcastJoins"/>
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="HpBroadcast" >
+		SELECT 
+			<include refid="hpBroadcastColumns"/>
+		FROM hp_broadcast a
+		<include refid="hpBroadcastJoins"/>
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+	
+	<select id="findAllList" resultType="HpBroadcast" >
+		SELECT 
+			<include refid="hpBroadcastColumns"/>
+		FROM hp_broadcast a
+		<include refid="hpBroadcastJoins"/>
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			${dataScope}
+		</where>		
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+	
+	<insert id="insert">
+		INSERT INTO hp_broadcast(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			content
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{content}
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE hp_broadcast SET 	
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+			content = #{content}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM hp_broadcast
+		WHERE id = #{id}
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE hp_broadcast SET 
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="HpBroadcast" statementType="STATEMENT">
+		select * FROM hp_broadcast  where ${propertyName} = '${value}'
+	</select>
+	
+</mapper>

+ 47 - 0
src/main/java/com/jeeplus/modules/hpadvertisement/service/HpBroadcastService.java

@@ -0,0 +1,47 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.hpadvertisement.service;
+
+import java.util.List;
+
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.service.CrudService;
+import com.jeeplus.modules.hpadvertisement.entity.HpBroadcast;
+import com.jeeplus.modules.hpadvertisement.mapper.HpBroadcastMapper;
+
+/**
+ * 通知公告Service
+ * @author zwq
+ * @version 2019-08-23
+ */
+@Service
+@Transactional(readOnly = true)
+public class HpBroadcastService extends CrudService<HpBroadcastMapper, HpBroadcast> {
+
+	public HpBroadcast get(String id) {
+		return super.get(id);
+	}
+	
+	public List<HpBroadcast> findList(HpBroadcast hpBroadcast) {
+		return super.findList(hpBroadcast);
+	}
+	
+	public Page<HpBroadcast> findPage(Page<HpBroadcast> page, HpBroadcast hpBroadcast) {
+		return super.findPage(page, hpBroadcast);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(HpBroadcast hpBroadcast) {
+		super.save(hpBroadcast);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(HpBroadcast hpBroadcast) {
+		super.delete(hpBroadcast);
+	}
+	
+}

+ 223 - 0
src/main/java/com/jeeplus/modules/hpadvertisement/web/HpBroadcastController.java

@@ -0,0 +1,223 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.hpadvertisement.web;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.ConstraintViolationException;
+
+import org.apache.shiro.authz.annotation.Logical;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.utils.DateUtils;
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.json.AjaxJson;
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.web.BaseController;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ExportExcel;
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.modules.hpadvertisement.entity.HpBroadcast;
+import com.jeeplus.modules.hpadvertisement.service.HpBroadcastService;
+
+/**
+ * 通知公告Controller
+ * @author zwq
+ * @version 2019-08-23
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/hpadvertisement/hpBroadcast")
+public class HpBroadcastController extends BaseController {
+
+	@Autowired
+	private HpBroadcastService hpBroadcastService;
+	
+	@ModelAttribute
+	public HpBroadcast get(@RequestParam(required=false) String id) {
+		HpBroadcast entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = hpBroadcastService.get(id);
+		}
+		if (entity == null){
+			entity = new HpBroadcast();
+		}
+		return entity;
+	}
+	
+	/**
+	 * 通知公告列表页面
+	 */
+	@RequiresPermissions("hpadvertisement:hpBroadcast:list")
+	@RequestMapping(value = {"list", ""})
+	public String list(HpBroadcast hpBroadcast, Model model) {
+		model.addAttribute("hpBroadcast", hpBroadcast);
+		return "modules/hpadvertisement/hpBroadcastList";
+	}
+	
+		/**
+	 * 通知公告列表数据
+	 */
+	@ResponseBody
+	@RequiresPermissions("hpadvertisement:hpBroadcast:list")
+	@RequestMapping(value = "data")
+	public Map<String, Object> data(HpBroadcast hpBroadcast, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<HpBroadcast> page = hpBroadcastService.findPage(new Page<HpBroadcast>(request, response), hpBroadcast); 
+		return getBootstrapData(page);
+	}
+
+	/**
+	 * 查看,增加,编辑通知公告表单页面
+	 */
+	@RequiresPermissions(value={"hpadvertisement:hpBroadcast:view","hpadvertisement:hpBroadcast:add","hpadvertisement:hpBroadcast:edit"},logical=Logical.OR)
+	@RequestMapping(value = "form")
+	public String form(HpBroadcast hpBroadcast, Model model) {
+		model.addAttribute("hpBroadcast", hpBroadcast);
+		return "modules/hpadvertisement/hpBroadcastForm";
+	}
+
+	/**
+	 * 保存通知公告
+	 */
+	@ResponseBody
+	@RequiresPermissions(value={"hpadvertisement:hpBroadcast:add","hpadvertisement:hpBroadcast:edit"},logical=Logical.OR)
+	@RequestMapping(value = "save")
+	public AjaxJson save(HpBroadcast hpBroadcast, Model model) throws Exception{
+		AjaxJson j = new AjaxJson();
+		/**
+		 * 后台hibernate-validation插件校验
+		 */
+		String errMsg = beanValidator(hpBroadcast);
+		if (StringUtils.isNotBlank(errMsg)){
+			j.setSuccess(false);
+			j.setMsg(errMsg);
+			return j;
+		}
+		//新增或编辑表单保存
+		hpBroadcastService.save(hpBroadcast);//保存
+		j.setSuccess(true);
+		j.setMsg("保存通知公告成功");
+		return j;
+	}
+	
+	/**
+	 * 删除通知公告
+	 */
+	@ResponseBody
+	@RequiresPermissions("hpadvertisement:hpBroadcast:del")
+	@RequestMapping(value = "delete")
+	public AjaxJson delete(HpBroadcast hpBroadcast) {
+		AjaxJson j = new AjaxJson();
+		hpBroadcastService.delete(hpBroadcast);
+		j.setMsg("删除通知公告成功");
+		return j;
+	}
+	
+	/**
+	 * 批量删除通知公告
+	 */
+	@ResponseBody
+	@RequiresPermissions("hpadvertisement:hpBroadcast:del")
+	@RequestMapping(value = "deleteAll")
+	public AjaxJson deleteAll(String ids) {
+		AjaxJson j = new AjaxJson();
+		String idArray[] =ids.split(",");
+		for(String id : idArray){
+			hpBroadcastService.delete(hpBroadcastService.get(id));
+		}
+		j.setMsg("删除通知公告成功");
+		return j;
+	}
+	
+	/**
+	 * 导出excel文件
+	 */
+	@ResponseBody
+	@RequiresPermissions("hpadvertisement:hpBroadcast:export")
+    @RequestMapping(value = "export")
+    public AjaxJson exportFile(HpBroadcast hpBroadcast, HttpServletRequest request, HttpServletResponse response) {
+		AjaxJson j = new AjaxJson();
+		try {
+            String fileName = "通知公告"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+            Page<HpBroadcast> page = hpBroadcastService.findPage(new Page<HpBroadcast>(request, response, -1), hpBroadcast);
+    		new ExportExcel("通知公告", HpBroadcast.class).setDataList(page.getList()).write(response, fileName).dispose();
+    		j.setSuccess(true);
+    		j.setMsg("导出成功!");
+    		return j;
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导出通知公告记录失败!失败信息:"+e.getMessage());
+		}
+			return j;
+    }
+
+	/**
+	 * 导入Excel数据
+
+	 */
+	@ResponseBody
+	@RequiresPermissions("hpadvertisement:hpBroadcast:import")
+    @RequestMapping(value = "import")
+   	public AjaxJson importFile(@RequestParam("file")MultipartFile file, HttpServletResponse response, HttpServletRequest request) {
+		AjaxJson j = new AjaxJson();
+		try {
+			int successNum = 0;
+			int failureNum = 0;
+			StringBuilder failureMsg = new StringBuilder();
+			ImportExcel ei = new ImportExcel(file, 1, 0);
+			List<HpBroadcast> list = ei.getDataList(HpBroadcast.class);
+			for (HpBroadcast hpBroadcast : list){
+				try{
+					hpBroadcastService.save(hpBroadcast);
+					successNum++;
+				}catch(ConstraintViolationException ex){
+					failureNum++;
+				}catch (Exception ex) {
+					failureNum++;
+				}
+			}
+			if (failureNum>0){
+				failureMsg.insert(0, ",失败 "+failureNum+" 条通知公告记录。");
+			}
+			j.setMsg( "已成功导入 "+successNum+" 条通知公告记录"+failureMsg);
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导入通知公告失败!失败信息:"+e.getMessage());
+		}
+		return j;
+    }
+	
+	/**
+	 * 下载导入通知公告数据模板
+	 */
+	@ResponseBody
+	@RequiresPermissions("hpadvertisement:hpBroadcast:import")
+    @RequestMapping(value = "import/template")
+     public AjaxJson importFileTemplate(HttpServletResponse response) {
+		AjaxJson j = new AjaxJson();
+		try {
+            String fileName = "通知公告数据导入模板.xlsx";
+    		List<HpBroadcast> list = Lists.newArrayList(); 
+    		new ExportExcel("通知公告数据", HpBroadcast.class, 1).setDataList(list).write(response, fileName).dispose();
+    		return null;
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg( "导入模板下载失败!失败信息:"+e.getMessage());
+		}
+		return j;
+    }
+
+}

+ 58 - 0
src/main/webapp/webpage/modules/hpadvertisement/hpBroadcastForm.jsp

@@ -0,0 +1,58 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>通知公告管理</title>
+	<meta name="decorator" content="ani"/>
+	<script type="text/javascript">
+
+		$(document).ready(function() {
+            $(".salary_content").change(function(){
+                $(".t_h_s i").html($(".salary_content").val().length);
+            })
+            $(".salary_content").keydown(function(){
+                $(".t_h_s i").html($(".salary_content").val().length);
+            })
+            $(".salary_content").keyup(function(){
+                $(".t_h_s i").html($(".salary_content").val().length);
+            })
+		});
+		function save() {
+            var isValidate = jp.validateForm('#inputForm');//校验表单
+            if(!isValidate){
+                return false;
+			}else{
+                jp.loading();
+                jp.post("${ctx}/hpadvertisement/hpBroadcast/save",$('#inputForm').serialize(),function(data){
+                    if(data.success){
+                        jp.getParent().refresh();
+                        var dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
+                        parent.layer.close(dialogIndex);
+                        jp.success(data.msg)
+
+                    }else{
+                        jp.error(data.msg);
+                    }
+                })
+			}
+
+        }
+	</script>
+</head>
+<body class="bg-white">
+		<form:form id="inputForm" modelAttribute="hpBroadcast" class="form-horizontal">
+		<form:hidden path="id"/>	
+		<table class="table table-bordered">
+		   <tbody>
+				<tr>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>内容:</label></td>
+					<td class="width-35">
+						<form:textarea rows="4" path="content" htmlEscape="false"  maxlength="30" onchange="this.value=this.value.substring(0,30)" onkeydown="this.value=this.value.substring(0,30)" onkeyup="this.value=this.value.substring(0,30)" class="form-control input-sm salary_content required" placeholder="30字以内"/>
+						<span class="t_h_s" style="float: right"><i>0</i>/30</span>
+					</td>
+		  		</tr>
+		 	</tbody>
+		</table>
+	</form:form>
+</body>
+</html>

+ 258 - 0
src/main/webapp/webpage/modules/hpadvertisement/hpBroadcastList.js

@@ -0,0 +1,258 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<script>
+$(document).ready(function() {
+	$('#hpBroadcastTable').bootstrapTable({
+		 
+		  //请求方法
+               method: 'post',
+               //类型json
+               dataType: "json",
+               contentType: "application/x-www-form-urlencoded",
+               //显示刷新按钮
+               showRefresh: true,
+    	       //最低显示2行
+    	       minimumCountColumns: 1,
+               //是否显示行间隔色
+               striped: true,
+               //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)     
+               cache: false,    
+               //是否显示分页(*)  
+               pagination: true,   
+                //排序方式 
+               sortOrder: "asc",  
+               //初始化加载第一页,默认第一页
+               pageNumber:1,   
+               //每页的记录行数(*)   
+               pageSize: 10,  
+               //可供选择的每页的行数(*)    
+               pageList: [10, 25, 50, 100],
+               //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据  
+               url: "${ctx}/hpadvertisement/hpBroadcast/data",
+               //默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
+               //queryParamsType:'',   
+               ////查询参数,每次调用是会带上这个参数,可自定义                         
+               queryParams : function(params) {
+               	var searchParam = $("#searchForm").serializeJSON();
+               	searchParam.pageNo = params.limit === undefined? "1" :params.offset/params.limit+1;
+               	searchParam.pageSize = params.limit === undefined? -1 : params.limit;
+               	searchParam.orderBy = params.sort === undefined? "" : params.sort+ " "+  params.order;
+                   return searchParam;
+               },
+               //分页方式:client客户端分页,server服务端分页(*)
+               sidePagination: "server",
+               contextMenuTrigger:"right",//pc端 按右键弹出菜单
+               contextMenuTriggerMobile:"press",//手机端 弹出菜单,click:单击, press:长按。
+               contextMenu: '#context-menu',
+               onContextMenuItem: function(row, $el){
+                   if($el.data("item") == "edit"){
+                   		edit(row.id);
+                   }else if($el.data("item") == "view"){
+                       view(row.id);
+                   } else if($el.data("item") == "delete"){
+                        jp.confirm('确认要删除该通知公告记录吗?', function(){
+                       	jp.loading();
+                       	jp.get("${ctx}/hpadvertisement/hpBroadcast/delete?id="+row.id, function(data){
+                   	  		if(data.success){
+                   	  			$('#hpBroadcastTable').bootstrapTable('refresh');
+                   	  			jp.success(data.msg);
+                   	  		}else{
+                   	  			jp.error(data.msg);
+                   	  		}
+                   	  	})
+                   	   
+                   	});
+                      
+                   } 
+               },
+              
+               onClickRow: function(row, $el){
+               },
+               	onShowSearch: function () {
+			$("#search-collapse").slideToggle();
+		},
+               columns: [{
+		        checkbox: true
+		       
+		    }
+            ,{
+                       field: 'content',
+                       title: '内容',
+                       sortable: false,
+                       sortName: 'content'
+                       ,formatter:function(value, row , index){
+                           value = jp.unescapeHTML(value);
+                       <c:choose>
+                           <c:when test="${fns:hasPermission('hpadvertisement:hpBroadcast:edit')}">
+                           return "<a href='javascript:edit(\""+row.id+"\")'>"+value+"</a>";
+                       </c:when>
+                           <c:when test="${fns:hasPermission('hpadvertisement:hpBroadcast:view')}">
+                           return "<a href='javascript:view(\""+row.id+"\")'>"+value+"</a>";
+                       </c:when>
+                           <c:otherwise>
+                           return value;
+                       </c:otherwise>
+                           </c:choose>
+                       }
+            }
+            ,{
+                       field: 'updateDate',
+                       title: '最后编辑时间',
+                       sortable: false,
+                       sortName: 'updateDate'
+            }
+			,{
+		        field: 'updateBy.name',
+		        title: '最后编辑人',
+		        sortable: false,
+		        sortName: 'updateBy.name'
+
+		    }
+                   ,{
+                       field: 'operate',
+                       title: '操作',
+                       align: 'center',
+                       events: {
+                           'click .edit': function (e, value, row, index) {
+                           		edit(row.id);
+                           },
+                       },
+                       formatter:  function operateFormatter(value, row, index) {
+                           var a = '<a href="#" class="edit">【编辑】</a>';
+                           return [
+                               	<shiro:hasPermission name="hpadvertisement:hpBroadcast:edit">
+                               		a,
+                       			</shiro:hasPermission>
+                       			].join('');
+                       }
+                   }
+
+		     ]
+		
+		});
+		
+		  
+	  if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
+
+		  $('#hpBroadcastTable').bootstrapTable("toggleView");
+		}
+	  
+	  $('#hpBroadcastTable').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
+                'check-all.bs.table uncheck-all.bs.table', function () {
+            $('#remove').prop('disabled', ! $('#hpBroadcastTable').bootstrapTable('getSelections').length);
+            $('#view,#edit').prop('disabled', $('#hpBroadcastTable').bootstrapTable('getSelections').length!=1);
+        });
+		  
+		$("#btnImport").click(function(){
+			jp.open({
+			    type: 2,
+                area: [500, 200],
+                auto: true,
+			    title:"导入数据",
+			    content: "${ctx}/tag/importExcel" ,
+			    btn: ['下载模板','确定', '关闭'],
+				    btn1: function(index, layero){
+					  jp.downloadFile('${ctx}/hpadvertisement/hpBroadcast/import/template');
+				  },
+			    btn2: function(index, layero){
+				        var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+						iframeWin.contentWindow.importExcel('${ctx}/hpadvertisement/hpBroadcast/import', function (data) {
+							if(data.success){
+								jp.success(data.msg);
+								refresh();
+							}else{
+								jp.error(data.msg);
+							}
+					   		jp.close(index);
+						});//调用保存事件
+						return false;
+				  },
+				 
+				  btn3: function(index){ 
+					  jp.close(index);
+	    	       }
+			}); 
+		});
+		
+		
+	 $("#export").click(function(){//导出Excel文件
+	        var searchParam = $("#searchForm").serializeJSON();
+	        searchParam.pageNo = 1;
+	        searchParam.pageSize = -1;
+            var sortName = $('#hpBroadcastTable').bootstrapTable("getOptions", "none").sortName;
+            var sortOrder = $('#hpBroadcastTable').bootstrapTable("getOptions", "none").sortOrder;
+            var values = "";
+            for(var key in searchParam){
+                values = values + key + "=" + searchParam[key] + "&";
+            }
+            if(sortName != undefined && sortOrder != undefined){
+                values = values + "orderBy=" + sortName + " "+sortOrder;
+            }
+
+			jp.downloadFile('${ctx}/hpadvertisement/hpBroadcast/export?'+values);
+	  })
+
+		    
+	  $("#search").click("click", function() {// 绑定查询按扭
+		  $('#hpBroadcastTable').bootstrapTable('refresh');
+		});
+	 
+	 $("#reset").click("click", function() {// 绑定查询按扭
+		  $("#searchForm  input").val("");
+		  $("#searchForm  select").val("");
+		  $("#searchForm  .select-item").html("");
+		  $('#hpBroadcastTable').bootstrapTable('refresh');
+		});
+		
+		
+	});
+		
+  function getIdSelections() {
+        return $.map($("#hpBroadcastTable").bootstrapTable('getSelections'), function (row) {
+            return row.id
+        });
+    }
+  
+  function deleteAll(){
+
+		jp.confirm('确认要删除该通知公告记录吗?', function(){
+			jp.loading();  	
+			jp.get("${ctx}/hpadvertisement/hpBroadcast/deleteAll?ids=" + getIdSelections(), function(data){
+         	  		if(data.success){
+         	  			$('#hpBroadcastTable').bootstrapTable('refresh');
+         	  			jp.success(data.msg);
+         	  		}else{
+         	  			jp.error(data.msg);
+         	  		}
+         	  	})
+          	   
+		})
+  }
+
+    //刷新列表
+  function refresh(){
+  	$('#hpBroadcastTable').bootstrapTable('refresh');
+  }
+  
+   function add(){
+	  jp.openSaveDialog('新增通知公告', "${ctx}/hpadvertisement/hpBroadcast/form",'800px', '500px');
+  }
+
+
+  
+   function edit(id){//没有权限时,不显示确定按钮
+       if(id == undefined){
+	      id = getIdSelections();
+	}
+	jp.openSaveDialog('编辑通知公告', "${ctx}/hpadvertisement/hpBroadcast/form?id=" + id, '800px', '500px');
+  }
+  
+ function view(id){//没有权限时,不显示确定按钮
+      if(id == undefined){
+             id = getIdSelections();
+      }
+        jp.openViewDialog('查看通知公告', "${ctx}/hpadvertisement/hpBroadcast/form?id=" + id, '800px', '500px');
+ }
+
+
+
+</script>

+ 62 - 0
src/main/webapp/webpage/modules/hpadvertisement/hpBroadcastList.jsp

@@ -0,0 +1,62 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>通知公告管理</title>
+	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
+	<meta name="decorator" content="ani"/>
+	<%@ include file="/webpage/include/bootstraptable.jsp"%>
+	<%@include file="/webpage/include/treeview.jsp" %>
+	<%@include file="hpBroadcastList.js" %>
+</head>
+<body>
+	<div class="wrapper wrapper-content">
+	<div class="panel panel-primary">
+
+	<div class="panel-body">
+	
+	<!-- 搜索 -->
+	<div id="search-collapse" class="collapse">
+		<div class="accordion-inner">
+			<form:form id="searchForm" modelAttribute="hpBroadcast" class="form form-horizontal well clearfix">
+		 <div class="col-xs-12 col-sm-6 col-md-4">
+			<div style="margin-top:26px">
+			  <a  id="search" class="btn btn-primary btn-rounded  btn-bordered btn-sm"><i class="fa fa-search"></i> 查询</a>
+			  <a  id="reset" class="btn btn-primary btn-rounded  btn-bordered btn-sm" ><i class="fa fa-refresh"></i> 重置</a>
+			 </div>
+	    </div>	
+	</form:form>
+	</div>
+	</div>
+	
+	<!-- 工具栏 -->
+	<div id="toolbar">
+			<shiro:hasPermission name="hpadvertisement:hpBroadcast:add">
+				<button id="add" class="btn btn-primary" onclick="add()">
+					<i class="glyphicon glyphicon-plus"></i> 新建
+				</button>
+			</shiro:hasPermission>
+			<shiro:hasPermission name="hpadvertisement:hpBroadcast:import">
+				<button id="btnImport" class="btn btn-info"><i class="fa fa-folder-open-o"></i> 导入</button>
+			</shiro:hasPermission>
+			<shiro:hasPermission name="hpadvertisement:hpBroadcast:export">
+	        		<button id="export" class="btn btn-warning">
+					<i class="fa fa-file-excel-o"></i> 导出
+				</button>
+			 </shiro:hasPermission>
+			<shiro:hasPermission name="hpadvertisement:hpBroadcast:del">
+				<button id="remove" class="btn btn-danger" disabled onclick="deleteAll()">
+					<i class="glyphicon glyphicon-remove"></i> 删除
+				</button>
+			</shiro:hasPermission>
+		    </div>
+		
+	<!-- 表格 -->
+	<table id="hpBroadcastTable"   data-toolbar="#toolbar"></table>
+
+
+	</div>
+	</div>
+	</div>
+</body>
+</html>