明树Git Lab

Commit eb89120a authored by zfp1's avatar zfp1

update

parent 83f40631
Pipeline #104271 passed with stage
in 3 seconds
...@@ -385,6 +385,7 @@ async function xiangmujuecegengxin(body, projectLzType) { ...@@ -385,6 +385,7 @@ async function xiangmujuecegengxin(body, projectLzType) {
await DB.ProjectJczt.destroy({ where: { projectId: projectInfo.id, id: { [Op.notIn]: pnids7 } } }); await DB.ProjectJczt.destroy({ where: { projectId: projectInfo.id, id: { [Op.notIn]: pnids7 } } });
await DB.ProjectJczt.bulkCreate(newprojectJczts); await DB.ProjectJczt.bulkCreate(newprojectJczts);
await Promise.all(pns7.map(item => { DB.ProjectJczt.update(item, { where: { id: item.id } }) })); await Promise.all(pns7.map(item => { DB.ProjectJczt.update(item, { where: { id: item.id } }) }));
// 处理审批意见ProjectSpyj
let projectSpyjs = body.projectSpyjs || []; let projectSpyjs = body.projectSpyjs || [];
let pnids9 = [], pns9 = [], newprojectSpyjs = []; let pnids9 = [], pns9 = [], newprojectSpyjs = [];
projectSpyjs.map(o => { if (!o.id) { if (!_.isEmpty(o)) { o.projectId = projectInfo.id; newprojectSpyjs.push(o); } } else { pnids9.push(o.id); pns9.push(o); } return o }); projectSpyjs.map(o => { if (!o.id) { if (!_.isEmpty(o)) { o.projectId = projectInfo.id; newprojectSpyjs.push(o); } } else { pnids9.push(o.id); pns9.push(o); } return o });
...@@ -406,8 +407,20 @@ async function xiangmujuecegengxin(body, projectLzType) { ...@@ -406,8 +407,20 @@ async function xiangmujuecegengxin(body, projectLzType) {
await DB.ProjectLcbjd.destroy({ where: { projectId: projectInfo.id, id: { [Op.notIn]: pnids11 } } }); await DB.ProjectLcbjd.destroy({ where: { projectId: projectInfo.id, id: { [Op.notIn]: pnids11 } } });
await DB.ProjectLcbjd.bulkCreate(newprojectLcbjds); await DB.ProjectLcbjd.bulkCreate(newprojectLcbjds);
await Promise.all(pns11.map(item => { DB.ProjectLcbjd.update(item, { where: { id: item.id } }) })); await Promise.all(pns11.map(item => { DB.ProjectLcbjd.update(item, { where: { id: item.id } }) }));
// 处理 ProjectZqrz
let projectZqrzs = body.projectZqrzs || [];
let pnids8 = [], newprojectZqrzs = [];
projectZqrzs.map(o => { if (!o.id) { if (!_.isEmpty(o)) { o.projectId = projectInfo.id; newprojectZqrzs.push(o); } } else { pnids8.push(o.id); pnids8.push(o); } return o });
await DB.ProjectZqrz.destroy({ where: { projectId: projectInfo.id, id: { [Op.notIn]: pnids8 } } });
await DB.ProjectZqrz.bulkCreate(newprojectZqrzs);
await Promise.all(pns11.map(item => { DB.ProjectZqrz.update(item, { where: { id: item.id } }) }));
// 处理决策审批意见 ProjectSpyjjc
let projectSpyjjcs = body.projectSpyjjcs || [];
let pnids12 = [], newprojectSpyjjcs = [];
projectSpyjjcs.map(o => { if (!o.id) { if (!_.isEmpty(o)) { o.projectId = projectInfo.id; newprojectSpyjjcs.push(o); } } else { pnids12.push(o.id); pnids12.push(o); } return o });
await DB.ProjectSpyjjc.destroy({ where: { projectId: projectInfo.id, id: { [Op.notIn]: pnids12 } } });
await DB.ProjectSpyjjc.bulkCreate(newprojectSpyjjcs);
await Promise.all(pns9.map(item => { DB.ProjectSpyjjc.update(item, { where: { id: item.id } }) }));
// 立项资料 // 立项资料
let lxzl = body.lxzl || []; let lxzl = body.lxzl || [];
...@@ -581,11 +594,11 @@ async function updateProject(req, res, next) { ...@@ -581,11 +594,11 @@ async function updateProject(req, res, next) {
// await DB.ProjectJczt.bulkCreate(newprojectJczts); // await DB.ProjectJczt.bulkCreate(newprojectJczts);
// await Promise.all(pns7.map(item => { DB.ProjectJczt.update(item, { where: { id: item.id } }) })); // await Promise.all(pns7.map(item => { DB.ProjectJczt.update(item, { where: { id: item.id } }) }));
// // // 处理 projectZqrz // // // 处理 projectZqrz
// // let projectZqrzs = body.projectZqrzs || []; // let projectZqrzs = body.projectZqrzs || [];
// // let pnids8 = [], newprojectZqrzs = []; // let pnids8 = [], newprojectZqrzs = [];
// // projectZqrzs.map(o => { if (!o.id) { o.projectId = project.id; newprojectZqrzs.push(o); } else { pnids8.push(o.id) } return o }); // projectZqrzs.map(o => { if (!o.id) { o.projectId = project.id; newprojectZqrzs.push(o); } else { pnids8.push(o.id) } return o });
// // await DB.ProjectZqrz.destroy({ where: { projectId: project.id, id: { [Op.notIn]: pnids8 } } }); // await DB.ProjectZqrz.destroy({ where: { projectId: project.id, id: { [Op.notIn]: pnids8 } } });
// // await DB.ProjectZqrz.bulkCreate(newprojectZqrzs); // await DB.ProjectZqrz.bulkCreate(newprojectZqrzs);
// // 处理 projectSpyjs // // 处理 projectSpyjs
// let projectSpyjs = body.projectSpyjs || []; // let projectSpyjs = body.projectSpyjs || [];
// let pnids9 = [], pns9 = [], newprojectSpyjs = []; // let pnids9 = [], pns9 = [], newprojectSpyjs = [];
......
const { DataTypes } = require('sequelize'); const { DataTypes } = require('sequelize');
const sequelize = require('../index'); const sequelize = require('../index');
const moment = require('moment'); const moment = require('moment');
const File = require('../system/file');
//决策主体审核情况 //决策主体审核情况
const ProjectJczt = sequelize.define('ProjectJczt', { const ProjectJczt = sequelize.define('ProjectJczt', {
id: { id: {
...@@ -8,17 +10,21 @@ const ProjectJczt = sequelize.define('ProjectJczt', { ...@@ -8,17 +10,21 @@ const ProjectJczt = sequelize.define('ProjectJczt', {
primaryKey: true, primaryKey: true,
autoIncrement: true autoIncrement: true
}, },
hylx: { type: DataTypes.STRING, allowNull: true, comment: "会议类型" }, hylx: { type: DataTypes.STRING, allowNull: true, comment: "会议类型" },
hylx: { type: DataTypes.STRING, allowNull: true, comment: "会议名称" }, hylx: { type: DataTypes.STRING, allowNull: true, comment: "会议名称" },
jc: { type: DataTypes.STRING, allowNull: true, comment: "届次" }, jcsj: { type: DataTypes.DATE, allowNull: true, comment: "决策时间" },
zkrq: { type: DataTypes.DATE, allowNull: true, comment: "召开日期" }, jcjl: { type: DataTypes.STRING, allowNull: true, comment: "决策结论" },
jl: { type: DataTypes.STRING, allowNull: true, comment: "结论" }, hyjy: {
qtsm: { type: DataTypes.TEXT, allowNull: true, comment: "决策结论" }, type: DataTypes.INTEGER, references: {
model: File,
key: 'id'
}, allowNull: true, comment: "hyjy"
},
qtsm: { type: DataTypes.TEXT, allowNull: true, comment: "其他说明" }, qtsm: { type: DataTypes.TEXT, allowNull: true, comment: "其他说明" },
projectId: { projectId: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
comment: "所属项目ID", comment: "所属项目ID",
}, },
del: { del: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
defaultValue: 0, defaultValue: 0,
...@@ -47,7 +53,7 @@ const ProjectJczt = sequelize.define('ProjectJczt', { ...@@ -47,7 +53,7 @@ const ProjectJczt = sequelize.define('ProjectJczt', {
// 同步模型到数据库(创建表) // 同步模型到数据库(创建表)
ProjectJczt.sync({ ProjectJczt.sync({
force: false, force: false,
// force: true ,//会删除已存在表并重新创建 // force: true ,//会删除已存在表并重新创建
// alter: true // alter: true
}) })
......
...@@ -2,14 +2,6 @@ const { DataTypes } = require('sequelize'); ...@@ -2,14 +2,6 @@ const { DataTypes } = require('sequelize');
const sequelize = require('../index'); const sequelize = require('../index');
const moment = require('moment'); const moment = require('moment');
const File = require('../system/file'); const File = require('../system/file');
// yjlx: { type: DataTypes.STRING, allowNull: true, comment: "意见类型" },
// pfyj: { type: DataTypes.STRING, allowNull: true, comment: "批复意见" },
// pfyjsj: { type: DataTypes.DATE, allowNull: true, comment: "批复意见时间" },
// zxhf: { type: DataTypes.STRING, allowNull: true, comment: "执行回复" },
// zxhfsj: { type: DataTypes.DATE, allowNull: true, comment: "执行回复时间" },
// zxhffj: { type: DataTypes.STRING, allowNull: true, comment: "执行回复附件" },
// wlsqksm: { type: DataTypes.STRING, allowNull: true, comment: "未落实情况说明" },
//里程碑节点 //里程碑节点
const ProjectLcbjd = sequelize.define('ProjectLcbjd', { const ProjectLcbjd = sequelize.define('ProjectLcbjd', {
id: { id: {
......
...@@ -3,14 +3,7 @@ const sequelize = require('../index'); ...@@ -3,14 +3,7 @@ const sequelize = require('../index');
const moment = require('moment'); const moment = require('moment');
const File = require('../system/file'); const File = require('../system/file');
// yjlx: { type: DataTypes.STRING, allowNull: true, comment: "意见类型" }, // 立项----审批意见
// pfyj: { type: DataTypes.STRING, allowNull: true, comment: "批复意见" },
// pfyjsj: { type: DataTypes.DATE, allowNull: true, comment: "批复意见时间" },
// zxhf: { type: DataTypes.STRING, allowNull: true, comment: "执行回复" },
// zxhfsj: { type: DataTypes.DATE, allowNull: true, comment: "执行回复时间" },
// zxhffj: { type: DataTypes.STRING, allowNull: true, comment: "执行回复附件" },
// wlsqksm: { type: DataTypes.STRING, allowNull: true, comment: "未落实情况说明" },
// 审批意见
const ProjectSpyj = sequelize.define('ProjectSpyj', { const ProjectSpyj = sequelize.define('ProjectSpyj', {
id: { id: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
......
const { DataTypes } = require('sequelize');
const sequelize = require('../index');
const moment = require('moment');
const File = require('../system/file');
// 决策----审批意见
const ProjectSpyjjc = sequelize.define('ProjectSpyjjc', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
},
lx: {
type: DataTypes.STRING,
comment: "指标名称"
},
pfyj: {
type: DataTypes.TEXT,
comment: "批复意见"
},
pfyjsj: {
type: DataTypes.DATE,
comment: "批复意见时间"
},
zxhf: { type: DataTypes.TEXT, allowNull: true, comment: "执行回复" },
zxhfsj: { type: DataTypes.DATE, allowNull: true, comment: "执行回复时间" },
zxhffj: {
type: DataTypes.INTEGER, references: {
model: File,
key: 'id'
}, allowNull: true, comment: "执行回复附件"
},
wlsqksm: { type: DataTypes.TEXT, allowNull: true, comment: "未落实情况说明" },
projectId: {
type: DataTypes.INTEGER,
comment: "所属项目ID",
},
del: {
type: DataTypes.INTEGER,
defaultValue: 0,
comment: "0 正常 1 删除"
},
createdAt: {
type: DataTypes.DATE,
defaultValue: new Date(),
get() {
const rawValue = this.getDataValue('createdAt');
return rawValue ? moment(rawValue).format('YYYY-MM-DD HH:mm:ss') : '';
}
},
updatedAt: { // 同样处理 updatedAt
type: DataTypes.DATE,
defaultValue: new Date(),
get() {
const rawValue = this.getDataValue('createdAt');
return rawValue ? moment(rawValue).format('YYYY-MM-DD HH:mm:ss') : '';
}
}
}, {
tableName: 'jt_project_spyjjc', // 指定表名(如果与模型名不同)
timestamps: true, // 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
});
// 同步模型到数据库(创建表)
ProjectSpyjjc.sync({
force: false,
// force: true ,//会删除已存在表并重新创建
// alter: true
})
.then(() => {
console.log('ProjectSpyjjc 表同步成功');
});
module.exports = ProjectSpyjjc;
\ No newline at end of file
const { DataTypes } = require('sequelize'); const { DataTypes } = require('sequelize');
const sequelize = require('../index'); const sequelize = require('../index');
const moment = require('moment'); const moment = require('moment');
const File = require('../system/file');
//投资主体审核情况 //投资主体审核情况
const ProjectTzzt = sequelize.define('ProjectTzzt', { const ProjectTzzt = sequelize.define('ProjectTzzt', {
id: { id: {
...@@ -9,9 +11,13 @@ const ProjectTzzt = sequelize.define('ProjectTzzt', { ...@@ -9,9 +11,13 @@ const ProjectTzzt = sequelize.define('ProjectTzzt', {
autoIncrement: true autoIncrement: true
}, },
hylx: { type: DataTypes.STRING, allowNull: true, comment: "会议类型" }, hylx: { type: DataTypes.STRING, allowNull: true, comment: "会议类型" },
jc: { type: DataTypes.STRING, allowNull: true, comment: "届次" }, hymc: { type: DataTypes.STRING, allowNull: true, comment: "会议名称" },
zkrq: { type: DataTypes.DATE, allowNull: true, comment: "召开日期" }, shsj: { type: DataTypes.DATE, allowNull: true, comment: "审核时间" },
jl: { type: DataTypes.STRING, allowNull: true, comment: "结论" }, jl: { type: DataTypes.STRING, allowNull: true, comment: "结论" },
fj: {type: DataTypes.INTEGER, references: {
model: File,
key: 'id'
}, allowNull: true, comment: "附件"},
qtsm: { type: DataTypes.TEXT, allowNull: true, comment: "其他说明" }, qtsm: { type: DataTypes.TEXT, allowNull: true, comment: "其他说明" },
projectId: { projectId: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
......
// const { DataTypes } = require('sequelize');
// const sequelize = require('../index');
// // 债权融资
// const ProjectZqrz = sequelize.define('ProjectZqrz', {
// id: {
// type: DataTypes.INTEGER,
// primaryKey: true,
// autoIncrement: true
// },
// wffzdzqrzjewy: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "我方负责的债权融资金额(万元)" },
// rzcbzq: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "融资成本债权" },
// qxzq: { type: DataTypes.INTEGER, allowNull: true, comment: "期限债权" },
// yjldsjzq: { type: DataTypes.DATE, allowNull: true, comment: "预计落地时间债权" },
// projectId: {
// type: DataTypes.INTEGER,
// comment: "所属项目ID",
// },
// del: {
// type: DataTypes.INTEGER,
// defaultValue: 0,
// comment: "0 正常 1 删除"
// },
// }, {
// tableName: 'jt_project_zqrz', // 指定表名(如果与模型名不同)
// timestamps: true, // 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
// });
// // 同步模型到数据库(创建表)
// ProjectZqrz.sync({
// force: false,
// // force: true ,//会删除已存在表并重新创建
// // alter: true
// })
// .then(() => {
// console.log('ProjectZqrz 表同步成功');
// });
// module.exports = ProjectZqrz;
\ No newline at end of file
const { DataTypes } = require('sequelize');
const sequelize = require('../index');
// 债权融资
const ProjectZqrz = sequelize.define('ProjectZqrz', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
},
wffzdzqrzjewy: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "我方负责的债权融资金额(万元)" },
rzcbzq: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "融资成本债权" },
qxzq: { type: DataTypes.INTEGER, allowNull: true, comment: "期限债权" },
yjldsjzq: { type: DataTypes.DATE, allowNull: true, comment: "预计落地时间债权" },
projectId: {
type: DataTypes.INTEGER,
comment: "所属项目ID",
},
del: {
type: DataTypes.INTEGER,
defaultValue: 0,
comment: "0 正常 1 删除"
},
}, {
tableName: 'jt_project_zqrz', // 指定表名(如果与模型名不同)
timestamps: true, // 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
});
// 同步模型到数据库(创建表)
ProjectZqrz.sync({
force: false,
// force: true ,//会删除已存在表并重新创建
// alter: true
})
.then(() => {
console.log('ProjectZqrz 表同步成功');
});
module.exports = ProjectZqrz;
\ No newline at end of file
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