drew há 6 anos atrás
pai
commit
40d1b65978

+ 17 - 12
app/src/main/assets/mockData/Room.json

@@ -1,14 +1,19 @@
 {
-    "roomNo": "NK_1BAJC",
-    "roomName": "一号会议室",
-    "siteCode": "zz001001",
-    "siteName": "营业部名称",
-    "branchDeptCode": "分公司zz编号",
-    "branchDeptName": "分公司名称",
-    "remark": "会议室描述",
-    "deviceCode": "电子屏设备号",
+    "uuid": "a406396e-1c25-434a-a575-38e0cb2de8fe",
+    "roomNo": "ZZ001041085-0-1-3",
+    "roomName": "财富管理室",
+    "siteCode": "ZZ001041085",
+    "siteName": null,
+    "branchDeptCode": "ZZ001041107",
+    "branchDeptName": "上海分公司",
+    "remark": null,
+    "deviceCode": "share-SH8001-5-A02",
     "devicePassword": "1234",
-    "capacity": "12",
-    "provideService": "可提供的服务",
-    "roomBizNum": "A03"
-}
+    "capacity": "6",
+    "provideService": null,
+    "roomBizNum": "D02",
+    "function": "视频、无线投屏",
+    "spaceType": "尊享型",
+    "spaceDesc": "配置豪华,功能全面的组合服务空间,主题可定制化",
+    "state": "可预约"
+}

+ 54 - 32
app/src/main/assets/mockData/RoomMeetings.json

@@ -1,44 +1,66 @@
 [
     {
         "room": {
-            "roomNo": "NK_1BAJC",
-            "roomName": "一号会议室",
-            "siteCode": "zz001001",
-            "siteName": "营业部名称",
-            "branchDeptCode": "分公司zz编号",
-            "branchDeptName": "分公司名称",
-            "remark": "会议室描述",
-            "deviceCode": "111111",
-            "devicePassword": "8888",
-            "capacity": "12",
-            "provideService": "可提供的服务",
-            "roomBizNum": "A03"
+            "uuid": "a406396e-1c25-434a-a575-38e0cb2de8fe",
+            "roomNo": "ZZ001041085-0-1-3",
+            "roomName": "财富管理室",
+            "siteCode": "ZZ001041085",
+            "siteName": "上海黄浦区来福士广场证券营业部",
+            "branchDeptCode": null,
+            "branchDeptName": null,
+            "remark": null,
+            "deviceCode": null,
+            "devicePassword": null,
+            "capacity": "",
+            "provideService": null,
+            "roomBizNum": "D02",
+            "function": null,
+            "spaceType": null,
+            "spaceDesc": null,
+            "state": null
         },
         "meetings": [
             {
-                "uuid": "会议唯一ID",
-                "createTime": "会议创建时间",
-                "subject": "会议主题",
-                "description": "会议描述",
+                "uuid": "f2e7ef94-aff6-4e04-93c4-fd2328b351ef",
+                "createTime": 1578980611878,
+                "subject": "测试3",
+                "description": null,
                 "status": "NEW",
-                "beginDate": "2020-01-08",
-                "beginTimeStr": "2020-01-08 10:00:00",
-                "endTimeStr": "2020-01-08 21:37:00",
+                "beginDate": "2020-01-14",
+                "beginTime": 1578973500000,
+                "endTime": 1578975300000,
+                "beginTimeStr": "2020-01-14 11:45:00",
+                "endTimeStr": "2020-01-14 12:15:00",
                 "createUser": {
-                    "userId": "012901",
-                    "userName": "鲁啸"
+                    "userId": "002332",
+                    "userName": "魏巍"
                 },
-                "attendees": [
-                    {
-                        "userId": "011111",
-                        "userName": "张三"
-                    }
-                ],
-                "meetingPurpose": "会议用途",
-                "welcomeText": "欢迎词",
-                "attendeeNum": 1,
-                "meetingService": "选择的会议服务"
+                "attendees": [],
+                "room": {
+                    "uuid": "a406396e-1c25-434a-a575-38e0cb2de8fe",
+                    "roomNo": "ZZ001041085-0-1-3",
+                    "roomName": "财富管理室",
+                    "siteCode": "ZZ001041085",
+                    "siteName": null,
+                    "branchDeptCode": "ZZ001041107",
+                    "branchDeptName": "上海分公司",
+                    "remark": null,
+                    "deviceCode": null,
+                    "devicePassword": null,
+                    "capacity": null,
+                    "provideService": null,
+                    "roomBizNum": null,
+                    "function": null,
+                    "spaceType": null,
+                    "spaceDesc": null,
+                    "state": null
+                },
+                "meetingPurpose": "洽谈、会议",
+                "welcomeText": "王先生",
+                "attendeeNum": "2",
+                "meetingService": "茶水服务、无线投屏",
+                "remind": false
             }
         ]
     }
-]
+]

+ 95 - 86
app/src/main/assets/mockData/投顾.json

@@ -1,90 +1,99 @@
 {
-    "birthPlace": "南京",
-    "birthday": null,
-    "certNo": "320103198303161545",
-    "certType": "ID_CARD",
-    "certifications": [
-        {
-            "certiedType": "02",
-            "certificateAcquisitionTime": 1563206400000,
-            "certificateNumber": "S0570610120372",
-            "class": "com.htsc.crm.employee.core.dto.EmpCertificationDTO",
-            "id": 209197,
-            "userId": "002332"
-        }
-    ],
-    "class": "com.htsc.crm.employee.core.dto.EmpInfoDTO",
-    "contactInfo": {
-        "class": "com.htsc.crm.employee.core.dto.EmpContactInfoDTO",
-        "email": "Tqinxiao@htzq.htsc.com.cn",
-        "mobile": "18951810511",
-        "officeNo": "",
-        "officePhone": "025-84798983",
-        "rowId": 244104,
-        "userId": "002332",
-        "userName": "魏巍"
+  "birthPlace": "南京",
+  "birthday": null,
+  "certNo": "320103198303161545",
+  "certType": "ID_CARD",
+  "certifications": [
+    {
+      "certiedType": "02",
+      "certificateAcquisitionTime": 1563206400000,
+      "certificateNumber": "S0570610120372",
+      "class": "com.htsc.crm.employee.core.dto.EmpCertificationDTO",
+      "id": 209197,
+      "userId": "002332"
+    }
+  ],
+  "class": "com.htsc.crm.employee.core.dto.EmpInfoDTO",
+  "contactInfo": {
+    "address": "南京鼓楼区清凉门大街296号苏宁馨瑰园5幢2单元802室",
+    "class": "com.htsc.crm.employee.core.dto.EmpContactInfoDTO",
+    "email": "Tqinxiao@htzq.htsc.com.cn",
+    "fax": "025-84798864",
+    "homePhone": "025-84505582",
+    "mobile": "18951810511",
+    "officeNo": "",
+    "officePhone": "025-84798983",
+    "rowId": 244104,
+    "userId": "002332",
+    "userName": "魏巍"
+  },
+  "depcity": "DF1501",
+  "description": null,
+  "empLabelDTOs": [
+    {
+      "class": "com.htsc.crm.employee.extend.dto.EmpLabelDTO",
+      "createdBy": "006073",
+      "id": 58,
+      "lastUpdatedBy": "006073",
+      "name": "融资服务"
     },
-    "depcity": "DF1501",
-    "description": "123",
-    "empLabelDTOs": [
-        {
-            "class": "com.htsc.crm.employee.extend.dto.EmpLabelDTO",
-            "createdBy": "006073",
-            "id": 58,
-            "lastUpdatedBy": "006073",
-            "name": "融资服务"
-        },
-        {
-            "class": "com.htsc.crm.employee.extend.dto.EmpLabelDTO",
-            "createdBy": "006073",
-            "id": 48,
-            "lastUpdatedBy": "006073",
-            "name": "波段操作"
-        },
-        {
-            "class": "com.htsc.crm.employee.extend.dto.EmpLabelDTO",
-            "createdBy": "006073",
-            "id": 47,
-            "lastUpdatedBy": "006073",
-            "name": "趋势投资"
-        },
-        {
-            "class": "com.htsc.crm.employee.extend.dto.EmpLabelDTO",
-            "createdBy": "006073",
-            "id": 41,
-            "lastUpdatedBy": "006073",
-            "name": "稳健投资"
-        }
-    ],
-    "entryTime": null,
-    "gender": "女",
-    "halfBodyPhoto": "http://s3.cn-north-1.amazonaws.com.cn/s3-000045-cfglpic/632fda26-4e7c-4048-af28-1dd078276aea_QQ图片20190730144159.png",
-    "hasExhibitionQua": true,
-    "headShot": "https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2020-01-08-17-05-20ZEhHJDfT.png",
-    "highLevel": "BACHELOR",
-    "incumbency": "NORMAL",
-    "levTime": null,
-    "marriage": "MARRIED",
-    "nation": "1",
-    "nativePlace": "南京",
-    "onDutyInvest": true,
-    "onLineInvest": true,
-    "party": "MEMBER_CCP",
-    "primaryJob": {
-        "class": "com.htsc.crm.employee.core.dto.EmpJobInfoDTO",
-        "jobId": 4923,
-        "jobName": "投资顾问",
-        "major": true,
-        "orgId": "ZZ001041051",
-        "orgName": "南京长江路证券营业部",
-        "parOrgCode": "ZZ001041093",
-        "parOrgName": "南京分公司",
-        "rowId": 93260,
-        "userId": "002332"
+    {
+      "class": "com.htsc.crm.employee.extend.dto.EmpLabelDTO",
+      "createdBy": "006073",
+      "id": 48,
+      "lastUpdatedBy": "006073",
+      "name": "波段操作"
     },
-    "rowId": 449590,
-    "tgStarLevel": 4.8,
-    "userId": "002332",
-    "userName": "魏巍",
-    "userStatus": "ON_DUTY"
+    {
+      "class": "com.htsc.crm.employee.extend.dto.EmpLabelDTO",
+      "createdBy": "006073",
+      "id": 47,
+      "lastUpdatedBy": "006073",
+      "name": "趋势投资"
+    },
+    {
+      "class": "com.htsc.crm.employee.extend.dto.EmpLabelDTO",
+      "createdBy": "006073",
+      "id": 41,
+      "lastUpdatedBy": "006073",
+      "name": "稳健投资"
+    }
+  ],
+  "entryTime": null,
+  "gender": "女",
+  "halfBodyPhoto": "http://s3.cn-north-1.amazonaws.com.cn/s3-000045-cfglpic/632fda26-4e7c-4048-af28-1dd078276aea_QQ图片20190730144159.png",
+  "hasExhibitionQua": true,
+  "headShot": "http://s3.cn-north-1.amazonaws.com.cn/s3-000045-cfglpic/a7e29ca6-20ca-45dd-9ad1-b0402a96c602_TIM图片20190705181004.png",
+  "highLevel": "BACHELOR",
+  "incumbency": "NORMAL",
+  "levTime": null,
+  "marriage": "MARRIED",
+  "nation": "1",
+  "nativePlace": "南京",
+  "onDutyInvest": true,
+  "onLineInvest": true,
+  "party": "MEMBER_CCP",
+  "primaryJob": {
+    "class": "com.htsc.crm.employee.core.dto.EmpJobInfoDTO",
+    "jobId": 4923,
+    "jobName": "投资顾问",
+    "major": true,
+    "orgId": "ZZ001041051",
+    "orgName": "南京长江路证券营业部",
+    "parOrgCode": "ZZ001041093",
+    "parOrgName": "南京分公司",
+    "rowId": 93260,
+    "userId": "002332"
+  },
+  "properties": {
+    "halfBodyPhoto": "{\"imgKey\":\"http://s3.cn-north-1.amazonaws.com.cn/s3-000045-cfglpic/632fda26-4e7c-4048-af28-1dd078276aea_QQ图片20190730144159.png\",\"imgName\":\"QQ图片20190730144159.png\"}",
+    "headShort": "{\"imgKey\":\"http://s3.cn-north-1.amazonaws.com.cn/s3-000045-cfglpic/a7e29ca6-20ca-45dd-9ad1-b0402a96c602_TIM图片20190705181004.png\",\"imgName\":\"TIM图片20190705181004.png\"}",
+    "openAccountUrl": "",
+    "qrCodeUrl": "http://s3.cn-north-1.amazonaws.com.cn/s3-000045-cfglpic/6756040b-dcaf-49a8-9c48-459f95fbb555_524A7D0F-99A8-4F3B-BDD4-9BAE86B1B638.jpeg"
+  },
+  "rowId": 449590,
+  "tgStarLevel": 4.8,
+  "userId": "002332",
+  "userName": "魏巍",
+  "userStatus": "ON_DUTY"
 }

+ 10 - 9
app/src/main/java/com/ht/gate/ApiService.java

@@ -7,20 +7,21 @@ import com.ht.gate.domain.emp.EmpInfo;
 import java.util.List;
 
 import retrofit2.Call;
-import retrofit2.http.Multipart;
+import retrofit2.http.Body;
 import retrofit2.http.POST;
-import retrofit2.http.Part;
 import retrofit2.http.Path;
+import retrofit2.http.Query;
 
 public interface ApiService {
-    @POST("/meeting/service-api/crmnew/bind-device/{deviceId}")
+    @POST("meeting/service-api/crmnew/bind-device/{deviceId}")
     Call<Room> bindDevice(@Path("deviceId") String deviceId);
 
-    @POST("/meeting/service-api/crmnew/find-room-meetings")
-    @Multipart
-    Call<List<RoomMeetings>> roomMeetings(@Part("beginTime") String beginTime, @Part("endTime") String endTime, @Part("roomNo") String roomNo);
+    @POST("meeting/service-api/crmnew/find-room-meetings")
+    Call<List<RoomMeetings>> roomMeetings(@Body QueryMeetingBody body);
 
-    @POST("/empInfo")
-    @Multipart
-    Call<EmpInfo> getEmpInfo(@Part("empId") String empId);
+    @POST("http://168.63.65.40:8090/employee-center/EmpService/queryEmpInfoByEmpId")
+    Call<EmpInfo> getEmpInfo(@Query("empId") String empId);
+
+//    @POST("employee-center/EmpService/queryEmpInfoByEmpId")
+//    Call<EmpInfo> getEmpInfo(@Query("empId") String empId);
 }

+ 49 - 1
app/src/main/java/com/ht/gate/MainActivity.java

@@ -10,7 +10,9 @@ import android.content.ComponentName;
 import android.content.Intent;
 import android.content.ServiceConnection;
 import android.os.Bundle;
+import android.os.Handler;
 import android.os.IBinder;
+import android.os.Message;
 import android.util.Log;
 import android.util.TypedValue;
 import android.view.View;
@@ -44,6 +46,8 @@ import retrofit2.Response;
 public class MainActivity extends AppCompatActivity {
     private static final String TAG = "MainActivity";
 
+    private static final int HIDE_BAR = 10000;
+
     @BindView(R.id.unlock_view)
     UnlockView unlockView;
     @BindView(R.id.tv_room_name)
@@ -57,6 +61,18 @@ public class MainActivity extends AppCompatActivity {
     private MeetingAdapter adapter;
     private DoorService.DoorBinder mDoorBinder;
 
+    private Handler handler = new Handler(msg -> {
+        switch (msg.what) {
+            case HIDE_BAR:
+                View decorView = getWindow().getDecorView();
+                int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+                        | View.SYSTEM_UI_FLAG_FULLSCREEN
+                        | View.SYSTEM_UI_FLAG_IMMERSIVE;
+                decorView.setSystemUiVisibility(uiOptions);
+        }
+        return true;
+    });
+
     private ServiceConnection connection = new ServiceConnection() {
         @Override
         public void onServiceConnected(ComponentName name, IBinder service) {
@@ -88,14 +104,46 @@ public class MainActivity extends AppCompatActivity {
                 @Override
                 public void onConfirm(PasswordDialog dialog, String password) {
                     dialog.dismiss();
-                    if (MyApplication.getPassword() != null && MyApplication.getPassword().equals(password)) {
+
+                    if (MyApplication.roomInfo != null && MyApplication.roomInfo.getDevicePassword().equals(password)) {
                         if (mDoorBinder != null) {
                             mDoorBinder.getService().openDoor();
                         }
+                        Toasty.normal(MainActivity.this, "已解锁").show();
+
+//                        try {
+//                            Meeting meeting = MyApplication.todayMeetings.get(0).getMeetings().get(0);
+//                            RetrofitManager.getInstance().getRetrofit().create(ApiService.class)
+//                                    .getEmpInfo(meeting.getCreateUser().getUserId()).enqueue(new Callback<EmpInfo>() {
+//                                @Override
+//                                public void onResponse(@NonNull Call<EmpInfo> call, @NonNull Response<EmpInfo> response) {
+//                                    if (response.code() == 200) {
+//                                        WelcomeActivity.start(MainActivity.this, meeting, response.body());
+//                                    } else {
+//                                        try {
+//                                            Toasty.error(MainActivity.this, response.errorBody().string()).show();
+//                                        } catch (IOException e) {
+//                                            e.printStackTrace();
+//                                        }
+//                                    }
+//                                }
+//
+//                                @Override
+//                                public void onFailure(@NonNull Call<EmpInfo> call, @NonNull Throwable t) {
+//                                    Toasty.error(MainActivity.this, "设备绑定失败,请稍后再试").show();
+//                                }
+//                            });
+//                        } catch (Exception e) {
+//                            e.printStackTrace();
+//                        }
+
                     } else {
                         Toasty.normal(MainActivity.this, "密码错误", ContextCompat.getDrawable(MainActivity.this, R.mipmap.toast_icon_warn_fill))
                                 .show();
                     }
+                    Message msg = new Message();
+                    msg.what = HIDE_BAR;
+                    handler.sendMessageDelayed(msg, 1000);
                 }
             });
             passwordDialog.show();

+ 1 - 1
app/src/main/java/com/ht/gate/MockServer.java

@@ -18,7 +18,7 @@ public class MockServer {
         MockNet mockNet = MockNet.create();
         mockNet.addConnection(MockConnectionFactory.getInstance()
                 .createGeneralConnection(MockConnection.POST,
-                        "/meeting/service-api/crmnew/bind-device/ABC-123",
+                        "/meeting/service-api/crmnew/bind-device/share-SH8001-5-A02",
                         "text/json",
                         loadAssetTextAsString(context, "mockData/Room.json")))
                 .addConnection(MockConnectionFactory.getInstance()

+ 6 - 3
app/src/main/java/com/ht/gate/MyApplication.java

@@ -55,7 +55,9 @@ public class MyApplication extends Application {
         super.onCreate();
         sharedPreferences = getSharedPreferences(SettingsActivity.PREF_NAME_SETTINGS, MODE_PRIVATE);
         roomInfo = Room.fromBase64(sharedPreferences.getString(Constants.PREF_ROOM_INFO, null));
-        password = sharedPreferences.getString(Constants.PREF_PASSWORD, null);
+        if (roomInfo != null) {
+            password = sharedPreferences.getString(Constants.PREF_PASSWORD, null);
+        }
         if (password == null && roomInfo != null) {
             password = roomInfo.getDevicePassword();
             sharedPreferences.edit().putString(Constants.PREF_PASSWORD, password).apply();
@@ -72,7 +74,7 @@ public class MyApplication extends Application {
             public void run() {
                 getMeetings();
             }
-        }, 0, 10 * 60 * 1000);
+        }, 0, 10 * 1000);
 
         CaocConfig.Builder.create()
                 .backgroundMode(CaocConfig.BACKGROUND_MODE_SILENT) //default: CaocConfig.BACKGROUND_MODE_SHOW_CUSTOM
@@ -93,7 +95,7 @@ public class MyApplication extends Application {
             SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA);
             String dateStr = simpleDateFormat.format(date);
             RetrofitManager.getInstance().getRetrofit().create(ApiService.class)
-                    .roomMeetings(dateStr + "00:00:00", dateStr + "23:59:59", room.getRoomNo()).enqueue(new Callback<List<RoomMeetings>>() {
+                    .roomMeetings(new QueryMeetingBody(dateStr + " 00:00:00", dateStr + " 23:59:59", room.getRoomNo())).enqueue(new Callback<List<RoomMeetings>>() {
                 @Override
                 public void onResponse(@NonNull Call<List<RoomMeetings>> call, @NonNull Response<List<RoomMeetings>> response) {
                     if (response.code() == 200) {
@@ -111,6 +113,7 @@ public class MyApplication extends Application {
                 @Override
                 public void onFailure(@NonNull Call<List<RoomMeetings>> call, @NonNull Throwable t) {
                     Toasty.info(MyApplication.this, "获取会议列表失败").show();
+                    t.printStackTrace();
                 }
             });
         }

+ 20 - 0
app/src/main/java/com/ht/gate/QueryMeetingBody.java

@@ -0,0 +1,20 @@
+package com.ht.gate;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+public class QueryMeetingBody {
+    private String beginTime;
+
+    private String endTime;
+
+    private String roomNo;
+
+    public QueryMeetingBody(String beginTime, String endTime, String roomNo) {
+        this.beginTime = beginTime;
+        this.endTime = endTime;
+        this.roomNo = roomNo;
+    }
+}

+ 2 - 1
app/src/main/java/com/ht/gate/RetrofitManager.java

@@ -12,7 +12,8 @@ import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
 import retrofit2.converter.gson.GsonConverterFactory;
 
 public class RetrofitManager {
-    private final String BASE_URL = "http://localhost:8080";
+//    private final String BASE_URL = "http://localhost:8080/";
+    private final String BASE_URL = "http://168.63.118.97:8080/jtxt/";
     private static RetrofitManager sInstance;
     private Retrofit mRetrofit;
 

+ 2 - 1
app/src/main/java/com/ht/gate/WelcomeActivity.java

@@ -124,10 +124,11 @@ public class WelcomeActivity extends AppCompatActivity {
                 @Override
                 public void onConfirm(PasswordDialog dialog, String password) {
                     dialog.dismiss();
-                    if (MyApplication.getPassword() != null && MyApplication.getPassword().equals(password)) {
+                    if (MyApplication.roomInfo != null && MyApplication.roomInfo.getDevicePassword().equals(password)) {
                         if (mDoorBinder != null) {
                             mDoorBinder.getService().openDoor();
                         }
+                        Toasty.normal(WelcomeActivity.this, "已解锁").show();
                     } else {
                         Toasty.normal(WelcomeActivity.this, "密码错误", ContextCompat.getDrawable(WelcomeActivity.this, R.mipmap.toast_icon_warn_fill))
                                 .show();

+ 1 - 1
app/src/main/java/com/ht/gate/domain/Room.java

@@ -28,7 +28,7 @@ public class Room implements Serializable {
     private String remark;
     private String deviceCode; //电子屏设备号
     private String devicePassword; //电子屏设备管理密码
-    private Integer capacity; //可容纳人数
+    private String capacity; //可容纳人数
     private String provideService; //可提供的服务
     private String roomBizNum;