明树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
000f0274
Commit
000f0274
authored
Dec 04, 2025
by
zfp1
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev'
parents
ec2e8323
28250989
Pipeline
#104128
passed with stage
in 3 seconds
Changes
7
Pipelines
1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
843 additions
and
413 deletions
+843
-413
a.js
a.js
+24
-1
projectController.js
controller/projectController.js
+487
-195
index.js
db/index.js
+2
-2
c.md
db/model/jt/c.md
+13
-1
project.js
db/model/jt/project.js
+249
-202
projectModule.js
module/projectModule.js
+53
-10
projectRouter.js
router/projectRouter.js
+15
-2
No files found.
a.js
View file @
000f0274
...
@@ -137,3 +137,26 @@ console.log(flattenTree(complexForest, 'xh', 'parentXh'));
...
@@ -137,3 +137,26 @@ console.log(flattenTree(complexForest, 'xh', 'parentXh'));
// [{ "xh": "1", "zb": "项目资本金", "dw": "万元", "parentXh": null, "children": [{ "xh": "1.1", "zb": "能建方出资", "dw": "万元", "parentXh": "1", "children": [] }, { "xh": "1.2", "zb": "外部股东", "dw": "万元", "parentXh": "1", "children": [] }] }, { "xh": "2", "zb": "贷款", "dw": "万元", "parentXh": null, "children": [{ "xh": "2.1", "zb": "其中:并非表项目我方贷款/投保额", "dw": "万元", "parentXh": "2", "children": [] }] }, { "xh": "3", "zb": "其他出资", "dw": "万元", "parentXh": null, "children": [{ "xh": "3.1", "zb": "其中:能建方出资", "dw": "万元", "parentXh": "3", "children": [] }] }, { "xh": "", "zb": "批复总出资", "dw": "万元", "parentXh": null, "children": [] }]
// [{ "xh": "1", "zb": "项目资本金", "dw": "万元", "parentXh": null, "children": [{ "xh": "1.1", "zb": "能建方出资", "dw": "万元", "parentXh": "1", "children": [] }, { "xh": "1.2", "zb": "外部股东", "dw": "万元", "parentXh": "1", "children": [] }] }, { "xh": "2", "zb": "贷款", "dw": "万元", "parentXh": null, "children": [{ "xh": "2.1", "zb": "其中:并非表项目我方贷款/投保额", "dw": "万元", "parentXh": "2", "children": [] }] }, { "xh": "3", "zb": "其他出资", "dw": "万元", "parentXh": null, "children": [{ "xh": "3.1", "zb": "其中:能建方出资", "dw": "万元", "parentXh": "3", "children": [] }] }, { "xh": "", "zb": "批复总出资", "dw": "万元", "parentXh": null, "children": [] }]
function
disTree
(
tree
)
{
let
parallel
=
[];
function
addToParallel
(
nodes
)
{
nodes
.
forEach
(
node
=>
{
parallel
.
push
({
...
node
,
children
:
undefined
});
if
(
node
.
children
&&
node
.
children
.
length
)
{
addToParallel
(
node
.
children
);
}
});
}
addToParallel
(
tree
)
return
parallel
}
console
.
log
(
disTree
(
[
1
,
2
,
3
]))
\ No newline at end of file
controller/projectController.js
View file @
000f0274
This diff is collapsed.
Click to expand it.
db/index.js
View file @
000f0274
...
@@ -182,5 +182,5 @@ Project.hasMany(ProjectXmtzze, { foreignKey: 'projectId', as: 'projectXmtzzes' }
...
@@ -182,5 +182,5 @@ Project.hasMany(ProjectXmtzze, { foreignKey: 'projectId', as: 'projectXmtzzes' }
ProjectXmtzze
.
belongsTo
(
Project
,
{
foreignKey
:
'projectId'
});
ProjectXmtzze
.
belongsTo
(
Project
,
{
foreignKey
:
'projectId'
});
/**项目-项目流转记录 */
/**项目-项目流转记录 */
Project
.
hasMany
(
FlowRecord
,
{
foreignKey
:
'projectId'
,
as
:
'flowRecords'
});
// Project.hasMany(FlowRecord, { foreignKey: 'projectId', as: 'flowRecords' });
FlowRecord
.
belongsTo
(
Project
,
{
foreignKey
:
'projectId'
});
// FlowRecord.belongsTo(Project, { foreignKey: 'projectId' });
\ No newline at end of file
\ No newline at end of file
db/model/jt/c.md
View file @
000f0274
...
@@ -7,3 +7,15 @@
...
@@ -7,3 +7,15 @@
投管项目审批人员 -- 看见所有项目公司人员
投管项目审批人员 -- 看见所有项目公司人员
1.
2 投管新建项目 --- 投管
1.
2 投管新建项目 --- 投管
同步发起 一个startFlow 流程记录 发起人 发起时间 项目状态(待审批-已审批)
同步发起 一个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 @
000f0274
This diff is collapsed.
Click to expand it.
module/projectModule.js
View file @
000f0274
...
@@ -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'
);
...
@@ -14,18 +12,63 @@ const projectModule = require('../module/projectModule');
...
@@ -14,18 +12,63 @@ const projectModule = require('../module/projectModule');
async
function
handleProjectData
(
ret
,
queryAttrs
)
{
async
function
handleProjectData
(
ret
,
queryAttrs
)
{
let
rawAttributes
=
DB
.
Project
.
rawAttributes
;
let
rawAttributes
=
_
.
cloneDeep
(
DB
.
Project
.
rawAttributes
)
;
console
.
log
(
r
awAttributes
,
"===="
)
console
.
log
(
r
et
,
"===="
)
let
queryRawAtr
=
[];
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
];
if
(
rawAttributes
[
element
])
{
if
(
rawAttributes
[
element
])
{
queryRawAtr
.
push
(
rawAttributes
[
element
]);
queryRawAtr
.
push
(
rawAttributes
[
element
]);
//查询得所有字段
if
([
'danxuan'
].
includes
(
rawAttributes
[
element
]
&&
rawAttributes
[
element
].
zjType
))
{
//其中需要处理的资源库字段,单选、
resourceKeys
.
push
(
element
);
}
}
}
}
console
.
log
(
queryRawAtr
);
}
let
groupAttr
=
_
.
groupBy
(
queryRawAtr
,
'zjType'
);
let
resources
=
await
getResourceByKeys
(
resourceKeys
);
return
groupAttr
;
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
;
}
async
function
getResourceByKeys
(
keys
)
{
if
(
!
(
keys
&&
keys
.
length
))
{
return
{};
}
let
ret
=
await
DB
.
Resources
.
findAll
({
where
:
{
key
:
{
[
Op
.
in
]:
keys
}
,
del
:
0
},
include
:
[
{
model
:
DB
.
ResourcesInfo
,
as
:
'resourcesInfos'
,
}
]
});
let
obj
=
{};
for
(
let
index
=
0
;
index
<
ret
.
length
;
index
++
)
{
const
element
=
ret
[
index
];
element
.
resourcesInfos
=
element
.
resourcesInfos
||
[];
let
oobj
=
{};
for
(
let
i
=
0
;
i
<
element
.
resourcesInfos
.
length
;
i
++
)
{
const
e
=
element
.
resourcesInfos
[
i
];
oobj
[
e
.
key
]
=
e
.
value
;
}
obj
[
element
.
key
]
=
oobj
;
}
return
obj
;
}
}
...
...
router/projectRouter.js
View file @
000f0274
...
@@ -8,12 +8,25 @@ const projectController = require('../controller/projectController');
...
@@ -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
(
'/updateProject'
,
projectController
.
updateProject
);
router
.
post
(
'/deleteProject'
,
projectController
.
deleteProject
);
router
.
post
(
'/deleteProject'
,
projectController
.
deleteProject
);
router
.
post
(
'/listProject'
,
projectController
.
listProject
);
router
.
post
(
'/listProject'
,
projectController
.
listProject
);
router
.
post
(
'/getProjectInfo'
,
projectController
.
getProjectInfo
);
router
.
post
(
'/getProjectInfo'
,
projectController
.
getProjectInfo
);
router
.
post
(
'/getProjectFields'
,
projectController
.
getProjectFields
);
router
.
post
(
'/exportExcel'
,
projectController
.
exportExcel
);
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