|
|
@@ -1,5 +1,6 @@
|
|
|
package com.xzjmyk.pm.activity.ui.erp.activity.oa;
|
|
|
|
|
|
+import android.Manifest;
|
|
|
import android.annotation.TargetApi;
|
|
|
import android.app.Activity;
|
|
|
import android.app.AlertDialog;
|
|
|
@@ -34,6 +35,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONException;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.alibaba.fastjson.serializer.PropertyFilter;
|
|
|
import com.andreabaccega.widget.FormEditText;
|
|
|
import com.lidroid.xutils.HttpUtils;
|
|
|
import com.lidroid.xutils.ViewUtils;
|
|
|
@@ -71,6 +73,7 @@ import com.xzjmyk.pm.activity.ui.erp.view.NScrollerGridView;
|
|
|
import com.xzjmyk.pm.activity.ui.tool.MultiImagePreviewActivity;
|
|
|
import com.xzjmyk.pm.activity.util.CameraUtil;
|
|
|
import com.xzjmyk.pm.activity.util.DisplayUtil;
|
|
|
+import com.xzjmyk.pm.activity.util.PermissionUtil;
|
|
|
import com.xzjmyk.pm.activity.util.StringUtils;
|
|
|
import com.xzjmyk.pm.activity.util.ToastUtil;
|
|
|
import com.xzjmyk.pm.activity.view.MyGridView;
|
|
|
@@ -390,7 +393,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
* @param id
|
|
|
*/
|
|
|
private void getUpdateData(int id) {
|
|
|
-// progressDialog.show();
|
|
|
+ progressDialog.show();
|
|
|
if (!CommonUtil.isNetWorkConnected(mContext)) {
|
|
|
ToastMessage(getString(R.string.networks_out));
|
|
|
}
|
|
|
@@ -528,6 +531,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
dtAdapter.notifyDataSetChanged();
|
|
|
detail_table_ll.setVisibility(View.VISIBLE);
|
|
|
doAutoCalculateJudge();
|
|
|
+ progressDialog.dismiss();
|
|
|
LogUtil.prinlnLongMsg("costFormModel_list",JSON.toJSONString(costFormModel_list));
|
|
|
}
|
|
|
}
|
|
|
@@ -873,15 +877,16 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
private void doUpdateCommit() {
|
|
|
progressDialog.show();
|
|
|
btn_save.setEnabled(false);
|
|
|
- String url= Constants.getAppBaseUrl(ct) + "mobile/oa/UpdateSubmitFYBX.action";
|
|
|
+ final String url= Constants.getAppBaseUrl(ct) + "mobile/oa/UpdateSubmitFYBX.action";
|
|
|
+// final String url= "https://192.168.253.252:8080/ERP/mobile/oa/UpdateSubmitFYBX.action";
|
|
|
Map<String, Object> formStoreMap = new HashMap<>();
|
|
|
formStoreMap.put("fp_v3", reimbursement_title_fet.getText().toString());
|
|
|
formStoreMap.put("fp_class", reimbursement_type_fet.getText().toString());
|
|
|
formStoreMap.put("fp_v13", reimbursement_currency_fet.getText().toString());
|
|
|
formStoreMap.put("fp_id",formid);
|
|
|
- String formStore = JSON.toJSONString(formStoreMap);
|
|
|
+ final String formStore = JSON.toJSONString(formStoreMap);
|
|
|
|
|
|
- List<UpdateCostDetailsGridStoreBean> gridStore_list = new ArrayList<>();
|
|
|
+ final List<UpdateCostDetailsGridStoreBean> gridStore_list = new ArrayList<>();
|
|
|
UpdateCostDetailsGridStoreBean gridStore_bean;
|
|
|
for (int i = 0; i < costFormModel_list.size(); i++) {
|
|
|
gridStore_bean = new UpdateCostDetailsGridStoreBean();
|
|
|
@@ -892,12 +897,11 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
|
|
|
if (i == (costFormModel_list.size()-1)){
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
-// params.put("fp_id",formid);
|
|
|
params.put("caller", caller);
|
|
|
params.put("formStore", formStore);
|
|
|
- params.put("param1",JSON.toJSONString(gridStore_list));
|
|
|
+ params.put("param1",JSON.toJSONString(gridStore_list,myprofilter)); // 过滤器过滤新增 "fpd_id": 0,那一行
|
|
|
params.put("param2","");
|
|
|
- LogUtil.prinlnLongMsg("gridStore_list",JSON.toJSONString(gridStore_list));
|
|
|
+ LogUtil.prinlnLongMsg("gridStore_list",JSON.toJSONString(gridStore_list,myprofilter));
|
|
|
LinkedHashMap<String, Object> headers1 = new LinkedHashMap<>();
|
|
|
headers1.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
ViewUtil.httpSendRequest(ct, url, params, erhandler, headers1, 0x08, null, null, "post");
|
|
|
@@ -905,6 +909,15 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ PropertyFilter myprofilter = new PropertyFilter() {
|
|
|
+ @Override
|
|
|
+ public boolean apply(Object object, String name, Object value) {
|
|
|
+ if (name.equalsIgnoreCase("fpd_id") && value.equals(0)){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ };
|
|
|
private void doFirstCommit() {
|
|
|
progressDialog.show();
|
|
|
btn_save.setEnabled(false);
|
|
|
@@ -1244,7 +1257,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
Map<String,Object> params = new HashMap<>();
|
|
|
params.put("caller",caller);
|
|
|
params.put("gridcaller",caller);
|
|
|
- params.put("condition","fpd_id = '"+ costFormModel_list.get(position).getFpd_id() +"'");
|
|
|
+ params.put("condition","fpd_id="+ costFormModel_list.get(position).getFpd_id() );
|
|
|
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
if (platform){
|
|
|
headers.put("Cookie", "JSESSIONID=" + ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().getCookie());
|
|
|
@@ -1623,4 +1636,16 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
}
|
|
|
return -1;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void onResume() {
|
|
|
+ super.onResume();
|
|
|
+ String[] permissions = new String[]{Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE};
|
|
|
+ for (String permission : permissions) {
|
|
|
+ if (PermissionUtil.lacksPermissions(ct, permission)) {
|
|
|
+ PermissionUtil.requestPermission(this, PermissionUtil.DEFAULT_REQUEST, permission);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|