Browse Source

修改bug

Bitliker 7 years ago
parent
commit
661e4a6e29

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/PushNetMessageReceiver.java

@@ -75,7 +75,7 @@ public class PushNetMessageReceiver extends PushMessageReceiver {
                 .add("deviceType", 3)
                 .add("channelId", channelId)
                 .build();
-        HttpClient httpClient = new HttpClient.Builder("https://mobile.ubtob.com:8443/schedule/").isDebug(false)
+        HttpClient httpClient = new HttpClient.Builder(com.core.utils.CommonUtil.getSchedulerBaseUrl()).isDebug(false)
                 .connectTimeout(5000)
                 .readTimeout(5000).build();
         httpClient.Api().post(mHttpClient, new ResultSubscriber<>(new Result2Listener<Object>() {

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

@@ -75,6 +75,16 @@
         "menuUrl": "",
         "caller": "",
         "isHide": false
+      },
+      {
+        "isLocalMenu": true,
+        "menuName": "title_time_helper",
+        "menuIcon": "icon_time_helper",
+        "menuActivity": "com.modular.work.TimeHelperActivity",
+        "menuTag": "local_time_helper",
+        "menuUrl": "",
+        "caller": "",
+        "isHide": false
       }
     ]
   },

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

@@ -217,6 +217,11 @@ public class CommonUtil {
         }
         return "https://api-inquiry.usoftmall.com/";
     }
+    //日程管理网址
+    public static String getSchedulerBaseUrl() {
+//        return "http://192.168.253.230:8080/schedule/";
+        return "https://mobile.ubtob.com:8443/schedule/";
+    }
 
     /**
      * B2B身份uid

+ 2 - 1
app_modular/apptasks/src/main/java/com/modular/apptasks/presenter/SchedulePresenter.java

@@ -8,6 +8,7 @@ import com.common.data.JSONUtil;
 import com.common.data.ListUtils;
 import com.common.data.StringUtil;
 import com.core.app.MyApplication;
+import com.core.utils.CommonUtil;
 import com.me.network.app.http.HttpClient;
 import com.me.network.app.http.rx.Result2Listener;
 import com.me.network.app.http.rx.ResultSubscriber;
@@ -36,7 +37,7 @@ public class SchedulePresenter {
 
     private HttpClient getHttpClient() {
         if (httpClient == null) {
-            String baseUrl = "https://mobile.ubtob.com:8443/schedule/";
+            String baseUrl = CommonUtil.getSchedulerBaseUrl();
             if (!StringUtil.isEmpty(baseUrl)) {
                 httpClient = new HttpClient.Builder(baseUrl).isDebug(true)
                         .connectTimeout(5000)

+ 1 - 0
app_modular/appworks/build.gradle

@@ -24,4 +24,5 @@ dependencies {
     compile project(path: ':imageload')
     compile 'com.android.support.constraint:constraint-layout:1.0.2'
     compile project(':facesdk')
+    compile project(path: ':appbooking')
 }

+ 79 - 10
app_modular/appworks/src/main/java/com/uas/appworks/activity/ScheduleActivity.java

@@ -2,6 +2,7 @@ package com.uas.appworks.activity;
 
 import android.content.Intent;
 import android.graphics.Color;
+import android.os.Bundle;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.text.TextUtils;
@@ -22,6 +23,8 @@ import com.common.data.JSONUtil;
 import com.common.data.ListUtils;
 import com.common.data.StringUtil;
 import com.core.app.MyApplication;
+import com.core.utils.CommonUtil;
+import com.core.utils.ToastUtil;
 import com.modular.apputils.activity.BaseNetActivity;
 import com.modular.apputils.listener.OnSmartHttpListener;
 import com.modular.apputils.network.Parameter;
@@ -29,6 +32,9 @@ import com.modular.apputils.network.Tags;
 import com.modular.apputils.widget.compactcalender.CompactCalendarView;
 import com.modular.apputils.widget.compactcalender.Lunar;
 import com.modular.apputils.widget.compactcalender.domain.Event;
+import com.modular.booking.activity.services.BServiceAddActivity;
+import com.modular.booking.model.BookingModel;
+import com.modular.booking.model.SBListModel;
 import com.uas.appworks.R;
 import com.uas.appworks.datainquiry.Constants;
 import com.uas.appworks.model.Schedule;
@@ -85,7 +91,7 @@ public class ScheduleActivity extends BaseNetActivity {
 
     @Override
     protected String getBaseUrl() {
-        return "https://mobile.ubtob.com:8443/schedule/";
+        return CommonUtil.getSchedulerBaseUrl();
     }
 
     private void initView() {
@@ -156,7 +162,7 @@ public class ScheduleActivity extends BaseNetActivity {
         requestHttp(new Parameter.Builder()
                         .addParams("imid", MyApplication.getInstance().getLoginUserId())
                         .addParams("day", dateStr)
-                        .url("schedule/byDaySchedule")
+                        .url("schedule/getByDaySchedule")
                         .record(LOAD_DAY)
                 , mOnSmartHttpListener);
     }
@@ -175,7 +181,7 @@ public class ScheduleActivity extends BaseNetActivity {
                         break;
                 }
             } catch (Exception e) {
-                LogUtil.i("gong","e="+e.getMessage());
+                LogUtil.i("gong", "e=" + e.getMessage());
 
             }
 
@@ -219,8 +225,9 @@ public class ScheduleActivity extends BaseNetActivity {
                 chche.setWarnTime(JSONUtil.getInt(object, "warnTime"));
                 chche.setAddress(JSONUtil.getText(object, "address"));
                 chche.setStatus(JSONUtil.getText(object, "status"));
+                chche.setDetails(JSONUtil.getText(object, "details"));
                 schedules.add(chche);
-                if (!ListUtils.isEmpty(systemSchedule)){
+                if (!ListUtils.isEmpty(systemSchedule)) {
                     for (Schedule e : systemSchedule) {
                         if (e.getId() == chche.getId()) {
                             systemSchedule.remove(e);
@@ -328,15 +335,78 @@ public class ScheduleActivity extends BaseNetActivity {
         private View.OnClickListener mOnClickListener = new View.OnClickListener() {
             @Override
             public void onClick(View view) {
-                if (view.getTag() != null && view.getTag() instanceof Schedule) {
-                    Schedule mSchedule = (Schedule) view.getTag();
-                    startActivityForResult(new Intent(ct, SchedulerCreateActivity.class)
-                            .putExtra(Constants.Intents.ENABLE, false)
-                            .putExtra(Constants.Intents.MODEL, mSchedule), 0x11);
+                try {
+                    if (view.getTag() != null && view.getTag() instanceof Schedule) {
+                        Schedule mSchedule = (Schedule) view.getTag();
+                        toDetailActivty(mSchedule);
+                    }
+                } catch (Exception e) {
                 }
             }
         };
 
+        private void toDetailActivty(Schedule mSchedule) throws Exception {
+            if ("个人预约".equals(mSchedule.getType())) {
+                Bundle bundle = new Bundle();
+                BookingModel model = getBookingModelByString(mSchedule.getDetails());
+                if (model==null){
+                    ToastUtil.showToast(ct,R.string.error_message);
+                    return;
+                }
+                bundle.putParcelable("model", model);
+                startActivity(new Intent("com.modular.booking.BookingDetailActivity")
+                        .putExtras(bundle));
+            } else if ("商务预约".equals(mSchedule.getType())) {
+                BookingModel mBookingModel = getBookingModelByString(mSchedule.getDetails());
+                if (mBookingModel==null){
+                    ToastUtil.showToast(ct,R.string.error_message);
+                    return;
+                }
+                SBListModel model = new SBListModel();
+                model.setId(Integer.valueOf(mBookingModel.getAb_id()));
+                model.setAddress(mBookingModel.getAb_address());
+                model.setType(mBookingModel.getAb_content());//行业关键代码
+                model.setIndustrycode(mBookingModel.getAb_content());
+                model.setEndtime(mBookingModel.getAb_endtime());
+                model.setName(mBookingModel.getAb_bman());
+                startActivity(new Intent(ct, BServiceAddActivity.class)
+                        .putExtra("model", model)
+                        .putExtra("isEdited", false)
+                        .putExtra("dataService", mBookingModel.getData_service()));
+            } else {
+                startActivityForResult(new Intent(ct, SchedulerCreateActivity.class)
+                        .putExtra(Constants.Intents.ENABLE, false)
+                        .putExtra(Constants.Intents.MODEL, mSchedule), 0x11);
+            }
+        }
+
+        private BookingModel getBookingModelByString(String json) throws Exception {
+            JSONArray array = JSON.parseArray(json);
+            if (!ListUtils.isEmpty(array)){
+                JSONObject object =array.getJSONObject(0);
+                BookingModel model = new BookingModel();
+                model.setAb_id(JSONUtil.getText(object, "ab_id"));
+                model.setAb_bman(JSONUtil.getText(object, "ab_bman"));
+                model.setAb_bmanid(JSONUtil.getText(object, "ab_bmanid"));
+                model.setAb_starttime(JSONUtil.getText(object, "ab_starttime"));
+                model.setAb_endtime(JSONUtil.getText(object, "ab_endtime"));
+                model.setAb_recorddate(JSONUtil.getText(object, "ab_recorddate"));
+                model.setAb_recordid(JSONUtil.getText(object, "ab_recordid"));
+                model.setAb_recordman(JSONUtil.getText(object, "ab_recordman"));
+                model.setAb_content(JSONUtil.getText(object, "ab_content"));
+                model.setAb_confirmstatus(JSONUtil.getText(object, "ab_confirmstatus"));
+                model.setAb_sharestatus(JSONUtil.getText(object, "ab_sharestatus"));
+                model.setAb_address(JSONUtil.getText(object, "ab_address"));
+                model.setAb_longitude(JSONUtil.getText(object, "ab_longitude"));
+                model.setAb_latitude(JSONUtil.getText(object, "ab_latitude"));
+                model.setAb_type(JSONUtil.getText(object, "ab_type"));
+                model.setAb_reason(JSONUtil.getText(object, "ab_reason"));
+                model.setAd_reason(JSONUtil.getText(object, "ab_reason"));
+                return model;
+            }
+           return null;
+        }
+
         @Override
         public int getItemCount() {
             return ListUtils.getSize(mSchedules) + 1;
@@ -359,7 +429,6 @@ public class ScheduleActivity extends BaseNetActivity {
                 contentTv = (TextView) itemView.findViewById(R.id.contentTv);
                 typeTv = (TextView) itemView.findViewById(R.id.typeTv);
                 tagTv = (TextView) itemView.findViewById(R.id.tagTv);
-
             }
         }
 

+ 1 - 1
app_modular/appworks/src/main/java/com/uas/appworks/activity/ScheduleSearchActivity.java

@@ -67,7 +67,7 @@ public class ScheduleSearchActivity extends BaseNetActivity {
     }
     @Override
     protected String getBaseUrl() {
-        return "https://mobile.ubtob.com:8443/schedule/";
+        return CommonUtil.getSchedulerBaseUrl();
     }
 
     private void initView() {

+ 1 - 1
app_modular/appworks/src/main/java/com/uas/appworks/activity/SchedulerCreateActivity.java

@@ -146,7 +146,7 @@ public class SchedulerCreateActivity extends BaseNetActivity {
 
     @Override
     protected String getBaseUrl() {
-        return "https://mobile.ubtob.com:8443/schedule/";
+        return CommonUtil.getSchedulerBaseUrl();
     }
 
     private void findById() {

+ 11 - 0
app_modular/appworks/src/main/java/com/uas/appworks/model/Schedule.java

@@ -21,6 +21,7 @@ public class Schedule implements Parcelable {
     private long warnRealTime;//提醒精确时间(预留)
     private String address;//地点(预留)
     private String status;//状态(预留)
+    private String details;//单据详情
 
 
     public Schedule(boolean formUU) {
@@ -45,6 +46,7 @@ public class Schedule implements Parcelable {
         warnRealTime = in.readLong();
         address = in.readString();
         status = in.readString();
+        details = in.readString();
     }
 
     public static final Creator<Schedule> CREATOR = new Creator<Schedule>() {
@@ -167,6 +169,14 @@ public class Schedule implements Parcelable {
         return warnTime > 0 ? 1 : 0;
     }
 
+    public String getDetails() {
+        return details;
+    }
+
+    public void setDetails(String details) {
+        this.details = details;
+    }
+
     @Override
     public int describeContents() {
         return 0;
@@ -187,5 +197,6 @@ public class Schedule implements Parcelable {
         parcel.writeLong(warnRealTime);
         parcel.writeString(address);
         parcel.writeString(status);
+        parcel.writeString(details);
     }
 }

+ 5 - 0
app_modular/appworks/src/main/res/drawable/icon_time_helper.xml

@@ -0,0 +1,5 @@
+<vector android:height="24dp" android:viewportHeight="100"
+    android:viewportWidth="100" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="#B475DD" android:pathData="M63.5,81.7l-0.1,-4.3c-0.1,-0.4 -0.2,-0.7 -0.4,-1.1c0,-0.1 -0.1,-0.2 -0.1,-0.3c-2.4,-5.9 -8.8,-10.1 -12.4,-13.2c-3.1,-2.6 -5.4,-11.4 -5.1,-13.1c0.3,-1.8 13.3,-10.1 13.3,-17.2h-27c0,7.7 13.1,15.8 13.3,17.2c0.2,1.4 -2.1,10.2 -4.9,13.1c-2.8,2.9 -10.5,7.6 -12.7,14.1c0.2,-8.5 2.6,-15.2 7.1,-20.1c3.5,-3.8 7,-5 7.1,-5.1c0.7,-0.2 1.1,-0.8 1.2,-1.5c0.1,-0.7 -0.3,-1.4 -0.9,-1.7c0,0 -3.7,-2.2 -7.3,-6.7c-4.7,-5.8 -7.1,-12.6 -7.2,-20.1h36c-0.1,7.5 -2.5,14.3 -7.2,20.1c-3.6,4.5 -7.3,6.7 -7.3,6.7c-0.6,0.4 -0.9,1 -0.9,1.7c0.1,0.7 0.5,1.3 1.2,1.5c0,0 3.6,1.2 7.1,5.1c0.2,0.2 0.3,0.4 0.4,0.5c0.4,-1.3 0.9,-2.5 1.6,-3.5c-1.8,-1.9 -3.7,-3.2 -5.1,-4.1c1.5,-1.2 3.6,-3.1 5.6,-5.6c3.6,-4.5 8,-12 8.1,-22.4h4.2c1.4,0 2.6,-1.2 2.6,-2.6c0,-1.4 -1.2,-2.6 -2.6,-2.6H19.6c-1.4,0 -2.6,1.2 -2.6,2.6c0,1.4 1.2,2.6 2.6,2.6h4.2c0.1,10.5 4.4,18 8.1,22.4c2,2.5 4.1,4.3 5.6,5.6C36,50.8 34,52.2 32,54.3c-3.7,4 -8.1,11.4 -8.2,23.8h-4.2c-1.4,0 -2.6,1.2 -2.6,2.6s1.2,2.6 2.6,2.6h44.6C63.8,82.9 63.5,82.4 63.5,81.7z"/>
+    <path android:fillColor="#DAB0F5" android:pathData="M62,55.6c-2.5,1.7 -4.2,4.6 -4.1,8c0.1,3.7 2.2,7 5.3,8.7c0.5,0.3 0.8,0.8 0.9,1.4l0.1,7.6c0,1.1 0.9,1.9 2,2l3.8,0.1c1,0 1.9,-0.8 1.9,-1.9l-0.1,-7.6c0,-0.6 0.3,-1.1 0.8,-1.3c3.1,-1.6 5.1,-4.8 5.1,-8.6c0,-3.4 -1.8,-6.4 -4.5,-8.2c-0.7,-0.5 -1.7,0 -1.7,0.9l0.1,7.5c0,1.1 -0.8,1.9 -1.9,1.9L65.9,66c-1.1,0 -1.9,-0.9 -2,-2l-0.1,-7.4C63.8,55.7 62.8,55.2 62,55.6L62,55.6zM62,55.6"/>
+</vector>

+ 14 - 4
app_modular/facesdk/src/main/java/com/baidu/aip/excep/activity/FaceManageActivity.java

@@ -102,7 +102,7 @@ public class FaceManageActivity extends BaseNetActivity {
                 }
                 setAdapter(showDatas);
             }
-        }else{
+        } else {
             setAdapter(allDatas);
         }
     }
@@ -182,11 +182,11 @@ public class FaceManageActivity extends BaseNetActivity {
 
     private void handlerDelete(boolean deleteOk, EmployeesEntity model) {
         if (deleteOk) {
-            ToastUtil.showToast(ct,R.string.delete_succeed_notice1);
+            ToastUtil.showToast(ct, R.string.delete_succeed_notice1);
             allDatas.remove(model);
             search(TextUtils.isEmpty(voiceSearchView.getText()) ? "" : voiceSearchView.getText().toString());
         } else {
-         ToastUtil.showToast(ct,R.string.delete_failed);
+            ToastUtil.showToast(ct, R.string.delete_failed);
         }
     }
 
@@ -203,17 +203,25 @@ public class FaceManageActivity extends BaseNetActivity {
                         ToastUtil.showToast(ct, R.string.not_load_ok_fefresh);
                     } else {
                         List<EmployeesEntity> hasFaceModels = new ArrayList<>();
+                        List<String> notHasUser = new ArrayList<>();
+
                         for (int i = 0; i < userListArray.size(); i++) {
                             String userId = userListArray.getString(i);
+                            boolean hasUser = false;
                             for (EmployeesEntity e : employees) {
                                 String imid = String.valueOf(e.getEm_IMID());
                                 if (e != null && !TextUtils.isEmpty(imid) && !TextUtils.isEmpty(userId) &&
                                         userId.equals(imid)) {
                                     hasFaceModels.add(e);
+                                    hasUser = true;
                                     break;
                                 }
                             }
+                            if (!hasUser) {
+                                notHasUser.add(userId);
+                            }
                         }
+                        LogUtil.i("gong","notHasUser="+JSON.toJSONString(notHasUser));
                         if (ListUtils.isEmpty(hasFaceModels)) {
                             ToastUtil.showToast(ct, R.string.not_load_ok_fefresh);
                         } else {
@@ -244,7 +252,9 @@ public class FaceManageActivity extends BaseNetActivity {
                 }
             }
         });
-
+        if (!ListUtils.isEmpty(faceModels)) {
+            LogUtil.i("gong", "faceModels=" + faceModels.size());
+        }
     }
 
     private class FaceAdapter extends BaseAdapter {