Browse Source

提交类型 处理bug
提交内容 针对客户联系人,添加对于明细表附加的支持

Bitliker 7 years ago
parent
commit
80e4846048

+ 2 - 1
app_modular/appme/src/main/AndroidManifest.xml

@@ -121,7 +121,8 @@
         <!-- <activity android:name=".settings.activity.PayTestActivity"></activity> -->
 
         <activity android:name=".settings.activity.SystemAdminActivity" />
-        <activity android:name=".other.activity.WorkCardActivity" />
+        <activity android:name=".other.activity.WorkCardActivity"
+            android:label="电子工牌"/>
         <activity android:name=".settings.activity.FontSizeActivity"
 
             android:launchMode="singleTask">

+ 50 - 15
app_modular/appme/src/main/java/com/uas/appme/other/activity/WorkCardActivity.java

@@ -3,24 +3,35 @@ package com.uas.appme.other.activity;
 import android.graphics.Bitmap;
 import android.os.Bundle;
 import android.widget.ImageView;
+import android.widget.TextView;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baidu.aip.excep.utils.Base64Util;
+import com.common.LogUtil;
 import com.common.data.JSONUtil;
 import com.common.data.ListUtils;
 import com.core.base.BaseActivity;
 import com.core.utils.CommonUtil;
+import com.me.imageloader.ImageLoaderUtil;
 import com.modular.apputils.listener.OnSmartHttpListener;
 import com.modular.apputils.network.Parameter;
 import com.modular.apputils.network.Tags;
+import com.modular.apputils.utils.ImageViewUtils;
+import com.modular.apputils.utils.TestStr;
 import com.modular.apputils.utils.UUHttpHelper;
 import com.uas.appme.R;
 
+import de.hdodenhof.circleimageview.CircleImageView;
+
 public class WorkCardActivity extends BaseActivity {
     private ImageView logoIv;
-    private ImageView headIv;
+    private TextView companyNameTv;
+    private TextView nameTv;
+    private TextView emCodeTv;
+    private TextView positionTv;
+    private CircleImageView headIv;
 
     private UUHttpHelper mUUHttpHelper;
 
@@ -34,19 +45,25 @@ public class WorkCardActivity extends BaseActivity {
     private void initView() {
         mUUHttpHelper = new UUHttpHelper(CommonUtil.getAppBaseUrl(ct));
         logoIv = (ImageView) findViewById(R.id.logoIv);
-        headIv = (ImageView) findViewById(R.id.headIv);
+        companyNameTv = (TextView) findViewById(R.id.companyNameTv);
+        nameTv = (TextView) findViewById(R.id.nameTv);
+        emCodeTv = (TextView) findViewById(R.id.emCodeTv);
+        positionTv = (TextView) findViewById(R.id.positionTv);
+        headIv = (CircleImageView) findViewById(R.id.headIv);
+
+
         loadData();
     }
 
     private void loadData() {
         mUUHttpHelper.requestCompanyHttp(new Parameter.Builder()
-                .url("mobile/oa/getLabourCardInfor.action")
-                .addParams("emcode",CommonUtil.getEmcode())
+                        .url("mobile/oa/getLabourCardInfor.action")
+                        .addParams("emcode", CommonUtil.getEmcode())
                 , new OnSmartHttpListener() {
                     @Override
                     public void onSuccess(int what, String message, Tags tag) throws Exception {
-                        JSONObject object= JSON.parseObject(message);
-                        JSONArray mLabourCardInfors= JSONUtil.getJSONArray(object,"LabourCardInfor");
+                        JSONObject object = JSON.parseObject(message);
+                        JSONArray mLabourCardInfors = JSONUtil.getJSONArray(object, "LabourCardInfor");
                         if (!ListUtils.isEmpty(mLabourCardInfors)) {
                             handlerData(mLabourCardInfors.getJSONObject(0));
                         }
@@ -57,18 +74,36 @@ public class WorkCardActivity extends BaseActivity {
 
                     }
                 });
+
+        //TODO 测试数据
+        JSONObject object = JSON.parseObject(TestStr.LABOUR_CARD_INFOR);
+        JSONArray mLabourCardInfors = JSONUtil.getJSONArray(object, "LabourCardInfor");
+        if (!ListUtils.isEmpty(mLabourCardInfors)) {
+            handlerData(mLabourCardInfors.getJSONObject(0));
+        }
     }
 
-    private void handlerData( JSONObject mLabourCardInfor ){
-        String em_photourl=JSONUtil.getText(mLabourCardInfor,"EM_PHOTOURL");
-        String em_name=JSONUtil.getText(mLabourCardInfor,"EM_NAME");
-        String em_code=JSONUtil.getText(mLabourCardInfor,"EM_CODE");
-        String em_sex=JSONUtil.getText(mLabourCardInfor,"EM_SEX");
-        String em_mobile=JSONUtil.getText(mLabourCardInfor,"EM_MOBILE");
-        String em_position=JSONUtil.getText(mLabourCardInfor,"EM_POSITION");
-        String en_logo=JSONUtil.getText(mLabourCardInfor,"EN_LOGO");
+
+    private void handlerData(JSONObject mLabourCardInfor) {
+        String em_cop = JSONUtil.getText(mLabourCardInfor, "EM_COP");
+        String em_photourl = JSONUtil.getText(mLabourCardInfor, "EM_PHOTOURL");
+        String em_name = JSONUtil.getText(mLabourCardInfor, "EM_NAME");
+        String em_code = JSONUtil.getText(mLabourCardInfor, "EM_CODE");
+        String em_sex = JSONUtil.getText(mLabourCardInfor, "EM_SEX");
+        String em_mobile = JSONUtil.getText(mLabourCardInfor, "EM_MOBILE");
+        String em_position = JSONUtil.getText(mLabourCardInfor, "EM_DEPART");
+        String en_logo = JSONUtil.getText(mLabourCardInfor, "EN_LOGO");
+
+        companyNameTv.setText(em_cop);
+        nameTv.setText(em_name);
+        emCodeTv.setText("ID " + em_code);
+        positionTv.setText(em_position);
+        positionTv.setText(em_position);
+        String headUrl = ImageViewUtils.getErpImageUrl(em_photourl);
+        LogUtil.i("gong","headUrl="+headUrl);
+        ImageLoaderUtil.getInstance().loadImage(headUrl, headIv);
         Bitmap logoMap = Base64Util.base64ToBitmap(en_logo);
-        if (logoMap!=null){
+        if (logoMap != null) {
             logoIv.setImageBitmap(logoMap);
         }
     }

BIN
app_modular/appme/src/main/res/drawable-hdpi/bg_work_card_head.png


BIN
app_modular/appme/src/main/res/drawable-xhdpi/bg_work_card_head.png


BIN
app_modular/appme/src/main/res/drawable-xxhdpi/bg_work_card_head.png


+ 80 - 7
app_modular/appme/src/main/res/layout/activity_work_card.xml

@@ -2,24 +2,97 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:background="@color/white"
     android:orientation="vertical">
 
 
     <ImageView
         android:id="@+id/logoIv"
-        android:layout_width="match_parent"
-        android:layout_height="50dp" />
+        android:layout_width="wrap_content"
+        android:layout_height="55dp"
+        android:layout_marginLeft="@dimen/padding"
+        android:layout_marginTop="@dimen/paddingMin" />
 
     <TextView
+        android:id="@+id/companyNameTv"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/padding"
         android:gravity="center"
         android:text="深圳优软科技有限公司"
+        android:textColor="#FF2B88AF"
         android:textSize="20sp" />
 
-    <ImageView
-        android:id="@+id/headIv"
-        android:layout_width="80dp"
-        android:layout_gravity="center"
-        android:layout_height="80dp" />
+
+    <FrameLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_marginTop="@dimen/paddingMax">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_marginTop="74dp"
+            android:background="#FF2B88AF"
+            android:gravity="center_horizontal"
+            android:orientation="vertical"
+            android:paddingTop="90dp">
+
+            <TextView
+                android:id="@+id/nameTv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="黄耀鹏"
+                android:textColor="@color/white"
+                android:textSize="15sp" />
+
+            <TextView
+                android:id="@+id/emCodeTv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/padding"
+                android:text="ID   T03674"
+                android:textColor="@color/white"
+                android:textSize="15sp" />
+
+            <TextView
+                android:id="@+id/positionTv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/padding"
+                android:text="优软科技移动app部"
+                android:textColor="@color/white"
+                android:textSize="15sp" />
+
+            <View
+                android:layout_width="0dp"
+                android:layout_height="0dp"
+                android:layout_weight="1" />
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="1dp"
+                android:background="#F7F8F8" />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginBottom="@dimen/padding"
+                android:layout_marginTop="@dimen/paddingMin"
+                android:text="英唐智慧   全球共享"
+                android:textColor="@color/white"
+                android:textSize="12sp" />
+        </LinearLayout>
+
+
+        <de.hdodenhof.circleimageview.CircleImageView
+            android:id="@+id/headIv"
+            android:layout_width="140dp"
+            android:layout_height="140dp"
+            android:padding="@dimen/paddingMin"
+            android:layout_gravity="center_horizontal"
+            android:background="@drawable/bg_work_card_head" />
+
+
+    </FrameLayout>
 </LinearLayout>

+ 21 - 0
app_modular/apputils/src/main/java/com/modular/apputils/utils/ImageViewUtils.java

@@ -0,0 +1,21 @@
+package com.modular.apputils.utils;
+
+import com.core.app.MyApplication;
+import com.core.utils.CommonUtil;
+
+public class ImageViewUtils {
+
+    public static String getErpImageUrl(String path) {
+        return CommonUtil.getAppBaseUrl(MyApplication.getInstance()) + "common/download.action?path=" + path + "&sessionId=" +
+                CommonUtil.getSharedPreferences(MyApplication.getInstance(), "sessionId") +
+                "&sessionUser=" + CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_username") +
+                "&master=" + CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_master");
+    }
+
+    public static String getErpImageUrl(int id) {
+        return CommonUtil.getAppBaseUrl(MyApplication.getInstance()) + "common/downloadbyId.action?id=" + id + "&sessionId=" +
+                CommonUtil.getSharedPreferences(MyApplication.getInstance(), "sessionId") +
+                "&sessionUser=" + CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_username") +
+                "&master=" + CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_master");
+    }
+}

File diff suppressed because it is too large
+ 9 - 0
app_modular/apputils/src/main/java/com/modular/apputils/utils/TestStr.java


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

@@ -83,7 +83,7 @@ public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHt
     @Override
     public boolean onOptionsItemSelected(MenuItem item) {
         if (R.id.addTravel == item.getItemId()) {
-            TravelUtils.showSelect(ct, appkey, appSceret, new BusinessTravel());
+            TravelUtils.showSelect(ct,cusCode, appkey, appSceret, new BusinessTravel());
         }
         return super.onOptionsItemSelected(item);
     }
@@ -146,11 +146,11 @@ public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHt
         public void onClick(View view) {
             int id=view.getId();
             if (R.id.clickAir == id) {
-                TravelUtils.reserve(ct, appkey, appSceret, getLeaderModel(BusinessTravel.AIR));
+                TravelUtils.reserve(ct,cusCode, appkey, appSceret, getLeaderModel(BusinessTravel.AIR));
             } else if (R.id.clickHotel == id) {
-                TravelUtils.reserve(ct, appkey, appSceret, getLeaderModel(BusinessTravel.HOTEL));
+                TravelUtils.reserve(ct,cusCode, appkey, appSceret, getLeaderModel(BusinessTravel.HOTEL));
             } else if (R.id.clickTrain == id) {
-                TravelUtils.reserve(ct, appkey, appSceret, getLeaderModel(BusinessTravel.TRAIN));
+                TravelUtils.reserve(ct,cusCode, appkey, appSceret, getLeaderModel(BusinessTravel.TRAIN));
             }
         }
     };
@@ -269,7 +269,7 @@ public class BusinessTravelActivity extends BaseNetActivity implements OnSmartHt
 
     private void setAdapter(List<BusinessTravel> models) {
         if (mAdapter == null) {
-            mAdapter = new BusinessTravelAdapter(ct, appkey, appSceret, models);
+            mAdapter = new BusinessTravelAdapter(ct,cusCode, appkey, appSceret, models);
             mRecyclerView.addItemDecoration(new SpaceItemDecoration(10));
             mRecyclerView.setLayoutManager(new LinearLayoutManager(ct));
             mRecyclerView.setAdapter(mAdapter);

+ 7 - 5
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/adapter/BusinessTravelAdapter.java

@@ -34,11 +34,13 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
     private List<BusinessTravel> models;
     private String currentName;
     private String appkey = null;
+    private String cusCode = null;
     private String appSceret = null;
 
-    public BusinessTravelAdapter(Context ct, String appkey, String appSceret, List<BusinessTravel> models) {
+    public BusinessTravelAdapter(Context ct, String cusCode, String appkey,String appSceret, List<BusinessTravel> models) {
         this.ct = ct;
         this.appkey = appkey;
+        this.cusCode = cusCode;
         this.appSceret = appSceret;
         this.models = models;
         this.currentName = CommonUtil.getName();
@@ -367,13 +369,13 @@ public class BusinessTravelAdapter extends RecyclerView.Adapter<RecyclerView.Vie
             notifyItemChanged(position);
         } else if (R.id.doneTv == id || R.id.subRl == id || R.id.addMoreTv == id) {
             BusinessTravel model = (BusinessTravel) v.getTag(R.id.tag_key);
-            TravelUtils.reserve(ct, appkey, appSceret, model);
+            TravelUtils.reserve(ct,cusCode, appkey, appSceret, model);
         } else if (R.id.clickAir == id) {
-            TravelUtils.reserve(ct, appkey, appSceret, getLeaderModel(BusinessTravel.AIR));
+            TravelUtils.reserve(ct, cusCode,appkey, appSceret, getLeaderModel(BusinessTravel.AIR));
         } else if (R.id.clickHotel == id) {
-            TravelUtils.reserve(ct, appkey, appSceret, getLeaderModel(BusinessTravel.HOTEL));
+            TravelUtils.reserve(ct,cusCode, appkey, appSceret, getLeaderModel(BusinessTravel.HOTEL));
         } else if (R.id.clickTrain == id) {
-            TravelUtils.reserve(ct, appkey, appSceret, getLeaderModel(BusinessTravel.TRAIN));
+            TravelUtils.reserve(ct,cusCode, appkey, appSceret, getLeaderModel(BusinessTravel.TRAIN));
         }
     }
 

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

@@ -32,9 +32,9 @@ import java.util.Map;
 
 public class TravelUtils {
 
-    public static void reserve(Context ct, String appkey, String appSceret, BusinessTravel model) {
+    public static void reserve(Context ct,String cusCode, String appkey, String appSceret, BusinessTravel model) {
         if (model.getType() == BusinessTravel.UNKOWN || BusinessTravel.TITLE == model.getType()) {
-            showSelect(ct, appkey, appSceret, model);
+            showSelect(ct,cusCode, appkey, appSceret, model);
             return;
         }
         Map<String, Object> map = new HashMap<>();
@@ -129,7 +129,7 @@ public class TravelUtils {
         }
     }
 
-    public static void showSelect(final Context ct, final String appkey, final String appSceret, final BusinessTravel model) {
+    public static void showSelect(final Context ct,final String cusCode, final String appkey, final String appSceret, final BusinessTravel model) {
         List<String> items = new ArrayList<>();
         items.add("火车票");
         items.add("飞机票");
@@ -152,7 +152,7 @@ public class TravelUtils {
                                 model.setType(BusinessTravel.AIR);
                                 break;
                         }
-                        reserve(ct, appkey, appSceret, model);
+                        reserve(ct,cusCode, appkey, appSceret, model);
                         return true;
                     }
                 }).positiveText(MyApplication.getInstance().getString(com.uas.appworks.R.string.common_sure)).show();

Some files were not shown because too many files changed in this diff