Kaynağa Gözat

会员模块开发

ZhangWenQiang 6 yıl önce
ebeveyn
işleme
596b07c9c6

+ 71 - 0
happy-job-base-system/src/main/webapp/webpage/modules/mpmanager/mpTaskSettingForm.jsp

@@ -0,0 +1,71 @@
+<%@ 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() {
+			jp.ajaxForm("#inputForm",function(data){
+				if(data.success){
+				    jp.success(data.msg);
+					jp.go("${ctx}/mpmanager/mpTaskSetting");
+				}else{
+				    jp.error(data.msg);
+				    $("#inputForm").find("button:submit").button("reset");
+				}
+			});
+
+		});
+	</script>
+</head>
+<body>
+<div class="wrapper wrapper-content">				
+<div class="row">
+	<div class="col-md-12">
+	<div class="panel panel-primary">
+		<div class="panel-heading">
+			<h3 class="panel-title"> 
+				<a class="panelButton" href="${ctx}/mpmanager/mpTaskSetting"><i class="ti-angle-left"></i> 返回</a>
+			</h3>
+		</div>
+		<div class="panel-body">
+		<form:form id="inputForm" modelAttribute="mpTaskSetting" action="${ctx}/mpmanager/mpTaskSetting/save" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+				<div class="form-group">
+					<label class="col-sm-2 control-label"><font color="red">*</font>任务名称:</label>
+					<div class="col-sm-10">
+						<form:input path="taskName" htmlEscape="false"    class="form-control required"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-2 control-label"><font color="red">*</font>分值:</label>
+					<div class="col-sm-10">
+						<form:input path="points" htmlEscape="false"    class="form-control required isIntGtZero"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-2 control-label"><font color="red">*</font>次数:</label>
+					<div class="col-sm-10">
+						<form:input path="taskNumber" htmlEscape="false"    class="form-control required isIntGtZero"/>
+					</div>
+				</div>
+		<c:if test="${mode == 'add' || mode=='edit'}">
+				<div class="col-lg-3"></div>
+		        <div class="col-lg-6">
+		             <div class="form-group text-center">
+		                 <div>
+		                     <button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="正在提交...">提 交</button>
+		                 </div>
+		             </div>
+		        </div>
+		</c:if>
+		</form:form>
+		</div>				
+	</div>
+	</div>
+</div>
+</div>
+</body>
+</html>

+ 210 - 0
happy-job-base-system/src/main/webapp/webpage/modules/mpmanager/mpTaskSettingList.js

@@ -0,0 +1,210 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<script>
+$(document).ready(function() {
+	$('#mpTaskSettingTable').bootstrapTable({
+		 
+		  //请求方法
+               method: 'post',
+               //类型json
+               dataType: "json",
+               contentType: "application/x-www-form-urlencoded",
+               //显示检索按钮
+	           showSearch: true,
+               //显示刷新按钮
+               showRefresh: true,
+               //显示切换手机试图按钮
+               showToggle: true,
+               //显示 内容列下拉框
+    	       showColumns: true,
+    	       //显示到处按钮
+    	       showExport: true,
+    	       //显示切换分页按钮
+    	       showPaginationSwitch: true,
+    	       //最低显示2行
+    	       minimumCountColumns: 2,
+               //是否显示行间隔色
+               striped: true,
+               //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)     
+               cache: false,    
+               //是否显示分页(*)  
+               pagination: true,   
+                //排序方式 
+               sortOrder: "asc",  
+               //初始化加载第一页,默认第一页
+               pageNumber:1,   
+               //每页的记录行数(*)   
+               pageSize: 10,  
+               //可供选择的每页的行数(*)    
+               pageList: [10, 25, 50, 100],
+               //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据  
+               url: "${ctx}/mpmanager/mpTaskSetting/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}/mpmanager/mpTaskSetting/delete?id="+row.id, function(data){
+                   	  		if(data.success){
+                   	  			$('#mpTaskSettingTable').bootstrapTable('refresh');
+                   	  			jp.success(data.msg);
+                   	  		}else{
+                   	  			jp.error(data.msg);
+                   	  		}
+                   	  	})
+                   	   
+                   	});
+                      
+                   } 
+               },
+              
+               onClickRow: function(row, $el){
+               },
+               	onShowSearch: function () {
+			$("#search-collapse").slideToggle();
+		},
+               columns: [{
+		        checkbox: true
+		       
+		    }
+		     ]
+		
+		});
+		
+		  
+	  if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
+
+		 
+		  $('#mpTaskSettingTable').bootstrapTable("toggleView");
+		}
+	  
+	  $('#mpTaskSettingTable').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
+                'check-all.bs.table uncheck-all.bs.table', function () {
+            $('#remove').prop('disabled', ! $('#mpTaskSettingTable').bootstrapTable('getSelections').length);
+            $('#view,#edit').prop('disabled', $('#mpTaskSettingTable').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}/mpmanager/mpTaskSetting/import/template');
+				  },
+			    btn2: function(index, layero){
+				        var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+						iframeWin.contentWindow.importExcel('${ctx}/mpmanager/mpTaskSetting/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 = $('#mpTaskSettingTable').bootstrapTable("getOptions", "none").sortName;
+            var sortOrder = $('#mpTaskSettingTable').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}/mpmanager/mpTaskSetting/export?'+values);
+	  })
+
+		    
+	  $("#search").click("click", function() {// 绑定查询按扭
+		  $('#mpTaskSettingTable').bootstrapTable('refresh');
+		});
+	 
+	 $("#reset").click("click", function() {// 绑定查询按扭
+		  $("#searchForm  input").val("");
+		  $("#searchForm  select").val("");
+		  $("#searchForm  .select-item").html("");
+		  $('#mpTaskSettingTable').bootstrapTable('refresh');
+		});
+		
+		
+	});
+		
+  function getIdSelections() {
+        return $.map($("#mpTaskSettingTable").bootstrapTable('getSelections'), function (row) {
+            return row.id
+        });
+    }
+  
+  function deleteAll(){
+
+		jp.confirm('确认要删除该任务设置记录吗?', function(){
+			jp.loading();  	
+			jp.get("${ctx}/mpmanager/mpTaskSetting/deleteAll?ids=" + getIdSelections(), function(data){
+         	  		if(data.success){
+         	  			$('#mpTaskSettingTable').bootstrapTable('refresh');
+         	  			jp.success(data.msg);
+         	  		}else{
+         	  			jp.error(data.msg);
+         	  		}
+         	  	})
+          	   
+		})
+  }
+  function refresh(){
+  	$('#mpTaskSettingTable').bootstrapTable('refresh');
+  }
+  function add(){
+		jp.go("${ctx}/mpmanager/mpTaskSetting/form/add");
+	}
+
+  function edit(id){
+	  if(id == undefined){
+		  id = getIdSelections();
+	  }
+	  jp.go("${ctx}/mpmanager/mpTaskSetting/form/edit?id=" + id);
+  }
+
+  function view(id) {
+      if(id == undefined){
+          id = getIdSelections();
+      }
+      jp.go("${ctx}/mpmanager/mpTaskSetting/form/view?id=" + id);
+  }
+  
+</script>

+ 86 - 0
happy-job-base-system/src/main/webapp/webpage/modules/mpmanager/mpTaskSettingList.jsp

@@ -0,0 +1,86 @@
+<%@ 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="mpTaskSettingList.js" %>
+</head>
+<body>
+	<div class="wrapper wrapper-content">
+	<div class="panel panel-primary">
+	<div class="panel-heading">
+		<h3 class="panel-title">任务设置列表</h3>
+	</div>
+	<div class="panel-body">
+	
+	<!-- 搜索 -->
+	<div id="search-collapse" class="collapse">
+		<div class="accordion-inner">
+			<form:form id="searchForm" modelAttribute="mpTaskSetting" 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="mpmanager:mpTaskSetting:add">
+				<button id="add" class="btn btn-primary" onclick="add()">
+					<i class="glyphicon glyphicon-plus"></i> 新建
+				</button>
+			</shiro:hasPermission>
+			<shiro:hasPermission name="mpmanager:mpTaskSetting:edit">
+			    <button id="edit" class="btn btn-success" disabled onclick="edit()">
+	            	<i class="glyphicon glyphicon-edit"></i> 修改
+	        	</button>
+			</shiro:hasPermission>
+			<shiro:hasPermission name="mpmanager:mpTaskSetting:del">
+				<button id="remove" class="btn btn-danger" disabled onclick="deleteAll()">
+	            	<i class="glyphicon glyphicon-remove"></i> 删除
+	        	</button>
+			</shiro:hasPermission>
+			<shiro:hasPermission name="mpmanager:mpTaskSetting:import">
+				<button id="btnImport" class="btn btn-info"><i class="fa fa-folder-open-o"></i> 导入</button>
+			</shiro:hasPermission>
+			<shiro:hasPermission name="mpmanager:mpTaskSetting:export">
+	        		<button id="export" class="btn btn-warning">
+					<i class="fa fa-file-excel-o"></i> 导出
+				</button>
+			 </shiro:hasPermission>
+	                 <shiro:hasPermission name="mpmanager:mpTaskSetting:view">
+				<button id="view" class="btn btn-default" disabled onclick="view()">
+					<i class="fa fa-search-plus"></i> 查看
+				</button>
+			</shiro:hasPermission>
+		    </div>
+		
+	<!-- 表格 -->
+	<table id="mpTaskSettingTable"   data-toolbar="#toolbar"></table>
+
+    <!-- context menu -->
+    <ul id="context-menu" class="dropdown-menu">
+    	<shiro:hasPermission name="mpmanager:mpTaskSetting:view">
+        <li data-item="view"><a>查看</a></li>
+        </shiro:hasPermission>
+    	<shiro:hasPermission name="mpmanager:mpTaskSetting:edit">
+        <li data-item="edit"><a>编辑</a></li>
+        </shiro:hasPermission>
+        <shiro:hasPermission name="mpmanager:mpTaskSetting:del">
+        <li data-item="delete"><a>删除</a></li>
+        </shiro:hasPermission>
+        <li data-item="action1"><a>取消</a></li>
+    </ul>  
+	</div>
+	</div>
+	</div>
+</body>
+</html>

+ 72 - 0
happy-job-module-hpvip/src/main/java/com/jeeplus/modules/mpmanager/entity/MpTaskSetting.java

@@ -0,0 +1,72 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.mpmanager.entity;
+
+import javax.validation.constraints.NotNull;
+
+import com.jeeplus.core.persistence.DataEntity;
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+
+/**
+ * 任务设置Entity
+ * @author zwq
+ * @version 2019-09-06
+ */
+public class MpTaskSetting extends DataEntity<MpTaskSetting> {
+	
+	private static final long serialVersionUID = 1L;
+	private String taskName;		// 任务名称
+	private Integer taskType;		// 任务类型(0:新手任务 1:日常任务)
+	private Integer points;		// 分值
+	private Integer taskNumber;		// 次数
+	
+	public MpTaskSetting() {
+		super();
+		this.setIdType(IDTYPE_AUTO);
+	}
+
+	public MpTaskSetting(String id){
+		super(id);
+	}
+
+	@ExcelField(title="任务名称", align=2, sort=1)
+	public String getTaskName() {
+		return taskName;
+	}
+
+	public void setTaskName(String taskName) {
+		this.taskName = taskName;
+	}
+	
+	@NotNull(message="任务类型(0:新手任务 1:日常任务)不能为空")
+	@ExcelField(title="任务类型(0:新手任务 1:日常任务)", align=2, sort=2)
+	public Integer getTaskType() {
+		return taskType;
+	}
+
+	public void setTaskType(Integer taskType) {
+		this.taskType = taskType;
+	}
+	
+	@NotNull(message="分值不能为空")
+	@ExcelField(title="分值", align=2, sort=3)
+	public Integer getPoints() {
+		return points;
+	}
+
+	public void setPoints(Integer points) {
+		this.points = points;
+	}
+	
+	@NotNull(message="次数不能为空")
+	@ExcelField(title="次数", align=2, sort=4)
+	public Integer getTaskNumber() {
+		return taskNumber;
+	}
+
+	public void setTaskNumber(Integer taskNumber) {
+		this.taskNumber = taskNumber;
+	}
+	
+}

+ 18 - 0
happy-job-module-hpvip/src/main/java/com/jeeplus/modules/mpmanager/mapper/MpTaskSettingMapper.java

@@ -0,0 +1,18 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.mpmanager.mapper;
+
+import com.jeeplus.core.persistence.BaseMapper;
+import com.jeeplus.core.persistence.annotation.MyBatisMapper;
+import com.jeeplus.modules.mpmanager.entity.MpTaskSetting;
+
+/**
+ * 任务设置MAPPER接口
+ * @author zwq
+ * @version 2019-09-06
+ */
+@MyBatisMapper
+public interface MpTaskSettingMapper extends BaseMapper<MpTaskSetting> {
+	
+}

+ 124 - 0
happy-job-module-hpvip/src/main/java/com/jeeplus/modules/mpmanager/mapper/xml/MpTaskSettingMapper.xml

@@ -0,0 +1,124 @@
+<?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.mpmanager.mapper.MpTaskSettingMapper">
+    
+	<sql id="mpTaskSettingColumns">
+		a.id AS "id",
+		a.task_name AS "taskName",
+		a.task_type AS "taskType",
+		a.points AS "points",
+		a.task_number AS "taskNumber",
+		a.create_date AS "createDate",
+		a.create_by AS "createBy.id",
+		a.update_date AS "updateDate",
+		a.update_by AS "updateBy.id",
+		a.del_flag AS "delFlag"
+	</sql>
+	
+	<sql id="mpTaskSettingJoins">
+		
+	</sql>
+	
+    
+	<select id="get" resultType="MpTaskSetting" >
+		SELECT 
+			<include refid="mpTaskSettingColumns"/>
+		FROM mp_task_setting a
+		<include refid="mpTaskSettingJoins"/>
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="MpTaskSetting" >
+		SELECT 
+			<include refid="mpTaskSettingColumns"/>
+		FROM mp_task_setting a
+		<include refid="mpTaskSettingJoins"/>
+		<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="MpTaskSetting" >
+		SELECT 
+			<include refid="mpTaskSettingColumns"/>
+		FROM mp_task_setting a
+		<include refid="mpTaskSettingJoins"/>
+		<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 mp_task_setting(
+			task_name,
+			task_type,
+			points,
+			task_number,
+			create_date,
+			create_by,
+			update_date,
+			update_by,
+			del_flag
+		) VALUES (
+			#{taskName},
+			#{taskType},
+			#{points},
+			#{taskNumber},
+			#{createDate},
+			#{createBy.id},
+			#{updateDate},
+			#{updateBy.id},
+			#{delFlag}
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE mp_task_setting SET 	
+			task_name = #{taskName},
+			task_type = #{taskType},
+			points = #{points},
+			task_number = #{taskNumber},
+			update_date = #{updateDate},
+			update_by = #{updateBy.id}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM mp_task_setting
+		WHERE id = #{id}
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE mp_task_setting SET 
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="MpTaskSetting" statementType="STATEMENT">
+		select * FROM mp_task_setting  where ${propertyName} = '${value}'
+	</select>
+	
+</mapper>

+ 47 - 0
happy-job-module-hpvip/src/main/java/com/jeeplus/modules/mpmanager/service/MpTaskSettingService.java

@@ -0,0 +1,47 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.mpmanager.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.mpmanager.entity.MpTaskSetting;
+import com.jeeplus.modules.mpmanager.mapper.MpTaskSettingMapper;
+
+/**
+ * 任务设置Service
+ * @author zwq
+ * @version 2019-09-06
+ */
+@Service
+@Transactional(readOnly = true)
+public class MpTaskSettingService extends CrudService<MpTaskSettingMapper, MpTaskSetting> {
+
+	public MpTaskSetting get(String id) {
+		return super.get(id);
+	}
+	
+	public List<MpTaskSetting> findList(MpTaskSetting mpTaskSetting) {
+		return super.findList(mpTaskSetting);
+	}
+	
+	public Page<MpTaskSetting> findPage(Page<MpTaskSetting> page, MpTaskSetting mpTaskSetting) {
+		return super.findPage(page, mpTaskSetting);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(MpTaskSetting mpTaskSetting) {
+		super.save(mpTaskSetting);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(MpTaskSetting mpTaskSetting) {
+		super.delete(mpTaskSetting);
+	}
+	
+}

+ 225 - 0
happy-job-module-hpvip/src/main/java/com/jeeplus/modules/mpmanager/web/MpTaskSettingController.java

@@ -0,0 +1,225 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.mpmanager.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.bind.annotation.PathVariable;
+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.mpmanager.entity.MpTaskSetting;
+import com.jeeplus.modules.mpmanager.service.MpTaskSettingService;
+
+/**
+ * 任务设置Controller
+ * @author zwq
+ * @version 2019-09-06
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/mpmanager/mpTaskSetting")
+public class MpTaskSettingController extends BaseController {
+
+	@Autowired
+	private MpTaskSettingService mpTaskSettingService;
+	
+	@ModelAttribute
+	public MpTaskSetting get(@RequestParam(required=false) String id) {
+		MpTaskSetting entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = mpTaskSettingService.get(id);
+		}
+		if (entity == null){
+			entity = new MpTaskSetting();
+		}
+		return entity;
+	}
+	
+	/**
+	 * 任务设置列表页面
+	 */
+	@RequiresPermissions("mpmanager:mpTaskSetting:list")
+	@RequestMapping(value = {"list", ""})
+	public String list(MpTaskSetting mpTaskSetting, Model model) {
+		model.addAttribute("mpTaskSetting", mpTaskSetting);
+		return "modules/mpmanager/mpTaskSettingList";
+	}
+	
+		/**
+	 * 任务设置列表数据
+	 */
+	@ResponseBody
+	@RequiresPermissions("mpmanager:mpTaskSetting:list")
+	@RequestMapping(value = "data")
+	public Map<String, Object> data(MpTaskSetting mpTaskSetting, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<MpTaskSetting> page = mpTaskSettingService.findPage(new Page<MpTaskSetting>(request, response), mpTaskSetting); 
+		return getBootstrapData(page);
+	}
+
+	/**
+	 * 查看,增加,编辑任务设置表单页面
+	 */
+	@RequiresPermissions(value={"mpmanager:mpTaskSetting:view","mpmanager:mpTaskSetting:add","mpmanager:mpTaskSetting:edit"},logical=Logical.OR)
+	@RequestMapping(value = "form/{mode}")
+	public String form(@PathVariable String mode, MpTaskSetting mpTaskSetting, Model model) {
+		model.addAttribute("mpTaskSetting", mpTaskSetting);
+		model.addAttribute("mode", mode);
+		return "modules/mpmanager/mpTaskSettingForm";
+	}
+
+	/**
+	 * 保存任务设置
+	 */
+	@ResponseBody
+	@RequiresPermissions(value={"mpmanager:mpTaskSetting:add","mpmanager:mpTaskSetting:edit"},logical=Logical.OR)
+	@RequestMapping(value = "save")
+	public AjaxJson save(MpTaskSetting mpTaskSetting, Model model) throws Exception{
+		AjaxJson j = new AjaxJson();
+		/**
+		 * 后台hibernate-validation插件校验
+		 */
+		String errMsg = beanValidator(mpTaskSetting);
+		if (StringUtils.isNotBlank(errMsg)){
+			j.setSuccess(false);
+			j.setMsg(errMsg);
+			return j;
+		}
+		//新增或编辑表单保存
+		mpTaskSettingService.save(mpTaskSetting);//保存
+		j.setSuccess(true);
+		j.setMsg("保存任务设置成功");
+		return j;
+	}
+	
+	/**
+	 * 删除任务设置
+	 */
+	@ResponseBody
+	@RequiresPermissions("mpmanager:mpTaskSetting:del")
+	@RequestMapping(value = "delete")
+	public AjaxJson delete(MpTaskSetting mpTaskSetting) {
+		AjaxJson j = new AjaxJson();
+		mpTaskSettingService.delete(mpTaskSetting);
+		j.setMsg("删除任务设置成功");
+		return j;
+	}
+	
+	/**
+	 * 批量删除任务设置
+	 */
+	@ResponseBody
+	@RequiresPermissions("mpmanager:mpTaskSetting:del")
+	@RequestMapping(value = "deleteAll")
+	public AjaxJson deleteAll(String ids) {
+		AjaxJson j = new AjaxJson();
+		String idArray[] =ids.split(",");
+		for(String id : idArray){
+			mpTaskSettingService.delete(mpTaskSettingService.get(id));
+		}
+		j.setMsg("删除任务设置成功");
+		return j;
+	}
+	
+	/**
+	 * 导出excel文件
+	 */
+	@ResponseBody
+	@RequiresPermissions("mpmanager:mpTaskSetting:export")
+    @RequestMapping(value = "export")
+    public AjaxJson exportFile(MpTaskSetting mpTaskSetting, HttpServletRequest request, HttpServletResponse response) {
+		AjaxJson j = new AjaxJson();
+		try {
+            String fileName = "任务设置"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+            Page<MpTaskSetting> page = mpTaskSettingService.findPage(new Page<MpTaskSetting>(request, response, -1), mpTaskSetting);
+    		new ExportExcel("任务设置", MpTaskSetting.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("mpmanager:mpTaskSetting: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<MpTaskSetting> list = ei.getDataList(MpTaskSetting.class);
+			for (MpTaskSetting mpTaskSetting : list){
+				try{
+					mpTaskSettingService.save(mpTaskSetting);
+					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("mpmanager:mpTaskSetting:import")
+    @RequestMapping(value = "import/template")
+     public AjaxJson importFileTemplate(HttpServletResponse response) {
+		AjaxJson j = new AjaxJson();
+		try {
+            String fileName = "任务设置数据导入模板.xlsx";
+    		List<MpTaskSetting> list = Lists.newArrayList(); 
+    		new ExportExcel("任务设置数据", MpTaskSetting.class, 1).setDataList(list).write(response, fileName).dispose();
+    		return null;
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg( "导入模板下载失败!失败信息:"+e.getMessage());
+		}
+		return j;
+    }
+
+}