ソースを参照

处理关于外勤的相关bug

Bitliker 9 年 前
コミット
299bef8549

+ 21 - 17
WeiChat/src/main/AndroidManifest.xml

@@ -105,7 +105,7 @@
     <uses-feature android:name="android.hardware.camera" />
     <!-- 使用照相机权限 -->
     <uses-feature android:name="android.hardware.camera.autofocus" />
-    <!--计步器用到-->
+    <!-- 计步器用到 -->
     <uses-feature android:name="android.hardware.sensor.accelerometer" />
 
     <!-- 自动聚焦权限 -->
@@ -116,8 +116,8 @@
         android:hardwareAccelerated="false"
         android:icon="@drawable/uuu"
         android:label="@string/app_name"
-        android:persistent="true"
         android:largeHeap="true"
+        android:persistent="true"
         android:theme="@style/AppTheme">
         <meta-data
             android:name="UMENG_CHANNEL"
@@ -670,7 +670,6 @@
             android:name=".ui.erp.activity.message.ProcessMsgActivity"
             android:label="@string/title_activity_process_msg" />
 
-
         <!-- 百度推送相关 -->
         <!-- push必须的receviver和service声明 -->
         <receiver
@@ -767,9 +766,9 @@
         <activity
             android:name=".ui.message.Subscription2Activity"
             android:label="订阅号" />
-        <activity android:name=".ui.erp.activity.oa.LocationSearchActivity"
-            android:windowSoftInputMode="stateUnspecified|adjustNothing"
-            />
+        <activity
+            android:name=".ui.erp.activity.oa.LocationSearchActivity"
+            android:windowSoftInputMode="stateUnspecified|adjustNothing" />
         <activity
             android:name=".ui.erp.activity.oa.MissionSetActivity"
             android:label="@string/activity_mission_set" />
@@ -784,8 +783,8 @@
         <activity
             android:name=".ui.erp.activity.form.FormListSelectActivity"
             android:hardwareAccelerated="false"
-            android:windowSoftInputMode="adjustPan"
-            android:launchMode="singleTask" />
+            android:launchMode="singleTask"
+            android:windowSoftInputMode="adjustPan" />
         <activity
             android:name=".ui.erp.activity.oa.WorkActivity"
             android:label="@string/activity_signing" />
@@ -798,16 +797,18 @@
         <activity
             android:name=".ui.erp.activity.oa.MissionActivity"
             android:label="@string/activity_mission_plan" />
-        <activity android:name="basepedo.ui.MyPedometerActivity"
-            android:label="UU运动"/>
+        <activity
+            android:name="basepedo.ui.MyPedometerActivity"
+            android:label="UU运动" />
+
         <service
             android:name="basepedo.service.StepService"
-            android:process="com.base.basepedo.step"
-            >
+            android:process="com.base.basepedo.step">
             <intent-filter android:priority="1000">
-                <!-- 系统启动完成后会调用-->
-                <action android:name="android.intent.action.BOOT_COMPLETED"/>
-                <action android:name="android.intent.action.DATE_CHANGED"/>
+
+                <!-- 系统启动完成后会调用 -->
+                <action android:name="android.intent.action.BOOT_COMPLETED" />
+                <action android:name="android.intent.action.DATE_CHANGED" />
                 <action android:name="android.intent.action.MEDIA_MOUNTED" />
                 <action android:name="android.intent.action.USER_PRESENT" />
                 <action android:name="android.intent.action.ACTION_TIME_TICK" />
@@ -815,13 +816,16 @@
                 <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
             </intent-filter>
         </service>
+
         <receiver android:name="basepedo.service.BootCompleteReceiver">
             <intent-filter>
-                <action android:name="android.intent.action.BOOT_COMPLETED"/>
+                <action android:name="android.intent.action.BOOT_COMPLETED" />
                 <action android:name="android.intent.action.USER_PRESENT" />
-                <action android:name="uu.step.destory"/>
+                <action android:name="uu.step.destory" />
             </intent-filter>
         </receiver>
+
+        <activity android:name=".ui.erp.activity.oa.ErpActivity"></activity>
     </application>
 
 </manifest>

+ 35 - 36
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/VisitReportAddActivity.java

@@ -87,40 +87,40 @@ public class VisitReportAddActivity extends BaseActivity implements View.OnClick
 
     private void initListener() {
         boolean isMe = getIntent().getBooleanExtra("isMe", true);
-        setFocusable(tv_date_start, isMe);
-        setFocusable(tv_date_end, isMe);
-        setFocusable(tv_customer_login, isMe);
-        setFocusable(tv_visit_steps, isMe);
-        setFocusable(tv_relate_business, isMe);
-
-        setFocusable(tv_visit_content, isMe);
-        setFocusable(tv_visit_theme, isMe);
-        setFocusable(tv_address_login, isMe);
-        setFocusable(tv_linksman_login, isMe);
-
-
-//        if () {
-//            tv_date_start.setOnClickListener(this);
-//            tv_date_end.setOnClickListener(this);
-//            tv_date_start.setKeyListener(null);
-//            tv_date_end.setKeyListener(null);
-//            tv_customer_login.setOnClickListener(this);
-//            tv_visit_steps.setKeyListener(null);
-//            tv_relate_business.setKeyListener(null);
-//            tv_visit_steps.setOnClickListener(this);
-//            tv_relate_business.setOnClickListener(this);
-//        } else {
-//            //当不可编辑tv_date_end
-//            tv_date_start.setFocusable(false);
-//            tv_date_end.setFocusable(false);
-//            tv_customer_login.setFocusable(false);
-//            tv_visit_steps.setFocusable(false);
-//            tv_relate_business.setFocusable(false);
-//            tv_visit_content.setFocusable(false);
-//            tv_visit_theme.setFocusable(false);
-//            tv_address_login.setFocusable(false);
-//            tv_linksman_login.setFocusable(false);
-//        }
+//        setFocusable(tv_date_start, isMe);
+//        setFocusable(tv_date_end, isMe);
+//        setFocusable(tv_customer_login, isMe);
+//        setFocusable(tv_visit_steps, isMe);
+//        setFocusable(tv_relate_business, isMe);
+
+//        setFocusable(tv_visit_content, isMe);
+//        setFocusable(tv_visit_theme, isMe);
+//        setFocusable(tv_address_login, isMe);
+//        setFocusable(tv_linksman_login, isMe);
+
+
+        if (isMe) {
+            tv_date_start.setOnClickListener(this);
+            tv_date_end.setOnClickListener(this);
+            tv_date_start.setKeyListener(null);
+            tv_date_end.setKeyListener(null);
+            tv_customer_login.setOnClickListener(this);
+            tv_visit_steps.setKeyListener(null);
+            tv_relate_business.setKeyListener(null);
+            tv_visit_steps.setOnClickListener(this);
+            tv_relate_business.setOnClickListener(this);
+        } else {
+            //当不可编辑tv_date_end
+            tv_date_start.setFocusable(false);
+            tv_date_end.setFocusable(false);
+            tv_customer_login.setFocusable(false);
+            tv_visit_steps.setFocusable(false);
+            tv_relate_business.setFocusable(false);
+            tv_visit_content.setFocusable(false);
+            tv_visit_theme.setFocusable(false);
+            tv_address_login.setFocusable(false);
+            tv_linksman_login.setFocusable(false);
+        }
     }
 
     private void initData() {
@@ -166,10 +166,9 @@ public class VisitReportAddActivity extends BaseActivity implements View.OnClick
 //            tv_visit_content.setText(getJSONString(object, "vr_detail"));
         } else if (type == 3) {
             //1.开始日期==预计拜访时间  2.客户名称==公司名称  客户地址
-
             String chche = getIntent().getStringExtra("data");
             JSONObject object = JSON.parseObject(chche);
-            vp_id = object.containsKey("object") ? object.getInteger("object") : -1;
+            vp_id = object.containsKey("mpd_id") ? object.getInteger("mpd_id") : -1;
             tv_date_start.setText(getJSONString(object, "mpd_actdate"));
             tv_date_end.setText(getJSONString(object, "mpd_outdate"));
             tv_customer_login.setText(getJSONString(object, "mpd_company"));

+ 15 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/ErpActivity.java

@@ -0,0 +1,15 @@
+package com.xzjmyk.pm.activity.ui.erp.activity.oa;
+
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+
+import com.xzjmyk.pm.activity.R;
+
+public class ErpActivity extends AppCompatActivity {
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_erp);
+    }
+}

+ 11 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/MissionActivity.java

@@ -347,6 +347,12 @@ public class MissionActivity extends BaseActivity implements View.OnClickListene
     }
 
 
+    /**
+     *
+     * @param name
+     * @param dis
+     * @update by 2017/1/11
+     */
     private void setEndTime(String name, final double dis) {
         BaiduMapUtil.getInstence().getDrivingRoute(MyApplication.getInstance().
                 getBdLocationHelper().getCityName(), MyApplication.getInstance().
@@ -378,9 +384,14 @@ public class MissionActivity extends BaseActivity implements View.OnClickListene
 
     /**
      * @param time 秒
+     * @update by 2017/1/11
      */
     private void setVoisitTime(long time) {
+        //TODO 修改通过经纬度获取地址,在通过地址获取路线
         String realTime = TimeUtils.f_long_2_str(System.currentTimeMillis() + (time * 1000));
+
+
+
         adapter.getModels().get(position).setVisitTime(realTime);
         adapter.notifyItemChanged(position);
     }

+ 2 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/OAActivity.java

@@ -616,6 +616,8 @@ public class OAActivity extends BaseActivity implements View.OnClickListener, Wo
         for (int i = 0; i < array.size(); i++) {
             object = array.getJSONObject(i);
             time = getTimeForObject(object);
+            if (adapter.isOutplan(object) && !StringUtils.isEmpty(adapter.getJSONString(object, "mpd_status")) && "已完成".equals(adapter.getJSONString(object, "mpd_status")))
+                continue;
             if (!StringUtils.isEmpty(time) && getIsDecorat(time, TimeUtils.s_format.format(curDate))) {//该时间为选择时间
                 //判断是否为该下属
                 chche.add(object);

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

@@ -107,11 +107,10 @@ public class HttpUtil {
             if (params != null && !params.isEmpty()) {
                 Set<Entry<String, Object>> entrys = params.entrySet();
                 for (Map.Entry<String, Object> entry : entrys) {
-                    nvps.add(new BasicNameValuePair(entry.getKey(),
-                            URLDecoder.decode(
-                                    entry.getValue().toString()
-                                    , "utf-8")
-                    ));
+                    if (entry.getValue() != null)
+                        nvps.add(new BasicNameValuePair(entry.getKey(), URLDecoder.decode(entry.getValue().toString(), "utf-8")));
+                    else
+                        nvps.add(new BasicNameValuePair(entry.getKey(), URLDecoder.decode("", "utf-8")));
                 }
             }
             httpPost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));

+ 3 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/net/ViewUtil.java

@@ -190,7 +190,7 @@ public class ViewUtil {
                 crouton.show();
             }
         } else {
-            if(cont!=null) {
+            if (cont != null) {
                 Toast.makeText(cont, msg, Toast.LENGTH_SHORT).show();
             }
         }
@@ -811,6 +811,8 @@ public class ViewUtil {
                 response = HttpUtil.sendPostRequest(url, params, headers, false);
             }
         } catch (Exception e) {
+            if (e != null)
+                Log.i("gongpengming", "httpSendTask Exception=" + e.getMessage());
             e.printStackTrace();
         }
         return response;

+ 177 - 0
WeiChat/src/main/res/layout/activity_erp.xml

@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.handmark.pulltorefresh.library.PullToRefreshScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/pullrefresh_sv"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="#EBE9E9"
+    android:fillViewport="true"
+    android:focusableInTouchMode="true">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:focusableInTouchMode="true"
+        android:orientation="vertical">
+
+        <LinearLayout
+            android:id="@+id/oamain_head_menu_ll"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:focusable="true"
+            android:focusableInTouchMode="true"
+            android:orientation="vertical">
+            <!--头布局-->
+            <LinearLayout
+                android:id="@+id/oa_rl_choose"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_below="@+id/toobar"
+                android:background="#6A6A6A"
+                android:orientation="vertical"
+                android:paddingTop="10dp">
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                    android:paddingBottom="10dp">
+
+                    <TextView
+                        android:id="@+id/work_tv"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:drawablePadding="@dimen/drawable_padding"
+                        android:drawableTop="@drawable/oa_1"
+                        android:gravity="center"
+                        android:text="打卡签到"
+                        android:textColor="@color/white" />
+
+                    <TextView
+                        android:id="@+id/mission_tv"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="2dp"
+                        android:layout_weight="1"
+                        android:drawablePadding="@dimen/drawable_padding"
+                        android:drawableTop="@drawable/oa_2"
+                        android:gravity="center"
+                        android:text="外勤签到"
+                        android:textColor="@color/white" />
+
+                    <TextView
+                        android:id="@+id/worklog_tv"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="2dp"
+                        android:layout_weight="1"
+                        android:drawablePadding="@dimen/drawable_padding"
+                        android:drawableTop="@drawable/oa_4"
+                        android:gravity="center"
+                        android:text="工作日报"
+                        android:textColor="@color/white" />
+
+                    <LinearLayout
+                        android:id="@+id/oamain_more_menu_ll"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="2dp"
+                        android:layout_weight="1"
+                        android:orientation="vertical">
+
+                        <ImageView
+                            android:id="@+id/oamain_more_menu_iv"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:gravity="center"
+                            android:src="@drawable/ic_oa_more" />
+
+                        <TextView
+                            android:id="@+id/more_menu_tv"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginTop="5dp"
+                            android:gravity="center"
+                            android:text="更多"
+                            android:textColor="@color/white" />
+                    </LinearLayout>
+
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                    android:paddingBottom="10dp">
+
+
+                    <!--<TextView
+                        android:id="@+id/stroke"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="2dp"
+                        android:layout_weight="1"
+                        android:drawablePadding="@dimen/drawable_padding"
+                        android:drawableTop="@drawable/oa_6"
+                        android:gravity="center"
+                        android:text="我的行程"
+                        android:textColor="@color/white" />-->
+
+
+                    <TextView
+                        android:id="@+id/meeting"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="2dp"
+                        android:layout_weight="1"
+                        android:drawablePadding="@dimen/drawable_padding"
+                        android:drawableTop="@drawable/oa_3"
+                        android:gravity="center"
+                        android:text="会议管理"
+                        android:textColor="@color/white" />
+
+                    <TextView
+                        android:id="@+id/erp"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="2dp"
+                        android:layout_weight="1"
+                        android:drawablePadding="@dimen/drawable_padding"
+                        android:drawableTop="@drawable/oa_5"
+                        android:gravity="center"
+                        android:text="请假申请"
+                        android:textColor="@color/white" />
+
+                    <TextView
+                        android:id="@+id/outtask"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="2dp"
+                        android:layout_weight="1"
+                        android:drawablePadding="@dimen/drawable_padding"
+                        android:drawableTop="@drawable/oa_chuchai"
+                        android:gravity="center"
+                        android:text="出差申请"
+                        android:textColor="@color/white" />
+
+                    <TextView
+                        android:id="@+id/oamain_overtime_apply_tv"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="2dp"
+                        android:layout_weight="1"
+                        android:drawablePadding="@dimen/drawable_padding"
+                        android:drawableTop="@drawable/oa_jiaban"
+                        android:gravity="center"
+                        android:text="加班申请"
+                        android:textColor="@color/white" />
+
+                </LinearLayout>
+
+            </LinearLayout>
+
+        </LinearLayout>
+
+
+    </LinearLayout>
+</com.handmark.pulltorefresh.library.PullToRefreshScrollView>