浏览代码

1、审批详情页面,添加多选功能
2、消息页面-知会消息,消息列表反转展示,未读消息展示在列表前列

RaoMeng 6 年之前
父节点
当前提交
a4ed57f5fa

+ 3 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/WebViewLoadActivity.java

@@ -61,6 +61,9 @@ public class WebViewLoadActivity extends BaseActivity {
                         String sessionId = FlexJsonUtil.fromJson(result).get("sessionId").toString();
                         String erpaccount = FlexJsonUtil.fromJson(result).get("erpaccount").toString();
                         String url = bundle.getString("url");
+                        if (url != null) {
+                            url = url.trim();
+                        }
                         String uu = bundle.getString("uu");
                         String master = bundle.getString("master");
                         String name = bundle.getString("name");

+ 3 - 3
WeiChat/version.properties

@@ -1,5 +1,5 @@
-#Tue Nov 26 17:52:52 CST 2019
+#Fri Dec 06 17:35:23 CST 2019
 debugName=972
-versionName=706
+versionName=709
 debugCode=972
-versionCode=260
+versionCode=263

+ 5 - 1
app_core/common/src/main/java/com/core/model/Approval.java

@@ -245,6 +245,8 @@ public class Approval {
             return 2;
         } else if (isDftypeEQ("C")) {
             return 3;
+        } else if (isDftypeEQ("MF")) {
+            return 6;
         } else if (isDBFind()) {
             return 4;
         } else if (isDftypeEQ("B", "YN")) {
@@ -259,7 +261,9 @@ public class Approval {
                 || "DT".equals(dfType)
                 || "C".equals(dfType)
                 || "YN".equals(dfType)
-                || "B".equals(dfType);
+                || "B".equals(dfType)
+                || "MF".equals(dfType)
+                ;
     }
 
     public void data2Values() {

+ 3 - 0
app_core/common/src/main/java/com/core/net/http/ViewUtil.java

@@ -487,6 +487,9 @@ public class ViewUtil {
                 }
             }
         }, 1500);
+        if (erp_baseurl != null) {
+            erp_baseurl = erp_baseurl.trim();
+        }
         if (ct instanceof Activity) {
             if (!StringUtil.isEmpty(CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_baseurl"))) {
             } else {

+ 5 - 3
app_core/common/src/main/java/com/core/widget/view/Activity/SelectActivity.java

@@ -308,11 +308,12 @@ public class SelectActivity extends BaseActivity {
                         bean.setName(item.getString(fieldkey) + "(" + value2 + ")");
                     }
                 }
+                item.put(showKey, bean.getName());
                 // 修改为显示所有的
                 bean.setShowName(getName(item));
                 bean.setDbfinds(dbfindsStr);
                 bean.setFields(JSON.toJSONString(values));
-                bean.setJson(JSON.toJSONString(datas.get(i)));
+                bean.setJson(JSON.toJSONString(item));
                 formBeaan.add(bean);
 
             }
@@ -327,8 +328,9 @@ public class SelectActivity extends BaseActivity {
                 } else {
                     bean.setName(item.getString(fieldkey));
                 }
-                bean.setObject(JSON.toJSONString(datas.get(i)));
-                bean.setJson(JSON.toJSONString(datas.get(i)));
+                item.put(showKey, bean.getName());
+                bean.setObject(JSON.toJSONString(item));
+                bean.setJson(JSON.toJSONString(item));
                 formBeaan.add(bean);
             }
         }

+ 3 - 0
app_modular/appmessages/src/main/java/com/modular/appmessages/activity/AppWebViewActivity.java

@@ -62,6 +62,9 @@ public class AppWebViewActivity extends SupportToolBarActivity {
                         String sessionId = FlexJsonUtil.fromJson(result).get("sessionId").toString();
                         String erpaccount = FlexJsonUtil.fromJson(result).get("erpaccount").toString();
                         String url = bundle.getString("url");
+                        if (url != null) {
+                            url = url.trim();
+                        }
                         String uu = bundle.getString("uu");
                         String master = bundle.getString("master");
                         String name = bundle.getString("name");

+ 73 - 0
app_modular/appmessages/src/main/java/com/modular/appmessages/activity/ApprovalActivity.java

@@ -7,6 +7,7 @@ import android.support.annotation.NonNull;
 import android.support.v7.widget.DefaultItemAnimator;
 import android.support.v7.widget.RecyclerView;
 import android.text.Editable;
+import android.text.TextUtils;
 import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.Menu;
@@ -57,8 +58,10 @@ import com.modular.appmessages.adapter.CrashLinearLayoutManager;
 import com.modular.appmessages.presenter.ApprovaPresenter;
 import com.modular.appmessages.presenter.imp.IApproval;
 import com.modular.apputils.activity.SelectNetAcitivty;
+import com.modular.apputils.model.BillGroupModel;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
@@ -165,6 +168,9 @@ public class ApprovalActivity extends BaseActivity implements IApproval, Approva
             } catch (Exception e) {
                 e.printStackTrace();
             }
+        } else if (100 == requestCode && 0x21 == resultCode) {
+            ArrayList<SelectBean> muliData = data.getParcelableArrayListExtra("data");
+            updateMfFind(muliData);
         }
         super.onActivityResult(requestCode, resultCode, data);
     }
@@ -188,6 +194,51 @@ public class ApprovalActivity extends BaseActivity implements IApproval, Approva
         }
     }
 
+    private void updateMfFind(ArrayList<SelectBean> muliData) {
+        JSONObject object = null;
+        if (!ListUtils.isEmpty(muliData)) {
+            object = JSON.parseObject(muliData.get(0).getJson());
+            String dbFind = muliData.get(0).getDbfinds();
+            for (int i = 1; i < muliData.size(); i++) {
+                SelectBean b = muliData.get(i);
+                JSONObject bObject = JSON.parseObject(b.getJson());
+                for (Map.Entry<String, Object> entry : bObject.entrySet()) {
+                    String oldText = object.getString(entry.getKey());
+                    object.put(entry.getKey(), oldText + "#" + entry.getValue());
+                }
+            }
+            if (!TextUtils.isEmpty(dbFind)) {
+                JSONArray fbFindArray = JSON.parseArray(dbFind);
+                if (!ListUtils.isEmpty(fbFindArray)) {
+                    for (int i = 0; i < fbFindArray.size(); i++) {
+                        String dbGridField = JSONUtil.getText(fbFindArray.getJSONObject(i), "dbGridField");
+                        String field = JSONUtil.getText(fbFindArray.getJSONObject(i), "field");
+                        if (object.containsKey(dbGridField)) {
+                            object.put(field, object.get(dbGridField));
+                            object.remove(dbGridField);
+                        }
+                    }
+                }
+            }
+        }
+        if (object == null) {
+            return;
+        }
+        if (mAdapter != null) {
+            List<Approval> models = mAdapter.getDbFind();
+            for (Approval e : models) {
+                if (e.isNeerInput() && (e.getType() == Approval.MAIN || e.getType() == Approval.DETAIL)) {
+                    for (Map.Entry<String, Object> map : object.entrySet()) {
+                        if (map.getKey().equals(e.getValuesKey()) && map.getValue() != null) {
+                            e.setValues(map.getValue().toString());
+                        }
+                    }
+                }
+            }
+            mAdapter.notifyDataSetChanged();
+        }
+    }
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -259,6 +310,28 @@ public class ApprovalActivity extends BaseActivity implements IApproval, Approva
 
     }
 
+    public void findMore(Approval approval) {
+        HashMap param = new HashMap<>();
+        param.put("caller", approval.getCaller());
+        param.put("page", "1");
+        param.put("which", "form");
+        param.put("condition", "1=1");
+        param.put("pageSize", "1000");
+        param.put("field", approval.getValuesKey());
+        Bundle bundle = new Bundle();
+        bundle.putSerializable("param", param);
+        Intent intent = new Intent(ct, SelectActivity.class);
+        intent.putExtra("type", 1);
+        intent.putExtra("isSingle", false);
+        intent.putExtras(bundle);
+        intent.putExtra("key", "combdatas");
+        intent.putExtra("showKey", approval.getValuesKey());
+        intent.putExtra("action", "common/dbfind.action");
+        intent.putExtra("title", approval.getCaption());
+        intent.putExtra("isForm", approval.getType() == Approval.MAIN);
+        startActivityForResult(intent, 100);
+    }
+
     private void getEmnameByReturn(String text) {
         if (StringUtil.isEmpty(text)) return;
         Pattern pattern = Pattern.compile("(?<=\\()(.+?)(?=\\))");

+ 8 - 5
app_modular/appmessages/src/main/java/com/modular/appmessages/activity/MsgsSecondCommonActivity.java

@@ -46,6 +46,8 @@ import com.lidroid.xutils.ViewUtils;
 import com.modular.appmessages.R;
 
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -283,6 +285,7 @@ public class MsgsSecondCommonActivity extends SupportToolBarActivity implements
     private void loadLocalData(String msg_type) {
         msgModel = MessageDao.getInstance().queryByType(msg_type);
         if (!ListUtils.isEmpty(msgModel)) { //当数据库中有数据时,
+            Collections.reverse(msgModel);//反转数据,将最新数据展示在列表前面
             if (!TextUtils.isEmpty(mark_time)) {
                 doSecondMarkSave(msgModel, mark_time); // 当第一层 有标为已读标志时,进行第二次更新本地及新来消息否读状态
             } else {
@@ -328,7 +331,7 @@ public class MsgsSecondCommonActivity extends SupportToolBarActivity implements
 
         msgAdapter.setMsgModel(msgModel);
         msgAdapter.notifyDataSetChanged();
-        myplv.getRefreshableView().setSelection(msgModel.size() - 1);
+//        myplv.getRefreshableView().setSelection(msgModel.size() - 1);
     }
 
     private void doSecondMarkSave(List<MessageModel> msgModel, String mark_time) {
@@ -437,18 +440,18 @@ public class MsgsSecondCommonActivity extends SupportToolBarActivity implements
     }
 
 
-    private void doClickEvent(int mPosition, MessageModel model ) {
+    private void doClickEvent(int mPosition, MessageModel model) {
         baseUrl = CommonUtil.getAppBaseUrl(ct);
         String url = baseUrl + "mobile/message/getDetail.action?id=" + model.getId();
-        Intent intent_web = new Intent(ct,MsgThirdWebActivity.class);
+        Intent intent_web = new Intent(ct, MsgThirdWebActivity.class);
         intent_web.putExtra(IntentUtils.KEY_URL, url);
         intent_web.putExtra(IntentUtils.KEY_TITLE, msg_title);
         intent_web.putExtra(IntentUtils.KEY_NEER_COOKIE, true);
         intent_web.putExtra(IntentUtils.KEY_NEER_SHARE, false);
         intent_web.putExtra(IntentUtils.KEY_SHARE_IMAGE, "");
         intent_web.putExtra(IntentUtils.KEY_SHARE_CONTENT, "");
-        intent_web.putExtra("caller",model.getCaller());
-        intent_web.putExtra("keyValue",model.getKeyValue());
+        intent_web.putExtra("caller", model.getCaller());
+        intent_web.putExtra("keyValue", model.getKeyValue());
         startActivityForResult(intent_web, MSG_MARKED_READED);
 //        intent_web.putExtra("url", url + "?id=" + msg_id);
 //        intent_web.putExtra("title", msg_title);

+ 4 - 0
app_modular/appmessages/src/main/java/com/modular/appmessages/adapter/ApprovalAdapter.java

@@ -473,6 +473,7 @@ public class ApprovalAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
                 case 2:
                 case 3:
                 case 4:
+                case 6:
                     if (approval.isMustInput()) {
                         holder.valueEt.setHint(R.string.common_select);
                     } else {
@@ -489,6 +490,9 @@ public class ApprovalAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
                             } else if (type == 4) {
                                 ct.toDbFind(approval);
                                 dbfindItem = position;
+                            } else if (type == 6) {
+                                ct.findMore(approval);
+                                dbfindItem = position;
                             } else {
                                 selectItem(approval, position);
                             }

+ 6 - 0
app_modular/apputils/src/main/java/com/modular/apputils/activity/BillDetailsActivity.java

@@ -261,6 +261,9 @@ public class BillDetailsActivity extends OABaseActivity implements IBillDetails,
 
     @Override
     public void addTopLayout(View... view) {
+        if (mTopLayout == null) {
+            return;
+        }
         if (view != null && view.length > 0) {
             mTopLayout.addView(view[0]);
             if (view.length > 1 && view[1] instanceof TabLayout) {
@@ -303,6 +306,9 @@ public class BillDetailsActivity extends OABaseActivity implements IBillDetails,
 
     @Override
     public void showHeaderLayout(boolean show) {
+        if (mHeaderLayout == null) {
+            return;
+        }
         if (show) {
             String loginUserId = MyApplication.getInstance().mLoginUser.getUserId();
             AvatarHelper.getInstance().display(loginUserId, mHeaderImageView, true, false);