From 979d9cff22806f213b420452ab4a68fcbaf021b6 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 31 五月 2021 17:43:49 +0800
Subject: [PATCH] 1. 修复多项可能引起空指针崩溃的bug; 2. 新建子任务时默认执行人员从全体人员改为当前用户; 3. 新建子任务时默认执行时间强制固定为总任务对应的时段内,确保子任务执行时间不会超出总任务范围。

---
 app/src/main/java/cn/flightfeather/thirdapp/util/MyPreference.kt                             |   57 ++++
 app/src/main/java/cn/flightfeather/thirdapp/activity/LoginActivity.java                      |    2 
 app/src/main/java/cn/flightfeather/thirdapp/fragment/SettingFragment.java                    |    5 
 app/src/main/java/cn/flightfeather/thirdapp/module/MainActivity.java                         |    6 
 app/src/main/java/cn/flightfeather/thirdapp/util/push/LoginInitializer.kt                    |   34 ++
 app/src/main/java/cn/flightfeather/thirdapp/util/updateApp/UpdateAppUtil.java                |    3 
 app/src/main/java/cn/flightfeather/thirdapp/module/base/BaseMapActivity.kt                   |    3 
 app/src/main/java/cn/flightfeather/thirdapp/util/push/MyMessageReceiver.kt                   |   72 ++++++
 app/aliyun-emas-services.json                                                                |   49 ++++
 app/build.gradle                                                                             |    1 
 app/src/main/java/cn/flightfeather/thirdapp/fragment/TaskFragment.java                       |    3 
 app/src/main/java/cn/flightfeather/thirdapp/module/home/HomeFragment.java                    |    2 
 app/src/main/java/cn/flightfeather/thirdapp/module/inspectioninfo/ProblemChangeFragment.java |    2 
 app/src/main/java/cn/flightfeather/thirdapp/module/task/NewSubTaskActivity.kt                |   56 +++-
 app/src/main/java/cn/flightfeather/thirdapp/util/notification/MyNotificationChannel.kt       |   42 +++
 app/src/main/java/cn/flightfeather/thirdapp/util/push/MyMessageIntentService.kt              |   96 ++++++++
 app/src/main/AndroidManifest.xml                                                             |   18 +
 app/src/main/java/cn/flightfeather/thirdapp/adapter/ContentFragmentAdapter.java              |    2 
 app/src/main/java/cn/flightfeather/thirdapp/module/login/CardFragment.java                   |    4 
 app/src/main/java/cn/flightfeather/thirdapp/module/home/HomeFragment_scene.java              |    2 
 app/src/main/java/cn/flightfeather/thirdapp/module/inspection/InspectionDetailActivity.kt    |    3 
 app/src/main/res/layout/fragment_home.xml                                                    |    2 
 app/src/main/java/cn/flightfeather/thirdapp/util/GlobalConfig.kt                             |   21 +
 /dev/null                                                                                    |   37 ---
 app/src/main/java/cn/flightfeather/thirdapp/activity/UploadMediaFilesActivity.java           |    1 
 app/src/main/java/cn/flightfeather/thirdapp/module/task/NewSubTaskViewModel.kt               |   28 +
 app/src/main/res/layout/fragment_home_competent.xml                                          |    2 
 app/src/main/java/cn/flightfeather/thirdapp/CommonApplication.java                           |   17 +
 app/src/main/java/com/ping/greendao/gen/DaoSession.java                                      |   28 +-
 app/src/main/java/cn/flightfeather/thirdapp/module/inspection/BaseProblemListActivity.kt     |    4 
 app/src/main/java/cn/flightfeather/thirdapp/activity/ScenseMapActivity.java                  |   15 
 app/src/main/java/cn/flightfeather/thirdapp/util/push/PushService.kt                         |   65 +++++
 app/src/main/java/com/ping/greendao/gen/DaoMaster.java                                       |    6 
 app/src/main/java/cn/flightfeather/thirdapp/module/home/HomeFragment_comptent.java           |    2 
 34 files changed, 586 insertions(+), 104 deletions(-)

diff --git a/app/aliyun-emas-services.json b/app/aliyun-emas-services.json
new file mode 100644
index 0000000..79f2bf9
--- /dev/null
+++ b/app/aliyun-emas-services.json
@@ -0,0 +1,49 @@
+{
+  "config": {
+    "emas.appKey":"333388958",
+    "emas.appSecret":"1836d953e9f2434a9e8a3f94cc8aff93",
+    "emas.packageName":"cn.flightfeather.thirdapp",
+    "hotfix.idSecret":"333388958-1",
+    "hotfix.rsaSecret":"MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCflE9YnKCC9YEgsyn3f0M4IQNGr6qBr8SFDKG/Iu3Bkfx8YwsQu2WqhWzVggQazZY5V1t5spUGQgcKA18m/MQ7Cxyc52+QGnyXT2GkCFxZNLpxAE04uUSBDsh9PvhPkzaYXCxoxWfHokgjk67G7rgVGkSWuiaZrbUdTtlIT/tt45bi9GAhILFuZZ/ztMdh+SKH9jvMRrUZU4S+vUPprgkEN7SiTrOjYiAcM91lZ9cdxj86BpmQ6ljhtbbf8wAs+H8Rr8dGp8NkzhppnlAAQwcsbyTo63WgBBtFIIU/EbxoECr10n5oE3bv+3puc7LtB51WjONTFEJBEiQuu+rVLyNRAgMBAAECggEBAJtmBc641+YvxUteraOCnqbuHw6aymP4EluubWSAUx+JVmKa4I+urdZckBtqvSyMv5mfZEkiitTJP6mUlviUdVM6AucYyR9/a4y9lMv0CFomatjX/lsar4cuKjctNwnmxeeg+u4cLm/NrIpYqn62wTRrnBdbt3M4IYMk4Zr1qFbdG6qr0fLBgC1nKJTzQTis7LPdPnmbS6FfGCxQsa4EA6Qfb+fq3ge99vmPSlDrQbWh5YLPrf2jaVfukH1ib+Sakv/pLh3c6ic5PENWHWfs4jHEdjo8Ng575b2Us/VLsbEkC9JYqb1Q6U9+uKv+l99y0c95vwsvdaSIGnNyxvNXrXECgYEA2hvrrD8/R3/crCGXBpIWoTRuT/iOppWZ+zAmMF1o5jvMN0bSI0rm7mD6tqo8+5B1Odw7yMf4zzOng8L7TZ8h0RSaRxsQ2+R8ZTMIxD0RL5Sdh91mYTCF6yIyP2lXJiAgR7GMoNBUwc4BrT/oh8sDjlA2P9kfmS4hI5+3cfOW1QsCgYEAu01dqLyYBxUHpx/nVd8eefE/KcgozQQCuqAXhpCIAVw/UTxhR4Ge9siQTxVycMCIu6sTrFtyKN3CDDxrmjOPDkgP6Kj0NOcCq+/U57mXLLfFIV/X3xtUEZSh/PMsTYuLVD8zYZqnj1hFufLoJokov7RZgCQrHUG88Jh2jzk9KpMCgYA3XlEkp+Wrg/UEKX7KZzmhcMr0ODgWZ/HwB1gafQwNLm74NV1RIkmfiDT9PBhBEHoB1zvCC6nJB+bllxDuspAGIMHNfTx5ZfaCRkNaddowBv06qWS9FXFZsJOq71X1UsB/Er6NcHWjwWVBkvC30Dy12vz6lmbkHwbAoWITZnAK4wKBgHjPzjmoa+cliWojCfQ5lk7RbQxmLusOSzRVTtddIly+Q5kCeTzGPuKvO2XHT6mqhoeGMYpa8aeqYh/CWSV9XCi6EojfcaUt3GtKpulQrFILtvtv9q3R0sgENvgRYeIiwBv3KA0s1CeBqHfoVhWFIuOEULZ2ndihLl2B+fcn1GxBAoGBAMjCk7WIXV0bxIFA/7e7XnMEFpM8t+ycfWWNig3bP8/Vcc1utyQ3PMIRRf/ksGa0hNEfjUhIqymNB01XvX7nvyBMXNKYKj8EMYtOo2SM78pa8S9B5ZgLrHvE6b2D2T3TXELl18MXSLv7GboDzG8XmFZ5yt8aUEPn3rHfhBQu59MM",
+    "httpdns.accountId":"181675",
+    "httpdns.secretKey":"08a9a1d5ae2ed3579280e0fff5292f16",
+    "appmonitor.tlog.rsaSecret":"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+Xc/Yr0Cy2CiVXXdb44kqIFBe0mTjl4dF3xFG427ObC4yL/KFrdTmDiNb6FkYu1lpqICdbWPLIHxPgrTOiadvwWUPtzs/5tZhhnfNPFN/L39q52KKrz6YZ22a8B3FndHXHgg4rcLA3evqEQQqNra0H2H1glVaII16huwGWcdYFwIDAQAB",
+    "appmonitor.rsaSecret":"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+Xc/Yr0Cy2CiVXXdb44kqIFBe0mTjl4dF3xFG427ObC4yL/KFrdTmDiNb6FkYu1lpqICdbWPLIHxPgrTOiadvwWUPtzs/5tZhhnfNPFN/L39q52KKrz6YZ22a8B3FndHXHgg4rcLA3evqEQQqNra0H2H1glVaII16huwGWcdYFwIDAQAB"
+  },
+  "services": {
+    "hotfix_service":{
+      "status":1,
+      "version":"3.2.17"
+    },
+    "ha-adapter_service":{
+      "status":1,
+      "version":"1.1.3.8-open"
+    },
+    "feedback_service":{
+      "status":1,
+      "version":"3.3.2"
+    },
+    "tlog_service":{
+      "status":1,
+      "version":"1.1.3.1-open"
+    },
+    "httpdns_service":{
+      "status":1,
+      "version":"2.0.0"
+    },
+    "apm_service":{
+      "status":1,
+      "version":"1.0.8.2-open"
+    },
+    "man_service":{
+      "status":1,
+      "version":"1.2.5"
+    },
+    "cps_service":{
+      "status":1,
+      "version":"3.2.5"
+    }
+  },
+  "use_maven":true,
+  "proguard_keeplist":"\n#httpdns\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n\n#cps\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n-keepclasseswithmembernames class ** {\nnative <methods>;\n}\n-keepattributes Signature\n-keep class sun.misc.Unsafe { *; }\n-keep class com.alipay.** {*;}\n-dontwarn com.alipay.**\n-keep class anet.**{*;}\n-keep class org.android.spdy.**{*;}\n-keep class org.android.agoo.**{*;}\n-dontwarn anet.**\n-dontwarn org.android.spdy.**\n-dontwarn org.android.agoo.**\n\n#hotfix\n#鍩虹嚎鍖呬娇鐢紝鐢熸垚mapping.txt\n-printmapping mapping.txt\n#鐢熸垚鐨刴apping.txt鍦╝pp/buidl/outputs/mapping/release璺緞涓嬶紝绉诲姩鍒�/app璺緞涓媆n#淇鍚庣殑椤圭洰浣跨敤锛屼繚璇佹贩娣嗙粨鏋滀竴鑷碶n#-applymapping mapping.txt\n#hotfix\n-keep class com.taobao.sophix.**{*;}\n-keep class com.ta.utdid2.device.**{*;}\n#闃叉inline\n-dontoptimize\n\n#man\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n\n#feedback\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n"
+}
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index c2b3b5f..fc391d5 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -4,6 +4,7 @@
 apply plugin: 'kotlin-android-extensions' // apply plugin
 apply plugin: 'kotlin-kapt'
 apply plugin: 'com.jakewharton.butterknife'
+apply plugin: 'com.aliyun.ams.emas-services'
 
 android {
     compileSdkVersion 28
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 3b74d86..1268b68 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -33,15 +33,18 @@
         android:name="android.permission.REQUEST_INSTALL_PACKAGES"
         tools:ignore="ProtectedPermissions" />
 
+    <!--    Android 9 绯荤粺涓婇粯璁ゆ墍鏈塇ttp璇锋眰琚姝紝娣诲姞android:usesCleartextTraffic="true" 锛岀‘淇滱ndroid 9涓婂彲浠ョ敤tbs鎵撳紑鏂囨。-->
     <application
         android:name=".CommonApplication"
         android:allowBackup="true"
+        tools:replace="android:allowBackup"
         android:hardwareAccelerated="true"
         android:icon="@mipmap/ic_launcher"
         android:label="@string/app_name"
         android:networkSecurityConfig="@xml/network_config"
         android:roundIcon="@mipmap/ic_launcher_round"
         android:supportsRtl="true"
+        android:usesCleartextTraffic="true"
         android:theme="@style/AppTheme.NoActionBar"
         tools:ignore="GoogleAppIndexingWarning, LockedOrientationActivity"
         tools:targetApi="n">
@@ -70,6 +73,21 @@
             </intent-filter>
         </receiver>
 
+        <receiver
+            android:name=".util.push.MyMessageReceiver"
+            android:exported="false"> <!-- 涓轰繚璇乺eceiver瀹夊叏锛屽缓璁缃笉鍙鍑猴紝濡傞渶瀵瑰叾浠栧簲鐢ㄥ紑鏀惧彲閫氳繃android锛歱ermission杩涜闄愬埗 -->
+            <intent-filter>
+                <action android:name="com.alibaba.push2.action.NOTIFICATION_OPENED" />
+            </intent-filter>
+            <intent-filter>
+                <action android:name="com.alibaba.push2.action.NOTIFICATION_REMOVED" />
+            </intent-filter>
+            <intent-filter>
+                <action android:name="com.alibaba.sdk.android.push.RECEIVE" />
+            </intent-filter>
+        </receiver>
+        
+
         <activity
             android:name=".module.MainActivity"
             android:label="@string/app_name"
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/CommonApplication.java b/app/src/main/java/cn/flightfeather/thirdapp/CommonApplication.java
index 40bb282..708c711 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/CommonApplication.java
+++ b/app/src/main/java/cn/flightfeather/thirdapp/CommonApplication.java
@@ -16,7 +16,10 @@
 
 import cn.flightfeather.thirdapp.bean.entity.Userinfo;
 import cn.flightfeather.thirdapp.common.net.RetrofitFactory;
+import cn.flightfeather.thirdapp.util.GlobalConfig;
 import cn.flightfeather.thirdapp.util.crashreport.MyCrashHandler;
+import cn.flightfeather.thirdapp.util.notification.MyNotificationChannel;
+import cn.flightfeather.thirdapp.util.push.PushService;
 import cn.flightfeather.thirdapp.util.tbs.Tbs;
 import retrofit2.Retrofit;
 import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
@@ -55,6 +58,12 @@
 
         //x5鍐呮牳鍒濆鍖�
         Tbs.Companion.init(this);
+
+        //Android8.0鍚庢敞鍐岄�氱煡閫氶亾
+        MyNotificationChannel.Companion.init(this);
+
+        //鍒濆鍖栫Щ鍔ㄦ帹閫�
+        PushService.Companion.init(this);
 
         if (instance == null) {
             instance = this;
@@ -155,12 +164,18 @@
     public Userinfo getCurrentUser() {
         if (currentUser ==null){
             userinfoDao = this.getDaoSession().getUserinfoDao();
-            currentUser = userinfoDao.queryBuilder().unique();
+            String userId = GlobalConfig.Companion.getInstance().getUserId();
+            if (userId == null) {
+                currentUser = userinfoDao.queryBuilder().unique();
+            } else {
+                currentUser = userinfoDao.queryBuilder().where(UserinfoDao.Properties.Guid.eq(userId)).unique();
+            }
         }
         return currentUser;
     }
 
     public void setCurrentUser(Userinfo currentUser) {
+        GlobalConfig.Companion.getInstance().setUserId(currentUser.getGuid());
         this.currentUser = currentUser;
     }
 
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/activity/LoginActivity.java b/app/src/main/java/cn/flightfeather/thirdapp/activity/LoginActivity.java
index 25b4d35..a9a1250 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/activity/LoginActivity.java
+++ b/app/src/main/java/cn/flightfeather/thirdapp/activity/LoginActivity.java
@@ -16,7 +16,7 @@
 import cn.flightfeather.thirdapp.R;
 import cn.flightfeather.thirdapp.adapter.ContentFragmentAdapter;
 import cn.flightfeather.thirdapp.CommonApplication;
-import cn.flightfeather.thirdapp.fragment.CardFragment;
+import cn.flightfeather.thirdapp.module.login.CardFragment;
 import cn.flightfeather.thirdapp.util.updateApp.UpdateAppUtil;
 import cn.flightfeather.thirdapp.view.OrientedViewPager;
 import cn.flightfeather.thirdapp.view.VerticalStackTransformer;
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/activity/ScenseMapActivity.java b/app/src/main/java/cn/flightfeather/thirdapp/activity/ScenseMapActivity.java
index abc30b9..913f727 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/activity/ScenseMapActivity.java
+++ b/app/src/main/java/cn/flightfeather/thirdapp/activity/ScenseMapActivity.java
@@ -55,7 +55,6 @@
 import cn.flightfeather.thirdapp.bean.entity.Scense;
 import cn.flightfeather.thirdapp.bean.entity.Subtask;
 import cn.flightfeather.thirdapp.bean.entity.Town;
-import cn.flightfeather.thirdapp.module.MainActivity;
 import cn.flightfeather.thirdapp.task.ObtainBoundaryRunnable;
 import cn.flightfeather.thirdapp.util.Area;
 import cn.flightfeather.thirdapp.util.CommonUtils;
@@ -534,15 +533,15 @@
                 }
                 break;
             case R.id.iBtn_data:
-                Intent detailIntent = new Intent(this, TaskDetailActivity.class);
-                detailIntent.putExtra(Constant.KEY_INTENT_SUBTASK, mSubTaskList.get(curPos));
-                startActivity(detailIntent);
+//                Intent detailIntent = new Intent(this, TaskDetailActivity.class);
+//                detailIntent.putExtra(Constant.KEY_INTENT_SUBTASK, mSubTaskList.get(curPos));
+//                startActivity(detailIntent);
                 break;
             case R.id.iBtn_inspection:
-                Intent inspectionIntent = new Intent(this, MainActivity.class);
-                inspectionIntent.putExtra(Constant.KEY_INTENT_SUBTASK, mSubTaskList.get(curPos));
-                setResult(RESULT_OK, inspectionIntent);
-                this.finish();
+//                Intent inspectionIntent = new Intent(this, MainActivity.class);
+//                inspectionIntent.putExtra(Constant.KEY_INTENT_SUBTASK, mSubTaskList.get(curPos));
+//                setResult(RESULT_OK, inspectionIntent);
+//                this.finish();
                 break;
         }
     }
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/activity/UploadMediaFilesActivity.java b/app/src/main/java/cn/flightfeather/thirdapp/activity/UploadMediaFilesActivity.java
index 9a3717e..b6a2899 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/activity/UploadMediaFilesActivity.java
+++ b/app/src/main/java/cn/flightfeather/thirdapp/activity/UploadMediaFilesActivity.java
@@ -112,6 +112,7 @@
             mediaFileListCurrent.removeAll(mediaFileListCurrent);
             mediaFileListCurrent.addAll(mediaFileList2);
             photoTotal = mediaFileListCurrent.size();
+            photoUploaded = 0;
             adapter.notifyDataSetChanged();
         }
     }
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/adapter/ContentFragmentAdapter.java b/app/src/main/java/cn/flightfeather/thirdapp/adapter/ContentFragmentAdapter.java
index 64f21fc..e6e79f4 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/adapter/ContentFragmentAdapter.java
+++ b/app/src/main/java/cn/flightfeather/thirdapp/adapter/ContentFragmentAdapter.java
@@ -13,7 +13,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import cn.flightfeather.thirdapp.fragment.CardFragment;
+import cn.flightfeather.thirdapp.module.login.CardFragment;
 
 
 public class ContentFragmentAdapter extends FragmentStatePagerAdapter {
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/common/StatusBar.java b/app/src/main/java/cn/flightfeather/thirdapp/common/StatusBar.java
deleted file mode 100644
index d2322b0..0000000
--- a/app/src/main/java/cn/flightfeather/thirdapp/common/StatusBar.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package cn.flightfeather.thirdapp.common;
-
-import android.os.Build;
-import android.support.v4.app.Fragment;
-import android.view.ViewGroup;
-
-/**
- * Created by note_ff_1603 on 2017/7/28.
- */
-
-public class StatusBar {
-    private Fragment fragment;
-
-    public StatusBar(Fragment fragment) {
-        this.fragment = fragment;
-    }
-    public StatusBar(android.app.Fragment fragment) {
-    }
-
-    public StatusBar(){
-    }
-
-    //鍒濆鍖栧崐閫忔槑鐘舵�佹爮
-    public void initTransparentStatsBar(ViewGroup viewGroup) {
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-            viewGroup.setPadding(0, getStatusBarHeight(), 0, 0);
-        }
-    }
-
-    //鑾峰緱鐘舵�佹爮楂樺害
-    public int getStatusBarHeight() {
-        int result = 0;
-        int resourceId = fragment.getResources().getIdentifier("status_bar_height", "dimen", "android");
-        if (resourceId > 0) {
-            result = fragment.getResources().getDimensionPixelSize(resourceId);
-        }
-        return result;
-    }
-}
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/common/database/DbLink.java b/app/src/main/java/cn/flightfeather/thirdapp/common/database/DbLink.java
deleted file mode 100644
index 427c8bc..0000000
--- a/app/src/main/java/cn/flightfeather/thirdapp/common/database/DbLink.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package cn.flightfeather.thirdapp.common.database;
-
-import android.content.Context;
-
-import cn.flightfeather.thirdapp.CommonApplication;
-
-/**
- * @author riku
- * 杩炴帴褰撳墠浣跨敤鐨勬暟鎹簱
- */
-// FIXME: 2019/3/27 by riku 鐩墠浠g爜涓緢澶氬湴鏂规槸鐩存帴浣跨敤Dao绫绘潵杩涜鏁版嵁搴撴搷浣滐紝骞朵笖閮芥槸鐩存帴鏀惧湪涓荤嚎绋嬩腑杩愯锛堟棤璇級,涔嬪悗鍙兘闇�瑕侀�愭闆嗘垚鍒癎reenDaoDb绫讳腑
-public class DbLink {
-    public static DbSource getDbSource(CommonApplication application) {
-        //姝ゅ鍙浛鎹笉鍚岀殑鏁版嵁搴撳疄渚嬶紝杈惧埌蹇�熸浛鎹㈡暟鎹簱鐨勬晥鏋�
-        return GreenDaoDb.getInstance(application);
-    }
-
-    public static DbSource getDbSource(Context context) {
-        //姝ゅ鍙浛鎹笉鍚岀殑鏁版嵁搴撳疄渚嬶紝杈惧埌蹇�熸浛鎹㈡暟鎹簱鐨勬晥鏋�
-        return GreenDaoDb.getInstance(context);
-    }
-}
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/common/database/DbSource.java b/app/src/main/java/cn/flightfeather/thirdapp/common/database/DbSource.java
deleted file mode 100644
index c4c535b..0000000
--- a/app/src/main/java/cn/flightfeather/thirdapp/common/database/DbSource.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package cn.flightfeather.thirdapp.common.database;
-
-import java.util.List;
-
-import cn.flightfeather.thirdapp.bean.entity.ChangeAdvice;
-import io.reactivex.Observable;
-
-/**
- * @author riku
- * 鏁版嵁搴撴搷浣滄柟娉曟帴鍙�
- */
-public interface DbSource {
-
-    //<editor-fold desc="ChangeAdviceDao">
-
-    //閫氳繃闂guid鏌ヨ瀵瑰簲鐨勬暣鏀瑰缓璁�
-    Observable<List<ChangeAdvice>> getAdviceByProblemType(String ptGuid);
-
-    //</editor-fold>
-}
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/common/database/GreenDaoDb.java b/app/src/main/java/cn/flightfeather/thirdapp/common/database/GreenDaoDb.java
deleted file mode 100644
index 8337f75..0000000
--- a/app/src/main/java/cn/flightfeather/thirdapp/common/database/GreenDaoDb.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package cn.flightfeather.thirdapp.common.database;
-
-import android.content.Context;
-import android.database.sqlite.SQLiteDatabase;
-import android.os.Environment;
-
-import com.ping.greendao.gen.ChangeAdviceDao;
-import com.ping.greendao.gen.DaoMaster;
-import com.ping.greendao.gen.DaoSession;
-
-import org.greenrobot.greendao.query.QueryBuilder;
-
-import java.io.File;
-import java.util.List;
-
-import cn.flightfeather.thirdapp.CommonApplication;
-import cn.flightfeather.thirdapp.bean.entity.ChangeAdvice;
-import io.reactivex.Observable;
-import io.reactivex.ObservableEmitter;
-import io.reactivex.ObservableOnSubscribe;
-import io.reactivex.schedulers.Schedulers;
-
-public class GreenDaoDb implements DbSource {
-
-    private DaoSession daoSession;
-    private static GreenDaoDb greenDaoDb;
-
-    //<editor-fold desc="Constructor">
-    // FIXME: 2019/3/27 by riku 鍘熸潵鐨勪唬鐮佸皢greendao鏁版嵁搴撳垵濮嬪寲鏀惧湪浜嗚嚜瀹氫箟Application绫讳腑锛屾殏鏃剁洿鎺ヨ皟鐢ㄤ箣鍓嶇殑鍒濆鍖�
-    private GreenDaoDb(CommonApplication commonApplication) {
-        daoSession = commonApplication.getDaoSession();
-    }
-
-    private GreenDaoDb(Context context) {
-        File path = new File(Environment.getExternalStorageDirectory(), "FlightFeather/third_new.db");
-        path.getParentFile().mkdirs();
-        //鍒涘缓鏁版嵁搴搒hop.db"
-        DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(context, path.getAbsolutePath(), null);
-        //鑾峰彇鍙啓鏁版嵁搴�
-        SQLiteDatabase db = helper.getWritableDatabase();
-        //鑾峰彇鏁版嵁搴撳璞�
-        DaoMaster daoMaster = new DaoMaster(db);
-
-        QueryBuilder.LOG_SQL = true;
-        QueryBuilder.LOG_VALUES = true;
-
-        daoSession = daoMaster.newSession();
-    }
-
-    public static synchronized GreenDaoDb getInstance(CommonApplication commonApplication) {
-        if (greenDaoDb == null) {
-            greenDaoDb = new GreenDaoDb(commonApplication);
-        }
-        return greenDaoDb;
-    }
-
-    public static synchronized GreenDaoDb getInstance(Context context) {
-        if (greenDaoDb == null) {
-            greenDaoDb = new GreenDaoDb(context);
-        }
-        return greenDaoDb;
-    }
-    //</editor-fold>t
-
-    @Override
-    public Observable<List<ChangeAdvice>> getAdviceByProblemType(final String ptGuid) {
-        final ChangeAdviceDao adviceDao = daoSession.getChangeAdviceDao();
-        return Observable.create(new ObservableOnSubscribe<List<ChangeAdvice>>() {
-            @Override
-            public void subscribe(ObservableEmitter<List<ChangeAdvice>> emitter) throws Exception {
-                List<ChangeAdvice> adviceList = adviceDao.queryBuilder()
-                        .where(
-                                ChangeAdviceDao.Properties.AdProblemtypeguid
-                                        .eq(ptGuid)
-                        ).list();
-                emitter.onNext(adviceList);
-                emitter.onComplete();
-            }
-        }).subscribeOn(Schedulers.io());
-    }
-}
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/fragment/SettingFragment.java b/app/src/main/java/cn/flightfeather/thirdapp/fragment/SettingFragment.java
index 909714e..a549044 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/fragment/SettingFragment.java
+++ b/app/src/main/java/cn/flightfeather/thirdapp/fragment/SettingFragment.java
@@ -21,6 +21,7 @@
 import cn.flightfeather.thirdapp.bean.entity.Userinfo;
 import cn.flightfeather.thirdapp.httpservice.SettingsService;
 import cn.flightfeather.thirdapp.util.GlobalConfig;
+import cn.flightfeather.thirdapp.util.push.LoginInitializer;
 import cn.flightfeather.thirdapp.view.SettingCommItemView;
 import okhttp3.ResponseBody;
 import retrofit2.Call;
@@ -59,7 +60,7 @@
         tv_userName = (TextView) view.findViewById(R.id.tv_user_name);
         tv_userName.setText(application.getCurrentUser().getRealname());
         text_version = view.findViewById(R.id.text_version);
-        text_version.setText(GlobalConfig.getInstance().getVersionName());
+        text_version.setText(GlobalConfig.Companion.getInstance().getVersionName());
         sc_changePassword = (SettingCommItemView) view.findViewById(R.id.sc_edit_password);
         sc_logOut = (SettingCommItemView) view.findViewById(R.id.sc_logout);
 
@@ -73,6 +74,8 @@
         dialog.setPositiveButton("纭畾", new DialogInterface.OnClickListener() {
             @Override
             public void onClick(DialogInterface dialogInterface, int i) {
+                LoginInitializer.INSTANCE.onLoginStatusCheck(getContext(), false, application.getCurrentUser().getAcountname());
+
                 Intent intent = new Intent(getActivity(), LoginActivity.class);
                 startActivity(intent);
                 getActivity().finish();
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/fragment/TaskFragment.java b/app/src/main/java/cn/flightfeather/thirdapp/fragment/TaskFragment.java
index 6384756..5f52f2a 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/fragment/TaskFragment.java
+++ b/app/src/main/java/cn/flightfeather/thirdapp/fragment/TaskFragment.java
@@ -346,6 +346,9 @@
         builder.setPositiveButton("纭畾", new DialogInterface.OnClickListener() {
             @Override
             public void onClick(DialogInterface dialog, int which) {
+                if (list.isEmpty()) {
+                    return;
+                }
                 showCheckTaskInfoDialog(list.get(mTopClassTaskChoice));
             }
         });
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/module/MainActivity.java b/app/src/main/java/cn/flightfeather/thirdapp/module/MainActivity.java
index eb540c4..8547af6 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/module/MainActivity.java
+++ b/app/src/main/java/cn/flightfeather/thirdapp/module/MainActivity.java
@@ -22,10 +22,10 @@
 import cn.flightfeather.thirdapp.R;
 import cn.flightfeather.thirdapp.bean.entity.Subtask;
 import cn.flightfeather.thirdapp.bean.vo.ProblemlistVo;
-import cn.flightfeather.thirdapp.business.widgettype2.HomeFragment_comptent;
-import cn.flightfeather.thirdapp.business.widgettype3.HomeFragment_scene;
+import cn.flightfeather.thirdapp.module.home.HomeFragment_comptent;
+import cn.flightfeather.thirdapp.module.home.HomeFragment_scene;
 import cn.flightfeather.thirdapp.dataanalysis.AnalysisOverViewFragment;
-import cn.flightfeather.thirdapp.fragment.HomeFragment;
+import cn.flightfeather.thirdapp.module.home.HomeFragment;
 import cn.flightfeather.thirdapp.fragment.SettingFragment;
 import cn.flightfeather.thirdapp.fragment.TaskFragment;
 import cn.flightfeather.thirdapp.module.inspection.InspectionFragment;
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/module/base/BaseMapActivity.kt b/app/src/main/java/cn/flightfeather/thirdapp/module/base/BaseMapActivity.kt
index e4e077a..d196eb1 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/module/base/BaseMapActivity.kt
+++ b/app/src/main/java/cn/flightfeather/thirdapp/module/base/BaseMapActivity.kt
@@ -258,6 +258,9 @@
 
             if (needMerge) {
                 for (i in myLatLngList.indices) {
+                    if (i >= myLatLngList.size) {
+                        return@create
+                    }
                     val p1 = myLatLngList[i]
 
                     for (y in i + 1 until myLatLngList.size) {
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/fragment/HomeFragment.java b/app/src/main/java/cn/flightfeather/thirdapp/module/home/HomeFragment.java
similarity index 99%
rename from app/src/main/java/cn/flightfeather/thirdapp/fragment/HomeFragment.java
rename to app/src/main/java/cn/flightfeather/thirdapp/module/home/HomeFragment.java
index 5d4bd81..2547594 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/fragment/HomeFragment.java
+++ b/app/src/main/java/cn/flightfeather/thirdapp/module/home/HomeFragment.java
@@ -1,4 +1,4 @@
-package cn.flightfeather.thirdapp.fragment;
+package cn.flightfeather.thirdapp.module.home;
 
 
 import android.content.Context;
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/business/widgettype2/HomeFragment_comptent.java b/app/src/main/java/cn/flightfeather/thirdapp/module/home/HomeFragment_comptent.java
similarity index 99%
rename from app/src/main/java/cn/flightfeather/thirdapp/business/widgettype2/HomeFragment_comptent.java
rename to app/src/main/java/cn/flightfeather/thirdapp/module/home/HomeFragment_comptent.java
index e3d3624..6a44a89 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/business/widgettype2/HomeFragment_comptent.java
+++ b/app/src/main/java/cn/flightfeather/thirdapp/module/home/HomeFragment_comptent.java
@@ -1,4 +1,4 @@
-package cn.flightfeather.thirdapp.business.widgettype2;
+package cn.flightfeather.thirdapp.module.home;
 
 
 import android.content.Context;
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/business/widgettype3/HomeFragment_scene.java b/app/src/main/java/cn/flightfeather/thirdapp/module/home/HomeFragment_scene.java
similarity index 99%
rename from app/src/main/java/cn/flightfeather/thirdapp/business/widgettype3/HomeFragment_scene.java
rename to app/src/main/java/cn/flightfeather/thirdapp/module/home/HomeFragment_scene.java
index 0df6103..81676e2 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/business/widgettype3/HomeFragment_scene.java
+++ b/app/src/main/java/cn/flightfeather/thirdapp/module/home/HomeFragment_scene.java
@@ -1,4 +1,4 @@
-package cn.flightfeather.thirdapp.business.widgettype3;
+package cn.flightfeather.thirdapp.module.home;
 
 
 import android.arch.lifecycle.ViewModelProviders;
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/BaseProblemListActivity.kt b/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/BaseProblemListActivity.kt
index cce3bee..7ab53f7 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/BaseProblemListActivity.kt
+++ b/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/BaseProblemListActivity.kt
@@ -64,6 +64,10 @@
             adapter = ProblemListAdapter(this@BaseProblemListActivity, viewModel.problemList.value, viewHolderType)
             addOnItemTouchListener(RecyclerItemClickListener(this@BaseProblemListActivity, this, object : RecyclerItemClickListener.OnItemClickListener {
                 override fun onItemClick(view: View?, position: Int) {
+                    val size = viewModel.problemList.value?.size ?: 0
+                    if (position >= size) {
+                        return
+                    }
                     val intent = Intent(this@BaseProblemListActivity, ProblemDetailActivity::class.java)
                     intent.putExtra("problemlistVo", viewModel.problemList.value?.get(position))
                     intent.putExtra("subTaskSelected", subTaskSelected)
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/InspectionDetailActivity.kt b/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/InspectionDetailActivity.kt
index 32ca2de..db5a936 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/InspectionDetailActivity.kt
+++ b/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/InspectionDetailActivity.kt
@@ -377,7 +377,8 @@
 
         //娣诲姞 鐢ㄦ埛绫诲瀷涓衡�滀富绠¢儴闂ㄢ�濇垨鈥滅鐞嗗憳鈥濓紝缂栧彿涓�2鎴�0鏃讹紝鎸夐挳iv_startEndTask娌℃湁鐐瑰嚮浜嬩欢
         if (viewModel.userTypeId != Domain.USER_COMPTENT.toByte()
-                && viewModel.userTypeId != Domain.USER_ADMIN.toByte()) {
+//                && viewModel.userTypeId != Domain.USER_ADMIN.toByte()
+        ) {
             iv_start_end_task.setOnClickListener(this)
         } else {
             iv_start_end_task.alpha = 0.5f
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/module/inspectioninfo/ProblemChangeFragment.java b/app/src/main/java/cn/flightfeather/thirdapp/module/inspectioninfo/ProblemChangeFragment.java
index 936d1bb..12c70b3 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/module/inspectioninfo/ProblemChangeFragment.java
+++ b/app/src/main/java/cn/flightfeather/thirdapp/module/inspectioninfo/ProblemChangeFragment.java
@@ -53,7 +53,7 @@
     public static final int REQUEST_CODE_SUBMIT = 11;
 
     private CommonApplication application;
-    private ArrayList<ProblemlistVo> problemlistVos;
+    private ArrayList<ProblemlistVo> problemlistVos = new ArrayList<>();
     private String fragmentType;
     private MediafileDao mediafileDao;
     private Unbinder unbinder;
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/fragment/CardFragment.java b/app/src/main/java/cn/flightfeather/thirdapp/module/login/CardFragment.java
similarity index 97%
rename from app/src/main/java/cn/flightfeather/thirdapp/fragment/CardFragment.java
rename to app/src/main/java/cn/flightfeather/thirdapp/module/login/CardFragment.java
index 3324057..ade7b84 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/fragment/CardFragment.java
+++ b/app/src/main/java/cn/flightfeather/thirdapp/module/login/CardFragment.java
@@ -1,4 +1,4 @@
-package cn.flightfeather.thirdapp.fragment;
+package cn.flightfeather.thirdapp.module.login;
 
 
 import android.content.Context;
@@ -29,6 +29,7 @@
 import cn.flightfeather.thirdapp.activity.LoginActivity;
 import cn.flightfeather.thirdapp.bean.entity.Userinfo;
 import cn.flightfeather.thirdapp.module.MainActivity;
+import cn.flightfeather.thirdapp.util.push.LoginInitializer;
 import retrofit2.Call;
 import retrofit2.Callback;
 import retrofit2.Response;
@@ -218,6 +219,7 @@
                     application.setCurrentUser(user);
                     useinfoDao.deleteAll();
                     useinfoDao.insert(user);
+                    LoginInitializer.INSTANCE.onLoginStatusCheck(getContext(), true, accountName);
                     Toast.makeText(application, "鐧诲綍鎴愬姛", Toast.LENGTH_SHORT).show();
                     startActivity(new Intent(getActivity(), MainActivity.class));
                     getActivity().finish();
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/module/task/NewSubTaskActivity.kt b/app/src/main/java/cn/flightfeather/thirdapp/module/task/NewSubTaskActivity.kt
index a06306c..cb40dd0 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/module/task/NewSubTaskActivity.kt
+++ b/app/src/main/java/cn/flightfeather/thirdapp/module/task/NewSubTaskActivity.kt
@@ -9,6 +9,7 @@
 import android.view.View
 import android.view.animation.AnimationUtils
 import android.widget.*
+import cn.flightfeather.thirdapp.CommonApplication
 import cn.flightfeather.thirdapp.R
 import cn.flightfeather.thirdapp.adapter.AllRecyclerViewAdapter
 import cn.flightfeather.thirdapp.bean.entity.Scense
@@ -215,19 +216,51 @@
             val tvExecDate =  findViewById<TextView>(R.id.tv_exec_date).apply {
                 text = DateFormatter.dateFormat.format(viewModel.todayTask.starttime)
             }
+
+            // fixme: 2021/5/31 鍒濆浠诲姟鎵ц鑰呴粯璁や负褰撳墠鐢ㄦ埛
+            val ids = viewModel.selectedTopTask?.executorguids?.split(Constant.CONNECTOR)
+            val userNames = viewModel.selectedTopTask?.executorusernames?.split(Constant.CONNECTOR)
+            val realNames = viewModel.selectedTopTask?.executorrealnames?.split(Constant.CONNECTOR)
+            var size = ids?.size
+            size = when {
+                userNames?.size!! > size ?: 0 -> userNames.size
+                realNames?.size!! > size ?: 0 -> realNames.size
+                else -> size
+            }
+            val mCheckedArray = BooleanArray(size ?: 0)
+
+            val id = StringBuilder()
+            val userName = StringBuilder()
+            val realName = StringBuilder()
+            for (i in ids?.indices ?: 0..0) {
+                if (CommonApplication.getInstance().currentUser.guid == ids?.get(i)) {
+                    mCheckedArray[i] = true
+                    if (id.isNotEmpty()) {
+                        id.append(Constant.CONNECTOR)
+                        userName.append(Constant.CONNECTOR)
+                        realName.append(Constant.CONNECTOR)
+                    }
+                    id.append(ids?.get(i))
+                    userName.append(userNames?.get(i))
+                    realName.append(realNames?.get(i))
+                } else {
+                    mCheckedArray[i] = false
+                }
+            }
+
             val tvTaskExecutors = findViewById<TextView>(R.id.tv_task_executors).apply {
-                text = viewModel.selectedTopTask?.executorrealnames?.replace(Constant.CONNECTOR, Constant.CONNECTOR_FOR_VIEW)
+                text = realName.toString().replace(Constant.CONNECTOR, Constant.CONNECTOR_FOR_VIEW)
             }
             viewModel.subTaskExecutor.apply {
-                this.executorGuids = viewModel.selectedTopTask?.executorguids
-                this.executorUserNames = viewModel.selectedTopTask?.executorusernames
-                this.executorRealNames = viewModel.selectedTopTask?.executorrealnames
+                this.executorGuids = ids.toString()
+                this.executorUserNames = userName.toString()
+                this.executorRealNames = realName.toString()
             }
             findViewById<LinearLayout>(R.id.ll_exec_date).setOnClickListener{
                 showDatePickerDialog(tvExecDate)
             }
             findViewById<LinearLayout>(R.id.ll_task_executors).setOnClickListener{
-                showExecutorsDialog(tvTaskExecutors)
+                showExecutorsDialog(tvTaskExecutors, mCheckedArray)
             }
         }
 
@@ -303,22 +336,11 @@
     /**
      * 鏄剧ず浠诲姟鎵ц鑰呭閫夊璇濇
      */
-    private fun showExecutorsDialog(t: TextView) {
+    private fun showExecutorsDialog(t: TextView, mCheckedArray: BooleanArray) {
         // 璁剧疆榛樿閫変腑鐨勯�夐」锛屽叏涓篺alse榛樿鍧囨湭閫変腑
         val executorGuids = viewModel.selectedTopTask?.executorguids?.split(Constant.CONNECTOR)
         val executorUNames = viewModel.selectedTopTask?.executorusernames?.split(Constant.CONNECTOR)?.toTypedArray()
         val executorRNames = viewModel.selectedTopTask?.executorrealnames?.split(Constant.CONNECTOR)?.toTypedArray()
-
-        var size = executorGuids?.size
-        size = when {
-            executorUNames?.size!! > size ?: 0 -> executorUNames.size
-            executorRNames?.size!! > size ?: 0 -> executorRNames.size
-            else -> size
-        }
-        val mCheckedArray = BooleanArray(size ?: 0)
-        for (i in mCheckedArray.indices) {
-            mCheckedArray[i] = true
-        }
 
         val multiChoiceDialog = AlertDialog.Builder(this)
         multiChoiceDialog.setTitle("閫夋嫨浠诲姟鎵ц鑰�")
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/module/task/NewSubTaskViewModel.kt b/app/src/main/java/cn/flightfeather/thirdapp/module/task/NewSubTaskViewModel.kt
index ea869ad..84d5a5a 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/module/task/NewSubTaskViewModel.kt
+++ b/app/src/main/java/cn/flightfeather/thirdapp/module/task/NewSubTaskViewModel.kt
@@ -418,16 +418,26 @@
                 tguid = UUIDGenerator.generate16ShortUUID()
                 tsguid = selectedTopTask?.tguid
                 levelnum = null
+
                 val cal = Calendar.getInstance()
-                cal.time = Date()
-                cal.set(Calendar.HOUR_OF_DAY, 0)
-                cal.set(Calendar.MINUTE, 0)
-                cal.set(Calendar.SECOND, 0)
-                starttime = cal.time
-                cal.set(Calendar.HOUR_OF_DAY, 23)
-                cal.set(Calendar.MINUTE, 59)
-                cal.set(Calendar.SECOND, 59)
-                endtime = cal.time
+                // 鍒ゆ柇褰撳墠鏃堕棿涓庢�讳换鍔$殑鏃堕棿娈靛叧绯伙紝涓嶅湪鎬讳换鍔℃椂闂磋寖鍥村唴鏃讹紝浣跨敤鎬讳换鍔″紑濮嬫椂闂翠负榛樿鏃堕棿锛屽惁鍒欑敤褰撳墠鏃堕棿涓洪粯璁ゆ椂闂�
+                if (cal.time < starttime || cal.time > endtime) {
+                    cal.time = starttime
+                    cal.set(Calendar.HOUR_OF_DAY, 23)
+                    cal.set(Calendar.MINUTE, 59)
+                    cal.set(Calendar.SECOND, 59)
+                    endtime = cal.time
+                } else {
+                    cal.set(Calendar.HOUR_OF_DAY, 0)
+                    cal.set(Calendar.MINUTE, 0)
+                    cal.set(Calendar.SECOND, 0)
+                    starttime = cal.time
+                    cal.set(Calendar.HOUR_OF_DAY, 23)
+                    cal.set(Calendar.MINUTE, 59)
+                    cal.set(Calendar.SECOND, 59)
+                    endtime = cal.time
+                }
+
                 plannerguid = application.currentUser.guid
                 plannerusername = application.currentUser.acountname
                 plannerrealname = application.currentUser.realname
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/util/GlobalConfig.java b/app/src/main/java/cn/flightfeather/thirdapp/util/GlobalConfig.java
deleted file mode 100644
index bf0975e..0000000
--- a/app/src/main/java/cn/flightfeather/thirdapp/util/GlobalConfig.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package cn.flightfeather.thirdapp.util;
-
-public class GlobalConfig {
-
-    private static GlobalConfig instance;
-
-    private int versionCode;
-    private String versionName;
-
-    private GlobalConfig() {
-    }
-
-    public synchronized static GlobalConfig getInstance() {
-        if (instance == null) {
-            instance = new GlobalConfig();
-        }
-        return instance;
-    }
-
-    public int getVersionCode() {
-        return versionCode;
-    }
-
-    public GlobalConfig setVersionCode(int versionCode) {
-        this.versionCode = versionCode;
-        return this;
-    }
-
-    public String getVersionName() {
-        return versionName;
-    }
-
-    public GlobalConfig setVersionName(String versionName) {
-        this.versionName = versionName;
-        return this;
-    }
-}
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/util/GlobalConfig.kt b/app/src/main/java/cn/flightfeather/thirdapp/util/GlobalConfig.kt
new file mode 100644
index 0000000..e0956f0
--- /dev/null
+++ b/app/src/main/java/cn/flightfeather/thirdapp/util/GlobalConfig.kt
@@ -0,0 +1,21 @@
+package cn.flightfeather.thirdapp.util
+
+class GlobalConfig private constructor() {
+    var versionCode = 0
+
+    var versionName: String? = null
+
+    var userId: String by MyPreference("userId", "default_customer")
+
+    companion object {
+        @get:Synchronized
+        var instance: GlobalConfig? = null
+            get() {
+                if (field == null) {
+                    field = GlobalConfig()
+                }
+                return field
+            }
+            private set
+    }
+}
\ No newline at end of file
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/util/MyPreference.kt b/app/src/main/java/cn/flightfeather/thirdapp/util/MyPreference.kt
new file mode 100644
index 0000000..e99b3fe
--- /dev/null
+++ b/app/src/main/java/cn/flightfeather/thirdapp/util/MyPreference.kt
@@ -0,0 +1,57 @@
+package cn.flightfeather.thirdapp.util
+
+import android.content.Context
+import android.content.SharedPreferences
+import cn.flightfeather.thirdapp.CommonApplication
+import kotlin.reflect.KProperty
+
+/**
+ * SharedPreference瀵硅薄
+ * @author riku
+ * Date: 2019/4/9
+ */
+class MyPreference<T>(private val keyName: String, private val default: T) {
+
+    private val prefs:SharedPreferences by lazy { CommonApplication.getInstance().getSharedPreferences("preference", Context.MODE_PRIVATE)}
+
+    operator fun getValue(thisRef: Any?, property: KProperty<*>): T {
+        return findSharedPreferences(keyName, default)
+    }
+
+    operator fun setValue(thisRef: Any?, property: KProperty<*>, value: T) {
+        putSharedPreferences(keyName, value)
+    }
+
+    fun get(): T {
+        return findSharedPreferences(keyName, default)
+    }
+
+    fun set(value: T) {
+        putSharedPreferences(keyName, value)
+    }
+
+    @Suppress("UNCHECKED_CAST")
+    private fun findSharedPreferences(name: String, default: T): T = with(prefs) {
+        val res: Any = when (default) {
+            is Long -> getLong(name, default)
+            is String -> getString(name, default)
+            is Int -> getInt(name, default)
+            is Boolean -> getBoolean(name, default)
+            is Float -> getFloat(name, default)
+            else -> throw IllegalArgumentException("Type Error, cannot be got!")
+        }
+
+        return res as T
+    }
+
+    private fun putSharedPreferences(name: String, value: T) = with(prefs.edit()) {
+        when (value) {
+            is Long -> putLong(name, value)
+            is String -> putString(name, value)
+            is Int -> putInt(name, value)
+            is Boolean -> putBoolean(name, value)
+            is Float -> putFloat(name, value)
+            else->throw IllegalArgumentException("Type Error, cannot be saved!")
+        }.apply()
+    }
+}
\ No newline at end of file
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/util/notification/MyNotificationChannel.kt b/app/src/main/java/cn/flightfeather/thirdapp/util/notification/MyNotificationChannel.kt
new file mode 100644
index 0000000..f248ec3
--- /dev/null
+++ b/app/src/main/java/cn/flightfeather/thirdapp/util/notification/MyNotificationChannel.kt
@@ -0,0 +1,42 @@
+package cn.flightfeather.thirdapp.util.notification
+
+import android.app.NotificationChannel
+import android.app.NotificationManager
+import android.content.Context
+import android.content.Context.NOTIFICATION_SERVICE
+import android.graphics.Color
+import android.os.Build
+
+
+/**
+ * Android 8.0 鍚庨渶瑕佹敞鍐孨otificationChannel鎵嶅彲浠ユ帴鏀堕�氱煡
+ * @author riku
+ * Date: 2019/12/26
+ */
+class MyNotificationChannel {
+    companion object {
+        fun init(applicationContext: Context) {
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+                val mNotificationManager = applicationContext.getSystemService(NOTIFICATION_SERVICE) as NotificationManager?
+                // 閫氱煡娓犻亾鐨刬d
+                val id = "1"
+                // 鐢ㄦ埛鍙互鐪嬪埌鐨勯�氱煡娓犻亾鐨勫悕瀛�.
+                val name = "aliCloudPush channel"
+                // 鐢ㄦ埛鍙互鐪嬪埌鐨勯�氱煡娓犻亾鐨勬弿杩�
+                val description = "aliCloudPush"
+                val importance = NotificationManager.IMPORTANCE_HIGH
+                val mChannel = NotificationChannel(id, name, importance)
+                // 閰嶇疆閫氱煡娓犻亾鐨勫睘鎬�
+                mChannel.description = description
+                // 璁剧疆閫氱煡鍑虹幇鏃剁殑闂伅锛堝鏋� android 璁惧鏀寔鐨勮瘽锛�
+                mChannel.enableLights(true)
+                mChannel.lightColor = Color.RED
+                // 璁剧疆閫氱煡鍑虹幇鏃剁殑闇囧姩锛堝鏋� android 璁惧鏀寔鐨勮瘽锛�
+                mChannel.enableVibration(true)
+                mChannel.vibrationPattern = longArrayOf(100, 200, 300, 400, 500, 400, 300, 200, 400)
+                //鏈�鍚庡湪notificationmanager涓垱寤鸿閫氱煡娓犻亾
+                mNotificationManager?.createNotificationChannel(mChannel)
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/util/push/LoginInitializer.kt b/app/src/main/java/cn/flightfeather/thirdapp/util/push/LoginInitializer.kt
new file mode 100644
index 0000000..70fca5f
--- /dev/null
+++ b/app/src/main/java/cn/flightfeather/thirdapp/util/push/LoginInitializer.kt
@@ -0,0 +1,34 @@
+package cn.flightfeather.thirdapp.util.push
+
+import android.content.Context
+import android.content.SharedPreferences
+/**
+ * @author riku
+ * Date: 2019/12/26
+ */
+object LoginInitializer {
+
+    /**
+     * 鏍规嵁鐧诲綍鐘舵�佺粦瀹氭帹閫�
+     */
+    fun onLoginStatusCheck(context: Context?, isLogin: Boolean, accountName: String) {
+        if (context==null) return
+        //璇诲彇鐧诲綍鐢ㄦ埛淇℃伅
+        val sharedPre: SharedPreferences = context.getSharedPreferences("config", Context.MODE_PRIVATE)
+        val isBindAccount = sharedPre.getBoolean("isBindAccount", false)
+
+        if (isLogin) {
+            if (!isBindAccount) {
+                PushService.bindAccount(accountName) {
+                    sharedPre.edit().putBoolean("isBindAccount", true).apply()
+                }
+            }
+        } else {
+            if (isBindAccount) {
+                PushService.unBindAccount {
+                    sharedPre.edit().putBoolean("isBindAccount", false).apply()
+                }
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/util/push/MyMessageIntentService.kt b/app/src/main/java/cn/flightfeather/thirdapp/util/push/MyMessageIntentService.kt
new file mode 100644
index 0000000..6804c75
--- /dev/null
+++ b/app/src/main/java/cn/flightfeather/thirdapp/util/push/MyMessageIntentService.kt
@@ -0,0 +1,96 @@
+package cn.flightfeather.thirdapp.util.push
+
+import android.content.Context
+import android.util.Log
+
+import com.alibaba.sdk.android.push.AliyunMessageIntentService
+import com.alibaba.sdk.android.push.notification.CPushMessage
+
+/**
+ * 涓洪伩鍏嶆帹閫佸箍鎾绯荤粺鎷︽埅鐨勫皬姒傜巼浜嬩欢,鎴戜滑鎺ㄨ崘鐢ㄦ埛閫氳繃IntentService澶勭悊娑堟伅浜掕皟,鎺ュ叆姝ラ:
+ * 璇︾粏鐢ㄦ埛鍙弬鑰�:https://help.aliyun.com/document_detail/30066.html#h2-2-messagereceiver-aliyunmessageintentservice
+ */
+
+class MyMessageIntentService : AliyunMessageIntentService() {
+
+    companion object {
+        private const val REC_TAG = "MyMessageIntentService"
+    }
+
+    /**
+     * 鎺ㄩ�侀�氱煡鐨勫洖璋冩柟娉�
+     * @param context
+     * @param title
+     * @param summary
+     * @param extraMap
+     */
+    override fun onNotification(context: Context, title: String, summary: String, extraMap: Map<String, String>) {
+        Log.i(REC_TAG, "鏀跺埌涓�鏉℃帹閫侀�氱煡 锛� $title, summary:$summary")
+    }
+
+    /**
+     * 鎺ㄩ�佹秷鎭殑鍥炶皟鏂规硶
+     * @param context
+     * @param cPushMessage
+     */
+    override fun onMessage(context: Context, cPushMessage: CPushMessage) {
+        Log.i(REC_TAG, "鏀跺埌涓�鏉℃帹閫佹秷鎭� 锛� " + cPushMessage.title + ", content:" + cPushMessage.content)
+    }
+
+    /**
+     * 浠庨�氱煡鏍忔墦寮�閫氱煡鐨勬墿灞曞鐞�
+     * @param context
+     * @param title
+     * @param summary
+     * @param extraMap
+     */
+    override fun onNotificationOpened(context: Context, title: String, summary: String, extraMap: String) {
+        Log.i(REC_TAG, "onNotificationOpened 锛�  : $title : $summary : $extraMap")
+
+    }
+
+    /**
+     * 鏃犲姩浣滈�氱煡鐐瑰嚮鍥炶皟銆傚綋鍦ㄥ悗鍙版垨闃块噷浜戞帶鍒跺彴鎸囧畾鐨勯�氱煡鍔ㄤ綔涓烘棤閫昏緫璺宠浆鏃�,閫氱煡鐐瑰嚮鍥炶皟涓簅nNotificationClickedWithNoAction鑰屼笉鏄痮nNotificationOpened
+     * @param context
+     * @param title
+     * @param summary
+     * @param extraMap
+     */
+    override fun onNotificationClickedWithNoAction(context: Context, title: String, summary: String, extraMap: String) {
+        Log.i(REC_TAG, "onNotificationClickedWithNoAction 锛�  : $title : $summary : $extraMap")
+    }
+
+    /**
+     * 閫氱煡鍒犻櫎鍥炶皟
+     * @param context
+     * @param messageId
+     */
+    override fun onNotificationRemoved(context: Context, messageId: String) {
+        Log.i(REC_TAG, "onNotificationRemoved 锛� $messageId")
+    }
+
+    /**
+     * 搴旂敤澶勪簬鍓嶅彴鏃堕�氱煡鍒拌揪鍥炶皟銆傛敞鎰�:璇ユ柟娉曚粎瀵硅嚜瀹氫箟鏍峰紡閫氱煡鏈夋晥,鐩稿叧璇︽儏璇峰弬鑰僪ttps://help.aliyun.com/document_detail/30066.html#h3-3-4-basiccustompushnotification-api
+     * @param context
+     * @param title
+     * @param summary
+     * @param extraMap
+     * @param openType
+     * @param openActivity
+     * @param openUrl
+     */
+    override fun onNotificationReceivedInApp(
+        context: Context,
+        title: String,
+        summary: String,
+        extraMap: Map<String, String>,
+        openType: Int,
+        openActivity: String,
+        openUrl: String
+    ) {
+        Log.i(
+            REC_TAG,
+            "onNotificationReceivedInApp 锛�  : $title : $summary  $extraMap : $openType : $openActivity : $openUrl"
+        )
+    }
+}
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/util/push/MyMessageReceiver.kt b/app/src/main/java/cn/flightfeather/thirdapp/util/push/MyMessageReceiver.kt
new file mode 100644
index 0000000..78330eb
--- /dev/null
+++ b/app/src/main/java/cn/flightfeather/thirdapp/util/push/MyMessageReceiver.kt
@@ -0,0 +1,72 @@
+package cn.flightfeather.thirdapp.util.push
+
+import android.content.Context
+import android.util.Log
+import com.alibaba.sdk.android.push.MessageReceiver
+import com.alibaba.sdk.android.push.notification.CPushMessage
+
+/**
+ * 闃块噷浜戞帹閫佹秷鎭帴鏀�
+ * @author riku
+ * Date: 2019/12/26
+ */
+class MyMessageReceiver : MessageReceiver() {
+    companion object {
+        // 娑堟伅鎺ユ敹閮ㄥ垎鐨凩OG_TAG
+        const val REC_TAG = "MyMessageReceiver"
+    }
+
+    override fun onNotification(
+        context: Context?,
+        title: String?,
+        summary: String?,
+        extraMap: Map<String, String>?
+    ) {
+        // TODO 澶勭悊鎺ㄩ�侀�氱煡
+        Log.e(REC_TAG, "Receive notification, title: $title, summary: $summary, extraMap: $extraMap")
+    }
+
+    override fun onMessage(context: Context?, cPushMessage: CPushMessage) {
+        Log.e(
+            REC_TAG,
+            "onMessage, messageId: " + cPushMessage.messageId + ", title: " + cPushMessage.title + ", content:" + cPushMessage.content
+        )
+
+        
+    }
+
+    override fun onNotificationOpened(context: Context?, title: String?, summary: String?, extraMap: String?) {
+        Log.e(REC_TAG, "onNotificationOpened, title: $title, summary: $summary, extraMap:$extraMap")
+    }
+
+    override fun onNotificationClickedWithNoAction(
+        context: Context?,
+        title: String?,
+        summary: String?,
+        extraMap: String?
+    ) {
+        Log.e(
+            REC_TAG,
+            "onNotificationClickedWithNoAction, title: $title, summary: $summary, extraMap:$extraMap"
+        )
+    }
+
+    override fun onNotificationReceivedInApp(
+        context: Context?,
+        title: String?,
+        summary: String?,
+        extraMap: Map<String, String>?,
+        openType: Int,
+        openActivity: String?,
+        openUrl: String?
+    ) {
+        Log.e(
+            REC_TAG,
+            "onNotificationReceivedInApp, title: $title, summary: $summary, extraMap:$extraMap, openType:$openType, openActivity:$openActivity, openUrl:$openUrl"
+        )
+    }
+
+    override fun onNotificationRemoved(context: Context?, messageId: String?) {
+        Log.e(REC_TAG, "onNotificationRemoved")
+    }
+}
\ No newline at end of file
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/util/push/PushService.kt b/app/src/main/java/cn/flightfeather/thirdapp/util/push/PushService.kt
new file mode 100644
index 0000000..d301289
--- /dev/null
+++ b/app/src/main/java/cn/flightfeather/thirdapp/util/push/PushService.kt
@@ -0,0 +1,65 @@
+package cn.flightfeather.thirdapp.util.push
+
+import android.content.Context
+import android.util.Log
+import com.alibaba.sdk.android.push.CloudPushService
+import com.alibaba.sdk.android.push.CommonCallback
+import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory
+
+/**
+ * 绉诲姩鎺ㄩ�佹湇鍔¢厤缃被
+ * @author riku
+ * Date: 2019/12/26
+ */
+class PushService {
+    companion object {
+        const val TAG = "PushService"
+
+        private var mPushService: CloudPushService? = null
+
+        /**
+         * 鍒濆鍖栦簯鎺ㄩ�侀�氶亾
+         * @param applicationContext
+         */
+        fun init(applicationContext: Context) {
+            PushServiceFactory.init(applicationContext)
+            mPushService = PushServiceFactory.getCloudPushService()
+            mPushService?.register(applicationContext, object : CommonCallback {
+                override fun onSuccess(response: String) {
+                    Log.d(TAG, "init cloudChannel success")
+                    Log.d(TAG, response)
+                }
+
+                override fun onFailed(errorCode: String, errorMessage: String) {
+                    Log.d(TAG, "init cloudChannel failed -- errorCode:$errorCode -- errorMessage:$errorMessage")
+                }
+            })
+        }
+
+        fun bindAccount(account: String, s: () -> Unit) {
+            mPushService?.bindAccount(account, object : CommonCallback {
+                override fun onSuccess(p0: String?) {
+                    Log.d(TAG, "bind account $account success")
+                    s()
+                }
+
+                override fun onFailed(p0: String?, p1: String?) {
+
+                }
+            })
+        }
+
+        fun unBindAccount(s: () -> Unit) {
+            mPushService?.unbindAccount(object : CommonCallback {
+                override fun onSuccess(p0: String?) {
+                    Log.d(TAG, "unbind account success")
+                    s()
+                }
+
+                override fun onFailed(p0: String?, p1: String?) {
+
+                }
+            })
+        }
+    }
+}
\ No newline at end of file
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/util/updateApp/UpdateAppUtil.java b/app/src/main/java/cn/flightfeather/thirdapp/util/updateApp/UpdateAppUtil.java
index 34ba6b6..e1ccb4e 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/util/updateApp/UpdateAppUtil.java
+++ b/app/src/main/java/cn/flightfeather/thirdapp/util/updateApp/UpdateAppUtil.java
@@ -87,7 +87,8 @@
                     .getPackageInfo(application.getPackageName(), 0);
             localVersion = packageInfo.versionCode;
             localVersionName = packageInfo.versionName;
-            GlobalConfig.getInstance().setVersionCode(localVersion).setVersionName(localVersionName);
+            GlobalConfig.Companion.getInstance().setVersionCode(localVersion);
+            GlobalConfig.Companion.getInstance().setVersionName(localVersionName);
         } catch (PackageManager.NameNotFoundException e) {
             e.printStackTrace();
         }
diff --git a/app/src/main/java/com/ping/greendao/gen/DaoMaster.java b/app/src/main/java/com/ping/greendao/gen/DaoMaster.java
index 8de81d0..af10665 100644
--- a/app/src/main/java/com/ping/greendao/gen/DaoMaster.java
+++ b/app/src/main/java/com/ping/greendao/gen/DaoMaster.java
@@ -35,6 +35,7 @@
         InspectionDao.createTable(db, ifNotExists);
         ItemevaluationDao.createTable(db, ifNotExists);
         MediafileDao.createTable(db, ifNotExists);
+        MediaFileCacheDao.createTable(db, ifNotExists);
         MediaTypeAliasDao.createTable(db, ifNotExists);
         MonitorobjectversionDao.createTable(db, ifNotExists);
         ProblemlistDao.createTable(db, ifNotExists);
@@ -47,7 +48,6 @@
         TaskvertionDao.createTable(db, ifNotExists);
         TownDao.createTable(db, ifNotExists);
         UserinfoDao.createTable(db, ifNotExists);
-        MediaFileCacheDao.createTable(db, ifNotExists);
     }
 
     /** Drops underlying database table using DAOs. */
@@ -66,6 +66,7 @@
         InspectionDao.dropTable(db, ifExists);
         ItemevaluationDao.dropTable(db, ifExists);
         MediafileDao.dropTable(db, ifExists);
+        MediaFileCacheDao.dropTable(db, ifExists);
         MediaTypeAliasDao.dropTable(db, ifExists);
         MonitorobjectversionDao.dropTable(db, ifExists);
         ProblemlistDao.dropTable(db, ifExists);
@@ -78,7 +79,6 @@
         TaskvertionDao.dropTable(db, ifExists);
         TownDao.dropTable(db, ifExists);
         UserinfoDao.dropTable(db, ifExists);
-        MediaFileCacheDao.dropTable(db, ifExists);
     }
 
     /**
@@ -111,6 +111,7 @@
         registerDaoClass(InspectionDao.class);
         registerDaoClass(ItemevaluationDao.class);
         registerDaoClass(MediafileDao.class);
+        registerDaoClass(MediaFileCacheDao.class);
         registerDaoClass(MediaTypeAliasDao.class);
         registerDaoClass(MonitorobjectversionDao.class);
         registerDaoClass(ProblemlistDao.class);
@@ -123,7 +124,6 @@
         registerDaoClass(TaskvertionDao.class);
         registerDaoClass(TownDao.class);
         registerDaoClass(UserinfoDao.class);
-        registerDaoClass(MediaFileCacheDao.class);
     }
 
     public DaoSession newSession() {
diff --git a/app/src/main/java/com/ping/greendao/gen/DaoSession.java b/app/src/main/java/com/ping/greendao/gen/DaoSession.java
index de8fce0..40787ae 100644
--- a/app/src/main/java/com/ping/greendao/gen/DaoSession.java
+++ b/app/src/main/java/com/ping/greendao/gen/DaoSession.java
@@ -22,6 +22,7 @@
 import cn.flightfeather.thirdapp.bean.entity.Inspection;
 import cn.flightfeather.thirdapp.bean.entity.Itemevaluation;
 import cn.flightfeather.thirdapp.bean.entity.Mediafile;
+import cn.flightfeather.thirdapp.bean.entity.MediaFileCache;
 import cn.flightfeather.thirdapp.bean.entity.MediaTypeAlias;
 import cn.flightfeather.thirdapp.bean.entity.Monitorobjectversion;
 import cn.flightfeather.thirdapp.bean.entity.Problemlist;
@@ -34,7 +35,6 @@
 import cn.flightfeather.thirdapp.bean.entity.Taskvertion;
 import cn.flightfeather.thirdapp.bean.entity.Town;
 import cn.flightfeather.thirdapp.bean.entity.Userinfo;
-import cn.flightfeather.thirdapp.bean.entity.MediaFileCache;
 
 import com.ping.greendao.gen.ChangeAdviceDao;
 import com.ping.greendao.gen.ChangeEffectDao;
@@ -50,6 +50,7 @@
 import com.ping.greendao.gen.InspectionDao;
 import com.ping.greendao.gen.ItemevaluationDao;
 import com.ping.greendao.gen.MediafileDao;
+import com.ping.greendao.gen.MediaFileCacheDao;
 import com.ping.greendao.gen.MediaTypeAliasDao;
 import com.ping.greendao.gen.MonitorobjectversionDao;
 import com.ping.greendao.gen.ProblemlistDao;
@@ -62,7 +63,6 @@
 import com.ping.greendao.gen.TaskvertionDao;
 import com.ping.greendao.gen.TownDao;
 import com.ping.greendao.gen.UserinfoDao;
-import com.ping.greendao.gen.MediaFileCacheDao;
 
 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
 
@@ -87,6 +87,7 @@
     private final DaoConfig inspectionDaoConfig;
     private final DaoConfig itemevaluationDaoConfig;
     private final DaoConfig mediafileDaoConfig;
+    private final DaoConfig mediaFileCacheDaoConfig;
     private final DaoConfig mediaTypeAliasDaoConfig;
     private final DaoConfig monitorobjectversionDaoConfig;
     private final DaoConfig problemlistDaoConfig;
@@ -99,7 +100,6 @@
     private final DaoConfig taskvertionDaoConfig;
     private final DaoConfig townDaoConfig;
     private final DaoConfig userinfoDaoConfig;
-    private final DaoConfig mediaFileCacheDaoConfig;
 
     private final ChangeAdviceDao changeAdviceDao;
     private final ChangeEffectDao changeEffectDao;
@@ -115,6 +115,7 @@
     private final InspectionDao inspectionDao;
     private final ItemevaluationDao itemevaluationDao;
     private final MediafileDao mediafileDao;
+    private final MediaFileCacheDao mediaFileCacheDao;
     private final MediaTypeAliasDao mediaTypeAliasDao;
     private final MonitorobjectversionDao monitorobjectversionDao;
     private final ProblemlistDao problemlistDao;
@@ -127,7 +128,6 @@
     private final TaskvertionDao taskvertionDao;
     private final TownDao townDao;
     private final UserinfoDao userinfoDao;
-    private final MediaFileCacheDao mediaFileCacheDao;
 
     public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
             daoConfigMap) {
@@ -175,6 +175,9 @@
         mediafileDaoConfig = daoConfigMap.get(MediafileDao.class).clone();
         mediafileDaoConfig.initIdentityScope(type);
 
+        mediaFileCacheDaoConfig = daoConfigMap.get(MediaFileCacheDao.class).clone();
+        mediaFileCacheDaoConfig.initIdentityScope(type);
+
         mediaTypeAliasDaoConfig = daoConfigMap.get(MediaTypeAliasDao.class).clone();
         mediaTypeAliasDaoConfig.initIdentityScope(type);
 
@@ -211,9 +214,6 @@
         userinfoDaoConfig = daoConfigMap.get(UserinfoDao.class).clone();
         userinfoDaoConfig.initIdentityScope(type);
 
-        mediaFileCacheDaoConfig = daoConfigMap.get(MediaFileCacheDao.class).clone();
-        mediaFileCacheDaoConfig.initIdentityScope(type);
-
         changeAdviceDao = new ChangeAdviceDao(changeAdviceDaoConfig, this);
         changeEffectDao = new ChangeEffectDao(changeEffectDaoConfig, this);
         cityDao = new CityDao(cityDaoConfig, this);
@@ -228,6 +228,7 @@
         inspectionDao = new InspectionDao(inspectionDaoConfig, this);
         itemevaluationDao = new ItemevaluationDao(itemevaluationDaoConfig, this);
         mediafileDao = new MediafileDao(mediafileDaoConfig, this);
+        mediaFileCacheDao = new MediaFileCacheDao(mediaFileCacheDaoConfig, this);
         mediaTypeAliasDao = new MediaTypeAliasDao(mediaTypeAliasDaoConfig, this);
         monitorobjectversionDao = new MonitorobjectversionDao(monitorobjectversionDaoConfig, this);
         problemlistDao = new ProblemlistDao(problemlistDaoConfig, this);
@@ -240,7 +241,6 @@
         taskvertionDao = new TaskvertionDao(taskvertionDaoConfig, this);
         townDao = new TownDao(townDaoConfig, this);
         userinfoDao = new UserinfoDao(userinfoDaoConfig, this);
-        mediaFileCacheDao = new MediaFileCacheDao(mediaFileCacheDaoConfig, this);
 
         registerDao(ChangeAdvice.class, changeAdviceDao);
         registerDao(ChangeEffect.class, changeEffectDao);
@@ -256,6 +256,7 @@
         registerDao(Inspection.class, inspectionDao);
         registerDao(Itemevaluation.class, itemevaluationDao);
         registerDao(Mediafile.class, mediafileDao);
+        registerDao(MediaFileCache.class, mediaFileCacheDao);
         registerDao(MediaTypeAlias.class, mediaTypeAliasDao);
         registerDao(Monitorobjectversion.class, monitorobjectversionDao);
         registerDao(Problemlist.class, problemlistDao);
@@ -268,7 +269,6 @@
         registerDao(Taskvertion.class, taskvertionDao);
         registerDao(Town.class, townDao);
         registerDao(Userinfo.class, userinfoDao);
-        registerDao(MediaFileCache.class, mediaFileCacheDao);
     }
     
     public void clear() {
@@ -286,6 +286,7 @@
         inspectionDaoConfig.clearIdentityScope();
         itemevaluationDaoConfig.clearIdentityScope();
         mediafileDaoConfig.clearIdentityScope();
+        mediaFileCacheDaoConfig.clearIdentityScope();
         mediaTypeAliasDaoConfig.clearIdentityScope();
         monitorobjectversionDaoConfig.clearIdentityScope();
         problemlistDaoConfig.clearIdentityScope();
@@ -298,7 +299,6 @@
         taskvertionDaoConfig.clearIdentityScope();
         townDaoConfig.clearIdentityScope();
         userinfoDaoConfig.clearIdentityScope();
-        mediaFileCacheDaoConfig.clearIdentityScope();
     }
 
     public ChangeAdviceDao getChangeAdviceDao() {
@@ -357,6 +357,10 @@
         return mediafileDao;
     }
 
+    public MediaFileCacheDao getMediaFileCacheDao() {
+        return mediaFileCacheDao;
+    }
+
     public MediaTypeAliasDao getMediaTypeAliasDao() {
         return mediaTypeAliasDao;
     }
@@ -403,10 +407,6 @@
 
     public UserinfoDao getUserinfoDao() {
         return userinfoDao;
-    }
-
-    public MediaFileCacheDao getMediaFileCacheDao() {
-        return mediaFileCacheDao;
     }
 
 }
diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml
index 6fb5a92..ce01d2f 100644
--- a/app/src/main/res/layout/fragment_home.xml
+++ b/app/src/main/res/layout/fragment_home.xml
@@ -3,7 +3,7 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical"
-    tools:context="cn.flightfeather.thirdapp.fragment.HomeFragment">
+    tools:context="cn.flightfeather.thirdapp.module.home.HomeFragment">
 
     <LinearLayout
         android:id="@+id/ll_weather_bg"
diff --git a/app/src/main/res/layout/fragment_home_competent.xml b/app/src/main/res/layout/fragment_home_competent.xml
index 3ea6dc1..e58d8e4 100644
--- a/app/src/main/res/layout/fragment_home_competent.xml
+++ b/app/src/main/res/layout/fragment_home_competent.xml
@@ -3,7 +3,7 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical"
-    tools:context="cn.flightfeather.thirdapp.fragment.HomeFragment"
+    tools:context="cn.flightfeather.thirdapp.module.home.HomeFragment"
     android:background="@drawable/shape_bg_gradient">
 
     <include android:id="@+id/topPanel_" layout="@layout/tab_panel_scenetype" android:visibility="gone"/>

--
Gitblit v1.9.3