feat: 添加ExaminationStuAbsentRsp接口,优化缺考请求响应处理

This commit is contained in:
wangzhongjie 2025-03-25 10:41:13 +08:00
parent 0f564b746a
commit a8bf95df5f
7 changed files with 32 additions and 15 deletions

View File

@ -2,6 +2,11 @@
"apiType": 'stageMode',
"buildOption": {
"externalNativeOptions": {
"abiFilters": [
"arm64-v8a",
"armeabi-v7a",
"x86_64"
],
"path": "./src/main/cpp/CMakeLists.txt",
"arguments": "",
"cppFlags": "",
@ -16,5 +21,5 @@
{
"name": "ohosTest",
}
]
],
}

View File

@ -1,6 +1,7 @@
import request from '../utils/Request'
import http from '@ohos.net.http'
import {
ApiResponseType,
ExaminationStuAbsentParams,
FaceCompareResp,
GetExaminationItemRsp,
@ -55,7 +56,7 @@ export async function getExaminationStudentInfo(params: ESObject) {
//缺考
export async function examinationStuAbsent(params: ExaminationStuAbsentParams) {
return request({
return request<ApiResponseType>({
url: '/der2/services/exam/examinationStuAbsent.ws',
data: `<?xml version="1.0" encoding="UTF-8" ?>
<examinationStuAbsentReq>

View File

@ -11,6 +11,13 @@ export interface ApiResponseType {
// 时间同步 /der2/services/exam/timeSynchronization.ws
timeSynchronizationRsp?: TimeSynchronizationRsp;
// 缺考
examinationStuAbsentRsp?: ExaminationStuAbsentRsp
}
interface ExaminationStuAbsentRsp {
head: Head
}
interface TimeSynchronizationRsp {
@ -163,7 +170,6 @@ export interface BeginExamRequest {
code?: number
}
// { getExaminationItemRsp: { body: { ykxx: '' } } }
export interface GetExaminationItemRsp {
getExaminationItemRsp: GetExaminationItemRspDetails
}
@ -175,6 +181,7 @@ interface GetExaminationItemRspDetails {
interface GetExaminationItemRspBody {
ykxx: string;
kssycs?: string | number;
}
export interface ExaminationStuAbsentParams {

View File

@ -24,7 +24,7 @@ import {
SYSTEMPARMARR
} from './judgeSDK/api/judgeSDK.d';
import { chunkArr, formatTime, getCurrentHourTime, getCurrentTime } from '../common/utils/tools';
import { chunkArr, getCurrentTime } from '../common/utils/tools';
import { getSyncData } from '../common/service/initable';
import { judgeConfig } from './judgeSDK/utils/judgeConfig';
import FileUtil from '../common/utils/File';
@ -222,8 +222,8 @@ struct Index {
IPADDR: '',
CARCLASS: decodeURI(carInfo.carclass),
KSCX: carInfo.kscx,
// TODO 确定一下是否有这个字段,表定义中没有
CARNAME: decodeURI(carInfo.carname),
// CARNAME: decodeURI(carInfo.carname),
CARNAME: "",
FLAG: carInfo.flag,
BK1: carInfo.bk1,
BK2: carInfo.bk2,
@ -238,7 +238,7 @@ struct Index {
// const { xm, sfzmhm, lsh, kszp, ksdd, kssycs, kslx, ksxl, xldm } = stuInfo;
this.name = stuInfo.xm || '测试考生';
this.idCard = stuInfo.sfzmhm || '01234567891010';
this.lsh = this.singlePlay ? '0000000000000' : lsh;
this.lsh = this.singlePlay ? '0000000000000' : stuInfo.lsh;
this.kszp = stuInfo.kszp;
this.ksdd = stuInfo.ksdd;
this.kssycs = stuInfo.kssycs;
@ -250,7 +250,7 @@ struct Index {
// 获取扣分代码信息
async initMarkRules(markRules ?: MarkRule[]) {
const markRuleParams = markRules || (await GetSyncData<MA_MARKRULEType>('MA_MARKRULE')
const markRuleParams = markRules || (await GetSyncData<MA_MARKRULEType>('MA_MARKRULE'))
markRuleParams.forEach(mark => {
const tempObj = {
@ -692,7 +692,7 @@ struct Index {
Text(this.startTime).fontColor('#FFF').fontSize(this.FONTSIZE)
}.margin({ bottom: 10 })
if (this.examSubject == 3) {
if (this.examSubject == "3") {
Row() {
Text('考试路线:').fontColor('#E5CCA1').fontSize(this.FONTSIZE)
Text(`线路${this.wayno || 3}`).fontColor('#FFAD33').fontSize(this.FONTSIZE)

View File

@ -61,7 +61,6 @@ struct Index {
.linearGradient({
angle: 0,
colors: [[0x403C36, 0.0], [0x4D473D, 0.34], [0x3D3A34, 1.0]]
})
.onChange((value: string) => {
this.inputTextList1[index] = value

View File

@ -36,6 +36,7 @@ import {
RouteParamsType,
SckType,
SystemParamType,
UDPParamType,
User
} from '../model';
import { BusinessError } from '@ohos.base';
@ -191,7 +192,7 @@ struct UserInfo {
if (this.singlePlay) {
return ''
} else {
const photoBase64 = await this.filePhoto.getPhoto();
const photoBase64: string = await this.filePhoto.getPhoto();
return photoBase64
}
}
@ -800,11 +801,11 @@ struct UserInfo {
examinationStuAbsent(param).then(res => {
const arr = [this.signNum || 0, 1]
let tmpList = [];
let tmpList: number[] = [];
tmpList.push(string2Bytes(arr[0], 1 * 8)[0])
tmpList.push(string2Bytes(arr[1], 1 * 8)[0])
const param = {
const param: UDPParamType = {
id: 43,
list: tmpList,
carNo: this.carInfo.carNo,
@ -849,7 +850,12 @@ struct UserInfo {
async sfbdinterfaceFn() {
AppStorage.setOrCreate('statue', 4)
this.stepFlag = true
let examItems: GetExaminationItemRsp = { getExaminationItemRsp: { body: { ykxx: '' } } };
let examItems: GetExaminationItemRsp = {
getExaminationItemRsp:
{
body: { ykxx: '' }
}
};
if (!this.singlePlay) {
//获取已考项目
examItems = await getExaminationItem({

View File

@ -709,7 +709,6 @@ struct Index {
async writeConfig() {
this.oldParam = JSON.parse(JSON.stringify(this.param))
this.videoArr = JSON.parse(JSON.stringify(this.videoArr))
console.log('kkkk', JSON.stringify(this.param))
const folderPath = await this.fileUtil.initFolder(`/config`);
this.fileUtil.addFile(`${folderPath}/config3.txt`, JSON.stringify(this.param), 'overWrite')
this.showFlag = false