Showing
7 changed files
with
59 additions
and
14 deletions
| ... | ... | @@ -8,7 +8,21 @@ public class RoomInfo extends BaseModel { |
| 8 | 8 | /** |
| 9 | 9 | * code : 0 |
| 10 | 10 | * msg : |
| 11 | - * data : {"id":5,"room_sn":"R170321112367","room_name":"海贼王008","create_time":1490067794,"mac_address":"123","imei":"LETEST","store_sn":"S170321113056","qr_code":"83e60eaa5de46498209fe83614cede9c","sort":0,"status":0,"picture":"none.png","create_name":"amdin","info":"海贼王008专用","mesh_name":"","password":""} | |
| 11 | + * data : {"id":5, | |
| 12 | + * "room_sn":"R170321112367", | |
| 13 | + * "room_name":"海贼王008", | |
| 14 | + * "create_time":1490067794, | |
| 15 | + * "mac_address":"123", | |
| 16 | + * "imei":"LETEST", | |
| 17 | + * "store_sn":"S170321113056", | |
| 18 | + * "qr_code":"83e60eaa5de46498209fe83614cede9c", | |
| 19 | + * "sort":0, | |
| 20 | + * "status":0, | |
| 21 | + * "picture":"none.png", | |
| 22 | + * "create_name":"amdin", | |
| 23 | + * "info":"海贼王008专用", | |
| 24 | + * "mesh_name":"", | |
| 25 | + * "password":""} | |
| 12 | 26 | */ |
| 13 | 27 | private DataEntity data; |
| 14 | 28 | |
| ... | ... | @@ -196,4 +210,11 @@ public class RoomInfo extends BaseModel { |
| 196 | 210 | '}'; |
| 197 | 211 | } |
| 198 | 212 | } |
| 213 | + | |
| 214 | + @Override | |
| 215 | + public String toString() { | |
| 216 | + return "RoomInfo{" + | |
| 217 | + "data=" + data + | |
| 218 | + '}'; | |
| 219 | + } | |
| 199 | 220 | } | ... | ... |
| ... | ... | @@ -32,8 +32,11 @@ public class SocketService extends Service { |
| 32 | 32 | private static final int ROOM_NOT_EXIST_M = 1002; |
| 33 | 33 | private static final int HEAT_BEAT_RTN = 1003; |
| 34 | 34 | |
| 35 | +// public static final String HOST = "10.10.4.6";// "192.168.1.21";// | |
| 36 | +// public static final int PORT = 9501; | |
| 37 | + | |
| 35 | 38 | public static final String HOST = "10.10.4.6";// "192.168.1.21";// |
| 36 | - public static final int PORT = 9501; | |
| 39 | + public static final int PORT = 8899; | |
| 37 | 40 | |
| 38 | 41 | public static final String END_SYMBOL = "\\r\\n\\r\\n";//心跳包内容 |
| 39 | 42 | // public String testRoomSn = "R170413034374"; | ... | ... |
| ... | ... | @@ -52,6 +52,7 @@ import com.adroplat.fist_switch.utils.protocol.one.FistProtocol; |
| 52 | 52 | import com.bluetoothle.BLEBroadcastReceiver; |
| 53 | 53 | import com.bluetoothle.BLEOpenRecord; |
| 54 | 54 | import com.bluetoothle.GREENBluetoothLeService; |
| 55 | +import com.bluetoothle.greencity.GREENBLE; | |
| 55 | 56 | import com.bluetoothle.greencity.GREENCITYBLEProtocolFactory; |
| 56 | 57 | import com.gimi.common.cinema.db.NewDBManager; |
| 57 | 58 | import com.gimi.common.cinema.model.ClassificationItem; |
| ... | ... | @@ -235,13 +236,13 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
| 235 | 236 | presenter.load(this); |
| 236 | 237 | Intent intent = new Intent(this, SocketService.class); |
| 237 | 238 | startService(intent); |
| 238 | - new Handler().postDelayed(new Runnable() { | |
| 239 | - @Override | |
| 240 | - public void run() { | |
| 241 | - Log.d("room-info", "test open door report"); | |
| 242 | - openDoor(); | |
| 243 | - } | |
| 244 | - }, 20 * 1000); | |
| 239 | +// new Handler().postDelayed(new Runnable() { | |
| 240 | +// @Override | |
| 241 | +// public void run() { | |
| 242 | +// Log.d("room-info", "test open door report"); | |
| 243 | +// openDoor(); | |
| 244 | +// } | |
| 245 | +// }, 20 * 1000); | |
| 245 | 246 | } |
| 246 | 247 | |
| 247 | 248 | @Override |
| ... | ... | @@ -1004,7 +1005,7 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
| 1004 | 1005 | } |
| 1005 | 1006 | |
| 1006 | 1007 | private void openDoor() { |
| 1007 | - handler.post(reportRunnable); | |
| 1008 | +// handler.post(reportRunnable); | |
| 1008 | 1009 | |
| 1009 | 1010 | bleBroadcastReceiver.setResponseObj(new GREENCITYBLEProtocolFactory.GREENCITYBleDataWritten() { |
| 1010 | 1011 | |
| ... | ... | @@ -1032,8 +1033,8 @@ public class MainActivity extends BaseActivity implements IMainView, EventListen |
| 1032 | 1033 | } |
| 1033 | 1034 | |
| 1034 | 1035 | }); |
| 1035 | -// String openCMD = "Open the door"; | |
| 1036 | -// GREENBLE.send(this, lockMac, openCMD.getBytes()); | |
| 1036 | + String openCMD = "Open the door"; | |
| 1037 | + GREENBLE.send(this, lockMac, openCMD.getBytes()); | |
| 1037 | 1038 | // List<LocalMovieMessage> localMovieMessages = new NewDBManager(this).queryRandomMovies(); |
| 1038 | 1039 | // if (localMovieMessages != null && localMovieMessages.size() > 0) { |
| 1039 | 1040 | // OpenMMUtils.openMMWithAds(this, localMovieMessages.get(0).getPlayPath(), null); | ... | ... |
| ... | ... | @@ -2,6 +2,7 @@ package com.xgimi.gimicinema.model; |
| 2 | 2 | |
| 3 | 3 | import android.content.Context; |
| 4 | 4 | import android.text.TextUtils; |
| 5 | +import android.util.Log; | |
| 5 | 6 | import com.gimi.common.cinema.model.RoomInfo; |
| 6 | 7 | import com.gimi.common.cinema.model.RoomQrCodeInfo; |
| 7 | 8 | import com.gimi.common.cinema.model.RoomStatusInfo; |
| ... | ... | @@ -17,11 +18,12 @@ import com.xgimi.gimicinema.application.FangTangApplication; |
| 17 | 18 | * Created by wugian on 2017/4/7 |
| 18 | 19 | */ |
| 19 | 20 | public class RoomInfoModelImpl implements IRoomInfoModel { |
| 20 | - private static final String ROOT_URL = "https://ft.qnbar.cn/develop/api/"; | |
| 21 | + // private static final String ROOT_URL = "https://ft.qnbar.cn/develop/api/"; | |
| 22 | + private static final String ROOT_URL = "https://ft.qnbar.cn/test/api/"; | |
| 21 | 23 | private static final String ROOM_INFO_BY_IMEI_URL = ROOT_URL + "tcp/getRoomInfoByimei?imei="; |
| 22 | 24 | private static final String ROOM_STATUS_BY_ROOM_SN_URL = ROOT_URL + "tcp/getRoomStatus?room_sn="; |
| 23 | 25 | private static final String ROOM_QRCODE_BY_ORDER_SN = ROOT_URL + "tcp/getEndQRCode?order_sn="; |
| 24 | - private static final String ROOM_REPORT_ROOM_STATUS = ROOT_URL + "tcp/tcp/reportRoomStatus?order_sn="; | |
| 26 | + private static final String ROOM_REPORT_ROOM_STATUS = ROOT_URL + "tcp/reportRoomStatus?order_sn="; | |
| 25 | 27 | |
| 26 | 28 | @Override |
| 27 | 29 | public void getRoomInfo(String imei, boolean needUpdate, final GetRoomInfoListener listener) { |
| ... | ... | @@ -139,6 +141,7 @@ public class RoomInfoModelImpl implements IRoomInfoModel { |
| 139 | 141 | |
| 140 | 142 | @Override |
| 141 | 143 | public void onResponse(String response) { |
| 144 | + Log.d("cccccc", response); | |
| 142 | 145 | listener.onOpenDoorSuccess(); |
| 143 | 146 | } |
| 144 | 147 | }); | ... | ... |
| ... | ... | @@ -252,9 +252,11 @@ public class MainPresenter extends BasePresenter |
| 252 | 252 | roomInfoModel.getRoomInfo(imei, false, new RoomInfoModelImpl.GetRoomInfoListener() { |
| 253 | 253 | @Override |
| 254 | 254 | public void onGetRoomInfoSuccess(RoomInfo info) { |
| 255 | + Log.d("room-info", "getOrderInfo:" + info.toString()); | |
| 255 | 256 | roomInfoModel.getRoomStatus(info.getData().getRoom_sn(), new RoomInfoModelImpl.GetRoomStatusListener() { |
| 256 | 257 | @Override |
| 257 | 258 | public void onGetRoomStatusSuccess(RoomStatusInfo info) { |
| 259 | + Log.d("room-info", "getOrderInfo#onGetRoomStatusSuccess:" + info.toString()); | |
| 258 | 260 | RoomStatusInfo.DataEntity data = info.getData(); |
| 259 | 261 | int durationMinutes = data.getEnd_time() - data.getBegin_time(); |
| 260 | 262 | Log.d("CountService", "durationMinutes:" + durationMinutes); |
| ... | ... | @@ -262,6 +264,7 @@ public class MainPresenter extends BasePresenter |
| 262 | 264 | roomInfoModel.getRoomQrCode(data.getOrder_sn(), new RoomInfoModelImpl.GetRoomQrCodeListener() { |
| 263 | 265 | @Override |
| 264 | 266 | public void onGetRoomQrCodeSuccess(RoomQrCodeInfo info) { |
| 267 | + Log.d("room-info", "getOrderInfo#onGetRoomStatusSuccess#onGetRoomQrCodeSuccess:" + info.toString()); | |
| 265 | 268 | mainView.prepareRoomQrCodeInfo(info); |
| 266 | 269 | } |
| 267 | 270 | ... | ... |
Please
register
or
login
to post a comment