Explorar o código

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

raomeng %!s(int64=8) %!d(string=hai) anos
pai
achega
9b77824d1f

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/OAActivity.java

@@ -466,7 +466,7 @@ public class OAActivity extends BaseActivity implements View.OnClickListener, Wo
         LinearLayout.LayoutParams linearParams = (LinearLayout.LayoutParams) viewPager.getLayoutParams(); // 取控件mGrid当前的布局参数   搜索
         linearParams.height = (getResources().getDisplayMetrics().heightPixels * 1 / 3);// 当控件的高强制设成50象素
         viewPager.setLayoutParams(linearParams); // 使设置好的布局参数应用到控件myGrid
-        pagerAdapter = new OACalenderViewPagerAdapter(ct);
+        pagerAdapter = new OACalenderViewPagerAdapter(ct,curDate);
         viewPager.setAdapter(pagerAdapter);
         viewPager.setCurrentItem(OACalenderViewPagerAdapter.MAX_NUM / 2);
         //判断是否是管理员

BIN=BIN
app_core/common/src/main/res/drawable-xxhdpi/received.png


+ 2 - 0
app_core/common/src/main/res/layout/activity_oamain.xml

@@ -10,6 +10,7 @@
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
+        android:focusableInTouchMode="true"
         android:orientation="vertical">
 
         <LinearLayout
@@ -257,6 +258,7 @@
         <!--end 头布局-->
         <FrameLayout
             android:layout_width="match_parent"
+            android:focusableInTouchMode="true"
             android:layout_height="match_parent">
 
             <!--标签布局-->

+ 101 - 0
app_core/common/src/main/res/layout/input_error_msg.xml

@@ -0,0 +1,101 @@
+<?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="match_parent"
+    android:gravity="center_horizontal"
+    android:orientation="vertical"
+    android:paddingLeft="10dp"
+    android:paddingRight="10dp"
+    android:paddingTop="10dp"
+    android:background="@drawable/pop_round_bg">
+
+    <TextView
+        android:id="@+id/title_tv"
+        android:layout_width="match_parent"
+        android:layout_height="20dp"
+        android:gravity="center"
+        android:text="请输入你的问题"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="10dp"
+        android:gravity="center"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text=""
+            android:textColor="@color/text_main"
+            android:textSize="@dimen/text_main" />
+
+        <EditText
+            android:id="@+id/msg_et"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="@null"
+            android:maxLines="3"
+            android:maxLength="100"
+            android:hint="@string/common_input"
+            android:textColor="@color/text_main"
+            android:textSize="@dimen/text_main"
+            android:gravity="center_horizontal"
+            />
+        <EditText
+            android:id="@+id/editname_et2"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="@null"
+            android:ellipsize="end"
+            android:maxLines="1"
+            android:hint="@string/common_input2"
+            android:textColor="@color/text_main"
+            android:textSize="@dimen/text_main"
+            android:gravity="center_horizontal"
+            android:inputType="number"/>
+    </LinearLayout>
+
+
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="2px"
+        android:layout_marginTop="10dp"
+        android:background="@color/item_line" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="40dp"
+        android:orientation="horizontal"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main">
+
+        <TextView
+            android:id="@+id/cancel1_tv"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:gravity="center"
+            android:text="@string/cancel"
+            android:textColor="@color/text_main"
+            android:textSize="@dimen/text_main" />
+
+        <View
+            android:layout_width="2px"
+            android:layout_height="match_parent"
+            android:background="@color/item_line" />
+
+        <TextView
+            android:id="@+id/sure_tv"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:gravity="center"
+            android:text="@string/common_sure"
+            android:textColor="@color/text_main"
+            android:textSize="@dimen/text_main" />
+    </LinearLayout>
+</LinearLayout>

+ 12 - 0
app_core/common/src/main/res/menu/wage_error.xml

@@ -0,0 +1,12 @@
+<menu 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"
+    tools:context="com.xzjmyk.pm.activity.MainActivity">
+
+    <item
+        android:tooltipText="报错"
+        android:id="@+id/wage_error"
+        android:title="报错"
+        app:showAsAction="ifRoom" />
+
+</menu>

+ 4 - 0
app_modular/appme/src/main/java/com/uas/appme/settings/activity/BRestActivity.java

@@ -145,6 +145,10 @@ public class BRestActivity extends BaseActivity implements BRestAdapter.OnItemCl
 
 	@Override
 	public void onClick(View v) {
+		if (!CommonUtil.isNetWorkConnected(ct)) {
+			ToastMessage(getString(R.string.common_notlinknet));
+			return;
+		}
 		if (v.getId() == R.id.saveBtn) {
 			submitSave();
 		}else if (v.getId() == R.id.deleteBtn){

+ 8 - 0
app_modular/appme/src/main/java/com/uas/appme/settings/activity/CheckWagesActivity.java

@@ -76,6 +76,7 @@ public class CheckWagesActivity extends BaseActivity implements View.OnClickList
                     seconds_tv.setVisibility(View.INVISIBLE);
                     mWagesCodeBtn.setVisibility(View.VISIBLE);
                     isRun = false;
+                    SecondT = 59;
                 }
                 Log.i("HttpLogs",SecondT+"");
             }
@@ -239,6 +240,10 @@ public class CheckWagesActivity extends BaseActivity implements View.OnClickList
                 ToastMessage("请输入查询密码");
                 return;
             }
+            if (!CommonUtil.isNetWorkConnected(ct)){
+                ToastMessage(getString(R.string.common_notlinknet));
+                return;
+            }
             searchWage();
         }else if (id == R.id.cancel_tv){
             popupWindow.dismiss();
@@ -315,8 +320,11 @@ public class CheckWagesActivity extends BaseActivity implements View.OnClickList
                             .putExtra("checkYear",checkYear)
                             .putExtra("checkMonth",checkMonth)
                             .putExtra("WageDatas",o.toString()));
+                    finish();
                 }else if (o.toString().contains("reason")){
                     ToastMessage(JSON.parseObject(o.toString()).getString("reason"));
+                }else if (o.toString().contains("exceptionInfo")){
+                    ToastMessage(JSON.parseObject(o.toString()).getString("exceptionInfo"));
                 }
 
             }

+ 128 - 6
app_modular/appme/src/main/java/com/uas/appme/settings/activity/WagesDetailsActivity.java

@@ -1,15 +1,21 @@
 package com.uas.appme.settings.activity;
 
+import android.app.Activity;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
 import android.os.Bundle;
 import android.os.Environment;
 import android.os.Handler;
+import android.util.DisplayMetrics;
 import android.util.Log;
 import android.view.Gravity;
 import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuItem;
 import android.view.View;
+import android.view.WindowManager;
 import android.widget.Button;
+import android.widget.EditText;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.PopupWindow;
@@ -70,6 +76,8 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
     private ImageView clear_im;
     private String master;
     private String emcode;
+    private EditText msg_et;
+    private ImageView received_im;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -106,15 +114,23 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
                             LogUtil.prinlnLongMsg("fanglh",JSON.toJSONString(kvModeList));
                         }
                     }
-                }else
-                    mEmptyLayout.showEmpty();
-            }else
-                mEmptyLayout.showEmpty();
+                }else{
+                   showEnty();
+                }
+            }else{
+                showEnty();
+            }
+
         } catch (Exception e) {
             e.printStackTrace();
         }
     }
 
+    private void showEnty() {
+        received_im.setVisibility(View.GONE);
+        mEmptyLayout.showEmpty();
+    }
+
     private EmptyLayout mEmptyLayout;
     private void initView() {
         //        emcode = MyApplication.getInstance().getLoginUserId();
@@ -138,6 +154,7 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
         mEmptyLayout.setShowEmptyButton(false);
         mEmptyLayout.setShowErrorButton(false);
         mEmptyLayout.setShowLoadingButton(false);
+        received_im = (ImageView) findViewById(R.id.received_im);
 //        findViewById(R.id.h_sign_tv).setOnClickListener(this);
 
         String result = getIntent().getStringExtra("WageDatas");
@@ -185,9 +202,46 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
             }else {
                 Toast.makeText(this,"您没有签名~", Toast.LENGTH_SHORT).show();
             }
+        }else if (v.getId() == R.id.sure_tv){
+            if (StringUtil.isEmpty(msg_et.getText().toString())){
+                ToastMessage("请输入你的问题");
+                return;
+            }
+            if (!CommonUtil.isNetWorkConnected(ct)){
+                ToastMessage(getString(R.string.common_notlinknet));
+                return;
+            }
+            doErrorMsgHandle();
+        }else if (v.getId() == R.id.cancel1_tv){
+            popupWindow.dismiss();
         }
     }
 
+    private void doErrorMsgHandle() {
+//        HttpClient httpClient = new HttpClient.Builder(Constants.IM_BASE_URL()).isDebug(true).build(true);
+        HttpClient httpClient = new HttpClient.Builder("http://192.168.253.58:8080/ERP/").isDebug(true).build(true);
+        httpClient.Api().send(new HttpClient.Builder()
+                .url("mobile/salary/salaryWrong.action")
+                .add("sl_id",sl_id)
+                .add("emcode",emcode)
+                .add("msg",msg_et.getText().toString())
+                .add("result",true)
+                .add("master", master)
+                .method(Method.POST)
+                .build(),new ResultSubscriber<>(new ResultListener<Object>() {
+            @Override
+            public void onResponse(Object o) {
+                if (!JSONUtil.validate(o.toString()) || o == null) return;
+                LogUtil.prinlnLongMsg("salaryWrong", o.toString()+"");
+                if (o.toString().contains("success") && JSON.parseObject(o.toString()).getBoolean("success")){
+                    ToastMessage("你的问题已提交");
+                    popupWindow.dismiss();
+                }
+
+            }
+        }));
+    }
+
     private void doNewSubmit(Bitmap pathBm, String plainpath) {
         String url = "http://192.168.253.58:8080/ERP/"+"mobile/salary/salaryBack.action";
         byte[] ppp = getBitmapByte(pathBm);
@@ -211,11 +265,10 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
                 ViewUtil.ToastMessage(ct, getString(R.string.Uploaded_successfully));
                 Log.i("doNewSubmit",JSON.parseObject(responseInfo.result).toJSONString());
                 if (JSONUtil.validate(responseInfo.result) && JSON.parseObject(responseInfo.result).getBoolean("success")) {
-                    Toast.makeText(ct,"提交成功",Toast.LENGTH_LONG).show();
+                    Toast.makeText(ct,"工资条签名提交成功",Toast.LENGTH_LONG).show();
                     closePopupWindow();
                 }
                 progressDialog.dismiss();
-                Toast.makeText(ct,getString(R.string.fangkui_success),Toast.LENGTH_LONG).show();
                 new Handler().postDelayed(new Runnable() {
                     @Override
                     public void run() {
@@ -305,4 +358,73 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
             setWindow.dismiss();
         DisplayUtil.backgroundAlpha(this, 1f);
     }
+
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        getMenuInflater().inflate(R.menu.wage_error, menu);
+        return super.onCreateOptionsMenu(menu);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == R.id.wage_error){
+           showErrorWindow();
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private PopupWindow popupWindow;
+    private void showErrorWindow() {
+
+        // 一个自定义的布局,作为显示的内容
+        View contentView = LayoutInflater.from(ct).inflate(
+                R.layout.input_error_msg, null);
+
+        // 设置按钮的点击事件
+        msg_et = (EditText) contentView.findViewById(R.id.msg_et);
+        contentView.findViewById(R.id.cancel1_tv).setOnClickListener(this);
+        contentView.findViewById(R.id.sure_tv).setOnClickListener(this);
+
+        DisplayMetrics dm = getResources().getDisplayMetrics();
+        int w_screen = dm.widthPixels;
+        int h_screen = dm.heightPixels;
+        w_screen = DisplayUtil.dip2px(this, 300);
+        h_screen = DisplayUtil.dip2px(this, 300);
+
+        popupWindow = new PopupWindow(contentView, w_screen, h_screen, true);
+        popupWindow.setTouchable(true);
+        popupWindow.setOutsideTouchable(false);
+        // 如果不设置PopupWindow的背景,无论是点击外部区域还是Back键都无法dismiss弹框
+        popupWindow.setBackgroundDrawable(getResources().getDrawable(com.uas.appworks.R.drawable.pop_round_bg));
+        // 设置好参数之后再show
+        popupWindow.showAtLocation(contentView, Gravity.CENTER, 0, 0);
+        setbg(0.4f);
+    }
+    private void setbg(float alpha) {
+        setBackgroundAlpha(this, alpha);
+        if (popupWindow == null) return;
+        popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
+            @Override
+            public void onDismiss() {
+                setBackgroundAlpha(WagesDetailsActivity.this, 1f);
+            }
+        });
+    }
+    /**
+     * 设置页面的透明度
+     * 兼容华为手机(在个别华为手机上 设置透明度会不成功)
+     *
+     * @param bgAlpha 透明度   1表示不透明
+     */
+    public void setBackgroundAlpha(Activity activity, float bgAlpha) {
+        WindowManager.LayoutParams lp = activity.getWindow().getAttributes();
+        lp.alpha = bgAlpha;
+        if (bgAlpha == 1) {
+            activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);//不移除该Flag的话,在有视频的页面上的视频会出现黑屏的bug
+        } else {
+            activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);//此行代码主要是解决在华为手机上半透明效果无效的bug
+        }
+        activity.getWindow().setAttributes(lp);
+    }
+
 }

+ 15 - 16
app_modular/appme/src/main/res/layout/sigature_pop.xml

@@ -40,12 +40,14 @@
             android:visibility="gone"/>
 
         <RelativeLayout
+            android:id="@+id/s_rl"
             android:layout_width="match_parent"
             android:layout_height="300dp"
             android:layout_alignParentTop="true"
             android:layout_centerHorizontal="true"
-            android:layout_marginTop="20dp"
-            android:background="@color/white">
+            android:layout_marginTop="30dp"
+            android:background="@color/white"
+            >
 
             <Button
                 android:id="@+id/hscreen_btn"
@@ -85,23 +87,20 @@
                 android:layout_gravity="center_horizontal"
                 android:background="@color/white" />
 
+
         </RelativeLayout>
+
+        <TextView
+            android:layout_below="@+id/s_rl"
+            android:gravity="center"
+            android:background="@color/white"
+            android:text="签名区域"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:padding="10dp"
+            android:layout_marginRight="10dp"/>
     </RelativeLayout>
-    <View
-        android:layout_marginTop="5dp"
-        android:layout_width="match_parent"
-        android:layout_height="2px"
-        android:background="@color/item_line" />
 
-    <TextView
-        android:gravity="center"
-        android:background="@color/white"
-        android:text="签名区域"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:padding="10dp"
-        android:layout_marginLeft="10dp"
-        android:layout_marginRight="10dp"/>
     <Button
         android:id="@+id/submit_btn"
         android:layout_width="match_parent"

+ 23 - 9
app_modular/appme/src/main/res/layout/wages_details_activity.xml

@@ -5,8 +5,7 @@
     android:orientation="vertical">
     <TextView
         android:background="@color/white"
-        android:paddingLeft="10dp"
-        android:paddingRight="10dp"
+        android:padding="10dp"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:text="公告:本月工资发放内容包括了上个月的餐补,请大家查看明细"/>
@@ -26,14 +25,29 @@
             android:layout_height="wrap_content"
             android:orientation="vertical">
 
-            <com.core.widget.MyListView
-
-                android:id="@+id/wages_lv"
+            <RelativeLayout
                 android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:padding="10dp"
-                android:background="@color/white">
-            </com.core.widget.MyListView>
+                android:layout_height="wrap_content">
+
+                <com.core.widget.MyListView
+
+                    android:id="@+id/wages_lv"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:padding="10dp"
+                    android:background="@color/white">
+                </com.core.widget.MyListView>
+                <ImageView
+                    android:id="@+id/received_im"
+                    android:layout_alignBottom="@+id/wages_lv"
+                    android:layout_alignRight="@+id/wages_lv"
+                    android:layout_width="100dp"
+                    android:layout_height="100dp"
+                    android:src="@drawable/received"
+                    android:layout_margin="30dp"
+                    />
+            </RelativeLayout>
+
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"

BIN=BIN
app_modular/apputils/libs/alipaySdk-20170922.jar


+ 1 - 1
app_modular/apputils/src/main/java/com/modular/apputils/utils/SwitchUtil.java

@@ -9,7 +9,7 @@ import com.common.config.BaseConfig;
 public class SwitchUtil {
 
     public static boolean showYiyuanjuan() {
-        return BaseConfig.isDebug()&&false;
+        return BaseConfig.isDebug() && false;
     }
 
     public static boolean showShebeiguanli() {

+ 11 - 12
app_modular/apputils/src/main/java/com/modular/apputils/utils/playsdk/AliPlay.java

@@ -7,7 +7,6 @@ import android.os.Looper;
 import android.os.Message;
 import android.text.TextUtils;
 
-import com.alipay.sdk.app.PayTask;
 import com.common.LogUtil;
 import com.common.thread.ThreadPool;
 import com.modular.apputils.listener.OnPlayListener;
@@ -91,16 +90,16 @@ public class AliPlay extends Handler {
     }
 
     private void payThread(Activity ct,  String orderInfo,  OnPlayListener onPlayListener) throws Exception {
-        PayTask alipay = new PayTask(ct);
-        LogUtil.i("orderInfo=" + orderInfo);
-        Map<String, String> result = alipay.payV2(orderInfo, true);
-        LogUtil.i(result.toString());
-        Message msg = new Message();
-        Bundle bundle = new Bundle();
-        bundle.putSerializable("onPlayListener", onPlayListener);
-        msg.setData(bundle);
-        msg.what = SDK_PAY_FLAG;
-        msg.obj = result;
-        sendMessage(msg);
+//        PayTask alipay = new PayTask(ct);
+//        LogUtil.i("orderInfo=" + orderInfo);
+//        Map<String, String> result = alipay.payV2(orderInfo, true);
+//        LogUtil.i(result.toString());
+//        Message msg = new Message();
+//        Bundle bundle = new Bundle();
+//        bundle.putSerializable("onPlayListener", onPlayListener);
+//        msg.setData(bundle);
+//        msg.what = SDK_PAY_FLAG;
+//        msg.obj = result;
+//        sendMessage(msg);
     }
 }