Browse Source

Merge remote-tracking branch 'origin/master'

蔡德晨 5 years ago
parent
commit
2fff538e50

+ 5 - 2
src/main/java/com/jeeplus/modules/sg/audit/information/web/InformationController.java

@@ -4,6 +4,7 @@
 package com.jeeplus.modules.sg.audit.information.web;
 
 import java.io.*;
+import java.net.URLDecoder;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -552,8 +553,10 @@ public class InformationController extends BaseController {
                 String[] strArr = projectId.split("\\s+");
                 information.setAttrs(strArr);
             }
-            projectName = request.getParameter("projectName");
-            projectName = new String(projectName.getBytes("iso8859-1"), "utf-8");
+/*            projectName = request.getParameter("projectName");
+            projectName = new String(projectName.getBytes("iso8859-1"), "utf-8");*/
+            projectName = (String)request.getParameter("projectName");
+            projectName = URLDecoder.decode(projectName,"UTF-8");
             information.setProjectName(projectName);
             projectType = request.getParameter("projectType");
             projectType = new String(projectType.getBytes("iso8859-1"), "utf-8");

+ 3 - 3
src/main/java/com/jeeplus/modules/sg/audit/report/mapper/xml/ReportMapper.xml

@@ -202,13 +202,13 @@
 			1=1
 			<if test="type!=null and type!=''">
 				<if test="type==0">
-					and a.department = #{condition}
+					and a.department like concat('%',#{condition},'%')
 				</if>
 				<if test="type==1">
-					and a.underCentralized = #{condition}
+					and a.underCentralized like concat('%',#{condition},'%')
 				</if>
 				<if test="type==2">
-					and a.second_units = #{condition}
+					and a.second_units like concat('%',#{condition},'%')
 				</if>
 			</if>
 			<if test="status!=null and status !=''">

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

@@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.net.URLDecoder;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -311,8 +312,12 @@ public class ReportController {
     public AjaxJson exportInformation(SgReport sgReport,HttpServletRequest request, HttpServletResponse response) {
         AjaxJson j = new AjaxJson();
         try {
+/*
             String condition =  request.getParameter("condition");
             condition = new String(condition.getBytes("iso8859-1"), "utf-8");
+*/
+            String condition = (String)request.getParameter("condition");
+            condition = URLDecoder.decode(condition,"UTF-8");
             String status =  request.getParameter("status");
             String type =  request.getParameter("type");
             sgReport.setStatus(status);

+ 3 - 2
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ErpInfo.java

@@ -355,8 +355,9 @@ public  class ErpInfo {
                     if (materialDetails.contains("kVA")){
                         String str[] =  materialDetails.split(",");
                         for (int k = 0; k < str.length; k++) {
-                            if (str[k].contains("kVA")){
-                                materialDetails = str[k].substring(0,str[k].indexOf("kVA"));
+                            if (str[k].toLowerCase().contains("kva")){
+                                materialDetails = str[k].substring(0,str[k].toLowerCase().indexOf("kva"));
+                                break;
                             }
                         }
                         erpCreditChild1.setEqmTotalCapacity(materialDetails);//添加总容量

+ 1 - 4
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ImportUtil.java

@@ -32,10 +32,7 @@ import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.text.NumberFormat;
 import java.text.SimpleDateFormat;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 /**
  * 导入Excel文件(支持“XLS”和“XLSX”格式)

+ 4 - 3
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/Test.java

@@ -6,12 +6,13 @@ import java.util.regex.Pattern;
 public class Test {
         @org.junit.Test
         public void getTest(){
-            String content = "10kV箱式变电站,400kVA,美式,硅钢片,普通,无环网柜,400kVA";
+            String content = "10kV箱式变电站,400kva,美式,硅钢片,普通,无环网柜,600kVA";
             String str[] =  content.split(",");
             for (int i = 0; i < str.length; i++) {
 //                System.out.println(str[i]);
-                if (str[i].contains("kVA")){
-                    System.out.println(str[i].substring(0,str[i].indexOf("kVA")));
+                    if (str[i].toLowerCase().contains("kva")){
+                    System.out.println(str[i].substring(0,str[i].toLowerCase().indexOf("kva")));
+                    break;
                 }
             }
         }

+ 1 - 1
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/web/ErpCreditController.java

@@ -134,7 +134,7 @@ public class ErpCreditController extends BaseController {
 	}
 
 	/**
-	 * 批量请假表单
+	 * 批量表单
 	 */
 	@ResponseBody
 //	@RequiresPermissions("sg:financial:erpCredit:del")

+ 1 - 1
src/main/resources/properties/jeeplus.properties

@@ -14,7 +14,7 @@
 #mysql database setting
 jdbc.type=mysql
 jdbc.driver=com.mysql.jdbc.Driver
-jdbc.url=jdbc:mysql://192.168.2.4:3306/sg_audit?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
+jdbc.url=jdbc:mysql://192.168.2.4:3306/sg_audit?useUnicode=true&amp;characterEncoding=utf-8&allowMultiQueries=true
 #jdbc.url=jdbc:mysql://localhost:3306/sg_audit?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
 jdbc.username=root
 jdbc.password=root

+ 3 - 1
src/main/webapp/webpage/modules/sg/audit/information/informationList.js

@@ -426,6 +426,7 @@ $(document).ready(function() {
 		var extendedStatus = $("#extendedStatus").val();
 		var extendedTime = $("#extendedTime").val();
 		var hiddenSign = $("#hiddenSign").val();
+
 		console.log(projectId );
 		console.log(projectName);
 		console.log(projectType);
@@ -451,6 +452,7 @@ $(document).ready(function() {
 		var extendedStatus = $("#extendedStatus").val();
 		var extendedTime = $("#extendedTime").val();
 		var hiddenSign = $("#hiddenSign").val();
+		var newProjectName = encodeURI(encodeURI(projectName));
 		console.log(projectId );
 		console.log(projectName);
 		console.log(projectType);
@@ -461,7 +463,7 @@ $(document).ready(function() {
 		console.log(extendedStatus);
 		console.log(extendedTime);
 		console.log(hiddenSign);
-		jp.downloadFile('${ctx}/sg/information/export?projectId='+projectId+'&projectName='+projectName+'&projectType='+projectType+'&projectYear='+projectYear+'&firstUnits='+firstUnits+'&secondUnits='+secondUnits+'&firstFinish='+firstFinish+'&extendedStatus='+extendedStatus+'&extendedTime='+extendedTime+'&hiddenSign='+hiddenSign);
+		jp.downloadFile('${ctx}/sg/information/export?projectId='+projectId+'&projectName='+newProjectName+'&projectType='+projectType+'&projectYear='+projectYear+'&firstUnits='+firstUnits+'&secondUnits='+secondUnits+'&firstFinish='+firstFinish+'&extendedStatus='+extendedStatus+'&extendedTime='+extendedTime+'&hiddenSign='+hiddenSign);
 
 	});
 

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

@@ -46,13 +46,13 @@
 			<tr>
 				<th>完成</th>
 				<c:forEach items="${list}" var="data" varStatus="index">
-					<th><a href="${ctx}/sg/report/exportInformation?condition=${data.name}&status=0&type=0">${data.finishCount}</a></th>
+					<th><a id="finish"><input id="finishOne" type="hidden" value="${data.name}"/>${data.finishCount}</a></th>
 				</c:forEach>
 			</tr>
 			<tr>
 				<th>未完成</th>
 				<c:forEach items="${list}" var="data" varStatus="index">
-					<th><a href="${ctx}/sg/report/exportInformation?condition=${data.name}&status=1&type=0">${data.unfinishCount}</a></th>
+					<th><a id="noFinish">${data.unfinishCount}</a></th>
 				</c:forEach>
 			</tr>
 			</thead>
@@ -121,6 +121,22 @@
 					// 使用刚指定的配置项和数据显示图表。
 					myChart.setOption(option);
 				})
+				//a连接传入参数
+				$("#finish").click(function () {
+					var conditionBe = $("#finishOne").val();
+					var condition = encodeURI(encodeURI(conditionBe));
+					console.log(conditionBe);
+					console.log(condition);
+					jp.downloadFile('${ctx}/sg/report/exportInformation?condition='+condition+'&status=0&type=0')
+				})
+
+				$("#noFinish").click(function () {
+					var conditionBe = $("#finishOne").val();
+					var condition = encodeURI(encodeURI(conditionBe));
+					console.log(conditionBe);
+					console.log(condition);
+					jp.downloadFile('${ctx}/sg/report/exportInformation?condition='+condition+'&status=1&type=0')
+				})
 			})
 		</script>
 	</div>

+ 8 - 8
src/main/webapp/webpage/modules/sg/financial/erp/erpCreditList.js

@@ -37,9 +37,9 @@ $(document).ready(function() {
                //初始化加载第一页,默认第一页
                pageNumber:1,   
                //每页的记录行数(*)   
-               pageSize: 10,  
+               pageSize: 5,
                //可供选择的每页的行数(*)    
-               pageList: [10, 25, 50, 100],
+               pageList: [5,10, 25, 50, 100],
                //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据  
                url: "${ctx}/sg/financial/erpCredit/data",
                //默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
@@ -228,11 +228,11 @@ $(document).ready(function() {
                 auto: true,
 			    title:"导入数据",
 			    content: "${ctx}/tag/importExcel" ,
-			    btn: ['下载模板','确定', '关闭'],
-				btn1: function(index, layero){
-					  jp.downloadFile('${ctx}/sg/financial/erpCredit/import/template');
-				  },
-			    btn2: function(index, layero){
+			    btn: ['确定', '关闭'],
+				// btn1: function(index, layero){
+				// 	  jp.downloadFile('${ctx}/sg/financial/erpCredit/import/template');
+				//   },
+			    btn1: function(index, layero){
 						var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
 						iframeWin.contentWindow.importExcel('${ctx}/sg/financial/erpCredit/import', function (data) {
 							if(data.success){
@@ -246,7 +246,7 @@ $(document).ready(function() {
                     return false;
 				  },
 				 
-				  btn3: function(index){ 
+				  btn2: function(index){
 					  jp.close(index);
 	    	       }
 			});