Browse Source

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

# Conflicts:
#	WeiChat/version.properties
raomeng 8 years ago
parent
commit
2ba070fbc3

+ 1 - 10
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/message/ChatActivity.java

@@ -133,16 +133,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
@@ -525,6 +515,7 @@ public class ChatActivity extends ActionBackActivity
             sendPushTask(mLoginUserId, mFriend.getUserId(), message.getContent());
 
         }
+        FriendHelper.addGoodFriend(this,mFriend);
     }
 
     private UploadEngine.ImFileUploadResponse mUploadResponse = new UploadEngine.ImFileUploadResponse() {

+ 3 - 3
WeiChat/version.properties

@@ -1,5 +1,5 @@
-#Tue Jan 23 10:51:07 CST 2018
-debugName=567
+#Mon Jan 22 17:29:26 CST 2018
+debugName=549
 versionName=625
-debugCode=567
+debugCode=549
 versionCode=164

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

@@ -1,6 +1,7 @@
 package com.core.xmpp;
 
 import android.content.Context;
+import android.content.Intent;
 
 import com.android.volley.Response.ErrorListener;
 import com.android.volley.VolleyError;
@@ -123,12 +124,20 @@ public class FriendHelper {
     /**
      * 添加常用
      */
-    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 && friend.getClickNum() < 10) {
+            int lastMagSend = friend.getTimeSend();
+            int defTime = ((int) System.currentTimeMillis() / 1000) - lastMagSend;
+            if (defTime<86400){
+                friend.setClickNum(10);
+                boolean b=FriendDao.getInstance().createOrUpdateFriend(friend);
+                if (b&&context!=null){
+                    Intent intent = new Intent("com.app.home.update");
+                    intent.putExtra("isGood", true);
+                    context.sendBroadcast(intent);
+                }
+            }
+        }
     }
 
     /**

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

@@ -16,6 +16,7 @@ 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.ui.widget.stickylistheaders.StickyListHeadersAdapter;
 
@@ -96,7 +97,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 +152,7 @@ public class FriendSortAdapter extends BaseAdapter implements SectionIndexer,Sti
                     if (matcher.matches()) {
 //                        selectByPhone(phone, finalConvertView);
                         SystemUtil.phoneAction(mContext,phone);
+                        FriendHelper.addGoodFriend(mContext,friend);
                     } else {
                         Crouton.makeText(mContext, R.string.not_format_phone);
                     }

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

@@ -244,11 +244,11 @@ public class MyFriendActivity extends BaseActivity {
                 long startTime = System.currentTimeMillis();
                 if (mLoginUserId == null)
                     mLoginUserId = MyApplication.getInstance().mLoginUser.getUserId();
-//                if (isPeculiar) {
-//                    friends = FriendDao.getInstance().getFriends(mLoginUserId, "clickNum", 10);
-//                } else {
+                if (isPeculiar) {
+                    friends = FriendDao.getInstance().getFriends(mLoginUserId, "clickNum", 10);
+                } else {
                     friends = FriendDao.getInstance().getFriends(mLoginUserId);// 取所有好友
-//                }
+                }
                 if (friends != null)
                     Log.i("wang", "friends size()=" + friends.size());
                 long delayTime = 200 - (startTime - System.currentTimeMillis());// 保证至少200ms的刷新过程

+ 1 - 0
app_modular/appme/src/main/java/com/uas/appme/other/activity/BasicInfoActivity.java

@@ -539,6 +539,7 @@ public class BasicInfoActivity extends BaseActivity implements NewFriendListener
                     } else {
                         ViewUtil.ShowMessageTitle(BasicInfoActivity.this, getString(R.string.error_phone));
                     }
+                    FriendHelper.addGoodFriend(ct,mFriend);
                 }
             }
         });

+ 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);

+ 2 - 6
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/activity/PurchaseDetailsActivity.java

@@ -142,7 +142,7 @@ public class PurchaseDetailsActivity extends BaseNetActivity implements OnSmartH
             String json = JSONUtil.map2JSON(mapList);
             reply(json);
         } else {
-            LogUtil.i("没有可以提交的明细表单");
+            ToastUtil.showToast(ct,"没有可以提交的明细表单");
         }
     }
 
@@ -151,7 +151,6 @@ public class PurchaseDetailsActivity extends BaseNetActivity implements OnSmartH
         int enuu = 10041559;
         String phone = "15671616315";
         Parameter.Builder builder = new Parameter.Builder();
-        LogUtil.i("json=" + json);
         builder.mode(Method.POST)
                 .url("mobile/sale/orders/reply")
                 .addParams("en_uu", enuu)
@@ -178,7 +177,6 @@ public class PurchaseDetailsActivity extends BaseNetActivity implements OnSmartH
 
     @Override
     public void onSuccess(int what, String message, Tags tag) throws Exception {
-        LogUtil.i("message=" + message);
         switch (what) {
             case 0x11:
                 handleMessage(message);
@@ -187,7 +185,7 @@ public class PurchaseDetailsActivity extends BaseNetActivity implements OnSmartH
                 replyNumber--;
                 if (replyNumber == 0) {
                     Toast.makeText(MyApplication.getInstance(), "回复成功", Toast.LENGTH_SHORT).show();
-                    if (this != null) {
+                    if (!this.isFinishing()) {
                         loadData();
                     }
                 }
@@ -201,8 +199,6 @@ public class PurchaseDetailsActivity extends BaseNetActivity implements OnSmartH
         if (0x12 == what && StringUtil.isEmpty(message) && this != null) {
             loadData();
         }
-
-
     }
 
 

+ 5 - 7
app_modular/appworks/src/main/res/layout/item_ls_purchase.xml

@@ -28,7 +28,7 @@
         android:layout_width="80dp"
         android:layout_marginTop="@dimen/padding"
         android:layout_height="wrap_content"
-        android:layout_below="@id/customerTag"
+        android:layout_below="@id/customerTv"
         android:text="收货地址:"
         android:textColor="@color/hintColor"
         android:textSize="@dimen/text_hine" />
@@ -37,8 +37,6 @@
         android:id="@+id/addressTv"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:lines="1"
-        android:ellipsize="end"
         android:layout_alignTop="@id/addressTag"
         android:layout_toRightOf="@id/customerTag"
         android:text="客户:"
@@ -50,7 +48,7 @@
         android:layout_width="80dp"
         android:layout_marginTop="@dimen/padding"
         android:layout_height="wrap_content"
-        android:layout_below="@id/addressTag"
+        android:layout_below="@id/addressTv"
         android:text="订单号:"
         android:textColor="@color/hintColor"
         android:textSize="@dimen/text_hine" />
@@ -70,7 +68,7 @@
         android:layout_width="80dp"
         android:layout_marginTop="@dimen/padding"
         android:layout_height="wrap_content"
-        android:layout_below="@id/codeTag"
+        android:layout_below="@id/codeTv"
         android:text="单据时间:"
         android:textColor="@color/hintColor"
         android:textSize="@dimen/text_hine" />
@@ -90,7 +88,7 @@
         android:layout_width="80dp"
         android:layout_marginTop="@dimen/padding"
         android:layout_height="wrap_content"
-        android:layout_below="@id/timeTag"
+        android:layout_below="@id/timeTv"
         android:text="备注:"
         android:textColor="@color/hintColor"
         android:textSize="@dimen/text_hine" />
@@ -110,7 +108,7 @@
         android:layout_marginTop="@dimen/padding"
         android:layout_width="80dp"
         android:layout_height="wrap_content"
-        android:layout_below="@id/remarksTag"
+        android:layout_below="@id/remarksTv"
         android:text="总额:"
         android:textColor="@color/hintColor"
         android:textSize="@dimen/text_hine" />

+ 5 - 5
app_modular/appworks/src/main/res/layout/item_purchase.xml

@@ -27,7 +27,7 @@
         android:id="@+id/remarksTag"
         android:layout_width="80dp"
         android:layout_height="wrap_content"
-        android:layout_below="@id/timeTag"
+        android:layout_below="@id/timeTv"
         android:layout_marginTop="@dimen/padding"
         android:text="产品:"
         android:textColor="@color/hintColor"
@@ -47,7 +47,7 @@
         android:id="@+id/totalTag"
         android:layout_width="80dp"
         android:layout_height="wrap_content"
-        android:layout_below="@id/remarksTag"
+        android:layout_below="@id/remarksTv"
         android:layout_marginTop="@dimen/padding"
         android:text="规格型号:"
         android:textColor="@color/hintColor"
@@ -67,7 +67,7 @@
         android:id="@+id/dateTag"
         android:layout_width="80dp"
         android:layout_height="wrap_content"
-        android:layout_below="@id/totalTag"
+        android:layout_below="@id/totalTv"
         android:layout_marginTop="@dimen/padding"
         android:text="交货日期:"
         android:textColor="@color/hintColor"
@@ -89,7 +89,7 @@
         android:id="@+id/numberTag"
         android:layout_width="80dp"
         android:layout_height="wrap_content"
-        android:layout_below="@id/dateTag"
+        android:layout_below="@id/dateEd"
         android:layout_marginTop="@dimen/padding"
         android:text="数量:"
         android:textColor="@color/hintColor"
@@ -126,7 +126,7 @@
         android:id="@+id/remarksInputTag"
         android:layout_width="80dp"
         android:layout_height="wrap_content"
-        android:layout_below="@id/numberTag"
+        android:layout_below="@id/numberEd"
         android:layout_marginTop="@dimen/padding"
         android:text="备注:"
         android:textColor="@color/hintColor"