明树Git Lab

Commit 83adadec authored by zfp1's avatar zfp1

1

parent 5e2bee82
Pipeline #106036 passed with stage
in 3 seconds
......@@ -15,12 +15,13 @@ async function createTzmbzrs(req, res, next) {
if (!req.body.projectId) {
return res.sendError(errorMessage.paramsError);
}
//创建投资目标责任书数据
let ret = await DB.TzTzmbzrs.create(req.body);
//处理文件参数
req.body.zrswj = (req.body.zrswj || []).map(o => { return o && o.id || o });
req.body.chwj = (req.body.chwj || []).map(o => { return o && o.id || o });
req.body.jyglzrs = (req.body.jyglzrs || []).map(o => { return o && o.id || o });
//创建投资目标责任书数据
let ret = await DB.TzTzmbzrs.create(req.body);
//处理 责任指标 表
let tzmbzrsZbs = (req.body.tzmbzrsZbs || []).map(o => { o.projectId = req.body.projectId; o.sourceId = ret.id; return o });
delete req.body.tzmbzrsZbs;
......@@ -160,7 +161,7 @@ async function getTzmbzrsInfo(req, res, next) {
let files = await DB.File.findAll({ where: { id: { [Op.in]: fileIds } }, raw: true });
let fileMap = {};
files.map(o => { fileMap[o.id] = o });
console.log(fileMap, fileIds, "=======================")
zrs.zrswj = (zrs.zrswj || []).map(o => { return fileMap[o] });
zrs.chwj = (zrs.chwj || []).map(o => { return fileMap[o] });
zrs.jyglzrs = (zrs.jyglzrs || []).map(o => { return fileMap[o] });
......
......@@ -27,6 +27,10 @@ const TzTzkzAqzlhb = sequelize.define('TzTzkzAqzlhb', {
// type: DataTypes.INTEGER,
// comment: "所属投资控制主表id",
// },
sourceId: {
type: DataTypes.INTEGER,
comment: "所属投资控制主表id"
},
projectId: {
type: DataTypes.INTEGER,
comment: "所属项目ID",
......
......@@ -30,7 +30,10 @@ const TzTzkzCwpj = sequelize.define('TzTzkzCwpj', {
type: DataTypes.TEXT,
comment: "主要差异说明",
},
sourceId: {
type: DataTypes.INTEGER,
comment: "所属投资控制主表id"
},
projectId: {
type: DataTypes.INTEGER,
comment: "所属项目ID",
......
......@@ -59,6 +59,10 @@ const TzTzkzGq = sequelize.define('TzTzkzGq', {
// type: DataTypes.INTEGER,
// comment: "所属投资控制主表id",
// },
sourceId: {
type: DataTypes.INTEGER,
comment: "所属投资控制主表id"
},
projectId: {
type: DataTypes.INTEGER,
comment: "所属项目ID",
......
......@@ -91,6 +91,10 @@ const TzTzkzJcpfyj = sequelize.define('TzTzkzJcpfyj', {
// type: DataTypes.INTEGER,
// comment: "所属投资控制主表id",
// },
sourceId: {
type: DataTypes.INTEGER,
comment: "所属投资控制主表id"
},
projectId: {
type: DataTypes.INTEGER,
comment: "所属项目ID",
......
......@@ -82,6 +82,10 @@ const TzTzkzTzekz = sequelize.define('TzTzkzTzekz', {
// type: DataTypes.INTEGER,
// comment: "所属投资控制主表id",
// },
sourceId: {
type: DataTypes.INTEGER,
comment: "所属投资控制主表id"
},
projectId: {
type: DataTypes.INTEGER,
comment: "所属项目ID",
......
......@@ -20,6 +20,10 @@ const TzTzkzTzsy = sequelize.define('TzTzkzTzsy', {
// type: DataTypes.INTEGER,
// comment: "所属投资控制主表id",
// },
sourceId: {
type: DataTypes.INTEGER,
comment: "所属投资控制主表id"
},
projectId: {
type: DataTypes.INTEGER,
comment: "所属项目ID",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment