diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d5bcd3f..4852924 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -175,6 +175,8 @@ android:screenOrientation="portrait" /> + buildhouseList; + private List reportBeanList; + + private long BreedFactory_ID; + @Override + protected int setLayoutId() { + return R.layout.act_poultry_chandan_report; + } + + @Override + protected void initView() { + initToolbar(mToolbar, "报表指数", new View.OnClickListener() { + @Override + public void onClick(View view) { + finish(); + } + }); + + combination(lv_buildhousename, lv_report_info, sv_title, sv_report_detail); + } + + @Override + protected void initData() { + BreedFactory_ID = getIntent().getLongExtra("BreedFactory_ID",-1); + buildhouseList = new ArrayList<>(); + reportBeanList = new ArrayList<>(); + } + + @Override + protected void initOper() { + lv_buildhousename.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView adapterView, View view, int i, long l) { + Intent intent = new Intent(PoultryReportChandanActvity.this,PoultryDataChartActivity.class); + intent.putExtra("House_ID",l); + intent.putExtra("House_Name",reportBeanList.get(i).getHouse_Name()); + intent.putExtra("TYPE",2); + startActivity(intent); + } + }); + lv_report_info.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView adapterView, View view, int i, long l) { + Intent intent = new Intent(PoultryReportChandanActvity.this,PoultryDataChartActivity.class); + intent.putExtra("House_ID",l); + intent.putExtra("House_Name",reportBeanList.get(i).getHouse_Name()); + intent.putExtra("TYPE",2); + startActivity(intent); + } + }); + } + + @Override + protected void onResume() { + super.onResume(); + HouseTotalInfoCount2(); + } + + private void HouseTotalInfoCount2() { + ViewOnClickTask HouseTotalInfoCount2Task = new ViewOnClickTask(this,"加载中...") { + List rpcList; + @Override + protected void successUI() { + buildhouseList.clear(); + reportBeanList.clear(); + for (int i = 0;i list; + + public PoultryReportChandanInfoAdapter(Context context, List list) { + this.context = context; + this.list = list; + } + + @Override + public int getCount() { + return list.size(); + } + + @Override + public Object getItem(int position) { + return list.get(position); + } + + @Override + public long getItemId(int position) { + return list.get(position).getHouse_ID(); + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + ViewHolder holder; + PoultryReportBean message = list.get(position); + if (convertView == null) { + holder = new ViewHolder(); + convertView = LayoutInflater.from(context).inflate(R.layout.item_lv_poultry_chandan_info, null); + holder.item_zhouling = (TextView) convertView.findViewById(R.id.item_zhouling); + holder.item_musitao = (TextView) convertView.findViewById(R.id.item_musitao); + holder.item_gongsitao = (TextView) convertView.findViewById(R.id.item_gongsitao); + holder.item_danzhong = (TextView) convertView.findViewById(R.id.item_danzhong); + holder.item_chandanlv = (TextView) convertView.findViewById(R.id.item_chandanlv); + holder.item_chandanfudonglv = (TextView) convertView.findViewById(R.id.item_chandanfudonglv); + holder.item_muzhiliaoliang = (TextView) convertView.findViewById(R.id.item_muzhiliaoliang); + holder.item_mucaishi = (TextView) convertView.findViewById(R.id.item_mucaishi); + + + holder.ll_buildhouseinfo = convertView.findViewById(R.id.ll_buildhouseinfo); + holder.item_dongshe = convertView.findViewById(R.id.item_dongshe); + + + convertView.setTag(holder); + } else { + holder = (ViewHolder) convertView.getTag(); + } + + ///< 自己看拼音吧 我也不想看了 + holder.item_zhouling.setText(message.getWeek()); + holder.item_musitao.setText(message.getFemaleSiTaoNumber()); + holder.item_gongsitao.setText(message.getMaleSiTaoNumber()); + + holder.item_danzhong.setText(message.getDanzhong()); + holder.item_chandanlv.setText(message.getChandanlv()); + holder.item_chandanfudonglv.setText(message.getChandanfudonglv()); + + holder.item_muzhiliaoliang.setText(message.getFemalePerFeedNumber()); + holder.item_mucaishi.setText(message.getFemaleEatTime()); + + holder.item_dongshe.setText(message.getHouse_Name()); + + if (position%2==0){ + holder.ll_buildhouseinfo.setBackgroundColor(context.getResources().getColor(R.color.greyf4f4f4)); + }else { + holder.ll_buildhouseinfo.setBackgroundColor(context.getResources().getColor(R.color.white)); + } + + return convertView; + } + private class ViewHolder { + TextView item_zhouling; + TextView item_musitao; + TextView item_gongsitao; + + TextView item_danzhong; + TextView item_chandanlv; + TextView item_chandanfudonglv; + + TextView item_muzhiliaoliang; + TextView item_mucaishi; + + TextView item_dongshe; + LinearLayout ll_buildhouseinfo; + } +} + + diff --git a/app/src/main/res/layout/act_poultry_chandan_report.xml b/app/src/main/res/layout/act_poultry_chandan_report.xml new file mode 100644 index 0000000..aaa3b3e --- /dev/null +++ b/app/src/main/res/layout/act_poultry_chandan_report.xml @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_lv_poultry_chandan_info.xml b/app/src/main/res/layout/item_lv_poultry_chandan_info.xml new file mode 100644 index 0000000..2583af6 --- /dev/null +++ b/app/src/main/res/layout/item_lv_poultry_chandan_info.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file