Переглянути джерело

Merge remote-tracking branch 'origin/master'

zhoupeng 1 рік тому
батько
коміт
0796886819

+ 6 - 0
.gitignore

@@ -0,0 +1,6 @@
+/industry-system/.idea
+/PrintServer/target
+/PrintServer/.idea
+/PrintServer/.mvn/wrapper
+/PrintServer/selenium/Chrome/Application
+/industry-system/HCNetSDKLog

+ 7 - 0
industry-system/README.md

@@ -0,0 +1,7 @@
+## 本地仓库添加依赖包
+```bash
+mvn install:install-file -Dfile=G:\WorkSoft\STS\workspace\industry-data-platform\industry-system\cqcy-ei-common\src\lib\aspose-cells-8.5.2.jar -DgroupId=com.example -DartifactId=aspose-cells  -Dversion=8.5.2  -Dpackaging=jar
+
+mvn install:install-file -Dfile=G:\WorkSoft\STS\workspace\industry-data-platform\industry-system\industry-da\src\main\resources\lib\examples.jar -DgroupId=com.sun.jna -DartifactId=examples  -Dversion=1.0  -Dpackaging=jar
+
+```

+ 8 - 2
industry-system/cqcy-ei-common/pom.xml

@@ -71,12 +71,18 @@
             <artifactId>validation-api</artifactId>
         </dependency>
 
-        <dependency>
+        <!--<dependency>
             <groupId>com.example</groupId>
             <artifactId>aspose-cells</artifactId>
             <version>1.0-SNAPSHOT</version>
             <scope>system</scope>
-            <systemPath>${project.basedir}/src/main/resources/lib/aspose-cells-8.5.2.jar</systemPath>
+            <systemPath>${project.basedir}/src/lib/aspose-cells-8.5.2.jar</systemPath>
+        </dependency>-->
+
+        <dependency>
+            <groupId>com.example</groupId>
+            <artifactId>aspose-cells</artifactId>
+            <version>8.5.2</version>
         </dependency>
 
         <dependency>

+ 0 - 0
industry-system/cqcy-ei-common/src/main/resources/lib/aspose-cells-8.5.2.jar → industry-system/cqcy-ei-common/src/lib/aspose-cells-8.5.2.jar


+ 2 - 4
industry-system/industry-da/pom.xml

@@ -232,11 +232,9 @@
             <version>3.0.9</version>
         </dependency>
         <dependency>
-            <groupId>com.example.opc_da</groupId>
+            <groupId>com.sun.jna</groupId>
             <artifactId>examples</artifactId>
-            <version>0.0.1-SNAPSHOT</version>
-            <scope>system</scope>
-            <systemPath>${basedir}/src/main/resources/lib/examples.jar</systemPath>
+            <version>1.0</version>
         </dependency>
         <!--        modbus4j只能从本都仓库引用,不能使用basedir引用,否则在工厂初始化时,会找不到modbus4j的jar包-->
         <dependency>

+ 0 - 0
industry-system/industry-da/src/main/resources/lib/bcprov-jdk15on-1.50.jar → industry-system/industry-da/src/lib/bcprov-jdk15on-1.50.jar


+ 0 - 0
industry-system/industry-da/src/main/resources/lib/examples.jar → industry-system/industry-da/src/lib/examples.jar


+ 0 - 0
industry-system/industry-da/src/main/resources/lib/jna.jar → industry-system/industry-da/src/lib/jna.jar


+ 0 - 0
industry-system/industry-da/src/main/resources/lib/license-core-1.0.jar → industry-system/industry-da/src/lib/license-core-1.0.jar


+ 0 - 0
industry-system/industry-da/src/main/resources/lib/license-verify-1.0.jar → industry-system/industry-da/src/lib/license-verify-1.0.jar


+ 0 - 0
industry-system/industry-da/src/main/resources/lib/modbus4j-3.1.0.jar → industry-system/industry-da/src/lib/modbus4j-3.1.0.jar


+ 0 - 0
industry-system/industry-da/src/main/resources/lib/org.openscada.opc.lib-1.5.0.jar → industry-system/industry-da/src/lib/org.openscada.opc.lib-1.5.0.jar


+ 1 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/config/InterceptorConfig.java

@@ -43,6 +43,7 @@ public class InterceptorConfig implements WebMvcConfigurer {
                 .excludePathPatterns("/pdf/*")
                 .excludePathPatterns("/*")
                 .excludePathPatterns("/reportTable/getReportTableById")
+                .excludePathPatterns("/reportTable/xlsToPdf")
                 .excludePathPatterns("/influxdb/getInfoCount")
                 .excludePathPatterns("/influxdb/saveInFluxDBInfo")
                 .excludePathPatterns("/itemGroup/uploadModBusModel")

+ 35 - 3
industry-system/industry-da/src/main/resources/static/reportSheet/js/report-history.js

@@ -1,5 +1,36 @@
-layui.use(['_$'], function() {
-	
+let printType = ''
+layui.use(['_$','rightMenu'], function() {
+	var queryParams = new URLSearchParams(window.location.search);
+	// 例如获取查询参数中的key
+	printType = queryParams.get("printType");
+	if(printType && printType === 'task'){
+		let reportId = queryParams.get("id");
+		let serverUrl = queryParams.get("serverUrl");
+		localStorage.setItem('url', serverUrl)
+		indexFn.initPage({
+			reportId: reportId
+		},() =>{
+			let data = {
+				orientation: 2,// 1横向, 2纵向 (前端上传、后端使用)
+				leftMargin: 10,// mm (前端上传、后端使用)
+				rightMargin: 10,// mm (前端上传、后端使用)
+				topMargin: 10,// mm (前端上传、后端使用)
+				bottomMargin: 10,// mm (前端上传、后端使用)
+				printScale: 1,// 1无缩放, 2所有列在一页, 3所有行在一页, 4自定义缩放 (前端上传、后端使用)
+				scale: 100,// 自定义缩放的比例 0-100 (前端上传、后端使用)
+				paperSize: 9,//1 letter, 3 tabloid, 4 ledger, 5 legal, 6 statement, 7 excutive, 8 A3, 9 A4, 11 A5, 12 B4, 13 B5 (前端上传)
+				printArea: '',// B1:B2 (前端上传、后端使用)
+				printQuality: 1,// 1-10 (前端使用,生成Excel)
+				wordQuality: null,//  300 300dpi, 600 600dpi, 1200 1200dpi (前端未上传,后端使用)
+			}
+			layui.excelUtil.xlsxToPdf({
+				data,
+				success: (json) => {
+					console.info("xlsxToPdf", json.data)
+				}
+			})
+		})
+	}
 })
 
 window.onload = function() {
@@ -23,7 +54,7 @@ window.onbeforeunload = function() {
 }
 
 const indexFn = {
-	initPage: (data) => {
+	initPage: (data, callback) => {
 		luckysheet.destroy()
 		layui._$.get({
 			url: '/reportTable/getReportTableById',
@@ -101,6 +132,7 @@ const indexFn = {
 										},
 									})
 								}
+								if(callback) callback()
 							}
 						})
 					}

+ 6 - 5
industry-system/industry-da/src/main/resources/static/reportSheet/js/src/model/excel-util.js

@@ -187,17 +187,18 @@ layui.define(function(exports) {
 			if (rgb.charAt(0) == '#') {
 				return rgb;
 			}
-						
-			const ds = rgb.split(/\D+/);
-			const decimal = Number(ds[1]) * 65536 + Number(ds[2]) * 256 + Number(ds[3]);
-			return "#" + zero_fill_hex(decimal, 6);
-						
+
+
 			const zero_fill_hex = (num, digits) => {
 				var s = num.toString(16);
 				while (s.length < digits)
 					s = "0" + s;
 				return s;
 			}
+						
+			const ds = rgb.split(/\D+/);
+			const decimal = Number(ds[1]) * 65536 + Number(ds[2]) * 256 + Number(ds[3]);
+			return "#" + zero_fill_hex(decimal, 6);
 		},
 		getObjType: (obj) => {
 			let toString = Object.prototype.toString;

+ 2 - 0
industry-system/industry-da/src/main/resources/static/reportSheet/report-history.html

@@ -28,6 +28,8 @@
 		<script type="text/javascript" src="js/layui-v2.9.3/layui.js"></script>
 		<script type="text/javascript" src="js/Luckysheet-2.1.13/plugins/js/plugin.js"></script>
 		<script type="text/javascript" src="js/Luckysheet-2.1.13/luckysheet.umd.js"></script>
+		<script type="text/javascript" src="js/lib/exceljs/polyfill.js"></script>
+		<script type="text/javascript" src="js/lib/exceljs/exceljs.js"></script>
 		<script type="text/javascript" src="js/util/constants.js"></script>
 		<script type="text/javascript" src="js/report-history.js"></script>
 	</body>