|
|
@@ -25,6 +25,7 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONException;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.common.LogUtil;
|
|
|
+import com.common.data.JSONUtil;
|
|
|
import com.common.data.ListUtils;
|
|
|
import com.common.data.StringUtil;
|
|
|
import com.common.system.ActivityUtils;
|
|
|
@@ -79,6 +80,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
private final static int COMMON_DOC_AF_REQUEST = 1125;
|
|
|
private final static int COMMON_DOC_MSG_REQUEST = 1126;
|
|
|
private static final int DELETE_DOC_REQUEST = 1127;
|
|
|
+ private final int SURE_DEVICE = 11251;
|
|
|
private EmptyLayout mEmptyLayput_approvalflow;
|
|
|
private CommonApprovalFlowBean mCommonApprovalFlowBean;
|
|
|
private CommonDocAMBean mCommonDocAMBean;
|
|
|
@@ -107,6 +109,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
private LinearLayout change_deal_man_ll;
|
|
|
private LinearLayout disagree_ll;
|
|
|
private LinearLayout resanddel_ll;
|
|
|
+ private TextView sureTv;
|
|
|
private LinearLayout resubmit_ll;
|
|
|
private LinearLayout delete_ll;
|
|
|
private CustomerScrollView commondoc_sv;
|
|
|
@@ -116,7 +119,8 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
private GridViewAdapter mAdapter;
|
|
|
private String last_status;
|
|
|
private String update;
|
|
|
- private Boolean platform; private String em_number;
|
|
|
+ private Boolean platform;
|
|
|
+ private String em_number;
|
|
|
private String type_emcode;
|
|
|
private String real_status;
|
|
|
private String emCode;
|
|
|
@@ -134,11 +138,13 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
commondoc_sv.smoothScrollTo(0, 0);
|
|
|
super.onResume();
|
|
|
}
|
|
|
+
|
|
|
private boolean device;
|
|
|
+
|
|
|
public void initView() {
|
|
|
Intent intent = getIntent();
|
|
|
- if (intent!=null){
|
|
|
- device=intent.getBooleanExtra("device",false);
|
|
|
+ if (intent != null) {
|
|
|
+ device = intent.getBooleanExtra("device", false);
|
|
|
}
|
|
|
|
|
|
platform = ApiUtils.getApiModel() instanceof ApiPlatform;
|
|
|
@@ -192,15 +198,16 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
second_msg_lv = (MyListView) findViewById(R.id.common_docui_second_msg_lv);
|
|
|
secondmsg_ll = (LinearLayout) findViewById(R.id.common_docui_secondmsg_ll);
|
|
|
approval_ll = (LinearLayout) findViewById(R.id.common_docui_agree_and_change_ll);
|
|
|
- agree_ll = (LinearLayout) findViewById(R.id.common_docui_agree_ll);
|
|
|
+ agree_ll = (LinearLayout) findViewById(R.id.common_docui_agree_ll);
|
|
|
change_deal_man_ll = (LinearLayout) findViewById(R.id.common_docui_change_dealman_ll);
|
|
|
disagree_ll = (LinearLayout) findViewById(R.id.common_docui_disagree_ll);
|
|
|
resanddel_ll = (LinearLayout) findViewById(R.id.item_common_docui_res_and_del_ll);
|
|
|
+ sureTv = (TextView) findViewById(R.id.sureTv);
|
|
|
resubmit_ll = (LinearLayout) findViewById(R.id.common_docui_resubmit_ll);
|
|
|
delete_ll = (LinearLayout) findViewById(R.id.common_docui_delete_ll);
|
|
|
commondoc_sv = (CustomerScrollView) findViewById(R.id.common_docui_sv);
|
|
|
hide_above_af = findViewById(R.id.hide_above_af);
|
|
|
- ex_invoice_ll = (LinearLayout) findViewById(R.id.ex_invoice_ll);
|
|
|
+ ex_invoice_ll = (LinearLayout) findViewById(R.id.ex_invoice_ll);
|
|
|
grid_view = (MyGridView) findViewById(R.id.grid_view);
|
|
|
|
|
|
}
|
|
|
@@ -209,11 +216,26 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
final Intent intent = getIntent();
|
|
|
mCaller = intent.getStringExtra("caller");
|
|
|
mkeyValue = intent.getIntExtra("keyValue", -1);
|
|
|
+
|
|
|
real_status = intent.getStringExtra("status");
|
|
|
- update= intent.getStringExtra("update");
|
|
|
- Log.i("mCaller", mCaller+"");
|
|
|
+ update = intent.getStringExtra("update");
|
|
|
+ Log.i("mCaller", mCaller + "");
|
|
|
Log.isLoggable("keyValue", mkeyValue);
|
|
|
- Log.i("real_status", real_status+"");
|
|
|
+ Log.i("real_status", real_status + "");
|
|
|
+
|
|
|
+ if (mkeyValue == -1) {
|
|
|
+ LogUtil.i("mkeyValue==-1");
|
|
|
+ String keyValue = intent.getStringExtra("keyValue");
|
|
|
+ LogUtil.i("keyValue=" + keyValue);
|
|
|
+ if (!StringUtil.isEmpty(keyValue)) {
|
|
|
+ try {
|
|
|
+ mkeyValue = Integer.valueOf(keyValue);
|
|
|
+ LogUtil.i("mkeyValue=" + mkeyValue);
|
|
|
+ } catch (Exception e) {
|
|
|
+ LogUtil.i("e=" + e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
//当获取到正确的单据caller和单据id时
|
|
|
if (!TextUtils.isEmpty(mCaller) && mkeyValue != -1) {
|
|
|
@@ -221,24 +243,25 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
getSupportActionBar().setTitle(getString(R.string.oavacation_apply) + getString(R.string.doc_detail));
|
|
|
}
|
|
|
if ("FeePlease!CCSQ!new".equals(mCaller)) {
|
|
|
- getSupportActionBar().setTitle(getString(R.string.oatravel_apply)+ getString(R.string.doc_detail));
|
|
|
+ getSupportActionBar().setTitle(getString(R.string.oatravel_apply) + getString(R.string.doc_detail));
|
|
|
}
|
|
|
if ("Workovertime".equals(mCaller) || "ExtraWork$".equals(mCaller)) {
|
|
|
- getSupportActionBar().setTitle(getString(R.string.oaovertime_apply)+ getString(R.string.doc_detail));
|
|
|
+ getSupportActionBar().setTitle(getString(R.string.oaovertime_apply) + getString(R.string.doc_detail));
|
|
|
}
|
|
|
if ("SpeAttendance".equals(mCaller)) {
|
|
|
- getSupportActionBar().setTitle(getString(R.string.oaspecial_attendance_apply)+ getString(R.string.doc_detail));
|
|
|
- }if ("MaterielApply".equals(mCaller)) {
|
|
|
- getSupportActionBar().setTitle(getString(R.string.oamaterials_apply)+ getString(R.string.doc_detail));
|
|
|
+ getSupportActionBar().setTitle(getString(R.string.oaspecial_attendance_apply) + getString(R.string.doc_detail));
|
|
|
+ }
|
|
|
+ if ("MaterielApply".equals(mCaller)) {
|
|
|
+ getSupportActionBar().setTitle(getString(R.string.oamaterials_apply) + getString(R.string.doc_detail));
|
|
|
} else if ("MainTain".equals(mCaller)) {
|
|
|
- getSupportActionBar().setTitle(getString(R.string.oaservice_apply)+ getString(R.string.doc_detail));
|
|
|
- }if ("StandbyApplication".equals(mCaller)) {
|
|
|
- getSupportActionBar().setTitle(getString(R.string.oaStandby_machine_apply)+ getString(R.string.doc_detail));
|
|
|
- } else
|
|
|
- if (!StringUtil.isEmpty(intent.getStringExtra("title"))) {
|
|
|
- getSupportActionBar().setTitle(intent.getStringExtra("title")+ getString(R.string.doc_detail));
|
|
|
+ getSupportActionBar().setTitle(getString(R.string.oaservice_apply) + getString(R.string.doc_detail));
|
|
|
}
|
|
|
- if ("FeePlease!FYBX".equals(mCaller)){
|
|
|
+ if ("StandbyApplication".equals(mCaller)) {
|
|
|
+ getSupportActionBar().setTitle(getString(R.string.oaStandby_machine_apply) + getString(R.string.doc_detail));
|
|
|
+ } else if (!StringUtil.isEmpty(intent.getStringExtra("title"))) {
|
|
|
+ getSupportActionBar().setTitle(intent.getStringExtra("title") + getString(R.string.doc_detail));
|
|
|
+ }
|
|
|
+ if ("FeePlease!FYBX".equals(mCaller)) {
|
|
|
getSupportActionBar().setTitle(getString(R.string.Expense_reimbursement) + getString(R.string.doc_detail));
|
|
|
}
|
|
|
//请求获取单据提交内容数据
|
|
|
@@ -275,7 +298,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
|
|
|
@Override
|
|
|
public boolean onCreateOptionsMenu(Menu menu) {
|
|
|
- if (!"FeePlease!FYBX".equals(mCaller)&&!device){
|
|
|
+ if (!"FeePlease!FYBX".equals(mCaller) && !device) {
|
|
|
getMenuInflater().inflate(R.menu.menu_add_icon, menu);
|
|
|
}
|
|
|
return super.onCreateOptionsMenu(menu);
|
|
|
@@ -285,7 +308,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
public boolean onOptionsItemSelected(MenuItem item) {
|
|
|
if (item.getItemId() == R.id.add_item) {
|
|
|
startActivity(new Intent(activity, DataFormDetailActivity.class)
|
|
|
- .putExtra("caller",mCaller));
|
|
|
+ .putExtra("caller", mCaller));
|
|
|
finish();
|
|
|
}
|
|
|
if (item.getItemId() == android.R.id.home) {
|
|
|
@@ -309,6 +332,13 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
@Override
|
|
|
public void handleMessage(Message msg) {
|
|
|
switch (msg.what) {
|
|
|
+ case SURE_DEVICE:
|
|
|
+ String deviceResult = msg.getData().getString("result");
|
|
|
+ boolean success = JSONUtil.getBoolean(deviceResult, "success");
|
|
|
+ if (success) {
|
|
|
+ //TODO 确定成功
|
|
|
+ }
|
|
|
+ break;
|
|
|
case COMMON_DOC_MSG_REQUEST:
|
|
|
String msg_result = msg.getData().getString("result");
|
|
|
AMshow(msg_result); //单据申请信息展示
|
|
|
@@ -324,17 +354,17 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
Toast.makeText(getApplicationContext(), getString(R.string.common_delete), Toast.LENGTH_LONG).show();
|
|
|
progressDialog.dismiss();
|
|
|
FormListSelectActivity.isdelete = true;
|
|
|
- FormListSelectActivity.reload=false;
|
|
|
+ FormListSelectActivity.reload = false;
|
|
|
finish();
|
|
|
break;
|
|
|
- case NEW_DELETE_DOC_REQUEST:
|
|
|
- if (msg.getData() != null){
|
|
|
+ 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;
|
|
|
+ FormListSelectActivity.reload = false;
|
|
|
finish();
|
|
|
}
|
|
|
break;
|
|
|
@@ -348,7 +378,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
.putExtra("caller", mCaller)
|
|
|
.putExtra("id", mkeyValue)
|
|
|
.putExtra("submittype", "resubmit")
|
|
|
- .putExtra("status","已提交"));
|
|
|
+ .putExtra("status", "已提交"));
|
|
|
|
|
|
finish();
|
|
|
}
|
|
|
@@ -364,17 +394,17 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
}
|
|
|
break;
|
|
|
case NEW_DOC_RESUB_SUCCESSFUL:
|
|
|
- if (msg.getData() != null){
|
|
|
+ if (msg.getData() != null) {
|
|
|
String new_doc_resub_result = msg.getData().getString("result");
|
|
|
LogUtil.prinlnLongMsg("new_doc_resub_result", new_doc_resub_result + "");
|
|
|
if (StringUtil.isEmpty(new_doc_resub_result)) return;
|
|
|
if (JSON.parseObject(new_doc_resub_result).containsKey("success")
|
|
|
- && JSON.parseObject(new_doc_resub_result).getBoolean("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","已提交"));
|
|
|
+ .putExtra("status", "已提交"));
|
|
|
|
|
|
finish();
|
|
|
}
|
|
|
@@ -383,7 +413,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
break;
|
|
|
|
|
|
case New_DOC_REDELETE_SUCCESSFUL:
|
|
|
- if (msg.getData() != null){
|
|
|
+ if (msg.getData() != null) {
|
|
|
String new_doc_redelete_result = msg.getData().getString("result");
|
|
|
LogUtil.prinlnLongMsg("new_doc_redelete_result", new_doc_redelete_result);
|
|
|
if (StringUtil.isEmpty(new_doc_redelete_result)) return;
|
|
|
@@ -397,14 +427,14 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
case 0x01:
|
|
|
if (msg.getData() != null) {
|
|
|
String result = msg.getData().getString("result");
|
|
|
- LogUtil.prinlnLongMsg("0x01result",result);
|
|
|
- if (!StringUtil.isEmpty(result) && result.contains("success")&&
|
|
|
- JSON.parseObject(result).getBoolean("success")){
|
|
|
+ LogUtil.prinlnLongMsg("0x01result", result);
|
|
|
+ if (!StringUtil.isEmpty(result) && result.contains("success") &&
|
|
|
+ JSON.parseObject(result).getBoolean("success")) {
|
|
|
startActivity(new Intent(CommonDocDetailsActivity.this, ExpenseReimbursementActivity.class)
|
|
|
.putExtra("caller", mCaller)
|
|
|
.putExtra("id", mkeyValue)
|
|
|
.putExtra("submittype", "resubmit")
|
|
|
- .putExtra("status","已提交"));
|
|
|
+ .putExtra("status", "已提交"));
|
|
|
finish();
|
|
|
}
|
|
|
}
|
|
|
@@ -412,7 +442,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
case 0x02:
|
|
|
if (msg.getData() != null) {
|
|
|
String result = msg.getData().getString("result");
|
|
|
- LogUtil.prinlnLongMsg("0x02result",result);
|
|
|
+ LogUtil.prinlnLongMsg("0x02result", result);
|
|
|
DeleteComDocRequest(mCaller, mkeyValue);
|
|
|
}
|
|
|
break;
|
|
|
@@ -442,10 +472,10 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
String url = "";
|
|
|
- if ("ExtraWork$".equals(mCaller)){
|
|
|
+ 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 {
|
|
|
+ } else {
|
|
|
url = CommonUtil.getSharedPreferences(ct, "erp_baseurl") + "/mobile/commondelete.action";
|
|
|
ViewUtil.httpSendRequest(this, url, params, mHandler, headers, DELETE_DOC_REQUEST, null, null, "get");
|
|
|
}
|
|
|
@@ -505,7 +535,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
(!TextUtils.isEmpty(fd_field) && fd_field.equals("FP_PEOPLE2"))) {
|
|
|
if (!fd_field.equals("null")) {
|
|
|
em_number = formdataArray.getJSONObject(0).getString(fd_field);
|
|
|
- Log.i("em_number", em_number+"");
|
|
|
+ Log.i("em_number", em_number + "");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -546,7 +576,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
}
|
|
|
} catch (JSONException e) {
|
|
|
e.printStackTrace();
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
@@ -562,6 +592,19 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private void sureDevice() {
|
|
|
+ progressDialog.show();
|
|
|
+ //请求获取单据审批流数据
|
|
|
+ String url = CommonUtil.getAppBaseUrl(getApplicationContext()) + "mobile/device/confirmDeal.action";
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("caller", mCaller);
|
|
|
+ param.put("id", mkeyValue);
|
|
|
+ LinkedHashMap headers = new LinkedHashMap();
|
|
|
+ headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(getApplicationContext(), "sessionId"));
|
|
|
+ ViewUtil.httpSendRequest(getApplicationContext(), url, param, mHandler, headers, SURE_DEVICE, null, null, "post");
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 申请单据的审批,提交,录入状态
|
|
|
*/
|
|
|
@@ -574,11 +617,11 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
resanddel_ll.setVisibility(View.GONE);
|
|
|
} else if (real_status.equals("已提交")) {
|
|
|
|
|
|
- if (!TextUtils.isEmpty(last_status) && last_status.equals("已审核")){
|
|
|
+ if (!TextUtils.isEmpty(last_status) && last_status.equals("已审核")) {
|
|
|
status_tv.setTextColor(getApplicationContext().getResources().getColor(R.color.approval));
|
|
|
status_tv.setText(getString(R.string.status_approved));
|
|
|
resanddel_ll.setVisibility(View.GONE);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
status_tv.setTextColor(getApplicationContext().getResources().getColor(R.color.no_approval));
|
|
|
status_tv.setText(getString(R.string.status_pending));
|
|
|
resanddel_ll.setVisibility(View.VISIBLE);
|
|
|
@@ -590,8 +633,19 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
resanddel_ll.setVisibility(View.VISIBLE);
|
|
|
}
|
|
|
}
|
|
|
- if (device){
|
|
|
+ if (device) {
|
|
|
+ LogUtil.i("real_status=" + real_status);
|
|
|
resanddel_ll.setVisibility(View.GONE);
|
|
|
+ if (real_status.equals("已审核")) {
|
|
|
+ sureTv.setVisibility(View.VISIBLE);
|
|
|
+ sureTv.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ sureDevice();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -606,7 +660,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
|
|
|
public void AFshow(String af_result) {
|
|
|
try {
|
|
|
- JSONObject resultJsonObject =JSON.parseObject(af_result);
|
|
|
+ JSONObject resultJsonObject = JSON.parseObject(af_result);
|
|
|
//JSONArray dailynodeArray = resultJsonObject.getJSONArray("nodes");
|
|
|
if (resultJsonObject == null) {
|
|
|
appflow_lv.setVisibility(View.GONE);
|
|
|
@@ -691,7 +745,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
im_ids.add("");
|
|
|
}
|
|
|
|
|
|
@@ -710,7 +764,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
//取process之后的审批人名字
|
|
|
if (!TextUtils.isEmpty(mCommonApprovalFlowBean.getData().get(j).getJP_NODEDEALMANNAME())) {
|
|
|
afpeople_names.add(mCommonApprovalFlowBean.getData().get(j).getJP_NODEDEALMANNAME());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
afpeople_names.add("");
|
|
|
}
|
|
|
//取process之后的imid
|
|
|
@@ -737,7 +791,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
im_ids.add("");
|
|
|
}
|
|
|
}
|
|
|
@@ -801,13 +855,14 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
}
|
|
|
} catch (JSONException e) {
|
|
|
e.printStackTrace();
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
handlerNode(af_result);
|
|
|
getemcodefromAF();
|
|
|
}
|
|
|
+
|
|
|
private void handlerNode(String message) {
|
|
|
List<Approval> approvals = ApprovaNodeUtil.handlerNode(manager, message);
|
|
|
if (!ListUtils.isEmpty(approvals)) {
|
|
|
@@ -818,6 +873,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
}
|
|
|
progressDialog.dismiss();
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 申请单据申请人emcode,从审批流数据获取
|
|
|
*/
|
|
|
@@ -850,7 +906,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
} else {
|
|
|
name_tv.setText(MyApplication.getInstance().mLoginUser.getNickName());
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
String em_name = CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_emname");
|
|
|
name_tv.setText(em_name);
|
|
|
String loginUserId = MyApplication.getInstance().mLoginUser.getUserId();
|
|
|
@@ -898,14 +954,14 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
String url = "";
|
|
|
- if ("ExtraWork$".equals(mCaller)){ // 新的加班单反提交
|
|
|
+ if ("ExtraWork$".equals(mCaller)) { // 新的加班单反提交
|
|
|
url = CommonUtil.getAppBaseUrl(ct) + "/hr/attendance/resSubmitExtraWork.action";
|
|
|
ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, NEW_DOC_RESUB_SUCCESSFUL, null, null, "post");
|
|
|
|
|
|
- }else if("FeePlease!FYBX".equals(mCaller)){ // 报销单
|
|
|
+ } else if ("FeePlease!FYBX".equals(mCaller)) { // 报销单
|
|
|
url = CommonUtil.getAppBaseUrl(ct) + "oa/fee/resSubmitFeePlease.action";
|
|
|
ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, 0x01, null, null, "post");
|
|
|
- }else { // 通用老的反提交
|
|
|
+ } else { // 通用老的反提交
|
|
|
url = CommonUtil.getAppBaseUrl(ct) + "/mobile/commonres.action";
|
|
|
ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, COM_DOC_RESUB_SUCCESSFUL, null, null, "post");
|
|
|
}
|
|
|
@@ -944,8 +1000,8 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
.setNegativeButton(getString(R.string.common_cancel), null)
|
|
|
.setPositiveButton(getString(R.string.common_sure), new DialogInterface.OnClickListener() {
|
|
|
@Override
|
|
|
- public void onClick(DialogInterface dialog, int which) { //反提交
|
|
|
- progressDialog.show();
|
|
|
+ public void onClick(DialogInterface dialog, int which) { //反提交
|
|
|
+ progressDialog.show();
|
|
|
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
params.put("caller", mCaller);
|
|
|
@@ -953,18 +1009,18 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
String url = "";
|
|
|
- if ("ExtraWork$".equals(mCaller)){ // 新的加班单反提交
|
|
|
+ if ("ExtraWork$".equals(mCaller)) { // 新的加班单反提交
|
|
|
url = CommonUtil.getAppBaseUrl(ct) + "/hr/attendance/resSubmitExtraWork.action";
|
|
|
ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, New_DOC_REDELETE_SUCCESSFUL, null, null, "post");
|
|
|
- }else if ("FeePlease!FYBX".equals(mCaller)){
|
|
|
+ } else if ("FeePlease!FYBX".equals(mCaller)) {
|
|
|
url = CommonUtil.getAppBaseUrl(ct) + "oa/fee/resSubmitFeePlease.action";
|
|
|
ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, 0x02, null, null, "post");
|
|
|
- }else { // 通用老的反提交s
|
|
|
+ } else { // 通用老的反提交s
|
|
|
url = CommonUtil.getAppBaseUrl(ct) + "/mobile/commonres.action";
|
|
|
ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, COM_DOC_REDELETE_SUCCESSFUL, null, null, "post");
|
|
|
}
|
|
|
- }
|
|
|
- }).show();
|
|
|
+ }
|
|
|
+ }).show();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -1017,24 +1073,24 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
@Override
|
|
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
|
|
if ((keyCode == KeyEvent.KEYCODE_BACK)) {
|
|
|
- if (device){
|
|
|
+ if (device) {
|
|
|
endDevice();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
if (ActivityUtils.isExsitMianActivity(mContext, FormListSelectActivity.class)) {
|
|
|
LogUtil.d("正常返回...");
|
|
|
- if ("1".equals(update)){
|
|
|
+ if ("1".equals(update)) {
|
|
|
startActivity(new Intent(mContext, FormListSelectActivity.class).putExtra("caller", mCaller)
|
|
|
.putExtra("update", update));
|
|
|
finish();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
onBackPressed();
|
|
|
}
|
|
|
} else {
|
|
|
- LogUtil.d("非正常返回..."+update);
|
|
|
- if ("1".equals(update)){
|
|
|
- FormListSelectActivity.reload=true;
|
|
|
- }else{
|
|
|
- FormListSelectActivity.reload=false;
|
|
|
+ LogUtil.d("非正常返回..." + update);
|
|
|
+ if ("1".equals(update)) {
|
|
|
+ FormListSelectActivity.reload = true;
|
|
|
+ } else {
|
|
|
+ FormListSelectActivity.reload = false;
|
|
|
}
|
|
|
startActivity(
|
|
|
new Intent(mContext, FormListSelectActivity.class)
|
|
|
@@ -1048,20 +1104,26 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- private void endDevice(){
|
|
|
+
|
|
|
+ private void endDevice() {
|
|
|
String dc_class = null;
|
|
|
if (mCaller.equals("DeviceChange!Use")) {
|
|
|
dc_class = "使用转移";
|
|
|
} else if (mCaller.equals("DeviceChange!Scrap")) {
|
|
|
- dc_class = "报废";
|
|
|
+ dc_class = "报废申请";
|
|
|
} else if (mCaller.equals("DeviceChange!Maintain")) {
|
|
|
dc_class = "保养维护";
|
|
|
} else if (mCaller.equals("DeviceChange!Inspect")) {
|
|
|
dc_class = "故障送检";
|
|
|
}
|
|
|
- startActivity(new Intent(ct, DeviceQueryActivity.class).putExtra(Constants.FLAG.DEVICE_CALLER, mCaller)
|
|
|
- .putExtra(Constants.FLAG.DEVICE_CLASS, dc_class));
|
|
|
- finish();
|
|
|
+ if (ActivityUtils.isExsitMianActivity(mContext, DeviceQueryActivity.class)) {
|
|
|
+ onBackPressed();
|
|
|
+ } else {
|
|
|
+ startActivity(new Intent(ct, DeviceQueryActivity.class).putExtra(Constants.FLAG.DEVICE_CALLER, mCaller)
|
|
|
+ .putExtra(Constants.FLAG.DEVICE_CLASS, dc_class)
|
|
|
+ );
|
|
|
+ finish();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1079,19 +1141,25 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public int getCount() { return getFb_attachs() == null ? 0 : getFb_attachs().length;}
|
|
|
+ public int getCount() {
|
|
|
+ return getFb_attachs() == null ? 0 : getFb_attachs().length;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Object getItem(int position) {
|
|
|
return position;
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public long getItemId(int position) {
|
|
|
return position;
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public int getViewTypeCount() {
|
|
|
return 1;
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public int getItemViewType(int position) {
|
|
|
return position;
|
|
|
@@ -1099,27 +1167,30 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
|
|
|
@Override
|
|
|
public View getView(final int position, View convertView, ViewGroup parent) {
|
|
|
- SquareCenterImageView imageView = new SquareCenterImageView(ct);
|
|
|
- imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
|
|
- int id = CommonUtil.getNumByString(getFb_attachs()[position]);
|
|
|
- ImageLoader.getInstance().displayImage(getImageUrl(id), imageView);
|
|
|
- return imageView;
|
|
|
+ SquareCenterImageView imageView = new SquareCenterImageView(ct);
|
|
|
+ imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
|
|
+ int id = CommonUtil.getNumByString(getFb_attachs()[position]);
|
|
|
+ ImageLoader.getInstance().displayImage(getImageUrl(id), imageView);
|
|
|
+ return imageView;
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private String fb_attachs[] = {};
|
|
|
+
|
|
|
/**
|
|
|
* 获取报销单的发票并显示
|
|
|
+ *
|
|
|
* @param formdataArray
|
|
|
*/
|
|
|
private void showExP(JSONArray formdataArray) {
|
|
|
if (formdataArray != null && "FeePlease!FYBX".equals(mCaller)) {
|
|
|
try {
|
|
|
String fb_attach = formdataArray.getJSONObject(0).getString("fb_attach");
|
|
|
- Log.i("fb_attachshow",fb_attach+"show");
|
|
|
- if (fb_attach==null||"null".equals(fb_attach)||fb_attach.length()<=0) {
|
|
|
+ Log.i("fb_attachshow", fb_attach + "show");
|
|
|
+ if (fb_attach == null || "null".equals(fb_attach) || fb_attach.length() <= 0) {
|
|
|
ex_invoice_ll.setVisibility(View.GONE);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
fb_attachs = fb_attach.split(";");
|
|
|
mAdapter.setFb_attachs(fb_attachs);
|
|
|
grid_view.deferNotifyDataSetChanged();
|
|
|
@@ -1128,7 +1199,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
} catch (JSONException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1140,10 +1211,11 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
intent.putExtra(AppConstant.EXTRA_IMAGE_URI,
|
|
|
getImageUrl(CommonUtil.getNumByString(fb_attachs[position])));
|
|
|
startActivity(intent);
|
|
|
- Log.i("P_position",mPosition+"");
|
|
|
+ Log.i("P_position", mPosition + "");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
private String getImageUrl(int id) {
|
|
|
return CommonUtil.getAppBaseUrl(ct) + "common/downloadbyId.action?id=" + id + "&sessionId=" +
|
|
|
CommonUtil.getSharedPreferences(ct, "sessionId") +
|