Browse Source

Merge branch 'developer' of https://gitlab.com/Arisono/SkWeiChat-Baidu into gitlab_developer

Arison 9 years ago
parent
commit
218dfc763a

+ 1 - 1
WeiChat/build.gradle

@@ -4,7 +4,7 @@ apply plugin: 'com.getkeepsafe.dexcount'
 android {
     signingConfigs {
         config {
-            storeFile file('D:/config/applicationsignname[20150409]')
+            storeFile file('E:/CompanyProject/applicationsignname[20150409]')
             storePassword '13237658359'
             keyAlias 'jie-20150409'
             keyPassword '13237658359'

+ 0 - 1
WeiChat/src/main/AndroidManifest.xml

@@ -590,7 +590,6 @@
         <activity android:name=".ui.erp.activity.me.FeedbackActivity"
             android:windowSoftInputMode="stateHidden|stateAlwaysHidden">
         </activity>
-        <activity android:name=".ui.erp.activity.me.FeedbackActivity" />
         <activity android:name=".ui.erp.activity.oa.OAMainActivity"/>
     </application>
 

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

@@ -145,9 +145,11 @@ public class VisitReportAddActivity extends BaseActivity implements View.OnClick
     private Handler mHandler = new Handler() {
         @Override
         public void handleMessage(Message msg) {
+            if (progressDialog != null && progressDialog.isShowing())
+                progressDialog.dismiss();
             switch (msg.what) {
                 case Constants.HTTP_SUCCESS_INIT:
-                    progressDialog.dismiss();
+
                     Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
                     ToastMessage("保存成功!");
 
@@ -166,12 +168,12 @@ public class VisitReportAddActivity extends BaseActivity implements View.OnClick
                     endActivity();
                     break;
                 case Constants.APP_SOCKETIMEOUTEXCEPTION:
-                    progressDialog.dismiss();
+
                     Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
                     ToastMessage(msg.getData().getString("result"));
                     break;
                 case 3:
-                    progressDialog.dismiss();
+
                     lists.clear();
                     Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
                     String json = msg.getData().getString("result");
@@ -192,7 +194,6 @@ public class VisitReportAddActivity extends BaseActivity implements View.OnClick
                     mVrId = resultJsonObject.getInteger("id");
                     break;
                 case LOAD_JIEDUAN:
-                    progressDialog.dismiss();
                     lists.clear();
                     Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
                     String jieduanJson = msg.getData().getString("result");
@@ -274,7 +275,8 @@ public class VisitReportAddActivity extends BaseActivity implements View.OnClick
         } else {
             return;
         }
-        progressDialog.show();
+        if (progressDialog != null)
+            progressDialog.show();
         String url = Constants.getAppBaseUrl(ct) + "crm/customermgr/saveVisitRecord.action";
         Map<String, Object> params = new HashMap<>();
         params.put("formStore", formStore);
@@ -372,19 +374,6 @@ public class VisitReportAddActivity extends BaseActivity implements View.OnClick
         }
     }
 
-    /**
-     * @desc:加载阶段
-     * @author:Arison on 2016/7/20
-     */
-    public void loadJieDuan() {
-        progressDialog.show();
-        String url = Constants.getAppBaseUrl(ct) + "/mobile/crm/getBusinessChanceStage.action";
-        Map<String, Object> params = new HashMap<>();
-        params.put("condition", "1=1");
-        LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
-        headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
-        com.xzjmyk.pm.activity.ui.erp.net.ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, LOAD_JIEDUAN, null, null, "post");
-    }
 
     private void showDateDialog(final FormEditText tv) {
         DateTimePicker picker = new DateTimePicker(this, DateTimePicker.HOUR_OF_DAY);
@@ -411,26 +400,17 @@ public class VisitReportAddActivity extends BaseActivity implements View.OnClick
         picker.show();
 
     }
-//    private void getCodeByNet() {
-//        String url = Constants.getAppBaseUrl(ct) + "mobile/crm/updateVistPlan.action";
-//        final Map<String, Object> param = new HashMap<>();
-//        String caller = "VisitRecord";
-//        param.put("caller", caller);
-//        param.put("type", 2);
-//        param.put("sessionId", CommonUtil.getSharedPreferences(ct, "sessionId"));
-//        LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
-//        headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
-//        ViewUtil.httpSendRequest(ct, url, param, mHandler, headers, codeWhat, null, null, "post");
-//    }
+
 
     //更新
     private void updataCode() {
-        progressDialog.show();
+        if (progressDialog != null)
+            progressDialog.show();
         if (StringUtils.isEmpty(vp_code))
             vp_code = getIntent().getStringExtra("code");
         String url = CommonUtil.getSharedPreferences(this, "erp_baseurl") + "mobile/crm/updateVistPlan.action";
         final Map<String, Object> param = new HashMap<>();
-        param.put("vr_id",mVrId);
+        param.put("vr_id", mVrId);
         param.put("vp_id", vp_id);
         //cu_nichestep商机阶段
         //cu_code客户编号
@@ -443,15 +423,6 @@ public class VisitReportAddActivity extends BaseActivity implements View.OnClick
         com.xzjmyk.pm.activity.ui.erp.net.ViewUtil.httpSendRequest(this, url, param, mHandler, headers, 0x16, null, null, "post");
     }
 
-    private void loadCustomer(int what) {
-        progressDialog.show();
-        String url = Constants.getAppBaseUrl(ct) + "mobile/crm/getCustomerbySeller.action";
-        Map<String, Object> params = new HashMap<>();
-        params.put("sellercode", CommonUtil.getSharedPreferences(ct, "erp_username"));
-        LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
-        headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
-        ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, what, null, null, "post");
-    }
 
     private JSONArray array;
     private SingleDialog singleDialog;

+ 13 - 22
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/OAMainActivity.java

@@ -95,16 +95,20 @@ public class OAMainActivity extends BaseActivity implements View.OnClickListener
     private ImageView ok_scale;
     private boolean isCrm = false;
     private boolean isMe = false;
-    private JSONArray meArray;
-    private JSONArray otherArray;
-    private OAListAdapter adapter;
-    private Set<Integer> meInt;
-    private Set<Integer> otherInt;
-    private int posItem;
+    private JSONArray meArray;    //当月我的数组
+    private JSONArray otherArray; //当月我的下属的数组
+    private OAListAdapter adapter; //当前列表的数据
+    private PagerAdapter pagerAdapter;//当前Viewpager适配器
+    private Date curDate;    //当前显示的日期  包含年月日信息
+
+    private Set<Integer> meInt;     //我的任务
+    private Set<Integer> otherInt;  //我的下属的任务
+    private int posItem;           //当前为滑动到的哪个Viewpager
     private Handler handler = new Handler() {
         @Override
         public void handleMessage(Message msg) {
-            progressDialog.dismiss();
+            if (progressDialog.isShowing())
+                progressDialog.dismiss();
             String message = (String) msg.getData().get("result");
             switch (msg.what) {
                 case 0x11:
@@ -137,8 +141,6 @@ public class OAMainActivity extends BaseActivity implements View.OnClickListener
             }
         }
     };
-    private Date curDate;
-    private PagerAdapter pagerAdapter;
 
     private Collection<? extends Integer> getDay(JSONArray array) {
         JSONObject object = null;
@@ -290,6 +292,7 @@ public class OAMainActivity extends BaseActivity implements View.OnClickListener
      * @param date 月份 yyyyMM
      */
     public void loadNetData(String date) {
+        progressDialog.show();
         String url = CommonUtil.getSharedPreferences(ct, "erp_baseurl") + "mobile/crm/gettaskscheduleandvisitplanmsg.action";
         //获取网络数据
         final Map<String, Object> param = new HashMap<>();
@@ -311,6 +314,7 @@ public class OAMainActivity extends BaseActivity implements View.OnClickListener
         array.addAll(addJsonToArray(chche, "visitRecord"));
     }
 
+    /*添加json数据到数组里面   区别crm和oa*/
     private JSONArray addJsonToArray(JSONObject chche, String key) {
         JSONArray chcheArray = new JSONArray();
         if (chche.containsKey(key) && chche.getJSONArray(key).size() > 0) {
@@ -333,10 +337,8 @@ public class OAMainActivity extends BaseActivity implements View.OnClickListener
         setAdapterBeans();
         if (isMe) {
             setDateToListener(meInt);
-//            setAdapterBeans(meArray);
         } else {
             setDateToListener(otherInt);
-//            setAdapterBeans(otherArray);
         }
     }
 
@@ -577,17 +579,6 @@ public class OAMainActivity extends BaseActivity implements View.OnClickListener
     public void setClickDay(Date date) {
         showDate = date;
         setAdapterBeans();
-//        setAdapterBeans(isMe ? meArray : otherArray);
-//        JSONArray array = isMe ? meArray : otherArray;
-//        if (array == null) return;
-//        JSONObject object = null;
-//        JSONArray chche = new JSONArray();
-//        for (int i = 0; i < array.size(); i++) {
-//            object = array.getJSONObject(i);
-//            if (object.containsKey("startdate") && !StringUtils.isEmpty(object.getString("startdate")) && getIsDecorat(object.getString("startdate"), TimeUtils.s_format.format(date)))
-//                chche.add(object);
-//        }
-//        setAdapterBeans(chche);
     }
 
     /*判断*/

+ 46 - 34
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/view/CustomProgressDialog.java

@@ -15,45 +15,57 @@ import com.xzjmyk.pm.activity.R;
  * @注释:自定义的进度条对话框
  */
 public class CustomProgressDialog extends Dialog {
-	@SuppressWarnings("unused")
-	private Context context = null;
-	private static CustomProgressDialog customProgressDialog = null;
-	
-	public CustomProgressDialog(Context context){
-		super(context);
-		this.context = context;
-	}
-	
-	public CustomProgressDialog(Context context, int theme) {
+    @SuppressWarnings("unused")
+    private Context context = null;
+    private static CustomProgressDialog customProgressDialog = null;
+
+    public CustomProgressDialog(Context context) {
+        super(context);
+        this.context = context;
+    }
+
+    @Override
+    public void show() {
+        if (this != null)
+            super.show();
+    }
+
+    @Override
+    public void dismiss() {
+        if (this != null)
+            super.dismiss();
+    }
+
+    public CustomProgressDialog(Context context, int theme) {
         super(context, theme);
     }
-	
-	public static CustomProgressDialog createDialog(Context context){
-		customProgressDialog = new CustomProgressDialog(context, R.style.CustomProgressDialog);
-		customProgressDialog.setContentView(R.layout.customprogressdialog);
-		customProgressDialog.getWindow().getAttributes().gravity = Gravity.CENTER;
-		//customProgressDialog.setCancelable(false);
-		return customProgressDialog;
-	}
- 
-    public void onWindowFocusChanged(boolean hasFocus){
-    	if (customProgressDialog == null){
-    		return;
-    	}
+
+    public static CustomProgressDialog createDialog(Context context) {
+        customProgressDialog = new CustomProgressDialog(context, R.style.CustomProgressDialog);
+        customProgressDialog.setContentView(R.layout.customprogressdialog);
+        customProgressDialog.getWindow().getAttributes().gravity = Gravity.CENTER;
+        //customProgressDialog.setCancelable(false);
+        return customProgressDialog;
+    }
+
+    public void onWindowFocusChanged(boolean hasFocus) {
+        if (customProgressDialog == null) {
+            return;
+        }
         ImageView imageView = (ImageView) customProgressDialog.findViewById(R.id.loadingImageView);
         AnimationDrawable animationDrawable = (AnimationDrawable) imageView.getBackground();
         animationDrawable.start();
     }
- 
-    public CustomProgressDialog setTitile(String strTitle){
-    	return customProgressDialog;
-    }
-    
-    public CustomProgressDialog setMessage(String strMessage){
-    	TextView tvMsg = (TextView)customProgressDialog.findViewById(R.id.id_tv_loadingmsg);
-    	if (tvMsg != null){
-    		tvMsg.setText(strMessage);
-    	}
-    	return customProgressDialog;
+
+    public CustomProgressDialog setTitile(String strTitle) {
+        return customProgressDialog;
+    }
+
+    public CustomProgressDialog setMessage(String strMessage) {
+        TextView tvMsg = (TextView) customProgressDialog.findViewById(R.id.id_tv_loadingmsg);
+        if (tvMsg != null) {
+            tvMsg.setText(strMessage);
+        }
+        return customProgressDialog;
     }
 }