明树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
4ffa5160
Commit
4ffa5160
authored
Jan 09, 2026
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
4f029b6c
Pipeline
#105872
passed with stage
in 3 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
12 deletions
+50
-12
messageController.js
controller/messageController.js
+36
-12
projectController.js
controller/projectController.js
+12
-0
projectRouter.js
router/projectRouter.js
+2
-0
No files found.
controller/messageController.js
View file @
4ffa5160
const
errorMessage
=
require
(
"../utils/errorMessage"
);
const
errorMessage
=
require
(
"../utils/errorMessage"
);
const
{
Op
}
=
require
(
"sequelize"
);
const
{
Op
}
=
require
(
"sequelize"
);
const
sequelize
=
require
(
'sequelize'
);
...
@@ -68,16 +69,24 @@ async function getUserMessages(req, res, next) {
...
@@ -68,16 +69,24 @@ async function getUserMessages(req, res, next) {
try
{
try
{
const
messages
=
await
DB
.
Message
.
findAll
({
const
messages
=
await
DB
.
Message
.
findAll
({
where
:
{
where
:
{
receivers
:
{
[
Op
.
contains
]:
[
req
.
user
.
id
]
},
[
Op
.
and
]:
[
sequelize
.
where
(
del
:
0
sequelize
.
fn
(
'JSON_CONTAINS'
,
sequelize
.
col
(
'receivers'
),
sequelize
.
cast
(
req
.
user
.
id
,
'JSON'
),
// 直接将数字转换为JSON
sequelize
.
literal
(
"'$'"
)
),
true
),
{
del
:
0
},
]
},
},
include
:
[
//
include: [
{
//
{
model
:
DB
.
User
,
//
model: DB.User,
as
:
'creatorInfo'
,
//
as: 'creatorInfo',
attributes
:
[
'id'
,
'name'
,
'avatar'
]
//
attributes: ['id', 'name', 'avatar']
}
//
}
],
//
],
raw
:
true
,
raw
:
true
,
order
:
[[
'createdAt'
,
'DESC'
]],
order
:
[[
'createdAt'
,
'DESC'
]],
});
});
...
@@ -102,9 +111,24 @@ async function getMesCount(req, res, next) {
...
@@ -102,9 +111,24 @@ async function getMesCount(req, res, next) {
try
{
try
{
const
count
=
await
DB
.
Message
.
count
({
const
count
=
await
DB
.
Message
.
count
({
where
:
{
where
:
{
receivers
:
{
[
Op
.
contains
]:
[
req
.
user
.
id
]
},
[
Op
.
and
]:
[
sequelize
.
where
(
del
:
0
,
sequelize
.
fn
(
'JSON_CONTAINS'
,
alreadyRead
:
{
[
Op
.
not
]:
{[
Op
.
contains
]:
[
req
.
user
.
id
]}
}
sequelize
.
col
(
'receivers'
),
sequelize
.
cast
(
req
.
user
.
id
,
'JSON'
),
// 直接将数字转换为JSON
sequelize
.
literal
(
"'$'"
)
),
true
),
{
del
:
0
},
sequelize
.
where
(
sequelize
.
fn
(
'JSON_CONTAINS'
,
sequelize
.
col
(
'alreadyRead'
),
sequelize
.
cast
(
req
.
user
.
id
,
'JSON'
),
// 直接将数字转换为JSON
sequelize
.
literal
(
"'$'"
)
),
true
)
]
}
}
});
});
return
res
.
sendData
({
count
});
return
res
.
sendData
({
count
});
...
...
controller/projectController.js
View file @
4ffa5160
...
@@ -1133,6 +1133,17 @@ async function getOwnProjects(req, res, next) {
...
@@ -1133,6 +1133,17 @@ async function getOwnProjects(req, res, next) {
}
}
}
}
async
function
getProFlowRecord
(
req
,
res
,
next
)
{
try
{
let
rcs
=
await
DB
.
FlowRecord
.
findAll
({
where
:
{
projectId
:
req
.
body
.
projectId
}});
return
res
.
sendData
(
rcs
);
}
catch
(
error
)
{
next
(
error
);
}
}
module
.
exports
=
{
module
.
exports
=
{
getProjectFields
,
getProjectFields
,
createProject
,
createProject
,
...
@@ -1153,4 +1164,5 @@ module.exports = {
...
@@ -1153,4 +1164,5 @@ module.exports = {
getProjectCwpj
,
getProjectCwpj
,
approvalLixiang
,
approvalLixiang
,
approvalJuece
,
approvalJuece
,
getProFlowRecord
,
}
}
\ No newline at end of file
router/projectRouter.js
View file @
4ffa5160
...
@@ -46,6 +46,8 @@ router.post('/listProject', projectController.listProject);
...
@@ -46,6 +46,8 @@ router.post('/listProject', projectController.listProject);
// router.post('/getOwnProjects', projectController.getOwnProjects);
// router.post('/getOwnProjects', projectController.getOwnProjects);
router
.
post
(
'/getProFlowRecord'
,
projectController
.
getProFlowRecord
)
/**
/**
* 投中管理
* 投中管理
...
...
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