Compare commits
	
		
			2 Commits
		
	
	
		
			98e17164e1
			...
			f57a04521c
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					f57a04521c | ||
| 
						 | 
					fff89ecf75 | 
@ -125,17 +125,19 @@ export class BaseJudge {
 | 
				
			|||||||
          ProjectStart(xmdm, that.xmxh, judgeUI)
 | 
					          ProjectStart(xmdm, that.xmxh, judgeUI)
 | 
				
			||||||
          UploadProgressPhoto(xmdm, that.plcData!, judgeUI)
 | 
					          UploadProgressPhoto(xmdm, that.plcData!, judgeUI)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        // this.judgeUI.projectsObj[xmdm].isUpload = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      case 2: {
 | 
					      case 2: {
 | 
				
			||||||
        dConsole.log(JudgeTag, ExamProcessDataTag, "项目结束判定1")
 | 
					        dConsole.log(JudgeTag, ExamProcessDataTag, "项目结束判定1")
 | 
				
			||||||
        const project: ProjectInfo = Reflect.get(judgeUI.projectsObj, xmdm)
 | 
					        const project: ProjectInfo = Reflect.get(judgeUI.projectsObj, xmdm)
 | 
				
			||||||
        const isStart = await this.checkProjectIsStart(xmdm, 2, judgeUI, that)
 | 
					        // const isStart = await this.checkProjectIsStart(xmdm, 1, judgeUI, that, kf)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (isStart) {
 | 
					        // if (isStart) {
 | 
				
			||||||
          // 项目结束了就不再生成数据
 | 
					        //   // 项目结束了就不再生成数据
 | 
				
			||||||
          dConsole.info(JudgeTag, ExamProcessDataTag, ' 项目是否结束 =>', project.isEnd)
 | 
					        //   dConsole.info(JudgeTag, ExamProcessDataTag, ' 项目是否结束 =>', project.isEnd)
 | 
				
			||||||
          if (!project.isEnd) {
 | 
					        //   if (!project.isEnd) {
 | 
				
			||||||
        // judgeTask.addTask(async () => {
 | 
					        // judgeTask.addTask(async () => {
 | 
				
			||||||
        //   dConsole.info(JudgeTag, `项目结束-${xmdm}-${project.name}`)
 | 
					        //   dConsole.info(JudgeTag, `项目结束-${xmdm}-${project.name}`)
 | 
				
			||||||
        //   await endProject(xmdm);
 | 
					        //   await endProject(xmdm);
 | 
				
			||||||
@ -145,8 +147,8 @@ export class BaseJudge {
 | 
				
			|||||||
        //   isDelay: true
 | 
					        //   isDelay: true
 | 
				
			||||||
        // })
 | 
					        // })
 | 
				
			||||||
        ProjectEnd(xmdm, that.xmxh, judgeUI)
 | 
					        ProjectEnd(xmdm, that.xmxh, judgeUI)
 | 
				
			||||||
          }
 | 
					        //   }
 | 
				
			||||||
        }
 | 
					        // }
 | 
				
			||||||
        dConsole.log(JudgeTag, ExamProcessDataTag, "项目结束判定3")
 | 
					        dConsole.log(JudgeTag, ExamProcessDataTag, "项目结束判定3")
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
          const param512: JudgeConfigObj = (Reflect.get(judgeUI.judgeConfigObj, '512') || '').split(',');
 | 
					          const param512: JudgeConfigObj = (Reflect.get(judgeUI.judgeConfigObj, '512') || '').split(',');
 | 
				
			||||||
@ -169,8 +171,8 @@ export class BaseJudge {
 | 
				
			|||||||
          that.avPlayer?.playAudio([`voice/${currentKf.markcatalog}.mp3`,
 | 
					          that.avPlayer?.playAudio([`voice/${currentKf.markcatalog}.mp3`,
 | 
				
			||||||
            `voice/mark_${Math.abs(currentKf?.score || 0)}.mp3`])
 | 
					            `voice/mark_${Math.abs(currentKf?.score || 0)}.mp3`])
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        const isStart = await this.checkProjectIsStart(Number(currentKf.xmdm), 2, judgeUI, that);
 | 
					        // const isStart = await this.checkProjectIsStart(Number(currentKf.xmdm), 2, judgeUI, that, kf);
 | 
				
			||||||
        if (isStart) {
 | 
					        // if (isStart) {
 | 
				
			||||||
        // await judgeTask.addTask(async () => {
 | 
					        // await judgeTask.addTask(async () => {
 | 
				
			||||||
        //   dConsole.info(JudgeTag, `项目扣分-${currentKf.markcatalog}-${currentKf.desc}`)
 | 
					        //   dConsole.info(JudgeTag, `项目扣分-${currentKf.markcatalog}-${currentKf.desc}`)
 | 
				
			||||||
        //   await pointsDedute(Number(currentKf.xmdm), currentKf)
 | 
					        //   await pointsDedute(Number(currentKf.xmdm), currentKf)
 | 
				
			||||||
@ -178,7 +180,10 @@ export class BaseJudge {
 | 
				
			|||||||
        //   isDelay: true
 | 
					        //   isDelay: true
 | 
				
			||||||
        // })
 | 
					        // })
 | 
				
			||||||
        DeductPoints(Number(currentKf.xmdm), currentKf, that.xmmcEndCode || "", judgeUI)
 | 
					        DeductPoints(Number(currentKf.xmdm), currentKf, that.xmmcEndCode || "", judgeUI)
 | 
				
			||||||
 | 
					        if (judgeUI.totalScore < judgeUI.passingScore) {
 | 
				
			||||||
 | 
					          ProjectEnd(xmdm, that.xmxh, judgeUI)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        // }
 | 
				
			||||||
        break
 | 
					        break
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      case 5: {
 | 
					      case 5: {
 | 
				
			||||||
@ -367,7 +372,6 @@ export class BaseJudge {
 | 
				
			|||||||
      })
 | 
					      })
 | 
				
			||||||
      return
 | 
					      return
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    //
 | 
					 | 
				
			||||||
    that.avPlayer?.playAudio(['voice/exam_waiting.mp3'], judgeUI.singlePlay, async () => {
 | 
					    that.avPlayer?.playAudio(['voice/exam_waiting.mp3'], judgeUI.singlePlay, async () => {
 | 
				
			||||||
      try {
 | 
					      try {
 | 
				
			||||||
        if (!judgeUI.singlePlay) {
 | 
					        if (!judgeUI.singlePlay) {
 | 
				
			||||||
@ -393,7 +397,6 @@ export class BaseJudge {
 | 
				
			|||||||
          await this.endExam(judgeUI, that)
 | 
					          await this.endExam(judgeUI, that)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
      await this.endExam(judgeUI, that)
 | 
					 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -402,7 +405,6 @@ export class BaseJudge {
 | 
				
			|||||||
    const singlePlay = judgeUI.singlePlay
 | 
					    const singlePlay = judgeUI.singlePlay
 | 
				
			||||||
    //TODO 断网考试结束补传
 | 
					    //TODO 断网考试结束补传
 | 
				
			||||||
    // await uploadDisConnectData();
 | 
					    // await uploadDisConnectData();
 | 
				
			||||||
 | 
					 | 
				
			||||||
    let backTimeOut = setTimeout(() => {
 | 
					    let backTimeOut = setTimeout(() => {
 | 
				
			||||||
      router.back()
 | 
					      router.back()
 | 
				
			||||||
    }, 90 * 1000)
 | 
					    }, 90 * 1000)
 | 
				
			||||||
@ -506,58 +508,62 @@ export class BaseJudge {
 | 
				
			|||||||
        }, param302 === "8" ? 3000 : 0)
 | 
					        }, param302 === "8" ? 3000 : 0)
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /**
 | 
					  /**
 | 
				
			||||||
   *  检测扣分、结束项目时该项目是否开始
 | 
					   *  检测扣分、结束项目时该项目是否开始
 | 
				
			||||||
   *
 | 
					   *
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
  async checkProjectIsStart(xmdm: number, currentType: 1 | 2, judgeUI: JudgePage, that: JudgeBusiness, kf?: MarkRule): Promise<boolean> {
 | 
					  // async checkProjectIsStart(xmdm: number, currentType: 1 | 2, judgeUI: JudgePage, that: JudgeBusiness, kf?: MarkRule[]): Promise<boolean> {
 | 
				
			||||||
    if (xmdm == 20) {
 | 
					  //   if (xmdm == 20) {
 | 
				
			||||||
      return true
 | 
					  //     return true
 | 
				
			||||||
    }
 | 
					  //   }
 | 
				
			||||||
    const currentProject: ProjectInfo = Reflect.get(judgeUI.projectsObj, xmdm)
 | 
					  //   const currentProject: ProjectInfo = Reflect.get(judgeUI.projectsObj, xmdm)
 | 
				
			||||||
 | 
					  //
 | 
				
			||||||
    if (!currentProject.isUpload) {
 | 
					  //   if (!currentProject.isUpload) {
 | 
				
			||||||
      dConsole.info(JudgeTag, '项目补传开始')
 | 
					  //     dConsole.info(JudgeTag, '项目补传开始')
 | 
				
			||||||
      // judgeTask.addTask(async () => {
 | 
					  //     // judgeTask.addTask(async () => {
 | 
				
			||||||
      //   await this.beginProject(xmdm)
 | 
					  //     //   await this.beginProject(xmdm)
 | 
				
			||||||
      // }, {
 | 
					  //     // }, {
 | 
				
			||||||
      //   isDelay: true
 | 
					  //     //   isDelay: true
 | 
				
			||||||
      // })
 | 
					  //     // })
 | 
				
			||||||
      // judgeTask.addTask(async () => {
 | 
					  //     // judgeTask.addTask(async () => {
 | 
				
			||||||
      //   await this.uploadProgressPhoto(xmdm)
 | 
					  //     //   await this.uploadProgressPhoto(xmdm)
 | 
				
			||||||
      // }, {
 | 
					  //     // }, {
 | 
				
			||||||
      //   isDelay: true
 | 
					  //     //   isDelay: true
 | 
				
			||||||
      // })
 | 
					  //     // })
 | 
				
			||||||
      currentProject.isUpload = true;
 | 
					  //     ProjectStart(xmdm, that.xmxh, judgeUI)
 | 
				
			||||||
      Reflect.set(judgeUI.projectsObj, xmdm, currentProject)
 | 
					  //     UploadProgressPhoto(xmdm, that.plcData!, judgeUI)
 | 
				
			||||||
      if (currentType == 2) {
 | 
					  //     currentProject.isUpload = true;
 | 
				
			||||||
        //项目结束需要等补传完毕
 | 
					  //     Reflect.set(judgeUI.projectsObj, xmdm, currentProject)
 | 
				
			||||||
        // judgeTask.addTask(async () => {
 | 
					  //     if (currentType == 2) {
 | 
				
			||||||
        //   await this.pointsDedute(xmdm, kf!)
 | 
					  //       //项目结束需要等补传完毕
 | 
				
			||||||
        // }, {
 | 
					  //       // judgeTask.addTask(async () => {
 | 
				
			||||||
        //   isDelay: true
 | 
					  //       //   await this.pointsDedute(xmdm, kf!)
 | 
				
			||||||
        // })
 | 
					  //       // }, {
 | 
				
			||||||
      }
 | 
					  //       //   isDelay: true
 | 
				
			||||||
      //扣分补传判断是否合格 不合格补传项目结束
 | 
					  //       // })\
 | 
				
			||||||
      if (currentType == 1 || (currentType == 2 && that.totalScore < judgeUI.passingScore)) {
 | 
					  //       const currentKf = kf[kf.length -1];
 | 
				
			||||||
        // judgeTask.addTask(async () => {
 | 
					  //       DeductPoints(Number(currentKf.xmdm), currentKf, that.xmmcEndCode || "", judgeUI)
 | 
				
			||||||
        //   await this.endProject(xmdm)
 | 
					  //     }
 | 
				
			||||||
        // }, {
 | 
					  //     //扣分补传判断是否合格 不合格补传项目结束
 | 
				
			||||||
        //   isDelay: true
 | 
					  //     if (currentType == 1 || (currentType == 2 && that.totalScore < judgeUI.passingScore)) {
 | 
				
			||||||
        // })
 | 
					  //       // judgeTask.addTask(async () => {
 | 
				
			||||||
        currentProject.isEnd = true;
 | 
					  //       //   await this.endProject(xmdm)
 | 
				
			||||||
        Reflect.set(judgeUI.projectsObj, xmdm, currentProject)
 | 
					  //       // }, {
 | 
				
			||||||
      }
 | 
					  //       //   isDelay: true
 | 
				
			||||||
      // judgeTask.addTask(async () => {
 | 
					  //       // })
 | 
				
			||||||
      //   this.checkExamIsEnd()
 | 
					  //       ProjectEnd(xmdm, that.xmxh, judgeUI)
 | 
				
			||||||
      // })
 | 
					  //       currentProject.isEnd = true;
 | 
				
			||||||
      return false;
 | 
					  //       Reflect.set(judgeUI.projectsObj, xmdm, currentProject)
 | 
				
			||||||
    }
 | 
					  //     }
 | 
				
			||||||
    return true
 | 
					  //     // judgeTask.addTask(async () => {
 | 
				
			||||||
  }
 | 
					  //     //   this.checkExamIsEnd()
 | 
				
			||||||
 | 
					  //     // })
 | 
				
			||||||
 | 
					  //     return false;
 | 
				
			||||||
 | 
					  //   }
 | 
				
			||||||
 | 
					  //   return true
 | 
				
			||||||
 | 
					  // }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  async judgeStart(callBack: Function, judgeUI: JudgePage, that: JudgeBusiness, beginExamInfo: JudgeBeginObj, initInfo: JudgeInitObj) {
 | 
					  async judgeStart(callBack: Function, judgeUI: JudgePage, that: JudgeBusiness, beginExamInfo: JudgeBeginObj, initInfo: JudgeInitObj) {
 | 
				
			||||||
    const name = judgeUI.name
 | 
					    const name = judgeUI.name
 | 
				
			||||||
@ -880,7 +886,6 @@ export class BaseJudge {
 | 
				
			|||||||
          that.isExamEnd = true
 | 
					          that.isExamEnd = true
 | 
				
			||||||
          return
 | 
					          return
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					 | 
				
			||||||
        //成绩合格
 | 
					        //成绩合格
 | 
				
			||||||
        if (isAllProjectsEnd && totalScore >= passingScore && !that.isEndTip) {
 | 
					        if (isAllProjectsEnd && totalScore >= passingScore && !that.isEndTip) {
 | 
				
			||||||
          if (examSubject == '2') {
 | 
					          if (examSubject == '2') {
 | 
				
			||||||
 | 
				
			|||||||
@ -708,7 +708,7 @@ struct UserInfoPage {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        this.list = JSON.parse(JSON.stringify(dataList))
 | 
					        this.list = JSON.parse(JSON.stringify(dataList))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        dConsole.log("temp list", JSON.stringify(this.list))
 | 
					        dConsole.log(UserInfoTag, "temp list", JSON.stringify(this.list))
 | 
				
			||||||
        this.list.forEach((listData, index) => {
 | 
					        this.list.forEach((listData, index) => {
 | 
				
			||||||
          //考过一次不允许切换学员
 | 
					          //考过一次不允许切换学员
 | 
				
			||||||
          if (listData.kssycs == '1') {
 | 
					          if (listData.kssycs == '1') {
 | 
				
			||||||
@ -730,7 +730,7 @@ struct UserInfoPage {
 | 
				
			|||||||
        })
 | 
					        })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // await upDateTableByArray('USERLIST', this.list || [])
 | 
					        // await upDateTableByArray('USERLIST', this.list || [])
 | 
				
			||||||
        dConsole.log("temp list", JSON.stringify(this.list))
 | 
					        dConsole.log(UserInfoTag, "temp list", JSON.stringify(this.list))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // await sqlInsertCommonFn("USERLIST", this.list || [])
 | 
					        // await sqlInsertCommonFn("USERLIST", this.list || [])
 | 
				
			||||||
        await SqlInsertTable('USERLIST', this.list || [])
 | 
					        await SqlInsertTable('USERLIST', this.list || [])
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,6 @@
 | 
				
			|||||||
// 处理worker线程的消息tcp拿差分改正数,udp给后置机
 | 
					// 处理worker线程的消息tcp拿差分改正数,udp给后置机
 | 
				
			||||||
import worker, { ErrorEvent, MessageEvents, ThreadWorkerGlobalScope } from '@ohos.worker';
 | 
					import worker, { ErrorEvent, MessageEvents, ThreadWorkerGlobalScope } from '@ohos.worker';
 | 
				
			||||||
import { WorkerTag } from '../config';
 | 
					import { SerialPortTag, WorkerTag } from '../config';
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
  CenterCallBackMsgType,
 | 
					  CenterCallBackMsgType,
 | 
				
			||||||
  EnvironmentConfigurationType,
 | 
					  EnvironmentConfigurationType,
 | 
				
			||||||
@ -70,7 +70,7 @@ function getDataFn(config: EnvironmentConfigurationType) {
 | 
				
			|||||||
      // 需要观察
 | 
					      // 需要观察
 | 
				
			||||||
      // console.log(WorkerTag, "后置机消息", data)
 | 
					      // console.log(WorkerTag, "后置机消息", data)
 | 
				
			||||||
      const res = await SerialPortService.getData()
 | 
					      const res = await SerialPortService.getData()
 | 
				
			||||||
      // console.log(SerialPortTag, "档位原始数据", res)
 | 
					      console.log(SerialPortTag, "档位原始数据", res)
 | 
				
			||||||
      if (res.length > 0) {
 | 
					      if (res.length > 0) {
 | 
				
			||||||
        const dataArray = data.split(",");
 | 
					        const dataArray = data.split(",");
 | 
				
			||||||
        // 替换data的第28位
 | 
					        // 替换data的第28位
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user