| | |
| | | import safeluck.drive.evaluation.DB.failitems.FailedProj; |
| | | import safeluck.drive.evaluation.DB.failitems.FailedProjRepository; |
| | | import safeluck.drive.evaluation.DB.failitems.FailedProj_select; |
| | | import safeluck.drive.evaluation.DB.failitems.LuKaoFailedProj; |
| | | import safeluck.drive.evaluation.DB.gps.GpsInfoWorker; |
| | | import safeluck.drive.evaluation.DB.rtktb.RTKConfig; |
| | | import safeluck.drive.evaluation.DB.rtktb.RTKConfigUpdateWorker; |
| | | import safeluck.drive.evaluation.DB.rtktb.RTKWorkRepository; |
| | | import safeluck.drive.evaluation.bean.ExamMap; |
| | | import safeluck.drive.evaluation.bean.ExamPlatformData; |
| | | import safeluck.drive.evaluation.cEventCenter.CEvent; |
| | | import safeluck.drive.evaluation.cEventCenter.CEventCenter; |
| | |
| | | import safeluck.drive.evaluation.util.SPUtils; |
| | | import safeluck.drive.evaluation.util.SystemUtil; |
| | | import safeluck.drive.evaluation.worker.MCUUpgradeWorker; |
| | | import safeluck.drive.evaluation.worker.TTSWorker; |
| | | |
| | | /** |
| | | * MyApplication2 |
| | |
| | | } |
| | | switch (cmd) { |
| | | case Constant.NDK_START: |
| | | sendVechileInfo(); |
| | | sendMapInfo(); |
| | | // sendVechileInfo(); |
| | | // sendMapInfo(); |
| | | OneTimeWorkRequest examStatausOutWorker = OneTimeWorkRequest.from(ExamStatusOutWorker.class); |
| | | OneTimeWorkRequest mcuUpgradeWorker = OneTimeWorkRequest.from(MCUUpgradeWorker.class); |
| | | WorkManager.getInstance(getApplicationContext()).beginWith(examStatausOutWorker).then(mcuUpgradeWorker).enqueue(); |
| | |
| | | case Constant.JUDGE_INFO: |
| | | |
| | | if(!TextUtils.isEmpty(json)){ |
| | | |
| | | Data judgeData = new Data.Builder().putString(Constant.TTS,json).build(); |
| | | OneTimeWorkRequest ttswoker = new OneTimeWorkRequest.Builder(TTSWorker.class).setInputData(judgeData).build(); |
| | | WorkManager.getInstance(getAppContext()).enqueue(ttswoker); |
| | | JsonArray jsonArray = JsonParser.parseString(json).getAsJsonArray(); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JsonObject jsonObject = jsonArray.get(i).getAsJsonObject(); |
| | |
| | | utc = utc.substring(2,utc.length()-3); |
| | | MyLog.i("评判消息解析之后的utc="+utc); |
| | | int sn = jsonObject.get("sn").getAsInt(); |
| | | if (ExamPlatformData.getInstance().getExamType()==2){//场地评判消息 |
| | | if (emp_id>31|| emp_id<0){ |
| | | MyLog.i(TAG,"emp_id超出范围不能插入数据库(I类考场)"); |
| | | return; |
| | | } |
| | | FailedProj failedProj = new FailedProj(Constant.SUBJECT_I, emp_id, Constant.TEST_STU_ID,utc,sn); |
| | | MyLog.i("插入fail_projects表="+failedProj.toString()); |
| | | failedProjRepository.insert(failedProj); |
| | | } |
| | | if (ExamPlatformData.getInstance().getExamType()>2){//道路 评判消息 |
| | | if (emp_id>66|| emp_id<1){ |
| | | MyLog.i(TAG,"emp_id超出范围不能插入数据库(路考类考场)"); |
| | | return; |
| | | } |
| | | FailedProj failedProj = new FailedProj(Constant.SUBJECT_III, emp_id, Constant.TEST_STU_ID,utc,sn); |
| | | MyLog.i("插入路考fail_projects表="+failedProj.toString()); |
| | | // if (ExamPlatformData.getInstance().getExamType()==2){//场地评判消息 |
| | | // if (emp_id>31|| emp_id<0){ |
| | | // MyLog.i(TAG,"emp_id超出范围不能插入数据库(I类考场)"); |
| | | // return; |
| | | // } |
| | | // FailedProj failedProj = new FailedProj(Constant.SUBJECT_I, emp_id, Constant.TEST_STU_ID,utc,sn); |
| | | // MyLog.i("插入fail_projects表="+failedProj.toString()); |
| | | // failedProjRepository.insert(failedProj); |
| | | } |
| | | // } |
| | | // if (ExamPlatformData.getInstance().getExamType()>2){//道路 评判消息 |
| | | // if (emp_id>66|| emp_id<1){ |
| | | // MyLog.i(TAG,"emp_id超出范围不能插入数据库(路考类考场)"); |
| | | // return; |
| | | // } |
| | | // LuKaoFailedProj failedProj = new LuKaoFailedProj(Constant.SUBJECT_III, emp_id, Constant.TEST_STU_ID,utc,sn); |
| | | // MyLog.i("插入路考fail_projects表="+failedProj.toString()); |
| | | // failedProjRepository.insertLuKao(failedProj); |
| | | // } |
| | | |
| | | } |
| | | } |
| | |
| | | Toast.makeText(getAppContext(), "读取Assert目录下初始化的地图", Toast.LENGTH_SHORT).show(); |
| | | } |
| | | }); |
| | | StringBuffer buffer =FileUtil.readAssetTxtFile(getApplicationContext(),Constant.ROAD_MAP); |
| | | if (buffer != null){ |
| | | StringBuffer buffer; |
| | | buffer =FileUtil.readAssetTxtFile(getApplicationContext(),Constant.ROAD_MAP); |
| | | if (buffer != null){ |
| | | |
| | | AYSdk.getInstance().sendCmd(Constant.PUSH_ROAD_MAP_INFO,buffer.toString()); |
| | | }else{ |
| | | MyLog.d(TAG,String.format("地图模型未拷入[%s]目录下", Environment.getExternalStorageDirectory().getAbsolutePath()+"/"+getApplicationContext().getPackageName())); |
| | | CThreadPoolExecutor.runOnMainThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | Toast.makeText(getAppContext(), String.format("地图模型未拷入[%s]目录下", Environment.getExternalStorageDirectory().getAbsolutePath()+"/"+getApplicationContext().getPackageName()), Toast.LENGTH_SHORT).show(); |
| | | } |
| | | }); |
| | | AYSdk.getInstance().sendCmd(Constant.PUSH_ROAD_MAP_INFO,buffer.toString()); |
| | | }else{ |
| | | MyLog.d(TAG,String.format("地图模型未拷入[%s]目录下", Environment.getExternalStorageDirectory().getAbsolutePath()+"/"+getApplicationContext().getPackageName())); |
| | | CThreadPoolExecutor.runOnMainThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | Toast.makeText(getAppContext(), String.format("地图模型未拷入[%s]目录下", Environment.getExternalStorageDirectory().getAbsolutePath()+"/"+getApplicationContext().getPackageName()), Toast.LENGTH_SHORT).show(); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | } |
| | | buffer =FileUtil.readAssetTxtFile(getApplicationContext(),Constant.MAP); |
| | | if (buffer != null){ |
| | | |
| | | AYSdk.getInstance().sendCmd(Constant.PUSH_MAP_INFO,buffer.toString()); |
| | | }else{ |
| | | MyLog.d(TAG,String.format("地图模型未拷入[%s]目录下", Environment.getExternalStorageDirectory().getAbsolutePath()+"/"+getApplicationContext().getPackageName())); |
| | | CThreadPoolExecutor.runOnMainThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | Toast.makeText(getAppContext(), String.format("地图模型未拷入[%s]目录下", Environment.getExternalStorageDirectory().getAbsolutePath()+"/"+getApplicationContext().getPackageName()), Toast.LENGTH_SHORT).show(); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |