|
|
@@ -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)
|
|
|
@@ -194,25 +197,25 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
//当获取到正确的单据caller和单据id时
|
|
|
if (!TextUtils.isEmpty(mCaller) && mkeyValue != -1) {
|
|
|
if ("Ask4Leave".equals(mCaller)) {
|
|
|
- getSupportActionBar().setTitle(getString(R.string.oavacation_apply) + getString(R.string.doc_detail));
|
|
|
+ getSupportActionBar().setTitle(getString(R.string.oavacation_apply) + "详情");
|
|
|
}
|
|
|
if ("FeePlease!CCSQ".equals(mCaller)) {
|
|
|
- getSupportActionBar().setTitle(getString(R.string.oatravel_apply)+ getString(R.string.doc_detail));
|
|
|
+ getSupportActionBar().setTitle(getString(R.string.oatravel_apply)+ "详情");
|
|
|
}
|
|
|
- if ("Workovertime".equals(mCaller)) {
|
|
|
- getSupportActionBar().setTitle(getString(R.string.oaovertime_apply)+ getString(R.string.doc_detail));
|
|
|
+ if ("Workovertime".equals(mCaller) || "ExtraWork$".equals(mCaller)) {
|
|
|
+ getSupportActionBar().setTitle(getString(R.string.oaovertime_apply)+ "详情");
|
|
|
}
|
|
|
if ("SpeAttendance".equals(mCaller)) {
|
|
|
- getSupportActionBar().setTitle(getString(R.string.oaspecial_attendance_apply)+ getString(R.string.doc_detail));
|
|
|
+ getSupportActionBar().setTitle(getString(R.string.oaspecial_attendance_apply)+ "详情");
|
|
|
}if ("MaterielApply".equals(mCaller)) {
|
|
|
- getSupportActionBar().setTitle(getString(R.string.oamaterials_apply)+ getString(R.string.doc_detail));
|
|
|
+ getSupportActionBar().setTitle(getString(R.string.oamaterials_apply)+ "详情");
|
|
|
} else if ("MainTain".equals(mCaller)) {
|
|
|
- getSupportActionBar().setTitle(getString(R.string.oaservice_apply)+ getString(R.string.doc_detail));
|
|
|
+ getSupportActionBar().setTitle(getString(R.string.oaservice_apply)+ "详情");
|
|
|
}if ("StandbyApplication".equals(mCaller)) {
|
|
|
- getSupportActionBar().setTitle(getString(R.string.oaStandby_machine_apply)+ getString(R.string.doc_detail));
|
|
|
+ getSupportActionBar().setTitle(getString(R.string.oaStandby_machine_apply)+ "详情");
|
|
|
} else
|
|
|
if (!StringUtils.isEmpty(intent.getStringExtra("title"))) {
|
|
|
- getSupportActionBar().setTitle(intent.getStringExtra("title")+ getString(R.string.doc_detail));
|
|
|
+ getSupportActionBar().setTitle(intent.getStringExtra("title")+ "详情");
|
|
|
}
|
|
|
//请求获取单据提交内容数据
|
|
|
progressDialog.show();
|
|
|
@@ -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,36 @@ 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 + "");
|
|
|
+ if (StringUtils.isEmpty(new_doc_resub_result)) return;
|
|
|
+ if (JSON.parseObject(new_doc_resub_result).containsKey("success")
|
|
|
+ && JSON.parseObject(new_doc_resub_result).getBoolean("success")){
|
|
|
+ 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);
|
|
|
+ if (StringUtils.isEmpty(new_doc_redelete_result)) return;
|
|
|
+ if (JSON.parseObject(new_doc_redelete_result).containsKey("success")
|
|
|
+ && JSON.parseObject(new_doc_redelete_result).getBoolean("success")) {
|
|
|
+ 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 +382,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 +828,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 +879,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();
|
|
|
}
|
|
|
}
|