raomeng 8 лет назад
Родитель
Сommit
9ea032d9d9

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

@@ -53,7 +53,7 @@ public class DataInquiryMenuGridAdapter extends BaseAdapter {
     @Override
     public View getView(int position, View convertView, ViewGroup parent) {
         if (convertView == null) {
-            convertView = layoutInflater.inflate(R.layout.item_grid_real_time_form_menu, parent, false);
+            convertView = layoutInflater.inflate(R.layout.item_grid_data_inquiry_menu, parent, false);
             convertView.setTag(new ViewHolder(convertView));
         }
         initializeViews((DataInquiryGirdItemBean) getItem(position), (ViewHolder) convertView.getTag());

+ 2 - 0
WeiChat/src/main/res/layout/activity_data_inquiry_list.xml

@@ -19,6 +19,8 @@
             android:divider="@color/gray_light"
             android:dividerHeight="1dp"
             android:layerType="software"
+            android:hardwareAccelerated="true"
+            android:scrollbars="none"
             android:scrollingCache="false"
             android:visibility="visible"/>
 

+ 5 - 1
WeiChat/src/main/res/layout/activity_report_query_criteria.xml

@@ -29,7 +29,11 @@
         android:layout_width="match_parent"
         android:layout_height="0dp"
         android:layout_marginTop="10dp"
-        android:layout_weight="1"/>
+        android:layout_weight="1"
+        android:hardwareAccelerated="true"
+        android:layerType="hardware"
+        android:scrollbars="none"
+        android:scrollingCache="false"/>
 
     <LinearLayout
         android:layout_width="match_parent"

+ 22 - 15
app_core/common/src/main/java/com/core/dao/DBManager.java

@@ -643,22 +643,29 @@ public class DBManager {
         String groupBy = null;
         String having = null;
         String orderBy = null;
-        if (checkDbObject()) return subscriptionNumbers;
-        Cursor cursor = db.query(table, null, selection, selectionArgs, groupBy, having, orderBy);
-        while (cursor.moveToNext()) {
-            SubscriptionNumber subscriptionNumber = new SubscriptionNumber();
-            subscriptionNumber.setId(cursor.getInt(cursor.getColumnIndex("subs_id")));
-            subscriptionNumber.setTitle(cursor.getString(cursor.getColumnIndex("subs_title")));
-            subscriptionNumber.setKind(cursor.getString(cursor.getColumnIndex("subs_kind")));
-            subscriptionNumber.setStatus(cursor.getInt(cursor.getColumnIndex("subs_status")));
-            subscriptionNumber.setType(cursor.getString(cursor.getColumnIndex("subs_type")));
-            subscriptionNumber.setMaster(cursor.getString(cursor.getColumnIndex("subs_master")));
-            subscriptionNumber.setUsername(cursor.getString(cursor.getColumnIndex("subs_username")));
-            subscriptionNumber.setRemoved(cursor.getInt(cursor.getColumnIndex("subs_removed")));
-            subscriptionNumber.setImg(cursor.getBlob(cursor.getColumnIndex("subs_img")));
-            subscriptionNumbers.add(subscriptionNumber);
+        if (checkDbObject()) {
+            return subscriptionNumbers;
+        }
+        try {
+            Cursor cursor = db.query(table, null, selection, selectionArgs, groupBy, having, orderBy);
+            while (cursor.moveToNext()) {
+                SubscriptionNumber subscriptionNumber = new SubscriptionNumber();
+                subscriptionNumber.setId(cursor.getInt(cursor.getColumnIndex("subs_id")));
+                subscriptionNumber.setTitle(cursor.getString(cursor.getColumnIndex("subs_title")));
+                subscriptionNumber.setKind(cursor.getString(cursor.getColumnIndex("subs_kind")));
+                subscriptionNumber.setStatus(cursor.getInt(cursor.getColumnIndex("subs_status")));
+                subscriptionNumber.setType(cursor.getString(cursor.getColumnIndex("subs_type")));
+                subscriptionNumber.setMaster(cursor.getString(cursor.getColumnIndex("subs_master")));
+                subscriptionNumber.setUsername(cursor.getString(cursor.getColumnIndex("subs_username")));
+                subscriptionNumber.setRemoved(cursor.getInt(cursor.getColumnIndex("subs_removed")));
+                subscriptionNumber.setImg(cursor.getBlob(cursor.getColumnIndex("subs_img")));
+                subscriptionNumbers.add(subscriptionNumber);
+            }
+            cursor.close();
+
+        }catch (Exception e){
+
         }
-        cursor.close();
 
         return subscriptionNumbers;
     }

+ 9 - 6
app_core/common/src/main/res/layout/activity_work_daily.xml

@@ -1,9 +1,9 @@
 <?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:orientation="vertical"
-    android:background="@drawable/bg_main"
+              android:layout_width="match_parent"
+              android:layout_height="match_parent"
+              android:background="@drawable/bg_main"
+              android:orientation="vertical"
     >
 
     <com.core.widget.VoiceSearchView
@@ -17,8 +17,11 @@
         android:layout_height="match_parent"
         android:layout_below="@id/seach_top"
         android:background="@color/item_line"
-        android:dividerHeight="2px"
-        android:scrollbars="none" />
+        android:dividerHeight="5px"
+        android:hardwareAccelerated="true"
+        android:layerType="hardware"
+        android:scrollbars="none"
+        android:scrollingCache="false" />
 
 
 </LinearLayout>

+ 6 - 20
app_core/common/src/main/res/layout/item_activity_workdaily.xml

@@ -13,15 +13,6 @@
         android:orientation="vertical">
 
 
-        <View
-            android:layout_width="wrap_content"
-            android:layout_height="1dp"
-            android:layout_marginLeft="10dp"
-            android:layout_marginRight="10dp"
-            android:layout_marginTop="2dp"
-            android:background="@color/black_gray"
-            android:visibility="gone" />
-
         <RelativeLayout
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
@@ -35,9 +26,9 @@
                 android:layout_marginLeft="10dp"
                 android:layout_marginTop="10dp"
                 android:gravity="left|top"
-                tools:text="2016-11-02"
                 android:textColor="#000000"
-                android:textSize="16sp" />
+                android:textSize="16sp"
+                tools:text="2016-11-02" />
 
             <TextView
                 android:id="@+id/item_activity_workdaily_status"
@@ -47,9 +38,9 @@
                 android:layout_marginBottom="5dp"
                 android:layout_marginRight="10dp"
                 android:layout_marginTop="10dp"
-                tools:text="待审批"
                 android:textColor="@color/red"
-                android:textSize="15sp" />
+                android:textSize="15sp"
+                tools:text="待审批" />
         </RelativeLayout>
 
         <View
@@ -81,9 +72,9 @@
             android:maxLines="3"
             android:paddingTop="3dp"
             android:scrollHorizontally="true"
-            tools:text="总合计穷的请问您"
             android:textColor="#575757"
             android:textSize="14sp"
+            tools:text="总合计穷的请问您"
             />
 
         <TextView
@@ -95,13 +86,8 @@
             android:layout_marginRight="10dp"
             android:text="@string/common_delete"
             android:textColor="@color/titleBlue"
-            android:visibility="visible" />
+            android:visibility="gone" />
     </LinearLayout>
 
-    <View
-        android:layout_width="match_parent"
-        android:layout_height="5dp"
-        android:background="@color/gainsboro"
-        />
 
 </LinearLayout>

+ 191 - 3
app_core/network/build.gradle

@@ -1,4 +1,19 @@
 apply plugin: 'com.android.library'
+/********************start upload bintray config******************************************/
+apply plugin: 'com.jfrog.bintray'
+apply plugin: 'com.github.dcendents.android-maven'
+
+def siteUrl = 'https://github.com/Arisono/AppModular'   // 项目的主页
+def gitUrl = 'https://github.com/Arisono/AppModular.git'   // Git仓库的url
+
+Properties properties = new Properties()
+properties.load(project.rootProject.file('local.properties').newDataInputStream())
+
+
+def disVersion='1.0.9'//TODO 页面展示版本号
+version = "1.0.9" //TODO 真实发布版本号
+group = "com.alphabet.app" //最终引用形式,如compile 'com.alphabet.app:1.0.0',其中lfilepicker在后面配置
+/********************end upload bintray config******************************************/
 
 
 android {
@@ -19,12 +34,12 @@ android {
 }
 
 dependencies {
+
     compile fileTree(dir: 'libs', include: ['*.jar'])
-    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
-        exclude group: 'com.android.support', module: 'support-annotations'
-    })
     testCompile deps.junit
     compile deps.appcompatV7
+
+    compile deps.logger
     compile deps.rxjava
     compile deps.rxandroid
     compile deps.okhttp
@@ -32,4 +47,177 @@ dependencies {
     compile deps.converterGson
     compile deps.adapterRxjava
     compile deps.fastjson
+    
+}
+
+/********************start upload bintray config******************************************/
+bintray {
+    user = properties.getProperty("bintray.user")
+    key = properties.getProperty("bintray.apikey")
+    pkg {
+        repo = 'maven'//发布到Bintray的哪个仓库里,默认账户有四个库,这里上传到maven库
+        name = 'AppNetwork'//上传到JCenter的名字,最终引用的名字
+        websiteUrl = siteUrl
+        vcsUrl = gitUrl
+        licenses = ['MIT']//不能随便写,只能是仓库创建时选择的license type
+        userOrg = 'appmodular' //自己创建的organization名称
+        publish = true // 是否是公开项目,公开别人可以引用
+
+        version {
+            name =disVersion 
+            desc = 'AppBase-NetWork'//描述,自己定义
+            released = new Date()
+            vcsTag =disVersion
+            attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin']
+        }
+    }
+    configurations = ['archives']
+}
+
+install {
+    repositories.mavenInstaller {
+        // This generates POM.xml with proper parameters
+        pom {
+            project {
+                packaging 'aar'
+                // Add your description here
+                name 'arison Android'
+                description 'arison open library.'
+                url siteUrl
+                // Set your license
+                licenses {
+                    license {
+                        name 'MIT' //和之前自己定义的协议一致
+                        url 'https://raw.githubusercontent.com/minggo620/Pluto-Android/master/LICENSE'
+                    }
+                }
+                developers {
+                    developer {
+                        id 'RaoMeng'        //填写bintray或者github的用户名
+                        name 'raomeng'         //姓名
+                        email 'raomeng0109@163.com'//邮箱
+                    }
+                }
+                scm {
+                    connection gitUrl
+                    developerConnection gitUrl
+                    url siteUrl
+                }
+            }
+        }
+    }
+}
+
+task makeJar(type: Copy) {
+    delete 'build/libs/appNetwork.jar' //删除已经存在的jar包
+    from('build/intermediates/bundles/release/')//从该目录下加载要打包的文件
+    into('build/libs/')//jar包的保存目录
+    include('classes.jar')//设置过滤,只打包classes文件
+    rename('classes.jar', 'appNetwork.jar')//重命名,mylibrary.jar 根据自己的需求设置
+}
+makeJar.dependsOn(build)
+
+task sourcesJar(type: Jar) {
+    from android.sourceSets.main.java.srcDirs
+    classifier = 'sources'
+}
+task javadoc(type: Javadoc) {
+    failOnError false //必须添加以免出错
+    source = android.sourceSets.main.java.srcDirs
+    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
 }
+task javadocJar(type: Jar, dependsOn: javadoc) {
+    classifier = 'javadoc'
+    from javadoc.destinationDir
+}
+artifacts {
+    archives javadocJar
+    archives sourcesJar
+}
+javadoc {
+    options {
+        //如果你的项目里面有中文注释的话,必须将格式设置为UTF-8,不然会出现乱码
+        encoding "UTF-8"
+        charSet 'UTF-8'
+        author true
+        version true
+        links "http://docs.oracle.com/javase/8/docs/api"
+    }
+}
+/********************end upload bintray config******************************************/
+
+
+
+
+/*def siteUrl = 'https://github.com/Arisono/AppModular'      // 项目的主页
+def gitUrl = 'https://github.com/Arisono/AppModular.git'   // Git仓库的url
+group = "com.android.base" // Maven Group ID for the artifact,一般填你唯一的包名
+
+install {
+    repositories.mavenInstaller {
+        // This generates POM.xml with proper parameters
+        pom {
+            project {
+                packaging 'aar'
+                description 'Android NetWork Modular'
+                name 'Android NetWork Modular'  //项目描述
+                url siteUrl
+                licenses {
+                    license {
+                        name 'The Apache Software License, Version 2.0'
+                        url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+                    }
+                }
+                developers {
+                    developer { // 开发者信息
+                        id 'arisono'
+                        name 'Arison'
+                        email 'arisono@aliyun.com'
+                    }
+                }
+                scm {
+                    connection gitUrl
+                    developerConnection gitUrl
+                    url siteUrl
+                }
+            }
+        }
+    }
+}
+
+task sourcesJar(type: Jar) {
+    from android.sourceSets.main.java.srcDirs
+    classifier = 'sources'
+}
+task javadoc(type: Javadoc) {
+    options.encoding = 'UTF-8'
+    source = 'src/main/java'
+}
+
+task javadocJar(type: Jar, dependsOn: javadoc) {
+    classifier = 'javadoc'
+    from javadoc.destinationDir
+}
+
+artifacts {
+    archives javadocJar
+    archives sourcesJar
+}
+Properties properties = new Properties()
+
+// 加载本地配置
+properties.load(project.rootProject.file('local.properties').newDataInputStream())
+bintray {
+    user = properties.getProperty("bintray.user")
+    key = properties.getProperty("bintray.apikey")
+    configurations = ['archives']
+    pkg {
+        repo = "AppPublic"  //发布到Bintray的那个仓库里,默认账户有四个库,我们这里上传到maven库
+        name = "AppNetwork"  //发布到Bintray上的项目名字
+        websiteUrl = siteUrl
+        vcsUrl = gitUrl
+        licenses = ["Apache-2.0"]
+        publish = true
+    }*/
+/*
+}*/

+ 13 - 9
app_modular/applogin/src/main/java/com/modular/login/activity/LoginActivity.java

@@ -40,10 +40,8 @@ import java.util.HashMap;
 import de.hdodenhof.circleimageview.CircleImageView;
 
 
-
 public class LoginActivity extends BaseActivity implements View.OnClickListener {
-
-    private String PASS_WORDS = "PASS_WORDS";
+    public static final String PASS_WORDS = "PASS_WORDS";
     private CircleImageView mHeader;
     private EditText mPhoneNumberEdit;
     private EditText mPasswordEdit;
@@ -77,9 +75,15 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
         if (!MyApplication.getInstance().getBdLocationHelper().isLocationUpdate()) {
             MyApplication.getInstance().getBdLocationHelper().requestLocation();
         }
-        if (ViewUtil.mdProcessDialog!=null){
+        if (ViewUtil.mdProcessDialog != null) {
             ViewUtil.mdProcessDialog.cancel();
         }
+        if (CommonUtil.getSharedPreferences(this, "user_phone") != null && CommonUtil.getSharedPreferences(this, "user_phone").length() > 0) {
+            mPhoneNumberEdit.setText(CommonUtil.getSharedPreferences(this, "user_phone"));
+        }
+        if (PreferenceUtils.getString(this, PASS_WORDS) != null && PreferenceUtils.getString(this, PASS_WORDS).length() > 0) {
+            mPasswordEdit.setText(PreferenceUtils.getString(this, PASS_WORDS));
+        }
     }
 
     @Override
@@ -118,13 +122,14 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
         }
     }
 
+
     @Override
     public void onClick(View v) {
-        if (v.getId() == R.id.login_btn){
+        if (v.getId() == R.id.login_btn) {
             login();
-        }else if (v.getId() == R.id.tv_register){
-            startActivity(new Intent(mContext,RegisterSelectActivity.class));
-        }else if (v.getId() == R.id.tv_findPwd){
+        } else if (v.getId() == R.id.tv_register) {
+            startActivity(new Intent(mContext, RegisterSelectActivity.class));
+        } else if (v.getId() == R.id.tv_findPwd) {
             IntentUtils.webLinks(mContext,
                     "https://account.ubtob.com/user/pwd?appId=home&returnURL=http%3A%2F%2Fwww.ubtob.com%2F",
                     getString(R.string.login_getpwd));
@@ -218,7 +223,6 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
     }
 
 
-
     private void login_manage(String phone, String password) {
         if (TextUtils.isEmpty(phone)) {
             return;

+ 16 - 7
app_modular/applogin/src/main/java/com/modular/login/activity/PersonalRegActivity.java

@@ -1,5 +1,6 @@
 package com.modular.login.activity;
 
+import android.content.Intent;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
@@ -14,6 +15,7 @@ import com.common.LogUtil;
 import com.common.data.JSONUtil;
 import com.common.data.StringUtil;
 import com.common.hmac.Md5Util;
+import com.common.preferences.PreferenceUtils;
 import com.core.app.Constants;
 import com.core.base.BaseActivity;
 import com.core.net.http.ViewUtil;
@@ -35,7 +37,7 @@ public class PersonalRegActivity extends BaseActivity implements View.OnClickLis
     private FormEditText name_et;
     private Button register_btn;
     private TextView to_login_tv;
-    
+
     private int male_log = 1;
     private long bir_Timestamp = 1489141231;
     private String md5_password;
@@ -46,11 +48,11 @@ public class PersonalRegActivity extends BaseActivity implements View.OnClickLis
         super.onCreate(savedInstanceState);
         setContentView(R.layout.personal_reg_activity);
         getSupportActionBar().hide();
-        phone_et=(FormEditText) findViewById(R.id.phone_et);
-        password_et=(FormEditText) findViewById(R.id.password_et);
-        name_et=(FormEditText) findViewById(R.id.name_et);
-        register_btn= (Button) findViewById(R.id.register_btn);
-        to_login_tv= (TextView) findViewById(R.id.to_login_tv);
+        phone_et = (FormEditText) findViewById(R.id.phone_et);
+        password_et = (FormEditText) findViewById(R.id.password_et);
+        name_et = (FormEditText) findViewById(R.id.name_et);
+        register_btn = (Button) findViewById(R.id.register_btn);
+        to_login_tv = (TextView) findViewById(R.id.to_login_tv);
         initView();
     }
 
@@ -66,7 +68,7 @@ public class PersonalRegActivity extends BaseActivity implements View.OnClickLis
             //showSelectSexDialog();
 
         } else if (i == R.id.birthday_et) {
-           // showSelectBirthdayDialog();
+            // showSelectBirthdayDialog();
 
         } else if (i == R.id.register_btn) {
             registerJudge();
@@ -151,6 +153,7 @@ public class PersonalRegActivity extends BaseActivity implements View.OnClickLis
 //                }).setCancelable(true).create().show();
 //    }
 
+
     private Handler rHandler = new Handler() {
         @Override
         public void handleMessage(Message msg) {
@@ -160,6 +163,12 @@ public class PersonalRegActivity extends BaseActivity implements View.OnClickLis
                     if (!StringUtil.isEmpty(result)) {
                         if (result.contains("resultCode") && JSON.parseObject(result).getInteger("resultCode") == 1) {
                             Toast.makeText(ct, "注册成功", Toast.LENGTH_LONG).show();
+                            PreferenceUtils.putString(PersonalRegActivity.this, LoginActivity.PASS_WORDS, password_et.getText().toString().trim());
+                            CommonUtil.setSharedPreferences(PersonalRegActivity.this, "user_phone", phone_et.getText().toString().trim());
+                            Intent intent = new Intent();
+                            intent.setClass(PersonalRegActivity.this, LoginActivity.class);
+                            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+                            startActivity(intent);
                             finish();
                         } else {
                             ToastMessage(JSON.parseObject(result).getString("resultMsg"));

+ 6 - 6
app_modular/appmessages/src/main/java/com/modular/appmessages/fragment/SubscriptionAllFragment.java

@@ -56,8 +56,8 @@ public class SubscriptionAllFragment extends BaseFragment {
     private List<String> mAllKeyStrings = new ArrayList<>();//所有订阅类
     private final static int SUBSCRIBE_DETAIL_REQUEST = 33;
     private static int mClickedPos = -1;
-    private String currentMaster;//当前账套
-    private String currentUser;//当前账号
+    private String currentMaster = "";//当前账套
+    private String currentUser = "";//当前账号
     private DBManager mDbManager;
     private PopupWindow mDeletePopupWindow;
 
@@ -84,8 +84,8 @@ public class SubscriptionAllFragment extends BaseFragment {
     @Override
     protected void initViews() {
         mDbManager = new DBManager(getActivity());
-        currentMaster = CommonUtil.getSharedPreferences(getActivity(), "erp_master");
-        currentUser = CommonUtil.getSharedPreferences(getActivity(), "erp_username");
+        currentMaster = CommonUtil.getSharedPreferences(getActivity(), "erp_master", "");
+        currentUser = CommonUtil.getSharedPreferences(getActivity(), "erp_username", "");
         mPullToRefreshListView = (PullToRefreshListView) root.findViewById(R.id.subscription_all_ptlv);
         mSubscriptionNumbers = new ArrayList<>();
         mAllSubscriptonKindMessages = new ArrayList<>();
@@ -121,7 +121,7 @@ public class SubscriptionAllFragment extends BaseFragment {
                     if (mPullToRefreshListView.isRefreshing()) {
                         mPullToRefreshListView.onRefreshComplete(500);
                     }
-                    Crouton.makeText(getActivity(),getString(R.string.common_notlinknet), 0xffff4444, 1500).show();
+                    Crouton.makeText(getActivity(), getString(R.string.common_notlinknet), 0xffff4444, 1500).show();
                 }
             }
 
@@ -246,7 +246,7 @@ public class SubscriptionAllFragment extends BaseFragment {
                             mAllSubscriptionAdapter.getmSubscriptionNumbers().clear();
                             mAllSubscriptionAdapter.notifyDataSetChanged();
                         } else {
-                            if (rbPos != 0){
+                            if (rbPos != 0) {
                                 rbPos = 0;
                                 mBufferKey = keyStrings.get(0);
                                 mTypeListView.setVisibility(View.VISIBLE);

+ 75 - 62
app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/activity/DailydetailsActivity.java

@@ -35,6 +35,7 @@ import com.core.model.Approval;
 import com.core.model.EmployeesEntity;
 import com.core.net.http.ViewUtil;
 import com.core.utils.CommonUtil;
+import com.core.utils.ToastUtil;
 import com.core.utils.helper.AvatarHelper;
 import com.core.widget.CustomerScrollView;
 import com.core.widget.EmptyLayout;
@@ -137,42 +138,45 @@ public class DailydetailsActivity extends BaseActivity {
         resubmit_ll.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-
-                if (!TextUtils.isEmpty(submittype) && submittype.equals("unsubmit")) {//未提交状态
-                    Intent intent = new Intent(activity, WorkReportAddActivity.class);
-                    intent.putExtra("caller", mCaller);
-                    intent.putExtra("id", mkeyValue);
-                    intent.putExtra("rs_summary", summary);
-                    intent.putExtra("rs_plan", plan);
-                    intent.putExtra("rs_experience", experience);
-                    intent.putExtra("rs_donetask", donetask);
-                    intent.putExtra("rs_undotask", undotask);
-                    intent.putExtra("resubmit", "resubmit");
-                    intent.putExtra("report_type", mReportType);
-                    intent.putExtra("report_date", mReportDate);
-                    if (mReportType == Constants.WORK_REPORT_DAY) {
-                        intent.putExtra("report_weekdays", mReportWeekdays);
-                    } else if (mReportType == Constants.WORK_REPORT_WEEK || mReportType == Constants.WORK_REPORT_MONTH) {
-                        intent.putExtra("report_serial", mReportSerial);
-                        intent.putExtra("report_startTime", mReportStartTime);
-                        intent.putExtra("report_endTime", mReportEndTime);
+                if (CommonUtil.isNetWorkConnected(DailydetailsActivity.this)) {
+                    if (!TextUtils.isEmpty(submittype) && submittype.equals("unsubmit")) {//未提交状态
+                        Intent intent = new Intent(activity, WorkReportAddActivity.class);
+                        intent.putExtra("caller", mCaller);
+                        intent.putExtra("id", mkeyValue);
+                        intent.putExtra("rs_summary", summary);
+                        intent.putExtra("rs_plan", plan);
+                        intent.putExtra("rs_experience", experience);
+                        intent.putExtra("rs_donetask", donetask);
+                        intent.putExtra("rs_undotask", undotask);
+                        intent.putExtra("resubmit", "resubmit");
+                        intent.putExtra("report_type", mReportType);
+                        intent.putExtra("report_date", mReportDate);
+                        if (mReportType == Constants.WORK_REPORT_DAY) {
+                            intent.putExtra("report_weekdays", mReportWeekdays);
+                        } else if (mReportType == Constants.WORK_REPORT_WEEK || mReportType == Constants.WORK_REPORT_MONTH) {
+                            intent.putExtra("report_serial", mReportSerial);
+                            intent.putExtra("report_startTime", mReportStartTime);
+                            intent.putExtra("report_endTime", mReportEndTime);
+                        }
+                        startActivity(intent);
+                        Log.i("dosubmit_id", mkeyValue + "");
+                        finish();
+                    } else {                                                             //提交状态
+                        new AlertDialog
+                                .Builder(mContext)
+                                .setTitle(getString(R.string.common_notice))
+                                .setMessage(getString(R.string.daily_resubmit_notice1))
+                                .setNegativeButton(getString(R.string.common_cancel), null)
+                                .setPositiveButton(getString(R.string.common_sure), new DialogInterface.OnClickListener() {
+                                    @Override
+                                    public void onClick(DialogInterface dialog, int which) {
+                                        String retype = "reforsub";
+                                        doresubmit(retype);
+                                    }
+                                }).show();
                     }
-                    startActivity(intent);
-                    Log.i("dosubmit_id", mkeyValue + "");
-                    finish();
-                } else {                                                             //提交状态
-                    new AlertDialog
-                            .Builder(mContext)
-                            .setTitle(getString(R.string.common_notice))
-                            .setMessage(getString(R.string.daily_resubmit_notice1))
-                            .setNegativeButton(getString(R.string.common_cancel), null)
-                            .setPositiveButton(getString(R.string.common_sure), new DialogInterface.OnClickListener() {
-                                @Override
-                                public void onClick(DialogInterface dialog, int which) {
-                                    String retype = "reforsub";
-                                    doresubmit(retype);
-                                }
-                            }).show();
+                } else {
+                    ToastUtil.showToast(DailydetailsActivity.this, R.string.networks_out);
                 }
 
             }
@@ -181,34 +185,39 @@ public class DailydetailsActivity extends BaseActivity {
         delete_ll.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-                if (!TextUtils.isEmpty(submittype) && submittype.equals("unsubmit")) {
-                    new AlertDialog
-                            .Builder(mContext)
-                            .setTitle(getString(R.string.common_notice))
-                            .setMessage(getString(R.string.delete_notice1))
-                            .setNegativeButton(getString(R.string.common_cancel), null)
-                            .setPositiveButton(getString(R.string.common_sure), new DialogInterface.OnClickListener() {
-                                @Override
-                                public void onClick(DialogInterface dialog, int which) {
-                                    dodelete(mkeyValue);
-                                }
-                            }).show();
+                if (CommonUtil.isNetWorkConnected(DailydetailsActivity.this)) {
+                    if (!TextUtils.isEmpty(submittype) && submittype.equals("unsubmit")) {
+                        new AlertDialog
+                                .Builder(mContext)
+                                .setTitle(getString(R.string.common_notice))
+                                .setMessage(getString(R.string.delete_notice1))
+                                .setNegativeButton(getString(R.string.common_cancel), null)
+                                .setPositiveButton(getString(R.string.common_sure), new DialogInterface.OnClickListener() {
+                                    @Override
+                                    public void onClick(DialogInterface dialog, int which) {
+                                        dodelete(mkeyValue);
+                                    }
+                                }).show();
 
+                    } else {
+                        new AlertDialog
+                                .Builder(mContext)
+                                .setTitle(getString(R.string.common_notice))
+                                .setMessage(getString(R.string.delete_sumited_notice1))
+                                .setNegativeButton(getString(R.string.common_cancel), null)
+                                .setPositiveButton(getString(R.string.common_sure), new DialogInterface.OnClickListener() {
+                                    @Override
+                                    public void onClick(DialogInterface dialog, int which) {
+                                        String retype = "refordelete";
+                                        doresubmit(retype);
+                                    }
+                                }).show();
+                    }
                 } else {
-                    new AlertDialog
-                            .Builder(mContext)
-                            .setTitle(getString(R.string.common_notice))
-                            .setMessage(getString(R.string.delete_sumited_notice1))
-                            .setNegativeButton(getString(R.string.common_cancel), null)
-                            .setPositiveButton(getString(R.string.common_sure), new DialogInterface.OnClickListener() {
-
-                                public void onClick(DialogInterface dialog, int which) {
-                                    String retype = "refordelete";
-                                    doresubmit(retype);
-                                }
-                            }).show();
+                    ToastUtil.showToast(DailydetailsActivity.this, R.string.networks_out);
                 }
 
+
             }
         });
 
@@ -1012,9 +1021,13 @@ public class DailydetailsActivity extends BaseActivity {
 
         // 当获取到正确的单据caller和单据id时 请求获取审批流数据
         if (!TextUtils.isEmpty(mCaller) && mkeyValue != -1) {
-            progressDialog.show();
-            getSingleWorkReports();
-            getCurrentJnodes();
+            if (CommonUtil.isNetWorkConnected(this)) {
+                progressDialog.show();
+                getSingleWorkReports();
+                getCurrentJnodes();
+            } else {
+                initDetailLocal();
+            }
         } else {
             approval_flowlv.setVisibility(View.GONE);
             hide_above_af.setVisibility(View.GONE);

+ 15 - 10
app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/activity/WorkDailyShowActivity.java

@@ -11,7 +11,6 @@ import android.support.v7.app.AlertDialog;
 import android.text.Editable;
 import android.text.TextUtils;
 import android.text.TextWatcher;
-import android.util.Log;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
@@ -57,6 +56,7 @@ import java.util.Map;
 public class WorkDailyShowActivity extends BaseActivity {
     private final int DAILY_DETAIL_EDIT = 0x01;
     private final int WORK_DAILY_REQUEST = 101;
+    private final int DELETE_REPORT_ITEM = 0x11;
 
     private VoiceSearchView voiceSearchView;
     private PullToRefreshListView mPullToRefreshListView;
@@ -320,6 +320,12 @@ public class WorkDailyShowActivity extends BaseActivity {
                     }
                     progressDialog.dismiss();
                     break;
+                case DELETE_REPORT_ITEM:
+                    int position = (int) msg.obj;
+                    mWorkReportAdapter.getWorkReportList().remove(position);
+                    mWorkReportAdapter.notifyDataSetChanged();
+                    mPullToRefreshListView.postInvalidate();
+                    break;
                 case Constants.APP_SOCKETIMEOUTEXCEPTION:
                     if (msg.getData() != null) {
                         if (!StringUtil.isEmpty(msg.getData().getString("result"))) {
@@ -327,7 +333,8 @@ public class WorkDailyShowActivity extends BaseActivity {
                             progressDialog.dismiss();
                         }
                     }
-
+                    break;
+                default:
                     break;
             }
 
@@ -491,7 +498,6 @@ public class WorkDailyShowActivity extends BaseActivity {
             if (mReportType == Constants.WORK_REPORT_DAY) {
                 viewHolder.WorkDailyDate.setText(workReportList.get(position).getDate());
             } else if (mReportType == Constants.WORK_REPORT_WEEK) {
-
                 viewHolder.WorkDailyDate.setText((TextUtils.isEmpty(workReportList.get(position).getSerial()) ? "" : "第" + workReportList.get(position).getSerial() + "周  ")
                         + workReportList.get(position).getDate());
             } else if (mReportType == Constants.WORK_REPORT_MONTH) {
@@ -522,11 +528,9 @@ public class WorkDailyShowActivity extends BaseActivity {
             }
             viewHolder.WorkDailySummary.setText(workReportList.get(position).getComment());
 
-            final ViewHolder finalViewHolder = viewHolder;
             viewHolder.WorkDailyDelete.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View v) {
-
                     new AlertDialog
                             .Builder(mContext)
                             .setTitle(mContext.getString(R.string.common_notice))
@@ -539,7 +543,6 @@ public class WorkDailyShowActivity extends BaseActivity {
                                         int mkeyValue = workReportList.get(position).getReportId();
                                         mPosition = position;
                                         dodelete(mkeyValue);
-                                        finalViewHolder.WorkDailyDelete.setVisibility(View.GONE);
                                     } else {
                                         ToastUtil.showToast(mContext, R.string.networks_out);
                                     }
@@ -557,7 +560,6 @@ public class WorkDailyShowActivity extends BaseActivity {
             HashMap<String, Object> params = new HashMap<>();
             params.put("caller", mCaller);
             params.put("id", mkeyValue);
-            Log.i("dodeleted", mkeyValue + "");
             LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
             headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(mContext, "sessionId"));
             LogUtil.prinlnLongMsg("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(mContext, "sessionId"));
@@ -573,8 +575,11 @@ public class WorkDailyShowActivity extends BaseActivity {
                     case DELETE_DOC_REQUEST_SUCCESSFULLY:
                         if (!StringUtil.isEmpty(msg.getData().getString("result"))) {
                             String delete_result = msg.getData().getString("result");
-                            LogUtil.prinlnLongMsg("delete_result", delete_result);
                             if (JSON.parseObject(delete_result).containsKey("success") && JSON.parseObject(delete_result).getBoolean("success")) {
+                                Message message = Message.obtain();
+                                message.what = DELETE_REPORT_ITEM;
+                                message.obj = mPosition;
+                                mHandler.sendMessage(message);
                                 String deleteResult = getResources().getString(R.string.report_delete_result);
                                 String deleteSuccess = "";
                                 if (mReportType == Constants.WORK_REPORT_DAY) {
@@ -585,8 +590,6 @@ public class WorkDailyShowActivity extends BaseActivity {
                                     deleteSuccess = String.format(deleteResult, "月", "成功");
                                 }
                                 Toast.makeText(mContext, deleteSuccess, Toast.LENGTH_LONG).show();
-                                workReportList.remove(mPosition);
-                                notifyDataSetChanged();
 //                                notifyDataSetInvalidated();
                             }
                         }
@@ -635,6 +638,8 @@ public class WorkDailyShowActivity extends BaseActivity {
                 protected void publishResults(CharSequence constraint, FilterResults results) {
                     workReportList = (List<WorkReportBean>) results.values;
                     notifyDataSetChanged();
+                    //防止出现重影
+                    mPullToRefreshListView.postInvalidate();
                     if (results.count == 0 && mEmptyLayout != null) {
                         mEmptyLayout.showEmpty();
                     }

+ 199 - 114
app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/activity/WorkReportAddActivity.java

@@ -72,6 +72,7 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
     private static final int GRAB_JOB_CONTENT = 0x05;
     private static final int GET_MULTINODE_ASSIGNS = 0x06;
     private static final int SELECT_APPROVERS = 0x07;
+    private static final int WORK_REPORT_LIST = 0x08;
 
     private TextView mReportTimeTv;
     private RadioGroup mReportTimeRg;
@@ -113,7 +114,7 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
     private int mReportType = Constants.WORK_REPORT_DAY;
     private int mkeyValue;
     private HttpClient mHttpClient;
-    private boolean isModify = false, isOptionEvent = false;
+    private boolean isPresentModify = false, isBeforeModify = false, isOptionEvent = false, isUpdateModify = false;
 
     private String mTodayDate, mYesterdayDate, mTodayWeek, mYesterdayWeek;
     private String mThisWeekStartDate, mThisWeekEndDate, mLastWeekStartDate, mLastWeekEndDate, mThisWeekSerial, mLastWeekSerial;
@@ -121,7 +122,7 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
     private String mTodayTime = "", mYesterdayTime = "", mThisWeekTime = "", mLastWeekTime = "", mThisMonthTime = "", mLastMonthTime = "";
     private String mDailyReportDate = "", mDailyReportWeek = "", mWeekReportStartDate = "", mWeekReportEndDate = "", mMonthReportStartDate = "", mMonthReportEndDate = "", mWeekReportSerial = "", mMonthReportSerial = "";
 
-    private String mUpdateDate = "", mUpdateWeekdays = "", mUpdateSerial = "", mUpdateStartTime = "", mUpdateEndTime = "";
+    private String mUpdateDate = "", mUpdateWeekdays = "", mUpdateSerial = "", mUpdateStartTime = "", mUpdateEndTime = "", mUpdateSummary = "", mUpdateSchedule = "", mUpdateExperience = "";
     private boolean isOnlyUpdate = false, isPresentExist = false, isBeforeExist = false;
     private WorkReportBean mInitPresentWorkReportBean, mInitBeforeWorkReportBean;
     private String mPresentPlan = "", mBeforePlan = "";
@@ -189,7 +190,7 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
                                             if (isOptionEvent) {
                                                 intent1.putExtra("fromwhere", "nosubmitdaily");
                                             }
-                                            startActivity(intent1);
+                                            startActivityForResult(intent1, WORK_REPORT_LIST);
                                         }
                                         if (!isOptionEvent) {
                                             finish();
@@ -325,17 +326,21 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
             } else if ("resubmit".equals(resubmit)) {
                 mSubmitButton.setText(getString(R.string.common_resubmit_button));
             }
-            if (!TextUtils.isEmpty(intent.getStringExtra("rs_summary"))) {
-                mSummaryContentEt.setText(intent.getStringExtra("rs_summary"));
+            mUpdateSummary = intent.getStringExtra("rs_summary");
+            if (!TextUtils.isEmpty(mUpdateSummary)) {
+                mSummaryContentEt.setText(mUpdateSummary);
+            } else {
+                mSummaryContentEt.setText("");
             }
-
-            if (!TextUtils.isEmpty(intent.getStringExtra("rs_plan"))) {
-                mNewScheduleContentEt.setText(intent.getStringExtra("rs_plan"));
+            mUpdateSchedule = intent.getStringExtra("rs_plan");
+            if (!TextUtils.isEmpty(mUpdateSchedule)) {
+                mNewScheduleContentEt.setText(mUpdateSchedule);
             } else {
                 mNewScheduleContentEt.setText("");
             }
-            if (!TextUtils.isEmpty(intent.getStringExtra("rs_experience"))) {
-                mExperienceContentEt.setText(intent.getStringExtra("rs_experience"));
+            mUpdateExperience = intent.getStringExtra("rs_experience");
+            if (!TextUtils.isEmpty(mUpdateExperience)) {
+                mExperienceContentEt.setText(mUpdateExperience);
             } else {
                 mExperienceContentEt.setText("");
             }
@@ -425,8 +430,27 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
 
             @Override
             public void afterTextChanged(Editable s) {
-                isModify = true;
                 mSummaryText = mSummaryContentEt.getText().toString();
+                if (isPresentExist && mReportTimePresentRb.isChecked()
+                        && !mSummaryText.equals(mInitPresentWorkReportBean.getComment())) {
+                    isPresentModify = true;
+                } else {
+                    isPresentModify = false;
+                }
+                if (isBeforeExist && mReportTimeBeforeRb.isChecked()
+                        && !mSummaryText.equals(mInitBeforeWorkReportBean.getComment())) {
+                    isBeforeModify = true;
+                } else {
+                    isBeforeModify = false;
+                }
+                if (!TextUtils.isEmpty(resubmit)) {
+                    if (!mSummaryText.equals(mUpdateSummary)) {
+                        isUpdateModify = true;
+                    } else {
+                        isUpdateModify = false;
+                    }
+                }
+
             }
         });
 
@@ -446,8 +470,26 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
 
             @Override
             public void afterTextChanged(Editable s) {
-                isModify = true;
                 mNewScheduleText = mNewScheduleContentEt.getText().toString();
+                if (isPresentExist && mReportTimePresentRb.isChecked()
+                        && !mNewScheduleText.equals(mInitPresentWorkReportBean.getPlan())) {
+                    isPresentModify = true;
+                } else {
+                    isPresentModify = false;
+                }
+                if (isBeforeExist && mReportTimeBeforeRb.isChecked()
+                        && !mNewScheduleText.equals(mInitBeforeWorkReportBean.getPlan())) {
+                    isBeforeModify = true;
+                } else {
+                    isBeforeModify = false;
+                }
+                if (!TextUtils.isEmpty(resubmit)) {
+                    if (!mNewScheduleText.equals(mUpdateSchedule)) {
+                        isUpdateModify = true;
+                    } else {
+                        isUpdateModify = false;
+                    }
+                }
             }
         });
 
@@ -467,8 +509,26 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
 
             @Override
             public void afterTextChanged(Editable s) {
-                isModify = true;
                 mExperienceText = mExperienceContentEt.getText().toString();
+                if (isPresentExist && mReportTimePresentRb.isChecked()
+                        && !mExperienceText.equals(mInitPresentWorkReportBean.getExperience())) {
+                    isPresentModify = true;
+                } else {
+                    isPresentModify = false;
+                }
+                if (isBeforeExist && mReportTimeBeforeRb.isChecked()
+                        && !mExperienceText.equals(mInitBeforeWorkReportBean.getExperience())) {
+                    isBeforeModify = true;
+                } else {
+                    isBeforeModify = false;
+                }
+                if (!TextUtils.isEmpty(resubmit)) {
+                    if (!mExperienceText.equals(mUpdateExperience)) {
+                        isUpdateModify = true;
+                    } else {
+                        isUpdateModify = false;
+                    }
+                }
             }
         });
     }
@@ -1323,128 +1383,135 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
         final Intent intent = getIntent();
         fromqzone = intent.getStringExtra("fromqzone");
         final boolean isResubmit = !TextUtils.isEmpty(resubmit) && ("unsub_tosub".equals(resubmit) || "resubmit".equals(resubmit));
-        if (isResubmit || (mReportTimePresentRb.isChecked() && isPresentExist)
-                || (mReportTimeBeforeRb.isChecked() && isBeforeExist)) {
-            if (isModify) {
-                new AlertDialog
-                        .Builder(mContext)
-                        .setTitle(getString(R.string.common_notice))
-                        .setMessage("正在离开录入页面,是否更新汇报内容?")
-                        .setNegativeButton(R.string.give_up, new DialogInterface.OnClickListener() {
-                            @Override
-                            public void onClick(DialogInterface dialog, int which) {
-                                if (isResubmit || isOptionEvent) {
-                                    Intent intent1 = new Intent(WorkReportAddActivity.this, WorkDailyShowActivity.class);
-                                    intent1.putExtra("caller", mCaller);
-                                    intent1.putExtra("report_type", mReportType);
-                                    if (isOptionEvent) {
-                                        intent1.putExtra("fromwhere", "nosubmitdaily");
-                                    }
-                                    startActivity(intent1);
+        if ((isResubmit && isUpdateModify) || (mReportTimePresentRb.isChecked() && isPresentExist && isPresentModify)
+                || (mReportTimeBeforeRb.isChecked() && isBeforeExist && isBeforeModify)) {
+            new AlertDialog
+                    .Builder(mContext)
+                    .setTitle(getString(R.string.common_notice))
+                    .setMessage("正在离开录入页面,是否更新汇报内容?")
+                    .setNegativeButton(R.string.give_up, new DialogInterface.OnClickListener() {
+                        @Override
+                        public void onClick(DialogInterface dialog, int which) {
+                            if (isResubmit || isOptionEvent) {
+                                Intent intent1 = new Intent(WorkReportAddActivity.this, WorkDailyShowActivity.class);
+                                intent1.putExtra("caller", mCaller);
+                                intent1.putExtra("report_type", mReportType);
+                                if (isOptionEvent) {
+                                    intent1.putExtra("fromwhere", "nosubmitdaily");
                                 }
-                                if (!isOptionEvent) {
-                                    finish();
+                                startActivityForResult(intent1, WORK_REPORT_LIST);
+                            }
+                            if (!isOptionEvent) {
+                                finish();
+                            }
+                        }
+                    })
+                    .setPositiveButton(R.string.updata, new DialogInterface.OnClickListener() {
+                        @Override
+                        public void onClick(DialogInterface dialog, int which) {
+                            if (mSummaryContentEt.testValidity()) {
+                                if (mNewScheduleContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER &&
+                                        mExperienceContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER) {
+                                    if (CommonUtil.isNetWorkConnected(WorkReportAddActivity.this)) {
+                                        isOnlyUpdate = true;
+                                        progressDialog.show();
+                                        updateWorkReport();
+                                    } else {
+                                        ToastUtil.showToast(WorkReportAddActivity.this, R.string.networks_out);
+                                    }
+
+                                } else {
+                                    ToastUtil.showToast(WorkReportAddActivity.this, "字数已超限!");
                                 }
                             }
-                        })
-                        .setPositiveButton(R.string.updata, new DialogInterface.OnClickListener() {
-                            @Override
-                            public void onClick(DialogInterface dialog, int which) {
-                                if (mSummaryContentEt.testValidity()) {
+
+                        }
+                    }).create().show();
+        } else {
+            if (((mReportTimePresentRb.isChecked() && !isPresentExist)
+                    || (mReportTimeBeforeRb.isChecked() && !isBeforeExist)) && !isResubmit) {
+                if (mSummaryText.length() > 0 ||
+                        mNewScheduleText.length() > 0 ||
+                        mExperienceText.length() > 0) {
+                    new AlertDialog
+                            .Builder(mContext)
+                            .setTitle(getString(R.string.common_notice))
+                            .setMessage(getString(R.string.work_report_exit_notice))
+                            .setNegativeButton(R.string.give_up, new DialogInterface.OnClickListener() {
+                                @Override
+                                public void onClick(DialogInterface dialog, int which) {
+                                    boolean isResubmit = !TextUtils.isEmpty(resubmit) && ("unsub_tosub".equals(resubmit) || "resubmit".equals(resubmit));
+                                    if (isResubmit || isOptionEvent) {
+                                        Intent optionIntent = new Intent(WorkReportAddActivity.this, WorkDailyShowActivity.class);
+                                        optionIntent.putExtra("caller", mCaller);
+                                        optionIntent.putExtra("report_type", mReportType);
+                                        if (isOptionEvent) {
+                                            optionIntent.putExtra("fromwhere", "nosubmitdaily");
+                                        }
+                                        startActivityForResult(optionIntent, WORK_REPORT_LIST);
+                                    } else if (!TextUtils.isEmpty(fromqzone) && "fromqzone".equals(fromqzone)) {
+
+                                    } else {
+                                        Intent intent1 = new Intent(WorkReportAddActivity.this, WorkReportMenuActivity.class);
+                                        startActivity(intent1);
+                                    }
+                                    if (!isOptionEvent) {
+                                        finish();
+                                    }
+                                }
+                            })
+                            .setPositiveButton(R.string.save, new DialogInterface.OnClickListener() {
+
+                                @Override
+                                public void onClick(DialogInterface dialog, int which) {
                                     if (mNewScheduleContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER &&
                                             mExperienceContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER) {
                                         if (CommonUtil.isNetWorkConnected(WorkReportAddActivity.this)) {
-                                            isOnlyUpdate = true;
                                             progressDialog.show();
-                                            updateWorkReport();
+                                            saveWorkReport();
                                         } else {
                                             ToastUtil.showToast(WorkReportAddActivity.this, R.string.networks_out);
                                         }
-
                                     } else {
                                         ToastUtil.showToast(WorkReportAddActivity.this, "字数已超限!");
                                     }
-                                }
-
-                            }
-                        }).create().show();
-            } else {
-
-            }
-        } else {
-            if (mSummaryText.length() > 0 ||
-                    mNewScheduleText.length() > 0 ||
-                    mExperienceText.length() > 0) {
-                new AlertDialog
-                        .Builder(mContext)
-                        .setTitle(getString(R.string.common_notice))
-                        .setMessage(getString(R.string.work_report_exit_notice))
-                        .setNegativeButton(R.string.give_up, new DialogInterface.OnClickListener() {
-                            @Override
-                            public void onClick(DialogInterface dialog, int which) {
-                                boolean isResubmit = !TextUtils.isEmpty(resubmit) && ("unsub_tosub".equals(resubmit) || "resubmit".equals(resubmit));
-                                if (isResubmit || isOptionEvent) {
-                                    Intent optionIntent = new Intent(WorkReportAddActivity.this, WorkDailyShowActivity.class);
-                                    optionIntent.putExtra("caller", mCaller);
-                                    optionIntent.putExtra("report_type", mReportType);
-                                    if (isOptionEvent) {
-                                        optionIntent.putExtra("fromwhere", "nosubmitdaily");
-                                    }
-                                    startActivity(optionIntent);
-
-                                } else if (!TextUtils.isEmpty(fromqzone) && "fromqzone".equals(fromqzone)) {
 
-                                } else {
-                                    Intent intent1 = new Intent(WorkReportAddActivity.this, WorkReportMenuActivity.class);
-                                    startActivity(intent1);
-                                }
-                                if (!isOptionEvent) {
-                                    finish();
                                 }
-                            }
-                        })
-                        .setPositiveButton(R.string.save, new DialogInterface.OnClickListener() {
-
-                            @Override
-                            public void onClick(DialogInterface dialog, int which) {
-                                if (mNewScheduleContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER &&
-                                        mExperienceContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER) {
-                                    if (CommonUtil.isNetWorkConnected(WorkReportAddActivity.this)) {
-                                        progressDialog.show();
-                                        saveWorkReport();
-                                    } else {
-                                        ToastUtil.showToast(WorkReportAddActivity.this, R.string.networks_out);
-                                    }
-                                } else {
-                                    ToastUtil.showToast(WorkReportAddActivity.this, "字数已超限!");
-                                }
-
-                            }
-                        }).show();
+                            }).show();
+                } else if (!TextUtils.isEmpty(fromqzone) && "fromqzone".equals(fromqzone)) {
+                    finish();
+                } else {
+                    leaveIntent(isResubmit);
+                }
             } else if (!TextUtils.isEmpty(fromqzone) && "fromqzone".equals(fromqzone)) {
                 finish();
             } else {
-                Intent intent1 = null;
-                if (isResubmit || isOptionEvent) {
-                    intent1 = new Intent(WorkReportAddActivity.this, WorkDailyShowActivity.class);
-                    intent1.putExtra("caller", mCaller);
-                    intent1.putExtra("report_type", mReportType);
-                    if (isOptionEvent) {
-                        intent1.putExtra("fromwhere", "nosubmitdaily");
-                    }
-                    startActivity(intent1);
-                } else {
-                    intent1 = new Intent(WorkReportAddActivity.this, WorkReportMenuActivity.class);
-                    startActivity(intent1);
-                }
-                if (!isOptionEvent) {
-                    finish();
-                }
+                leaveIntent(isResubmit);
             }
+
         }
 
     }
 
+    private void leaveIntent(boolean isResubmit) {
+        Intent intent1 = null;
+        if (isResubmit || isOptionEvent) {
+            intent1 = new Intent(WorkReportAddActivity.this, WorkDailyShowActivity.class);
+            intent1.putExtra("caller", mCaller);
+            intent1.putExtra("report_type", mReportType);
+            if (isOptionEvent) {
+                intent1.putExtra("fromwhere", "nosubmitdaily");
+            }
+            startActivityForResult(intent1, WORK_REPORT_LIST);
+        } else {
+            intent1 = new Intent(WorkReportAddActivity.this, WorkReportMenuActivity.class);
+            startActivity(intent1);
+        }
+        if (!isOptionEvent) {
+            finish();
+        }
+    }
+
     private void saveWorkReport() {
         String saveUrl = "oa/persontask/saveWorkDaily.action";
         if (mReportType == Constants.WORK_REPORT_DAY) {
@@ -1476,7 +1543,7 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
                         if (isOptionEvent) {
                             optionIntent.putExtra("fromwhere", "nosubmitdaily");
                         }
-                        startActivity(optionIntent);
+                        startActivityForResult(optionIntent, WORK_REPORT_LIST);
 
                     } else if (!TextUtils.isEmpty(fromqzone) && "fromqzone".equals(fromqzone)) {
 
@@ -1526,6 +1593,22 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
             } else {
                 jumptododetail(mkeyValue);
             }
+        } else if (requestCode == WORK_REPORT_LIST) {
+            mDateLinearLayout.setVisibility(View.GONE);
+            mReportTimeRg.setVisibility(View.VISIBLE);
+            mOldScheduleLl.setVisibility(View.VISIBLE);
+            mSummaryContentEt.setText("");
+            mNewScheduleContentEt.setText("");
+            mExperienceContentEt.setText("");
+            isPresentExist = false;
+            isBeforeExist = false;
+            mInitPresentWorkReportBean = new WorkReportBean();
+            mInitBeforeWorkReportBean = new WorkReportBean();
+            if (CommonUtil.isNetWorkConnected(this)) {
+                getWorkReportInit();
+            } else {
+                ToastUtil.showToast(this, R.string.networks_out);
+            }
         }
     }
 
@@ -1536,7 +1619,9 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
     }
 
     private void getEmnameByReturn(String text) {
-        if (StringUtil.isEmpty(text)) return;
+        if (StringUtil.isEmpty(text)) {
+            return;
+        }
         Pattern pattern = Pattern.compile("(?<=\\()(.+?)(?=\\))");
         Matcher matcher = pattern.matcher(text);
         if (matcher.find()) {