Przeglądaj źródła

首页待办事项展示功能修改

user5 2 lat temu
rodzic
commit
ce5ce7ed23

+ 1 - 1
src/main/java/com/jeeplus/modules/sys/web/LoginController.java

@@ -468,7 +468,7 @@ public class LoginController extends BaseController{
 		workProjectNotify.setStatus("0");
 		workProjectNotify.setRemarks("待通知");
 		//通知信息
-		Page<WorkProjectNotify> notifyPageShow = workProjectNotifyService.findPage(new Page<WorkProjectNotify>(request, response), workProjectNotify);
+		Page<WorkProjectNotify> notifyPageShow = workProjectNotifyService.notifyFindPage(new Page<WorkProjectNotify>(request, response), workProjectNotify);
 		model.addAttribute("notifyShowPage", notifyPageShow.getList());
 		model.addAttribute("notifyShowCount", notifyPageShow.getList().size());//未读通知条数
 		model.addAttribute("notifyShowCount1", notifyPageShow.getCount());//未读通知条数

+ 2 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/dao/WorkProjectNotifyDao.java

@@ -117,4 +117,6 @@ public interface WorkProjectNotifyDao extends CrudDao<WorkProjectNotify> {
 
 
     int updateWpaData(WorkProjectNotify notify);
+
+    List<WorkProjectNotify> notifyFindList(WorkProjectNotify workProjectNotify);
 }

+ 34 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/service/WorkProjectNotifyService.java

@@ -108,6 +108,13 @@ public class WorkProjectNotifyService extends CrudService<WorkProjectNotifyDao,
 
 	}
 
+
+
+	public List<WorkProjectNotify> notifyFindList(WorkProjectNotify workProjectNotify) {
+		//workProjectNotify.getSqlMap().put("dsf", dataScopeFilterOR(workProjectNotify.getCurrentUser(), "o", "u","s", MenuStatusEnum.PROJECT_NOTIFY.getValue()));
+		return dao.notifyFindList(workProjectNotify);
+	}
+
 	public Page<WorkProjectNotify> findPage(Page<WorkProjectNotify> page, WorkProjectNotify workProjectNotify) {
 		Integer count = dao.queryCount(workProjectNotify);
 		if(null == count){
@@ -135,6 +142,33 @@ public class WorkProjectNotifyService extends CrudService<WorkProjectNotifyDao,
 		return page;
 	}
 
+	public Page<WorkProjectNotify> notifyFindPage(Page<WorkProjectNotify> page, WorkProjectNotify workProjectNotify) {
+		Integer count = dao.queryCount(workProjectNotify);
+		if(null == count){
+			count = 0;
+		}
+		page.setCount(count);
+		page.setCountFlag(false);
+		workProjectNotify.setPage(page);
+		List<WorkProjectNotify> list = notifyFindList(workProjectNotify);
+		/*for (WorkProjectNotify info: list) {
+			//如果记录中流程开始时间为空,则通过流程id查询该流程的开始时间
+			if(null == info.getWapCreateDate() && StringUtils.isNotBlank(info.getProcessInstanceId())){
+				WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+				workActivityProcess.setIsApproval("0");
+				workActivityProcess.setProcessInstanceId(info.getProcessInstanceId());
+				List<WorkActivityProcess> beginList = workActivityProcessService.findByProcInsIdAndIsApprovalOnList(workActivityProcess);
+				if(beginList.size()>0){
+					info.setWapCreateDate(beginList.get(0).getCreateDate());
+				}else{
+					info.setWapCreateDate(new Date());
+				}
+			}
+		}*/
+		page.setList(list);
+		return page;
+	}
+
 	/**
 	 * 已办数据信息
 	 * @param page

+ 3 - 3
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -1060,7 +1060,7 @@ public class WorkProjectNotifyController extends BaseController {
 		workProjectNotify.setStatus("0");
 		workProjectNotify.setRemarks("待通知");
 		workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
-		Page<WorkProjectNotify> pageList = workProjectNotifyService.findPage(new Page<WorkProjectNotify>(request, response),workProjectNotify);
+		Page<WorkProjectNotify> pageList = workProjectNotifyService.notifyFindPage(new Page<WorkProjectNotify>(request, response),workProjectNotify);
 		model.addAttribute("page", pageList);
 		return "modules/workprojectnotify/workProjectNotifyShowList";
 	}
@@ -1093,7 +1093,7 @@ public class WorkProjectNotifyController extends BaseController {
 		workProjectNotify.setStatus("0");
 		workProjectNotify.setRemarks("待通知");
 		workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
-		List<WorkProjectNotify> notifyList = workProjectNotifyService.findList(workProjectNotify);
+		List<WorkProjectNotify> notifyList = workProjectNotifyService.notifyFindList(workProjectNotify);
 		if(notifyList.size()>0){
 			for(WorkProjectNotify notify : notifyList){
 				workProjectNotifyService.readNotify(workProjectNotifyService.get(notify.getId()));
@@ -1125,7 +1125,7 @@ public class WorkProjectNotifyController extends BaseController {
 		workProjectNotify.setStatus("2");
 		workProjectNotify.setRemarks("待通知");
 		workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
-		Page<WorkProjectNotify> pageList = workProjectNotifyService.findPage(new Page<WorkProjectNotify>(request, response),workProjectNotify);
+		Page<WorkProjectNotify> pageList = workProjectNotifyService.notifyFindPage(new Page<WorkProjectNotify>(request, response),workProjectNotify);
 		model.addAttribute("page", pageList);
 		return "modules/workprojectnotify/workProjectNotifyReadShowList";
 	}

+ 105 - 3
src/main/resources/mappings/modules/workprojectnotify/WorkProjectNotifyDao.xml

@@ -88,11 +88,113 @@
 		SELECT
 		<include refid="workProjectNotifyColumns"/>
 		,a.wap_begin_date AS "wapCreateDate"
-		,(select user.id from work_activity_process wap left join sys_user user on wap.create_by = user.id where wap.process_instance_id = a.process_instance_id order by wap.create_date asc limit 1) as 'initiator'
-		,(select p.user_id from work_activity_process wap
+		,(select user.id from work_activity_process wap left join sys_user user on wap.create_by = user.id where wap.count != 0 and (case when a.process_instance_id is null then wap.process_instance_id = (select waps.process_instance_id
+		FROM work_project_notify waps
+		WHERE waps.notify_id = a.notify_id and waps.process_instance_id is not null order by waps.notify_id desc
+		LIMIT 1) else wap.process_instance_id = a.process_instance_id end)  and wap.is_approval = '0'  order by wap.count asc limit 1) as 'initiator'
+		/*,(select p.user_id from work_activity_process wap
 		left join work_activity_process_user p on wap.process_instance_id = p.process_id and p.count = wap.count
 		left join sys_user u on u.id = p.user_id
-		where wap.process_instance_id = 'b4b984e916114f1ca1f188e682465926' and wap.is_approval = '0'  order by wap.count asc limit 1) as 'auditor'
+		where (case when a.process_instance_id is null then wap.process_instance_id = (select waps.process_instance_id
+		FROM work_project_notify waps
+		WHERE waps.notify_id = a.notify_id and waps.process_instance_id is not null order by waps.notify_id desc
+		LIMIT 1) else wap.process_instance_id = a.process_instance_id end) and wap.is_approval = '0'  order by wap.count asc limit 1) as 'auditor'*/
+		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}
+			<if test="title != null and title != ''">
+				AND a.title LIKE
+				<if test="dbName == 'oracle'">'%'||#{title}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{title}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{title},'%')</if>
+			</if>
+			<if test="content != null and content != ''">
+				AND a.content LIKE
+				<if test="dbName == 'oracle'">'%'||#{content}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{content}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{content},'%')</if>
+			</if>
+			<if test="user != null and user.id != null and user.id != ''">
+				AND a.notify_user = #{user.id}
+			</if>
+			<if test="userName != null and userName != ''">
+				AND u.name LIKE
+				<if test="dbName == 'oracle'">'%'||#{userName}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{userName}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{userName},'%')</if>
+			</if>
+
+			<if test="companyId != null and companyId != ''">
+				AND a.company_id = #{companyId}
+			</if>
+			<if test="type != null and type != ''">
+				AND a.type = #{type}
+			</if>
+			<if test="types != null and types != ''">
+				AND a.type in (${types})
+			</if>
+			<if test="startDate != null and startDate != ''">
+				AND a.create_date &gt;= #{startDate}
+			</if>
+			<if test="endDate != null and endDate != ''">
+				AND a.create_date &lt;= #{endDate}
+			</if>
+
+			<if test="startBeginDate != null and startBeginDate != ''">
+				AND a.wap_begin_date &gt;= #{startBeginDate}
+			</if>
+			<if test="endBeginDate != null and endBeginDate != ''">
+				AND a.wap_begin_date &lt;= #{endBeginDate}
+			</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>
+				<when test="status !=null and status != '' ">
+					AND a.status = #{status}
+				</when>
+				<otherwise>
+					AND a.status != '1'
+				</otherwise>
+			</choose>
+			<choose>
+				<when test="remarks !=null and remarks != '' and remarks == '待通知'">
+					AND a.remarks = #{remarks}
+				</when>
+				<otherwise>
+					AND a.remarks != '待通知'
+				</otherwise>
+			</choose>
+		</where>
+
+		ORDER BY a.update_date DESC, a.exigency desc
+		<choose>
+			<!--<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.create_date DESC,a.id
+			</otherwise>-->
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				,${page.orderBy}
+			</when>
+			<!--<otherwise>
+				,a.create_date DESC,a.id
+			</otherwise>-->
+		</choose>
+	</select>
+
+	<select id="notifyFindList" resultType="WorkProjectNotify" >
+		SELECT
+		<include refid="workProjectNotifyColumns"/>
+		,a.wap_begin_date AS "wapCreateDate"
+		,(select user.id from work_activity_process wap left join sys_user user on wap.create_by = user.id where wap.process_instance_id = a.process_instance_id order by wap.create_date asc limit 1) as 'initiator'
 		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

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

@@ -834,10 +834,10 @@
                         return "<span title='"+ d.content +"'>" + d.content + "</span>";
                     }}
                 ,{align:'center',title: '提交人', width:80,templet:function(d){
-                        return "<span title='"+ d.submit +"'>" + d.submit + "</span>";
+                        return "<span title='"+ d.initiator +"'>" + d.initiator + "</span>";
                     }}
                 ,{align:'center',title: '审核人', width:80,templet:function(d){
-                        return "<span title='"+ d.auditorName +"'>" + d.auditorName + "</span>";
+                        return "<span title='"+ d.submit +"'>" + d.submit + "</span>";
                     }}
                 ,{field:'status1', align:'center',title: '审批状态',width:100}
                 ,{field:'op',align:'center', title: '创建时间', width:140,templet:function(d){