|
|
@ -68,18 +68,17 @@ public class WdailyActivity extends BaseActivity { |
|
|
|
|
|
|
|
|
private RpcObject rpcObj; |
|
|
private RpcObject rpcObj; |
|
|
|
|
|
|
|
|
String houseid; |
|
|
|
|
|
String housename; |
|
|
|
|
|
String days; |
|
|
|
|
|
String dienumber; |
|
|
|
|
|
String obs; |
|
|
|
|
|
String water; |
|
|
|
|
|
String weight; |
|
|
|
|
|
|
|
|
private String houseid; |
|
|
|
|
|
private String housename; |
|
|
|
|
|
private String days; |
|
|
|
|
|
private String dienumber; |
|
|
|
|
|
private String obs; |
|
|
|
|
|
private String water; |
|
|
|
|
|
private String weight; |
|
|
private void LoadOrCreateEditingDayProduct() { |
|
|
private void LoadOrCreateEditingDayProduct() { |
|
|
ViewOnClickTask LoadOrCreateEditingDayProductTask = new ViewOnClickTask(this, "加载中...") { |
|
|
ViewOnClickTask LoadOrCreateEditingDayProductTask = new ViewOnClickTask(this, "加载中...") { |
|
|
@Override |
|
|
@Override |
|
|
protected void successUI() { |
|
|
protected void successUI() { |
|
|
System.out.println("aaa++++++" + rpcObj); |
|
|
|
|
|
List<RpcObject> detailsList = rpcObj.getManyList("Details"); |
|
|
List<RpcObject> detailsList = rpcObj.getManyList("Details"); |
|
|
for (int i = 0; i < detailsList.size(); i++) { |
|
|
for (int i = 0; i < detailsList.size(); i++) { |
|
|
if (detailsList.get(i).getLong("House_ID")!=null) { |
|
|
if (detailsList.get(i).getLong("House_ID")!=null) { |
|
|
@ -126,7 +125,7 @@ public class WdailyActivity extends BaseActivity { |
|
|
list.add(new DailyDetailsBean(houseid, housename |
|
|
list.add(new DailyDetailsBean(houseid, housename |
|
|
, days, dienumber |
|
|
, days, dienumber |
|
|
, obs, water |
|
|
, obs, water |
|
|
, weight, "单据明细" + i+1)); |
|
|
|
|
|
|
|
|
, weight, "单据明细" + (i+1))); |
|
|
} |
|
|
} |
|
|
adapter = new DailyDetailsAdapter(WdailyActivity.this, list); |
|
|
adapter = new DailyDetailsAdapter(WdailyActivity.this, list); |
|
|
wdaily_lv.setAdapter(adapter); |
|
|
wdaily_lv.setAdapter(adapter); |
|
|
@ -154,7 +153,6 @@ public class WdailyActivity extends BaseActivity { |
|
|
public boolean onOptionsItemSelected(MenuItem item) { |
|
|
public boolean onOptionsItemSelected(MenuItem item) { |
|
|
switch (item.getItemId()) { |
|
|
switch (item.getItemId()) { |
|
|
case R.id.commit_dailys: |
|
|
case R.id.commit_dailys: |
|
|
// System.out.println("aaa++++"+list.toString()); |
|
|
|
|
|
commit(); |
|
|
commit(); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
@ -162,6 +160,63 @@ public class WdailyActivity extends BaseActivity { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void commit() { |
|
|
private void commit() { |
|
|
|
|
|
ViewOnClickTask updateTask = new ViewOnClickTask(this,"加载中...") { |
|
|
|
|
|
RpcObject rpcobj; |
|
|
|
|
|
@Override |
|
|
|
|
|
protected void successUI() { |
|
|
|
|
|
showToast("提交成功"); |
|
|
|
|
|
finish(); |
|
|
|
|
|
} |
|
|
|
|
|
@Override |
|
|
|
|
|
public Object call() throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
///< 带多样参数的集合 |
|
|
|
|
|
RpcObject parmObject = rpcObj; |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
for (int i = 0; i < list.size(); i++) { |
|
|
|
|
|
RpcObject setDetails = parmObject.getManyList("Details").get(i); |
|
|
|
|
|
|
|
|
|
|
|
// if (list.get(i).getDays()!=null && !"".equals(list.get(i).getDays())) { |
|
|
|
|
|
// setDetails.setInt("Days", Integer.parseInt(list.get(i).getDays())); |
|
|
|
|
|
// }else { |
|
|
|
|
|
// setDetails.setInt("Days",null); |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
if (list.get(i).getDieNumber()!=null && !"".equals(list.get(i).getDieNumber())) { |
|
|
|
|
|
setDetails.setInt("DieNumber", Integer.parseInt(list.get(i).getDieNumber())); |
|
|
|
|
|
}else { |
|
|
|
|
|
setDetails.setInt("DieNumber",null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (list.get(i).getObsolete()!=null && !"".equals(list.get(i).getObsolete())) { |
|
|
|
|
|
setDetails.setInt("Obsolete", Integer.parseInt(list.get(i).getObsolete())); |
|
|
|
|
|
}else { |
|
|
|
|
|
setDetails.setInt("Obsolete",null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (list.get(i).getWaterIntake()!=null && !"".equals(list.get(i).getWaterIntake())) { |
|
|
|
|
|
setDetails.setDecimal("WaterIntake", new BigDecimal(list.get(i).getWaterIntake())); |
|
|
|
|
|
}else { |
|
|
|
|
|
setDetails.setDecimal("WaterIntake",null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (list.get(i).getWeight()!=null && !"".equals(list.get(i).getWeight())) { |
|
|
|
|
|
setDetails.setDecimal("Weight", new BigDecimal(list.get(i).getWeight())); |
|
|
|
|
|
}else { |
|
|
|
|
|
setDetails.setDecimal("Weight",null); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
JsonRpcResult result = RpcFacade.rpcCall(RpcUrl.DayProductRpc_Update, parmObject); |
|
|
|
|
|
rpcobj = result.getRpcObject(RpcUrl.DayProductRpc_Update_canshu_fanhui); |
|
|
|
|
|
}catch (NumberFormatException e) |
|
|
|
|
|
{ |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
} |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
updateTask.execute(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |