Commit b42c3ab03b37218d7d59e6f92b02802f6d454160
1 parent
fc0b8695
畅游通核销app4.0 1.修改剩余x份的数组字段
Showing
1 changed file
with
19 additions
and
17 deletions
src/com/ectrip/cyt/adapter/ReportExpandableListAdapter.java
| ... | ... | @@ -46,7 +46,7 @@ import java.util.concurrent.atomic.AtomicBoolean; |
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * @author dengchen |
| 49 | - * Created by 2016/8/5. | |
| 49 | + * Created by 2016/8/5. | |
| 50 | 50 | */ |
| 51 | 51 | public class ReportExpandableListAdapter extends AnimatedExpandableListView.AnimatedExpandableListAdapter { |
| 52 | 52 | |
| ... | ... | @@ -63,7 +63,7 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim |
| 63 | 63 | private final int screenWidth; |
| 64 | 64 | private int type; |
| 65 | 65 | |
| 66 | - public ReportExpandableListAdapter(ListOnclickCallback callback, Context context, List<OrderInfo> orderInfos,int type) { | |
| 66 | + public ReportExpandableListAdapter(ListOnclickCallback callback, Context context, List<OrderInfo> orderInfos, int type) { | |
| 67 | 67 | this.callback = callback; |
| 68 | 68 | this.context = context; |
| 69 | 69 | this.orderInfos = orderInfos; |
| ... | ... | @@ -78,7 +78,7 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim |
| 78 | 78 | screenWidth = display.getWidth(); |
| 79 | 79 | devtype = SharedPreferences2Obj.getInstance(context) |
| 80 | 80 | .setName("MachineType").getObject("type", Integer.class); |
| 81 | - LogUtil.d("ReportExpandableListAdapter","Select = "+Select); | |
| 81 | + LogUtil.d("ReportExpandableListAdapter", "Select = " + Select); | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
| ... | ... | @@ -266,21 +266,21 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim |
| 266 | 266 | |
| 267 | 267 | // int type = getItemViewType(groupPosition); |
| 268 | 268 | holder.ticket_print.setTag("" + groupPosition); |
| 269 | - LogUtil.d("ReportExpandableListAdapter","type = "+type); | |
| 269 | + LogUtil.d("ReportExpandableListAdapter", "type = " + type); | |
| 270 | 270 | switch (type) { |
| 271 | 271 | case VALUE_NOT_PART: // 这种情况下是没有部分检票的 |
| 272 | 272 | holder.part.setVisibility(View.GONE); |
| 273 | 273 | break; |
| 274 | 274 | case VALUE_PART: |
| 275 | 275 | String status = orderInfos.get(groupPosition).getOrderStatus(); |
| 276 | - if (status != null && OrderStutas.PRINTSUCCESS.getValue().equals(status) ) { | |
| 276 | + if (status != null && OrderStutas.PRINTSUCCESS.getValue().equals(status)) { | |
| 277 | 277 | if (Select == 1) { |
| 278 | 278 | holder.part.setVisibility(View.VISIBLE); |
| 279 | - }else { | |
| 279 | + } else { | |
| 280 | 280 | holder.part.setVisibility(View.GONE); |
| 281 | 281 | } |
| 282 | - } else if (status != null && OrderStutas.CONSUMED.getValue().equals(status) ) { | |
| 283 | - holder.part.setVisibility(View.GONE); | |
| 282 | + } else if (status != null && OrderStutas.CONSUMED.getValue().equals(status)) { | |
| 283 | + holder.part.setVisibility(View.GONE); | |
| 284 | 284 | } |
| 285 | 285 | if (Select == 1 && holder.part != null) { |
| 286 | 286 | // holder.part.setClickable(false); |
| ... | ... | @@ -366,12 +366,14 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim |
| 366 | 366 | } |
| 367 | 367 | base.time_item.setText(orderInfos.get(position).getContactorName() + " |"); |
| 368 | 368 | base.id_number.setText(credentials); |
| 369 | - }else { | |
| 369 | + } else { | |
| 370 | 370 | base.time_item.setText(orderInfos.get(position).getContactorName()); |
| 371 | 371 | base.id_number.setText(" "); |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | - base.total_num.setText("剩余 " + orderInfos.get(position).getOrderAmount() + " 份"); | |
| 374 | +// base.total_num.setText("剩余 " + orderInfos.get(position).getOrderAmount() + " 份"); | |
| 375 | + LogUtil.d("ReportExpandableListAdapter", "Quantity = " + orderInfos.get(position).getProducts().get(position).getQuantity()); | |
| 376 | + base.total_num.setText("剩余 " + orderInfos.get(position).getProducts().get(position).getQuantity() + " 份"); | |
| 375 | 377 | |
| 376 | 378 | String status = orderInfos.get(position).getOrderStatus(); |
| 377 | 379 | String paystatus = orderInfos.get(position).getPaymentWay(); |
| ... | ... | @@ -405,16 +407,16 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim |
| 405 | 407 | } else if (Select == 3) { |
| 406 | 408 | base.ticket_print.setVisibility(View.GONE); |
| 407 | 409 | } |
| 408 | - } else if (paystatus!=null&&paystatus.equals("CASHPAY")){ | |
| 410 | + } else if (paystatus != null && paystatus.equals("CASHPAY")) { | |
| 409 | 411 | base.style_item.setText("到付订单"); |
| 410 | 412 | if (base.part != null) { |
| 411 | 413 | base.part.setVisibility(View.GONE); |
| 412 | 414 | } |
| 413 | 415 | |
| 414 | - }else if (status != null | |
| 416 | + } else if (status != null | |
| 415 | 417 | && OrderStutas.NOTPAYED.getValue().equals(status)) { |
| 416 | - base.style_item.setText(R.string.notpayed); | |
| 417 | - base.ticket_print.setVisibility(View.GONE); | |
| 418 | + base.style_item.setText(R.string.notpayed); | |
| 419 | + base.ticket_print.setVisibility(View.GONE); | |
| 418 | 420 | |
| 419 | 421 | if (base.part != null) { |
| 420 | 422 | base.part.setVisibility(View.GONE); |
| ... | ... | @@ -426,7 +428,7 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim |
| 426 | 428 | } |
| 427 | 429 | |
| 428 | 430 | if (Select == 1) { |
| 429 | - if (paystatus!=null&&paystatus.equals("CASHPAY")&&status != null | |
| 431 | + if (paystatus != null && paystatus.equals("CASHPAY") && status != null | |
| 430 | 432 | && OrderStutas.NOTPAYED.getValue().equals(status)) { |
| 431 | 433 | base.ticket_print.setText("收费确认"); |
| 432 | 434 | base.ticket_print.setVisibility(View.VISIBLE); |
| ... | ... | @@ -623,7 +625,7 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim |
| 623 | 625 | Display display = manager.getDefaultDisplay(); |
| 624 | 626 | int width = display.getWidth(); |
| 625 | 627 | |
| 626 | - lp.width = DenstityUtils.dp2px(activity,300); | |
| 628 | + lp.width = DenstityUtils.dp2px(activity, 300); | |
| 627 | 629 | lp.height = ActionBar.LayoutParams.WRAP_CONTENT; |
| 628 | 630 | dialog.getWindow().setAttributes(lp); |
| 629 | 631 | |
| ... | ... | @@ -758,7 +760,7 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim |
| 758 | 760 | } |
| 759 | 761 | }); |
| 760 | 762 | |
| 761 | - if (dialog.isShowing()){ | |
| 763 | + if (dialog.isShowing()) { | |
| 762 | 764 | dialog.dismiss(); |
| 763 | 765 | } |
| 764 | 766 | ... | ... |