|
|
@ -8,6 +8,16 @@ import android.widget.TextView; |
|
|
|
|
|
|
|
|
import com.qhclh.ytzh.R; |
|
|
import com.qhclh.ytzh.R; |
|
|
import com.qhclh.ytzh.base.BaseActivity; |
|
|
import com.qhclh.ytzh.base.BaseActivity; |
|
|
|
|
|
import com.qhclh.ytzh.bean.BreedFactoryInfoBean; |
|
|
|
|
|
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; |
|
|
|
|
|
|
|
|
import butterknife.BindView; |
|
|
import butterknife.BindView; |
|
|
|
|
|
|
|
|
@ -27,6 +37,9 @@ public class PianquinfosActivity extends BaseActivity { |
|
|
@BindView(R.id.ll_konglan) |
|
|
@BindView(R.id.ll_konglan) |
|
|
LinearLayout ll_konglan; |
|
|
LinearLayout ll_konglan; |
|
|
|
|
|
|
|
|
|
|
|
private List<BreedFactoryInfoBean> cunlanlist; |
|
|
|
|
|
private List<BreedFactoryInfoBean> konglanlist; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
protected int setLayoutId() { |
|
|
protected int setLayoutId() { |
|
|
return R.layout.act_pianquinfos; |
|
|
return R.layout.act_pianquinfos; |
|
|
@ -49,23 +62,8 @@ public class PianquinfosActivity extends BaseActivity { |
|
|
name = getIntent().getStringExtra("name"); |
|
|
name = getIntent().getStringExtra("name"); |
|
|
tv_toolbar_title.setText(name+"片区详细"); |
|
|
tv_toolbar_title.setText(name+"片区详细"); |
|
|
|
|
|
|
|
|
for (int i=0;i<25;i++){ |
|
|
|
|
|
View view = LayoutInflater.from(PianquinfosActivity.this).inflate(R.layout.item_pianquinfos,null); |
|
|
|
|
|
TextView pianqu_name = view.findViewById(R.id.pianqu_name); |
|
|
|
|
|
TextView pianqu_content = view.findViewById(R.id.pianqu_content); |
|
|
|
|
|
pianqu_name.setText("aaaa++++++++++"+i); |
|
|
|
|
|
pianqu_content.setText("bbb+++"+i); |
|
|
|
|
|
ll_cunlan.addView(view); |
|
|
|
|
|
} |
|
|
|
|
|
for (int i=0;i<25;i++){ |
|
|
|
|
|
View view = LayoutInflater.from(PianquinfosActivity.this).inflate(R.layout.item_pianquinfos,null); |
|
|
|
|
|
TextView pianqu_name = view.findViewById(R.id.pianqu_name); |
|
|
|
|
|
TextView pianqu_content = view.findViewById(R.id.pianqu_content); |
|
|
|
|
|
pianqu_name.setText("aaaa++++++++++"+i); |
|
|
|
|
|
pianqu_content.setText("bbb+++"+i); |
|
|
|
|
|
ll_konglan.addView(view); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cunlanlist = new ArrayList<>(); |
|
|
|
|
|
konglanlist = new ArrayList<>(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
@ -80,5 +78,75 @@ public class PianquinfosActivity extends BaseActivity { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void getFactryList() { |
|
|
private void getFactryList() { |
|
|
|
|
|
ViewOnClickTask factryTask = new ViewOnClickTask(this,"加载中...") { |
|
|
|
|
|
List<RpcObject> rpcObjectList; |
|
|
|
|
|
@Override |
|
|
|
|
|
protected void successUI() { |
|
|
|
|
|
cunlanlist.clear(); |
|
|
|
|
|
konglanlist.clear(); |
|
|
|
|
|
for (int i=0;i<rpcObjectList.size();i++) |
|
|
|
|
|
{ |
|
|
|
|
|
if (rpcObjectList.get(i).getBoolean("Empty")==true){ |
|
|
|
|
|
///< 空栏 |
|
|
|
|
|
BreedFactoryInfoBean konglanbean = new BreedFactoryInfoBean(); |
|
|
|
|
|
konglanbean.setID(rpcObjectList.get(i).getLong("ID")); |
|
|
|
|
|
if (rpcObjectList.get(i).getString("Name")!=null) { |
|
|
|
|
|
konglanbean.setName(rpcObjectList.get(i).getString("Name")); |
|
|
|
|
|
}else { |
|
|
|
|
|
konglanbean.setName(""); |
|
|
|
|
|
} |
|
|
|
|
|
if (rpcObjectList.get(i).getString("Contact")!=null) { |
|
|
|
|
|
konglanbean.setContact(rpcObjectList.get(i).getString("Contact")); |
|
|
|
|
|
}else { |
|
|
|
|
|
konglanbean.setContact(""); |
|
|
|
|
|
} |
|
|
|
|
|
konglanlist.add(konglanbean); |
|
|
|
|
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
///< 存栏 |
|
|
|
|
|
BreedFactoryInfoBean cunlanbean = new BreedFactoryInfoBean(); |
|
|
|
|
|
cunlanbean.setID(rpcObjectList.get(i).getLong("ID")); |
|
|
|
|
|
if (rpcObjectList.get(i).getString("Name")!=null) { |
|
|
|
|
|
cunlanbean.setName(rpcObjectList.get(i).getString("Name")); |
|
|
|
|
|
}else { |
|
|
|
|
|
cunlanbean.setName(""); |
|
|
|
|
|
} |
|
|
|
|
|
if (rpcObjectList.get(i).getString("Contact")!=null) { |
|
|
|
|
|
cunlanbean.setContact(rpcObjectList.get(i).getString("Contact")); |
|
|
|
|
|
}else { |
|
|
|
|
|
cunlanbean.setContact(""); |
|
|
|
|
|
} |
|
|
|
|
|
cunlanlist.add(cunlanbean); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i=0;i<cunlanlist.size();i++){ |
|
|
|
|
|
View view = LayoutInflater.from(PianquinfosActivity.this).inflate(R.layout.item_pianquinfos,null); |
|
|
|
|
|
TextView pianqu_name = view.findViewById(R.id.pianqu_name); |
|
|
|
|
|
TextView pianqu_content = view.findViewById(R.id.pianqu_content); |
|
|
|
|
|
pianqu_name.setText((i+1)+".养殖场:"+cunlanlist.get(i).getName()); |
|
|
|
|
|
pianqu_content.setText("厂长:"+cunlanlist.get(i).getContact()); |
|
|
|
|
|
ll_cunlan.addView(view); |
|
|
|
|
|
} |
|
|
|
|
|
for (int i=0;i<konglanlist.size();i++){ |
|
|
|
|
|
View view = LayoutInflater.from(PianquinfosActivity.this).inflate(R.layout.item_pianquinfos,null); |
|
|
|
|
|
TextView pianqu_name = view.findViewById(R.id.pianqu_name); |
|
|
|
|
|
TextView pianqu_content = view.findViewById(R.id.pianqu_content); |
|
|
|
|
|
pianqu_name.setText((i+1)+".养殖场:"+konglanlist.get(i).getName()); |
|
|
|
|
|
pianqu_content.setText("厂长:"+konglanlist.get(i).getContact()); |
|
|
|
|
|
ll_konglan.addView(view); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public Object call() throws Exception { |
|
|
|
|
|
JsonRpcResult result = RpcFacade.rpcCall(RpcUrl.BreedFactoryDetails,id); |
|
|
|
|
|
rpcObjectList = result.getRpcObjectList(RpcUrl.BreedFactoryDetails_fanhui); |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
factryTask.execute(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |