Procházet zdrojové kódy

添加月考核重算
修改打印问题

luobo před 4 roky
rodič
revize
cb32da0cb5

+ 1 - 1
WebContent/WEB-INF/view/base/base-section-edit.jsp

@@ -34,7 +34,7 @@
 		<tr>
 			<td><span class="star">*</span>区段:</td>
 			<td><input type="text" name="section" value='${bs.section!""}' datatype="n" style="width: 50%"/></td>
-			<td><span class="star">*</span>加价水价:</td>
+			<td><span class="star">*</span>加价比例:</td>
 			<td><input type="text" name="progressivesPrice" value='${bs.progressivesPrice!""}' datatype="*" style="width: 50%"/></td>
 
 		</tr>

+ 2 - 2
WebContent/WEB-INF/view/base/punishment-section-edit.jsp

@@ -176,7 +176,7 @@ $(function($){
 				<tr>
 					<td width="150"><span class="star">*</span>考核区间类别:</td>
 					<td><select name="sectionType"
-						data='{"list":[{"value":"quarter","key":"季度考核"},{"value":"month","key":"月考核"},{"value":"yearhf","key":"半年考核"}]}'
+						data='{"list":[{"value":"month","key":"月考核"}]}'
 						selectedValue='${bps.sectionType!""}'></select></td>
 				</tr>
 				<tr>
@@ -219,7 +219,7 @@ $(function($){
 					<td width="23%">结束区间(%)</td>
 					<td width="5%">是否包含开始</td>
 					<td width="5%">是否包含结束</td>
-					<td width="20%">加价水价</td>
+					<td width="20%">加价比例</td>
 				</tr>
 				
 				[#if baseSectionList??]

+ 1 - 1
WebContent/WEB-INF/view/base/punishment-section-list.jsp

@@ -136,7 +136,7 @@ margin:5px 0px 5px 20px;
 			       	                			  return "是";
 			       	                     }	
 		        					}, 
-		        					{ display: '加价水价', name: 'progressivesPrice', 	align: 'center',width: "10%"},
+		        					{ display: '加价比例', name: 'progressivesPrice', 	align: 'center',width: "10%"},
 		        					{ display: '创建人', name: 'userName', 	align: 'center',width: "12%"},
 		        					{ display: '创建时间', name: 'createTime', 	align: 'center',width: "10%"},
 		        					 { display: '操作', isAllowHide: false, align: 'center', width:"13%",

+ 20 - 0
WebContent/WEB-INF/view/bus/month-assessment-list.jsp

@@ -177,6 +177,10 @@
                 {line:true},
                 {text:'导出',click:exportExcel, iconClass:'icon_export'},
         </@pop_perm>
+            <@pop_perm url="/monthAssessment/recalculation.do">
+                {line:true},
+                {text:'重算',click:recalculation, iconClass:'icon_export'}
+        </@pop_perm>
         //     <@pop_perm url="/monthAssessment/print.do">
         //         {line:true},
         //         {text:'开发票',click:invoice, iconClass:'icon_export'},
@@ -567,6 +571,22 @@
         function clearArray(){
             checkedArray.length=0;
         }
+        function recalculation() {
+            var year=$("#year").val();
+            var month=$('#month').val();
+            var url="${ctx}/monthAssessment/print.do?";
+            url +="year="+year;
+            url +="&month="+month;
+            $.post("${ctx}/monthAssessment/recalculation.do",
+                {
+                    "year":year,
+                    "month":month
+                },
+                function(result){
+                    top.Dialog.alert("请求已发送!");
+                },"json");
+
+        }
     </script>
 
 </head>

+ 47 - 203
WebContent/WEB-INF/view/bus/org-email-view.jsp

@@ -1,214 +1,58 @@
-[#ftl]
+
 <!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>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>信封</title>
 <script type="text/javascript" src="${ctx}/qui/libs/js/jquery.js"></script>
-<script type="text/javascript" src="${ctx}/js/LodopFuncs.js"></script>
-</head>
-<script type="text/javascript" language="JavaScript">
-var org = ${orgList};
-var step = org.length;
-var LODOP;
-$(window).load(function(){
-	printView();
-});
+    <style media=print type="text/css">
+        .noprint {
+            display: none;
+        }
+    </style>
+
+    <style type="text/css">
+
+        table {
+            border-right: 1px solid #cccccc;
+            border-bottom: 1px solid #cccccc
+        }
 
-function printView(){
-	LODOP = getLodop();
-	LODOP.PRINT_INITA(-17,-13,793,1061,"reply_email");
-	LODOP.SET_PRINT_PAGESIZE(1,"212mm","281mm","");
-	for(var i=0;i<step;i+=12){
-		LODOP.NewPage();
-		LODOP.ADD_PRINT_SETUP_BKIMG("<img border='0' src='${ctx}/image/notices/reply_email.png'>");
-		LODOP.SET_SHOW_MODE("BKIMG_IN_PREVIEW",true);
-		createprint(i);
-	}
-	window.close();
-	LODOP.PREVIEW();
-};
-function createprint(i){
+        table th {
+            border-left: 1px solid #cccccc;
+            border-top: 1px solid #cccccc
+        }
+
+        table td {
+            border-left: 1px solid #cccccc;
+            border-top: 1px solid #cccccc
+        }
+        .left{
+            width: 50%;
+        }
+        .right{
+            width: 50%;
+        }
+    </style>
+    <script type="text/javascript">
+        function doPrint() {
+            window.print();
+        }
+    </script>
+
+</head>
 
-    LODOP.ADD_PRINT_TEXTA("text01"+i,124,125,220,25,org[i].codeNum);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text02"+i,165,188,215,25,org[i].orgName);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text03"+i,207,188,215,25,org[i].address);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text04"+i,246,357,65,25,i+1);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	if(i+1>step-1){
-		return;
-	}
-	LODOP.ADD_PRINT_TEXTA("text05"+i,124,449,220,25,org[i+1].codeNum);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text06"+i,165,507,215,25,org[i+1].orgName);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text07"+i,207,507,215,25,org[i+1].address);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text08"+i,246,670,65,25,i+2);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5); 
-	if(i+2>step-1){
-		return;
-	}
-	LODOP.ADD_PRINT_TEXTA("text09"+i,270,125,220,25,org[i+2].codeNum);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text10"+i,312,188,215,25,org[i+2].orgName);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text11"+i,354,188,215,25,org[i+2].address);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text12"+i,394,357,65,25,i+3);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	if(i+3>step-1){
-		return;
-	}
-	LODOP.ADD_PRINT_TEXTA("text13"+i,270,449,220,25,org[i+3].codeNum);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text14"+i,312,507,215,25,org[i+3].orgName);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text15"+i,354,507,215,25,org[i+3].address);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text16"+i,394,670,65,25,i+4);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5); 
-	if(i+4>step-1){
-		return;
-	}
-	LODOP.ADD_PRINT_TEXTA("text17"+i,417,125,220,25,org[i+4].codeNum);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text18"+i,459,188,215,25,org[i+4].orgName);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text19"+i,501,188,215,25,org[i+4].address);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text20"+i,542,357,65,25,i+5);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	if(i+5>step-1){
-		return;
-	}
-	LODOP.ADD_PRINT_TEXTA("text21"+i,417,449,220,25,org[i+5].codeNum);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text22"+i,459,507,215,25,org[i+5].orgName);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text23"+i,501,507,215,25,org[i+5].address);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text24"+i,542,670,65,25,i+6);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5); 
-	if(i+6>step-1){
-		return;
-	}
-	LODOP.ADD_PRINT_TEXTA("text25"+i,564,125,220,25,org[i+6].codeNum);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text25"+i,605,188,215,25,org[i+6].orgName);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text27"+i,647,188,215,25,org[i+6].address);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text28"+i,687,357,65,25,i+7);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	if(i+7>step-1){
-		return;
-	}
-	LODOP.ADD_PRINT_TEXTA("text29"+i,564,449,220,25,org[i+7].codeNum);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text30"+i,605,507,215,25,org[i+7].orgName);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text31"+i,647,507,215,25,org[i+7].address);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text32"+i,687,670,65,25,i+8);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5); 
-	if(i+8>step-1){
-		return;
-	}
-	LODOP.ADD_PRINT_TEXTA("text3"+i,710,125,220,25,org[i+8].codeNum);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text4"+i,751,188,215,25,org[i+8].orgName);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text5"+i,793,188,215,25,org[i+8].address);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text6"+i,832,357,65,25,i+9);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	if(i+9>step-1){
-		return;
-	}
-	LODOP.ADD_PRINT_TEXTA("text7"+i,710,449,220,25,org[i+9].codeNum);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text8"+i,751,507,215,25,org[i+9].orgName);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text9"+i,793,507,215,25,org[i+9].address);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text0"+i,832,670,65,25,i+10);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5); 
-	if(i+10>step-1){
-		return;
-	}
-	LODOP.ADD_PRINT_TEXTA("text1"+i,856,125,220,25,org[i+10].codeNum);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text2"+i,897,188,215,25,org[i+10].orgName);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text3"+i,939,188,215,25,org[i+10].address);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text4"+i,979,357,65,25,i+11);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	if(i+11>step-1){
-		return;
-	}
-	LODOP.ADD_PRINT_TEXTA("text5"+i,856,449,220,25,org[i+11].codeNum);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text6"+i,897,507,215,25,org[i+11].orgName);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text7"+i,939,507,215,25,org[i+11].address);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5);
-	LODOP.ADD_PRINT_TEXTA("text8"+i,979,670,65,25,i+12);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","宋体");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",10.5); 	 
-}
-</script>
 <body>
+<div class="noprint"
+     style="padding-top: 10px; padding-right: 200px; text-align: right;">
+    <input type="button" value="打印" onclick="doPrint();">
+</div>
+       <table >
+           <tr>
+               <td ><div class="left">111111</div></td>
+               <td ><div class="right">2222222</div></td>
+           </tr>
+
+       </table>
 </body>
 </html>

+ 0 - 39
WebContent/WEB-INF/view/bus/org-plan-view.jsp

@@ -17,46 +17,7 @@
 }
 </style>
 </head>
-<script type="text/javascript" language="JavaScript">
-function doPrint() {
 
-/// 隐藏不需要打印的内容
-        try
-    {
-        PageSetup_Null();
-    }
-    catch(e)
-    {
-        var errorMsg = e.message+"\r"+"请设置:IE选项->安全->Internet->"+"ActiveX控件和插件"+"\r"+"对未标记为可安全执行脚本的ActiveX的控件初始化并执行脚本->允许/提示";
-        alert(errorMsg);
-        return;
-    }
-    window.print();
-}
-var HKEY_Root,HKEY_Path,HKEY_Key;
-HKEY_Root="HKEY_CURRENT_USER";
-HKEY_Path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
-//设置网页打印的页眉页脚为空
-function PageSetup_Null()
-{
-      var Wsh=new ActiveXObject("WScript.Shell");
-      HKEY_Key="header";
-      Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
-      HKEY_Key="footer";
-      Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
-      HKEY_Key="margin_left"
-      Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"0"); //键值设定--左边边界
-
-      HKEY_Key="margin_top"
-      Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"0"); //键值设定--上边边界
-
-      HKEY_Key="margin_right"
-      Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"0"); //键值设定--右边边界
-
-      HKEY_Key="margin_bottom"
-      Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"0"); //键值设定--下边边界
-}
-</script>
 <body>
 	<div class="noprint"
 		style="padding-top: 10px; padding-right: 200px; text-align: right;">

+ 92 - 99
WebContent/WEB-INF/view/bus/org-reply-view.jsp

@@ -1,111 +1,104 @@
 <!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>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>南宁市城市计划供水节约用水办公室--关于批复下达${year}年度供水计划的通知</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+    <title>南宁市城市计划供水节约用水办公室--关于批复下达${year}年度供水计划的通知</title>
 
-<!--打印插件-->
-<script type="text/javascript" src="${ctx}/js/LodopFuncs.js"></script>
-<object id="LODOP_OB"
-	classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0
-	style="position: absolute; left: 0px; top: -10px;"></object>
-<object id="LODOP_EM" type="application/x-print-lodop" width=0 height=0
-	style="position: absolute; left: 0px; top: -10px;"></object>
-<!--打印end-->
 
-<script type="text/javascript" src="${ctx}/qui/libs/js/jquery.js"></script>
-<script type="text/javascript">
-var LODOP; //声明为全局变量 
-LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
-var myDate = new Date();
-var year=myDate.getFullYear();
-var month=myDate.getMonth();
-var day=myDate.getDate();
-month=parseInt(month);
-month=month+1;
-var length=${listLength!''}
-length=parseInt(length);
-function createPrintPage(orgName,firstQuarter,secondQuarter,thirdQuarter,fourthQuarter,replyOfWater,meterNumber) {
-	LODOP.NewPage();
-	LODOP.ADD_PRINT_SETUP_BKIMG("<img border='0' src='${ctx}/image/notices/reply_notice.png'>");
-	LODOP.SET_SHOW_MODE("BKIMG_IN_PREVIEW",true);
-	LODOP.ADD_PRINT_TEXTA("text01",285,103,593,25,orgName);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
-	LODOP.ADD_PRINT_TEXTA("text02",502,249,375,25,firstQuarter);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
-	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
-	LODOP.ADD_PRINT_TEXTA("text03",532,249,375,25,secondQuarter);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
-	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
-	LODOP.ADD_PRINT_TEXTA("text04",563,249,375,25,thirdQuarter);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
-	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
-	LODOP.ADD_PRINT_TEXTA("text05",595,249,375,25,fourthQuarter);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
-	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
-	LODOP.ADD_PRINT_TEXTA("text06",625,249,375,25,replyOfWater);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
-	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
-	LODOP.ADD_PRINT_TEXTA("text07",997,386,60,25,year);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
-	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
-	LODOP.ADD_PRINT_TEXTA("text08",997,461,42,25,month);
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
-	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
-	LODOP.ADD_PRINT_TEXTA("text09",997,517,38,25,day);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
-	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
-	LODOP.ADD_PRINT_TEXTA("text10",660,241,456,25,meterNumber);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
-}
+    <script type="text/javascript" src="${ctx}/qui/libs/js/jquery.js"></script>
+    <style media=print type="text/css">
+        .noprint {
+            display: none;
+        }
+    </style>
 
-function printReplyNotice(){
-	LODOP.PRINT_INITA(-17,-13,793,1061,"reply_notice");
-	LODOP.SET_PRINT_PAGESIZE(1,"212mm","281mm","");//设置纸张高度
-	for(var i=1;i<=length;i++){
-		var orgName=$("#div_"+i).children("input[name='orgName']").val();
-	  	var firstQuarter=$("#div_"+i).children("input[name='firstQuarter']").val();
-	  	var secondQuarter=$("#div_"+i).children("input[name='secondQuarter']").val();
-	  	var thirdQuarter=$("#div_"+i).children("input[name='thirdQuarter']").val();
-	  	var fourthQuarter=$("#div_"+i).children("input[name='fourthQuarter']").val();
-	  	var replyOfWater=$("#div_"+i).children("input[name='replyOfWater']").val();
-	  	var meterNumber=$("#div_"+i).children("input[name='meterNumber']").val();
-	  	
-	  	firstQuarter=Math.round(firstQuarter);
-	  	secondQuarter=Math.round(secondQuarter);
-	  	thirdQuarter=Math.round(thirdQuarter);
-	  	fourthQuarter=Math.round(fourthQuarter);
-	  	replyOfWater=Math.round(replyOfWater);
-		createPrintPage(orgName,firstQuarter,secondQuarter,thirdQuarter,fourthQuarter,replyOfWater,meterNumber);
-	}
-	LODOP.PREVIEW();
-	window.close();
-}
+    <style type="text/css">
+
+        table {
+            border-right: 1px solid #cccccc;
+            border-bottom: 1px solid #cccccc
+        }
+
+        table th {
+            border-left: 1px solid #cccccc;
+            border-top: 1px solid #cccccc
+        }
+
+        table td {
+            border-left: 1px solid #cccccc;
+            border-top: 1px solid #cccccc
+        }
+
+        .orgName {
+            width: 200px;
+            word-wrap: break-word;
+        }
+
+        .meterNum {
+            width: 150px;
+            word-wrap: break-word;
+        }
+    </style>
+    <script type="text/javascript">
+        function doPrint() {
+            window.print();
+        }
+    </script>
 
-window.onload=printReplyNotice;
 
-</script>
 </head>
 <body>
-	<#assign size=1> <#list unit as u>
-	<div id="div_${u_index+1 }">
-		<input name="orgName" type="hidden" value="${u.orgName}" /> <input
-			name="firstQuarter" type="hidden" value="${u.numOne}" /> <input
-			name="secondQuarter" type="hidden" value="${u.numTwo}" /> <input
-			name="thirdQuarter" type="hidden" value="${u.numThird}" /> <input
-			name="fourthQuarter" type="hidden" value="${u.numFourth}" /> <input
-			name="replyOfWater" type="hidden" value="${u.replyOfWater}" /> <input
-			name="meterNumber" type="hidden" value="${u.meterNum}" />
-	</div>
-	<#assign size=size+1> </#list>
+<div class="noprint"
+     style="padding-top: 10px; padding-right: 200px; text-align: right;">
+    <input type="button" value="打印" onclick="doPrint();">
+</div>
+
+<table>
+    <thead>
+    <th>单位名称</th>
+    <th width="150px">水表号</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>
+    </thead>
+    <tbody>
+    <#assign size=1> <#list unit as u>
+    <tr>
+        <td>
+            <div class="orgName">${u.orgName}</div>
+        </td>
+        <td width="150px">
+            <div class="meterNum">${u.meterNum}</div>
+        </td>
+        <td>${u.replyOfWater}</td>
+        <td>${u.janReply}</td>
+        <td>${u.febReply}</td>
+        <td>${u.marReply}</td>
+        <td>${u.aprReply}</td>
+        <td>${u.mayReply}</td>
+        <td>${u.junReply}</td>
+        <td>${u.julReply}</td>
+        <td>${u.augReply}</td>
+        <td>${u.septReply}</td>
+        <td>${u.octReply}</td>
+        <td>${u.novReply}</td>
+        <td>${u.decReply}</td>
+    </tr>
+    <#assign size=size+1>
+    </#list>
+    </tbody>
+</table>
+
+
 </body>
 </html>

+ 59 - 102
WebContent/WEB-INF/view/bus/org-year-plan-notice-print.jsp

@@ -2,7 +2,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>南宁市城市计划供水节约用水办公室--关于编制下达2013年度供水计划的通知</title>
+<title>南宁市城市计划供水节约用水办公室--关于编制下达${year}年度供水计划的通知</title>
 <!--打印插件-->
 <script type="text/javascript" src="${ctx}/js/LodopFuncs.js"></script>
 <object id="LODOP_OB"
@@ -13,117 +13,74 @@
 <!--打印end-->
 
 <script type="text/javascript" src="${ctx}/qui/libs/js/jquery.js"></script>
-<script type="text/javascript">
-var LODOP; //声明为全局变量 
-LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
-
-var d = new Date();
-var strYear = d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
-
-//把日期格式转换为中文  如:2014-12-25 转换后:二〇一四年十二月二十五日
-var chinese = [ '〇', '一', '二', '三', '四', '五', '六', '七', '八', '九' ];
-var len = [ '十' ];
-var ydm = [ '年', '月', '日' ];
-function num2chinese(s) {
-	s = "" + s;
-	slen = s.length;
-	var result = "";
-	for (var i = 0; i < slen; i++) {
-		result += chinese[s.charAt(i)];
-	}
-	return result;
-}
-function n2c(s) {
-	s = "" + s;
-	var result = "";
-	if (s.length == 2) {
-		if (s.charAt(0) == "1") {
-			if (s.charAt(1) == "0")
-				return len[0];
-			return len[0] + chinese[s.charAt(1)];
+	<style media=print type="text/css">
+		.noprint {
+			display: none;
 		}
-		if (s.charAt(1) == "0")
-			return chinese[s.charAt(0)] + len[0];
-		return chinese[s.charAt(0)] + len[0] + chinese[s.charAt(1)];
-	}
-	return num2chinese(s)
-}
-function bao(s) {
-	var datePat = /^(\d{2}|\d{4})(\/|-)(\d{1,2})(\2)(\d{1,2})$/;
-	var matchArray = s.match(datePat);
-	var ok = ""
-	if (matchArray == null)
-		return false;
-	for (var i = 1; i < matchArray.length; i = i + 2) {
-		ok += n2c(matchArray[i] - 0) + ydm[(i - 1) / 2];
-	}
-	return ok;
-}
-
-
-var dataTime=bao(strYear);
+	</style>
 
-var c_year=dataTime.substring(0,4);
-var c_month=dataTime.substring(5,dataTime.indexOf("月"));
-var c_day=dataTime.substring(dataTime.indexOf("月")+1, dataTime.indexOf("日"));
+	<style type="text/css">
 
-var length=${listLength!''}
-length=parseInt(length);
+		table {
+			border-right: 1px solid #cccccc;
+			border-bottom: 1px solid #cccccc
+		}
 
-function createPrintPage(orgName,planOfWater,meterNumber) {
-	LODOP.NewPage();
-	LODOP.ADD_PRINT_SETUP_BKIMG("<img border='0' src='${ctx}/image/notices/plan_notice.png'>");
-	LODOP.SET_SHOW_MODE("BKIMG_IN_PREVIEW",true);
-	LODOP.ADD_PRINT_TEXT(269,103,588,25,orgName);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
-	LODOP.ADD_PRINT_TEXT(480,402,198,25,planOfWater);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
-	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
-	LODOP.ADD_PRINT_TEXT(843,241,444,25,meterNumber);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
-	LODOP.ADD_PRINT_TEXT(943,395,95,25,c_year);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
-	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
-	LODOP.ADD_PRINT_TEXT(942,500,53,25,c_month);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
-	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
-	LODOP.ADD_PRINT_TEXT(942,561,72,25,c_day);
-	LODOP.SET_PRINT_STYLEA(0,"FontName","仿宋");
-	LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
-	LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
-}
+		table th {
+			border-left: 1px solid #cccccc;
+			border-top: 1px solid #cccccc
+		}
 
-function printPlanNotice(){
-	LODOP.PRINT_INITA(-18,-20,793,1060,"plan_notice");
-	LODOP.SET_PRINT_PAGESIZE(1,"207mm","280mm","");//设置纸张高度
-	for(var i=1;i<=length;i++){
-		var orgName=$("#div_"+i).children("input[name='orgName']").val();
-	  	var planOfWater=$("#div_"+i).children("input[name='planOfWater']").val();
-	  	var meterNumber=$("#div_"+i).children("input[name='meterNumber']").val();
-	  	planOfWater=Math.round(planOfWater);
-		createPrintPage(orgName,planOfWater,meterNumber);
-	}
-	LODOP.PREVIEW();
-	window.close();
-}
+		table td {
+			border-left: 1px solid #cccccc;
+			border-top: 1px solid #cccccc
+		}
 
-window.onload=printPlanNotice;
+		.orgName {
+			width: 280px;
+			word-wrap: break-word;
+		}
 
-</script>
+		.meterNum {
+			width: 350px;
+			word-wrap: break-word;
+		}
+	</style>
+	<script type="text/javascript">
+		function doPrint() {
+			window.print();
+		}
+	</script>
 
 </head>
 <body>
+<div class="noprint"
+	 style="padding-top: 10px; padding-right: 200px; text-align: right;">
+	<input type="button" value="打印" onclick="doPrint();">
+</div>
+
+<table>
+	<thead>
+	<th>单位名称</th>
+	<th width="150px">水表号</th>
+	<th>年批复</th>
+
+	</thead>
+	<tbody>
 	<#assign size=1> <#list list as u>
-	<div id="div_${u_index+1 }">
-		<input name="orgName" type="hidden" value="${u.orgName}" /> <input
-			name="planOfWater" type="hidden" value="${u.replyOfWater}" /> <input
-			name="meterNumber" type="hidden" value="${u.meterNum}" />
-	</div>
-	<#assign size=size+1> </#list>
+	<tr>
+		<td>
+			<div class="orgName">${u.orgName}</div>
+		</td>
+		<td width="150px">
+			<div class="meterNum">${u.meterNum}</div>
+		</td>
+		<td>${u.replyOfWater}</td>
+
+	</tr>
+	<#assign size=size+1>
+	</#list>
+	</tbody>
+</table>
 </body>
 </html>

+ 1 - 1
src/java/com/base/model/BaseSection.java

@@ -32,7 +32,7 @@ public class BaseSection{
 	private BasePunishmentSection basePunishmentSection;
 	/**创建时间**/
 	private Date createTime;
-    /***累进单价**/
+    /***加价比例**/
 	private Float progressivesPrice;
 	
 	/**

+ 1 - 1
src/java/com/base/model/temp/BaseSectionTemp.java

@@ -22,7 +22,7 @@ public class BaseSectionTemp {
 	private String containLower;
 	/**罚款比例**/
 	private Float fineProportion;
-	/**累进加价**/
+	/**加价比例**/
 	private Float progressivesPrice;
 
 	/**创建人**/

+ 229 - 0
src/java/com/bus/model/temp/ReplyMonPrintTemp.java

@@ -0,0 +1,229 @@
+package com.bus.model.temp;
+
+public class ReplyMonPrintTemp {
+    private String orgName;
+    private Float janReply;
+    private Float febReply;
+    private Float marReply;
+    private Float aprReply;
+    private Float mayReply;
+    private Float junReply;
+    private Float julReply;
+    private Float augReply;
+    private Float septReply;
+    private Float octReply;
+    private Float novReply;
+    private Float decReply;
+    private String meterNum;
+    private Float replyOfWater;
+    private String contacts;
+    private String contactNum;
+    private String printUser;
+    private String id;
+
+
+    public ReplyMonPrintTemp(String orgName, String meter, String contacts, String contactNum, String id, String user) {
+        super();
+        this.orgName = orgName;
+        this.meterNum = meter;
+        this.contacts = contacts;
+        this.contactNum = contactNum;
+        this.id = id;
+        this.printUser = user;
+    }
+
+
+    public ReplyMonPrintTemp(String orgName,
+                             Float _janReply,
+                             Float _febReply,
+                             Float _marReply,
+                             Float _aprReply,
+                             Float _mayReply,
+                             Float _junReply,
+                             Float _julReply,
+                             Float _augReply,
+                             Float _septReply,
+                             Float _octReply,
+                             Float _novReply,
+                             Float _decReply,
+                             String meterNum, Float replyOfWater) {
+        super();
+        this.orgName = orgName;
+        this.janReply = _janReply;
+        this.febReply = _febReply;
+        this.marReply = _marReply;
+        this.aprReply = _aprReply;
+        this.mayReply = _mayReply;
+        this.junReply = _junReply;
+        this.julReply = _julReply;
+        this.augReply = _augReply;
+        this.septReply = _septReply;
+        this.octReply = _octReply;
+        this.novReply = _novReply;
+        this.decReply = _decReply;
+        this.meterNum = meterNum;
+        this.replyOfWater = replyOfWater;
+
+    }
+
+    public ReplyMonPrintTemp(String orgName, Float reply, String meter) {
+        super();
+        this.orgName = orgName;
+        this.replyOfWater = reply;
+        this.meterNum = meter;
+    }
+
+    public String getContacts() {
+        return contacts;
+    }
+
+    public void setContacts(String contacts) {
+        this.contacts = contacts;
+    }
+
+    public String getContactNum() {
+        return contactNum;
+    }
+
+    public void setContactNum(String contactNum) {
+        this.contactNum = contactNum;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getPrintUser() {
+        return printUser;
+    }
+
+    public void setPrintUser(String printUser) {
+        this.printUser = printUser;
+    }
+
+    public String getOrgName() {
+        return orgName;
+    }
+
+    public void setOrgName(String orgName) {
+        this.orgName = orgName;
+    }
+
+
+    public Float getJanReply() {
+        return janReply;
+    }
+
+    public void setJanReply(Float janReply) {
+        this.janReply = janReply;
+    }
+
+    public Float getFebReply() {
+        return febReply;
+    }
+
+    public void setFebReply(Float febReply) {
+        this.febReply = febReply;
+    }
+
+    public Float getMarReply() {
+        return marReply;
+    }
+
+    public void setMarReply(Float marReply) {
+        this.marReply = marReply;
+    }
+
+    public Float getAprReply() {
+        return aprReply;
+    }
+
+    public void setAprReply(Float aprReply) {
+        this.aprReply = aprReply;
+    }
+
+    public Float getMayReply() {
+        return mayReply;
+    }
+
+    public void setMayReply(Float mayReply) {
+        this.mayReply = mayReply;
+    }
+
+    public Float getJunReply() {
+        return junReply;
+    }
+
+    public void setJunReply(Float junReply) {
+        this.junReply = junReply;
+    }
+
+    public Float getJulReply() {
+        return julReply;
+    }
+
+    public void setJulReply(Float julReply) {
+        this.julReply = julReply;
+    }
+
+    public Float getAugReply() {
+        return augReply;
+    }
+
+    public void setAugReply(Float augReply) {
+        this.augReply = augReply;
+    }
+
+    public Float getSeptReply() {
+        return septReply;
+    }
+
+    public void setSeptReply(Float septReply) {
+        this.septReply = septReply;
+    }
+
+    public Float getOctReply() {
+        return octReply;
+    }
+
+    public void setOctReply(Float octReply) {
+        this.octReply = octReply;
+    }
+
+    public Float getNovReply() {
+        return novReply;
+    }
+
+    public void setNovReply(Float novReply) {
+        this.novReply = novReply;
+    }
+
+    public Float getDecReply() {
+        return decReply;
+    }
+
+    public void setDecReply(Float decReply) {
+        this.decReply = decReply;
+    }
+
+    public String getMeterNum() {
+        return meterNum;
+    }
+
+    public void setMeterNum(String meterNum) {
+        this.meterNum = meterNum;
+    }
+
+    public Float getReplyOfWater() {
+        return replyOfWater;
+    }
+
+    public void setReplyOfWater(Float replyOfWater) {
+        this.replyOfWater = replyOfWater;
+    }
+
+}

+ 8 - 0
src/java/com/bus/service/IBusMonthAssessmentService.java

@@ -136,4 +136,12 @@ public interface IBusMonthAssessmentService extends IGenericService<BusMonthAsse
      * @return
      */
     Page getAnnualPlanSelectedData(int pageNo, int pageSize,String orgName,String year);
+
+    /**
+     * 重算月考核
+     * @param year
+     * @param month
+     * @return
+     */
+    Boolean recalculation(String year,String month);
 }

+ 4 - 4
src/java/com/bus/service/IBusOrgService.java

@@ -5,10 +5,7 @@ import java.util.Date;
 import java.util.List;
 
 import com.bus.model.BusOrg;
-import com.bus.model.temp.BusOrgTemp;
-import com.bus.model.temp.OrgTemp;
-import com.bus.model.temp.OrgTypeCountTemp;
-import com.bus.model.temp.ReplyPrintTemp;
+import com.bus.model.temp.*;
 import com.core.service.IGenericService;
 import com.core.util.Page;
 
@@ -129,6 +126,9 @@ public interface IBusOrgService extends IGenericService<BusOrg, Long>{
       public List<ReplyPrintTemp> unitYearReplyPrin(String orgNumber,String orgName,String year,String busOrgCustomerNumber,
     			String address,String busOrgMeterNumber,String priYearUseWater,String userType,String orgTypeId);
 
+      public List<ReplyMonPrintTemp> unitYearReplyPrin2(String orgNumber, String orgName, String year, String busOrgCustomerNumber,
+														String address, String busOrgMeterNumber, String priYearUseWater, String userType, String orgTypeId);
+
       /**
        * 信封打印预览
        * @param orgNumber

+ 16 - 0
src/java/com/bus/service/impl/BusMonthAssessmentServiceImpl.java

@@ -13,8 +13,10 @@ import com.bus.service.IBusOrgService;
 import com.core.dao.IGenericDao;
 import com.core.service.impl.GenericServiceImpl;
 import com.core.util.AppUtil;
+import com.core.util.DateUtil;
 import com.core.util.Page;
 import flexjson.JSONDeserializer;
+import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -24,6 +26,7 @@ import org.springframework.jdbc.core.RowMapper;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.text.DecimalFormat;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -1118,4 +1121,17 @@ public class BusMonthAssessmentServiceImpl extends GenericServiceImpl<BusMonthAs
         return dao.getPageByHql(hql, pageNo, pageSize);
     }
 
+    @Override
+    public Boolean recalculation(String year, String month) {
+
+        if (StringUtils.isBlank(year)){
+            year = DateUtil.getFormatDateTime(new Date(),"yyyy");
+        }
+        if (StringUtils.isBlank(month)){
+            month="1,2,3,4,5,6,7,8,9,10,11,12";
+        }
+        jdbcTemplate.execute("CALL update_month_assessment('"+year+"','"+month+"')");
+
+        return true;
+    }
 }

+ 603 - 540
src/java/com/bus/service/impl/BusOrgServiceImpl.java

@@ -11,54 +11,53 @@ import com.base.model.BaseWaterProperties;
 import com.base.service.IBaseOrgTypeService;
 import com.base.service.IBaseWaterPropertiesService;
 import com.bus.model.*;
+import com.bus.model.temp.*;
 import com.bus.service.*;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.jdbc.core.RowMapper;
 
 import com.bus.dao.IBusOrgDao;
-import com.bus.model.temp.BusOrgTemp;
-import com.bus.model.temp.OrgTemp;
-import com.bus.model.temp.OrgTypeCountTemp;
-import com.bus.model.temp.ReplyPrintTemp;
 import com.core.dao.IGenericDao;
 import com.core.service.impl.GenericServiceImpl;
 import com.core.util.Page;
+
 /**
  * 导入数据文件业务层实现类
- * @author lha
  *
+ * @author lha
  */
 public class BusOrgServiceImpl extends GenericServiceImpl<BusOrg, Long> implements IBusOrgService {
 
-	@Autowired
-	private IBusOrgDao busOrgDao;
-	@Autowired
-	private IBaseOrgTypeService baseOrgTypeService;
-	@Autowired
-	private IBusCustomerMeterService busCustomerMeterService;
-	@Autowired
-	private IBusAnnualPlanForWaterService busAnnualPlanForWaterService;
-	@Autowired
-	private IBusQuarterlyAssessmentService busQuarterlyAssessmentService;
-	@Autowired
-	private IBusMonthAssessmentService busMonthAssessmentService;
-	@Autowired
-	private IBaseWaterPropertiesService baseWaterPropertiesService;
-
-
-	@Autowired
-	private org.springframework.jdbc.core.JdbcTemplate jdbcTemplate;
-	@Override
-	protected IGenericDao<BusOrg, Long> getGenericDao() {
-		return this.busOrgDao;
-	}
-
-	@Override
-	public String getMatYearFromBusOrg() {
-		// TODO Auto-generated method stub
-		return this.busOrgDao.getMatYearFromBusOrg();
-	}
+    @Autowired
+    private IBusOrgDao busOrgDao;
+    @Autowired
+    private IBaseOrgTypeService baseOrgTypeService;
+    @Autowired
+    private IBusCustomerMeterService busCustomerMeterService;
+    @Autowired
+    private IBusAnnualPlanForWaterService busAnnualPlanForWaterService;
+    @Autowired
+    private IBusQuarterlyAssessmentService busQuarterlyAssessmentService;
+    @Autowired
+    private IBusMonthAssessmentService busMonthAssessmentService;
+    @Autowired
+    private IBaseWaterPropertiesService baseWaterPropertiesService;
+
+
+    @Autowired
+    private org.springframework.jdbc.core.JdbcTemplate jdbcTemplate;
+
+    @Override
+    protected IGenericDao<BusOrg, Long> getGenericDao() {
+        return this.busOrgDao;
+    }
+
+    @Override
+    public String getMatYearFromBusOrg() {
+        // TODO Auto-generated method stub
+        return this.busOrgDao.getMatYearFromBusOrg();
+    }
 
 
 /*	@Override
@@ -67,511 +66,575 @@ public class BusOrgServiceImpl extends GenericServiceImpl<BusOrg, Long> implemen
 		return this.busOrgDao.getCountInitDate(year);
 	}*/
 
-	@Override
-	public Page getOrgListPage(int pageNo, int pageSize, String orgNumber,
-			String orgName, String year, String busOrgCustomerNumber,
-			String address, String busOrgMeterNumber, String isPlanUser,
-			String userType, String orgTypeId) {
-		String hql = "select b from BusOrg b where b.importStatus='normal'";
-		if (null != orgNumber && !orgNumber.equals("")) {
-			hql += " and b.orgNumber = '" + orgNumber + "'";
-		}
-		if (null != orgName && !orgName.equals("")) {
-			hql += " and b.orgName like '%" + orgName + "%'";
-		}
-		if (null != year && !year.equals("")) {
-			hql += " and b.year like '%" + year + "%'";
-		}
-		if (null != busOrgCustomerNumber && !busOrgCustomerNumber.equals("")) {
-			hql += " and b.orgId in(select bcm.org.orgId from BusCustomerMeter bcm where bcm.customerNumber='"+busOrgCustomerNumber+"')";
-		}
-		if (null != address && !address.equals("")) {
-			hql += " and b.address like '%" + address + "%'";
-		}
-		if (null != busOrgMeterNumber && !busOrgMeterNumber.equals("")) {
-			hql += " and b.orgId in(select bc.org.orgId from BusCustomerMeter bc where bc.meterNumber='"+busOrgMeterNumber+"')";
-		}
-		if (null != userType && !userType.equals("")) {
-			hql += " and b.newMeter = '1'";
-		}
-		if (null != isPlanUser && !isPlanUser.equals("")) {
-			hql += " and b.isPlanUser ='" + isPlanUser + "'";
-		}
-		if (null != orgTypeId && !orgTypeId.equals("")) {
-			hql += " and b.orgTypeId  = " + orgTypeId + "";
-		}
-		return busOrgDao.getPageByHql(hql, pageNo, pageSize);
-	}
-
-
-
-	@Override
-	public void updateYearneedInitDate(String initYear,
-			Date initStartTime, Date initEndTime, Date bMonthStartTime,
-			Date bMonthEndTime, Date eMonthStartTime, Date eMonthEndTime) {
-		// TODO Auto-generated method stub
-		 this.busOrgDao.updateYearneedInitDate(initYear, initStartTime, initEndTime, bMonthStartTime, bMonthEndTime, eMonthStartTime, eMonthEndTime);
-	}
-
-	@Override
-	public void updateCountYearInitDate(Long userId,Date updateTime,String userName,String year,Date initStartTime,
-			Date initEndTime, Date bMonthStartTime, Date bMonthEndTime,
-			Date eMonthStartTime, Date eMonthEndTime) {
-		// TODO Auto-generated method stub
-		 this.busOrgDao.updateCountYearInitDate(userId,updateTime,userName,year, initStartTime, initEndTime, bMonthStartTime, bMonthEndTime, eMonthStartTime, eMonthEndTime);
-	}
-
-	@Override
-	public void importExceInitData(String year, List<String[]> dataList) {
-
-		//查询到居民用水与非居民用水信息
-		BaseOrgType jmOrgType = baseOrgTypeService.findUniqueBy("orgName","居民用水");
-		BaseOrgType fjmOrgType = baseOrgTypeService.findUniqueBy("orgName","非居民用水");
-
-		//使用导入的功能都认为是计划户
-		String _isPlanUser="yes";
-		//邮政编码
-		String _code = "530000";
-		//说明
-		String _remark = year+"导入年计划";
-		//导入状态
-		String _importStatus="normal";
-		//日期
-		Date now = new Date();
-		//用户类型全部为自来水户
-		String _baseUserTypeId = "1";
-
-
-
-
-
-
-		//插入用户信息表
-		for (int i = 1;i<dataList.size();i++){
-			String[] item = dataList.get(i);
-			String _no = item[0];
-			String _orgName = item[1];
-			String _address = item[2];
-			String _properties = item[3];
-
-			//判断单位是否已经存在
-
-
-
-
-
-
-
-			String _waterPriceStr = item[4];
-
-			if (StringUtils.isBlank(_waterPriceStr)){
-				_waterPriceStr = "0";
-			}
-			_waterPriceStr = _waterPriceStr.trim().replaceAll(",","");
-
-			Float _waterPrice = Float.parseFloat(_waterPriceStr);
-			String _customerMeter = item[5];
-
-			//实际用水
-			String _actualStr = item[6];
-			if (StringUtils.isBlank(_actualStr)){
-				_actualStr = "0";
-			}
-			_actualStr = _actualStr.trim().replaceAll(",","");
-
-			Float _actual = Float.parseFloat(_actualStr);
-			//计划用水
-
-			String _planStr = item[7];
-			if (StringUtils.isBlank(_planStr)){
-				_planStr = "0";
-			}
-			_planStr = _planStr.trim().replaceAll(",","");
-
-			Float _plan =  Float.parseFloat(_planStr);
-
-			BusOrg busOrg = new BusOrg();
-			busOrg.setOrgName(_orgName);
-			busOrg.setOrgNumber(Integer.parseInt(_no));
-			busOrg.setYear(year);
-			busOrg.setBaseUserType(_baseUserTypeId);
-			busOrg.setAddress(_address);
-			busOrg.setIsPlanUser(_isPlanUser);
-			busOrg.setCode(_code);
-			busOrg.setRemark(_remark);
-			if (_properties!=null && _properties.indexOf("居民")>=0){
-				busOrg.setOrgType(jmOrgType);
-			}else{
-				busOrg.setOrgType(fjmOrgType);
-			}
-			busOrg.setImportId(0L);
-			busOrg.setImportStatus(_importStatus);
-			busOrg.setPostalAddress(_address);
-			//保存到数据
-			busOrg =busOrgDao.save(busOrg);
-
-
-
-
-
-
-
-			if (_properties!=null && !_properties.equalsIgnoreCase("")){
-				//当前用水性质是否存在
-				BaseWaterProperties baseWaterProperties =null;
-				try {
-					baseWaterProperties = baseWaterPropertiesService.findUniqueBy("propertiesName",_properties);
-				}catch (Exception ex){
-					ex.printStackTrace();
-				}
-				if (baseWaterProperties==null ){
-					 baseWaterProperties = new BaseWaterProperties(_properties,_waterPrice);
-					baseWaterPropertiesService.save(baseWaterProperties);
-				}
-
-			}
-
-
-
-			//插入水表信息
-			if (StringUtils.isNotBlank(_customerMeter)){
-				_customerMeter = _customerMeter.replaceAll(",",",");
-				//拿到水表号
-				String[] _customerMeterList = _customerMeter.split(",");
-				//循环添加水表信息
-				for (int j=0;j< _customerMeterList.length;j++){
-					BusCustomerMeter busCustomerMeter= new BusCustomerMeter();
-					busCustomerMeter.setYear(year);
-					busCustomerMeter.setMeterNumber(Integer.parseInt(_customerMeterList[j]));
-					busCustomerMeter.setRemark(_remark);
-					busCustomerMeter.setCustomerNumber(Integer.parseInt(_no));
-					busCustomerMeter.setAddress(_address);
-					busCustomerMeter.setOrg(busOrg);
-					busCustomerMeterService.save(busCustomerMeter);
-				}
-			}
-			//算出季度用水
-			Float quarterlyPlan = _plan/4;
-			//算出月份用水
-			Float monthPlan = _plan/12;
-			//生成年计划
-			BusAnnualPlanForWater busAnnualPlanForWater = new BusAnnualPlanForWater();
-			busAnnualPlanForWater.setFillTime(now);
-			busAnnualPlanForWater.setOrg(busOrg);
-			busAnnualPlanForWater.setIsCancel("yes");
-			//上年用水量
-			busAnnualPlanForWater.setPriYearUseWater(_actual);
-			//计划用水量
-			busAnnualPlanForWater.setPlanOfWater(_plan);
-			busAnnualPlanForWater.setReplyOfWater(_plan);
-			//计划季度用水量
-			busAnnualPlanForWater.setFirstQuarterPlan(quarterlyPlan);
-			busAnnualPlanForWater.setSecondQuarterPlan(quarterlyPlan);
-			busAnnualPlanForWater.setThirdQuarterPlan(quarterlyPlan);
-			busAnnualPlanForWater.setFourthQuarterPlan(quarterlyPlan);
-
-			busAnnualPlanForWater.setFirstQuarterReply(quarterlyPlan);
-			busAnnualPlanForWater.setSecondQuarterReply(quarterlyPlan);
-			busAnnualPlanForWater.setThirdQuarterReply(quarterlyPlan);
-			busAnnualPlanForWater.setFourthQuarterReply(quarterlyPlan);
-
-			busAnnualPlanForWater.setJanPlan(monthPlan);
-			busAnnualPlanForWater.setFebPlan(monthPlan);
-			busAnnualPlanForWater.setMarPlan(monthPlan);
-			busAnnualPlanForWater.setAprPlan(monthPlan);
-			busAnnualPlanForWater.setMayPlan(monthPlan);
-			busAnnualPlanForWater.setJunPlan(monthPlan);
-			busAnnualPlanForWater.setJulPlan(monthPlan);
-			busAnnualPlanForWater.setAugPlan(monthPlan);
-			busAnnualPlanForWater.setSeptPlan(monthPlan);
-			busAnnualPlanForWater.setOctPlan(monthPlan);
-			busAnnualPlanForWater.setNovPlan(monthPlan);
-			busAnnualPlanForWater.setDecPlan(monthPlan);
-
-			busAnnualPlanForWater.setJanReply(monthPlan);
-			busAnnualPlanForWater.setFebReply(monthPlan);
-			busAnnualPlanForWater.setMarReply(monthPlan);
-			busAnnualPlanForWater.setAprReply(monthPlan);
-			busAnnualPlanForWater.setMayReply(monthPlan);
-			busAnnualPlanForWater.setJunReply(monthPlan);
-			busAnnualPlanForWater.setJulReply(monthPlan);
-			busAnnualPlanForWater.setAugReply(monthPlan);
-			busAnnualPlanForWater.setSeptReply(monthPlan);
-			busAnnualPlanForWater.setOctReply(monthPlan);
-			busAnnualPlanForWater.setNovReply(monthPlan);
-			busAnnualPlanForWater.setDecReply(monthPlan);
-			busAnnualPlanForWaterService.save(busAnnualPlanForWater);
-			//生成季考核
-			for (int j = 1;j<=4;j++){
-				BusQuarterlyAssessment busQuarterlyAssessment = new BusQuarterlyAssessment();
-				busQuarterlyAssessment.setAssessmentQuarter(j);
-				busQuarterlyAssessment.setWaterPlanningIndex(quarterlyPlan);
-				busQuarterlyAssessment.setReplyOfWater(quarterlyPlan);
-				busQuarterlyAssessment.setOrg(busOrg);
-				busQuarterlyAssessment.setIsWriteOff("no");
-				busQuarterlyAssessment.setWaterPrice(_waterPrice);
-				busQuarterlyAssessmentService.save(busQuarterlyAssessment);
-
-			}
-			//生成月份考核
-			for (int j = 1;j<=12;j++){
-				BusMonthAssessment busMonthAssessment = new BusMonthAssessment();
-				busMonthAssessment.setAssessmentMonth(j);
-				busMonthAssessment.setWaterPlanningIndex(monthPlan);
-				busMonthAssessment.setReplyOfWater(monthPlan);
-				busMonthAssessment.setOrg(busOrg);
-				busMonthAssessment.setIsWriteOff("no");
-				busMonthAssessmentService.save(busMonthAssessment);
-			}
-		}
-	}
-
-	@Override
-	public void updateInitbusQuarterlyAssessment(int assessmentQuarter,
-			String year, Date initStartTime, Date initEndTime,
-			Date bMonthStartTime, Date bMonthEndTime, Date eMonthStartTime,
-			Date eMonthEndTime) {
-		this.busOrgDao.updateInitbusQuarterlyAssessment(assessmentQuarter, year, initStartTime, initEndTime, bMonthStartTime, bMonthEndTime, eMonthStartTime, eMonthEndTime);
-		
-	}
-
-	@Override
-	public void updateInitbusMonthAssessment(int assessmentMonth,
-			String year, Date initStartTime, Date initEndTime,
-			Date bMonthStartTime, Date bMonthEndTime, Date eMonthStartTime,
-			Date eMonthEndTime) {
-		this.busOrgDao.updateInitbusMonthAssessment(assessmentMonth, year, initStartTime, initEndTime, bMonthStartTime, bMonthEndTime, eMonthStartTime, eMonthEndTime);
-
-	}
-
-	@Override
-	public void updateInitbusHalfYearAssessment(int assessmentQuarter,
-			 String year, Date initStartTime, Date initEndTime,
-			 Date bMonthStartTime, Date bMonthEndTime, Date eMonthStartTime,
-			 Date eMonthEndTime,Float GR) {
-		this.busOrgDao.updateInitbusHalfYearAssessment(assessmentQuarter, year, initStartTime, initEndTime, bMonthStartTime, bMonthEndTime, eMonthStartTime, eMonthEndTime,GR);
-
-	}
-
-	@Override
-	public List<BusOrgTemp> getPlanYearCountData(String orgNumber,
-			String orgName, String year, String busOrgCustomerNumber,
-			String address, String userType, String orgTypeId) throws UnsupportedEncodingException {
-		// TODO Auto-generated method stub
-		return this.busOrgDao.getPlanYearCountData(orgNumber, orgName, year, busOrgCustomerNumber, address, userType, orgTypeId);
-	}
-
-	@Override
-	public String getMaxUserPlanYear() {
-		// TODO Auto-generated method stub
-		return this.busOrgDao.getMaxUserPlanYear();
-	}
-
-	@Override
-	public void initOneData(Long orgId, int nextYear,String type) {
-		 this.busOrgDao.initOneData(orgId, nextYear,type);
-		
-	}
-
-	@Override
-	public List<ReplyPrintTemp> unitYearReplyPrin(String orgNumber, String orgName,
-			String year, String busOrgCustomerNumber, String address,
-			String busOrgMeterNumber, String priYearUseWater, String userType, String orgTypeId) {
-	     String sql = " SELECT b.`org_name`,w.`first_quarter_reply` AS numOne,w.`second_quarter_reply` AS numTwo,w.`third_quarter_reply` AS numThird,w.`fourth_quarter_reply` AS numFourth,GROUP_CONCAT(bm.`meter_Number`) AS meterNum,w.reply_of_water "
-                 + " FROM `bus_org` b " 
-                 + " JOIN `bus_annual_plan_for_water` w ON b.`org_id` = w.`org_id` JOIN `bus_customer_meter` bm ON b.`org_id`=bm.`org_id` "
-                 + " WHERE b.`is_plan_user`='yes' AND w.`is_cancel`='yes' ";
-      if(!orgNumber.equals("")){
-      	   sql +=" and b.org_number="+orgNumber;
-      }
-      if(!orgName.equals("")){
-      	   try {
-			orgName = new String(orgName.getBytes("iso8859-1"),"UTF-8");
-		} catch (UnsupportedEncodingException e) {
-			
-			e.printStackTrace();
-		}
-      	   sql +=" and b.org_name like '%"+orgName+"%'";
-      }
-		if(orgTypeId!=null && !orgTypeId.equals("")){
-			try {
-				orgTypeId = new String(orgTypeId.getBytes("iso8859-1"),"UTF-8");
-			} catch (UnsupportedEncodingException e) {
-
-				e.printStackTrace();
-			}
-			sql +=" and b.org_type_id = "+orgTypeId+"";
-		}
-      	   sql +=" and b.year="+year;
-      if(!address.equals("")){
-      	   try {
-			address = new String(address.getBytes("iso8859-1"),"UTF-8");
-		} catch (UnsupportedEncodingException e) {
-			
-			e.printStackTrace();
-		}
-      	   sql +=" and b.address like '%"+address+"%'";
-      }
-      if(!priYearUseWater.equals("")){
-      	   Float f = Float.parseFloat(priYearUseWater);
-      	   sql +=" and w.pri_year_usewater >="+f;
-      }
-      if(!userType.equals("")){
-      	   sql +=" and b.user_type="+userType;
-      }                  
-             sql += " GROUP BY b.`org_id`";
-      if(!busOrgCustomerNumber.equals("")){
-      	   sql +=" having GROUP_CONCAT(bm.`meter_Number`) like '%"+busOrgCustomerNumber+"%'";
-      }
-      if(!busOrgMeterNumber.equals("")){
-      	   sql +=" and GROUP_CONCAT(bm.`customer_Number`) like '%"+busOrgMeterNumber+"%'";
-      }
-      RowMapper<ReplyPrintTemp> rowMapper = new RowMapper<ReplyPrintTemp>() {
-
-		@Override
-		public ReplyPrintTemp mapRow(ResultSet rs, int arg1) throws SQLException {
-			ReplyPrintTemp busOrgTem = new ReplyPrintTemp(rs.getString("org_name"),rs.getFloat("numOne"),rs.getFloat("numTwo"),
-					rs.getFloat("numThird"),rs.getFloat("numFourth"),rs.getString("meterNum"),rs.getFloat("reply_of_water"));
-			return busOrgTem;
-		}
-	
-      };
-      List<ReplyPrintTemp> list = jdbcTemplate.query(sql, rowMapper);
-		return list;
-	}
-
-	@Override
-	public List<OrgTemp> emailPrintView(String orgNumber, String orgName,
-			String year, String busOrgCustomerNumber, String address,
-			String busOrgMeterNumber, String priYearUseWater, String userType, String orgTypeId) throws UnsupportedEncodingException {
-		String sql = " SELECT b.`code`,b.`org_name`,b.postal_address FROM `bus_org` b " +
-				     " LEFT JOIN `bus_annual_plan_for_water` w ON b.`org_id` = w.`org_id` WHERE b.`year`='"+year+"' AND b.`is_plan_user`='yes' AND w.`is_cancel`='yes'";
-		        if(!orgNumber.equals("")){
-		        	sql +=" and b.org_number="+orgNumber;
-		        }
-		        if(!orgName.equals("")){
-		        	orgName = new String(orgName.getBytes("iso8859-1"),"UTF-8");
-		        	sql +=" and b.org_name like '%"+orgName+"%'";
-		        }
-				if(!orgTypeId.equals("")){
-					orgTypeId = new String(orgTypeId.getBytes("iso8859-1"),"UTF-8");
-					sql +=" and b.org_type_id = "+orgTypeId+"";
-				}
-		        if(!address.equals("")){
-		        	address = new String(address.getBytes("iso8859-1"),"UTF-8");
-		        	sql +=" and b.address like '%"+address+"%'";
-		        }
-		        if(!priYearUseWater.equals("")){
-		        	Float f = Float.parseFloat(priYearUseWater);
-		        	sql +=" and w.pri_year_usewater>="+f;
-		        }
-		        if(!userType.equals("")){
-		        	sql +=" and b.user_type="+userType;
-		        }
-		        if(!busOrgCustomerNumber.equals("")){
-		        	sql +=" and b.org_id in (select bm.org_id from `bus_customer_meter` bm where bm.year='"+year+"' and bm.customer_Number="+busOrgCustomerNumber+")";
-		        }
-		        if(!busOrgMeterNumber.equals("")){
-		        	sql +=" and b.org_id in (select bcm.org_id from `bus_customer_meter` bcm where bcm.year='"+year+"' and bcm.meter_Number="+busOrgMeterNumber+")";
-		        }
-		 RowMapper<OrgTemp> rowMapper = new RowMapper<OrgTemp>() {
-
-			@Override
-			public OrgTemp mapRow(ResultSet rs, int arg1) throws SQLException {
-				OrgTemp org = new OrgTemp(rs.getString("code"),rs.getString("org_name"),rs.getString("postal_address"));
-				return org;
-			}
-		
-		 };
-		 List<OrgTemp> list = jdbcTemplate.query(sql, rowMapper);
-		return list;
-	}
-
-	@Override
-	public int checkPendingIsNull() {
-		return jdbcTemplate.queryForInt("SELECT COUNT(*) FROM `bus_org` WHERE `import_status`='pending'");
-	}
-
-	@Override
-	public List<Object[]> listCountWaterData(String year) {
-		String sql =" SELECT bwp.`properties_name`,                                       " 
-                   +" IFNULL((                                                            "
-                   +" SELECT SUM(w.`reply_of_water`) FROM `bus_annual_plan_for_water` w   "
-                   +" JOIN `bus_meter_read_info` info ON w.`org_id`=info.`org_id` WHERE   "
-                   +" bwp.`properties_id`=info.properties_id AND info.year='"+year+"'),0)  "
-                   +" AS reply,                                                            "
-                   +" IFNULL((                                                             "
-                   +" SELECT SUM(i.`water`) FROM `bus_meter_read_info` i                   "
-                   +" JOIN `bus_annual_plan_for_water` fw ON i.`org_id` = fw.`org_id`      "
-                   +" WHERE i.`year`='"+year+"' AND i.`properties_id`=bwp.`properties_id`),0)  "
-                   +" AS userWater                                                         "
-                   +" FROM `base_water_properties` bwp                                     "
-                   +" UNION ALL                                                            "
-                   +" ("
-                   +" SELECT '总计',IFNULL(SUM(bap.`reply_of_water`),0),IFNULL(SUM(bm.`water`),0)                          "
-                   +" FROM `base_water_properties` p JOIN `bus_meter_read_info` bm ON p.`properties_id`=bm.`properties_id` "
-                   +" JOIN `bus_annual_plan_for_water` bap ON bm.`org_id`=bap.`org_id` WHERE bm.`year`='"+year+"'              "
-                   +" )";
-		RowMapper<Object[]> rowMapper = new RowMapper<Object[]>() {
-
-			@Override
-			public Object[] mapRow(ResultSet rs, int arg1)
-					throws SQLException {
-				    Object[] obj = new Object[3];
-				    obj[0] = rs.getString("properties_name");
-				    obj[1] = rs.getFloat("reply");
-				    obj[2] = rs.getFloat("userWater");
-				return obj;
-			}
-		};
-		List<Object[]> list = jdbcTemplate.query(sql, rowMapper);
-		return list;
-	}
-
-	@Override
-	public void updateIsplanYear(String year) {
-		this.busOrgDao.updateIsplanYear(year);
-		
-	}
-
-	@Override
-	public void updateSetplanYear(String initYear, Date initStartTime,
-			Date initEndTime, Date bMonthStartTime, Date bMonthEndTime,
-			Date eMonthStartTime, Date eMonthEndTime, Float checkWater) {
-		this.busOrgDao.updateSetplanYear(initYear, initStartTime, initEndTime, bMonthStartTime, bMonthEndTime, eMonthStartTime, eMonthEndTime, checkWater);
-		
-	}
-
-	@Override
-	public void updateCosMeter(String year) {
-		this.busOrgDao.updateCosMeter(year);
-		
-	}
-
-	@Override
-	public void delteInfoForSplitOrg(Long orgId) {
-		//先删除用水信息
-		jdbcTemplate.update("DELETE FROM `bus_meter_read_info` WHERE `org_id`=?",orgId);
-		//删除对应水表
-		jdbcTemplate.update("DELETE FROM `bus_customer_meter` WHERE `org_id`=?",orgId);
-		//删除年度供水计划
-		jdbcTemplate.update("DELETE FROM `bus_annual_plan_for_water` WHERE `org_id`=?",orgId);
-		//删除季度考核
-		jdbcTemplate.update("DELETE FROM `bus_quarterly_assessment` WHERE `org_id`=?",orgId);
-		//删除单位
-		jdbcTemplate.update("DELETE FROM `bus_org` WHERE `org_id`=?",orgId);
-	}
-
-	@Override
-	public Long findOrgNumberByYear(Integer orgNumber) {
-		String sql = "SELECT o.`org_id` FROM `bus_org` o WHERE o.`org_number` = "+orgNumber+" AND o.`year` = DATE_FORMAT( CURRENT_TIMESTAMP(),'%Y' ) AND o.`import_status` = 'normal'";
-		Long orgId = jdbcTemplate.queryForLong(sql);
-		return orgId;
-	}
-
-	@Override
-	public void updateAddress(String orgId,String postalAddress) {
-		jdbcTemplate.update("UPDATE `bus_org` SET `postal_address`=? WHERE `org_id`=?",postalAddress,orgId);//
-		
-	}
+    @Override
+    public Page getOrgListPage(int pageNo, int pageSize, String orgNumber,
+                               String orgName, String year, String busOrgCustomerNumber,
+                               String address, String busOrgMeterNumber, String isPlanUser,
+                               String userType, String orgTypeId) {
+        String hql = "select b from BusOrg b where b.importStatus='normal'";
+        if (null != orgNumber && !orgNumber.equals("")) {
+            hql += " and b.orgNumber = '" + orgNumber + "'";
+        }
+        if (null != orgName && !orgName.equals("")) {
+            hql += " and b.orgName like '%" + orgName + "%'";
+        }
+        if (null != year && !year.equals("")) {
+            hql += " and b.year like '%" + year + "%'";
+        }
+        if (null != busOrgCustomerNumber && !busOrgCustomerNumber.equals("")) {
+            hql += " and b.orgId in(select bcm.org.orgId from BusCustomerMeter bcm where bcm.customerNumber='" + busOrgCustomerNumber + "')";
+        }
+        if (null != address && !address.equals("")) {
+            hql += " and b.address like '%" + address + "%'";
+        }
+        if (null != busOrgMeterNumber && !busOrgMeterNumber.equals("")) {
+            hql += " and b.orgId in(select bc.org.orgId from BusCustomerMeter bc where bc.meterNumber='" + busOrgMeterNumber + "')";
+        }
+        if (null != userType && !userType.equals("")) {
+            hql += " and b.newMeter = '1'";
+        }
+        if (null != isPlanUser && !isPlanUser.equals("")) {
+            hql += " and b.isPlanUser ='" + isPlanUser + "'";
+        }
+        if (null != orgTypeId && !orgTypeId.equals("")) {
+            hql += " and b.orgTypeId  = " + orgTypeId + "";
+        }
+        return busOrgDao.getPageByHql(hql, pageNo, pageSize);
+    }
+
+
+    @Override
+    public void updateYearneedInitDate(String initYear,
+                                       Date initStartTime, Date initEndTime, Date bMonthStartTime,
+                                       Date bMonthEndTime, Date eMonthStartTime, Date eMonthEndTime) {
+        // TODO Auto-generated method stub
+        this.busOrgDao.updateYearneedInitDate(initYear, initStartTime, initEndTime, bMonthStartTime, bMonthEndTime, eMonthStartTime, eMonthEndTime);
+    }
+
+    @Override
+    public void updateCountYearInitDate(Long userId, Date updateTime, String userName, String year, Date initStartTime,
+                                        Date initEndTime, Date bMonthStartTime, Date bMonthEndTime,
+                                        Date eMonthStartTime, Date eMonthEndTime) {
+        // TODO Auto-generated method stub
+        this.busOrgDao.updateCountYearInitDate(userId, updateTime, userName, year, initStartTime, initEndTime, bMonthStartTime, bMonthEndTime, eMonthStartTime, eMonthEndTime);
+    }
+
+    @Override
+    public void importExceInitData(String year, List<String[]> dataList) {
+
+        //查询到居民用水与非居民用水信息
+        BaseOrgType jmOrgType = baseOrgTypeService.findUniqueBy("orgName", "居民用水");
+        BaseOrgType fjmOrgType = baseOrgTypeService.findUniqueBy("orgName", "非居民用水");
+
+        //使用导入的功能都认为是计划户
+        String _isPlanUser = "yes";
+        //邮政编码
+        String _code = "530000";
+        //说明
+        String _remark = year + "导入年计划";
+        //导入状态
+        String _importStatus = "normal";
+        //日期
+        Date now = new Date();
+        //用户类型全部为自来水户
+        String _baseUserTypeId = "1";
+
+
+        //插入用户信息表
+        for (int i = 1; i < dataList.size(); i++) {
+            String[] item = dataList.get(i);
+            String _no = item[0];
+            String _orgName = item[1];
+            String _address = item[2];
+            String _properties = item[3];
+
+            //判断单位是否已经存在
+
+
+            String _waterPriceStr = item[4];
+
+            if (StringUtils.isBlank(_waterPriceStr)) {
+                _waterPriceStr = "0";
+            }
+            _waterPriceStr = _waterPriceStr.trim().replaceAll(",", "");
+
+            Float _waterPrice = Float.parseFloat(_waterPriceStr);
+            String _customerMeter = item[5];
+
+            //实际用水
+            String _actualStr = item[6];
+            if (StringUtils.isBlank(_actualStr)) {
+                _actualStr = "0";
+            }
+            _actualStr = _actualStr.trim().replaceAll(",", "");
+
+            Float _actual = Float.parseFloat(_actualStr);
+            //计划用水
+
+            String _planStr = item[7];
+            if (StringUtils.isBlank(_planStr)) {
+                _planStr = "0";
+            }
+            _planStr = _planStr.trim().replaceAll(",", "");
+
+            Float _plan = Float.parseFloat(_planStr);
+
+            BusOrg busOrg = new BusOrg();
+            busOrg.setOrgName(_orgName);
+            busOrg.setOrgNumber(Integer.parseInt(_no));
+            busOrg.setYear(year);
+            busOrg.setBaseUserType(_baseUserTypeId);
+            busOrg.setAddress(_address);
+            busOrg.setIsPlanUser(_isPlanUser);
+            busOrg.setCode(_code);
+            busOrg.setRemark(_remark);
+            if (_properties != null && _properties.indexOf("居民") >= 0) {
+                busOrg.setOrgType(jmOrgType);
+            } else {
+                busOrg.setOrgType(fjmOrgType);
+            }
+            busOrg.setImportId(0L);
+            busOrg.setImportStatus(_importStatus);
+            busOrg.setPostalAddress(_address);
+            //保存到数据
+            busOrg = busOrgDao.save(busOrg);
+
+
+            if (_properties != null && !_properties.equalsIgnoreCase("")) {
+                //当前用水性质是否存在
+                BaseWaterProperties baseWaterProperties = null;
+                try {
+                    baseWaterProperties = baseWaterPropertiesService.findUniqueBy("propertiesName", _properties);
+                } catch (Exception ex) {
+                    ex.printStackTrace();
+                }
+                if (baseWaterProperties == null) {
+                    baseWaterProperties = new BaseWaterProperties(_properties, _waterPrice);
+                    baseWaterPropertiesService.save(baseWaterProperties);
+                }
+
+            }
+
+
+            //插入水表信息
+            if (StringUtils.isNotBlank(_customerMeter)) {
+                _customerMeter = _customerMeter.replaceAll(",", ",");
+                //拿到水表号
+                String[] _customerMeterList = _customerMeter.split(",");
+                //循环添加水表信息
+                for (int j = 0; j < _customerMeterList.length; j++) {
+                    BusCustomerMeter busCustomerMeter = new BusCustomerMeter();
+                    busCustomerMeter.setYear(year);
+                    busCustomerMeter.setMeterNumber(Integer.parseInt(_customerMeterList[j]));
+                    busCustomerMeter.setRemark(_remark);
+                    busCustomerMeter.setCustomerNumber(Integer.parseInt(_no));
+                    busCustomerMeter.setAddress(_address);
+                    busCustomerMeter.setOrg(busOrg);
+                    busCustomerMeterService.save(busCustomerMeter);
+                }
+            }
+            //算出季度用水
+            Float quarterlyPlan = _plan / 4;
+            //算出月份用水
+            Float monthPlan = _plan / 12;
+            //生成年计划
+            BusAnnualPlanForWater busAnnualPlanForWater = new BusAnnualPlanForWater();
+            busAnnualPlanForWater.setFillTime(now);
+            busAnnualPlanForWater.setOrg(busOrg);
+            busAnnualPlanForWater.setIsCancel("yes");
+            //上年用水量
+            busAnnualPlanForWater.setPriYearUseWater(_actual);
+            //计划用水量
+            busAnnualPlanForWater.setPlanOfWater(_plan);
+            busAnnualPlanForWater.setReplyOfWater(_plan);
+            //计划季度用水量
+            busAnnualPlanForWater.setFirstQuarterPlan(quarterlyPlan);
+            busAnnualPlanForWater.setSecondQuarterPlan(quarterlyPlan);
+            busAnnualPlanForWater.setThirdQuarterPlan(quarterlyPlan);
+            busAnnualPlanForWater.setFourthQuarterPlan(quarterlyPlan);
+
+            busAnnualPlanForWater.setFirstQuarterReply(quarterlyPlan);
+            busAnnualPlanForWater.setSecondQuarterReply(quarterlyPlan);
+            busAnnualPlanForWater.setThirdQuarterReply(quarterlyPlan);
+            busAnnualPlanForWater.setFourthQuarterReply(quarterlyPlan);
+
+            busAnnualPlanForWater.setJanPlan(monthPlan);
+            busAnnualPlanForWater.setFebPlan(monthPlan);
+            busAnnualPlanForWater.setMarPlan(monthPlan);
+            busAnnualPlanForWater.setAprPlan(monthPlan);
+            busAnnualPlanForWater.setMayPlan(monthPlan);
+            busAnnualPlanForWater.setJunPlan(monthPlan);
+            busAnnualPlanForWater.setJulPlan(monthPlan);
+            busAnnualPlanForWater.setAugPlan(monthPlan);
+            busAnnualPlanForWater.setSeptPlan(monthPlan);
+            busAnnualPlanForWater.setOctPlan(monthPlan);
+            busAnnualPlanForWater.setNovPlan(monthPlan);
+            busAnnualPlanForWater.setDecPlan(monthPlan);
+
+            busAnnualPlanForWater.setJanReply(monthPlan);
+            busAnnualPlanForWater.setFebReply(monthPlan);
+            busAnnualPlanForWater.setMarReply(monthPlan);
+            busAnnualPlanForWater.setAprReply(monthPlan);
+            busAnnualPlanForWater.setMayReply(monthPlan);
+            busAnnualPlanForWater.setJunReply(monthPlan);
+            busAnnualPlanForWater.setJulReply(monthPlan);
+            busAnnualPlanForWater.setAugReply(monthPlan);
+            busAnnualPlanForWater.setSeptReply(monthPlan);
+            busAnnualPlanForWater.setOctReply(monthPlan);
+            busAnnualPlanForWater.setNovReply(monthPlan);
+            busAnnualPlanForWater.setDecReply(monthPlan);
+            busAnnualPlanForWaterService.save(busAnnualPlanForWater);
+            //生成季考核
+            for (int j = 1; j <= 4; j++) {
+                BusQuarterlyAssessment busQuarterlyAssessment = new BusQuarterlyAssessment();
+                busQuarterlyAssessment.setAssessmentQuarter(j);
+                busQuarterlyAssessment.setWaterPlanningIndex(quarterlyPlan);
+                busQuarterlyAssessment.setReplyOfWater(quarterlyPlan);
+                busQuarterlyAssessment.setOrg(busOrg);
+                busQuarterlyAssessment.setIsWriteOff("no");
+                busQuarterlyAssessment.setWaterPrice(_waterPrice);
+                busQuarterlyAssessmentService.save(busQuarterlyAssessment);
+
+            }
+            //生成月份考核
+            for (int j = 1; j <= 12; j++) {
+                BusMonthAssessment busMonthAssessment = new BusMonthAssessment();
+                busMonthAssessment.setAssessmentMonth(j);
+                busMonthAssessment.setWaterPlanningIndex(monthPlan);
+                busMonthAssessment.setReplyOfWater(monthPlan);
+                busMonthAssessment.setOrg(busOrg);
+                busMonthAssessment.setIsWriteOff("no");
+                busMonthAssessmentService.save(busMonthAssessment);
+            }
+        }
+    }
+
+    @Override
+    public void updateInitbusQuarterlyAssessment(int assessmentQuarter,
+                                                 String year, Date initStartTime, Date initEndTime,
+                                                 Date bMonthStartTime, Date bMonthEndTime, Date eMonthStartTime,
+                                                 Date eMonthEndTime) {
+        this.busOrgDao.updateInitbusQuarterlyAssessment(assessmentQuarter, year, initStartTime, initEndTime, bMonthStartTime, bMonthEndTime, eMonthStartTime, eMonthEndTime);
+
+    }
+
+    @Override
+    public void updateInitbusMonthAssessment(int assessmentMonth,
+                                             String year, Date initStartTime, Date initEndTime,
+                                             Date bMonthStartTime, Date bMonthEndTime, Date eMonthStartTime,
+                                             Date eMonthEndTime) {
+        this.busOrgDao.updateInitbusMonthAssessment(assessmentMonth, year, initStartTime, initEndTime, bMonthStartTime, bMonthEndTime, eMonthStartTime, eMonthEndTime);
+
+    }
+
+    @Override
+    public void updateInitbusHalfYearAssessment(int assessmentQuarter,
+                                                String year, Date initStartTime, Date initEndTime,
+                                                Date bMonthStartTime, Date bMonthEndTime, Date eMonthStartTime,
+                                                Date eMonthEndTime, Float GR) {
+        this.busOrgDao.updateInitbusHalfYearAssessment(assessmentQuarter, year, initStartTime, initEndTime, bMonthStartTime, bMonthEndTime, eMonthStartTime, eMonthEndTime, GR);
+
+    }
+
+    @Override
+    public List<BusOrgTemp> getPlanYearCountData(String orgNumber,
+                                                 String orgName, String year, String busOrgCustomerNumber,
+                                                 String address, String userType, String orgTypeId) throws UnsupportedEncodingException {
+        // TODO Auto-generated method stub
+        return this.busOrgDao.getPlanYearCountData(orgNumber, orgName, year, busOrgCustomerNumber, address, userType, orgTypeId);
+    }
+
+    @Override
+    public String getMaxUserPlanYear() {
+        // TODO Auto-generated method stub
+        return this.busOrgDao.getMaxUserPlanYear();
+    }
+
+    @Override
+    public void initOneData(Long orgId, int nextYear, String type) {
+        this.busOrgDao.initOneData(orgId, nextYear, type);
+
+    }
+
+    @Override
+    public List<ReplyPrintTemp> unitYearReplyPrin(String orgNumber, String orgName,
+                                                  String year, String busOrgCustomerNumber, String address,
+                                                  String busOrgMeterNumber, String priYearUseWater, String userType, String orgTypeId) {
+        String sql = " SELECT b.`org_name`,w.`first_quarter_reply` AS numOne,w.`second_quarter_reply` AS numTwo,w.`third_quarter_reply` AS numThird,w.`fourth_quarter_reply` AS numFourth,GROUP_CONCAT(bm.`meter_Number`) AS meterNum,w.reply_of_water "
+                + " FROM `bus_org` b "
+                + " JOIN `bus_annual_plan_for_water` w ON b.`org_id` = w.`org_id` JOIN `bus_customer_meter` bm ON b.`org_id`=bm.`org_id` "
+                + " WHERE b.`is_plan_user`='yes' AND w.`is_cancel`='yes' ";
+        if (!orgNumber.equals("")) {
+            sql += " and b.org_number=" + orgNumber;
+        }
+        if (!orgName.equals("")) {
+            try {
+                orgName = new String(orgName.getBytes("iso8859-1"), "UTF-8");
+            } catch (UnsupportedEncodingException e) {
+
+                e.printStackTrace();
+            }
+            sql += " and b.org_name like '%" + orgName + "%'";
+        }
+        if (orgTypeId != null && !orgTypeId.equals("")) {
+            try {
+                orgTypeId = new String(orgTypeId.getBytes("iso8859-1"), "UTF-8");
+            } catch (UnsupportedEncodingException e) {
+
+                e.printStackTrace();
+            }
+            sql += " and b.org_type_id = " + orgTypeId + "";
+        }
+        sql += " and b.year=" + year;
+        if (!address.equals("")) {
+            try {
+                address = new String(address.getBytes("iso8859-1"), "UTF-8");
+            } catch (UnsupportedEncodingException e) {
+
+                e.printStackTrace();
+            }
+            sql += " and b.address like '%" + address + "%'";
+        }
+        if (!priYearUseWater.equals("")) {
+            Float f = Float.parseFloat(priYearUseWater);
+            sql += " and w.pri_year_usewater >=" + f;
+        }
+        if (!userType.equals("")) {
+            sql += " and b.user_type=" + userType;
+        }
+        sql += " GROUP BY b.`org_id`";
+        if (!busOrgCustomerNumber.equals("")) {
+            sql += " having GROUP_CONCAT(bm.`meter_Number`) like '%" + busOrgCustomerNumber + "%'";
+        }
+        if (!busOrgMeterNumber.equals("")) {
+            sql += " and GROUP_CONCAT(bm.`customer_Number`) like '%" + busOrgMeterNumber + "%'";
+        }
+        RowMapper<ReplyPrintTemp> rowMapper = new RowMapper<ReplyPrintTemp>() {
+
+            @Override
+            public ReplyPrintTemp mapRow(ResultSet rs, int arg1) throws SQLException {
+                ReplyPrintTemp busOrgTem = new ReplyPrintTemp(rs.getString("org_name"), rs.getFloat("numOne"), rs.getFloat("numTwo"),
+                        rs.getFloat("numThird"), rs.getFloat("numFourth"), rs.getString("meterNum"), rs.getFloat("reply_of_water"));
+                return busOrgTem;
+            }
+
+        };
+        List<ReplyPrintTemp> list = jdbcTemplate.query(sql, rowMapper);
+        return list;
+    }
+
+
+    public List<ReplyMonPrintTemp> unitYearReplyPrin2(String orgNumber, String orgName,
+                                                   String year, String busOrgCustomerNumber, String address,
+                                                   String busOrgMeterNumber, String priYearUseWater, String userType, String orgTypeId) {
+        String sql = " SELECT b.`org_name`,w.jan_reply,w.feb_reply,w.mar_reply,w.apr_reply,w.may_reply,w.jun_reply,w.jul_reply,w.aug_reply,w.sept_reply,w.oct_reply,w.nov_reply,w.dec_reply,GROUP_CONCAT(bm.`meter_Number`) AS meterNum,w.reply_of_water "
+                + " FROM `bus_org` b "
+                + " JOIN `bus_annual_plan_for_water` w ON b.`org_id` = w.`org_id` JOIN `bus_customer_meter` bm ON b.`org_id`=bm.`org_id` "
+                + " WHERE b.`is_plan_user`='yes' AND w.`is_cancel`='yes' ";
+        if (!orgNumber.equals("")) {
+            sql += " and b.org_number=" + orgNumber;
+        }
+        if (!orgName.equals("")) {
+            try {
+                orgName = new String(orgName.getBytes("iso8859-1"), "UTF-8");
+            } catch (UnsupportedEncodingException e) {
+
+                e.printStackTrace();
+            }
+            sql += " and b.org_name like '%" + orgName + "%'";
+        }
+        if (orgTypeId != null && !orgTypeId.equals("")) {
+            try {
+                orgTypeId = new String(orgTypeId.getBytes("iso8859-1"), "UTF-8");
+            } catch (UnsupportedEncodingException e) {
+
+                e.printStackTrace();
+            }
+            sql += " and b.org_type_id = " + orgTypeId + "";
+        }
+        sql += " and b.year=" + year;
+        if (!address.equals("")) {
+            try {
+                address = new String(address.getBytes("iso8859-1"), "UTF-8");
+            } catch (UnsupportedEncodingException e) {
+
+                e.printStackTrace();
+            }
+            sql += " and b.address like '%" + address + "%'";
+        }
+        if (!priYearUseWater.equals("")) {
+            Float f = Float.parseFloat(priYearUseWater);
+            sql += " and w.pri_year_usewater >=" + f;
+        }
+        if (!userType.equals("")) {
+            sql += " and b.user_type=" + userType;
+        }
+        sql += " GROUP BY b.`org_id`";
+        if (!busOrgCustomerNumber.equals("")) {
+            sql += " having GROUP_CONCAT(bm.`meter_Number`) like '%" + busOrgCustomerNumber + "%'";
+        }
+        if (!busOrgMeterNumber.equals("")) {
+            sql += " and GROUP_CONCAT(bm.`customer_Number`) like '%" + busOrgMeterNumber + "%'";
+        }
+        RowMapper<ReplyMonPrintTemp> rowMapper = new RowMapper<ReplyMonPrintTemp>() {
+
+            @Override
+            public ReplyMonPrintTemp mapRow(ResultSet rs, int arg1) throws SQLException {
+                ReplyMonPrintTemp busOrgTem = new ReplyMonPrintTemp(rs.getString("org_name"),
+                        rs.getFloat("jan_reply"),
+                        rs.getFloat("feb_reply"),
+                        rs.getFloat("mar_reply"),
+                        rs.getFloat("apr_reply"),
+                        rs.getFloat("may_reply"),
+                        rs.getFloat("jun_reply"),
+                        rs.getFloat("jul_reply"),
+                        rs.getFloat("aug_reply"),
+                        rs.getFloat("sept_reply"),
+                        rs.getFloat("oct_reply"),
+                        rs.getFloat("nov_reply"),
+                        rs.getFloat("dec_reply"),
+                        rs.getString("meterNum"), rs.getFloat("reply_of_water"));
+                return busOrgTem;
+            }
+
+        };
+        List<ReplyMonPrintTemp> list = jdbcTemplate.query(sql, rowMapper);
+        return list;
+    }
+
+
+    @Override
+    public List<OrgTemp> emailPrintView(String orgNumber, String orgName,
+                                        String year, String busOrgCustomerNumber, String address,
+                                        String busOrgMeterNumber, String priYearUseWater, String userType, String orgTypeId) throws UnsupportedEncodingException {
+        String sql = " SELECT b.`code`,b.`org_name`,b.postal_address FROM `bus_org` b " +
+                " LEFT JOIN `bus_annual_plan_for_water` w ON b.`org_id` = w.`org_id` WHERE b.`year`='" + year + "' AND b.`is_plan_user`='yes' AND w.`is_cancel`='yes'";
+        if (!orgNumber.equals("")) {
+            sql += " and b.org_number=" + orgNumber;
+        }
+        if (!orgName.equals("")) {
+            orgName = new String(orgName.getBytes("iso8859-1"), "UTF-8");
+            sql += " and b.org_name like '%" + orgName + "%'";
+        }
+        if (!orgTypeId.equals("")) {
+            orgTypeId = new String(orgTypeId.getBytes("iso8859-1"), "UTF-8");
+            sql += " and b.org_type_id = " + orgTypeId + "";
+        }
+        if (!address.equals("")) {
+            address = new String(address.getBytes("iso8859-1"), "UTF-8");
+            sql += " and b.address like '%" + address + "%'";
+        }
+        if (!priYearUseWater.equals("")) {
+            Float f = Float.parseFloat(priYearUseWater);
+            sql += " and w.pri_year_usewater>=" + f;
+        }
+        if (!userType.equals("")) {
+            sql += " and b.user_type=" + userType;
+        }
+        if (!busOrgCustomerNumber.equals("")) {
+            sql += " and b.org_id in (select bm.org_id from `bus_customer_meter` bm where bm.year='" + year + "' and bm.customer_Number=" + busOrgCustomerNumber + ")";
+        }
+        if (!busOrgMeterNumber.equals("")) {
+            sql += " and b.org_id in (select bcm.org_id from `bus_customer_meter` bcm where bcm.year='" + year + "' and bcm.meter_Number=" + busOrgMeterNumber + ")";
+        }
+        RowMapper<OrgTemp> rowMapper = new RowMapper<OrgTemp>() {
+
+            @Override
+            public OrgTemp mapRow(ResultSet rs, int arg1) throws SQLException {
+                OrgTemp org = new OrgTemp(rs.getString("code"), rs.getString("org_name"), rs.getString("postal_address"));
+                return org;
+            }
+
+        };
+        List<OrgTemp> list = jdbcTemplate.query(sql, rowMapper);
+        return list;
+    }
+
+    @Override
+    public int checkPendingIsNull() {
+        return jdbcTemplate.queryForInt("SELECT COUNT(*) FROM `bus_org` WHERE `import_status`='pending'");
+    }
+
+    @Override
+    public List<Object[]> listCountWaterData(String year) {
+        String sql = " SELECT bwp.`properties_name`,                                       "
+                + " IFNULL((                                                            "
+                + " SELECT SUM(w.`reply_of_water`) FROM `bus_annual_plan_for_water` w   "
+                + " JOIN `bus_meter_read_info` info ON w.`org_id`=info.`org_id` WHERE   "
+                + " bwp.`properties_id`=info.properties_id AND info.year='" + year + "'),0)  "
+                + " AS reply,                                                            "
+                + " IFNULL((                                                             "
+                + " SELECT SUM(i.`water`) FROM `bus_meter_read_info` i                   "
+                + " JOIN `bus_annual_plan_for_water` fw ON i.`org_id` = fw.`org_id`      "
+                + " WHERE i.`year`='" + year + "' AND i.`properties_id`=bwp.`properties_id`),0)  "
+                + " AS userWater                                                         "
+                + " FROM `base_water_properties` bwp                                     "
+                + " UNION ALL                                                            "
+                + " ("
+                + " SELECT '总计',IFNULL(SUM(bap.`reply_of_water`),0),IFNULL(SUM(bm.`water`),0)                          "
+                + " FROM `base_water_properties` p JOIN `bus_meter_read_info` bm ON p.`properties_id`=bm.`properties_id` "
+                + " JOIN `bus_annual_plan_for_water` bap ON bm.`org_id`=bap.`org_id` WHERE bm.`year`='" + year + "'              "
+                + " )";
+        RowMapper<Object[]> rowMapper = new RowMapper<Object[]>() {
+
+            @Override
+            public Object[] mapRow(ResultSet rs, int arg1)
+                    throws SQLException {
+                Object[] obj = new Object[3];
+                obj[0] = rs.getString("properties_name");
+                obj[1] = rs.getFloat("reply");
+                obj[2] = rs.getFloat("userWater");
+                return obj;
+            }
+        };
+        List<Object[]> list = jdbcTemplate.query(sql, rowMapper);
+        return list;
+    }
+
+    @Override
+    public void updateIsplanYear(String year) {
+        this.busOrgDao.updateIsplanYear(year);
+
+    }
+
+    @Override
+    public void updateSetplanYear(String initYear, Date initStartTime,
+                                  Date initEndTime, Date bMonthStartTime, Date bMonthEndTime,
+                                  Date eMonthStartTime, Date eMonthEndTime, Float checkWater) {
+        this.busOrgDao.updateSetplanYear(initYear, initStartTime, initEndTime, bMonthStartTime, bMonthEndTime, eMonthStartTime, eMonthEndTime, checkWater);
+
+    }
+
+    @Override
+    public void updateCosMeter(String year) {
+        this.busOrgDao.updateCosMeter(year);
+
+    }
+
+    @Override
+    public void delteInfoForSplitOrg(Long orgId) {
+        //先删除用水信息
+        jdbcTemplate.update("DELETE FROM `bus_meter_read_info` WHERE `org_id`=?", orgId);
+        //删除对应水表
+        jdbcTemplate.update("DELETE FROM `bus_customer_meter` WHERE `org_id`=?", orgId);
+        //删除年度供水计划
+        jdbcTemplate.update("DELETE FROM `bus_annual_plan_for_water` WHERE `org_id`=?", orgId);
+        //删除季度考核
+        jdbcTemplate.update("DELETE FROM `bus_quarterly_assessment` WHERE `org_id`=?", orgId);
+        //删除单位
+        jdbcTemplate.update("DELETE FROM `bus_org` WHERE `org_id`=?", orgId);
+    }
+
+    @Override
+    public Long findOrgNumberByYear(Integer orgNumber) {
+        String sql = "SELECT o.`org_id` FROM `bus_org` o WHERE o.`org_number` = " + orgNumber + " AND o.`year` = DATE_FORMAT( CURRENT_TIMESTAMP(),'%Y' ) AND o.`import_status` = 'normal'";
+        Long orgId = jdbcTemplate.queryForLong(sql);
+        return orgId;
+    }
+
+    @Override
+    public void updateAddress(String orgId, String postalAddress) {
+        jdbcTemplate.update("UPDATE `bus_org` SET `postal_address`=? WHERE `org_id`=?", postalAddress, orgId);//
+
+    }
 }

+ 61 - 42
src/java/com/bus/web/BusInitController.java

@@ -25,6 +25,7 @@ import javax.servlet.http.HttpServletResponse;
 
 import com.base.service.IBaseOrgTypeService;
 import com.bus.model.*;
+import com.bus.model.temp.*;
 import com.bus.service.*;
 import com.core.util.excel.ExcelImport;
 import jxl.Workbook;
@@ -54,12 +55,6 @@ import com.base.model.BaseSection;
 import com.base.model.BaseStatus;
 import com.base.model.enumType.UserType;
 import com.base.service.IBaseStatusService;
-import com.bus.model.temp.BusOrgTemp;
-import com.bus.model.temp.BusPlanTempRowMap;
-import com.bus.model.temp.OrgTemp;
-import com.bus.model.temp.OrgTypeCountTemp;
-import com.bus.model.temp.ReplyPrintTemp;
-import com.bus.model.temp.unitCountYearRowMap;
 import com.core.dao.util.Updater;
 import com.core.util.FileUploadUtils;
 import com.core.util.JsonUtil;
@@ -211,6 +206,7 @@ public class BusInitController extends BaseController {
         }
         return "bus/org-init-create";
     }
+
     @RequestMapping("gotoImpInitYearTimePage.do")
     public String gotoImpInitYearTimePage(String orgIds, String year, Model model) {
 
@@ -222,19 +218,20 @@ public class BusInitController extends BaseController {
 
     /**
      * 导入年计划
+     *
      * @return
      * @throws ParseException
      */
     @RequestMapping("importExceInitData.do")
     @ResponseBody
-    public void importExceInitData(HttpServletRequest request,HttpServletResponse response,final String year,ModelMap model) throws  IOException {
-        log.info("****年计划信息导入,导入年份:"+year);
+    public void importExceInitData(HttpServletRequest request, HttpServletResponse response, final String year, ModelMap model) throws IOException {
+        log.info("****年计划信息导入,导入年份:" + year);
         MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
         Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
         //        Map<String, Object> map = new HashMap<String, Object>();
         response.setContentType("text/html;charset=utf-8");
         PrintWriter print = response.getWriter();
-        if (fileMap==null || fileMap.size()<=0){
+        if (fileMap == null || fileMap.size() <= 0) {
             print.write("<script type='text/javascript'>alert('请选择文件!');</script>");
             return;
         }
@@ -249,15 +246,15 @@ public class BusInitController extends BaseController {
             dataList = ExcelImport.getExcelData(file);
         } catch (Exception e) {
             e.printStackTrace();
-            print.write("<script type='text/javascript'>alert('"+e.getMessage()+"');</script>");
+            print.write("<script type='text/javascript'>alert('" + e.getMessage() + "');</script>");
             return;
         }
 
-        if(dataList==null){
+        if (dataList == null) {
             print.write("<script type='text/javascript'>alert('数据为空');</script>");
-            return ;
+            return;
         }
-        busOrgService.importExceInitData(year,dataList);
+        busOrgService.importExceInitData(year, dataList);
         print.write("<script type='text/javascript'>top.frmright.resetSearch();top.Dialog.close();</script>");
     }
 
@@ -278,7 +275,7 @@ public class BusInitController extends BaseController {
         SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         try {
             if (ids.length() <= 0) {// 没有选择则所有生成年度计划初值化
-                doInityearDate(f.parse(startTime), f.parse(endTime),year);
+                doInityearDate(f.parse(startTime), f.parse(endTime), year);
             } else {
                 String[] strs = ids.split(",");
                 for (String str : strs) {
@@ -1024,7 +1021,7 @@ public class BusInitController extends BaseController {
             //修改月考核表
             String hqlmon = "select q from BusMonthAssessment q where q.org.orgId=? order by q.assessmentMonth";
             List<BusMonthAssessment> list2 = busMonthAssessmentService.findByHql(hqlmon, orgId);
-            for(int i = 0; i < list2.size(); i++){
+            for (int i = 0; i < list2.size(); i++) {
                 switch (i + 1) {
                     case 1:
                         BusMonthAssessment qa1 = list2.get(i);
@@ -1140,7 +1137,6 @@ public class BusInitController extends BaseController {
             }
 
 
-
             if (plan.getFirstQuarterAdjust() != null && plan.getFirstQuarterAdjust() != 0) {
                 //qa1.setWaterPlanningIndex(plan.getFirstQuarterAdjust());
                 plan.setFirstQuarterReply(plan.getFirstQuarterAdjust());
@@ -1289,7 +1285,7 @@ public class BusInitController extends BaseController {
             orgName = new String(orgName.getBytes("iso8859-1"), "UTF-8");
             hql += " and o.orgName like '%" + orgName + "%'";
         }
-        if (orgTypeId !=null && !orgTypeId.equals("")) {
+        if (orgTypeId != null && !orgTypeId.equals("")) {
 
             orgTypeId = new String(orgTypeId.getBytes("iso8859-1"), "UTF-8");
             hql += " and o.orgTypeId = " + orgTypeId + "";
@@ -1425,26 +1421,26 @@ public class BusInitController extends BaseController {
                 sheet.addCell(new Label(3, row, plan.getPostCode()));//邮编
                 sheet.addCell(new Label(4, row, plan.getOrgMeterNumber()));//水表户号
                 sheet.addCell(new Label(5, row, plan.getYear()));//年度
-                sheet.addCell(new Label(6, row, (plan.getPriYearUseWater()!=null?Math.round(plan.getPriYearUseWater()):0) + ""));//上一年实际用水量
+                sheet.addCell(new Label(6, row, (plan.getPriYearUseWater() != null ? Math.round(plan.getPriYearUseWater()) : 0) + ""));//上一年实际用水量
 //                sheet.addCell(new Label(7, row, Math.round(plan.getFirstQuarterReply()) + ""));//一季度
 //                sheet.addCell(new Label(8, row, Math.round(plan.getSecondQuarterReply()) + ""));//二季度
 //                sheet.addCell(new Label(9, row, Math.round(plan.getThirdQuarterReply()) + ""));//三季度
 //                sheet.addCell(new Label(10, row, Math.round(plan.getFourthQuarterReply()) + ""));//四季度
-                sheet.addCell(new Label(7, row, (plan.getPlanOfWater()!=null?Math.round(plan.getPlanOfWater()):0)+ ""));//全年计划
-                sheet.addCell(new Label(8, row, (plan.getReplyOfWater()!=null?Math.round(plan.getReplyOfWater()):0) + ""));//全年批复
+                sheet.addCell(new Label(7, row, (plan.getPlanOfWater() != null ? Math.round(plan.getPlanOfWater()) : 0) + ""));//全年计划
+                sheet.addCell(new Label(8, row, (plan.getReplyOfWater() != null ? Math.round(plan.getReplyOfWater()) : 0) + ""));//全年批复
                 sheet.addCell(new Label(9, row, plan.getOrgType()));//用户类型
-                sheet.addCell(new Label(10, row, (plan.getJanPlan()!=null?Math.round(plan.getJanPlan()):0)+""));//一月份计划
-                sheet.addCell(new Label(11, row, (plan.getFebPlan()!=null?Math.round(plan.getFebPlan()):0)+""));//二月份计划
-                sheet.addCell(new Label(12, row, (plan.getMarPlan()!=null?Math.round(plan.getMarPlan()):0)+""));//三月份计划
-                sheet.addCell(new Label(13, row, (plan.getAprPlan()!=null?Math.round(plan.getAprPlan()):0)+""));//四月份计划
-                sheet.addCell(new Label(14, row, (plan.getMayPlan()!=null?Math.round(plan.getMayPlan()):0)+""));//五月份计划
-                sheet.addCell(new Label(15, row, (plan.getJunPlan()!=null?Math.round(plan.getJunPlan()):0)+""));//六月份计划
-                sheet.addCell(new Label(16, row, (plan.getJulPlan()!=null?Math.round(plan.getJulPlan()):0)+""));//七月份计划
-                sheet.addCell(new Label(17, row, (plan.getAugPlan()!=null?Math.round(plan.getAugPlan()):0)+""));//八月份计划
-                sheet.addCell(new Label(18, row, (plan.getSeptPlan()!=null?Math.round(plan.getSeptPlan()):0)+""));//九月份计划
-                sheet.addCell(new Label(19, row, (plan.getOctPlan()!=null?Math.round(plan.getOctPlan()):0)+""));//十月份计划
-                sheet.addCell(new Label(20, row, (plan.getNovPlan()!=null?Math.round(plan.getNovPlan()):0)+""));//十一月份计划
-                sheet.addCell(new Label(21, row, (plan.getDecPlan()!=null?Math.round(plan.getDecPlan()):0)+""));//十二月份计划
+                sheet.addCell(new Label(10, row, (plan.getJanPlan() != null ? Math.round(plan.getJanPlan()) : 0) + ""));//一月份计划
+                sheet.addCell(new Label(11, row, (plan.getFebPlan() != null ? Math.round(plan.getFebPlan()) : 0) + ""));//二月份计划
+                sheet.addCell(new Label(12, row, (plan.getMarPlan() != null ? Math.round(plan.getMarPlan()) : 0) + ""));//三月份计划
+                sheet.addCell(new Label(13, row, (plan.getAprPlan() != null ? Math.round(plan.getAprPlan()) : 0) + ""));//四月份计划
+                sheet.addCell(new Label(14, row, (plan.getMayPlan() != null ? Math.round(plan.getMayPlan()) : 0) + ""));//五月份计划
+                sheet.addCell(new Label(15, row, (plan.getJunPlan() != null ? Math.round(plan.getJunPlan()) : 0) + ""));//六月份计划
+                sheet.addCell(new Label(16, row, (plan.getJulPlan() != null ? Math.round(plan.getJulPlan()) : 0) + ""));//七月份计划
+                sheet.addCell(new Label(17, row, (plan.getAugPlan() != null ? Math.round(plan.getAugPlan()) : 0) + ""));//八月份计划
+                sheet.addCell(new Label(18, row, (plan.getSeptPlan() != null ? Math.round(plan.getSeptPlan()) : 0) + ""));//九月份计划
+                sheet.addCell(new Label(19, row, (plan.getOctPlan() != null ? Math.round(plan.getOctPlan()) : 0) + ""));//十月份计划
+                sheet.addCell(new Label(20, row, (plan.getNovPlan() != null ? Math.round(plan.getNovPlan()) : 0) + ""));//十一月份计划
+                sheet.addCell(new Label(21, row, (plan.getDecPlan() != null ? Math.round(plan.getDecPlan()) : 0) + ""));//十二月份计划
                 row += 1;
             }
             if (this.page.hasNextPage()) {
@@ -1547,7 +1543,7 @@ public class BusInitController extends BaseController {
         if (year.equals("")) {
             year = getCurrentYear();
         }
-        List<ReplyPrintTemp> list = new ArrayList<ReplyPrintTemp>();
+        List<ReplyMonPrintTemp> list = new ArrayList<ReplyMonPrintTemp>();
         if (ids.length > 0) {
             for (Long orgId : ids) {
                 BusOrg org = busOrgService.get(orgId);
@@ -1566,16 +1562,38 @@ public class BusInitController extends BaseController {
                     }
                 }
                 BusAnnualPlanForWater water = org.getBusAnnualPlanForWater();
-                Float one = water.getFirstQuarterReply();
-                Float two = water.getSecondQuarterReply();
-                Float three = water.getThirdQuarterReply();
-                Float fourth = water.getFourthQuarterReply();
+
+                Float _janReply = water.getJanReply();
+                Float _febReply = water.getFebReply();
+                Float _marReply = water.getMarReply();
+                Float _aprReply = water.getAprReply();
+                Float _mayReply = water.getMayReply();
+                Float _junReply = water.getJunReply();
+                Float _julReply = water.getJulReply();
+                Float _augReply = water.getAugReply();
+                Float _septReply = water.getSeptReply();
+                Float _octReply = water.getOctReply();
+                Float _novReply = water.getNovReply();
+                Float _decReply = water.getDecReply();
                 Float reply = water.getReplyOfWater();
-                ReplyPrintTemp temp = new ReplyPrintTemp(name, one, two, three, fourth, meter, reply);
+                ReplyMonPrintTemp temp = new ReplyMonPrintTemp(name,
+                        _janReply,
+                        _febReply,
+                        _marReply,
+                        _aprReply,
+                        _mayReply,
+                        _junReply,
+                        _julReply,
+                        _augReply,
+                        _septReply,
+                        _octReply,
+                        _novReply,
+                        _decReply,
+                        meter, reply);
                 list.add(temp);
             }
         } else {
-            list = busOrgService.unitYearReplyPrin(orgNumber, orgName, year, busOrgCustomerNumber, address, busOrgMeterNumber, priYearUseWater, userType, orgTypeId);
+            list = busOrgService.unitYearReplyPrin2(orgNumber, orgName, year, busOrgCustomerNumber, address, busOrgMeterNumber, priYearUseWater, userType, orgTypeId);
         }
         model.addAttribute("unit", list);
         model.addAttribute("year", year);
@@ -1661,7 +1679,7 @@ public class BusInitController extends BaseController {
         if (year.equals("")) {
             year = getCurrentYear();
         }
-        List<ReplyPrintTemp> list = new ArrayList<ReplyPrintTemp>();
+        List<ReplyMonPrintTemp> list = new ArrayList<ReplyMonPrintTemp>();
         if (ids.length > 0) {
             for (Long orgId : ids) {
                 BusOrg org = busOrgService.get(orgId);
@@ -1681,15 +1699,16 @@ public class BusInitController extends BaseController {
 
                     }
                 }
-                ReplyPrintTemp temp = new ReplyPrintTemp(name, reply, meter);
+                ReplyMonPrintTemp temp = new ReplyMonPrintTemp(name, reply, meter);
                 list.add(temp);
             }
         } else {
-            list = busOrgService.unitYearReplyPrin(orgNumber, orgName, year, busOrgCustomerNumber, address, busOrgMeterNumber, priYearUseWater, userType, orgTypeId);
+            list = busOrgService.unitYearReplyPrin2(orgNumber, orgName, year, busOrgCustomerNumber, address, busOrgMeterNumber, priYearUseWater, userType, orgTypeId);
         }
         if (list != null)
             model.addAttribute("listLength", list.size());
         model.addAttribute("list", list);
+        model.addAttribute("year", year);
         return "bus/org-year-plan-notice-print";
     }
 

+ 7 - 0
src/java/com/bus/web/BusMonthAssessmentController.java

@@ -804,4 +804,11 @@ public class BusMonthAssessmentController extends BaseController {
         System.out.println(s);
         return s;
     }
+
+    @ResponseBody
+    @RequestMapping("recalculation.do")
+    public Object recalculation(String year,String month){
+        busMonthAssessmentService.recalculation(year,month);
+        return addJsonSuccessMsg("重算发送成功!");
+    }
 }

+ 1 - 1
src/java/com/core/util/AppUtil.java

@@ -34,7 +34,7 @@ public class AppUtil implements ApplicationContextAware {
 	@Override
 	public void setApplicationContext(ApplicationContext contex)
 			throws BeansException {
-		System.out.println("fdggggggggggggggd");
+		//System.out.println("fdggggggggggggggd");
 		this.applicationContext = contex;
 	}