优化api
This commit is contained in:
parent
66cf9d1b5f
commit
58d44fbe45
@ -1,82 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '../common/utils/http';
|
||||
|
||||
/** 1.获取考车考点信息 获取考车gpsIP、udpIP、音视频端口等考车和考点参数配置 POST /para/initCarInfoCache.ws */
|
||||
export async function initCarInfoCacheUsingPost(
|
||||
body: API.GpsIPUdpIP2,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROfGpsIPUdpIP_>('/para/initCarInfoCache.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 3.初始化考车视频参数 初始化考车视频参数 POST /para/initCarParameter.ws */
|
||||
export async function initCarVideoParameterUsingPost(
|
||||
body: API.Pinyin_7,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROf2>('/para/initCarParameter.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 4.从参数平台获取参数 单个读表,读取其他 ma_ 开头的评判参数表 POST /para/initCenterCache.ws */
|
||||
export async function initCenterCacheFromParamUsingPost(
|
||||
body: API.Pinyin_5,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROfListOfobject>('/para/initCenterCache.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 2.初始化模型 初始化模型 POST /para/initEsModel.ws */
|
||||
export async function initModelUsingPost(body: API.Pinyin_32, options?: { [key: string]: any }) {
|
||||
return request<API.ROf10>('/para/initEsModel.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 5.参数平台基础数据同步 被请求的 GET /param/baseDataSync */
|
||||
export async function paramBaseDataSyncUsingGet(options?: { [key: string]: any }) {
|
||||
return request<API.ROf3>('/param/baseDataSync', {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 6.参数平台参数数据同步 被请求的 GET /param/configDataSync/${param0} */
|
||||
export async function paramConfigDataSyncUsingGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.paramConfigDataSyncUsingGETParams,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
const { tableName: param0, ...queryParams } = params;
|
||||
return request<API.ROfobject>(`/param/configDataSync/${param0}`, {
|
||||
method: 'GET',
|
||||
params: { ...queryParams },
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
61
entry/src/main/ets/api/checkCar.ets
Normal file
61
entry/src/main/ets/api/checkCar.ets
Normal file
@ -0,0 +1,61 @@
|
||||
import request from "../utils/Request"
|
||||
import http from "@ohos.net.http"
|
||||
|
||||
|
||||
export async function carConfigurationInfo(params: object) {
|
||||
return request<object>({
|
||||
url: '/der2/services/exam/carConfigurationInfo.ws',
|
||||
data: params,
|
||||
method: http.RequestMethod.POST,
|
||||
xml: false,
|
||||
})
|
||||
}
|
||||
|
||||
interface registrationDeviceNoParams {
|
||||
time: string
|
||||
deviceName: string
|
||||
type: string
|
||||
}
|
||||
|
||||
//设备注册
|
||||
export async function registrationDeviceNo(params: registrationDeviceNoParams) {
|
||||
return request<object>({
|
||||
url: '/der2/services/exam/registrationDeviceNo.ws',
|
||||
data: `<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<registrationDeviceNoReq>
|
||||
<head><time>${params.time}</time></head>
|
||||
<body><deviceNo>${params.deviceName}</deviceNo><deviceName>${params.deviceName}</deviceName><type>${params.type}</type></body>
|
||||
</registrationDeviceNoReq>`,
|
||||
method: http.RequestMethod.POST,
|
||||
xml: true
|
||||
})
|
||||
}
|
||||
|
||||
interface uploadExamCarCheckResultParams {
|
||||
time: string
|
||||
carId: string
|
||||
examinationRoomId: string
|
||||
plateNo: string
|
||||
flag: string
|
||||
condition: string
|
||||
}
|
||||
|
||||
//自检结果上传
|
||||
export async function uploadExamCarCheckResult(params: uploadExamCarCheckResultParams) {
|
||||
return request<object>({
|
||||
url: '/der2/services/exam/uploadExamCarCheckResult.ws',
|
||||
data: `<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<uploadExamCarCheckResultReq>
|
||||
<head><time>${params.time}</time></head>
|
||||
<body><carId>${params.carId}</carId><examinationRoomId>${params.examinationRoomId}</examinationRoomId><plateNo>${params.plateNo}</plateNo><flag>${params.flag}</flag> <condition>${params.condition}</condition></body>
|
||||
</uploadExamCarCheckResultReq>
|
||||
`,
|
||||
method: http.RequestMethod.POST,
|
||||
xml: true
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,45 +0,0 @@
|
||||
import request from "../common/utils/request"
|
||||
|
||||
|
||||
export async function carConfigurationInfo(params){
|
||||
return request({
|
||||
url:'/der2/services/exam/carConfigurationInfo.ws',
|
||||
data:params,
|
||||
method:'post',
|
||||
xml:false,
|
||||
})
|
||||
}
|
||||
|
||||
//设备注册
|
||||
export async function registrationDeviceNo(params){
|
||||
return request({
|
||||
url:'/der2/services/exam/registrationDeviceNo.ws',
|
||||
data:`<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<registrationDeviceNoReq>
|
||||
<head><time>${params.time}</time></head>
|
||||
<body><deviceNo>${params.deviceName}</deviceNo><deviceName>${params.deviceName}</deviceName><type>${params.type}</type></body>
|
||||
</registrationDeviceNoReq>`,
|
||||
method:'post',
|
||||
xml:true
|
||||
})
|
||||
}
|
||||
|
||||
//自检结果上传
|
||||
export async function uploadExamCarCheckResult(params){
|
||||
return request({
|
||||
url:'/der2/services/exam/uploadExamCarCheckResult.ws',
|
||||
data:`<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<uploadExamCarCheckResultReq>
|
||||
<head><time>${params.time}</time></head>
|
||||
<body><carId>${params.carId}</carId><examinationRoomId>${params.examinationRoomId}</examinationRoomId><plateNo>${params.plateNo}</plateNo><flag>${params.flag}</flag> <condition>${params.condition}</condition></body>
|
||||
</uploadExamCarCheckResultReq>
|
||||
`,
|
||||
method:'post',
|
||||
xml:true
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
import request from "../common/utils/request"
|
||||
import tempRequest from '../common/utils/tempRequest'
|
||||
|
||||
export async function timeSynchronization(params){
|
||||
return request({
|
||||
url:'/der2/services/exam/timeSynchronization.ws',
|
||||
data:`<timeSynchronizationReq>
|
||||
<head>
|
||||
<time>` + params.time + `</time>
|
||||
</head>
|
||||
</timeSynchronizationReq>`,
|
||||
method:'get',
|
||||
xml:true
|
||||
})
|
||||
}
|
||||
150
entry/src/main/ets/api/index.ets
Normal file
150
entry/src/main/ets/api/index.ets
Normal file
@ -0,0 +1,150 @@
|
||||
import request from "../utils/Request"
|
||||
import http from "@ohos.net.http"
|
||||
|
||||
interface timeSynchronizationParams {
|
||||
time: string
|
||||
deviceNo: string
|
||||
version: string
|
||||
judgeVersion: string
|
||||
}
|
||||
|
||||
//同步时间
|
||||
export async function timeSynchronization(params: timeSynchronizationParams) {
|
||||
return request<object>({
|
||||
url: '/der2/services/exam/timeSynchronization.ws',
|
||||
data: `<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<timeSynchronizationReq>
|
||||
<head><time>${params.time}</time></head>
|
||||
<body><deviceNo>${params.deviceNo}</deviceNo>
|
||||
<shellVersion>${params.version}</shellVersion>
|
||||
<judgeVersion>${params.judgeVersion}</judgeVersion>
|
||||
</body>
|
||||
</timeSynchronizationReq>`,
|
||||
method: http.RequestMethod.POST,
|
||||
xml: true
|
||||
})
|
||||
}
|
||||
|
||||
interface timeSynchronizationHTTPParams {
|
||||
time: string
|
||||
deviceNo: string
|
||||
version: string
|
||||
judgeVersion: string
|
||||
}
|
||||
|
||||
//同步时间
|
||||
export async function timeSynchronizationHTTP(params: timeSynchronizationHTTPParams) {
|
||||
return request<object>({
|
||||
url: '/der2/services/exam/timeSynchronization.ws',
|
||||
data: `<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<timeSynchronizationReq>
|
||||
<head><time>${params.time}</time></head>
|
||||
<body><deviceNo>${params.deviceNo}</deviceNo>
|
||||
<shellVersion>${params.version}</shellVersion>
|
||||
<judgeVersion>${params.judgeVersion}</judgeVersion>
|
||||
</body>
|
||||
</timeSynchronizationReq>`,
|
||||
method: http.RequestMethod.POST,
|
||||
xml: true
|
||||
})
|
||||
}
|
||||
|
||||
interface obtainCarExamInfoParams {
|
||||
time: string
|
||||
deviceNo: string
|
||||
}
|
||||
|
||||
//获取考车信息
|
||||
export async function obtainCarExamInfo(params: obtainCarExamInfoParams) {
|
||||
return request<object>({
|
||||
url: '/der2/services/exam/obtainCarExamInfo.ws',
|
||||
data: `<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<obtainCarExamInfoReq>
|
||||
<head><time>${params.time}</time></head>
|
||||
<body><deviceNo>${params.deviceNo}</deviceNo></body>
|
||||
</obtainCarExamInfoReq>`,
|
||||
method: http.RequestMethod.POST,
|
||||
xml: true
|
||||
})
|
||||
}
|
||||
|
||||
interface initCarInfoCacheParams {
|
||||
data: object
|
||||
host: string
|
||||
}
|
||||
|
||||
//获取参数平台考车信息
|
||||
export async function initCarInfoCache(params: initCarInfoCacheParams) {
|
||||
return request<object>({
|
||||
url: '/para/initCarInfoCache.ws',
|
||||
data: params.data,
|
||||
method: http.RequestMethod.POST,
|
||||
xml: false,
|
||||
host: params.host
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//参数下发读表接口
|
||||
export async function initCenterCache(params: object, url: string) {
|
||||
return await request<object>({
|
||||
url: '/para/initCenterCache.ws',
|
||||
data: params,
|
||||
method: http.RequestMethod.POST,
|
||||
xml: false,
|
||||
host: url || globalThis.timeInfo.url as string,
|
||||
})
|
||||
}
|
||||
|
||||
//参数下发读表接口
|
||||
export async function initCenterCacheByKSPT(params: object, url: string) {
|
||||
return await request<object>({
|
||||
url: '/der2/services/para/initCenterCache.ws',
|
||||
data: params,
|
||||
method: http.RequestMethod.POST,
|
||||
xml: false,
|
||||
host: url
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//从参数平台获取模型
|
||||
export async function initEsModel(params) {
|
||||
return await request<object>({
|
||||
url: '/para/initEsModel.ws',
|
||||
data: params,
|
||||
method: http.RequestMethod.POST,
|
||||
xml: false,
|
||||
host: globalThis.timeInfo.url as string,
|
||||
})
|
||||
}
|
||||
|
||||
interface initializationParams {
|
||||
carId: string
|
||||
examinationRoomId: string
|
||||
shellVersion: string
|
||||
judgeVersion: string
|
||||
videoVersion: string
|
||||
host: string
|
||||
}
|
||||
|
||||
export async function initialization(params: initializationParams) {
|
||||
return await request<object>({
|
||||
url: '/der2/services/exam/initialization.ws',
|
||||
data: `<?xml version="1.0" encoding="UTF-8" ?><initializationReq><body><carId>${params.carId}</carId><examinationRoomId>${params.examinationRoomId}</examinationRoomId><shellVersion>${params.shellVersion}</shellVersion><judgeVersion>${params.judgeVersion}</judgeVersion><videoVersion>${params.videoVersion}</videoVersion><carInfo></carInfo><map_Road></map_Road><map_Road_Lane></map_Road_Lane><map_SubItem></map_SubItem><t_CarParmSet></t_CarParmSet><map_ItemClass></map_ItemClass><map_Point></map_Point><map_Point_Item></map_Point_Item><CDSBINFO></CDSBINFO><MARKRULESET></MARKRULESET></body></initializationReq>`,
|
||||
method: http.RequestMethod.POST,
|
||||
host: params.host,
|
||||
xml: true,
|
||||
timeout: 1000 * 60
|
||||
})
|
||||
}
|
||||
|
||||
//参数下发读表接口
|
||||
export async function initCarParameter(params: object) {
|
||||
return await request<object>({
|
||||
url: '/der2/services/para/initCarParameter.ws',
|
||||
data: params,
|
||||
method: http.RequestMethod.POST,
|
||||
xml: false,
|
||||
})
|
||||
}
|
||||
@ -1,113 +0,0 @@
|
||||
import request from "../common/utils/request"
|
||||
import tempRequest from '../common/utils/tempRequest'
|
||||
|
||||
//同步时间
|
||||
export async function timeSynchronization(params){
|
||||
return request({
|
||||
url:'/der2/services/exam/timeSynchronization.ws',
|
||||
data:`<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<timeSynchronizationReq>
|
||||
<head><time>${params.time}</time></head>
|
||||
<body><deviceNo>${params.deviceNo}</deviceNo>
|
||||
<shellVersion>${params.version}</shellVersion>
|
||||
<judgeVersion>${params.judgeVersion}</judgeVersion>
|
||||
</body>
|
||||
</timeSynchronizationReq>`,
|
||||
method:'post',
|
||||
xml:true
|
||||
})
|
||||
}
|
||||
|
||||
//同步时间
|
||||
export async function timeSynchronizationHTTP(params){
|
||||
return tempRequest({
|
||||
url:'/der2/services/exam/timeSynchronization.ws',
|
||||
data:`<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<timeSynchronizationReq>
|
||||
<head><time>${params.time}</time></head>
|
||||
<body><deviceNo>${params.deviceNo}</deviceNo>
|
||||
<shellVersion>${params.version}</shellVersion>
|
||||
<judgeVersion>${params.judgeVersion}</judgeVersion>
|
||||
</body>
|
||||
</timeSynchronizationReq>`,
|
||||
method:'post',
|
||||
xml:true
|
||||
})
|
||||
}
|
||||
|
||||
//获取考车信息
|
||||
export async function obtainCarExamInfo(params){
|
||||
return request({
|
||||
url:'/der2/services/exam/obtainCarExamInfo.ws',
|
||||
data:`<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<obtainCarExamInfoReq>
|
||||
<head><time>${params.time}</time></head>
|
||||
<body><deviceNo>${params.deviceNo}</deviceNo></body>
|
||||
</obtainCarExamInfoReq>`,
|
||||
method:'post',
|
||||
xml:true
|
||||
})
|
||||
}
|
||||
//获取参数平台考车信息
|
||||
export async function initCarInfoCache(params){
|
||||
return request({
|
||||
url:'/para/initCarInfoCache.ws',
|
||||
data:params.data,
|
||||
method:'post',
|
||||
xml:false,
|
||||
host: params.host
|
||||
})
|
||||
}
|
||||
//参数下发读表接口
|
||||
export async function initCenterCache(params,url){
|
||||
return await request({
|
||||
url:'/para/initCenterCache.ws',
|
||||
data:params,
|
||||
method:'post',
|
||||
xml:false,
|
||||
host:url||globalThis.timeInfo.url,
|
||||
})
|
||||
}
|
||||
//参数下发读表接口
|
||||
export async function initCenterCacheByKSPT(params,url){
|
||||
return await request({
|
||||
url:'/der2/services/para/initCenterCache.ws',
|
||||
data:params,
|
||||
method:'post',
|
||||
xml:false,
|
||||
host:url
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//从参数平台获取模型
|
||||
export async function initEsModel(params){
|
||||
return await request({
|
||||
url:'/para/initEsModel.ws',
|
||||
data:params,
|
||||
method:'post',
|
||||
xml:false,
|
||||
host:globalThis.timeInfo.url,
|
||||
})
|
||||
}
|
||||
|
||||
export async function initialization(params){
|
||||
return await request({
|
||||
url:'/der2/services/exam/initialization.ws',
|
||||
data:`<?xml version="1.0" encoding="UTF-8" ?><initializationReq><body><carId>${params.carId}</carId><examinationRoomId>${params.examinationRoomId}</examinationRoomId><shellVersion>${params.shellVersion}</shellVersion><judgeVersion>${params.judgeVersion}</judgeVersion><videoVersion>${params.videoVersion}</videoVersion><carInfo></carInfo><map_Road></map_Road><map_Road_Lane></map_Road_Lane><map_SubItem></map_SubItem><t_CarParmSet></t_CarParmSet><map_ItemClass></map_ItemClass><map_Point></map_Point><map_Point_Item></map_Point_Item><CDSBINFO></CDSBINFO><MARKRULESET></MARKRULESET></body></initializationReq>`,
|
||||
method:'post',
|
||||
host:params.host,
|
||||
xml:true,
|
||||
timeout: 1000 * 60
|
||||
})
|
||||
}
|
||||
|
||||
//参数下发读表接口
|
||||
export async function initCarParameter(params){
|
||||
return await request({
|
||||
url:'/der2/services/para/initCarParameter.ws',
|
||||
data:params,
|
||||
method:'post',
|
||||
xml:false,
|
||||
})
|
||||
}
|
||||
@ -1,20 +1,21 @@
|
||||
import request from '../common/utils/request';
|
||||
import request from '../utils/Request';
|
||||
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;
|
||||
|
||||
|
||||
// 下载模型
|
||||
export async function download() {
|
||||
return request({
|
||||
host: baseHost,
|
||||
return request<object>({
|
||||
host: baseHost as string,
|
||||
url: '/para/initEsModel.ws',
|
||||
method: 'post',
|
||||
xml: false
|
||||
method: http.RequestMethod.POST,
|
||||
xml: false,
|
||||
})
|
||||
}
|
||||
|
||||
@ -64,17 +65,19 @@ export async function writeObjectOut(params, filePath?: string): Promise<WR> {
|
||||
.map((key: string) => (
|
||||
`<${key}>${drvexam[key]}</${key}>`));
|
||||
|
||||
console.log('surenjun filePath=>', filePath);
|
||||
if (filePath) {
|
||||
const fileUtil = new FileUtil(globalThis.context);
|
||||
await fileUtil.initFolder(filePath);
|
||||
fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`, JSON.stringify({
|
||||
xtlb, jkxlh, jkid, drvexam: { ...drvexam, zp: '' },
|
||||
xtlb,
|
||||
jkxlh,
|
||||
jkid,
|
||||
drvexam: { ...drvexam, zp: '' },
|
||||
}) + `\n`);
|
||||
}
|
||||
|
||||
//对象转换成xml
|
||||
const temp = await request({
|
||||
const temp = await request<object>({
|
||||
host: globalThis.JGHOST,
|
||||
url: '/dems_ws/services/TmriOutAccess?wsdl',
|
||||
data: `<?xml version="1.0"?>
|
||||
@ -101,7 +104,7 @@ export async function writeObjectOut(params, filePath?: string): Promise<WR> {
|
||||
</writeObjectOut>
|
||||
</SOAP-ENV:Body>
|
||||
</SOAP-ENV:Envelope>`,
|
||||
method: 'post',
|
||||
method: http.RequestMethod.POST,
|
||||
xml: true
|
||||
},)
|
||||
if (filePath) {
|
||||
@ -118,8 +121,19 @@ export async function writeObjectOut(params, filePath?: string): Promise<WR> {
|
||||
return temp
|
||||
}
|
||||
|
||||
interface uploadExamProgressDataParams{
|
||||
carId: string
|
||||
examinationRoomId: string
|
||||
type: string
|
||||
time: string
|
||||
cardNo: string
|
||||
examData: string
|
||||
examStartTime: string
|
||||
examEndTime: string
|
||||
}
|
||||
|
||||
// 过程文件上传
|
||||
export async function uploadExamProgressData(params) {
|
||||
export async function uploadExamProgressData(params:uploadExamProgressDataParams) {
|
||||
const singlePlay = globalThis.singlePlay
|
||||
const { carId, examinationRoomId, type, time, cardNo, examData, examStartTime, examEndTime } = params
|
||||
if (singlePlay) {
|
||||
@ -129,18 +143,18 @@ export async function uploadExamProgressData(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: 'post',
|
||||
method: http.RequestMethod.POST,
|
||||
xml: true
|
||||
})
|
||||
}
|
||||
@ -151,7 +165,7 @@ export async function uploadExamProgressData2(params) {
|
||||
if (singlePlay) {
|
||||
return
|
||||
}
|
||||
return request({
|
||||
return request<object>({
|
||||
url: '/der2/services/exam/uploadExamDataFile.ws',
|
||||
data: `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<uploadExamDataFileReq>
|
||||
@ -166,7 +180,7 @@ export async function uploadExamProgressData2(params) {
|
||||
<examEndTime>${examEndTime}</examEndTime>
|
||||
</body>
|
||||
</uploadExamDataFileReq>`,
|
||||
method: 'post',
|
||||
method: http.RequestMethod.POST,
|
||||
xml: true
|
||||
})
|
||||
}
|
||||
@ -178,7 +192,7 @@ export async function uploadExamMileage(params) {
|
||||
return
|
||||
}
|
||||
const time = await getCurrentTime()
|
||||
return request({
|
||||
return request<object>({
|
||||
url: '/der2/services/exam/uploadExamMileage.ws',
|
||||
data: `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<uploadExamMileageReq>
|
||||
@ -191,7 +205,7 @@ export async function uploadExamMileage(params) {
|
||||
<kslc>${params.kslc}<kslc>
|
||||
</body>
|
||||
</uploadExamMileageReq>`,
|
||||
method: 'post',
|
||||
method: http.RequestMethod.POST,
|
||||
xml: true
|
||||
})
|
||||
}
|
||||
@ -204,7 +218,7 @@ export async function uploadExamGrade(params) {
|
||||
}
|
||||
const paramsArrs = Reflect.ownKeys(params).map((key: string) => (`<${key}>${params[key]}</${key}>`))
|
||||
const time = await getCurrentTime()
|
||||
return request({
|
||||
return request<object>({
|
||||
url: '/der2/services/exam/uploadExamGrade.ws',
|
||||
data: `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<uploadExamGradeReq>
|
||||
@ -213,7 +227,7 @@ export async function uploadExamGrade(params) {
|
||||
${paramsArrs}
|
||||
</body>
|
||||
</uploadExamGradeReq>`,
|
||||
method: 'post',
|
||||
method: http.RequestMethod.POST,
|
||||
xml: true
|
||||
})
|
||||
}
|
||||
@ -226,9 +240,9 @@ function validateIP(path: string) {
|
||||
|
||||
// 上传运行时常
|
||||
export async function uploadHarmonyLiCheng(data) {
|
||||
return request({
|
||||
return request<object>({
|
||||
url: '/der2/services/data/harmonyLiCheng.ws',
|
||||
data,
|
||||
method: 'post',
|
||||
method: http.RequestMethod.POST,
|
||||
})
|
||||
}
|
||||
@ -1,116 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '../common/utils/http';
|
||||
|
||||
/** 4.考车自检项目信息读取 考车自检项目信息读取 POST /exam/carConfigurationInfo.ws */
|
||||
export async function carConfigurationInfoUsingPost(
|
||||
body: API.Pinyin_34,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROf11>('/exam/carConfigurationInfo.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 6.随车考试员登录 随车考试员登录 POST /exam/examinerLogin.ws */
|
||||
export async function examinerLoginUsingPost(
|
||||
body: API.Pinyin_39,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROf12>('/exam/examinerLogin.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 3.获取考点系统参数 考车从考试中心获取考点系统参数,即考试平台的exam_point_config表 POST /exam/initSysset300.ws */
|
||||
export async function initExamPointConfigUsingPost(
|
||||
body: API.Pinyin_33,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROfListOfobject>('/exam/initSysset300.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 8.考车考点信息查询 考车考点信息查询 POST /exam/queryVehiclePoint.ws */
|
||||
export async function queryVehiclePointUsingPost(
|
||||
body: API.Pinyin_28,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROfobject>('/exam/queryVehiclePoint.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 1.终端设备注册 包括但不限于考车、闸机 POST /exam/registrationDeviceNo.ws */
|
||||
export async function registrationDeviceNoUsingPost(
|
||||
body: API.Pinyin_23,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROfobject>('/exam/registrationDeviceNo.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 2.终端初始化时间同步 终端初始化时间同步 POST /exam/timeSynchronization.ws */
|
||||
export async function timeSynchronizationUsingPost(options?: { [key: string]: any }) {
|
||||
return request<API.ROf9>('/exam/timeSynchronization.ws', {
|
||||
method: 'POST',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 5.考车自检结果写入 考车自检结果写入 POST /exam/uploadExamCarCheckResult.ws */
|
||||
export async function uploadExamCarCheckResultUsingPost(
|
||||
body: API.Pinyin_29,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROfobject>('/exam/uploadExamCarCheckResult.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 7.考车日志信息上传 考车日志信息上传 POST /exam/uploadVehicleLog.ws */
|
||||
export async function uploadVehicleLogUsingPost(
|
||||
body: API.Pinyin_27,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROfobject>('/exam/uploadVehicleLog.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,78 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '../common/utils/http';
|
||||
|
||||
/** 3.考车对考生缺考操作 考车对考生缺考操作 POST /exam/examinationStuAbsent.ws */
|
||||
export async function examinationStuAbsentUsingPost(
|
||||
body: API.Pinyin_26,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROfobject>('/exam/examinationStuAbsent.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 2.断点续考 断点续考获取考试项目 POST /exam/getExaminationItem.ws */
|
||||
export async function getExaminationItemUsingPost(
|
||||
body: API.Pinyin_18,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROf8>('/exam/getExaminationItem.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 1.下载考生信息 考车端通过此接口下载监管(或本地随机)分配的考生信息 POST /exam/getExaminationStudentInfo.ws */
|
||||
export async function getExaminationStudentInfoUsingPost(
|
||||
body: API.Pinyin_3,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROf_>('/exam/getExaminationStudentInfo.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 4.上传考试过程数据文件 上传考试过程数据文件 POST /exam/uploadExamDataFile.ws */
|
||||
export async function uploadExamDataFileUsingPost(
|
||||
body: API.Pinyin_2,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROfobject>('/exam/uploadExamDataFile.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 5.上传考生考试里程 上传考生考试里程 POST /exam/uploadExamMileage.ws */
|
||||
export async function uploadExamMileageUsingPost(
|
||||
body: API.Pinyin__,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROfobject>('/exam/uploadExamMileage.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,46 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
// @ts-ignore
|
||||
import request from '../common/utils/http';
|
||||
|
||||
/** 2.无锡所接口请求 无锡所通用接口请求 POST /common/callWxsRest.do */
|
||||
export async function callWxsRestUsingPost(body: API.Pinyin_20, options?: { [key: string]: any }) {
|
||||
return request<API.ROfobject>('/common/callWxsRest.do', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 3.无锡所接口请求测试 无锡所接口请求测试,返回测试数据 POST /common/callWxsRestTest.do */
|
||||
export async function callWxsRestTestUsingPost(
|
||||
body: API.Pinyin_20,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROfobject>('/common/callWxsRestTest.do', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 1.大屏显示数据查询与控制 大屏显示数据查询与控制 POST /data/examInfoStandardDisplay.ws */
|
||||
export async function examInfoStandardDisplayUsingPost(
|
||||
body: API.Pinyin_13,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROf5>('/data/examInfoStandardDisplay.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,75 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '../common/utils/http';
|
||||
|
||||
/** 4.数据更新 数据更新:照片,指纹,随机序号,监管签到,状态等操作 POST /data/getAccessControlInfo.ws */
|
||||
export async function getAccessControlInfoUsingPost(
|
||||
body: API.Pinyin_30,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROfobject>('/data/getAccessControlInfo.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 2.身份合法性判断 身份合法性判断:约考信息下载,收费查询,场次控制等 POST /data/getAccessStuInfo.ws */
|
||||
export async function getAccessStuInfoUsingPost(
|
||||
body: API.Pinyin_36,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROfobject>('/data/getAccessStuInfo.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 1.门禁版本控制 门禁版本控制 POST /exam/gateLoginInit.ws */
|
||||
export async function getLoginInitUsingPost(body: API.Pinyin_38, options?: { [key: string]: any }) {
|
||||
return request<API.ROfobject>('/exam/gateLoginInit.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 3.门禁/考车终端人脸识别 门禁/考车终端人脸识别 POST /imageCompare/base64ImageStrCompare.ws */
|
||||
export async function base64ImageStrCompareUsingPost(
|
||||
body: API.Pinyin_37,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROfobject>('/imageCompare/base64ImageStrCompare.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 5.考官/随车考试员闸机人脸识别 考官/随车考试员闸机人脸识别,此处安全员是代替没有身份证学员人脸识别 POST /pmUserCheckCardNoFace.ws */
|
||||
export async function examManFaceRecognitionUsingPost(
|
||||
body: API.Pinyin_25,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROfobject>('/pmUserCheckCardNoFace.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -1,63 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import request from '../common/utils/http';
|
||||
|
||||
/** 3.合成视频监测 合成视频监测 POST /data/compositedVideosMonitor.ws */
|
||||
export async function compositedVideosMonitorUsingPost(
|
||||
body: API.Pinyin_11,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROfobject>('/data/compositedVideosMonitor.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 1.场地摄像头设备信息 场地摄像头设备信息--科目二三都调用此接口(科三只有贵州在用2022-10-13) POST /data/getKm2FieldGunCameraInfo.ws */
|
||||
export async function getKm2FieldGunCameraInfoUsingPost(
|
||||
body: API.Pinyin_11,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROf4>('/data/getKm2FieldGunCameraInfo.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 4.获取考生考试信息 获取考生考试信息 POST /data/getStudExamInfo.ws */
|
||||
export async function getStudExamInfoUsingPost(
|
||||
body: API.Pinyin_17,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROf7>('/data/getStudExamInfo.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 2.小红求获取扣分信息(参数平台接口) 小红求获取扣分信息-(视频合成用-小红球程序-放在参数平台) POST /data/obtainMarkRuleSetInfo.ws */
|
||||
export async function obtainMarkRuleSetInfoUsingPost(
|
||||
body: API.Pinyin_15,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.ROf6>('/data/obtainMarkRuleSetInfo.ws', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@ -5,12 +5,12 @@ import promptAction from "@ohos.promptAction";
|
||||
|
||||
interface RequestOption {
|
||||
url: string
|
||||
params: object
|
||||
data: object | string
|
||||
data?: object | string
|
||||
xml: boolean
|
||||
method: http.RequestMethod
|
||||
host?: string
|
||||
isNewCenter?: boolean
|
||||
timeout?: number
|
||||
}
|
||||
|
||||
const base: string = ""
|
||||
@ -118,7 +118,8 @@ export default function Request<T>(options: RequestOption): Promise<T> {
|
||||
header: {
|
||||
"Content-Type": options.xml ? "text/xml" : 'application/json'
|
||||
},
|
||||
extraData: options.xml ? options.data : JSON.stringify(options.data)
|
||||
extraData: options.xml ? options.data : JSON.stringify(options.data),
|
||||
readTimeout: options.timeout || 30 * 1000
|
||||
}).then(async data => {
|
||||
let result = options.xml ? xmlToJSON(data.result as string) : data.result
|
||||
let resObj: object
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user