| | |
| | | import safeluck.drive.evaluation.DB.exam_status.ExamStatusWoker; |
| | | 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.gps.GpsInfoWorker; |
| | | import safeluck.drive.evaluation.DB.rtktb.RTKConfig; |
| | | import safeluck.drive.evaluation.DB.rtktb.RTKWorkRepository; |
| | |
| | | import safeluck.drive.evaluation.im.IMSClientBootstrap; |
| | | import safeluck.drive.evaluation.im.IMSConnectStatusListener; |
| | | import safeluck.drive.evaluation.im.MessageProcessor; |
| | | import safeluck.drive.evaluation.platformMessage.AttachInfo; |
| | | import safeluck.drive.evaluation.platformMessage.JKMessage0100; |
| | | import safeluck.drive.evaluation.platformMessage.JKMessage0101; |
| | | import safeluck.drive.evaluation.platformMessage.JKMessage0203; |
| | | import safeluck.drive.evaluation.platformMessage.JKMessage0206; |
| | | import safeluck.drive.evaluation.util.FileUtil; |
| | | import safeluck.drive.evaluation.util.SPUtils; |
| | | import safeluck.drive.evaluation.util.SystemUtil; |
| | |
| | | case Constant.JUDGE_INFO: |
| | | |
| | | if(!TextUtils.isEmpty(json)){ |
| | | JKMessage0203 jkMessage0203 = new JKMessage0203(); |
| | | jkMessage0203.phone = "0314200100000004"; |
| | | jkMessage0203.timeBCD = new Date(); |
| | | jkMessage0203.fail_item_id = 4; |
| | | jkMessage0203.fail_score = 10; |
| | | jkMessage0203.fail_reason = "发动机启动后,不及时松开启动开关"; |
| | | jkMessage0203.ID = "123456789"; |
| | | jkMessage0203.exam_id = 123456; |
| | | MessageProcessor.getInstance().sendMessage(jkMessage0203); |
| | | |
| | | JsonArray jsonArray = JsonParser.parseString(json).getAsJsonArray(); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JsonObject jsonObject = jsonArray.get(i).getAsJsonObject(); |
| | | int emp_id = jsonObject.get("wrong_id").getAsInt(); |
| | | String utc = jsonObject.get("utc").getAsString(); |
| | | MyLog.i("评判消息解析之前的utc="+utc); |
| | | utc = utc.substring(2,utc.length()-3); |
| | | MyLog.i("评判消息解析之后的utc="+utc); |
| | | int sn = jsonObject.get("sn").getAsInt(); |
| | | if (emp_id>31|| emp_id<0){ |
| | | MyLog.i(TAG,"emp_id超出范围不能插入数据库(I类考场)"); |
| | | return; |
| | | } |
| | | failedProjRepository.insert(new FailedProj(Constant.SUBJECT_I, emp_id, Constant.TEST_STU_ID)); |
| | | FailedProj failedProj = new FailedProj(Constant.SUBJECT_I, emp_id, Constant.TEST_STU_ID,utc,sn); |
| | | MyLog.i("插入fail_projects表="+failedProj.toString()); |
| | | failedProjRepository.insert(failedProj); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | CEventCenter.dispatchEvent(Constant.BIND_SPEED_TOPIC,cmd,0,json); |
| | | break; |
| | | case Constant.RTK_INFO: |
| | | try { |
| | | JSONObject jsSpeed = new JSONObject(json); |
| | | double latitude = jsSpeed.getDouble("latitude"); |
| | | double longitude = jsSpeed.getDouble("longitude"); |
| | | double altitude = jsSpeed.getDouble("altitude"); |
| | | double speed = jsSpeed.getDouble("speed"); |
| | | int qf = jsSpeed.getInt("qf"); |
| | | double track_ture = jsSpeed.getDouble("track_ture"); |
| | | String utc = jsSpeed.getString("utc"); |
| | | utc = utc.replace(".",""); |
| | | MyLog.i("RTK info 修改后的utc"+utc); |
| | | JKMessage0206 jkMessage0206 = new JKMessage0206(); |
| | | jkMessage0206.alert = 0; |
| | | jkMessage0206.status = 0; |
| | | jkMessage0206.jd = longitude; |
| | | jkMessage0206.wd = latitude; |
| | | jkMessage0206.gaoCheng = (int)altitude; |
| | | jkMessage0206.speed = speed; |
| | | jkMessage0206.fangXiang = (int)track_ture; |
| | | jkMessage0206.rf = qf; |
| | | jkMessage0206.timeBCD = utc; |
| | | jkMessage0206.json =json; |
| | | jkMessage0206.length = jkMessage0206.json.length(); |
| | | AttachInfo attachInfo = new AttachInfo(); |
| | | attachInfo.attach_message_id = Integer.parseInt(String.valueOf(0x40)); |
| | | attachInfo.attach_message_length = 4; |
| | | Log.i(TAG, "attachInfo.attach_message_id ="+attachInfo.attach_message_id ); |
| | | if (attachInfo.attach_message_id == 0x41){ |
| | | Log.i(TAG, "onClick: 41"); |
| | | attachInfo.attach_data="00000000"; |
| | | }else{ |
| | | |
| | | //18个字节 ascii |
| | | attachInfo.attach_data="303030303030303030303030303030303030"; |
| | | } |
| | | |
| | | jkMessage0206.attachInfo = attachInfo; |
| | | Log.i(TAG, "位置上报="+jkMessage0206.toString()); |
| | | MessageProcessor.getInstance().sendMessage(jkMessage0206); |
| | | } catch (JSONException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | break; |
| | | |
| | | } |
| | | |