明树Git Lab

Commit 8ea4a304 authored by zfp1's avatar zfp1

update

parent 54ee709e
Pipeline #106323 passed with stage
in 3 seconds
...@@ -24,6 +24,7 @@ async function createCgqygl(req, res, next) { ...@@ -24,6 +24,7 @@ async function createCgqygl(req, res, next) {
// 投资分红 // 投资分红
let tzfhs = (req.body.tzfhs || []).map(o => { o.projectId = req.body.projectId; o.sourceId = ret.id; return o }); let tzfhs = (req.body.tzfhs || []).map(o => { o.projectId = req.body.projectId; o.sourceId = ret.id; return o });
console.log(tzfhs, "===")
if (tzfhs.length) await DB.RcCgqyglTzfh.bulkCreate(tzfhs); if (tzfhs.length) await DB.RcCgqyglTzfh.bulkCreate(tzfhs);
// 委托运营 // 委托运营
...@@ -71,7 +72,6 @@ async function getCgqygl(req, res, next) { ...@@ -71,7 +72,6 @@ async function getCgqygl(req, res, next) {
try { try {
let search = {}; let search = {};
if (req.body.id) search.id = req.body.id; 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); if (_.isEmpty(search)) return res.sendError(errorMessage.paramsError);
let info = await DB.RcCgqygl.findOne({ where: search, raw: true }); let info = await DB.RcCgqygl.findOne({ where: search, raw: true });
......
...@@ -512,16 +512,16 @@ async function getYjglInfo(req, res, next) { ...@@ -512,16 +512,16 @@ async function getYjglInfo(req, res, next) {
if (!(yjgl && yjgl.id)) { if (!(yjgl && yjgl.id)) {
return res.sendError(errorMessage.resourceNotFound); return res.sendError(errorMessage.resourceNotFound);
} }
let fileIds = [].concat(yjgl.zbyzyj).concat(yjgl.qzlyzzyj).concat(yjgl.qmyj); // let fileIds = [].concat(yjgl.zbyzyj).concat(yjgl.qzlyzzyj).concat(yjgl.qmyj);
let files = await DB.File.findAll({ where: { id: { [Op.in]: fileIds } }, raw: true }); // let files = await DB.File.findAll({ where: { id: { [Op.in]: fileIds } }, raw: true });
let fileMap = []; // let fileMap = [];
for (let index = 0; index < files.length; index++) { // for (let index = 0; index < files.length; index++) {
const element = files[index]; // const element = files[index];
fileMap[element.id] = element; // fileMap[element.id] = element;
} // }
yjgl.zbyzyj = (yjgl.zbyzyj || []).map(o => { return fileMap[o] }); // yjgl.zbyzyj = (yjgl.zbyzyj || []).map(o => { return fileMap[o] });
yjgl.qzlyzzyj = yjgl.qzlyzzyj.map(o => { return fileMap[o] }); // yjgl.qzlyzzyj = yjgl.qzlyzzyj.map(o => { return fileMap[o] });
yjgl.qmyj = yjgl.qmyj.map(o => { return fileMap[o] }); // yjgl.qmyj = yjgl.qmyj.map(o => { return fileMap[o] });
return res.sendData(yjgl); return res.sendData(yjgl);
} catch (error) { } catch (error) {
next(error); next(error);
......
...@@ -76,11 +76,13 @@ const ThYyqtzjc = require('./model/jt/thYyqtzjc'); ...@@ -76,11 +76,13 @@ const ThYyqtzjc = require('./model/jt/thYyqtzjc');
const ThYyqtzjcTzfx = require('./model/jt/thYyqtzjcTzfx'); const ThYyqtzjcTzfx = require('./model/jt/thYyqtzjcTzfx');
const ThYyqtzjcZxjc = require('./model/jt/thYyqtzjcZxjc'); const ThYyqtzjcZxjc = require('./model/jt/thYyqtzjcZxjc');
const ThYyqtzjcrcjc = require('./model/jt/thYyqtzjcrcjc'); const ThYyqtzjcrcjc = require('./model/jt/thYyqtzjcrcjc');
const ThYjgl = require("./model/jt/thYjgl");
const RcTxjs = require('./model/jt/rcTxjs'); const RcTxjs = require('./model/jt/rcTxjs');
const RcTxjsWj = require('./model/jt/rcTxjswj'); const RcTxjsWj = require('./model/jt/rcTxjswj');
const RcCgqygl = require('./model/jt/rcCgqygl');
const RcCgqyglTzfh = require('./model/jt/rcCgqygltzfh');
const RcCgqyglWtyy = require('./model/jt/rcCgqyglWtyy');
/** /**
* 业务表 * 业务表
*/ */
...@@ -156,9 +158,13 @@ global.DB = { ...@@ -156,9 +158,13 @@ global.DB = {
ThYyqtzjcTzfx, ThYyqtzjcTzfx,
ThYyqtzjcZxjc, ThYyqtzjcZxjc,
ThYyqtzjcrcjc, ThYyqtzjcrcjc,
ThYjgl,
RcTxjs, RcTxjs,
RcTxjsWj, RcTxjsWj,
RcCgqygl,
RcCgqyglTzfh,
RcCgqyglWtyy,
} }
......
...@@ -34,14 +34,14 @@ const RcCgqygl = sequelize.define('RcCgqygl', { ...@@ -34,14 +34,14 @@ const RcCgqygl = sequelize.define('RcCgqygl', {
type: DataTypes.STRING, type: DataTypes.STRING,
comment: "股权结构" comment: "股权结构"
}, },
dcqk: { // dcqk: {
type: DataTypes.STRING, // type: DataTypes.STRING,
comment: "代持情况" // comment: "代持情况"
}, // },
sjcgbl: { // sjcgbl: {
type: DataTypes.DECIMAL(5, 2), // type: DataTypes.DECIMAL(5, 2),
comment: "实际持股比例" // comment: "实际持股比例"
}, // },
xmzbjze: { xmzbjze: {
type: DataTypes.DECIMAL(20, 8), type: DataTypes.DECIMAL(20, 8),
......
...@@ -22,7 +22,10 @@ const RcCgqyglTzfh = sequelize.define('RcCgqyglTzfh', { ...@@ -22,7 +22,10 @@ const RcCgqyglTzfh = sequelize.define('RcCgqyglTzfh', {
type: DataTypes.DECIMAL(20, 8), type: DataTypes.DECIMAL(20, 8),
comment: "分红金额" comment: "分红金额"
}, },
sourceId: {
type: DataTypes.INTEGER,
comment: "所属主表id"
},
projectId: { projectId: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
comment: "所属项目ID", comment: "所属项目ID",
......
...@@ -3,7 +3,7 @@ const sequelize = require('../index'); ...@@ -3,7 +3,7 @@ const sequelize = require('../index');
const moment = require('moment'); const moment = require('moment');
//投中管理- 建设期投资检查 //投中管理- 建设期投资检查
const RcCgqyglTzfh = sequelize.define('RcCgqyglTzfh', { const RcCgqyglWtyy = sequelize.define('RcCgqyglWtyy', {
id: { id: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
primaryKey: true, primaryKey: true,
...@@ -30,7 +30,10 @@ const RcCgqyglTzfh = sequelize.define('RcCgqyglTzfh', { ...@@ -30,7 +30,10 @@ const RcCgqyglTzfh = sequelize.define('RcCgqyglTzfh', {
type: DataTypes.DECIMAL(20, 8), type: DataTypes.DECIMAL(20, 8),
comment: "业务利润" comment: "业务利润"
}, },
sourceId: {
type: DataTypes.INTEGER,
comment: "所属主表id"
},
projectId: { projectId: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
comment: "所属项目ID", comment: "所属项目ID",
...@@ -57,19 +60,19 @@ const RcCgqyglTzfh = sequelize.define('RcCgqyglTzfh', { ...@@ -57,19 +60,19 @@ const RcCgqyglTzfh = sequelize.define('RcCgqyglTzfh', {
} }
} }
}, { }, {
tableName: 'jt_rc_cgqygltzfh', // 指定表名(如果与模型名不同) tableName: 'jt_rc_cgqyglwtyy', // 指定表名(如果与模型名不同)
timestamps: true, // 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置) timestamps: true, // 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
}); });
// 同步模型到数据库(创建表) // 同步模型到数据库(创建表)
RcCgqyglTzfh.sync({ RcCgqyglWtyy.sync({
// force: false, // force: false,
// force: true ,//会删除已存在表并重新创建 // force: true ,//会删除已存在表并重新创建
alter: true alter: true
}) })
.then(() => { .then(() => {
console.log('RcCgqyglTzfh 表同步成功'); console.log('RcCgqyglWtyy 表同步成功');
}); });
module.exports = RcCgqyglTzfh; module.exports = RcCgqyglWtyy;
\ No newline at end of file \ 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