|
|
|
@ -13,6 +13,13 @@ import android.widget.TextView; |
|
|
|
|
|
|
|
import com.qhclh.ytzh.R; |
|
|
|
import com.qhclh.ytzh.base.BaseActivity; |
|
|
|
import com.qhclh.ytzh.home.RpcUrl; |
|
|
|
import com.qhclh.ytzh.tasks.ViewOnClickTask; |
|
|
|
import com.qhclh.ytzh.work.Hatchery.HatcheryBean; |
|
|
|
|
|
|
|
import org.forks.jsonrpc.JsonRpcResult; |
|
|
|
import org.forks.jsonrpc.RpcFacade; |
|
|
|
import org.forks.jsonrpc.RpcObject; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
@ -36,6 +43,8 @@ public class FowlActivity extends BaseActivity { |
|
|
|
private List<Fragment> mFragmentList = new ArrayList<>(); |
|
|
|
private List<String> mTitleList = new ArrayList<>(); |
|
|
|
private TabViewPagerAdapter mViewPagerAdapter; |
|
|
|
|
|
|
|
private List<HatcheryBean> list; |
|
|
|
@Override |
|
|
|
protected int setLayoutId() { |
|
|
|
return R.layout.act_poultrydailyreport; |
|
|
|
@ -55,7 +64,7 @@ public class FowlActivity extends BaseActivity { |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void initData() { |
|
|
|
|
|
|
|
list = new ArrayList<>(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@ -74,12 +83,32 @@ public class FowlActivity extends BaseActivity { |
|
|
|
public boolean onOptionsItemSelected(MenuItem item) { |
|
|
|
switch (item.getItemId()) { |
|
|
|
case R.id.search_addr: |
|
|
|
|
|
|
|
GetChoiceBoxWords(); |
|
|
|
break; |
|
|
|
} |
|
|
|
return super.onOptionsItemSelected(item); |
|
|
|
} |
|
|
|
|
|
|
|
private void GetChoiceBoxWords() { |
|
|
|
ViewOnClickTask hatcheryTask = new ViewOnClickTask(this,"加载中...") { |
|
|
|
List<RpcObject> rpcobj; |
|
|
|
@Override |
|
|
|
protected void successUI() { |
|
|
|
list.clear(); |
|
|
|
for (int i =0;i<rpcobj.size();i++){ |
|
|
|
list.add(new HatcheryBean(Long.parseLong(rpcobj.get(i).getString("Item1")),rpcobj.get(i).getString("Item2"))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Object call() throws Exception { |
|
|
|
JsonRpcResult result = RpcFacade.rpcCall(RpcUrl.GetChoiceBoxWords,"B3ProduceUnitedInfos_区域","",""); |
|
|
|
rpcobj = result.getRpcObjectList(RpcUrl.GetChoiceBoxWords_fanhui); |
|
|
|
return null; |
|
|
|
} |
|
|
|
}; |
|
|
|
hatcheryTask.execute(); |
|
|
|
} |
|
|
|
private void initTabLayout() { |
|
|
|
mTitleList.add("上鸡"); |
|
|
|
mTitleList.add("出栏"); |
|
|
|
|