|
|
|
@ -7,6 +7,16 @@ import android.widget.TextView; |
|
|
|
|
|
|
|
import com.qhclh.ytzh.R; |
|
|
|
import com.qhclh.ytzh.base.BaseActivity; |
|
|
|
import com.qhclh.ytzh.bean.ThreeTypeBean; |
|
|
|
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; |
|
|
|
|
|
|
|
@ -24,6 +34,8 @@ public class ThreeTypeActivity extends BaseActivity { |
|
|
|
ListView lv_threetype; |
|
|
|
|
|
|
|
private long status; |
|
|
|
private ThreeTypeAdapter threeTypeAdapter; |
|
|
|
private List<ThreeTypeBean> threeTypeBeanList; |
|
|
|
@Override |
|
|
|
protected int setLayoutId() { |
|
|
|
return R.layout.act_threetype; |
|
|
|
@ -42,23 +54,57 @@ public class ThreeTypeActivity extends BaseActivity { |
|
|
|
@Override |
|
|
|
protected void initData() { |
|
|
|
status = getIntent().getLongExtra("status",-1); |
|
|
|
threeTypeBeanList = new ArrayList<>(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void initOper() { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void onResume() { |
|
|
|
super.onResume(); |
|
|
|
if (status ==0){ |
|
|
|
tv_toolbar_title.setText("空栏"); |
|
|
|
BreedFactoryCountView0(); |
|
|
|
}else if (status == 1){ |
|
|
|
tv_toolbar_title.setText("育雏育成期"); |
|
|
|
BreedFactoryCountView1(); |
|
|
|
}else if (status == 2){ |
|
|
|
tv_toolbar_title.setText("产蛋期"); |
|
|
|
BreedFactoryCountView2(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void initOper() { |
|
|
|
private void BreedFactoryCountView0() { |
|
|
|
ViewOnClickTask breedTask = new ViewOnClickTask(ThreeTypeActivity.this,"加载中...") { |
|
|
|
List<RpcObject> rpcList0; |
|
|
|
@Override |
|
|
|
protected void successUI() { |
|
|
|
threeTypeBeanList.clear(); |
|
|
|
for (int i=0;i<rpcList0.size();i++){ |
|
|
|
threeTypeBeanList.add(new ThreeTypeBean(rpcList0.get(i).getLong("BreedFactory_ID") |
|
|
|
,rpcList0.get(i).getString("BreedFactory_Name") |
|
|
|
,"在养栋舍数:"+rpcList0.get(i).getInt("LivingNumber"),"未养栋舍数:"+rpcList0.get(i).getInt("EmptyNumber"))); |
|
|
|
} |
|
|
|
threeTypeAdapter = new ThreeTypeAdapter(ThreeTypeActivity.this,threeTypeBeanList); |
|
|
|
lv_threetype.setAdapter(threeTypeAdapter); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Object call() throws Exception { |
|
|
|
JsonRpcResult result = RpcFacade.rpcCall(RpcUrl.BreedFactoryCountView0); |
|
|
|
rpcList0 = result.getRpcObjectList(RpcUrl.BreedFactoryCountView0_fanhui); |
|
|
|
return null; |
|
|
|
} |
|
|
|
}; |
|
|
|
breedTask.execute(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void onResume() { |
|
|
|
super.onResume(); |
|
|
|
|
|
|
|
private void BreedFactoryCountView1() { |
|
|
|
} |
|
|
|
|
|
|
|
private void BreedFactoryCountView2() { |
|
|
|
} |
|
|
|
} |