88 lines
5.3 KiB
JavaScript
88 lines
5.3 KiB
JavaScript
|
import sqlite from './sqlite.js'
|
||
|
module.exports = {
|
||
|
dbName: 'dianji_chat',
|
||
|
dbPath: '_doc/dianji_chat.db',
|
||
|
// 创建所有表
|
||
|
createAllTable() {
|
||
|
this.createMessageRespList()
|
||
|
// this.createWorkMessageRespList()
|
||
|
this.creatAttachUnmoorRespList()
|
||
|
this.createShipmentShipSupplyRespList()
|
||
|
this.createShipmentAdviserLayoutRespList()
|
||
|
this.createShipmentLoadUnloadNoticeRespList()
|
||
|
this.createShipmentQualityConsultationRespList()
|
||
|
this.createAbnormalConditionRespList()
|
||
|
this.createMafiListRespList()
|
||
|
this.createSafetyInspectionRespList()
|
||
|
},
|
||
|
// 创建人员信息 messageRespList
|
||
|
createMessageRespList() {
|
||
|
let sql =
|
||
|
'CREATE TABLE if not exists messageRespList ("webId" text NOT NULL,"bthId" text,"bthIdName" text,"jobStartTime" text,"jobEndTime" text,"shipPerson" text,"vvyId" text,"vvyName" text,"weatherId" text,"weatherType" text,"workSuite" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
|
||
|
this.executeSql(sql)
|
||
|
},
|
||
|
// 创建工班信息 workMessageRespList
|
||
|
// createWorkMessageRespList() {
|
||
|
// console.log('创建表');
|
||
|
// let sql =
|
||
|
// 'CREATE TABLE if not exists workMessageRespList ("webId" text NOT NULL,"bthId" text,"bthIdName" text,"jobStartTime" text,"jobEndTime" text,"shipPerson" text,"vvyId" text,"vvyName" text,"weatherId" text,"weatherType" text,"workSuite" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
|
||
|
// this.executeSql(sql)
|
||
|
// },
|
||
|
// 创建系解缆 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 =
|
||
|
'CREATE TABLE if not exists shipmentQualityConsultationRespList ("webId" text NOT NULL,"vvyId" text,"vvyName" text,"bthId" text,"bthIdName" text,"loaderTypeId" text,"loaderType" text,"vehicleSize" text,"sparePart" text,"workTime" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
|
||
|
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)
|
||
|
},
|
||
|
// 创建mifi mafiListRespList
|
||
|
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)
|
||
|
},
|
||
|
executeSql(sql) {
|
||
|
sqlite.executeSqlCeshi(sql).then((value) => {
|
||
|
// 在resolve时执行的回调函数
|
||
|
console.log(value);
|
||
|
}).catch((error) => {
|
||
|
// 在reject时执行的回调函数
|
||
|
console.error(error);
|
||
|
});
|
||
|
},
|
||
|
}
|