明树Git Lab

Commit 81f3b886 authored by zfp1's avatar zfp1

update

parent 6d2514b4
...@@ -673,7 +673,7 @@ async function getOwnProjects(req, res, next) { ...@@ -673,7 +673,7 @@ async function getOwnProjects(req, res, next) {
attributes: ['projectId'], attributes: ['projectId'],
raw: true raw: true
}); });
console.log(messs) // console.log(messs)
let projectIds = messs.map(o => { return o && o.projectId }); let projectIds = messs.map(o => { return o && o.projectId });
// //
let cArr = [ let cArr = [
...@@ -695,6 +695,7 @@ async function getOwnProjects(req, res, next) { ...@@ -695,6 +695,7 @@ async function getOwnProjects(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;
} }
search.raw = true;
console.log(JSON.stringify(search), "-==") console.log(JSON.stringify(search), "-==")
let ret = await DB.Project.findAndCountAll(search); let ret = await DB.Project.findAndCountAll(search);
let lastRet = await projectModule.handleProjectData(ret, search.attributes); let lastRet = await projectModule.handleProjectData(ret, search.attributes);
......
...@@ -5,7 +5,9 @@ const moment = require('moment') ...@@ -5,7 +5,9 @@ const moment = require('moment')
const User = require('../system/user'); const User = require('../system/user');
const Project = sequelize.define('Project', { const Project = sequelize.define('Project', {
// 定义字段 /**
* 系统基本字段
*/
id: { id: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
primaryKey: true, primaryKey: true,
...@@ -21,107 +23,37 @@ const Project = sequelize.define('Project', { ...@@ -21,107 +23,37 @@ const Project = sequelize.define('Project', {
key: 'id', key: 'id',
}, },
}, },
projectLiuZhuanType: {
type: DataTypes.STRING,
comment: "项目流转状态 1. 待提交、3 待初审、1初审退回、5待终审、1终审退回、7待立项审批、立项审批退回、已立项、已暂停、已结束等",
},
projectLiuZhuanTypeDes: {
type: DataTypes.STRING,
comment: "项目流转状态说明 待提交 待初审 初审退回 待终审 终审退回 待立项审批 立项审批退回 已立项 已结束等",
},
/**
* 项目基本信息
*/
/**
* 决策及批复信息
*/
/**
* 项目公司落实批复信息
*/
/**
* 项目合法合规性附件
*/
/**
* 全生命周期策划文件
*/
/**
* 项目绩效评价
*/
/**
* 目标责任书考核
*/
/**
* 后评价
*/
/**
* 重大事项上报
*/
/**
* 投资分析
*/
/**
* 投资检查
*/
/**
* 投资回收
*/
/**
* 管理费上缴
*/
/**
* PPP整改方案
*/
/**
* 项目结束/暂停(备案资料)
*/
del: { del: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
defaultValue: 0, defaultValue: 0,
comment1: "0 正常 1 删除", comment1: "0 正常 1 删除",
}, },
/*------------------------------------------------------- */ /**
//项目基本信息 * 立项字段
projectName: { type: DataTypes.STRING, allowNull: true, comment: "项目名称", _mark: "xmjbxx" }, */
projectCode: { type: DataTypes.STRING, allowNull: true, comment: "项目编号", _mark: "xmjbxx" }, projectName: { type: DataTypes.STRING, allowNull: true, comment: "项目名称", _mark: "lixiang" },
cym: { type: DataTypes.STRING, allowNull: true, comment: "曾用名", _mark: "xmjbxx" }, projectCode: { type: DataTypes.STRING, allowNull: true, comment: "项目编号", },
sfzjc: { type: DataTypes.INTEGER, allowNull: true, comment: "是否再决策", zjType: 'danxuan', zjKey: 'sf', _mark: "xmjbxx" }, // 1是 2 否 cym: { type: DataTypes.STRING, allowNull: true, comment: "曾用名", },
projectForeignName: { type: DataTypes.STRING, allowNull: true, comment: "项目外文名称", _mark: "xmjbxx" }, sfzjc: { type: DataTypes.INTEGER, allowNull: true, comment: "是否再决策", zjType: 'danxuan', zjKey: 'sf', }, // 1是 2 否
sfnjlhtxm: { type: DataTypes.INTEGER, allowNull: true, comment: "是否能建联合体项目", zjType: 'danxuan', zjKey: 'sf', _mark: "xmjbxx" }, // 1是 2 否 projectForeignName: { type: DataTypes.STRING, allowNull: true, comment: "项目外文名称", },
applicationUnit: { type: DataTypes.STRING, allowNull: true, comment: "申报单位", _mark: "xmjbxx" }, sfnjlhtxm: { type: DataTypes.INTEGER, allowNull: true, comment: "是否能建联合体项目", zjType: 'danxuan', zjKey: 'sf', }, // 1是 2 否
zyfzy: { type: DataTypes.STRING, allowNull: true, comment: "主业/非主业", zjType: 'danxuan', _mark: "xmjbxx" }, //TODO:下拉 applicationUnit: { type: DataTypes.STRING, allowNull: true, comment: "申报单位", },
zsqy: { type: DataTypes.STRING, allowNull: true, comment: "直属企业", _mark: "xmjbxx" }, zyfzy: { type: DataTypes.STRING, allowNull: true, comment: "主业/非主业", zjType: 'danxuan', }, //TODO:下拉
sfnjzdhzytz: { type: DataTypes.INTEGER, allowNull: true, comment: "是否能建重大或重要投资", zjType: 'danxuan', zjKey: 'sf', _mark: "xmjbxx" }, zsqy: { type: DataTypes.STRING, allowNull: true, comment: "直属企业", },
sfzzjc: { type: DataTypes.INTEGER, allowNull: true, comment: "是否自主决策", _mark: "xmjbxx" }, sfnjzdhzytz: { type: DataTypes.INTEGER, allowNull: true, comment: "是否能建重大或重要投资", zjType: 'danxuan', zjKey: 'sf', },
cwbblx: { type: DataTypes.STRING, allowNull: true, comment: "财务报表类型", zjType: 'danxuan', _mark: "xmjbxx" }, //TODO:下拉 sfzzjc: { type: DataTypes.INTEGER, allowNull: true, comment: "是否自主决策", },
zfsphzbajb: { type: DataTypes.STRING, allowNull: true, comment: "政府审批(核准、备案)级别", zjType: 'danxuan', _mark: "xmjbxx" }, //TODO:下拉 cwbblx: { type: DataTypes.STRING, allowNull: true, comment: "财务报表类型", zjType: 'danxuan', }, //TODO:下拉
sflxbqyscx: { type: DataTypes.INTEGER, allowNull: true, comment: "是否履行标前预审程序", zjType: 'danxuan', zjKey: 'sf', _mark: "xmjbxx" }, zfsphzbajb: { type: DataTypes.STRING, allowNull: true, comment: "政府审批(核准、备案)级别", zjType: 'danxuan', }, //TODO:下拉
xmztz: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "项目总投资", _mark: "xmjbxx" }, sflxbqyscx: { type: DataTypes.INTEGER, allowNull: true, comment: "是否履行标前预审程序", zjType: 'danxuan', zjKey: 'sf', },
glzt: { type: DataTypes.STRING, allowNull: true, comment: "管理主体", _mark: "xmjbxx" }, xmztz: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "项目总投资", },
tzms: { type: DataTypes.STRING, allowNull: true, comment: "投资模式", _mark: "xmjbxx" }, glzt: { type: DataTypes.STRING, allowNull: true, comment: "管理主体", },
dwqypp: { type: DataTypes.STRING, allowNull: true, comment: "对外签约品牌", _mark: "xmjbxx" }, tzms: { type: DataTypes.STRING, allowNull: true, comment: "投资模式", },
xmzjly: { type: DataTypes.STRING, allowNull: true, comment: "项目资金来源", _mark: "xmjbxx" }, dwqypp: { type: DataTypes.STRING, allowNull: true, comment: "对外签约品牌", },
swbxmlx: { type: DataTypes.STRING, allowNull: true, comment: "商务部项目类型", zjType: 'danxuan', _mark: "xmjbxx" }, //TODO:下拉 xmzjly: { type: DataTypes.STRING, allowNull: true, comment: "项目资金来源", },
xmlx: { type: DataTypes.STRING, allowNull: true, comment: "项目类型", zjType: 'danxuan', _mark: "xmjbxx" }, //TODO:下拉 swbxmlx: { type: DataTypes.STRING, allowNull: true, comment: "商务部项目类型", zjType: 'danxuan', }, //TODO:下拉
sfpppxm: { type: DataTypes.INTEGER, allowNull: true, comment: "是否PPP项目", zjType: 'danxuan', zjKey: 'sf', _mark: "xmjbxx" }, xmlx: { type: DataTypes.STRING, allowNull: true, comment: "项目类型", zjType: 'danxuan', }, //TODO:下拉
sfpppxm: { type: DataTypes.INTEGER, allowNull: true, comment: "是否PPP项目", zjType: 'danxuan', zjKey: 'sf', },
//项目所在地 //项目所在地
jnw: { type: DataTypes.STRING, allowNull: true, comment: "境内/外", zjType: 'danxuan' },//TODO:下拉 jnw: { type: DataTypes.STRING, allowNull: true, comment: "境内/外", zjType: 'danxuan' },//TODO:下拉
sjnzjjw: { type: DataTypes.STRING, allowNull: true, comment: "省(境内)/洲际(境外)", zjType: 'danxuan' },//TODO:下拉 sjnzjjw: { type: DataTypes.STRING, allowNull: true, comment: "省(境内)/洲际(境外)", zjType: 'danxuan' },//TODO:下拉
...@@ -258,8 +190,30 @@ const Project = sequelize.define('Project', { ...@@ -258,8 +190,30 @@ const Project = sequelize.define('Project', {
spjb: { type: DataTypes.STRING, allowNull: true, comment: "审批级别" }, //TODO:下拉 spjb: { type: DataTypes.STRING, allowNull: true, comment: "审批级别" }, //TODO:下拉
spje: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "审批金额(万元)" }, spje: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "审批金额(万元)" },
spsj: { type: DataTypes.DATE, allowNull: true, comment: "审批时间" }, spsj: { type: DataTypes.DATE, allowNull: true, comment: "审批时间" },
//里程碑计划审批表文件 //里程碑计划审批表文件
/**
* 决策字段
*/
// //
// ---从此往下待确定--- // // ---从此往下待确定--- //
......
...@@ -5,8 +5,6 @@ const _ = require("lodash"); ...@@ -5,8 +5,6 @@ const _ = require("lodash");
const { Op } = require('sequelize'); const { Op } = require('sequelize');
const sequelize = require('sequelize'); const sequelize = require('sequelize');
const moment = require('moment'); const moment = require('moment');
const userModule = require('../module/userModule');
const projectModule = require('../module/projectModule');
...@@ -15,7 +13,7 @@ const projectModule = require('../module/projectModule'); ...@@ -15,7 +13,7 @@ const projectModule = require('../module/projectModule');
async function handleProjectData(ret, queryAttrs) { async function handleProjectData(ret, queryAttrs) {
let rawAttributes = _.cloneDeep(DB.Project.rawAttributes); let rawAttributes = _.cloneDeep(DB.Project.rawAttributes);
console.log(rawAttributes, "====") console.log(ret, "====")
let queryRawAtr = [], resourceKeys = []; let queryRawAtr = [], resourceKeys = [];
for (let index = 0; index < queryAttrs.length; index++) { for (let index = 0; index < queryAttrs.length; index++) {
const element = queryAttrs[index]; const element = queryAttrs[index];
...@@ -27,11 +25,22 @@ async function handleProjectData(ret, queryAttrs) { ...@@ -27,11 +25,22 @@ async function handleProjectData(ret, queryAttrs) {
} }
} }
let resources = await getResourceByKeys(resourceKeys); let resources = await getResourceByKeys(resourceKeys);
console.log(resources);
// let groupAttr = _.groupBy(queryRawAtr, 'zjType');
//获取对应得资源库说明
return resources; let newRet = [];
for (let index = 0; index < ret.rows.length; index++) {
const element = ret.rows[index];
console.log(element);
for (const key in element) {
if(!_.isEmpty(resources[key])) {
element[key] = resources[key][element[key]]
}
}
newRet.push(element);
}
//获取对应得资源库说明
ret.rows = newRet;
return ret;
} }
......
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