Browse Source

Merge remote-tracking branch 'origin/master'

wangpx 1 year ago
parent
commit
1c5491d657

+ 1 - 1
src/main/master1_pm/com/yw/master1_pm/pageflow/master1_pm.xml

@@ -83,7 +83,7 @@
 			<param list="" />
 	  </action>
 	  <action>
-			<forward id="/mtProManage?task=toFlowStatisticsForPm" path="" type="立项管理" title="项目统计" isAuthor="1" />
+			<forward id="/mtProManage?task=toprostatlist" path="" type="立项管理" title="项目统计" isAuthor="1" />
 			<class name="com.yw.master1_pm.project.action.MtProjectAction" needLogin="true" level="1" />
 			<param list="" />
 	  </action>

+ 4 - 0
src/main/master1_pm/com/yw/master1_pm/project/action/MtProjectAction.java

@@ -33,6 +33,7 @@ public class MtProjectAction extends PmProjectAction {
 	private String success="/yw/master1/success.jsp";
 	private String error="/yw/master1/error.jsp";
 	private String flowStatisticsForPmUrl="/yw/master1_pm/project/info/flowStatisticsForPm.jsp";
+	private String prostatlist="/yw/master1_pm/project/info/projectStatistics_list.jsp";
 	
 	
 	@Override
@@ -241,6 +242,9 @@ public class MtProjectAction extends PmProjectAction {
 			getProjectsForPmStat(request, response);
 			this.path = flowStatisticsForPmUrl;
 			return;
+		}else if("toprostatlist".equals(task)){
+			toListProjectStateForStat(request,response);
+			this.path=prostatlist;
 		}
 	}
 	

+ 7 - 1
src/main/pm/com/yw/pm/pageflow/pm_project.xml

@@ -47,9 +47,15 @@
 	   <param list="" />
 	</action>
 
-	<action>
+	<!-- <action>
 	  <forward id="/pmProject?task=toFlowStatisticsForPm" path="" type="项目立项管理" title="项目统计" isMenu="1" isAuthor="1"/>
 	  <class name="com.yw.pm.project.action.PmProjectAction" needLogin="true" />
 	   <param list="" />
+	</action> -->
+	
+	<action>
+	  <forward id="/pmProject?task=toprostatlist" path="" type="项目立项管理" title="项目统计" isMenu="1" isAuthor="1"/>
+	  <class name="com.yw.pm.project.action.PmProjectAction" needLogin="true" />
+	   <param list="" />
 	</action>
 </pageflow>

+ 103 - 3
src/main/pm/com/yw/pm/project/action/PmProjectAction.java

@@ -8,12 +8,16 @@ import java.lang.reflect.Method;
 import java.net.URLDecoder;
 import java.sql.SQLException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.Set;
+import java.util.stream.Collectors;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -32,6 +36,7 @@ import com.yw.bpm.instance.service.FlowService;
 import com.yw.bpm.system.init.UrlMapping;
 import com.yw.bpm.system.model.SystemUser;
 import com.yw.bpm.system.util.JsonUtil;
+import com.yw.bpm.system.util.ServletUtil;
 import com.yw.core.framework.http.PermitDataAction;
 import com.yw.core.framework.http.RequestUtil;
 import com.yw.core.session.AppSession;
@@ -83,6 +88,7 @@ public class PmProjectAction extends PermitDataAction {
 	private String apply_add="/yw/pm/project/plan/apply_add.jsp";
 	private String tips="/yw/pm/tips.jsp";
 	private String flowStatisticsForPmUrl="/yw/pm/project/info/flowStatisticsForPm.jsp";
+	private String prostatlist="/yw/pm/project/info/projectStatistics_list.jsp";
 	
 	private PmProjectService pmProjectService;
 	private PmProjectFinishApply apply;
@@ -93,7 +99,10 @@ public class PmProjectAction extends PermitDataAction {
 	public void afterPermitDataAction(HttpServletRequest request,
 			HttpServletResponse response) throws Exception {
 		// TODO Auto-generated method stub
-		response.setContentType("text/html;charset=GBK");
+		/*request.setCharacterEncoding("UTF-8");
+		response.setCharacterEncoding("UTF-8");
+		response.setContentType("text/html;charset=UTF-8");*/
+		ServletUtil.setEncodingAndType(request, response);
 		String task = request.getParameter("task");
 		contextPath = request.getContextPath();
 		Long id = oasession.getCompanyRoot().getId();
@@ -397,6 +406,14 @@ public class PmProjectAction extends PermitDataAction {
 			this.getFlowStatisticsForPm(request, response);
 			this.path = PATH_AJAX;
 			return;
+		}else if("toprostatlist".equals(task)){
+			toListProjectStateForStat(request,response);
+			this.path=prostatlist;
+		}else if("prostatlist".equals(task)){
+			String result=prostatlist(request,response);
+			responseAjax(response, result);
+			this.path = PATH_AJAX;
+			return;
 		}  
 	}
 	public int editmile(HttpServletRequest request,HttpServletResponse response) throws Exception {
@@ -2352,10 +2369,17 @@ public class PmProjectAction extends PermitDataAction {
 	}
 	
 	public void getProjectsForPmStat(HttpServletRequest request, HttpServletResponse response) throws Exception {
+		PmProjectService pmProjectService=(PmProjectService)this.getBean(PmProjectService.class, "pmProjectService"); 
 		Long unitId = oasession.getUnit().getId();  
 		Map<String, String> map = new HashMap<String, String>();
-		map.put("unitId", String.valueOf(unitId));
-		PmProjectService pmProjectService=(PmProjectService)this.getBean(PmProjectService.class, "pmProjectService"); 
+		map.put("unitId", String.valueOf(unitId)); 
+		String project_id=request.getParameter("project_id");
+		String project_name="";
+		if(!com.yw.pm.common.util.StringUtil.isEmpty(project_id)){ 
+			Map<String, Object> projectMap=pmProjectService.getProjectById(Long.parseLong(project_id));
+			project_name=projectMap.get("project_name").toString();
+		}
+		request.setAttribute("project_name", project_name); 
 		List<Map<String, Object>> projectList = new ArrayList<Map<String, Object>>(); 
 		projectList = pmProjectService.getProjectsForPmStat(map);
 		String projectJson = JsonUtil.getJson(projectList, true); 
@@ -2388,5 +2412,81 @@ public class PmProjectAction extends PermitDataAction {
 		out.print(statResult);
 		return;
 	}
+	
+	/***
+	 * 项目统计列表
+	 * @param request
+	 * @param response
+	 * @return
+	 * @throws Exception
+	 */
+	public String prostatlist(HttpServletRequest request,
+			HttpServletResponse response) throws Exception{
+		PmProjectService pmProjectService=(PmProjectService)this.getBean(PmProjectService.class, "pmProjectService");
+		String p = request.getParameter("p");
+		String pSize = request.getParameter("pSize"); 
+		int intp = ParameterHelper.isNullP(p);
+		int intpSize = ParameterHelper.isNullPSize(pSize);
+		List<Map<String, Object>> projectList = new ArrayList<Map<String, Object>>();
+		Map<String, Object> map = new HashMap<String, Object>();
+		Long unitId = oasession.getUnit().getId();  
+		map.put("unitId", String.valueOf(unitId)); 
+		 
+		String project_code=request.getParameter("project_code");
+		if(!com.yw.pm.common.util.StringUtil.isEmpty(project_code)){
+			project_code=URLDecoder.decode(project_code, "utf-8");
+			map.put("project_code", project_code);
+		}
+		String project_name=request.getParameter("project_name");
+		if(!com.yw.pm.common.util.StringUtil.isEmpty(project_name)){
+			project_name=URLDecoder.decode(project_name, "utf-8");
+			map.put("project_name", project_name);
+		}
+		String state=request.getParameter("state");
+		map.put("state", state);
+		String start_date=request.getParameter("start_date");
+		map.put("start_date", start_date);
+		String end_date=request.getParameter("end_date");
+		map.put("end_date", end_date);
+		String lose_flag=request.getParameter("lose_flag");
+		map.put("lose_flag", lose_flag);
+		int total= 0;
+		projectList =  pmProjectService.getProjectStatList(intp, intpSize, map);
+		for (Map<String, Object> project : projectList){
+			String project_id = project.get("universalid") == null ? "" : project.get("universalid").toString();
+			if (!StringUtil.isEmpty(project_id)){
+				Map<String, Object> count_hour = pmProjectService.getCountHour(project_id);
+				project.put("plan_hour_count", count_hour.get("plan_hour_count"));
+				project.put("prac_hour_count", count_hour.get("prac_hour_count"));
+			}
+			total = project.get("total_data") == null ? total : Integer.parseInt(project.get("total_data").toString());
+		}
+		projectList.remove(projectList.size()-1);
+		JsonConfig jsonConfig = new JsonConfig();
+		JsonDateValueProcessor jdvp = new JsonDateValueProcessor();
+		jsonConfig.registerJsonValueProcessor(Date.class, jdvp);
+		jsonConfig.registerJsonValueProcessor(java.sql.Date.class, jdvp);
+		JSONArray json = JSONArray.fromObject(projectList, jsonConfig);
+		String result = json.toString(); 
+		return "{Rows : " + result + ", Total : " + total + "}";
+	}
 
+	/**
+	 * 项目状态(统计用) 
+	 * @param request
+	 * @param response
+	 */
+	public void toListProjectStateForStat(HttpServletRequest request,
+			HttpServletResponse response){
+		List<PmDataDictionary> projectState = new ArrayList<PmDataDictionary>();
+		projectState = PmDataDictionaryManager
+				.getListByValue("pm_projectState");
+		Set<String> excludedValues = new HashSet<>(Arrays.asList("1",  "2", "4", "9")); 
+		projectState = projectState.stream() 
+		        .filter(d -> d.getDvalue()  != null && !excludedValues.contains(d.getDvalue())) 
+		        .collect(Collectors.toList()); 
+		request.setAttribute("projectState", projectState);
+		String projectStateJson = JsonUtil.getJson(projectState, true); 
+		request.setAttribute("projectStateJson", projectStateJson); 
+	}
 }

+ 2 - 0
src/main/pm/com/yw/pm/project/dao/PmProjectDao.java

@@ -222,6 +222,8 @@ public interface PmProjectDao {
 	 * @return
 	 */
 	public List<Map<String, Object>> getProjectsForPmStat(Map<String, String> map);
+
+	public List<Map<String, Object>> getProjectStatList(int p, int pSize, Map<String, Object> map) throws Exception;
 	
 	
 }

+ 41 - 1
src/main/pm/com/yw/pm/project/dao/PmProjectDaoImp.java

@@ -754,7 +754,7 @@ public class PmProjectDaoImp extends BaseDao implements PmProjectDao {
 		StringBuilder sb = new StringBuilder();
 		sb.append("select ppi.universalid,ppi.project_short_name,ppi.project_code,ppi.project_name,ppi.state,ppi.start_date,ppi.end_date,ppi.create_date,ppi.lose_flag,ppi.custor_unit,t.name create_username,t2.name responsibleName  ");
 		sb.append("from pm_project_info ppi inner join t_user t on ppi.create_user=t.universalid left join t_user t2 on ppi.responsible=t2.universalid  ");
-		sb.append("where 1=1 and ppi.state='3' "); 
+		sb.append("where 1=1 and ppi.state not in (1,2,4,9) "); 
 		sb.append(" and ppi.unit_id=? "); 
 		sb.append(" order by create_date desc");
 		List<Object> params = new ArrayList();
@@ -764,4 +764,44 @@ public class PmProjectDaoImp extends BaseDao implements PmProjectDao {
 		return list;
 	}
 
+	@Override
+	public List<Map<String, Object>> getProjectStatList(int p, int pSize, Map<String, Object> map) throws Exception {
+		StringBuilder sb = new StringBuilder();
+		sb.append("select ppi.universalid,ppi.project_short_name,ppi.project_code,ppi.project_name,ppi.state,ppi.start_date,ppi.end_date,ppi.create_date,ppi.lose_flag,t.name create_username  ");
+		sb.append("from pm_project_info ppi inner join t_user t on ppi.create_user=t.universalid  ");
+		sb.append("where 1=1 and ppi.state not in (1,2,4,9) ");
+		if (map.get("unitId") != null && !"".equals(map.get("unitId"))) {
+			sb.append(" and ppi.unit_id = '" + map.get("unitId").toString().replaceAll("'", "") + "'");
+		}
+		if (map.get("project_code") != null && !"".equals(map.get("project_code"))) {
+			sb.append(" and ppi.project_code like '%" + map.get("project_code").toString().replaceAll("'", "") + "%'");
+		}
+		if (map.get("project_name") != null && !"".equals(map.get("project_name"))) {
+			sb.append(" and ppi.project_name like '%" + map.get("project_name").toString().replaceAll("'", "") + "%'");
+		}
+		if (map.get("state") != null && !"".equals(map.get("state"))) {
+			sb.append(" and ppi.state in (" + map.get("state")).append(")");
+		}
+		if (map.get("lose_flag") != null && !"".equals(map.get("lose_flag"))) {
+			sb.append(" and ppi.lose_flag in (" + map.get("lose_flag")).append(")");
+		}
+		if (map.get("start_date") != null && !"".equals(map.get("start_date"))) {
+			sb.append(" and to_days(ppi.start_date) >= to_days('" + map.get("start_date") + "')");
+		}
+		if (map.get("end_date") != null && !"".equals(map.get("end_date"))) {
+			sb.append(" and to_days(ppi.end_date) <= to_days('" + map.get("end_date") + "')");
+		}
+		sb.append(" order by create_date desc");
+		List params = new ArrayList();
+		pagerService = pagerService.queryPageForList(p - 1, pSize, sb.toString(), params);
+		List<Map<String, Object>> list = pagerService.getDatas();
+		Integer total_data = pagerService.getAllCount();
+		if(total_data==null)total_data = 0;
+		ProConvertMappingData(list);
+		Map<String, Object> temp = new HashMap<String, Object>();
+		temp.put("total_data", total_data);
+		list.add(temp);
+		return list;
+	}
+
 }

+ 11 - 0
src/main/pm/com/yw/pm/project/service/PmProjectService.java

@@ -203,5 +203,16 @@ public interface PmProjectService {
 	 * @return
 	 */
 	public List<Map<String, Object>> getProjectsForPmStat(Map<String, String> map);
+	
+	/**
+	 * 获取项目统计列表
+	 * 
+	 * @param p
+	 * @param pSize
+	 * @param map
+	 * @return
+	 * @throws Excepiton
+	 */
+	public List<Map<String, Object>> getProjectStatList(int p, int pSize, Map<String, Object> map) throws Exception;
 
 }

+ 6 - 3
src/main/pm/com/yw/pm/project/service/PmProjectServiceImpl.java

@@ -334,16 +334,19 @@ public class PmProjectServiceImpl implements PmProjectService {
 
 	@Override
 	public PagerService getProjectMoneyPage(int intp, int intpSize,
-			Map<String, Object> map) throws SQLException, Exception {
-		// TODO Auto-generated method stub
+			Map<String, Object> map) throws SQLException, Exception { 
 		return pmProjectDao.getProjectMoneyPage(intp-1, intpSize, map);
 	}
 
 	@Override
 	public List<Map<String, Object>> getProjectsForPmStat(Map<String, String> map) {
-		//pmProjectDao.getProjectInfoAll(p, pSize, map);
 		return pmProjectDao.getProjectsForPmStat(map);
 	}
+
+	@Override
+	public List<Map<String, Object>> getProjectStatList(int p, int pSize, Map<String, Object> map) throws Exception {
+		return pmProjectDao.getProjectStatList(p, pSize, map);
+	}
 	
 
 	

+ 4 - 3
src/main/webapp/yw/master1_pm/project/info/flowStatisticsForPm.jsp

@@ -155,7 +155,7 @@
 	}
 
 	function searchAll() { 
-		$("#project_name").val(""); 
+		//$("#project_name").val(""); 
 		$("#starttime").val("");
 		$("#endtime").val("");  
 		$("#name").val("");
@@ -188,7 +188,7 @@
 			<input type="button" id="back" class="l-button" value="返回" onclick="history.back(-1);" />
 		</div>
 		<div class="default_search" style="margin: 0; width: 100%;">  
-			<ul class="list_search" style="width:250px;">
+			<%-- <ul class="list_search" style="width:250px;">
 				<li class="title">项目名称:</li>
 				<li class="text">
 					<select name="project_name" id="project_name" style="width: 130px;" >
@@ -198,7 +198,8 @@
 					 	</c:forEach>
 					</select>
 				</li>
-			</ul> 
+			</ul>  --%>
+			<input type="hidden" name="project_name" id="project_name" value="${requestScope.project_name}">
 			<ul style="width: 250px;">
 				<li class="title">流程状态:</li>
 				<li class="text">

+ 2 - 2
src/main/webapp/yw/master1_pm/project/info/left_project.jsp

@@ -55,8 +55,8 @@
 				     </div>
 				 </a>
        		</yr:isAuthor>
-       		<yr:isAuthor key="/mtProManage?task=toFlowStatisticsForPm">
-       			<a href="#"	onclick="item('mtProManage.do?task=toFlowStatisticsForPm');">
+       		<yr:isAuthor key="/mtProManage?task=toprostatlist">
+       			<a href="#"	onclick="item('mtProManage.do?task=toprostatlist');">
 				    <div class="tc_menu_new fl" >
 				    	<div class="new_icon">
 				    		<img src="/shares/images/master1/icon_new_liebiao.png" width="25" height="29" />

+ 195 - 0
src/main/webapp/yw/master1_pm/project/info/projectStatistics_list.jsp

@@ -0,0 +1,195 @@
+<%@ page contentType="text/html;charset=UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib prefix="tms" uri="http://fzywtx.com/jsp/yw/tms" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=GBK">
+<title>项目统计</title>
+<link href="/shares/js/yw/master1/liger/skins/ynet/css/ligerui-all.css" rel="stylesheet" type="text/css" />
+<link href="/shares/css/yw/master1/reset.css" rel="stylesheet" type="text/css" />
+<script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
+<script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
+<script src="/shares/jquery.progressbar/js/jquery.progressbar.js" type="text/javascript"></script>
+<script type="text/javascript" src="/shares/js/common.js"></script>
+<script type="text/javascript" src="/shares/js/constant.js"></script>
+<script type="text/javascript" src="/shares/js/yw/master1/page.js"></script>
+<script type="text/javascript" src="/shares/js/yw/master1/common.js"></script>
+<script type="text/javascript" src="/shares/js/yw/master1/searchBox.js"></script>
+<script type="text/javascript">
+//(new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423 
+//(new Date()).Format("yyyy-M-d h:m:s.S")      ==> 2006-7-2 8:9:4.18 
+Date.prototype.Format = function (fmt) { //author: meizz 
+  var o = {
+      "M+": this.getMonth() + 1, //月份 
+      "d+": this.getDate(), //日 
+      "h+": this.getHours(), //小时 
+      "m+": this.getMinutes(), //分 
+      "s+": this.getSeconds(), //秒 
+      "q+": Math.floor((this.getMonth() + 3) / 3), //季度 
+      "S": this.getMilliseconds() //毫秒 
+  };
+  if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+  for (var k in o)
+  if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+  return fmt;
+};
+$(function(){
+	var projectStateJson  = '${requestScope.projectStateJson}'; 
+	var projectState = JSON.parse(projectStateJson);
+	var items = [];
+	var initValueItem = [];
+    for (var i = 0; i < projectState.length;  i++) { 
+        items.push({  
+        	id: projectState[i].dvalue,  
+            text: projectState[i].dname,  
+            value: projectState[i].dvalue, 
+        });
+        initValueItem.push(projectState[i].dvalue);
+    }
+    var initValueString = initValueItem.join(",");
+	$("#state").ligerComboBox({ isShowCheckBox: true, isMultiSelect: true, 
+        data: items,
+        valueFieldID: 'state_',
+        isMultiSelect : true,
+        initValue : initValueString,
+        split :',',
+        onSelected : function (value, text){ 
+          	 $('#project_name').val("输入项目名称");
+          	searchByKword();
+          }
+    });
+	searchByKword();
+	//search("pmProject.do?task=myprolist");
+});
+function search(url,s){
+	var p = $("#p").val();
+	var pSize = $("#pSize").val();
+	var param={"p":p,"pSize":pSize};
+	sendAsyncAjax(param, url+"&time="+ new Date().getTime()+s, "json", function(data) {
+			var num = data.Total;
+			page(num,pSize,p);	
+			var datas = data.Rows;
+			var item_name = $('#contentDiv');
+			$(item_name).empty();//初始化table,清空table
+			var html = '';
+			if(datas.length == 0){
+				html = notquery();
+			}else{
+				var j=0;
+				 for (var i = 0; i < datas.length; i++){
+					 var arr = datas[i];
+					 var bdiv = 1;
+					 bdiv = 1 + j;
+					 if (j < 7) {
+						j++
+					 } else {
+						j = 0;
+					 }
+					 html+= '<div class="tr_cont_new mar4 f5_new">';
+					 html+= '<a href="#" onclick="detailpro('+arr.universalid+')">';
+					 html+= '<div class="wdrw_tiao_new bn'+bdiv+' fl"></div>';
+					 html += '<div class="tr_rw_d_new fl">';
+					 html+= '<p><img src="/shares/images/master1/rw_ico_menu.png" width="17" height="15"  />';
+					 html+='['+arr.state_name+']&nbsp;&nbsp;【<font color="blue">';
+					 html+= arr.project_name+'</font>】&nbsp;&nbsp;';
+					 html+= '[<font color="red">计划用时:'+(arr.plan_hour_count == null ?  0 : arr.plan_hour_count)+'h&nbsp;&nbsp;';
+					 html+= '实际用时:'+(arr.prac_hour_count == null ?  0 : arr.prac_hour_count)+'h</font>]&nbsp;&nbsp;';
+					 if (arr.lose_flag == "1"){
+						 html+='[<font color="red">已结项</font>]';
+					 }
+					 html+= '</p>';
+					 html+='<p class=\'mar5\'>';
+					 var create_date=new Date(arr.create_date.time);
+					 html+='立项申请人:'+arr.create_username+',&nbsp;&nbsp;申请时间:'+create_date.Format("yyyy-MM-dd hh:mm:ss");	
+					 html+='</p>';
+					 html+= '</div>';
+					 html+= '</a>';
+					 html+= '<div class="tr_rw_btn_new fr" style="width: 370px;margin-right:30px;" >'; 
+					 html+= '<div class="div_btn">';
+					 html+='<input type="button" class="btn_c" value="统 计" onclick="statpro('+arr.universalid+')" />';
+					 html+='</div>';
+					 html+= '</div>';
+					 html+= '</div>';
+	             }
+			}		
+			$(item_name).html(html);				
+	});			
+}
+function detailpro(project_id){
+	item('mtProManage.do?task=toptdetail&type=1&project_id='+project_id);
+}
+function editpro(project_id,type){
+	var s = '';
+	if (type == 1){
+		s = '&edit=edit';
+	}
+	item('mtProManage.do?task=topteditpro&type=1&project_id='+project_id + s);
+}
+function statpro(project_id){
+	if(project_id){
+		item("mtProManage.do?task=toFlowStatisticsForPm&project_id="+project_id);
+	}else{
+		item("mtProManage.do?task=toFlowStatisticsForPm");
+	}
+}
+function searchByKword(){
+	var s = "";
+	var state = $("#state_").val();
+	var project_name=searchBox.getValue();
+	if (project_name != "" && typeof (project_name) != "undefined" && project_name !="输入项目名称") {
+		s += "&project_name=" + encodeURI(encodeURI(project_name));
+	}
+	if (state != "" && typeof (state) != "undefined") {
+		s += "&state=" + state;
+	}
+	/* if($("#ended_project").attr('checked')){
+		s += "&lose_flag=0,1";
+	} else {
+		s += "&lose_flag=0";
+		
+	} */
+	search("pmProject.do?task=prostatlist",s);
+}
+</script>
+</head>
+<body>
+	<div class="tc_b">
+			<div id="left" style="float:left;width:100%;">						 
+				<div class="tc_r">
+					<div class="tr_con b5 f4">
+						<div class="fl f4">
+							<img src="/shares/images/master1/wdrw_ico.png" width="25" height="31" />&nbsp;项目统计列表
+						</div>
+						<div class="fl f4" style="margin-left:30px;">
+							项目状态:
+						</div>
+						<div class="fl mar6">
+							<input type="text" id="state" name="state" />
+							<input type="hidden" id="state_" name="state_"/>
+			    		</div>
+			    		<div class="fl f4" style="margin-top:10px;margin-left:30px;">
+							<input type="button" class='l-button' name="stat" onclick="statpro();" value="统计全部" />
+						</div>
+			    		<!-- <div class="fl" style="margin-left:30px;">
+							<input type='checkbox' name='ended_project' id="ended_project" value=2 onclick="searchByKword();">&nbsp;显示已结项的项目
+			    		</div> -->
+						
+						<div class="div_ck_k fr">
+							<input class="div_cx fl" name="project_name" id="project_name" type="text" value="输入项目名称" />
+					  		<input class="btn_ck fl" type="button" id="button" onclick="searchByKword();"/>
+						</div>
+					</div>
+					<div class="tr_right_bg">
+						<div id="contentDiv"></div>
+						<jsp:include page="/yw/master1/page.jsp">
+							<jsp:param name="functionName" value="searchByKword"/>		
+						</jsp:include>	
+					</div>
+				</div>
+			</div>
+			<%@ include file="/yw/master1_pm/project/info/left_project.jsp"%>
+		</div>
+</body>
+</html>

+ 6 - 5
src/main/webapp/yw/pm/project/info/flowStatisticsForPm.jsp

@@ -148,7 +148,7 @@
 	}
 
 	function searchAll() { 
-		$("#project_name").val(""); 
+		//$("#project_name").val(""); 
 		$("#starttime").val("");
 		$("#endtime").val("");  
 		$("#name").val("");
@@ -182,7 +182,7 @@
 			<input onclick="closeWindow();" type="button" value="关闭" class="l-button guanbi">
 		</div>
 		<div class="default_search" style="margin: 0; width: 100%;">  
-			<ul class="list_search" style="width:250px;">
+			<%-- <ul class="list_search" style="width:250px;">
 				<li class="title">项目名称:</li>
 				<li class="text">
 					<select name="project_name" id="project_name" style="width: 130px;" >
@@ -192,7 +192,8 @@
 					 	</c:forEach>
 					</select>
 				</li>
-			</ul> 
+			</ul>  --%>
+			<input type="hidden" name="project_name" id="project_name" value="${requestScope.project_name}">
 			<ul style="width: 250px;">
 				<li class="title">流程状态:</li>
 				<li class="text">
@@ -209,8 +210,8 @@
 					<input type="text" id="name" name="name" style="width: 130px;">
 				</li>
 			</ul>   
-		</div>
-		<div class="default_search before_define" style="margin: 0; width: 100%;">
+		<!-- </div>
+		<div class="default_search before_define" style="margin: 0; width: 100%;"> -->
 			
 			<ul class="list_search" style="width: 450px;">
 				<li class="title">发起时间:</li>

+ 184 - 0
src/main/webapp/yw/pm/project/info/projectStatistics_list.jsp

@@ -0,0 +1,184 @@
+<%@ page contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>  
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>项目统计列表</title>
+	<link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
+	
+	<link href="${pageContext.request.contextPath }/main.css" rel="stylesheet" type="text/css" />
+	<script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
+	<script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
+	<script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
+	<script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerResizable.js" type="text/javascript"></script>
+	<script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerTab.js" type="text/javascript"></script>
+	<script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDrag.js" type="text/javascript"></script>
+	<script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
+	<script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
+	<script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
+    <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>
+	
+	<script type="text/javascript" src="/shares/js/constant.js"></script>
+	<script type="text/javascript" src="/shares/js/common.js"></script>
+	<style type="text/css">
+		.default_search li input[type='text']{height:28px; line-height:28px}
+	</style>
+	<script type="text/javascript">
+		$(function(){
+			searchlist();
+			$("#start_date").ligerDateEditor({
+				labelWidth : 100,
+				labelAlign : 'right',
+				initValue:'' 
+			});
+			$("#end_date").ligerDateEditor({
+				labelWidth : 100,
+				labelAlign : 'right',
+				initValue:'' 
+			});
+		});
+		
+		 
+		function detailpro(project_id){
+			addTab("${pageContext.request.contextPath }/pmProject.do?task=toptdetail&type=1&project_id="+project_id, "查看", "pmProject.do?task=toptdetail&type=1&project_id="+project_id, true);
+		}
+		
+		function statpro(project_id){
+			if(project_id){
+				addTab("${pageContext.request.contextPath }/pmProject.do?task=toFlowStatisticsForPm&project_id="+project_id, "统计", "pmProject.do?task=toFlowStatisticsForPm&project_id="+project_id, true);
+			}else{
+				addTab("${pageContext.request.contextPath }/pmProject.do?task=toFlowStatisticsForPm", "统计", "pmProject.do?task=toFlowStatisticsForPm", true);
+			}
+		}
+		
+		var manager;
+		function searchlist(){
+			var project_code=$("#project_code").val();
+			var project_name=$("#project_name").val();
+			var state=$("#state").val();
+			var start_date=$("#start_date").val();
+			var end_date=$("#end_date").val();
+			var josnobj={"project_code":"","project_name":"","state":"","start_date":"","end_date":""};
+			if(project_code !="" && typeof (project_code) !="undefined" ){
+				josnobj.project_code=encodeURI(project_code);
+			}
+			if(project_name !="" && typeof (project_name) !="undefined" ){
+				josnobj.project_name=encodeURI(project_name);
+			}
+			if(state !="" && typeof (state) !="undefined" ){
+				josnobj.state=state;
+			}
+			if(start_date !="" && typeof (start_date) !="undefined" ){
+				josnobj.start_date=start_date;
+			}
+			if(end_date !="" && typeof (end_date) !="undefined" ){
+				josnobj.end_date=end_date;
+			}
+			if(manager==undefined){
+				manager1=$("#projectmaingrid").ligerGrid({
+					columns:[
+					      {display:"项目编号",name:"project_code",align: 'center',width: 200,render : function(rowdata, rowindex, value)
+					    	  {
+					    	  	 var html="";
+					    	  	 if(rowdata.project_code !=null && rowdata.project_code !=""){
+					    	  		html="<a href='javascript:detailpro("+rowdata.universalid+")'>"+rowdata.project_code+"</a>";
+					    	  	 }
+					    	  	 return html;
+					    	  }
+					      },
+					      { display: '项目名称', name: 'project_name', width: 300, align: 'center'},
+				          { display: '立项申请人', name: 'create_username', width: 200, align: 'center'},
+				          { display: '计划启动时间', name: 'start_date', width: 150, align: 'center'},
+				          { display: '计划结束时间', name: 'end_date', width: 150, align: 'center'},
+				          { display: '项目状态', name: 'state_name', width: 150, align: 'center'},
+				          { display: '操作', isSort: false, width: 200,render : function(rowdata, rowindex, value)
+				        	  {
+				        	  	  var html="";
+				        	  	  html+="<a href='javascript:detailpro("+rowdata.universalid+")'>查看</a>";
+				        	  	  html+="&nbsp;&nbsp;<a href='javascript:statpro("+rowdata.universalid+")'>统计</a>"; 
+				        	  	  return html;
+				        	  }
+				          }
+					],pageSize:10,
+					url:"pmProject.do?task=prostatlist&time="+ new Date().getTime(),
+					parms :josnobj,
+		            pageParmName: 'p',               //页索引参数名,(提交给服务器)
+		   		    pagesizeParmName: 'pSize',        //页记录数参数名,(提交给服务器)
+		   		    width : '100%',   	
+		   		    height : '99.4%',   	
+		            rownumbers:true
+				});	
+			}else{
+				manager._setParms(josnobj);
+				manager.loadData();
+			}
+		}
+		 
+		$(function() {
+		    $("#state").ligerComboBox(); 
+		});
+	</script>
+</head>
+<body>
+	<div id="title" class="form-button">
+		<input onclick="closeWindow();" type="button" value="关闭" class="l-button" />
+
+	</div>
+	<div class="container-layout">
+		<div class="default_search" style="margin-bottom: 0px;">
+			<ul class="list_search">
+				<li class="title">项目编号:</li>
+				<li class="text">
+				<input type="text" id="project_code" name="project_code" style="width: 130px" />
+				</li>
+			</ul>
+			<ul class="list_search">
+				<li class="title">项目名称:</li>
+				<li class="text">
+					<input type="text" id="project_name" name="project_name" style="width: 130px" />
+				</li>
+			</ul>
+			<ul class="list_search" >
+				<li class="title" >项目状态:</li>
+				<li class="text" >
+					<select id="state" name="state" >
+						<option value=""></option>
+						<c:forEach items="${projectState }" var="obj">
+							<option value="${obj.dvalue }">${obj.dname }</option>
+						</c:forEach>
+					</select>
+				</li>
+			</ul>
+		</div>
+		<div class="default_search" style="margin-bottom: 0px;">
+			<ul class="list_search" >
+				<li class="title" >启动时间:</li>
+				<li class="text" >
+					<input type="text" id="start_date" name="start_date" style="width: 130px;"  />
+				</li>
+			</ul>
+			<ul class="list_search" >
+				<li class="title" >结束时间:</li>
+				<li class="text" >
+					<input type="text" id="end_date" name="end_date" style="width: 130px;"  />
+				</li>
+			</ul>
+			<ul class="list_search" >
+				<li class="search-button" style="width: 100px;">
+					<input type="button" class='l-button' name="search" onclick="searchlist();" value="查询" />
+				</li>
+				<li class="search-button" style="width: 100px;">
+					<input type="button" class='l-button' name="stat" onclick="statpro();" value="统计全部" />
+				</li>
+			</ul>
+		</div>
+		
+		<div style="clear: both;margin-right: 2px;margin-bottom:0px;margin-left:0px;margin-top:0px; padding: 0">
+
+			<div id="projectmaingrid" style=" margin:0;padding: 0"></div>
+		</div>
+		
+	</div>
+</body>
+</html>