|
|
@@ -157,7 +157,8 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
private List<AddCostBean> mAddCost_list; // popwindow要展示的消费明细类型
|
|
|
|
|
|
//点击新增需要展示的消费明数据细主表
|
|
|
- private List<CostTypeSingleBean> type_combdatas;
|
|
|
+ private List<CostTypeSingleBean> costtypesinglebeanList;
|
|
|
+ private CostTypeSingleBean mcosttypesinglebean;
|
|
|
private CostSingleBean money_combdatas;
|
|
|
private String deparmentname;
|
|
|
private int keyValue;
|
|
|
@@ -178,10 +179,38 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
break;
|
|
|
case 0x02:
|
|
|
if (!StringUtils.isEmpty(result)){
|
|
|
- type_combdatas = handleTypeSingleArray(result,type_combdatas);//报销类型列表数据
|
|
|
+ try {
|
|
|
+ JSONObject resultJsonObject = JSON.parseObject(result);
|
|
|
+ String dataString = resultJsonObject.getString("data").toString();
|
|
|
+ costtypesinglebeanList = JSON.parseArray(dataString,CostTypeSingleBean.class);
|
|
|
+ } catch (JSONException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
LogUtil.prinlnLongMsg("0x02result",result);
|
|
|
break;
|
|
|
+
|
|
|
+ case 0x15:
|
|
|
+ if (!StringUtils.isEmail(result)){
|
|
|
+ LogUtil.prinlnLongMsg("0x15result",result);
|
|
|
+ if (!ListUtils.isEmpty(costtypesinglebeanList)) costtypesinglebeanList.clear();
|
|
|
+ try {
|
|
|
+ JSONObject resultJsonObject = JSON.parseObject(result);
|
|
|
+ JSONArray array = resultJsonObject.getJSONArray("combdatas");
|
|
|
+ if (!ListUtils.isEmpty(array)){
|
|
|
+ for (int i = 0; i < array.size(); i++) {
|
|
|
+ mcosttypesinglebean = new CostTypeSingleBean();
|
|
|
+ mcosttypesinglebean.setFk_name(array.getJSONObject(i).getString("DISPLAY"));
|
|
|
+ mcosttypesinglebean.setFk_desc(array.getJSONObject(i).getString("VALUE"));
|
|
|
+ costtypesinglebeanList.add(mcosttypesinglebean);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ LogUtil.prinlnLongMsg("costtypesinglebeanList0x15",costtypesinglebeanList.toString());
|
|
|
+ } catch (JSONException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
case 0x03:
|
|
|
if (!StringUtils.isEmpty(result)){
|
|
|
money_combdatas = handleSingleArray(result,money_combdatas); //币种列表数据
|
|
|
@@ -194,7 +223,12 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
}
|
|
|
LogUtil.prinlnLongMsg("0x04result",result);
|
|
|
break;
|
|
|
+ case 0x16:
|
|
|
+ if (!StringUtils.isEmpty(result)){
|
|
|
|
|
|
+ }
|
|
|
+ LogUtil.prinlnLongMsg("0x16result",result);
|
|
|
+ break;
|
|
|
case 0x05:
|
|
|
if (!StringUtils.isEmpty(result)){
|
|
|
//{"fp_id": 38366,"success": true,"fpd_id": [[28859,1]]}
|
|
|
@@ -368,9 +402,8 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
setContentView(R.layout.activity_expense_reimbursement);
|
|
|
ViewUtils.inject(this);
|
|
|
initView();
|
|
|
- initTypeAndMoneyData(); //TODO 获取该表单相关字段,只做查阅作用,看完了关掉不请求
|
|
|
- getTypeAndMoneyData(); //获取报销类型、币种数据
|
|
|
- getCostDetailsData(); //获取新增要展示明细列表数据源
|
|
|
+ initTypeAndMoneyData(); // 获取该表单相关字段,
|
|
|
+
|
|
|
initPicturesEvent(); //添加发票事件
|
|
|
}
|
|
|
private void initView() {
|
|
|
@@ -402,7 +435,8 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
|
|
|
mGridconfigsBean = new ArrayList<>();
|
|
|
mFormconfigsBean = new ArrayList<>();
|
|
|
- type_combdatas = new ArrayList<>();
|
|
|
+ costtypesinglebeanList = new ArrayList<>();
|
|
|
+ mcosttypesinglebean = new CostTypeSingleBean();
|
|
|
money_combdatas = new CostSingleBean();
|
|
|
mCostBean = new CostBean();
|
|
|
|
|
|
@@ -479,12 +513,23 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
}
|
|
|
}, 1000);
|
|
|
}
|
|
|
+
|
|
|
+ /* private List<CostTypeSingleBean> cTypeSingleArray(String result, List<CostTypeSingleBean> type_combdatas) {
|
|
|
+ JSONArray resultArray = null;
|
|
|
+ try {
|
|
|
+ JSONObject resultJsonObject = JSON.parseObject(result);
|
|
|
+ String dataString = resultJsonObject.getString("combdatas").toString();
|
|
|
+ type_combdatas = JSON.parseArray(dataString,CostTypeSingleBean.class);
|
|
|
+ } catch (JSONException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return type_combdatas;
|
|
|
+ }
|
|
|
private List<CostTypeSingleBean> handleTypeSingleArray(String result, List<CostTypeSingleBean> type_combdatas) {
|
|
|
JSONObject resultJsonObject = null;
|
|
|
try {
|
|
|
resultJsonObject = JSON.parseObject(result);
|
|
|
String dataString = resultJsonObject.getString("data").toString();
|
|
|
- JSONArray dataArray = JSON.parseArray(dataString);
|
|
|
type_combdatas = JSON.parseArray(dataString,CostTypeSingleBean.class);
|
|
|
} catch (JSONException e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -494,7 +539,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
}else {
|
|
|
return null;
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
private CostSingleBean handleSingleArray(String result,CostSingleBean combdatas) {
|
|
|
LogUtil.prinlnLongMsg("handleSingleList_result",result);
|
|
|
JSONObject resultJsonObject = null;
|
|
|
@@ -661,6 +706,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
|
|
|
}
|
|
|
LogUtil.prinlnLongMsg("mFormconfigsBean_eg", JSON.toJSONString(mFormconfigsBean));
|
|
|
+ getTypeAndMoneyData(); //获取报销类型、币种数据
|
|
|
}
|
|
|
|
|
|
// 获取需要显示的从表单配置数据属性保存到mGridconfigsBean中
|
|
|
@@ -675,6 +721,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
}
|
|
|
}
|
|
|
LogUtil.prinlnLongMsg("mGridconfigsBean_eg", JSON.toJSONString(mGridconfigsBean));
|
|
|
+ getCostDetailsData(); //获取新增要展示明细列表数据源
|
|
|
}
|
|
|
}
|
|
|
}catch (JSONException e){
|
|
|
@@ -705,7 +752,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- String url= Constants.getAppBaseUrl(ct) + "common/dbfind.action";
|
|
|
+ String url="";
|
|
|
Map<String, Object> params_Details = new HashMap<>();
|
|
|
params_Details.put("which", "grid");
|
|
|
params_Details.put("caller", "FeeCategorySet");
|
|
|
@@ -715,12 +762,28 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
params_Details.put("pageSize", "30");
|
|
|
LinkedHashMap<String, Object> headers1 = new LinkedHashMap<>();
|
|
|
headers1.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
- ViewUtil.httpSendRequest(ct, url, params_Details, erhandler, headers1, 0x04, null, null, "get");
|
|
|
+ if (!ListUtils.isEmpty(mGridconfigsBean)){
|
|
|
+ for (int i = 0; i < mGridconfigsBean.size(); i++) {
|
|
|
+ if ("fpd_d1".equals(mGridconfigsBean.get(i).getDg_field())){
|
|
|
+ dg_type = mGridconfigsBean.get(i).getDg_type();
|
|
|
+ if ("S".equals(dg_type)){
|
|
|
+ url= Constants.getAppBaseUrl(ct) + "mobile/common/getComboValue.action";
|
|
|
+ ViewUtil.httpSendRequest(ct, url, params_Details, erhandler, headers1, 0x16, null, null, "get");
|
|
|
+ }else if ("DF".equals(dg_type)){
|
|
|
+ url = Constants.getAppBaseUrl(ct) + "common/dbfind.action";
|
|
|
+ ViewUtil.httpSendRequest(ct, url, params_Details, erhandler, headers1, 0x04, null, null, "get");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+ private String fd_type = "";
|
|
|
+ private String dg_type = "";
|
|
|
private void getTypeAndMoneyData() {
|
|
|
-// String url= Constants.getAppBaseUrl(ct) + "mobile/common/getComboValue.action";
|
|
|
- String url = Constants.getAppBaseUrl(ct) + "common/dbfind.action";
|
|
|
+
|
|
|
+ String url = "";
|
|
|
Map<String, Object> params_type = new HashMap<>();
|
|
|
params_type.put("caller", caller);
|
|
|
params_type.put("field", "fp_class");
|
|
|
@@ -730,9 +793,20 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
params_type.put("pageSize", "30");
|
|
|
LinkedHashMap<String, Object> headers1 = new LinkedHashMap<>();
|
|
|
headers1.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
- ViewUtil.httpSendRequest(ct, url, params_type, erhandler, headers1, 0x02, null, null, "get");
|
|
|
-
|
|
|
-
|
|
|
+ if (!ListUtils.isEmpty(mFormconfigsBean)){
|
|
|
+ for (int i = 0; i < mFormconfigsBean.size(); i++) {
|
|
|
+ if ("fp_class".equals(mFormconfigsBean.get(i).getFd_field())){
|
|
|
+ fd_type = mFormconfigsBean.get(i).getFd_type();
|
|
|
+ if ("C".equals(fd_type)){
|
|
|
+ url= Constants.getAppBaseUrl(ct) + "mobile/common/getComboValue.action";
|
|
|
+ ViewUtil.httpSendRequest(ct, url, params_type, erhandler, headers1, 0x15, null, null, "get");
|
|
|
+ }else if ("SF".equals(fd_type)){
|
|
|
+ url = Constants.getAppBaseUrl(ct) + "common/dbfind.action";
|
|
|
+ ViewUtil.httpSendRequest(ct, url, params_type, erhandler, headers1, 0x02, null, null, "get");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
String url2= Constants.getAppBaseUrl(ct) + "mobile/common/getComboValue.action";
|
|
|
Map<String, Object> params_money = new HashMap<>();
|
|
|
params_money.put("caller", caller);
|
|
|
@@ -786,12 +860,12 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
public void onClick(View v) {
|
|
|
switch (v.getId()){
|
|
|
case R.id.reimbursement_type_fet:
|
|
|
- LogUtil.prinlnLongMsg("combdatasType",JSON.toJSONString(type_combdatas));
|
|
|
- if(ListUtils.isEmpty(type_combdatas)) {
|
|
|
+ LogUtil.prinlnLongMsg("combdatasType",JSON.toJSONString(costtypesinglebeanList));
|
|
|
+ if(ListUtils.isEmpty(costtypesinglebeanList)) {
|
|
|
ToastMessage(getString(R.string.crm_nodatas));
|
|
|
break;
|
|
|
}
|
|
|
- doTypeSingleSelect(type_combdatas,2,getString(R.string.Reimbursement_type),SELECT_REIMBURSEMENT_TYPE);
|
|
|
+ doTypeSingleSelect(costtypesinglebeanList,2,getString(R.string.Reimbursement_type),SELECT_REIMBURSEMENT_TYPE);
|
|
|
break;
|
|
|
case R.id.reimbursement_currency_fet:
|
|
|
LogUtil.prinlnLongMsg("combdatasMoney",JSON.toJSONString(money_combdatas));
|
|
|
@@ -1236,9 +1310,9 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
if (b != null){
|
|
|
switch (requestCode){
|
|
|
case SELECT_REIMBURSEMENT_TYPE:
|
|
|
- for (int i = 0; i < type_combdatas.size(); i++) {
|
|
|
- if (b.getName().equals(type_combdatas.get(i).getFk_name()+"("+type_combdatas.get(i).getFk_desc()+")")){
|
|
|
- reimbursement_type_fet.setText(type_combdatas.get(i).getFk_name());
|
|
|
+ for (int i = 0; i < costtypesinglebeanList.size(); i++) {
|
|
|
+ if (b.getName().equals(costtypesinglebeanList.get(i).getFk_name()+"("+costtypesinglebeanList.get(i).getFk_desc()+")")){
|
|
|
+ reimbursement_type_fet.setText(costtypesinglebeanList.get(i).getFk_name());
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
@@ -1575,15 +1649,15 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
|
|
|
startActivityForResult(intent, requestCode);
|
|
|
}
|
|
|
|
|
|
- private void doTypeSingleSelect(List<CostTypeSingleBean> type_combdatas, int type, String title, int requestCode) {
|
|
|
+ private void doTypeSingleSelect(List<CostTypeSingleBean> costtypesinglebeanList, int type, String title, int requestCode) {
|
|
|
//TODO Datas为接口返回
|
|
|
- if (ListUtils.isEmpty(type_combdatas)) return;
|
|
|
+ if (ListUtils.isEmpty(costtypesinglebeanList)) return;
|
|
|
|
|
|
ArrayList<SelectBean> formBeaan = new ArrayList<>();
|
|
|
SelectBean selectBean;
|
|
|
- for (int i = 0; i < type_combdatas.size(); i++) {
|
|
|
+ for (int i = 0; i < costtypesinglebeanList.size(); i++) {
|
|
|
selectBean = new SelectBean();
|
|
|
- selectBean.setName(type_combdatas.get(i).getFk_name()+"("+type_combdatas.get(i).getFk_desc()+")");
|
|
|
+ selectBean.setName(costtypesinglebeanList.get(i).getFk_name()+"("+costtypesinglebeanList.get(i).getFk_desc()+")");
|
|
|
formBeaan.add(selectBean);
|
|
|
}
|
|
|
Intent intent = new Intent();
|