明树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
ae7590d7
Commit
ae7590d7
authored
Dec 03, 2025
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
81f3b886
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
759 additions
and
351 deletions
+759
-351
projectController.js
controller/projectController.js
+483
-193
c.md
db/model/jt/c.md
+13
-1
project.js
db/model/jt/project.js
+248
-155
projectRouter.js
router/projectRouter.js
+15
-2
No files found.
controller/projectController.js
View file @
ae7590d7
...
...
@@ -10,22 +10,8 @@ async function getProjectFields(req, res, next) {
try
{
let
rawAttributes
=
_
.
cloneDeep
(
DB
.
Project
.
rawAttributes
);
let
obj
=
{
xmjbxx
:
'项目基本信息'
,
// jcpfxx: '决策及批复信息',
// xmgslspfxx: '项目公司落实批复信息',
// xmfhhgxffj: '项目合法合规性附件',
// qshmkchw: '全生命周期策划文件',
// xmjxxpj: '项目绩效评价',
// mbzrskh: '目标责任书考核',
// hpj: '后评价',
// zdsxsb: '重大事项上报',
// tzfx: '投资分析',
// tzjc: '投资检查',
// tzhs: '投资核算',
// system: '系统字段',
// glfsj: '管理费上缴',
// pppzgfa: 'PPP资格认定方案',
// xmjs: '项目结束/暂停(备案资料)',
lixiang
:
'立项'
,
juece
:
'决策'
,
};
for
(
const
key
in
rawAttributes
)
{
let
element
=
_
.
pick
(
rawAttributes
[
key
],
[
'comment'
,
'_mark'
,
'fieldName'
]);
...
...
@@ -47,8 +33,9 @@ async function getProjectFields(req, res, next) {
next
(
error
);
}
}
/**
* 创建
提交 创建
* 创建
时候保存项目
* @param {*} req
* @param {*} res
* @param {*} next
...
...
@@ -64,12 +51,12 @@ async function createProject(req, res, next) {
projectXmtzzes :关联项目投资额表
projectBjtjs :关联项目核心边界条件表
projectSpyjs :关联审批意见表
projectFxgls: 关联 风险管理
projectTzzts: 关联 投资主体审核
ProjectJczts: 关联 决策主体审核
// projectZqrzs: 关联 债权融资
//
projectFxgls: 关联 风险管理
//
projectTzzts: 关联 投资主体审核
//
ProjectJczts: 关联 决策主体审核
//
//
projectZqrzs: 关联 债权融资
projectCwpjzbs: 关联 财务评价指标
ProjectLcbjds: 关联 里程碑节点
//
ProjectLcbjds: 关联 里程碑节点
lxzl :关联projectFiles-File文件表
lxpfwj :关联projectFiles-File文件表
xgshcl :关联projectFiles-File文件表
...
...
@@ -80,7 +67,9 @@ async function createProject(req, res, next) {
'projectSpyjs'
,
'projectFxgls'
,
'projectTzzts'
,
'projectJczts'
,
'projectZqrzs'
,
'projectCwpjzbs'
,
'projectLcbjds'
,
'lxzl'
,
'lxpfwj'
,
'xgshcl'
]);
projectInfo
.
projectCreator
=
req
.
user
.
id
;
projectInfo
.
projectLiuZhuanType
=
1
;
// 草稿状态
projectInfo
.
projectLzType
=
1
;
// 草稿状态
let
project
=
await
DB
.
Project
.
create
(
projectInfo
);
project
=
project
.
toJSON
();
// 处理 projectJsgms
...
...
@@ -100,18 +89,18 @@ async function createProject(req, res, next) {
let
projectBjtjs
=
body
.
projectBjtjs
||
[];
projectBjtjs
=
projectBjtjs
.
map
(
o
=>
{
o
.
projectId
=
project
.
id
;
return
o
});
await
DB
.
ProjectBjtj
.
bulkCreate
(
projectBjtjs
);
// 处理 projectFxgl
let
projectFxgls
=
body
.
projectFxgls
||
[];
projectFxgls
=
projectFxgls
.
map
(
o
=>
{
o
.
projectId
=
project
.
id
;
return
o
});
await
DB
.
ProjectFxgl
.
bulkCreate
(
projectFxgls
);
//
//
处理 projectFxgl
//
let projectFxgls = body.projectFxgls || [];
//
projectFxgls = projectFxgls.map(o => { o.projectId = project.id; return o });
//
await DB.ProjectFxgl.bulkCreate(projectFxgls);
// 处理 ProjectTzzt
let
projectTzzts
=
body
.
projectTzzts
||
[];
projectTzzts
=
projectTzzts
.
map
(
o
=>
{
o
.
projectId
=
project
.
id
;
return
o
});
await
DB
.
ProjectTzzt
.
bulkCreate
(
projectTzzts
);
// 处理 ProjectJczt
let
projectJczts
=
body
.
projectJczts
||
[];
projectJczts
=
projectJczts
.
map
(
o
=>
{
o
.
projectId
=
project
.
id
;
return
o
});
await
DB
.
ProjectJczt
.
bulkCreate
(
projectJczts
);
//
let projectTzzts = body.projectTzzts || [];
//
projectTzzts = projectTzzts.map(o => { o.projectId = project.id; return o });
//
await DB.ProjectTzzt.bulkCreate(projectTzzts);
//
//
处理 ProjectJczt
//
let projectJczts = body.projectJczts || [];
//
projectJczts = projectJczts.map(o => { o.projectId = project.id; return o });
//
await DB.ProjectJczt.bulkCreate(projectJczts);
// // 处理 projectZqrz
// let projectZqrzs = body.projectZqrzs || [];
// projectZqrzs = projectZqrzs.map(o => { o.projectId = project.id; return o });
...
...
@@ -144,140 +133,255 @@ async function createProject(req, res, next) {
console
.
log
(
proFiles
,
"================="
)
await
DB
.
ProjectFile
.
bulkCreate
(
proFiles
);
/**
* 处理项目审批及消息 依靠项目状态流转
* 1. 发起人角色为项目公司项目发起人 xmgs_xmfqr;
* 2. 流转状态为 1待处理
* 3. 消息发送给 项目公司项目审批人 xmgs_xmspr,需要写一个审批接口 :项目基本信息不变,状态需要改为 2 项目公司初审:通过则变为3,不通过则变为1;
* 4. 若是投管部门自主创建项目,则项目状态直接到 5 待投管审核---退回则到1
* 5. 投管后续立项推送、决策推送状态再行处理
*/
//B. 找到本公司审批人员发送消息-- 如果找不到人 则提示项目已保存,联系管理员添加【项目公司项目审批人】角色
//A. 创建发起记录
if
(
req
.
body
.
buttonType
===
'submit'
)
{
await
DB
.
FlowRecord
.
create
({
userId
:
req
.
user
.
id
,
actionName
:
'发起项目初审
'
,
actionName
:
'创建项目
'
,
projectId
:
project
.
id
,
});
let
approvers
=
await
userModule
.
getProjectApprover
(
req
.
user
.
id
,
'xmgs_xmspr'
);
if
(
!
(
approvers
&&
approvers
.
length
>
0
))
{
return
res
.
sendError
({
code
:
'60001'
,
msg
:
'项目已保存,请联系管理员为本公司添加【项目初审】角色人员'
});
// if (req.body.buttonType === 'submit') {
// await DB.FlowRecord.create({
// userId: req.user.id,
// actionName: '发起项目立项',
// projectId: project.id,
// });
// // let approvers = await userModule.getProjectApprover(req.user.id, 'xmgs_xmspr');
// // if (!(approvers && approvers.length > 0)) {
// // return res.sendError({ code: '60001', msg: '项目已保存,请联系管理员为本公司添加【项目初审】角色人员' });
// // }
// // await DB.Message.create({
// // projectId: project.id,
// // creator: req.user.id,
// // receivers: approvers.map(o => o.id),
// // type: 2,
// // title: `项目【${project.name}】已发起,请尽快处理!`,
// // content: `项目【${project.name}】已发起,请尽快处理!`
// // });
// await DB.Project.update({ projectLzType: 3 }, { where: { id: project.id } });
// }
console
.
log
(
project
)
return
res
.
sendData
(
project
);
}
catch
(
error
)
{
next
(
error
);
}
await
DB
.
Message
.
create
({
}
async
function
xiangmulixianggengxin
(
project
,
projectLzType
)
{
try
{
// 1. 处理项目
// let project = body;
let
projectInfo
=
_
.
omit
(
body
,
[
'projectJsgms'
,
'projectGdxxs'
,
'projectXmtzzes'
,
'projectBjtjs'
,
'projectSpyjs'
,
'projectFxgls'
,
'projectTzzts'
,
'projectJczts'
,
'projectZqrzs'
,
'projectCwpjzbs'
,
'projectLcbjds'
,
'lxzl'
,
'lxpfwj'
,
'xgshcl'
]);
// 处理 projectJsgms
let
projectJsgms
=
body
.
projectJsgms
||
[];
let
pnids1
=
[],
pns1
=
[],
newprojectJsgms
=
[];
projectJsgms
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectJsgms
.
push
(
o
);
}
}
else
{
pnids1
.
push
(
o
.
id
);
pns1
.
push
(
o
);
}
return
o
});
await
DB
.
ProjectJsgm
.
destroy
({
where
:
{
projectId
:
project
.
id
,
id
:
{
[
Op
.
notIn
]:
pnids1
}
}
});
await
DB
.
ProjectJsgm
.
bulkCreate
(
newprojectJsgms
);
await
Promise
.
all
(
pns1
.
map
(
item
=>
{
DB
.
ProjectJsgm
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
// 处理 projectGdxxs
let
projectGdxxs
=
body
.
projectGdxxs
||
[];
let
pnids2
=
[],
pns2
=
[],
newprojectGdxxs
=
[];
projectGdxxs
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectGdxxs
.
push
(
o
);
}
}
else
{
pnids2
.
push
(
o
.
id
);
pns2
.
push
(
o
);
}
return
o
});
await
DB
.
ProjectGdxx
.
destroy
({
where
:
{
projectId
:
project
.
id
,
id
:
{
[
Op
.
notIn
]:
pnids2
}
}
});
await
DB
.
ProjectGdxx
.
bulkCreate
(
newprojectGdxxs
);
await
Promise
.
all
(
pns2
.
map
(
item
=>
{
DB
.
ProjectGdxx
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
// 处理 projectXmtzzes
let
projectXmtzzes
=
body
.
projectXmtzzes
||
[];
projectXmtzzes
=
utils
.
flattenTree
(
projectXmtzzes
,
'xh'
,
'parentXh'
);
let
pnids3
=
[],
pns3
=
[],
newprojectXmtzzes
=
[];
projectXmtzzes
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectXmtzzes
.
push
(
o
);
}
}
else
{
pnids3
.
push
(
o
.
id
);
pns3
.
push
(
o
);
}
return
o
});
await
DB
.
ProjectXmtzze
.
bulkCreate
(
newprojectXmtzzes
);
await
Promise
.
all
(
pns3
.
map
(
item
=>
{
DB
.
ProjectXmtzze
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
// 处理 projectBjtjs
let
projectBjtjs
=
body
.
projectBjtjs
||
[];
let
pnids4
=
[],
pns4
=
[],
newprojectBjtjs
=
[];
projectBjtjs
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectBjtjs
.
push
(
o
);
}
}
else
{
pnids4
.
push
(
o
.
id
);
pns4
.
push
(
o
);
}
return
o
});
await
DB
.
ProjectBjtj
.
destroy
({
where
:
{
projectId
:
project
.
id
,
id
:
{
[
Op
.
notIn
]:
pnids4
}
}
});
await
DB
.
ProjectBjtj
.
bulkCreate
(
newprojectBjtjs
);
await
Promise
.
all
(
pns4
.
map
(
item
=>
{
DB
.
ProjectBjtj
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
// 处理 projectSpyjs
let
projectSpyjs
=
body
.
projectSpyjs
||
[];
let
pnids9
=
[],
pns9
=
[],
newprojectSpyjs
=
[];
projectSpyjs
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectSpyjs
.
push
(
o
);
}
}
else
{
pnids9
.
push
(
o
.
id
);
pns9
.
push
(
o
);
}
return
o
});
await
DB
.
ProjectSpyj
.
destroy
({
where
:
{
projectId
:
project
.
id
,
id
:
{
[
Op
.
notIn
]:
pnids9
}
}
});
await
DB
.
ProjectSpyj
.
bulkCreate
(
newprojectSpyjs
);
await
Promise
.
all
(
pns9
.
map
(
item
=>
{
DB
.
ProjectSpyj
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
// 处理 projectCwpjzb
let
projectCwpjzbs
=
body
.
projectCwpjzbs
||
[];
let
pnids10
=
[],
pns10
=
[],
newprojectCwpjzbs
=
[];
projectCwpjzbs
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
())
{
o
.
projectId
=
project
.
id
;
newprojectCwpjzbs
.
push
(
o
);
}
}
else
{
pnids10
.
push
(
o
.
id
);
pns10
.
push
(
o
);
}
return
o
});
await
DB
.
ProjectCwpjzb
.
destroy
({
where
:
{
projectId
:
project
.
id
,
id
:
{
[
Op
.
notIn
]:
pnids10
}
}
});
await
DB
.
ProjectCwpjzb
.
bulkCreate
(
newprojectCwpjzbs
);
await
Promise
.
all
(
pns10
.
map
(
item
=>
{
DB
.
ProjectCwpjzb
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
// 处理 ProjectLcbjd
let
projectLcbjds
=
body
.
projectLcbjds
||
[];
let
pnids11
=
[],
pns11
=
[],
newprojectLcbjds
=
[];
projectLcbjds
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectLcbjds
.
push
(
o
);
}
}
else
{
pnids11
.
push
(
o
.
id
);
pns11
.
push
(
o
);
}
return
o
});
await
DB
.
ProjectLcbjd
.
destroy
({
where
:
{
projectId
:
project
.
id
,
id
:
{
[
Op
.
notIn
]:
pnids11
}
}
});
await
DB
.
ProjectLcbjd
.
bulkCreate
(
newprojectLcbjds
);
await
Promise
.
all
(
pns11
.
map
(
item
=>
{
DB
.
ProjectLcbjd
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
// 处理 projectTzzjll-----
// 立项资料
let
lxzl
=
body
.
lxzl
||
[];
let
needIds
=
[];
let
createIds
=
[];
lxzl
.
map
(
o
=>
{
if
(
!
o
.
proFieldKey
)
{
createIds
.
push
({
id
:
o
.
id
,
proFieldKey
:
'lxzl'
})
}
else
{
needIds
.
push
(
o
.
id
)
};
return
{
fileId
:
o
.
id
,
projectId
:
project
.
id
,
proFieldKey
:
'lxzl'
}
});
// 立项批复文件
let
lxpfwj
=
body
.
lxpfwj
||
[];
lxpfwj
.
map
(
o
=>
{
if
(
!
o
.
proFieldKey
)
{
createIds
.
push
({
id
:
o
.
id
,
proFieldKey
:
'lxpfwj'
})
}
else
{
needIds
.
push
(
o
.
id
)
};
return
{
fileId
:
o
.
id
,
projectId
:
project
.
id
,
proFieldKey
:
'lxpfwj'
}
});
// 相关上会材料
let
xgshcl
=
body
.
xgshcl
||
[];
xgshcl
.
map
(
o
=>
{
if
(
!
o
.
proFieldKey
)
{
createIds
.
push
({
id
:
o
.
id
,
proFieldKey
:
'xgshcl'
})
}
else
{
needIds
.
push
(
o
.
id
)
};
return
{
fileId
:
o
.
id
,
projectId
:
project
.
id
,
proFieldKey
:
'xgshcl'
}
});
// 处理文件
//1. 删除
await
DB
.
ProjectFile
.
destroy
({
where
:
{
projectId
:
project
.
id
,
creator
:
req
.
user
.
id
,
receivers
:
approvers
.
map
(
o
=>
o
.
id
),
type
:
2
,
title
:
`项目【
${
project
.
name
}
】已发起,请尽快处理!`
,
content
:
`项目【
${
project
.
name
}
】已发起,请尽快处理!`
fileId
:
{
[
Op
.
notIn
]:
needIds
}
}
});
await
DB
.
Project
.
update
({
projectLiuZhuanType
:
3
},
{
where
:
{
id
:
project
.
id
}
});
//2. 创建
if
(
createIds
.
length
)
{
let
creProFiles
=
createIds
.
map
(
o
=>
{
return
{
projectId
:
project
.
id
,
fileId
:
o
.
id
,
proFieldKey
:
o
.
proFieldKey
}
});
await
DB
.
ProjectFile
.
bulkCreate
(
creProFiles
);
}
console
.
log
(
project
)
return
res
.
sendData
(
project
);
if
(
projectLzType
)
{
projectInfo
.
projectLzType
=
projectLzType
;
}
const
ret
=
await
DB
.
Project
.
update
(
projectInfo
,
{
where
:
{
id
:
body
.
id
}
});
return
ret
;
}
catch
(
error
)
{
next
(
error
);
throw
error
;
}
}
/**
* 立项之前保存
*/
async
function
saveProjectPreLixiang
(
req
,
res
,
next
)
{
try
{
let
body
=
req
.
body
;
if
(
!
body
.
id
)
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
)
}
let
ret
=
await
xiangmulixianggengxin
(
body
);
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
}
}
/**
* 更新提交 更新
* @param {*} req
* @param {*} res
* @param {*} next
* @returns
* 发起立项
*/
async
function
updateProject
(
req
,
res
,
next
)
{
async
function
startLixiang
(
req
,
res
,
next
)
{
try
{
let
body
=
req
.
body
;
if
(
!
body
.
id
)
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
)
}
//记录操作
await
DB
.
FlowRecord
.
create
({
userId
:
req
.
user
.
id
,
actionName
:
'发起项目立项审批'
,
projectId
:
project
.
id
,
});
//更新信息和状态
let
ret
=
await
xiangmulixianggengxin
(
body
,
3
);
//状态 3 -- 显示立项审批中
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
error
);
}
}
async
function
xiangmujuecegengxin
(
project
,
projectLzType
)
{
// 1. 处理项目
let
project
=
body
;
let
projectInfo
=
_
.
omit
(
body
,
[
'projectJsgms'
,
'projectGdxxs'
,
'projectXmtzzes'
,
'projectBjtjs'
,
'projectSpyjs'
,
'projectFxgls'
,
'projectTzzts'
,
'projectJczts'
,
'projectZqrzs'
,
'projectCwpjzbs'
,
'projectLcbjds'
,
'lxzl'
,
'lxpfwj'
,
'xgshcl'
]);
// 处理 projectJsgms
let
projectJsgms
=
body
.
projectJsgms
||
[];
let
pnids1
=
[],
pns1
=
[],
newprojectJsgms
=
[];
projectJsgms
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
)){
o
.
projectId
=
project
.
id
;
newprojectJsgms
.
push
(
o
);
}
}
else
{
pnids1
.
push
(
o
.
id
);
pns1
.
push
(
o
);
}
return
o
});
projectJsgms
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectJsgms
.
push
(
o
);
}
}
else
{
pnids1
.
push
(
o
.
id
);
pns1
.
push
(
o
);
}
return
o
});
await
DB
.
ProjectJsgm
.
destroy
({
where
:
{
projectId
:
project
.
id
,
id
:
{
[
Op
.
notIn
]:
pnids1
}
}
});
await
DB
.
ProjectJsgm
.
bulkCreate
(
newprojectJsgms
);
await
Promise
.
all
(
pns1
.
map
(
item
=>
{
DB
.
ProjectJsgm
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}})
}));
await
Promise
.
all
(
pns1
.
map
(
item
=>
{
DB
.
ProjectJsgm
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
// 处理 projectGdxxs
let
projectGdxxs
=
body
.
projectGdxxs
||
[];
let
pnids2
=
[],
pns2
=
[],
newprojectGdxxs
=
[];
projectGdxxs
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectGdxxs
.
push
(
o
);
}
}
else
{
pnids2
.
push
(
o
.
id
);
pns2
.
push
(
o
);
}
return
o
});
projectGdxxs
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectGdxxs
.
push
(
o
);
}
}
else
{
pnids2
.
push
(
o
.
id
);
pns2
.
push
(
o
);
}
return
o
});
await
DB
.
ProjectGdxx
.
destroy
({
where
:
{
projectId
:
project
.
id
,
id
:
{
[
Op
.
notIn
]:
pnids2
}
}
});
await
DB
.
ProjectGdxx
.
bulkCreate
(
newprojectGdxxs
);
await
Promise
.
all
(
pns2
.
map
(
item
=>
{
DB
.
ProjectGdxx
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}})
}));
await
Promise
.
all
(
pns2
.
map
(
item
=>
{
DB
.
ProjectGdxx
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
// 处理 projectXmtzzes
let
projectXmtzzes
=
body
.
projectXmtzzes
||
[];
projectXmtzzes
=
utils
.
flattenTree
(
projectXmtzzes
,
'xh'
,
'parentXh'
);
let
pnids3
=
[],
pns3
=
[],
newprojectXmtzzes
=
[];
projectXmtzzes
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectXmtzzes
.
push
(
o
);}
}
else
{
pnids3
.
push
(
o
.
id
);
pns3
.
push
(
o
);
}
return
o
});
projectXmtzzes
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectXmtzzes
.
push
(
o
);
}
}
else
{
pnids3
.
push
(
o
.
id
);
pns3
.
push
(
o
);
}
return
o
});
await
DB
.
ProjectXmtzze
.
bulkCreate
(
newprojectXmtzzes
);
await
Promise
.
all
(
pns3
.
map
(
item
=>
{
DB
.
ProjectXmtzze
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}})
}));
await
Promise
.
all
(
pns3
.
map
(
item
=>
{
DB
.
ProjectXmtzze
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
// 处理 projectBjtjs
let
projectBjtjs
=
body
.
projectBjtjs
||
[];
let
pnids4
=
[],
pns4
=
[],
newprojectBjtjs
=
[];
projectBjtjs
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectBjtjs
.
push
(
o
);}
}
else
{
pnids4
.
push
(
o
.
id
);
pns4
.
push
(
o
);
}
return
o
});
let
pnids4
=
[],
pns4
=
[],
newprojectBjtjs
=
[];
projectBjtjs
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectBjtjs
.
push
(
o
);
}
}
else
{
pnids4
.
push
(
o
.
id
);
pns4
.
push
(
o
);
}
return
o
});
await
DB
.
ProjectBjtj
.
destroy
({
where
:
{
projectId
:
project
.
id
,
id
:
{
[
Op
.
notIn
]:
pnids4
}
}
});
await
DB
.
ProjectBjtj
.
bulkCreate
(
newprojectBjtjs
);
await
Promise
.
all
(
pns4
.
map
(
item
=>
{
DB
.
ProjectBjtj
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}})
}));
await
Promise
.
all
(
pns4
.
map
(
item
=>
{
DB
.
ProjectBjtj
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
// 处理 projectFxgl
let
projectFxgls
=
body
.
projectFxgls
||
[];
let
pnids5
=
[],
pns5
=
[],
newprojectFxgls
=
[];
projectFxgls
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectFxgls
.
push
(
o
);
}
}
else
{
pnids5
.
push
(
o
.
id
);
pns5
.
push
(
o
);
}
return
o
});
let
pnids5
=
[],
pns5
=
[],
newprojectFxgls
=
[];
projectFxgls
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectFxgls
.
push
(
o
);
}
}
else
{
pnids5
.
push
(
o
.
id
);
pns5
.
push
(
o
);
}
return
o
});
await
DB
.
ProjectFxgl
.
destroy
({
where
:
{
projectId
:
project
.
id
,
id
:
{
[
Op
.
notIn
]:
pnids5
}
}
});
await
DB
.
ProjectFxgl
.
bulkCreate
(
newprojectFxgls
);
await
Promise
.
all
(
pns5
.
map
(
item
=>
{
DB
.
ProjectFxgl
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}})
}));
await
Promise
.
all
(
pns5
.
map
(
item
=>
{
DB
.
ProjectFxgl
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
// 处理 ProjectTzzt
let
projectTzzts
=
body
.
projectTzzts
||
[];
let
pnids6
=
[],
pns6
=
[],
newprojectTzzts
=
[];
projectTzzts
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectTzzts
.
push
(
o
);
}
}
else
{
pnids6
.
push
(
o
.
id
);
pns6
.
push
(
o
);
}
return
o
});
let
pnids6
=
[],
pns6
=
[],
newprojectTzzts
=
[];
projectTzzts
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectTzzts
.
push
(
o
);
}
}
else
{
pnids6
.
push
(
o
.
id
);
pns6
.
push
(
o
);
}
return
o
});
await
DB
.
ProjectTzzt
.
destroy
({
where
:
{
projectId
:
project
.
id
,
id
:
{
[
Op
.
notIn
]:
pnids6
}
}
});
await
DB
.
ProjectTzzt
.
bulkCreate
(
newprojectTzzts
);
await
Promise
.
all
(
pns6
.
map
(
item
=>
{
DB
.
ProjectTzzt
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}})
}));
await
Promise
.
all
(
pns6
.
map
(
item
=>
{
DB
.
ProjectTzzt
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
// 处理 ProjectJczt
let
projectJczts
=
body
.
projectJczts
||
[];
let
pnids7
=
[],
pns7
=
[],
newprojectJczts
=
[];
projectJczts
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectJczts
.
push
(
o
);
}
}
else
{
pnids7
.
push
(
o
.
id
);
pns7
.
push
(
o
);
}
return
o
});
let
pnids7
=
[],
pns7
=
[],
newprojectJczts
=
[];
projectJczts
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectJczts
.
push
(
o
);
}
}
else
{
pnids7
.
push
(
o
.
id
);
pns7
.
push
(
o
);
}
return
o
});
await
DB
.
ProjectJczt
.
destroy
({
where
:
{
projectId
:
project
.
id
,
id
:
{
[
Op
.
notIn
]:
pnids7
}
}
});
await
DB
.
ProjectJczt
.
bulkCreate
(
newprojectJczts
);
await
Promise
.
all
(
pns7
.
map
(
item
=>
{
DB
.
ProjectJczt
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}})}));
// // 处理 projectZqrz
// let projectZqrzs = body.projectZqrzs || [];
// let pnids8 = [], newprojectZqrzs = [];
// projectZqrzs.map(o => { if (!o.id) { o.projectId = project.id; newprojectZqrzs.push(o); } else { pnids8.push(o.id) } return o });
// await DB.ProjectZqrz.destroy({ where: { projectId: project.id, id: { [Op.notIn]: pnids8 } } });
// await DB.ProjectZqrz.bulkCreate(newprojectZqrzs);
// 处理 projectSpyjs
await
Promise
.
all
(
pns7
.
map
(
item
=>
{
DB
.
ProjectJczt
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
let
projectSpyjs
=
body
.
projectSpyjs
||
[];
let
pnids9
=
[],
pns9
=
[],
newprojectSpyjs
=
[];
projectSpyjs
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectSpyjs
.
push
(
o
);}
}
else
{
pnids9
.
push
(
o
.
id
);
pns9
.
push
(
o
);
}
return
o
});
let
pnids9
=
[],
pns9
=
[],
newprojectSpyjs
=
[];
projectSpyjs
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectSpyjs
.
push
(
o
);
}
}
else
{
pnids9
.
push
(
o
.
id
);
pns9
.
push
(
o
);
}
return
o
});
await
DB
.
ProjectSpyj
.
destroy
({
where
:
{
projectId
:
project
.
id
,
id
:
{
[
Op
.
notIn
]:
pnids9
}
}
});
await
DB
.
ProjectSpyj
.
bulkCreate
(
newprojectSpyjs
);
await
Promise
.
all
(
pns9
.
map
(
item
=>
{
DB
.
ProjectSpyj
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}})
}));
await
Promise
.
all
(
pns9
.
map
(
item
=>
{
DB
.
ProjectSpyj
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
// 处理 projectCwpjzb
let
projectCwpjzbs
=
body
.
projectCwpjzbs
||
[];
let
pnids10
=
[],
pns10
=
[],
newprojectCwpjzbs
=
[];
projectCwpjzbs
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
())
{
o
.
projectId
=
project
.
id
;
newprojectCwpjzbs
.
push
(
o
);
}}
else
{
pnids10
.
push
(
o
.
id
);
pns10
.
push
(
o
);
}
return
o
});
let
pnids10
=
[],
pns10
=
[],
newprojectCwpjzbs
=
[];
projectCwpjzbs
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
())
{
o
.
projectId
=
project
.
id
;
newprojectCwpjzbs
.
push
(
o
);
}
}
else
{
pnids10
.
push
(
o
.
id
);
pns10
.
push
(
o
);
}
return
o
});
await
DB
.
ProjectCwpjzb
.
destroy
({
where
:
{
projectId
:
project
.
id
,
id
:
{
[
Op
.
notIn
]:
pnids10
}
}
});
await
DB
.
ProjectCwpjzb
.
bulkCreate
(
newprojectCwpjzbs
);
await
Promise
.
all
(
pns10
.
map
(
item
=>
{
DB
.
ProjectCwpjzb
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}})
}));
await
Promise
.
all
(
pns10
.
map
(
item
=>
{
DB
.
ProjectCwpjzb
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
// 处理 ProjectLcbjd
let
projectLcbjds
=
body
.
projectLcbjds
||
[];
let
pnids11
=
[],
pns11
=
[],
newprojectLcbjds
=
[];
projectLcbjds
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectLcbjds
.
push
(
o
);
}
}
else
{
pnids11
.
push
(
o
.
id
);
pns11
.
push
(
o
);
}
return
o
});
let
pnids11
=
[],
pns11
=
[],
newprojectLcbjds
=
[];
projectLcbjds
.
map
(
o
=>
{
if
(
!
o
.
id
)
{
if
(
!
_
.
isEmpty
(
o
))
{
o
.
projectId
=
project
.
id
;
newprojectLcbjds
.
push
(
o
);
}
}
else
{
pnids11
.
push
(
o
.
id
);
pns11
.
push
(
o
);
}
return
o
});
await
DB
.
ProjectLcbjd
.
destroy
({
where
:
{
projectId
:
project
.
id
,
id
:
{
[
Op
.
notIn
]:
pnids11
}
}
});
await
DB
.
ProjectLcbjd
.
bulkCreate
(
newprojectLcbjds
);
await
Promise
.
all
(
pns11
.
map
(
item
=>
{
DB
.
ProjectLcbjd
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}})
}));
// 处理 projectTzzjll-----
await
Promise
.
all
(
pns11
.
map
(
item
=>
{
DB
.
ProjectLcbjd
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
// 立项资料
...
...
@@ -290,6 +394,21 @@ async function updateProject(req, res, next) {
// 相关上会材料
let
xgshcl
=
body
.
xgshcl
||
[];
xgshcl
.
map
(
o
=>
{
if
(
!
o
.
proFieldKey
)
{
createIds
.
push
({
id
:
o
.
id
,
proFieldKey
:
'xgshcl'
})
}
else
{
needIds
.
push
(
o
.
id
)
};
return
{
fileId
:
o
.
id
,
projectId
:
project
.
id
,
proFieldKey
:
'xgshcl'
}
});
// 可研材料
let
kycl
=
body
.
kycl
||
[];
kycl
.
map
(
o
=>
{
if
(
!
o
.
proFieldKey
)
{
createIds
.
push
({
id
:
o
.
id
,
proFieldKey
:
'kycl'
})
}
else
{
needIds
.
push
(
o
.
id
)
};
return
{
fileId
:
o
.
id
,
projectId
:
project
.
id
,
proFieldKey
:
'kycl'
}
});
// 经济指标初步测算材料
let
jjzbcbcscl
=
body
.
jjzbcbcscl
||
[];
jjzbcbcscl
.
map
(
o
=>
{
if
(
!
o
.
proFieldKey
)
{
createIds
.
push
({
id
:
o
.
id
,
proFieldKey
:
'jjzbcbcscl'
})
}
else
{
needIds
.
push
(
o
.
id
)
};
return
{
fileId
:
o
.
id
,
projectId
:
project
.
id
,
proFieldKey
:
'jjzbcbcscl'
}
});
// 补充相关支撑材料
let
bcxgzccl
=
body
.
bcxgzccl
||
[];
bcxgzccl
.
map
(
o
=>
{
if
(
!
o
.
proFieldKey
)
{
createIds
.
push
({
id
:
o
.
id
,
proFieldKey
:
'bcxgzccl'
})
}
else
{
needIds
.
push
(
o
.
id
)
};
return
{
fileId
:
o
.
id
,
projectId
:
project
.
id
,
proFieldKey
:
'bcxgzccl'
}
});
// 其他相关支撑材料
let
qtxgzccl
=
body
.
qtxgzccl
||
[];
qtxgzccl
.
map
(
o
=>
{
if
(
!
o
.
proFieldKey
)
{
createIds
.
push
({
id
:
o
.
id
,
proFieldKey
:
'qtxgzccl'
})
}
else
{
needIds
.
push
(
o
.
id
)
};
return
{
fileId
:
o
.
id
,
projectId
:
project
.
id
,
proFieldKey
:
'qtxgzccl'
}
});
// 上会议案
let
shya
=
body
.
shya
||
[];
shya
.
map
(
o
=>
{
if
(
!
o
.
proFieldKey
)
{
createIds
.
push
({
id
:
o
.
id
,
proFieldKey
:
'shya'
})
}
else
{
needIds
.
push
(
o
.
id
)
};
return
{
fileId
:
o
.
id
,
projectId
:
project
.
id
,
proFieldKey
:
'shya'
}
});
// 处理文件
//1. 删除
await
DB
.
ProjectFile
.
destroy
({
...
...
@@ -303,34 +422,201 @@ async function updateProject(req, res, next) {
let
creProFiles
=
createIds
.
map
(
o
=>
{
return
{
projectId
:
project
.
id
,
fileId
:
o
.
id
,
proFieldKey
:
o
.
proFieldKey
}
});
await
DB
.
ProjectFile
.
bulkCreate
(
creProFiles
);
}
/**
* 根据前端加入的参数区分按钮 更新草稿并提交 更新草稿 TODO:
if
(
projectLzType
)
{
projectInfo
.
projectLzType
=
projectLzType
;
}
const
ret
=
await
DB
.
Project
.
update
(
projectInfo
,
{
where
:
{
id
:
body
.
id
}
});
return
ret
;
}
/**
* 决策保存
*/
if
(
req
.
body
.
buttonType
===
'submit'
)
{
async
function
saveJuece
(
req
,
res
,
next
)
{
try
{
let
body
=
req
.
body
;
if
(
!
body
.
id
)
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
)
}
await
xiangmujuecegengxin
(
body
);
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
error
);
}
}
async
function
startJuece
(
req
,
res
,
next
)
{
try
{
let
body
=
req
.
body
;
if
(
!
body
.
id
)
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
)
}
await
DB
.
FlowRecord
.
create
({
userId
:
req
.
user
.
id
,
actionName
:
'发起项目初审'
,
projectId
:
project
.
id
,
});
let
approvers
=
await
userModule
.
getProjectApprover
(
req
.
user
.
id
,
'xmgs_xmspr'
);
if
(
!
(
approvers
&&
approvers
.
length
>
0
))
{
return
res
.
sendError
(
'项目已保存,请联系管理员为本公司添加【项目初审】角色人员'
);
}
await
DB
.
Message
.
create
({
actionName
:
'发起项目决策审批'
,
projectId
:
project
.
id
,
creator
:
req
.
user
.
id
,
receivers
:
approvers
.
map
(
o
=>
o
.
id
),
type
:
2
,
content
:
`项目【
${
project
.
name
}
】已发起初审,请尽快处理!`
});
projectInfo
.
projectLiuZhuanType
=
3
;
// 待初审
}
const
ret
=
await
DB
.
Project
.
update
(
projectInfo
,
{
where
:
{
id
:
body
.
id
}
});
return
res
.
sendData
(
ret
);
let
ret
=
await
xiangmujuecegengxin
(
body
,
7
);
return
ret
;
}
catch
(
error
)
{
next
(
error
);
}
}
/**
* 更新提交 更新
* @param {*} req
* @param {*} res
* @param {*} next
* @returns
*/
async
function
updateProject
(
req
,
res
,
next
)
{
// try {
// let body = req.body;
// if (!body.id) {
// return res.sendError(errorMessage.resourceNotFound)
// }
// // 1. 处理项目
// let project = body;
// let projectInfo = _.omit(body, ['projectJsgms', 'projectGdxxs', 'projectXmtzzes', 'projectBjtjs',
// 'projectSpyjs', 'projectFxgls', 'projectTzzts', 'projectJczts', 'projectZqrzs', 'projectCwpjzbs', 'projectLcbjds',
// 'lxzl', 'lxpfwj', 'xgshcl']);
// // 处理 projectJsgms
// let projectJsgms = body.projectJsgms || [];
// let pnids1 = [], pns1 = [], newprojectJsgms = [];
// projectJsgms.map(o => { if (!o.id) { if (!_.isEmpty(o)) { o.projectId = project.id; newprojectJsgms.push(o); } } else { pnids1.push(o.id); pns1.push(o); } return o });
// await DB.ProjectJsgm.destroy({ where: { projectId: project.id, id: { [Op.notIn]: pnids1 } } });
// await DB.ProjectJsgm.bulkCreate(newprojectJsgms);
// await Promise.all(pns1.map(item => { DB.ProjectJsgm.update(item, { where: { id: item.id } }) }));
// // 处理 projectGdxxs
// let projectGdxxs = body.projectGdxxs || [];
// let pnids2 = [], pns2 = [], newprojectGdxxs = [];
// projectGdxxs.map(o => { if (!o.id) { if (!_.isEmpty(o)) { o.projectId = project.id; newprojectGdxxs.push(o); } } else { pnids2.push(o.id); pns2.push(o); } return o });
// await DB.ProjectGdxx.destroy({ where: { projectId: project.id, id: { [Op.notIn]: pnids2 } } });
// await DB.ProjectGdxx.bulkCreate(newprojectGdxxs);
// await Promise.all(pns2.map(item => { DB.ProjectGdxx.update(item, { where: { id: item.id } }) }));
// // 处理 projectXmtzzes
// let projectXmtzzes = body.projectXmtzzes || [];
// projectXmtzzes = utils.flattenTree(projectXmtzzes, 'xh', 'parentXh');
// let pnids3 = [], pns3 = [], newprojectXmtzzes = [];
// projectXmtzzes.map(o => { if (!o.id) { if (!_.isEmpty(o)) { o.projectId = project.id; newprojectXmtzzes.push(o); } } else { pnids3.push(o.id); pns3.push(o); } return o });
// await DB.ProjectXmtzze.bulkCreate(newprojectXmtzzes);
// await Promise.all(pns3.map(item => { DB.ProjectXmtzze.update(item, { where: { id: item.id } }) }));
// // 处理 projectBjtjs
// let projectBjtjs = body.projectBjtjs || [];
// let pnids4 = [], pns4 = [], newprojectBjtjs = [];
// projectBjtjs.map(o => { if (!o.id) { if (!_.isEmpty(o)) { o.projectId = project.id; newprojectBjtjs.push(o); } } else { pnids4.push(o.id); pns4.push(o); } return o });
// await DB.ProjectBjtj.destroy({ where: { projectId: project.id, id: { [Op.notIn]: pnids4 } } });
// await DB.ProjectBjtj.bulkCreate(newprojectBjtjs);
// await Promise.all(pns4.map(item => { DB.ProjectBjtj.update(item, { where: { id: item.id } }) }));
// // 处理 projectFxgl
// let projectFxgls = body.projectFxgls || [];
// let pnids5 = [], pns5 = [], newprojectFxgls = [];
// projectFxgls.map(o => { if (!o.id) { if (!_.isEmpty(o)) { o.projectId = project.id; newprojectFxgls.push(o); } } else { pnids5.push(o.id); pns5.push(o); } return o });
// await DB.ProjectFxgl.destroy({ where: { projectId: project.id, id: { [Op.notIn]: pnids5 } } });
// await DB.ProjectFxgl.bulkCreate(newprojectFxgls);
// await Promise.all(pns5.map(item => { DB.ProjectFxgl.update(item, { where: { id: item.id } }) }));
// // 处理 ProjectTzzt
// let projectTzzts = body.projectTzzts || [];
// let pnids6 = [], pns6 = [], newprojectTzzts = [];
// projectTzzts.map(o => { if (!o.id) { if (!_.isEmpty(o)) { o.projectId = project.id; newprojectTzzts.push(o); } } else { pnids6.push(o.id); pns6.push(o); } return o });
// await DB.ProjectTzzt.destroy({ where: { projectId: project.id, id: { [Op.notIn]: pnids6 } } });
// await DB.ProjectTzzt.bulkCreate(newprojectTzzts);
// await Promise.all(pns6.map(item => { DB.ProjectTzzt.update(item, { where: { id: item.id } }) }));
// // 处理 ProjectJczt
// let projectJczts = body.projectJczts || [];
// let pnids7 = [], pns7 = [], newprojectJczts = [];
// projectJczts.map(o => { if (!o.id) { if (!_.isEmpty(o)) { o.projectId = project.id; newprojectJczts.push(o); } } else { pnids7.push(o.id); pns7.push(o); } return o });
// await DB.ProjectJczt.destroy({ where: { projectId: project.id, id: { [Op.notIn]: pnids7 } } });
// await DB.ProjectJczt.bulkCreate(newprojectJczts);
// await Promise.all(pns7.map(item => { DB.ProjectJczt.update(item, { where: { id: item.id } }) }));
// // // 处理 projectZqrz
// // let projectZqrzs = body.projectZqrzs || [];
// // let pnids8 = [], newprojectZqrzs = [];
// // projectZqrzs.map(o => { if (!o.id) { o.projectId = project.id; newprojectZqrzs.push(o); } else { pnids8.push(o.id) } return o });
// // await DB.ProjectZqrz.destroy({ where: { projectId: project.id, id: { [Op.notIn]: pnids8 } } });
// // await DB.ProjectZqrz.bulkCreate(newprojectZqrzs);
// // 处理 projectSpyjs
// let projectSpyjs = body.projectSpyjs || [];
// let pnids9 = [], pns9 = [], newprojectSpyjs = [];
// projectSpyjs.map(o => { if (!o.id) { if (!_.isEmpty(o)) { o.projectId = project.id; newprojectSpyjs.push(o); } } else { pnids9.push(o.id); pns9.push(o); } return o });
// await DB.ProjectSpyj.destroy({ where: { projectId: project.id, id: { [Op.notIn]: pnids9 } } });
// await DB.ProjectSpyj.bulkCreate(newprojectSpyjs);
// await Promise.all(pns9.map(item => { DB.ProjectSpyj.update(item, { where: { id: item.id } }) }));
// // 处理 projectCwpjzb
// let projectCwpjzbs = body.projectCwpjzbs || [];
// let pnids10 = [], pns10 = [], newprojectCwpjzbs = [];
// projectCwpjzbs.map(o => { if (!o.id) { if (!_.isEmpty()) { o.projectId = project.id; newprojectCwpjzbs.push(o); } } else { pnids10.push(o.id); pns10.push(o); } return o });
// await DB.ProjectCwpjzb.destroy({ where: { projectId: project.id, id: { [Op.notIn]: pnids10 } } });
// await DB.ProjectCwpjzb.bulkCreate(newprojectCwpjzbs);
// await Promise.all(pns10.map(item => { DB.ProjectCwpjzb.update(item, { where: { id: item.id } }) }));
// // 处理 ProjectLcbjd
// let projectLcbjds = body.projectLcbjds || [];
// let pnids11 = [], pns11 = [], newprojectLcbjds = [];
// projectLcbjds.map(o => { if (!o.id) { if (!_.isEmpty(o)) { o.projectId = project.id; newprojectLcbjds.push(o); } } else { pnids11.push(o.id); pns11.push(o); } return o });
// await DB.ProjectLcbjd.destroy({ where: { projectId: project.id, id: { [Op.notIn]: pnids11 } } });
// await DB.ProjectLcbjd.bulkCreate(newprojectLcbjds);
// await Promise.all(pns11.map(item => { DB.ProjectLcbjd.update(item, { where: { id: item.id } }) }));
// // 处理 projectTzzjll-----
// // 立项资料
// let lxzl = body.lxzl || [];
// let needIds = []; let createIds = [];
// lxzl.map(o => { if (!o.proFieldKey) { createIds.push({ id: o.id, proFieldKey: 'lxzl' }) } else { needIds.push(o.id) }; return { fileId: o.id, projectId: project.id, proFieldKey: 'lxzl' } });
// // 立项批复文件
// let lxpfwj = body.lxpfwj || [];
// lxpfwj.map(o => { if (!o.proFieldKey) { createIds.push({ id: o.id, proFieldKey: 'lxpfwj' }) } else { needIds.push(o.id) }; return { fileId: o.id, projectId: project.id, proFieldKey: 'lxpfwj' } });
// // 相关上会材料
// let xgshcl = body.xgshcl || [];
// xgshcl.map(o => { if (!o.proFieldKey) { createIds.push({ id: o.id, proFieldKey: 'xgshcl' }) } else { needIds.push(o.id) }; return { fileId: o.id, projectId: project.id, proFieldKey: 'xgshcl' } });
// // 处理文件
// //1. 删除
// await DB.ProjectFile.destroy({
// where: {
// projectId: project.id,
// fileId: { [Op.notIn]: needIds }
// }
// });
// //2. 创建
// if (createIds.length) {
// let creProFiles = createIds.map(o => { return { projectId: project.id, fileId: o.id, proFieldKey: o.proFieldKey } });
// await DB.ProjectFile.bulkCreate(creProFiles);
// }
// /**
// * 根据前端加入的参数区分按钮 更新草稿并提交 更新草稿 TODO:
// */
// if (req.body.buttonType === 'submit') {
// await DB.FlowRecord.create({
// userId: req.user.id,
// actionName: '发起项目初审',
// projectId: project.id,
// });
// let approvers = await userModule.getProjectApprover(req.user.id, 'xmgs_xmspr');
// if (!(approvers && approvers.length > 0)) {
// return res.sendError('项目已保存,请联系管理员为本公司添加【项目初审】角色人员');
// }
// await DB.Message.create({
// projectId: project.id,
// creator: req.user.id,
// receivers: approvers.map(o => o.id),
// type: 2,
// content: `项目【${project.name}】已发起初审,请尽快处理!`
// });
// projectInfo.projectLiuZhuanType = 3; // 待初审
// }
// const ret = await DB.Project.update(projectInfo, { where: { id: body.id } });
// return res.sendData(ret);
// } catch (error) {
// next(error);
// }
}
...
...
@@ -343,53 +629,53 @@ async function updateProject(req, res, next) {
*/
async
function
preJugProject
(
req
,
res
,
next
)
{
try
{
let
{
id
}
=
req
.
body
;
if
(
!
id
)
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
)
}
let
project
=
await
DB
.
Project
.
findOne
({
where
:
{
id
}
});
if
(
!
project
)
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
)
}
/**
* 1. 更新项目状态 5 初审通过 初审不通过则回到状态1
*/
if
(
req
.
body
.
buttonType
===
'approve'
)
{
await
DB
.
Project
.
update
({
projectLiuZhuanType
:
5
},
{
where
:
{
id
}
});
//处理项目流转记录 及消息发送TODO:
await
DB
.
FlowRecord
.
create
({
userId
:
req
.
user
.
id
,
actionName
:
'项目初审通过,提交终审'
,
projectId
:
project
.
id
,
});
let
approvers
=
await
userModule
.
getProjectApprover
(
req
.
user
.
id
,
'jt_xmzs'
);
if
(
!
(
approvers
&&
approvers
.
length
>
0
))
{
return
res
.
sendError
(
'项目已保存,请联系管理员为本公司添加【项目初审】角色人员'
);
}
await
DB
.
Message
.
create
({
projectId
:
project
.
id
,
creator
:
req
.
user
.
id
,
receivers
:
approvers
.
map
(
o
=>
o
.
id
),
type
:
2
,
content
:
`项目【
${
project
.
name
}
】已发起终审,请尽快处理!`
});
}
else
{
await
DB
.
Project
.
update
({
projectLiuZhuanType
:
1
},
{
where
:
{
id
}
});
//处理项目流转记录 及消息发送TODO:
await
DB
.
FlowRecord
.
create
({
userId
:
req
.
user
.
id
,
actionName
:
'项目初审不通过,退回处理'
,
projectId
:
project
.
id
,
});
let
approvers
=
[
project
.
projectCreator
]
await
DB
.
Message
.
create
({
projectId
:
project
.
id
,
creator
:
req
.
user
.
id
,
receivers
:
approvers
.
map
(
o
=>
o
.
id
),
type
:
2
,
content
:
`项目【
${
project
.
name
}
】已退回,请尽快处理!`
});
}
//
let { id } = req.body;
//
if (!id) {
//
return res.sendError(errorMessage.resourceNotFound)
//
}
//
let project = await DB.Project.findOne({ where: { id } });
//
if (!project) {
//
return res.sendError(errorMessage.resourceNotFound)
//
}
/
/ /
**
//
* 1. 更新项目状态 5 初审通过 初审不通过则回到状态1
//
*/
//
if (req.body.buttonType === 'approve') {
//
await DB.Project.update({ projectLiuZhuanType: 5 }, { where: { id } });
//
//处理项目流转记录 及消息发送TODO:
//
await DB.FlowRecord.create({
//
userId: req.user.id,
//
actionName: '项目初审通过,提交终审',
//
projectId: project.id,
//
});
//
let approvers = await userModule.getProjectApprover(req.user.id, 'jt_xmzs');
//
if (!(approvers && approvers.length > 0)) {
//
return res.sendError('项目已保存,请联系管理员为本公司添加【项目初审】角色人员');
//
}
//
await DB.Message.create({
//
projectId: project.id,
//
creator: req.user.id,
//
receivers: approvers.map(o => o.id),
//
type: 2,
//
content: `项目【${project.name}】已发起终审,请尽快处理!`
//
});
//
} else {
//
await DB.Project.update({ projectLiuZhuanType: 1 }, { where: { id } });
//
//处理项目流转记录 及消息发送TODO:
//
await DB.FlowRecord.create({
//
userId: req.user.id,
//
actionName: '项目初审不通过,退回处理',
//
projectId: project.id,
//
});
//
let approvers = [project.projectCreator]
//
await DB.Message.create({
//
projectId: project.id,
//
creator: req.user.id,
//
receivers: approvers.map(o => o.id),
//
type: 2,
//
content: `项目【${project.name}】已退回,请尽快处理!`
//
});
//
}
return
res
.
sendData
();
}
catch
(
error
)
{
...
...
@@ -565,7 +851,7 @@ async function listProject(req, res, next) {
}
search
.
limit
=
limit
;
search
.
offset
=
offset
;
if
(
req
.
body
.
attributes
&&
req
.
body
.
attributes
.
length
)
{
if
(
req
.
body
.
attributes
&&
req
.
body
.
attributes
.
length
)
{
search
.
attributes
=
req
.
body
.
attributes
;
}
let
ret
=
await
DB
.
Project
.
findAndCountAll
(
search
);
...
...
@@ -679,7 +965,7 @@ async function getOwnProjects(req, res, next) {
let
cArr
=
[
{
projectCreator
:
req
.
user
.
id
},
]
if
(
projectIds
.
length
>
0
)
{
if
(
projectIds
.
length
>
0
)
{
cArr
.
push
({
id
:
{
[
Op
.
in
]:
projectIds
}
})
}
if
(
req
.
body
.
projectName
)
{
...
...
@@ -716,4 +1002,8 @@ module.exports = {
preJugProject
,
finalJugProject
,
getOwnProjects
,
startLixiang
,
saveJuece
,
startJuece
,
saveProjectPreLixiang
,
}
\ No newline at end of file
db/model/jt/c.md
View file @
ae7590d7
...
...
@@ -7,3 +7,15 @@
投管项目审批人员 -- 看见所有项目公司人员
1.
2 投管新建项目 --- 投管
同步发起 一个startFlow 流程记录 发起人 发起时间 项目状态(待审批-已审批)
/
**
*
处理项目审批及消息 依靠项目状态流转
*
1. 发起人角色为项目公司项目发起人 xmgs_xmfqr;
*
2. 流转状态为 1待处理
*
3. 消息发送给 项目公司项目审批人 xmgs_xmspr,需要写一个审批接口 :项目基本信息不变,状态需要改为 2 项目公司初审:通过则变为3,不通过则变为1;
*
4. 若是投管部门自主创建项目,则项目状态直接到 5 待投管审核---退回则到1
*
5. 投管后续立项推送、决策推送状态再行处理
*
/
//B. 找到本公司审批人员发送消息-- 如果找不到人 则提示项目已保存,联系管理员添加【项目公司项目审批人】角色
//A. 创建发起记录
\ No newline at end of file
db/model/jt/project.js
View file @
ae7590d7
...
...
@@ -23,6 +23,10 @@ const Project = sequelize.define('Project', {
key
:
'id'
,
},
},
projectLzType
:
{
type
:
DataTypes
.
INTEGER
,
comment
:
"项目流转状态: 1. 待立项(保存), 3. 立项审批中, 5. 已立项, 7. 决策审批中, 9. 已决策 "
,
},
del
:
{
type
:
DataTypes
.
INTEGER
,
defaultValue
:
0
,
...
...
@@ -32,170 +36,224 @@ const Project = sequelize.define('Project', {
/**
* 立项字段
*/
/**
* 立项字段
*/
//项目基本信息
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'
,
},
projectCode
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目编号"
,
_mark
:
"lixiang"
},
sfzjc
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否再决策"
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
,
_mark
:
"lixiang"
},
// 1是 2 否
projectForeignName
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目外文名称"
,
_mark
:
"lixiang"
},
sfnjlhtxm
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否能建联合体项目"
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
,
_mark
:
"lixiang"
},
// 1是 2 否
tzzt
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资主体"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
zyfzy
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"主业/非主业"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
zsqy
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"直属企业"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
sfnjzdhzytz
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否能建重大或重要投资"
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
,
_mark
:
"lixiang"
},
sfzzjc
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否自主决策"
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
,
_mark
:
"lixiang"
},
cwbblx
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"财务报表类型"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
zfsphzbajb
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"政府审批(核准、备案)级别"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
sflxbqyscx
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否履行标前预审程序"
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
,
_mark
:
"lixiang"
},
//项目所在地
jnw
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"境内/外"
,
zjType
:
'danxuan'
},
//TODO:下拉
sjnzjjw
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"省(境内)/洲际(境外)"
,
zjType
:
'danxuan'
},
//TODO:下拉
dsjngjjw
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"地市(境内)/国家(境外)"
,
zjType
:
'danxuan'
},
//TODO:下拉
qxjngjjw
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"区县(境内)/国家(境外)"
,
zjType
:
'danxuan'
},
//TODO:下拉
xmqy
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目区域"
,
zjType
:
'danxuan'
},
//TODO:下拉
sfydylyxgj
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否一带一路沿线国家"
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
},
jnw
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"境内/外"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
sjnzjjw
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"省(境内)/洲际(境外)"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
dsjngjjw
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"地市(境内)/国家(境外)"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
qxjngjjw
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"区县(境内)/国家(境外)"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
xmqy
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目区域"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
sfydylyxgj
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否一带一路沿线国家"
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
,
_mark
:
"lixiang"
},
//计量币种
bizhong
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"币种"
,
zjType
:
'danxuan'
},
//TODO:下拉
huilv
:
{
type
:
DataTypes
.
DECIMAL
(
3
,
2
),
allowNull
:
true
,
comment
:
"汇率"
},
bizhong
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"币种"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
huilv
:
{
type
:
DataTypes
.
DECIMAL
(
3
,
2
),
allowNull
:
true
,
comment
:
"汇率"
,
_mark
:
"lixiang"
},
//实施时间
xmjsqy
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目建设期(月)"
},
yynxn
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"运营年限(年)"
},
xmhzqn
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目合作期(月)"
},
xmkgsjyj
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
"项目开工时间(预计)"
},
xmjgsjyj
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
"项目交工时间(预计)"
},
//投资分类
tzsxyjfl
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资属性的一级分类"
},
//TODO:下拉
tzsxejfl
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资属性的二级分类"
},
//TODO:下拉
tzbk
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资板块"
},
//TODO:下拉
subsector
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"细分板块"
},
//TODO:下拉
tzmdyjfl
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资目的一级分类"
},
//TODO:下拉
tzmdejfl
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资目的二级分类"
},
//TODO:下拉
sxfl
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"四新分类"
},
//TODO:下拉
tzznyjfl
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资指南一级分类"
},
//TODO:下拉
tzznejfl
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资指南二级分类"
},
//TODO:下拉
tzznflgs
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资指南分类概述"
},
gmjjhy
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"国民经济行业"
},
//TODO:下拉
sfnrbtml
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"是否纳入补贴目录"
},
njsfqtf
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"能建是否牵头方"
},
//1是 2否
sfylx
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否已立项"
},
//1是 2否
sfzdqy
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否重点区域"
},
//1是 2否
zdqy
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"重点区域"
},
//下拉
// 特别关注、特别监管类等信息
sfxbgjfzggwhswbhz
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否需报国家发展改革委和商务部核准"
},
//TODO:下拉
sfgjldjq
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否国家领导见签"
},
//TODO:下拉
sfjntbjgl
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否境内特别监管类"
},
//TODO:下拉
//建设规模(实物量指标)
//股东信息
xmjsqy
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目建设期(月)"
,
_mark
:
"lixiang"
},
yynxn
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"运营年限(年)"
,
_mark
:
"lixiang"
},
xmhzqn
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目合作期(月)"
,
_mark
:
"lixiang"
},
xmkgsjyj
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
"项目开工时间(预计)"
,
_mark
:
"lixiang"
},
xmjgsjyj
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
"项目交工时间(预计)"
,
_mark
:
"lixiang"
},
//投资分类---投资属性
tzsxyjfl
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资属性的一级分类"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
tzsxejfl
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资属性的二级分类"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
tzbk
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资板块"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
subsector
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"细分板块"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
//投资分类---投资目的
tzmdyjfl
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资目的一级分类"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
tzmdejfl
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资目的二级分类"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
sxfl
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"四新分类"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
//投资分类---投资指南
tzznyjfl
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资指南一级分类"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
tzznejfl
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资指南二级分类"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
tzznflgs
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资指南分类概述"
,
_mark
:
"lixiang"
},
gmjjhy
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"国民经济行业"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
//特别关注、特别监管类等信息
sfxbgjfzggwhswbhz
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否需报国家发展改革委和商务部核准"
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
,
_mark
:
"lixiang"
},
sfgjldjq
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否国家领导见签"
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
,
_mark
:
"lixiang"
},
sfjntbjgl
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否境内特别监管类"
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
,
_mark
:
"lixiang"
},
//建设规模(实物量指标)(表)
//股东信息(表)
//项目必要性及可行性
jsnrjgm
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
"建设内容及规模"
},
xmbyx
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
"项目必要性"
},
xmkxx
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
"项目可行性"
},
qtsm
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"其他说明"
},
//立项资料 -------- 项目表关联材料表 使用中间表
jsnrjgm
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
"建设内容及规模"
,
_mark
:
"lixiang"
},
xmbyx
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
"项目必要性"
,
_mark
:
"lixiang"
},
xmkxx
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
"项目可行性"
,
_mark
:
"lixiang"
},
// 项目投资总额
// xmzbjwy: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "项目资本金(万元)" },
//
//立项资料 -------- 项目表关联材料表 使用中间表
wfczrjcgbl
:
{
type
:
DataTypes
.
DECIMAL
(
3
,
2
),
allowNull
:
true
,
comment
:
"我方出资人及持股比例"
},
sjnjfsgdw
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"涉及能建方施工单位"
},
// 项目总投资总额(全口径)(表)
// 财务评价指标(表)
// xmtznbsylsq: { type: DataTypes.DECIMAL(3, 2), allowNull: true, comment: "项目投资内部收益率(税前)" },
// xmtznbsylsh: { type: DataTypes.DECIMAL(3, 2), allowNull: true, comment: "项目投资内部收益率(税后)" },
// xmzbjnbsyl: { type: DataTypes.DECIMAL(3, 2), allowNull: true, comment: "项目资本金内部收益率" },
// xmzbjhsq: { type: DataTypes.STRING, allowNull: true, comment: "项目资本金回收期" },
// yccblrlfdcxm: { type: DataTypes.DECIMAL(3, 2), allowNull: true, comment: "预测成本利润率(房地产项目)" },
// xmtzhsqsq: { type: DataTypes.STRING, allowNull: true, comment: "项目投资回收期(税前)" },
// njfnbsyl: { type: DataTypes.DECIMAL(3, 2), allowNull: true, comment: "能建方内部收益率" },
// njfnbhsq: { type: DataTypes.STRING, allowNull: true, comment: "能建方内部回收期" },
// jxjlhznf: { type: DataTypes.STRING, allowNull: true, comment: "净现金流回正年份" },
// jlrlhznf: { type: DataTypes.STRING, allowNull: true, comment: "净利润流回正年份" },
// kfplrhznf: { type: DataTypes.STRING, allowNull: true, comment: "可分配利润回正年份" },
//核心边界条件
/**
* 项目投资总额(全口径)
*/
xmzjgcjasbfrmbwb
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"项目造价构成_建安设备费(人民币/外币)"
},
xmzjgcqtfyrmbwb
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"项目造价构成_其他费用(人民币/外币)"
},
xmzjgcqztdxgfyrmbwb
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"项目造价构成_其中:土地相关费用(人民币/外币)"
},
xmzjgcjbybfrmbwb
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"项目造价构成_基本预备费(人民币/外币)"
},
xmzjgcjsqlxrmbwb
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"项目造价构成_建设期利息(人民币/外币)"
},
// xmztzrmbwb: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "项目总投资(人民币/外币)" },
xmzbjrmbwb
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"项目资本金(人民币/外币)"
},
xmzbjnjfczrmbwb
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"项目资本金_能建方出资(人民币/外币)"
},
xmzbjwbgdrmbwb
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"项目资本金_外部股东(人民币/外币)"
},
dkrmbwb
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"贷款(人民币/外币)"
},
dkqzfbbxmwfdkdbermbwb
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"贷款_其中:非并表项目我方贷款/担保额(人民币/外币)"
},
qtczrmbwb
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"其他出资(人民币/外币)"
},
qtczqznjfczrmbwb
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"其他出资_其中:能建方出资(人民币/外币)"
},
pfztz
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"批复总投资"
},
//特别关注、特别监管类等信息
sfydylyxgj
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否一带一路沿线国家"
},
//核心边界与条件
//项目立项信息
qthysyqk
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
"其他会议审议情况"
},
lxzzpfyj
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"立项最终批复意见"
},
lxxmpfsj
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
"立项项目批复时间"
},
lxxmpfwh
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"立项项目批复文号"
},
wtgzyyyyyq
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
"未通过主要原因与要求"
},
qthysyqk
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
"其他会议审议情况"
,
_mark
:
"lixiang"
},
lxzzpfyj
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"立项最终批复意见"
,
zjType
:
'danxuan'
,
_mark
:
"lixiang"
},
lxxmpfsj
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
"立项项目批复时间"
,
_mark
:
"lixiang"
},
lxxmpfwh
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"立项项目批复文号"
,
_mark
:
"lixiang"
},
wtgzyyyyyq
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
"未通过主要原因与要求"
,
_mark
:
"lixiang"
},
// lxpfwj: { type: DataTypes.STRING, allowNull: true, comment: "立项批复文件" },项目表关联材料表 使用中间表
//审批意见 (表 TODO: 看是否分立项、决策两种情况)
/**
* 决策字段
*/
// projectName: { type: DataTypes.STRING, allowNull: true, comment: "项目名称", _mark: "lixiang" },
// projectForeignName: { type: DataTypes.STRING, allowNull: true, comment: "项目外文名称", },
cym
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"曾用名"
,
_mark
:
'juece'
},
// projectCode: { type: DataTypes.STRING, allowNull: true, comment: "项目编号", },
sbdw
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"申报单位"
,
_mark
:
'juece'
},
//TODO:下拉选择公司名称,这个需要公司管理的数据
sbdwqygg
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"申报单位企业规格"
,
_mark
:
'juece'
,
zjType
:
'danxuan'
},
xmztz
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"项目总投资"
,
_mark
:
'juece'
},
// zsqy: { type: DataTypes.STRING, allowNull: true, comment: "直属企业", },
glzt
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"管理主体"
,
_mark
:
'juece'
,
zjType
:
'danxuan'
},
// xmqy: { type: DataTypes.STRING, allowNull: true, comment: "项目区域", zjType: 'danxuan' },
// jnw: { type: DataTypes.STRING, allowNull: true, comment: "境内/外", zjType: 'danxuan' },
// sjnzjjw: { type: DataTypes.STRING, allowNull: true, comment: "省(境内)/洲际(境外)", zjType: 'danxuan' },
// dsjngjjw: { type: DataTypes.STRING, allowNull: true, comment: "地市(境内)/国家(境外)", zjType: 'danxuan' },
// qxjngjjw: { type: DataTypes.STRING, allowNull: true, comment: "区县(境内)/国家(境外)", zjType: 'danxuan' },
// bizhong: { type: DataTypes.STRING, allowNull: true, comment: "币种", zjType: 'danxuan' },
// huilv: { type: DataTypes.DECIMAL(3, 2), allowNull: true, comment: "汇率" },
tzms
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资模式"
,
_mark
:
'juece'
},
dwqypp
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"对外签约品牌"
,
_mark
:
'juece'
},
// sfnjzdhzytz: { type: DataTypes.INTEGER, allowNull: true, comment: "是否能建重大或重要投资", zjType: 'danxuan', zjKey: 'sf', },
xmzjly
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"项目资金来源"
,
_mark
:
'juece'
,
zjType
:
'duoxuan'
},
// swbxmlx: { type: DataTypes.STRING, allowNull: true, comment: "商务部项目类型", zjType: 'danxuan', },
// gmjjhy: { type: DataTypes.STRING, allowNull: true, comment: "国民经济行业" },
// sfzzjc: { type: DataTypes.INTEGER, allowNull: true, comment: "是否自主决策", },
// cwbblx: { type: DataTypes.STRING, allowNull: true, comment: "财务报表类型", zjType: 'danxuan', },
// xmlx: { type: DataTypes.STRING, allowNull: true, comment: "项目类型", zjType: 'danxuan', },
// yynxn: { type: DataTypes.STRING, allowNull: true, comment: "运营年限(年)" },
// zyfzy: { type: DataTypes.STRING, allowNull: true, comment: "主业/非主业", zjType: 'danxuan', },
// xmhzqn: { type: DataTypes.STRING, allowNull: true, comment: "项目合作期(月)" },
njzgb
:
{
type
:
DataTypes
.
DECIMAL
(
3
,
2
),
allowNull
:
true
,
comment
:
"能建占股比"
,
_mark
:
'juece'
},
// xmjsqy: { type: DataTypes.STRING, allowNull: true, comment: "项目建设期(月)" },
// xmkgsjyj: { type: DataTypes.DATE, allowNull: true, comment: "项目开工时间(预计)" },
// xmjgsjyj: { type: DataTypes.DATE, allowNull: true, comment: "项目交工时间(预计)" },
// sfnjlhtxm: { type: DataTypes.INTEGER, allowNull: true, comment: "是否能建联合体项目", zjType: 'danxuan', zjKey: 'sf', }, // 1是 2 否
sfyjlx
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否已经立项"
,
_mark
:
'juece'
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
,
},
sfzdqy
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否重点区域"
,
_mark
:
'juece'
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
},
//1是 2否
zdqy
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"重点区域"
,
_mark
:
'juece'
,
zjType
:
'danxuan'
,
},
//下拉
// jsnrjgm: { type: DataTypes.TEXT, allowNull: true, comment: "建设内容及规模" },
glxm
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"关联项目"
,
_mark
:
'juece'
,
},
//TODO:关联项目 关联关系
lxr
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"联系人"
,
_mark
:
'juece'
,
},
lxrdh
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"联系人电话"
,
_mark
:
'juece'
,
},
tzhsfs
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"投资回收方式"
,
_mark
:
'juece'
,
zjType
:
'danxuan'
,
},
cblrl
:
{
type
:
DataTypes
.
DECIMAL
(
3
,
2
),
allowNull
:
true
,
comment
:
"成本利润率"
,
_mark
:
'juece'
,
},
// wtgzyyyyyq: { type: DataTypes.TEXT, allowNull: true, comment: "未通过主要原因与要求" },
// tzsxyjfl: { type: DataTypes.STRING, allowNull: true, comment: "投资属性的一级分类" },
// tzsxejfl: { type: DataTypes.STRING, allowNull: true, comment: "投资属性的二级分类" },
// tzbk: { type: DataTypes.STRING, allowNull: true, comment: "投资板块" },
// subsector: { type: DataTypes.STRING, allowNull: true, comment: "细分板块" },
// tzmdyjfl: { type: DataTypes.STRING, allowNull: true, comment: "投资目的一级分类" },
// tzmdejfl: { type: DataTypes.STRING, allowNull: true, comment: "投资目的二级分类" },
// sxfl: { type: DataTypes.STRING, allowNull: true, comment: "四新分类" },
// tzznyjfl: { type: DataTypes.STRING, allowNull: true, comment: "投资指南一级分类" },
// tzznejfl: { type: DataTypes.STRING, allowNull: true, comment: "投资指南二级分类" },
// tzznflgs: { type: DataTypes.STRING, allowNull: true, comment: "投资指南分类概述" },
// sfzjc: { type: DataTypes.INTEGER, allowNull: true, comment: "是否再决策", zjType: 'danxuan', zjKey: 'sf', }, // 1是 2 否
sfnrbtml
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"是否纳入补贴目录"
,
_mark
:
'juece'
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
},
// sfxbgjfzggwhswbhz: { type: DataTypes.INTEGER, allowNull: true, comment: "是否需报国家发展改革委和商务部核准" },
// sfgjldjq: { type: DataTypes.INTEGER, allowNull: true, comment: "是否国家领导见签" },
// sfjntbjgl: { type: DataTypes.INTEGER, allowNull: true, comment: "是否境内特别监管类" },
// sfydylyxgj: { type: DataTypes.INTEGER, allowNull: true, comment: "是否一带一路沿线国家" },
//建设规模(实物量指标)---立项表格
gsgllc
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"高速公路里程"
,
_mark
:
'juece'
},
qtsfgllc
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"其他收费公路里程"
,
_mark
:
'juece'
},
//政府审批(核准、备案)文件
sfyjzfsp
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否已经政府审批"
,
_mark
:
'juece'
,
zjType
:
'danxuan'
,
zjKey
:
'sf'
},
//1是 2否
spdwmc
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"审批单位名称(全称)"
,
_mark
:
'juece'
,
},
pwwh
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"批文文号"
,
_mark
:
'juece'
,
},
// spjb: { type: DataTypes.STRING, allowNull: true, comment: "审批级别" }, //TODO:下拉
spje
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"审批金额(万元)"
,
_mark
:
'juece'
,
},
spsj
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
"审批时间"
,
_mark
:
'juece'
,
},
//股东信息 ---立项表格 --TODO:需要按照股东类型计算合计,再计算总合计
wfczrjcgbl
:
{
type
:
DataTypes
.
DECIMAL
(
3
,
2
),
allowNull
:
true
,
comment
:
"我方出资人及持股比例"
,
_mark
:
'juece'
,
},
sjnjfsgdw
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"涉及能建方施工单位"
,
_mark
:
'juece'
,
},
// 我方担保及股权融资情况
wffzdgqrzjewy
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"我方负责的股权融资金额(万元)"
},
rzcbgq
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"融资成本股权"
},
qxgq
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"期限股权"
},
dbje
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"担保金额"
},
wffzdgqrzjewy
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"我方负责的股权融资金额(万元)"
,
_mark
:
'juece'
,
},
rzcbgq
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"融资成本股权"
,
_mark
:
'juece'
,
},
qxgq
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"期限股权"
,
_mark
:
'juece'
,
},
dbje
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"担保金额"
,
_mark
:
'juece'
,
},
//我方担保及债权融资情况
wffzdzqrzjewy
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"我方负责的债权融资金额(万元)"
,
_mark
:
'juece'
,
},
rzcbzq
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"融资成本债权"
,
_mark
:
'juece'
,
},
qxzq
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"期限债权"
,
_mark
:
'juece'
,
},
yjldsjzq
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"预计落地时间债权"
,
_mark
:
'juece'
,
},
//工程带动情况
ddgchte
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"带动工程合同额"
,
_mark
:
'juece'
,
},
tzddb
:
{
type
:
DataTypes
.
DECIMAL
(
3
,
2
),
allowNull
:
true
,
comment
:
"投资带动比"
,
_mark
:
'juece'
,
},
gclrwy
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"工程利润(万元)"
,
_mark
:
'juece'
,
},
gclrl
:
{
type
:
DataTypes
.
DECIMAL
(
3
,
2
),
allowNull
:
true
,
comment
:
"工程利润率(%)"
,
_mark
:
'juece'
,
},
xmbyx
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
"项目必要性"
,
_mark
:
'juece'
,
},
qtsm
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
"其他说明"
,
_mark
:
'juece'
,
},
//风险管理---立项已经建表TODO: 是否区分决策
//里程碑节点 --同上
//里程碑计划审批表 关联projectFile ---- lcbjhspb
//投评决策资料(以下都是 关联projectFile ---- )
// kycl: { type: DataTypes.STRING, allowNull: true, comment: "可研材料" },
// jjzbcbcscl: { type: DataTypes.STRING, allowNull: true, comment: "经济指标初步测算材料" },
// bcxgzccl: { type: DataTypes.STRING, allowNull: true, comment: "补充相关支撑材料" },
// qtxgzccl: { type: DataTypes.STRING, allowNull: true, comment: "其他相关支撑材料" },
// shya: { type: DataTypes.STRING, allowNull: true, comment: "上会议案" },
// 财务指标 ---暂时搁置
// 投决计划 ---暂时搁置
// 项目投资总额--有增加
// 财务评价指标--有增加
//核心边界条件--不变
// 决策主体审核情况 -- 立项已经建表
// 投资主体审核情况 -- 立项已经建表
// qthysyqk: { type: DataTypes.TEXT, allowNull: true, comment: "其他会议审议情况" },
jcqthysyqk
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
"决策-其他会议审议情况"
,
_mark
:
'juece'
,},
jczzpfyj
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"决策-最终批复意见"
,
_mark
:
'juece'
,
},
jcxmpfsj
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
"决策-项目批复时间"
,
_mark
:
'juece'
,},
jcxmpfwh
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"决策-项目批复文号"
,
_mark
:
'juece'
,},
jcwtgzyyyyyq
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
"决策-未通过主要原因与要求"
,
_mark
:
'juece'
,},
// jcspyj 审批意见 -- 立项已经建表 --- 是否按照决策区分
tzztscsbsj
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
" 申报时间"
,
_mark
:
'juece'
,},
hqwcsj
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
"会签完成时间"
,
_mark
:
'juece'
,
},
scfhsj
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
"首次发函时间"
,
_mark
:
'juece'
,},
bczlsj
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
"补充资料时间"
,
_mark
:
'juece'
,},
shr
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"审核人"
,
_mark
:
'juece'
,},
//申请报告---暂时搁置
/**------------------------------------------------------------------------------------------------ */
//我方担保及债权融资情况
wffzdzqrzjewy
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"我方负责的债权融资金额(万元)"
},
rzcbzq
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"融资成本债权"
},
qxzq
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"期限债权"
},
yjldsjzq
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"预计落地时间债权"
},
// 带动情况
ddgchte
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"带动工程合同额"
},
tzddb
:
{
type
:
DataTypes
.
DECIMAL
(
3
,
2
),
allowNull
:
true
,
comment
:
"投资带动比"
},
gclrwy
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"工程利润(万元)"
},
gclrl
:
{
type
:
DataTypes
.
DECIMAL
(
3
,
2
),
allowNull
:
true
,
comment
:
"工程利润率(%)"
},
tzztscsbsj
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
"投资主体首次申报时间"
},
hqwcsj
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
"会签完成时间"
},
scfhsj
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
"首次发函时间"
},
bczlsj
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
"补充资料时间"
},
shr
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"审核人"
},
jcqthysyqk
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
"决策-其他会议审议情况"
},
jczzpfyj
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"决策-最终批复意见"
},
jcxmpfsj
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
"决策-项目批复时间"
},
jcxmpfwh
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"决策-项目批复文号"
},
jcwtgzyyyyyq
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
"决策-未通过主要原因与要求"
},
//政府审批(核准、备案)文件
sfyjzfsp
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
comment
:
"是否已经政府审批"
},
//1是 2否
spdwmc
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"审批单位名称(全称)"
},
pwwh
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"批文文号"
},
spjb
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
comment
:
"审批级别"
},
//TODO:下拉
spje
:
{
type
:
DataTypes
.
DECIMAL
(
19
,
8
),
allowNull
:
true
,
comment
:
"审批金额(万元)"
},
spsj
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
"审批时间"
},
//里程碑计划审批表文件
/**
* 决策字段
*/
...
...
@@ -210,6 +268,45 @@ const Project = sequelize.define('Project', {
// 财务评价指标(表)
// xmtznbsylsq: { type: DataTypes.DECIMAL(3, 2), allowNull: true, comment: "项目投资内部收益率(税前)" },
// xmtznbsylsh: { type: DataTypes.DECIMAL(3, 2), allowNull: true, comment: "项目投资内部收益率(税后)" },
// xmzbjnbsyl: { type: DataTypes.DECIMAL(3, 2), allowNull: true, comment: "项目资本金内部收益率" },
// xmzbjhsq: { type: DataTypes.STRING, allowNull: true, comment: "项目资本金回收期" },
// yccblrlfdcxm: { type: DataTypes.DECIMAL(3, 2), allowNull: true, comment: "预测成本利润率(房地产项目)" },
// xmtzhsqsq: { type: DataTypes.STRING, allowNull: true, comment: "项目投资回收期(税前)" },
// njfnbsyl: { type: DataTypes.DECIMAL(3, 2), allowNull: true, comment: "能建方内部收益率" },
// njfnbhsq: { type: DataTypes.STRING, allowNull: true, comment: "能建方内部回收期" },
// jxjlhznf: { type: DataTypes.STRING, allowNull: true, comment: "净现金流回正年份" },
// jlrlhznf: { type: DataTypes.STRING, allowNull: true, comment: "净利润流回正年份" },
// kfplrhznf: { type: DataTypes.STRING, allowNull: true, comment: "可分配利润回正年份" },
/**
* 项目投资总额(全口径)
*/
// xmzjgcjasbfrmbwb: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "项目造价构成_建安设备费(人民币/外币)" },
// xmzjgcqtfyrmbwb: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "项目造价构成_其他费用(人民币/外币)" },
// xmzjgcqztdxgfyrmbwb: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "项目造价构成_其中:土地相关费用(人民币/外币)" },
// xmzjgcjbybfrmbwb: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "项目造价构成_基本预备费(人民币/外币)" },
// xmzjgcjsqlxrmbwb: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "项目造价构成_建设期利息(人民币/外币)" },
// // xmztzrmbwb: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "项目总投资(人民币/外币)" },
// xmzbjrmbwb: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "项目资本金(人民币/外币)" },
// xmzbjnjfczrmbwb: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "项目资本金_能建方出资(人民币/外币)" },
// xmzbjwbgdrmbwb: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "项目资本金_外部股东(人民币/外币)" },
// dkrmbwb: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "贷款(人民币/外币)" },
// dkqzfbbxmwfdkdbermbwb: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "贷款_其中:非并表项目我方贷款/担保额(人民币/外币)" },
// qtczrmbwb: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "其他出资(人民币/外币)" },
// qtczqznjfczrmbwb: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "其他出资_其中:能建方出资(人民币/外币)" },
// pfztz: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "批复总投资" },
...
...
@@ -577,7 +674,7 @@ const Project = sequelize.define('Project', {
// sbdwjcsj: { type: DataTypes.DATE, allowNull: true, comment: "申报单位决策时间" },
//
// syly: { type: DataTypes.STRING, allowNull: true, comment: "收益来源" },
//
njzgb: { type: DataTypes.DECIMAL(3, 2), allowNull: true, comment: "能建占股比" },
//
// cblrl: { type: DataTypes.DECIMAL(3, 2), allowNull: true, comment: "成本利润率" },
// zqqx: { type: DataTypes.STRING, allowNull: true, comment: "债权期限" },
// zbjtzdthsq: { type: DataTypes.DATE, allowNull: true, comment: "资本金投资动态回收期" },
...
...
@@ -689,7 +786,7 @@ const Project = sequelize.define('Project', {
// xscbxsfy2: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "销售成本(销售费用)" },
// zbsjx: { type: DataTypes.STRING, allowNull: true, comment: "指标数据项" },
// sjzb: { type: DataTypes.STRING, allowNull: true, comment: "实际指标" },
//
xmztz: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "项目总投资" },
//
// jaf: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "建安费" },
// sbjgjgzf: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "设备及工具购置费" },
// tdxgfy: { type: DataTypes.DECIMAL(19, 8), allowNull: true, comment: "土地相关费用" },
...
...
@@ -1460,12 +1557,9 @@ const Project = sequelize.define('Project', {
/* ----------------------------- */
// fxgl: { type: DataTypes.STRING, allowNull: true, comment: "风险管理" },
// lcbjd: { type: DataTypes.STRING, allowNull: true, comment: "里程碑节点" },
// 里程碑计划审批表
// kycl: { type: DataTypes.STRING, allowNull: true, comment: "可研材料" },
// jjzbcbcscl: { type: DataTypes.STRING, allowNull: true, comment: "经济指标初步测算材料" },
// bcxgzccl: { type: DataTypes.STRING, allowNull: true, comment: "补充相关支撑材料" },
// qtxgzccl: { type: DataTypes.STRING, allowNull: true, comment: "其他相关支撑材料" },
// shya: { type: DataTypes.STRING, allowNull: true, comment: "上会议案" },
//
//
/* ----------------------------- */
...
...
@@ -1722,8 +1816,7 @@ const Project = sequelize.define('Project', {
get
()
{
const
rawValue
=
this
.
getDataValue
(
'createdAt'
);
return
rawValue
?
moment
(
rawValue
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
;
},
_mark
:
'xmjbxx'
}
},
updatedAt
:
{
// 同样处理 updatedAt
type
:
DataTypes
.
DATE
,
...
...
router/projectRouter.js
View file @
ae7590d7
...
...
@@ -8,12 +8,25 @@ const projectController = require('../controller/projectController');
/**
* 项目相关
*/
router
.
post
(
'/createProject'
,
projectController
.
createProject
);
//获取项目可选字段--字符串 数值 单选 多选 //表格字段不能导出,可以rongyu存储到表内再行导出
router
.
post
(
'/getProjectFields'
,
projectController
.
getProjectFields
);
router
.
post
(
'/createProject'
,
projectController
.
createProject
);
//创建项目
router
.
post
(
'/saveProjectPreLixiang'
,
projectController
.
saveProjectPreLixiang
);
//保存项目
router
.
post
(
'/startLixiang'
,
projectController
.
startLixiang
);
//发起立项审批----TODO:待完成与能建对接
// -----------------------接收能建立项结果信息,更新立项批复信息等字段------------------------------------------
router
.
post
(
'/saveJuece'
,
projectController
.
saveJuece
);
//决策保存
router
.
post
(
'/startJuece'
,
projectController
.
startJuece
);
router
.
post
(
'/updateProject'
,
projectController
.
updateProject
);
router
.
post
(
'/deleteProject'
,
projectController
.
deleteProject
);
router
.
post
(
'/listProject'
,
projectController
.
listProject
);
router
.
post
(
'/getProjectInfo'
,
projectController
.
getProjectInfo
);
router
.
post
(
'/getProjectFields'
,
projectController
.
getProjectFields
);
router
.
post
(
'/exportExcel'
,
projectController
.
exportExcel
);
...
...
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