| | |
| | | |
| | | import safeluck.drive.evaluation.DB.WorkRoomDataBase; |
| | | import safeluck.drive.evaluation.DB.appstatusdb.AppStatusWorker; |
| | | import safeluck.drive.evaluation.DB.criterias.CriteriaForI; |
| | | import safeluck.drive.evaluation.DB.criterias.CriteriaForIII; |
| | | import safeluck.drive.evaluation.DB.exam_status.ExamStatusInitWorker; |
| | | import safeluck.drive.evaluation.DB.exam_status.ExamStatusOutWorker; |
| | | import safeluck.drive.evaluation.DB.exam_status.ExamStatusWoker; |
| | |
| | | |
| | | if(!TextUtils.isEmpty(json)){ |
| | | Data judgeData = new Data.Builder().putString(Constant.TTS,json).build(); |
| | | JsonArray jsonArray = (JsonArray) JsonParser.parseString(json); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JsonObject jsonObject = jsonArray.get(i).getAsJsonObject(); |
| | | int emp_id = jsonObject.get("wrong_id").getAsInt(); |
| | | if (emp_id>1000){ |
| | | CriteriaForIII ttsStr=WorkRoomDataBase.getWorkRoomDataBase(this).getCriteriaIIIDao().queryItemForCriteriaIIINoLive(emp_id-1000); |
| | | ExamPlatformData.getInstance().getTTS().speak(ttsStr.getDeducting_reason() + (ttsStr.getScore_deducting() == 100? "不合格" : "扣" + |
| | | ttsStr.getScore_deducting() + "分")); |
| | | }else{ |
| | | CriteriaForI ttsStr = WorkRoomDataBase.getWorkRoomDataBase(this).getCriteriaIDao().queryItemForCriteriaINoLive(emp_id); |
| | | ExamPlatformData.getInstance().getTTS().speak(ttsStr.getDeducting_reason() + (ttsStr.getScore_deducting() == 100? "不合格" : "扣" + |
| | | ttsStr.getScore_deducting() + "分")); |
| | | } |
| | | |
| | | } |
| | | |
| | | OneTimeWorkRequest ttswoker = new OneTimeWorkRequest.Builder(TTSWorker.class).setInputData(judgeData).build(); |
| | | WorkManager.getInstance(getAppContext()).enqueue(ttswoker); |
| | | |
| | |
| | | } |
| | | }); |
| | | 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(); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | // 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(); |
| | | // } |
| | | // }); |
| | | // |
| | | // } |
| | | buffer =FileUtil.readAssetTxtFile(getApplicationContext(),Constant.MAP); |
| | | if (buffer != null){ |
| | | |