明树Git Lab
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
J
jt_backend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zengfanpei
jt_backend
Commits
81f3b886
Commit
81f3b886
authored
Dec 03, 2025
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
6d2514b4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
105 deletions
+69
-105
projectController.js
controller/projectController.js
+2
-1
project.js
db/model/jt/project.js
+51
-97
projectModule.js
module/projectModule.js
+16
-7
No files found.
controller/projectController.js
View file @
81f3b886
...
...
@@ -673,7 +673,7 @@ async function getOwnProjects(req, res, next) {
attributes
:
[
'projectId'
],
raw
:
true
});
console
.
log
(
messs
)
//
console.log(messs)
let
projectIds
=
messs
.
map
(
o
=>
{
return
o
&&
o
.
projectId
});
//
let
cArr
=
[
...
...
@@ -695,6 +695,7 @@ async function getOwnProjects(req, res, next) {
if
(
req
.
body
.
attributes
&&
req
.
body
.
attributes
.
length
)
{
search
.
attributes
=
req
.
body
.
attributes
;
}
search
.
raw
=
true
;
console
.
log
(
JSON
.
stringify
(
search
),
"-=="
)
let
ret
=
await
DB
.
Project
.
findAndCountAll
(
search
);
let
lastRet
=
await
projectModule
.
handleProjectData
(
ret
,
search
.
attributes
);
...
...
db/model/jt/project.js
View file @
81f3b886
...
...
@@ -5,7 +5,9 @@ const moment = require('moment')
const
User
=
require
(
'../system/user'
);
const
Project
=
sequelize
.
define
(
'Project'
,
{
// 定义字段
/**
* 系统基本字段
*/
id
:
{
type
:
DataTypes
.
INTEGER
,
primaryKey
:
true
,
...
...
@@ -21,107 +23,37 @@ const Project = sequelize.define('Project', {
key
:
'id'
,
},
},
projectLiuZhuanType
:
{
type
:
DataTypes
.
STRING
,
comment
:
"项目流转状态 1. 待提交、3 待初审、1初审退回、5待终审、1终审退回、7待立项审批、立项审批退回、已立项、已暂停、已结束等"
,
},
projectLiuZhuanTypeDes
:
{
type
:
DataTypes
.
STRING
,
comment
:
"项目流转状态说明 待提交 待初审 初审退回 待终审 终审退回 待立项审批 立项审批退回 已立项 已结束等"
,
},
/**
* 项目基本信息
*/
/**
* 决策及批复信息
*/
/**
* 项目公司落实批复信息
*/
/**
* 项目合法合规性附件
*/
/**
* 全生命周期策划文件
*/
/**
* 项目绩效评价
*/
/**
* 目标责任书考核
*/
/**
* 后评价
*/
/**
* 重大事项上报
*/
/**
* 投资分析
*/
/**
* 投资检查
*/
/**
* 投资回收
*/
/**
* 管理费上缴
*/
/**
* PPP整改方案
*/
/**
* 项目结束/暂停(备案资料)
*/
del
:
{
type
:
DataTypes
.
INTEGER
,
defaultValue
:
0
,
comment1
:
"0 正常 1 删除"
,
},
/*------------------------------------------------------- */
//项目基本信息
projectName
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目名称"
,
_mark
:
"xmjbxx"
},
projectCode
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目编号"
,
_mark
:
"xmjbxx"
},
cym
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"曾用名"
,
_mark
:
"xmjbxx"
},
sfzjc
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否再决策"
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
,
_mark
:
"xmjbxx"
},
// 1是 2 否
projectForeignName
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目外文名称"
,
_mark
:
"xmjbxx"
},
sfnjlhtxm
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否能建联合体项目"
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
,
_mark
:
"xmjbxx"
},
// 1是 2 否
applicationUnit
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"申报单位"
,
_mark
:
"xmjbxx"
},
zyfzy
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"主业/非主业"
,
zjType
:
'danxuan'
,
_mark
:
"xmjbxx"
},
//TODO:下拉
zsqy
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"直属企业"
,
_mark
:
"xmjbxx"
},
sfnjzdhzytz
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否能建重大或重要投资"
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
,
_mark
:
"xmjbxx"
},
sfzzjc
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否自主决策"
,
_mark
:
"xmjbxx"
},
cwbblx
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"财务报表类型"
,
zjType
:
'danxuan'
,
_mark
:
"xmjbxx"
},
//TODO:下拉
zfsphzbajb
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"政府审批(核准、备案)级别"
,
zjType
:
'danxuan'
,
_mark
:
"xmjbxx"
},
//TODO:下拉
sflxbqyscx
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否履行标前预审程序"
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
,
_mark
:
"xmjbxx"
},
xmztz
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"项目总投资"
,
_mark
:
"xmjbxx"
},
glzt
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"管理主体"
,
_mark
:
"xmjbxx"
},
tzms
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资模式"
,
_mark
:
"xmjbxx"
},
dwqypp
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"对外签约品牌"
,
_mark
:
"xmjbxx"
},
xmzjly
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目资金来源"
,
_mark
:
"xmjbxx"
},
swbxmlx
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"商务部项目类型"
,
zjType
:
'danxuan'
,
_mark
:
"xmjbxx"
},
//TODO:下拉
xmlx
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目类型"
,
zjType
:
'danxuan'
,
_mark
:
"xmjbxx"
},
//TODO:下拉
sfpppxm
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否PPP项目"
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
,
_mark
:
"xmjbxx"
},
/**
* 立项字段
*/
projectName
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目名称"
,
_mark
:
"lixiang"
},
projectCode
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目编号"
,
},
cym
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"曾用名"
,
},
sfzjc
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否再决策"
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
,
},
// 1是 2 否
projectForeignName
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目外文名称"
,
},
sfnjlhtxm
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否能建联合体项目"
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
,
},
// 1是 2 否
applicationUnit
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"申报单位"
,
},
zyfzy
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"主业/非主业"
,
zjType
:
'danxuan'
,
},
//TODO:下拉
zsqy
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"直属企业"
,
},
sfnjzdhzytz
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否能建重大或重要投资"
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
,
},
sfzzjc
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否自主决策"
,
},
cwbblx
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"财务报表类型"
,
zjType
:
'danxuan'
,
},
//TODO:下拉
zfsphzbajb
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"政府审批(核准、备案)级别"
,
zjType
:
'danxuan'
,
},
//TODO:下拉
sflxbqyscx
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否履行标前预审程序"
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
,
},
xmztz
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"项目总投资"
,
},
glzt
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"管理主体"
,
},
tzms
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资模式"
,
},
dwqypp
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"对外签约品牌"
,
},
xmzjly
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目资金来源"
,
},
swbxmlx
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"商务部项目类型"
,
zjType
:
'danxuan'
,
},
//TODO:下拉
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:下拉
sjnzjjw
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"省(境内)/洲际(境外)"
,
zjType
:
'danxuan'
},
//TODO:下拉
...
...
@@ -261,6 +193,28 @@ const Project = sequelize.define('Project', {
//里程碑计划审批表文件
/**
* 决策字段
*/
//
// ---从此往下待确定--- //
...
...
module/projectModule.js
View file @
81f3b886
...
...
@@ -5,8 +5,6 @@ const _ = require("lodash");
const
{
Op
}
=
require
(
'sequelize'
);
const
sequelize
=
require
(
'sequelize'
);
const
moment
=
require
(
'moment'
);
const
userModule
=
require
(
'../module/userModule'
);
const
projectModule
=
require
(
'../module/projectModule'
);
...
...
@@ -15,7 +13,7 @@ const projectModule = require('../module/projectModule');
async
function
handleProjectData
(
ret
,
queryAttrs
)
{
let
rawAttributes
=
_
.
cloneDeep
(
DB
.
Project
.
rawAttributes
);
console
.
log
(
r
awAttributes
,
"===="
)
console
.
log
(
r
et
,
"===="
)
let
queryRawAtr
=
[],
resourceKeys
=
[];
for
(
let
index
=
0
;
index
<
queryAttrs
.
length
;
index
++
)
{
const
element
=
queryAttrs
[
index
];
...
...
@@ -27,11 +25,22 @@ async function handleProjectData(ret, queryAttrs) {
}
}
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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment