明树Git Lab

Commit 4934da66 authored by zfp1's avatar zfp1

update

parent 9b71b5eb
Pipeline #108812 passed with stage
in 3 seconds
...@@ -55,6 +55,9 @@ async function getYyqtzhsInfo(req, res, next) { ...@@ -55,6 +55,9 @@ async function getYyqtzhsInfo(req, res, next) {
if (!(tzhs && tzhs.id && tzhs.projectId)) { if (!(tzhs && tzhs.id && tzhs.projectId)) {
return res.sendError(errorMessage.resourceNotFound); return res.sendError(errorMessage.resourceNotFound);
} }
let lastyear = moment().subtract(1, 'year').format('YYYY');
let lastyeartzhs = await DB.ThYyqtzhs.findOne({where: {projectId: tzhs.projectId, nd: lastyear}});
tzhs.lastyeartzhs = lastyeartzhs;
// let yyqtzhss = await DB.ThYyqtzhszb.findAll({ where: { projectId: tzhs.projectId, sourceId: req.body.id }, raw: true }); // let yyqtzhss = await DB.ThYyqtzhszb.findAll({ where: { projectId: tzhs.projectId, sourceId: req.body.id }, raw: true });
// tzhs.yyqtzhss = _.values(_.groupBy(yyqtzhss, 'groupBy')) || [[]] // tzhs.yyqtzhss = _.values(_.groupBy(yyqtzhss, 'groupBy')) || [[]]
return res.sendData(tzhs); return res.sendData(tzhs);
......
...@@ -58,6 +58,13 @@ const ThYyqtzhs = sequelize.define('ThYyqtzhs', { ...@@ -58,6 +58,13 @@ const ThYyqtzhs = sequelize.define('ThYyqtzhs', {
comment: "下年项目阶段", comment: "下年项目阶段",
}, },
nd: {
type: DataTypes.DATE,
get() {
const rawValue = this.getDataValue('nd');
return rawValue ? moment(rawValue).format('YYYY') : '';
}
},
projectGdxxs: { projectGdxxs: {
type: DataTypes.JSON, type: DataTypes.JSON,
}, },
...@@ -97,10 +104,10 @@ const ThYyqtzhs = sequelize.define('ThYyqtzhs', { ...@@ -97,10 +104,10 @@ const ThYyqtzhs = sequelize.define('ThYyqtzhs', {
}, },
tzhsjc: {type: DataTypes.JSON, comment: "投资回收决策"}, tzhsjc: { type: DataTypes.JSON, comment: "投资回收决策" },
tzhsjh: {type: DataTypes.JSON, comment: "投资回收计划----合并到上一个进去了"}, tzhsjh: { type: DataTypes.JSON, comment: "投资回收计划----合并到上一个进去了" },
tzhswcqkndgx: {type: DataTypes.JSON, comment: "投资回收完成情况年度更新"}, tzhswcqkndgx: { type: DataTypes.JSON, comment: "投资回收完成情况年度更新" },
tzhswcqkydgx: {type: DataTypes.JSON, comment: "投资回收完成情况月度更新"}, tzhswcqkydgx: { type: DataTypes.JSON, comment: "投资回收完成情况月度更新" },
......
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