Browse Source

git-svn-id: https://192.168.57.71/svn/jsgkj@1357 931142cf-59ea-a443-aa0e-51397b428577

ld_xuhx 8 years ago
parent
commit
934d265de8

+ 16 - 24
gkjsjy/trunk/WebContent/WEB-INF/pages/gkyxtjyfx/gkhwttlfx/gkhwttlfx.jsp

@@ -37,39 +37,36 @@ function initChart(){
 			zoomType: 'xy'
 	    },
 	    title: {
-	        text: '货物吞吐量分析'
+	        text: ''
 	    },
-	    /* subtitle: {副标题
-	    	text: 'Source: WorldClimate.com'
-	    }, */
+	  
 	    xAxis: [{
-	        categories: month,//['Jan', 'Feb', 'Mar', 'Apr', 'May'],
-	        crosshair: true
+	        categories: month,
 	    }],
-	    yAxis: [{ // Primary yAxis
+	    yAxis: [{ 
 	        labels: {
 	            format: '{value}%',
 	            style: {
-	                color: Highcharts.getOptions().colors[1]
+	                color: '#89A54E'
 	            }
 	        },
 	        title: {
-	            text: '百分比',
+	            text: '增长比率',
 	            style: {
-	                color: Highcharts.getOptions().colors[1]
+	                color:'#89A54E'
 	            }
 	        }
 	    }, { // Secondary yAxis
 	        title: {
 	           text: '货物吞吐量',
                style: {
-	                color: Highcharts.getOptions().colors[0]
+	                color: '#4572A7'
 	            }
 	        },
 	        labels: {
-	            format: '{value}吨',
+	            format: '{value}吨',
 	            style: {
-	                color: Highcharts.getOptions().colors[0]
+	                color: '#4572A7'
 	            }
 	        },
 	        opposite: true
@@ -77,25 +74,16 @@ function initChart(){
 	    tooltip: {
 	        shared: true
         },
-	    legend: {
-	        layout: 'vertical',
-	        align: 'left',
-	        x: 120,
-	        verticalAlign: 'top',
-            y: 100,
-            floating: true,
-	        backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
-	    },
         series: [{
         	name: '吞吐量',
 	        type: 'column',
 	        yAxis: 1,
-	        data: ttl,//[49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
+	        data: ttl,
 	        tooltip: {
 	            valueSuffix: '吨'
             }
         }, {
-	        name: '百分比',
+	        name: '增长比率',
 	        type: 'spline',
 	        data: bl,
 	        tooltip: {
@@ -163,6 +151,10 @@ function initChart(){
 		</table>
 	</div>
 </form>
+
+<h2 align="center" style="margin-top:20px;" ><font style="font-size:16px;color:#196794;font-family:微软雅黑;font-weight: bold;">
+(${startDate}月——${endDate}月)港口货物吞吐量分析</font></h2>
+<br>
 	<div id="container" style="min-width:400px;height:400px"></div>
 
 </body>

+ 9 - 15
gkjsjy/trunk/WebContent/WEB-INF/pages/gkyxtjyfx/gkhwttlfx/gyhzttlfx.jsp

@@ -44,7 +44,7 @@ function initChart(){
 			zoomType: 'xy'
 	    },
 	    title: {
-	        text: '货物吞吐量分析'
+	        text: ''
 	    },
 	    /* subtitle: {副标题
 	    	text: 'Source: WorldClimate.com'
@@ -61,7 +61,7 @@ function initChart(){
 	            }
 	        },
 	        title: {
-	            text: '百分比',
+	            text: '增长比率',
 	            style: {
 	                color: Highcharts.getOptions().colors[1]
 	            }
@@ -74,7 +74,7 @@ function initChart(){
 	            }
 	        },
 	        labels: {
-	            format: '{value}吨',
+	            format: '{value}吨',
 	            style: {
 	                color: Highcharts.getOptions().colors[0]
 	            }
@@ -84,25 +84,16 @@ function initChart(){
 	    tooltip: {
 	        shared: true
         },
-	    legend: {
-	        layout: 'vertical',
-	        align: 'left',
-	        x: 120,
-	        verticalAlign: 'top',
-            y: 100,
-            floating: true,
-	        backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
-	    },
         series: [{
-        	name: '吞吐量',
+        	name: '货物吞吐量',
 	        type: 'column',
 	        yAxis: 1,
 	        data: ttl,//[49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
 	        tooltip: {
-	            valueSuffix: '吨'
+	            valueSuffix: '万吨'
             }
         }, {
-	        name: '百分比',
+	        name: '增长比率',
 	        type: 'spline',
 	        data: bl,
 	        tooltip: {
@@ -171,6 +162,9 @@ function initChart(){
 		</table>
 	</div>
 </form>
+<h2 align="center" style="margin-top:20px;" ><font style="font-size:16px;color:#196794;font-family:微软雅黑;font-weight: bold;">
+(${startDate}月——${endDate}月)港口公用与货主码头吞吐量分析</font></h2>
+<br>
 	<div id="container" style="min-width:400px;height:400px"></div>
 
 </body>

+ 9 - 15
gkjsjy/trunk/WebContent/WEB-INF/pages/gkyxtjyfx/gkhwttlfx/wmhwttlfx.jsp

@@ -37,7 +37,7 @@ function initChart(){
 			zoomType: 'xy'
 	    },
 	    title: {
-	        text: '货物吞吐量分析'
+	        text: ''
 	    },
 	    /* subtitle: {副标题
 	    	text: 'Source: WorldClimate.com'
@@ -54,7 +54,7 @@ function initChart(){
 	            }
 	        },
 	        title: {
-	            text: '百分比',
+	            text: '增长比率',
 	            style: {
 	                color: Highcharts.getOptions().colors[1]
 	            }
@@ -67,7 +67,7 @@ function initChart(){
 	            }
 	        },
 	        labels: {
-	            format: '{value}吨',
+	            format: '{value}吨',
 	            style: {
 	                color: Highcharts.getOptions().colors[0]
 	            }
@@ -77,25 +77,16 @@ function initChart(){
 	    tooltip: {
 	        shared: true
         },
-	    legend: {
-	        layout: 'vertical',
-	        align: 'left',
-	        x: 120,
-	        verticalAlign: 'top',
-            y: 100,
-            floating: true,
-	        backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
-	    },
         series: [{
-        	name: '吞吐量',
+        	name: '货物吞吐量',
 	        type: 'column',
 	        yAxis: 1,
 	        data: ttl,//[49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
 	        tooltip: {
-	            valueSuffix: '吨'
+	            valueSuffix: '万吨'
             }
         }, {
-	        name: '百分比',
+	        name: '增长比率',
 	        type: 'spline',
 	        data: bl,
 	        tooltip: {
@@ -163,6 +154,9 @@ function initChart(){
 		</table>
 	</div>
 </form>
+<h2 align="center" style="margin-top:20px;" ><font style="font-size:16px;color:#196794;font-family:微软雅黑;font-weight: bold;">
+(${startDate}月——${endDate}月)港口外贸货物吞吐量分析</font></h2>
+<br>
 	<div id="container" style="min-width:400px;height:400px"></div>
 
 </body>

+ 1 - 1
gkjsjy/trunk/WebContent/WEB-INF/pages/gkyxtjyfx/hxhbtj/hxhbtj.jsp

@@ -42,7 +42,7 @@
 <body>
 	<div class="box" >
 		<div class="box-content">
-		<h1 align="center" style="margin-top:0px;"><font style="font-size:25px;color:#196794;font-family:微软雅黑;font-weight: bold;">江苏省港口集装箱航线航班月度统计表</h1>
+		<h1 align="center" style="margin-top:0px;"><font style="font-size:25px;color:#196794;font-family:微软雅黑;font-weight: bold;">江苏省港口集装箱航线航班月度统计表</font></h1>
 		<form action="${app }/hxhbtj/main" id="hxhbtjform" method="post"> 
 		<input type="hidden" name="menuid" value="${menuid }">		
 		<div>

+ 1 - 1
gkjsjy/trunk/WebContent/WEB-INF/pages/gkyxtjyfx/hxhbtj/hxhbtjpro.jsp

@@ -25,7 +25,7 @@
 <body>
 	<div class="box" >
 		<div class="box-content">
-		<h1 align="center" style="margin-top:0px;"><font style="font-size:25px;color:#196794;font-family:微软雅黑;font-weight: bold;">全省港口集装箱航线航班月度统计表(${rq }月)</h1>
+		<h1 align="center" style="margin-top:0px;"><font style="font-size:25px;color:#196794;font-family:微软雅黑;font-weight: bold;">全省港口集装箱航线航班月度统计表(${rq }月)</font></h1>
 		<form action="${app }/hxhbtjpro/main" id="hxhbtjproform" method="post"> 
 		<input type="hidden" name="menuid" value="${menuid }">		
 		<div>

+ 35 - 35
gkjsjy/trunk/WebContent/WEB-INF/pages/gkyxtjyfx/hzttltj/hzttltj.jsp

@@ -72,7 +72,7 @@
 	            },
 	            labels: {
 	                formatter: function() {
-	                    return this.value +' 吨';
+	                    return this.value +' 吨';
 	                },
 	                style: {
 	                    color: '#4572A7'
@@ -107,7 +107,7 @@
 	            yAxis: 1,
 	            data: eval('['+zttl+']'),
 	            tooltip: {
-	                valueSuffix: ' 吨'
+	                valueSuffix: ' 吨'
 	            }
 
 	        }, {
@@ -186,21 +186,21 @@ width:50px;
 	<div style="margin:28px 35px ;height:40%;min-height:200px;">
     <table id="dctjtb" class="main_table" style="width:99%" border="1">
 			<tr >
-				<th rowspan="2">货物分类</th>
+				<th style="width: 15%" rowspan="2">货物分类</th>
 				<th colspan="3">总计</th>
 				<th colspan="3">出港</th>
 				<th colspan="3">进港</th>
 			</tr>
 			<tr >
-				<th >合计</th>
-				<th >外贸</th>
-				<th >内贸</th>
-				<th >合计</th>
-				<th >外贸</th>
-				<th >内贸</th>
-				<th >合计</th>
-				<th >外贸</th>
-				<th >内贸</th>
+				<th >合计(万吨)</th>
+				<th >外贸(万吨)</th>
+				<th >内贸(万吨)</th>
+				<th >合计(万吨)</th>
+				<th >外贸(万吨)</th>
+				<th >内贸(万吨)</th>
+				<th >合计(万吨)</th>
+				<th >外贸(万吨)</th>
+				<th >内贸(万吨)</th>
 			</tr>
 			<tr>
 				<td >总计</td>
@@ -251,7 +251,7 @@ width:50px;
 				<td>${a348}</td>
 			</tr>
 			<tr>
-				<td style="padding-left:100px">其中:焦炭</td>
+				<td style="padding-left:50px">其中:焦炭</td>
 				<td>${a5}</td>
 				<td>${a48}</td>
 				<td>${a91}</td>
@@ -275,7 +275,7 @@ width:50px;
 				<td>${a350}</td>
 			</tr>
 			<tr>
-				<td style="padding-left:100px">其中:原油</td>
+				<td style="padding-left:50px">其中:原油</td>
 				<td>${a7}</td>
 				<td>${a50}</td>
 				<td>${a93}</td>
@@ -289,7 +289,7 @@ width:50px;
 				
 			</tr>
 			<tr>
-				<td style="padding-left:100px">成品油</td>
+				<td style="padding-left:50px">成品油</td>
 				<td>${a8}</td>
 				<td>${a51}</td>
 				<td>${a94}</td>
@@ -303,7 +303,7 @@ width:50px;
 								
 			</tr>
 			<tr>
-				<td style="padding-left:100px">液化气、天然气</td>
+				<td style="padding-left:50px">液化气、天然气</td>
 				<td>${a9}</td>
 				<td>${a52}</td>
 				<td>${a95}</td>
@@ -329,7 +329,7 @@ width:50px;
 				
 			</tr>
 			<tr>
-				<td style="padding-left:100px">其中:铁矿石</td>
+				<td style="padding-left:50px">其中:铁矿石</td>
 				<td>${a11}</td>
 				<td>${a54}</td>
 				<td>${a97}</td>
@@ -355,7 +355,7 @@ width:50px;
 				
 			</tr>
 			<tr>
-				<td style="padding-left:100px">其中:钢铁</td>
+				<td style="padding-left:50px">其中:钢铁</td>
 				<td>${a13}</td>
 				<td>${a56}</td>
 				<td>${a99}</td>
@@ -368,7 +368,7 @@ width:50px;
 
 			</tr>
 			<tr>
-				<td style="padding-left:100px">生铁</td>
+				<td style="padding-left:50px">生铁</td>
 				<td>${a14}</td>
 				<td>${a57}</td>
 				<td>${a100}</td>
@@ -396,7 +396,7 @@ width:50px;
 				
 			</tr>
 			<tr>
-				<td style="padding-left:100px">其中:砂</td>
+				<td style="padding-left:50px">其中:砂</td>
 				<td>${a16}</td>
 <td>${a59}</td>
 <td>${a102}</td>
@@ -438,7 +438,7 @@ width:50px;
 				
 			</tr>
 			<tr>
-				<td style="padding-left:100px">其中:原木</td>
+				<td style="padding-left:50px">其中:原木</td>
 			<td>${a19}</td>
 <td>${a62}</td>
 <td>${a105}</td>
@@ -466,7 +466,7 @@ width:50px;
 				
 			</tr>
 			<tr>
-				<td style="padding-left:100px">其中:磷矿</td>
+				<td style="padding-left:50px">其中:磷矿</td>
 			<td>${a21}</td>
 <td>${a64}</td>
 <td>${a107}</td>
@@ -521,7 +521,7 @@ width:50px;
 				
 			</tr>
 			<tr>
-				<td style="padding-left:100px">其中:小麦</td>
+				<td style="padding-left:50px">其中:小麦</td>
 			<td>${a25}</td>
 <td>${a68}</td>
 <td>${a111}</td>
@@ -535,7 +535,7 @@ width:50px;
 				
 			</tr>
 			<tr>
-				<td style="padding-left:100px">玉米</td>
+				<td style="padding-left:50px">玉米</td>
 				<td>${a26}</td>
 <td>${a69}</td>
 <td>${a112}</td>
@@ -549,7 +549,7 @@ width:50px;
 				
 			</tr>
 			<tr>
-				<td style="padding-left:100px">黄豆</td>
+				<td style="padding-left:50px">黄豆</td>
 				<td>${a27}</td>
 <td>${a70}</td>
 <td>${a113}</td>
@@ -562,7 +562,7 @@ width:50px;
 
 			</tr>
 			<tr>
-				<td style="padding-left:100px">大米</td>
+				<td style="padding-left:50px">大米</td>
 				<td>${a28}</td>
 <td>${a71}</td>
 <td>${a114}</td>
@@ -604,7 +604,7 @@ width:50px;
 				
 			</tr>
 			<tr>
-				<td style="padding-left:100px">其中:橡胶</td>
+				<td style="padding-left:50px">其中:橡胶</td>
 				<td>${a31}</td>
 <td>${a74}</td>
 <td>${a117}</td>
@@ -618,7 +618,7 @@ width:50px;
 				
 			</tr>
 			<tr>
-				<td style="padding-left:100px">纯碱</td>
+				<td style="padding-left:50px">纯碱</td>
 			<td>${a32}</td>
 <td>${a75}</td>
 <td>${a118}</td>
@@ -659,7 +659,7 @@ width:50px;
 								
 			</tr>
 			<tr>
-				<td style="padding-left:100px">其中:纸</td>
+				<td style="padding-left:50px">其中:纸</td>
 		<td>${a35}</td>
 <td>${a78}</td>
 <td>${a121}</td>
@@ -673,7 +673,7 @@ width:50px;
 				
 			</tr>
 			<tr>
-				<td style="padding-left:100px">日用工业品</td>
+				<td style="padding-left:50px">日用工业品</td>
 			<td>${a36}</td>
 <td>${a79}</td>
 <td>${a122}</td>
@@ -687,7 +687,7 @@ width:50px;
 				
 			</tr>
 			<tr>
-				<td style="padding-left:100px">糖</td>
+				<td style="padding-left:50px">糖</td>
 			<td>${a37}</td>
 <td>${a80}</td>
 <td>${a123}</td>
@@ -715,7 +715,7 @@ width:50px;
 				
 			</tr>
 			<tr>
-				<td style="padding-left:100px">其中:棉花</td>
+				<td style="padding-left:50px">其中:棉花</td>
 				<td>${a39}</td>
 <td>${a82}</td>
 <td>${a125}</td>
@@ -743,7 +743,7 @@ width:50px;
 				
 			</tr>
 			<tr>
-				<td style="padding-left:100px">其中:集装箱重量(吨)</td>
+				<td style="padding-left:50px">其中:集装箱重量(吨)</td>
 			<td>${a41}</td>
 <td>${a84}</td>
 <td>${a127}</td>
@@ -756,7 +756,7 @@ width:50px;
 
 			</tr>
 			<tr>
-				<td style="padding-left:100px">滚装船汽车吞吐量(吨)</td>
+				<td style="padding-left:50px">滚装船汽车吞吐量(吨)</td>
 			<td>${a42}</td>
 <td>${a85}</td>
 <td>${a128}</td>
@@ -770,7 +770,7 @@ width:50px;
 				
 			</tr>
 			<tr>
-				<td style="padding-left:100px">滚装船汽车吞吐量(标辆)</td>
+				<td style="padding-left:50px">滚装船汽车吞吐量(标辆)</td>
 			<td>${a43}</td>
 <td>${a86}</td>
 <td>${a129}</td>

+ 1 - 1
gkjsjy/trunk/WebContent/WEB-INF/pages/gkyxtjyfx/hzttltj/jzxttltj.jsp

@@ -86,7 +86,7 @@
 	            },
 	            labels: {
 	                formatter: function() {
-	                    return this.value +' 吨';
+	                    return this.value +' 吨';
 	                },
 	                style: {
 	                    color: '#4572A7'

+ 152 - 142
gkjsjy/trunk/src/com/xt/jygl/gkyxtjyfx/hzttltj/ctl/GyhzttlfxCtl.java

@@ -1,7 +1,8 @@
 package com.xt.jygl.gkyxtjyfx.hzttltj.ctl;
 
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Calendar;
+import java.util.Date;
 import java.util.List;
 
 import javax.persistence.criteria.CriteriaBuilder;
@@ -23,265 +24,274 @@ import com.xtframe.util.StringUtils;
 
 @Controller
 @RequestMapping(value = "/gyhzttlfx")
-public class GyhzttlfxCtl extends BaseWebCtl{
-	
-/*	@Autowired
-	private GyttlfxService gyttlfxService;
-	@Autowired
-	private HzttlfxService hzttlfxService;*/
-	
+public class GyhzttlfxCtl extends BaseWebCtl {
+
 	@Autowired
 	private HwttlfxService hwttlfxService;
-	
-	@RequestMapping(value="/gymtttl/main")
-	public String gymtttl(Model model,final HttpServletRequest request,String tjx,String zzbl,final String startDate,final String endDate,final String menuid){
+
+	@RequestMapping(value = "/gymtttl/main")
+	public String gymtttl(Model model, final HttpServletRequest request, String tjx, String zzbl, final String startDate, final String endDate, final String menuid) {
+		String start = "";
+		String end = "";
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+		Date date1 = new Date();
+		if (StringUtils.isEmpty(startDate)) {
+			start = sdf.format(date1).substring(0, 5) + "01";
+			end = sdf.format(date1);
+		}
 		Specification<FlhwttlhjEntity> spec = new Specification<FlhwttlhjEntity>() {
 			@Override
 			public Predicate toPredicate(Root<FlhwttlhjEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
 				List<Predicate> list = new ArrayList<Predicate>();
-				if (StringUtils.isNotEmpty(startDate)&&StringUtils.isNotEmpty(endDate)) {
-					list.add(cb.between(root.get("tj_month").as(String.class), startDate,endDate));
-				}else{
-					Calendar currentDate = Calendar.getInstance();
-					list.add(cb.between(root.get("tj_month").as(String.class), currentDate.get(Calendar.YEAR)+"-01",
-							currentDate.get(Calendar.YEAR)+"-"+currentDate.get(Calendar.MONTH)));
+				if (StringUtils.isNotEmpty(startDate) && StringUtils.isNotEmpty(endDate)) {
+					list.add(cb.between(root.get("tj_month").as(String.class), startDate, endDate));
+				} else {
+					SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+					list.add(cb.between(root.get("tj_month").as(String.class), sdf.format(new Date()).substring(0, 5) + "01", sdf.format(new Date())));
 				}
 				return cb.and(list.toArray(new Predicate[] {}));
 			}
 		};
 		List<FlhwttlhjEntity> entityList = query.findAll(spec, FlhwttlhjEntity.class);
-		//吞吐量
+		// 吞吐量
 		List<String> ttl = new ArrayList<String>();
-		//时间区间
+		// 时间区间
 		List<String> dateList = new ArrayList<String>();
-		//比率
+		// 比率
 		List<String> bl = new ArrayList<String>();
 		String[] date;
-		int year,month;
+		int year, month;
 		FlhwttlhjEntity temp = null;
-		for(FlhwttlhjEntity e : entityList){
-			ttl.add(e.getGK03010202000100020000000000()+"");
+		for (FlhwttlhjEntity e : entityList) {
+			ttl.add((e.getGK03010202000100020000000000() / 10000) + "");
 		}
-		//比率
-		//同比
-		if(StringUtils.isEmpty(zzbl)||"tb".equals(zzbl)){
-			for(FlhwttlhjEntity e : entityList){
+		// 比率
+		// 同比
+		if (StringUtils.isEmpty(zzbl) || "tb".equals(zzbl)) {
+			for (FlhwttlhjEntity e : entityList) {
 				date = e.gettj_month().split("-");
-				year = Integer.parseInt(date[0])-1;
+				year = Integer.parseInt(date[0]) - 1;
 				month = Integer.parseInt(date[1]);
-				if(month<10){
-					temp = hwttlfxService.findOne(year+"-0"+month);
-				}else{
-					temp = hwttlfxService.findOne(year+"-"+month);
+				if (month < 10) {
+					temp = hwttlfxService.findOne(year + "-0" + month);
+				} else {
+					temp = hwttlfxService.findOne(year + "-" + month);
 				}
-				if(temp == null || e.getGK03010202000100020000000000() == 0){
+				if (temp == null || e.getGK03010202000100020000000000() == 0) {
 					bl.add("0");
-				}else{
-					bl.add(""+(int)((e.getGK03010202000100020000000000()-temp.getGK03010202000100020000000000())/temp.getGK03010202000100020000000000()*100));
+				} else {
+					bl.add("" + (int) ((e.getGK03010202000100020000000000() - temp.getGK03010202000100020000000000()) / temp.getGK03010202000100020000000000() * 100));
 				}
 			}
-		}else if("hb".equals(zzbl)){
-			for(int i = 0; i < entityList.size(); i++){
-				if(i == 0){
+		} else if ("hb".equals(zzbl)) {
+			for (int i = 0; i < entityList.size(); i++) {
+				if (i == 0) {
 					date = entityList.get(i).gettj_month().split("-");
 					year = Integer.parseInt(date[0]);
 					month = Integer.parseInt(date[1]);
-					if(month == 1){
+					if (month == 1) {
 						year = year - 1;
 						month = 12;
-					}else{
+					} else {
 						month = month - 1;
-						if(month<10){
-							temp = hwttlfxService.findOne(year+"-0"+month);
-						}else{
-							temp = hwttlfxService.findOne(year+"-"+month);
+						if (month < 10) {
+							temp = hwttlfxService.findOne(year + "-0" + month);
+						} else {
+							temp = hwttlfxService.findOne(year + "-" + month);
 						}
 					}
-					if(temp == null || entityList.get(i).getGK03010202000100020000000000() == 0){
+					if (temp == null || entityList.get(i).getGK03010202000100020000000000() == 0) {
 						bl.add("0");
-					}else{
-						bl.add(""+(int)((entityList.get(i).getGK03010202000100020000000000()-temp.getGK03010202000100020000000000())/entityList.get(i).getGK03010202000100020000000000()*100));
+					} else {
+						bl.add("" + (int) ((entityList.get(i).getGK03010202000100020000000000() - temp.getGK03010202000100020000000000()) / entityList.get(i).getGK03010202000100020000000000() * 100));
 					}
-				}else{
-					if(entityList.get(i).getGK03010202000100020000000000() == 0){
+				} else {
+					if (entityList.get(i).getGK03010202000100020000000000() == 0) {
 						bl.add("0");
-					}else{
-						bl.add(""+(int)((entityList.get(i).getGK03010202000100020000000000()-entityList.get(i-1).getGK03010202000100020000000000())/entityList.get(i).getGK03010202000100020000000000()*100));
+					} else {
+						bl.add("" + (int) ((entityList.get(i).getGK03010202000100020000000000() - entityList.get(i - 1).getGK03010202000100020000000000()) / entityList.get(i).getGK03010202000100020000000000() * 100));
 					}
 				}
 			}
-		}else{
-			for(int i = 0; i < entityList.size(); i++){
-				if(i == 0){
+		} else {
+			for (int i = 0; i < entityList.size(); i++) {
+				if (i == 0) {
 					date = entityList.get(i).gettj_month().split("-");
 					year = Integer.parseInt(date[0]);
 					month = Integer.parseInt(date[1]);
-					if(month == 1){
+					if (month == 1) {
 						year = year - 1;
 						month = 12;
-					}else{
+					} else {
 						month = month - 1;
-						if(month<10){
-							temp = hwttlfxService.findOne(year+"-0"+month);
-						}else{
-							temp = hwttlfxService.findOne(year+"-"+month);
+						if (month < 10) {
+							temp = hwttlfxService.findOne(year + "-0" + month);
+						} else {
+							temp = hwttlfxService.findOne(year + "-" + month);
 						}
 					}
-					if(temp == null || entityList.get(1).getGK03010202000100020000000000() == 0){
+					if (temp == null || entityList.get(1).getGK03010202000100020000000000() == 0) {
 						bl.add("0");
-					}else{
-						bl.add(""+(int)((entityList.get(i).getGK03010202000100020000000000()-temp.getGK03010202000100020000000000())/temp.getGK03010202000100020000000000()*100));
+					} else {
+						bl.add("" + (int) ((entityList.get(i).getGK03010202000100020000000000() - temp.getGK03010202000100020000000000()) / temp.getGK03010202000100020000000000() * 100));
 					}
-				}else{
-					if(entityList.get(i-1).getGK03010202000100020000000000() == 0 && entityList.get(i).getGK03010202000100020000000000() != 0){
+				} else {
+					if (entityList.get(i - 1).getGK03010202000100020000000000() == 0 && entityList.get(i).getGK03010202000100020000000000() != 0) {
 						bl.add("100");
-					}else if(entityList.get(i).getGK03010202000100020000000000() == 0){
+					} else if (entityList.get(i).getGK03010202000100020000000000() == 0) {
 						bl.add("0");
-					}else{
-						bl.add(""+(int)((entityList.get(i).getGK03010202000100020000000000()-entityList.get(i-1).getGK03010202000100020000000000())/entityList.get(i-1).getGK03010202000100020000000000()*100));
+					} else {
+						bl.add("" + (int) ((entityList.get(i).getGK03010202000100020000000000() - entityList.get(i - 1).getGK03010202000100020000000000()) / entityList.get(i - 1).getGK03010202000100020000000000() * 100));
 					}
 				}
 			}
 		}
-		//获取时间区间
-		for(FlhwttlhjEntity e : entityList){
-			dateList.add("'"+e.gettj_month()+"'");
+		// 获取时间区间
+		for (FlhwttlhjEntity e : entityList) {
+			dateList.add("'" + e.gettj_month() + "'");
 		}
-		model.addAttribute("bl",bl);
+		model.addAttribute("bl", bl);
 		model.addAttribute("ttl", ttl);
 		model.addAttribute("dateList", dateList);
-		model.addAttribute("startDate", startDate);
-		model.addAttribute("endDate", endDate);
+		model.addAttribute("startDate", startDate != null ? startDate : start);
+		model.addAttribute("endDate", endDate != null ? endDate : end);
 		model.addAttribute("zzbl", zzbl);
 		model.addAttribute("tjx", tjx);
 		model.addAttribute("menuid", menuid);
 		return "gkyxtjyfx/gkhwttlfx/gyhzttlfx";
 	}
-	
-	@RequestMapping(value="/hzmtttl/main")
-	public String hzmtttl(Model model,final HttpServletRequest request,String tjx,String zzbl,final String startDate,final String endDate,final String menuid){
+
+	@RequestMapping(value = "/hzmtttl/main")
+	public String hzmtttl(Model model, final HttpServletRequest request, String tjx, String zzbl, final String startDate, final String endDate, final String menuid) {
+		String start = "";
+		String end = "";
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+		Date date1 = new Date();
+		if (StringUtils.isEmpty(startDate)) {
+			start = sdf.format(date1).substring(0, 5) + "01";
+			end = sdf.format(date1);
+		}
 		Specification<FlhwttlhjEntity> spec = new Specification<FlhwttlhjEntity>() {
 			@Override
 			public Predicate toPredicate(Root<FlhwttlhjEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
 				List<Predicate> list = new ArrayList<Predicate>();
-				if (StringUtils.isNotEmpty(startDate)&&StringUtils.isNotEmpty(endDate)) {
-					list.add(cb.between(root.get("tj_month").as(String.class), startDate,endDate));
-				}else{
-					Calendar currentDate = Calendar.getInstance();
-					list.add(cb.between(root.get("tj_month").as(String.class), currentDate.get(Calendar.YEAR)+"-01",
-							currentDate.get(Calendar.YEAR)+"-"+currentDate.get(Calendar.MONTH)));
+				if (StringUtils.isNotEmpty(startDate) && StringUtils.isNotEmpty(endDate)) {
+					list.add(cb.between(root.get("tj_month").as(String.class), startDate, endDate));
+				} else {
+					SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+					list.add(cb.between(root.get("tj_month").as(String.class), sdf.format(new Date()).substring(0, 5) + "01", sdf.format(new Date())));
 				}
 				return cb.and(list.toArray(new Predicate[] {}));
 			}
 		};
 		List<FlhwttlhjEntity> entityList = query.findAll(spec, FlhwttlhjEntity.class);
-		//吞吐量
+		// 吞吐量
 		List<String> ttl = new ArrayList<String>();
-		//时间区间
+		// 时间区间
 		List<String> dateList = new ArrayList<String>();
-		//比率
+		// 比率
 		List<String> bl = new ArrayList<String>();
 		String[] date;
-		int year,month;
+		int year, month;
 		FlhwttlhjEntity temp = null;
-		for(FlhwttlhjEntity e : entityList){
-			ttl.add(e.getGK03010202000000000000000000() - e.getGK03010202000100020000000000()+"");
+		for (FlhwttlhjEntity e : entityList) {
+			ttl.add((e.getGK03010202000000000000000000() - e.getGK03010202000100020000000000()) / 10000 + "");
 		}
-		//比率
-		//同比
-		if(StringUtils.isEmpty(zzbl)||"tb".equals(zzbl)){
-			for(FlhwttlhjEntity e : entityList){
+		// 比率
+		// 同比
+		if (StringUtils.isEmpty(zzbl) || "tb".equals(zzbl)) {
+			for (FlhwttlhjEntity e : entityList) {
 				date = e.gettj_month().split("-");
-				year = Integer.parseInt(date[0])-1;
+				year = Integer.parseInt(date[0]) - 1;
 				month = Integer.parseInt(date[1]);
-				if(month<10){
-					temp = hwttlfxService.findOne(year+"-0"+month);
-				}else{
-					temp = hwttlfxService.findOne(year+"-"+month);
+				if (month < 10) {
+					temp = hwttlfxService.findOne(year + "-0" + month);
+				} else {
+					temp = hwttlfxService.findOne(year + "-" + month);
 				}
 				double hz = e.getGK03010202000000000000000000() - e.getGK03010202000100020000000000();
-				if(temp == null || hz == 0){
+				if (temp == null || hz == 0) {
 					bl.add("0");
-				}else{
-					bl.add(""+(int)((hz-(temp.getGK03010202000000000000000000() - temp.getGK03010202000100020000000000()))/(temp.getGK03010202000000000000000000() - temp.getGK03010202000100020000000000())*100));
+				} else {
+					bl.add("" + (int) ((hz - (temp.getGK03010202000000000000000000() - temp.getGK03010202000100020000000000())) / (temp.getGK03010202000000000000000000() - temp.getGK03010202000100020000000000()) * 100));
 				}
 			}
-		}else if("hb".equals(zzbl)){
-			for(int i = 0; i < entityList.size(); i++){
+		} else if ("hb".equals(zzbl)) {
+			for (int i = 0; i < entityList.size(); i++) {
 				double hz = entityList.get(i).getGK03010202000000000000000000() - entityList.get(i).getGK03010202000100020000000000();
-				if(i == 0){
+				if (i == 0) {
 					date = entityList.get(i).gettj_month().split("-");
 					year = Integer.parseInt(date[0]);
 					month = Integer.parseInt(date[1]);
-					if(month == 1){
+					if (month == 1) {
 						year = year - 1;
 						month = 12;
-					}else{
+					} else {
 						month = month - 1;
-						if(month<10){
-							temp = hwttlfxService.findOne(year+"-0"+month);
-						}else{
-							temp = hwttlfxService.findOne(year+"-"+month);
+						if (month < 10) {
+							temp = hwttlfxService.findOne(year + "-0" + month);
+						} else {
+							temp = hwttlfxService.findOne(year + "-" + month);
 						}
 					}
-					if(temp == null || hz == 0){
+					if (temp == null || hz == 0) {
 						bl.add("0");
-					}else{
-						bl.add(""+(int)((hz-(temp.getGK03010202000000000000000000() - temp.getGK03010202000100020000000000()))/hz*100));
+					} else {
+						bl.add("" + (int) ((hz - (temp.getGK03010202000000000000000000() - temp.getGK03010202000100020000000000())) / hz * 100));
 					}
-				}else{
-					if(hz == 0){
+				} else {
+					if (hz == 0) {
 						bl.add("0");
-					}else{
-						double hzqn = entityList.get(i-1).getGK03010202000000000000000000() - entityList.get(i-1).getGK03010202000100020000000000();
-						bl.add(""+(int)((hz-hzqn)/hzqn*100));
+					} else {
+						double hzqn = entityList.get(i - 1).getGK03010202000000000000000000() - entityList.get(i - 1).getGK03010202000100020000000000();
+						bl.add("" + (int) ((hz - hzqn) / hzqn * 100));
 					}
 				}
 			}
-		}else{
-			for(int i = 0; i < entityList.size(); i++){
+		} else {
+			for (int i = 0; i < entityList.size(); i++) {
 				double hz = entityList.get(i).getGK03010202000000000000000000() - entityList.get(i).getGK03010202000100020000000000();
-				if(i == 0){
+				if (i == 0) {
 					date = entityList.get(i).gettj_month().split("-");
 					year = Integer.parseInt(date[0]);
 					month = Integer.parseInt(date[1]);
-					if(month == 1){
+					if (month == 1) {
 						year = year - 1;
 						month = 12;
-					}else{
+					} else {
 						month = month - 1;
-						if(month<10){
-							temp = hwttlfxService.findOne(year+"-0"+month);
-						}else{
-							temp = hwttlfxService.findOne(year+"-"+month);
+						if (month < 10) {
+							temp = hwttlfxService.findOne(year + "-0" + month);
+						} else {
+							temp = hwttlfxService.findOne(year + "-" + month);
 						}
 					}
-					if(temp == null || hz == 0){
+					if (temp == null || hz == 0) {
 						bl.add("0");
-					}else{
-						bl.add(""+(int)((hz-(temp.getGK03010202000000000000000000() - temp.getGK03010202000100020000000000()))/(temp.getGK03010202000000000000000000() - temp.getGK03010202000100020000000000())*100));
+					} else {
+						bl.add("" + (int) ((hz - (temp.getGK03010202000000000000000000() - temp.getGK03010202000100020000000000())) / (temp.getGK03010202000000000000000000() - temp.getGK03010202000100020000000000()) * 100));
 					}
-				}else{
-					double hzqn = entityList.get(i-1).getGK03010202000000000000000000() - entityList.get(i-1).getGK03010202000100020000000000();
-					if(hzqn == 0 && hz != 0){
+				} else {
+					double hzqn = entityList.get(i - 1).getGK03010202000000000000000000() - entityList.get(i - 1).getGK03010202000100020000000000();
+					if (hzqn == 0 && hz != 0) {
 						bl.add("100");
-					}else if(hzqn == 0){
+					} else if (hzqn == 0) {
 						bl.add("0");
-					}else{
-						bl.add(""+(int)((hz-hzqn)/hzqn*100));
+					} else {
+						bl.add("" + (int) ((hz - hzqn) / hzqn * 100));
 					}
 				}
 			}
 		}
-		//获取时间区间
-		for(FlhwttlhjEntity e : entityList){
-			dateList.add("'"+e.gettj_month()+"'");
+		// 获取时间区间
+		for (FlhwttlhjEntity e : entityList) {
+			dateList.add("'" + e.gettj_month() + "'");
 		}
-		model.addAttribute("bl",bl);
+		model.addAttribute("bl", bl);
 		model.addAttribute("ttl", ttl);
 		model.addAttribute("dateList", dateList);
-		model.addAttribute("startDate", startDate);
-		model.addAttribute("endDate", endDate);
+		model.addAttribute("startDate", startDate != null ? startDate : start);
+		model.addAttribute("endDate", endDate != null ? endDate : end);
 		model.addAttribute("zzbl", zzbl);
 		model.addAttribute("tjx", tjx);
 		model.addAttribute("menuid", menuid);

+ 175 - 168
gkjsjy/trunk/src/com/xt/jygl/gkyxtjyfx/hzttltj/ctl/HwttlfxCtl.java

@@ -1,7 +1,8 @@
 package com.xt.jygl.gkyxtjyfx.hzttltj.ctl;
 
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Calendar;
+import java.util.Date;
 import java.util.List;
 
 import javax.persistence.criteria.CriteriaBuilder;
@@ -24,319 +25,325 @@ import com.xtframe.util.StringUtils;
 
 @Controller
 @RequestMapping(value = "/hwttlfx")
-public class HwttlfxCtl extends BaseWebCtl{
+public class HwttlfxCtl extends BaseWebCtl {
 
 	@Autowired
 	private QueryService query;
 	@Autowired
 	private HwttlfxService hwttlfxService;
-	
-	@RequestMapping(value="/main")
-	public String main(Model model,final HttpServletRequest request,String tjx,String zzbl,final String startDate,final String endDate,final String menuid){
 
-		Specification<FlhwttlhjEntity> spec = new Specification<FlhwttlhjEntity>() {
+	@RequestMapping(value = "/main")
+	public String main(Model model, final HttpServletRequest request, String tjx, String zzbl, final String startDate, final String endDate, final String menuid) {
+		String start="";
+		String end="";
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+		Date date1 = new Date();
+		if (StringUtils.isEmpty(startDate)) {
+			start = sdf.format(date1).substring(0, 5) + "01";
+			end = sdf.format(date1);
+		}
 
+		Specification<FlhwttlhjEntity> spec = new Specification<FlhwttlhjEntity>() {
 			@Override
 			public Predicate toPredicate(Root<FlhwttlhjEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
 				List<Predicate> list = new ArrayList<Predicate>();
-				if (StringUtils.isNotEmpty(startDate)&&StringUtils.isNotEmpty(endDate)) {
-					list.add(cb.between(root.get("tj_month").as(String.class), startDate,endDate));
-				}else{
-					Calendar currentDate = Calendar.getInstance();
-					list.add(cb.between(root.get("tj_month").as(String.class), currentDate.get(Calendar.YEAR)+"-01",
-							currentDate.get(Calendar.YEAR)+"-"+currentDate.get(Calendar.MONTH)));
+				if (StringUtils.isNotEmpty(startDate) && StringUtils.isNotEmpty(endDate)) {
+					list.add(cb.between(root.get("tj_month").as(String.class), startDate, endDate));
+				} else {
+					SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+					list.add(cb.between(root.get("tj_month").as(String.class),sdf.format(new Date()).substring(0, 5) + "01",sdf.format(new Date())));
 				}
 				return cb.and(list.toArray(new Predicate[] {}));
 			}
 		};
-		
+
 		List<FlhwttlhjEntity> entityList = query.findAll(spec, FlhwttlhjEntity.class);
-		//吞吐量
+		// 吞吐量
 		List<String> ttl = new ArrayList<String>();
-		//时间区间
+		// 时间区间
 		List<String> dateList = new ArrayList<String>();
-		//比率
+		// 比率
 		List<String> bl = new ArrayList<String>();
 		String[] date;
-		int year,month;
-		//获取吞吐量
-		if(StringUtils.isEmpty(tjx) || tjx.equals("GK03010202000000000000000000")){
-			for(FlhwttlhjEntity e : entityList){
-				ttl.add(e.getGK03010202000000000000000000()+"");
+		int year, month;
+		// 获取吞吐量
+		if (StringUtils.isEmpty(tjx) || tjx.equals("GK03010202000000000000000000")) {
+			for (FlhwttlhjEntity e : entityList) {
+				ttl.add((e.getGK03010202000000000000000000() / 10000) + "");
 			}
-			//比率
-			//同比
-			if(StringUtils.isEmpty(zzbl)||"tb".equals(zzbl)){
-				for(FlhwttlhjEntity e : entityList){
+			// 比率
+			// 同比
+			if (StringUtils.isEmpty(zzbl) || "tb".equals(zzbl)) {
+				for (FlhwttlhjEntity e : entityList) {
 					date = e.gettj_month().split("-");
-					year = Integer.parseInt(date[0])-1;
+					year = Integer.parseInt(date[0]) - 1;
 					month = Integer.parseInt(date[1]);
 					FlhwttlhjEntity temp;
-					//月份补0
-					if(month<10){
-						temp = hwttlfxService.findOne(year+"-0"+month);
-					}else{
-						temp = hwttlfxService.findOne(year+"-"+month);
+					// 月份补0
+					if (month < 10) {
+						temp = hwttlfxService.findOne(year + "-0" + month);
+					} else {
+						temp = hwttlfxService.findOne(year + "-" + month);
 					}
-					if(temp == null || e.getGK03010202000000000000000000() == 0){
+					if (temp == null || e.getGK03010202000000000000000000() == 0) {
 						bl.add("0");
-					}else{
-						bl.add(""+(int)((e.getGK03010202000000000000000000()-temp.getGK03010202000000000000000000())/temp.getGK03010202000000000000000000()*100));
+					} else {
+						bl.add("" + (int) ((e.getGK03010202000000000000000000() - temp.getGK03010202000000000000000000()) / temp.getGK03010202000000000000000000() * 100));
 					}
 				}
-			}else if("hb".equals(zzbl)){
-				for(int i = 0; i < entityList.size(); i++){
-					if(i == 0){
+			} else if ("hb".equals(zzbl)) {
+				for (int i = 0; i < entityList.size(); i++) {
+					if (i == 0) {
 						date = entityList.get(i).gettj_month().split("-");
 						year = Integer.parseInt(date[0]);
 						month = Integer.parseInt(date[1]);
 						FlhwttlhjEntity temp = null;
-						if(month == 1){
+						if (month == 1) {
 							year = year - 1;
 							month = 12;
-						}else{
+						} else {
 							month = month - 1;
-							if(month<10){
-								temp = hwttlfxService.findOne(year+"-0"+month);
-							}else{
-								temp = hwttlfxService.findOne(year+"-"+month);
+							if (month < 10) {
+								temp = hwttlfxService.findOne(year + "-0" + month);
+							} else {
+								temp = hwttlfxService.findOne(year + "-" + month);
 							}
 						}
-						if(temp == null || entityList.get(i).getGK03010202000000000000000000() == 0){
+						if (temp == null || entityList.get(i).getGK03010202000000000000000000() == 0) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000000000000000000()-temp.getGK03010202000000000000000000())/entityList.get(i).getGK03010202000000000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000000000000000000() - temp.getGK03010202000000000000000000()) / entityList.get(i).getGK03010202000000000000000000() * 100));
 						}
-					}else{
-						if(entityList.get(i).getGK03010202000000000000000000() == 0){
+					} else {
+						if (entityList.get(i).getGK03010202000000000000000000() == 0) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000000000000000000()-entityList.get(i-1).getGK03010202000000000000000000())/entityList.get(i).getGK03010202000000000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000000000000000000() - entityList.get(i - 1).getGK03010202000000000000000000()) / entityList.get(i).getGK03010202000000000000000000() * 100));
 						}
 					}
 				}
-			}else{
-				for(int i = 0; i < entityList.size(); i++){
-					if(i == 0){
+			} else {
+				for (int i = 0; i < entityList.size(); i++) {
+					if (i == 0) {
 						date = entityList.get(i).gettj_month().split("-");
 						year = Integer.parseInt(date[0]);
 						month = Integer.parseInt(date[1]);
 						FlhwttlhjEntity temp = null;
-						if(month == 1){
+						if (month == 1) {
 							year = year - 1;
 							month = 12;
-						}else{
+						} else {
 							month = month - 1;
-							if(month<10){
-								temp = hwttlfxService.findOne(year+"-0"+month);
-							}else{
-								temp = hwttlfxService.findOne(year+"-"+month);
+							if (month < 10) {
+								temp = hwttlfxService.findOne(year + "-0" + month);
+							} else {
+								temp = hwttlfxService.findOne(year + "-" + month);
 							}
 						}
-						if(temp == null){
+						if (temp == null) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000000000000000000()-temp.getGK03010202000000000000000000())/temp.getGK03010202000000000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000000000000000000() - temp.getGK03010202000000000000000000()) / temp.getGK03010202000000000000000000() * 100));
 						}
-					}else{
-						if(entityList.get(i-1).getGK03010202000000000000000000() == 0 && entityList.get(i).getGK03010202000000000000000000() != 0){
+					} else {
+						if (entityList.get(i - 1).getGK03010202000000000000000000() == 0 && entityList.get(i).getGK03010202000000000000000000() != 0) {
 							bl.add("100");
-						}else if(entityList.get(i).getGK03010202000000000000000000() == 0){
+						} else if (entityList.get(i).getGK03010202000000000000000000() == 0) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000000000000000000()-entityList.get(i-1).getGK03010202000000000000000000())/entityList.get(i-1).getGK03010202000000000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000000000000000000() - entityList.get(i - 1).getGK03010202000000000000000000()) / entityList.get(i - 1).getGK03010202000000000000000000() * 100));
 						}
 					}
 				}
 			}
-		}else if(tjx.equals("GK03010202000010000000000000")){
-			for(FlhwttlhjEntity e : entityList){
-				ttl.add(e.getGK03010202000010000000000000()+"");
+		} else if (tjx.equals("GK03010202000010000000000000")) {
+			for (FlhwttlhjEntity e : entityList) {
+				ttl.add(e.getGK03010202000010000000000000()/10000 + "");
 			}
-			//比率
-			if(StringUtils.isEmpty(zzbl)||zzbl.equals("tb")){
-				for(FlhwttlhjEntity e : entityList){
+			// 比率
+			if (StringUtils.isEmpty(zzbl) || zzbl.equals("tb")) {
+				for (FlhwttlhjEntity e : entityList) {
 					date = e.gettj_month().split("-");
-					year = Integer.parseInt(date[0])-1;
+					year = Integer.parseInt(date[0]) - 1;
 					month = Integer.parseInt(date[1]);
 					FlhwttlhjEntity temp;
-					if(month<10){
-						temp = hwttlfxService.findOne(year+"-0"+month);
-					}else{
-						temp = hwttlfxService.findOne(year+"-"+month);
+					if (month < 10) {
+						temp = hwttlfxService.findOne(year + "-0" + month);
+					} else {
+						temp = hwttlfxService.findOne(year + "-" + month);
 					}
-					if(temp == null || e.getGK03010202000010000000000000() == 0){
+					if (temp == null || e.getGK03010202000010000000000000() == 0) {
 						bl.add("0");
-					}else{
-						bl.add(""+(int)((e.getGK03010202000010000000000000()-temp.getGK03010202000010000000000000())/temp.getGK03010202000010000000000000()*100));
+					} else {
+						bl.add("" + (int) ((e.getGK03010202000010000000000000() - temp.getGK03010202000010000000000000()) / temp.getGK03010202000010000000000000() * 100));
 					}
 				}
-			}else if("hb".equals(zzbl)){
-				for(int i = 0; i < entityList.size(); i++){
-					if(i == 0){
+			} else if ("hb".equals(zzbl)) {
+				for (int i = 0; i < entityList.size(); i++) {
+					if (i == 0) {
 						date = entityList.get(i).gettj_month().split("-");
 						year = Integer.parseInt(date[0]);
 						month = Integer.parseInt(date[1]);
 						FlhwttlhjEntity temp = null;
-						if(month == 1){
+						if (month == 1) {
 							year = year - 1;
 							month = 12;
-						}else{
+						} else {
 							month = month - 1;
-							if(month<10){
-								temp = hwttlfxService.findOne(year+"-0"+month);
-							}else{
-								temp = hwttlfxService.findOne(year+"-"+month);
+							if (month < 10) {
+								temp = hwttlfxService.findOne(year + "-0" + month);
+							} else {
+								temp = hwttlfxService.findOne(year + "-" + month);
 							}
 						}
-						if(temp == null || entityList.get(i).getGK03010202000010000000000000() == 0){
+						if (temp == null || entityList.get(i).getGK03010202000010000000000000() == 0) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000010000000000000()-temp.getGK03010202000010000000000000())/entityList.get(i).getGK03010202000010000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000010000000000000() - temp.getGK03010202000010000000000000()) / entityList.get(i).getGK03010202000010000000000000() * 100));
 						}
-					}else{
-						if(entityList.get(i).getGK03010202000010000000000000() == 0){
+					} else {
+						if (entityList.get(i).getGK03010202000010000000000000() == 0) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000010000000000000()-entityList.get(i-1).getGK03010202000010000000000000())/entityList.get(i).getGK03010202000010000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000010000000000000() - entityList.get(i - 1).getGK03010202000010000000000000()) / entityList.get(i).getGK03010202000010000000000000() * 100));
 						}
 					}
 				}
-			}else{
-				for(int i = 0; i < entityList.size(); i++){
-					if(i == 0){
+			} else {
+				for (int i = 0; i < entityList.size(); i++) {
+					if (i == 0) {
 						date = entityList.get(i).gettj_month().split("-");
 						year = Integer.parseInt(date[0]);
 						month = Integer.parseInt(date[1]);
 						FlhwttlhjEntity temp = null;
-						if(month == 1){
+						if (month == 1) {
 							year = year - 1;
 							month = 12;
-						}else{
+						} else {
 							month = month - 1;
-							if(month<10){
-								temp = hwttlfxService.findOne(year+"-0"+month);
-							}else{
-								temp = hwttlfxService.findOne(year+"-"+month);
+							if (month < 10) {
+								temp = hwttlfxService.findOne(year + "-0" + month);
+							} else {
+								temp = hwttlfxService.findOne(year + "-" + month);
 							}
 						}
-						if(temp == null){
+						if (temp == null) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000010000000000000()-temp.getGK03010202000010000000000000())/temp.getGK03010202000010000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000010000000000000() - temp.getGK03010202000010000000000000()) / temp.getGK03010202000010000000000000() * 100));
 						}
-					}else{
-						if(entityList.get(i).getGK03010202000010000000000000() != 0 && entityList.get(i-1).getGK03010202000010000000000000() == 0){
+					} else {
+						if (entityList.get(i).getGK03010202000010000000000000() != 0 && entityList.get(i - 1).getGK03010202000010000000000000() == 0) {
 							bl.add("100");
-						}else if(entityList.get(i).getGK03010202000010000000000000() == 0){
+						} else if (entityList.get(i).getGK03010202000010000000000000() == 0) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000010000000000000()-entityList.get(i-1).getGK03010202000010000000000000())/entityList.get(i-1).getGK03010202000010000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000010000000000000() - entityList.get(i - 1).getGK03010202000010000000000000()) / entityList.get(i - 1).getGK03010202000010000000000000() * 100));
 						}
 					}
 				}
 			}
-		}else if(tjx.equals("GK03010202000020000000000000")){
-			for(FlhwttlhjEntity e : entityList){
-				ttl.add(e.getGK03010202000020000000000000()+"");
+		} else if (tjx.equals("GK03010202000020000000000000")) {
+			for (FlhwttlhjEntity e : entityList) {
+				ttl.add(e.getGK03010202000020000000000000()/10000 + "");
 			}
-			//比率
-			if(StringUtils.isEmpty(zzbl)||zzbl.equals("tb")){
-				for(FlhwttlhjEntity e : entityList){
+			// 比率
+			if (StringUtils.isEmpty(zzbl) || zzbl.equals("tb")) {
+				for (FlhwttlhjEntity e : entityList) {
 					date = e.gettj_month().split("-");
-					year = Integer.parseInt(date[0])-1;
+					year = Integer.parseInt(date[0]) - 1;
 					month = Integer.parseInt(date[1]);
 					FlhwttlhjEntity temp;
-					if(month<10){
-						temp = hwttlfxService.findOne(year+"-0"+month);
-					}else{
-						temp = hwttlfxService.findOne(year+"-"+month);
+					if (month < 10) {
+						temp = hwttlfxService.findOne(year + "-0" + month);
+					} else {
+						temp = hwttlfxService.findOne(year + "-" + month);
 					}
-					if(temp == null || e.getGK03010202000020000000000000() == 0){
+					if (temp == null || e.getGK03010202000020000000000000() == 0) {
 						bl.add("0");
-					}else{
-						bl.add(""+(int)((e.getGK03010202000020000000000000()-temp.getGK03010202000020000000000000())/temp.getGK03010202000020000000000000()*100));
+					} else {
+						bl.add("" + (int) ((e.getGK03010202000020000000000000() - temp.getGK03010202000020000000000000()) / temp.getGK03010202000020000000000000() * 100));
 					}
 				}
-			}else if("hb".equals(zzbl)){
-				for(int i = 0; i < entityList.size(); i++){
-					if(i == 0){
+			} else if ("hb".equals(zzbl)) {
+				for (int i = 0; i < entityList.size(); i++) {
+					if (i == 0) {
 						date = entityList.get(i).gettj_month().split("-");
 						year = Integer.parseInt(date[0]);
 						month = Integer.parseInt(date[1]);
 						FlhwttlhjEntity temp = null;
-						if(month == 1){
+						if (month == 1) {
 							year = year - 1;
 							month = 12;
-						}else{
+						} else {
 							month = month - 1;
-							if(month<10){
-								temp = hwttlfxService.findOne(year+"-0"+month);
-							}else{
-								temp = hwttlfxService.findOne(year+"-"+month);
+							if (month < 10) {
+								temp = hwttlfxService.findOne(year + "-0" + month);
+							} else {
+								temp = hwttlfxService.findOne(year + "-" + month);
 							}
 						}
-						if(temp == null || entityList.get(i).getGK03010202000020000000000000() == 0){
+						if (temp == null || entityList.get(i).getGK03010202000020000000000000() == 0) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000020000000000000()-temp.getGK03010202000020000000000000())/entityList.get(i).getGK03010202000020000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000020000000000000() - temp.getGK03010202000020000000000000()) / entityList.get(i).getGK03010202000020000000000000() * 100));
 						}
-					}else{
-						if(entityList.get(i).getGK03010202000020000000000000()==0){
+					} else {
+						if (entityList.get(i).getGK03010202000020000000000000() == 0) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000020000000000000()-entityList.get(i-1).getGK03010202000020000000000000())/entityList.get(i).getGK03010202000020000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000020000000000000() - entityList.get(i - 1).getGK03010202000020000000000000()) / entityList.get(i).getGK03010202000020000000000000() * 100));
 						}
 					}
 				}
-			}else{
-				for(int i = 0; i < entityList.size(); i++){
-					if(i == 0){
+			} else {
+				for (int i = 0; i < entityList.size(); i++) {
+					if (i == 0) {
 						date = entityList.get(i).gettj_month().split("-");
 						year = Integer.parseInt(date[0]);
 						month = Integer.parseInt(date[1]);
 						FlhwttlhjEntity temp = null;
-						if(month == 1){
+						if (month == 1) {
 							year = year - 1;
 							month = 12;
-						}else{
+						} else {
 							month = month - 1;
-							if(month<10){
-								temp = hwttlfxService.findOne(year+"-0"+month);
-							}else{
-								temp = hwttlfxService.findOne(year+"-"+month);
+							if (month < 10) {
+								temp = hwttlfxService.findOne(year + "-0" + month);
+							} else {
+								temp = hwttlfxService.findOne(year + "-" + month);
 							}
 						}
-						if(temp == null){
+						if (temp == null) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000020000000000000()-temp.getGK03010202000020000000000000())/temp.getGK03010202000020000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000020000000000000() - temp.getGK03010202000020000000000000()) / temp.getGK03010202000020000000000000() * 100));
 						}
-					}else{
-						if(entityList.get(i).getGK03010202000020000000000000() != 0 && entityList.get(i-1).getGK03010202000020000000000000() == 0){
+					} else {
+						if (entityList.get(i).getGK03010202000020000000000000() != 0 && entityList.get(i - 1).getGK03010202000020000000000000() == 0) {
 							bl.add("100");
-						}else if(entityList.get(i).getGK03010202000020000000000000() == 0){
+						} else if (entityList.get(i).getGK03010202000020000000000000() == 0) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000020000000000000()-entityList.get(i-1).getGK03010202000020000000000000())/entityList.get(i-1).getGK03010202000020000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000020000000000000() - entityList.get(i - 1).getGK03010202000020000000000000()) / entityList.get(i - 1).getGK03010202000020000000000000() * 100));
 						}
 					}
 				}
 			}
 		}
-		//获取时间区间
-		for(FlhwttlhjEntity e : entityList){
-			dateList.add("'"+e.gettj_month()+"'");
+		// 获取时间区间
+		for (FlhwttlhjEntity e : entityList) {
+			dateList.add("'" + e.gettj_month() + "'");
 		}
-		model.addAttribute("bl",bl);
+		model.addAttribute("bl", bl);
 		model.addAttribute("ttl", ttl);
 		model.addAttribute("dateList", dateList);
-		model.addAttribute("startDate", startDate);
-		model.addAttribute("endDate", endDate);
+		model.addAttribute("startDate", startDate != null ? startDate : start);
+		model.addAttribute("endDate", endDate != null ? endDate : end);
 		model.addAttribute("zzbl", zzbl);
 		model.addAttribute("tjx", tjx);
 		model.addAttribute("menuid", menuid);
 		return "gkyxtjyfx/gkhwttlfx/gkhwttlfx";
 	}
-	
+
 }

+ 2 - 1
gkjsjy/trunk/src/com/xt/jygl/gkyxtjyfx/hzttltj/ctl/HzttltjCtl.java

@@ -159,8 +159,8 @@ public class HzttltjCtl extends BaseWebCtl {
 					BigDecimal c = new BigDecimal(0.0000);
 					HzttlVo vo = new HzttlVo();
 					vo.setTjmonth(month);
-					vo.setTtl(e[id].toString());
 					a = (BigDecimal) e[id];
+					vo.setTtl(a.divide(new BigDecimal(10000),4,BigDecimal.ROUND_HALF_EVEN).toString());
 					if (a.compareTo(new BigDecimal(0)) > 0) {
 						// 环比
 						Object[] hbhzttl = (Object[]) hzttlService.findBytjmonth(ymonth);
@@ -194,6 +194,7 @@ public class HzttltjCtl extends BaseWebCtl {
 							s = (BigDecimal) sum[j];
 						}
 						BigDecimal ss = (BigDecimal) e[j];
+						ss =ss.divide(new BigDecimal(10000),4,BigDecimal.ROUND_HALF_EVEN);
 						s = s.add(ss);
 						sum[j] = s;
 					}

+ 1 - 1
gkjsjy/trunk/src/com/xt/jygl/gkyxtjyfx/hzttltj/ctl/JzxttltjCtl.java

@@ -72,8 +72,8 @@ public class JzxttltjCtl extends BaseWebCtl {
 					HzttlVo vo = new HzttlVo();
 					vo.setTjmonth(month);
 					if(e[id] != null && !"".equals(e[id])){
-						vo.setTtl(e[id].toString());
 						a = (BigDecimal) e[id];
+						vo.setTtl(a.divide(new BigDecimal(10000),4,BigDecimal.ROUND_HALF_EVEN).toString());
 					}else{
 						vo.setTtl("0");
 					}

+ 167 - 160
gkjsjy/trunk/src/com/xt/jygl/gkyxtjyfx/hzttltj/ctl/WmhwttlfxCtl.java

@@ -1,7 +1,8 @@
 package com.xt.jygl.gkyxtjyfx.hzttltj.ctl;
 
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Calendar;
+import java.util.Date;
 import java.util.List;
 
 import javax.persistence.criteria.CriteriaBuilder;
@@ -24,308 +25,314 @@ import com.xtframe.util.StringUtils;
 
 @Controller
 @RequestMapping(value = "/wmhwttlfx")
-public class WmhwttlfxCtl extends BaseWebCtl{
+public class WmhwttlfxCtl extends BaseWebCtl {
 
 	@Autowired
 	private QueryService query;
 	@Autowired
 	private HwttlfxService hwttlfxService;
-	
-	@RequestMapping(value="/main")
-	public String main(Model model,final HttpServletRequest request,String tjx,String zzbl,final String startDate,final String endDate,final String menuid){
 
+	@RequestMapping(value = "/main")
+	public String main(Model model, final HttpServletRequest request, String tjx, String zzbl, final String startDate, final String endDate, final String menuid) {
+		String start="";
+		String end="";
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+		Date date1 = new Date();
+		if (StringUtils.isEmpty(startDate)) {
+			start = sdf.format(date1).substring(0, 5) + "01";
+			end = sdf.format(date1);
+		}
 		Specification<FlhwttlhjEntity> spec = new Specification<FlhwttlhjEntity>() {
 
 			@Override
 			public Predicate toPredicate(Root<FlhwttlhjEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
 				List<Predicate> list = new ArrayList<Predicate>();
-				if (StringUtils.isNotEmpty(startDate)&&StringUtils.isNotEmpty(endDate)) {
-					list.add(cb.between(root.get("tj_month").as(String.class), startDate,endDate));
-				}else{
-					Calendar currentDate = Calendar.getInstance();
-					list.add(cb.between(root.get("tj_month").as(String.class), currentDate.get(Calendar.YEAR)+"-01",
-							currentDate.get(Calendar.YEAR)+"-"+currentDate.get(Calendar.MONTH)));
+				if (StringUtils.isNotEmpty(startDate) && StringUtils.isNotEmpty(endDate)) {
+					list.add(cb.between(root.get("tj_month").as(String.class), startDate, endDate));
+				} else {
+					SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+					list.add(cb.between(root.get("tj_month").as(String.class),sdf.format(new Date()).substring(0, 5) + "01",sdf.format(new Date())));
 				}
 				return cb.and(list.toArray(new Predicate[] {}));
 			}
 		};
-		
+
 		List<FlhwttlhjEntity> entityList = query.findAll(spec, FlhwttlhjEntity.class);
-		//吞吐量
+		// 吞吐量
 		List<String> ttl = new ArrayList<String>();
-		//时间区间
+		// 时间区间
 		List<String> dateList = new ArrayList<String>();
-		//比率
+		// 比率
 		List<String> bl = new ArrayList<String>();
 		String[] date;
-		int year,month;
-		//获取吞吐量
-		if(StringUtils.isEmpty(tjx) || tjx.equals("GK03010202000001000000000000")){
-			for(FlhwttlhjEntity e : entityList){
-				ttl.add(e.getGK03010202000001000000000000()+"");
+		int year, month;
+		// 获取吞吐量
+		if (StringUtils.isEmpty(tjx) || tjx.equals("GK03010202000001000000000000")) {
+			for (FlhwttlhjEntity e : entityList) {
+				ttl.add(e.getGK03010202000001000000000000() / 10000 + "");
 			}
-			//比率
-			//同比
-			if(StringUtils.isEmpty(zzbl)||"tb".equals(zzbl)){
-				for(FlhwttlhjEntity e : entityList){
+			// 比率
+			// 同比
+			if (StringUtils.isEmpty(zzbl) || "tb".equals(zzbl)) {
+				for (FlhwttlhjEntity e : entityList) {
 					date = e.gettj_month().split("-");
-					year = Integer.parseInt(date[0])-1;
+					year = Integer.parseInt(date[0]) - 1;
 					month = Integer.parseInt(date[1]);
 					FlhwttlhjEntity temp;
-					if(month<10){
-						temp = hwttlfxService.findOne(year+"-0"+month);
-					}else{
-						temp = hwttlfxService.findOne(year+"-"+month);
+					if (month < 10) {
+						temp = hwttlfxService.findOne(year + "-0" + month);
+					} else {
+						temp = hwttlfxService.findOne(year + "-" + month);
 					}
-					if(temp == null || e.getGK03010202000001000000000000() == 0){
+					if (temp == null || e.getGK03010202000001000000000000() == 0) {
 						bl.add("0");
-					}else{
-						bl.add(""+(int)((e.getGK03010202000001000000000000()-temp.getGK03010202000001000000000000())/temp.getGK03010202000001000000000000()*100));
+					} else {
+						bl.add("" + (int) ((e.getGK03010202000001000000000000() - temp.getGK03010202000001000000000000()) / temp.getGK03010202000001000000000000() * 100));
 					}
 				}
-			}else if("hb".equals(zzbl)){
-				for(int i = 0; i < entityList.size(); i++){
-					if(i == 0){
+			} else if ("hb".equals(zzbl)) {
+				for (int i = 0; i < entityList.size(); i++) {
+					if (i == 0) {
 						date = entityList.get(i).gettj_month().split("-");
 						year = Integer.parseInt(date[0]);
 						month = Integer.parseInt(date[1]);
 						FlhwttlhjEntity temp = null;
-						if(month == 1){
+						if (month == 1) {
 							year = year - 1;
 							month = 12;
-						}else{
+						} else {
 							month = month - 1;
-							if(month<10){
-								temp = hwttlfxService.findOne(year+"-0"+month);
-							}else{
-								temp = hwttlfxService.findOne(year+"-"+month);
+							if (month < 10) {
+								temp = hwttlfxService.findOne(year + "-0" + month);
+							} else {
+								temp = hwttlfxService.findOne(year + "-" + month);
 							}
 						}
-						if(temp == null || entityList.get(i).getGK03010202000001000000000000() == 0){
+						if (temp == null || entityList.get(i).getGK03010202000001000000000000() == 0) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000001000000000000()-temp.getGK03010202000001000000000000())/entityList.get(i).getGK03010202000001000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000001000000000000() - temp.getGK03010202000001000000000000()) / entityList.get(i).getGK03010202000001000000000000() * 100));
 						}
-					}else{
-						if(entityList.get(i).getGK03010202000001000000000000() == 0){
+					} else {
+						if (entityList.get(i).getGK03010202000001000000000000() == 0) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000001000000000000()-entityList.get(i-1).getGK03010202000001000000000000())/entityList.get(i).getGK03010202000001000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000001000000000000() - entityList.get(i - 1).getGK03010202000001000000000000()) / entityList.get(i).getGK03010202000001000000000000() * 100));
 						}
 					}
 				}
-			}else{
-				for(int i = 0; i < entityList.size(); i++){
-					if(i == 0){
+			} else {
+				for (int i = 0; i < entityList.size(); i++) {
+					if (i == 0) {
 						date = entityList.get(i).gettj_month().split("-");
 						year = Integer.parseInt(date[0]);
 						month = Integer.parseInt(date[1]);
 						FlhwttlhjEntity temp = null;
-						if(month == 1){
+						if (month == 1) {
 							year = year - 1;
 							month = 12;
-						}else{
+						} else {
 							month = month - 1;
-							if(month<10){
-								temp = hwttlfxService.findOne(year+"-0"+month);
-							}else{
-								temp = hwttlfxService.findOne(year+"-"+month);
+							if (month < 10) {
+								temp = hwttlfxService.findOne(year + "-0" + month);
+							} else {
+								temp = hwttlfxService.findOne(year + "-" + month);
 							}
 						}
-						if(temp == null){
+						if (temp == null) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000001000000000000()-temp.getGK03010202000001000000000000())/temp.getGK03010202000001000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000001000000000000() - temp.getGK03010202000001000000000000()) / temp.getGK03010202000001000000000000() * 100));
 						}
-					}else{
-						if(entityList.get(i-1).getGK03010202000001000000000000() == 0 && entityList.get(i).getGK03010202000001000000000000() != 0){
+					} else {
+						if (entityList.get(i - 1).getGK03010202000001000000000000() == 0 && entityList.get(i).getGK03010202000001000000000000() != 0) {
 							bl.add("100");
-						}else if(entityList.get(i).getGK03010202000001000000000000() == 0){
+						} else if (entityList.get(i).getGK03010202000001000000000000() == 0) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000001000000000000()-entityList.get(i-1).getGK03010202000001000000000000())/entityList.get(i-1).getGK03010202000001000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000001000000000000() - entityList.get(i - 1).getGK03010202000001000000000000()) / entityList.get(i - 1).getGK03010202000001000000000000() * 100));
 						}
 					}
 				}
 			}
-		}else if(tjx.equals("GK03010202000021000000000000")){
-			for(FlhwttlhjEntity e : entityList){
-				ttl.add(e.getGK03010202000021000000000000()+"");
+		} else if (tjx.equals("GK03010202000021000000000000")) {
+			for (FlhwttlhjEntity e : entityList) {
+				ttl.add(e.getGK03010202000021000000000000() / 10000 + "");
 			}
-			//比率
-			if(StringUtils.isEmpty(zzbl)||zzbl.equals("tb")){
-				for(FlhwttlhjEntity e : entityList){
+			// 比率
+			if (StringUtils.isEmpty(zzbl) || zzbl.equals("tb")) {
+				for (FlhwttlhjEntity e : entityList) {
 					date = e.gettj_month().split("-");
-					year = Integer.parseInt(date[0])-1;
+					year = Integer.parseInt(date[0]) - 1;
 					month = Integer.parseInt(date[1]);
-					FlhwttlhjEntity temp = hwttlfxService.findOne(year+"-"+month);
-					if(temp == null || e.getGK03010202000021000000000000() == 0){
+					FlhwttlhjEntity temp = hwttlfxService.findOne(year + "-" + month);
+					if (temp == null || e.getGK03010202000021000000000000() == 0) {
 						bl.add("0");
-					}else{
-						bl.add(""+(int)((e.getGK03010202000021000000000000()-temp.getGK03010202000021000000000000())/temp.getGK03010202000021000000000000()*100));
+					} else {
+						bl.add("" + (int) ((e.getGK03010202000021000000000000() - temp.getGK03010202000021000000000000()) / temp.getGK03010202000021000000000000() * 100));
 					}
 				}
-			}else if("hb".equals(zzbl)){
-				for(int i = 0; i < entityList.size(); i++){
-					if(i == 0){
+			} else if ("hb".equals(zzbl)) {
+				for (int i = 0; i < entityList.size(); i++) {
+					if (i == 0) {
 						date = entityList.get(i).gettj_month().split("-");
 						year = Integer.parseInt(date[0]);
 						month = Integer.parseInt(date[1]);
 						FlhwttlhjEntity temp = null;
-						if(month == 1){
+						if (month == 1) {
 							year = year - 1;
 							month = 12;
-						}else{
+						} else {
 							month = month - 1;
-							if(month<10){
-								temp = hwttlfxService.findOne(year+"-0"+month);
-							}else{
-								temp = hwttlfxService.findOne(year+"-"+month);
+							if (month < 10) {
+								temp = hwttlfxService.findOne(year + "-0" + month);
+							} else {
+								temp = hwttlfxService.findOne(year + "-" + month);
 							}
 						}
-						if(temp == null || entityList.get(i).getGK03010202000021000000000000() == 0){
+						if (temp == null || entityList.get(i).getGK03010202000021000000000000() == 0) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000021000000000000()-temp.getGK03010202000021000000000000())/entityList.get(i).getGK03010202000021000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000021000000000000() - temp.getGK03010202000021000000000000()) / entityList.get(i).getGK03010202000021000000000000() * 100));
 						}
-					}else{
-						if(entityList.get(i).getGK03010202000021000000000000() == 0){
+					} else {
+						if (entityList.get(i).getGK03010202000021000000000000() == 0) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000021000000000000()-entityList.get(i-1).getGK03010202000021000000000000())/entityList.get(i).getGK03010202000021000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000021000000000000() - entityList.get(i - 1).getGK03010202000021000000000000()) / entityList.get(i).getGK03010202000021000000000000() * 100));
 						}
 					}
 				}
-			}else{
-				for(int i = 0; i < entityList.size(); i++){
-					if(i == 0){
+			} else {
+				for (int i = 0; i < entityList.size(); i++) {
+					if (i == 0) {
 						date = entityList.get(i).gettj_month().split("-");
 						year = Integer.parseInt(date[0]);
 						month = Integer.parseInt(date[1]);
 						FlhwttlhjEntity temp = null;
-						if(month == 1){
+						if (month == 1) {
 							year = year - 1;
 							month = 12;
-						}else{
+						} else {
 							month = month - 1;
-							if(month<10){
-								temp = hwttlfxService.findOne(year+"-0"+month);
-							}else{
-								temp = hwttlfxService.findOne(year+"-"+month);
+							if (month < 10) {
+								temp = hwttlfxService.findOne(year + "-0" + month);
+							} else {
+								temp = hwttlfxService.findOne(year + "-" + month);
 							}
 						}
-						if(temp == null){
+						if (temp == null) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000021000000000000()-temp.getGK03010202000021000000000000())/temp.getGK03010202000021000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000021000000000000() - temp.getGK03010202000021000000000000()) / temp.getGK03010202000021000000000000() * 100));
 						}
-					}else{
-						if(entityList.get(i-1).getGK03010202000021000000000000() == 0 && entityList.get(i).getGK03010202000021000000000000() != 0){
+					} else {
+						if (entityList.get(i - 1).getGK03010202000021000000000000() == 0 && entityList.get(i).getGK03010202000021000000000000() != 0) {
 							bl.add("100");
-						}else if(entityList.get(i).getGK03010202000021000000000000() == 0){
+						} else if (entityList.get(i).getGK03010202000021000000000000() == 0) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000021000000000000()-entityList.get(i-1).getGK03010202000021000000000000())/entityList.get(i-1).getGK03010202000021000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000021000000000000() - entityList.get(i - 1).getGK03010202000021000000000000()) / entityList.get(i - 1).getGK03010202000021000000000000() * 100));
 						}
 					}
 				}
 			}
-		}else if(tjx.equals("GK03010202000011000000000000")){
-			for(FlhwttlhjEntity e : entityList){
-				ttl.add(e.getGK03010202000011000000000000()+"");
+		} else if (tjx.equals("GK03010202000011000000000000")) {
+			for (FlhwttlhjEntity e : entityList) {
+				ttl.add(e.getGK03010202000011000000000000() / 10000 + "");
 			}
-			//比率
-			if(StringUtils.isEmpty(zzbl)||zzbl.equals("tb")){
-				for(FlhwttlhjEntity e : entityList){
+			// 比率
+			if (StringUtils.isEmpty(zzbl) || zzbl.equals("tb")) {
+				for (FlhwttlhjEntity e : entityList) {
 					date = e.gettj_month().split("-");
-					year = Integer.parseInt(date[0])-1;
+					year = Integer.parseInt(date[0]) - 1;
 					month = Integer.parseInt(date[1]);
-					FlhwttlhjEntity temp = hwttlfxService.findOne(year+"-"+month);
-					if(temp == null || e.getGK03010202000011000000000000() == 0){
+					FlhwttlhjEntity temp = hwttlfxService.findOne(year + "-" + month);
+					if (temp == null || e.getGK03010202000011000000000000() == 0) {
 						bl.add("0");
-					}else{
-						bl.add(""+(int)((e.getGK03010202000011000000000000()-temp.getGK03010202000011000000000000())/temp.getGK03010202000011000000000000()*100));
+					} else {
+						bl.add("" + (int) ((e.getGK03010202000011000000000000() - temp.getGK03010202000011000000000000()) / temp.getGK03010202000011000000000000() * 100));
 					}
 				}
-			}else if("hb".equals(zzbl)){
-				for(int i = 0; i < entityList.size(); i++){
-					if(i == 0){
+			} else if ("hb".equals(zzbl)) {
+				for (int i = 0; i < entityList.size(); i++) {
+					if (i == 0) {
 						date = entityList.get(i).gettj_month().split("-");
 						year = Integer.parseInt(date[0]);
 						month = Integer.parseInt(date[1]);
 						FlhwttlhjEntity temp = null;
-						if(month == 1){
+						if (month == 1) {
 							year = year - 1;
 							month = 12;
-						}else{
+						} else {
 							month = month - 1;
-							if(month<10){
-								temp = hwttlfxService.findOne(year+"-0"+month);
-							}else{
-								temp = hwttlfxService.findOne(year+"-"+month);
+							if (month < 10) {
+								temp = hwttlfxService.findOne(year + "-0" + month);
+							} else {
+								temp = hwttlfxService.findOne(year + "-" + month);
 							}
 						}
-						if(temp == null || entityList.get(i).getGK03010202000011000000000000() == 0){
+						if (temp == null || entityList.get(i).getGK03010202000011000000000000() == 0) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000011000000000000()-temp.getGK03010202000011000000000000())/entityList.get(i).getGK03010202000011000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000011000000000000() - temp.getGK03010202000011000000000000()) / entityList.get(i).getGK03010202000011000000000000() * 100));
 						}
-					}else{
-						if(entityList.get(i).getGK03010202000011000000000000()==0){
+					} else {
+						if (entityList.get(i).getGK03010202000011000000000000() == 0) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000011000000000000()-entityList.get(i-1).getGK03010202000011000000000000())/entityList.get(i).getGK03010202000011000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000011000000000000() - entityList.get(i - 1).getGK03010202000011000000000000()) / entityList.get(i).getGK03010202000011000000000000() * 100));
 						}
 					}
 				}
-			}else{
-				for(int i = 0; i < entityList.size(); i++){
-					if(i == 0){
+			} else {
+				for (int i = 0; i < entityList.size(); i++) {
+					if (i == 0) {
 						date = entityList.get(i).gettj_month().split("-");
 						year = Integer.parseInt(date[0]);
 						month = Integer.parseInt(date[1]);
 						FlhwttlhjEntity temp = null;
-						if(month == 1){
+						if (month == 1) {
 							year = year - 1;
 							month = 12;
-						}else{
+						} else {
 							month = month - 1;
-							if(month<10){
-								temp = hwttlfxService.findOne(year+"-0"+month);
-							}else{
-								temp = hwttlfxService.findOne(year+"-"+month);
+							if (month < 10) {
+								temp = hwttlfxService.findOne(year + "-0" + month);
+							} else {
+								temp = hwttlfxService.findOne(year + "-" + month);
 							}
 						}
-						if(temp == null){
+						if (temp == null) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000011000000000000()-temp.getGK03010202000011000000000000())/temp.getGK03010202000011000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000011000000000000() - temp.getGK03010202000011000000000000()) / temp.getGK03010202000011000000000000() * 100));
 						}
-					}else{
-						if(entityList.get(i-1).getGK03010202000011000000000000() == 0 && entityList.get(i).getGK03010202000011000000000000() != 0){
+					} else {
+						if (entityList.get(i - 1).getGK03010202000011000000000000() == 0 && entityList.get(i).getGK03010202000011000000000000() != 0) {
 							bl.add("100");
-						}else if(entityList.get(i).getGK03010202000011000000000000() == 0){
+						} else if (entityList.get(i).getGK03010202000011000000000000() == 0) {
 							bl.add("0");
-						}else{
-							bl.add(""+(int)((entityList.get(i).getGK03010202000011000000000000()-entityList.get(i-1).getGK03010202000011000000000000())/entityList.get(i-1).getGK03010202000011000000000000()*100));
+						} else {
+							bl.add("" + (int) ((entityList.get(i).getGK03010202000011000000000000() - entityList.get(i - 1).getGK03010202000011000000000000()) / entityList.get(i - 1).getGK03010202000011000000000000() * 100));
 						}
 					}
 				}
 			}
 		}
-		//获取时间区间
-		for(FlhwttlhjEntity e : entityList){
-			dateList.add("'"+e.gettj_month()+"'");
+		// 获取时间区间
+		for (FlhwttlhjEntity e : entityList) {
+			dateList.add("'" + e.gettj_month() + "'");
 		}
-		model.addAttribute("bl",bl);
+		model.addAttribute("bl", bl);
 		model.addAttribute("ttl", ttl);
 		model.addAttribute("dateList", dateList);
-		model.addAttribute("startDate", startDate);
-		model.addAttribute("endDate", endDate);
+		model.addAttribute("startDate", startDate != null ? startDate : start);
+		model.addAttribute("endDate", endDate != null ? endDate : end);
 		model.addAttribute("zzbl", zzbl);
 		model.addAttribute("tjx", tjx);
 		model.addAttribute("menuid", menuid);
 		return "gkyxtjyfx/gkhwttlfx/wmhwttlfx";
 	}
-	
+
 }