Bläddra i källkod

Merge branch 'feature' of https://gitlab.com/Arisono/SkWeiChat-Baidu into feature_fanglh

# Conflicts:
#	WeiChat/version.properties
#	app_core/common/build.gradle
FANGLH 8 år sedan
förälder
incheckning
d2e6588b6c
100 ändrade filer med 5370 tillägg och 792 borttagningar
  1. 2 2
      WeiChat/build.gradle
  2. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/adapter/PublicMessageAdapter.java
  3. 2 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/circle/BusinessCircleActivity.java
  4. 0 4
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/ADActivity.java
  5. 0 12
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/net/HttpUtil.java
  6. 1 2
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/me/MeFragment.java
  7. 46 16
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/message/ChatActivity.java
  8. 0 5
      WeiChat/src/main/java/com/xzjmyk/pm/activity/util/oa/AutoErpService.java
  9. 0 6
      WeiChat/src/main/java/com/xzjmyk/pm/activity/util/oa/DepositNoticeUtil.java
  10. 11 22
      WeiChat/src/main/java/com/xzjmyk/pm/activity/video/VideoActivity.java
  11. 1 1
      WeiChat/src/main/res/layout/activity_subscribe_manage.xml
  12. 6 0
      WeiChat/src/main/res/values/styles.xml
  13. 3 3
      WeiChat/version.properties
  14. 3 3
      app_core/common/build.gradle
  15. 9 0
      app_core/common/src/main/assets/work_menu.json
  16. 5 6
      app_core/common/src/main/java/com/common/LogUtil.java
  17. 288 287
      app_core/common/src/main/java/com/common/data/JSONUtil.java
  18. 8 0
      app_core/common/src/main/java/com/core/app/ActionBackActivity.java
  19. 49 1
      app_core/common/src/main/java/com/core/app/Constants.java
  20. 18 2
      app_core/common/src/main/java/com/core/base/fragment/BaseMVPFragment.java
  21. 8 3
      app_core/common/src/main/java/com/core/dao/MessageDao.java
  22. 4 2
      app_core/common/src/main/java/com/core/db/DBOpenHelper.java
  23. 12 0
      app_core/common/src/main/java/com/core/db/DatabaseTables.java
  24. 24 1
      app_core/common/src/main/java/com/core/model/MessageModel.java
  25. 1 0
      app_core/common/src/main/java/com/core/net/http/ViewUtil.java
  26. 0 2
      app_core/common/src/main/java/com/core/net/http/http/OAHttpHelper.java
  27. 0 8
      app_core/common/src/main/java/com/core/net/location/BdLocationHelper.java
  28. 31 3
      app_core/common/src/main/java/com/core/utils/CommonUtil.java
  29. 5 5
      app_core/common/src/main/java/com/core/utils/OpenFilesUtils.java
  30. 319 0
      app_core/common/src/main/java/com/core/widget/LoadingLayout.java
  31. 14 5
      app_core/common/src/main/java/com/core/widget/NoSlideViewpager.java
  32. 35 1
      app_core/common/src/main/java/com/core/widget/SearchActionView.java
  33. 46 6
      app_core/common/src/main/java/com/core/xmpp/FriendHelper.java
  34. 36 0
      app_core/common/src/main/java/com/core/xmpp/dao/FriendDao.java
  35. 5 0
      app_core/common/src/main/res/drawable/_loading_layout_button.xml
  36. 0 0
      app_core/common/src/main/res/drawable/edit_hint_right_angle.xml
  37. 15 0
      app_core/common/src/main/res/drawable/selector_b2b_business_tab.xml
  38. 28 0
      app_core/common/src/main/res/layout/_loading_layout_empty.xml
  39. 42 0
      app_core/common/src/main/res/layout/_loading_layout_error.xml
  40. 25 0
      app_core/common/src/main/res/layout/_loading_layout_loading.xml
  41. 1 1
      app_core/common/src/main/res/layout/activity_subscribe_manage.xml
  42. 37 0
      app_core/common/src/main/res/layout/view_net_error.xml
  43. 8 1
      app_core/common/src/main/res/values/colors.xml
  44. 47 0
      app_core/common/src/main/res/values/styles.xml
  45. 68 0
      app_core/common/src/main/res/values/values-loading-layout.xml
  46. 3 6
      app_core/network/build.gradle
  47. 2 2
      app_core/network/src/main/java/com/me/network/app/base/HttpCallback.java
  48. 16 4
      app_core/network/src/main/java/com/me/network/app/http/HttpRequest.java
  49. 10 1
      app_modular/appcontact/src/main/java/com/uas/appcontact/adapter/FriendSortAdapter.java
  50. 139 0
      app_modular/appcontact/src/main/java/com/uas/appcontact/db/TopContactsDao.java
  51. 5 0
      app_modular/appcontact/src/main/java/com/uas/appcontact/manager/ContactsManager.java
  52. 73 0
      app_modular/appcontact/src/main/java/com/uas/appcontact/model/TopContacts.java
  53. 7 1
      app_modular/appcontact/src/main/java/com/uas/appcontact/ui/activity/CompanyContactsActivity.java
  54. 51 35
      app_modular/appcontact/src/main/java/com/uas/appcontact/ui/activity/MyFriendActivity.java
  55. 1 1
      app_modular/appcontact/src/main/java/com/uas/appcontact/ui/fragment/ContactsFragment.java
  56. 11 3
      app_modular/appme/src/main/java/com/uas/appme/other/activity/BasicInfoActivity.java
  57. 3 2
      app_modular/appme/src/main/java/com/uas/appme/settings/activity/BaseInfoActivity.java
  58. 1 0
      app_modular/appmessages/src/main/AndroidManifest.xml
  59. 0 2
      app_modular/appmessages/src/main/java/com/modular/appmessages/activity/AppWebViewActivity.java
  60. 0 1
      app_modular/appmessages/src/main/java/com/modular/appmessages/activity/ApprovalActivity.java
  61. 212 160
      app_modular/appmessages/src/main/java/com/modular/appmessages/activity/MessageWebActivity.java
  62. 61 0
      app_modular/appmessages/src/main/java/com/modular/appmessages/activity/MsgThirdWebActivity.java
  63. 19 8
      app_modular/appmessages/src/main/java/com/modular/appmessages/activity/MsgsSecondCommonActivity.java
  64. 1 1
      app_modular/appmessages/src/main/java/com/modular/appmessages/activity/SubcribeManageActivity.java
  65. 2 2
      app_modular/appmessages/src/main/java/com/modular/appmessages/adapter/ApprovalAdapter.java
  66. 0 1
      app_modular/appmessages/src/main/java/com/modular/appmessages/fragment/BaseFragment.java
  67. 6 8
      app_modular/appmessages/src/main/java/com/modular/appmessages/presenter/MessagePresenter.java
  68. 11 15
      app_modular/apputils/src/main/java/com/modular/apputils/IntentUrlActivity.java
  69. 8 1
      app_modular/apputils/src/main/java/com/modular/apputils/activity/BaseNetActivity.java
  70. 72 28
      app_modular/apputils/src/main/java/com/modular/apputils/activity/SelectNetAcitivty.java
  71. 46 0
      app_modular/apputils/src/main/java/com/modular/apputils/utils/RecyclerItemDecoration.java
  72. 6 3
      app_modular/apputils/src/main/java/com/modular/apputils/utils/SwitchUtil.java
  73. 110 0
      app_modular/apputils/src/main/java/com/modular/apputils/utils/TestStr.java
  74. 24 0
      app_modular/apputils/src/main/res/drawable/edit_hint_right_angle.xml
  75. 10 0
      app_modular/apputils/src/main/res/drawable/edit_white_right_angle.xml
  76. 45 1
      app_modular/appworks/src/main/AndroidManifest.xml
  77. 0 1
      app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/AddBusinessActivity.java
  78. 1 0
      app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/DeviceDataFormAddActivity.java
  79. 0 1
      app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/ScanDetailActivity.java
  80. 19 4
      app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/activity/CommonDocDetailsActivity.java
  81. 7 5
      app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/activity/form/DataFormDetailActivity.java
  82. 23 21
      app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/adapter/CommonDocMainMsgAdapter.java
  83. 5 5
      app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/presenter/WorkPresenter.java
  84. 8 14
      app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/activity/BusinessTravelActivity.java
  85. 335 0
      app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/activity/PurchaseDetailsActivity.java
  86. 1 27
      app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/adapter/ActivityAdapter.java
  87. 0 1
      app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/adapter/AutoPlayPagerAdapter.java
  88. 61 15
      app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/adapter/BusinessTravelAdapter.java
  89. 266 0
      app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/adapter/PurchaseDetailsAdapter.java
  90. 16 0
      app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/model/BusinessTravel.java
  91. 143 0
      app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/model/Purchase.java
  92. 125 0
      app_modular/appworks/src/main/java/com/uas/appworks/activity/B2BBusinessLoginActivity.java
  93. 711 0
      app_modular/appworks/src/main/java/com/uas/appworks/activity/B2BBusinessMainActivity.java
  94. 500 0
      app_modular/appworks/src/main/java/com/uas/appworks/activity/CustomerInquiryDetailActivity.java
  95. 176 0
      app_modular/appworks/src/main/java/com/uas/appworks/activity/CustomerInquiryListActivity.java
  96. 312 0
      app_modular/appworks/src/main/java/com/uas/appworks/activity/PublicInquiryDetailActivity.java
  97. 146 0
      app_modular/appworks/src/main/java/com/uas/appworks/activity/PublicInquiryListActivity.java
  98. 161 0
      app_modular/appworks/src/main/java/com/uas/appworks/activity/PurchaseOrderListActivity.java
  99. 76 0
      app_modular/appworks/src/main/java/com/uas/appworks/adapter/B2BAccountAdapter.java
  100. 59 0
      app_modular/appworks/src/main/java/com/uas/appworks/adapter/B2BBusinessCompanyAdapter.java

+ 2 - 2
WeiChat/build.gradle

@@ -120,7 +120,7 @@ android {
         flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name]
     }
 
-    applicationVariants.all { variant ->
+    /*applicationVariants.all { variant ->
         variant.outputs.each { output ->
             def outputFile = output.outputFile
             def fileName
@@ -142,7 +142,7 @@ android {
                 output.outputFile = new File(outputFile.parent, fileName)
             }
         }
-    }
+    }*/
 }
 
 dependencies {

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/adapter/PublicMessageAdapter.java

@@ -465,7 +465,7 @@ public class PublicMessageAdapter extends BaseAdapter implements BusinessCircleA
                     builder.append("、");
             }
             if (message.getPraise() > praises.size()) {
-                builder.append("...");
+                builder.append("..."+"共"+message.getPraise()+"个点赞");
             }
 
             viewHolder.multi_praise_tv.setText(builder);

+ 2 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/circle/BusinessCircleActivity.java

@@ -31,6 +31,7 @@ import com.alibaba.fastjson.JSON;
 import com.android.volley.Response;
 import com.android.volley.Response.ErrorListener;
 import com.android.volley.VolleyError;
+import com.common.LogUtil;
 import com.common.preferences.PreferenceUtils;
 import com.common.system.DisplayUtil;
 import com.common.ui.CameraUtil;
@@ -695,7 +696,7 @@ public class BusinessCircleActivity extends BaseActivity implements showCEView {
         }, new StringJsonArrayRequest.Listener<PublicMessage>() {
             @Override
             public void onResponse(ArrayResult<PublicMessage> result) {
-                Log.i("Arison", "商务信息:" + JSON.toJSONString(result));
+                LogUtil.prinlnLongMsg("Arison", "商务信息:" + JSON.toJSONString(result));
                 boolean success = Result.defaultParser(mContext, result, true);
                 if (success) {
                     List<PublicMessage> datas = result.getData();

+ 0 - 4
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/ADActivity.java

@@ -97,19 +97,15 @@ public class ADActivity extends BaseActivity {
                 switch (checkedId) {
                     case R.id.rb1:
                         item = 0;
-                        LogUtil.i("R.id.rb1");
                         break;
                     case R.id.rb2:
                         item = 1;
-                        LogUtil.i("R.id.rb2");
                         break;
                     case R.id.rb3:
                         item = 2;
-                        LogUtil.i("R.id.rb3");
                         break;
                     case R.id.rb4:
                         item = 3;
-                        LogUtil.i("R.id.rb4");
                         break;
                 }
                 ad_vp.setCurrentItem(item);

+ 0 - 12
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/net/HttpUtil.java

@@ -158,7 +158,6 @@ public class HttpUtil {
     public static Response httpPostWithJSON(String url, String json) throws Exception {
         // 将JSON进行UTF-8编码,以便传输中文
         String encoderJson = URLEncoder.encode(json, HTTP.UTF_8);
-        LogUtil.i("json=" + json);
         DefaultHttpClient httpClient = new DefaultHttpClient();
         HttpPost httpPost = new HttpPost(url);
         httpPost.addHeader(HTTP.CONTENT_TYPE, APPLICATION_JSON);
@@ -318,7 +317,6 @@ public class HttpUtil {
 
     private static void onFileLoadResult(final String filePath,    final OpenFilesUtils.OnFileLoadListener onFileLoadListener) {
         boolean ok;
-        LogUtil.i("filePath=" + filePath);
         if (!StringUtil.isEmpty(filePath) && new File(filePath).exists()) {
             ok = true;
         } else {
@@ -370,16 +368,12 @@ public class HttpUtil {
 
             final int file_leng = connection.getContentLength();
             InputStream bin = connection.getInputStream();
-            LogUtil.i("path=" + path);
-            LogUtil.i("fileName=" + fileName);
             File file = new File(path);
             if (!file.exists()) {
-                LogUtil.i("!file.exists()");
                 file.mkdirs();
             }
             file = new File(path + "/" + fileName);
             if (!file.exists()) {
-                LogUtil.i("!file.exists()2");
                 file.createNewFile();
             }
             OutputStream out = new FileOutputStream(file);
@@ -397,34 +391,28 @@ public class HttpUtil {
                         onFileLoadListener.onLoadIng(finalLen * 100, file_leng);
                     }
                 });
-                LogUtil.i("下载了=" + len * 100 / file_leng);
             }
             bin.close();
             out.close();
             return path + "/" + fileName;
         } catch (MalformedURLException e) {
             if (e != null) {
-                LogUtil.i("MalformedURLException=" + e.getMessage());
                 return e.getMessage();
             }
         } catch (IOException e) {
             if (e != null) {
-                LogUtil.i("IOException=" + e.getMessage());
                 return e.getMessage();
             }
         } catch (NoSuchAlgorithmException e) {
             if (e != null) {
-                LogUtil.i("NoSuchAlgorithmException=" + e.getMessage());
                 return e.getMessage();
             }
         } catch (KeyManagementException e) {
             if (e != null) {
-                LogUtil.i("KeyManagementException=" + e.getMessage());
                 return e.getMessage();
             }
         } catch (Exception e) {
             if (e != null) {
-                LogUtil.i("Exception=" + e.getMessage());
                 return e.getMessage();
             }
         }

+ 1 - 2
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/me/MeFragment.java

@@ -352,8 +352,7 @@ public class MeFragment extends EasyFragment implements View.OnClickListener {
             @Override
             public void onClick(View v) {
               startActivity(new Intent("com.modular.apputils.activity.SimpleWebActivity")
-             // .putExtra("filepath", FileUtils.getSDRoot()+"/uu/HTTP权威指南.pdf")
-              .putExtra("url","https://218.17.158.219:9443/uas_dev/mobile/message/getDetail.action?id=1393204")
+              .putExtra("url","http://qq784602719.imwork.net:13767/Chapter/")
               );
             }
         });

+ 46 - 16
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/message/ChatActivity.java

@@ -29,14 +29,18 @@ import android.widget.Toast;
 import com.alibaba.fastjson.JSON;
 import com.android.volley.Response;
 import com.android.volley.VolleyError;
+import com.common.LogUtil;
 import com.common.data.CalendarUtil;
 import com.common.data.ListUtils;
 import com.common.preferences.PreferenceUtils;
+import com.common.thread.ThreadPool;
 import com.common.ui.CameraUtil;
 import com.core.app.ActionBackActivity;
 import com.core.app.Constants;
 import com.core.app.MyApplication;
 import com.core.broadcast.MsgBroadcast;
+import com.core.dao.DBManager;
+import com.core.model.EmployeesEntity;
 import com.core.model.Friend;
 import com.core.model.User;
 import com.core.model.XmppMessage;
@@ -45,6 +49,7 @@ import com.core.net.volley.FastVolley;
 import com.core.net.volley.ObjectResult;
 import com.core.net.volley.Result;
 import com.core.net.volley.StringJsonObjectRequest;
+import com.core.utils.CommonUtil;
 import com.core.utils.ToastUtil;
 import com.core.xmpp.CoreService;
 import com.core.xmpp.FriendHelper;
@@ -63,6 +68,7 @@ import com.core.xmpp.widget.ChatContentView;
 import com.core.xmpp.widget.PullDownListView;
 import com.uas.appcontact.R;
 import com.nostra13.universalimageloader.core.ImageLoader;
+import com.uas.appcontact.db.TopContactsDao;
 
 import java.io.File;
 import java.util.ArrayList;
@@ -133,16 +139,6 @@ public class ChatActivity extends ActionBackActivity
         } else if (getIntent() != null) {
             mFriend = (Friend) getIntent().getSerializableExtra(AppConstant.EXTRA_FRIEND);
         }
-        if (mFriend != null && mFriend.getRoomFlag() == 0) {
-            //将这个人的numClick 添加1
-            int i = mFriend.getClickNum();
-            FriendHelper.addGoodFriend(mFriend);
-            if (i < 10 && mFriend.getClickNum() == 10) {
-                Intent intent = new Intent("com.app.home.update");
-                intent.putExtra("isGood", true);
-                sendBroadcast(intent);
-            }
-        }
         mAudioManager = (AudioManager) getSystemService(android.app.Service.AUDIO_SERVICE);
         mChatMessages = new ArrayList<>();
         Downloader.getInstance().init(MyApplication.getInstance().mAppDir + File.separator + mLoginUserId
@@ -158,7 +154,36 @@ public class ChatActivity extends ActionBackActivity
         instantFilePath = getIntent().getStringExtra(Constants.INSTANT_MESSAGE_FILE);//只有转发文件才会有
         IntentFilter filter = new IntentFilter(Constants.CHAT_MESSAGE_DELETE_ACTION);
         registerReceiver(broadcastReceiver, filter);
+        addPhone2Friend();
+    }
 
+    private void addPhone2Friend() {
+        if (mFriend != null && TextUtils.isEmpty(mFriend.getPhone())) {
+            LogUtil.i("mFriend != null && TextUtils.isEmpty(mFriend.getPhone())");
+            ThreadPool.getThreadPool().addTask(new Runnable() {
+                @Override
+                public void run() {
+                    Intent intent = getIntent();
+                    String phone = null;
+                    if (intent != null) {
+                        phone = intent.getStringExtra("phone");
+                    }
+                    if (!TextUtils.isEmpty(mFriend.getEmCode())) {
+                        String whichsys = CommonUtil.getMaster();
+                        String[] selectionArgs = {mFriend.getEmCode(), whichsys};
+                        String selection = "em_code=? and whichsys=? ";
+                        EmployeesEntity emModel = DBManager.getInstance().selectForEmployee(selectionArgs, selection);
+                        if (emModel != null && !TextUtils.isEmpty(emModel.getEM_MOBILE())) {
+                            phone = emModel.getEM_MOBILE();
+                        }
+                    }
+                    LogUtil.i("phone=" + phone);
+                    if (!TextUtils.isEmpty(phone)) {
+                        mFriend.setPhone(phone);
+                    }
+                }
+            });
+        }
     }
 
     BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
@@ -461,10 +486,10 @@ public class ChatActivity extends ActionBackActivity
             if (!message.isUpload()) {
                 UploadEngine.uploadImFile(mFriend.getUserId(), message, mUploadResponse);
             } else {
-                mService.sendChatMessage(mFriend.getUserId(), message);
+              sendMessageByService( message);
             }
         } else {
-            mService.sendChatMessage(mFriend.getUserId(), message);
+            sendMessageByService(message);
         }
         // mService.sendChatMessage(mFriend.getUserId(), chatMessage);
     }
@@ -515,22 +540,23 @@ public class ChatActivity extends ActionBackActivity
 
             } else {
                 Log.d("roamer", "sendChatMessage....");
-                mService.sendChatMessage(mFriend.getUserId(), message);
+                sendMessageByService( message);
             }
         } else {
             Log.d("roamer", "sendChatMessage");
 
-            mService.sendChatMessage(mFriend.getUserId(), message);
+            sendMessageByService( message);
             //进行百度推送
             sendPushTask(mLoginUserId, mFriend.getUserId(), message.getContent());
 
         }
+        TopContactsDao.api().addGoodFriend(mFriend);
     }
 
     private UploadEngine.ImFileUploadResponse mUploadResponse = new UploadEngine.ImFileUploadResponse() {
         @Override
         public void onSuccess(String toUserId, ChatMessage message) {
-            mService.sendChatMessage(mFriend.getUserId(), message);
+            sendMessageByService(message);
 
         }
 
@@ -547,9 +573,13 @@ public class ChatActivity extends ActionBackActivity
                 }
             }
         }
-
     };
 
+    private void sendMessageByService(ChatMessage message){
+        if (mService!=null&&mFriend!=null){
+            mService.sendChatMessage(mFriend.getUserId(), message);
+        }
+    }
     /**
      * 停止播放聊天的录音
      */

+ 0 - 5
WeiChat/src/main/java/com/xzjmyk/pm/activity/util/oa/AutoErpService.java

@@ -101,7 +101,6 @@ public class AutoErpService extends Service {
 
 	@Override
 	public int onStartCommand(Intent intent, int flags, int startId) {
-		LogUtil.i("onStartCommand");
 		try {
 			initBroadcast();//初始化广播接受器
 			initDB();//初始化数据库数据,1.删除昨天数据   2.下拉当天数据
@@ -114,7 +113,6 @@ public class AutoErpService extends Service {
 
 	@Override
 	public void onDestroy() {
-		LogUtil.i("onDestroy");
 		super.onDestroy();
 		LocalBroadcastManager.getInstance(MyApplication.getInstance()).unregisterReceiver(updateReceiver);
 		//TODO 获取此刻精确时间并转换为yyyy-MM-dd HH:mm:ss
@@ -168,18 +166,15 @@ public class AutoErpService extends Service {
 						}
 						dnotice = true;
 						isDNoticeRuning = true;
-						LogUtil.i("startDNoticeTask Runnable");
 						int i = DNOTICE_ITER - 1;
 						Log.i("dnoticeIter", dnoticeIter + "");
 
 						if (dnoticeIter == i) {
-							LogUtil.i("dnoticeIter == i");
 //                            MyApplication.getInstance().getBdLocationHelper().requestLocation();   // 暂时去掉定位
 						}
 						if (dnoticeIter == 0 || dnoticeIter == DNOTICE_ITER) {
 							dnoticeIter = 0;
 							//TODO 修改
-							LogUtil.i("dnoticeIter == 0 || dnoticeIter == DNOTICE_ITER");
 							DepositNoticeUtil.isNoticeTime(mSureBookModel);
 
 						}

+ 0 - 6
WeiChat/src/main/java/com/xzjmyk/pm/activity/util/oa/DepositNoticeUtil.java

@@ -133,7 +133,6 @@ public class DepositNoticeUtil {
 /*            LatLng latLng = new LatLng(Double.valueOf(model.getAb_latitude()), Double.valueOf(model.getAb_longitude()));
             float distance = BaiduMapUtil.getInstence().autoDistance(latLng);
             if (distance == -1f) {
-                LogUtil.i("distance == -1f");
                 continue;
             }*/
             if (model.getAb_starttime().compareTo(TimeUtils.f_long_2_str(System.currentTimeMillis())) > 0) {
@@ -155,8 +154,6 @@ public class DepositNoticeUtil {
         } else {
             Log.i("notificationManage", "提醒时间不符合");
         }
-        LogUtil.i("startNoticeTime=" + TimeUtils.f_long_2_str(startNoticeTime));
-        LogUtil.i("System.currentTimeMillis()=" + TimeUtils.f_long_2_str(System.currentTimeMillis()));
     }
 
     public static List<SureBookModel> getsureBookData() {
@@ -202,9 +199,6 @@ public class DepositNoticeUtil {
                             } else {
                                 Log.i("notificationManage", "提醒时间不符合");
                             }
-                            LogUtil.i("minTime=" + minTime);
-                            LogUtil.i("startNoticeTime=" + TimeUtils.f_long_2_str(startNoticeTime));
-                            LogUtil.i("System.currentTimeMillis()=" + TimeUtils.f_long_2_str(System.currentTimeMillis()));
                         } catch (Exception e) {
                             if (e != null)
                                 Log.i("setStartime Exception=", e.getMessage() + "");

+ 11 - 22
WeiChat/src/main/java/com/xzjmyk/pm/activity/video/VideoActivity.java

@@ -132,8 +132,7 @@ public class VideoActivity extends BaseActivity implements MediaRecorder.OnError
         try {
             mCamera = Camera.open();
         } catch (Exception e) {
-            if (e != null)
-                LogUtil.i("initCamera Exception=" + e.getMessage());
+
             freeCameraResource();
             Toast.makeText(MyApplication.getInstance(), "权限未开启,请检查", Toast.LENGTH_SHORT);
             finish();
@@ -192,11 +191,9 @@ public class VideoActivity extends BaseActivity implements MediaRecorder.OnError
                 releaseRecord();
             }
         } catch (IOException e) {
-            if (e != null)
-                LogUtil.i("IOException==" + e.getMessage());
+
         } catch (Exception e) {
-            if (e != null)
-                LogUtil.i("Exception==" + e.getMessage());
+
         }
     }
 
@@ -221,14 +218,11 @@ public class VideoActivity extends BaseActivity implements MediaRecorder.OnError
                 mMediaRecorder.stop();
                 mMediaRecorder.reset();
             } catch (IllegalStateException e) {
-                if (e != null)
-                    LogUtil.i("IllegalStateException==" + e.getMessage());
+
             } catch (RuntimeException e) {
-                if (e != null)
-                    LogUtil.i("RuntimeException==" + e.getMessage());
+
             } catch (Exception e) {
-                if (e != null)
-                    LogUtil.i("Exception==" + e.getMessage());
+
             }
         }
     }
@@ -285,12 +279,10 @@ public class VideoActivity extends BaseActivity implements MediaRecorder.OnError
         try {
             mMediaRecorder.prepare();
         } catch (IllegalStateException e) {
-            if (e != null)
-                LogUtil.i("IllegalStateException==" + e.getMessage());
+
             return false;
         } catch (IOException e) {
-            if (e != null)
-                LogUtil.i("IOException==" + e.getMessage());
+
             return false;
         }
         return true;
@@ -303,11 +295,9 @@ public class VideoActivity extends BaseActivity implements MediaRecorder.OnError
             if (mr != null)
                 mr.reset();
         } catch (IllegalStateException e) {
-            if (e != null)
-                LogUtil.i("IllegalStateException==" + e.getMessage());
+
         } catch (Exception e) {
-            if (e != null)
-                LogUtil.i("IllegalStateException==" + e.getMessage());
+
         }
     }
 
@@ -322,8 +312,7 @@ public class VideoActivity extends BaseActivity implements MediaRecorder.OnError
             try {
                 initCamera();
             } catch (IOException e) {
-                if (e != null)
-                    LogUtil.i("IOException==" + e.getMessage());
+
             }
         }
 

+ 1 - 1
WeiChat/src/main/res/layout/activity_subscribe_manage.xml

@@ -14,7 +14,7 @@
         android:layout_width="match_parent"
         android:layout_height="3dp"/>
 
-    <com.modular.appmessages.ui.NoSlideViewpager
+    <com.core.widget.NoSlideViewpager
         android:id="@+id/subscribe_manage_vp"
         android:layout_width="match_parent"
         android:layout_height="match_parent"/>

+ 6 - 0
WeiChat/src/main/res/values/styles.xml

@@ -35,6 +35,7 @@
         <item name="homeAsUpIndicator">@drawable/actionbar_up_indicator</item>
         <!-- This disables the black preview screen -->
         <item name="android:windowDisablePreview">true</item>
+        <item name="styleLoadingLayout">@style/LoadingLayoutStyle</item>
     </style>
 
 
@@ -47,6 +48,11 @@
 
     </style>
 
+    <style name="LoadingLayoutStyle" parent="LoadingLayout.Style">
+        <item name="llEmptyImage">@drawable/ic_empty</item>
+        <item name="llErrorImage">@drawable/ic_error</item>
+    </style>
+
     <!-- Dialog Style -->
     <style name="IMTheme.DialogStyle" parent="Theme.AppCompat.Dialog">
         <item name="android:windowFrame">@null</item>

+ 3 - 3
WeiChat/version.properties

@@ -1,5 +1,5 @@
-#Mon Jan 22 18:05:42 CST 2018
-debugName=132
+#Wed Jan 24 15:21:30 CST 2018
+debugName=142
 versionName=613
-debugCode=132
+debugCode=142
 versionCode=152

+ 3 - 3
app_core/common/build.gradle

@@ -8,7 +8,8 @@ android {
         targetSdkVersion rootProject.ext.android.targetSdkVersion
         versionCode rootProject.ext.android.versionCode
         versionName rootProject.ext.android.versionName
-       
+
+
     }
     useLibrary 'org.apache.http.legacy'
 
@@ -58,6 +59,5 @@ dependencies {
     compile project(':recyclerlibrary')
     //折线库
     compile files('libs/hellocharts-library-1.5.8.jar')
-    compile 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+'
-
+    compile deps.wechatSdk
 }

+ 9 - 0
app_core/common/src/main/assets/work_menu.json

@@ -293,6 +293,15 @@
         "menuUrl": "",
         "caller": "",
         "isHide": false
+      },
+      {
+        "isLocalMenu": true,
+        "menuName": "b2b商务",
+        "menuIcon": "",
+        "menuActivity": "com.modular.work.B2BBusinessLoginActivity",
+        "menuUrl": "",
+        "caller": "",
+        "isHide": false
       }
     ]
   }

+ 5 - 6
app_core/common/src/main/java/com/common/LogUtil.java

@@ -40,9 +40,8 @@ public class LogUtil {
 	}
 
 	public static void i(String msg) {
-		if (BaseConfig.showLogAble() && msg != null && msg.length() > 0) {
-			Log.i("gongpengming", msg);
-		}
+		prinlnLongMsg("gongpengming", msg);
+
 	}
 
 	public static void i(String tag, String msg) {
@@ -103,14 +102,14 @@ public class LogUtil {
 				for (int i = 0; i <= chunkCount; i++) {
 					int max = 3000 * (i + 1);
 					if (max >= responseInfo.length()) {
-						Log.v(TAG, "【chunk " + i + " of " + chunkCount + "】:" + responseInfo.substring(3000 * i));
+						Log.i(TAG, "【chunk " + i + " of " + chunkCount + "】:" + responseInfo.substring(3000 * i));
 					} else {
-						Log.v(TAG, "【chunk " + i + " of " + chunkCount + "】:" + responseInfo.substring(3000 * i, max));
+						Log.i(TAG, "【chunk " + i + " of " + chunkCount + "】:" + responseInfo.substring(3000 * i, max));
 					}
 				}
 			} else {
 				Log.v(TAG, "sb.length = " + responseInfo.length());
-				Log.v(TAG, responseInfo.toString());
+				Log.i(TAG, responseInfo.toString());
 			}
 		}
 

+ 288 - 287
app_core/common/src/main/java/com/common/data/JSONUtil.java

@@ -15,292 +15,293 @@ import java.util.Map;
 
 public class JSONUtil {
 
-	public static <T> String map2JSON(Map<String, T> map) {
-		if (map == null) return "";
-		StringBuilder builder = new StringBuilder("{\n");
-		for (Map.Entry<String, T> e : map.entrySet()) {
-			builder.append("\"" + e.getKey() + "\":");
-			if (e.getValue() instanceof String || e.getValue() instanceof CharSequence) {
-				builder.append("\"" + e.getValue() + "\",\n");
-			} else {
-				builder.append(e.getValue() + ",\n");
-			}
-		}
-		builder.deleteCharAt(builder.length() - 1);
-		builder.deleteCharAt(builder.length() - 1);
-		builder.append("\n}");
-		return builder.toString();
-	}
-
-	public static <T> String map2JSON(List<Map<String, T>> maps) {
-		if (maps == null || maps.size() <= 0) return "";
-		StringBuilder builder = new StringBuilder("[\n");
-		for (Map<String, T> m : maps) {
-			builder.append("{\n");
-			for (Map.Entry<String, T> e : m.entrySet()) {
-				builder.append("\"" + e.getKey() + "\":");
-				if (e.getValue() instanceof String || e.getValue() instanceof CharSequence) {
-					builder.append("\"" + StringUtil.toHttpString((String) e.getValue()) + "\",\n");
-				} else {
-					builder.append(e.getValue() + ",\n");
-				}
-			}
-			StringUtil.removieLast(builder);
-			StringUtil.removieLast(builder);
-			builder.append("\n},\n");
-		}
-		StringUtil.removieLast(builder);
-		StringUtil.removieLast(builder);
-		builder.append("\n]");
-		return builder.toString();
-	}
-
-	public static String param2Url(String url, Map<String, Object> param) {
-		if (StringUtil.isEmpty(url))
-			return "";
-		StringBuilder urlBuilder = new StringBuilder(url);
-		if (param == null || param.isEmpty()) {
-			return urlBuilder.toString();
-		}
-		if (!url.contains("?"))
-			urlBuilder.append("?");
-		else urlBuilder.append("&");
-		for (Map.Entry<String, Object> e : param.entrySet()) {
-			if (e.getValue() == null || StringUtil.isEmpty(e.getKey()))
-				continue;
-			String value = null;
-			try {
-				value = URLEncoder.encode(e.getValue().toString(), "UTF-8");
-			} catch (UnsupportedEncodingException e1) {
-				value = e.getValue().toString();
-			}
-			urlBuilder.append(String.format("%s=%s", e.getKey(), value));
-			urlBuilder.append("&");
-		}
-		if (urlBuilder.length() > 1)
-			urlBuilder.deleteCharAt(urlBuilder.length() - 1);
-		return urlBuilder.toString();
-	}
-
-	public static JSONObject getJSONObject(String message, String... keys) {
-		try {
-			return getJSONObject(JSON.parseObject(message), keys);
-		} catch (Exception e) {
-			return new JSONObject();
-		}
-	}
-
-	public static JSONArray getJSONArray(String message, String... keys) {
-		try {
-			return getJSONArray(JSON.parseObject(message), keys);
-		} catch (Exception e) {
-			return new JSONArray();
-		}
-	}
-
-	public static boolean getBoolean(String message, String... keys) {
-		try {
-			return getBoolean(JSON.parseObject(message), keys);
-		} catch (Exception e) {
-			return false;
-		}
-	}
-
-	public static String getText(String message, String... keys) {
-		try {
-			return getText(JSON.parseObject(message), keys);
-		} catch (Exception e) {
-			return "";
-		}
-	}
-
-	public static int getInt(String message, String... keys) {
-		try {
-			return getInt(JSON.parseObject(message), keys);
-		} catch (Exception e) {
-			return 0;
-		}
-	}
-
-	public static long getLong(String message, String... keys) {
-		try {
-			return getLong(JSON.parseObject(message), keys);
-		} catch (Exception e) {
-			return 0;
-		}
-	}
-
-	public static double getDouble(String message, String... keys) {
-		try {
-			return getDouble(JSON.parseObject(message), keys);
-		} catch (Exception e) {
-			return 0;
-		}
-	}
-
-	public static float getFloat(String message, String... keys) {
-		try {
-			return getFloat(JSON.parseObject(message), keys);
-		} catch (Exception e) {
-			return 0;
-		}
-	}
-
-	private static boolean satisfyGet(JSONObject object, String... keys) {
-		return !(object == null || keys == null || keys.length <= 0);
-	}
-
-	public static JSONObject getJSONObject(JSONObject object, String... keys) {
-		if (satisfyGet(object, keys)) {
-			try {
-				for (String key : keys) {
-					if (key != null && object.containsKey(key) && object.get(key) != null && object.get(key) instanceof JSONObject) {
-						return object.getJSONObject(key);
-					}
-				}
-			} catch (Exception e) {
-				return new JSONObject();
-			}
-		}
-		return new JSONObject();
-	}
-
-	public static JSONArray getJSONArray(JSONObject object, String... keys) {
-		try {
-			if (object == null || keys == null || keys.length <= 0) return new JSONArray();
-			for (String key : keys) {
-				if (object.containsKey(key) && object.get(key) instanceof JSONArray) {
-					return object.getJSONArray(key);
-				}
-			}
-		} catch (Exception e) {
-			return new JSONArray();
-		}
-		return new JSONArray();
-	}
-
-	public static boolean getBoolean(JSONObject object, String... keys) {
-		try {
-			String bool = getDataForJson(object, keys);
-			return Boolean.valueOf(bool);
-		} catch (Exception e) {
-			return false;
-		}
-
-	}
-
-	public static String getText(JSONObject object, String... keys) {
-		try {
-			String t = getDataForJson(object, keys);
-			if (StringUtil.isEmpty(t) || StringUtil.hasOneEqual(t, "(null)", "null")) {
-				return "";
-			} else
-				return t;
-		} catch (Exception e) {
-			return "";
-		}
-	}
-
-	public static int getInt(JSONObject object, String... keys) {
-		try {
-			String i = getDataForJson(object, keys);
-			return Integer.valueOf(i);
-		} catch (Exception e) {
-			return 0;
-		}
-	}
-
-	public static long getLong(JSONObject object, String... keys) {
-		try {
-			String i = getDataForJson(object, keys);
-			return Long.valueOf(i);
-		} catch (Exception e) {
-			return 0;
-		}
-	}
-
-	public static double getDouble(JSONObject object, String... keys) {
-		try {
-			String d = getDataForJson(object, keys);
-			return Double.valueOf(d);
-		} catch (Exception e) {
-			return 0;
-
-		}
-	}
-
-	public static float getFloat(JSONObject object, String... keys) {
-		try {
-			String f = getDataForJson(object, keys);
-			return Float.valueOf(f);
-		} catch (Exception e) {
-			return 0;
-		}
-	}
-
-	private static String getDataForJson(JSONObject object, String... keys) {
-		if (object == null || keys == null || keys.length <= 0) return null;
-		Object o = null;
-		for (String key : keys) {
-			o = object.get(key);
-			if (o != null)
-				return o.toString();
-		}
-		return null;
-	}
-
-
-	/*获取接口时间格式,由于独立版和erp版本返回的时间格式不一样 long 和 String */
-	public static long getTime(JSONObject jsonObject, String... keys) {
-		if (jsonObject == null || keys == null || keys.length <= 0) return 0;
-		for (String k : keys) {
-			try {
-				if (jsonObject.containsKey(k)) {
-					Object o = jsonObject.get(k);
-					if (o instanceof String) {
-						return DateFormatUtil.str2Long((String) o, DateFormatUtil.YMD_HMS);
-					} else if (o instanceof Long) {
-						return (long) o;
-					}
-				}
-			} catch (Exception e) {
-
-			}
-		}
-		return 0;
-	}
-
-	/*验证一个字符串是否是合法的JSON串*/
-	public static boolean validate(String message) {
-		if (StringUtil.isEmpty(message)) return false;
-		try {
-			JSON.parse(message);
-			return true;
-		} catch (Exception e) {
-			return false;
-		}
-	}
-
-	/*验证一个字符串是否是合法的JSON串*/
-	public static boolean validateJSONObject(String message) {
-		if (StringUtil.isEmpty(message)) return false;
-		try {
-			JSON.parseObject(message);
-			return true;
-		} catch (Exception e) {
-			return false;
-		}
-	}
-
-	/*验证一个字符串是否是合法的JSON串*/
-	public static boolean validateJSONArray(String message) {
-		if (StringUtil.isEmpty(message)) return false;
-		try {
-			JSON.parseArray(message);
-			return true;
-		} catch (Exception e) {
-			return false;
-		}
-	}
+    public static <T> String map2JSON(Map<String, T> map) {
+        if (map == null) return "";
+        StringBuilder builder = new StringBuilder("{\n");
+        for (Map.Entry<String, T> e : map.entrySet()) {
+            builder.append("\"" + e.getKey() + "\":");
+            if (e.getValue() instanceof String || e.getValue() instanceof CharSequence) {
+                builder.append("\"" + e.getValue() + "\",\n");
+            } else {
+                builder.append(e.getValue() + ",\n");
+            }
+        }
+        builder.deleteCharAt(builder.length() - 1);
+        builder.deleteCharAt(builder.length() - 1);
+        builder.append("\n}");
+        return builder.toString();
+    }
+
+    public static <T> String map2JSON(List<Map<String, T>> maps) {
+        if (maps == null || maps.size() <= 0) return "";
+        StringBuilder builder = new StringBuilder("[\n");
+        for (Map<String, T> m : maps) {
+            builder.append("{\n");
+            for (Map.Entry<String, T> e : m.entrySet()) {
+                builder.append("\"" + e.getKey() + "\":");
+                if (e.getValue() instanceof String || e.getValue() instanceof CharSequence) {
+                    builder.append("\"" + StringUtil.toHttpString((String) e.getValue()) + "\",\n");
+                } else {
+                    builder.append(e.getValue() + ",\n");
+                }
+            }
+            StringUtil.removieLast(builder);
+            StringUtil.removieLast(builder);
+            builder.append("\n},\n");
+        }
+        StringUtil.removieLast(builder);
+        StringUtil.removieLast(builder);
+        builder.append("\n]");
+        return builder.toString();
+    }
+
+    public static String param2Url(String url, Map<String, Object> param) {
+        if (StringUtil.isEmpty(url))
+            return "";
+        StringBuilder urlBuilder = new StringBuilder(url);
+        if (param == null || param.isEmpty()) {
+            return urlBuilder.toString();
+        }
+        if (!url.contains("?"))
+            urlBuilder.append("?");
+        else urlBuilder.append("&");
+        for (Map.Entry<String, Object> e : param.entrySet()) {
+            if (e.getValue() == null || StringUtil.isEmpty(e.getKey()))
+                continue;
+            String value = null;
+            try {
+                value = URLEncoder.encode(e.getValue().toString(), "UTF-8");
+            } catch (UnsupportedEncodingException e1) {
+                value = e.getValue().toString();
+            }
+            urlBuilder.append(String.format("%s=%s", e.getKey(), value));
+            urlBuilder.append("&");
+        }
+        if (urlBuilder.length() > 1)
+            urlBuilder.deleteCharAt(urlBuilder.length() - 1);
+        return urlBuilder.toString();
+    }
+
+    public static JSONObject getJSONObject(String message, String... keys) {
+        try {
+            return getJSONObject(JSON.parseObject(message), keys);
+        } catch (Exception e) {
+            return new JSONObject();
+        }
+    }
+
+    public static JSONArray getJSONArray(String message, String... keys) {
+        try {
+            return getJSONArray(JSON.parseObject(message), keys);
+        } catch (Exception e) {
+            return new JSONArray();
+        }
+    }
+
+    public static boolean getBoolean(String message, String... keys) {
+        try {
+            return getBoolean(JSON.parseObject(message), keys);
+        } catch (Exception e) {
+            return false;
+        }
+    }
+
+    public static String getText(String message, String... keys) {
+        try {
+            return getText(JSON.parseObject(message), keys);
+        } catch (Exception e) {
+            return "";
+        }
+    }
+
+    public static int getInt(String message, String... keys) {
+        try {
+            return getInt(JSON.parseObject(message), keys);
+        } catch (Exception e) {
+            return 0;
+        }
+    }
+
+    public static long getLong(String message, String... keys) {
+        try {
+            return getLong(JSON.parseObject(message), keys);
+        } catch (Exception e) {
+            return 0;
+        }
+    }
+
+    public static double getDouble(String message, String... keys) {
+        try {
+            return getDouble(JSON.parseObject(message), keys);
+        } catch (Exception e) {
+            return 0;
+        }
+    }
+
+    public static float getFloat(String message, String... keys) {
+        try {
+            return getFloat(JSON.parseObject(message), keys);
+        } catch (Exception e) {
+            return 0;
+        }
+    }
+
+    private static boolean satisfyGet(JSONObject object, String... keys) {
+        return !(object == null || keys == null || keys.length <= 0);
+    }
+
+    public static JSONObject getJSONObject(JSONObject object, String... keys) {
+        if (satisfyGet(object, keys)) {
+            try {
+                for (String key : keys) {
+                    if (key != null && object.containsKey(key) && object.get(key) != null && object.get(key) instanceof JSONObject) {
+                        return object.getJSONObject(key);
+                    }
+                }
+            } catch (Exception e) {
+                return new JSONObject();
+            }
+        }
+        return new JSONObject();
+    }
+
+    public static JSONArray getJSONArray(JSONObject object, String... keys) {
+        try {
+            if (object == null || keys == null || keys.length <= 0) return new JSONArray();
+            for (String key : keys) {
+                if (object.containsKey(key) && object.get(key) instanceof JSONArray) {
+                    return object.getJSONArray(key);
+                }
+            }
+        } catch (Exception e) {
+            return new JSONArray();
+        }
+        return new JSONArray();
+    }
+
+    public static boolean getBoolean(JSONObject object, String... keys) {
+        try {
+            String bool = getDataForJson(object, keys);
+            return Boolean.valueOf(bool);
+        } catch (Exception e) {
+            return false;
+        }
+
+    }
+
+    public static String getText(JSONObject object, String... keys) {
+        try {
+            String t = getDataForJson(object, keys);
+            if (StringUtil.isEmpty(t) || StringUtil.hasOneEqual(t, "(null)", "null")) {
+                return "";
+            } else
+                return t;
+        } catch (Exception e) {
+            return "";
+        }
+    }
+
+    public static int getInt(JSONObject object, String... keys) {
+        try {
+            String i = getDataForJson(object, keys);
+            return Integer.valueOf(i);
+        } catch (Exception e) {
+            return 0;
+        }
+    }
+
+    public static long getLong(JSONObject object, String... keys) {
+        try {
+            String i = getDataForJson(object, keys);
+            return Long.valueOf(i);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    public static double getDouble(JSONObject object, String... keys) {
+        try {
+            String d = getDataForJson(object, keys);
+            return Double.valueOf(d);
+        } catch (Exception e) {
+            return 0;
+
+        }
+    }
+
+    public static float getFloat(JSONObject object, String... keys) {
+        try {
+            String f = getDataForJson(object, keys);
+            return Float.valueOf(f);
+        } catch (Exception e) {
+            return 0;
+        }
+    }
+
+    private static String getDataForJson(JSONObject object, String... keys) {
+        if (object == null || keys == null || keys.length <= 0) return null;
+        Object o = null;
+        for (String key : keys) {
+            o = object.get(key);
+            if (o != null)
+                return o.toString();
+        }
+        return null;
+    }
+
+
+    /*获取接口时间格式,由于独立版和erp版本返回的时间格式不一样 long 和 String */
+    public static long getTime(JSONObject jsonObject, String... keys) {
+        if (jsonObject == null || keys == null || keys.length <= 0) return 0;
+        for (String k : keys) {
+            try {
+                if (jsonObject.containsKey(k)) {
+                    Object o = jsonObject.get(k);
+                    if (o instanceof String) {
+                        return DateFormatUtil.str2Long((String) o, DateFormatUtil.YMD_HMS);
+                    } else if (o instanceof Long) {
+                        return (long) o;
+                    }
+                }
+            } catch (Exception e) {
+
+            }
+        }
+        return 0;
+    }
+
+    /*验证一个字符串是否是合法的JSON串*/
+    public static boolean validate(String message) {
+        if (StringUtil.isEmpty(message)) return false;
+        try {
+            JSON.parse(message);
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
+    }
+
+    /*验证一个字符串是否是合法的JSON串*/
+    public static boolean validateJSONObject(String message) {
+        if (StringUtil.isEmpty(message)) return false;
+        try {
+            JSON.parseObject(message);
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
+    }
+
+    /*验证一个字符串是否是合法的JSON串*/
+    public static boolean validateJSONArray(String message) {
+        if (StringUtil.isEmpty(message)) return false;
+        try {
+            JSON.parseArray(message);
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
+    }
 
 }

+ 8 - 0
app_core/common/src/main/java/com/core/app/ActionBackActivity.java

@@ -198,4 +198,12 @@ public class ActionBackActivity extends StackActivity {
         super.finish();
         overridePendingTransition(R.anim.anim_activity_back_in, R.anim.anim_activity_back_out);
     }
+
+    protected void finish(boolean anim) {
+        if (anim) {
+            finish();
+        } else {
+            super.finish();
+        }
+    }
 }

+ 49 - 1
app_core/common/src/main/java/com/core/app/Constants.java

@@ -17,6 +17,7 @@ public class Constants {
         String url = "";
         if (BaseConfig.isDebug()) {
             url = IM_BASE_URL_TEST;
+            url = IM_BASE_URL;
         } else {
             url = IM_BASE_URL;
         }
@@ -253,7 +254,9 @@ public class Constants {
             + "type varchar(20),"//类型
             + "hierarchy integer,"//类型
             + "readTime integer,"//阅读时间
-            + "isReaded integer"//阅读状态,1阅读
+            + "isReaded integer,"//阅读状态,1阅读
+            + "caller varchar(20),"//
+            + "keyValue integer"//
             + ")";
     //考勤地址表
     public static final String WORK_LOCATION = "CREATE TABLE work_location ("
@@ -317,6 +320,17 @@ public class Constants {
             + "," + DatabaseTables.UUHelperTable.Cols.TYPE
             + ")";
 
+    //TopContactsTable
+    public static final String TABLE_TOPCONTACTS_RECORD = "create table "
+            + DatabaseTables.TopContactsTable.NAME + "("
+            + DatabaseTables.TopContactsTable.Cols.USER_ID
+            + "," + DatabaseTables.TopContactsTable.Cols.OWNER_ID
+            + "," + DatabaseTables.TopContactsTable.Cols.PHONE
+            + "," + DatabaseTables.TopContactsTable.Cols.NAME
+            + "," + DatabaseTables.TopContactsTable.Cols.EM_CODE
+            + "," + DatabaseTables.TopContactsTable.Cols.LAST_TIME
+            + "," + DatabaseTables.TopContactsTable.Cols.STATUS
+            + ")";
     public static String IS_NOTIFICATION = "is_notification";//是是否进行通知
     /**
      * @desc:常量
@@ -468,5 +482,39 @@ public class Constants {
          */
         int WEIXIN_PAY = 101;
         int API_PAY = 102;
+
+        /**
+         * B2B商务
+         */
+        String B2B_COMPANY_BEAN = "b2b_company_bean";
+
+        String EXTRA_B2B_LIST_ID = "extra_b2b_list_id";
+        String EXTRA_B2B_LIST_STATE = "extra_b2b_list_state";
+        String EXTRA_B2B_LIST_ENUU = "extra_b2b_list_enuu";
+        String EXTRA_B2B_LIST_JSON = "extra_b2b_list_json";
+
+        String STATE_PURCHASE_ORDER_TODO = "todo";
+        String STATE_PURCHASE_ORDER_END = "end";
+        String STATE_PURCHASE_ORDER_DONE = "done";
+
+        String STATE_CUSTOMER_INQUIRY_TODO = "todo";
+        String STATE_CUSTOMER_INQUIRY_DONE = "done";
+        String STATE_CUSTOMER_INQUIRY_AGREED = "agreed";
+        String STATE_CUSTOMER_INQUIRY_END = "end";
+        String STATE_CUSTOMER_INQUIRY_REFUSED = "refused";
+        String STATE_CUSTOMER_INQUIRY_INVALID = "invalid";
+        String STATE_CUSTOMER_INQUIRY_ABANDONED = "abandoned";
+
+        String STATE_PUBLIC_INQUIRY_DONE = "public_done";
+        String STATE_PUBLIC_INQUIRY_TODO = "public_todo";
+
+        int RESULT_PURCHASE_ORDER = 111;
+        int RESULT_CUSTOMER_INQUIRY = 112;
+        int RESULT_PUBLIC_INQUIRY = 113;
+
+    }
+
+    public interface CACHE {
+        String B2B_BUSINESS_ENUU = "b2b_business_enuu";
     }
 }

+ 18 - 2
app_core/common/src/main/java/com/core/base/fragment/BaseMVPFragment.java

@@ -14,6 +14,7 @@ import com.core.app.R;
 import com.core.base.presenter.BasePresenter;
 import com.core.base.view.BaseView;
 import com.core.utils.ToastUtil;
+import com.core.widget.CustomProgressDialog;
 
 
 /**
@@ -37,6 +38,8 @@ public abstract class BaseMVPFragment<T extends BasePresenter> extends Fragment
      */
     private View mRootView;
 
+    public CustomProgressDialog progressDialog;
+
     @Override
     public void onAttach(Context context) {
         super.onAttach(context);
@@ -76,6 +79,7 @@ public abstract class BaseMVPFragment<T extends BasePresenter> extends Fragment
         if (mPresenter != null) {
             mPresenter.attachView(this);
         }
+        progressDialog = CustomProgressDialog.createDialog(mContext);
         initViews();
         initEvents();
         initDatas();
@@ -184,6 +188,18 @@ public abstract class BaseMVPFragment<T extends BasePresenter> extends Fragment
         getActivity().overridePendingTransition(R.anim.anim_activity_in, R.anim.anim_activity_out);
     }
 
+    @Override
+    public void startActivity(Intent intent, @Nullable Bundle options) {
+        super.startActivity(intent, options);
+        getActivity().overridePendingTransition(R.anim.anim_activity_in, R.anim.anim_activity_out);
+    }
+
+    @Override
+    public void startActivityForResult(Intent intent, int requestCode, @Nullable Bundle options) {
+        super.startActivityForResult(intent, requestCode, options);
+        getActivity().overridePendingTransition(R.anim.anim_activity_in, R.anim.anim_activity_out);
+    }
+
     /**
      * [含有Bundle通过Class打开编辑界面]
      *
@@ -217,6 +233,8 @@ public abstract class BaseMVPFragment<T extends BasePresenter> extends Fragment
         getActivity().overridePendingTransition(R.anim.anim_activity_in, R.anim.anim_activity_out);
     }
 
+    protected abstract int getLayout();
+
     /**
      * 创建presenter
      *
@@ -224,8 +242,6 @@ public abstract class BaseMVPFragment<T extends BasePresenter> extends Fragment
      */
     protected abstract T initPresenter();
 
-    protected abstract int getLayout();
-
     protected abstract void initViews();
 
     protected abstract void initEvents();

+ 8 - 3
app_core/common/src/main/java/com/core/dao/MessageDao.java

@@ -263,7 +263,7 @@ public class MessageDao {
             String emcode = CommonUtil.getEmcode();
             if (StringUtil.isEmpty(master) || StringUtil.isEmpty(emcode)) return messageModels;
             db = DatabaseManager.getInstance().openDatabase();
-            String[] columns = {"id", "count", "title", "subTitle", "time", "type", "isReaded", "readTime"};
+            String[] columns = {"id", "count", "title", "subTitle", "time", "type", "isReaded", "readTime","caller","keyValue"};
 //TODO
             String selection = "hierarchy=? and master=? and emcode=?  and  isReaded!=? ";
             String[] selectArgs = {String.valueOf(0), master, emcode, String.valueOf(3)};
@@ -295,7 +295,7 @@ public class MessageDao {
             String emcode = CommonUtil.getEmcode();
             if (StringUtil.isEmpty(master) || StringUtil.isEmpty(emcode)) return messageModels;
             db = DatabaseManager.getInstance().openDatabase();
-            String[] columns = {"id", "count", "title", "subTitle", "time", "type", "isReaded", "readTime"};
+            String[] columns = {"id", "count", "title", "subTitle", "time", "type", "isReaded", "readTime","caller","keyValue"};
             Cursor c = null;
             String selection;
             if (platform) {
@@ -328,7 +328,6 @@ public class MessageDao {
         SQLiteDatabase db = null;
         long i = 0;
         try {
-            String readTime = TimeUtils.f_long_2_str(System.currentTimeMillis());
             String master = CommonUtil.getMaster();
             String emcode = CommonUtil.getEmcode();
             if (StringUtil.isEmpty(master) || StringUtil.isEmpty(emcode)) return false;
@@ -487,7 +486,11 @@ public class MessageDao {
             int isReaded = c.getInt(c.getColumnIndex("isReaded"));
             String readTime = c.getString(c.getColumnIndex("readTime"));
             int readStatus = c.getInt(c.getColumnIndex("isReaded"));
+            String caller = c.getString(c.getColumnIndex("caller"));
+            int keyValue = c.getInt(c.getColumnIndex("keyValue"));
             model = new MessageModel(id, hierarchy, count, title, subTitle, time, type, (isReaded == 1 || isReaded == 3), readStatus, readTime);
+           model.setCaller(caller);
+           model.setKeyValue(keyValue);
             messageModels.add(model);
         }
         return messageModels;
@@ -505,6 +508,8 @@ public class MessageDao {
         values.put("title", m.getTitle());
         values.put("subTitle", m.getSubTitle());
         values.put("hierarchy", m.getHierarchy());
+        values.put("caller", m.getCaller());
+        values.put("keyValue", m.getKeyValue());
         return values;
     }
 

+ 4 - 2
app_core/common/src/main/java/com/core/db/DBOpenHelper.java

@@ -13,8 +13,8 @@ import com.core.app.Constants;
  * @注释:建立数据库
  */
 public class DBOpenHelper extends SQLiteOpenHelper {
-    //TODO  上一个发布版本是87
-    private static final int DATABASE_VERSION = 88;
+    //TODO  上一个发布版本是89
+    private static final int DATABASE_VERSION = 90;
     public static String dataBaseName = "erp.db";
     public Context context;
 
@@ -57,6 +57,7 @@ public class DBOpenHelper extends SQLiteOpenHelper {
 //            db.execSQL(Constants.TRACK_POINT); //运行轨迹,实时定位点记录表
             db.execSQL(Constants.TABLE_HISTORICAL_RECORD);//数据查询历史记录表
             db.execSQL(Constants.TABLE_UUHELPER_RECORD);//UU助手
+            db.execSQL(Constants.TABLE_TOPCONTACTS_RECORD);//常用联系人
             db.execSQL(Constants.STEPRANKING_FIRST); //用于存贮每天UU运动排名第一相关的数据表
         } catch (Exception e) {
 
@@ -101,6 +102,7 @@ public class DBOpenHelper extends SQLiteOpenHelper {
 //        db.execSQL("DROP TABLE IF EXISTS trackPoint");
         db.execSQL("DROP TABLE IF EXISTS " + DatabaseTables.HistoricalRecordTable.NAME);
         db.execSQL("DROP TABLE IF EXISTS " + DatabaseTables.UUHelperTable.NAME);
+        db.execSQL("DROP TABLE IF EXISTS " + DatabaseTables.TopContactsTable.NAME);
         db.execSQL("DROP TABLE IF EXISTS StepRankingFirst");
     }
 

+ 12 - 0
app_core/common/src/main/java/com/core/db/DatabaseTables.java

@@ -32,4 +32,16 @@ public interface DatabaseTables {
             String TYPE = "type";
         }
     }
+    interface TopContactsTable {
+        String NAME = "top_contacts";
+        interface Cols {
+            String USER_ID = "userId";
+            String OWNER_ID = "ownerId";
+            String PHONE = "phone";
+            String NAME = "name";
+            String EM_CODE = "emCode";
+            String LAST_TIME = "lastTime";
+            String STATUS = "status";
+        }
+    }
 }

+ 24 - 1
app_core/common/src/main/java/com/core/model/MessageModel.java

@@ -23,10 +23,13 @@ public class MessageModel implements Parcelable {
     private int readStatus;//阅读状态
     private String readTime;
 
+    private String caller;
+    private int keyValue;
+
     public MessageModel() {
     }
 
-    public MessageModel(int id, int hierarchy, int count,  String title, String subTitle, String time, String type, boolean isReaded, int readStatus, String readTime) {
+    public MessageModel(int id, int hierarchy, int count, String title, String subTitle, String time, String type, boolean isReaded, int readStatus, String readTime) {
         this.id = id;
         this.hierarchy = hierarchy;
         this.count = count;
@@ -51,6 +54,9 @@ public class MessageModel implements Parcelable {
         isReaded = in.readByte() != 0;
         readStatus = in.readInt();
         readTime = in.readString();
+        caller = in.readString();
+        keyValue = in.readInt();
+
     }
 
     @Override
@@ -66,6 +72,8 @@ public class MessageModel implements Parcelable {
         dest.writeByte((byte) (isReaded ? 1 : 0));
         dest.writeInt(readStatus);
         dest.writeString(readTime);
+        dest.writeString(caller);
+        dest.writeInt(keyValue);
     }
 
     @Override
@@ -153,6 +161,21 @@ public class MessageModel implements Parcelable {
         isReaded = readed;
     }
 
+    public String getCaller() {
+        return caller;
+    }
+
+    public void setCaller(String caller) {
+        this.caller = caller;
+    }
+
+    public int getKeyValue() {
+        return keyValue;
+    }
+
+    public void setKeyValue(int keyValue) {
+        this.keyValue = keyValue;
+    }
 
     /**
      * 1crm/CRM提醒

+ 1 - 0
app_core/common/src/main/java/com/core/net/http/ViewUtil.java

@@ -1046,6 +1046,7 @@ public class ViewUtil {
                                     String password) {
         mdProcessDialog.setContent(MyApplication.getInstance().getString(R.string.login_progress_erp));
         url = url + "mobile/login.action";
+//        url = CommonUtil.getAppBaseUrl(MyApplication.getInstance()) + "mobile/login.action";
         Map<String, String> params = new HashMap<String, String>();
         params.put("username", username);
         params.put("password", password);

+ 0 - 2
app_core/common/src/main/java/com/core/net/http/http/OAHttpHelper.java

@@ -54,8 +54,6 @@ public class OAHttpHelper extends Handler {
     @Override
     public void handleMessage(Message msg) {
         try {
-            LogUtil.i("handleMessage");
-            LogUtil.i("msg="+ JSON.toJSONString(msg));
             OnHttpResultListener listener = (OnHttpResultListener) msg.getData().getSerializable("listener");
             if (listener == null) return;
             Bundle bundle = msg.getData();

+ 0 - 8
app_core/common/src/main/java/com/core/net/location/BdLocationHelper.java

@@ -112,8 +112,6 @@ public class BdLocationHelper {
 			try {
 				setLocation(location);
 			} catch (Exception e) {
-				if (e != null)
-					LogUtil.i("onReceiveLocation Exception" + e.getMessage());
 				clearLocation();
 			}
 		}
@@ -127,7 +125,6 @@ public class BdLocationHelper {
 				) {
 			//定位成功
 			mLocationClient.stop();
-			LogUtil.i("定位成功" + location.getLocType());
 			locationOk = true;
 			latLng = new LatLng(location.getLatitude(), location.getLongitude());
 			this.location = location.getLocationDescribe();
@@ -150,22 +147,17 @@ public class BdLocationHelper {
 		} else {
 			//统一为定位失败
 			locationOk = false;
-			LogUtil.i("定位失败");
 			if (location.getLocType() == BDLocation.TypeServerError) {
 				//服务端网络定位失败,可以反馈IMEI号和大体定位时间到loc-bugs@baidu.com,会有人追查原因
 				errorMessage = "服务端网络定位失败";
-				LogUtil.i("服务端网络定位失败");
 			} else if (location.getLocType() == BDLocation.TypeNetWorkException) {
 				//网络不同导致定位失败,请检查网络是否通畅
 				errorMessage = "网络不同导致定位失败,请检查网络是否通畅";
-				LogUtil.i("网络不同导致定位失败,请检查网络是否通畅");
 			} else if (location.getLocType() == BDLocation.TypeCriteriaException) {
 				//无法获取有效定位依据导致定位失败,一般是由于手机的原因,处于飞行模式下一般会造成这种结果,可以试着重启手机
 				errorMessage = "无法获取有效定位依据导致定位失败";
-				LogUtil.i("无法获取有效定位依据导致定位失败");
 			} else {
 				errorMessage = "未知错误";
-				LogUtil.i("未知错误");
 			}
 			if (mFaildCount < 3) {
 				mFaildCount++;

+ 31 - 3
app_core/common/src/main/java/com/core/utils/CommonUtil.java

@@ -101,7 +101,7 @@ public class CommonUtil {
         }
         String baseUrl = getSharedPreferences(ct, "erp_baseurl");
 //        if (BaseConfig.isDebug()){
-//            baseUrl="http://192.168.253.35:8080/ERP/";
+//            baseUrl="http://192.168.253.203:8090/ERP/";
 //        }
 //        baseUrl="http://192.168.253.203:8090/ERP/
 
@@ -137,6 +137,7 @@ public class CommonUtil {
     }
 
     private static final String TAG = "CommonUtil";
+
     /**
      * B2B身份session
      *
@@ -145,7 +146,7 @@ public class CommonUtil {
      */
     public static String getB2BSession(Context ct) {
         if (ct == null) {
-            LogUtil.d(TAG,"ct ==null");
+            LogUtil.d(TAG, "ct ==null");
             return "";
         }
         return getSharedPreferences(ct, Constants.B2B_SESSION_CACHE) == null ? "" : getSharedPreferences(ct, Constants.B2B_SESSION_CACHE);
@@ -529,7 +530,6 @@ public class CommonUtil {
     }
 
 
-
     /**
      * 获得当前包的版本号 return
      **/
@@ -1143,6 +1143,22 @@ public class CommonUtil {
 
     }
 
+    /**
+     * 是否控件重复点击
+     *
+     * @return
+     */
+    public static boolean isRepeatClick(long time) {
+        long currentTime = System.currentTimeMillis();
+        long intervals = currentTime - mLastClickTime;
+        if (intervals > 0 && intervals < time) {
+            return true;
+        }
+        mLastClickTime = currentTime;
+        return false;
+
+    }
+
     /**
      * EditText竖直方向是否可以滚动
      *
@@ -1186,4 +1202,16 @@ public class CommonUtil {
         List<T> dest = (List<T>) in.readObject();
         return dest;
     }
+
+
+    /**
+     * double值小数点后为0则不显示,保留四位小数
+     *
+     * @param v
+     * @return
+     */
+    public static String doubleFormat(double v) {
+        DecimalFormat decimalFormat = new DecimalFormat("###.####");
+        return decimalFormat.format(v);
+    }
 }

+ 5 - 5
app_core/common/src/main/java/com/core/utils/OpenFilesUtils.java

@@ -286,18 +286,18 @@ public class OpenFilesUtils {
             int status = c.getInt(c.getColumnIndex(DownloadManager.COLUMN_STATUS));
             switch (status) {
                 case DownloadManager.STATUS_PAUSED:
-                    showFileToast(">>>下载暂停");
+                    showFileToast(">>>浏览暂停");
                 case DownloadManager.STATUS_PENDING:
-                    showFileToast(">>>下载延迟");
+                    showFileToast(">>>浏览出现延迟");
                 case DownloadManager.STATUS_RUNNING:
-                    showFileToast(">>>正在下载");
+                    showFileToast(">>>正在生成附件浏览");
                     break;
                 case DownloadManager.STATUS_SUCCESSFUL:
-                    showFileToast(">>>下载完成");
+                    showFileToast(">>>正在打开文件");
                     //下载完成安装克定义自动执行打开文件操作
                     break;
                 case DownloadManager.STATUS_FAILED:
-                    showFileToast(">>>下载失败");
+                    showFileToast(">>>浏览失败");
                     break;
             }
         }

+ 319 - 0
app_core/common/src/main/java/com/core/widget/LoadingLayout.java

@@ -0,0 +1,319 @@
+package com.core.widget;
+
+import android.app.Activity;
+import android.app.Fragment;
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.graphics.drawable.Drawable;
+import android.support.annotation.DrawableRes;
+import android.support.annotation.LayoutRes;
+import android.util.AttributeSet;
+import android.util.TypedValue;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.core.app.R;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+public class LoadingLayout extends FrameLayout {
+    public interface OnInflateListener {
+        void onInflate(View inflated);
+    }
+
+    public static LoadingLayout wrap(Activity activity) {
+        return wrap(((ViewGroup)activity.findViewById(android.R.id.content)).getChildAt(0));
+    }
+    public static LoadingLayout wrap(Fragment fragment) {
+        return wrap(fragment.getView());
+    }
+    public static LoadingLayout wrap(View view) {
+        if (view == null) {
+            throw new RuntimeException("content view can not be null");
+        }
+        ViewGroup parent = (ViewGroup)view.getParent();
+        if (view == null) {
+            throw new RuntimeException("parent view can not be null");
+        }
+        ViewGroup.LayoutParams lp = view.getLayoutParams();
+        int index = parent.indexOfChild(view);
+        parent.removeView(view);
+
+        LoadingLayout layout = new LoadingLayout(view.getContext());
+        parent.addView(layout, index, lp);
+        layout.addView(view);
+        layout.setContentView(view);
+        return layout;
+    }
+
+    int mEmptyImage;
+    CharSequence mEmptyText;
+
+    int mErrorImage;
+    CharSequence mErrorText, mRetryText;
+    OnClickListener mRetryButtonClickListener = new OnClickListener() {
+        @Override
+        public void onClick(View v) {
+            if (mRetryListener != null) {
+                mRetryListener.onClick(v);
+            }
+        }
+    };
+    OnClickListener mRetryListener;
+
+    OnInflateListener mOnEmptyInflateListener;
+    OnInflateListener mOnErrorInflateListener;
+
+    int mTextColor, mTextSize;
+    int mButtonTextColor, mButtonTextSize;
+    Drawable mButtonBackground;
+    int mEmptyResId = NO_ID, mLoadingResId = NO_ID, mErrorResId = NO_ID;
+    int mContentId = NO_ID;
+
+    Map<Integer, View> mLayouts = new HashMap<>();
+
+
+    public LoadingLayout(Context context) {
+        this(context, null, R.attr.styleLoadingLayout);
+    }
+
+    public LoadingLayout(Context context, AttributeSet attrs) {
+        this(context, attrs, R.attr.styleLoadingLayout);
+    }
+
+    public LoadingLayout(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+
+        mInflater = LayoutInflater.from(context);
+        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.LoadingLayout, defStyleAttr, R.style.LoadingLayout_Style);
+        mEmptyImage = a.getResourceId(R.styleable.LoadingLayout_llEmptyImage, NO_ID);
+        mEmptyText = a.getString(R.styleable.LoadingLayout_llEmptyText);
+
+        mErrorImage = a.getResourceId(R.styleable.LoadingLayout_llErrorImage, NO_ID);
+        mErrorText = a.getString(R.styleable.LoadingLayout_llErrorText);
+        mRetryText = a.getString(R.styleable.LoadingLayout_llRetryText);
+
+        mTextColor = a.getColor(R.styleable.LoadingLayout_llTextColor, 0xff999999);
+        mTextSize = a.getDimensionPixelSize(R.styleable.LoadingLayout_llTextSize, dp2px(16));
+
+        mButtonTextColor = a.getColor(R.styleable.LoadingLayout_llButtonTextColor, 0xff999999);
+        mButtonTextSize = a.getDimensionPixelSize(R.styleable.LoadingLayout_llButtonTextSize, dp2px(16));
+        mButtonBackground = a.getDrawable(R.styleable.LoadingLayout_llButtonBackground);
+
+        mEmptyResId = a.getResourceId(R.styleable.LoadingLayout_llEmptyResId, R.layout._loading_layout_empty);
+        mLoadingResId = a.getResourceId(R.styleable.LoadingLayout_llLoadingResId, R.layout._loading_layout_loading);
+        mErrorResId = a.getResourceId(R.styleable.LoadingLayout_llErrorResId, R.layout._loading_layout_error);
+        a.recycle();
+    }
+
+    int dp2px(float dp) {
+        return (int) (getResources().getDisplayMetrics().density * dp);
+    }
+
+
+    LayoutInflater mInflater;
+    @Override
+    protected void onFinishInflate() {
+        super.onFinishInflate();
+        if (getChildCount() == 0) {
+            return;
+        }
+        if (getChildCount() > 1) {
+            removeViews(1, getChildCount() - 1);
+        }
+        View view = getChildAt(0);
+        setContentView(view);
+        showLoading();
+    }
+
+    private void setContentView(View view) {
+        mContentId = view.getId();
+        mLayouts.put(mContentId, view);
+    }
+
+    public LoadingLayout setLoading(@LayoutRes int id) {
+        if (mLoadingResId != id) {
+            remove(mLoadingResId);
+            mLoadingResId = id;
+        }
+        return this;
+    }
+    public LoadingLayout setEmpty(@LayoutRes int id) {
+        if (mEmptyResId != id) {
+            remove(mEmptyResId);
+            mEmptyResId = id;
+        }
+        return this;
+    }
+    public LoadingLayout setOnEmptyInflateListener(OnInflateListener listener) {
+        mOnEmptyInflateListener = listener;
+        if (mOnEmptyInflateListener != null && mLayouts.containsKey(mEmptyResId)) {
+            listener.onInflate(mLayouts.get(mEmptyResId));
+        }
+        return this;
+    }
+    public LoadingLayout setOnErrorInflateListener(OnInflateListener listener) {
+        mOnErrorInflateListener = listener;
+        if (mOnErrorInflateListener != null && mLayouts.containsKey(mErrorResId)) {
+            listener.onInflate(mLayouts.get(mErrorResId));
+        }
+        return this;
+    }
+
+    public LoadingLayout setEmptyImage(@DrawableRes int resId) {
+        mEmptyImage = resId;
+        image(mEmptyResId, R.id.empty_image, mEmptyImage);
+        return this;
+    }
+    public LoadingLayout setEmptyText(String value) {
+        mEmptyText = value;
+        text(mEmptyResId, R.id.empty_text, mEmptyText);
+        return this;
+    }
+    public LoadingLayout setErrorImage(@DrawableRes int resId) {
+        mErrorImage = resId;
+        image(mErrorResId, R.id.error_image, mErrorImage);
+        return this;
+    }
+    public LoadingLayout setErrorText(String value) {
+        mErrorText = value;
+        text(mErrorResId, R.id.error_text, mErrorText);
+        return this;
+    }
+
+    public LoadingLayout setRetryText(String text) {
+        mRetryText = text;
+        text(mErrorResId, R.id.retry_button, mRetryText);
+        return this;
+    }
+
+    public LoadingLayout setRetryListener(OnClickListener listener) {
+        mRetryListener = listener;
+        return this;
+    }
+
+
+//    public LoadingLayout setTextColor(@ColorInt int color) {
+//        mTextColor = color;
+//        return this;
+//    }
+//    public LoadingLayout setTextSize(@ColorInt int dp) {
+//        mTextColor = dp2px(dp);
+//        return this;
+//    }
+//    public LoadingLayout setButtonTextColor(@ColorInt int color) {
+//        mButtonTextColor = color;
+//        return this;
+//    }
+//    public LoadingLayout setButtonTextSize(@ColorInt int dp) {
+//        mButtonTextColor = dp2px(dp);
+//        return this;
+//    }
+//    public LoadingLayout setButtonBackground(Drawable drawable) {
+//        mButtonBackground = drawable;
+//        return this;
+//    }
+
+    public void showLoading() {
+        show(mLoadingResId);
+    }
+
+    public void showEmpty() {
+        show(mEmptyResId);
+    }
+
+    public void showError() {
+        show(mErrorResId);
+    }
+
+    public void showContent() {
+        show(mContentId);
+    }
+
+    private void show(int layoutId) {
+        for (View view : mLayouts.values()) {
+            view.setVisibility(GONE);
+        }
+        layout(layoutId).setVisibility(VISIBLE);
+    }
+
+    private void remove(int layoutId) {
+        if (mLayouts.containsKey(layoutId)) {
+            View vg = mLayouts.remove(layoutId);
+            removeView(vg);
+        }
+    }
+
+    private View layout(int layoutId) {
+        if (mLayouts.containsKey(layoutId)) {
+            return mLayouts.get(layoutId);
+        }
+        View layout = mInflater.inflate(layoutId, this, false);
+        layout.setVisibility(GONE);
+        addView(layout);
+        mLayouts.put(layoutId, layout);
+
+        if (layoutId == mEmptyResId) {
+            ImageView img = (ImageView) layout.findViewById(R.id.empty_image);
+            if (img != null) {
+                img.setImageResource(mEmptyImage);
+            }
+            TextView view = (TextView) layout.findViewById(R.id.empty_text);
+            if (view != null) {
+                view.setText(mEmptyText);
+                view.setTextColor(mTextColor);
+                view.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextSize);
+            }
+            if (mOnEmptyInflateListener != null) {
+                mOnEmptyInflateListener.onInflate(layout);
+            }
+        } else if (layoutId == mErrorResId) {
+            ImageView img = (ImageView) layout.findViewById(R.id.error_image);
+            if (img != null) {
+                img.setImageResource(mErrorImage);
+            }
+            TextView txt = (TextView) layout.findViewById(R.id.error_text);
+            if (txt != null) {
+                txt.setText(mErrorText);
+                txt.setTextColor(mTextColor);
+                txt.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextSize);
+            }
+            TextView btn = (TextView) layout.findViewById(R.id.retry_button);
+            if (btn != null) {
+                btn.setText(mRetryText);
+                btn.setTextColor(mButtonTextColor);
+                btn.setTextSize(TypedValue.COMPLEX_UNIT_PX, mButtonTextSize);
+                btn.setBackground(mButtonBackground);
+                btn.setOnClickListener(mRetryButtonClickListener);
+            }
+            if (mOnErrorInflateListener != null) {
+                mOnErrorInflateListener.onInflate(layout);
+            }
+        }
+        return layout;
+    }
+
+    private void text(int layoutId, int ctrlId, CharSequence value) {
+        if (mLayouts.containsKey(layoutId)) {
+            TextView view = (TextView) mLayouts.get(layoutId).findViewById(ctrlId);
+            if (view != null) {
+                view.setText(value);
+            }
+        }
+    }
+
+    private void image(int layoutId, int ctrlId, int resId) {
+        if (mLayouts.containsKey(layoutId)) {
+            ImageView view = (ImageView) mLayouts.get(layoutId).findViewById(ctrlId);
+            if (view != null) {
+                view.setImageResource(resId);
+            }
+        }
+    }
+}

+ 14 - 5
app_modular/appmessages/src/main/java/com/modular/appmessages/ui/NoSlideViewpager.java → app_core/common/src/main/java/com/core/widget/NoSlideViewpager.java

@@ -1,4 +1,4 @@
-package com.modular.appmessages.ui;
+package com.core.widget;
 
 import android.content.Context;
 import android.support.v4.view.ViewPager;
@@ -20,11 +20,20 @@ public class NoSlideViewpager extends ViewPager {
         super(context, attrs);
     }
 
+    public boolean isNoSlide() {
+        return noSlide;
+    }
+
+    public void setNoSlide(boolean noSlide) {
+        this.noSlide = noSlide;
+    }
+
     @Override
     public boolean onTouchEvent(MotionEvent ev) {
-        if (noSlide){
+        if (noSlide) {
+
             return false;
-        }else {
+        } else {
             return super.onTouchEvent(ev);
 
         }
@@ -32,9 +41,9 @@ public class NoSlideViewpager extends ViewPager {
 
     @Override
     public boolean onInterceptTouchEvent(MotionEvent ev) {
-        if (noSlide){
+        if (noSlide) {
             return false;
-        }else {
+        } else {
             return super.onInterceptTouchEvent(ev);
 
         }

+ 35 - 1
app_core/common/src/main/java/com/core/widget/SearchActionView.java

@@ -4,6 +4,8 @@ import android.app.Activity;
 import android.content.Context;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
+import android.text.Editable;
+import android.text.TextWatcher;
 import android.util.AttributeSet;
 import android.view.KeyEvent;
 import android.view.LayoutInflater;
@@ -18,7 +20,7 @@ import com.core.utils.CommonUtil;
 
 /**
  * @author RaoMeng
- * @describe
+ * @describe 带搜索框以及右侧菜单的actionview
  * @date 2017/12/22 10:17
  */
 
@@ -27,6 +29,7 @@ public class SearchActionView extends FrameLayout {
     private OnVoiceCompleteListener mOnVoiceCompleteListener;
     private OnEnterActionListener mOnEnterActionListener;
     private OnMenuClickListener mOnMenuClickListener;
+    private OnTextChangedListener mOnTextChangedListener;
     private ClearEditText mSearchEditText;
 
     public void setOnVoiceCompleteListener(OnVoiceCompleteListener onVoiceCompleteListener) {
@@ -41,6 +44,10 @@ public class SearchActionView extends FrameLayout {
         mOnMenuClickListener = onMenuClickListener;
     }
 
+    public void setOnTextChangedListener(OnTextChangedListener onTextChangedListener) {
+        mOnTextChangedListener = onTextChangedListener;
+    }
+
     public void setMenuImage(int menuImage) {
         try {
             mMenuImageView.setImageResource(menuImage);
@@ -117,6 +124,25 @@ public class SearchActionView extends FrameLayout {
                 return false;
             }
         });
+
+        mSearchEditText.addTextChangedListener(new TextWatcher() {
+            @Override
+            public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+            }
+
+            @Override
+            public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+            }
+
+            @Override
+            public void afterTextChanged(Editable editable) {
+                if (mOnTextChangedListener != null) {
+                    mOnTextChangedListener.onTextChanged(editable.toString());
+                }
+            }
+        });
     }
 
     public void setSearchHint(String hint) {
@@ -127,6 +153,10 @@ public class SearchActionView extends FrameLayout {
         mSearchEditText.setHint(hint);
     }
 
+    public String getText() {
+        return mSearchEditText.getText().toString();
+    }
+
     public interface OnVoiceCompleteListener {
         void onVoiceComplete();
     }
@@ -138,4 +168,8 @@ public class SearchActionView extends FrameLayout {
     public interface OnMenuClickListener {
         void onMenuClick(View view);
     }
+
+    public interface OnTextChangedListener {
+        void onTextChanged(String text);
+    }
 }

+ 46 - 6
app_core/common/src/main/java/com/core/xmpp/FriendHelper.java

@@ -1,7 +1,9 @@
 package com.core.xmpp;
 
 import android.content.Context;
+import android.content.Intent;
 
+import com.alibaba.fastjson.JSON;
 import com.android.volley.Response.ErrorListener;
 import com.android.volley.VolleyError;
 import com.common.LogUtil;
@@ -11,10 +13,12 @@ import com.core.broadcast.MsgBroadcast;
 import com.core.model.AttentionUser;
 import com.core.model.CircleMessage;
 import com.core.model.Friend;
+import com.core.model.Hrorgs;
 import com.core.net.volley.ArrayResult;
 import com.core.net.volley.FastVolley;
 import com.core.net.volley.Result;
 import com.core.net.volley.StringJsonArrayRequest;
+import com.core.utils.sortlist.BaseSortModel;
 import com.core.utils.sp.TableVersionSp;
 import com.core.xmpp.dao.ChatMessageDao;
 import com.core.xmpp.dao.CircleMessageDao;
@@ -120,17 +124,52 @@ public class FriendHelper {
         MsgBroadcast.broadcastMsgNumReset(MyApplication.getInstance());
     }
 
+    public static void addGoodFriend(Context context, Hrorgs.Employee employee) {
+        if (employee != null) {
+            Friend friend = new Friend();
+            friend.setTimeCreate((int) (System.currentTimeMillis() / 1000));
+            friend.setTimeSend((int) (System.currentTimeMillis() / 1000));
+            friend.setOwnerId(MyApplication.getInstance().getLoginUserId());
+            friend.setUserId(String.valueOf(employee.em_imid));
+            friend.setNickName(employee.em_name);
+            friend.setPhone(employee.em_mobile);
+            friend.setEmCode(employee.em_code);
+            friend.setRoomFlag(0);// 0朋友 1群组
+            friend.setStatus(Friend.STATUS_FRIEND);
+            BaseSortModel<Friend> mode = new BaseSortModel<>();
+            mode.setBean(friend);
+            addGoodFriend(context, friend);
+        }
+    }
+
     /**
      * 添加常用
+     * 1.拨打电话
+     * 2.发送聊天信息
      */
-    public static void addGoodFriend(Friend friend) {
-//        if (friend.getClickNum() < 10) {
-            friend.setClickNum(friend.getClickNum() + 1);
-            boolean b = FriendDao.getInstance().createOrUpdateFriend(friend);
-            LogUtil.i("b="+b);
-//        }
+    public static void addGoodFriend(Context context, Friend friend) {
+        if (friend != null) {
+            String ownId = MyApplication.getInstance().getLoginUserId();
+            LogUtil.i("ownId== " + ownId);
+            LogUtil.i("friendid== " + friend.getUserId());
+            Friend updateFriend = FriendDao.getInstance().getFriend(ownId, friend.getUserId());
+            if (updateFriend == null) {
+                friend.setTimeSend( (int) (System.currentTimeMillis() / 1000));
+                FriendDao.getInstance().createFriend(friend);
+            } else {
+                LogUtil.i("updateFriend==elseelseelse");
+                int lastMagSend = updateFriend.getTimeSend();
+                int defTime = ((int) System.currentTimeMillis() / 1000) - lastMagSend;
+                if (defTime < 86400) {
+                    FriendDao.getInstance().updateClickNum(ownId, friend.getUserId(), 10);
+                } else {
+                    FriendDao.getInstance().updateSendTime(ownId, friend.getUserId(), (int) (System.currentTimeMillis() / 1000));
+                }
+            }
+        }
     }
 
+
     /**
      * 在本地数据库表中出入一条关注记录,额外需要做的操作
      */
@@ -152,6 +191,7 @@ public class FriendHelper {
         // 更新Main Ui message 未读数量
         MsgBroadcast.broadcastMsgNumUpdate(MyApplication.getInstance(), true, 1);
     }
+
     /**
      * 如果关注或加好友某个人,那么就去下载他的商务圈消息
      *

+ 36 - 0
app_core/common/src/main/java/com/core/xmpp/dao/FriendDao.java

@@ -5,6 +5,7 @@ import android.os.Handler;
 import android.text.TextUtils;
 import android.util.Log;
 
+import com.common.LogUtil;
 import com.core.app.R;
 import com.common.data.CalendarUtil;
 import com.core.app.MyApplication;
@@ -1172,6 +1173,41 @@ public class FriendDao {
         ).start();
     }
 
+    public int createFriend(Friend friend) {
+        try {
+            int status = friendDao.create(friend);
+            return status;
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        return -1;
+    }
+    public void updateSendTime(String ownerId, String friendId, int sendTime) {
+        UpdateBuilder<Friend, Integer> builder = friendDao.updateBuilder();
+        try {
+            builder.where().eq("ownerId", ownerId).and().eq("userId", friendId);
+            builder.updateColumnValue("timeSend", sendTime);
+            int e = friendDao.update(builder.prepare());
+            LogUtil.i("updateSendTime e=" + e);
+        } catch (SQLException e) {
+            e.printStackTrace();
+            LogUtil.i("e=" + e.getMessage());
+        }
+    }
+
+    public void updateClickNum(String ownerId, String friendId, int clickNum) {
+        UpdateBuilder<Friend, Integer> builder = friendDao.updateBuilder();
+        try {
+            builder.where().eq("ownerId", ownerId).and().eq("userId", friendId);
+            builder.updateColumnValue("clickNum", clickNum);
+            int e = friendDao.update(builder.prepare());
+            LogUtil.i("updateClickNum e=" + e);
+        } catch (SQLException e) {
+            e.printStackTrace();
+            LogUtil.i("e=" + e.getMessage());
+        }
+    }
+
     public void updateNickName(String ownerId, String friendId, String myNickName) {
         UpdateBuilder<Friend, Integer> builder = friendDao.updateBuilder();
         try {

+ 5 - 0
app_core/common/src/main/res/drawable/_loading_layout_button.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <corners android:radius="5dp" />
+    <stroke android:width="1px" android:color="#CCCCCC" />
+</shape>

+ 0 - 0
app_core/common/src/main/res/drawable-xxhdpi/edit_hint_right_angle.xml → app_core/common/src/main/res/drawable/edit_hint_right_angle.xml


+ 15 - 0
app_core/common/src/main/res/drawable/selector_b2b_business_tab.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <!-- Non focused states -->
+    <item android:state_focused="false" android:state_pressed="false" android:state_selected="false" android:color="@color/black"/>
+    <item android:state_focused="false" android:state_pressed="false" android:state_selected="true" android:color="@color/b2b_tab_selected"/>
+
+    <!-- Focused states -->
+    <item android:state_focused="true" android:state_pressed="false" android:state_selected="false" android:color="@color/black"/>
+    <item android:state_focused="true" android:state_pressed="false" android:state_selected="true" android:color="@color/b2b_tab_selected"/>
+
+    <!-- Pressed -->
+    <item android:state_pressed="true" android:color="@color/black"/>
+
+</selector>

+ 28 - 0
app_core/common/src/main/res/layout/_loading_layout_empty.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_gravity="center"
+    android:paddingBottom="30dp"
+    android:gravity="center"
+    android:orientation="vertical">
+
+    <ImageView
+        android:id="@id/empty_image"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:adjustViewBounds="true"/>
+
+    <TextView
+        android:id="@id/empty_text"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        tools:textColor="#999999"
+        tools:textSize="16sp"
+        tools:text="暂无数据"/>
+</LinearLayout>

+ 42 - 0
app_core/common/src/main/res/layout/_loading_layout_error.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_gravity="center"
+    android:paddingBottom="30dp"
+    android:gravity="center"
+    android:orientation="vertical">
+    <ImageView
+        android:id="@id/error_image"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:adjustViewBounds="true"/>
+
+    <TextView
+        android:id="@id/error_text"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:layout_margin="20dp"
+        tools:text="无网络连接,请检查您的网络..."
+        tools:textColor="#666666"
+        tools:textSize="16sp"/>
+
+    <TextView
+        android:id="@id/retry_button"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:background="@drawable/_loading_layout_button"
+        android:gravity="center"
+        android:minWidth="120dp"
+        android:padding="10dp"
+        tools:text="加载失败,点击重试~~"
+        tools:textColor="#999999"
+        tools:textSize="16sp"/>
+
+</LinearLayout>

+ 25 - 0
app_core/common/src/main/res/layout/_loading_layout_loading.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_gravity="center"
+    android:gravity="center"
+    android:paddingBottom="30dp"
+    android:orientation="vertical">
+    <ProgressBar
+        android:layout_width="30dp"
+        android:layout_height="30dp"
+        android:layout_gravity="center"
+        android:progress="80"/>
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:text="加载中..."
+        android:textColor="#999999"
+        android:textSize="16sp"/>
+</LinearLayout>

+ 1 - 1
app_core/common/src/main/res/layout/activity_subscribe_manage.xml

@@ -14,7 +14,7 @@
         android:layout_width="match_parent"
         android:layout_height="3dp"/>
 
-    <com.xzjmyk.pm.activity.view.NoSlideViewpager
+    <com.core.widget.NoSlideViewpager
         android:id="@+id/subscribe_manage_vp"
         android:layout_width="match_parent"
         android:layout_height="match_parent"/>

+ 37 - 0
app_core/common/src/main/res/layout/view_net_error.xml

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/rl_empty"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <TextView
+            android:id="@+id/textViewMessage"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
+            android:layout_marginTop="16dp"
+            android:drawableTop="@drawable/ic_empty"
+            android:text="@string/networks_out"
+            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:textColor="@color/gray_light" />
+
+        <Button
+            android:id="@+id/buttonEmpty"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_below="@+id/textViewMessage"
+            android:layout_centerHorizontal="true"
+            android:layout_marginTop="16dp"
+            android:text="@string/empty_button"
+            android:visibility="gone" />
+    </RelativeLayout>
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content" />
+</RelativeLayout>

+ 8 - 1
app_core/common/src/main/res/values/colors.xml

@@ -338,7 +338,14 @@
     <color name="data_inquiry_gird_menu_color6">#68d2c9</color>
     <color name="data_inquiry_caption_textcolor">#999999</color>
     <color name="data_inquiry_value_textcolor">#333333</color>
-    
+
     <!--服务预约-->
     <color name="blue_seats_num">#2E94DD</color>
+
+    <!--B2B商务-->
+    <color name="b2b_tab_bg">#f2f8fc</color>
+    <color name="b2b_tab_selected">#2F95DD</color>
+    <color name="b2b_btn_todo">#2F95DD</color>
+    <color name="b2b_btn_done">#62B1CB</color>
+    <color name="b2b_btn_end">#AAAAAA</color>
 </resources>

+ 47 - 0
app_core/common/src/main/res/values/styles.xml

@@ -35,6 +35,7 @@
         <item name="homeAsUpIndicator">@drawable/actionbar_up_indicator</item>
         <!-- This disables the black preview screen -->
         <item name="android:windowDisablePreview">true</item>
+        <item name="styleLoadingLayout">@style/LoadingLayoutStyle</item>
     </style>
 
 
@@ -47,6 +48,12 @@
 
     </style>
 
+
+    <style name="LoadingLayoutStyle" parent="LoadingLayout.Style">
+        <item name="llEmptyImage">@drawable/ic_empty</item>
+        <item name="llErrorImage">@drawable/ic_error</item>
+    </style>
+
     <!-- Dialog Style -->
     <style name="IMTheme.DialogStyle" parent="Theme.AppCompat.Dialog">
         <item name="android:windowFrame">@null</item>
@@ -1043,6 +1050,46 @@
         <item name="fadeDelay">1000</item>-->
     </style>
 
+    <style name="StyledBlueIndicators" parent="@style/AppTheme">
+        <item name="vpiTabPageIndicatorStyle">@style/CustomBlueTabPageIndicator</item>
+        <item name="vpiUnderlinePageIndicatorStyle">@style/CustomBlueUnderlinePageIndicator</item>
+    </style>
+
+    <style name="CustomBlueTabPageIndicator" parent="Widget.TabPageIndicator">
+        <!-- 点击时在不同状态下显示的背景色 -->
+        <!--<item name="android:background">@drawable/vpi__tab_indicator</item>-->
+        <item name="android:background">@color/b2b_tab_bg</item>
+        <!-- 分割线图片设置 -->
+        <item name="android:divider">@drawable/dividing_line</item>
+        <!-- 设置分割线的显示位置,或是不显示 -->
+        <item name="android:showDividers">none</item>
+
+        <item name="android:textAppearance">@style/CustomBlueTabPageIndicator.Text</item>
+        <item name="android:textColor">@drawable/selector_b2b_business_tab</item>
+        <item name="android:textSize">14sp</item>
+        <!--<item name="android:textStyle">bold</item>-->
+        <!--<item name="android:dividerPadding">10dp</item>-->
+        <item name="android:paddingLeft">10dp</item>
+        <item name="android:paddingRight">10dp</item>
+        <item name="android:paddingTop">10dp</item>
+        <item name="android:paddingBottom">10dp</item>
+        <item name="android:fadingEdgeLength">10dp</item>
+        <item name="android:fadingEdge">horizontal</item>
+    </style>
+
+    <style name="CustomBlueTabPageIndicator.Text" parent="android:TextAppearance.Medium">
+        <item name="android:typeface">normal</item>
+        <!--<item name="android:textColor">@color/selector_subscribe_manage</item>-->
+    </style>
+
+    <style name="CustomBlueUnderlinePageIndicator">
+        <item name="selectedColor">@color/b2b_tab_selected</item>
+        <item name="android:background">@color/b2b_tab_bg</item>
+        <!--<item name="android:textColor">@drawable/selector_subscribe_tab</item>-->
+        <!--<item name="fadeLength">1000</item>
+        <item name="fadeDelay">1000</item>-->
+    </style>
+
     <!-- PopupWindow窗口动画 -->
     <style name="MenuAnimationFade">
         <item name="android:windowEnterAnimation">@anim/popup_fade_in</item>

+ 68 - 0
app_core/common/src/main/res/values/values-loading-layout.xml

@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<resources>
+    <item name="empty_image" type="id"/>
+    <item name="empty_text" type="id"/>
+
+    <item name="error_image" type="id"/>
+    <item name="error_text" type="id"/>
+    <item name="retry_button" type="id"/>
+
+    <attr name="styleLoadingLayout" format="reference"/>
+
+    <style name="LoadingLayout">
+    </style>
+
+    <style name="LoadingLayout.Style">
+        <item name="llEmptyResId">@layout/_loading_layout_empty</item>
+        <item name="llLoadingResId">@layout/_loading_layout_loading</item>
+        <item name="llErrorResId">@layout/_loading_layout_error</item>
+
+        <item name="llTextColor">#999999</item>
+        <item name="llTextSize">16sp</item>
+
+        <item name="llButtonTextColor">#999999</item>
+        <item name="llButtonTextSize">16sp</item>
+        <item name="llButtonBackground">@drawable/_loading_layout_button</item>
+
+        <item name="llEmptyImage">@null</item>
+        <item name="llEmptyText">暂无数据</item>
+        <item name="llErrorImage">@null</item>
+        <item name="llErrorText">无网络连接,请检查您的网络...</item>
+        <item name="llRetryText">加载失败,点击重试~~</item>
+    </style>
+
+
+    <declare-styleable name="LoadingLayout">
+        <!-- 空布局资源id -->
+        <attr name="llEmptyResId" format="reference"/>
+        <!-- 加载中布局资源id -->
+        <attr name="llLoadingResId" format="reference"/>
+        <!-- 错误布局资源id -->
+        <attr name="llErrorResId" format="reference"/>
+
+        <!-- 空布局图片 -->
+        <attr name="llEmptyImage" format="reference"/>
+        <!-- 空布局文本 -->
+        <attr name="llEmptyText" format="string"/>
+
+        <!-- 错误布局图片 -->
+        <attr name="llErrorImage" format="reference"/>
+        <!-- 错误布局文本 -->
+        <attr name="llErrorText" format="string"/>
+        <!-- 错误布局重试按钮文本 -->
+        <attr name="llRetryText" format="string"/>
+
+        <!-- 文本颜色 -->
+        <attr name="llTextColor" format="color"/>
+        <!-- 文本尺寸 -->
+        <attr name="llTextSize" format="dimension"/>
+
+        <!-- 按钮文本颜色 -->
+        <attr name="llButtonTextColor" format="color"/>
+        <!-- 按钮文本尺寸 -->
+        <attr name="llButtonTextSize" format="dimension"/>
+        <!-- 按钮背景 -->
+        <attr name="llButtonBackground" format="reference"/>
+    </declare-styleable>
+</resources>

+ 3 - 6
app_core/network/build.gradle

@@ -10,7 +10,7 @@ Properties properties = new Properties()
 properties.load(project.rootProject.file('local.properties').newDataInputStream())
 
 
-def disVersion='1.0.9'//TODO 页面展示版本号
+def disVersion = '1.0.9'//TODO 页面展示版本号
 version = "1.0.9" //TODO 真实发布版本号
 group = "com.alphabet.app" //最终引用形式,如compile 'com.alphabet.app:1.0.0',其中lfilepicker在后面配置
 /********************end upload bintray config******************************************/
@@ -61,10 +61,10 @@ bintray {
         publish = true // 是否是公开项目,公开别人可以引用
 
         version {
-            name =disVersion 
+            name = disVersion
             desc = 'AppBase-NetWork'//描述,自己定义
             released = new Date()
-            vcsTag =disVersion
+            vcsTag = disVersion
             attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin']
         }
     }
@@ -143,9 +143,6 @@ javadoc {
 }
 /********************end upload bintray config******************************************/
 
-
-
-
 /*def siteUrl = 'https://github.com/Arisono/AppModular'      // 项目的主页
 def gitUrl = 'https://github.com/Arisono/AppModular.git'   // Git仓库的url
 group = "com.android.base" // Maven Group ID for the artifact,一般填你唯一的包名

+ 2 - 2
app_core/network/src/main/java/com/me/network/app/base/HttpCallback.java

@@ -8,7 +8,7 @@ package com.me.network.app.base;
 
 public interface HttpCallback<T> {
 
-    void onSuccess(int flag, T t);
+    void onSuccess(int flag, T t) throws Exception;
 
-    void onFail(int flag, String failStr);
+    void onFail(int flag, String failStr) throws Exception;
 }

+ 16 - 4
app_core/network/src/main/java/com/me/network/app/http/HttpRequest.java

@@ -1,6 +1,7 @@
 package com.me.network.app.http;
 
 import android.text.TextUtils;
+import android.util.Log;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
@@ -68,12 +69,16 @@ public class HttpRequest {
                 .build(), new ResultSubscriber<Object>(new Result2Listener<Object>() {
             @Override
             public void onResponse(Object response) {
-                callback.onSuccess(httpParams.getFlag(), response == null ? "" : response);
+                try {
+                    callback.onSuccess(httpParams.getFlag(), response == null ? "" : response);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
             }
 
             @Override
             public void onFailure(Object t) {
-                String failMsg = "";
+                String failMsg = "系统错误";
                 if (t != null) {
                     String result = t.toString();
                     try {
@@ -83,10 +88,17 @@ public class HttpRequest {
                             failMsg = result;
                         }
                     } catch (Exception e) {
-                        failMsg = result;
+                        Log.e("exceptionInfo", result);
+                        if (result.length() < 40) {
+                            failMsg = result;
+                        }
                     }
                 }
-                callback.onFail(httpParams.getFlag(), failMsg);
+                try {
+                    callback.onFail(httpParams.getFlag(), failMsg);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
             }
         }));
     }

+ 10 - 1
app_modular/appcontact/src/main/java/com/uas/appcontact/adapter/FriendSortAdapter.java

@@ -10,13 +10,17 @@ import android.widget.ImageView;
 import android.widget.SectionIndexer;
 import android.widget.TextView;
 
+import com.alibaba.fastjson.JSON;
+import com.common.LogUtil;
 import com.common.data.StringUtil;
 import com.common.system.SystemUtil;
 import com.core.model.Friend;
 import com.core.utils.helper.AvatarHelper;
 import com.core.utils.sortlist.BaseSortModel;
 import com.core.widget.crouton.Crouton;
+import com.core.xmpp.FriendHelper;
 import com.uas.appcontact.R;
+import com.uas.appcontact.db.TopContactsDao;
 import com.uas.appcontact.ui.widget.stickylistheaders.StickyListHeadersAdapter;
 
 import java.util.ArrayList;
@@ -96,7 +100,7 @@ public class FriendSortAdapter extends BaseAdapter implements SectionIndexer,Sti
 //        } else {
 //            holder.tag_tv.setVisibility(View.GONE);
 //        }
-        Friend friend = mSortFriends.get(position).getBean();
+       final Friend friend = mSortFriends.get(position).getBean();
         final String phone = friend.getPhone();
         if (!StringUtil.isEmpty(phone)) {
             String check = "^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$";
@@ -151,6 +155,11 @@ public class FriendSortAdapter extends BaseAdapter implements SectionIndexer,Sti
                     if (matcher.matches()) {
 //                        selectByPhone(phone, finalConvertView);
                         SystemUtil.phoneAction(mContext,phone);
+                        LogUtil.i("通讯录界面 拨打电话\n"+ JSON.toJSONString(friend));
+                        if (friend!=null){
+                            friend.setPhone(phone);
+                        }
+                        TopContactsDao.api().addGoodFriend(friend);
                     } else {
                         Crouton.makeText(mContext, R.string.not_format_phone);
                     }

+ 139 - 0
app_modular/appcontact/src/main/java/com/uas/appcontact/db/TopContactsDao.java

@@ -0,0 +1,139 @@
+package com.uas.appcontact.db;
+
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+
+import com.alibaba.fastjson.JSON;
+import com.common.LogUtil;
+import com.common.data.ListUtils;
+import com.core.app.MyApplication;
+import com.core.dao.Dao;
+import com.core.db.DatabaseTables;
+import com.core.model.Friend;
+import com.core.model.Hrorgs;
+import com.core.utils.sortlist.BaseSortModel;
+import com.core.xmpp.dao.FriendDao;
+import com.uas.appcontact.model.TopContacts;
+
+import java.util.List;
+
+/**
+ * Created by Bitlike on 2018/1/23.
+ */
+
+public class TopContactsDao extends Dao<TopContacts> {
+    @Override
+    protected String getTable() {
+        return DatabaseTables.TopContactsTable.NAME;
+    }
+
+    @Override
+    protected ContentValues getValues(TopContacts topContacts) throws Exception {
+        ContentValues values = new ContentValues();
+        values.put(DatabaseTables.TopContactsTable.Cols.USER_ID, topContacts.getUserId());
+        values.put(DatabaseTables.TopContactsTable.Cols.OWNER_ID, topContacts.getOwnerId());
+        values.put(DatabaseTables.TopContactsTable.Cols.PHONE, topContacts.getPhone());
+        values.put(DatabaseTables.TopContactsTable.Cols.NAME, topContacts.getName());
+        values.put(DatabaseTables.TopContactsTable.Cols.EM_CODE, topContacts.getEmCode());
+        values.put(DatabaseTables.TopContactsTable.Cols.LAST_TIME, topContacts.getLastTime());
+        values.put(DatabaseTables.TopContactsTable.Cols.STATUS, topContacts.getStatus());
+        return values;
+    }
+
+    @Override
+    protected TopContacts getData(Cursor c) throws Exception {
+        TopContacts topContacts = new TopContacts();
+        topContacts.setUserId(c.getString(c.getColumnIndex(DatabaseTables.TopContactsTable.Cols.USER_ID)));
+        topContacts.setOwnerId(c.getString(c.getColumnIndex(DatabaseTables.TopContactsTable.Cols.OWNER_ID)));
+        topContacts.setPhone(c.getString(c.getColumnIndex(DatabaseTables.TopContactsTable.Cols.PHONE)));
+        topContacts.setName(c.getString(c.getColumnIndex(DatabaseTables.TopContactsTable.Cols.NAME)));
+        topContacts.setEmCode(c.getString(c.getColumnIndex(DatabaseTables.TopContactsTable.Cols.EM_CODE)));
+        topContacts.setLastTime(c.getLong(c.getColumnIndex(DatabaseTables.TopContactsTable.Cols.LAST_TIME)));
+        topContacts.setStatus(c.getInt(c.getColumnIndex(DatabaseTables.TopContactsTable.Cols.STATUS)));
+        return topContacts;
+    }
+
+
+    private static TopContactsDao api;
+
+    public static TopContactsDao api() {
+        if (api == null) {
+            synchronized (TopContactsDao.class) {
+                if (api == null) {
+                    api = new TopContactsDao();
+                }
+            }
+        }
+        return api;
+    }
+
+    private TopContactsDao() {
+
+    }
+
+
+    public void addGoodFriend(Friend friend) {
+        if (friend != null) {
+            TopContacts topContacts = new TopContacts();
+            String ownerId = MyApplication.getInstance().getLoginUserId();
+            String userId = String.valueOf(friend.getUserId());
+            topContacts.setUserId(userId);
+            topContacts.setOwnerId(ownerId);
+            topContacts.setName(friend.getNickName());
+            topContacts.setEmCode(friend.getEmCode());
+            topContacts.setPhone(friend.getPhone());
+            topContacts.setLastTime(System.currentTimeMillis());
+            addGoodFriend(topContacts);
+        }
+    }
+
+
+    public void addGoodFriend(Hrorgs.Employee employee) {
+        if (employee != null) {
+            TopContacts topContacts = new TopContacts();
+            String ownerId = MyApplication.getInstance().getLoginUserId();
+            String userId = String.valueOf(employee.em_imid);
+            topContacts.setUserId(userId);
+            topContacts.setOwnerId(ownerId);
+            topContacts.setName(employee.em_name);
+            topContacts.setEmCode(employee.em_code);
+            topContacts.setPhone(employee.em_mobile);
+            topContacts.setLastTime(System.currentTimeMillis());
+            addGoodFriend(topContacts);
+        }
+    }
+
+    /**
+     * 添加常用
+     * 1.拨打电话
+     * 2.发送聊天信息
+     */
+    public void addGoodFriend(TopContacts topContacts) {
+        String where = DatabaseTables.TopContactsTable.Cols.OWNER_ID + "=? and "
+                + DatabaseTables.TopContactsTable.Cols.USER_ID + "=? ";
+        String[] whereAge = new String[]{topContacts.getOwnerId(), topContacts.getUserId()};
+        List<TopContacts> dbContacts = query(where, whereAge);
+        if (ListUtils.isEmpty(dbContacts)) {
+            boolean b = insert(topContacts, where, whereAge);
+            LogUtil.i("insert=" + b);
+        } else {
+            TopContacts dbContact = dbContacts.get(0);
+            if (dbContact != null && (System.currentTimeMillis() - dbContact.getLastTime())< (86400000)) {
+                topContacts.setStatus(1);
+            }
+            LogUtil.i("dbContact=" + JSON.toJSONString(dbContact));
+            boolean b = update(topContacts, where, whereAge);
+            LogUtil.i("update=" + b);
+        }
+    }
+    public List<TopContacts> getTopContacts(){
+        String owerId= MyApplication.getInstance().getLoginUserId();
+        String where = DatabaseTables.TopContactsTable.Cols.OWNER_ID + "=? ";
+//                + " and " +DatabaseTables.TopContactsTable.Cols.STATUS + "=? ";
+        String[] whereAge = new String[]{owerId/*, String.valueOf(1)*/};
+        LogUtil.i("owerId="+owerId);
+        LogUtil.i("where="+where);
+        return query(where,whereAge);
+    }
+}

+ 5 - 0
app_modular/appcontact/src/main/java/com/uas/appcontact/manager/ContactsManager.java

@@ -3,6 +3,7 @@ package com.uas.appcontact.manager;
 
 import android.os.Bundle;
 import android.os.Looper;
+import android.text.TextUtils;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
@@ -12,6 +13,7 @@ import com.common.config.BaseConfig;
 import com.common.data.JSONUtil;
 import com.common.data.ListUtils;
 import com.common.data.StringUtil;
+import com.common.data.TextUtil;
 import com.common.thread.ThreadUtil;
 import com.core.api.wxapi.ApiConfig;
 import com.core.api.wxapi.ApiModel;
@@ -100,6 +102,9 @@ public class ContactsManager {
         } else {
             baseUrl = CommonUtil.getAppBaseUrl(MyApplication.getInstance());
         }
+        if (TextUtils.isEmpty(baseUrl)){
+            baseUrl="http://";
+        }
         String url = isB2b ? "mobile/approvalflow/getUsersInfo" : "mobile/getAllHrorgEmps.action";
         String sessionId = CommonUtil.getSharedPreferences(BaseConfig.getContext(), "sessionId");
         HttpClient httpClient = new HttpClient.Builder(baseUrl)

+ 73 - 0
app_modular/appcontact/src/main/java/com/uas/appcontact/model/TopContacts.java

@@ -0,0 +1,73 @@
+package com.uas.appcontact.model;
+
+/**
+ * Created by Bitlike on 2018/1/23.
+ */
+
+public class TopContacts {
+
+    private String userId;
+    private String ownerId;
+    private String phone;
+    private String name;
+    private String emCode;
+    private long lastTime;
+    private int status;//1,常用联系人  0,联系人
+
+
+    public String getOwnerId() {
+        return ownerId;
+    }
+
+    public void setOwnerId(String ownerId) {
+        this.ownerId = ownerId;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getEmCode() {
+        return emCode;
+    }
+
+    public void setEmCode(String emCode) {
+        this.emCode = emCode;
+    }
+
+    public long getLastTime() {
+        return lastTime;
+    }
+
+    public void setLastTime(long lastTime) {
+        this.lastTime = lastTime;
+    }
+
+    public int getStatus() {
+        return status;
+    }
+
+    public void setStatus(int status) {
+        this.status = status;
+    }
+}

+ 7 - 1
app_modular/appcontact/src/main/java/com/uas/appcontact/ui/activity/CompanyContactsActivity.java

@@ -1,5 +1,6 @@
 package com.uas.appcontact.ui.activity;
 
+import android.annotation.SuppressLint;
 import android.content.Context;
 import android.content.Intent;
 import android.graphics.Color;
@@ -51,10 +52,12 @@ import com.core.utils.CommonUtil;
 import com.core.utils.helper.AvatarHelper;
 import com.core.widget.CustomerListView;
 import com.core.widget.VoiceSearchView;
+import com.core.xmpp.FriendHelper;
 import com.core.xmpp.dao.FriendDao;
 import com.scwang.smartrefresh.layout.api.RefreshLayout;
 import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
 import com.uas.appcontact.R;
+import com.uas.appcontact.db.TopContactsDao;
 
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -896,6 +899,7 @@ public class CompanyContactsActivity extends BaseActivity {
 
     private PopupWindow popupWindow = null;
 
+    @SuppressLint("WrongConstant")
     public void showPopupWindow(View parent) {
         View view = null;
         WindowManager windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
@@ -1133,6 +1137,7 @@ public class CompanyContactsActivity extends BaseActivity {
                         @Override
                         public void onClick(View v) {
                             SystemUtil.phoneAction(ct, employees.get(position - lists.size()).getEm_mobile());
+                            TopContactsDao.api().addGoodFriend( employees.get(position - lists.size()));
                         }
                     });
                 }
@@ -1169,6 +1174,7 @@ public class CompanyContactsActivity extends BaseActivity {
                     @Override
                     public void onClick(View v) {
                         SystemUtil.phoneAction(ct, employees.get(position - lists.size()).getEm_mobile());
+                        TopContactsDao.api().addGoodFriend( employees.get(position - lists.size()));
                     }
                 });
             }
@@ -1250,8 +1256,8 @@ public class CompanyContactsActivity extends BaseActivity {
             phone_img.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View v) {
-
                     SystemUtil.phoneAction(mContext, mMap.get("item_phone").toString());
+                    LogUtil.i("企业架构界面 拨打电话"+JSON.toJSONString(mMap));
                 }
             });
 

+ 51 - 35
app_modular/appcontact/src/main/java/com/uas/appcontact/ui/activity/MyFriendActivity.java

@@ -23,6 +23,7 @@ import com.common.LogUtil;
 import com.common.data.JSONUtil;
 import com.common.data.ListUtils;
 import com.common.data.StringUtil;
+import com.common.thread.ThreadPool;
 import com.common.ui.ProgressDialogUtil;
 import com.core.app.MyApplication;
 import com.core.base.BaseActivity;
@@ -50,6 +51,8 @@ import com.handmark.pulltorefresh.library.PullToRefreshBase;
 import com.handmark.pulltorefresh.library.PullToRefreshListView;
 import com.uas.appcontact.R;
 import com.uas.appcontact.adapter.UUFriendSortAdapter;
+import com.uas.appcontact.db.TopContactsDao;
+import com.uas.appcontact.model.TopContacts;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -94,15 +97,15 @@ public class MyFriendActivity extends BaseActivity {
         initView();
 
     }
-    
+
     private void initView() {
         progressDialog.show();
         mPullToRefreshListView = (PullToRefreshListView) findViewById(R.id.pull_refresh_list);
         mTextDialog = (TextView) findViewById(R.id.text_dialog);
         mSideBar = (SideBar) findViewById(R.id.sidebar);
-        voiceSearchView = (VoiceSearchView)findViewById(R.id.voiceSearchView);
+        voiceSearchView = (VoiceSearchView) findViewById(R.id.voiceSearchView);
         mSideBar.setTextView(mTextDialog);
-      
+
         mSideBar.setOnTouchingLetterChangedListener(new SideBar.OnTouchingLetterChangedListener() {
             @Override
             public void onTouchingLetterChanged(String s) {
@@ -122,7 +125,7 @@ public class MyFriendActivity extends BaseActivity {
                 //linear_top_menu.setVisibility(View.VISIBLE);
             }
         });
-      // setHeaderView();
+        // setHeaderView();
         loadData();
        /* mPullToRefreshListView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener<ListView>() {
             @Override
@@ -132,23 +135,24 @@ public class MyFriendActivity extends BaseActivity {
                 loadData();
             }
         });*/
-       mPullToRefreshListView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ListView>() {
-           @Override
-           public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
-               progressDialog.show();
-               mAdapter.setisRefeshed(true);
-               upDataFriend();
-               loadData();
-           }
+        mPullToRefreshListView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ListView>() {
+            @Override
+            public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
+                progressDialog.show();
+                mAdapter.setisRefeshed(true);
+                upDataFriend();
+                loadData();
+            }
 
-           @Override
-           public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
+            @Override
+            public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
 
-           }
-       });
+            }
+        });
 
         mPullToRefreshListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
             private Friend friend;   //l临时对象
+
             @Override
             public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                 try {
@@ -197,10 +201,7 @@ public class MyFriendActivity extends BaseActivity {
         View headview = LayoutInflater.from(ct).inflate(R.layout.header_fragment_contact, null);
         mPullToRefreshListView.getRefreshableView().addHeaderView(headview);
         headview.findViewById(R.id.click_ll).setVisibility(View.GONE);
-       voiceSearchView = (VoiceSearchView) headview.findViewById(R.id.voiceSearchView);
-
-    
-
+        voiceSearchView = (VoiceSearchView) headview.findViewById(R.id.voiceSearchView);
     }
 
     /**
@@ -217,7 +218,7 @@ public class MyFriendActivity extends BaseActivity {
                 mAdapter.getmSortFriends().add(e);
             }
         }
-        LogUtil.prinlnLongMsg("mSortFriends",JSON.toJSONString(mAdapter.getmSortFriends()));
+        LogUtil.prinlnLongMsg("mSortFriends", JSON.toJSONString(mAdapter.getmSortFriends()));
         mAdapter.notifyDataSetChanged();
     }
 
@@ -228,7 +229,7 @@ public class MyFriendActivity extends BaseActivity {
 //            loadData();
             mNeedUpdate = false;
         }
-        if (mAdapter!=null) {
+        if (mAdapter != null) {
             mAdapter.notifyDataSetChanged();
         }
     }
@@ -238,17 +239,32 @@ public class MyFriendActivity extends BaseActivity {
     private void loadData() {
 //        if (isPeculiar) loadContactByERpNet();
 //        else
-        new Thread(new Runnable() {
+        ThreadPool.getThreadPool().addTask(new Runnable() {
             @Override
             public void run() {
                 long startTime = System.currentTimeMillis();
-                if (mLoginUserId == null)
+                if (mLoginUserId == null) {
                     mLoginUserId = MyApplication.getInstance().mLoginUser.getUserId();
-//                if (isPeculiar) {
+                }
+                friends = new ArrayList<>();
+                if (isPeculiar) {
+                    List<TopContacts> topContacts = TopContactsDao.api().getTopContacts();
+                    if (topContacts != null) {
+                        for (TopContacts e : topContacts) {
+                            Friend f = new Friend();
+                            f.setNickName(e.getName());
+                            f.setPhone(e.getPhone());
+                            f.setUserId(e.getUserId());
+                            f.setOwnerId(e.getOwnerId());
+                            f.setEmCode(e.getEmCode());
+                            f.setTimeSend((int) (e.getLastTime() / 1000));
+                            friends.add(f);
+                        }
+                    }
 //                    friends = FriendDao.getInstance().getFriends(mLoginUserId, "clickNum", 10);
-//                } else {
+                } else {
                     friends = FriendDao.getInstance().getFriends(mLoginUserId);// 取所有好友
-//                }
+                }
                 if (friends != null)
                     Log.i("wang", "friends size()=" + friends.size());
                 long delayTime = 200 - (startTime - System.currentTimeMillis());// 保证至少200ms的刷新过程
@@ -260,11 +276,11 @@ public class MyFriendActivity extends BaseActivity {
                     @Override
                     public void run() {
                         handlerFriends(friends);
-                        LogUtil.prinlnLongMsg("hifriends",JSON.toJSONString(friends));
+                        LogUtil.prinlnLongMsg("hifriends", JSON.toJSONString(friends));
                     }
                 }, delayTime);
             }
-        }).start();
+        });
     }
 
     private void getFriendByRep(EmployeesEntity e, Friend friend) {
@@ -317,7 +333,7 @@ public class MyFriendActivity extends BaseActivity {
                     friends.add(friend);
                 }
                 handlerFriends(friends);
-                LogUtil.prinlnLongMsg("hifriends",JSON.toJSONString(friend));
+                LogUtil.prinlnLongMsg("hifriends", JSON.toJSONString(friend));
             }
 
             @Override
@@ -350,19 +366,19 @@ public class MyFriendActivity extends BaseActivity {
                 public int compare(BaseSortModel<Friend> o1, BaseSortModel<Friend> o2) {
                     Friend f1 = o1.getBean();
                     Friend f2 = o2.getBean();
-                    return f2.getClickNum()-f1.getClickNum();
+                    return f2.getClickNum() - f1.getClickNum();
                 }
             });
-            LogUtil.prinlnLongMsg("mSortFriends",JSON.toJSONString(mSortFriends));
+            LogUtil.prinlnLongMsg("mSortFriends", JSON.toJSONString(mSortFriends));
             Collections.sort(allFriends, new Comparator<BaseSortModel<Friend>>() {
                 @Override
                 public int compare(BaseSortModel<Friend> o1, BaseSortModel<Friend> o2) {
                     Friend f1 = o1.getBean();
                     Friend f2 = o2.getBean();
-                    return f2.getClickNum()-f1.getClickNum();
+                    return f2.getClickNum() - f1.getClickNum();
                 }
             });
-            LogUtil.prinlnLongMsg("allFriends",JSON.toJSONString(allFriends));
+            LogUtil.prinlnLongMsg("allFriends", JSON.toJSONString(allFriends));
 //            Collections.sort(mSortFriends, mBaseComparator);
 //            Collections.sort(allFriends, mBaseComparator);
         }
@@ -447,7 +463,7 @@ public class MyFriendActivity extends BaseActivity {
         }, new StringJsonArrayRequest.Listener<AttentionUser>() {
             @Override
             public void onResponse(ArrayResult<AttentionUser> result) {
-                LogUtil.d("Test","result:"+result);
+                LogUtil.d("Test", "result:" + result);
                 boolean success = Result.defaultParser(MyFriendActivity.this, result, false);
                 if (success) {
                     FriendDao.getInstance().addAttentionUsers(mHandler, MyApplication.getInstance().mLoginUser.getUserId(), result.getData(),

+ 1 - 1
app_modular/appcontact/src/main/java/com/uas/appcontact/ui/fragment/ContactsFragment.java

@@ -409,7 +409,7 @@ public class ContactsFragment extends EasyFragment
         friend.setPrivacy(e.getEM_EMAIL());
         friend.setCompanyId(0);
         friend.setRoomFlag(0);// 0朋友 1群组
-        friend.setStatus(Friend.STATUS_UNKNOW);
+        friend.setStatus(Friend.STATUS_FRIEND);
         BaseSortModel<Friend> mode = new BaseSortModel<>();
         mode.setBean(friend);
         setSortCondition(mode);

+ 11 - 3
app_modular/appme/src/main/java/com/uas/appme/other/activity/BasicInfoActivity.java

@@ -31,6 +31,7 @@ import android.widget.LinearLayout;
 import android.widget.PopupWindow;
 import android.widget.TextView;
 
+import com.alibaba.fastjson.JSON;
 import com.android.volley.Response.ErrorListener;
 import com.android.volley.VolleyError;
 import com.common.LogUtil;
@@ -66,6 +67,7 @@ import com.core.xmpp.listener.NewFriendListener;
 import com.core.xmpp.model.AddAttentionResult;
 import com.core.xmpp.utils.CardcastUiUpdateUtil;
 import com.uas.appcontact.db.ContactsDao;
+import com.uas.appcontact.db.TopContactsDao;
 import com.uas.appcontact.model.contacts.ContactsModel;
 import com.uas.appme.R;
 
@@ -529,16 +531,22 @@ public class BasicInfoActivity extends BaseActivity implements NewFriendListener
         phone_img.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-                if (!StringUtil.isEmpty(phone_tv.getText().toString())) {
+                String phone=StringUtil.getText(phone_tv);
+                if (!StringUtil.isEmpty(phone)) {
                     String check = "^[1][3,5,7,8][0-9]\\d{8}$";
                     Pattern regex = Pattern.compile(check);
-                    Matcher matcher = regex.matcher(phone_tv.getText().toString());
+                    Matcher matcher = regex.matcher(phone);
                     boolean isMatched = matcher.matches();
                     if (isMatched) {
-                        SystemUtil.phoneAction(BasicInfoActivity.this,phone_tv.getText().toString());
+                        SystemUtil.phoneAction(BasicInfoActivity.this,phone);
                     } else {
                         ViewUtil.ShowMessageTitle(BasicInfoActivity.this, getString(R.string.error_phone));
                     }
+                    if (mFriend!=null){
+                        mFriend.setPhone(phone);
+                    }
+                    LogUtil.i("个人资料界面 拨打电话\n"+ JSON.toJSONString(mFriend));
+                    TopContactsDao.api().addGoodFriend(mFriend);
                 }
             }
         });

+ 3 - 2
app_modular/appme/src/main/java/com/uas/appme/settings/activity/BaseInfoActivity.java

@@ -65,8 +65,9 @@ import java.util.List;
 
 
 /**
- * 个人资料页面
- */
+  * @desc:用户个人资料界面
+  * @author:Arison on 2018/1/23
+  */
 public class BaseInfoActivity extends BaseActivity implements View.OnClickListener {
 
     private ImageView iv_headImage;

+ 1 - 0
app_modular/appmessages/src/main/AndroidManifest.xml

@@ -8,6 +8,7 @@
         android:supportsRtl="true">
         <activity android:name=".activity.MsgsSecondCommonActivity" />
         <activity android:name=".activity.PlatMsgThirdActivity" />
+        <activity android:name=".activity.MsgThirdWebActivity" />
         <activity android:name=".activity.ProcessB2BActivity">
             <intent-filter>
                 <action android:name="com.modular.work.ProcessB2BActivity" />

+ 0 - 2
app_modular/appmessages/src/main/java/com/modular/appmessages/activity/AppWebViewActivity.java

@@ -365,9 +365,7 @@ public class AppWebViewActivity extends BaseActivity {
                 }
             }
         } catch (Exception e) {
-            LogUtil.i("Exception=" + e.getMessage());
         }
-        LogUtil.i("nodeId=" + nodeId);
         return nodeId;
     }
 

+ 0 - 1
app_modular/appmessages/src/main/java/com/modular/appmessages/activity/ApprovalActivity.java

@@ -103,7 +103,6 @@ public class ApprovalActivity extends OABaseActivity implements IApproval, Appro
         MenuItem item = menu.getItem(1);
         item.setTitle("返回旧版");
         boolean hiteAble=!PreferenceUtils.getBoolean(AppConfig.IS_ADMIN, false);
-        LogUtil.i("hiteAble="+hiteAble);
         if (hiteAble) {
             MenuItem setItem = menu.getItem(0);
             setItem.setVisible(false);

+ 212 - 160
app_modular/appmessages/src/main/java/com/modular/appmessages/activity/MessageWebActivity.java

@@ -1,5 +1,6 @@
 package com.modular.appmessages.activity;
 
+import android.content.Context;
 import android.content.Intent;
 import android.graphics.Bitmap;
 import android.net.http.SslError;
@@ -8,8 +9,14 @@ import android.os.Bundle;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
+import android.webkit.CookieManager;
+import android.webkit.CookieSyncManager;
+import android.webkit.JsPromptResult;
+import android.webkit.JsResult;
 import android.webkit.SslErrorHandler;
 import android.webkit.WebChromeClient;
+import android.webkit.WebResourceRequest;
+import android.webkit.WebResourceResponse;
 import android.webkit.WebSettings;
 import android.webkit.WebView;
 import android.webkit.WebViewClient;
@@ -18,177 +25,222 @@ import android.widget.ZoomButtonsController;
 
 import com.common.LogUtil;
 import com.common.system.SystemUtil;
+import com.core.app.MyApplication;
 import com.core.base.BaseActivity;
 import com.core.utils.CommonUtil;
 import com.core.utils.IntentUtils;
+import com.core.utils.ToastUtil;
 import com.modular.appmessages.R;
 import com.umeng.socialize.ShareAction;
 import com.umeng.socialize.bean.SHARE_MEDIA;
 import com.umeng.socialize.media.UMImage;
 
+import org.apache.http.cookie.Cookie;
+
 import java.lang.reflect.Field;
 
 public class MessageWebActivity extends BaseActivity {
 
 
-	private WebView webViewRefresh;
-	private ProgressBar progressBar;
-	private String url;
-
-	@Override
-	protected void onCreate(Bundle savedInstanceState) {
-		super.onCreate(savedInstanceState);
-		setContentView(R.layout.activity_message_web);
-		webViewRefresh = (WebView) findViewById(R.id.webView);
-		progressBar = (ProgressBar) findViewById(R.id.progressBar);
-		initView();
-		initData();
-	}
-
-
-	@Override
-	public boolean onCreateOptionsMenu(Menu menu) {
-		if (getIntent() != null && getIntent().getBooleanExtra(IntentUtils.KEY_NEER_SHARE, false)) {
-			getMenuInflater().inflate(R.menu.menu_about, menu);
-		}
-		return true;
-	}
-
-	@Override
-	public boolean onOptionsItemSelected(MenuItem item) {
-		if (R.id.app_about == item.getItemId()) {
-			String title = getSupportActionBar().getTitle().toString();
-			String content = null;
-			String imageUrl = null;
-			Intent intent = getIntent();
-			if (intent != null) {
-				content = intent.getStringExtra(IntentUtils.KEY_SHARE_CONTENT);
-				imageUrl = intent.getStringExtra(IntentUtils.KEY_SHARE_IMAGE);
-			}
-			if (content == null) {
-				content = "UU互联 Android客户端" + SystemUtil.getVersionName(mContext);
-				imageUrl = "http://img.my.csdn.net/uploads/201609/30/1475204542_1365.png";
-			}
-			LogUtil.i("url="+url);
-			LogUtil.i("content="+content);
-			LogUtil.i("imageUrl="+imageUrl);
-			new ShareAction(activity).setDisplayList(
-					SHARE_MEDIA.SINA,
-					SHARE_MEDIA.QQ,
-					SHARE_MEDIA.QZONE,
-					SHARE_MEDIA.WEIXIN,
-					SHARE_MEDIA.WEIXIN_CIRCLE,
-					SHARE_MEDIA.WEIXIN_FAVORITE,
-					SHARE_MEDIA.MORE)
-					.withTitle(title)
-					.withText(content)
-					.withMedia(new UMImage(activity, imageUrl))
-					.withTargetUrl(url)
-					.setCallback(CommonUtil.umShareListener)
-					.open();
-		}
-		return super.onOptionsItemSelected(item);
-	}
-
-	private void initView() {
-		webViewRefresh.getSettings().setJavaScriptEnabled(true);
-		webViewRefresh.getSettings().setSupportZoom(true);
-		webViewRefresh.getSettings().setBuiltInZoomControls(true);
-		webViewRefresh.getSettings().setUseWideViewPort(true);
-		webViewRefresh.getSettings().setDomStorageEnabled(true);
-		webViewRefresh.getSettings().setLoadWithOverviewMode(true);
-		webViewRefresh.getSettings().setDefaultTextEncodingName("utf-8");
-		webViewRefresh.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
-		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
-			webViewRefresh.getSettings().setDisplayZoomControls(false);
-		} else {
-			setZoomControlGone();
-		}
-		webViewRefresh.clearCache(true);
-		webViewRefresh.clearHistory();
-		webViewRefresh.setWebViewClient(new WebViewClient() {
-			public boolean shouldOverrideUrlLoading(WebView view, String url) {
-				view.loadUrl(url);
-				return true;
-			}
-
-			@Override
-			public void onPageStarted(WebView view, String url, Bitmap favicon) {
-				if (progressBar.getVisibility() == View.GONE) {
-					progressBar.setVisibility(View.VISIBLE);
-				}
-			}
-
-			@Override
-			public void onPageFinished(WebView view, String url) {
-				if (progressBar.getVisibility() == View.VISIBLE) {
-					progressBar.setVisibility(View.GONE);
-				}
-			}
-
-			@Override
-			public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
-				handler.proceed();
-			}
-		});
-		webViewRefresh.setWebChromeClient(new WebChromeClient() {
-			@Override
-			public void onProgressChanged(WebView view, int newProgress) {
-				progressBar.setProgress(newProgress);
-				if (newProgress == 100) {
-					progressBar.setProgress(newProgress);
-					progressBar.setVisibility(View.GONE);
-				}
-				super.onProgressChanged(view, newProgress);
-			}
-		});
-//        webViewRefresh.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener<WebView>() {
-//            @Override
-//            public void onRefresh(PullToRefreshBase<WebView> refreshView) {
-//                loadData();
-//            }
-//        });
-	}
-
-	public void setZoomControlGone() {
-		Class classType;
-		Field field;
-		try {
-			classType = WebView.class;
-			field = classType.getDeclaredField("mZoomButtonsController");
-			field.setAccessible(true);
-			ZoomButtonsController mZoomButtonsController = new ZoomButtonsController(webViewRefresh);
-			mZoomButtonsController.getZoomControls().setVisibility(View.GONE);
-			try {
-				field.set(webViewRefresh, mZoomButtonsController);
-			} catch (IllegalArgumentException e) {
-				e.printStackTrace();
-			} catch (IllegalAccessException e) {
-				e.printStackTrace();
-			}
-		} catch (SecurityException e) {
-			e.printStackTrace();
-		} catch (NoSuchFieldException e) {
-			e.printStackTrace();
-		}
-	}
-
-	private void initData() {
-		Intent intent = getIntent();
-		if (intent != null) {
-			url = intent.getStringExtra(IntentUtils.KEY_URL);
-			String title = intent.getStringExtra(IntentUtils.KEY_TITLE);
-			if (title != null) {
-				getSupportActionBar().setTitle(title);
-			}
-		}
-		loadData();
-	}
-
-	private void loadData() {
-		if (url != null) {
-			webViewRefresh.loadUrl(url);
-		}
-
-	}
+    protected WebView webViewRefresh;
+    protected ProgressBar progressBar;
+    protected String url;
+    private boolean needCookie;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_message_web);
+        webViewRefresh = (WebView) findViewById(R.id.webView);
+        progressBar = (ProgressBar) findViewById(R.id.progressBar);
+        initView();
+        initData();
+    }
+
+
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        if (getIntent() != null && getIntent().getBooleanExtra(IntentUtils.KEY_NEER_SHARE, false)) {
+            getMenuInflater().inflate(R.menu.menu_about, menu);
+        }
+        return true;
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (R.id.app_about == item.getItemId()) {
+            String title = getSupportActionBar().getTitle().toString();
+            String content = null;
+            String imageUrl = null;
+            Intent intent = getIntent();
+            if (intent != null) {
+                content = intent.getStringExtra(IntentUtils.KEY_SHARE_CONTENT);
+                imageUrl = intent.getStringExtra(IntentUtils.KEY_SHARE_IMAGE);
+            }
+            if (content == null) {
+                content = "UU互联 Android客户端" + SystemUtil.getVersionName(mContext);
+                imageUrl = "http://img.my.csdn.net/uploads/201609/30/1475204542_1365.png";
+            }
+            LogUtil.i("url=" + url);
+            LogUtil.i("content=" + content);
+            LogUtil.i("imageUrl=" + imageUrl);
+            new ShareAction(activity).setDisplayList(
+                    SHARE_MEDIA.SINA,
+                    SHARE_MEDIA.QQ,
+                    SHARE_MEDIA.QZONE,
+                    SHARE_MEDIA.WEIXIN,
+                    SHARE_MEDIA.WEIXIN_CIRCLE,
+                    SHARE_MEDIA.WEIXIN_FAVORITE,
+                    SHARE_MEDIA.MORE)
+                    .withTitle(title)
+                    .withText(content)
+                    .withMedia(new UMImage(activity, imageUrl))
+                    .withTargetUrl(url)
+                    .setCallback(CommonUtil.umShareListener)
+                    .open();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    protected void initView() {
+        webViewRefresh.getSettings().setJavaScriptEnabled(true);
+        webViewRefresh.getSettings().setSupportZoom(true);
+        webViewRefresh.getSettings().setBuiltInZoomControls(true);
+        webViewRefresh.getSettings().setUseWideViewPort(true);
+        webViewRefresh.getSettings().setDomStorageEnabled(true);
+        webViewRefresh.getSettings().setLoadWithOverviewMode(true);
+        webViewRefresh.getSettings().setDefaultTextEncodingName("utf-8");
+        webViewRefresh.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
+            webViewRefresh.getSettings().setDisplayZoomControls(false);
+        } else {
+            setZoomControlGone();
+        }
+        webViewRefresh.clearCache(true);
+        webViewRefresh.clearHistory();
+        webViewRefresh.setWebViewClient(getWebViewClient());
+        webViewRefresh.setWebChromeClient(getWebChromeClient());
+    }
+
+
+    protected WebChromeClient getWebChromeClient() {
+        return new WebChromeClient() {
+            @Override
+            public void onProgressChanged(WebView view, int newProgress) {
+                progressBar.setProgress(newProgress);
+                if (newProgress == 100) {
+                    progressBar.setProgress(newProgress);
+                    progressBar.setVisibility(View.GONE);
+                }
+                super.onProgressChanged(view, newProgress);
+            }
+        };
+    }
+    protected WebViewClient getWebViewClient() {
+        return new WebViewClient() {
+            public boolean shouldOverrideUrlLoading(WebView view, String url) {
+                LogUtil.i("shouldOverrideUrlLoading url=" + url);
+                if (needCookie) {
+                    synCookies(ct, url);
+                }
+                view.loadUrl(url);
+                return true;
+            }
+
+            @Override
+            public void onPageStarted(WebView view, String url, Bitmap favicon) {
+                LogUtil.i("onPageStarted url=" + url);
+                if (progressBar.getVisibility() == View.GONE) {
+                    progressBar.setVisibility(View.VISIBLE);
+                }
+            }
+
+
+            @Override
+            public void onReceivedHttpError(WebView view, WebResourceRequest request, WebResourceResponse errorResponse) {
+                ToastUtil.showToast(ct,"Cookie已经过期,请重新登陆");
+                super.onReceivedHttpError(view, request, errorResponse);
+            }
+
+            @Override
+            public void onPageFinished(WebView view, String url) {
+                if (progressBar.getVisibility() == View.VISIBLE) {
+                    progressBar.setVisibility(View.GONE);
+                }
+            }
+
+            @Override
+            public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
+                handler.proceed();
+            }
+        };
+    }
+
+    public void setZoomControlGone() {
+        Class classType;
+        Field field;
+        try {
+            classType = WebView.class;
+            field = classType.getDeclaredField("mZoomButtonsController");
+            field.setAccessible(true);
+            ZoomButtonsController mZoomButtonsController = new ZoomButtonsController(webViewRefresh);
+            mZoomButtonsController.getZoomControls().setVisibility(View.GONE);
+            try {
+                field.set(webViewRefresh, mZoomButtonsController);
+            } catch (IllegalArgumentException e) {
+                e.printStackTrace();
+            } catch (IllegalAccessException e) {
+                e.printStackTrace();
+            }
+        } catch (SecurityException e) {
+            e.printStackTrace();
+        } catch (NoSuchFieldException e) {
+            e.printStackTrace();
+        }
+    }
+
+
+    private void initData() {
+        Intent intent = getIntent();
+        if (intent != null) {
+            url = intent.getStringExtra(IntentUtils.KEY_URL);
+            String title = intent.getStringExtra(IntentUtils.KEY_TITLE);
+            needCookie = intent.getBooleanExtra(IntentUtils.KEY_NEER_COOKIE, false);
+            if (title != null) {
+                getSupportActionBar().setTitle(title);
+            }
+            if (needCookie) {
+                synCookies(ct, url);
+            }
+        }
+        loadData();
+    }
+
+    private void loadData() {
+        if (url != null) {
+            webViewRefresh.loadUrl(url);
+        }
+
+    }
+
+
+    /**
+     * 同步一下cookie
+     */
+    public void synCookies(Context context, String url) {
+        CookieSyncManager.createInstance(context);
+        CookieManager cookieManager = CookieManager.getInstance();
+        cookieManager.setAcceptCookie(true);
+        cookieManager.removeSessionCookie();//移除
+        Cookie sessionCookie = MyApplication.cookieERP;
+        if (sessionCookie!=null){
+            String cookieStr = sessionCookie.getName() + "="
+                    + sessionCookie.getValue() + "; domain="
+                    + sessionCookie.getDomain() + "; path="
+                    + sessionCookie.getPath();
+            cookieManager.setCookie(url, cookieStr);//cookies是在HttpClient中获得的cookie
+            CookieSyncManager.getInstance().sync();
+        }
+
+    }
 }

+ 61 - 0
app_modular/appmessages/src/main/java/com/modular/appmessages/activity/MsgThirdWebActivity.java

@@ -0,0 +1,61 @@
+package com.modular.appmessages.activity;
+
+import android.content.Intent;
+import android.view.View;
+import android.webkit.JsResult;
+import android.webkit.WebChromeClient;
+import android.webkit.WebView;
+
+import com.common.LogUtil;
+import com.core.utils.IntentUtils;
+import com.uas.appworks.OA.erp.activity.CommonDocDetailsActivity;
+
+/**
+ * Created by Bitlike on 2018/1/16.
+ */
+public class MsgThirdWebActivity extends MessageWebActivity {
+    @Override
+    protected WebChromeClient getWebChromeClient() {
+        return new WebChromeClient() {
+            @Override
+            public void onProgressChanged(WebView view, int newProgress) {
+                progressBar.setProgress(newProgress);
+                if (newProgress == 100) {
+                    progressBar.setProgress(newProgress);
+                    progressBar.setVisibility(View.GONE);
+                }
+                super.onProgressChanged(view, newProgress);
+            }
+
+            @Override
+            public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
+                LogUtil.i("onJsAlert url=" + url);
+                LogUtil.i("onJsAlert message=" + message);
+                LogUtil.i("onJsAlert result=" + result.toString());
+                Intent intent = getIntent();
+                if (intent != null  ) {
+                   String title= intent.getStringExtra(IntentUtils.KEY_TITLE);
+                   if (title!=null&&title.equals("审批知会")){
+                       String caller = intent.getStringExtra("caller");
+                       int keyValue = intent.getIntExtra("keyValue", 0);
+                       LogUtil.i("onJsAlert caller=" + caller);
+                       LogUtil.i("onJsAlert keyValue=" + keyValue);
+                       startActivity(caller, keyValue);
+                   }
+                }
+                result.cancel();
+                return true;
+            }
+        };
+    }
+
+
+    private void startActivity(String caller, int keyValue) {
+        startActivity(new Intent(ct, CommonDocDetailsActivity.class)
+                .putExtra("caller", caller)
+                .putExtra("keyValue", keyValue)
+                .putExtra("device", true)
+                .putExtra("message", true)
+                .putExtra("status", "已审批"));
+    }
+}

+ 19 - 8
app_modular/appmessages/src/main/java/com/modular/appmessages/activity/MsgsSecondCommonActivity.java

@@ -39,6 +39,7 @@ import com.core.dao.MessageDao;
 import com.core.model.MessageModel;
 import com.core.net.http.ViewUtil;
 import com.core.utils.CommonUtil;
+import com.core.utils.IntentUtils;
 import com.core.utils.TimeUtils;
 import com.core.widget.EmptyLayout;
 import com.handmark.pulltorefresh.library.PullToRefreshBase;
@@ -381,6 +382,7 @@ public class MsgsSecondCommonActivity extends BaseActivity implements View.OnCli
             public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                 mPosition = (int) parent.getItemIdAtPosition(position);
                 msg_id = msgModel.get(mPosition).getId();
+                MessageModel model = msgModel.get(mPosition);
 //                ToastMessage("点击position = " + mPosition + "," + " msg_id = " + msg_id);
                 if (platform) {
                     Log.i("msg_title,msg_context", msg_title + "," + Html.fromHtml(msgModel.get(mPosition).getSubTitle()));
@@ -398,7 +400,7 @@ public class MsgsSecondCommonActivity extends BaseActivity implements View.OnCli
                         MessageDao.getInstance().upStatusByType("kpi", true);// 考勤消息进入第二层后全部标为已读
                         msgAdapter.notifyDataSetChanged();
                     } else {
-                        doClickEvent(mPosition, msg_id);
+                        doClickEvent(mPosition, model);
                     }
                 }
 
@@ -437,14 +439,23 @@ public class MsgsSecondCommonActivity extends BaseActivity implements View.OnCli
     }
 
 
-    private void doClickEvent(int mPosition, int msg_id) {
-        baseUrl = CommonUtil.getSharedPreferences(mContext, "erp_baseurl");
-        String url = baseUrl + "mobile/message/getDetail.action";
-        Intent intent_web = new Intent("com.modular.main.WebViewCommActivity");
-        intent_web.putExtra("url", url + "?id=" + msg_id);
-        intent_web.putExtra("title", msg_title);
-        intent_web.putExtra("cookie", true);
+    private void doClickEvent(int mPosition, MessageModel model ) {
+        baseUrl = CommonUtil.getAppBaseUrl(ct);
+        String url = baseUrl + "mobile/message/getDetail.action?id=" + model.getId();
+        Intent intent_web = new Intent(ct,MsgThirdWebActivity.class);
+        intent_web.putExtra(IntentUtils.KEY_URL, url);
+        intent_web.putExtra(IntentUtils.KEY_TITLE, msg_title);
+        intent_web.putExtra(IntentUtils.KEY_NEER_COOKIE, true);
+        intent_web.putExtra(IntentUtils.KEY_NEER_SHARE, false);
+        intent_web.putExtra(IntentUtils.KEY_SHARE_IMAGE, "");
+        intent_web.putExtra(IntentUtils.KEY_SHARE_CONTENT, "");
+        intent_web.putExtra("caller",model.getCaller());
+        intent_web.putExtra("keyValue",model.getKeyValue());
         startActivityForResult(intent_web, MSG_MARKED_READED);
+//        intent_web.putExtra("url", url + "?id=" + msg_id);
+//        intent_web.putExtra("title", msg_title);
+//        intent_web.putExtra("cookie", true);
+//        startActivityForResult(intent_web, MSG_MARKED_READED);
 
         Log.d("322msg_id", msg_id + ":" + url);
         msgModel.get(mPosition).setReaded(true);

+ 1 - 1
app_modular/appmessages/src/main/java/com/modular/appmessages/activity/SubcribeManageActivity.java

@@ -13,7 +13,7 @@ import com.modular.appmessages.adapter.SubscribeManegeVpAdapter;
 import com.modular.appmessages.fragment.BaseFragment;
 import com.modular.appmessages.fragment.SubscriptionAllFragment;
 import com.modular.appmessages.fragment.SubscriptionMyFragment;
-import com.modular.appmessages.ui.NoSlideViewpager;
+import com.core.widget.NoSlideViewpager;
 import com.viewpagerindicator.TabPageIndicator;
 import com.viewpagerindicator.UnderlinePageIndicator;
 

+ 2 - 2
app_modular/appmessages/src/main/java/com/modular/appmessages/adapter/ApprovalAdapter.java

@@ -320,8 +320,8 @@ public class ApprovalAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
     private void gotoReadEnclosure(Approval approval) {
         String url = approval.getIdKey();
         final CustomProgressDialog progressDialog = CustomProgressDialog.createDialog(ct);
-        progressDialog.setTitile("正在下载");
-        progressDialog.setMessage("正在下载,请勿关闭程序");
+        progressDialog.setTitile("正在预览");
+        progressDialog.setMessage("正在生成附件预览,请勿关闭程序");
         LogUtil.i("gotoReadEnclosure");
         if (!StringUtil.isEmpty(approval.getCaption())) {
             if (isImage(approval.getCaption())) {

+ 0 - 1
app_modular/appmessages/src/main/java/com/modular/appmessages/fragment/BaseFragment.java

@@ -13,7 +13,6 @@ import com.modular.appmessages.R;
 
 
 /**
- * BaseFragment 采用工厂模式
  * Created by RaoMeng on 2016/8/19.
  */
 public abstract class BaseFragment extends Fragment {

+ 6 - 8
app_modular/appmessages/src/main/java/com/modular/appmessages/presenter/MessagePresenter.java

@@ -13,7 +13,6 @@ import android.text.TextUtils;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.common.LogUtil;
 import com.common.data.DateFormatUtil;
 import com.common.data.JSONUtil;
 import com.common.data.ListUtils;
@@ -59,8 +58,8 @@ import com.modular.appmessages.util.ApprovalUtil;
 import com.modular.apputils.utils.SwitchUtil;
 import com.modular.booking.activity.services.BServiceListActivity;
 import com.modular.booking.model.SBMenuModel;
-import com.uas.appworks.CRM.erp.activity.DeviceManageActivity;
 import com.uas.appworks.OA.platform.activity.BusinessTravelActivity;
+import com.uas.appworks.OA.platform.activity.PurchaseDetailsActivity;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -105,7 +104,6 @@ public class MessagePresenter implements OnHttpResultListener {
         public void onReceive(Context context, Intent intent) {
             String action = intent.getAction();
             if (StringUtil.isEmpty(action)) return;
-            LogUtil.i("MessagePresenter=" + action);
             if (action.equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
                 iMessageView.changeNet(SystemUtil.isNetWorkConnected(MyApplication.getInstance()));
             } else if (OAConfig.AUTO_SIGIN_ALART.equals(action)) {
@@ -597,8 +595,7 @@ public class MessagePresenter implements OnHttpResultListener {
         List<MessageModel> models = new ArrayList<>();
         List<MessageModel> detailModels = new ArrayList<>();
         MessageModel model = null;
-        MessageModel  detailModel = null;
-        LogUtil.i("array="+array.size());
+        MessageModel detailModel = null;
         for (int i = 0; i < array.size(); i++) {
             object = array.getJSONObject(i);
             model = new MessageModel();
@@ -620,9 +617,11 @@ public class MessagePresenter implements OnHttpResultListener {
                     detailModel.setId(JSONUtil.getInt(detail, "id"));
                     detailModel.setTitle(JSONUtil.getText(detail, "title"));
                     detailModel.setSubTitle(JSONUtil.getText(detail, "subTitle"));
-                    detailModel.setTime(DateFormatUtil.long2Str(JSONUtil.getTime(detail,"createTime"), "yyyy-MM-dd HH:mm"));
+                    detailModel.setTime(DateFormatUtil.long2Str(JSONUtil.getTime(detail, "createTime"), "yyyy-MM-dd HH:mm"));
                     detailModel.setType(type);
                     detailModel.setHierarchy(1);
+                    detailModel.setCaller(JSONUtil.getText(detail,"caller"));
+                    detailModel.setKeyValue(JSONUtil.getInt(detail,"keyValue"));
                     detailModels.add(detailModel);
                 }
             }
@@ -1054,7 +1053,6 @@ public class MessagePresenter implements OnHttpResultListener {
         List<MessageHeader> models = new ArrayList<>();
         MessageHeader model = null;
         String role = CommonUtil.getUserRole();
-        LogUtil.i("role=" + role);
         if (role.equals("1")) {//个人用户
             models.addAll(getPersonalHeader());
         } else if (role.equals("3")) {//b2b用户
@@ -1274,7 +1272,7 @@ public class MessagePresenter implements OnHttpResultListener {
                 ct.startActivity(intent);
                 break;
             case 10:
-                intent = new Intent(ct, DeviceManageActivity.class);
+                intent = new Intent(ct, PurchaseDetailsActivity.class).putExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE, "待回复");
                 ct.startActivity(intent);
                 break;
             default:

+ 11 - 15
app_modular/apputils/src/main/java/com/modular/apputils/IntentUrlActivity.java

@@ -6,7 +6,6 @@ import android.net.Uri;
 import android.os.Bundle;
 
 import com.common.LogUtil;
-import com.modular.apputils.activity.SimpleWebActivity;
 
 /**
   * @desc:负责分发外部URL链接的中转界面
@@ -27,26 +26,23 @@ private static final String TAG = "IntentUrlActivity";
                 String id= uri.getQueryParameter("id");
                 LogUtil.d(TAG,"pagekind:"+pagekind+" id:"+id);
                 if ("A".equals(pagekind)){
-                    Intent intent=new Intent(this, SimpleWebActivity.class);
-                    intent.putExtra("id",id);
-                    intent.putExtra("url","https://www.baidu.com");
-                    intent.putExtra("p","询价单");
+                    Intent intent=new Intent("com.modular.work.platform.activity.CustomerInquiryDetailActivity");
+
+                    intent.putExtra("extra_b2b_list_id",id);
+                    intent.putExtra("extra_b2b_list_state","todo");
                     startActivity(intent);
-                    
                 }
-                if ("B".equals(pagekind)){
-                    Intent intent=new Intent(this, SimpleWebActivity.class);
-                    intent.putExtra("id",id);
-                    intent.putExtra("url","https://github.com");
-                    intent.putExtra("p","公共询价单");
+                if ("B".equals(pagekind)){//公共询价单
+                    Intent intent=new Intent("com.modular.work.platform.activity.CustomerInquiryDetailActivity");
+                    intent.putExtra("extra_b2b_list_id",id);
+                    intent.putExtra("extra_b2b_list_state","public_todo");
                     startActivity(intent);
                   
                 }
                 if ("C".equals(pagekind)){
-                    Intent intent=new Intent(this, SimpleWebActivity.class);
-                    intent.putExtra("id",id);
-                    intent.putExtra("url","https://www.jianshu.com/u/7cfc7246c714");
-                    intent.putExtra("p","采购单");
+                    Intent intent=new Intent("com.modular.work.platform.activity.PurchaseDetailsActivity");
+                    intent.putExtra("extra_b2b_list_id",id);
+                    intent.putExtra("extra_b2b_list_state","todo");
                     startActivity(intent);
                 }
                 overridePendingTransition(0,0);

+ 8 - 1
app_modular/apputils/src/main/java/com/modular/apputils/activity/BaseNetActivity.java

@@ -11,6 +11,7 @@ import android.support.annotation.NonNull;
 import android.support.v4.app.ActivityCompat;
 import android.support.v4.content.ContextCompat;
 import android.util.DisplayMetrics;
+import android.util.Log;
 import android.util.SparseArray;
 import android.view.View;
 
@@ -38,7 +39,7 @@ import java.util.Locale;
 public abstract class BaseNetActivity extends ActionBackActivity {
     protected Activity ct;
     private CustomProgressDialog progressDialog;
-    private HttpClient httpClient;
+    protected HttpClient httpClient;
 
     @Override
     protected void onResume() {
@@ -122,6 +123,7 @@ public abstract class BaseNetActivity extends ActionBackActivity {
             httpClient.Api().send(httpBuilder.build(), new ResultSubscriber<>(new Result2Listener<Object>() {
                 @Override
                 public void onResponse(Object o) {
+                    LogUtil.i("onResponse oooo=" + o.toString());
                     if (onHttpListener != null) try {
                         Tags tags = parameter.getTag();
                         int record = 0;
@@ -134,6 +136,9 @@ public abstract class BaseNetActivity extends ActionBackActivity {
                         }
                         onHttpListener.onSuccess(record, message, tags);
                     } catch (Exception e) {
+                        if (e != null && e.getMessage() != null) {
+                            Log.i(TAG, e.getMessage());
+                        }
                         e.printStackTrace();
                     }
                     dismissProgress();
@@ -141,6 +146,7 @@ public abstract class BaseNetActivity extends ActionBackActivity {
 
                 @Override
                 public void onFailure(Object t) {
+                    LogUtil.i("onFailure oooo=" + t.toString());
                     if (onHttpListener != null) try {
                         Tags tags = parameter.getTag();
                         int record = 0;
@@ -153,6 +159,7 @@ public abstract class BaseNetActivity extends ActionBackActivity {
                         }
                         onHttpListener.onFailure(record, message, tags);
                     } catch (Exception e) {
+                        LogUtil.i("oooo=" + e.getMessage());
                         e.printStackTrace();
                     }
                     dismissProgress();

+ 72 - 28
app_modular/apputils/src/main/java/com/modular/apputils/activity/SelectNetAcitivty.java

@@ -8,6 +8,7 @@ import android.support.v7.widget.DefaultItemAnimator;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.text.Editable;
+import android.text.TextUtils;
 import android.util.Log;
 import android.view.KeyEvent;
 import android.view.LayoutInflater;
@@ -125,6 +126,9 @@ public class SelectNetAcitivty extends OABaseActivity {
                 if (bundle != null) {
                     if (bundle.getInt(CodeUtils.RESULT_TYPE) == CodeUtils.RESULT_SUCCESS) {
                         String result = bundle.getString(CodeUtils.RESULT_STRING);
+                        LogUtil.i("result=" + result);
+                        lastKey = result;
+                        showLoading();
                         loadSearch(page = 1, result);
                     }
                 }
@@ -132,6 +136,8 @@ public class SelectNetAcitivty extends OABaseActivity {
         }
     }
 
+    private boolean isDevice;
+
     private void initView() {
         VoiceSearchView voiceSearchView = (VoiceSearchView) findViewById(R.id.voiceSearchView);
         refreshListView = (PullToRefreshListView) findViewById(R.id.refreshListView);
@@ -145,7 +151,11 @@ public class SelectNetAcitivty extends OABaseActivity {
             @Override
             public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                 lastKey = StringUtil.getText(v);
-                loadSearch(page = 1, lastKey);
+                if (isDevice && !TextUtils.isEmpty(lastKey)) {
+                    loadSearchDevice(lastKey);
+                } else {
+                    loadSearch(page = 1, lastKey);
+                }
                 return false;
             }
         });
@@ -167,13 +177,12 @@ public class SelectNetAcitivty extends OABaseActivity {
             caller = intent.getStringExtra("caller");
             gCaller = intent.getStringExtra("gCaller");
             corekey = intent.getStringExtra("corekey");
+            isDevice = intent.getBooleanExtra("isDevice",false);
         }
         String baseUrl = CommonUtil.getAppBaseUrl(this);
         String sessionId = CommonUtil.getSharedPreferences(this, "sessionId");
-        Log.i("gongpengming", "baseUrl=" + baseUrl);
         httpClient = new HttpClient.Builder(baseUrl)
                 .isDebug(true)
-//                .header("Cookie", "JSESSIONID=" + sessionId)
                 .add("master", CommonUtil.getMaster())
                 .add("sessionUser", CommonUtil.getEmcode())
                 .add("sessionId", sessionId)
@@ -184,25 +193,43 @@ public class SelectNetAcitivty extends OABaseActivity {
         showLoading();
     }
 
+    private void loadSearchDevice(final String keyWork) {
+        refreshListView.setMode(PullToRefreshBase.Mode.DISABLED);
+        HttpClient.Builder builder = new HttpClient.Builder();
+        boolean isForm = StringUtil.isEmpty(gCaller);
+        builder.url("mobile/device/getSearchData.action")
+                .add("caller", isForm ? caller : gCaller)
+                .add("name", fieldKey)
+                .header("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(this, "sessionId"))
+                .add("condition", keyWork)
+                .method(Method.GET);
+        httpClient.Api().send(builder.build(), new ResultSubscriber<>(new ResultListener<Object>() {
+            @Override
+            public void onResponse(Object o) {
+                if (!lastKey.equals(keyWork)) return;
+                try {
+                    handleData(o.toString());
+                    dimssLoading();
+                } catch (Exception e) {
+                    dimssLoading();
+                    if (mAdapter == null || ListUtils.isEmpty(mAdapter.models)) {
+                        mEmptyLayout.showEmpty();
+                    }
+                }
+                refreshListView.onRefreshComplete();
+            }
+        }));
+
+    }
+
     private void loadSearch(int page, final String keyWork) {
+        refreshListView.setMode(PullToRefreshBase.Mode.BOTH);
         String condition = null;
         if (StringUtil.isEmpty(keyWork)) {
             condition = "1=1";
-        } else
-//            if (configMap == null || configMap.isEmpty()) {
+        } else {
             condition = "upper(" + (StringUtil.isEmpty(corekey) ? fieldKey : corekey) + ") like '%" + keyWork.toUpperCase() + "%'";
-//        } else {
-//            String kwUp = keyWork.toUpperCase();
-//            StringBuilder conditionBulid = new StringBuilder();
-//            for (Map.Entry<String, String> e : configMap.entrySet()) {
-//                conditionBulid.append("upper(" +e.getValue()+ ") like '%" + kwUp+ "%' or ");
-//            }
-//            if (conditionBulid.length()>2){
-//                conditionBulid.delete(conditionBulid.length()-3,conditionBulid.length());
-//            }
-//            condition = conditionBulid.toString();
-//            LogUtil.i("condition="+condition);
-//        }
+        }
         HttpClient.Builder builder = new HttpClient.Builder();
         boolean isForm = StringUtil.isEmpty(gCaller);
         builder.url("mobile/common/dbfind.action")
@@ -240,8 +267,24 @@ public class SelectNetAcitivty extends OABaseActivity {
 
     private ListAdapter mAdapter = null;
 
+    private void handleDataDevice(String messgae) throws Exception {
+        JSONObject object = JSON.parseObject(messgae);
+        String dataStr = JSONUtil.getText(object, "data");
+        JSONArray data = JSON.parseArray(dataStr);
+        List<Bean> models = new ArrayList<>();
+        Bean b = null;
+        for (int i = 0; i < data.size(); i++) {
+            JSONObject o = data.getJSONObject(i);
+            b = new Bean();
+            b.name = JSONUtil.getText(o, fieldKey);
+            b.json = o.toJSONString();
+            b.showName = getShowName(o);
+            models.add(b);
+        }
+        showByAdapter(models);
+    }
+
     private void handleData(String messgae) throws Exception {
-        LogUtil.prinlnLongMsg("gongpengming", "messgae=" + messgae);
         JSONObject object = JSON.parseObject(messgae);
         JSONArray dbfinds = JSONUtil.getJSONArray(object, "dbfinds", "gridDbfinds");
         String dataStr = JSONUtil.getText(object, "data");
@@ -249,10 +292,9 @@ public class SelectNetAcitivty extends OABaseActivity {
         setData2Adapter(data, dbfinds);
     }
 
-    private Map<String, String> configMap;
 
     private void setData2Adapter(JSONArray data, JSONArray dbfinds) throws Exception {
-        configMap = new LinkedHashMap<>();
+         Map<String, String> configMap = new LinkedHashMap<>();
         //获取配置
         JSONObject config = null;
         String fieldKeyLike = null;
@@ -288,6 +330,10 @@ public class SelectNetAcitivty extends OABaseActivity {
             if (!StringUtil.isEmpty(b.name))
                 models.add(b);
         }
+        showByAdapter(models);
+    }
+
+    private void showByAdapter(List<Bean> models) {
         if (mAdapter == null) {
             mAdapter = new ListAdapter(models);
             refreshListView.setAdapter(mAdapter);
@@ -302,24 +348,22 @@ public class SelectNetAcitivty extends OABaseActivity {
                     }
                 }
             });
-            if (ListUtils.isEmpty(models)) {
-                mEmptyLayout.showEmpty();
-            }
+
         } else {
             if (page == 1) {
                 mAdapter.setModels(models);
-                if (ListUtils.isEmpty(models)) {
-                    mEmptyLayout.showEmpty();
-                }
             } else {
                 mAdapter.addModls(models);
             }
         }
+        if (ListUtils.isEmpty(models)) {
+            mEmptyLayout.showEmpty();
+        }
     }
 
-    private String getShowName(Map<String, String> object) throws Exception {
+    private <T> String getShowName(Map<String, T> object) throws Exception {
         StringBuilder builder = new StringBuilder();
-        for (Map.Entry<String, String> e : object.entrySet()) {
+        for (Map.Entry<String, T> e : object.entrySet()) {
             builder.append(e.getValue() + ",");
         }
         StringUtil.removieLast(builder);

+ 46 - 0
app_modular/apputils/src/main/java/com/modular/apputils/utils/RecyclerItemDecoration.java

@@ -0,0 +1,46 @@
+package com.modular.apputils.utils;
+
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.graphics.Rect;
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+
+import com.modular.apputils.R;
+
+/**
+ * Created by Bitlike on 2018/1/24.
+ */
+
+public class RecyclerItemDecoration extends RecyclerView.ItemDecoration {
+
+    private int dividerHeight;
+    private Paint mPaint;
+
+    public RecyclerItemDecoration(int dividerHeight) {
+        this.dividerHeight = dividerHeight;
+        mPaint = new Paint();
+        mPaint.setColor(0xBFD3D3D3);
+    }
+
+    @Override
+    public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
+        super.onDraw(c, parent, state);
+        int childCount = parent.getChildCount();
+        int left = parent.getPaddingLeft();
+        int right = parent.getWidth() - parent.getPaddingRight();
+
+        for (int i = 0; i < childCount - 1; i++) {
+            View view = parent.getChildAt(i);
+            float top = view.getBottom();
+            float bottom = view.getBottom() + dividerHeight;
+            c.drawRect(left, top, right, bottom, mPaint);
+        }
+    }
+
+    @Override
+    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
+        super.getItemOffsets(outRect, view, parent, state);
+        outRect.bottom = this.dividerHeight;
+    }
+}

+ 6 - 3
app_modular/apputils/src/main/java/com/modular/apputils/utils/SwitchUtil.java

@@ -8,13 +8,16 @@ import com.common.config.BaseConfig;
  */
 
 public class SwitchUtil {
-
     public static boolean showYiyuanjuan() {
-        return false;
+        return  BaseConfig.isDebug();
     }
 
     public static boolean showShebeiguanli() {
-        return  false;
+        return false;
+    }
+
+    public static boolean newFeePlease() {
+        return  BaseConfig.isDebug();
     }
 
 

+ 110 - 0
app_modular/apputils/src/main/java/com/modular/apputils/utils/TestStr.java

@@ -42,4 +42,114 @@ public class TestStr {
            "\t\"em_cttpid\": null,\n" +
            "\t\"sessionId\": \"FF4B29623F0E5CD9A4D79160ED85160C\"\n" +
            "}";
+
+
+   public static String PURCHASE_STR="{\n" +
+           "\t\"CLIENT\": \"凤唐物联技术有限公司\",\n" +
+           "\t\"ADDRESS\": \"凤唐物联技术有限公司收货地址\",\n" +
+           "\t\"CODE\": \"W76267272828\",\n" +
+           "\t\"TIME\": \"2018-01-01\",\n" +
+           "\t\"REMARKS\": null,\n" +
+           "\t\"ALLS\": 30000,\n" +
+           "\t\"DATA\": [{\n" +
+           "\t\t\"ID\": 17,\n" +
+           "\t\t\"TIME\": \"2018-01-01\",\n" +
+           "\t\t\"REMARKS\": null,\n" +
+           "\t\t\"ALLS\": 30000,\n" +
+           "\t\t\"DELIVERYDATE\": null,\n" +
+           "\t\t\"NUMBER\": null\n" +
+           "\t},\n" +
+           "\t{\n" +
+           "\t\t\"ID\": 16,\n" +
+           "\t\t\"TIME\": \"2018-01-01\",\n" +
+           "\t\t\"REMARKS\": null,\n" +
+           "\t\t\"ALLS\": 30000,\n" +
+           "\t\t\"DELIVERYDATE\": null,\n" +
+           "\t\t\"NUMBER\": null\n" +
+           "\t},\n" +
+           "\t{\n" +
+           "\t\t\"ID\": 15,\n" +
+           "\t\t\"TIME\": \"2018-01-01\",\n" +
+           "\t\t\"REMARKS\": null,\n" +
+           "\t\t\"ALLS\": 30000,\n" +
+           "\t\t\"DELIVERYDATE\": null,\n" +
+           "\t\t\"NUMBER\": null\n" +
+           "\t},\n" +
+           "\t{\n" +
+           "\t\t\"ID\": 14,\n" +
+           "\t\t\"TIME\": \"2018-01-01\",\n" +
+           "\t\t\"REMARKS\": null,\n" +
+           "\t\t\"ALLS\": 30000,\n" +
+           "\t\t\"DELIVERYDATE\": null,\n" +
+           "\t\t\"NUMBER\": null\n" +
+           "\t},\n" +
+           "\t{\n" +
+           "\t\t\"ID\": 13,\n" +
+           "\t\t\"TIME\": \"2018-01-01\",\n" +
+           "\t\t\"REMARKS\": null,\n" +
+           "\t\t\"ALLS\": 30000,\n" +
+           "\t\t\"DELIVERYDATE\": null,\n" +
+           "\t\t\"NUMBER\": null\n" +
+           "\t},\n" +
+           "\t{\n" +
+           "\t\t\"ID\": 10,\n" +
+           "\t\t\"TIME\": \"2018-01-01\",\n" +
+           "\t\t\"REMARKS\": null,\n" +
+           "\t\t\"ALLS\": 30000,\n" +
+           "\t\t\"DELIVERYDATE\": null,\n" +
+           "\t\t\"NUMBER\": null\n" +
+           "\t},\n" +
+           "\t{\n" +
+           "\t\t\"ID\": 11,\n" +
+           "\t\t\"TIME\": \"2018-01-01\",\n" +
+           "\t\t\"REMARKS\": null,\n" +
+           "\t\t\"ALLS\": 30000,\n" +
+           "\t\t\"DELIVERYDATE\": null,\n" +
+           "\t\t\"NUMBER\": null\n" +
+           "\t},\n" +
+           "\t{\n" +
+           "\t\t\"ID\": 12,\n" +
+           "\t\t\"TIME\": \"2018-01-01\",\n" +
+           "\t\t\"REMARKS\": null,\n" +
+           "\t\t\"ALLS\": 30000,\n" +
+           "\t\t\"DELIVERYDATE\": null,\n" +
+           "\t\t\"NUMBER\": null\n" +
+           "\t}],\n" +
+           "\t\"fields\": [{\n" +
+           "\t\t\"caption\": \"ID\",\n" +
+           "\t\t\"field\": \"ID\",\n" +
+           "\t\t\"type\": \"int\",\n" +
+           "\t\t\"needInput\": true\n" +
+           "\t},\n" +
+           "\t{\n" +
+           "\t\t\"caption\": \"单据时间\",\n" +
+           "\t\t\"field\": \"TIME\",\n" +
+           "\t\t\"type\": \"date\",\n" +
+           "\t\t\"needInput\": true\n" +
+           "\t},\n" +
+           "\t{\n" +
+           "\t\t\"caption\": \"备注\",\n" +
+           "\t\t\"field\": \"REMARKS\",\n" +
+           "\t\t\"type\": \"S\",\n" +
+           "\t\t\"needInput\": true\n" +
+           "\t},\n" +
+           "\t{\n" +
+           "\t\t\"caption\": \"总额\",\n" +
+           "\t\t\"field\": \"ALLS\",\n" +
+           "\t\t\"type\": \"S\",\n" +
+           "\t\t\"needInput\": true\n" +
+           "\t},\n" +
+           "\t{\n" +
+           "\t\t\"caption\": \"交货时间\",\n" +
+           "\t\t\"field\": \"DELIVERYDATE\",\n" +
+           "\t\t\"type\": \"date\",\n" +
+           "\t\t\"needInput\": true\n" +
+           "\t},\n" +
+           "\t{\n" +
+           "\t\t\"caption\": \"数量\",\n" +
+           "\t\t\"field\": \"NUMBER\",\n" +
+           "\t\t\"type\": \"S\",\n" +
+           "\t\t\"needInput\": true\n" +
+           "\t}]\n" +
+           "}";
 }

+ 24 - 0
app_modular/apputils/src/main/res/drawable/edit_hint_right_angle.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_focused="true">
+        <shape>
+            <solid android:color="@color/base_bg"/>
+            <stroke android:width="0.6dp" android:color="@color/item_line"/>
+            <padding android:bottom="0.5dp" android:left="0.5dp" android:right="0.5dp" android:top="0.5dp"/>
+        </shape>
+    </item>
+    <item android:state_pressed="true">
+        <shape>
+            <solid android:color="@color/base_bg"/>
+            <stroke android:width="0.6dp" android:color="@color/item_line"/>
+            <padding android:bottom="0.5dp" android:left="0.5dp" android:right="0.5dp" android:top="0.5dp"/>
+        </shape>
+    </item>
+    <item>
+        <shape>
+            <solid android:color="@color/base_bg"/>
+            <stroke android:width="0.6dp" android:color="@color/item_line"/>
+            <padding android:bottom="0.5dp" android:left="0.5dp" android:right="0.5dp" android:top="0.5dp"/>
+        </shape>
+    </item>
+</selector>

+ 10 - 0
app_modular/apputils/src/main/res/drawable/edit_white_right_angle.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item>
+        <shape>
+            <solid android:color="@color/white"/>
+            <stroke android:width="0.6dp" android:color="@color/item_line"/>
+            <padding android:bottom="0.5dp" android:left="0.5dp" android:right="0.5dp" android:top="0.5dp"/>
+        </shape>
+    </item>
+</selector>

+ 45 - 1
app_modular/appworks/src/main/AndroidManifest.xml

@@ -325,9 +325,10 @@
             </intent-filter>
         </activity>
 
+        <!--设备管理-->
         <activity
             android:name=".CRM.erp.activity.DeviceManageActivity"
-            android:label="@string/title_device_manage" >
+            android:label="@string/title_device_manage">
             <intent-filter>
                 <action android:name="com.modular.work.DeviceManageActivity" />
 
@@ -371,6 +372,49 @@
                 <category android:name="android.intent.category.DEFAULT" />
             </intent-filter>
         </activity>
+
+        <!--B2B商务-->
+        <activity android:name=".activity.B2BBusinessMainActivity">
+            <intent-filter>
+                <action android:name="com.modular.work.B2BBusinessMainActivity" />
+
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+        </activity>
+        <activity android:name=".activity.B2BBusinessLoginActivity">
+            <intent-filter>
+                <action android:name="com.modular.work.B2BBusinessLoginActivity" />
+
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+        </activity>
+        <activity
+            android:name=".activity.PublicInquiryListActivity"
+            android:theme="@style/StyledBlueIndicators"
+            android:windowSoftInputMode="adjustPan|stateHidden" />
+        <activity
+            android:name=".activity.CustomerInquiryListActivity"
+            android:theme="@style/StyledBlueIndicators"
+            android:windowSoftInputMode="adjustPan|stateHidden" />
+        <activity
+            android:name=".activity.PurchaseOrderListActivity"
+            android:theme="@style/StyledBlueIndicators"
+            android:windowSoftInputMode="adjustPan|stateHidden" />
+        <activity android:name=".activity.PublicInquiryDetailActivity" />
+        
+        <activity android:name=".activity.CustomerInquiryDetailActivity">
+            <intent-filter>
+                <action android:name="com.modular.work.platform.activity.CustomerInquiryDetailActivity" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+        </activity>
+        
+        <activity android:name=".OA.platform.activity.PurchaseDetailsActivity" >
+            <intent-filter>
+                <action android:name="com.modular.work.platform.activity.PurchaseDetailsActivity" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+        </activity>
     </application>
 
 </manifest>

+ 0 - 1
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/AddBusinessActivity.java

@@ -340,7 +340,6 @@ public class AddBusinessActivity extends OABaseActivity implements View.OnClickL
             @Override
             public void onResponse(Object t) {
                 String message = t.toString();
-                LogUtil.i("message=" + message);
                 judgeApprovers(mBcId);
             }
 

+ 1 - 0
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/DeviceDataFormAddActivity.java

@@ -1022,6 +1022,7 @@ public class DeviceDataFormAddActivity extends BaseActivity implements View.OnCl
                                 startActivityForResult(new Intent(ct, SelectNetAcitivty.class)
                                                 .putExtra("fieldKey", data.getField())
                                                 .putExtra("caller", caller)
+                                                .putExtra("isDevice", true)
                                                 .putExtra("device", data.getName().equals("设备编号"))
                                                 .putExtra("isForm", true)
                                         , 90);

+ 0 - 1
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/ScanDetailActivity.java

@@ -251,7 +251,6 @@ public class ScanDetailActivity extends BaseActivity implements View.OnClickList
         }
     };
     private void handleData(String message) throws Exception {
-        LogUtil.prinlnLongMsg("gongpengming", "message=" + message);
         JSONObject json = JSON.parseObject(message);
         boolean success = JSONUtil.getBoolean(json, "success");
         JSONObject object = JSONUtil.getJSONObject(json, "data");

+ 19 - 4
app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/activity/CommonDocDetailsActivity.java

@@ -28,6 +28,7 @@ import com.common.LogUtil;
 import com.common.data.JSONUtil;
 import com.common.data.ListUtils;
 import com.common.data.StringUtil;
+import com.common.data.TextUtil;
 import com.common.system.ActivityUtils;
 import com.core.api.wxapi.ApiPlatform;
 import com.core.api.wxapi.ApiUtils;
@@ -141,11 +142,13 @@ public class CommonDocDetailsActivity extends BaseActivity {
     }
 
     private boolean device;
+    private boolean message;
 
     public void initView() {
         Intent intent = getIntent();
         if (intent != null) {
             device = intent.getBooleanExtra("device", false);
+            message = intent.getBooleanExtra("message", false);
         }
 
         platform = ApiUtils.getApiModel() instanceof ApiPlatform;
@@ -313,7 +316,9 @@ public class CommonDocDetailsActivity extends BaseActivity {
             finish();
         }
         if (item.getItemId() == android.R.id.home) {
-            if (device) {
+            if (message) {
+                endMessage();
+            } else if (device) {
                 endDevice();
             } else {
                 if (ActivityUtils.isExsitMianActivity(mContext, FormListSelectActivity.class)) {
@@ -584,8 +589,12 @@ public class CommonDocDetailsActivity extends BaseActivity {
                 }
             }
         } catch (JSONException e) {
+            if (e != null)
+                LogUtil.i("JSONException =" + e.getMessage());
             e.printStackTrace();
         } catch (Exception e) {
+            if (e != null)
+                LogUtil.i("Exception =" + e.getMessage());
             e.printStackTrace();
         }
 
@@ -645,7 +654,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
         if (device) {
             LogUtil.i("real_status=" + real_status);
             resanddel_ll.setVisibility(View.GONE);
-            if (real_status.equals("已审核")&&!StringUtil.isEmpty(mCaller)&&(mCaller.equals("DeviceChange!Use")||mCaller.equals("DeviceChange!Inspect"))) {
+            if (real_status.equals("已审核") && !StringUtil.isEmpty(mCaller) && (mCaller.equals("DeviceChange!Use") || mCaller.equals("DeviceChange!Inspect"))) {
                 sureTv.setVisibility(View.VISIBLE);
                 sureTv.setOnClickListener(new View.OnClickListener() {
                     @Override
@@ -1037,7 +1046,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
     }
 
     private void getapplypeomsg(String em_number) {
-        if (!em_number.isEmpty()) {
+        if (TextUtils.isEmpty(em_number)) {
             String whichsys = CommonUtil.getSharedPreferences(mContext, "erp_master");
             String[] selectionArgs = {em_number == null ? "" : em_number, whichsys};
             String selection = "em_code=? and whichsys=? ";
@@ -1083,7 +1092,9 @@ public class CommonDocDetailsActivity extends BaseActivity {
     @Override
     public boolean onKeyDown(int keyCode, KeyEvent event) {
         if ((keyCode == KeyEvent.KEYCODE_BACK)) {
-            if (device) {
+            if (message) {
+                endMessage();
+            } else if (device) {
                 endDevice();
             } else {
                 if (ActivityUtils.isExsitMianActivity(mContext, FormListSelectActivity.class)) {
@@ -1115,6 +1126,10 @@ public class CommonDocDetailsActivity extends BaseActivity {
 
     }
 
+    private void endMessage() {
+        onBackPressed();
+    }
+
     private void endDevice() {
         String dc_class = null;
         if (mCaller.equals("DeviceChange!Use")) {

+ 7 - 5
app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/activity/form/DataFormDetailActivity.java

@@ -52,6 +52,7 @@ import com.core.widget.view.selectcalendar.bean.Data;
 import com.lidroid.xutils.ViewUtils;
 import com.modular.apputils.activity.SelectNetAcitivty;
 import com.modular.apputils.utils.PopupWindowHelper;
+import com.modular.apputils.utils.SwitchUtil;
 import com.uas.appworks.OA.erp.activity.CommonDocDetailsActivity;
 import com.uas.appworks.OA.erp.model.form.GroupData;
 import com.uas.appworks.R;
@@ -75,6 +76,7 @@ import java.util.regex.Pattern;
 /**
  * @desc:动态表单界面
  * @author:Arison on 2016/11/8
+ * update 更新敏感操作,fpd_start_time(fpd_date1)fpd_end_time(fpd_date2)
  */
 public class DataFormDetailActivity extends BaseActivity implements View.OnClickListener {
 
@@ -660,8 +662,8 @@ public class DataFormDetailActivity extends BaseActivity implements View.OnClick
                 } else if ("FeePlease!CCSQ".equals(caller) || "FeePlease!CCSQ!new".equals(caller)) {
                     startDate = "fp_prestartdate";
                     endDate = "fp_preenddate";
-                    d_startDate = "fpd_date1";
-                    d_endDate = "fpd_date2";
+                    d_startDate = SwitchUtil.newFeePlease()?"fpd_start_time":"fpd_date1";
+                    d_endDate = SwitchUtil.newFeePlease()?"fpd_end_time":"fpd_date2";
 
                     formidkey = "fp_id";
                     detailkey_id = "fpd_id";//明细id
@@ -1624,14 +1626,14 @@ public class DataFormDetailActivity extends BaseActivity implements View.OnClick
                 mAdapter.getmListData().get(model.getGroupId()).getDatas().get(va_alltimes - 1).setValue(startDate);
                 mAdapter.getmListData().get(model.getGroupId()).getDatas().get(va_alldays - 1).setValue(endDate);
             }
-            if ("fpd_date1".equals(field) || "fpd_date2".equals(field)) {
+            if ("fpd_date1".equals(field) || "fpd_date2".equals(field)||"fpd_start_time".equals(field)||"fpd_end_time".equals(field)) {
                 List<Data> tempLists = mAdapter.getmListData().get(model.getGroupId()).getDatas();
                 for (int i = 0; i < tempLists.size(); i++) {
                     Data tempData = tempLists.get(i);
-                    if (tempData.getField().equals("fpd_date1")) {
+                    if (tempData.getField().equals(SwitchUtil.newFeePlease()?"fpd_start_time":"fpd_date1")) {
                         va_alldays = i + 1;
                     }
-                    if (tempData.getField().equals("fpd_date2")) {
+                    if (tempData.getField().equals(SwitchUtil.newFeePlease()?"fpd_end_time":"fpd_date2")) {
                         va_alltimes = i + 1;
                     }
                 }

+ 23 - 21
app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/adapter/CommonDocMainMsgAdapter.java

@@ -9,6 +9,7 @@ import android.widget.TextView;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONException;
+import com.common.data.ListUtils;
 import com.uas.appworks.R;
 import com.uas.appworks.OA.erp.model.CommonDocAMBean;
 
@@ -62,39 +63,40 @@ public class CommonDocMainMsgAdapter extends BaseAdapter {
     @Override
     public View getView(int position, View convertView, ViewGroup parent) {
         ViewHolder viewHolder = null;
-        if (convertView == null){
+        if (convertView == null) {
             viewHolder = new ViewHolder();
-            convertView =  View.inflate(mContext, R.layout.item_comdoc_am,null);
+            convertView = View.inflate(mContext, R.layout.item_comdoc_am, null);
             viewHolder.docmainmsg_list = (TextView) convertView.findViewById(R.id.item_comdoc_am_list_tv);
             viewHolder.docmainmsg_value = (TextView) convertView.findViewById(R.id.item_comdoc_am_value_tv);
             convertView.setTag(viewHolder);
-        }else {
+        } else {
             viewHolder = (ViewHolder) convertView.getTag();
         }
 
-        if (mFormconfigsBean != null && formdataBeans != null){
-                viewHolder.docmainmsg_list.setText(mFormconfigsBean.get(position).getFD_CAPTION());
-                    try {
-                        if (formdataBeans.getJSONObject(0).getString(mFormconfigsBean.get(position).getFD_FIELD()) != null) {
-                            if (!formdataBeans.getJSONObject(0).getString(mFormconfigsBean.get(position).getFD_FIELD()).equals("null")){
-                                Log.i("VALUE",mFormconfigsBean.get(position).getFD_FIELD().toString());
-                                viewHolder.docmainmsg_value.setText(formdataBeans.getJSONObject(0)
-                                        .getString(mFormconfigsBean.get(position).getFD_FIELD().toString()));
-                            }else {
-                                viewHolder.docmainmsg_value.setText("");
-                            }
-
-                        } else  {
-                            viewHolder.docmainmsg_value.setText("");
-                        }
-                    } catch (JSONException e) {
-                        e.printStackTrace();
+        if (mFormconfigsBean != null && formdataBeans != null) {
+            viewHolder.docmainmsg_list.setText(mFormconfigsBean.get(position).getFD_CAPTION());
+            if (!ListUtils.isEmpty(formdataBeans)) try {
+                if (formdataBeans.getJSONObject(0).getString(mFormconfigsBean.get(position).getFD_FIELD()) != null) {
+                    if (!formdataBeans.getJSONObject(0).getString(mFormconfigsBean.get(position).getFD_FIELD()).equals("null")) {
+                        Log.i("VALUE", mFormconfigsBean.get(position).getFD_FIELD().toString());
+                        viewHolder.docmainmsg_value.setText(formdataBeans.getJSONObject(0)
+                                .getString(mFormconfigsBean.get(position).getFD_FIELD().toString()));
+                    } else {
+                        viewHolder.docmainmsg_value.setText("");
                     }
+
+                } else {
+                    viewHolder.docmainmsg_value.setText("");
+                }
+            } catch (JSONException e) {
+                e.printStackTrace();
+            }
         }
 
         return convertView;
     }
-    class ViewHolder{
+
+    class ViewHolder {
         TextView docmainmsg_list;
         TextView docmainmsg_value;
     }

+ 5 - 5
app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/presenter/WorkPresenter.java

@@ -436,11 +436,11 @@ public class WorkPresenter implements OnHttpResultListener, IWorkPresenter {
      * @return
      */
     private boolean isSubmitAble(ArrayList<WorkModel> models) {
-        if (ListUtils.isEmpty(models) && !isFree) {
-            if (iWorkView != null)
-                iWorkView.showToast(R.string.not_work_message, R.color.load_warning);
-            return false;
-        }
+//        if (ListUtils.isEmpty(models) && !isFree) {
+//            if (iWorkView != null)
+//                iWorkView.showToast(R.string.not_work_message, R.color.load_warning);
+//            return false;
+//        }
         if (isSubmiting) {
             if (iWorkView != null)
                 iWorkView.showToast(R.string.not_signin_agin, R.color.load_warning);

+ 8 - 14
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/activity/BusinessTravelActivity.java

@@ -6,6 +6,7 @@ import android.support.v7.widget.RecyclerView;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.common.LogUtil;
 import com.common.config.BaseConfig;
 import com.common.data.JSONUtil;
 import com.common.data.ListUtils;
@@ -50,6 +51,7 @@ public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHt
     private void initView() {
         mRefreshLayout = findViewById(R.id.mRefreshLayout);
         mRecyclerView = findViewById(R.id.mRecyclerView);
+        mRefreshLayout.setEnabledPullUp(false);
         mRefreshLayout.setOnRefreshListener(new BaseRefreshLayout.onRefreshListener() {
             @Override
             public void onRefresh() {
@@ -58,7 +60,7 @@ public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHt
 
             @Override
             public void onLoadMore() {
-                loadData(++page);
+//                loadData(++page);
             }
         });
     }
@@ -77,7 +79,6 @@ public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHt
     }
 
 
-
     @Override
     public void onSuccess(int what, String message, Tags tags) throws Exception {
         handlerData(message);
@@ -94,11 +95,12 @@ public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHt
 
 
     private void handlerData(String message) throws Exception {
-        JSONObject object= JSON.parseObject(message);
+        LogUtil.i("handlerData");
+        JSONObject object = JSON.parseObject(message);
         JSONArray listdata = JSONUtil.getJSONArray(object, "listdata");
         List<BusinessTravel> models = new ArrayList<>();
         BusinessTravel model = null;
-        String cttpid=JSONUtil.getText(object, "em_cttpid");
+        String cttpid = JSONUtil.getText(object, "em_cttpid");
         for (int i = 0; i < listdata.size(); i++) {
             JSONObject data = listdata.getJSONObject(i);
             model = new BusinessTravel();
@@ -107,23 +109,15 @@ public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHt
             models.add(model);
             JSONArray reimbursements = JSONUtil.getJSONArray(data, "reimbursement");
             for (int j = 0; j < reimbursements.size(); j++) {
-                models.add(new BusinessTravel(cttpid,reimbursements.getJSONObject(i)));
+                models.add(new BusinessTravel(cttpid, reimbursements.getJSONObject(j)));
             }
         }
         setAdapter(models);
     }
 
     private void setAdapter(List<BusinessTravel> models) {
-        if (BaseConfig.isDebug()) {
-
-        }
         if (mAdapter == null) {
-            mAdapter = new BusinessTravelAdapter(ct, models, new BusinessTravelAdapter.OnItemClickListener() {
-                @Override
-                public void click(int position, BusinessTravel model) {
-
-                }
-            });
+            mAdapter = new BusinessTravelAdapter(ct, models);
             mRecyclerView.addItemDecoration(new SpaceItemDecoration(30));
             mRecyclerView.setLayoutManager(new LinearLayoutManager(ct));
             mRecyclerView.setAdapter(mAdapter);

+ 335 - 0
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/activity/PurchaseDetailsActivity.java

@@ -0,0 +1,335 @@
+package com.uas.appworks.OA.platform.activity;
+
+import android.content.Intent;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.view.KeyEvent;
+import android.view.MenuItem;
+import android.widget.Toast;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.common.LogUtil;
+import com.common.data.DateFormatUtil;
+import com.common.data.JSONUtil;
+import com.common.data.ListUtils;
+import com.common.data.StringUtil;
+import com.common.thread.ThreadPool;
+import com.core.app.Constants;
+import com.core.app.MyApplication;
+import com.core.net.http.http.OAHttpHelper;
+import com.core.utils.CommonUtil;
+import com.core.utils.ToastUtil;
+import com.me.network.app.http.Method;
+import com.modular.apputils.activity.BaseNetActivity;
+import com.modular.apputils.listener.OnSmartHttpListener;
+import com.modular.apputils.network.Parameter;
+import com.modular.apputils.network.Tags;
+import com.modular.apputils.utils.RecyclerItemDecoration;
+import com.uas.appworks.OA.platform.adapter.PurchaseDetailsAdapter;
+import com.uas.appworks.OA.platform.model.Purchase;
+import com.uas.appworks.R;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * Created by Bitlike on 2018/1/15.
+ */
+
+public class PurchaseDetailsActivity extends BaseNetActivity implements OnSmartHttpListener {
+
+    private String varId;
+    private String varStatus;
+    private String enUU;
+
+    private RecyclerView mRecyclerView;
+    private PurchaseDetailsAdapter mAdapter;
+
+    private boolean changeStatus;
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.activity_purchase_details;
+    }
+
+    @Override
+    protected String getBaseUrl() {
+//        return "http://uas.ubtob.com/";
+        return "http://192.168.253.102:8090/platform-b2b/";
+    }
+
+    @Override
+    protected void init() throws Exception {
+        Intent intent = getIntent();
+        if (intent != null) {
+            varId = intent.getStringExtra(Constants.FLAG.EXTRA_B2B_LIST_ID);
+            varStatus = intent.getStringExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE);
+            enUU = intent.getStringExtra(Constants.FLAG.EXTRA_B2B_LIST_ENUU);
+            if (TextUtils.isEmpty(enUU)) {
+                enUU = CommonUtil.getSharedPreferences(mContext, Constants.CACHE.B2B_BUSINESS_ENUU);
+            }
+        }
+        if (varStatus == null) {
+            varStatus = "";
+        }
+        changeStatus = false;
+        setStatus();
+        initView();
+        initData();
+    }
+
+    private void setStatus() {
+        String title = "";
+        switch (varStatus) {
+            case Constants.FLAG.STATE_PURCHASE_ORDER_END:
+                title = "已结案";
+                break;
+            case Constants.FLAG.STATE_PURCHASE_ORDER_DONE:
+                title = "已回复";
+                break;
+            case Constants.FLAG.STATE_PURCHASE_ORDER_TODO:
+                title = "待回复";
+                break;
+        }
+        getSupportActionBar().setTitle(title);
+    }
+
+    private void initView() {
+        mRecyclerView = findViewById(R.id.mRecyclerView);
+        mRecyclerView.setLayoutManager(new LinearLayoutManager(ct));
+        mRecyclerView.addItemDecoration(new RecyclerItemDecoration(1));
+
+    }
+
+    private void initData() {
+        loadData();
+    }
+
+
+    private void loadData() {
+        showProgress();
+        String phone = MyApplication.getInstance().mLoginUser.getTelephone();
+        Parameter.Builder builder = new Parameter.Builder();
+        String url = "mobile/sale/orders/" + varId + "/info";//卖方
+        builder.mode(Method.GET)
+                .url(url)
+                .record(0x11)
+                .showLog(true)
+                .autoProgress(true)
+                .addParams("en_uu", enUU)
+                .addParams("user_tel", phone);
+        requestHttp(builder, this);
+    }
+
+    private boolean replyed;
+
+    private void verifiReply(List<Purchase> purchases) {
+        List<Map<String, Object>> mapList = new ArrayList<>();
+        for (int i = 1; i < purchases.size(); i++) {
+            Purchase purchase = purchases.get(i);
+            if (!TextUtils.isEmpty(purchase.getDate()) && purchase.isCanInput()) {
+                Map<String, Object> map = new HashMap<>();
+                map.put("qty", StringUtil.getFirstInt(purchase.getNumber(), 0));
+                map.put("delivery", DateFormatUtil.str2Long(purchase.getDate(), DateFormatUtil.YMD));//
+                map.put("remark", purchase.getRemarksInput());
+                map.put("pdId", purchase.getId());
+                mapList.add(map);
+            }
+        }
+        if (!ListUtils.isEmpty(mapList)) {
+            String json = JSONUtil.map2JSON(mapList);
+            reply(json);
+        } else {
+            ToastUtil.showToast(ct, "没有可以提交的明细表单");
+        }
+    }
+
+    private void reply(String json) {
+        String phone = MyApplication.getInstance().mLoginUser.getTelephone();
+        Parameter.Builder builder = new Parameter.Builder();
+        builder.mode(Method.POST)
+                .url("mobile/sale/orders/reply")
+                .addParams("en_uu", enUU)
+                .addParams("json", json)
+                .addParams("user_tel", phone)
+                .record(0x12)
+                .showLog(true)
+                .autoProgress(true);
+        requestHttp(builder, this);
+    }
+
+
+    private void setData2Adapter(List<Purchase> dataList) {
+        mAdapter = new PurchaseDetailsAdapter(ct, varStatus, dataList);
+        mAdapter.setOnReplyLisenter(new PurchaseDetailsAdapter.OnReplyLisenter() {
+            @Override
+            public void reply(List<Purchase> purchases) {
+                PurchaseDetailsActivity.this.verifiReply(purchases);
+            }
+        });
+        mRecyclerView.setAdapter(mAdapter);
+
+    }
+
+    @Override
+    public void onSuccess(int what, String message, Tags tag) throws Exception {
+        switch (what) {
+            case 0x11:
+                handleMessage(message);
+                break;
+            case 0x12:
+                if (!this.isFinishing()) {
+                    replyed = true;
+                    loadData();
+                }
+                break;
+        }
+        dismissProgress();
+    }
+
+    @Override
+    public void onFailure(int what, String message, Tags tag) throws Exception {
+        ToastUtil.showToast(ct, message);
+        if (0x12 == what && StringUtil.isEmpty(message) && this != null) {
+            loadData();
+        }
+    }
+
+
+    private void handleMessage(final String message) throws Exception {
+        ThreadPool.getThreadPool().addTask(new Runnable() {
+            @Override
+            public void run() {
+                JSONObject object = JSON.parseObject(message);
+                setVarStatus(object);
+                final List<Purchase> dataList = new ArrayList<>();
+                JSONArray orderItems = JSONUtil.getJSONArray(object, "orderItems");
+
+                Purchase mainPurchase = getPurchase(true, object);
+                float top = 0;
+                if (!ListUtils.isEmpty(orderItems)) {
+                    Purchase purchase = null;
+                    for (int i = 0; i < orderItems.size(); i++) {
+                        purchase = getPurchase(false, orderItems.getJSONObject(i));
+                        dataList.add(purchase);
+                        try {
+                            top += Float.valueOf(purchase.getAmount());
+                        } catch (Exception e) {
+                            LogUtil.i("e=" + e.getMessage());
+                        }
+                    }
+                }
+                mainPurchase.setTotal(String.valueOf(top));
+                dataList.add(0, mainPurchase);
+                OAHttpHelper.getInstance().post(new Runnable() {
+                    @Override
+                    public void run() {
+                        setStatus();
+                        if (replyed) {
+                            Toast.makeText(MyApplication.getInstance(), "回复成功", Toast.LENGTH_SHORT).show();
+                            finish();
+                        } else {
+                            setData2Adapter(dataList);
+                        }
+                    }
+                });
+            }
+        });
+    }
+
+    private void setVarStatus(JSONObject object) {
+        String end = JSONUtil.getText(object, "end");
+        if (!TextUtils.isEmpty(end) && "1".equals(end)) {
+            if (!varStatus.equals(Constants.FLAG.STATE_PURCHASE_ORDER_END)) {
+                changeStatus = true;
+                varStatus = Constants.FLAG.STATE_PURCHASE_ORDER_END;
+            }
+        } else {
+            String status = JSONUtil.getText(object, "status");
+            String reply = JSONUtil.getText(object, "reply");
+            if ("200".equals(status)) {
+                if (!varStatus.equals(Constants.FLAG.STATE_PURCHASE_ORDER_TODO)) {
+                    changeStatus = true;
+                    varStatus = Constants.FLAG.STATE_PURCHASE_ORDER_TODO;
+                }
+            } else if ("201".equals(status) && "1".equals(reply)) {
+                if (!varStatus.equals(Constants.FLAG.STATE_PURCHASE_ORDER_DONE)) {
+                    changeStatus = true;
+                    varStatus = Constants.FLAG.STATE_PURCHASE_ORDER_DONE;
+                }
+            }
+        }
+    }
+
+
+    private Purchase getPurchase(boolean first, JSONObject object) {
+        Purchase purchase = new Purchase();
+        int id = JSONUtil.getInt(object, "id");
+        String address = JSONUtil.getText(object, "shipAddress");//收货地址
+        String time = DateFormatUtil.long2Str(JSONUtil.getLong(object, "erpDate", "date"), DateFormatUtil.YMD);//单据时间
+        String date = DateFormatUtil.long2Str(JSONUtil.getLong(object, "replyDelivery", "delivery"), DateFormatUtil.YMD);//交货日期
+        String replyRemark = JSONUtil.getText(object, "replyRemark");//采购单号
+        int status = JSONUtil.getInt(object, "status");//状态
+        String code;//采购单号
+        String remarks;//备注|产品
+        String alls;//总额|产品规格
+        if (first) {
+            String currency = JSONUtil.getText(object, "currency");//采购单号
+            code = JSONUtil.getText(object, "code");//采购单号
+            remarks = JSONUtil.getText(object, "remark");//备注
+            alls = JSONUtil.getText(object, "amount");//总额
+            JSONObject enterprise = JSONUtil.getJSONObject(object, "enterprise");//客户
+            String client = JSONUtil.getText(enterprise, "enName");
+            purchase.setCurrency(currency);
+            purchase.setCustomer(client);
+        } else {
+            JSONObject product = JSONUtil.getJSONObject(object, "product");
+            code = JSONUtil.getText(product, "code");
+            remarks = JSONUtil.getText(product, "title");
+            alls = JSONUtil.getText(product, "spec");
+            String unit = JSONUtil.getText(product, "unit");
+            String amount = JSONUtil.getText(object, "amount");
+            String price = JSONUtil.getText(object, "price");
+            String number = JSONUtil.getText(object, "qty");//数量
+            purchase.setNumber(number);
+            purchase.setAmount(amount);
+            purchase.setPrice(price);
+            purchase.setUnit(unit);
+        }
+        purchase.setCanInput(status == 200);
+        purchase.setId(id);
+        purchase.setCode(code);
+        purchase.setAddress(address);
+        purchase.setTime(time);
+        purchase.setRemarks(remarks);
+        purchase.setTotal(alls);
+        purchase.setDate(date);
+        purchase.setRemarksInput(replyRemark);
+        return purchase;
+    }
+
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == android.R.id.home) {
+            if (changeStatus) {
+                setResult(Constants.FLAG.RESULT_PURCHASE_ORDER, new Intent().putExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE, varStatus));
+            }
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        if (keyCode == KeyEvent.KEYCODE_BACK && changeStatus) {
+            setResult(Constants.FLAG.RESULT_PURCHASE_ORDER, new Intent().putExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE, varStatus));
+        }
+        return super.onKeyDown(keyCode, event);
+    }
+}

+ 1 - 27
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/adapter/ActivityAdapter.java

@@ -93,19 +93,16 @@ public class ActivityAdapter extends BaseAdapter {
         ImageLoader.getInstance().displayImage(model.getActImg(), finalHoder.contantImg, ImageConfig.getCharitableImageOptions(), new ImageLoadingListener() {
             @Override
             public void onLoadingStarted(String s, View view) {
-                LogUtil.i("onLoadingStarted view instanceof ImageView");
                 finalHoder.contantImg.setImageResource(R.drawable.charitable_def_image);
             }
 
             @Override
             public void onLoadingFailed(String s, View view, FailReason failReason) {
-                LogUtil.i("onLoadingFailed view instanceof ImageView");
                 finalHoder.contantImg.setImageResource(R.drawable.charitable_def_image);
             }
 
             @Override
             public void onLoadingComplete(String s, View view, Bitmap bitmap) {
-                LogUtil.i("onLoadingComplete view instanceof ImageView");
                 if (finalHoder.contantImg.getTag()!=null&& url.equals(finalHoder.contantImg.getTag())){
                     finalHoder.contantImg.setImageBitmap(bitmap);
                 }
@@ -113,7 +110,6 @@ public class ActivityAdapter extends BaseAdapter {
 
             @Override
             public void onLoadingCancelled(String s, View view) {
-                LogUtil.i("onLoadingCancelled view instanceof ImageView");
                 finalHoder.contantImg.setImageResource(R.drawable.charitable_def_image);
             }
         });
@@ -160,27 +156,5 @@ public class ActivityAdapter extends BaseAdapter {
         TextView subTv;
     }
 
-//    private ImageLoadingListener imageLoadingListener = new ImageLoadingListener() {
-//        @Override
-//        public void onLoadingStarted(String s, View view) {
-//            if (view instanceof ImageView) {
-//                LogUtil.i("onLoadingStarted view instanceof ImageView");
-//            }
-//        }
-//
-//        @Override
-//        public void onLoadingFailed(String s, View view, FailReason failReason) {
-//            LogUtil.i("onLoadingFailed view instanceof ImageView");
-//        }
-//
-//        @Override
-//        public void onLoadingComplete(String s, View view, Bitmap bitmap) {
-//            LogUtil.i("onLoadingComplete view instanceof ImageView");
-//        }
-//
-//        @Override
-//        public void onLoadingCancelled(String s, View view) {
-//            LogUtil.i("onLoadingCancelled view instanceof ImageView");
-//        }
-//    };
+
 }

+ 0 - 1
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/adapter/AutoPlayPagerAdapter.java

@@ -56,7 +56,6 @@ public class AutoPlayPagerAdapter extends AutoPagerAdapter implements View.OnCli
 		if (c!=null){
 			itemClickListener.clickItem( c);
 		}else{
-			LogUtil.i("c is null");
 		}
 	}
 

+ 61 - 15
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/adapter/BusinessTravelAdapter.java

@@ -12,14 +12,21 @@ import android.widget.TextView;
 import com.alibaba.fastjson.JSON;
 import com.common.LogUtil;
 import com.common.data.DateFormatUtil;
+import com.common.data.JSONUtil;
 import com.common.data.ListUtils;
 import com.common.data.StringUtil;
+import com.common.hmac.Md5Util;
 import com.core.utils.CommonUtil;
+import com.core.utils.IntentUtils;
 import com.modular.apputils.widget.TravelDirectionView;
 import com.uas.appworks.OA.platform.model.BusinessTravel;
 import com.uas.appworks.R;
 
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * Created by Bitlike on 2017/12/12.
@@ -28,13 +35,11 @@ import java.util.List;
 public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements View.OnClickListener {
     private Context ct;
     private List<BusinessTravel> models;
-    private OnItemClickListener listener;
     private String currentName;
 
-    public BusinessTravelAdapter(Context ct, List<BusinessTravel> models, OnItemClickListener listener) {
+    public BusinessTravelAdapter(Context ct, List<BusinessTravel> models) {
         this.ct = ct;
         this.models = models;
-        this.listener = listener;
         this.currentName = CommonUtil.getName();
     }
 
@@ -99,7 +104,7 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
     private final String DONE_CANCEL = "取消预约";
 
     private void bindBaseView(BaseViewHlder holder, BusinessTravel model, int position) {
-        holder.codeTv.setText(model.getTitle());
+        holder.codeTv.setText(model.getTitleAndCode() );
         holder.statusTv.setText(model.getStatus());
         holder.nameTv.setText(currentName == null ? "**" : currentName);
         holder.idCardTv.setText(model.getCttpid());
@@ -144,7 +149,7 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
         holder.tripTv.setText(fromCity + "-" + toCity);
         holder.mTravelDirectionView.setData(model.getSeat(), longTime2Time(model.getAllTime()));
         //改签
-        if (model.canChange()) {
+        if (StringUtil.getText(holder.dateTv).equals(DONE_CANCEL)) {
             holder.changeTv.setVisibility(View.VISIBLE);
             holder.changeTv.setBackgroundResource(R.drawable.text_frame_radian_hint_bg);
             holder.changeTv.setTextColor(ct.getResources().getColor(R.color.text_hine));
@@ -285,8 +290,6 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
     public void onClick(View v) {
         BusinessTravel model = (BusinessTravel) v.getTag(R.id.tag_key);
         int position = (int) v.getTag(R.id.tag_key2);
-        LogUtil.i("model=" + JSON.toJSONString(model));
-        LogUtil.i("position=" + position);
         int id = v.getId();
         if (id == R.id.expandTv) {
             model.setExpand(!model.isExpand());
@@ -295,21 +298,16 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
             TextView doneTv = (TextView) v;
             String doneMessage = StringUtil.getText(doneTv);
             if (doneMessage.equals(DONE_CANCEL)) {
-                LogUtil.i("点击了取消预约");
+                cancel(model);
             } else {
-                LogUtil.i("点击了预约/订票");
+                reserve(model);
             }
         } else if (R.id.changeTv == id) {
-            LogUtil.i("点击了改签");
+            change(model);
         }
     }
 
 
-    public interface OnItemClickListener {
-        void click(int position, BusinessTravel model);
-    }
-
-
     private String longTime2Time(long time) {
         long second = time / 1000;
         long hh = second / 3600;
@@ -317,4 +315,52 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
         return hh + "小时" + mm + "分钟";
     }
 
+
+    private void cancel(BusinessTravel model) {
+        LogUtil.i("点击了取消预约");
+
+    }
+
+    private void reserve(BusinessTravel model) {
+        Map<String, Object> map = new HashMap<>();
+        map.put("traverorderno", model.getCode());
+        map.put("product", model.getTitleCode());
+        map.put("costname", "成本中心");
+        map.put("proname", "UU互联差旅订票");
+        map.put("fpd_id", model.getId());
+        map.put("master", CommonUtil.getMaster());
+        map.put("baseUrl", CommonUtil.getAppBaseUrl(ct));
+        map.put("emCode", CommonUtil.getEmcode());
+        String p = JSONUtil.map2JSON(map);
+        turn2Web(p);
+    }
+
+    private void change(BusinessTravel model) {
+        LogUtil.i("点击了改签");
+
+    }
+
+    private void turn2Web(String p) {
+        //TODO 测试数据
+        LogUtil.i("p="+p);
+        String appkey = "y8gd87dsdkencgzk394k7s5c78io35c";
+        String username = "huangx";
+        String appSceret = "e212e142a5c9e0590eefb7d9f1bc91d7";
+        String data = appkey + username.toUpperCase() + appSceret;
+        String key = Md5Util.toMD5(appSceret).toUpperCase();
+        String sign = Md5Util.toMD5(key + data);
+        StringBuilder urlBuilder = new StringBuilder("http://124.254.45.234:8082/oa/caslogin/");
+        urlBuilder.append(appkey + "/");
+        urlBuilder.append(username + "/");
+        urlBuilder.append(sign);
+        try {
+            urlBuilder.append("?p=" + URLEncoder.encode(p, "UTF-8"));
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        LogUtil.i(urlBuilder.toString());
+        IntentUtils.linkCommonWeb(ct, urlBuilder.toString());
+    }
+
+
 }

+ 266 - 0
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/adapter/PurchaseDetailsAdapter.java

@@ -0,0 +1,266 @@
+package com.uas.appworks.OA.platform.adapter;
+
+import android.app.Activity;
+import android.content.Context;
+import android.support.v7.widget.AppCompatTextView;
+import android.support.v7.widget.RecyclerView;
+import android.text.Editable;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.TextView;
+
+import com.common.LogUtil;
+import com.common.data.CalendarUtil;
+import com.common.data.DateFormatUtil;
+import com.common.data.ListUtils;
+import com.common.data.StringUtil;
+import com.common.data.TextUtil;
+import com.common.system.DisplayUtil;
+import com.core.app.Constants;
+import com.core.utils.time.wheel.DateTimePicker;
+import com.core.widget.listener.EditChangeListener;
+import com.uas.appworks.OA.platform.model.Purchase;
+import com.uas.appworks.R;
+
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * Created by Bitlike on 2018/1/16.
+ */
+
+public class PurchaseDetailsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
+    private Context context;
+    private List<Purchase> purchases;
+    private LayoutInflater mInflater;
+    private boolean canReply;
+
+    public PurchaseDetailsAdapter(Context context, String status, List<Purchase> purchases) {
+        this.context = context;
+        this.purchases = purchases;
+        mInflater = LayoutInflater.from(context);
+        canReply = (status != null && status.equals(Constants.FLAG.STATE_CUSTOMER_INQUIRY_TODO));
+
+    }
+
+    @Override
+    public int getItemViewType(int position) {
+        return position;
+    }
+
+    @Override
+    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+        if (viewType == 0) {
+            return new TotalViewHolder(parent);
+        } else if (viewType == ListUtils.getSize(purchases)) {
+            return new BtnViewHolder(parent);
+        }
+        return new ViewHolder(parent);
+    }
+
+    @Override
+    public int getItemCount() {
+        return ListUtils.getSize(purchases) + 1;
+    }
+
+
+    class BtnViewHolder extends RecyclerView.ViewHolder {
+        Button replyBtn;
+
+        public BtnViewHolder(ViewGroup viewGroup) {
+            this(mInflater.inflate(R.layout.item_btn, viewGroup, false));
+        }
+
+        public BtnViewHolder(View itemView) {
+            super(itemView);
+            replyBtn = itemView.findViewById(R.id.replyBtn);
+            replyBtn.setVisibility(canReply ? View.VISIBLE : View.GONE);
+        }
+    }
+
+    class ViewHolder extends RecyclerView.ViewHolder {
+        TextView timeTv, remarksTv, totalTv, dateEd,amountTv,numberUnit;
+        EditText numberEd, remarksInputEd;
+
+        public ViewHolder(ViewGroup viewGroup) {
+            this(mInflater.inflate(R.layout.item_purchase, viewGroup, false));
+        }
+
+        public ViewHolder(View itemView) {
+            super(itemView);
+            timeTv = itemView.findViewById(R.id.timeTv);
+            numberUnit = itemView.findViewById(R.id.numberUnit);
+            amountTv = itemView.findViewById(R.id.amountTv);
+            remarksTv = itemView.findViewById(R.id.remarksTv);
+            totalTv = itemView.findViewById(R.id.totalTv);
+            dateEd = itemView.findViewById(R.id.dateEd);
+            numberEd = itemView.findViewById(R.id.numberEd);
+            remarksInputEd = itemView.findViewById(R.id.remarksInputEd);
+
+        }
+    }
+
+    class TotalViewHolder extends RecyclerView.ViewHolder {
+        TextView customerTv, addressTv, codeTv, timeTv, remarksTv, totalTv,currencyTv;
+
+        public TotalViewHolder(ViewGroup viewGroup) {
+            this(mInflater.inflate(R.layout.item_ls_purchase, viewGroup, false));
+        }
+
+        public TotalViewHolder(View itemView) {
+            super(itemView);
+            currencyTv = itemView.findViewById(R.id.currencyTv);
+            addressTv = itemView.findViewById(R.id.addressTv);
+            codeTv = itemView.findViewById(R.id.codeTv);
+            timeTv = itemView.findViewById(R.id.timeTv);
+            customerTv = itemView.findViewById(R.id.customerTv);
+            remarksTv = itemView.findViewById(R.id.remarksTv);
+            totalTv = itemView.findViewById(R.id.totalTv);
+
+        }
+    }
+
+
+    @Override
+    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
+        if (holder instanceof ViewHolder && position < ListUtils.getSize(purchases)) {
+            onBindViewHolder((ViewHolder) holder, position);
+        } else if (holder instanceof TotalViewHolder) {
+            onBindViewHolder((TotalViewHolder) holder, position);
+        } else if (holder instanceof BtnViewHolder) {
+            onBindViewHolder((BtnViewHolder) holder);
+        }
+    }
+
+    private void onBindViewHolder(TotalViewHolder holder, int position) {
+        Purchase purchase = purchases.get(position);
+        holder.totalTv.setText(purchase.getTotal());
+        holder.addressTv.setText(purchase.getAddress());
+        holder.customerTv.setText(purchase.getCustomer());
+        holder.codeTv.setText(purchase.getCode());
+        holder.remarksTv.setText(TextUtils.isEmpty(purchase.getRemarks()) ? "无" : purchase.getRemarks());
+        holder.timeTv.setText(purchase.getTime());
+        holder.currencyTv.setText(purchase.getCurrency());
+    }
+
+    private void onBindViewHolder(BtnViewHolder holder) {
+        holder.replyBtn.setFocusable(canReply);
+        holder.replyBtn.setClickable(canReply);
+        holder.replyBtn.setPressed(!canReply);
+        int padd = DisplayUtil.dip2px(context, 10);
+        if (canReply) {
+            holder.replyBtn.setBackgroundResource(R.drawable.bg_bule_btn);
+            holder.replyBtn.setOnClickListener(onClickListener);
+
+        } else {
+            holder.replyBtn.setBackgroundResource(R.drawable.bg_orange_btn_pass);
+        }
+        holder.replyBtn.setPadding(padd, padd, padd, padd);
+    }
+
+    private void onBindViewHolder(ViewHolder holder, int position) {
+        Purchase purchase = purchases.get(position);
+        holder.totalTv.setText(purchase.getTotal());
+        holder.remarksTv.setText(purchase.getRemarks());
+        holder.timeTv.setText(purchase.getCode());
+        holder.amountTv.setText(purchase.getPrice());
+        holder.dateEd.setText(purchase.getDate());
+        holder.numberEd.setText(purchase.getNumber());
+        holder.remarksInputEd.setText(purchase.getRemarksInput());
+        holder.numberUnit.setText(purchase.getUnit());
+
+        if (canReply && purchase.isCanInput()) {
+            holder.dateEd.setTag(position);
+            holder.dateEd.setOnClickListener(onClickListener);
+            holder.numberEd.addTextChangedListener(new TextChangListener(position, 1));
+            holder.remarksInputEd.addTextChangedListener(new TextChangListener(position, 2));
+            holder.numberEd.setClickable(true);
+            holder.numberEd.setFocusable(true);
+            holder.remarksInputEd.setClickable(true);
+            holder.remarksInputEd.setFocusable(true);
+        } else {
+            holder.dateEd.setOnClickListener(null);
+            holder.numberEd.setClickable(false);
+            holder.numberEd.setFocusable(false);
+            holder.remarksInputEd.setClickable(false);
+            holder.remarksInputEd.setFocusable(false);
+        }
+
+
+    }
+
+    private View.OnClickListener onClickListener = new View.OnClickListener() {
+        @Override
+        public void onClick(View v) {
+            if (v.getId() == R.id.dateEd && v.getTag() != null && v.getTag() instanceof Integer) {
+                int position = (int) v.getTag();
+                showDateSelect(position);
+            } else if (v.getId() == R.id.replyBtn) {
+                if (onReplyLisenter != null) {
+                    onReplyLisenter.reply(purchases);
+                }
+            }
+        }
+    };
+
+    private void showDateSelect(final int position) {
+        DateTimePicker picker = new DateTimePicker((Activity) context, DateTimePicker.YEAR_MONTH_DAY);
+        picker.setRange(2000, 2030);
+        int year, month, day;
+        Date time = null;
+        if (ListUtils.getSize(purchases) > position && !StringUtil.isEmpty(purchases.get(position).getDate())) {
+            time = DateFormatUtil.str2date(purchases.get(position).getDate(), DateFormatUtil.YMD);
+        }
+        year = CalendarUtil.getYear(time);
+        month = CalendarUtil.getMonth(time);
+        day = CalendarUtil.getDay(time);
+        picker.setSelectedItem(year, month, day);
+        picker.setOnDateTimePickListener(new DateTimePicker.OnYearMonthDayTimePickListener() {
+            @Override
+            public void onDateTimePicked(String year, String month, String day, String hour, String minute) {
+                if (ListUtils.getSize(purchases) > position) {
+                    purchases.get(position).setDate(year + "-" + month + "-" + day);
+                    notifyItemChanged(position);
+                }
+            }
+        });
+        picker.show();
+    }
+
+    private class TextChangListener extends EditChangeListener {
+        private int position;
+        private int type;
+
+        public TextChangListener(int position, int type) {
+            this.position = position;
+            this.type = type;
+        }
+
+        @Override
+        public void afterTextChanged(Editable s) {
+            if (this.position >= 0 && ListUtils.getSize(purchases) > this.position) {
+                String message = s == null ? "" : s.toString();
+                if (type == 1) {
+                    purchases.get(this.position).setNumber(message);
+                } else if (type == 2) {
+                    purchases.get(this.position).setRemarksInput(message);
+                }
+            }
+        }
+    }
+
+    private OnReplyLisenter onReplyLisenter;
+
+    public void setOnReplyLisenter(OnReplyLisenter onReplyLisenter) {
+        this.onReplyLisenter = onReplyLisenter;
+    }
+
+    public interface OnReplyLisenter {
+        void reply(List<Purchase> purchases);
+    }
+}

+ 16 - 0
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/model/BusinessTravel.java

@@ -265,6 +265,22 @@ public class BusinessTravel {
     }
 
     public String getTitle() {
+        return title;
+    }
+
+    public String getTitleCode() {
+        switch (title) {
+            case "火车票":
+                return "train";
+            case "住宿":
+                return "hotel";
+            case "飞机票":
+                return "air";
+        }
+        return title;
+    }
+
+    public String getTitleAndCode() {
         return title + "   " + (StringUtil.isEmpty(code) ? "未订票" : code);
     }
 

+ 143 - 0
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/model/Purchase.java

@@ -0,0 +1,143 @@
+package com.uas.appworks.OA.platform.model;
+
+/**
+ * Created by Bitlike on 2018/1/16.
+ */
+
+public class Purchase {
+    private int id;
+    private boolean canInput;
+    private String customer;
+    private String address;
+    private String code;
+    private String time;
+    private String remarks;
+    private String total;
+    private String date;
+    private String number;
+    private String remarksInput;
+    private String amount;//单价
+    private String currency;//币种
+    private String unit;//单位
+    private String price;//单位
+
+    public String getPrice() {
+        return price;
+    }
+
+    public void setPrice(String price) {
+        this.price = price;
+    }
+
+    public String getUnit() {
+        return unit==null?"PCS":unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    public String getCurrency() {
+        return currency==null?"":currency;
+    }
+
+    public void setCurrency(String currency) {
+        this.currency = currency;
+    }
+
+    public String getAmount() {
+        return amount==null?"0":amount;
+    }
+
+    public void setAmount(String amount) {
+        this.amount = amount;
+    }
+
+    public boolean isCanInput() {
+        return canInput;
+    }
+
+    public void setCanInput(boolean canInput) {
+        this.canInput = canInput;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String getCustomer() {
+        return customer;
+    }
+
+    public void setCustomer(String customer) {
+        this.customer = customer;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getTime() {
+        return time;
+    }
+
+    public void setTime(String time) {
+        this.time = time;
+    }
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    public String getTotal() {
+        return total;
+    }
+
+    public void setTotal(String total) {
+        this.total = total;
+    }
+
+    public String getDate() {
+        return date;
+    }
+
+    public void setDate(String date) {
+        this.date = date;
+    }
+
+    public String getNumber() {
+        return number;
+    }
+
+    public void setNumber(String number) {
+        this.number = number;
+    }
+
+    public String getRemarksInput() {
+        return remarksInput;
+    }
+
+    public void setRemarksInput(String remarksInput) {
+        this.remarksInput = remarksInput;
+    }
+}

+ 125 - 0
app_modular/appworks/src/main/java/com/uas/appworks/activity/B2BBusinessLoginActivity.java

@@ -0,0 +1,125 @@
+package com.uas.appworks.activity;
+
+import android.content.Intent;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.widget.LinearLayout;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.common.data.JSONUtil;
+import com.core.app.Constants;
+import com.core.base.activity.BaseMVPActivity;
+import com.core.utils.CommonUtil;
+import com.core.widget.RecycleViewDivider;
+import com.module.recyclerlibrary.listener.OnRecyclerItemClickListener;
+import com.uas.appworks.R;
+import com.uas.appworks.adapter.B2BBusinessCompanyAdapter;
+import com.uas.appworks.model.bean.B2BCompanyBean;
+import com.uas.appworks.presenter.WorkPlatPresenter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author RaoMeng
+ * @describe B2B商务登录页面
+ * @date 2018/1/15 15:41
+ */
+
+public class B2BBusinessLoginActivity extends BaseMVPActivity {
+
+    private RecyclerView mRecyclerView;
+    private List<B2BCompanyBean> mB2BCompanyBeans;
+    private B2BBusinessCompanyAdapter mB2BBusinessCompanyAdapter;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.activity_b2b_business_login;
+    }
+
+    @Override
+    protected void initView() {
+        getSupportActionBar().setTitle(R.string.str_work_b2b_commerce);
+
+        mRecyclerView = $(R.id.b2b_business_login_company_rv);
+        mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext));
+        mRecyclerView.addItemDecoration(new RecycleViewDivider(this, LinearLayout.HORIZONTAL, 1, getResources().getColor(R.color.gray_light)));
+
+        mB2BCompanyBeans = new ArrayList<>();
+        mB2BBusinessCompanyAdapter = new B2BBusinessCompanyAdapter(mContext, mB2BCompanyBeans);
+        mRecyclerView.setAdapter(mB2BBusinessCompanyAdapter);
+    }
+
+    @Override
+    protected WorkPlatPresenter initPresenter() {
+        return null;
+    }
+
+    @Override
+    protected void initEvent() {
+        mRecyclerView.addOnItemTouchListener(new OnRecyclerItemClickListener(mRecyclerView) {
+            @Override
+            public void onItemClick(RecyclerView.ViewHolder vh) {
+                B2BCompanyBean b2BCompanyBean = mB2BCompanyBeans.get(vh.getLayoutPosition());
+                CommonUtil.setSharedPreferences(mContext, Constants.CACHE.B2B_BUSINESS_ENUU, b2BCompanyBean.getEnuu());
+
+                Intent intent = new Intent();
+                intent.setClass(mContext, B2BBusinessMainActivity.class);
+                intent.putExtra(Constants.FLAG.B2B_COMPANY_BEAN, b2BCompanyBean);
+                startActivity(intent);
+                B2BBusinessLoginActivity.this.finish(false);
+            }
+        });
+    }
+
+    @Override
+    protected void initData() {
+        getB2BCompanys();
+    }
+
+    private void getB2BCompanys() {
+        String companyJson = CommonUtil.getSharedPreferences(this, "loginJson");
+        if (JSONUtil.validate(companyJson)) {
+            JSONArray companyArray = JSON.parseArray(companyJson);
+            if (companyArray != null && companyArray.size() > 0) {
+                for (int i = 0; i < companyArray.size(); i++) {
+                    JSONObject companyObject = companyArray.getJSONObject(i);
+                    if (companyObject != null) {
+                        String platform = JSONUtil.getText(companyObject, "platform");
+                        if ("B2B".equals(platform)) {
+                            JSONArray spacesArray = companyObject.getJSONArray("spaces");
+                            if (spacesArray != null && spacesArray.size() > 0) {
+                                for (int j = 0; j < spacesArray.size(); j++) {
+                                    JSONObject spacesObject = spacesArray.getJSONObject(j);
+                                    if (spacesObject != null) {
+                                        B2BCompanyBean b2BCompanyBean = new B2BCompanyBean();
+                                        b2BCompanyBean.setId(JSONUtil.getInt(spacesObject, "id"));
+                                        b2BCompanyBean.setEnuu(JSONUtil.getText(spacesObject, "enuu"));
+                                        b2BCompanyBean.setBusinessCode(JSONUtil.getText(spacesObject, "businessCode"));
+                                        b2BCompanyBean.setName(JSONUtil.getText(spacesObject, "name"));
+
+                                        mB2BCompanyBeans.add(b2BCompanyBean);
+                                    }
+                                }
+                                mB2BBusinessCompanyAdapter.notifyDataSetChanged();
+                            }
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    @Override
+    public void showLoading(String loadStr) {
+
+    }
+
+    @Override
+    public void hideLoading() {
+
+    }
+}

+ 711 - 0
app_modular/appworks/src/main/java/com/uas/appworks/activity/B2BBusinessMainActivity.java

@@ -0,0 +1,711 @@
+package com.uas.appworks.activity;
+
+import android.content.Intent;
+import android.support.v7.app.ActionBar;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.SpannableStringBuilder;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.afollestad.materialdialogs.MaterialDialog;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.common.LogUtil;
+import com.common.data.DateFormatUtil;
+import com.common.data.JSONUtil;
+import com.core.app.Constants;
+import com.core.app.MyApplication;
+import com.core.base.activity.BaseMVPActivity;
+import com.core.utils.CommonUtil;
+import com.core.utils.SpanUtils;
+import com.core.widget.DrawableCenterTextView;
+import com.core.widget.RecycleViewDivider;
+import com.me.network.app.base.HttpCallback;
+import com.me.network.app.base.HttpParams;
+import com.me.network.app.http.HttpRequest;
+import com.me.network.app.http.Method;
+import com.scwang.smartrefresh.layout.api.RefreshLayout;
+import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
+import com.uas.appworks.OA.platform.activity.PurchaseDetailsActivity;
+import com.uas.appworks.R;
+import com.uas.appworks.adapter.B2BAccountAdapter;
+import com.uas.appworks.adapter.B2bBusinessListAdapter;
+import com.uas.appworks.model.bean.B2BBusinessListBean;
+import com.uas.appworks.model.bean.B2BCompanyBean;
+import com.uas.appworks.presenter.WorkPlatPresenter;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author RaoMeng
+ * @describe B2B商务首页
+ * @date 2018/1/14 14:19
+ */
+
+public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter> implements View.OnClickListener, HttpCallback {
+    private static final int OBTAIN_PURCHASE_ORDER_LIST = 0x01, OBTAIN_CUSTOMER_INQUIRY_LIST = 0x02, OBTAIN_PUBLIC_INQUIRY_LIST = 0x03, REQUEST_PURCHASE_DETAIL = 0x04, REQUEST_CUSTOMER_DETAIL = 0x05, REQUEST_PUBLIC_DETAIL = 0x06;
+
+    private RefreshLayout mRefreshLayout;
+    private ImageView mBackImageView;
+    private DrawableCenterTextView mCompanyNameTextView;
+    private LinearLayout mPurchaseOrderIv, mCustomerInquiryIv, mPublicInquiryIv;
+    private TextView mPurchaseOrderAllTv, mCustomerInquiryAllTv, mPublicInquiryAllTv, mAccountSureTextView, mAccountCancelTextView;
+    private RecyclerView mPurchaseOrderRv, mCustomerInquiryRv, mPublicInquiryRv, mAccountRecyclerView;
+    private MaterialDialog mAccountDialog;
+
+    private B2BCompanyBean mB2BCompanyBean;
+    private SpanUtils mSpanUtils;
+    private List<B2BCompanyBean> mB2BCompanyBeans;
+    private B2BAccountAdapter mB2BAccountAdapter;
+    private List<B2BBusinessListBean> mPurchaseOrderBeans, mCustomerInquiryBeans, mPublicInquiryBeans;
+    private B2bBusinessListAdapter mPurchaseOrderAdapter, mCustomerInquiryAdapter, mPublicInquiryAdapter;
+    private boolean isPurchaseSuccess, isCustomerSuccess, isPublicSuccess;
+    private int mSelectPosition = -1;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.activity_b2b_business_main;
+    }
+
+    @Override
+    protected void initView() {
+        View actionView = View.inflate(mContext, R.layout.action_b2b_company, null);
+        mBackImageView = (ImageView) actionView.findViewById(R.id.b2b_company_back);
+        mCompanyNameTextView = (DrawableCenterTextView) actionView.findViewById(R.id.b2b_company_name);
+
+        ActionBar actionBar = getSupportActionBar();
+        actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
+        actionBar.setCustomView(actionView);
+
+        mRefreshLayout = $(R.id.b2b_business_main_refreshlayout);
+        mPurchaseOrderIv = $(R.id.b2b_business_main_purchase_order_iv);
+        mCustomerInquiryIv = $(R.id.b2b_business_main_customer_inquiry_iv);
+        mPublicInquiryIv = $(R.id.b2b_business_main_public_inquiry_iv);
+        mPurchaseOrderAllTv = $(R.id.b2b_business_main_purchase_order_all_tv);
+        mPurchaseOrderRv = $(R.id.b2b_business_main_purchase_order_rv);
+        mCustomerInquiryAllTv = $(R.id.b2b_business_main_customer_inquiry_all_tv);
+        mCustomerInquiryRv = $(R.id.b2b_business_main_customer_inquiry_rv);
+        mPublicInquiryAllTv = $(R.id.b2b_business_main_public_inquiry_all_tv);
+        mPublicInquiryRv = $(R.id.b2b_business_main_public_inquiry_rv);
+
+        View accountView = View.inflate(mContext, R.layout.pop_b2b_change_account, null);
+        mAccountRecyclerView = (RecyclerView) accountView.findViewById(R.id.b2b_change_account_rv);
+        mAccountRecyclerView.setLayoutManager(new LinearLayoutManager(mContext));
+        mAccountSureTextView = (TextView) accountView.findViewById(R.id.b2b_change_account_sure_tv);
+        mAccountCancelTextView = (TextView) accountView.findViewById(R.id.b2b_change_account_cancel_tv);
+
+        mB2BCompanyBeans = new ArrayList<>();
+        mB2BAccountAdapter = new B2BAccountAdapter(mContext, mB2BCompanyBeans);
+        mAccountRecyclerView.setAdapter(mB2BAccountAdapter);
+
+        mAccountDialog = new MaterialDialog.Builder(mContext)
+                .customView(accountView, true)
+                .build();
+
+        mPurchaseOrderRv.setLayoutManager(new LinearLayoutManager(mContext));
+        mPurchaseOrderRv.setNestedScrollingEnabled(false);
+        mPurchaseOrderRv.addItemDecoration(new RecycleViewDivider(mContext, LinearLayout.HORIZONTAL, 1, getResources().getColor(R.color.gray_light)));
+        mPurchaseOrderBeans = new ArrayList<>();
+        mPurchaseOrderAdapter = new B2bBusinessListAdapter(mContext, mPurchaseOrderBeans);
+        mPurchaseOrderRv.setAdapter(mPurchaseOrderAdapter);
+
+        mCustomerInquiryRv.setLayoutManager(new LinearLayoutManager(mContext));
+        mCustomerInquiryRv.setNestedScrollingEnabled(false);
+        mCustomerInquiryRv.addItemDecoration(new RecycleViewDivider(mContext, LinearLayout.HORIZONTAL, 1, getResources().getColor(R.color.gray_light)));
+        mCustomerInquiryBeans = new ArrayList<>();
+        mCustomerInquiryAdapter = new B2bBusinessListAdapter(mContext, mCustomerInquiryBeans);
+        mCustomerInquiryRv.setAdapter(mCustomerInquiryAdapter);
+
+        mPublicInquiryRv.setLayoutManager(new LinearLayoutManager(mContext));
+        mPublicInquiryRv.setNestedScrollingEnabled(false);
+        mPublicInquiryRv.addItemDecoration(new RecycleViewDivider(mContext, LinearLayout.HORIZONTAL, 1, getResources().getColor(R.color.gray_light)));
+        mPublicInquiryBeans = new ArrayList<>();
+        mPublicInquiryAdapter = new B2bBusinessListAdapter(mContext, mPublicInquiryBeans);
+        mPublicInquiryRv.setAdapter(mPublicInquiryAdapter);
+    }
+
+    @Override
+    protected WorkPlatPresenter initPresenter() {
+        return null;
+    }
+
+    @Override
+    protected void initEvent() {
+        mBackImageView.setOnClickListener(this);
+        mCompanyNameTextView.setOnClickListener(this);
+        mPurchaseOrderIv.setOnClickListener(this);
+        mPurchaseOrderAllTv.setOnClickListener(this);
+        mCustomerInquiryIv.setOnClickListener(this);
+        mCustomerInquiryAllTv.setOnClickListener(this);
+        mPublicInquiryIv.setOnClickListener(this);
+        mPublicInquiryAllTv.setOnClickListener(this);
+        mAccountSureTextView.setOnClickListener(this);
+        mAccountCancelTextView.setOnClickListener(this);
+
+        mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
+            @Override
+            public void onRefresh(RefreshLayout refreshLayout) {
+                if (CommonUtil.isNetWorkConnected(mContext)) {
+                    isPurchaseSuccess = false;
+                    isCustomerSuccess = false;
+                    isPublicSuccess = false;
+                    getListData(OBTAIN_PURCHASE_ORDER_LIST);
+                    getListData(OBTAIN_CUSTOMER_INQUIRY_LIST);
+                    getListData(OBTAIN_PUBLIC_INQUIRY_LIST);
+                } else {
+                    toast(R.string.networks_out);
+                    mRefreshLayout.finishRefresh(500, false);
+                }
+
+            }
+        });
+
+        mPurchaseOrderAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+            @Override
+            public void onItemClick(BaseQuickAdapter baseQuickAdapter, View view, int i) {
+                mSelectPosition = i;
+                Intent intent = new Intent();
+                intent.setClass(mContext, PurchaseDetailsActivity.class);
+                intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_ID, mPurchaseOrderBeans.get(i).getId());
+                intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE, mPurchaseOrderBeans.get(i).getBillState());
+                intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_JSON, mPurchaseOrderBeans.get(i).getJsonData());
+                startActivityForResult(intent, REQUEST_PURCHASE_DETAIL);
+            }
+        });
+
+        mCustomerInquiryAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+            @Override
+            public void onItemClick(BaseQuickAdapter baseQuickAdapter, View view, int i) {
+                mSelectPosition = i;
+                Intent intent = new Intent();
+                intent.setClass(mContext, CustomerInquiryDetailActivity.class);
+                intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_ID, mCustomerInquiryBeans.get(i).getId());
+                intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE, mCustomerInquiryBeans.get(i).getBillState());
+                intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_JSON, mCustomerInquiryBeans.get(i).getJsonData());
+                startActivityForResult(intent, REQUEST_CUSTOMER_DETAIL);
+            }
+        });
+
+        mPublicInquiryAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+            @Override
+            public void onItemClick(BaseQuickAdapter baseQuickAdapter, View view, final int position) {
+                Intent intent = new Intent();
+                String billState = mPublicInquiryBeans.get(position).getBillState();
+                if (Constants.FLAG.STATE_PUBLIC_INQUIRY_DONE.equals(billState)) {
+                    intent.setClass(mContext, PublicInquiryDetailActivity.class);
+                    intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_ID, mPublicInquiryBeans.get(position).getId());
+                    intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE, mPublicInquiryBeans.get(position).getBillState());
+                    intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_JSON, mPublicInquiryBeans.get(position).getJsonData());
+                    startActivity(intent);
+                } else if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(billState)) {
+                    showLoading(null);
+
+                    Map<String, Object> params = new HashMap<>();
+                    params.put("en_uu", mB2BCompanyBean.getEnuu());
+                    params.put("user_tel", MyApplication.getInstance().mLoginUser.getTelephone());
+                    params.put("id", mPublicInquiryBeans.get(position).getId());
+
+                    HttpRequest.getInstance().sendRequest("http://218.17.158.219:24000/",
+                            new HttpParams.Builder()
+                                    .url("inquiry/sale/quote")
+                                    .method(Method.GET)
+                                    .setHeaders(new HashMap<String, Object>())
+                                    .setParams(params)
+                                    .build(), new HttpCallback() {
+                                @Override
+                                public void onSuccess(int flag, Object o) throws Exception {
+                                    hideLoading();
+                                    Intent intent = null;
+                                    String result = o.toString();
+                                    if (TextUtils.isEmpty(result)) {
+//                                        mSelectPosition = position;
+                                        intent = new Intent();
+                                        intent.setClass(mContext, CustomerInquiryDetailActivity.class);
+                                        intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_ID, mPublicInquiryBeans.get(position).getId());
+                                        intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE, mPublicInquiryBeans.get(position).getBillState());
+                                        intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_JSON, mPublicInquiryBeans.get(position).getJsonData());
+                                        startActivityForResult(intent, REQUEST_PUBLIC_DETAIL);
+                                    } else {
+                                        intent = new Intent();
+                                        intent.setClass(mContext, PublicInquiryDetailActivity.class);
+                                        intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_ID, mPublicInquiryBeans.get(position).getId());
+                                        intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE, mPublicInquiryBeans.get(position).getBillState());
+                                        intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_JSON, mPublicInquiryBeans.get(position).getJsonData());
+                                        startActivity(intent);
+                                    }
+                                }
+
+                                @Override
+                                public void onFail(int flag, String failStr) throws Exception {
+                                    hideLoading();
+                                    toast(failStr);
+                                }
+                            });
+                }
+            }
+        });
+    }
+
+    @Override
+    protected void initData() {
+        Intent intent = getIntent();
+        if (intent != null) {
+            mB2BCompanyBean = (B2BCompanyBean) intent.getSerializableExtra(Constants.FLAG.B2B_COMPANY_BEAN);
+            mSpanUtils = new SpanUtils();
+            SpannableStringBuilder companyName = mSpanUtils.append(mB2BCompanyBean.getName()).setUnderline().create();
+            mCompanyNameTextView.setText(companyName);
+        }
+
+        if (CommonUtil.isNetWorkConnected(mContext)) {
+            showLoading(null);
+            getListData(OBTAIN_PURCHASE_ORDER_LIST);
+            getListData(OBTAIN_CUSTOMER_INQUIRY_LIST);
+            getListData(OBTAIN_PUBLIC_INQUIRY_LIST);
+        } else {
+            toast(R.string.networks_out);
+        }
+
+    }
+
+    private void getListData(int flag) {
+        String host = "http://192.168.253.102:8090/platform-b2b/";
+        String url = "";
+        switch (flag) {
+            case OBTAIN_PURCHASE_ORDER_LIST:
+                url = "mobile/sale/orders/info/search";
+                break;
+            case OBTAIN_CUSTOMER_INQUIRY_LIST:
+                url = "mobile/sale/inquiry/info/search";
+                break;
+            case OBTAIN_PUBLIC_INQUIRY_LIST:
+                host = "http://218.17.158.219:24000/";
+                url = "inquiry/public/mobile";
+                break;
+        }
+        showLoading(null);
+
+        Map<String, Object> params = new HashMap<>();
+        params.put("en_uu", mB2BCompanyBean.getEnuu());
+        params.put("user_tel", MyApplication.getInstance().mLoginUser.getTelephone());
+        params.put("_state", "");
+        params.put("page", 1);
+        params.put("size", 3);
+
+        HttpRequest.getInstance().sendRequest(host,
+                new HttpParams.Builder()
+                        .url(url)
+                        .flag(flag)
+                        .method(Method.GET)
+                        .setHeaders(new HashMap<String, Object>())
+                        .setParams(params)
+                        .build(), this);
+    }
+
+    @Override
+    public void showLoading(String loadStr) {
+        if (!mRefreshLayout.isRefreshing()) {
+            progressDialog.show();
+        }
+    }
+
+    @Override
+    public void hideLoading() {
+        if (mRefreshLayout.isRefreshing()) {
+            mRefreshLayout.finishRefresh(0);
+        }
+        progressDialog.dismiss();
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (requestCode == REQUEST_PURCHASE_DETAIL
+                && resultCode == Constants.FLAG.RESULT_PURCHASE_ORDER && data != null) {
+            String purchaseStatus = data.getStringExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE);
+            B2BBusinessListBean b2BBusinessListBean = mPurchaseOrderBeans.get(mSelectPosition);
+            if (b2BBusinessListBean != null) {
+                b2BBusinessListBean.setBillState(purchaseStatus);
+                mPurchaseOrderAdapter.notifyDataSetChanged();
+            }
+        } else if (requestCode == REQUEST_CUSTOMER_DETAIL
+                && resultCode == Constants.FLAG.RESULT_CUSTOMER_INQUIRY) {
+            B2BBusinessListBean b2BBusinessListBean = mCustomerInquiryBeans.get(mSelectPosition);
+            if (b2BBusinessListBean != null) {
+                b2BBusinessListBean.setBillState(Constants.FLAG.STATE_CUSTOMER_INQUIRY_DONE);
+            }
+            mCustomerInquiryAdapter.notifyDataSetChanged();
+        } else if (requestCode == REQUEST_PUBLIC_DETAIL
+                && resultCode == Constants.FLAG.RESULT_PUBLIC_INQUIRY) {
+            /*B2BBusinessListBean b2BBusinessListBean = mPublicInquiryBeans.get(mSelectPosition);
+            if (b2BBusinessListBean != null) {
+                b2BBusinessListBean.setBillState(Constants.FLAG.STATE_PUBLIC_INQUIRY_DONE);
+            }*/
+        }
+    }
+
+    @Override
+    public void onSuccess(int flag, Object o) {
+        try {
+            String result = o.toString();
+            LogUtil.prinlnLongMsg("b2blistlogsuccess", result);
+            JSONObject resultObject = JSON.parseObject(result);
+            JSONArray contentArray = resultObject.getJSONArray("content");
+            switch (flag) {
+                case OBTAIN_PURCHASE_ORDER_LIST:
+                    isPurchaseSuccess = true;
+                    if (isCustomerSuccess && isPublicSuccess) {
+                        hideLoading();
+                    }
+                    if (contentArray == null || contentArray.size() == 0) {
+                        mPurchaseOrderBeans.clear();
+                        mPurchaseOrderAdapter.notifyDataSetChanged();
+                        return;
+                    }
+                    mPurchaseOrderBeans.clear();
+                    analysisPurchaseOrder(contentArray);
+                    break;
+                case OBTAIN_CUSTOMER_INQUIRY_LIST:
+                    isCustomerSuccess = true;
+                    if (isPurchaseSuccess && isPublicSuccess) {
+                        hideLoading();
+                    }
+                    if (contentArray == null || contentArray.size() == 0) {
+                        mCustomerInquiryBeans.clear();
+                        mCustomerInquiryAdapter.notifyDataSetChanged();
+                        return;
+                    }
+                    mCustomerInquiryBeans.clear();
+                    analysisCustomerInquiry(contentArray);
+                    break;
+                case OBTAIN_PUBLIC_INQUIRY_LIST:
+                    isPublicSuccess = true;
+                    if (isCustomerSuccess && isPurchaseSuccess) {
+                        hideLoading();
+                    }
+                    if (contentArray == null || contentArray.size() == 0) {
+                        mPublicInquiryBeans.clear();
+                        mPublicInquiryAdapter.notifyDataSetChanged();
+                        return;
+                    }
+                    mPublicInquiryBeans.clear();
+                    analisisPublicInquiry(contentArray);
+                    break;
+                default:
+                    break;
+            }
+        } catch (Exception e) {
+
+        }
+
+    }
+
+    private void analisisPublicInquiry(JSONArray contentArray) {
+        for (int i = 0; i < contentArray.size(); i++) {
+            JSONObject contentObject = contentArray.getJSONObject(i);
+            if (contentObject != null) {
+                B2BBusinessListBean b2BBusinessListBean = new B2BBusinessListBean();
+                b2BBusinessListBean.setJsonData(contentObject.toString());
+                b2BBusinessListBean.setItemType(B2BBusinessListBean.PUBLIC_INQUIRY_LIST);
+                b2BBusinessListBean.setId(JSONUtil.getText(contentObject, "id"));
+
+                long date = contentObject.getLongValue("date");
+                if (date != 0) {
+                    b2BBusinessListBean.setBillDate(DateFormatUtil.long2Str(date, DateFormatUtil.YMD));
+                }
+                JSONObject inquiryObject = contentObject.getJSONObject("inquiry");
+                JSONObject productObject = contentObject.getJSONObject("product");
+
+                if (productObject != null) {
+                    b2BBusinessListBean.setProductName(JSONUtil.getText(productObject, "title"));
+                    b2BBusinessListBean.setProductModel(JSONUtil.getText(productObject, "code"));
+                    b2BBusinessListBean.setProductSpecification(JSONUtil.getText(productObject, "spec"));
+                    b2BBusinessListBean.setProductBrand(JSONUtil.getText(productObject, "brand"));
+                }
+                if (inquiryObject != null) {
+                    JSONObject enterpriseObject = inquiryObject.getJSONObject("enterprise");
+                    if (enterpriseObject != null) {
+                        b2BBusinessListBean.setCompanyName(JSONUtil.getText(enterpriseObject, "enName"));
+                    }
+
+                    long endDate = inquiryObject.getLongValue("endDate");
+                    if (endDate != 0) {
+                        b2BBusinessListBean.setExpiryDate(DateFormatUtil.long2Str(endDate, DateFormatUtil.YMD));
+                    }
+                }
+                String invalid = JSONUtil.getText(contentObject, "invalid");
+                String overdue = JSONUtil.getText(contentObject, "overdue");
+                String status = JSONUtil.getText(contentObject, "status");
+                if ("1".equals(invalid) || "1".equals(overdue) || "201".equals(status)) {
+                    b2BBusinessListBean.setBillState(Constants.FLAG.STATE_PUBLIC_INQUIRY_DONE);
+                } else {
+                    b2BBusinessListBean.setBillState(Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO);
+                }
+                mPublicInquiryBeans.add(b2BBusinessListBean);
+            }
+        }
+        mPublicInquiryAdapter.notifyDataSetChanged();
+    }
+
+    private void analysisCustomerInquiry(JSONArray contentArray) {
+        for (int i = 0; i < contentArray.size(); i++) {
+            JSONObject contentObject = contentArray.getJSONObject(i);
+            if (contentObject != null) {
+                B2BBusinessListBean b2BBusinessListBean = new B2BBusinessListBean();
+                b2BBusinessListBean.setJsonData(contentObject.toString());
+                b2BBusinessListBean.setItemType(B2BBusinessListBean.CUSTOMER_INQUIRY_LIST);
+                b2BBusinessListBean.setId(JSONUtil.getText(contentObject, "id"));
+
+                JSONObject inquiryObject = contentObject.getJSONObject("inquiry");
+                JSONObject productObject = contentObject.getJSONObject("product");
+                if (inquiryObject != null) {
+                    JSONObject enterpriseObject = inquiryObject.getJSONObject("enterprise");
+                    if (enterpriseObject != null) {
+                        b2BBusinessListBean.setCompanyName(JSONUtil.getText(enterpriseObject, "enName"));
+                    }
+                    b2BBusinessListBean.setBillNum(JSONUtil.getText(inquiryObject, "code"));
+
+                    long endDate = inquiryObject.getLongValue("endDate");
+                    if (endDate != 0) {
+                        b2BBusinessListBean.setExpiryDate(DateFormatUtil.long2Str(endDate, DateFormatUtil.YMD));
+                    }
+                }
+                if (productObject != null) {
+                    b2BBusinessListBean.setMaterialNum(JSONUtil.getText(productObject, "code"));
+                    b2BBusinessListBean.setMaterialName(JSONUtil.getText(productObject, "title"));
+                    b2BBusinessListBean.setMaterialSpec(JSONUtil.getText(productObject, "spec"));
+                }
+                long date = contentObject.getLongValue("date");
+                if (date != 0) {
+                    b2BBusinessListBean.setBillDate(DateFormatUtil.long2Str(date, DateFormatUtil.YMD));
+                }
+
+                String invalid = JSONUtil.getText(contentObject, "invalid");
+                if ("1".equals(invalid)) {
+                    b2BBusinessListBean.setBillState(Constants.FLAG.STATE_CUSTOMER_INQUIRY_INVALID);
+                } else {
+                    String overdue = JSONUtil.getText(contentObject, "overdue");
+                    if ("1".equals(overdue)) {
+                        b2BBusinessListBean.setBillState(Constants.FLAG.STATE_CUSTOMER_INQUIRY_END);
+                    } else {
+                        String agreed = JSONUtil.getText(contentObject, "agreed");
+                        if ("1".equals(agreed)) {
+                            b2BBusinessListBean.setBillState(Constants.FLAG.STATE_CUSTOMER_INQUIRY_AGREED);
+                        } else if ("0".equals(agreed)) {
+                            b2BBusinessListBean.setBillState(Constants.FLAG.STATE_CUSTOMER_INQUIRY_REFUSED);
+                        } else {
+                            String status = JSONUtil.getText(contentObject, "status");
+                            if ("200".equals(status)) {
+                                b2BBusinessListBean.setBillState(Constants.FLAG.STATE_CUSTOMER_INQUIRY_TODO);
+                            } else if ("201".equals(status)) {
+                                b2BBusinessListBean.setBillState(Constants.FLAG.STATE_CUSTOMER_INQUIRY_DONE);
+                            }
+                        }
+                    }
+                }
+
+                mCustomerInquiryBeans.add(b2BBusinessListBean);
+            }
+        }
+        mCustomerInquiryAdapter.notifyDataSetChanged();
+    }
+
+    private void analysisPurchaseOrder(JSONArray contentArray) {
+        for (int i = 0; i < contentArray.size(); i++) {
+            JSONObject contentObject = contentArray.getJSONObject(i);
+            if (contentObject != null) {
+                B2BBusinessListBean b2BBusinessListBean = new B2BBusinessListBean();
+                b2BBusinessListBean.setJsonData(contentObject.toString());
+                b2BBusinessListBean.setItemType(B2BBusinessListBean.PURCHASE_ORDER_LIST);
+                b2BBusinessListBean.setId(JSONUtil.getText(contentObject, "id"));
+
+                JSONObject enterprise = contentObject.getJSONObject("enterprise");
+                if (enterprise != null) {
+                    b2BBusinessListBean.setCompanyName(JSONUtil.getText(enterprise, "enName"));
+                }
+
+                long date = contentObject.getLongValue("date");
+                if (date != 0) {
+                    b2BBusinessListBean.setBillDate(DateFormatUtil.long2Str(date, DateFormatUtil.YMD));
+                }
+                b2BBusinessListBean.setBillNum(JSONUtil.getText(contentObject, "code"));
+                b2BBusinessListBean.setCurrency(JSONUtil.getText(contentObject, "currency"));
+
+                JSONArray orderItems = contentObject.getJSONArray("orderItems");
+                if (orderItems == null || orderItems.size() == 0) {
+                    b2BBusinessListBean.setMoney("0");
+                } else {
+                    double money = 0;
+                    for (int j = 0; j < orderItems.size(); j++) {
+                        JSONObject orderItem = orderItems.getJSONObject(j);
+                        double amount = JSONUtil.getDouble(orderItem, "amount");
+                        money += amount;
+                    }
+                    b2BBusinessListBean.setMoney(CommonUtil.doubleFormat(money));
+                }
+                String end = JSONUtil.getText(contentObject, "end");
+                if (!TextUtils.isEmpty(end) && "1".equals(end)) {
+                    b2BBusinessListBean.setBillState(Constants.FLAG.STATE_PURCHASE_ORDER_END);
+                } else {
+                    String status = JSONUtil.getText(contentObject, "status");
+                    if ("200".equals(status)) {
+                        b2BBusinessListBean.setBillState(Constants.FLAG.STATE_PURCHASE_ORDER_TODO);
+                    } else if ("201".equals(status)) {
+                        b2BBusinessListBean.setBillState(Constants.FLAG.STATE_PURCHASE_ORDER_DONE);
+                    }
+                }
+
+                mPurchaseOrderBeans.add(b2BBusinessListBean);
+            }
+        }
+        mPurchaseOrderAdapter.notifyDataSetChanged();
+    }
+
+    @Override
+    public void onFail(int flag, String failStr) {
+        try {
+            if (!CommonUtil.isRepeatClick(2000)) {
+                toast(failStr);
+            }
+            switch (flag) {
+                case OBTAIN_PURCHASE_ORDER_LIST:
+                    isPurchaseSuccess = true;
+                    if (isCustomerSuccess && isPublicSuccess) {
+                        hideLoading();
+                    }
+                    break;
+                case OBTAIN_CUSTOMER_INQUIRY_LIST:
+                    isCustomerSuccess = true;
+                    if (isPurchaseSuccess && isPublicSuccess) {
+                        hideLoading();
+                    }
+                    break;
+                case OBTAIN_PUBLIC_INQUIRY_LIST:
+                    isPublicSuccess = true;
+                    if (isCustomerSuccess && isPurchaseSuccess) {
+                        hideLoading();
+                    }
+                    break;
+                default:
+                    break;
+            }
+        } catch (Exception e) {
+
+        }
+
+    }
+
+    @Override
+    public void onClick(View view) {
+        int i = view.getId();
+        if (i == R.id.b2b_company_back) {
+            onBackPressed();
+        } else if (i == R.id.b2b_company_name) {
+            popAccountList();
+        } else if (i == R.id.b2b_business_main_purchase_order_iv
+                || i == R.id.b2b_business_main_purchase_order_all_tv) {
+            startActivity(PurchaseOrderListActivity.class);
+        } else if (i == R.id.b2b_business_main_customer_inquiry_iv
+                || i == R.id.b2b_business_main_customer_inquiry_all_tv) {
+            startActivity(CustomerInquiryListActivity.class);
+        } else if (i == R.id.b2b_business_main_public_inquiry_iv
+                || i == R.id.b2b_business_main_public_inquiry_all_tv) {
+            startActivity(PublicInquiryListActivity.class);
+        } else if (i == R.id.b2b_change_account_sure_tv) {
+            if (CommonUtil.isNetWorkConnected(mContext)) {
+                for (B2BCompanyBean b2BCompanyBean : mB2BCompanyBeans) {
+                    if (b2BCompanyBean.isSelected()) {
+                        mB2BCompanyBean = b2BCompanyBean;
+                        break;
+                    }
+                }
+                CommonUtil.setSharedPreferences(mContext, Constants.CACHE.B2B_BUSINESS_ENUU, mB2BCompanyBean.getEnuu());
+                mSpanUtils = new SpanUtils();
+                SpannableStringBuilder companyName = mSpanUtils.append(mB2BCompanyBean.getName()).setUnderline().create();
+                mCompanyNameTextView.setText(companyName);
+                mAccountDialog.dismiss();
+
+                isPurchaseSuccess = false;
+                isCustomerSuccess = false;
+                isPublicSuccess = false;
+                showLoading(null);
+                getListData(OBTAIN_PURCHASE_ORDER_LIST);
+                getListData(OBTAIN_CUSTOMER_INQUIRY_LIST);
+                getListData(OBTAIN_PUBLIC_INQUIRY_LIST);
+            } else {
+                toast(R.string.networks_out);
+            }
+
+        } else if (i == R.id.b2b_change_account_cancel_tv) {
+            mAccountDialog.dismiss();
+        }
+    }
+
+    private void popAccountList() {
+        if (mB2BCompanyBeans == null || mB2BCompanyBeans.size() == 0) {
+            getB2BCompanys();
+        }
+        if (mB2BCompanyBeans == null || mB2BCompanyBeans.size() == 0) {
+            toast("您的账号未绑定任何B2B账套");
+        } else {
+            for (B2BCompanyBean b2BCompanyBean : mB2BCompanyBeans) {
+                String enuu = b2BCompanyBean.getEnuu();
+                if (enuu != null && enuu.equals(mB2BCompanyBean.getEnuu())) {
+                    b2BCompanyBean.setSelected(true);
+                } else {
+                    b2BCompanyBean.setSelected(false);
+                }
+            }
+            mB2BAccountAdapter.notifyDataSetChanged();
+            mAccountDialog.show();
+        }
+    }
+
+    private void getB2BCompanys() {
+        String companyJson = CommonUtil.getSharedPreferences(this, "loginJson");
+        if (JSONUtil.validate(companyJson)) {
+            JSONArray companyArray = JSON.parseArray(companyJson);
+            if (companyArray != null && companyArray.size() > 0) {
+                for (int i = 0; i < companyArray.size(); i++) {
+                    JSONObject companyObject = companyArray.getJSONObject(i);
+                    if (companyObject != null) {
+                        String platform = JSONUtil.getText(companyObject, "platform");
+                        if ("B2B".equals(platform)) {
+                            JSONArray spacesArray = companyObject.getJSONArray("spaces");
+                            if (spacesArray != null && spacesArray.size() > 0) {
+                                for (int j = 0; j < spacesArray.size(); j++) {
+                                    JSONObject spacesObject = spacesArray.getJSONObject(j);
+                                    if (spacesObject != null) {
+                                        String name = JSONUtil.getText(spacesObject, "name");
+                                        B2BCompanyBean b2BCompanyBean = new B2BCompanyBean();
+                                        b2BCompanyBean.setId(JSONUtil.getInt(spacesObject, "id"));
+                                        b2BCompanyBean.setEnuu(JSONUtil.getText(spacesObject, "enuu"));
+                                        b2BCompanyBean.setBusinessCode(JSONUtil.getText(spacesObject, "businessCode"));
+                                        b2BCompanyBean.setName(name);
+                                        if (mB2BCompanyBean != null && name.equals(mB2BCompanyBean.getName())) {
+                                            b2BCompanyBean.setSelected(true);
+                                        } else {
+                                            b2BCompanyBean.setSelected(false);
+                                        }
+
+                                        mB2BCompanyBeans.add(b2BCompanyBean);
+                                    }
+                                }
+                            }
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+}

+ 500 - 0
app_modular/appworks/src/main/java/com/uas/appworks/activity/CustomerInquiryDetailActivity.java

@@ -0,0 +1,500 @@
+package com.uas.appworks.activity;
+
+import android.content.Intent;
+import android.os.Handler;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageView;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.annotation.JSONField;
+import com.common.LogUtil;
+import com.common.data.JSONUtil;
+import com.core.app.Constants;
+import com.core.app.MyApplication;
+import com.core.base.activity.BaseMVPActivity;
+import com.core.utils.CommonUtil;
+import com.me.network.app.base.HttpCallback;
+import com.me.network.app.base.HttpParams;
+import com.me.network.app.http.HttpRequest;
+import com.me.network.app.http.Method;
+import com.uas.appworks.R;
+import com.uas.appworks.adapter.B2BDetailListAdapter;
+import com.uas.appworks.adapter.B2BQuotePriceAdapter;
+import com.uas.appworks.model.bean.B2BDetailListBean;
+import com.uas.appworks.model.bean.B2BQuotePriceBean;
+import com.uas.appworks.presenter.WorkPlatPresenter;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author RaoMeng
+ * @describe 客户询价单详情页
+ * @date 2018/1/16 16:46
+ */
+
+public class CustomerInquiryDetailActivity extends BaseMVPActivity<WorkPlatPresenter> implements View.OnClickListener, HttpCallback {
+    private final int CUSTOMER_INQUIRY_REPLY = 0x14;
+    private final int CUSTOMER_INQUIRY_DETAIL = 0x15;
+    private final int PUBLIC_INQUIRY_DETAIL = 0x16;
+
+    private RecyclerView mDataRecyclerView, mQuoteRecyclerView;
+    private ImageView mAddImageView;
+    private Button mQuoteButton;
+    private B2BDetailListAdapter mB2BDetailListAdapter;
+    private List<B2BDetailListBean> mB2BDetailListBeans;
+    private B2BQuotePriceAdapter mB2BQuotePriceAdapter;
+    private List<B2BQuotePriceBean> mB2BQuotePriceBeans;
+
+    private String mId, mState = "", mJson;
+    private String mEnuu;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.activity_customer_inquiry_detail;
+    }
+
+    @Override
+    protected void initView() {
+
+        mDataRecyclerView = $(R.id.customer_inquiry_detail_data_rv);
+        mQuoteRecyclerView = $(R.id.customer_inquiry_detail_quote_rv);
+        mAddImageView = $(R.id.customer_inquiry_detail_add_iv);
+        mQuoteButton = $(R.id.customer_inquiry_detail_quote_btn);
+
+        mDataRecyclerView.setLayoutManager(new LinearLayoutManager(mContext));
+        mDataRecyclerView.setNestedScrollingEnabled(false);
+        mQuoteRecyclerView.setLayoutManager(new LinearLayoutManager(mContext));
+        mQuoteRecyclerView.setNestedScrollingEnabled(false);
+
+        mB2BDetailListBeans = new ArrayList<>();
+        mB2BDetailListAdapter = new B2BDetailListAdapter(mContext, mB2BDetailListBeans);
+        mDataRecyclerView.setAdapter(mB2BDetailListAdapter);
+
+        mB2BQuotePriceBeans = new ArrayList<>();
+        mB2BQuotePriceAdapter = new B2BQuotePriceAdapter(mContext, mB2BQuotePriceBeans);
+        mQuoteRecyclerView.setAdapter(mB2BQuotePriceAdapter);
+
+        Intent intent = getIntent();
+        if (intent != null) {
+            mId = intent.getStringExtra(Constants.FLAG.EXTRA_B2B_LIST_ID);
+            mState = intent.getStringExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE);
+            mJson = intent.getStringExtra(Constants.FLAG.EXTRA_B2B_LIST_JSON);
+            mEnuu = intent.getStringExtra(Constants.FLAG.EXTRA_B2B_LIST_ENUU);
+
+            if (mState != null) {
+                switch (mState) {
+                    case Constants.FLAG.STATE_CUSTOMER_INQUIRY_TODO:
+                        getSupportActionBar().setTitle(R.string.str_wait_quoted);
+                        initEditable(true, View.VISIBLE);
+                        break;
+                    case Constants.FLAG.STATE_CUSTOMER_INQUIRY_DONE:
+                        getSupportActionBar().setTitle(R.string.str_quoted_price);
+                        if (mJson != null && JSONUtil.validate(mJson)) {
+                            JSONObject detailObject = JSON.parseObject(mJson);
+                            JSONObject inquiryObject = detailObject.getJSONObject("inquiry");
+                            String checked = JSONUtil.getText(inquiryObject, "checked");
+                            String overdue = JSONUtil.getText(inquiryObject, "overdue");
+                            if (!"1".equals(checked) || "0".equals(overdue)) {
+                                initEditable(true, View.VISIBLE);
+                                mQuoteButton.setText(R.string.modify_quote_price);
+                            } else {
+                                initEditable(false, View.GONE);
+                            }
+                        } else {
+                            initEditable(false, View.GONE);
+                        }
+                        break;
+                    case Constants.FLAG.STATE_CUSTOMER_INQUIRY_AGREED:
+                        getSupportActionBar().setTitle(R.string.str_quotation_adopted);
+                        initEditable(false, View.GONE);
+                        break;
+                    case Constants.FLAG.STATE_CUSTOMER_INQUIRY_END:
+                        getSupportActionBar().setTitle(R.string.str_expired);
+                        initEditable(false, View.GONE);
+                        break;
+                    case Constants.FLAG.STATE_CUSTOMER_INQUIRY_REFUSED:
+                        getSupportActionBar().setTitle(R.string.str_quotation_unadopted);
+                        initEditable(false, View.GONE);
+                        break;
+                    case Constants.FLAG.STATE_CUSTOMER_INQUIRY_INVALID:
+                        getSupportActionBar().setTitle(R.string.str_invalid);
+                        initEditable(false, View.GONE);
+                        break;
+                    case Constants.FLAG.STATE_CUSTOMER_INQUIRY_ABANDONED:
+                        getSupportActionBar().setTitle(R.string.str_abandoned);
+                        initEditable(false, View.GONE);
+                        break;
+                    case Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO:
+                        getSupportActionBar().setTitle(R.string.str_wait_quoted);
+                        initEditable(true, View.VISIBLE);
+                        break;
+                    default:
+                        initEditable(false, View.GONE);
+                        break;
+                }
+            }
+        }
+
+        if (TextUtils.isEmpty(mEnuu)) {
+            mEnuu = CommonUtil.getSharedPreferences(mContext, Constants.CACHE.B2B_BUSINESS_ENUU);
+        }
+    }
+
+    private void initEditable(boolean editable, int visible) {
+        mB2BDetailListAdapter.setEditable(editable);
+        mB2BQuotePriceAdapter.setEditable(editable);
+        mAddImageView.setEnabled(editable);
+
+        mQuoteButton.setVisibility(visible);
+    }
+
+    @Override
+    protected WorkPlatPresenter initPresenter() {
+        return null;
+    }
+
+    @Override
+    protected void initEvent() {
+        mAddImageView.setOnClickListener(this);
+
+        mQuoteButton.setOnClickListener(this);
+    }
+
+    @Override
+    protected void initData() {
+        if (mJson != null && JSONUtil.validate(mJson)) {
+            initDetailData(mJson);
+        } else {
+            showLoading(null);
+
+            Map<String, Object> params = new HashMap<>();
+            params.put("en_uu", mEnuu);
+            params.put("user_tel", MyApplication.getInstance().mLoginUser.getTelephone());
+            params.put("id", mId);
+            params.put("itemId", mId);
+
+            String host = "http://192.168.253.102:8090/platform-b2b/";
+            String url = "mobile/sale/inquiry/" + mId + "/info";
+            int flag = CUSTOMER_INQUIRY_DETAIL;
+            if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)) {
+                host = "http://218.17.158.219:24000/";
+                url = "inquiry/sale/publicInquiry/detail";
+                flag = PUBLIC_INQUIRY_DETAIL;
+            }
+            HttpRequest.getInstance().sendRequest(host
+                    , new HttpParams.Builder()
+                            .url(url)
+                            .method(Method.GET)
+                            .flag(flag)
+                            .setHeaders(new HashMap<String, Object>())
+                            .setParams(params).build(), this);
+
+        }
+    }
+
+    private void initDetailData(String detail) {
+        if (detail != null && JSONUtil.validate(detail)) {
+            mB2BDetailListBeans.clear();
+            mB2BQuotePriceBeans.clear();
+
+            JSONObject detailObject = JSON.parseObject(detail);
+            JSONObject inquiryObject = detailObject.getJSONObject("inquiry");
+            JSONObject productObject = detailObject.getJSONObject("product");
+            if (inquiryObject == null) {
+                inquiryObject = JSON.parseObject("");
+            }
+            JSONObject enterpriseObject = inquiryObject.getJSONObject("enterprise");
+            JSONObject recorderUser = inquiryObject.getJSONObject("recorderUser");
+
+            String customer = JSONUtil.getText(enterpriseObject, "enName");//客户
+            String customerAddress = JSONUtil.getText(enterpriseObject, "enAddress");//客户地址
+
+            String userTel = "";
+            if (recorderUser != null) {
+                userTel = JSONUtil.getText(recorderUser, "userTel");//客户联系电话
+            }
+            String billNum = JSONUtil.getText(inquiryObject, "code");//单据
+
+            String material = "";
+            if (productObject != null) {
+                String title = JSONUtil.getText(productObject, "title");
+                String spec = JSONUtil.getText(productObject, "spec");
+                String code = JSONUtil.getText(productObject, "code");
+                material = code + (TextUtils.isEmpty(title) ? "" : (",\n" + title)
+                        + (TextUtils.isEmpty(spec) ? "" : (",\n" + spec)));//物料
+            }
+
+            String currency = JSONUtil.getText(detailObject, "currency");//币别
+            String taxrate = JSONUtil.getText(detailObject, "taxrate");//税率
+            String environment = JSONUtil.getText(inquiryObject, "environment");//环保要求
+            String priceType = JSONUtil.getText(inquiryObject, "priceType");//价格类型
+
+            String leadtime = JSONUtil.getText(detailObject, "leadtime");//交货周期
+            String minOrderQty = JSONUtil.getText(detailObject, "minOrderQty");//最小起订
+            String minPackQty = JSONUtil.getText(detailObject, "minPackQty");//最小包装
+
+            mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT, getString(R.string.customer_inquiry_customer), customer, "", "客户", ""));
+            mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT, getString(R.string.customer_inquiry_customer_address), customerAddress, "", "客户地址", ""));
+            mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT, getString(R.string.customer_inquiry_customer_phone), userTel, "", "联系电话", ""));
+            mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT, getString(R.string.customer_inquiry_bill_num), billNum, "", "单据", ""));
+            mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT, getString(R.string.customer_inquiry_material), material, "", "物料", ""));
+            mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT, getString(R.string.customer_inquiry_currency), currency, "", "币别", ""));
+            mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT, getString(R.string.customer_inquiry_taxrate), taxrate, "", "税率", ""));
+            mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT, getString(R.string.customer_inquiry_environment), environment, "", "环保要求", ""));
+            mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT, getString(R.string.customer_inquiry_price_type), priceType, "", "价格类型", ""));
+
+            mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_EDIT, getString(R.string.customer_inquiry_leadtime), leadtime, "天", "leadtime", ""));
+            mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_EDIT, getString(R.string.customer_inquiry_min_order), minOrderQty, "PCS", "minOrderQty", ""));
+            mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_EDIT, getString(R.string.customer_inquiry_min_pack), minPackQty, "PCS", "minPackQty", ""));
+
+            mB2BDetailListAdapter.notifyDataSetChanged();
+
+            JSONArray replies = detailObject.getJSONArray("replies");
+            if (replies != null && replies.size() > 0) {
+                for (int i = 0; i < replies.size(); i++) {
+                    JSONObject replyObject = replies.getJSONObject(i);
+                    long id = JSONUtil.getLong(replyObject, "id");
+                    String amount = JSONUtil.getText(replyObject, "lapQty");
+                    String price = JSONUtil.getText(replyObject, "price");
+
+                    mB2BQuotePriceBeans.add(createB2BQuotePriceBean(id, amount, price));
+                }
+            } else {
+                mB2BQuotePriceBeans.add(createB2BQuotePriceBean(0, "", ""));
+            }
+            mB2BQuotePriceAdapter.notifyDataSetChanged();
+        }
+    }
+
+    private B2BDetailListBean createB2BDetailListBean(int itemType,
+                                                      String caption,
+                                                      String value,
+                                                      String unit,
+                                                      String flag,
+                                                      String type) {
+        B2BDetailListBean b2BDetailListBean = new B2BDetailListBean();
+
+        b2BDetailListBean.setItemType(itemType);
+        b2BDetailListBean.setCaption(caption);
+        b2BDetailListBean.setFlag(flag);
+        b2BDetailListBean.setValue(value);
+        b2BDetailListBean.setType(type);
+        b2BDetailListBean.setUnit(unit);
+
+        return b2BDetailListBean;
+    }
+
+    private B2BQuotePriceBean createB2BQuotePriceBean(long id, String amount, String price) {
+        B2BQuotePriceBean b2BQuotePriceBean = new B2BQuotePriceBean();
+
+        b2BQuotePriceBean.setId(id);
+        b2BQuotePriceBean.setAmount(amount);
+        b2BQuotePriceBean.setPrice(price);
+
+        return b2BQuotePriceBean;
+    }
+
+    @Override
+    public void showLoading(String loadStr) {
+        progressDialog.show();
+    }
+
+    @Override
+    public void hideLoading() {
+        progressDialog.dismiss();
+    }
+
+    @Override
+    public void onClick(View view) {
+        int i = view.getId();
+        if (i == R.id.customer_inquiry_detail_add_iv) {
+            mB2BQuotePriceBeans.add(createB2BQuotePriceBean(0, "", ""));
+            mB2BQuotePriceAdapter.notifyDataSetChanged();
+        } else if (i == R.id.customer_inquiry_detail_quote_btn) {
+            List<B2BQuotePriceBean> b2BQuotePriceBeans = mB2BQuotePriceAdapter.getB2BQuotePriceBeans();
+            List<B2BDetailListBean> b2BDetailListBeans = mB2BDetailListAdapter.getB2BDetailListBeans();
+
+            String leadtime = "", minPackQty = "", minOrderQty = "";
+            for (B2BDetailListBean b2BDetailListBean : b2BDetailListBeans) {
+                String flag = b2BDetailListBean.getFlag();
+                if ("leadtime".equals(flag)) {
+                    leadtime = b2BDetailListBean.getValue();
+                    if (TextUtils.isEmpty(leadtime)) {
+                        toast(getString(R.string.delivery_period_can_not_be_empty));
+                    }
+                }
+                if ("minPackQty".equals(flag)) {
+                    minPackQty = b2BDetailListBean.getValue();
+                }
+                if ("minOrderQty".equals(flag)) {
+                    minOrderQty = b2BDetailListBean.getValue();
+                }
+            }
+            List<Reply> replies = new ArrayList<>();
+            for (B2BQuotePriceBean b2BQuotePriceBean : b2BQuotePriceBeans) {
+                Reply reply = new Reply();
+                String amount = b2BQuotePriceBean.getAmount();
+                String price = b2BQuotePriceBean.getPrice();
+
+                if (TextUtils.isEmpty(amount) || TextUtils.isEmpty(price)) {
+                    toast(getString(R.string.unfilled_items_in_subsection_quotation));
+                    return;
+                }
+                reply.setLapQty(amount);
+                reply.setPrice(price);
+
+                replies.add(reply);
+            }
+
+            String repliesJson = JSON.toJSONString(replies);
+
+            Map<String, Object> params = new HashMap<>();
+            params.put("en_uu", mEnuu);
+            params.put("user_tel", MyApplication.getInstance().mLoginUser.getTelephone());
+            params.put("inquiryItemId", mId);
+            params.put("replies", repliesJson);
+            params.put("leadtime", leadtime);
+            params.put("minPackQty", minPackQty);
+            params.put("minOrderQty", minOrderQty);
+
+            params.put("useruu", "1000002503");
+
+
+            showLoading(null);
+            String url = "mobile/sale/inquiry/items/" + mId + "/reply";
+            String host = "http://192.168.253.102:8090/platform-b2b/";
+            if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)) {
+                url = "inquiry/sale/mobile/quote";
+                host = "http://192.168.253.192:8080/";
+            }
+            HttpRequest.getInstance().sendRequest(host
+                    , new HttpParams.Builder()
+                            .url(url)
+                            .method(Method.POST)
+                            .flag(CUSTOMER_INQUIRY_REPLY)
+                            .setHeaders(new HashMap<String, Object>())
+                            .setParams(params).build(), this);
+        }
+    }
+
+    @Override
+    public void onSuccess(int flag, Object o) {
+        hideLoading();
+        String result = o.toString();
+        LogUtil.prinlnLongMsg("customerdetailsuccess", result);
+        if (flag == CUSTOMER_INQUIRY_REPLY) {
+            getSupportActionBar().setTitle(R.string.str_quoted_price);
+            toast(getString(R.string.quote_success));
+            String publicId = "";
+            if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)) {
+                setResult(Constants.FLAG.RESULT_PUBLIC_INQUIRY);
+                initEditable(false, View.GONE);
+                if (JSONUtil.validate(result)) {
+                    JSONObject publicObject = JSON.parseObject(result);
+                    publicId = JSONUtil.getText(publicObject, "content");
+                }
+            } else {
+                setResult(Constants.FLAG.RESULT_CUSTOMER_INQUIRY);
+            }
+
+            initEditable(false, View.GONE);
+            new Handler().postDelayed(new Runnable() {
+                @Override
+                public void run() {
+                    finish();
+                }
+            }, 1000);
+
+            /*Map<String, Object> params = new HashMap<>();
+            params.put("en_uu", mEnuu);
+            params.put("user_tel", MyApplication.getInstance().mLoginUser.getTelephone());
+            if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)) {
+                params.put("itemId", publicId);
+            } else {
+                params.put("itemId", mId);
+            }
+
+            String url = "mobile/sale/inquiry/" + mId + "/info";
+            String host = "http://192.168.253.102:8090/platform-b2b/";
+            if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)) {
+                url = "inquiry/sale/inquiry/detail";
+                host = "http://218.17.158.219:24000/";
+            }
+            HttpRequest.getInstance().sendRequest(host
+                    , new HttpParams.Builder()
+                            .url(url)
+                            .method(Method.GET)
+                            .flag(CUSTOMER_INQUIRY_DETAIL)
+                            .setHeaders(new HashMap<String, Object>())
+                            .setParams(params).build(), this);*/
+        } else if (flag == CUSTOMER_INQUIRY_DETAIL) {
+
+            if (result != null && JSONUtil.validate(result)
+                    && (Constants.FLAG.STATE_CUSTOMER_INQUIRY_TODO.equals(mState)
+                    || Constants.FLAG.STATE_CUSTOMER_INQUIRY_DONE.equals(mState))) {
+                JSONObject contentObject = JSON.parseObject(result);
+                JSONObject inquiryObject = contentObject.getJSONObject("inquiry");
+                String checked = JSONUtil.getText(inquiryObject, "checked");
+                String overdue = JSONUtil.getText(inquiryObject, "overdue");
+                if (!"1".equals(checked) || "0".equals(overdue)) {
+                    initEditable(true, View.VISIBLE);
+                } else {
+                    initEditable(false, View.GONE);
+                }
+            } else {
+                initEditable(false, View.GONE);
+            }
+            initDetailData(result);
+
+        } else if (flag == PUBLIC_INQUIRY_DETAIL) {
+
+            initEditable(true, View.VISIBLE);
+            initDetailData(result);
+        }
+    }
+
+    @Override
+    public void onFail(int flag, String failStr) {
+        hideLoading();
+        LogUtil.prinlnLongMsg("customerdetailfail", failStr);
+        toast(failStr);
+    }
+
+    class Reply {
+
+        /**
+         * lapQty : 10
+         * price : 8.88
+         */
+
+        @JSONField(name = "lapQty")
+        private String lapQty;
+        @JSONField(name = "price")
+        private String price;
+
+        public String getLapQty() {
+            return lapQty;
+        }
+
+        public void setLapQty(String lapQty) {
+            this.lapQty = lapQty;
+        }
+
+        public String getPrice() {
+            return price;
+        }
+
+        public void setPrice(String price) {
+            this.price = price;
+        }
+    }
+}

+ 176 - 0
app_modular/appworks/src/main/java/com/uas/appworks/activity/CustomerInquiryListActivity.java

@@ -0,0 +1,176 @@
+package com.uas.appworks.activity;
+
+import android.support.v4.app.Fragment;
+import android.support.v4.view.ViewPager;
+import android.support.v7.app.ActionBar;
+import android.text.TextUtils;
+
+import com.core.app.Constants;
+import com.core.base.activity.BaseMVPActivity;
+import com.core.utils.CommonUtil;
+import com.core.widget.SearchActionView;
+import com.uas.appworks.R;
+import com.uas.appworks.adapter.TabViewpagerAdapter;
+import com.uas.appworks.fragment.B2BBusinessListFragment;
+import com.uas.appworks.model.bean.B2BBusinessListBean;
+import com.uas.appworks.presenter.WorkPlatPresenter;
+import com.uas.appworks.view.WorkPlatView;
+import com.viewpagerindicator.TabPageIndicator;
+import com.viewpagerindicator.UnderlinePageIndicator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author RaoMeng
+ * @describe 客户询价单列表页面
+ * @date 2018/1/15 10:09
+ */
+
+public class CustomerInquiryListActivity extends BaseMVPActivity<WorkPlatPresenter> implements WorkPlatView {
+
+    private TabPageIndicator mTabPageIndicator;
+    private UnderlinePageIndicator mUnderlinePageIndicator;
+    private List<Fragment> mFragments;
+    private TabViewpagerAdapter mTabViewpagerAdapter;
+    private ViewPager mViewPager;
+    private List<String> mTitleStrings;
+    private SearchActionView mSearchActionView;
+
+    private B2BBusinessListFragment mAllFragment, mWaitQuotedFragment, mQuotedPriceFragment, mQuotationAdoptedFragment, mInvalidFragment;
+    private String mKeyWord;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.activity_tab_viewpager;
+    }
+
+    @Override
+    protected void initView() {
+        mSearchActionView = new SearchActionView(mContext);
+        ActionBar bar = this.getSupportActionBar();
+        bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
+        bar.setCustomView(mSearchActionView);
+        mSearchActionView.setSearchHint(R.string.str_customer_inquiry_list);
+
+        mTabPageIndicator = (TabPageIndicator) findViewById(R.id.tab_viewpager_tab);
+        mUnderlinePageIndicator = (UnderlinePageIndicator) findViewById(R.id.tab_viewpager_undertab);
+        mViewPager = (ViewPager) findViewById(R.id.tab_viewpager_vp);
+
+        mAllFragment = new B2BBusinessListFragment();
+        mWaitQuotedFragment = new B2BBusinessListFragment();
+        mQuotedPriceFragment = new B2BBusinessListFragment();
+        mQuotationAdoptedFragment = new B2BBusinessListFragment();
+        mInvalidFragment = new B2BBusinessListFragment();
+
+        mAllFragment.setListType(B2BBusinessListBean.CUSTOMER_INQUIRY_LIST);
+        mWaitQuotedFragment.setListType(B2BBusinessListBean.CUSTOMER_INQUIRY_LIST);
+        mWaitQuotedFragment.setListState(Constants.FLAG.STATE_CUSTOMER_INQUIRY_TODO);
+        mQuotedPriceFragment.setListType(B2BBusinessListBean.CUSTOMER_INQUIRY_LIST);
+        mQuotedPriceFragment.setListState(Constants.FLAG.STATE_CUSTOMER_INQUIRY_DONE);
+        mQuotationAdoptedFragment.setListType(B2BBusinessListBean.CUSTOMER_INQUIRY_LIST);
+        mQuotationAdoptedFragment.setListState(Constants.FLAG.STATE_CUSTOMER_INQUIRY_AGREED);
+        mInvalidFragment.setListType(B2BBusinessListBean.CUSTOMER_INQUIRY_LIST);
+        mInvalidFragment.setListState(Constants.FLAG.STATE_CUSTOMER_INQUIRY_INVALID);
+
+        mFragments = new ArrayList<>();
+        mFragments.add(mAllFragment);
+        mFragments.add(mWaitQuotedFragment);
+        mFragments.add(mQuotedPriceFragment);
+        mFragments.add(mQuotationAdoptedFragment);
+        mFragments.add(mInvalidFragment);
+
+        mTitleStrings = new ArrayList<>();
+        mTitleStrings.add(getString(R.string.all));
+        mTitleStrings.add(getString(R.string.str_wait_quoted));
+        mTitleStrings.add(getString(R.string.str_quoted_price));
+        mTitleStrings.add(getString(R.string.str_adopted));
+        mTitleStrings.add(getString(R.string.str_invalid));
+        mTabViewpagerAdapter = new TabViewpagerAdapter(this, mFragments, mTitleStrings, getSupportFragmentManager());
+
+        mViewPager.setOffscreenPageLimit(mFragments.size() - 1);
+        mViewPager.setAdapter(mTabViewpagerAdapter);
+        mTabPageIndicator.setViewPager(mViewPager);
+        mUnderlinePageIndicator.setFades(false);
+        mUnderlinePageIndicator.setViewPager(mViewPager);
+        mTabPageIndicator.setOnPageChangeListener(mUnderlinePageIndicator);
+    }
+
+    @Override
+    protected WorkPlatPresenter initPresenter() {
+        return new WorkPlatPresenter();
+    }
+
+    @Override
+    protected void initEvent() {
+
+        mSearchActionView.setOnEnterActionListener(new SearchActionView.OnEnterActionListener() {
+            @Override
+            public void onEnterAction() {
+                if (CommonUtil.isNetWorkConnected(mContext)) {
+                    mKeyWord = mSearchActionView.getText();
+                    obtainListData();
+                } else {
+                    toast(R.string.networks_out);
+                }
+            }
+        });
+
+        mSearchActionView.setOnVoiceCompleteListener(new SearchActionView.OnVoiceCompleteListener() {
+            @Override
+            public void onVoiceComplete() {
+                if (CommonUtil.isNetWorkConnected(mContext)) {
+                    mKeyWord = mSearchActionView.getText();
+                    obtainListData();
+                } else {
+                    toast(R.string.networks_out);
+                }
+            }
+        });
+
+        mSearchActionView.setOnTextChangedListener(new SearchActionView.OnTextChangedListener() {
+            @Override
+            public void onTextChanged(String text) {
+                if (TextUtils.isEmpty(text) && !TextUtils.isEmpty(mKeyWord)) {
+                    if (CommonUtil.isNetWorkConnected(mContext)) {
+                        mKeyWord = "";
+                        obtainListData();
+                    }
+                }
+            }
+        });
+    }
+
+    private void obtainListData() {
+        mAllFragment.getListData(1, mKeyWord);
+        mWaitQuotedFragment.getListData(1, mKeyWord);
+        mQuotedPriceFragment.getListData(1, mKeyWord);
+        mQuotationAdoptedFragment.getListData(1, mKeyWord);
+        mInvalidFragment.getListData(1, mKeyWord);
+    }
+
+    @Override
+    protected void initData() {
+
+    }
+
+    @Override
+    public void showLoading(String loadStr) {
+
+    }
+
+    @Override
+    public void hideLoading() {
+
+    }
+
+    @Override
+    public void requestSuccess(int what, Object object) {
+
+    }
+
+    @Override
+    public void requestError(int what, String errorMsg) {
+
+    }
+}

+ 312 - 0
app_modular/appworks/src/main/java/com/uas/appworks/activity/PublicInquiryDetailActivity.java

@@ -0,0 +1,312 @@
+package com.uas.appworks.activity;
+
+import android.Manifest;
+import android.content.Intent;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.common.LogUtil;
+import com.common.data.DateFormatUtil;
+import com.common.data.JSONUtil;
+import com.common.data.StringUtil;
+import com.core.app.AppConstant;
+import com.core.app.Constants;
+import com.core.app.MyApplication;
+import com.core.base.activity.BaseMVPActivity;
+import com.core.utils.CommonUtil;
+import com.core.utils.OpenFilesUtils;
+import com.core.utils.ToastUtil;
+import com.core.widget.CustomProgressDialog;
+import com.me.network.app.base.HttpCallback;
+import com.me.network.app.base.HttpParams;
+import com.me.network.app.http.HttpRequest;
+import com.me.network.app.http.Method;
+import com.uas.appworks.R;
+import com.uas.appworks.adapter.B2BDetailListAdapter;
+import com.uas.appworks.model.bean.B2BAttachBean;
+import com.uas.appworks.model.bean.B2BDetailListBean;
+import com.uas.appworks.presenter.WorkPlatPresenter;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author RaoMeng
+ * @describe 公共询价单详情页
+ * @date 2018/1/16 15:31
+ */
+
+public class PublicInquiryDetailActivity extends BaseMVPActivity<WorkPlatPresenter> implements HttpCallback {
+    private final int PUBLIC_INQUIRY_DETAIL = 0x16;
+
+    private RecyclerView mInquiryRecyclerView, mMaterialRecyclerView;
+    private List<B2BDetailListBean> mInquiryListBeans, mMaterialListBeans;
+    private B2BDetailListAdapter mInquiryListAdapter, mMaterialListAdapter;
+
+    private String mId, mState, mJson;
+    private String mEnuu;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.activity_public_inquiry_detail;
+    }
+
+    @Override
+    protected void initView() {
+        getSupportActionBar().setTitle(R.string.title_quoted_price);
+
+        mInquiryRecyclerView = $(R.id.public_inquiry_detail_inquiry_information_rv);
+        mMaterialRecyclerView = $(R.id.public_inquiry_detail_material_information_rv);
+
+        mInquiryRecyclerView.setLayoutManager(new LinearLayoutManager(mContext));
+        mInquiryRecyclerView.setNestedScrollingEnabled(false);
+        mMaterialRecyclerView.setLayoutManager(new LinearLayoutManager(mContext));
+        mMaterialRecyclerView.setNestedScrollingEnabled(false);
+
+        mInquiryListBeans = new ArrayList<>();
+        mInquiryListAdapter = new B2BDetailListAdapter(mContext, mInquiryListBeans);
+        mInquiryRecyclerView.setAdapter(mInquiryListAdapter);
+
+        mMaterialListBeans = new ArrayList<>();
+        mMaterialListAdapter = new B2BDetailListAdapter(mContext, mMaterialListBeans);
+        mMaterialRecyclerView.setAdapter(mMaterialListAdapter);
+
+        Intent intent = getIntent();
+        if (intent != null) {
+            mId = intent.getStringExtra(Constants.FLAG.EXTRA_B2B_LIST_ID);
+            mState = intent.getStringExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE);
+            mJson = intent.getStringExtra(Constants.FLAG.EXTRA_B2B_LIST_JSON);
+            mEnuu = intent.getStringExtra(Constants.FLAG.EXTRA_B2B_LIST_ENUU);
+        }
+
+        if (TextUtils.isEmpty(mEnuu)) {
+            mEnuu = CommonUtil.getSharedPreferences(mContext, Constants.CACHE.B2B_BUSINESS_ENUU);
+        }
+    }
+
+    @Override
+    protected WorkPlatPresenter initPresenter() {
+        return null;
+    }
+
+    @Override
+    protected void initEvent() {
+
+    }
+
+    @Override
+    protected void initData() {
+        if (mJson != null && JSONUtil.validate(mJson)) {
+            initDetailData(mJson);
+        } else {
+            showLoading(null);
+
+            Map<String, Object> params = new HashMap<>();
+            params.put("en_uu", mEnuu);
+            params.put("user_tel", MyApplication.getInstance().mLoginUser.getTelephone());
+            params.put("id", mId);
+
+            HttpRequest.getInstance().sendRequest("http://218.17.158.219:24000/",
+                    new HttpParams.Builder()
+                            .url("inquiry/sale/publicInquiry/detail")
+                            .flag(PUBLIC_INQUIRY_DETAIL)
+                            .method(Method.GET)
+                            .setHeaders(new HashMap<String, Object>())
+                            .setParams(params)
+                            .build(), this);
+        }
+    }
+
+    private void initDetailData(String detail) {
+        JSONObject contentObject = JSON.parseObject(detail);
+        JSONObject inquiryObject = contentObject.getJSONObject("inquiry");
+        JSONObject productObject = contentObject.getJSONObject("product");
+
+        String inquiryId = "", inquiryCompany = "", phone = "", contact = "", enddate = "", attachs = "", model = "", brand = "", spec = "", material = "", unit = "", amount = "";
+
+        amount = JSONUtil.getText(contentObject, "needquantity");
+        if (productObject != null) {
+            model = JSONUtil.getText(productObject, "cmpCode");
+            brand = JSONUtil.getText(productObject, "brand");
+            spec = JSONUtil.getText(productObject, "spec");
+            material = JSONUtil.getText(productObject, "title");
+            unit = JSONUtil.getText(productObject, "unit");
+        }
+        if (inquiryObject != null) {
+
+            inquiryId = JSONUtil.getText(inquiryObject, "code");
+            long endDate = inquiryObject.getLongValue("endDate");
+            if (endDate != 0) {
+                enddate = DateFormatUtil.long2Str(endDate, DateFormatUtil.YMD);
+            }
+
+            JSONObject enterpriseObject = inquiryObject.getJSONObject("enterprise");
+            if (enterpriseObject != null) {
+                inquiryCompany = JSONUtil.getText(enterpriseObject, "enName");
+            }
+
+            //附件
+            /*JSONArray attachsArray = inquiryObject.getJSONArray("attachs");
+            if (attachsArray != null && attachsArray.size() > 0) {
+                SpanUtils spanUtils = new SpanUtils();
+                for (int i = 0; i < attachsArray.size(); i++) {
+                    final B2BAttachBean b2BAttachBean = new B2BAttachBean();
+
+                    JSONObject attachObject = attachsArray.getJSONObject(i);
+                    String name = JSONUtil.getText(attachObject, "name");
+                    String path = JSONUtil.getText(attachObject, "path");
+                    long size = attachObject.getLongValue("size");
+
+                    b2BAttachBean.setName(name);
+                    b2BAttachBean.setPath(path);
+                    b2BAttachBean.setSize(size);
+
+                    spanUtils.append(name + ((i == (attachsArray.size() - 1)) ? "" : "\n")).setUnderline()
+                            .setForegroundColor(getResources().getColor(R.color.titleBlue)).setClickSpan(new ClickableSpan() {
+                        @Override
+                        public void onClick(View view) {
+                            gotoReadEnclosure(b2BAttachBean);
+                        }
+                    });
+                }
+                attachs = spanUtils.create().toString();
+            }*/
+        }
+
+        mInquiryListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT_WHITE, getString(R.string.public_inquiry_id), inquiryId, "", "询价编号", ""));
+        mInquiryListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT_WHITE, getString(R.string.public_inquiry_company), inquiryCompany, "", "询价企业", ""));
+        mInquiryListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT_WHITE, getString(R.string.public_inquiry_phone), phone, "", "联系电话", ""));
+        mInquiryListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT_WHITE, getString(R.string.public_inquiry_contact), contact, "", "联系人", ""));
+        mInquiryListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT_WHITE, getString(R.string.public_inquiry_enddate), enddate, "", "报价截止如期", ""));
+        mInquiryListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT_WHITE, getString(R.string.public_inquiry_attachs), attachs, "", "附件", ""));
+
+        mInquiryListAdapter.notifyDataSetChanged();
+
+        mMaterialListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT_WHITE, getString(R.string.public_inquiry_model), model, "", "原厂型号", ""));
+        mMaterialListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT_WHITE, getString(R.string.public_inquiry_brand), brand, "", "品牌", ""));
+        mMaterialListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT_WHITE, getString(R.string.public_inquiry_spec), spec, "", "物料规格", ""));
+        mMaterialListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT_WHITE, getString(R.string.public_inquiry_material), material, "", "物料名称", ""));
+        mMaterialListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT_WHITE, getString(R.string.public_inquiry_unit), unit, "", "单位", ""));
+        mMaterialListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT_WHITE, getString(R.string.public_inquiry_amount), amount, "", "数量", ""));
+
+        mMaterialListAdapter.notifyDataSetChanged();
+    }
+
+    private B2BDetailListBean createB2BDetailListBean(int itemType,
+                                                      String caption,
+                                                      String value,
+                                                      String unit,
+                                                      String flag,
+                                                      String type) {
+        B2BDetailListBean b2BDetailListBean = new B2BDetailListBean();
+
+        b2BDetailListBean.setItemType(itemType);
+        b2BDetailListBean.setCaption(caption);
+        b2BDetailListBean.setFlag(flag);
+        b2BDetailListBean.setValue(value);
+        b2BDetailListBean.setType(type);
+        b2BDetailListBean.setUnit(unit);
+
+        return b2BDetailListBean;
+    }
+
+    @Override
+    public void showLoading(String loadStr) {
+        progressDialog.show();
+    }
+
+    @Override
+    public void hideLoading() {
+        progressDialog.dismiss();
+    }
+
+    @Override
+    public void onSuccess(int flag, Object o) throws Exception {
+        hideLoading();
+        String result = o.toString();
+        LogUtil.prinlnLongMsg("publicdetailsuccess", result);
+        if (flag == PUBLIC_INQUIRY_DETAIL) {
+            if (JSONUtil.validate(result)) {
+                JSONObject resultObject = JSON.parseObject(result);
+                JSONObject inquiryItem = resultObject.getJSONObject("inquiryItem");
+                if (inquiryItem != null) {
+                    initDetailData(inquiryItem.toString());
+                } else {
+                    initDetailData("");
+                    toast("数据获取为空");
+                }
+            }
+        }
+    }
+
+    @Override
+    public void onFail(int flag, String failStr) throws Exception {
+        hideLoading();
+        LogUtil.prinlnLongMsg("publicdetailfail", failStr);
+        if (flag == PUBLIC_INQUIRY_DETAIL) {
+            toast(failStr);
+        }
+    }
+
+    private void gotoReadEnclosure(B2BAttachBean attach) {
+        String url = attach.getPath();
+        final CustomProgressDialog progressDialog = CustomProgressDialog.createDialog(ct);
+        progressDialog.setTitile("正在预览");
+        progressDialog.setMessage("正在生成附件预览,请勿关闭程序");
+        if (!StringUtil.isEmpty(attach.getName())) {
+            if (isImage(attach.getName())) {
+                Intent intent = new Intent("com.modular.tool.SingleImagePreviewActivity");
+                intent.putExtra(AppConstant.EXTRA_IMAGE_URI, url);
+                ct.startActivity(intent);
+            } else {
+                OpenFilesUtils.downLoadFile(url, attach.getName(), new OpenFilesUtils.OnFileLoadListener() {
+                    @Override
+                    public void onLoadIng(int progress, int allProgress) {
+                        if (progressDialog != null) {
+                            progressDialog.show();
+                        }
+                    }
+
+                    @Override
+                    public void onSuccess(final File file) {
+                        if (progressDialog != null)
+                            progressDialog.dismiss();
+                        try {
+                            requestPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE, new Runnable() {
+                                @Override
+                                public void run() {
+                                    OpenFilesUtils.openCommonFils(ct, file);
+                                }
+                            }, new Runnable() {
+                                @Override
+                                public void run() {
+                                    toast(R.string.not_system_permission);
+                                }
+                            });
+                        } catch (Exception e) {
+
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(String exception) {
+                        LogUtil.i("exception=" + exception);
+                        ToastUtil.showToast(ct, exception);
+                    }
+                });
+            }
+        }
+    }
+
+    private boolean isImage(String name) {
+        return name.toUpperCase().endsWith("jpeg".toUpperCase())
+                || name.toUpperCase().endsWith("jpg".toUpperCase())
+                || name.toUpperCase().endsWith("png".toUpperCase());
+    }
+}

+ 146 - 0
app_modular/appworks/src/main/java/com/uas/appworks/activity/PublicInquiryListActivity.java

@@ -0,0 +1,146 @@
+package com.uas.appworks.activity;
+
+import android.support.v4.app.Fragment;
+import android.support.v4.view.ViewPager;
+import android.support.v7.app.ActionBar;
+import android.text.TextUtils;
+
+import com.core.base.activity.BaseMVPActivity;
+import com.core.utils.CommonUtil;
+import com.core.widget.SearchActionView;
+import com.uas.appworks.R;
+import com.uas.appworks.adapter.TabViewpagerAdapter;
+import com.uas.appworks.fragment.B2BBusinessListFragment;
+import com.uas.appworks.model.bean.B2BBusinessListBean;
+import com.uas.appworks.presenter.WorkPlatPresenter;
+import com.viewpagerindicator.TabPageIndicator;
+import com.viewpagerindicator.UnderlinePageIndicator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author RaoMeng
+ * @describe 公共询价单列表页面
+ * @date 2018/1/15 10:09
+ */
+
+public class PublicInquiryListActivity extends BaseMVPActivity<WorkPlatPresenter> {
+
+    private TabPageIndicator mTabPageIndicator;
+    private UnderlinePageIndicator mUnderlinePageIndicator;
+    private List<Fragment> mFragments;
+    private TabViewpagerAdapter mTabViewpagerAdapter;
+    private ViewPager mViewPager;
+    private List<String> mTitleStrings;
+    private SearchActionView mSearchActionView;
+
+    private B2BBusinessListFragment mAllFragment, mDoneFragment;
+    private String mKeyWord;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.activity_tab_viewpager;
+    }
+
+    @Override
+    protected void initView() {
+        mSearchActionView = new SearchActionView(mContext);
+        ActionBar bar = this.getSupportActionBar();
+        bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
+        bar.setCustomView(mSearchActionView);
+        mSearchActionView.setSearchHint(R.string.str_public_inquiry_list);
+
+        mTabPageIndicator = (TabPageIndicator) findViewById(R.id.tab_viewpager_tab);
+        mUnderlinePageIndicator = (UnderlinePageIndicator) findViewById(R.id.tab_viewpager_undertab);
+        mViewPager = (ViewPager) findViewById(R.id.tab_viewpager_vp);
+
+        mAllFragment = new B2BBusinessListFragment();
+        mDoneFragment = new B2BBusinessListFragment();
+
+        mAllFragment.setListType(B2BBusinessListBean.PUBLIC_INQUIRY_LIST);
+        mDoneFragment.setListType(B2BBusinessListBean.PUBLIC_INQUIRY_LIST);
+        mDoneFragment.setListState("done");
+
+        mFragments = new ArrayList<>();
+        mFragments.add(mAllFragment);
+        mFragments.add(mDoneFragment);
+
+        mTitleStrings = new ArrayList<>();
+        mTitleStrings.add(getString(R.string.all));
+        mTitleStrings.add(getString(R.string.str_quoted_price));
+        mTabViewpagerAdapter = new TabViewpagerAdapter(this, mFragments, mTitleStrings, getSupportFragmentManager());
+
+        mViewPager.setOffscreenPageLimit(mFragments.size() - 1);
+        mViewPager.setAdapter(mTabViewpagerAdapter);
+        mTabPageIndicator.setViewPager(mViewPager);
+        mUnderlinePageIndicator.setFades(false);
+        mUnderlinePageIndicator.setViewPager(mViewPager);
+        mTabPageIndicator.setOnPageChangeListener(mUnderlinePageIndicator);
+    }
+
+    @Override
+    protected WorkPlatPresenter initPresenter() {
+        return null;
+    }
+
+    @Override
+    protected void initEvent() {
+
+        mSearchActionView.setOnEnterActionListener(new SearchActionView.OnEnterActionListener() {
+            @Override
+            public void onEnterAction() {
+                if (CommonUtil.isNetWorkConnected(mContext)) {
+                    mKeyWord = mSearchActionView.getText();
+                    obtainListData();
+                } else {
+                    toast(R.string.networks_out);
+                }
+            }
+        });
+
+        mSearchActionView.setOnVoiceCompleteListener(new SearchActionView.OnVoiceCompleteListener() {
+            @Override
+            public void onVoiceComplete() {
+                if (CommonUtil.isNetWorkConnected(mContext)) {
+                    mKeyWord = mSearchActionView.getText();
+                    obtainListData();
+                } else {
+                    toast(R.string.networks_out);
+                }
+            }
+        });
+
+        mSearchActionView.setOnTextChangedListener(new SearchActionView.OnTextChangedListener() {
+            @Override
+            public void onTextChanged(String text) {
+                if (TextUtils.isEmpty(text) && !TextUtils.isEmpty(mKeyWord)) {
+                    if (CommonUtil.isNetWorkConnected(mContext)) {
+                        mKeyWord = "";
+                        obtainListData();
+                    }
+                }
+            }
+        });
+    }
+
+    private void obtainListData() {
+        mAllFragment.getListData(1, mKeyWord);
+        mDoneFragment.getListData(1, mKeyWord);
+    }
+
+    @Override
+    protected void initData() {
+
+    }
+
+    @Override
+    public void showLoading(String loadStr) {
+
+    }
+
+    @Override
+    public void hideLoading() {
+
+    }
+}

+ 161 - 0
app_modular/appworks/src/main/java/com/uas/appworks/activity/PurchaseOrderListActivity.java

@@ -0,0 +1,161 @@
+package com.uas.appworks.activity;
+
+import android.support.v4.app.Fragment;
+import android.support.v4.view.ViewPager;
+import android.support.v7.app.ActionBar;
+import android.text.TextUtils;
+
+import com.core.app.Constants;
+import com.core.base.activity.BaseMVPActivity;
+import com.core.base.presenter.BasePresenter;
+import com.core.utils.CommonUtil;
+import com.core.widget.SearchActionView;
+import com.uas.appworks.R;
+import com.uas.appworks.adapter.TabViewpagerAdapter;
+import com.uas.appworks.fragment.B2BBusinessListFragment;
+import com.uas.appworks.model.bean.B2BBusinessListBean;
+import com.viewpagerindicator.TabPageIndicator;
+import com.viewpagerindicator.UnderlinePageIndicator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author RaoMeng
+ * @describe 客户采购单列表页面
+ * @date 2018/1/15 10:09
+ */
+
+public class PurchaseOrderListActivity extends BaseMVPActivity {
+
+    private TabPageIndicator mTabPageIndicator;
+    private UnderlinePageIndicator mUnderlinePageIndicator;
+    private List<Fragment> mFragments;
+    private TabViewpagerAdapter mTabViewpagerAdapter;
+    private ViewPager mViewPager;
+    private List<String> mTitleStrings;
+    private SearchActionView mSearchActionView;
+
+    private B2BBusinessListFragment mAllFragment, mRepliedFragment, mWaitReplyFragment, mSettledFragment;
+    private String mKeyWord;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.activity_tab_viewpager;
+    }
+
+    @Override
+    protected void initView() {
+        mSearchActionView = new SearchActionView(mContext);
+        ActionBar bar = this.getSupportActionBar();
+        bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
+        bar.setCustomView(mSearchActionView);
+        mSearchActionView.setSearchHint(R.string.str_purchase_order_list);
+
+        mTabPageIndicator = (TabPageIndicator) findViewById(R.id.tab_viewpager_tab);
+        mUnderlinePageIndicator = (UnderlinePageIndicator) findViewById(R.id.tab_viewpager_undertab);
+        mViewPager = (ViewPager) findViewById(R.id.tab_viewpager_vp);
+
+        mAllFragment = new B2BBusinessListFragment();
+        mRepliedFragment = new B2BBusinessListFragment();
+        mWaitReplyFragment = new B2BBusinessListFragment();
+        mSettledFragment = new B2BBusinessListFragment();
+
+        mAllFragment.setListType(B2BBusinessListBean.PURCHASE_ORDER_LIST);
+        mWaitReplyFragment.setListType(B2BBusinessListBean.PURCHASE_ORDER_LIST);
+        mWaitReplyFragment.setListState(Constants.FLAG.STATE_PURCHASE_ORDER_TODO);
+        mRepliedFragment.setListType(B2BBusinessListBean.PURCHASE_ORDER_LIST);
+        mRepliedFragment.setListState(Constants.FLAG.STATE_PURCHASE_ORDER_DONE);
+        mSettledFragment.setListType(B2BBusinessListBean.PURCHASE_ORDER_LIST);
+        mSettledFragment.setListState(Constants.FLAG.STATE_PURCHASE_ORDER_END);
+
+        mFragments = new ArrayList<>();
+        mFragments.add(mAllFragment);
+        mFragments.add(mWaitReplyFragment);
+        mFragments.add(mRepliedFragment);
+        mFragments.add(mSettledFragment);
+
+        mTitleStrings = new ArrayList<>();
+        mTitleStrings.add(getString(R.string.all));
+        mTitleStrings.add(getString(R.string.str_wait_for_reply));
+        mTitleStrings.add(getString(R.string.str_have_replied));
+        mTitleStrings.add(getString(R.string.str_case_closed));
+        mTabViewpagerAdapter = new TabViewpagerAdapter(this, mFragments, mTitleStrings, getSupportFragmentManager());
+
+        mViewPager.setOffscreenPageLimit(mFragments.size() - 1);
+        mViewPager.setAdapter(mTabViewpagerAdapter);
+        mTabPageIndicator.setViewPager(mViewPager);
+        mUnderlinePageIndicator.setFades(false);
+        mUnderlinePageIndicator.setViewPager(mViewPager);
+        mTabPageIndicator.setOnPageChangeListener(mUnderlinePageIndicator);
+    }
+
+    @Override
+    protected BasePresenter initPresenter() {
+        return null;
+    }
+
+    @Override
+    protected void initEvent() {
+
+        mSearchActionView.setOnEnterActionListener(new SearchActionView.OnEnterActionListener() {
+            @Override
+            public void onEnterAction() {
+                if (CommonUtil.isNetWorkConnected(mContext)) {
+                    mKeyWord = mSearchActionView.getText();
+                    obtainListData();
+                } else {
+                    toast(R.string.networks_out);
+                }
+            }
+        });
+
+        mSearchActionView.setOnVoiceCompleteListener(new SearchActionView.OnVoiceCompleteListener() {
+            @Override
+            public void onVoiceComplete() {
+                if (CommonUtil.isNetWorkConnected(mContext)) {
+                    mKeyWord = mSearchActionView.getText();
+                    obtainListData();
+                } else {
+                    toast(R.string.networks_out);
+                }
+            }
+        });
+
+        mSearchActionView.setOnTextChangedListener(new SearchActionView.OnTextChangedListener() {
+            @Override
+            public void onTextChanged(String text) {
+                if (TextUtils.isEmpty(text) && !TextUtils.isEmpty(mKeyWord)) {
+                    if (CommonUtil.isNetWorkConnected(mContext)) {
+                        mKeyWord = "";
+                        obtainListData();
+                    }
+                }
+            }
+        });
+
+    }
+
+    private void obtainListData() {
+        mAllFragment.getListData(1, mKeyWord);
+        mRepliedFragment.getListData(1, mKeyWord);
+        mWaitReplyFragment.getListData(1, mKeyWord);
+        mSettledFragment.getListData(1, mKeyWord);
+    }
+
+    @Override
+    protected void initData() {
+
+    }
+
+    @Override
+    public void showLoading(String loadStr) {
+        progressDialog.show();
+    }
+
+    @Override
+    public void hideLoading() {
+        progressDialog.dismiss();
+    }
+
+}

+ 76 - 0
app_modular/appworks/src/main/java/com/uas/appworks/adapter/B2BAccountAdapter.java

@@ -0,0 +1,76 @@
+package com.uas.appworks.adapter;
+
+import android.content.Context;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.CheckBox;
+
+import com.uas.appworks.R;
+import com.uas.appworks.model.bean.B2BCompanyBean;
+
+import java.util.List;
+
+/**
+ * @author RaoMeng
+ * @describe
+ * @date 2018/1/16 11:09
+ */
+
+public class B2BAccountAdapter extends RecyclerView.Adapter<B2BAccountAdapter.B2BAccountViewHolder> {
+    private Context mContext;
+    private LayoutInflater mLayoutInflater;
+    private List<B2BCompanyBean> mB2BCompanyBeans;
+
+    public B2BAccountAdapter(Context context, List<B2BCompanyBean> b2BCompanyBeans) {
+        mContext = context;
+        mB2BCompanyBeans = b2BCompanyBeans;
+        mLayoutInflater = LayoutInflater.from(mContext);
+    }
+
+    @Override
+    public B2BAccountViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+        View itemView = mLayoutInflater.inflate(R.layout.layout_list_b2b_account, parent, false);
+        return new B2BAccountViewHolder(itemView);
+    }
+
+    @Override
+    public void onBindViewHolder(B2BAccountViewHolder holder, final int position) {
+        B2BCompanyBean b2BCompanyBean = mB2BCompanyBeans.get(position);
+        holder.mCheckBox.setChecked(b2BCompanyBean.isSelected());
+        holder.mCheckBox.setText(b2BCompanyBean.getName());
+
+        holder.mCheckBox.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                for (int i = 0; i < mB2BCompanyBeans.size(); i++) {
+                    if (mB2BCompanyBeans.get(i).isSelected()) {
+                        if (i == position) {
+                            break;
+                        } else {
+                            mB2BCompanyBeans.get(i).setSelected(false);
+                            notifyItemChanged(i);
+                        }
+                    }
+                }
+                mB2BCompanyBeans.get(position).setSelected(true);
+                notifyItemChanged(position);
+            }
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return mB2BCompanyBeans == null ? 0 : mB2BCompanyBeans.size();
+    }
+
+    class B2BAccountViewHolder extends RecyclerView.ViewHolder {
+        private CheckBox mCheckBox;
+
+        public B2BAccountViewHolder(View itemView) {
+            super(itemView);
+            mCheckBox = (CheckBox) itemView.findViewById(R.id.list_b2b_account_cb);
+        }
+    }
+}

+ 59 - 0
app_modular/appworks/src/main/java/com/uas/appworks/adapter/B2BBusinessCompanyAdapter.java

@@ -0,0 +1,59 @@
+package com.uas.appworks.adapter;
+
+import android.content.Context;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import com.uas.appworks.R;
+import com.uas.appworks.model.bean.B2BCompanyBean;
+
+import org.w3c.dom.Text;
+
+import java.util.List;
+
+/**
+ * @author RaoMeng
+ * @describe
+ * @date 2018/1/15 16:04
+ */
+
+public class B2BBusinessCompanyAdapter extends RecyclerView.Adapter<B2BBusinessCompanyAdapter.MyViewHolder> {
+    private Context mContext;
+    private LayoutInflater mLayoutInflater;
+    private List<B2BCompanyBean> mB2BCompanyBeans;
+
+    public B2BBusinessCompanyAdapter(Context context, List<B2BCompanyBean> b2BCompanyBeans) {
+        mContext = context;
+        mB2BCompanyBeans = b2BCompanyBeans;
+        mLayoutInflater = LayoutInflater.from(mContext);
+    }
+
+    @Override
+    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+        View itemView = mLayoutInflater.inflate(R.layout.layout_list_b2b_company, parent, false);
+        return new MyViewHolder(itemView);
+    }
+
+    @Override
+    public void onBindViewHolder(MyViewHolder holder, int position) {
+        holder.companyTextView.setText(mB2BCompanyBeans.get(position).getName());
+    }
+
+    @Override
+    public int getItemCount() {
+        return mB2BCompanyBeans == null ? 0 : mB2BCompanyBeans.size();
+    }
+
+    class MyViewHolder extends RecyclerView.ViewHolder {
+        private TextView companyTextView;
+
+        public MyViewHolder(View itemView) {
+            super(itemView);
+
+            companyTextView = (TextView) itemView.findViewById(R.id.b2b_company_name_tv);
+        }
+    }
+}

Vissa filer visades inte eftersom för många filer har ändrats