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