明树Git Lab

Commit b016712b authored by zfp1's avatar zfp1

update

parent 9b2d8967
Pipeline #106926 passed with stage
in 3 seconds
...@@ -362,6 +362,7 @@ async function approvalLixiang(req, res, next) { ...@@ -362,6 +362,7 @@ async function approvalLixiang(req, res, next) {
userId: req.user.id, userId: req.user.id,
actionName: '立项审批通过', actionName: '立项审批通过',
projectId: project.id, projectId: project.id,
content: req.body.approvalMessage,
}); });
} else { } else {
//待立项 //待立项
...@@ -370,6 +371,7 @@ async function approvalLixiang(req, res, next) { ...@@ -370,6 +371,7 @@ async function approvalLixiang(req, res, next) {
userId: req.user.id, userId: req.user.id,
actionName: '立项审批未通过', actionName: '立项审批未通过',
projectId: project.id, projectId: project.id,
content: req.body.approvalMessage,
}); });
} }
return res.sendData(proInfo); return res.sendData(proInfo);
...@@ -611,6 +613,7 @@ async function approvalJuece(req, res, next) { ...@@ -611,6 +613,7 @@ async function approvalJuece(req, res, next) {
userId: req.user.id, userId: req.user.id,
actionName: '决策审批通过', actionName: '决策审批通过',
projectId: project.id, projectId: project.id,
content: req.body.approvalMessage,
}); });
} else { } else {
//回到 已立项 //回到 已立项
...@@ -619,6 +622,7 @@ async function approvalJuece(req, res, next) { ...@@ -619,6 +622,7 @@ async function approvalJuece(req, res, next) {
userId: req.user.id, userId: req.user.id,
actionName: '决策审批未通过', actionName: '决策审批未通过',
projectId: project.id, projectId: project.id,
content: req.body.approvalMessage,
}); });
} }
return res.sendData(proInfo); return res.sendData(proInfo);
......
...@@ -17,7 +17,7 @@ async function createYyqtzhs(req, res, next) { ...@@ -17,7 +17,7 @@ async function createYyqtzhs(req, res, next) {
if (!req.body.projectId) { if (!req.body.projectId) {
return res.sendError(errorMessage.paramsError); return res.sendError(errorMessage.paramsError);
} }
let ret = await DB.ThTzYyqtzhs.create(req.body); let ret = await DB.ThYyqtzhs.create(req.body);
// //处理财务指标 // //处理财务指标
// let flattenArr = []; // let flattenArr = [];
...@@ -35,7 +35,7 @@ async function createYyqtzhs(req, res, next) { ...@@ -35,7 +35,7 @@ async function createYyqtzhs(req, res, next) {
// } // }
// delete req.body.yyqtzhss; // delete req.body.yyqtzhss;
// await DB.ThTzYyqtzhszb.bulkCreate(flattenArr); // await DB.ThYyqtzhszb.bulkCreate(flattenArr);
return res.sendData(ret); return res.sendData(ret);
} catch (error) { } catch (error) {
next(error); next(error);
...@@ -51,11 +51,11 @@ async function getYyqtzhsInfo(req, res, next) { ...@@ -51,11 +51,11 @@ async function getYyqtzhsInfo(req, res, next) {
if (_.isEmpty(search)) { if (_.isEmpty(search)) {
return res.sendError(errorMessage.paramsError); return res.sendError(errorMessage.paramsError);
} }
let tzhs = await DB.ThTzYyqtzhs.findOne({ where: search, raw: true }); let tzhs = await DB.ThYyqtzhs.findOne({ where: search, raw: true });
if (!(tzhs && tzhs.id && tzhs.projectId)) { if (!(tzhs && tzhs.id && tzhs.projectId)) {
return res.sendError(errorMessage.resourceNotFound); return res.sendError(errorMessage.resourceNotFound);
} }
// let yyqtzhss = await DB.ThTzYyqtzhszb.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);
} catch (error) { } catch (error) {
...@@ -85,12 +85,12 @@ async function updateYyqtzhs(req, res, next) { ...@@ -85,12 +85,12 @@ async function updateYyqtzhs(req, res, next) {
// } // }
// } // }
// } // }
// await DB.ThTzYyqtzhszb.destroy({ where: { projectId: req.body.projectId, sourceId: req.body.id, id: { [Op.notIn]: ids3 } } }); // 删除id不在传入id数组里面的(用户在界面删除的) // await DB.ThYyqtzhszb.destroy({ where: { projectId: req.body.projectId, sourceId: req.body.id, id: { [Op.notIn]: ids3 } } }); // 删除id不在传入id数组里面的(用户在界面删除的)
// await DB.ThTzYyqtzhszb.bulkCreate(newtyyqtzhss);//创建新的 没有id的 // await DB.ThYyqtzhszb.bulkCreate(newtyyqtzhss);//创建新的 没有id的
// await Promise.all(infos3.map(item => { DB.ThTzYyqtzhszb.update(item, { where: { id: item.id } }) })); // await Promise.all(infos3.map(item => { DB.ThYyqtzhszb.update(item, { where: { id: item.id } }) }));
// delete req.body.yyqtzhss; // delete req.body.yyqtzhss;
await DB.ThTzYyqtzhs.update(req.body, { where: { id: req.body.id } }); await DB.ThYyqtzhs.update(req.body, { where: { id: req.body.id } });
return res.sendData({}); return res.sendData({});
} catch (error) { } catch (error) {
next(error); next(error);
...@@ -121,7 +121,7 @@ async function getYyqtzhsList(req, res, next) { ...@@ -121,7 +121,7 @@ async function getYyqtzhsList(req, res, next) {
if (req.body.attributes && req.body.attributes.length) { if (req.body.attributes && req.body.attributes.length) {
search.attributes = req.body.attributes; search.attributes = req.body.attributes;
} }
let ret = await DB.ThTzYyqtzhs.findAndCountAll(search); let ret = await DB.ThYyqtzhs.findAndCountAll(search);
return res.sendData(ret); return res.sendData(ret);
} catch (error) { } catch (error) {
next(error); next(error);
...@@ -538,7 +538,7 @@ async function getYjglInfo(req, res, next) { ...@@ -538,7 +538,7 @@ async function getYjglInfo(req, res, next) {
async function deleteYyqtzhs(req, res, next) { async function deleteYyqtzhs(req, res, next) {
try { try {
await DB.ThTzYyqtzhs.update({ del: 1 }, { where: { id: req.body.id } }); await DB.ThYyqtzhs.update({ del: 1 }, { where: { id: req.body.id } });
return res.sendData({}); return res.sendData({});
} catch (error) { } catch (error) {
next(error); next(error);
......
...@@ -61,6 +61,7 @@ const TzJsqtzjcTzfx = require("./model/jt/tzJsqtzjcTzfx"); ...@@ -61,6 +61,7 @@ const TzJsqtzjcTzfx = require("./model/jt/tzJsqtzjcTzfx");
const TzJsqtzjcrcjc = require("./model/jt/tzJsqtzjcrcjc"); const TzJsqtzjcrcjc = require("./model/jt/tzJsqtzjcrcjc");
const TzJsqtzjcZxjc = require("./model/jt/tzJsqtzjcZxjc"); const TzJsqtzjcZxjc = require("./model/jt/tzJsqtzjcZxjc");
const TzJsqtzhs = require("./model/jt/tzJsqtzhs");
const TzZdsxsp = require("./model/jt/tzZdsxsp"); const TzZdsxsp = require("./model/jt/tzZdsxsp");
const TzZdsxspfl = require("./model/jt/tzZdsxspfl"); const TzZdsxspfl = require("./model/jt/tzZdsxspfl");
...@@ -146,7 +147,7 @@ global.DB = { ...@@ -146,7 +147,7 @@ global.DB = {
TzZdfxcz, TzZdfxcz,
// TzZdfxcwzb, // TzZdfxcwzb,
// TzZdfxqk, // TzZdfxqk,
TzJsqtzhs,
TzJsqtzjc, TzJsqtzjc,
TzJsqtzjcTzfx, TzJsqtzjcTzfx,
// TzJsqtzjcrcjc, // TzJsqtzjcrcjc,
......
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