فهرست منبع

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

Arison 8 سال پیش
والد
کامیت
ee8957b0c3

+ 12 - 12
WeiChat/src/main/java/com/xzjmyk/pm/activity/wxapi/WXPayEntryActivity.java

@@ -3,6 +3,7 @@ package com.xzjmyk.pm.activity.wxapi;
 import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
+import android.widget.Toast;
 
 import com.core.app.Constants;
 import com.tencent.mm.opensdk.constants.ConstantsAPI;
@@ -11,6 +12,7 @@ import com.tencent.mm.sdk.modelbase.BaseResp;
 import com.tencent.mm.sdk.openapi.IWXAPI;
 import com.tencent.mm.sdk.openapi.IWXAPIEventHandler;
 import com.tencent.mm.sdk.openapi.WXAPIFactory;
+import com.xzjmyk.pm.activity.R;
 
 public class WXPayEntryActivity extends Activity implements IWXAPIEventHandler {
     private IWXAPI api;
@@ -36,21 +38,19 @@ public class WXPayEntryActivity extends Activity implements IWXAPIEventHandler {
 
     @Override
     public void onResp(BaseResp resp) {
-
-        // 0 支付成功
-        // -2取消
+        /**
+         * 0 支付成功
+         * -1 支付错误
+         * -2 用户取消
+         */
         if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
-//			AlertDiaWedroidLog.Builder builder = new AlertDiaWedroidLog.Builder(this);
-//			builder.setTitle(R.string.app_tip);
-//			builder.setMessage(getString(R.string.pay_result_callback_msg, String.valueOf(resp.errCode)));
-//			builder.show();
-            Intent mIntent = new Intent("wxpay");
             if (resp.errCode == 0) {
-                mIntent.putExtra("result", true);
-            } else {
-                mIntent.putExtra("result", false);
+                Toast.makeText(this, R.string.str_error_wechat_pay_success, Toast.LENGTH_LONG).show();
+            } else if (resp.errCode == -1) {
+                Toast.makeText(this, R.string.str_error_wechat_pay_fail, Toast.LENGTH_LONG).show();
+            } else if (resp.errCode == -2) {
+                Toast.makeText(this, R.string.str_error_wechat_pay_cancel, Toast.LENGTH_LONG).show();
             }
-            sendBroadcast(mIntent);
         }
         finish();
     }

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

@@ -23,6 +23,15 @@
         "menuUrl": "",
         "caller": "",
         "isHide": false
+      },
+      {
+        "isLocalMenu": true,
+        "menuName": "商旅服务",
+        "menuIcon": "",
+        "menuActivity": "com.modular.work.BusinessTravelActivity",
+        "menuUrl": "",
+        "caller": "",
+        "isHide": false
       }
     ]
   },

+ 3 - 0
app_core/common/src/main/java/com/core/app/Constants.java

@@ -454,5 +454,8 @@ public class Constants {
     public interface FLAG {
         String DEVICE_CALLER = "device_caller";
         String DEVICE_CLASS = "device_class";
+        String DEVICE_WHICH_PAGE = "device_which_page";
+        String DEVICE_FROM_COMMON = "device_from_common";
+        String DEVICE_FROM_QUERY = "device_from_common";
     }
 }

+ 6 - 0
app_modular/apputils/src/main/res/values-en/strings.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="str_error_wechat_pay_success">支付成功</string>
+    <string name="str_error_wechat_pay_fail">支付失败</string>
+    <string name="str_error_wechat_pay_cancel">支付已取消</string>
+</resources>

+ 6 - 0
app_modular/apputils/src/main/res/values-zh-rCN/strings.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="str_error_wechat_pay_success">支付成功</string>
+    <string name="str_error_wechat_pay_fail">支付失败</string>
+    <string name="str_error_wechat_pay_cancel">支付已取消</string>
+</resources>

+ 6 - 0
app_modular/apputils/src/main/res/values-zh-rTW/strings.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="str_error_wechat_pay_success">支付成功</string>
+    <string name="str_error_wechat_pay_fail">支付失败</string>
+    <string name="str_error_wechat_pay_cancel">支付已取消</string>
+</resources>

+ 3 - 0
app_modular/apputils/src/main/res/values/strings.xml

@@ -1,3 +1,6 @@
 <resources>
     <string name="app_name">AppUtils</string>
+    <string name="str_error_wechat_pay_success">支付成功</string>
+    <string name="str_error_wechat_pay_fail">支付失败</string>
+    <string name="str_error_wechat_pay_cancel">支付已取消</string>
 </resources>

+ 51 - 38
app_modular/appworks/src/main/java/com/uas/appworks/activity/DeviceQueryActivity.java

@@ -79,10 +79,10 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
     private int mPageIndex = 1, mPageSize = 25;
     private List<DataInquiryFlexBean> mDeviceQueryFlexBeans;
     private DataInquiryFlexAdapter mDeviceQueryFlexAdapter;
-    private List<DataInquiryFlexBean.RowBean.RowChildBean> mAllRowChildBeans;
+    private List<DataInquiryFlexBean.RowBean.RowChildBean> mRowChildBeans, mAllRowChildBeans;
     private String mFuzzyField = "";
     private int mOldPosition = -1;
-    private String mCaller = "Device", mClass;
+    private String mCaller = "Device", mClass, mWhichPage;
 
     @Override
     protected int getLayout() {
@@ -137,12 +137,17 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
         if (intent != null) {
             mCaller = intent.getStringExtra(Constants.FLAG.DEVICE_CALLER);
             mClass = intent.getStringExtra(Constants.FLAG.DEVICE_CLASS);
+            mWhichPage = intent.getStringExtra(Constants.FLAG.DEVICE_WHICH_PAGE);
         }
 
         if (TextUtils.isEmpty(mCaller)) {
             mCaller = "Device";
         }
 
+        if (TextUtils.isEmpty(mWhichPage)) {
+            mWhichPage = Constants.FLAG.DEVICE_FROM_QUERY;
+        }
+
         if (!TextUtils.isEmpty(mClass)) {
             String dc_class = "dc_class";
 //            if (mCaller != null && mCaller.equals("DeviceChange!Maintain")) {
@@ -197,36 +202,37 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
             @Override
             public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                 int reallyPosition = (int) parent.getItemIdAtPosition(position);
-                List<DataInquiryFlexBean.RowBean> rowBeans = mDeviceQueryFlexAdapter.getObjects().get(reallyPosition).getRowBeans();
-                String keyValue = null, status = null;
-                for (DataInquiryFlexBean.RowBean rowBean : rowBeans) {
-                    List<DataInquiryFlexBean.RowBean.RowChildBean> rowChildBeans = rowBean.getRowChildBeans();
-                    for (DataInquiryFlexBean.RowBean.RowChildBean rowChildBean : rowChildBeans) {
+                if (Constants.FLAG.DEVICE_FROM_COMMON.equals(mWhichPage)) {
+                    String keyValue = null, status = null;
+                    List<DataInquiryFlexBean.RowBean.RowChildBean> childBeans = mDeviceQueryFlexAdapter.getRowChildBeans().get(reallyPosition);
+                    for (DataInquiryFlexBean.RowBean.RowChildBean rowChildBean : childBeans) {
                         if ("dc_id".equals(rowChildBean.getField())) {
                             keyValue = rowChildBean.getValue();
                         }
                         if ("dc_status".equals(rowChildBean.getField())) {
                             status = rowChildBean.getValue();
                         }
+                        if (keyValue != null && status != null) {
+                            break;
+                        }
                     }
-                    if (keyValue != null && status != null) {
-                        break;
-                    }
-                }
-                startActivity(new Intent(mContext, CommonDocDetailsActivity.class)
-                        .putExtra("caller", mCaller)
-                        .putExtra("keyValue", keyValue)
-                        .putExtra("device", true)
-                        .putExtra("status", status));
-                /*if (CommonUtil.isRepeatClick()) {
-                    if (mOldPosition == reallyPosition) {
-                        mDeviceQueryFlexAdapter.getObjects().get(reallyPosition).setIsFlex(!mDeviceQueryFlexAdapter.getObjects().get(reallyPosition).isFlex());
-                        mDeviceQueryFlexAdapter.notifyDataSetChanged();
-                    } else {
-                        mOldPosition = reallyPosition;
+                    startActivity(new Intent(mContext, CommonDocDetailsActivity.class)
+                            .putExtra("caller", mCaller)
+                            .putExtra("keyValue", keyValue)
+                            .putExtra("device", true)
+                            .putExtra("status", status));
+
+                } else {
+                    if (CommonUtil.isRepeatClick()) {
+                        if (mOldPosition == reallyPosition) {
+                            mDeviceQueryFlexAdapter.getObjects().get(reallyPosition).setIsFlex(!mDeviceQueryFlexAdapter.getObjects().get(reallyPosition).isFlex());
+                            mDeviceQueryFlexAdapter.notifyDataSetChanged();
+                        } else {
+                            mOldPosition = reallyPosition;
+                        }
                     }
+                    mOldPosition = reallyPosition;
                 }
-                mOldPosition = reallyPosition;*/
             }
         });
         mDataListView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ListView>() {
@@ -547,15 +553,15 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
                         JSONObject columnsObject = columnsArray.getJSONObject(i);
                         if (columnsObject != null) {
                             int width = JSONUtil.getInt(columnsObject, "width");
-                            if (width > 0) {
-                                SchemeConditionBean columnsConditionBean = new SchemeConditionBean();
-                                columnsConditionBean.setCaption(JSONUtil.getText(columnsObject, "caption"));
-                                columnsConditionBean.setField(JSONUtil.getText(columnsObject, "dataIndex"));
-                                columnsConditionBean.setWidth(JSONUtil.getInt(columnsObject, "width"));
-                                columnsConditionBean.setType(JSONUtil.getText(columnsObject, "type"));
-
-                                columnsConditionBeans.add(columnsConditionBean);
-                            }
+//                            if (width > 0) {
+                            SchemeConditionBean columnsConditionBean = new SchemeConditionBean();
+                            columnsConditionBean.setCaption(JSONUtil.getText(columnsObject, "caption"));
+                            columnsConditionBean.setField(JSONUtil.getText(columnsObject, "dataIndex"));
+                            columnsConditionBean.setWidth(JSONUtil.getInt(columnsObject, "width"));
+                            columnsConditionBean.setType(JSONUtil.getText(columnsObject, "type"));
+
+                            columnsConditionBeans.add(columnsConditionBean);
+//                            }
                         }
                     }
 
@@ -593,7 +599,9 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
                     /**
                      * 列表数据解析
                      */
+                    List<List<DataInquiryFlexBean.RowBean.RowChildBean>> rowChildBeans = new ArrayList<>();
                     for (int i = 0; i < listdataArray.size(); i++) {
+                        mRowChildBeans = new ArrayList<>();
                         mAllRowChildBeans = new ArrayList<>();
                         JSONObject listdataObject = listdataArray.getJSONObject(i);
                         if (listdataObject != null) {
@@ -603,6 +611,7 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
                             List<DataInquiryFlexBean.RowBean> rowBeans = new ArrayList<>();
 
                             for (int j = 0; j < columnsConditionBeans.size(); j++) {
+                                int width = columnsConditionBeans.get(j).getWidth();
                                 String field = columnsConditionBeans.get(j).getField();
                                 String type = columnsConditionBeans.get(j).getType();
                                 String caption = columnsConditionBeans.get(j).getCaption();
@@ -614,21 +623,25 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
                                     rowChildBean.setCaption(caption);
                                     rowChildBean.setValue(value);
                                     rowChildBean.setField(field);
-                                    rowChildBean.setWidth(columnsConditionBeans.get(j).getWidth());
+                                    rowChildBean.setWidth(width);
 
                                     mAllRowChildBeans.add(rowChildBean);
+                                    if (width > 0) {
+                                        mRowChildBeans.add(rowChildBean);
+                                    }
                                 }
                             }
+                            rowChildBeans.add(mAllRowChildBeans);
 
-                            for (int k = 0; k < mAllRowChildBeans.size(); k++) {
+                            for (int k = 0; k < mRowChildBeans.size(); k++) {
                                 DataInquiryFlexBean.RowBean rowBean = new DataInquiryFlexBean.RowBean();
 
                                 List<DataInquiryFlexBean.RowBean.RowChildBean> childBeans = new ArrayList<>();
 
-                                DataInquiryFlexBean.RowBean.RowChildBean rowChildBean1 = mAllRowChildBeans.get(k);
+                                DataInquiryFlexBean.RowBean.RowChildBean rowChildBean1 = mRowChildBeans.get(k);
                                 childBeans.add(rowChildBean1);
-                                if (rowChildBean1.getWidth() <= 100 && k < (mAllRowChildBeans.size() - 1)) {
-                                    DataInquiryFlexBean.RowBean.RowChildBean rowChildBean2 = mAllRowChildBeans.get(k + 1);
+                                if (rowChildBean1.getWidth() <= 100 && k < (mRowChildBeans.size() - 1)) {
+                                    DataInquiryFlexBean.RowBean.RowChildBean rowChildBean2 = mRowChildBeans.get(k + 1);
                                     if (rowChildBean2.getWidth() <= 100) {
                                         childBeans.add(rowChildBean2);
                                         k++;
@@ -640,10 +653,10 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
                                 rowBeans.add(rowBean);
                             }
                             deviceQueryFlexBean.setRowBeans(rowBeans);
-
                             mDeviceQueryFlexBeans.add(deviceQueryFlexBean);
                         }
                     }
+                    mDeviceQueryFlexAdapter.setRowChildBeans(rowChildBeans);
                     mDeviceQueryFlexAdapter.notifyDataSetChanged();
                 } catch (Exception e) {
                     mDeviceQueryFlexAdapter.notifyDataSetChanged();

+ 9 - 0
app_modular/appworks/src/main/java/com/uas/appworks/datainquiry/adapter/DataInquiryFlexAdapter.java

@@ -22,6 +22,7 @@ import java.util.List;
 public class DataInquiryFlexAdapter extends BaseAdapter {
     private final int mFlexLines = 3;
     private List<DataInquiryFlexBean> objects = new ArrayList<DataInquiryFlexBean>();
+    private List<List<DataInquiryFlexBean.RowBean.RowChildBean>> mRowChildBeans = new ArrayList<>();
 
     private Context context;
     private LayoutInflater layoutInflater;
@@ -32,6 +33,14 @@ public class DataInquiryFlexAdapter extends BaseAdapter {
         this.objects = objects;
     }
 
+    public List<List<DataInquiryFlexBean.RowBean.RowChildBean>> getRowChildBeans() {
+        return mRowChildBeans;
+    }
+
+    public void setRowChildBeans(List<List<DataInquiryFlexBean.RowBean.RowChildBean>> rowChildBeans) {
+        mRowChildBeans = rowChildBeans;
+    }
+
     public List<DataInquiryFlexBean> getObjects() {
         return objects;
     }