Browse Source

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

# Conflicts:
#	WeiChat/version.properties
Arison 8 years ago
parent
commit
58f90292c0
30 changed files with 730 additions and 506 deletions
  1. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/adapter/WorkMenuParentAdapter.java
  2. 1 1
      app_core/common/src/main/java/com/common/data/JSONUtil.java
  3. 21 11
      app_core/common/src/main/java/com/core/model/Approval.java
  4. 2 2
      app_core/common/src/main/java/com/core/net/http/ViewUtil.java
  5. 34 6
      app_core/common/src/main/res/layout/item_approval_tag.xml
  6. 35 17
      app_modular/appmessages/src/main/java/com/modular/appmessages/adapter/ApprovalAdapter.java
  7. 1 0
      app_modular/appmessages/src/main/java/com/modular/appmessages/model/ApprovalRecord.java
  8. 33 22
      app_modular/appmessages/src/main/java/com/modular/appmessages/presenter/ApprovaPresenter.java
  9. 0 1
      app_modular/apputils/src/main/java/com/modular/apputils/network/Parameter.java
  10. 0 25
      app_modular/apputils/src/main/java/com/modular/apputils/utils/TravelUtils.java
  11. BIN
      app_modular/apputils/src/main/res/drawable-hdpi/icon_empty_lamp.png
  12. BIN
      app_modular/apputils/src/main/res/drawable-xhdpi/icon_add_circular.png
  13. BIN
      app_modular/apputils/src/main/res/drawable-xhdpi/icon_empty_lamp.png
  14. BIN
      app_modular/apputils/src/main/res/drawable-xxhdpi/icon_add_circular.png
  15. BIN
      app_modular/apputils/src/main/res/drawable-xxhdpi/icon_empty_lamp.png
  16. 1 1
      app_modular/apputils/src/main/res/values/color.xml
  17. 2 0
      app_modular/apputils/src/main/res/values/strings.xml
  18. 1 1
      app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/activity/form/TravelDataFormDetailActivity.java
  19. 84 78
      app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/activity/BusinessTravelActivity.java
  20. 60 128
      app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/adapter/BusinessTravelAdapter.java
  21. 38 48
      app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/model/BusinessTravel.java
  22. 0 1
      app_modular/appworks/src/main/java/com/uas/appworks/activity/CommonDataFormActivity.java
  23. 161 0
      app_modular/appworks/src/main/java/com/uas/appworks/utils/TravelUtils.java
  24. 50 8
      app_modular/appworks/src/main/res/layout/activity_business_travel.xml
  25. 101 85
      app_modular/appworks/src/main/res/layout/item_bus_travel_air.xml
  26. 50 42
      app_modular/appworks/src/main/res/layout/item_bus_travel_hotel.xml
  27. 51 24
      app_modular/appworks/src/main/res/layout/item_bus_travel_title.xml
  28. 1 1
      app_modular/appworks/src/main/res/layout/pop_click_menu.xml
  29. 1 1
      app_modular/appworks/src/main/res/menu/menu_add_travel.xml
  30. 1 2
      app_modular/appworks/src/main/res/menu/menu_common_docdetails.xml

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/adapter/WorkMenuParentAdapter.java

@@ -199,7 +199,7 @@ public class WorkMenuParentAdapter extends BaseAdapter {
                     } else if (ApiUtils.getApiModel() instanceof ApiUAS) {
                         String travelCaller = CommonUtil.getSharedPreferences(context, Constants.WORK_TRAVEL_CALLER_CACHE);
                         if (StringUtil.isEmpty(travelCaller)) {
-                            intent.putExtra("caller", "FeePlease!CCSQ");
+                            intent.putExtra("caller", "FeePlease!CCSQ!new");
                         } else {
                             intent.putExtra("caller", travelCaller);
                         }

+ 1 - 1
app_core/common/src/main/java/com/common/data/JSONUtil.java

@@ -215,7 +215,7 @@ public class JSONUtil {
     public static long getLong(JSONObject object, String... keys) {
         try {
             String i = getDataForJson(object, keys);
-            return Long.valueOf(i);
+            return i==null?0:Long.valueOf(i);
         } catch (Exception e) {
             e.printStackTrace();
             return 0;

+ 21 - 11
app_core/common/src/main/java/com/core/model/Approval.java

@@ -20,6 +20,10 @@ import java.util.Map;
  */
 
 public class Approval {
+    public static final String VALUES_YES = "是";
+    public static final String VALUES_NO = "否";
+    public static final String VALUES_UNKNOWN = "未选择";
+
     public static final int
             TITLE = 11//标题
             , MAIN = 12  //主表
@@ -210,7 +214,7 @@ public class Approval {
      * @return 输入类型:0字符输入  1.数字输入  2.日期输入选择  3.下拉选择  4.dbfind
      */
     public int inputType() {
-       if (isNumber())
+        if (isNumber())
             return 1;
         else if (isDftypeEQ("DT", "D")) {
             return 2;
@@ -218,10 +222,10 @@ public class Approval {
             return 3;
         } else if (isDBFind()) {
             return 4;
-        } else if (isDftypeEQ("B", "YN")){
+        } else if (isDftypeEQ("B", "YN")) {
             return 5;
         }
-            return 0;
+        return 0;
     }
 
     public boolean isSelect() {
@@ -248,22 +252,28 @@ public class Approval {
                 }
             }
         } else if ("C".equals(dfType) || "YN".equals(dfType)) {
-            if (values.equals("-1")) values = "是";
-            else if (values.equals("0")) values = "否";
+            if (values.equals("-1")) {
+                values = VALUES_YES;
+            } else if ("YN".equals(dfType) &&values.equals("1")&& type == DETAIL && isNeerInput()) {
+                values = VALUES_UNKNOWN;
+            } else {
+                values = VALUES_NO;
+            }
             if (!StringUtil.isEmpty(oldValues)) {
-                if (oldValues.equals("-1")) oldValues = "是";
-                else if (oldValues.equals("0")) oldValues = "否";
+                if (oldValues.equals("-1")) oldValues = VALUES_YES;
+                else if (oldValues.equals("0")) oldValues = VALUES_NO;
             }
         } else if ("B".equals(dfType)) {
-            if (values.equals("1")) values = "是";
-            else values = "否";
+            if (values.equals("1")) values = VALUES_YES;
+            else values = VALUES_NO;
             if (!StringUtil.isEmpty(oldValues)) {
-                if (oldValues.equals("1")) oldValues = "是";
-                else oldValues = "否";
+                if (oldValues.equals("1")) oldValues = VALUES_YES;
+                else oldValues = VALUES_NO;
             }
         }
     }
 
+
     public void addValues(String str) {
         values = StringUtil.isEmpty(values) ? str : values + str;
     }

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

@@ -581,7 +581,7 @@ public class ViewUtil {
     public static void LoginSucess(Message msg) {
         String json = msg.getData().getString("result");
         LogUtil.prinlnLongMsg("HttpLogs", "管理平台登录:" + json);
-        CommonUtil.setSharedPreferences(ct, "loginJson", json);
+        CommonUtil.setSharedPreferences(MyApplication.getInstance(), "loginJson", json);
         String phone = msg.getData().getString("phone");
         String password = msg.getData().getString("password");
         try {
@@ -591,7 +591,7 @@ public class ViewUtil {
                 if (object != null && object.containsKey("userName")) {
                     String userName = getNameByB2b(object.getString("userName"), phone);
                     if (!StringUtil.isEmpty(userName))
-                        CommonUtil.setSharedPreferences(ct, "erp_emname", userName);
+                        CommonUtil.setSharedPreferences(MyApplication.getInstance(), "erp_emname", userName);
                 }
             }
         } catch (Exception e) {

+ 34 - 6
app_core/common/src/main/res/layout/item_approval_tag.xml

@@ -1,20 +1,20 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              android:layout_width="match_parent"
-              android:layout_height="wrap_content"
-              android:orientation="vertical">
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical">
 
     <View
         android:id="@+id/padding"
         android:layout_width="match_parent"
         android:layout_height="@dimen/paddingApp"
-        android:background="@color/item_line"/>
+        android:background="@color/item_line" />
 
     <View
         android:id="@+id/line"
         android:layout_width="match_parent"
         android:layout_height="2px"
-        android:background="@color/item_line"/>
+        android:background="@color/item_line" />
 
     <TextView
         android:id="@+id/tagTv"
@@ -27,5 +27,33 @@
         android:paddingLeft="6dp"
         android:paddingTop="8dp"
         android:text="tagTv"
-        android:textColor="@color/titleBlue"/>
+        android:textColor="@color/titleBlue" />
+
+    <RadioGroup
+        android:id="@+id/valuesRG"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:visibility="gone"
+        android:layout_marginLeft="@dimen/padding"
+        android:orientation="horizontal"
+        android:paddingLeft="@dimen/padding">
+
+        <RadioButton
+            android:id="@+id/yesRB"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="@dimen/padding"
+            android:button="@drawable/oa_checkbox"
+            android:paddingRight="@dimen/padding"
+            android:text="全部采纳" />
+
+        <RadioButton
+            android:id="@+id/notRB"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/padding"
+            android:button="@drawable/oa_checkbox"
+            android:paddingLeft="@dimen/padding"
+            android:text="全部不采纳" />
+    </RadioGroup>
 </LinearLayout>

+ 35 - 17
app_modular/appmessages/src/main/java/com/modular/appmessages/adapter/ApprovalAdapter.java

@@ -283,6 +283,7 @@ public class ApprovalAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
     }
 
     private void bindTAGView(TagViewHolder holder, final int position) {
+        holder.valuesRG.setVisibility(View.GONE);
         String name = approvals.get(position).getCaption();
         if (approvals.get(position).getType() == Approval.ENCLOSURE) {//附件列表
             holder.line.setVisibility(View.GONE);
@@ -295,7 +296,7 @@ public class ApprovalAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
                 }
             });
         } else {
-            if (ListUtils.getSize(approvals) > position + 1 && position > 0) {
+            if (ListUtils.getSize(approvals) > position + 1 && position > 0) {//标题
                 if (approvals.get(position + 1).getType() == approvals.get(position - 1).getType()) {
                     holder.line.setVisibility(View.VISIBLE);
                     holder.padding.setVisibility(View.GONE);
@@ -306,6 +307,19 @@ public class ApprovalAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
                         holder.nameTv.setTextColor(ct.getResources().getColor(R.color.text_normal));
                     } else {
                         holder.nameTv.setTextColor(ct.getResources().getColor(R.color.titleBlue));
+                        if (!TextUtils.isEmpty(approvals.get(position).getValues())) {
+                            holder.valuesRG.setOnCheckedChangeListener(null);
+                            if (approvals.get(position).getValues().equals(Approval.VALUES_YES)) {
+                                holder.yesRB.setChecked(true);
+                                holder.notRB.setChecked(false);
+                            } else if (approvals.get(position).getValues().equals(Approval.VALUES_NO)) {
+                                holder.yesRB.setChecked(false);
+                                holder.notRB.setChecked(true);
+                            }
+                            holder.valuesRG.setVisibility(View.VISIBLE);
+                            holder.valuesRG.setTag(position);
+                            holder.valuesRG.setOnCheckedChangeListener(mOnCheckedChangeListener);
+                        }
                     }
                 }
             }
@@ -347,6 +361,7 @@ public class ApprovalAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
             @Override
             public void onProgress(long allProress, long progress) {
             }
+
             @Override
             public void onSuccess(final File file) {
                 LogUtil.i("onSuccess=" + (file == null ? "" : file.getPath()));
@@ -438,10 +453,10 @@ public class ApprovalAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
                 case 5:
                     setViewShowAble(false, holder.valueEt);
                     setViewShowAble(true, holder.valuesRG);
-                    if (approval.getValues().equals("是") || approval.getValues().equals("0")) {
+                    if (approval.getValues().equals(Approval.VALUES_YES) || approval.getValues().equals("0")) {
                         holder.yesRB.setChecked(true);
                         holder.notRB.setChecked(false);
-                    } else {
+                    } else if (approval.getValues().equals(Approval.VALUES_NO)) {
                         holder.yesRB.setChecked(false);
                         holder.notRB.setChecked(true);
                     }
@@ -487,22 +502,20 @@ public class ApprovalAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
                 int position = (int) group.getTag();
                 if (ListUtils.getSize(approvals) > position) {
                     Approval approval = approvals.get(position);
-                    if (approval.inputType() == 5) {
-                        LogUtil.i("checkedId" + approval.getValues());
-                        if (checkedId == R.id.yesRB) {
-                            if (!"是".equals(approval.getValues())) {
-                                approval.setValues("是");
-//                                notifyItemChanged(position);
-                            }
-                            LogUtil.i("checkedId == R.id.yesRB ");
-                        } else {
-                            LogUtil.i("checkedId !!!!!!= R.id.yesRB ");
-                            if (!"否".equals(approval.getValues())) {
-                                approval.setValues("否");
-//                                notifyItemChanged(position);
+                    boolean select = checkedId == R.id.yesRB;
+                    if (approval.getType() == Approval.TAG) {//全部采纳和全部不采纳
+                        approval.setValues(select ? Approval.VALUES_YES : Approval.VALUES_NO);
+                        for (int i = position + 1; i < ListUtils.getSize(approvals); i++) {
+                            approval = approvals.get(i);
+                            if (approval.getType() == Approval.DETAIL && approval.inputType() == 5 && approval.isNeerInput()) {
+                                approval.setValues(select ? Approval.VALUES_YES : Approval.VALUES_NO);
+                                notifyItemChanged(i);
                             }
                         }
-
+                    } else {
+                        if (approval.inputType() == 5) {
+                            approval.setValues(select ? Approval.VALUES_YES : Approval.VALUES_NO);
+                        }
                     }
                 }
             }
@@ -588,6 +601,8 @@ public class ApprovalAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
     private class TagViewHolder extends RecyclerView.ViewHolder {
         TextView nameTv;
         View padding, line;
+        RadioGroup valuesRG;
+        RadioButton yesRB, notRB;
 
         public TagViewHolder(ViewGroup parent) {
             this(LayoutInflater.from(ct).inflate(R.layout.item_approval_tag, parent, false));
@@ -598,6 +613,9 @@ public class ApprovalAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
             nameTv = (TextView) itemView.findViewById(R.id.tagTv);
             padding = itemView.findViewById(R.id.padding);
             line = itemView.findViewById(R.id.line);
+            valuesRG = itemView.findViewById(R.id.valuesRG);
+            yesRB = itemView.findViewById(R.id.yesRB);
+            notRB = itemView.findViewById(R.id.notRB);
         }
     }
 

+ 1 - 0
app_modular/appmessages/src/main/java/com/modular/appmessages/model/ApprovalRecord.java

@@ -17,6 +17,7 @@ public class ApprovalRecord {
     public String chcheNode = "";
     public String imid = "";
     public String status = "";
+    public String currentNodeMan = "";//当前节点的人员编号
     public String nodeName = "";
     public String needInputKeys = "";
     public String showNeedMessage = "";//保存必填字段时候,,没有填写时候提示信息

+ 33 - 22
app_modular/appmessages/src/main/java/com/modular/appmessages/presenter/ApprovaPresenter.java

@@ -4,7 +4,7 @@ import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
 import android.os.Looper;
-import android.util.Log;
+import android.text.TextUtils;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
@@ -33,7 +33,6 @@ import com.modular.apputils.utils.MathUtil;
 import com.uas.appworks.OA.erp.activity.form.DataFormFieldActivity;
 import com.core.widget.view.selectcalendar.bean.Data;
 
-import java.math.BigDecimal;
 import java.text.DecimalFormat;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -597,7 +596,6 @@ public class ApprovaPresenter implements OnHttpResultListener {
                     public void run() {
                         try {
                             handlerFormandGriddataInThread(JSONUtil.getJSONObject(object, "datas"));
-
                         } catch (Exception e) {
                             LogUtil.i("handlerFormandGriddataInThread =" + e.getMessage());
                             loading = false;
@@ -709,9 +707,9 @@ public class ApprovaPresenter implements OnHttpResultListener {
             JSONObject currentnode = JSONUtil.getJSONObject(object, "currentnode");
             if (currentnode != null) {
                 String recordName = JSONUtil.getText(currentnode, "jp_launcherName");
-                String nodeDealMan = JSONUtil.getText(currentnode, "jp_nodeDealMan");
+                record.currentNodeMan = JSONUtil.getText(currentnode, "jp_nodeDealMan");
                 String launcherCode = JSONUtil.getText(currentnode, "jp_launcherId");
-                iApproval.nodeDealMan(nodeDealMan);
+                iApproval.nodeDealMan(record.currentNodeMan);
                 String nodeName = JSONUtil.getText(currentnode, "jp_nodeName");
                 int keyValue = JSONUtil.getInt(currentnode, "jp_keyValue");
                 record.title = record.callerName = JSONUtil.getText(currentnode, "jp_name");
@@ -776,9 +774,17 @@ public class ApprovaPresenter implements OnHttpResultListener {
                                 false, i == 0);
                         if (!ListUtils.isEmpty(detailedApproval)) {
                             Approval approval = new Approval(Approval.TAG);
+
+                            if (!TextUtils.isEmpty(record.currentNodeMan)
+                                    && record.caller.toUpperCase().equals("INQUIRY")
+                                    && isApprovaling()
+                                    && CommonUtil.getEmcode().equals(record.currentNodeMan)) {
+                                approval.setValues("初始化");
+                            }
                             approval.setCaption(i == 0 ? record.getCallerName() + " 明细" : "");
                             detailedApproval.add(0, approval);
                             detailedList.addAll(detailedApproval);
+
                         }
                     }
                 }
@@ -954,23 +960,24 @@ public class ApprovaPresenter implements OnHttpResultListener {
                 }
             }
             boolean mergeAble = appwidth == 1 || (approval.isDftypeEQ("MT"));
-            approval.data2Values();
             approval.setMustInput(true);
             if (!StringUtil.isEmpty(record.needInputKeys)
                     && ("," + record.needInputKeys + ",").contains("," + valueKey + ",")) {
                 approval.setNeerInput(true);
                 if (approval.getDatas().size() <= 0) {
                     if (approval.isDftypeEQ("YN", "C")) {
-                        approval.getDatas().add(new Approval.Data("-1", "是"));
-                        approval.getDatas().add(new Approval.Data("0", "否"));
+                        approval.getDatas().add(new Approval.Data("-1", Approval.VALUES_YES));
+                        approval.getDatas().add(new Approval.Data("0", Approval.VALUES_NO));
                     } else if (approval.isDftypeEQ("B")) {
-                        approval.getDatas().add(new Approval.Data("1", "是"));
-                        approval.getDatas().add(new Approval.Data("0", "否"));
+                        approval.getDatas().add(new Approval.Data("1", Approval.VALUES_YES));
+                        approval.getDatas().add(new Approval.Data("0", Approval.VALUES_NO));
                     }
                 }
             }
-            if (!isApprovaling())
+            if (!isApprovaling()){
                 approval.setNeerInput(false);
+            }
+            approval.data2Values();
             if ((!approval.isNeerInput() && StringUtil.isEmpty(approval.getValues())) || !showAble || approval.getValues().equals("null") || !showAble || approval.getValues().equals("(null)")) {
                 continue;//如果不是要输入的对象,同时显示值为空,需要隐藏去
             }
@@ -1578,18 +1585,22 @@ public class ApprovaPresenter implements OnHttpResultListener {
                     }
                     return null;
                 } else {
-                    boolean isputed = false;
-                    for (Approval.Data data : approval.getDatas()) {
-                        isputed = false;
-                        if (data.display.equals(approval.getValues())) {
-                            formstore.put(approval.getValuesKey(),
-                                    StringUtil.isEmpty(data.value) ? approval.getValues() : data.value);
-                            isputed = true;
-                            break;
+                    if (approval.getValues().equals(Approval.VALUES_UNKNOWN)) {
+                        formstore.put(approval.getValuesKey(), "1");//添加特殊字符判断
+                    } else {
+                        boolean isputed = false;
+                        for (Approval.Data data : approval.getDatas()) {
+                            isputed = false;
+                            if (data.display.equals(approval.getValues())) {
+                                formstore.put(approval.getValuesKey(),
+                                        StringUtil.isEmpty(data.value) ? approval.getValues() : data.value);
+                                isputed = true;
+                                break;
+                            }
+                        }
+                        if (!isputed) {
+                            formstore.put(approval.getValuesKey(), approval.getValues());
                         }
-                    }
-                    if (!isputed) {
-                        formstore.put(approval.getValuesKey(), approval.getValues());
                     }
                 }
             }

+ 0 - 1
app_modular/apputils/src/main/java/com/modular/apputils/network/Parameter.java

@@ -17,7 +17,6 @@ import java.util.Map;
 
 public class Parameter {
 
-
     public static final String MEDIA_TYPE_XWWW = "application/x-www-form-urlencoded;charset=utf-8";
     public static final String MEDIA_TYPE_JSON = "application/json;charset=utf-8";
     public static final String MEDIA_TYPE_PLAIN = "text/plain;charset=utf-8";

+ 0 - 25
app_modular/apputils/src/main/java/com/modular/apputils/utils/TravelUtils.java

@@ -1,25 +0,0 @@
-package com.modular.apputils.utils;
-
-import android.text.TextUtils;
-
-import com.common.data.TextUtil;
-
-/**
- * Created by Bitlike on 2018/3/23.
- */
-
-public class TravelUtils {
-
-    //TODO 差旅卡号
-    public static String getTraveCode(String cusCode, String master) {
-        if (TextUtils.isEmpty(cusCode)) {
-            switch (master) {
-                default:
-                    return master;
-            }
-        } else {
-            return cusCode;
-        }
-
-    }
-}

BIN
app_modular/apputils/src/main/res/drawable-hdpi/icon_empty_lamp.png


BIN
app_modular/apputils/src/main/res/drawable-xhdpi/icon_add_circular.png


BIN
app_modular/apputils/src/main/res/drawable-xhdpi/icon_empty_lamp.png


BIN
app_modular/apputils/src/main/res/drawable-xxhdpi/icon_add_circular.png


BIN
app_modular/apputils/src/main/res/drawable-xxhdpi/icon_empty_lamp.png


+ 1 - 1
app_modular/apputils/src/main/res/values/color.xml

@@ -6,5 +6,5 @@
     <color name="reactivity">#ef613b</color>
     <color name="indianred_pass">#c84421</color>
     <color name="cui">#5bbcaf</color>
-    <color name="cui_yellow">#89FC71</color>
+    <color name="cui_yellow">#EDFC71</color>
 </resources>

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

@@ -3,4 +3,6 @@
     <string name="str_error_wechat_pay_success">支付成功</string>
     <string name="str_error_wechat_pay_fail">支付失败</string>
     <string name="str_error_wechat_pay_cancel">支付已取消</string>
+    <string name="click_to"><u>点击前往</u></string>
+    <string name="administrators_phone"><u>13430818775</u></string>
 </resources>

+ 1 - 1
app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/activity/form/TravelDataFormDetailActivity.java

@@ -1110,7 +1110,7 @@ public class TravelDataFormDetailActivity extends BaseActivity implements View.O
                             data.getType().equals("DF")) {
                         model.editText.setKeyListener(null);
                         model.editText.setFocusable(false);
-                        model.editText.setHint("请选择(必选)");
+                        model.editText.setHint("F".equals(data.getReadonly())?"请选择(必选)":"请选择");
                     }
                     if (data.isEditing()) {
                         model.editText.setEnabled(true);

+ 84 - 78
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/activity/BusinessTravelActivity.java

@@ -2,13 +2,17 @@ package com.uas.appworks.OA.platform.activity;
 
 import android.content.Intent;
 import android.support.v7.widget.LinearLayoutManager;
+import android.text.TextUtils;
 import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
 import android.widget.PopupWindow;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
 
+import com.afollestad.materialdialogs.MaterialDialog;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -17,24 +21,31 @@ import com.common.config.BaseConfig;
 import com.common.data.DateFormatUtil;
 import com.common.data.JSONUtil;
 import com.common.data.ListUtils;
+import com.common.data.TextUtil;
 import com.common.hmac.Md5Util;
 import com.common.system.DisplayUtil;
+import com.common.system.SystemUtil;
+import com.core.app.Constants;
+import com.core.app.MyApplication;
 import com.core.net.utils.NetUtils;
 import com.core.utils.CommonUtil;
 import com.core.utils.IntentUtils;
 import com.core.utils.ToastUtil;
+import com.iflytek.cloud.thirdparty.V;
 import com.me.network.app.http.Method;
 import com.modular.apputils.activity.BaseNetActivity;
 import com.modular.apputils.listener.OnSmartHttpListener;
 import com.modular.apputils.network.Parameter;
 import com.modular.apputils.network.Tags;
-import com.modular.apputils.utils.TravelUtils;
 import com.modular.apputils.widget.EmptyRecyclerView;
 import com.modular.apputils.widget.SpaceItemDecoration;
 import com.module.recyclerlibrary.ui.refresh.BaseRefreshLayout;
 import com.uas.appworks.OA.platform.adapter.BusinessTravelAdapter;
 import com.uas.appworks.OA.platform.model.BusinessTravel;
 import com.uas.appworks.R;
+import com.uas.appworks.utils.TravelUtils;
+
+import org.xbill.DNS.Master;
 
 import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
@@ -46,9 +57,15 @@ import java.util.Map;
 public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHttpListener {
     private BaseRefreshLayout mRefreshLayout;
     private EmptyRecyclerView mRecyclerView;
+    private RelativeLayout remainRl;
+    private TextView remainTag;
+    private TextView remainTv;
     private BusinessTravelAdapter mAdapter;
     private boolean isLead = false;
     private String cusCode;
+    private String appSceret;
+    private String appkey;
+    private MaterialDialog mDialog;
 
     @Override
     protected int getLayoutId() {
@@ -61,10 +78,12 @@ public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHt
         loadData();
     }
 
+    private boolean isHasMenu;
+
     @Override
     public boolean onPrepareOptionsMenu(Menu menu) {
-        LogUtil.i("onPrepareOptionsMenu=" + isLead);
-        if (isLead) {
+        if (isLead && !isHasMenu) {
+            isHasMenu = true;
             getMenuInflater().inflate(R.menu.menu_add_travel, menu);
         }
         return super.onPrepareOptionsMenu(menu);
@@ -73,7 +92,7 @@ public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHt
     @Override
     public boolean onOptionsItemSelected(MenuItem item) {
         if (R.id.addTravel == item.getItemId()) {
-            reserve();
+            TravelUtils.showSelect(ct, appkey, appSceret, new BusinessTravel());
         }
         return super.onOptionsItemSelected(item);
     }
@@ -87,6 +106,29 @@ public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHt
         LogUtil.i("BusinessTravelActivity");
         mRefreshLayout = findViewById(R.id.mRefreshLayout);
         mRecyclerView = findViewById(R.id.mRecyclerView);
+        remainRl = findViewById(R.id.remainRl);
+        remainTag = findViewById(R.id.remainTag);
+        remainTv = findViewById(R.id.remainTv);
+
+        remainTv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                CharSequence remain = remainTv.getText();
+                if (!TextUtils.isEmpty(remain)) {
+                    LogUtil.i("remain=" + remain);
+                    if (remain.toString().equals(getString(R.string.click_to))) {
+                        Intent intent = new Intent("com.modular.form.TravelDataFormDetailActivity");
+                        String travelCaller = CommonUtil.getSharedPreferences(ct, Constants.WORK_TRAVEL_CALLER_CACHE);
+                        intent.putExtra("caller", TextUtils.isEmpty(travelCaller)?"FeePlease!CCSQ!new":travelCaller);
+                        startActivity(intent);
+                    } else {
+                        SystemUtil.phoneAction(BusinessTravelActivity.this,remain.toString());
+
+                    }
+                }
+
+            }
+        });
         mRefreshLayout.setEnabledPullUp(false);
         mRefreshLayout.setOnRefreshListener(new BaseRefreshLayout.onRefreshListener() {
             @Override
@@ -114,7 +156,6 @@ public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHt
         window.setOutsideTouchable(false);
         window.setFocusable(true);
         int actionBarHeight = getSupportActionBar().getHeight() + DisplayUtil.dip2px(ct, 10);
-
         window.showAtLocation(getWindow().getDecorView(), Gravity.TOP, 0, actionBarHeight);
         window.setOnDismissListener(new PopupWindow.OnDismissListener() {
             @Override
@@ -158,13 +199,15 @@ public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHt
 
 
     private void handlerData(String message) throws Exception {
-        LogUtil.i("handlerData");
+
         JSONObject object = JSON.parseObject(message);
         int isLead = JSONUtil.getInt(object, "isLead");
         cusCode = JSONUtil.getText(object, "travelCard");
+        appkey = JSONUtil.getText(object, "appKey");
+        appSceret = JSONUtil.getText(object, "appSceret");
         //表示可以预定
-        this.isLead = isLead > 0;
-        if (this.isLead) {
+        this.isLead = isLead > 0&&!TextUtils.isEmpty(appkey);
+        if (this.isLead && !isHasMenu) {
             supportInvalidateOptionsMenu();
         }
         JSONArray listdata = JSONUtil.getJSONArray(object, "listdata");
@@ -172,36 +215,62 @@ public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHt
         String cttpid = JSONUtil.getText(object, "em_iccode");
         for (int i = 0; i < listdata.size(); i++) {
             JSONObject data = listdata.getJSONObject(i);
+            String fp_id = JSONUtil.getText(data, "FP_ID");
             long startTime = JSONUtil.getLong(data, "FP_PRESTARTDATE");
             long endTime = JSONUtil.getLong(data, "FP_PREENDDATE");
             JSONArray reimbursements = JSONUtil.getJSONArray(data, "reimbursement");
             List<BusinessTravel> gridModels = new ArrayList<>();
             for (int j = 0; j < reimbursements.size(); j++) {
-                BusinessTravel e = new BusinessTravel(cttpid, startTime, endTime, reimbursements.getJSONObject(j));
+                BusinessTravel e = new BusinessTravel(cttpid, fp_id, startTime, endTime, reimbursements.getJSONObject(j));
                 if (e.getType() != BusinessTravel.TITLE) {
                     gridModels.add(e);
                 }
             }
             if (!ListUtils.isEmpty(gridModels)) {
-                models.add(new BusinessTravel(JSONUtil.getText(data, "FP_CODEDoc")));
+                models.add(BusinessTravel.createTitle(data));
                 models.addAll(gridModels);
             }
         }
-        setAdapter(models);
+        //判断
+        if (TextUtils.isEmpty(appkey)) {
+            remainRl.setVisibility(View.VISIBLE);
+            mRefreshLayout.setVisibility(View.GONE);
+            remainTag.setText("您的账号未开通商旅服务,请联系负责人");
+            remainTv.setText(R.string.administrators_phone);
+        } else {
+            remainRl.setVisibility(View.GONE);
+            mRefreshLayout.setVisibility(View.VISIBLE);
+            setAdapter(models);
+        }
+        if (BaseConfig.isDebug()){
+            LogUtil.i("message="+message);
+        }
     }
 
 
     private void setAdapter(List<BusinessTravel> models) {
         if (mAdapter == null) {
-            mAdapter = new BusinessTravelAdapter(ct, cusCode, models);
-            mRecyclerView.addItemDecoration(new SpaceItemDecoration(30));
+            mAdapter = new BusinessTravelAdapter(ct, appkey, appSceret, models);
+            mRecyclerView.addItemDecoration(new SpaceItemDecoration(10));
             mRecyclerView.setLayoutManager(new LinearLayoutManager(ct));
             mRecyclerView.setAdapter(mAdapter);
         } else {
             mAdapter.setModels(models);
         }
-        if (ListUtils.isEmpty(models) && isLead) {
-            showPop();
+        if (ListUtils.isEmpty(models)) {
+            if (!isLead) {
+                //TODO 非领导没有单号
+                remainRl.setVisibility(View.VISIBLE);
+                mRefreshLayout.setVisibility(View.GONE);
+                remainTag.setText("请先录入出差单");
+                remainTv.setText(R.string.click_to);
+            } else {
+                remainRl.setVisibility(View.GONE);
+                mRefreshLayout.setVisibility(View.VISIBLE);
+            }
+            if (isLead && isHasMenu) {
+                showPop();
+            }
         }
     }
 
@@ -213,67 +282,4 @@ public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHt
         }
     }
 
-
-    private void reserve() {
-        Map<String, Object> map = new HashMap<>();
-        map.put("traverorderno", "RES56884");
-        map.put("product", "index");
-        map.put("costname", "成本中心");
-        map.put("proname", "所属项目");
-        String from = "";
-        String fromcode = "";
-        String arrive = "";
-        String arrivecode = "";
-
-        Map<String, String> routeMap = new HashMap<>();
-        routeMap.put("from", from);
-        routeMap.put("fromcode", fromcode);
-        routeMap.put("arrive", arrive);
-        routeMap.put("arrivecode", arrivecode);
-        routeMap.put("startdate", DateFormatUtil.long2Str(System.currentTimeMillis(), DateFormatUtil.YMD));
-        routeMap.put("arrivedate", DateFormatUtil.long2Str(System.currentTimeMillis() + 24 * 60 * 60 * 1000, DateFormatUtil.YMD));
-        routeMap.put("isCanModify", "1");
-        map.put("route", routeMap);
-
-        //个人中心
-        Map<String, String> custinfoMap = new HashMap<>();
-        custinfoMap.put("backUrl", CommonUtil.getAppBaseUrl(ct));
-        custinfoMap.put("isNeedPush", "1");
-        custinfoMap.put("cusCode", TravelUtils.getTraveCode(cusCode, CommonUtil.getMaster()));//TODO 差旅卡号
-        custinfoMap.put("emCode", CommonUtil.getEmcode());
-        custinfoMap.put("outOrderno", String.valueOf(-1));
-        map.put("custinfo", custinfoMap);
-        String p = JSONUtil.map2JSON(map);
-        turn2Web(p);
-    }
-
-    private void turn2Web(String p) {
-        if (NetUtils.isNetWorkConnected(ct)) {
-            String appkey = "y8gd87dsdkencgzk394k7s5c78io35c";
-            String appSceret = "e212e142a5c9e0590eefb7d9f1bc91d7";
-            String baseUrl = "http://124.254.45.234:8082/oa/caslogin/";
-            if (!BaseConfig.isDebug()) {
-                appkey = "fjdsfnvg6523fsgjkff879fidsf";
-                appSceret = "9891ca5330271eba81ec1332e740c210";
-                baseUrl = "http://h5.auvgo.com/";
-            }
-            String username = CommonUtil.getEmcode();
-            String data = appkey + username.toUpperCase() + appSceret;
-            String key = Md5Util.toMD5(appSceret).toUpperCase();
-            String sign = Md5Util.toMD5(key + data);
-            StringBuilder urlBuilder = new StringBuilder(baseUrl);
-            urlBuilder.append(appkey + "/");
-            urlBuilder.append(username + "/");
-            urlBuilder.append(sign);
-            try {
-                urlBuilder.append("?p=" + URLEncoder.encode(p, "UTF-8"));
-            } catch (UnsupportedEncodingException e) {
-                e.printStackTrace();
-            }
-            LogUtil.i(urlBuilder.toString());
-            IntentUtils.linkCommonWeb(ct, urlBuilder.toString(), "行旅国际", "", "", false, false, false);
-        } else {
-            ToastUtil.showToast(ct, R.string.networks_out);
-        }
-    }
 }

+ 60 - 128
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/adapter/BusinessTravelAdapter.java

@@ -6,10 +6,12 @@ import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.ImageView;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
 
+import com.afollestad.materialdialogs.MaterialDialog;
 import com.alibaba.fastjson.JSON;
 import com.common.LogUtil;
 import com.common.config.BaseConfig;
@@ -23,13 +25,14 @@ import com.core.net.utils.NetUtils;
 import com.core.utils.CommonUtil;
 import com.core.utils.IntentUtils;
 import com.core.utils.ToastUtil;
-import com.modular.apputils.utils.TravelUtils;
 import com.modular.apputils.widget.TravelDirectionView;
 import com.uas.appworks.OA.platform.model.BusinessTravel;
 import com.uas.appworks.R;
+import com.uas.appworks.utils.TravelUtils;
 
 import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -39,14 +42,19 @@ import java.util.Map;
  */
 
 public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements View.OnClickListener {
+    private final String DONE_SUBMIT = "预约/订票";
+    private final String DONE_CANCEL = "查看详情";
+
     private Context ct;
     private List<BusinessTravel> models;
     private String currentName;
-    private String cusCode;
+    private String appkey = null;
+    private String appSceret = null;
 
-    public BusinessTravelAdapter(Context ct,String cusCode, List<BusinessTravel> models) {
+    public BusinessTravelAdapter(Context ct, String appkey, String appSceret, List<BusinessTravel> models) {
         this.ct = ct;
-        this.cusCode = cusCode;
+        this.appkey = appkey;
+        this.appSceret = appSceret;
         this.models = models;
         this.currentName = CommonUtil.getName();
     }
@@ -79,6 +87,7 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
         switch (viewType) {
             case BusinessTravel.AIR:
             case BusinessTravel.TRAIN:
+            case BusinessTravel.UNKOWN:
                 return new AirViewHolder(parent);
             case BusinessTravel.HOTEL:
                 return new HotelViewHolder(parent);
@@ -92,7 +101,7 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
         if (holder != null) {
             BusinessTravel model = models.get(position);
             if (holder instanceof TitleViewHolder) {
-                bindTitleView((TitleViewHolder) holder, model);
+                bindTitleView((TitleViewHolder) holder, model, position);
             } else if (holder instanceof BaseViewHlder) {
                 bindBaseView((BaseViewHlder) holder, model, position);
                 if (holder instanceof AirViewHolder) {
@@ -105,25 +114,49 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
         }
     }
 
-    private void bindTitleView(TitleViewHolder holder, BusinessTravel model) {
+    private void bindTitleView(TitleViewHolder holder, BusinessTravel model, int position) {
         holder.codeTv.setText(model.getCode());
+        holder.addMoreTv.setTag(R.id.tag_key, model);
+        holder.addMoreTv.setTag(R.id.tag_key2, position);
+        holder.addMoreTv.setOnClickListener(this);
+        if (position == 0) {
+            holder.titleLine.setVisibility(View.GONE);
+        } else {
+            holder.titleLine.setVisibility(View.VISIBLE);
+        }
     }
 
-    private final String DONE_SUBMIT = "预约/订票";
-    private final String DONE_CANCEL = "查看详情";
 
     private void bindBaseView(BaseViewHlder holder, BusinessTravel model, int position) {
         holder.codeTv.setText(model.getTitleAndCode());
-        holder.statusTv.setText(model.getStatus());
+        String status = model.getStatus();
+        holder.statusTv.setText(status);
+        if (status.equals(BusinessTravel.EMPTY_STATUS)) {
+            holder.orderInfoRl.setVisibility(View.GONE);
+            holder.userInfoRl.setVisibility(View.GONE);
+            holder.line.setVisibility(View.GONE);
+            model.setExpand(true);
+            holder.subRl.setTag(R.id.tag_key, model);
+            holder.subRl.setTag(R.id.tag_key2, position);
+            holder.subRl.setOnClickListener(this);
+        } else {
+            holder.orderInfoRl.setVisibility(View.VISIBLE);
+            holder.userInfoRl.setVisibility(View.VISIBLE);
+            holder.line.setVisibility(View.VISIBLE);
+            holder.subRl.setOnClickListener(null);
+        }
         holder.nameTv.setText(currentName == null ? "**" : currentName);
         holder.idCardTv.setText(model.getCttpid());
         holder.seatTv.setText(model.getSeat());
-        holder.realFeeTv.setText(model.getRealFee());
+        String realFee = model.getRealFee();
+        realFee = TextUtils.isEmpty(realFee) ? "" : (realFee + "元");
+        holder.realFeeTv.setText(realFee);
         holder.payTypeTv.setText(model.getPayType());
         holder.levelTv.setText(model.getLevel());
         holder.expecteFeeTv.setText(model.getExpecteFee());
         holder.idTypeTv.setText("二代身份证");
-        holder.dateTv.setText(model.getDate());
+        String date = DateFormatUtil.long2Str(model.getStartTime(), DateFormatUtil.YMD);
+        holder.dateTv.setText(date);
         if (StringUtil.isEmpty(model.getStatus()) || StringUtil.isEmpty(model.getCode())) {
             holder.doneTv.setText(DONE_SUBMIT);
             holder.doneTv.setBackgroundResource(R.drawable.text_frame_radian_hint_bg);
@@ -156,9 +189,9 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
         holder.toTimeTv.setText(DateFormatUtil.long2Str(model.getEndTime(), "HH:mm"));
         //行程
 
-        if (TextUtils.isEmpty(fromCity)||TextUtils.isEmpty(toCity)){
+        if (TextUtils.isEmpty(fromCity) || TextUtils.isEmpty(toCity)) {
             holder.tripTv.setText(fromCity + "" + toCity);
-        }else{
+        } else {
             holder.tripTv.setText(fromCity + "-" + toCity);
         }
         holder.mTravelDirectionView.setData(model.getFlightCode(), model.getAllTime());
@@ -183,8 +216,8 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
         if (!StringUtil.isEmpty(model.getCode()) && !StringUtil.isEmpty(model.getStatus())) {
             holder.roomsTv.setText("1间");
         }
-        holder.addressTv.setText(model.getHotelAddress());
-        holder.dateTv.setText(DateFormatUtil.long2Str(DateFormatUtil.YMD));
+        String address = TextUtils.isEmpty(model.getHotelAddress()) ? model.getHotelCity() : model.getHotelAddress();
+        holder.addressTv.setText(address);
         holder.numberSubTv.setText(model.getNumber() + "人");
     }
 
@@ -197,6 +230,8 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
 
     private class TitleViewHolder extends RecyclerView.ViewHolder {
         TextView codeTv;
+        ImageView addMoreTv;
+        View titleLine;
 
         public TitleViewHolder(ViewGroup viewGroup) {
             this(getInflater().inflate(R.layout.item_bus_travel_title, viewGroup, false));
@@ -205,6 +240,8 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
         public TitleViewHolder(View itemView) {
             super(itemView);
             codeTv = itemView.findViewById(R.id.codeTv);
+            titleLine = itemView.findViewById(R.id.titleLine);
+            addMoreTv = itemView.findViewById(R.id.addMoreTv);
         }
     }
 
@@ -214,7 +251,6 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
                 whenLongTv,
                 numberSubTv,//人数
                 numberTv,
-                dateTv,
                 addressTv,  //地址
                 roomsTv;//房间人数
 
@@ -227,7 +263,6 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
             businessNameTv = (TextView) itemView.findViewById(R.id.businessNameTv);
             whenLongTv = (TextView) itemView.findViewById(R.id.whenLongTv);
             numberTv = (TextView) itemView.findViewById(R.id.numberTv);
-            dateTv = (TextView) itemView.findViewById(R.id.dateTv);
             roomsTv = (TextView) itemView.findViewById(R.id.roomsTv);
             addressTv = (TextView) itemView.findViewById(R.id.addressTv);
             numberSubTv = (TextView) itemView.findViewById(R.id.numberSubTv);
@@ -249,10 +284,16 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
                 idTypeTv, //身份类型
                 dateTv;//入住时间|返程时间
         RelativeLayout subRl;
+        RelativeLayout userInfoRl;
+        RelativeLayout orderInfoRl;
+        View line;
 
         public BaseViewHlder(View itemView) {
             super(itemView);
             subRl = (RelativeLayout) itemView.findViewById(R.id.subRl);
+            orderInfoRl = (RelativeLayout) itemView.findViewById(R.id.orderInfoRl);
+            line = itemView.findViewById(R.id.line);
+            userInfoRl = (RelativeLayout) itemView.findViewById(R.id.userInfoRl);
             codeTv = (TextView) itemView.findViewById(R.id.codeTv);
             statusTv = (TextView) itemView.findViewById(R.id.statusTv);
             nameTv = (TextView) itemView.findViewById(R.id.nameTv);
@@ -309,117 +350,8 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
         if (id == R.id.expandTv) {
             model.setExpand(!model.isExpand());
             notifyItemChanged(position);
-        } else if (R.id.doneTv == id && v instanceof TextView) {
-            TextView doneTv = (TextView) v;
-            String doneMessage = StringUtil.getText(doneTv);
-            if (doneMessage.equals(DONE_CANCEL)) {
-                cancel(model);
-            } else {
-                reserve(model);
-            }
-        } else if (R.id.changeTv == id) {
-            change(model);
-        }
-    }
-
-
-    private void cancel(BusinessTravel model) {
-        reserve(model);
-    }
-
-    private void reserve(BusinessTravel model) {
-        Map<String, Object> map = new HashMap<>();
-        map.put("traverorderno", "RES56884");
-        map.put("product", model.getProduct());
-        map.put("costname", "成本中心");
-        map.put("proname", "所属项目");
-        String from = "";
-        String fromcode = "";
-        String arrive = "";
-        String arrivecode = "";
-        switch (model.getType()) {
-            case BusinessTravel.AIR:
-                from = model.getAirStarting();
-                fromcode = model.getAirStartingCode();
-                arrive = model.getAirDestination();
-                arrivecode = model.getAirDestinationCode();
-                break;
-            case BusinessTravel.TRAIN:
-                from = model.getTrainStarting();
-                fromcode = model.getTrainStartingCode();
-                arrive = model.getTrainDestination();
-                arrivecode = model.getTrainDestinationCode();
-                break;
-            case BusinessTravel.HOTEL:
-                from = model.getHotelCity();
-                fromcode = model.getHotelCityCode();
-                break;
-        }
-        Map<String, String> routeMap = new HashMap<>();
-        routeMap.put("from", from);
-        routeMap.put("fromcode", fromcode);
-        routeMap.put("arrive", arrive);
-        routeMap.put("arrivecode", arrivecode);
-        routeMap.put("startdate", DateFormatUtil.long2Str(model.getStartTime(), DateFormatUtil.YMD));
-        routeMap.put("arrivedate", DateFormatUtil.long2Str(model.getEndTime(), DateFormatUtil.YMD));
-        routeMap.put("isCanModify", "1");
-        map.put("route", routeMap);
-
-        //个人中心
-        Map<String, String> custinfoMap = new HashMap<>();
-        custinfoMap.put("backUrl", CommonUtil.getAppBaseUrl(ct));
-        custinfoMap.put("isNeedPush", "1");
-        custinfoMap.put("cusCode", /*URY*/CommonUtil.getMaster());
-        custinfoMap.put("emCode", CommonUtil.getEmcode());
-        custinfoMap.put("outOrderno", String.valueOf(model.getId()));
-        map.put("custinfo", custinfoMap);
-        String p = JSONUtil.map2JSON(map);
-        LogUtil.i("p=" + p);
-        turn2Web(p);
-    }
-
-    private void change(BusinessTravel model) {
-        LogUtil.i("点击了改签");
-        Map<String, Object> map = new HashMap<>();
-        map.put("traverorderno", model.getCode());
-        map.put("product", "airgq");
-        map.put("costname", "成本中心");
-        map.put("proname", "UU互联差旅订票");
-        map.put("fpd_id", model.getId());
-        map.put("master", CommonUtil.getMaster());
-        map.put("baseUrl", CommonUtil.getAppBaseUrl(ct));
-        map.put("emCode",  TravelUtils.getTraveCode(cusCode,CommonUtil.getMaster()));
-        String p = JSONUtil.map2JSON(map);
-        turn2Web(p);
-    }
-
-    private void turn2Web(String p) {
-        if (NetUtils.isNetWorkConnected(ct)) {
-            String appkey = "y8gd87dsdkencgzk394k7s5c78io35c";
-            String appSceret = "e212e142a5c9e0590eefb7d9f1bc91d7";
-            String baseUrl = "http://124.254.45.234:8082/oa/caslogin/";
-            if (!BaseConfig.isDebug()) {
-                appkey = "fjdsfnvg6523fsgjkff879fidsf";
-                appSceret = "9891ca5330271eba81ec1332e740c210";
-                baseUrl = "http://h5.auvgo.com/";
-            }
-            String username = CommonUtil.getEmcode();
-            String data = appkey + username.toUpperCase() + appSceret;
-            String key = Md5Util.toMD5(appSceret).toUpperCase();
-            String sign = Md5Util.toMD5(key + data);
-            StringBuilder urlBuilder = new StringBuilder(baseUrl);
-            urlBuilder.append(appkey + "/");
-            urlBuilder.append(username + "/");
-            urlBuilder.append(sign);
-            try {
-                urlBuilder.append("?p=" + URLEncoder.encode(p, "UTF-8"));
-            } catch (UnsupportedEncodingException e) {
-                e.printStackTrace();
-            }
-            LogUtil.i(urlBuilder.toString());
-            IntentUtils.linkCommonWeb(ct, urlBuilder.toString(), "行旅国际", "", "", false, false, false);
-        } else {
-            ToastUtil.showToast(ct, R.string.networks_out);
+        } else if (R.id.doneTv == id || R.id.subRl == id || R.id.addMoreTv == id) {
+            TravelUtils.reserve(ct, appkey, appSceret, model);
         }
     }
 

+ 38 - 48
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/model/BusinessTravel.java

@@ -3,11 +3,9 @@ package com.uas.appworks.OA.platform.model;
 import android.text.TextUtils;
 
 import com.alibaba.fastjson.JSONObject;
-import com.common.config.BaseConfig;
 import com.common.data.DateFormatUtil;
 import com.common.data.JSONUtil;
 import com.common.data.StringUtil;
-import com.common.data.TextUtil;
 
 
 /**
@@ -15,11 +13,14 @@ import com.common.data.TextUtil;
  */
 
 public class BusinessTravel {
+    public static final String EMPTY_STATUS = "未购票";
     public static final int TITLE = 1;
+    public static final int UNKOWN = 0;
     public static final int AIR = 2;
     public static final int TRAIN = 3;
     public static final int HOTEL = 4;
     private boolean expand;
+    private String fpId;//主表id
     private int id;//明细id
     private int type;
     private int number;
@@ -54,15 +55,26 @@ public class BusinessTravel {
     private String flightCode;
     private String hotelAddress;
 
+    public BusinessTravel() {
 
-    public BusinessTravel(String titleCode) {
-        this.type = TITLE;
-        code = titleCode;
     }
 
-    public BusinessTravel(String cttpid, long dfStartTime, long dfEndTime, JSONObject reimbursement) {
+    public static BusinessTravel createTitle(JSONObject object) {
+        BusinessTravel businessTravel = new BusinessTravel();
+        businessTravel.type = TITLE;
+        businessTravel.fpId = JSONUtil.getText(object, "FP_ID");
+        businessTravel.code = JSONUtil.getText(object, "FP_CODE");
+        businessTravel.startTime = JSONUtil.getLong(object, "FP_PRESTARTDATE");
+        businessTravel.endTime = JSONUtil.getLong(object, "FP_PREENDDATE");
+        return businessTravel;
+
+    }
+
+
+    public BusinessTravel(String cttpid, String fpId, long dfStartTime, long dfEndTime, JSONObject reimbursement) {
         try {
             title = JSONUtil.getText(reimbursement, "FPD_RES_TYPE");
+            this.fpId = fpId;
             endTime = JSONUtil.getLong(reimbursement, "FPD_END_TIME");
             startTime = JSONUtil.getLong(reimbursement, "FPD_START_TIME");
             if (startTime <= 0 && dfStartTime > 0) {
@@ -91,11 +103,6 @@ public class BusinessTravel {
                     hotelCity = JSONUtil.getText(reimbursement, "FPD_HOTEL_CITY");
                     hotelCityCode = JSONUtil.getText(reimbursement, "FPD_CITYCODE5");
                     hotelAddress = JSONUtil.getText(reimbursement, "FPD_HOTEL_ADDRESS");
-                    if (BaseConfig.isDebug()) {
-                        hotelCity = "艺龙测试";
-                        hotelCityCode = "5389";
-
-                    }
                     if (endTime == startTime) {
                         endTime = startTime + 86400000;
                     } else if (DateFormatUtil.long2Str(endTime, DateFormatUtil.YMD).equals(DateFormatUtil.long2Str(startTime, DateFormatUtil.YMD))) {
@@ -103,7 +110,7 @@ public class BusinessTravel {
                     }
                     break;
                 default:
-                    this.type = TITLE;
+                    this.type = UNKOWN;
             }
             flightCode = JSONUtil.getText(reimbursement, "FPD_FLIGHT_CODE");
             status = JSONUtil.getText(reimbursement, "FPD_STATUS");
@@ -127,15 +134,18 @@ public class BusinessTravel {
         }
     }
 
+    public String getFpId() {
+        return fpId;
+    }
 
     public String getProduct() {
-        switch (title) {
-            case "火车票":
+        switch (type) {
+            case AIR:
+                return "air";
+            case TRAIN:
                 return "train";
-            case "住宿":
+            case HOTEL:
                 return "hotel";
-            case "飞机票":
-                return "air";
             default:
                 return "center";
         }
@@ -150,9 +160,6 @@ public class BusinessTravel {
         return type == AIR ? StringUtil.getMessage(airDestination) : StringUtil.getMessage(trainDestination);
     }
 
-    public String getDate() {
-        return type == AIR ? (DateFormatUtil.long2Str(startTime, "yyyy-MM-dd")) : (DateFormatUtil.long2Str(startTime, "yyyy-MM-dd"));
-    }
 
     public String getTitleAndCode() {
         return title + "   " + (StringUtil.isEmpty(code) ? "" : code);
@@ -181,12 +188,16 @@ public class BusinessTravel {
         return type;
     }
 
+    public void setType(int type) {
+        this.type = type;
+    }
+
     public int getNumber() {
         return number;
     }
 
     public long getStartTime() {
-        return startTime;
+        return startTime<=0?System.currentTimeMillis():startTime;
     }
 
     public long getEndTime() {
@@ -202,7 +213,7 @@ public class BusinessTravel {
     }
 
     public String getStatus() {
-        return status == null ? "未购票" : status;
+        return TextUtils.isEmpty(status) ? EMPTY_STATUS : status;
     }
 
     public String getOrderType() {
@@ -214,7 +225,7 @@ public class BusinessTravel {
     }
 
     public String getRealFee() {
-        return TextUtils.isEmpty(realFee) ? "" : (realFee + "元");
+        return TextUtils.isEmpty(realFee) ? "" : realFee;
     }
 
     public String getExpecteFee() {
@@ -250,27 +261,16 @@ public class BusinessTravel {
     }
 
     public String getAirStartingCode() {
-        return StringUtil.isEmpty(airStartingCode) ? (getTestAir(airStarting)) : airStartingCode;
+        return StringUtil.isEmpty(airStartingCode) ? "" : airStartingCode;
     }
 
 
-    private String getTestAir(String air) {
-        if (!BaseConfig.isDebug()) {
-            return "";
-        } else if (air.equals("南宁")) {
-            return "NNG";
-        } else if (air.equals("深圳")) {
-            return "SZX";
-        }
-        return "";
-    }
-
     public String getAirDestination() {
         return airDestination;
     }
 
     public String getAirDestinationCode() {
-        return StringUtil.isEmpty(airDestinationCode) ? (getTestAir(airDestination)) : airDestinationCode;
+        return StringUtil.isEmpty(airDestinationCode) ? "" : airDestinationCode;
     }
 
     public String getTrainStarting() {
@@ -278,7 +278,7 @@ public class BusinessTravel {
     }
 
     public String getTrainStartingCode() {
-        return StringUtil.isEmpty(trainStartingCode) ? (getTestTrain(trainStarting)) : trainStartingCode;
+        return StringUtil.isEmpty(trainStartingCode) ? "" : trainStartingCode;
     }
 
     public String getTrainDestination() {
@@ -286,19 +286,9 @@ public class BusinessTravel {
     }
 
     public String getTrainDestinationCode() {
-        return StringUtil.isEmpty(trainDestinationCode) ? (getTestTrain(trainDestination)) : trainDestinationCode;
+        return StringUtil.isEmpty(trainDestinationCode) ? "" : trainDestinationCode;
     }
 
-    private String getTestTrain(String train) {
-        if (!BaseConfig.isDebug()) {
-            return "";
-        } else if (train.equals("南宁")) {
-            return "2102";
-        } else if (train.equals("深圳")) {
-            return "2003";
-        }
-        return "";
-    }
 
     public String getHotelCity() {
         return hotelCity;

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

@@ -2441,7 +2441,6 @@ public class CommonDataFormActivity extends BaseActivity implements View.OnClick
                         ToastMessage(item.getName() + "不能为空!");
                         return;
                     }
-
                     //日期格式判断
                     if (!StringUtil.isEmpty(startDate) && !StringUtil.isEmpty(endDate)) {
                         if (key.equals(startDate)) {

+ 161 - 0
app_modular/appworks/src/main/java/com/uas/appworks/utils/TravelUtils.java

@@ -0,0 +1,161 @@
+package com.uas.appworks.utils;
+
+import android.app.Activity;
+import android.content.Context;
+import android.text.TextUtils;
+import android.view.View;
+
+import com.afollestad.materialdialogs.MaterialDialog;
+import com.alibaba.fastjson.JSON;
+import com.common.LogUtil;
+import com.common.config.BaseConfig;
+import com.common.data.DateFormatUtil;
+import com.common.data.JSONUtil;
+import com.common.data.StringUtil;
+import com.common.data.TextUtil;
+import com.common.hmac.Md5Util;
+import com.core.app.MyApplication;
+import com.core.net.utils.NetUtils;
+import com.core.utils.CommonUtil;
+import com.core.utils.IntentUtils;
+import com.core.utils.ToastUtil;
+import com.modular.apputils.R;
+import com.uas.appworks.OA.platform.model.BusinessTravel;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by Bitlike on 2018/3/23.
+ */
+
+public class TravelUtils {
+
+    public static void reserve(Context ct, String appkey, String appSceret, BusinessTravel model) {
+        if (model.getType() == BusinessTravel.UNKOWN || BusinessTravel.TITLE == model.getType()) {
+            showSelect(ct, appkey, appSceret, model);
+            return;
+        }
+        LogUtil.i("model=" + JSON.toJSONString(model));
+        Map<String, Object> map = new HashMap<>();
+        map.put("traverorderno", "RES56884");
+        map.put("product", model.getProduct());
+        map.put("costname", "成本中心");
+        map.put("proname", "所属项目");
+        String from = "";
+        String fromcode = "";
+        String arrive = "";
+        String arrivecode = "";
+        switch (model.getType()) {
+            case BusinessTravel.AIR:
+                from = model.getAirStarting();
+                fromcode = model.getAirStartingCode();
+                arrive = model.getAirDestination();
+                arrivecode = model.getAirDestinationCode();
+                break;
+            case BusinessTravel.TRAIN:
+                from = model.getTrainStarting();
+                fromcode = model.getTrainStartingCode();
+                arrive = model.getTrainDestination();
+                arrivecode = model.getTrainDestinationCode();
+                break;
+            case BusinessTravel.HOTEL:
+                from = model.getHotelCity();
+                fromcode = model.getHotelCityCode();
+                break;
+        }
+        Map<String, String> routeMap = new HashMap<>();
+        routeMap.put("from", from);
+        routeMap.put("fromcode", fromcode);
+        routeMap.put("arrive", arrive);
+        routeMap.put("arrivecode", arrivecode);
+        routeMap.put("startdate", DateFormatUtil.long2Str(model.getStartTime(), DateFormatUtil.YMD));
+        routeMap.put("arrivedate", DateFormatUtil.long2Str(model.getEndTime(), DateFormatUtil.YMD));
+        routeMap.put("isCanModify", "1");
+        map.put("route", routeMap);
+
+        //个人中心
+        Map<String, String> otherJSON = new HashMap<>();
+        otherJSON.put("fpid", model.getFpId() == null ? "" : model.getFpId());
+        Map<String, String> custinfoMap = new HashMap<>();
+        custinfoMap.put("backUrl", CommonUtil.getAppBaseUrl(ct));
+        custinfoMap.put("isNeedPush", "1");
+        custinfoMap.put("cusCode", /*URY*/CommonUtil.getMaster());
+        custinfoMap.put("emCode", CommonUtil.getEmcode());
+        custinfoMap.put("outOrderno", model.getId() <= 0 ? "-1" : String.valueOf(model.getId()));
+        map.put("otherContent", StringUtil.toHttpString(JSONUtil.map2JSON(otherJSON)));
+        map.put("custinfo", custinfoMap);
+        String p = JSONUtil.map2JSON(map);
+        LogUtil.i("p=" + p);
+        if (NetUtils.isNetWorkConnected(ct)) {
+            String baseUrl = "http://124.254.45.234:8082/oa/caslogin/";
+//            if (BaseConfig.isDebug()) {
+//                appkey = "y8gd87dsdkencgzk394k7s5c78io35c";
+//                appSceret = "e212e142a5c9e0590eefb7d9f1bc91d7";
+//                baseUrl = "http://124.254.45.234:8082/oa/caslogin/";
+//            } else {
+                baseUrl = "http://h5.auvgo.com/oa/caslogin/";
+                if (TextUtils.isEmpty(appkey)) {
+                    appkey = "fjdsfnvg6523fsgjkff879fidsf";
+                }
+                if (TextUtils.isEmpty(appSceret)) {
+                    appSceret = "9891ca5330271eba81ec1332e740c210";
+                }
+//            }
+            String username = CommonUtil.getEmcode();
+            String data = appkey + username.toUpperCase() + appSceret;
+            String key = Md5Util.toMD5(appSceret).toUpperCase();
+            String sign = Md5Util.toMD5(key + data);
+            StringBuilder urlBuilder = new StringBuilder(baseUrl);
+            urlBuilder.append(appkey + "/");
+            urlBuilder.append(username + "/");
+            urlBuilder.append(sign);
+            try {
+                urlBuilder.append("?p=" + URLEncoder.encode(p, "UTF-8"));
+            } catch (UnsupportedEncodingException e) {
+                e.printStackTrace();
+            }
+            LogUtil.i(urlBuilder.toString());
+            IntentUtils.linkCommonWeb(ct, urlBuilder.toString(), "行旅国际", "", "", false, false, false);
+        } else {
+            ToastUtil.showToast(ct, R.string.networks_out);
+        }
+    }
+
+    public static void showSelect(final Context ct, final String appkey, final String appSceret, final BusinessTravel model) {
+        List<String> items = new ArrayList<>();
+        items.add("火车票");
+        items.add("飞机票");
+        items.add("住宿");
+        MaterialDialog mDialog = new MaterialDialog.Builder(ct)
+                .title("选择预订类型")
+                .items(items)
+                .itemsCallbackSingleChoice(0, new MaterialDialog.ListCallbackSingleChoice() {
+                    @Override
+                    public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {
+                        LogUtil.i("text=" + text);
+                        switch (text.toString()) {
+                            case "火车票":
+                                model.setType(BusinessTravel.TRAIN);
+                                break;
+                            case "住宿":
+                                model.setType(BusinessTravel.HOTEL);
+                                break;
+                            case "飞机票":
+                                model.setType(BusinessTravel.AIR);
+                                break;
+                        }
+                        reserve(ct, appkey, appSceret, model);
+                        return true;
+                    }
+                }).positiveText(MyApplication.getInstance().getString(com.uas.appworks.R.string.common_sure)).show();
+
+        mDialog.show();
+    }
+
+
+}

+ 50 - 8
app_modular/appworks/src/main/res/layout/activity_business_travel.xml

@@ -1,18 +1,60 @@
 <?xml version="1.0" encoding="utf-8"?>
-<com.module.recyclerlibrary.ui.refresh.simlpe.SimpleRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/mRefreshLayout"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="@color/base_bg"
-    app:enablePullDown="true"
-    app:enablePullUp="true"
     tools:context="com.uas.appworks.OA.platform.activity.BusinessTravelActivity">
 
-    <com.modular.apputils.widget.EmptyRecyclerView
-        android:id="@+id/mRecyclerView"
+    <RelativeLayout
+        android:id="@+id/remainRl"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:visibility="gone"
+        android:orientation="horizontal"
+       >
+
+        <ImageView
+            android:id="@+id/remainImg"
+            android:src="@drawable/icon_empty_lamp"
+            android:layout_width="60dp"
+            android:layout_centerHorizontal="true"
+            android:layout_height="60dp" />
+
+        <TextView
+            android:id="@+id/remainTag"
+            android:layout_below="@id/remainImg"
+            android:layout_width="wrap_content"
+            android:textSize="@dimen/text_min"
+            android:layout_marginTop="@dimen/padding"
+            android:layout_height="wrap_content" />
+
+        <TextView
+            android:id="@+id/remainTv"
+            android:layout_alignTop="@id/remainTag"
+            android:layout_toRightOf="@id/remainTag"
+            android:layout_width="wrap_content"
+            android:textColor="#D13F57"
+            android:textSize="@dimen/text_min"
+            android:layout_marginLeft="@dimen/paddingMin"
+            android:layout_height="wrap_content" />
+
+    </RelativeLayout>
+
+    <com.module.recyclerlibrary.ui.refresh.simlpe.SimpleRefreshLayout
+        android:id="@+id/mRefreshLayout"
         android:layout_width="match_parent"
-        android:layout_height="match_parent" />
+        android:layout_height="match_parent"
+        app:enablePullDown="true"
+        android:visibility="gone"
+        app:enablePullUp="true">
+
+        <com.modular.apputils.widget.EmptyRecyclerView
+            android:id="@+id/mRecyclerView"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent" />
 
-</com.module.recyclerlibrary.ui.refresh.simlpe.SimpleRefreshLayout>
+    </com.module.recyclerlibrary.ui.refresh.simlpe.SimpleRefreshLayout>
+</FrameLayout>

+ 101 - 85
app_modular/appworks/src/main/res/layout/item_bus_travel_air.xml

@@ -18,8 +18,8 @@
             android:id="@+id/codeTv"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginLeft="@dimen/padding"
             android:layout_marginBottom="@dimen/padding"
+            android:layout_marginLeft="@dimen/padding"
             android:gravity="center_horizontal"
             android:text="单程机票:671283"
             android:textColor="@color/white"
@@ -39,108 +39,120 @@
         <View
             android:layout_width="match_parent"
             android:layout_height="@dimen/line"
+            android:id="@+id/line"
             android:layout_below="@id/codeTv"
             android:background="@color/item_line" />
 
-        <LinearLayout
-            android:id="@+id/fromLL"
-            android:layout_width="wrap_content"
+        <RelativeLayout
+            android:id="@+id/orderInfoRl"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_below="@id/codeTv"
-            android:layout_marginLeft="20dp"
-            android:layout_marginRight="@dimen/padding"
-            android:layout_marginTop="@dimen/padding"
-            android:gravity="center_horizontal"
-            android:orientation="vertical">
-
-            <TextView
-                android:id="@+id/fromCityTv"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="上海"
-                android:textColor="@color/white"
-                android:textSize="@dimen/textXXL" />
-
-            <TextView
-                android:id="@+id/startDateTv"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_below="@id/fromCityTv"
-                android:lines="1"
-                android:text="2017-12-12"
-                android:textColor="@color/white"
-                android:textSize="@dimen/text_main" />
-
-            <TextView
-                android:id="@+id/startTimeTv"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="07:20"
-                android:textColor="@color/white"
-                android:textSize="@dimen/text_main" />
-
-        </LinearLayout>
+            android:layout_marginTop="@dimen/padding">
 
-        <LinearLayout
-            android:id="@+id/toLL"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignParentRight="true"
-            android:layout_alignTop="@id/fromLL"
-            android:layout_marginLeft="@dimen/padding"
-            android:layout_marginRight="20dp"
-            android:gravity="center_horizontal"
-            android:orientation="vertical">
-
-            <TextView
-                android:id="@+id/toCityTv"
+            <LinearLayout
+                android:id="@+id/fromLL"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_alignParentRight="true"
                 android:layout_below="@id/codeTv"
-                android:text="深圳"
-                android:textColor="@color/white"
-                android:textSize="@dimen/textXXL" />
-
-            <TextView
-                android:id="@+id/toDateTv"
+                android:layout_marginLeft="20dp"
+                android:layout_marginRight="@dimen/padding"
+                android:layout_marginTop="@dimen/padding"
+                android:gravity="center_horizontal"
+                android:orientation="vertical">
+
+                <TextView
+                    android:id="@+id/fromCityTv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="上海"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textXXL" />
+
+                <TextView
+                    android:id="@+id/startDateTv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_below="@id/fromCityTv"
+                    android:lines="1"
+                    android:text="2017-12-12"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/text_main" />
+
+                <TextView
+                    android:id="@+id/startTimeTv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="07:20"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/text_main" />
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/toLL"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_alignParentRight="true"
-                android:layout_below="@id/fromCityTv"
-                android:gravity="center"
-                android:lines="1"
-                android:text="2017-12-12"
-                android:textColor="@color/white"
-                android:textSize="@dimen/text_main" />
-
-            <TextView
-                android:id="@+id/toTimeTv"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
+                android:layout_alignTop="@id/fromLL"
+                android:layout_marginLeft="@dimen/padding"
+                android:layout_marginRight="20dp"
                 android:gravity="center_horizontal"
-                android:text="07:20"
-                android:textColor="@color/white"
-                android:textSize="@dimen/text_main" />
-        </LinearLayout>
-
-
-        <com.modular.apputils.widget.TravelDirectionView
-            android:id="@+id/mTravelDirectionView"
-            android:layout_width="match_parent"
-            android:layout_height="60dp"
-            android:layout_alignTop="@id/fromLL"
-            android:layout_toLeftOf="@id/toLL"
-            android:layout_toRightOf="@id/fromLL"
-            app:time="2小时20分"
-            app:timeSize="@dimen/text_hine"
-            app:title="D7890"
-            app:titleSize="@dimen/text_main" />
+                android:orientation="vertical">
+
+                <TextView
+                    android:id="@+id/toCityTv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentRight="true"
+                    android:layout_below="@id/codeTv"
+                    android:text="深圳"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textXXL" />
+
+                <TextView
+                    android:id="@+id/toDateTv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentRight="true"
+                    android:layout_below="@id/fromCityTv"
+                    android:gravity="center"
+                    android:lines="1"
+                    android:text="2017-12-12"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/text_main" />
+
+                <TextView
+                    android:id="@+id/toTimeTv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:gravity="center_horizontal"
+                    android:text="07:20"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/text_main" />
+            </LinearLayout>
+
+
+            <com.modular.apputils.widget.TravelDirectionView
+                android:id="@+id/mTravelDirectionView"
+                android:layout_width="match_parent"
+                android:layout_height="60dp"
+                android:layout_alignTop="@id/fromLL"
+                android:layout_toLeftOf="@id/toLL"
+                android:layout_toRightOf="@id/fromLL"
+                app:time="2小时20分"
+                app:timeSize="@dimen/text_hine"
+                app:title="D7890"
+                app:titleSize="@dimen/text_main" />
+
+
+        </RelativeLayout>
 
 
     </RelativeLayout>
 
     <RelativeLayout
+        android:id="@+id/userInfoRl"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:background="@color/white"
@@ -207,6 +219,10 @@
             android:layout_marginLeft="30dp"
             android:layout_toRightOf="@id/seatTv"
             android:text="54元"
+            android:lines="1"
+            android:paddingRight="3dp"
+            android:ellipsize="end"
+            android:layout_toLeftOf="@+id/payTypeTv"
             android:textColor="@color/indianred"
             android:textSize="@dimen/text_main" />
 

+ 50 - 42
app_modular/appworks/src/main/res/layout/item_bus_travel_hotel.xml

@@ -17,10 +17,10 @@
             android:id="@+id/codeTv"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:layout_marginBottom="@dimen/padding"
             android:layout_marginLeft="@dimen/padding"
             android:gravity="center_horizontal"
             android:text="住宿"
-            android:layout_marginBottom="@dimen/padding"
             android:textColor="@color/white"
             android:textSize="@dimen/text_hine" />
 
@@ -39,56 +39,64 @@
             android:layout_width="match_parent"
             android:layout_height="@dimen/line"
             android:layout_below="@id/codeTv"
+            android:id="@+id/line"
             android:background="@color/item_line" />
 
-        <TextView
-            android:id="@+id/levelTv"
-            android:layout_width="wrap_content"
+        <RelativeLayout
+            android:id="@+id/orderInfoRl"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_alignLeft="@id/codeTv"
             android:layout_below="@id/codeTv"
-            android:layout_marginTop="@dimen/padding"
-            android:text="标准单人间"
-            android:textColor="@color/white"
-            android:textSize="@dimen/textXXL" />
-
-        <TextView
-            android:id="@+id/businessNameTv"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignTop="@id/levelTv"
-            android:layout_marginLeft="@dimen/padding"
-            android:layout_toRightOf="@id/levelTv"
-            android:text="香格里拉酒店"
-            android:textColor="@color/white"
-            android:textSize="@dimen/text_main" />
-
-        <TextView
-            android:id="@+id/whenLongTv"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignLeft="@id/levelTv"
-            android:layout_below="@id/businessNameTv"
-            android:layout_marginTop="@dimen/padding"
-            android:text="入住:12-10     离店:12-12    共两晚"
-            android:textColor="@color/white"
-            android:textSize="@dimen/text_hine" />
-
-        <TextView
-            android:id="@+id/numberTv"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignLeft="@id/whenLongTv"
-            android:layout_below="@id/whenLongTv"
-            android:layout_marginTop="@dimen/padding"
-            android:text="1人"
-            android:textColor="@color/white"
-            android:textSize="@dimen/text_hine" />
+            android:layout_marginTop="@dimen/padding">
+
+            <TextView
+                android:id="@+id/levelTv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignLeft="@id/codeTv"
+                android:text="标准单人间"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textXXL" />
+
+            <TextView
+                android:id="@+id/businessNameTv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignTop="@id/levelTv"
+                android:layout_marginLeft="@dimen/padding"
+                android:layout_toRightOf="@id/levelTv"
+                android:text="香格里拉酒店"
+                android:textColor="@color/white"
+                android:textSize="@dimen/text_main" />
+
+            <TextView
+                android:id="@+id/whenLongTv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignLeft="@id/levelTv"
+                android:layout_below="@id/businessNameTv"
+                android:layout_marginTop="@dimen/padding"
+                android:text="入住:12-10     离店:12-12    共两晚"
+                android:textColor="@color/white"
+                android:textSize="@dimen/text_hine" />
+
+            <TextView
+                android:id="@+id/numberTv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignLeft="@id/whenLongTv"
+                android:layout_below="@id/whenLongTv"
+                android:layout_marginTop="@dimen/padding"
+                android:text="1人"
+                android:textColor="@color/white"
+                android:textSize="@dimen/text_hine" />
+        </RelativeLayout>
 
 
     </RelativeLayout>
 
     <RelativeLayout
+        android:id="@+id/userInfoRl"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:background="@color/white"

+ 51 - 24
app_modular/appworks/src/main/res/layout/item_bus_travel_title.xml

@@ -2,32 +2,59 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:background="@color/white"
+    android:background="@color/base_bg"
     android:gravity="center_vertical"
-    android:orientation="horizontal">
+    android:orientation="vertical">
 
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginBottom="@dimen/padding"
-        android:layout_marginTop="@dimen/padding"
-        android:gravity="center_horizontal"
-        android:paddingLeft="10dp"
-        android:paddingRight="10dp"
-        android:text="出差单号"
-        android:textColor="@color/hint_text_color"
-        android:textSize="@dimen/text_hine" />
+    <View
+        android:id="@+id/titleLine"
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/padding" />
 
-    <TextView
-        android:id="@+id/codeTv"
-        android:layout_width="wrap_content"
+    <RelativeLayout
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginBottom="@dimen/padding"
-        android:layout_marginTop="@dimen/padding"
-        android:gravity="center_horizontal"
-        android:paddingLeft="10dp"
-        android:paddingRight="10dp"
-        android:text="出差单号"
-        android:textColor="@color/black"
-        android:textSize="@dimen/text_main" />
+        android:background="@color/white"
+        android:gravity="center_vertical"
+        android:orientation="horizontal">
+
+        <TextView
+            android:id="@+id/tag"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginBottom="@dimen/padding"
+            android:layout_marginTop="@dimen/padding"
+            android:gravity="center_horizontal"
+            android:paddingLeft="10dp"
+            android:paddingRight="10dp"
+            android:text="出差单号"
+            android:textColor="@color/hint_text_color"
+            android:textSize="@dimen/text_hine" />
+
+        <ImageView
+            android:id="@+id/addMoreTv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentRight="true"
+            android:layout_marginRight="@dimen/padding"
+            android:layout_centerVertical="true"
+            android:padding="4dp"
+            android:src="@drawable/icon_add_circular" />
+
+        <TextView
+            android:id="@+id/codeTv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginBottom="@dimen/padding"
+            android:layout_marginTop="@dimen/padding"
+            android:layout_toLeftOf="@id/addMoreTv"
+            android:layout_toRightOf="@id/tag"
+            android:gravity="left"
+            android:paddingLeft="10dp"
+            android:paddingRight="10dp"
+            android:text="出差单号"
+            android:textColor="@color/black"
+            android:textSize="@dimen/text_main" />
+    </RelativeLayout>
+
 </LinearLayout>

+ 1 - 1
app_modular/appworks/src/main/res/layout/pop_click_menu.xml

@@ -19,7 +19,7 @@
         android:layout_toLeftOf="@id/clickImage"
         android:gravity="right"
         android:padding="@dimen/padding"
-        android:text="点击这里预定"
+        android:text="点击右上角预订"
         android:textColor="#5f95dd"
         android:textSize="@dimen/textXXL" />
 

+ 1 - 1
app_modular/appworks/src/main/res/menu/menu_add_travel.xml

@@ -3,6 +3,6 @@
     xmlns:app="http://schemas.android.com/apk/res-auto">
 
     <item android:id="@+id/addTravel"
-        android:title="预"
+        android:title="预"
         app:showAsAction="always"/>
 </menu>

+ 1 - 2
app_modular/appworks/src/main/res/menu/menu_common_docdetails.xml

@@ -3,8 +3,7 @@
     xmlns:app="http://schemas.android.com/apk/res-auto">
     <item
         android:id="@+id/toTravel"
-        android:title="转差旅"
-
+        android:title="去预订"
         app:showAsAction="ifRoom"/>
     <item
         android:id="@+id/add_item"