ソースを参照

xls导出修改

fanghuisheng 3 年 前
コミット
9716a8c3da

+ 2 - 0
WebRoot/view/patrolplan/scripts/patrolplan.js

@@ -395,6 +395,7 @@ Ext.onReady(function(){
                         name:"start_time",
             			minValue:'00:00',
             			maxValue:'24:00',
+						editable:false,//只读约束
             			minText:'时间要大于{0}',
             			maxText:'时间要小于{0}',
             			format:'G:i',//时间格式G(24小时进制)、i、s(时分秒,g是12小时进制)
@@ -408,6 +409,7 @@ Ext.onReady(function(){
                         name:"end_time",
             			minValue:'00:00',
             			maxValue:'24:00',
+						editable:false,//只读约束
             			minText:'时间要大于{0}',
             			maxText:'时间要小于{0}',
             			format:'G:i',//时间格式G(24小时进制)、i、s(时分秒,g是12小时进制)

+ 31 - 64
src/cn/com/usky/iot/excel/service/ExcelServiceImpl.java

@@ -554,8 +554,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"FileDatamonitoring"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"FileDatamonitoring"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -715,8 +714,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"WaterDatamonitoring"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"WaterDatamonitoring"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -876,8 +874,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"RtuDatamonitoring"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"RtuDatamonitoring"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -1133,8 +1130,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"FireAlarm"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"FireAlarm"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -1294,8 +1290,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"EfireAlarm"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"EfireAlarm"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -1538,8 +1533,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"WaterAlarm"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"WaterAlarm"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -1783,8 +1777,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"LiftAlarm"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"LiftAlarm"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -2027,8 +2020,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"RTUAlarm"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"RTUAlarm"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -2188,8 +2180,7 @@ public class ExcelServiceImpl implements ExcelService {
 			File newFile1 = new File(path+"userUpload/");
 			if(!newFile1.exists())
 				newFile1.mkdir();
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"Datamonitoring"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -2349,8 +2340,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"PatrolPlanExcel"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"PatrolPlanExcel"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -2510,8 +2500,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"InspectionRecordExcel"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"InspectionRecordExcel"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -2671,8 +2660,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"CheckRecordExcel"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"CheckRecordExcel"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -2832,8 +2820,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"RouteExcel"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"RouteExcel"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -2993,8 +2980,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"InspectorsExcel"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"InspectorsExcel"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -3154,8 +3140,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"PatrolPointExcel"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"PatrolPointExcel"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -3315,8 +3300,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"QrcodeAnalysisExcel"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"QrcodeAnalysisExcel"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -3476,8 +3460,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"MaintenancePlanExcel"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"MaintenancePlanExcel"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -3637,8 +3620,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"MaintenanceRecordExcel"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"MaintenanceRecordExcel"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -3798,8 +3780,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"Route2Excel"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"Route2Excel"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -3959,8 +3940,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"QrcodeAnalysis2Excel"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"QrcodeAnalysis2Excel"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -4120,8 +4100,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"CheckRecord2Excel"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"CheckRecord2Excel"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -4281,8 +4260,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"MaintenanceExcel"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"MaintenanceExcel"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -4442,8 +4420,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"MaintenancePersonExcel"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"MaintenancePersonExcel"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -4625,8 +4602,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"WbInspectionPointsExcel"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"WbInspectionPointsExcel"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -4808,8 +4784,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"XjInspectionPointsExcel1"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"XjInspectionPointsExcel1"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -4993,8 +4968,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"InspectorsExcel"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"InspectorsExcel"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -5176,8 +5150,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"WbPlanMasterExcel"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"WbPlanMasterExcel"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -5360,8 +5333,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"XjPlanMasterExcel1"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"XjPlanMasterExcel1"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -5544,8 +5516,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"WbSpotOperationRecordExcel"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"WbSpotOperationRecordExcel"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -5729,8 +5700,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"XjSpotOperationRecordExcel1"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"XjSpotOperationRecordExcel1"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -5914,8 +5884,7 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path+"userUpload/"+"EventProcessingExcel"+nowDate+".xls");
-			if(newFile.exists())
-				newFile.delete();
+			
 			FileOutputStream fout = new FileOutputStream(path+"userUpload/"+"EventProcessingExcel"+nowDate+".xls");
 			wb.write(fout);
 			fout.close();
@@ -6174,8 +6143,6 @@ public class ExcelServiceImpl implements ExcelService {
 			if(!newFile1.exists())
 				newFile1.mkdir();
 			File newFile = new File(path + "userUpload/" + "VideoAlarm" + nowDate + ".xls");
-			if (newFile.exists())
-				newFile.delete();
 			FileOutputStream fout = new FileOutputStream(path + "userUpload/" + "VideoAlarm" + nowDate + ".xls");
 			wb.write(fout);
 			fout.close();