Explorar el Código

新的加班申请单据反提交删除操作完成。

FANGLH hace 9 años
padre
commit
394e3849be

+ 66 - 12
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/CommonDocDetailsActivity.java

@@ -65,6 +65,9 @@ public class CommonDocDetailsActivity extends BaseActivity {
 
     private static final int COM_DOC_RESUB_SUCCESSFUL = 1213;
     private static final int COM_DOC_REDELETE_SUCCESSFUL = 1215;
+    private static final int NEW_DOC_RESUB_SUCCESSFUL = 52601;
+    private static final int New_DOC_REDELETE_SUCCESSFUL = 52602;
+    private static final int NEW_DELETE_DOC_REQUEST = 52603;
     @ViewInject(R.id.common_docui_photo_img)
     private ImageView photo_im;
     @ViewInject(R.id.common_docui_name_tv)
@@ -199,7 +202,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
             if ("FeePlease!CCSQ".equals(mCaller)) {
                 getSupportActionBar().setTitle(getString(R.string.oatravel_apply)+ getString(R.string.doc_detail));
             }
-            if ("Workovertime".equals(mCaller)) {
+            if ("Workovertime".equals(mCaller) || "ExtraWork$".equals(mCaller)) {
                 getSupportActionBar().setTitle(getString(R.string.oaovertime_apply)+ getString(R.string.doc_detail));
             }
             if ("SpeAttendance".equals(mCaller)) {
@@ -294,6 +297,17 @@ public class CommonDocDetailsActivity extends BaseActivity {
                     FormListSelectActivity.reload=false;
                     finish();
                     break;
+                case  NEW_DELETE_DOC_REQUEST:
+                    if (msg.getData() != null){
+                        String new_delete_doc_result = msg.getData().getString("result");
+                        LogUtil.prinlnLongMsg("new_delete_doc_result", new_delete_doc_result);
+                        Toast.makeText(getApplicationContext(), getString(R.string.common_delete), Toast.LENGTH_LONG).show();
+                        progressDialog.dismiss();
+                        FormListSelectActivity.isdelete = true;
+                        FormListSelectActivity.reload=false;
+                        finish();
+                    }
+                    break;
                 case COM_DOC_RESUB_SUCCESSFUL:  //已提交状态 重新提交操作前的反提交
                     if (msg.getData() != null) {
                         if (!StringUtils.isEmpty(msg.getData().getString("result"))) {
@@ -319,6 +333,27 @@ public class CommonDocDetailsActivity extends BaseActivity {
                         }
                     }
                     break;
+                case NEW_DOC_RESUB_SUCCESSFUL:
+                    if (msg.getData() != null){
+                        String new_doc_resub_result = msg.getData().getString("result");
+                        LogUtil.prinlnLongMsg("new_doc_resub_result", new_doc_resub_result);
+                        startActivity(new Intent(CommonDocDetailsActivity.this, DataFormDetailActivity.class)
+                                .putExtra("caller", mCaller)
+                                .putExtra("id", mkeyValue)
+                                .putExtra("submittype", "resubmit")
+                                .putExtra("status","已提交"));
+
+                        finish();
+                    }
+                    break;
+
+                case New_DOC_REDELETE_SUCCESSFUL:
+                    if (msg.getData() != null){
+                        String new_doc_redelete_result = msg.getData().getString("result");
+                        LogUtil.prinlnLongMsg("new_doc_redelete_result", new_doc_redelete_result);
+                        DeleteComDocRequest(mCaller, mkeyValue);
+                    }
+                    break;
                 case Constants.APP_SOCKETIMEOUTEXCEPTION:
                     Toast.makeText(CommonDocDetailsActivity.this, msg.getData().getString("result"), Toast.LENGTH_LONG).show();
                     if (!TextUtils.isEmpty(real_status) && real_status.equals("已审核")) {
@@ -338,15 +373,20 @@ public class CommonDocDetailsActivity extends BaseActivity {
      * @param mkeyValue
      */
     private void DeleteComDocRequest(String mCaller, int mkeyValue) {
-
-        String url = CommonUtil.getSharedPreferences(ct, "erp_baseurl") + "/mobile/commondelete.action";
         Map<String, Object> formStoreMap = new HashMap<>();
         HashMap<String, Object> params = new HashMap<>();
         params.put("caller", mCaller);
         params.put("id", mkeyValue);
         LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
         headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
-        ViewUtil.httpSendRequest(this, url, params, mHandler, headers, DELETE_DOC_REQUEST, null, null, "get");
+        String url = "";
+        if ("ExtraWork$".equals(mCaller)){
+            url = CommonUtil.getSharedPreferences(ct, "erp_baseurl") + "/hr/attendance/deleteExtraWork.action";
+            ViewUtil.httpSendRequest(this, url, params, mHandler, headers, NEW_DELETE_DOC_REQUEST, null, null, "post");
+        }else {
+            url = CommonUtil.getSharedPreferences(ct, "erp_baseurl") + "/mobile/commondelete.action";
+            ViewUtil.httpSendRequest(this, url, params, mHandler, headers, DELETE_DOC_REQUEST, null, null, "get");
+        }
 
     }
 
@@ -779,13 +819,20 @@ public class CommonDocDetailsActivity extends BaseActivity {
                                 .setPositiveButton(getString(R.string.common_sure), new DialogInterface.OnClickListener() {
                                     @Override
                                     public void onClick(DialogInterface dialog, int which) {
-                                        String url = Constants.getAppBaseUrl(ct) + "/mobile/commonres.action";
                                         Map<String, Object> params = new HashMap<>();
                                         params.put("caller", mCaller);
                                         params.put("id", mkeyValue);
                                         LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
                                         headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
-                                        ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, COM_DOC_RESUB_SUCCESSFUL, null, null, "post");
+                                        String url = "";
+                                        if ("ExtraWork$".equals(mCaller)){ // 新的加班单反提交
+                                            url = Constants.getAppBaseUrl(ct) + "/hr/attendance/resSubmitExtraWork.action";
+                                            ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, NEW_DOC_RESUB_SUCCESSFUL, null, null, "post");
+
+                                        }else { // 通用老的反提交
+                                            url = Constants.getAppBaseUrl(ct) + "/mobile/commonres.action";
+                                            ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, COM_DOC_RESUB_SUCCESSFUL, null, null, "post");
+                                        }
 
                                     }
                                 }).show();
@@ -823,14 +870,21 @@ public class CommonDocDetailsActivity extends BaseActivity {
                                 @Override
                                     public void onClick(DialogInterface dialog, int which) {  //反提交
                                         progressDialog.show();
-                                        String url = Constants.getAppBaseUrl(ct) + "/mobile/commonres.action";
-                                        Map<String, Object> params = new HashMap<>();
-                                        params.put("caller", mCaller);
-                                        params.put("id", mkeyValue);
-                                        LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
-                                        headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
+
+                                    Map<String, Object> params = new HashMap<>();
+                                    params.put("caller", mCaller);
+                                    params.put("id", mkeyValue);
+                                    LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
+                                    headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
+                                    String url = "";
+                                    if ("ExtraWork$".equals(mCaller)){ // 新的加班单反提交
+                                        url = Constants.getAppBaseUrl(ct) + "/hr/attendance/resSubmitExtraWork.action";
+                                        ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, New_DOC_REDELETE_SUCCESSFUL, null, null, "post");
+                                    }else { // 通用老的反提交
+                                        url = Constants.getAppBaseUrl(ct) + "/mobile/commonres.action";
                                         ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, COM_DOC_REDELETE_SUCCESSFUL, null, null, "post");
                                     }
+                                    }
                                 }).show();
                 }
             }

+ 19 - 19
WeiChat/src/main/res/values-en/strings.xml

@@ -1218,23 +1218,23 @@
     <string name = "hour">hour</string>
     <string name = "remove_blacklist"> remove the blacklist </string>
     <string name = "say_hello"> Say hello </string>
-        <string name = "send_msg"> send a message </string>
-        <string name = "say_hello_succ"> Say hello success </string>
-        <string name = "add_friend_succ"> add friends success </string>
-        <string name = "error_phone"> phone format is not correct </string>
-        <string name = "say_hello_dialog_title"> Verify the message </string>
-        <string name = "say_hello_dialog_hint"> pro, give me a reason to add you! </string>
-        <string name = "say_hello_default"> Hey, hello! </string>
-        <string name = "add_attention_succ"> Attention to success </string>
-        <string name = "add_attention_failed"> Attention Failed, you have been blacklisted by each other </string>
-        <string name = "set_remark_name"> set the note name </string>
-        <string name = "remove_blacklist_succ"> remove the blacklist succeed </string>
-        <string name = "cancel_attention_prompt"> Are you sure you want to cancel your attention? </string>
-        <string name = "delete_all_prompt"> completely delete the operation, if the other side is also concerned about you, then it will cancel the other side of your concern, sure to completely delete it? </string>
-        <string name = "cancel_attention_succ"> cancel attention successfully </string>
-        <string name = "prompt_title"> prompt </string>
-        <string name = "delete_all_succ"> delete success </string>
-        <string name = "remove_blacklist_prompt"> Are you sure you want to remove the blacklist? </string>
-        <string name = "add_blacklist_prompt"> Are you sure you want to add a blacklist? </string>
-        <string name = "add_blacklist_succ"> add blacklist success </string>
+    <string name = "send_msg"> send a message </string>
+    <string name = "say_hello_succ"> Say hello success </string>
+    <string name = "add_friend_succ"> add friends success </string>
+    <string name = "error_phone"> phone format is not correct </string>
+    <string name = "say_hello_dialog_title"> Verify the message </string>
+    <string name = "say_hello_dialog_hint"> pro, give me a reason to add you! </string>
+    <string name = "say_hello_default"> Hey, hello! </string>
+    <string name = "add_attention_succ"> Attention to success </string>
+    <string name = "add_attention_failed"> Attention Failed, you have been blacklisted by each other </string>
+    <string name = "set_remark_name"> set the note name </string>
+    <string name = "remove_blacklist_succ"> remove the blacklist succeed </string>
+    <string name = "cancel_attention_prompt"> Are you sure you want to cancel your attention? </string>
+    <string name = "delete_all_prompt"> completely delete the operation, if the other side is also concerned about you, then it will cancel the other side of your concern, sure to completely delete it? </string>
+    <string name = "cancel_attention_succ"> cancel attention successfully </string>
+    <string name = "prompt_title"> prompt </string>
+    <string name = "delete_all_succ"> delete success </string>
+    <string name = "remove_blacklist_prompt"> Are you sure you want to remove the blacklist? </string>
+    <string name = "add_blacklist_prompt"> Are you sure you want to add a blacklist? </string>
+    <string name = "add_blacklist_succ"> add blacklist success </string>
 </resources>