Browse Source

删除不用的model

master
wenlele 2 years ago
parent
commit
bc650cb8db
  1. 329
      api/app/lib/controllers/patrolManage/projectSituation.js
  2. 98
      api/app/lib/models/camera.js
  3. 52
      api/app/lib/models/company.js
  4. 130
      api/app/lib/models/coordinate.js
  5. 89
      api/app/lib/models/hide_danger_dispose.js
  6. 107
      api/app/lib/models/hide_danger_rectify.js
  7. 62
      api/app/lib/models/hide_danger_rectify_sites.js
  8. 88
      api/app/lib/models/hide_danger_report.js
  9. 115
      api/app/lib/models/metting.js
  10. 60
      api/app/lib/models/phone_validate_code.js
  11. 69
      api/app/lib/models/post.js
  12. 109
      api/app/lib/models/problem_report.js
  13. 59
      api/app/lib/models/problem_report_consult.js
  14. 64
      api/app/lib/models/problem_report_file.js
  15. 70
      api/app/lib/models/project_disclosure.js
  16. 65
      api/app/lib/models/project_disclosure_files.js
  17. 170
      api/app/lib/models/risk_report.js
  18. 74
      api/app/lib/models/role.js
  19. 43
      api/app/lib/models/role_group.js
  20. 47
      api/app/lib/models/role_resource.js
  21. 69
      api/app/lib/models/safety_cultivate.js
  22. 53
      api/app/lib/models/user_deal_todo.js
  23. 51
      api/app/lib/models/user_department.js
  24. 51
      api/app/lib/models/user_post.js
  25. 43
      api/app/lib/models/user_token.js
  26. 134
      api/app/lib/models/worker.js
  27. 74
      api/app/lib/models/worker_attendance.js
  28. 124
      api/app/lib/models/xuncheck_task.js

329
api/app/lib/controllers/patrolManage/projectSituation.js

@ -1,329 +0,0 @@
'use strict';
async function projectList (ctx, next) {
try {
const models = ctx.fs.dc.models;
let userInfo = ctx.fs.api.userInfo;
const { limit, page, name, justStructure } = ctx.query;
let options = {
where: {
},
// include: [{
// as: 'company',
// model: models.Company,
// attributes: ['id', 'name'],
// },],
}
if (limit) {
options.limit = Number(limit)
}
if (page && limit) {
options.offset = Number(page) * Number(limit)
}
if (name) {
options.where.name = { $like: `%${name}%` }
}
let res = []
if (justStructure) {
res = await models.Project.findAndCountAll({
attributes: ['id', 'name'],
})
} else {
res = await models.Project.findAndCountAll(options)
}
ctx.status = 200;
ctx.body = res
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
"message": "获取结构列表失败"
}
}
}
async function postAddProject (ctx, next) {
try {
const models = ctx.fs.dc.models;
let userInfo = ctx.fs.api.userInfo;
const data = ctx.request.body;
const { img, longitude, latitude, name, type, describe } = data
let errMsg = data.id ? '工程编辑失败' : '工程新增失败'
let project = { img, longitude, latitude, name, type, describe, userId: userInfo.id }
const alikeProject = await models.Project.findOne({
where: {
name: name,
}
})
if ((!data.id && alikeProject) || (alikeProject && alikeProject.id !== data.id)) {
errMsg = '已有相同结构物名称'
throw errMsg
}
if (data && data.id) {
await models.Project.update(project, {
where: {
id: data.id
}
})
} else {
await models.Project.create(project)
}
ctx.status = 204;
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`)
ctx.status = 400;
ctx.body = {
"message": errMsg
}
}
}
async function delProject (ctx, next) {
try {
const models = ctx.fs.dc.models;
let userInfo = ctx.fs.api.userInfo;
const { id } = ctx.params
await models.Project.destroy({
where: {
id,
}
})
await models.Point.destroy({
where: {
projectId: id
}
})
ctx.status = 204;
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`)
ctx.status = 400;
ctx.body = {
"message": '删除结构物失败'
}
}
}
async function addPosition (ctx, next) {
try {
const models = ctx.fs.dc.models;
let userInfo = ctx.fs.api.userInfo;
const data = ctx.request.body;
const { longitude, latitude, name, describe, qrCode, projectId, } = data
let errMsg = data.id ? '点位编辑失败' : '点位新增失败'
let pointData = { longitude, latitude, name, describe, qrCode, projectId }
const alikeProject = await models.Project.findOne({
where: {
id: data.id,
}
})
if (data && data.id) {
await models.Point.update({ qrCode }, {
where: {
id: data.id,
}
})
} else {
await models.Point.create(pointData)
}
ctx.status = 204;
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`)
ctx.status = 400;
ctx.body = {
"message": errMsg
}
}
}
async function position (ctx, next) {
try {
const models = ctx.fs.dc.models;
let userInfo = ctx.fs.api.userInfo;
const { limit, page, projectId } = ctx.query;
let options = {
where: {
id: projectId
},
include: [{
model: models.Point,
},],
}
if (limit) {
options.limit = Number(limit)
}
if (page && limit) {
options.offset = Number(page) * Number(limit)
}
let res = await models.Project.findAndCountAll(options)
ctx.status = 200;
ctx.body = res
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
"message": "获取结构列表失败"
}
}
}
async function delPosition (ctx, next) {
try {
const models = ctx.fs.dc.models;
let userInfo = ctx.fs.api.userInfo;
const { id } = ctx.params
await models.Point.destroy({
where: {
id,
}
})
ctx.status = 204;
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`)
ctx.status = 400;
ctx.body = {
"message": '删除点位失败'
}
}
}
async function qrCodeShow (ctx, next) {
try {
const models = ctx.fs.dc.models;
let userInfo = ctx.fs.api.userInfo;
const { projectId, name } = ctx.query;
let options = {
where: {
qrCode: { $ne: null }
},
}
if (projectId) {
options.where.projectId = projectId
}
if (name) {
options.where.name = { $like: `%${name}%` }
}
let res = await models.Point.findAndCountAll(options)
ctx.status = 200;
ctx.body = res
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
"message": "获取二维码列表失败"
}
}
}
async function q(ctx) {
// let error = {
// name: 'FindError',
// message: "获取失败!"
// };
// const models = ctx.fs.dc.models;
// const { devices } = ctx.request.body
// const attachment = ctx.app.fs.qn_attachment
// try {
// if (!Array.isArray(devices)) {
// error = { name: 'paramsError', message: '参数不能为空' };
// ctx.throw(400);
// }
// const devicesArr = await models.Device.findAll({
// attributes: ['deviceNo', 'periodCode', 'qrSrc'],
// where: { deviceNo: { $in: devices } }
// })
// let ids = [], idsMap = {}, qnImages = []
// devicesArr.forEach(d => {
// const qrSrc = d.qrSrc
// const deviceNo = d.deviceNo
// const periodCode = d.periodCode
// if (qrSrc) {
// if (/^\d+$/.test(qrSrc)) {
// ids.push(qrSrc)
// idsMap[qrSrc] = { deviceNo, periodCode }
// } else {
// let domain = globalCache.getQnDomain()
// let imgUrl = `${domain}/${qrSrc}`
// qnImages.push({ src: imgUrl, deviceNo, periodCode })
// }
// }
// })
// const docs = await models.QrcodePng.findAll({
// where: {
// id: { $in: ids }
// },
// attributes: ["id", "base64"]
// })
// let pics = []
// if (docs.length > 0) {
// pics = docs.map((d) => {
// let { deviceNo, periodCode } = idsMap[d.id] || {}
// let base64 = d.base64.replace(/^data:image\/\w+;base64,/, '')
// return {
// url: Buffer.from(base64, 'base64'),
// name: deviceNo,
// periodCode
// }
// })
// }
// if (qnImages.length > 0) {
// let qns = await downloadImgsAsBase64(qnImages)
// pics = pics.concat(qns)
// }
// let fileUrl = await downLoadImageBiz(pics, { zipName: "二维码_" + moment().format("YYYY-MM-DD-HH-mm-ss"), attachment })
// add2CleanCache(fileUrl, attachment)
// ctx.status = 200
// ctx.body = { fileUrl }
// } catch (err) {
// ctx.fs.logger.error(err);
// ctx.status = 400;
// ctx.body = error;
// }
}
module.exports = {
projectList,
postAddProject,
delProject,
addPosition,
position,
delPosition,
qrCodeShow,
q
}

98
api/app/lib/models/camera.js

@ -1,98 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const Camera = sequelize.define("camera", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "camera_id_uindex"
},
siteId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: "工地id",
primaryKey: false,
field: "site_id",
autoIncrement: false,
},
userId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: "工地id",
primaryKey: false,
field: "user_id",
autoIncrement: false,
},
name: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "name",
autoIncrement: false
},
type: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "type",
autoIncrement: false
},
online: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "online",
autoIncrement: false
},
channelNo: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "channelNo",
autoIncrement: false
},
serialNo: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "serialNo",
autoIncrement: false
},
vender: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "vender",
autoIncrement: false
},
}, {
tableName: "camera",
comment: "摄像头",
indexes: []
});
dc.models.Camera = Camera;
return Camera;
};

52
api/app/lib/models/company.js

@ -1,52 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const Company = sequelize.define("company", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "company_id_uindex"
},
name: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "name",
autoIncrement: false
},
relateSites: {
type: DataTypes.ARRAY(DataTypes.INTEGER),
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "relate_sites",
autoIncrement: false
},
del: {
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "del",
autoIncrement: false
}
}, {
tableName: "company",
comment: "",
indexes: []
});
dc.models.Company = Company;
return Company;
};

130
api/app/lib/models/coordinate.js

@ -1,130 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const Coordinate = sequelize.define("coordinate", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
},
siteId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: '工地id',
primaryKey: false,
field: "site_id",
autoIncrement: false
},
title: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: '申请协调标题',
primaryKey: false,
field: "title",
},
emergencyDegree: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: '紧急程度',
primaryKey: false,
field: "emergency_degree",
},
status: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: '协调状态',
primaryKey: false,
field: "status",
},
time: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: null,
comment: '申请时间',
primaryKey: false,
field: "time",
},
describe: {
type: DataTypes.TEXT,
allowNull: false,
defaultValue: null,
comment: '申请描述',
primaryKey: false,
field: "describe",
},
accessory: {
type: DataTypes.JSON,
allowNull: true,
defaultValue: null,
comment: '附件',
primaryKey: false,
field: "accessory",
},
name: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: '申请人',
primaryKey: false,
field: "name",
},
applySite: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: '申请工地',
primaryKey: false,
field: "apply_site",
},
coordinateTime: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
comment: '协调时间',
primaryKey: false,
field: "coordinate_time",
},
coordinator: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: '协调人',
primaryKey: false,
field: "coordinator",
},
coordinateDescribe: {
type: DataTypes.TEXT,
allowNull: true,
defaultValue: null,
comment: '协调描述',
primaryKey: false,
field: "coordinate_describe",
},
coordinateFile: {
type: DataTypes.JSON,
allowNull: true,
defaultValue: null,
comment: '协调附件',
primaryKey: false,
field: "coordinate_file",
},
}, {
tableName: "coordinate",
comment: "",
indexes: []
});
dc.models.Coordinate = Coordinate;
return Coordinate;
};

89
api/app/lib/models/hide_danger_dispose.js

@ -1,89 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const HideDangerDispose = sequelize.define("hideDangerDispose", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "hide_danger_dispose_id_uindex"
},
rectifySiteId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "rectify_site_id",
autoIncrement: false
},
disposeUser: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "dispose_user",
autoIncrement: false
},
disposeTime: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "dispose_time",
autoIncrement: false
},
describe: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "describe",
autoIncrement: false
},
file: {
type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "file",
autoIncrement: false
},
type: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: "1:整改 2:审核 3:复审",
primaryKey: false,
field: "type",
autoIncrement: false
},
admit: {
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: null,
comment: "是否通过审核",
primaryKey: false,
field: "admit",
autoIncrement: false
}
}, {
tableName: "hide_danger_dispose",
comment: "",
indexes: []
});
dc.models.HideDangerDispose = HideDangerDispose;
return HideDangerDispose;
};

107
api/app/lib/models/hide_danger_rectify.js

@ -1,107 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const HideDangerRectify = sequelize.define("hideDangerRectify", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "hide_danger_rectify_id_uindex"
},
name: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "name",
autoIncrement: false
},
places: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "places",
autoIncrement: false
},
type: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "type",
autoIncrement: false
},
level: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "level",
autoIncrement: false
},
desc: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "desc",
autoIncrement: false
},
deadline: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "deadline",
autoIncrement: false
},
user: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "user",
autoIncrement: false
},
createTime: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "create_time",
autoIncrement: false
},
from: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: "1:集团 2:公司 3:项目",
primaryKey: false,
field: "from",
autoIncrement: false
}
}, {
tableName: "hide_danger_rectify",
comment: "",
indexes: []
});
dc.models.HideDangerRectify = HideDangerRectify;
return HideDangerRectify;
};

62
api/app/lib/models/hide_danger_rectify_sites.js

@ -1,62 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const HideDangerRectifySites = sequelize.define("hideDangerRectifySites", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "hide_danger_rectify_sites_id_uindex"
},
rectifyId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "rectify_id",
autoIncrement: false
},
siteId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "site_id",
autoIncrement: false
},
status: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: "0: 已下发, 待整改,\n1: 已整改, 待审核,\n2: 审核通过, 待复审,\n3: 审核未通过, 待重新整改,\n4: 复审未通过, 待重新整改,\n5: 整改完成",
primaryKey: false,
field: "status",
autoIncrement: false
},
lastDisposeTime: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "last_dispose_time",
autoIncrement: false
}
}, {
tableName: "hide_danger_rectify_sites",
comment: "",
indexes: []
});
dc.models.HideDangerRectifySites = HideDangerRectifySites;
return HideDangerRectifySites;
};

88
api/app/lib/models/hide_danger_report.js

@ -1,88 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const HideDangerReport = sequelize.define("hideDangerReport", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "hide_danger_report_id_uindex"
},
siteCount: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: "0",
comment: null,
primaryKey: false,
field: "site_count",
autoIncrement: false
},
rectifyCount: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: "0",
comment: null,
primaryKey: false,
field: "rectify_count",
autoIncrement: false
},
completedRectifyCount: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: "0",
comment: null,
primaryKey: false,
field: "completed_rectify_count",
autoIncrement: false
},
uncompletedRectifyCount: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: "0",
comment: null,
primaryKey: false,
field: "uncompleted_rectify_count",
autoIncrement: false
},
report: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "report",
autoIncrement: false
},
type: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "month 月 / quarter 季度 / year 年",
primaryKey: false,
field: "type",
autoIncrement: false
},
time: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "time",
autoIncrement: false
}
}, {
tableName: "hide_danger_report",
comment: "",
indexes: []
});
dc.models.HideDangerReport = HideDangerReport;
return HideDangerReport;
};

115
api/app/lib/models/metting.js

@ -1,115 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const Metting = sequelize.define("metting", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "metting_id_uindex"
},
siteId: {
type: DataTypes.INTEGER,
//allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "site_id",
autoIncrement: false
},
name: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "name",
autoIncrement: false
},
type: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "type",
autoIncrement: false
},
desc: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "desc",
autoIncrement: false
},
signFile: {
type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "sign_file",
autoIncrement: false
},
recordingVideo: {
type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "recording_video",
autoIncrement: false
},
attachments: {
type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "attachments",
autoIncrement: false
},
submitUser: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "submit_user",
autoIncrement: false
},
submitTime: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "submit_time",
autoIncrement: false
},
date: {
type: DataTypes.DATEONLY,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "date",
autoIncrement: false
}
}, {
tableName: "metting",
comment: "",
indexes: []
});
dc.models.Metting = Metting;
return Metting;
};

60
api/app/lib/models/phone_validate_code.js

@ -1,60 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const PhoneValidateCode = sequelize.define("phoneValidateCode", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true
},
phone: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "phone",
autoIncrement: false
},
code: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "code",
autoIncrement: false
},
sig: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "sig",
autoIncrement: false
},
expired: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "expired",
autoIncrement: false
}
}, {
tableName: "phone_validate_code",
comment: "",
indexes: []
});
dc.models.PhoneValidateCode = PhoneValidateCode;
return PhoneValidateCode;
};

69
api/app/lib/models/post.js

@ -1,69 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const Post = sequelize.define("post", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "post_id_uindex"
},
name: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "name",
autoIncrement: false
},
companyId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "company_id",
autoIncrement: false,
references: {
key: "id",
model: "tCompany"
}
},
departmentId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "department_id",
autoIncrement: false,
references: {
key: "id",
model: "tDepartment"
}
},
del: {
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "del",
autoIncrement: false
}
}, {
tableName: "post",
comment: "",
indexes: []
});
dc.models.Post = Post;
return Post;
};

109
api/app/lib/models/problem_report.js

@ -1,109 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const ProblemReport = sequelize.define("problemReport", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true
},
siteId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "siteId",
autoIncrement: false
},
type: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "type",
autoIncrement: false
},
title: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "title",
autoIncrement: false
},
describe: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "describe",
autoIncrement: false
},
urgencyDegree: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "urgency_degree",
autoIncrement: false
},
isReaded: {
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "isReaded",
autoIncrement: false
},
reportTime: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "report_time",
autoIncrement: false
},
reporter: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "reporter",
autoIncrement: false,
references: {
key: "id",
model: "tUser"
}
},
source: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "source",
autoIncrement: false
},
}, {
tableName: "problem_report",
comment: "",
indexes: []
});
dc.models.ProblemReport = ProblemReport;
return ProblemReport;
};

59
api/app/lib/models/problem_report_consult.js

@ -1,59 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const ProblemReportConsult = sequelize.define("problemReportConsult", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
},
siteId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: '工地id',
primaryKey: false,
field: "site_id",
autoIncrement: false
},
problemId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: '问题id',
primaryKey: false,
field: "problem_id",
},
name: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: '查阅人员',
primaryKey: false,
field: "name",
},
time: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: null,
comment: '查阅时间',
primaryKey: false,
field: "time",
},
}, {
tableName: "problem_report_consult",
comment: "",
indexes: []
});
dc.models.ProblemReportConsult = ProblemReportConsult;
return ProblemReportConsult;
};

64
api/app/lib/models/problem_report_file.js

@ -1,64 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const ProblemReportFile = sequelize.define("problemReportFile", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true
},
reportId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "reportId",
autoIncrement: false,
references: {
key: "id",
model: "tProblemReport"
}
},
filePath: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "filePath",
autoIncrement: false
},
fileSize: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "fileSize",
autoIncrement: false
},
fileName: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "fileName",
autoIncrement: false
}
}, {
tableName: "problem_report_file",
comment: "",
indexes: []
});
dc.models.ProblemReportFile = ProblemReportFile;
return ProblemReportFile;
};

70
api/app/lib/models/project_disclosure.js

@ -1,70 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const ProjectDisclosure = sequelize.define("projectDisclosure", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "project_disclosure_id_uindex"
},
siteId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "site_id",
autoIncrement: false
},
type: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "type",
autoIncrement: false
},
desc: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "desc",
autoIncrement: false
},
submiter: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "submiter",
autoIncrement: false
},
submitTime: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "submit_time",
autoIncrement: false
}
}, {
tableName: "project_disclosure",
comment: "",
indexes: []
});
dc.models.ProjectDisclosure = ProjectDisclosure;
return ProjectDisclosure;
};

65
api/app/lib/models/project_disclosure_files.js

@ -1,65 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const ProjectDisclosureFiles = sequelize.define("projectDisclosureFiles", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "project_disclosure_files_id_uindex"
},
projectDisclosureId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "project_disclosure_id",
autoIncrement: false,
references: {
key: "id",
model: "projectDisclosure"
}
},
fileName: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "file_name",
autoIncrement: false
},
fileSize: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "file_size",
autoIncrement: false
},
fileLink: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "file_link",
autoIncrement: false
}
}, {
tableName: "project_disclosure_files",
comment: "",
indexes: []
});
dc.models.ProjectDisclosureFiles = ProjectDisclosureFiles;
return ProjectDisclosureFiles;
};

170
api/app/lib/models/risk_report.js

@ -1,170 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const RiskReport = sequelize.define("riskReport", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "table_name_id_uindex"
},
siteId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "site_id",
autoIncrement: false
},
name: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "name",
autoIncrement: false
},
riskLevel: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "风险等级",
primaryKey: false,
field: "risk_level",
autoIncrement: false
},
specialType: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "特种作业类型",
primaryKey: false,
field: "special_type",
autoIncrement: false
},
contentFiles: {
type: DataTypes.JSON,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "content_files",
autoIncrement: false
},
content: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "施工内容描述",
primaryKey: false,
field: "content",
autoIncrement: false
},
phone: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "联系方式",
primaryKey: false,
field: "phone",
autoIncrement: false
},
guardian: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "现场监护人",
primaryKey: false,
field: "guardian",
autoIncrement: false
},
controlMeasuresFiles: {
type: DataTypes.JSON,
allowNull: false,
defaultValue: null,
comment: "管控措施附件",
primaryKey: false,
field: "control_measures_files",
autoIncrement: false
},
saftyMeasuresFiles: {
type: DataTypes.JSON,
allowNull: false,
defaultValue: null,
comment: "安全措施附件",
primaryKey: false,
field: "safty_measures_files",
autoIncrement: false
},
operationTicketFiles: {
type: DataTypes.JSON,
allowNull: false,
defaultValue: null,
comment: "作业票附件",
primaryKey: false,
field: "operation_ticket_files",
autoIncrement: false
},
controlMeasures: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "管控措施描述",
primaryKey: false,
field: "control_measures",
autoIncrement: false
},
saftyMeasures: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "安全措施描述",
primaryKey: false,
field: "safty_measures",
autoIncrement: false
},
operationTicket: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "作业票描述",
primaryKey: false,
field: "operation_ticket",
autoIncrement: false
},
state: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "登记状态",
primaryKey: false,
field: "state",
autoIncrement: false
},
createTime: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "create_time",
autoIncrement: false
}
}, {
tableName: "risk_report",
comment: "",
indexes: []
});
dc.models.RiskReport = RiskReport;
return RiskReport;
};

74
api/app/lib/models/role.js

@ -1,74 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const Role = sequelize.define("role", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "role_id_uindex"
},
name: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "name",
autoIncrement: false
},
roleGroupId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "role_group_id",
autoIncrement: false,
references: {
key: "id",
model: "tRoleGroup"
}
},
type: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: "1:集团 2:公司 3:项目",
primaryKey: false,
field: "type",
autoIncrement: false
},
dataRange: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: "1:全公司 2:本人 3:本部门 ",
primaryKey: false,
field: "data_range",
autoIncrement: false
},
del: {
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "del",
autoIncrement: false
}
}, {
tableName: "role",
comment: "",
indexes: []
});
dc.models.Role = Role;
return Role;
};

43
api/app/lib/models/role_group.js

@ -1,43 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const RoleGroup = sequelize.define("roleGroup", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "role_group_id_uindex"
},
name: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "name",
autoIncrement: false
},
del: {
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "del",
autoIncrement: false
}
}, {
tableName: "role_group",
comment: "",
indexes: []
});
dc.models.RoleGroup = RoleGroup;
return RoleGroup;
};

47
api/app/lib/models/role_resource.js

@ -1,47 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const RoleResource = sequelize.define("roleResource", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "role_resource_id_uindex"
},
roleId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "role_id",
autoIncrement: false,
references: {
key: "id",
model: "tRole"
}
},
resourceCode: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "resource_code",
autoIncrement: false
}
}, {
tableName: "role_resource",
comment: "",
indexes: []
});
dc.models.RoleResource = RoleResource;
return RoleResource;
};

69
api/app/lib/models/safety_cultivate.js

@ -1,69 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const SafetyCultivate = sequelize.define("safety_cultivate", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
},
name: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "name",
autoIncrement: false
},
interlinkage: {
type: DataTypes.JSON,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "interlinkage",
autoIncrement: false
} ,
type: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "type",
autoIncrement: false
},
time: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "time",
autoIncrement: false
},
siteId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "site_id",
autoIncrement: false
},
}, {
tableName: "safety_cultivate",
comment: "",
indexes: []
});
dc.models.SafetyCultivate = SafetyCultivate;
return SafetyCultivate;
};

53
api/app/lib/models/user_deal_todo.js

@ -1,53 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const UserDealTodo = sequelize.define("userDealTodo", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "user_deal_todo_id_uindex"
},
userId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "user_id",
autoIncrement: false
},
moduleId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "module_id",
autoIncrement: false
},
module: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "module",
autoIncrement: false
}
}, {
tableName: "user_deal_todo",
comment: "",
indexes: []
});
dc.models.UserDealTodo = UserDealTodo;
return UserDealTodo;
};

51
api/app/lib/models/user_department.js

@ -1,51 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const UserDepartment = sequelize.define("userDepartment", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "user_department_id_uindex"
},
userId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "user_id",
autoIncrement: false,
references: {
key: "id",
model: "tUser"
}
},
departmentId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "department_id",
autoIncrement: false,
references: {
key: "id",
model: "tDepartment"
}
}
}, {
tableName: "user_department",
comment: "",
indexes: []
});
dc.models.UserDepartment = UserDepartment;
return UserDepartment;
};

51
api/app/lib/models/user_post.js

@ -1,51 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const UserPost = sequelize.define("userPost", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "user_post_id_uindex"
},
userId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "user_id",
autoIncrement: false,
references: {
key: "id",
model: "tUser"
}
},
postId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "post_id",
autoIncrement: false,
references: {
key: "id",
model: "tPost"
}
}
}, {
tableName: "user_post",
comment: "",
indexes: []
});
dc.models.UserPost = UserPost;
return UserPost;
};

43
api/app/lib/models/user_token.js

@ -1,43 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const UserToken = sequelize.define("userToken", {
token: {
type: DataTypes.UUIDV4,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "token",
autoIncrement: false,
unique: "user_token_token_uindex"
},
userInfo: {
type: DataTypes.JSONB,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "user_info",
autoIncrement: false
},
expired: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "expired",
autoIncrement: false
}
}, {
tableName: "user_token",
comment: "",
indexes: []
});
dc.models.UserToken = UserToken;
return UserToken;
};

134
api/app/lib/models/worker.js

@ -1,134 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const Worker = sequelize.define("worker", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
unique: "worker_id_uindex"
},
siteId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "site_id",
autoIncrement: false
},
name: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "name",
autoIncrement: false
},
gender: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "gender",
autoIncrement: false
},
photo: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "photo",
autoIncrement: false
},
nation: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "nation",
autoIncrement: false
},
nativePlace: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "native_place",
autoIncrement: false
},
idCard: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "id_card",
autoIncrement: false
},
tel: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "tel",
autoIncrement: false
},
groupId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "group_id",
autoIncrement: false
},
workTypeId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "work_type_id",
autoIncrement: false
},
isLeader: {
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "is_leader",
autoIncrement: false
},
status: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: "1:在册,0:已退场",
primaryKey: false,
field: "status",
autoIncrement: false
}
}, {
tableName: "worker",
comment: "",
indexes: []
});
dc.models.Worker = Worker;
return Worker;
};

74
api/app/lib/models/worker_attendance.js

@ -1,74 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const WorkerAttendance = sequelize.define("workerAttendance", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true,
},
siteId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: '工地id',
primaryKey: false,
field: "site_id",
autoIncrement: false
},
workerId: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: '工人id',
primaryKey: false,
field: "worker_id",
},
temperature: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: '体温',
primaryKey: false,
field: "temperature",
},
code: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: '健康码',
primaryKey: false,
field: "code",
},
type: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: '进出类型',
primaryKey: false,
field: "type",
},
time: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: null,
comment: '通行时间',
primaryKey: false,
field: "time",
}
}, {
tableName: "worker_attendance",
comment: "",
indexes: []
});
dc.models.WorkerAttendance = WorkerAttendance;
return WorkerAttendance;
};

124
api/app/lib/models/xuncheck_task.js

@ -1,124 +0,0 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const xunCheckTask = sequelize.define("xuncheckTask", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true
},
inspectiontaskname: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "inspectiontaskname",
comment: "巡检任务名",
autoIncrement: false
},
inspectionnum: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "inspectionnum",
comment: "巡检频次",
autoIncrement: false
},
taskperiod: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "taskperiod",
comment: "任务周期",
autoIncrement: false
},
checkContent: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "checkContent",
comment: "巡检点",
autoIncrement: false
},
contentList: {
type: DataTypes.JSONB,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
comment: "巡检点列表",
field: "contentList",
autoIncrement: false
},
insectionuser: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "insectionuser",
comment: "巡检人员",
autoIncrement: false
},
status: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "status",
comment: "巡检状态",
autoIncrement: false
},
starTime: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
comment: null,
comment: "巡检开始时间",
primaryKey: false,
field: "star_time",
autoIncrement: false
},
endTime: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "end_time",
comment: "巡检结束时间",
autoIncrement: false
},
path: {
type: DataTypes.JSONB,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "path",
comment: "文件路径",
autoIncrement: false
},
}, {
tableName: "t_xuncheck_tasks",
comment: "",
indexes: []
});
dc.models.xunCheckTask = xunCheckTask;
return xunCheckTask;
};
Loading…
Cancel
Save