pad-app/common/createDataTable.js

161 lines
10 KiB
JavaScript
Raw Normal View History

2023-08-01 09:32:45 +08:00
import sqlite from './sqlite.js'
module.exports = {
dbName: 'dianji_chat',
dbPath: '_doc/dianji_chat.db',
// 创建所有表
createAllTable() {
2023-08-04 17:06:33 +08:00
// 创建船舶基本信息
this.createShipInfoTable()
// 创建人员信息
2023-08-01 09:32:45 +08:00
this.createMessageRespList()
2023-08-04 17:06:33 +08:00
// 创建工班信息
this.createWorkMessageRespList()
// 创建工班信息详细
this.createWorkMessageRespInfoList()
// // 创建工班信息翻仓
this.createRetallyMessageRespList()
2023-08-04 17:06:33 +08:00
// // 创建工班信息其他
this.createInfoRespList()
2023-08-04 17:06:33 +08:00
// 创建系解缆
2023-08-01 09:32:45 +08:00
this.creatAttachUnmoorRespList()
2023-08-04 17:06:33 +08:00
// 创建供给
2023-08-01 09:32:45 +08:00
this.createShipmentShipSupplyRespList()
2023-08-04 17:06:33 +08:00
// 创建指导员作业布置
2023-08-01 09:32:45 +08:00
this.createShipmentAdviserLayoutRespList()
2023-08-04 17:06:33 +08:00
// 创建船舶装卸通知书
2023-08-01 09:32:45 +08:00
this.createShipmentLoadUnloadNoticeRespList()
2023-08-04 17:06:33 +08:00
// 创建质量意见征询
2023-08-01 09:32:45 +08:00
this.createShipmentQualityConsultationRespList()
2023-08-04 17:06:33 +08:00
// 创建异常情况
2023-08-01 09:32:45 +08:00
this.createAbnormalConditionRespList()
2023-08-04 17:06:33 +08:00
// 创建mafi
2023-08-01 09:32:45 +08:00
this.createMafiListRespList()
2023-08-04 17:06:33 +08:00
// 创建安全巡检
2023-08-01 09:32:45 +08:00
this.createSafetyInspectionRespList()
2023-08-18 17:28:11 +08:00
// 创建安全巡检图片上传地址
this.createSafetyInspectionRespUrlList()
2023-08-04 17:06:33 +08:00
// 创建作业查询
2023-08-01 14:35:05 +08:00
this.createShipmentShipLoadPlansRespList()
2023-08-04 17:06:33 +08:00
// 创建下拉数据
2023-08-03 15:36:23 +08:00
this.createShipOption()
2023-09-23 20:16:54 +08:00
// 创建单证签名表
this.createWorkSignTable()
2023-08-01 09:32:45 +08:00
},
2023-08-04 17:06:33 +08:00
// 创建船舶基本信息 shipInfoTable
createShipInfoTable() {
let sql =
2023-09-23 20:16:54 +08:00
'CREATE TABLE if not exists shipInfoTable ("webId" text NOT NULL,"agencyCname" text,"ctyCnname" text,"ctyCode" text,"dataVersion" text,"shipCname" text,"shipTypeName" text,"spmBoardCentrele" text,"spmBoardCentrerg" text,"spmBoardFrontle" text,"spmBoardFrontrg" text,"spmBoardLaterle" text,"spmBoardLaterrg" text,"spmCab" text,"spmCabinht" text,"spmCountrycd" text,"spmEdicd" text,"spmId" text,"spmLightWeight" text,"spmMadeTime" text,"spmMintide" text,"spmMmsi" text,"spmNationality" text,"spmPilot" text,"spmPilotName" text,"spmRemark" text,"spmShipSign" text,"spmShipType" text,"spmTotalCargo" text,"spmTrade" text,"spmTradeName" text,"tenantId" text,"termcd" text,"valid" text,"vslAudio" text,"vslBaynum" text,"vslBkbaynum" text,"vslBkendbay" text,"vslBkstartbay" text,"vslBksternnum" text,"vslBreadth" text,"vslCallid" text,"vslCallsign" text,"vslCd" text,"vslCnname" text,"vslCstAgency" text,"vslCstShippingline" text,"vslCtyCountrycd" text,"vslDeckmaxrows" text,"vslDeckmaxtiers" text,"vslDepth" text,"vslDerrickamount" text,"vslDraftload" text,"vslDraftunload" text,"vslEndlength" text,"vslEnname" text,"vslGton" text,"vslHatchamount" text,"vslHatchcoveramount" text,"vslHatchmaxrows" text,"vslHatchmaxtiers" text,"vslImono" text,"vslLcg" text,"vslLoa" text,"vslLoaddisargereq" text,"vslMadedt" text,"vslNetton" text,"vslOrigin" text,"vslPilotage" text,"vslRfsocket" text,"vslSailspeed" text,"vslSpoptp" text,"vslStdId" text,"vslStopsign" text,"vslStowagereq" text,"vslSummaryloading" text,"vslTcg" text,"vslTotallocation" text,"vslUncode" text,"vslVcg" text,"vslVtpcode" text,"webDate" text, PRIMARY KEY("webId"));'
2023-08-04 17:06:33 +08:00
this.executeSql(sql)
},
2023-08-01 09:32:45 +08:00
// 创建人员信息 messageRespList
createMessageRespList() {
let sql =
2023-09-23 20:16:54 +08:00
'CREATE TABLE if not exists messageRespList ("webId" text NOT NULL,"bthId" text,"bthIdName" text,"jobStartTime" text,"jobEndTime" text,"shipPerson" text,"vvyId" text,"vvyName" text,"weatherType" text,"weatherTypeDesc" text,"workSuite" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
2023-08-01 09:32:45 +08:00
this.executeSql(sql)
},
// 创建工班信息 workMessageRespList
2023-08-04 17:06:33 +08:00
createWorkMessageRespList() {
let sql =
2023-09-23 20:16:54 +08:00
'CREATE TABLE if not exists workMessageRespList ("webId" text NOT NULL,"contactId" text,"aId" text,"vvyId" text,"vvyName" text,"loadType" text,"loadTypeName" text,"pwcType" text,"pwcTypeName" text,"workStartTime" text,"workEndTime" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
2023-08-04 17:06:33 +08:00
this.executeSql(sql)
},
// 创建工班信息详细 workMessageRespInfoList
createWorkMessageRespInfoList() {
let sql =
2023-09-23 20:16:54 +08:00
'CREATE TABLE if not exists workMessageRespInfoList ("webId" text NOT NULL,"contactId" text,"carType" text,"carTypeName" text,"goodsNumber" text,"loadingType" text,"loadingTypeName" text,"remark" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
2023-08-04 17:06:33 +08:00
this.executeSql(sql)
},
// 创建工班信息翻仓 retallyMessageRespList
createRetallyMessageRespList() {
let sql =
2023-09-23 20:16:54 +08:00
'CREATE TABLE if not exists retallyMessageRespList ("webId" text NOT NULL,"contactId" text,"aId" text,"vvyId" text,"vvyName" text,"retallyType" text,"retallyTypeName" text,"retallyOrigin" text,"retallyTerminus" text,"retallyStartTime" text,"retallyEndTime" text,"carType" text,"carTypeName" text,"goodsNumber" text,"goodsVolume" text,"goodsWeight" text,"editStatus" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
2023-08-04 17:06:33 +08:00
this.executeSql(sql)
},
// 创建工班信息其他 infoRespList
createInfoRespList() {
let sql =
2023-09-23 20:16:54 +08:00
'CREATE TABLE if not exists infoRespList ("webId" text NOT NULL,"contactId" text,"aId" text,"vvyId" text,"vvyName" text,"tecNum" text,"tecStartTm" text,"tecEndTm" text,"tecWeight" text,"tecVolume" text,"genNum" text,"genStartTm" text,"genEndTm" text,"genWeight" text,"genVolume" text,"auxRemark" text,"waitRemark" text,"workRemark" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
2023-08-04 17:06:33 +08:00
this.executeSql(sql)
},
2023-08-01 09:32:45 +08:00
// 创建系解缆 attachUnmoorRespList
creatAttachUnmoorRespList() {
let sql =
'CREATE TABLE if not exists attachUnmoorRespList ("webId" text NOT NULL,"shipDeadWeight" text,"vvyId" text,"vvyName" text,"bthId" text,"bthIdName" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"attachTime" text,"unmoorTime" text,"shiftingBerthTime" text,"noProductBerthTime" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
this.executeSql(sql)
},
// 创建供给 shipmentShipSupplyRespList
createShipmentShipSupplyRespList() {
let sql =
'CREATE TABLE if not exists shipmentShipSupplyRespList ("webId" text NOT NULL,"vvyId" text,"vvyName" text,"stopBerthage" text,"stopBerthageName" text,"sssId" text,"supplyType" text,"supplyAmount" text,"supplyDate" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
this.executeSql(sql)
},
// 创建指导员作业布置 shipmentAdviserLayoutRespList
createShipmentAdviserLayoutRespList() {
let sql =
'CREATE TABLE if not exists shipmentAdviserLayoutRespList ("webId" text NOT NULL,"vvyId" text,"vvyName" text,"bthId" text,"bthIdName" text,"pwcTypeId" text,"pwcType" text,"personNumber" text,"loaderTypeId" text,"loaderType" text,"vehicleSize" text,"sparePart" text,"workTime" text,"startTime" text,"endTime" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
this.executeSql(sql)
},
// 创建船舶装卸通知书 shipmentLoadUnloadNoticeRespList
createShipmentLoadUnloadNoticeRespList() {
let sql =
'CREATE TABLE if not exists shipmentLoadUnloadNoticeRespList ("webId" text NOT NULL,"vvyId" text,"vvyName" text,"workDate" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
this.executeSql(sql)
},
// 创建质量意见征询 shipmentQualityConsultationRespList
createShipmentQualityConsultationRespList() {
let sql =
2023-09-23 20:16:54 +08:00
'CREATE TABLE if not exists shipmentQualityConsultationRespList ("webId" text NOT NULL,"vvyId" text,"vvyName" text,"bthId" text,"bthIdName" text,"handlingTypeId" text,"handlingType" text,"vehiclesNumber" text,"spareNumber" text,"operationDate" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
2023-08-01 09:32:45 +08:00
this.executeSql(sql)
},
// 创建异常情况 abnormalConditionRespList
createAbnormalConditionRespList() {
let sql =
'CREATE TABLE if not exists abnormalConditionRespList ("webId" text NOT NULL,"vvyId" text,"vvyName" text,"type" text,"remark" text,"workTime" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
this.executeSql(sql)
},
2023-08-04 17:06:33 +08:00
// 创建mafi mafiListRespList
2023-08-01 09:32:45 +08:00
createMafiListRespList() {
let sql =
'CREATE TABLE if not exists mafiListRespList ("webId" text NOT NULL,"vvyId" text,"vvyName" text,"loaderTypeId" text,"loaderType" text,"typeId" text,"type" text,"size" text,"mafiBarcode" text,"workDate" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
this.executeSql(sql)
},
// 创建安全巡检 safetyInspectionRespList
createSafetyInspectionRespList() {
let sql =
'CREATE TABLE if not exists safetyInspectionRespList ("webId" text NOT NULL,"vvyId" text,"vvyName" text,"type" text,"remark" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
this.executeSql(sql)
},
2023-08-18 17:28:11 +08:00
// 创建安全巡检图片上传地址 safetyInspectionRespUrlList
createSafetyInspectionRespUrlList() {
let sql =
'CREATE TABLE if not exists safetyInspectionRespUrlList ("webId" text NOT NULL,"contactId" text,"url" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
this.executeSql(sql)
},
2023-08-01 14:35:05 +08:00
// 创建作业查询 shipmentShipLoadPlansRespList
createShipmentShipLoadPlansRespList() {
let sql =
2023-08-01 16:32:50 +08:00
'CREATE TABLE if not exists shipmentShipLoadPlansRespList ("webId" text NOT NULL,"agentId" text,"agentName" text,"amount" text,"brdId" text,"brdName" text,"bvdId" text,"bvdName" text,"bvmId" text,"bvmName" text,"carHeight" text,"carLength" text,"carWidth" text,"customsDeclareNo" text,"customsDeclareStatus" text,"mnfBl" text,"potId" text,"potName" text,"sourceType" text,"vvyId" text,"vvyName" text,"yardPos" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
2023-08-01 14:35:05 +08:00
this.executeSql(sql)
},
2023-08-03 15:36:23 +08:00
// 创建下拉数据 shipOption
createShipOption() {
let sql =
'CREATE TABLE if not exists shipOption ("dictionariesName" text,"ptrCode" text,"ptrDesc" text,"webId" text NOT NULL,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
this.executeSql(sql)
},
2023-09-23 20:16:54 +08:00
// 创建单证签名表 workSignTable
createWorkSignTable() {
let sql =
'CREATE TABLE if not exists workSignTable ("webId" text,"vvyId" text,"vvyName" text,"signId" text,"url" text,"signTable" text,"signType" text,"webDate" text, PRIMARY KEY("webId"));'
this.executeSql(sql)
},
2023-08-01 09:32:45 +08:00
executeSql(sql) {
sqlite.executeSqlCeshi(sql).then((value) => {
// 在resolve时执行的回调函数
console.log(value);
2023-08-01 09:32:45 +08:00
}).catch((error) => {
// 在reject时执行的回调函数
console.error(error);
});
},
}