Browse Source

提交类型 移除测试数据
提交内容 移除测试数据,提交发布代码

Bitliker 7 years ago
parent
commit
fb9a7f9132

+ 1 - 11
app_core/common/src/main/assets/work_menu.json

@@ -268,7 +268,7 @@
         "isLocalMenu": true,
         "menuName": "str_work_customer_manage",
         "menuIcon": "ic_work_customer_manage",
-        "menuActivity": "com.modular.work.crm3_0.activity.CustomerManageActivity",
+        "menuActivity": "com.modular.crm.CustomerListActivity",
         "menuTag": "local_customer_manage",
         "menuUrl": "",
         "caller": "",
@@ -313,16 +313,6 @@
         "menuUrl": "",
         "caller": "",
         "isHide": false
-      },
-      {
-        "isLocalMenu": true,
-        "menuName": "客户拜访",
-        "menuIcon": "local_customer_visit",
-        "menuActivity": "com.modular.work.crm3_0.activity.CustomerVisitActivity",
-        "menuTag": "local_customer_visit",
-        "menuUrl": "",
-        "caller": "",
-        "isHide": false
       }
     ]
   },

BIN
app_core/common/src/main/res/drawable-hdpi/ic_work_card.png


BIN
app_core/common/src/main/res/drawable-hdpi/icon_menu_my_scheduler.png


BIN
app_core/common/src/main/res/drawable-xhdpi/ic_work_card.png


BIN
app_core/common/src/main/res/drawable-xhdpi/icon_menu_my_scheduler.png


BIN
app_core/common/src/main/res/drawable-xxhdpi/ic_work_card.png


BIN
app_core/common/src/main/res/drawable-xxhdpi/icon_menu_my_scheduler.png


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

@@ -646,7 +646,7 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_centerVertical="true"
-                android:drawableLeft="@drawable/icon_uu_setting"
+                android:drawableLeft="@drawable/ic_work_card"
                 android:drawablePadding="10dp"
                 android:gravity="center"
                 android:text="电子工牌"

+ 11 - 6
app_modular/appme/src/main/java/com/uas/appme/other/activity/WorkCardActivity.java

@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baidu.aip.excep.utils.Base64Util;
 import com.common.LogUtil;
+import com.common.config.BaseConfig;
 import com.common.data.JSONUtil;
 import com.common.data.ListUtils;
 import com.core.base.BaseActivity;
@@ -66,20 +67,24 @@ public class WorkCardActivity extends BaseActivity {
                         JSONArray mLabourCardInfors = JSONUtil.getJSONArray(object, "LabourCardInfor");
                         if (!ListUtils.isEmpty(mLabourCardInfors)) {
                             handlerData(mLabourCardInfors.getJSONObject(0));
+                        }else{
+                            handlerData(new JSONObject());
                         }
                     }
 
                     @Override
                     public void onFailure(int what, String message, Tags tag) throws Exception {
-
+                        handlerData(new JSONObject());
                     }
                 });
 
         //TODO 测试数据
-        JSONObject object = JSON.parseObject(TestStr.LABOUR_CARD_INFOR);
-        JSONArray mLabourCardInfors = JSONUtil.getJSONArray(object, "LabourCardInfor");
-        if (!ListUtils.isEmpty(mLabourCardInfors)) {
-            handlerData(mLabourCardInfors.getJSONObject(0));
+        if (BaseConfig.isDebug()) {
+            JSONObject object = JSON.parseObject(TestStr.LABOUR_CARD_INFOR);
+            JSONArray mLabourCardInfors = JSONUtil.getJSONArray(object, "LabourCardInfor");
+            if (!ListUtils.isEmpty(mLabourCardInfors)) {
+                handlerData(mLabourCardInfors.getJSONObject(0));
+            }
         }
     }
 
@@ -100,7 +105,7 @@ public class WorkCardActivity extends BaseActivity {
         positionTv.setText(em_position);
         positionTv.setText(em_position);
         String headUrl = ImageViewUtils.getErpImageUrl(em_photourl);
-        LogUtil.i("gong","headUrl="+headUrl);
+        LogUtil.i("gong", "headUrl=" + headUrl);
         ImageLoaderUtil.getInstance().loadImage(headUrl, headIv);
         Bitmap logoMap = Base64Util.base64ToBitmap(en_logo);
         if (logoMap != null) {

+ 1 - 0
app_modular/appmessages/src/main/java/com/modular/appmessages/model/MessageHeader.java

@@ -16,6 +16,7 @@ public class MessageHeader {
      * 5.代办工作
      * 6.订阅号
      * 7.一元捐
+     * 21.我的日程
      */
     private int type;//根据类型来决定要调转的界面
     private int icon;

+ 74 - 2
app_modular/appmessages/src/main/java/com/modular/appmessages/presenter/MessagePresenter.java

@@ -58,13 +58,18 @@ import com.modular.appmessages.model.MessageNew;
 import com.modular.appmessages.model.SubMessage;
 import com.modular.appmessages.presenter.imp.IMessageView;
 import com.modular.appmessages.util.ApprovalUtil;
+import com.modular.apputils.listener.OnSmartHttpListener;
+import com.modular.apputils.network.Parameter;
+import com.modular.apputils.network.Tags;
 import com.modular.apputils.utils.SignUtils;
 import com.modular.apputils.utils.SwitchUtil;
+import com.modular.apputils.utils.UUHttpHelper;
 import com.modular.apputils.utils.VoiceUtils;
 import com.modular.booking.activity.services.BServiceListActivity;
 import com.modular.booking.model.SBMenuModel;
 import com.uas.appworks.OA.platform.activity.BusinessTravelActivity;
 import com.uas.appworks.OA.platform.activity.PurchaseDetailsActivity;
+import com.uas.appworks.activity.ScheduleActivity;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -88,6 +93,7 @@ public class MessagePresenter implements OnHttpResultListener {
     private final int LOAD_BOOKING = 0x17;//小秘书红点
     private final int LOAD_REAL_TIME = 0x18;
     private final int IS_COMPANY_ADMIN = 0x19;
+    private final int LOAD_SCHEDULE = 0x20;//获取日程数据
 
     public static final int REAL_TIME_FORM = 7;
     public static final int BUSINESS_STATISTICS = 8;
@@ -101,7 +107,7 @@ public class MessagePresenter implements OnHttpResultListener {
     private String subReadTime;//订阅号点击时间
 
     private String filter;//搜索数据
-    private int emnewsNum, subsNum, processNum, taskNum, bookingNum, uuHelperNum;//红点消息分类数量
+    private int emnewsNum, subsNum, processNum, taskNum, bookingNum, uuHelperNum, scheduleNum;//红点消息分类数量
     private String[] RECEIVER_LIST = {ConnectivityManager.CONNECTIVITY_ACTION, OAConfig.AUTO_SIGIN_ALART, MsgBroadcast.ACTION_MSG_COMPANY_UPDATE, "com.app.home.update"
             , MsgBroadcast.ACTION_MSG_UI_UPDATE};
     private BroadcastReceiver dataChangeReceiver = new BroadcastReceiver() {
@@ -155,6 +161,9 @@ public class MessagePresenter implements OnHttpResultListener {
             loadProcessToDo();//获取审批流接口
             loadSubData();
             loadNews(isB2b);//获取消息
+            if (!isB2b) {
+                loadSchedule();
+            }
         } else if (role.equals("3")) {//B2b用户
             isB2b = true;
             loadB2bNewsCount();
@@ -251,9 +260,48 @@ public class MessagePresenter implements OnHttpResultListener {
                 .setWhat(LOAD_EMNEWS)
                 .bulid();
         OAHttpHelper.getInstance().requestHttp(request, this);
+    }
+
+    /**
+     * 获取日程
+     */
+    private void loadSchedule() {
+        if (mUUHttpHelper == null) {
+            mUUHttpHelper = new UUHttpHelper(CommonUtil.getSchedulerBaseUrl());
+        }
+        String sessionId= CommonUtil.getSharedPreferences(ct, "sessionId");
+        mUUHttpHelper.requestHttp(new Parameter.Builder()
+                .url("schedule/getSchedule")
+                .addParams("imid", MyApplication.getInstance().getLoginUserId())
+                .addParams("uasUrl", CommonUtil.getAppBaseUrl(ct))
+                .addParams("emcode", CommonUtil.getEmcode())
+                .addParams("master", CommonUtil.getMaster())
+                .addParams("sessionId",sessionId)
+                .addSuperHeaders("Cookie", "JSESSIONID=" + sessionId)
+                .record(LOAD_SCHEDULE), mOnSmartHttpListener);
 
     }
 
+    private UUHttpHelper mUUHttpHelper;
+    private OnSmartHttpListener mOnSmartHttpListener = new OnSmartHttpListener() {
+        @Override
+        public void onSuccess(int what, String message, Tags tag) throws Exception {
+            JSONObject object = JSON.parseObject(message);
+            switch (what) {
+                case LOAD_SCHEDULE:
+                    if (JSONUtil.getBoolean(object, "success")) {
+                        int unRead = JSONUtil.getInt(object, "data");
+                        showScheduleNum(unRead);
+                    }
+                    break;
+            }
+        }
+
+        @Override
+        public void onFailure(int what, String message, Tags tag) throws Exception {
+
+        }
+    };
 
     private void postReadNews(String ids) {
         Map<String, Object> param = new HashMap<>();
@@ -422,6 +470,10 @@ public class MessagePresenter implements OnHttpResultListener {
                 } else if ("1".equals(result)) {
                     iMessageView.updateHeaderView(BUSINESS_STATISTICS, 1, "", "");
                 }
+                break;
+            case LOAD_SCHEDULE:
+                //TODO 获取日程数据
+                break;
             default:
                 break;
         }
@@ -551,6 +603,12 @@ public class MessagePresenter implements OnHttpResultListener {
         iMessageView.updateHeaderView(6, num, num > 0 ? title : "", time);
     }
 
+    private void showScheduleNum(int num) {
+        scheduleNum = num;
+        updateForUnReader();
+        iMessageView.updateHeaderView(21, num, num > 0 ? "你有新的日程" : "", "");
+    }
+
     private void saveSubs2Db(JSONObject o) throws Exception {
         JSONArray array = o.getJSONArray("data");
         if (ListUtils.isEmpty(array)) return;
@@ -1035,7 +1093,7 @@ public class MessagePresenter implements OnHttpResultListener {
 
     /*跟新未读红点信息*/
     private void updateForUnReader() {
-        int num = subsNum + processNum + uuHelperNum + emnewsNum + taskNum + bookingNum;
+        int num = subsNum + processNum + uuHelperNum + emnewsNum + taskNum + bookingNum + scheduleNum;
         if (this.unReaderListener != null) {
             this.unReaderListener.setUnReader(num);
         }
@@ -1128,6 +1186,16 @@ public class MessagePresenter implements OnHttpResultListener {
             models.addAll(getErpHeader());
         }
 
+        if (1 == 1) {
+            MessageNew h = new MessageNew();
+            MessageHeader model = new MessageHeader(StringUtil.getMessage(R.string.my_scheduler));
+            model.setIcon(R.drawable.icon_menu_my_scheduler);
+            model.setSubDoc("");
+            model.setType(21);
+            model.setRedKey("my_scheduler");
+            h.setT(model);
+            models.add(h);
+        }
         if (PreferenceUtils.getInt("UUSTEP", -1) == 1) {
             //显示UU运动
             MessageNew h = new MessageNew();
@@ -1364,6 +1432,10 @@ public class MessagePresenter implements OnHttpResultListener {
                 intent = new Intent(ct, PurchaseDetailsActivity.class).putExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE, "待回复");
                 ct.startActivity(intent);
                 break;
+            case 21:
+                intent = new Intent(ct, ScheduleActivity.class);
+                ct.startActivity(intent);
+                break;
             default:
                 break;
         }