|
|
@@ -0,0 +1,75 @@
|
|
|
+package com.uas.appme.other.activity;
|
|
|
+
|
|
|
+import android.graphics.Bitmap;
|
|
|
+import android.os.Bundle;
|
|
|
+import android.widget.ImageView;
|
|
|
+
|
|
|
+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.data.JSONUtil;
|
|
|
+import com.common.data.ListUtils;
|
|
|
+import com.core.base.BaseActivity;
|
|
|
+import com.core.utils.CommonUtil;
|
|
|
+import com.modular.apputils.listener.OnSmartHttpListener;
|
|
|
+import com.modular.apputils.network.Parameter;
|
|
|
+import com.modular.apputils.network.Tags;
|
|
|
+import com.modular.apputils.utils.UUHttpHelper;
|
|
|
+import com.uas.appme.R;
|
|
|
+
|
|
|
+public class WorkCardActivity extends BaseActivity {
|
|
|
+ private ImageView logoIv;
|
|
|
+ private ImageView headIv;
|
|
|
+
|
|
|
+ private UUHttpHelper mUUHttpHelper;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void onCreate(Bundle savedInstanceState) {
|
|
|
+ super.onCreate(savedInstanceState);
|
|
|
+ setContentView(R.layout.activity_work_card);
|
|
|
+ initView();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void initView() {
|
|
|
+ mUUHttpHelper = new UUHttpHelper(CommonUtil.getAppBaseUrl(ct));
|
|
|
+ logoIv = (ImageView) findViewById(R.id.logoIv);
|
|
|
+ headIv = (ImageView) findViewById(R.id.headIv);
|
|
|
+ loadData();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void loadData() {
|
|
|
+ mUUHttpHelper.requestCompanyHttp(new Parameter.Builder()
|
|
|
+ .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");
|
|
|
+ if (!ListUtils.isEmpty(mLabourCardInfors)) {
|
|
|
+ handlerData(mLabourCardInfors.getJSONObject(0));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFailure(int what, String message, Tags tag) throws Exception {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ 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");
|
|
|
+ Bitmap logoMap = Base64Util.base64ToBitmap(en_logo);
|
|
|
+ if (logoMap!=null){
|
|
|
+ logoIv.setImageBitmap(logoMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|