明树Git Lab

Commit 54ee709e authored by zfp1's avatar zfp1

1

parent e053c2e6
Pipeline #106317 passed with stage
in 4 seconds
/**
* 其他管理 - 参股企业管理 (DB.RcCgqygl)
*/
const errorMessage = require("../utils/errorMessage");
const _ = require("lodash");
const { Op } = require('sequelize');
async function createCgqygl(req, res, next) {
try {
if (!req.body.projectId) {
return res.sendError(errorMessage.paramsError);
}
let ret = await DB.RcCgqygl.create(req.body);
// 投资分红
let tzfhs = (req.body.tzfhs || []).map(o => { o.projectId = req.body.projectId; o.sourceId = ret.id; return o });
if (tzfhs.length) await DB.RcCgqyglTzfh.bulkCreate(tzfhs);
// 委托运营
let wtyys = (req.body.wtyys || []).map(o => { o.projectId = req.body.projectId; o.sourceId = ret.id; return o });
if (wtyys.length) await DB.RcCgqyglWtyy.bulkCreate(wtyys);
return res.sendData(ret);
} catch (error) {
next(error);
}
}
async function updateCgqygl(req, res, next) {
try {
if (!(req.body.id && req.body.projectId)) {
return res.sendError(errorMessage.paramsError);
}
let ret = await DB.RcCgqygl.findOne({ where: { id: req.body.id }, raw: true });
if (!(ret && ret.id)) return res.sendError(errorMessage.resourceNotFound);
// 处理 tzfhs
let tzfhs = req.body.tzfhs || [];
let ids = [], infos = [], newArr = [];
tzfhs.map(o => { if (!o.id) { if (!_.isEmpty(o)) { o.projectId = req.body.projectId; o.sourceId = ret.id; newArr.push(o); } } else { ids.push(o.id); infos.push(o); } return o; });
await DB.RcCgqyglTzfh.destroy({ where: { projectId: req.body.projectId, sourceId: ret.id, id: { [Op.notIn]: ids } } });
if (newArr.length) await DB.RcCgqyglTzfh.bulkCreate(newArr);
await Promise.all(infos.map(item => { return DB.RcCgqyglTzfh.update(item, { where: { id: item.id } }) }));
// 处理 wtyys
let wtyys = req.body.wtyys || [];
let ids2 = [], infos2 = [], newArr2 = [];
wtyys.map(o => { if (!o.id) { if (!_.isEmpty(o)) { o.projectId = req.body.projectId; o.sourceId = ret.id; newArr2.push(o); } } else { ids2.push(o.id); infos2.push(o); } return o; });
await DB.RcCgqyglWtyy.destroy({ where: { projectId: req.body.projectId, sourceId: ret.id, id: { [Op.notIn]: ids2 } } });
if (newArr2.length) await DB.RcCgqyglWtyy.bulkCreate(newArr2);
await Promise.all(infos2.map(item => { return DB.RcCgqyglWtyy.update(item, { where: { id: item.id } }) }));
await DB.RcCgqygl.update(req.body, { where: { id: req.body.id } });
return res.sendData({});
} catch (error) {
next(error);
}
}
async function getCgqygl(req, res, next) {
try {
let search = {};
if (req.body.id) search.id = req.body.id;
if (req.body.projectId) search.projectId = req.body.projectId;
if (_.isEmpty(search)) return res.sendError(errorMessage.paramsError);
let info = await DB.RcCgqygl.findOne({ where: search, raw: true });
if (!(info && info.id && info.projectId)) return res.sendError(errorMessage.resourceNotFound);
let tzfhs = await DB.RcCgqyglTzfh.findAll({ where: { projectId: info.projectId, sourceId: info.id }, raw: true });
let wtyys = await DB.RcCgqyglWtyy.findAll({ where: { projectId: info.projectId, sourceId: info.id }, raw: true });
info.tzfhs = tzfhs || [];
info.wtyys = wtyys || [];
return res.sendData(info);
} catch (error) {
next(error);
}
}
async function getCgqyglList(req, res, next) {
try {
let page = req.body.page || 1;
let limit = req.body.pagesize || req.body.pageSize || 10;
let offset = (page - 1) * limit;
let search = {};
search.order = [['createdAt', 'DESC']];
search.limit = limit;
search.offset = offset;
let where = { del: 0 };
if (req.body.projectName) {
where = { [Op.or]: [{ projectName: { [Op.like]: `%${req.body.projectName}%` } }], del: 0 };
}
search.where = where;
if (req.body.attributes && req.body.attributes.length) search.attributes = req.body.attributes;
let ret = await DB.RcCgqygl.findAndCountAll(search);
return res.sendData(ret);
} catch (error) {
next(error);
}
}
async function deleteCgqygl(req, res, next) {
try {
await DB.RcCgqygl.update({ del: 1 }, { where: { id: req.body.id } });
return res.sendData({});
} catch (error) {
next(error);
}
}
module.exports = {
createCgqygl,
updateCgqygl,
getCgqygl,
getCgqyglList,
deleteCgqygl,
}
\ No newline at end of file
/**
* 日常管理 - 体系建设 (RcTxjs)
*/
const errorMessage = require("../utils/errorMessage");
const _ = require("lodash");
const { Op } = require('sequelize');
async function createTxjs(req, res, next) {
try {
if (!req.body.projectId) {
return res.sendError(errorMessage.paramsError);
}
// 创建主表
let ret = await DB.RcTxjs.create(req.body);
// 处理附件/子表
let wjs = (req.body.rcTxjsWjs || []).map(o => { o.projectId = req.body.projectId; o.sourceId = ret.id; return o });
if (wjs.length) {
await DB.RcTxjsWj.bulkCreate(wjs);
}
return res.sendData(ret);
} catch (error) {
next(error);
}
}
async function updateTxjs(req, res, next) {
try {
if (!(req.body.id && req.body.projectId)) {
return res.sendError(errorMessage.paramsError);
}
let ret = await DB.RcTxjs.findOne({ where: { id: req.body.id }, raw: true });
if (!(ret && ret.id)) {
return res.sendError(errorMessage.resourceNotFound);
}
// 处理子表 rc 文件
let arr = req.body.rcTxjsWjs || [];
let ids = [], infos = [], newArr = [];
(arr || []).map(o => {
if (!o.id) {
if (!_.isEmpty(o)) { o.projectId = req.body.projectId; o.sourceId = ret.id; newArr.push(o); }
} else { ids.push(o.id); infos.push(o); }
return o;
});
await DB.RcTxjsWj.destroy({ where: { projectId: req.body.projectId, sourceId: ret.id, id: { [Op.notIn]: ids } } });
if (newArr.length) await DB.RcTxjsWj.bulkCreate(newArr);
await Promise.all(infos.map(item => { return DB.RcTxjsWj.update(item, { where: { id: item.id } }) }));
await DB.RcTxjs.update(req.body, { where: { id: req.body.id } });
return res.sendData({});
} catch (error) {
next(error);
}
}
async function getTxjs(req, res, next) {
try {
let search = {};
if (req.body.id) search.id = req.body.id;
if (req.body.projectId) search.projectId = req.body.projectId;
if (_.isEmpty(search)) {
return res.sendError(errorMessage.paramsError);
}
let tx = await DB.RcTxjs.findOne({ where: search, raw: true });
if (!(tx && tx.id && tx.projectId)) {
return res.sendError(errorMessage.resourceNotFound);
}
let wjs = await DB.RcTxjsWj.findAll({ where: { projectId: tx.projectId, sourceId: tx.id }, raw: true });
tx.rcTxjsWjs = wjs || [];
return res.sendData(tx);
} catch (error) {
next(error);
}
}
async function getTxjsList(req, res, next) {
try {
let page = req.body.page || 1;
let limit = req.body.pagesize || req.body.pageSize || 10;
let offset = (page - 1) * limit;
let search = {};
search.order = [['createdAt', 'DESC']];
search.limit = limit;
search.offset = offset;
let where = { del: 0 };
if (req.body.projectName) {
where = {
[Op.or]: [
{ projectName: { [Op.like]: `%${req.body.projectName}%` } },
],
del: 0
}
}
search.where = where;
if (req.body.attributes && req.body.attributes.length) {
search.attributes = req.body.attributes;
}
let ret = await DB.RcTxjs.findAndCountAll(search);
return res.sendData(ret);
} catch (error) {
next(error);
}
}
async function deleteTxjs(req, res, next) {
try {
await DB.RcTxjs.update({ del: 1 }, { where: { id: req.body.id } });
return res.sendData({});
} catch (error) {
next(error);
}
}
module.exports = {
createTxjs,
updateTxjs,
getTxjs,
getTxjsList,
deleteTxjs,
}
\ No newline at end of file
......@@ -441,9 +441,9 @@ async function getTzhpjInfo(req, res, next) {
async function createYjgl(req, res, next) {
try {
//
req.body.zbyzyj = (req.body.zbyzyj || []).map(o => { return o && o.id || o });
req.body.qzlyzzyj = (req.body.qzlyzzyj || []).map(o => { return o && o.id || o });
req.body.qmyj = (req.body.qmyj || []).map(o => { return o && o.id || o });
// req.body.zbyzyj = (req.body.zbyzyj || []).map(o => { return o && o.id || o });
// req.body.qzlyzzyj = (req.body.qzlyzzyj || []).map(o => { return o && o.id || o });
// req.body.qmyj = (req.body.qmyj || []).map(o => { return o && o.id || o });
let ret = await DB.ThYjgl.create(req.body);
return res.sendData(ret);
} catch (error) {
......@@ -454,9 +454,9 @@ async function createYjgl(req, res, next) {
async function updateYjgl(req, res, next) {
try {
req.body.zbyzyj = (req.body.zbyzyj || []).map(o => { return o && o.id || o });
req.body.qzlyzzyj = (req.body.qzlyzzyj || []).map(o => { return o && o.id || o });
req.body.qmyj = (req.body.qmyj || []).map(o => { return o && o.id || o });
// req.body.zbyzyj = (req.body.zbyzyj || []).map(o => { return o && o.id || o });
// req.body.qzlyzzyj = (req.body.qzlyzzyj || []).map(o => { return o && o.id || o });
// req.body.qmyj = (req.body.qmyj || []).map(o => { return o && o.id || o });
await DB.ThYjgl.update(req.body, { where: { id: req.body.id } });
return res.sendData();
} catch (error) {
......
......@@ -77,6 +77,10 @@ const ThYyqtzjcTzfx = require('./model/jt/thYyqtzjcTzfx');
const ThYyqtzjcZxjc = require('./model/jt/thYyqtzjcZxjc');
const ThYyqtzjcrcjc = require('./model/jt/thYyqtzjcrcjc');
const RcTxjs = require('./model/jt/rcTxjs');
const RcTxjsWj = require('./model/jt/rcTxjswj');
/**
* 业务表
*/
......@@ -152,6 +156,9 @@ global.DB = {
ThYyqtzjcTzfx,
ThYyqtzjcZxjc,
ThYyqtzjcrcjc,
RcTxjs,
RcTxjsWj,
}
......
const { DataTypes } = require('sequelize');
const sequelize = require('../index');
const moment = require('moment');
//投中管理- 建设期投资检查
const QtCbgl = sequelize.define('QtCbgl', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
},
projectName: {
type: DataTypes.STRING,
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('updatedAt');
return rawValue ? moment(rawValue).format('YYYY-MM-DD HH:mm:ss') : '';
}
}
}, {
tableName: 'jt_qt_cbgl', // 指定表名(如果与模型名不同)
timestamps: true, // 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
});
// 同步模型到数据库(创建表)
QtCbgl.sync({
// force: false,
// force: true ,//会删除已存在表并重新创建
alter: true
})
.then(() => {
console.log('QtCbgl 表同步成功');
});
module.exports = QtCbgl;
\ No newline at end of file
const { DataTypes } = require('sequelize');
const sequelize = require('../index');
const moment = require('moment');
//投中管理- 建设期投资检查
const QtCbglzb = sequelize.define('QtCbglzb', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
},
ztlx: {
type: DataTypes.STRING,
comment: "主题类型"
},
zbmc: {
type: DataTypes.STRING,
comment: "指标名称"
},
zbkhlr: {
type: DataTypes.STRING,
comment: "指标考核内容"
},
jyz: {
type: DataTypes.STRING,
comment: "建议值"
},
sourceId: {
type: DataTypes.INTEGER,
comment: "所属主表id"
},
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('updatedAt');
return rawValue ? moment(rawValue).format('YYYY-MM-DD HH:mm:ss') : '';
}
}
}, {
tableName: 'jt_qt_cbglzb', // 指定表名(如果与模型名不同)
timestamps: true, // 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
});
// 同步模型到数据库(创建表)
QtCbglzb.sync({
// force: false,
// force: true ,//会删除已存在表并重新创建
alter: true
})
.then(() => {
console.log('QtCbglzb 表同步成功');
});
module.exports = QtCbglzb;
\ No newline at end of file
const { DataTypes } = require('sequelize');
const sequelize = require('../index');
const moment = require('moment');
//投中管理- 建设期投资检查
const RcCgqygl = sequelize.define('RcCgqygl', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
},
projectName: {
type: DataTypes.STRING,
comment: "项目名称",
},
qc: {
type: DataTypes.STRING,
comment: "全称"
},
jc: {
type: DataTypes.STRING,
comment: "简称"
},
nbtzglzt: {
type: DataTypes.STRING,
comment: "内部投资管理主体"
},
xmscjd: {
type: DataTypes.STRING,
comment: "项目所处阶段 立项阶段 建设期 建设期/运营期 运营期 已竣备 中止/终止/退出"
},
gqjg: {
type: DataTypes.STRING,
comment: "股权结构"
},
dcqk: {
type: DataTypes.STRING,
comment: "代持情况"
},
sjcgbl: {
type: DataTypes.DECIMAL(5, 2),
comment: "实际持股比例"
},
xmzbjze: {
type: DataTypes.DECIMAL(20, 8),
comment: "项目资本金总额(亿元)",
},
gszbjyczze: {
type: DataTypes.DECIMAL(20, 8),
comment: "公司资本金应出资总额 (亿元)",
},
gsdqycze: {
type: DataTypes.DECIMAL(20, 8),
comment: "公司当前应出资额 (亿元)",
},
gsdqycze: {
type: DataTypes.DECIMAL(20, 8),
comment: "公司当前已出资额 (亿元)",
},
gsdqycwcje: {
type: DataTypes.DECIMAL(20, 8),
comment: "公司当前应出未出金额(亿元)",
},
gsdqsycze: {
type: DataTypes.DECIMAL(20, 8),
comment: "公司当前剩余出资额 (亿元)",
},
cgbczqk: {
type: DataTypes.STRING,
comment: "超股比出资情况"
},
wfqyhttkyd: {
type: DataTypes.TEXT,
comment: "我方权益合同条款约定(市场、设计、施工、运营权、养护份额等权益)"
},
qyhqjz: {
type: DataTypes.TEXT,
comment: "权益获取进展"
},
qyhqyyd: {
type: DataTypes.TEXT,
comment: "权益获取与约定不一致的情况"
},
dbqk: {
type: DataTypes.TEXT,
comment: "督办情况"
},
lrfp: {
type: DataTypes.TEXT,
comment: "利润分配/分红约定"
},
sfddlrfptj: {
type: DataTypes.STRING,
comment: "是否达到利润分配条件"
},
ljhqfh: {
type: DataTypes.DECIMAL(20, 8),
comment: "累计获取分红 (万元)"
},
ytrzj: {
type: DataTypes.DECIMAL(20, 8),
comment: "应投入资金(万元)"
},
ljtrzj: {
type: DataTypes.DECIMAL(20, 8),
comment: "累计投入资金 (万元)"
},
sxtrzj: {
type: DataTypes.DECIMAL(20, 8),
comment: "尚需投入资金"
},
jt: {
type: DataTypes.DECIMAL(20, 8),
comment: "静态"
},
zx: {
type: DataTypes.DECIMAL(20, 8),
comment: "折现(3.5%)"
},
lxr: {
type: DataTypes.STRING,
comment: "联系人"
},
lxfs: {
type: DataTypes.STRING,
comment: "联系方式"
},
bz: {
type: DataTypes.TEXT,
comment: "备注"
},
lrxj: {
type: DataTypes.DECIMAL(20, 8),
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('updatedAt');
return rawValue ? moment(rawValue).format('YYYY-MM-DD HH:mm:ss') : '';
}
}
}, {
tableName: 'jt_rc_cgqygl', // 指定表名(如果与模型名不同)
timestamps: true, // 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
});
// 同步模型到数据库(创建表)
RcCgqygl.sync({
// force: false,
// force: true ,//会删除已存在表并重新创建
alter: true
})
.then(() => {
console.log('RcCgqygl 表同步成功');
});
module.exports = RcCgqygl;
\ No newline at end of file
const { DataTypes } = require('sequelize');
const sequelize = require('../index');
const moment = require('moment');
//投中管理- 建设期投资检查
const RcCgqyglTzfh = sequelize.define('RcCgqyglTzfh', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
},
fhsj: {
type: DataTypes.DATE,
defaultValue: new Date(),
get() {
const rawValue = this.getDataValue('fhsj');
return rawValue ? moment(rawValue).format('YYYY-MM-DD HH:mm:ss') : '';
}
},
fhje: {
type: DataTypes.DECIMAL(20, 8),
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('updatedAt');
return rawValue ? moment(rawValue).format('YYYY-MM-DD HH:mm:ss') : '';
}
}
}, {
tableName: 'jt_rc_cgqygltzfh', // 指定表名(如果与模型名不同)
timestamps: true, // 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
});
// 同步模型到数据库(创建表)
RcCgqyglTzfh.sync({
// force: false,
// force: true ,//会删除已存在表并重新创建
alter: true
})
.then(() => {
console.log('RcCgqyglTzfh 表同步成功');
});
module.exports = RcCgqyglTzfh;
\ No newline at end of file
const { DataTypes } = require('sequelize');
const sequelize = require('../index');
const moment = require('moment');
//投中管理- 建设期投资检查
const RcCgqyglTzfh = sequelize.define('RcCgqyglTzfh', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
},
lx: {
type: DataTypes.STRING,
comment: "类型"
},
fwsj: {
type: DataTypes.DATE,
defaultValue: new Date(),
get() {
const rawValue = this.getDataValue('fwsj');
return rawValue ? moment(rawValue).format('YYYY-MM-DD HH:mm:ss') : '';
}
},
htje: {
type: DataTypes.DECIMAL(20, 8),
comment: "合同金额"
},
ywlr: {
type: DataTypes.DECIMAL(20, 8),
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('updatedAt');
return rawValue ? moment(rawValue).format('YYYY-MM-DD HH:mm:ss') : '';
}
}
}, {
tableName: 'jt_rc_cgqygltzfh', // 指定表名(如果与模型名不同)
timestamps: true, // 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
});
// 同步模型到数据库(创建表)
RcCgqyglTzfh.sync({
// force: false,
// force: true ,//会删除已存在表并重新创建
alter: true
})
.then(() => {
console.log('RcCgqyglTzfh 表同步成功');
});
module.exports = RcCgqyglTzfh;
\ No newline at end of file
const { DataTypes } = require('sequelize');
const sequelize = require('../index');
const moment = require('moment');
//投中管理- 建设期投资检查
const RcTxjs = sequelize.define('RcTxjs', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
},
projectName: {
type: DataTypes.STRING,
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('updatedAt');
return rawValue ? moment(rawValue).format('YYYY-MM-DD HH:mm:ss') : '';
}
}
}, {
tableName: 'jt_rc_txjs', // 指定表名(如果与模型名不同)
timestamps: true, // 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
});
// 同步模型到数据库(创建表)
RcTxjs.sync({
// force: false,
// force: true ,//会删除已存在表并重新创建
alter: true
})
.then(() => {
console.log('RcTxjs 表同步成功');
});
module.exports = RcTxjs;
\ No newline at end of file
const { DataTypes } = require('sequelize');
const sequelize = require('../index');
const moment = require('moment');
//投中管理- 建设期投资检查
const RcTxjsWj = sequelize.define('RcTxjsWj', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
},
ztmc: {
type: DataTypes.STRING,
comment: "主体名称"
},
wjlx: {
type: DataTypes.STRING,
comment: "文件类型"
},
wj: {
type: DataTypes.JSON,
comment: "文件上传"
},
jyz: {
type: DataTypes.STRING,
comment: "建议值"
},
sourceId: {
type: DataTypes.INTEGER,
comment: "所属主表id"
},
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('updatedAt');
return rawValue ? moment(rawValue).format('YYYY-MM-DD HH:mm:ss') : '';
}
}
}, {
tableName: 'jt_rc_rctxwj', // 指定表名(如果与模型名不同)
timestamps: true, // 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
});
// 同步模型到数据库(创建表)
RcTxjsWj.sync({
// force: false,
// force: true ,//会删除已存在表并重新创建
alter: true
})
.then(() => {
console.log('RcTxjsWj 表同步成功');
});
module.exports = RcTxjsWj;
\ No newline at end of file
......@@ -6,6 +6,8 @@ const router = express.Router();
const projectController = require('../controller/projectController');
const projectTzController = require('../controller/projectTzController');
const projectThController = require('../controller/projectThController');
const projectRcController = require('../controller/projectRcController');
const projectQtController = require('../controller/projectQtController');
/**
* 项目相关
......@@ -136,4 +138,55 @@ router.post('/createYjgl', projectThController.createYjgl);
router.post('/updateYjgl', projectThController.updateYjgl);
router.post('/getYjglList', projectThController.getYjglList);
router.post('/getYjglInfo', projectThController.getYjglInfo);
/**
* 日常管理
*/
//4.1 体系建设
router.post('/createTxjs', projectRcController.createTxjs);
router.post('/updateTxjs', projectRcController.updateTxjs);
router.post('/getTxjs', projectRcController.getTxjs);
router.post('/getTxjsList', projectRcController.getTxjsList);
router.post('/deleteTxjs', projectRcController.deleteTxjs);
//4.2 投资规划
// router.post('/createTzgh', projectRcController.createTzgh);
// router.post('/updateTzgh', projectRcController.updateTzgh);
// router.post('/getTzgh', projectRcController.getTzgh);
// router.post('/getTzghList', projectRcController.getTzghList);
// router.post('/deleteTzgh', projectRcController.deleteTzgh);
// 4.3 投资计划
//4.4 信息报送
//4.5 投委会管理
//4.6 投资档案管理
//4.7 参股企业管理
router.post('/createCgqygl', projectQtController.createCgqygl);
router.post('/updateCgqygl', projectQtController.updateCgqygl);
router.post('/getCgqygl', projectQtController.getCgqygl);
router.post('/getCgqyglList', projectQtController.getCgqyglList);
router.post('/deleteCgqygl', projectQtController.deleteCgqygl);
//4.8 信息化建设
/**
* 其他管理
*/
//5.1 成本管理
// router.post('/createCbgl', projectQtController.createCbgl);
// router.post('/updateCbgl', projectQtController.updateCbgl);
// router.post('/getCbgl', projectQtController.getCbgl);
// router.post('/getCbglList', projectQtController.getCbglList);
// router.post('/deleteCbgl', projectQtController.deleteCbgl);
module.exports = router;
\ 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