Explorar el Código

APP测试版功能处理

oyq28 hace 1 mes
padre
commit
217a020092
Se han modificado 5 ficheros con 52 adiciones y 19 borrados
  1. 11 2
      AndroidManifest.xml
  2. 4 2
      config.uts
  3. 5 13
      manifest.json
  4. 27 2
      uni_modules/uni-sqlContext/utssdk/app-android/index.uts
  5. 5 0
      utils/sqlite.uts

+ 11 - 2
AndroidManifest.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>  
 <?xml version="1.0" encoding="utf-8"?>  
 <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"   
 <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"   
-  package="io.dcloud.nativeresouce">  
+  package="uni.app.UNI899F11F">  
     <!--按下面方式配置需要自定义添加的权限-->  
     <!--按下面方式配置需要自定义添加的权限-->  
     <!-- 使用网络权限 -->
     <!-- 使用网络权限 -->
     <uses-permission android:name="android.permission.INTERNET"/>
     <uses-permission android:name="android.permission.INTERNET"/>
@@ -36,6 +36,15 @@
     <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
     <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
     <uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>"
     <uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>"
     <application>  
     <application>  
-        <!--meta-data-->  
+        <!--meta-data-->
+		<activity android:name="io.dcloud.uniapp.UniLaunchProxyActivity" android:exported="true">
+		            <intent-filter>
+		                <action android:name="android.intent.action.VIEW" />
+		                <category android:name="android.intent.category.DEFAULT" />
+		                <category android:name="android.intent.category.BROWSABLE" />
+						<data android:scheme="uniappx"/>
+		                <data android:scheme="QTApp800"/>
+		      </intent-filter>
+		</activity>
     </application>  
     </application>  
 </manifest>
 </manifest>

+ 4 - 2
config.uts

@@ -21,6 +21,7 @@ export type GlobalConfig= {
   uploadURL: string;
   uploadURL: string;
   uploadTaskURL: string;
   uploadTaskURL: string;
   getImgURL: string;
   getImgURL: string;
+  dbpath: string;
 }
 }
 
 
 export const globalConfig  = {
 export const globalConfig  = {
@@ -49,13 +50,14 @@ export const globalConfig  = {
   },
   },
   // host: "http://192.168.43.62:4523/m1/7190626-6915798-default",
   // host: "http://192.168.43.62:4523/m1/7190626-6915798-default",
   host: "http://10.122.30.10/mobile",
   host: "http://10.122.30.10/mobile",
+  dbpath: "/static/db/QT800.db",
   tokenURL: '/d800.qm.QmImpl/mobLogin?username=',
   tokenURL: '/d800.qm.QmImpl/mobLogin?username=',
   downloadURL: '/d800.qm.QmImpl/loadQmImagetask?prodcode=',
   downloadURL: '/d800.qm.QmImpl/loadQmImagetask?prodcode=',
   downloadTaskURL: '/d800.qm.QmImpl/loadQmLkCheckinfo?gxpk=',
   downloadTaskURL: '/d800.qm.QmImpl/loadQmLkCheckinfo?gxpk=',
   // getImgURL: 'http://192.168.43.62:8080/api/download?fileid=',
   // getImgURL: 'http://192.168.43.62:8080/api/download?fileid=',
   getImgURL: 'http://10.122.30.10/mobile/download?fileid=',
   getImgURL: 'http://10.122.30.10/mobile/download?fileid=',
   // uploadURL: 'http://192.168.43.62:8080/api/upload'
   // uploadURL: 'http://192.168.43.62:8080/api/upload'
-  uploadURL: 'http://10.122.30.10/mobile/upload'
+  uploadURL: 'http://10.122.30.10/mobile/upload',
   // uploadTaskURL: 'http://192.168.43.62:8080/api/backQmLkCheckinfo'
   // uploadTaskURL: 'http://192.168.43.62:8080/api/backQmLkCheckinfo'
-  uploadTaskURL: 'http://10.122.30.10/mobile/d800.qm.QmImpl/backQmLkCheckinfo'
+  uploadTaskURL: 'http://10.122.30.10/mobile/d800.qm.QmImpl/backQmLkCheckinfo',  
 } as GlobalConfig;
 } as GlobalConfig;

+ 5 - 13
manifest.json

@@ -781,21 +781,17 @@
     "app-android" : {
     "app-android" : {
         "distribute" : {
         "distribute" : {
             "icons" : {
             "icons" : {
-                "hdpi" : "D:/project/QTApp_800/static/app_icon.png",
-                "xxhdpi" : "D:/project/QTApp_800/static/app_icon.png",
+                "hdpi" : "D:/projects/QTApp_800/static/newLogo.png",
+                "xxhdpi" : "D:/projects/QTApp_800/static/newLogo.png",
                 "xxxhdpi" : "",
                 "xxxhdpi" : "",
-                "xhdpi" : "D:/project/QTApp_800/static/app_icon.png"
+                "xhdpi" : "D:/projects/QTApp_800/static/newLogo.png"
             },
             },
             "minSdkVersion" : "22",
             "minSdkVersion" : "22",
             "targetSdkVersion" : "35",
             "targetSdkVersion" : "35",
             "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86", "x86_64" ],
             "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86", "x86_64" ],
             "permissions" : [
             "permissions" : [
                 "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
                 "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
-                "<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>",
-                "",
-                "",
-                "",
-                ""
+                "<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>"
             ]
             ]
         }
         }
     },
     },
@@ -805,13 +801,9 @@
                 "uni-ad" : {
                 "uni-ad" : {
                     "360" : {},
                     "360" : {},
                     "BXM-AD" : {},
                     "BXM-AD" : {},
-                    "bd" : {},
                     "csj" : {},
                     "csj" : {},
                     "gdt" : {},
                     "gdt" : {},
-                    "hw" : {},
-                    "ks" : {},
-                    "ks-content" : {},
-                    "sigmob" : {}
+                    "ks-content" : {}
                 }
                 }
             }
             }
         }
         }

+ 27 - 2
uni_modules/uni-sqlContext/utssdk/app-android/index.uts

@@ -2,12 +2,14 @@ import Cursor from 'android.database.Cursor';
 import SQLiteDatabase from 'android.database.sqlite.SQLiteDatabase';
 import SQLiteDatabase from 'android.database.sqlite.SQLiteDatabase';
 import SQLiteOpenHelper from 'android.database.sqlite.SQLiteOpenHelper';
 import SQLiteOpenHelper from 'android.database.sqlite.SQLiteOpenHelper';
 import Environment from 'android.os.Environment';
 import Environment from 'android.os.Environment';
+//import { globalConfig } from '@/config';
 
 
 import { createSQLiteContextOptions, executeSqlOptions, selectSqlOptions, executeSqlOptionsResult, selectSqlOptionsResult, CreateSQLiteContext, transactionOptions, transactionResult, ICreateSQLiteContextError } from '../interface.uts';
 import { createSQLiteContextOptions, executeSqlOptions, selectSqlOptions, executeSqlOptionsResult, selectSqlOptionsResult, CreateSQLiteContext, transactionOptions, transactionResult, ICreateSQLiteContextError } from '../interface.uts';
 //import { createSQLiteContextOptions, executeSqlOptions, selectSqlOptions, transactionOptions } from '../interface.uts';
 //import { createSQLiteContextOptions, executeSqlOptions, selectSqlOptions, transactionOptions } from '../interface.uts';
 import { createSQLiteContextFailImpl } from '../unierror.uts';
 import { createSQLiteContextFailImpl } from '../unierror.uts';
 
 
 class SQLiteContext extends SQLiteOpenHelper {
 class SQLiteContext extends SQLiteOpenHelper {
+
 	private dbName : string | null;
 	private dbName : string | null;
 	private forceRecreateTables : boolean;
 	private forceRecreateTables : boolean;
 
 
@@ -343,7 +345,7 @@ class SQLiteContext extends SQLiteOpenHelper {
 
 
 		// 插入初始数据
 		// 插入初始数据
 		console.log("Inserting initial data into app_user table");
 		console.log("Inserting initial data into app_user table");
-		const insertDataSQLs = [
+		let insertDataSQLs = [
 			`INSERT INTO "app_user" ("id", "username", "name", "userno", "password", "token", "status", "avatar", "createtime", "createuser", "updatetime", "updateuser", "role") 
 			`INSERT INTO "app_user" ("id", "username", "name", "userno", "password", "token", "status", "avatar", "createtime", "createuser", "updatetime", "updateuser", "role") 
        VALUES (1, 'admin', '管理员', 1, 'admin123', 'token1', 1, NULL, NULL, 1, NULL, 1, 'admin');`,
        VALUES (1, 'admin', '管理员', 1, 'admin123', 'token1', 1, NULL, NULL, 1, NULL, 1, 'admin');`,
 
 
@@ -362,8 +364,31 @@ class SQLiteContext extends SQLiteOpenHelper {
 			`INSERT INTO "app_user" ("id", "username", "name", "userno", "password", "token", "status", "avatar", "createtime", "createuser", "updatetime", "updateuser", "role")
 			`INSERT INTO "app_user" ("id", "username", "name", "userno", "password", "token", "status", "avatar", "createtime", "createuser", "updatetime", "updateuser", "role")
 		   VALUES (6, 'luyongjun', '陆永俊', 6, '123456', 'token1', 1, NULL, NULL, 1, NULL, 1, 'user');`
 		   VALUES (6, 'luyongjun', '陆永俊', 6, '123456', 'token1', 1, NULL, NULL, 1, NULL, 1, 'user');`
 		];
 		];
+		let testBizData = [
+			`INSERT INTO "app_media_info" ("pdid", "workorder", "invname", "productno", "cardno", "model", "graphid", "ver", "phase", "processno", "progress", "status", "createtime", "createuser", "updatetime", "updateuser", "uploadFlag", "uploadtime") VALUES (1, '632-P-01', '箱间段', 'YH0001', 'LK20230707070012', NULL, '1CFA1040-02', NULL, NULL, 'Pb/XXX-E11', '0/2', 1, NULL, '1', '2025-06-23', '1', 0, NULL);`,
+			`INSERT INTO "app_media_record" ("sxid", "senum", "photoitem", "productno", "part", "partno", "pk", "exampleid", "descb", "num", "status", "date", "urlspl", "imgname", "urlpdt", "createtime", "createuser", "updatetime", "updateuser", "pid", "uploadFlag") VALUES (1, '1', '前底-外侧', 'YH0001', '角焊缝', 'TD10-01', '1', NULL, '角片角焊缝', 2, 1, '2025-06-05', '/static/images/demo.png,/static/images/demo.png', '', '', NULL, '1', NULL, '1', 1, 0);`,
+			`INSERT INTO "app_media_record" ("sxid", "senum", "photoitem", "productno", "part", "partno", "pk", "exampleid", "descb", "num", "status", "date", "urlspl", "imgname", "urlpdt", "createtime", "createuser", "updatetime", "updateuser", "pid", "uploadFlag") VALUES (2, '1', '后底-外侧', 'YH0001', '角焊缝', 'TD10-02', '2', NULL, '角片角焊缝', 3, 1, '2025-06-05', '/static/images/demo.png,/static/images/demo.png,/static/images/demo.png', '', '', NULL, '1', NULL, '1', 1, 0);`,
+			`INSERT INTO "app_task_info" ("pdid", "gxpk", "pk_serial", "cardno", "productcode", "model", "workorder", "invname", "graphid", "processno", "gxno", "ver", "lastupdatetime", "updateuser", "uploadFlag", "uploadtime") VALUES (1, 'PI02297172', '1b93d201-8430-41a4-b462-4bbedef28cab', 'LK202407290121G01', 'YHZJ240442TD', '718', '718-SY-YZ-03', '一层段', '1020#S', 'Pb/1020-E7', '230检验', 'B.1', NULL, NULL, 0, NULL);`,
+			`INSERT INTO "app_task_record" ("sxid", "pdid", "pk", "fk_invcode", "no", "invcode", "invname", "processStep", "fk_processTask", "checkTarget", "checknum", "oknum", "ngnum", "status", "result", "checkTime", "fk_creator", "cs", "ts") VALUES (1, 1, 'af90ef8a-9979-42d7-9a2e-3b3a6ecfe3cb', '1002N11000000012X3K8', '检验工序_LK202407290121G01_23', '1020', '一层段', '230检验', 'PI02297172', '检验工序', 1, 1, 0, '已检验', '合格', '2024-09-29 09:45:21', '060080000199', '2024-09-29 09:41:56', '2024-09-29 09:45:21');`,
+			`INSERT INTO "app_task_record_item" ("sxid", "psxid", "pk", "fk_qcRecord", "fk_prodcode", "prodno", "name", "no", "nature", "unit", "maxNum", "minNum", "status", "memo", "measuredvalue", "measuredvaluemax", "result", "cs", "ts", "recorder") VALUES (1, 1, 'f50678b6898446d088686f4be3e06a4c', 'af90ef8a-9979-42d7-9a2e-3b3a6ecfe3cb', '76697df1-5058-40f3-b753-855a53caf2c3', 'YHZJ240442TD', '位置', '1', '定性', '-', NULL, NULL, '有效', '相互位置', '0', NULL, '0', '2024-09-29 09:41:56', '2024-09-29 09:45:21', NULL);`,
+			`INSERT INTO "app_task_record_item" ("sxid", "psxid", "pk", "fk_qcRecord", "fk_prodcode", "prodno", "name", "no", "nature", "unit", "maxNum", "minNum", "status", "memo", "measuredvalue", "measuredvaluemax", "result", "cs", "ts", "recorder") VALUES (2, 1, 'b76126adad9f466e9e1cb74dfbf9ad56', 'af90ef8a-9979-42d7-9a2e-3b3a6ecfe3cb', '76697df1-5058-40f3-b753-855a53caf2c3', 'YHZJ240442TD', '装配间隙', '2', '定量', 'mm', NULL, NULL, '有效', '装配间隙', '0.3', NULL, '0', '2024-09-29 09:41:56', '2024-09-29 09:45:21', NULL);`,
+			`INSERT INTO "app_task_record_item" ("sxid", "psxid", "pk", "fk_qcRecord", "fk_prodcode", "prodno", "name", "no", "nature", "unit", "maxNum", "minNum", "status", "memo", "measuredvalue", "measuredvaluemax", "result", "cs", "ts", "recorder") VALUES (3, 1, '3d060a2a314f4f23b0e19dc318950fec', 'af90ef8a-9979-42d7-9a2e-3b3a6ecfe3cb', '76697df1-5058-40f3-b753-855a53caf2c3', 'YHZJ240442TD', '错边量', '3', '定量', 'mm', NULL, NULL, '有效', '错边量', '0.3', NULL, '0', '2024-09-29 09:41:56', '2024-09-29 09:45:21', NULL);`,
+			`INSERT INTO "app_task_record_item" ("sxid", "psxid", "pk", "fk_qcRecord", "fk_prodcode", "prodno", "name", "no", "nature", "unit", "maxNum", "minNum", "status", "memo", "measuredvalue", "measuredvaluemax", "result", "cs", "ts", "recorder") VALUES (4, 1, '47c321d7a1fc4c44a688b2c270cda83e', 'af90ef8a-9979-42d7-9a2e-3b3a6ecfe3cb', '76697df1-5058-40f3-b753-855a53caf2c3', 'YHZJ240442TD', '对齐', '4', '定量', 'mm', NULL, NULL, '有效', '网格对齐', '0', NULL, '0', '2024-09-29 09:41:56', '2024-09-29 09:45:21', NULL);`,
+			`INSERT INTO "app_task_record_item" ("sxid", "psxid", "pk", "fk_qcRecord", "fk_prodcode", "prodno", "name", "no", "nature", "unit", "maxNum", "minNum", "status", "memo", "measuredvalue", "measuredvaluemax", "result", "cs", "ts", "recorder") VALUES (5, 1, '535e0a2805b04d409054beac2f9f2c09', 'af90ef8a-9979-42d7-9a2e-3b3a6ecfe3cb', '76697df1-5058-40f3-b753-855a53caf2c3', 'YHZJ240442TD', '对中偏移量', '5', '定量', 'mm', NULL, NULL, '有效', '对中偏移量', '0', NULL, '0', '2024-09-29 09:41:56', '2024-09-29 09:45:21', NULL);`,
+			`INSERT INTO "app_media_task" ("id", "pid", "name", "num", "step", "status", "createtime", "createuser", "updatetime", "updateuser") VALUES (1, 1, '前底-外侧', 5, 5, 3, NULL, 1, NULL, 1);`,
+			`INSERT INTO "app_media_task" ("id", "pid", "name", "num", "step", "status", "createtime", "createuser", "updatetime", "updateuser") VALUES (2, 1, '后底-外侧', 3, 3, 4, NULL, 1, NULL, 1);`,
+			`INSERT INTO "app_media_task" ("id", "pid", "name", "num", "step", "status", "createtime", "createuser", "updatetime", "updateuser") VALUES (3, 1, '简段-外侧', 12, 2, 2, NULL, 1, NULL, 1);`,
+			`INSERT INTO "app_product_task" ("id", "pid", "name", "num", "step", "status", "createtime", "createuser", "updatetime", "updateuser") VALUES (1, 1, '前底-外侧', 5, 5, 3, NULL, 1, NULL, 1);`,
+			`INSERT INTO "app_product_task" ("id", "pid", "name", "num", "step", "status", "createtime", "createuser", "updatetime", "updateuser") VALUES (2, 1, '后底-外侧', 3, 3, 4, NULL, 1, NULL, 1);`,
+			`INSERT INTO "app_product_task" ("id", "pid", "name", "num", "step", "status", "createtime", "createuser", "updatetime", "updateuser") VALUES (3, 1, '简段-外侧', 12, 2, 2, NULL, 1, NULL, 1);`,
+            `INSERT INTO "app_task_keyprocess" ("sxid", "pdid", "pk", "testapparatus", "tableid", "testrequirelower", "testrequireupper", "parametername", "parameterorder", "measureunit", "parameterinstruction", "parameterid", "fk_creator", "fk_prodcode", "prodno", "processstep", "fk_processtask", "measuredvaluemin", "measuredvaluemax", "result", "memo", "fks_operator", "cs", "ts", "operator") VALUES (1, 1, '9e3903b8a0654220aa511d912fca146a', '螺纹环规(6h)', '16026721389362', '定性(只能编辑上限值)', NULL, '螺纹', '1', '/', '外螺纹', '188418860506145', '060080003348', 'e2eca140-55d5-42db-b9a6-347ea3d5c8cf', 'WQ01202505000160-1', '30车削', 'b7d8fcc5dc0640f387c7c9e99e8cf88a', '合格', '合格', NULL, NULL, '060080003348', '2025-09-26 08:23:26', '2025-09-26 14:42:38', NULL);`,
+            `INSERT INTO "app_task_keyprocess" ("sxid", "pdid", "pk", "testapparatus", "tableid", "testrequirelower", "testrequireupper", "parametername", "parameterorder", "measureunit", "parameterinstruction", "parameterid", "fk_creator", "fk_prodcode", "prodno", "processstep", "fk_processtask", "measuredvaluemin", "measuredvaluemax", "result", "memo", "fks_operator", "cs", "ts", "operator") VALUES (2, 1, '9d153531d48c4161ba34932826856800', '游标卡尺(0-200mm)', '16026721389362', '5.8', NULL, '长度', '2', 'mm', '螺纹长度', '439121372420532', '060080003348', 'e2eca140-55d5-42db-b9a6-347ea3d5c8cf', 'WQ01202505000160-1', '30车削', 'b7d8fcc5dc0640f387c7c9e99e8cf88a', '5.8', '5.81', NULL, NULL, '060080003348', '2025-09-26 08:23:26', '2025-09-26 14:42:38', NULL);`
+
+
+		];
+		const mergeDataSQLs = insertDataSQLs.concat(testBizData);
 
 
-		for (const sql of insertDataSQLs) {
+		for (const sql of mergeDataSQLs) {
 			try {
 			try {
 				// 使用INSERT OR IGNORE避免重复插入
 				// 使用INSERT OR IGNORE避免重复插入
 				const safeSql = sql.replace("INSERT INTO", "INSERT OR IGNORE INTO");
 				const safeSql = sql.replace("INSERT INTO", "INSERT OR IGNORE INTO");

+ 5 - 0
utils/sqlite.uts

@@ -3,9 +3,14 @@ import {selectSqlOptions,executeSqlOptions, executeSqlOptionsResult,selectSqlOpt
 
 
 
 
 
 
+
 // 数据库名称 - 确保包含.db后缀
 // 数据库名称 - 确保包含.db后缀
 const dbName = 'QT800.db'
 const dbName = 'QT800.db'
 
 
+// 数据库地址,推荐以下划线为开头   _doc/xxx.db
+// 如果路径不为_downloads/xxx.db,在手机中会找不到文件夹(强烈建议:不要修改路径)
+const dbPath = '/www/static/db/QT800'
+
 // 注意:根据接口定义,createSQLiteContext函数只接受一个参数
 // 注意:根据接口定义,createSQLiteContext函数只接受一个参数
 // 不需要指定外部路径,路径相关配置已不再使用
 // 不需要指定外部路径,路径相关配置已不再使用
 // const dbPath = '/www/static/db/qt_app_800'
 // const dbPath = '/www/static/db/qt_app_800'