明树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
ac73ce5a
Commit
ac73ce5a
authored
Dec 04, 2025
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
28250989
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
13 deletions
+93
-13
projectController.js
controller/projectController.js
+42
-12
c.md
db/model/jt/c.md
+13
-1
projectLixiang.js
db/model/jt/projectLixiang.js
+37
-0
projectRouter.js
router/projectRouter.js
+1
-0
No files found.
controller/projectController.js
View file @
ac73ce5a
...
@@ -276,6 +276,25 @@ async function saveProjectPreLixiang(req, res, next) {
...
@@ -276,6 +276,25 @@ async function saveProjectPreLixiang(req, res, next) {
}
}
}
}
/**
* 主动查询立项结果、或者能建调用我方接口
*/
async
function
queryLixiangResult
(
req
,
res
,
next
)
{
try
{
//请求能建提供接口
let
result
=
{
success
:
true
};
//成功
if
(
result
.
success
)
{
}
}
catch
(
error
)
{
next
(
error
);
}
}
/**
/**
* 发起立项
* 发起立项
*/
*/
...
@@ -381,7 +400,7 @@ async function xiangmujuecegengxin(project, projectLzType) {
...
@@ -381,7 +400,7 @@ async function xiangmujuecegengxin(project, projectLzType) {
await
DB
.
ProjectLcbjd
.
destroy
({
where
:
{
projectId
:
project
.
id
,
id
:
{
[
Op
.
notIn
]:
pnids11
}
}
});
await
DB
.
ProjectLcbjd
.
destroy
({
where
:
{
projectId
:
project
.
id
,
id
:
{
[
Op
.
notIn
]:
pnids11
}
}
});
await
DB
.
ProjectLcbjd
.
bulkCreate
(
newprojectLcbjds
);
await
DB
.
ProjectLcbjd
.
bulkCreate
(
newprojectLcbjds
);
await
Promise
.
all
(
pns11
.
map
(
item
=>
{
DB
.
ProjectLcbjd
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
await
Promise
.
all
(
pns11
.
map
(
item
=>
{
DB
.
ProjectLcbjd
.
update
(
item
,
{
where
:
{
id
:
item
.
id
}
})
}));
// 立项资料
// 立项资料
...
@@ -410,20 +429,20 @@ async function xiangmujuecegengxin(project, projectLzType) {
...
@@ -410,20 +429,20 @@ async function xiangmujuecegengxin(project, projectLzType) {
let
shya
=
body
.
shya
||
[];
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'
}
});
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. 删除
//1. 删除
await
DB
.
ProjectFile
.
destroy
({
await
DB
.
ProjectFile
.
destroy
({
where
:
{
where
:
{
projectId
:
project
.
id
,
projectId
:
project
.
id
,
fileId
:
{
[
Op
.
notIn
]:
needIds
}
fileId
:
{
[
Op
.
notIn
]:
needIds
}
}
}
});
});
//2. 创建
//2. 创建
if
(
createIds
.
length
)
{
if
(
createIds
.
length
)
{
let
creProFiles
=
createIds
.
map
(
o
=>
{
return
{
projectId
:
project
.
id
,
fileId
:
o
.
id
,
proFieldKey
:
o
.
proFieldKey
}
});
let
creProFiles
=
createIds
.
map
(
o
=>
{
return
{
projectId
:
project
.
id
,
fileId
:
o
.
id
,
proFieldKey
:
o
.
proFieldKey
}
});
await
DB
.
ProjectFile
.
bulkCreate
(
creProFiles
);
await
DB
.
ProjectFile
.
bulkCreate
(
creProFiles
);
}
}
if
(
projectLzType
)
{
if
(
projectLzType
)
{
projectInfo
.
projectLzType
=
projectLzType
;
projectInfo
.
projectLzType
=
projectLzType
;
}
}
...
@@ -837,18 +856,28 @@ async function deleteProject(req, res, next) {
...
@@ -837,18 +856,28 @@ async function deleteProject(req, res, next) {
async
function
listProject
(
req
,
res
,
next
)
{
async
function
listProject
(
req
,
res
,
next
)
{
try
{
try
{
let
search
=
{
where
:
{
del
:
0
}
};
let
page
=
req
.
body
.
page
||
1
;
let
page
=
req
.
body
.
page
||
1
;
let
limit
=
req
.
body
.
pageSize
||
10
;
let
limit
=
req
.
body
.
pageSize
||
10
;
let
offset
=
(
page
-
1
)
*
limit
;
let
offset
=
(
page
-
1
)
*
limit
;
if
(
req
.
body
.
name
)
{
let
search
=
{};
search
.
where
=
{
let
where
=
{
del
:
0
};
[
Op
.
or
]:
[
//处理筛选条件
{
name
:
{
[
Op
.
like
]:
`%
${
req
.
body
.
name
}
%`
}
}
switch
(
req
.
body
.
buttonType
)
{
],
case
"xmdak"
:
del
:
0
,
}
break
;
case
"xmlx"
:
break
;
case
"xmjc"
:
break
;
default
:
break
;
}
}
search
.
limit
=
limit
;
search
.
limit
=
limit
;
search
.
offset
=
offset
;
search
.
offset
=
offset
;
if
(
req
.
body
.
attributes
&&
req
.
body
.
attributes
.
length
)
{
if
(
req
.
body
.
attributes
&&
req
.
body
.
attributes
.
length
)
{
...
@@ -1006,4 +1035,5 @@ module.exports = {
...
@@ -1006,4 +1035,5 @@ module.exports = {
saveJuece
,
saveJuece
,
startJuece
,
startJuece
,
saveProjectPreLixiang
,
saveProjectPreLixiang
,
queryLixiangResult
,
}
}
\ No newline at end of file
db/model/jt/c.md
View file @
ac73ce5a
...
@@ -18,4 +18,16 @@
...
@@ -18,4 +18,16 @@
*
5. 投管后续立项推送、决策推送状态再行处理
*
5. 投管后续立项推送、决策推送状态再行处理
*
/
*
/
//B. 找到本公司审批人员发送消息-- 如果找不到人 则提示项目已保存,联系管理员添加【项目公司项目审批人】角色
//B. 找到本公司审批人员发送消息-- 如果找不到人 则提示项目已保存,联系管理员添加【项目公司项目审批人】角色
//A. 创建发起记录
//A. 创建发起记录
\ No newline at end of file
1.
字典,提供形式:导出字典数据表或者excel表,提供内容举例:
主业/非主业:
[
{key: "zy", value: "主业"}, {key:"fzy", value: "非主业"}
]
2.
项目数据提交接口:
项目存量数据信息获取接口(获取交投公司存量项目)
项目立项数据推送接口
项目立项审批结果获取接口(贵方提供,我方循环拉取结果) || 项目立项审批结果回调接口(我方提供,贵方推送)
项目决策数据推送接口
项目决策审批结果获取接口(贵方提供,我方循环拉取结果) || 项目决策审批结果回调接口(我方提供,贵方推送)
3.
文件处理:
双方在项目数据交互时,文件数据如何交互,需要技术人员进一步商讨
db/model/jt/projectLixiang.js
0 → 100644
View file @
ac73ce5a
const
{
DataTypes
}
=
require
(
'sequelize'
);
const
sequelize
=
require
(
'../index'
);
const
moment
=
require
(
'moment'
);
// 风险管理
const
ProjectLixiang
=
sequelize
.
define
(
'ProjectLixiang'
,
{
id
:
{
type
:
DataTypes
.
INTEGER
,
primaryKey
:
true
,
autoIncrement
:
true
},
lixiang
:{
type
:
DataTypes
.
JSON
},
projectId
:
{
type
:
DataTypes
.
INTEGER
,
comment
:
"所属项目ID"
,
},
del
:
{
type
:
DataTypes
.
INTEGER
,
defaultValue
:
0
,
comment
:
"0 正常 1 删除"
}
},
{
tableName
:
'jt_project_lixiang'
,
// 指定表名(如果与模型名不同)
timestamps
:
true
,
// 是否自动添加 createdAt 和 updatedAt 字段(覆盖全局设置)
});
// 同步模型到数据库(创建表)
ProjectLixiang
.
sync
({
force
:
false
,
// force: true ,//会删除已存在表并重新创建
// alter: true
})
.
then
(()
=>
{
console
.
log
(
'ProjectLixiang 表同步成功'
);
});
module
.
exports
=
ProjectLixiang
;
\ No newline at end of file
router/projectRouter.js
View file @
ac73ce5a
...
@@ -16,6 +16,7 @@ router.post('/createProject', projectController.createProject); //创建项目
...
@@ -16,6 +16,7 @@ router.post('/createProject', projectController.createProject); //创建项目
router
.
post
(
'/saveProjectPreLixiang'
,
projectController
.
saveProjectPreLixiang
);
//保存项目
router
.
post
(
'/saveProjectPreLixiang'
,
projectController
.
saveProjectPreLixiang
);
//保存项目
router
.
post
(
'/startLixiang'
,
projectController
.
startLixiang
);
//发起立项审批----TODO:待完成与能建对接
router
.
post
(
'/startLixiang'
,
projectController
.
startLixiang
);
//发起立项审批----TODO:待完成与能建对接
router
.
post
(
'/queryLixiangResult'
,
projectController
.
queryLixiangResult
);
// -----------------------接收能建立项结果信息,更新立项批复信息等字段------------------------------------------
// -----------------------接收能建立项结果信息,更新立项批复信息等字段------------------------------------------
...
...
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