|
|
|
@ -12,6 +12,12 @@ import android.view.View; |
|
|
|
|
|
|
|
import com.qhclh.ytzh.R; |
|
|
|
import com.qhclh.ytzh.base.BaseActivity; |
|
|
|
import com.qhclh.ytzh.home.RpcUrl; |
|
|
|
import com.qhclh.ytzh.tasks.ViewOnClickTask; |
|
|
|
|
|
|
|
import org.forks.jsonrpc.JsonRpcResult; |
|
|
|
import org.forks.jsonrpc.RpcFacade; |
|
|
|
import org.forks.jsonrpc.RpcObject; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
@ -32,6 +38,7 @@ public class WriteDActivity extends BaseActivity { |
|
|
|
private List<Fragment> mFragmentList = new ArrayList<>(); |
|
|
|
private List<String> mTitleList = new ArrayList<>(); |
|
|
|
private TabViewPagerAdapter mViewPagerAdapter; |
|
|
|
private List<Long> mHouseId = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -62,6 +69,81 @@ public class WriteDActivity extends BaseActivity { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void onResume() { |
|
|
|
super.onResume(); |
|
|
|
LoadOrCreateEditingDayProduct(); |
|
|
|
} |
|
|
|
private RpcObject rpcObj; |
|
|
|
|
|
|
|
private String houseid; |
|
|
|
private String housename; |
|
|
|
private String days; |
|
|
|
private String dienumber; |
|
|
|
private String obs; |
|
|
|
private String water; |
|
|
|
private String weight; |
|
|
|
private void LoadOrCreateEditingDayProduct() { |
|
|
|
ViewOnClickTask LoadOrCreateEditingDayProductTask = new ViewOnClickTask(this, "加载中...") { |
|
|
|
@Override |
|
|
|
protected void successUI() { |
|
|
|
List<RpcObject> detailsList = rpcObj.getManyList("Details"); |
|
|
|
for (int i = 0; i < detailsList.size(); i++) { |
|
|
|
if (detailsList.get(i).getLong("House_ID")!=null) { |
|
|
|
houseid = detailsList.get(i).getLong("House_ID")+""; |
|
|
|
}else { |
|
|
|
houseid = ""; |
|
|
|
} |
|
|
|
|
|
|
|
if (detailsList.get(i).getString("House_Name")!=null) { |
|
|
|
housename = detailsList.get(i).getString("House_Name"); |
|
|
|
}else { |
|
|
|
housename = ""; |
|
|
|
} |
|
|
|
|
|
|
|
if (detailsList.get(i).getInt("Days")!=null) { |
|
|
|
days = detailsList.get(i).getInt("Days")+""; |
|
|
|
}else { |
|
|
|
days = ""; |
|
|
|
} |
|
|
|
|
|
|
|
if (detailsList.get(i).getInt("DieNumber")!=null) { |
|
|
|
dienumber = detailsList.get(i).getInt("DieNumber")+""; |
|
|
|
}else { |
|
|
|
dienumber = ""; |
|
|
|
} |
|
|
|
|
|
|
|
if (detailsList.get(i).getInt("Obsolete")!=null) { |
|
|
|
obs = detailsList.get(i).getInt("Obsolete")+""; |
|
|
|
}else { |
|
|
|
obs = ""; |
|
|
|
} |
|
|
|
|
|
|
|
if (detailsList.get(i).getDecimal("WaterIntake")!=null) { |
|
|
|
water = detailsList.get(i).getDecimal("WaterIntake")+""; |
|
|
|
}else { |
|
|
|
water =""; |
|
|
|
} |
|
|
|
|
|
|
|
if (detailsList.get(i).getDecimal("Weight")!=null) { |
|
|
|
weight = detailsList.get(i).getDecimal("Weight")+""; |
|
|
|
}else { |
|
|
|
weight = ""; |
|
|
|
} |
|
|
|
mHouseId.add(detailsList.get(i).getLong("House_ID")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Object call() throws Exception { |
|
|
|
JsonRpcResult result = RpcFacade.rpcCall(RpcUrl.LoadOrCreateEditingDayProduct, new Object[]{null}); |
|
|
|
rpcObj = result.getRpcObject(RpcUrl.LoadOrCreateEditingDayProduct_fanhui); |
|
|
|
return null; |
|
|
|
} |
|
|
|
}; |
|
|
|
LoadOrCreateEditingDayProductTask.execute(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean onCreateOptionsMenu(Menu menu) { |
|
|
|
@ -127,5 +209,9 @@ public class WriteDActivity extends BaseActivity { |
|
|
|
public CharSequence getPageTitle(int position) { |
|
|
|
return mTitleList.get(position); |
|
|
|
} |
|
|
|
// @Override |
|
|
|
// public long getItemId(int position) { |
|
|
|
// return mHouseId.get(position); |
|
|
|
// } |
|
|
|
} |
|
|
|
} |