优化api

This commit is contained in:
lixiao 2025-02-12 09:16:01 +08:00
parent 49461428ab
commit 34f77cac8d
7 changed files with 117 additions and 1059 deletions

View File

@ -3,7 +3,6 @@ import { getCurrentTime } from '../common/utils/tools';
import { getSyncData } from '../common/service/initable';
import writeObjectOutNew from './judgeNew';
import FileUtil from '../common/utils/File';
import tempRequest from '../common/utils/tempRequest';
import http from '@ohos.net.http';
let baseHost = globalThis.host;
@ -78,7 +77,7 @@ export async function writeObjectOut(params, filePath?: string): Promise<WR> {
//对象转换成xml
const temp = await request<object>({
host: globalThis.JGHOST,
host: globalThis.JGHOST as string,
url: '/dems_ws/services/TmriOutAccess?wsdl',
data: `<?xml version="1.0"?>
<SOAP-ENV:Envelope
@ -121,7 +120,7 @@ export async function writeObjectOut(params, filePath?: string): Promise<WR> {
return temp
}
interface uploadExamProgressDataParams{
interface UploadExamProgressDataParams {
carId: string
examinationRoomId: string
type: string
@ -133,13 +132,12 @@ interface uploadExamProgressDataParams{
}
// 过程文件上传
export async function uploadExamProgressData(params:uploadExamProgressDataParams) {
export async function uploadExamProgressData(params: UploadExamProgressDataParams) {
const singlePlay = globalThis.singlePlay
const { carId, examinationRoomId, type, time, cardNo, examData, examStartTime, examEndTime } = params
if (singlePlay) {
return
}
return tempRequest({
return request({
url: '/der2/services/exam/uploadExamDataFile.ws',
data: `<?xml version="1.0" encoding="UTF-8"?>
<uploadExamDataFileReq>
@ -159,9 +157,19 @@ export async function uploadExamProgressData(params:uploadExamProgressDataParams
})
}
export async function uploadExamProgressData2(params) {
interface UploadExamProgressDataParams2 {
carId: string
examinationRoomId: string
type: string
time: string
cardNo: string
examData: string
examStartTime: string
examEndTime: string
}
export async function uploadExamProgressData2(params: UploadExamProgressDataParams2) {
const singlePlay = globalThis.singlePlay
const { carId, examinationRoomId, type, time, cardNo, examData, examStartTime, examEndTime } = params
if (singlePlay) {
return
}
@ -169,15 +177,15 @@ export async function uploadExamProgressData2(params) {
url: '/der2/services/exam/uploadExamDataFile.ws',
data: `<?xml version="1.0" encoding="UTF-8"?>
<uploadExamDataFileReq>
<head><time>${time}</time></head>
<head><time>${params.time}</time></head>
<body>
<carId>${carId}</carId>
<examinationRoomId>${examinationRoomId}</examinationRoomId>
<examData>${examData}</examData>
<type>${type}</type>
<cardNo>${cardNo}</cardNo>
<examStartTime>${examStartTime}</examStartTime>
<examEndTime>${examEndTime}</examEndTime>
<carId>${params.carId}</carId>
<examinationRoomId>${params.examinationRoomId}</examinationRoomId>
<examData>${params.examData}</examData>
<type>${params.type}</type>
<cardNo>${params.cardNo}</cardNo>
<examStartTime>${params.examStartTime}</examStartTime>
<examEndTime>${params.examEndTime}</examEndTime>
</body>
</uploadExamDataFileReq>`,
method: http.RequestMethod.POST,
@ -185,8 +193,15 @@ export async function uploadExamProgressData2(params) {
})
}
interface UploadExamMileage {
carId: string
examinationRoomId: string
lsh: string
kslc: string
}
// 上传考试里程
export async function uploadExamMileage(params) {
export async function uploadExamMileage(params: UploadExamMileage) {
const singlePlay = globalThis.singlePlay
if (singlePlay) {
return
@ -233,16 +248,17 @@ export async function uploadExamGrade(params) {
}
function validateIP(path: string) {
const reg = new RegExp(/(\w+):\/\/([^/:]+)(:\d*)?/)
const reg = new RegExp(`(\w+):\/\/([^/:]+)(:\d*)?`)
const result = path.match(reg);
return result[0]
}
// 上传运行时常
export async function uploadHarmonyLiCheng(data) {
export async function uploadHarmonyLiCheng(data: object) {
return request<object>({
url: '/der2/services/data/harmonyLiCheng.ws',
data,
method: http.RequestMethod.POST,
xml: false
})
}

View File

@ -1,11 +1,12 @@
import { getSyncData } from '../common/service/initable';
import request from "../common/utils/request"
let baseHost = globalThis.host;
import request from "../utils/Request"
import FileUtil from '../common/utils/File';
import FileLog from '../pages/judgeSDK/utils/fileLog';
import http from '@ohos.net.http';
//监管接口序列号映射
const gjxlhObj = {
const gjxlhObj: Record<string, string> = {
'17C51': '02-21-000009',
'17C52': '02-21-000010',
'17C53': '02-21-000011',
@ -14,33 +15,39 @@ const gjxlhObj = {
'17C56': '02-21-000014',
}
interface WR{
message?:string
code:number
interface WR {
message?: string
code: number
}
export default async function writeObjectOutNew(data,filePath): Promise<WR> {
export default async function writeObjectOutNew(data, filePath): Promise<WR> {
const fileUtil = new FileUtil(globalThis.context);
const {jkid , drvexam} = data;
const { jkid, drvexam } = data;
const basic = await getBasicConfig(jkid);
const params = await getParams(jkid, drvexam);
const {wglb,jkxlh,glbm,jgbh,sjbs} = basic;
const { wglb, jkxlh, glbm, jgbh, sjbs } = basic;
if(filePath){
await fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`,JSON.stringify({
wglb,jkxlh,glbm,jgbh,sjbs,
data:params.data,
file:{...params.file,param:[]},
if (filePath) {
await fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`, JSON.stringify({
wglb,
jkxlh,
glbm,
jgbh,
sjbs,
data: params.data,
file: {
...params.file, param: []
},
}));
}
// let connectTimeout = sjbs === '02-21-000014' ?60000:1
console.info('surenjun','调用新监管')
let temp
console.info('surenjun', '调用新监管')
let temp: WR
try {
temp = await request({
host: globalThis.JGHOST,
method: 'post',
temp = await request<WR>({
host: globalThis.JGHOST as string,
method: http.RequestMethod.POST,
//是否是新中心
isNewCenter: true,
xml: true,
@ -69,11 +76,10 @@ export default async function writeObjectOutNew(data,filePath): Promise<WR> {
temp = e
}
console.log("temp message: ", JSON.stringify(temp))
if(filePath){
await fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`,JSON.stringify(temp) +`\n`);
if (filePath) {
await fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`, JSON.stringify(temp) + `\n`);
}
return temp
}
export async function getParams(jkid, drvexam) {

View File

@ -1,10 +1,18 @@
import request from "../common/utils/request"
import request from "../utils/Request"
import http from "@ohos.net.http"
export async function examinerLogin(params){
return request({
url:'/der2/services/exam/examinerLogin.ws',
data:`<?xml version="1.0" encoding="UTF-8" ?>
interface ExaminerLoginParams {
carId
examinationRoomId
username
password
}
export async function examinerLogin(params: ExaminerLoginParams) {
return request({
url: '/der2/services/exam/examinerLogin.ws',
data: `<?xml version="1.0" encoding="UTF-8" ?>
<examinerLoginReq>
<body>
<carId>${params.carId}</carId>
@ -13,7 +21,7 @@ export async function examinerLogin(params){
<examinerPwd>${params.password}</examinerPwd>
</body>
</examinerLoginReq>`,
method:'post',
xml:true,
})
method: http.RequestMethod.POST,
xml: true,
})
}

View File

@ -1,31 +0,0 @@
// @ts-ignore
/* eslint-disable */
import request from '../common/utils/http';
/** 2.考试中心执行参数同步 由外部(考试平台)调用,主动请求参数平台同步基础数据 GET /system/doParamBaseDataSync */
export async function doParamBaseDataSyncUsingGet(options?: { [key: string]: any }) {
return request<API.ROfobject>('/system/doParamBaseDataSync', {
method: 'GET',
...(options || {}),
});
}
/** 3.考试中心执行参数数据同步 由外部(考试平台)调用,主动请求参数平台同步参数数据 GET /system/doParamConfigDataSync */
export async function doParamConfigDataSyncUsingGet(options?: { [key: string]: any }) {
return request<API.ROfobject>('/system/doParamConfigDataSync', {
method: 'GET',
...(options || {}),
});
}
/** 1.用户登录 用户登录接口获取用户相关信息和登录Token登录后调用后台接口时将Token放到请求头中 POST /system/userLogin.do */
export async function userLoginUsingPost(body: API.Pinyin_21, options?: { [key: string]: any }) {
return request<API.ROfobject>('/system/userLogin.do', {
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=UTF-8',
},
data: body,
...(options || {}),
});
}

View File

@ -1,964 +0,0 @@
declare namespace API {
type CarBrand_ = {
/** 品牌名 {type_name} */
brandName?: string;
/** 创建者 */
createBy?: string;
/** 创建时间 */
createTime?: string;
/** 百米脉冲 */
hundredMeterPulse?: string;
/** 主键 */
id?: number;
/** 签到序号起始点 */
signNumber?: number;
/** SIMPLE_NAME */
simpleName?: string;
/** 更新者 */
updateBy?: string;
/** 更新时间 */
updateTime?: string;
};
type CarInfo_ = {
/** 监管分车时间 */
assignTime?: string;
/** 车辆品牌id [car_brand.id] {cartypeid} */
carBrandId?: number;
/** 考车自检状态0不用检查1待检查2检查通过3检查不通过 */
carCheckStatus?: string;
/** 考车实际IP {carip} */
carIp?: string;
/** 考车对应mac地址 */
carMac?: string;
/** 考车编号 {carno} */
carNo?: string;
/** 考车身份证号 */
cardNoArray?: string;
/** 创建者 */
createBy?: string;
/** 创建时间 */
createTime?: string;
/** 删除标记0存在2已经删除status */
delFlag?: string;
/** 考点id [sys_dept.dept_id] {exampointid} */
deptId?: number;
/** 设备号 */
deviceNo?: string;
/** 考车状态1正常2停用3异常 */
deviceStatus?: string;
/** 准驾车型 {cartype} */
drivingLicenseType?: string;
/** 终点库位号 {zdkwh} */
endPointNo?: string;
/** 考车路线 */
examLineArray?: string;
/** 所属考官对应的用户id [sys_user.user_id] */
examManId?: number;
/** 考试场次 {kscc} */
examRound?: number;
/** 当前登录随车考试员id [examiner_info.id] */
examinerId?: number;
/** 考场区域代号 */
fieldId?: string;
/** 百米脉冲 */
hundredMeterPulse?: string;
/** 主键 */
id?: number;
/** 监控审核人脸识别方式0无人脸识别1视频截图方式2考车上传方式 {isface} */
isFace?: string;
/** 是否更新map_collect 01 {is_mapcollect} */
isMapCollect?: string;
/** 是否需要审核01 */
isReview?: string;
/** 上一次登录随车考试员 [examiner_info.id] */
lastExaminerId?: number;
/** 考车号牌 {carcode} */
licensePlate?: string;
/** 模型id [model_info.id] {modelid} */
modelId?: number;
/** 导航线路 {dhxl} */
navigationLine?: string;
/** 考车对应软件版本 */
softwareVersion?: string;
/** 更新者 */
updateBy?: string;
/** 更新时间 */
updateTime?: string;
/** 车辆型号 */
vehicleModel?: string;
/** 考车对应车辆识别代号 */
vin?: string;
/** 考试路线 */
wayNo?: number;
};
type ExamInfoVo = {
bk1?: string;
bz1?: string;
cartype?: string;
czlx?: string;
fieldid?: string;
flag?: string;
fz?: string;
jdxx?: string;
jxmc?: string;
kchp?: string;
kfxm?: string;
kscc?: string;
kscx?: string;
ksdd?: string;
kskm?: string;
kslx?: string;
ksmjzp?: string;
kssycs?: string;
ksxl?: string;
ksy1?: string;
ksy1sfzmhm?: string;
ksy2?: string;
ksy2sfzmhm?: string;
kszp?: string;
kszt?: string;
ktbh?: string;
lsh?: string;
motorType?: string;
roadway?: string;
securityGuard?: string;
sfcode?: string;
sfzmhm?: string;
updatetime?: string;
xb?: string;
xh?: string;
xldm?: string;
xm?: string;
ykrq?: string;
yycs?: string;
zkzmbh?: string;
zwxx1?: string;
zwxx2?: string;
zwxx3?: string;
zwxx4?: string;
};
type ExamPointInfo_ = {
/** 考场地址 {address} */
address?: string;
/** 考场车辆类型1小车2大车3摩托{is_motor} */
carType?: string;
/** 创建者 */
createBy?: string;
/** 创建时间 */
createTime?: string;
/** 所属部门id [sys_dept.dept_id] {organize_id} */
deptId?: number;
/** 考点名称 {name} */
deptName?: string;
/** 准驾车型(列表,逗号隔开) {car_type} */
drivingLicenseType?: string;
/** 考点代码 {code} */
examPointCode?: string;
/** 考点全称 {fullname} */
fullName?: string;
/** 主键 */
id?: number;
/** 联系人 {contact} */
master?: string;
/** 联系电话 {phone} */
phone?: string;
/** 电子地图映射信息json */
photoInfo?: string;
/** 电子地图图片路径 {path} */
photoPath?: string;
/** 备注 */
remark?: string;
/** 考试科目 {type} */
subjectType?: string;
/** 更新者 */
updateBy?: string;
/** 更新时间 */
updateTime?: string;
};
type GpsIPUdpIP_ = {
/** 车辆品牌名称 */
carBrandName?: string;
/** 准驾车型C1、C2... */
drivingLicenseType?: string;
/** GPS差分服务器地址 */
gpsAddress?: string;
/** 是否需要自检0不需要自检1需要自检 */
isNeedCheck?: string;
/** 百米脉冲 */
pulse?: string;
/** 考试科目 */
subjectType?: string;
/** UDP服务器数据端口号 */
udpDataPort?: string;
/** UDP服务器ip */
udpIp?: string;
/** UDP服务器消息端口号 */
udpMessagePort?: string;
/** 语音对讲服务ip */
voiceIp?: string;
/** 语音对讲服务端口号 */
voicePort?: string;
};
type GpsIPUdpIP2 = {
/** 车牌号 */
licensePlate: string;
/** 评判版本号 */
softwareVersion: string;
};
type MarkRuleSet = {
itemName?: string;
itemno?: string;
kfxh?: string;
markcatalog?: string;
markdepend?: string;
markreal?: string;
markserial?: string;
markshow?: string;
markstandard?: string;
};
type paramConfigDataSyncUsingGETParams = {
/** tableName */
tableName: string;
};
type Pinyin__ = {
/** 车牌号 */
licensePlate: string;
/** 考试里程{kslc} */
mileage: number;
/** 流水号 */
serialNo: string;
/** 特殊扣分内容 */
specialSub?: string;
};
type Pinyin_10 = {
/** 考车id */
gunCameraInfos?: Pinyin_9[];
};
type Pinyin_11 = {
/** 小红球程序编号 */
deviceNo: string;
/** 小红球消息 */
message: string;
};
type Pinyin_12 = {
kaoShengXinXi?: ExamInfoVo[];
};
type Pinyin_13 = {
b2no?: string;
c1no?: string;
c2no?: string;
c5no?: string;
deviceNo?: string;
fieldId?: string;
kscc?: string;
};
type Pinyin_14 = {
judgeVersion?: string;
kdid?: string;
kskm?: string;
markRuleSet?: MarkRuleSet[];
shellVersion?: string;
speendParam?: string;
vehicleSpeend?: VehicleSpeend[];
};
type Pinyin_15 = {
/** 小红球程序编号 */
deviceNo: string;
};
type Pinyin_16 = {
aqyphoto?: string;
aqysfzmhm?: string;
aqyxm?: string;
bkhgkssj?: string;
jxmc?: string;
kch?: string;
kchp?: string;
kclx?: string;
kcmc?: string;
kscs?: string;
kscx?: string;
ksxl?: string;
ksyphoto?: string;
ksysfzmhm?: string;
ksyxm?: string;
lsh?: string;
sfzmhm?: string;
xm?: string;
yycs?: string;
zp1?: string;
zp2?: string;
zwh?: string;
};
type Pinyin_17 = {
/** 考车编号 */
carNo: string;
/** 小红球程序编号 */
deviceNo: string;
/** 流水号 */
serialNo: string;
};
type Pinyin_18 = {
/** 随车考试员编号 */
examinerCode?: string;
/** 车牌号 */
licensePlate: string;
/** 流水号 */
serialNo: string;
};
type Pinyin_19 = {
/** 安徽已考项目 */
ahykxx?: string;
/** 大车初考项目 */
firstABykxx?: string;
/** 考试剩余次数 */
kssycs?: string;
/** 考试预约流水号 */
lsh?: string;
/** 摩托车考试模式 */
motorType?: string;
/** 大车补考项目 */
secondABykxx?: string;
/** 约考信息,内容如:开始时间;里程;考试项目;扣分项目;特殊地方扣分明细 */
ykxx?: string;
};
type Pinyin_2 = {
/** 文件base64 */
examData: string;
/** 考试结束时间 */
examEndTime: string;
/** 考试开始时间 */
examStartTime: string;
/** 文件名称type=2/3时需要传 */
fileName?: string;
/** 车牌号 */
licensePlate: string;
/** 流水号 */
serialNo: string;
/** 文件类型鸿蒙考车固定传10本地轨迹1监管轨迹2轨迹回放3注意力识别 */
type: string;
};
type Pinyin_20 = {
/** 考车请求时间跟下面请求数据data中的业务发生时间相同这里用作设备时差校验 */
carSendTime: string;
/** 请求数据详见无锡所接口文档。JSON对象 */
data: Record<string, any>;
/** 文件列表 */
files?: WxsBaseFileBean[];
/** 车牌号 */
licensePlate: string;
/** 接口编号例如02-21-000009考试开始 */
restCode: string;
};
type Pinyin_21 = {
/** 设备imei号 */
imei: string;
/** 用户登录时间戳 */
loginTime: number;
/** md5加密串(根据imei号+时间戳+盐混淆) */
signKey: string;
};
type Pinyin_22 = {
/** 中心服务器当前时间 */
time?: string;
};
type Pinyin_23 = {
/** 设备名称 */
deviceName: string;
/** 设备编号 */
deviceNo: string;
/** 设备类型1考车2闸机3大屏4指纹仪5拍照 */
type: string;
};
type Pinyin_24 = {
/** 考试项目 */
bk1?: string;
/** 备注1 0,0, */
bz1?: string;
/** 考试车型考生表的carType */
cartype?: string;
/** 操作类型 */
czlx?: string;
/** 考试区域 */
fieldid?: string;
/** 考试是否合格 */
flag?: string;
/** 考试分组 */
fz?: string;
/** 阶段信息 */
jdxx?: string;
/** 驾校名称 */
jxmc?: string;
/** 考车号牌 */
kchp?: string;
/** 扣分项目 */
kfxm?: string;
/** 考试场次 */
kscc?: string;
/** 考试车型 */
kscx?: string;
/** 考试地点,考场编号 */
ksdd?: string;
/** 考试科目 */
kskm?: string;
/** 考试类型 */
kslx?: string;
/** ksmjzp */
ksmjzp?: string;
/** 考试剩余次数 */
kssycs?: string;
/** 考试线路-实用 */
ksxl?: string;
/** 考试员姓名1 */
ksy1?: string;
/** 考试员1身份证号 */
ksy1sfzmhm?: string;
/** 考试员随车考试员2 */
ksy2?: string;
/** 考试员2身份证号 */
ksy2sfzmhm?: string;
/** 考生照片base64编码 */
kszp?: string;
/** 考试状态 */
kszt?: string;
/** 考台编号 */
ktbh?: string;
/** 考试预约流水号 */
lsh?: string;
/** 摩托车考试模式 1.先考科目2再考科目3 2.科目2 3.科目3 4.先考科目3再考科目2 */
motorType?: string;
/** 车道 */
roadway?: string;
/** 安全员姓名 */
securityGuard?: string;
/** 6位身份编码 */
sfcode?: string;
/** 身份证号 */
sfzmhm?: string;
/** 上车更新时间 */
updatetime?: string;
/** 考生性别 */
xb?: string;
/** 序号 */
xh?: string;
/** 监管线路代码,上传用 */
xldm?: string;
/** 考生姓名 */
xm?: string;
/** 约考日期 */
ykrq?: string;
/** 预约次数 */
yycs?: string;
/** 准考证明编号admissionNo */
zkzmbh?: string;
/** 指纹1 */
zwxx1?: string;
/** 指纹2 */
zwxx2?: string;
/** 指纹3 */
zwxx3?: string;
/** 指纹4 */
zwxx4?: string;
};
type Pinyin_25 = {
/** 设备号 */
deviceNo: string;
/** 照片1 */
firstImage: string;
/** 照片2 */
secondImage: string;
/** 身份证号码 */
sfzh: string;
};
type Pinyin_26 = {
/** 车牌号 */
licensePlate: string;
/** 流水号 */
serialNo: string;
};
type Pinyin_27 = {
/** 类别1外壳2视屏3评判4接口 */
category: string;
/** 车牌号 */
licensePlate: string;
/** 日志内容 */
logData: string;
/** 考车日志类型1升级日2错误日志 */
logType: string;
/** 考车发生时间格式yyyy-MM-dd HH:mm:ss */
vehicleTime: string;
};
type Pinyin_28 = {
/** 设备编号 */
deviceNo: string;
};
type Pinyin_29 = {
/** 自检结果附带信息 */
condition: string;
/** 自检结果1合格0不合格 */
flag: string;
/** 车牌号 */
licensePlate: string;
};
type Pinyin_3 = {
/** 车牌号 */
licensePlate: string;
};
type Pinyin_30 = {
/** 考车编号 */
carNo?: string;
/** 车辆类型 */
carType?: string;
/** 身份证号 */
cardNo?: string;
/** 设备编号 */
deviceNo?: string;
faceVerifyRes?: string;
/** fieldId */
fieldId?: string;
fingerVerifyRes?: string;
/** 体温是否正常标志 */
health?: string;
/** 6位身份编码 */
idNoSix?: string;
/** 考官证件号码 */
kgCardNo?: string;
/** 人工过门禁原因 */
manualReason?: string;
/** mixModel */
mixModel?: string;
/** 人脸识别度 */
rlsbValue?: string;
/** 流水号 */
serialNo?: string;
sfzzp?: string;
/** 考试科目 */
subjectType?: string;
/** 体温值 */
temperature?: string;
/** 体温照片1 */
twzp1?: string;
/** 体温照片2 */
twzp2?: string;
/** 照片 */
zp?: string;
zw1?: string;
zw2?: string;
zw3?: string;
zw4?: string;
};
type Pinyin_31 = {
/** 模型内容base64 */
content: string;
/** 文件名 */
filename: string;
};
type Pinyin_32 = {
/** 车牌号 */
licensePlate: string;
};
type Pinyin_33 = {
/** 车牌号码 */
licensePlate: string;
};
type Pinyin_34 = {
/** 车牌号 */
licensePlate: string;
};
type Pinyin_35 = {
/** 是否需要自检0不需要自检1需要自检 */
isNeedCheck?: string;
/** 自检项目 */
items?: string;
/** 串口号 */
portNo?: string;
/** 重试次数 */
retryTime?: string;
/** 1取反0不取反例如安全带取反且离合器不取反即1^0 */
reverse?: string;
};
type Pinyin_36 = {
/** 住址 */
addr?: string;
/** 设备编号 */
deviceNo?: string;
/** fieldId */
fieldId?: string;
/** 考官证件号码 */
kgsfzmhm?: string;
/** 考试科目 */
kskm?: string;
/** 流水号 */
lsh?: string;
/** mixModel */
mixModel?: string;
/** 身份证号 */
sfzh: string;
/** 姓名 */
xm?: string;
};
type Pinyin_37 = {
/** 设备号 */
deviceNo?: string;
/** 照片1 */
firstImage?: string;
/** 考试科目 */
kskm?: string;
/** 认证次数 */
rzcs?: string;
/** 照片2 */
secondImage: string;
/** 身份证号码 */
sfzh: string;
/** 设备类型(1、门禁2、考车3、过程) */
type: string;
/** 审核类型(2、人工审核) */
verifyType?: string;
};
type Pinyin_38 = {
/** 设备硬件号 */
deviceNo: string;
/** 门禁程序版本号 */
gateVersion: string;
};
type Pinyin_39 = {
/** 随车考试员登录用户名(可以是身份证号、员工号、制卡号等等) */
examinerName: string;
/** 随车考试员密码 */
examinerPwd?: string;
/** 车牌号 */
licensePlate: string;
};
type Pinyin_4 = {
/** 考生信息列表 */
studentList?: Pinyin_24[];
};
type Pinyin_40 = {
/** 指纹信息1 */
finger1?: string;
/** 指纹信息2 */
finger2?: string;
/** 随车考试员姓名 */
name?: string;
};
type Pinyin_5 = {
/** 车牌号码 */
licensePlate: string;
/** 表名,大写 */
tableName: string;
};
type Pinyin_6 = {
/** car_mac */
car_mac: string;
/** 设备类型1海康2大华 */
equipment_type: string;
/** 第一路通道 */
first_channel: string;
/** 第一路ip */
first_ip: string;
/** 第一路密码 */
first_password: string;
/** 第一路端口 */
first_port: string;
/** 第一路用户名 */
first_username: string;
/** 第四路通道 */
fourth_channel: string;
/** 第四路ip */
fourth_ip: string;
/** 第四路密码 */
fourth_password: string;
/** 第四路端口 */
fourth_port: string;
/** 第四路用户名 */
fourth_username: string;
/** 连接类型0主码流TCP方式1子码流TCP方式2主码流UDP方式3子码流UDP方式 */
line_type: string;
/** 拍照通道 */
photo_channel: string;
/** 叠加内容11.考生姓名身份证号3.当前项目4.当前时间) */
photo_overlay_text_content1: string;
/** 叠加内容21.考生姓名身份证号3.当前项目4.当前时间0 */
photo_overlay_text_content2: string;
/** 叠加内容31.考生姓名身份证号3.当前项目4.当前时间0 */
photo_overlay_text_content3: string;
/** 照片叠加文字1启用0关闭 */
photo_overlay_text_enable: string;
/** 位置1左上角2右上角3左下角4.右下角) */
photo_overlay_text_position: string;
/** 文字大小 */
photo_overlay_text_size: string;
/** 分割符1/2*\3换行 */
photo_overlay_text_split: string;
/** 启用过程人脸比对 {process_face_comparion_enable} */
process_face_comparion_enable: string;
/** 过程人脸比对模式1启用0关闭 {process_face_comparion_mode} */
process_face_comparion_mode: string;
/** 第二路通道 */
second_channel: string;
/** 第二路ip */
second_ip: string;
/** 第二路密码 */
second_password: string;
/** 第二路端口 */
second_port: string;
/** 第二路用户名 */
second_username: string;
/** 第三路通道 */
third_channel: string;
/** 第三路ip */
third_ip: string;
/** 第三路密码 */
third_password: string;
/** 第三路端口 */
third_port: string;
/** 第三路用户名 */
third_username: string;
/** 视频路数 */
video_channel: string;
/** 录像方式0本地录像1本地不录象 */
video_mode: string;
/** 视频遮挡 */
video_occlusion: string;
/** 视频遮挡范围1一路2二路3三路4四路 */
video_occlusion_range: string;
/** 视频叠加位置X */
video_overlay_position_x: string;
/** 视频叠加位置Y */
video_overlay_position_y: string;
/** 视频叠加内容11考生姓名2身份证号3当前项目4当前时间 */
video_overlay_text_content1: string;
/** 视频叠加内容21考生姓名2身份证号3当前项目4当前时间0 */
video_overlay_text_content2: string;
/** 视频叠加内容31考生姓名2身份证号3当前项目4当前时间0 */
video_overlay_text_content3: string;
/** 视频叠加文字1启用0关闭 */
video_overlay_text_enable: string;
/** 视频叠加分割符1/2*\3换行 */
video_overlay_text_split: string;
/** 录像范围1一路2二路3三路4四路 */
video_range: string;
/** 本考车对应视频合成服务器IP填错将不能开始考试 */
video_synthesis_server_ip: string;
/** 本考车对应视频合成服务器端口(填错将不能开始考试) */
video_synthesis_server_port: string;
/** 本考车对应视频合成信息处理系统IP填错或不填将可能导致录像丢失 */
video_synthesis_system_ip: string;
/** 本考车对应视频合成信息处理系统本地响应端口(填错或不填将可能导致录像丢失) */
video_synthesis_system_port: string;
};
type Pinyin_7 = {
/** 车牌号 */
licensePlate: string;
};
type Pinyin_8 = {
/** 车辆品牌列表 */
carBrandList?: CarBrand_[];
/** 考车列表 */
carInfoList?: CarInfo_[];
/** 考点列表 */
examPointInfoList?: ExamPointInfo_[];
};
type Pinyin_9 = {
/** 摄像头通道号 */
channel?: string;
/** 硬盘录像机ip */
deviceIP?: string;
/** 监管场地编号 */
equipmentId?: string;
/** 非全景绑定的全景 */
fullId?: string;
/** 全景区域坐标 */
gpsArea?: string;
/** 摄像头id */
id?: string;
/** 是否全景摄像头 */
isFull?: string;
/** 硬盘录像机密码 */
password?: string;
/** 硬盘录像机端口 */
port?: string;
/** 硬盘录像机用户名 */
user?: string;
};
type ROf_ = {
/** 状态码 1成功 0通用失败 */
code: number;
data?: Pinyin_4;
/** 返回消息 */
msg: string;
};
type ROf10 = {
/** 状态码 1成功 0通用失败 */
code: number;
data?: Pinyin_31;
/** 返回消息 */
msg: string;
};
type ROf11 = {
/** 状态码 1成功 0通用失败 */
code: number;
data?: Pinyin_35;
/** 返回消息 */
msg: string;
};
type ROf12 = {
/** 状态码 1成功 0通用失败 */
code: number;
data?: Pinyin_40;
/** 返回消息 */
msg: string;
};
type ROf2 = {
/** 状态码 1成功 0通用失败 */
code: number;
data?: Pinyin_6;
/** 返回消息 */
msg: string;
};
type ROf3 = {
/** 状态码 1成功 0通用失败 */
code: number;
data?: Pinyin_8;
/** 返回消息 */
msg: string;
};
type ROf4 = {
/** 状态码 1成功 0通用失败 */
code: number;
data?: Pinyin_10;
/** 返回消息 */
msg: string;
};
type ROf5 = {
/** 状态码 1成功 0通用失败 */
code: number;
data?: Pinyin_12;
/** 返回消息 */
msg: string;
};
type ROf6 = {
/** 状态码 1成功 0通用失败 */
code: number;
data?: Pinyin_14;
/** 返回消息 */
msg: string;
};
type ROf7 = {
/** 状态码 1成功 0通用失败 */
code: number;
data?: Pinyin_16;
/** 返回消息 */
msg: string;
};
type ROf8 = {
/** 状态码 1成功 0通用失败 */
code: number;
data?: Pinyin_19;
/** 返回消息 */
msg: string;
};
type ROf9 = {
/** 状态码 1成功 0通用失败 */
code: number;
data?: Pinyin_22;
/** 返回消息 */
msg: string;
};
type ROfGpsIPUdpIP_ = {
/** 状态码 1成功 0通用失败 */
code: number;
data?: GpsIPUdpIP_;
/** 返回消息 */
msg: string;
};
type ROfListOfobject = {
/** 状态码 1成功 0通用失败 */
code: number;
/** 承载数据 */
data?: Record<string, any>[];
/** 返回消息 */
msg: string;
};
type ROfobject = {
/** 状态码 1成功 0通用失败 */
code: number;
/** 承载数据 */
data?: Record<string, any>;
/** 返回消息 */
msg: string;
};
type VehicleSpeend = {
carType?: string;
speend?: string;
};
type WxsBaseFileBean = {
/** 文件内容base64编码 */
data: string;
/** 文件类别或id */
fileid: string;
};
}

View File

@ -1,5 +1,6 @@
import request from "../common/utils/request"
import request from "../utils/Request"
import tempRequest from '../common/utils/tempRequest'
import http from "@ohos.net.http"
/**
* 照片比对
@ -11,8 +12,16 @@ import tempRequest from '../common/utils/tempRequest'
* @param verifyType 不传或者传1为标准传2为人工审核
*/
export async function faceCompare(params) {
return request({
interface FaceCompareParams {
sfzh: string
firstImage: string
secondImage: string
type: string
verifyType: string
}
export async function faceCompare(params: FaceCompareParams) {
return request<object>({
url: '/der2/services/imageCompare/base64ImageStrCompare.ws',
data: `<?xml version="1.0" encoding="UTF-8" ?>
<imageCompareReq>
@ -24,33 +33,40 @@ export async function faceCompare(params) {
<verifyType>${params.verifyType}</verifyType>
</body>
</imageCompareReq>`,
method: 'post',
method: http.RequestMethod.POST,
xml: true
})
}
export async function getExaminationStudentInfo(params) {
return tempRequest({
export async function getExaminationStudentInfo(params: object) {
return request({
url: '/der2/services/exam/getExaminationStudentInfo.ws',
data: params,
method: 'post',
method: http.RequestMethod.POST,
xml: true
})
}
//缺考
export async function examinationStuAbsent(params) {
export async function examinationStuAbsent(params: object) {
return request({
url: '/der2/services/exam/examinationStuAbsent.ws',
data: params,
method: 'post',
method: http.RequestMethod.POST,
xml: true
})
}
interface GetExaminationItemParams {
time: string
carId: string
examinationRoomId: string
lsh: string
}
//获取断点续考
export async function getExaminationItem(params) {
export async function getExaminationItem(params: GetExaminationItemParams) {
return request({
url: '/der2/services/exam/getExaminationItem.ws',
data: `<getExaminationItemReq>
@ -63,17 +79,24 @@ export async function getExaminationItem(params) {
<lsh>${params.lsh}</lsh>
</body>
</getExaminationItemReq>`,
method: 'post',
method: http.RequestMethod.POST,
xml: true
})
}
interface GetPhotosForOtherParams {
time: string
sfzmhm: string
zptype: string
ksrq: string
}
//参数下发读表接口
export async function getPhotosForOther(params) {
export async function getPhotosForOther(params: GetPhotosForOtherParams) {
return request({
url: '/der2/services/third/getPhotosForOther.ws',
data: `<?xml version="1.0" encoding="utf-8"?><getBmzpReq><head><time>${params.time}</time></head><body><sfzmhm>${params.sfzmhm}</sfzmhm><kskm>2</kskm><zptype>${params.zptype}</zptype><ksrq>${params.ksrq}</ksrq></body></getBmzpReq>`,
method: 'post',
method: http.RequestMethod.POST,
xml: true,
}
)
@ -84,7 +107,7 @@ export async function setVideoText() {
url: 'http://admin:12345qwe@192.168.36.94/PSIA/Custom/SelfExt/OSD/channels/2/textOverlay',
data: `<?xml version="1.0" encoding="UTF-8" ?>
<TextOverlayList><TextOverlay><id>1</id><enabled>true</enabled><positionX>0</positionX><positionY>0</positionY><displayText>1222</displayText></TextOverlay><TextOverlay><id>2</id><enabled>true</enabled><positionX>0</positionX><positionY>0</positionY><displayText>2222</displayText></TextOverlay><TextOverlay><id>3</id><enabled>false</enabled><positionX>0</positionX><positionY>0</positionY><displayText></displayText></TextOverlay><TextOverlay><id>4</id><enabled>false</enabled><positionX>0</positionX><positionY>0</positionY><displayText></displayText></TextOverlay><TextOverlay><id>5</id><enabled>false</enabled><positionX>0</positionX><positionY>0</positionY><displayText></displayText></TextOverlay><TextOverlay><id>6</id><enabled>false</enabled><positionX>0</positionX><positionY>0</positionY><displayText></displayText></TextOverlay><TextOverlay><id>7</id><enabled>false</enabled><positionX>0</positionX><positionY>0</positionY><displayText></displayText></TextOverlay><TextOverlay><id>8</id><enabled>false</enabled><positionX>0</positionX><positionY>0</positionY><displayText></displayText></TextOverlay></TextOverlayList>`,
method: 'put',
method: http.RequestMethod.PUT,
xml: true
})
}

View File

@ -108,7 +108,7 @@ function dealCenterCode(message: string, isNewCenter: boolean): CenterCodeResult
}
}
export default function Request<T>(options: RequestOption): Promise<T> {
export default function Request<T = object>(options: RequestOption): Promise<T> {
return new Promise((resolve, reject) => {
const instance = http.createHttp()
const baseURL = options.host || base