明树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
55112b3b
Commit
55112b3b
authored
Dec 04, 2025
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2c8bedbc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
29 deletions
+47
-29
projectController.js
controller/projectController.js
+45
-29
index.js
db/index.js
+2
-0
No files found.
controller/projectController.js
View file @
55112b3b
...
@@ -276,37 +276,12 @@ async function saveProjectPreLixiang(req, res, next) {
...
@@ -276,37 +276,12 @@ async function saveProjectPreLixiang(req, res, next) {
}
}
}
}
/**
* 主动查询立项结果、或者能建调用我方接口
*/
async
function
queryLixiangResult
(
req
,
res
,
next
)
{
try
{
if
(
!
req
.
body
.
id
)
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
)
}
//请求能建提供接口
let
result
=
{
success
:
true
};
//成功
if
(
result
.
success
)
{
let
proInfo
=
await
projectModule
.
getProjectInfo
(
body
);
//1. 更新项目状态
await
DB
.
Project
.
update
({
projectLzType
:
5
},
{
where
:
{
id
}});
}
}
catch
(
error
)
{
next
(
error
);
}
}
/**
/**
* 发起立项
* 发起立项
*/
*/
async
function
startLixiang
(
req
,
res
,
next
)
{
async
function
startLixiang
(
req
,
res
,
next
)
{
try
{
try
{
let
body
=
req
.
body
;
if
(
!
req
.
body
.
id
)
{
if
(
!
body
.
id
)
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
)
return
res
.
sendError
(
errorMessage
.
resourceNotFound
)
}
}
...
@@ -314,11 +289,11 @@ async function startLixiang(req, res, next) {
...
@@ -314,11 +289,11 @@ async function startLixiang(req, res, next) {
await
DB
.
FlowRecord
.
create
({
await
DB
.
FlowRecord
.
create
({
userId
:
req
.
user
.
id
,
userId
:
req
.
user
.
id
,
actionName
:
'发起项目立项审批'
,
actionName
:
'发起项目立项审批'
,
projectId
:
project
.
id
,
projectId
:
req
.
body
.
id
,
});
});
//更新信息和状态
//更新信息和状态
let
ret
=
await
xiangmulixianggengxin
(
body
,
3
);
//状态 3 -- 显示立项审批中
let
ret
=
await
xiangmulixianggengxin
(
req
.
body
,
3
);
//状态 3 -- 显示立项审批中
return
res
.
sendData
(
ret
);
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
}
catch
(
error
)
{
...
@@ -326,6 +301,33 @@ async function startLixiang(req, res, next) {
...
@@ -326,6 +301,33 @@ async function startLixiang(req, res, next) {
}
}
}
}
/**
* 主动查询立项结果、或者能建调用我方接口
*/
async
function
queryLixiangResult
(
req
,
res
,
next
)
{
try
{
if
(
!
req
.
body
.
id
)
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
)
}
//请求能建提供接口
let
result
=
{
success
:
true
};
//成功
if
(
result
.
success
)
{
let
proInfo
=
await
projectModule
.
getProjectInfo
(
req
.
body
);
//1. 更新项目状态
await
DB
.
Project
.
update
({
projectLzType
:
5
},
{
where
:
{
id
:
req
.
body
.
id
}});
//2. 存储快照 关联关系太多 全部建立快照表工程过大,暂时存储形式
proInfo
.
projectLzType
=
5
;
await
DB
.
ProjectLixiang
.
create
({
lixiang
:
proInfo
,
projectId
:
proInfo
.
id
});
return
res
.
sendData
(
proInfo
);
}
else
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
//暂时
}
}
catch
(
error
)
{
next
(
error
);
}
}
...
@@ -751,7 +753,21 @@ async function getProjectInfo(req, res, next) {
...
@@ -751,7 +753,21 @@ async function getProjectInfo(req, res, next) {
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
return
res
.
sendError
(
errorMessage
.
resourceNotFound
);
}
}
let
ret
=
await
projectModule
.
getProjectInfo
(
req
.
body
);
let
ret
=
await
projectModule
.
getProjectInfo
(
req
.
body
);
return
res
.
sendData
(
ret
);
let
lixiang
=
await
DB
.
ProjectLixiang
.
findOne
({
order
:
[[
'createdAt'
,
'DESC'
]],
where
:
{
projectId
:
req
.
body
.
id
},
});
let
obj
=
{};
if
(
lixiang
&&
lixiang
.
id
)
{
obj
.
lixiang
=
lixiang
.
lixiang
;
//快照
//当项目状态 进入决策信息填报时候
if
([].
includes
(
ret
&&
ret
.
projectLzType
))
{
obj
.
juece
=
ret
;
}
}
else
{
obj
.
lixiang
=
ret
;
//这里就只有立项 决策的数据一旦开始填报 证明一定有ProjectLixiang lixiang
}
return
res
.
sendData
(
obj
);
}
catch
(
error
)
{
}
catch
(
error
)
{
next
(
error
);
next
(
error
);
}
}
...
...
db/index.js
View file @
55112b3b
...
@@ -30,6 +30,7 @@ const ProjectSpyj = require("./model/jt/projectSpyj");
...
@@ -30,6 +30,7 @@ const ProjectSpyj = require("./model/jt/projectSpyj");
const
ProjectTzzjll
=
require
(
"./model/jt/projectTzzjll"
);
const
ProjectTzzjll
=
require
(
"./model/jt/projectTzzjll"
);
const
ProjectTzzt
=
require
(
"./model/jt/projectTzzt"
);
const
ProjectTzzt
=
require
(
"./model/jt/projectTzzt"
);
const
ProjectXmtzze
=
require
(
"./model/jt/projectXmtzze"
);
const
ProjectXmtzze
=
require
(
"./model/jt/projectXmtzze"
);
const
ProjectLixiang
=
require
(
"./model/jt/projectLixiang"
);
/**
/**
...
@@ -67,6 +68,7 @@ global.DB = {
...
@@ -67,6 +68,7 @@ global.DB = {
ProjectXmtzze
,
ProjectXmtzze
,
Message
,
Message
,
FlowRecord
,
FlowRecord
,
ProjectLixiang
,
}
}
...
...
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