Browse Source

待办列表添加一个提交人筛选项

user5 4 years atrás
parent
commit
143fa75302

+ 26 - 8
src/main/java/com/jeeplus/modules/workprojectnotify/entity/WorkProjectNotify.java

@@ -17,7 +17,7 @@ import java.util.Date;
  * @version 2017-11-10
  */
 public class WorkProjectNotify extends DataEntity<WorkProjectNotify> {
-	
+
 	private static final long serialVersionUID = 1L;
 	private String companyId;		// 公司主键
 	private String title;		// 标题
@@ -38,6 +38,8 @@ public class WorkProjectNotify extends DataEntity<WorkProjectNotify> {
 	private String view;
 	private String projectType;  //项目类型
 	private String home;
+	private String createUserId;
+	private String createUserName;
 
 	public WorkProjectNotify() {
 		super();
@@ -55,7 +57,7 @@ public class WorkProjectNotify extends DataEntity<WorkProjectNotify> {
 	public void setCompanyId(String companyId) {
 		this.companyId = companyId;
 	}
-	
+
 	@ExcelField(title="标题", align=2, sort=8)
 	public String getTitle() {
 		return title;
@@ -64,7 +66,7 @@ public class WorkProjectNotify extends DataEntity<WorkProjectNotify> {
 	public void setTitle(String title) {
 		this.title = title;
 	}
-	
+
 	@ExcelField(title="内容", align=2, sort=9)
 	public String getContent() {
 		return content;
@@ -73,7 +75,7 @@ public class WorkProjectNotify extends DataEntity<WorkProjectNotify> {
 	public void setContent(String content) {
 		this.content = content;
 	}
-	
+
 	@ExcelField(title="类型", align=2, sort=10)
 	public String getType() {
 		return type;
@@ -82,7 +84,7 @@ public class WorkProjectNotify extends DataEntity<WorkProjectNotify> {
 	public void setType(String type) {
 		this.type = type;
 	}
-	
+
 	@ExcelField(title="通知人", align=2, sort=11)
 	public User getUser() {
 		return user;
@@ -91,7 +93,7 @@ public class WorkProjectNotify extends DataEntity<WorkProjectNotify> {
 	public void setUser(User user) {
 		this.user = user;
 	}
-	
+
 	@ExcelField(title="通知信息id", align=2, sort=12)
 	public String getNotifyId() {
 		return notifyId;
@@ -100,7 +102,7 @@ public class WorkProjectNotify extends DataEntity<WorkProjectNotify> {
 	public void setNotifyId(String notifyId) {
 		this.notifyId = notifyId;
 	}
-	
+
 	@ExcelField(title="读取状态", align=2, sort=13)
 	public String getStatus() {
 		return status;
@@ -205,4 +207,20 @@ public class WorkProjectNotify extends DataEntity<WorkProjectNotify> {
 	public void setHome(String home) {
 		this.home = home;
 	}
-}
+
+	public String getCreateUserId() {
+		return createUserId;
+	}
+
+	public void setCreateUserId(String createUserId) {
+		this.createUserId = createUserId;
+	}
+
+	public String getCreateUserName() {
+		return createUserName;
+	}
+
+	public void setCreateUserName(String createUserName) {
+		this.createUserName = createUserName;
+	}
+}

+ 27 - 20
src/main/resources/mappings/modules/workprojectnotify/WorkProjectNotifyDao.xml

@@ -1,7 +1,7 @@
 <?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.workprojectnotify.dao.WorkProjectNotifyDao">
-    
+
 	<sql id="workProjectNotifyColumns">
 		a.id AS "id",
 		a.create_by AS "createBy.id",
@@ -21,10 +21,10 @@
 		a.kind AS "kind",
 		a.officeId AS "officeId"
 	</sql>
-	
+
 	<sql id="workProjectNotifyJoins">
 	</sql>
-	
+
     <select id="getByWorkBidingDocument" parameterType="string"  resultType="WorkProjectNotify">
 		SELECT
 		<include refid="workProjectNotifyColumns"/>
@@ -42,7 +42,7 @@
 
 
 	<select id="get" resultType="WorkProjectNotify" >
-		SELECT 
+		SELECT
 			<include refid="workProjectNotifyColumns"/>
 		,a.process_instance_id as "processInstanceId"
 		FROM work_project_notify a
@@ -63,11 +63,13 @@
 		<include refid="workProjectNotifyJoins"/>
 		WHERE a.notify_id = #{notifyId} AND a.notify_user = #{notifyUserId}
 	</select>
-	
+
 	<select id="findList" resultType="WorkProjectNotify" >
-		SELECT 
+		SELECT
 			<include refid="workProjectNotifyColumns"/>
 		FROM work_project_notify a
+		left join sys_user su on a.create_by = su.id
+		LEFT JOIN sys_user u ON u.id = a.create_by
 		<include refid="workProjectNotifyJoins"/>
 		<where>
 			a.del_flag = #{DEL_FLAG_NORMAL}
@@ -108,6 +110,9 @@
 			<if test="endDate != null and endDate != ''">
 				AND a.create_date &lt;= #{endDate}
 			</if>
+			<if test="(createUserId != null and createUserId != '') or (createUserName != null and createUserName != '')">
+				AND (a.create_by = #{createUserId} or su.name like concat('%',#{createUserName},'%'))
+			</if>
 			<choose>
 				<when test="status !=null and status != '' and status == '-1'">
 				</when>
@@ -140,9 +145,8 @@
 	<select id="queryCount" resultType="Integer" >
 		SELECT count(1)
 		FROM work_project_notify a
-		<if test="userName != null and userName != ''">
-			LEFT JOIN sys_user u ON u.id = a.create_by
-		</if>
+		LEFT JOIN sys_user u ON u.id = a.create_by
+		LEFT JOIN sys_user su ON su.id = a.create_by
 		<where>
 			a.del_flag = #{DEL_FLAG_NORMAL}
 			<if test="title != null and title != ''">
@@ -182,6 +186,9 @@
 			<if test="endDate != null and endDate != ''">
 				AND a.create_date &lt;= #{endDate}
 			</if>
+			<if test="(createUserId != null and createUserId != '') or (createUserName != null and createUserName != '')">
+				AND (a.create_by = #{createUserId} or su.name like concat('%',#{createUserName},'%'))
+			</if>
 			<choose>
 				<when test="status !=null and status != '' and status == '-1'">
 				</when>
@@ -297,13 +304,13 @@
 	</select>
 
 	<select id="findAllList" resultType="WorkProjectNotify" >
-		SELECT 
+		SELECT
 			<include refid="workProjectNotifyColumns"/>
 		FROM work_project_notify a
 		<include refid="workProjectNotifyJoins"/>
 		<where>
 			a.del_flag = #{DEL_FLAG_NORMAL}
-		</where>		
+		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -313,7 +320,7 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<insert id="insert">
 		INSERT INTO work_project_notify(
 			id,
@@ -355,7 +362,7 @@
 	</insert>
 
 	<update id="update">
-		UPDATE work_project_notify SET 	
+		UPDATE work_project_notify SET
 			update_by = #{updateBy.id}
 			,update_date = #{updateDate}
 			,remarks = #{remarks}
@@ -417,21 +424,21 @@
 			status = #{status}
 		WHERE notify_id = #{notifyId} AND status != '1'
 	</update>
-	
+
 	<!--物理删除-->
 	<update id="delete">
 		DELETE FROM work_project_notify
 		WHERE id = #{id}
 	</update>
-	
+
 	<!--逻辑删除-->
 	<update id="deleteByLogic">
-		UPDATE work_project_notify SET 
+		UPDATE work_project_notify SET
 			del_flag = #{DEL_FLAG_DELETE}
 		WHERE id = #{id}
 	</update>
-	
-	
+
+
 	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
 	<select id="findUniqueByProperty" resultType="WorkProjectNotify" statementType="STATEMENT">
 		select * FROM work_project_notify  where ${propertyName} = '${value}'
@@ -685,5 +692,5 @@
 	  status = 2
 	where id = #{id}
 	</update>
-	
-</mapper>
+
+</mapper>

+ 32 - 0
src/main/webapp/webpage/modules/workprojectnotify/workProjectNotifyList.jsp

@@ -469,6 +469,31 @@
 				}
 			});
 		}
+
+		function cBlur(obj) {
+			var id = $("#createUserId").val();
+			if(undefined != obj.value && null != obj.value && '' != obj.value){
+				$.ajax({
+					url:'${ctx}/sys/user/getUserByName?name='+obj.value,
+					type:"post",
+					success:function(data){
+						var user = data.body.data;
+						if(undefined == user || null == user || '' == user){
+							$("#createUserId").val("");
+						}else{
+							if(data.body.data.id != id){
+								if(undefined != id && null != id && '' != id){
+									$("#createUserId").val("");
+								}
+							}
+						}
+					}
+				});
+			}else{
+				$("#createUserId").val("");
+			}
+
+		}
 	</script>
 	<style>
 		body{
@@ -531,6 +556,13 @@
 				</div>
 				<div id="moresees" style="clear:both;display:none;height: 70px;">
 					<div class="layui-item query athird">
+						<label class="layui-form-label">提交人:</label>
+						<div class="layui-input-block with-icon">
+							<sys:inquireselectUserNotReadolny id="createUser" name="createUserId" value="${workProjectNotify.createUserId}" labelName="createUserName" labelValue="${workProjectNotify.createUserName}" cssStyle="background-color: #fff"
+															  title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
+						</div>
+					</div>
+					<div class="layui-item query athird">
 						<label class="layui-form-label">创建日期:</label>
 						<div class="layui-input-block">
 							<input id="startDate" name="startDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"