Bladeren bron

Merge remote-tracking branch 'origin/master'

yue 5 jaren geleden
bovenliggende
commit
458fb15dfb

+ 10 - 8
src/main/java/com/jeeplus/modules/sg/report/mapper/xml/ReportMapper.xml

@@ -16,7 +16,7 @@
 
 	<select id="findList" parameterType="SgReport" resultType="SgReport">
 		SELECT b.department as name,
-		sum(b.level1) as lever1,
+		sum(b.level1) as level1,
 		sum(b.level2) as level2,
 		sum(b.level3) as level3,
 		sum(b.level4) as level4 from
@@ -31,13 +31,15 @@
 		         department,
 		         if(firstFinish='否' or secondFinish = '否',NOW(),if(secondFinish = '是',secondFinishDate,firstFinishDate) )as da ,
 		          approvalDate ,if(firstFinish='否' or secondFinish = '否','0','1') as status
-		          from project_information) a ) b   GROUP BY b.department
-		 <where>
-		    <if test="status != null and status != ''">
-			 b.status = #{status} and
-		   </if>
-		   1=1
-		 </where>
+		          from project_information) a
+		<where>
+			<if test="status != null and status != ''">
+				a.status = #{status} and
+			</if>
+			1=1
+		</where>
+		          ) b   GROUP BY b.department
+
 	</select>
 
 

+ 5 - 0
src/main/java/com/jeeplus/modules/sg/report/web/ReportController.java

@@ -30,6 +30,11 @@ public class ReportController {
     @RequestMapping(value = {"list", ""})
     public String list(SgReport sgReport, Model model) {
         model.addAttribute("sgReport", sgReport);
+        List<SgReport> list = reportService.findData();
+        List<SgReport> list1 = reportService.findList(sgReport);
+        model.addAttribute("list",list);
+        model.addAttribute("list1",list1);
+        model.addAttribute("dataURL", "/echarts/bar/sample3/option");
         return "modules/sg/report/reportList";
     }
 

+ 7 - 7
src/main/webapp/webpage/modules/sg/report/reportList.js

@@ -9,19 +9,19 @@ $(document).ready(function() {
                dataType: "json",
                contentType: "application/x-www-form-urlencoded",
                //显示检索按钮
-	           showSearch: true,
+	           // showSearch: true,
                //显示刷新按钮
-               showRefresh: true,
+               // showRefresh: true,
                //显示切换手机试图按钮
-               showToggle: true,
+               // showToggle: true,
                //显示 内容列下拉框
-    	       showColumns: true,
+    	       // showColumns: true,
     	       //显示到处按钮
-    	       showExport: true,
+    	       // showExport: true,
     	       //显示切换分页按钮
-    	       showPaginationSwitch: true,
+    	       // showPaginationSwitch: true,
     	       //最低显示2行
-    	       minimumCountColumns: 2,
+    	       // minimumCountColumns: 2,
                //是否显示行间隔色
                striped: true,
                //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)     

+ 80 - 2
src/main/webapp/webpage/modules/sg/report/reportList.jsp

@@ -6,7 +6,8 @@
 	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
 	<meta name="decorator" content="ani"/>
 	<%@ include file="/webpage/include/bootstraptable.jsp"%>
-	<%@include file="reportList.js" %>
+	<%@ include file="/webpage/include/echarts.jsp"%>
+	<%--<%@include file="reportList.js" %>--%>
 </head>
 <body>
 	<div class="wrapper wrapper-content">
@@ -73,10 +74,87 @@
 		    <%--</div>--%>
 		
 	<!-- 表格 -->
-	<table id="reportTable"   data-toolbar="#toolbar"></table>
+	<%--<table id="reportTable"   data-toolbar="#toolbar"></table>--%>
 
     <!-- context menu -->
+		<table class="table table-bordered">
 
+            <thead>
+			<tr>
+				<th> </th>
+				<c:forEach items="${list}" var="data" varStatus="index">
+				<th>${data.name}</th>
+				</c:forEach>
+			</tr>
+			<tr>
+				<th>完成</th>
+				<c:forEach items="${list}" var="data" varStatus="index">
+				<th>${data.finishCount}</th>
+				</c:forEach>
+			</tr>
+			<tr>
+				<th>未完成</th>
+				<c:forEach items="${list}" var="data" varStatus="index">
+				<th>${data.unfinishCount}</th>
+				</c:forEach>
+			</tr>
+			</thead>
+
+
+		</table>
+
+		<table class="table table-bordered">
+
+			<thead>
+			<tr>
+				<th> </th>
+				<c:forEach items="${list1}" var="data" varStatus="index">
+					<th>${data.name}</th>
+				</c:forEach>
+			</tr>
+			<tr>
+				<th>1-7天</th>
+				<c:forEach items="${list1}" var="data" varStatus="index">
+					<th>${data.level1}</th>
+				</c:forEach>
+			</tr>
+			<tr>
+				<th>8-14天</th>
+				<c:forEach items="${list1}" var="data" varStatus="index">
+					<th>${data.level2}</th>
+				</c:forEach>
+			</tr>
+			<tr>
+				<th>15-21天</th>
+				<c:forEach items="${list1}" var="data" varStatus="index">
+					<th>${data.level3}</th>
+				</c:forEach>
+			</tr>
+			<tr>
+				<th>21天以上</th>
+				<c:forEach items="${list1}" var="data" varStatus="index">
+					<th>${data.level4}</th>
+				</c:forEach>
+			</tr>
+
+			</thead>
+
+
+		</table>
+		<div id="main" style="width: 100%;height: 100%"></div>
+		<script type="text/javascript">
+			// 基于准备好的dom,初始化echarts实例4
+			var myChart = echarts.init(document.getElementById('main'));
+			window.onresize = myChart.resize;
+			$(function () {
+
+				jp.get("${ctx}${dataURL}", function (option) {
+					// 指定图表的配置项和数据
+					// 使用刚指定的配置项和数据显示图表。
+					myChart.setOption(option);
+				})
+			})
+		</script>
 	</div>
 	</div>
 	</div>