Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nanMoMentorPlatform
Overview
Overview
Details
Activity
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
node_server
nanMoMentorPlatform
Commits
fee4541c
Commit
fee4541c
authored
Jul 15, 2026
by
PC-20251223ZVQQ\Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测评题库和成长寄语
parent
b2f71448
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
86 additions
and
11 deletions
+86
-11
teacherSurvey.ts
src/biz/admin/teacherSurvey.ts
+28
-7
authentication.ts
src/biz/authentication.ts
+28
-0
abilityComparison.ts
src/biz/common/abilityComparison.ts
+15
-3
dianxinService.ts
src/biz/common/dianxinService.ts
+15
-1
No files found.
src/biz/admin/teacherSurvey.ts
View file @
fee4541c
...
@@ -120,6 +120,20 @@ export async function updateIsOpenSurvey(surveyId: number, isOpen: number) {
...
@@ -120,6 +120,20 @@ export async function updateIsOpenSurvey(surveyId: number, isOpen: number) {
await
updateManyData
(
TABLENAME
.
测评活动表
,
{
id
:
surveyId
},
{
await
updateManyData
(
TABLENAME
.
测评活动表
,
{
id
:
surveyId
},
{
is_open
:
isOpen
?
true
:
false
is_open
:
isOpen
?
true
:
false
});
});
// 通过模板id查询试卷,按创建时间倒序取最晚一条
let
survey_template
=
await
selectOneDataByParam
(
TABLENAME
.
测评活动表
,
{
is_temp
:
2
,
temp_id
:
surveyId
,
"%orderDesc%"
:
"created_at"
,
"%limit%"
:
1
});
if
(
hasData
(
survey_template
))
{
let
survey_id
=
(
survey_template
.
data
as
any
).
id
;
await
updateManyData
(
TABLENAME
.
测评活动表
,
{
id
:
survey_id
},
{
is_open
:
isOpen
?
true
:
false
});
}
return
{
isSuccess
:
true
};
return
{
isSuccess
:
true
};
}
}
...
@@ -152,10 +166,10 @@ export async function updateSurvey(param: {
...
@@ -152,10 +166,10 @@ export async function updateSurvey(param: {
if
(
!
hasData
(
survey
))
{
if
(
!
hasData
(
survey
))
{
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
'测评不存在'
);
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
'测评不存在'
);
}
}
await
updateSurveyInfo
(
surveyId
,
surveyName
,
startTime
,
endTime
,
isOpen
,
description
,
questions
);
// 若是没有更新开始时间,则同步更新试卷
// 若是没有更新开始时间,则同步更新试卷
if
(
survey
.
data
.
start_time
===
startTime
)
{
if
(
survey
.
data
.
start_time
===
startTime
)
{
// 更新模板
await
updateSurveyInfo
(
null
,
surveyId
,
surveyName
,
startTime
,
endTime
,
isOpen
,
description
,
questions
);
// 通过模板id查询试卷,按创建时间倒序取最晚一条
// 通过模板id查询试卷,按创建时间倒序取最晚一条
let
survey_template
=
await
selectOneDataByParam
(
TABLENAME
.
测评活动表
,
{
let
survey_template
=
await
selectOneDataByParam
(
TABLENAME
.
测评活动表
,
{
is_temp
:
2
,
is_temp
:
2
,
...
@@ -166,10 +180,12 @@ export async function updateSurvey(param: {
...
@@ -166,10 +180,12 @@ export async function updateSurvey(param: {
if
(
hasData
(
survey_template
))
{
if
(
hasData
(
survey_template
))
{
let
survey_id
=
(
survey_template
.
data
as
any
).
id
;
let
survey_id
=
(
survey_template
.
data
as
any
).
id
;
// 更新试卷信息
// 更新试卷信息
await
updateSurveyInfo
(
survey_id
,
surveyName
,
startTime
,
endTime
,
isOpen
,
description
,
questions
);
await
updateSurveyInfo
(
null
,
survey_id
,
surveyName
,
startTime
,
endTime
,
isOpen
,
description
,
questions
);
}
}
}
else
{
}
else
{
let
semester
=
await
getCurrentSemester
();
let
semester
=
await
getCurrentSemester
();
// 更新模板
await
updateSurveyInfo
(
semester
.
id
,
surveyId
,
surveyName
,
startTime
,
endTime
,
isOpen
,
description
,
questions
);
// 若是更新开始时间,则通过模板创建试卷
// 若是更新开始时间,则通过模板创建试卷
let
insertData
=
await
insertSurveyInfo
(
semester
.
id
,
surveyName
,
startTime
,
endTime
,
isOpen
,
description
,
2
,
surveyId
);
let
insertData
=
await
insertSurveyInfo
(
semester
.
id
,
surveyName
,
startTime
,
endTime
,
isOpen
,
description
,
2
,
surveyId
);
let
survey_id
=
(
insertData
as
any
).
data
.
id
;
let
survey_id
=
(
insertData
as
any
).
data
.
id
;
...
@@ -250,16 +266,21 @@ async function insertSurveyDetail(surveyId: number, questions: any[]){
...
@@ -250,16 +266,21 @@ async function insertSurveyDetail(surveyId: number, questions: any[]){
}
}
}
}
// 内联方法,用于更新测评信息和题目列表
// 内联方法,用于更新测评信息和题目列表
async
function
updateSurveyInfo
(
surveyId
:
number
,
surveyName
:
string
,
startTime
:
string
,
async
function
updateSurveyInfo
(
s
emesterId
:
number
,
s
urveyId
:
number
,
surveyName
:
string
,
startTime
:
string
,
endTime
:
string
,
isOpen
:
number
,
description
:
string
,
questions
:
any
[]){
endTime
:
string
,
isOpen
:
number
,
description
:
string
,
questions
:
any
[]){
/**更新 survey 表 */
let
surveyParam
:
any
=
{
await
updateManyData
(
TABLENAME
.
测评活动表
,
{
id
:
surveyId
},
{
name
:
surveyName
,
name
:
surveyName
,
start_time
:
startTime
||
null
,
start_time
:
startTime
||
null
,
end_time
:
endTime
||
null
,
end_time
:
endTime
||
null
,
is_open
:
isOpen
?
true
:
false
,
is_open
:
isOpen
?
true
:
false
,
description
:
description
||
null
description
:
description
||
null
});
};
if
(
semesterId
)
{
surveyParam
.
semester_id
=
semesterId
;
}
/**更新 survey 表 */
await
updateManyData
(
TABLENAME
.
测评活动表
,
{
id
:
surveyId
},
surveyParam
);
/**操作 survey_question 表:先删后加 */
/**操作 survey_question 表:先删后加 */
await
delData
(
TABLENAME
.
测评题目表
,
{
survey_id
:
surveyId
});
await
delData
(
TABLENAME
.
测评题目表
,
{
survey_id
:
surveyId
});
...
...
src/biz/authentication.ts
View file @
fee4541c
...
@@ -1046,6 +1046,34 @@ async function parseXmlResponse(xmlData: string): Promise<string | false> {
...
@@ -1046,6 +1046,34 @@ async function parseXmlResponse(xmlData: string): Promise<string | false> {
// 学生账号列表
// 学生账号列表
students
:
[
students
:
[
{
{
user_id
:
'nmzx2203040'
,
user_name
:
'何陈迹'
,
gender
:
'女'
,
user_type
:
'10010'
,
email
:
'hecj@test.com'
,
phone
:
'13900000020'
,
class_name
:
''
,
student_no
:
''
,
is_youth_party_school
:
false
,
middle_school
:
''
,
parent_name
:
''
,
parent_phone
:
''
},
{
user_id
:
'nmzx2203570'
,
user_name
:
'贾玉龙'
,
gender
:
'男'
,
user_type
:
'10010'
,
email
:
'jiayl@test.com'
,
phone
:
'13900000021'
,
class_name
:
''
,
student_no
:
''
,
is_youth_party_school
:
false
,
middle_school
:
''
,
parent_name
:
''
,
parent_phone
:
''
},
{
user_id
:
'nmzx2107510'
,
user_id
:
'nmzx2107510'
,
user_name
:
'葛颋宇'
,
user_name
:
'葛颋宇'
,
gender
:
'男'
,
gender
:
'男'
,
...
...
src/biz/common/abilityComparison.ts
View file @
fee4541c
...
@@ -12,7 +12,7 @@ export async function getAbilityComparison(
...
@@ -12,7 +12,7 @@ export async function getAbilityComparison(
let
abilityData
=
await
post
(
systemConfig
.
abilitycomparison
,
{
student_id
:
studentId
},
{});
let
abilityData
=
await
post
(
systemConfig
.
abilitycomparison
,
{
student_id
:
studentId
},
{});
let
abilityModel
=
transformAbilityData
(
abilityData
);
let
abilityModel
=
transformAbilityData
(
abilityData
);
let
avatarInfo
=
extractAvatarInfo
(
abilityData
);
let
avatarInfo
=
extractAvatarInfo
(
abilityData
);
let
threeScores
=
calculateDirectionScoresFromDimensions
(
abilityModel
.
abilityScores
);
let
threeScores
=
calculateDirectionScoresFromDimensions
(
abilityModel
.
ability
Basic
Scores
);
return
{
return
{
abilityModel
,
abilityModel
,
avatarInfo
,
avatarInfo
,
...
@@ -42,6 +42,16 @@ function transformAbilityData(apiData: any) {
...
@@ -42,6 +42,16 @@ function transformAbilityData(apiData: any) {
}
}
const
data
=
apiData
.
data
;
const
data
=
apiData
.
data
;
let
abilityScores
=
[];
Object
.
entries
(
data
.
abilities
).
forEach
(([
key
,
value
]:
[
string
,
any
])
=>
{
abilityScores
.
push
({
"key"
:
key
,
"curr"
:
value
.
currentScore
||
0
,
"avg"
:
value
.
averageScore
||
0
});
});
return
{
return
{
hasData
:
data
.
hasData
,
hasData
:
data
.
hasData
,
message
:
data
.
message
||
'获取成功'
,
message
:
data
.
message
||
'获取成功'
,
...
@@ -49,9 +59,11 @@ function transformAbilityData(apiData: any) {
...
@@ -49,9 +59,11 @@ function transformAbilityData(apiData: any) {
currentScore
:
data
.
totalScore
?.
currentScore
||
0
,
currentScore
:
data
.
totalScore
?.
currentScore
||
0
,
previousScore
:
data
.
totalScore
?.
previousScore
||
null
,
previousScore
:
data
.
totalScore
?.
previousScore
||
null
,
yoyChange
:
data
.
totalScore
?.
yoyChange
||
null
,
yoyChange
:
data
.
totalScore
?.
yoyChange
||
null
,
yoyPercent
:
data
.
totalScore
?.
yoyPercent
||
null
yoyPercent
:
data
.
totalScore
?.
yoyPercent
||
null
,
abilityRank
:
data
.
totalScore
?.
abilityRank
||
"--"
},
},
abilityScores
:
{
abilityScores
:
abilityScores
,
abilityBasicScores
:
{
jgqh
:
data
.
abilities
?.
jgqh
?.
currentScore
||
0
,
jgqh
:
data
.
abilities
?.
jgqh
?.
currentScore
||
0
,
gjsy
:
data
.
abilities
?.
gjsy
?.
currentScore
||
0
,
gjsy
:
data
.
abilities
?.
gjsy
?.
currentScore
||
0
,
zrdd
:
data
.
abilities
?.
zrdd
?.
currentScore
||
0
,
zrdd
:
data
.
abilities
?.
zrdd
?.
currentScore
||
0
,
...
...
src/biz/common/dianxinService.ts
View file @
fee4541c
...
@@ -2,7 +2,8 @@ import { post } from "../../util/request";
...
@@ -2,7 +2,8 @@ import { post } from "../../util/request";
import
{
BizError
}
from
"../../util/bizError"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
const
BASE_URL
=
'http://58.246.54.66:8000'
;
// const BASE_URL = 'http://58.246.54.66:8000';
const
BASE_URL
=
'https://nmzx-proxy.dev.yunstech.cn'
;
const
CLIENT_ID
=
'1103b3776c534c0f98d38f1f7d6697f9'
;
const
CLIENT_ID
=
'1103b3776c534c0f98d38f1f7d6697f9'
;
let
tokenQueue
=
""
;
let
tokenQueue
=
""
;
...
@@ -39,6 +40,19 @@ async function callDianXinApi(url: string, params: Record<string, any>) {
...
@@ -39,6 +40,19 @@ async function callDianXinApi(url: string, params: Record<string, any>) {
return
result
;
return
result
;
}
}
/** 获取学生基础信息 */
export
async
function
getStudentInfo
(
username
:
string
,
grade
:
string
,
classroom
:
string
)
{
let
params
:
Record
<
string
,
any
>
=
{
username
};
if
(
grade
)
{
params
.
grade
=
grade
;
}
if
(
classroom
)
{
params
.
classroom
=
classroom
;
}
let
result
:
any
=
await
callDianXinApi
(
'/service/api/nmzx/student_info'
,
params
);
return
result
?.
data
||
null
;
}
/** 获取学生最近成绩(各科分数 + 总分 + 班级排名) */
/** 获取学生最近成绩(各科分数 + 总分 + 班级排名) */
export
async
function
getStudentLatestScore
(
stuno
:
string
,
xuenian
:
string
)
{
export
async
function
getStudentLatestScore
(
stuno
:
string
,
xuenian
:
string
)
{
let
params
:
Record
<
string
,
any
>
=
{
stuno
};
let
params
:
Record
<
string
,
any
>
=
{
stuno
};
...
...
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