Commit b42c3ab03b37218d7d59e6f92b02802f6d454160

Authored by 杜方
1 parent fc0b8695

畅游通核销app4.0 1.修改剩余x份的数组字段

src/com/ectrip/cyt/adapter/ReportExpandableListAdapter.java
@@ -46,7 +46,7 @@ import java.util.concurrent.atomic.AtomicBoolean; @@ -46,7 +46,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
46 46
47 /** 47 /**
48 * @author dengchen 48 * @author dengchen
49 - * Created by 2016/8/5. 49 + * Created by 2016/8/5.
50 */ 50 */
51 public class ReportExpandableListAdapter extends AnimatedExpandableListView.AnimatedExpandableListAdapter { 51 public class ReportExpandableListAdapter extends AnimatedExpandableListView.AnimatedExpandableListAdapter {
52 52
@@ -63,7 +63,7 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim @@ -63,7 +63,7 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim
63 private final int screenWidth; 63 private final int screenWidth;
64 private int type; 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 this.callback = callback; 67 this.callback = callback;
68 this.context = context; 68 this.context = context;
69 this.orderInfos = orderInfos; 69 this.orderInfos = orderInfos;
@@ -78,7 +78,7 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim @@ -78,7 +78,7 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim
78 screenWidth = display.getWidth(); 78 screenWidth = display.getWidth();
79 devtype = SharedPreferences2Obj.getInstance(context) 79 devtype = SharedPreferences2Obj.getInstance(context)
80 .setName("MachineType").getObject("type", Integer.class); 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,21 +266,21 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim
266 266
267 // int type = getItemViewType(groupPosition); 267 // int type = getItemViewType(groupPosition);
268 holder.ticket_print.setTag("" + groupPosition); 268 holder.ticket_print.setTag("" + groupPosition);
269 - LogUtil.d("ReportExpandableListAdapter","type = "+type); 269 + LogUtil.d("ReportExpandableListAdapter", "type = " + type);
270 switch (type) { 270 switch (type) {
271 case VALUE_NOT_PART: // 这种情况下是没有部分检票的 271 case VALUE_NOT_PART: // 这种情况下是没有部分检票的
272 holder.part.setVisibility(View.GONE); 272 holder.part.setVisibility(View.GONE);
273 break; 273 break;
274 case VALUE_PART: 274 case VALUE_PART:
275 String status = orderInfos.get(groupPosition).getOrderStatus(); 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 if (Select == 1) { 277 if (Select == 1) {
278 holder.part.setVisibility(View.VISIBLE); 278 holder.part.setVisibility(View.VISIBLE);
279 - }else { 279 + } else {
280 holder.part.setVisibility(View.GONE); 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 if (Select == 1 && holder.part != null) { 285 if (Select == 1 && holder.part != null) {
286 // holder.part.setClickable(false); 286 // holder.part.setClickable(false);
@@ -366,12 +366,14 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim @@ -366,12 +366,14 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim
366 } 366 }
367 base.time_item.setText(orderInfos.get(position).getContactorName() + " |"); 367 base.time_item.setText(orderInfos.get(position).getContactorName() + " |");
368 base.id_number.setText(credentials); 368 base.id_number.setText(credentials);
369 - }else { 369 + } else {
370 base.time_item.setText(orderInfos.get(position).getContactorName()); 370 base.time_item.setText(orderInfos.get(position).getContactorName());
371 base.id_number.setText(" "); 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 String status = orderInfos.get(position).getOrderStatus(); 378 String status = orderInfos.get(position).getOrderStatus();
377 String paystatus = orderInfos.get(position).getPaymentWay(); 379 String paystatus = orderInfos.get(position).getPaymentWay();
@@ -405,16 +407,16 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim @@ -405,16 +407,16 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim
405 } else if (Select == 3) { 407 } else if (Select == 3) {
406 base.ticket_print.setVisibility(View.GONE); 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 base.style_item.setText("到付订单"); 411 base.style_item.setText("到付订单");
410 if (base.part != null) { 412 if (base.part != null) {
411 base.part.setVisibility(View.GONE); 413 base.part.setVisibility(View.GONE);
412 } 414 }
413 415
414 - }else if (status != null 416 + } else if (status != null
415 && OrderStutas.NOTPAYED.getValue().equals(status)) { 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 if (base.part != null) { 421 if (base.part != null) {
420 base.part.setVisibility(View.GONE); 422 base.part.setVisibility(View.GONE);
@@ -426,7 +428,7 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim @@ -426,7 +428,7 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim
426 } 428 }
427 429
428 if (Select == 1) { 430 if (Select == 1) {
429 - if (paystatus!=null&&paystatus.equals("CASHPAY")&&status != null 431 + if (paystatus != null && paystatus.equals("CASHPAY") && status != null
430 && OrderStutas.NOTPAYED.getValue().equals(status)) { 432 && OrderStutas.NOTPAYED.getValue().equals(status)) {
431 base.ticket_print.setText("收费确认"); 433 base.ticket_print.setText("收费确认");
432 base.ticket_print.setVisibility(View.VISIBLE); 434 base.ticket_print.setVisibility(View.VISIBLE);
@@ -623,7 +625,7 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim @@ -623,7 +625,7 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim
623 Display display = manager.getDefaultDisplay(); 625 Display display = manager.getDefaultDisplay();
624 int width = display.getWidth(); 626 int width = display.getWidth();
625 627
626 - lp.width = DenstityUtils.dp2px(activity,300); 628 + lp.width = DenstityUtils.dp2px(activity, 300);
627 lp.height = ActionBar.LayoutParams.WRAP_CONTENT; 629 lp.height = ActionBar.LayoutParams.WRAP_CONTENT;
628 dialog.getWindow().setAttributes(lp); 630 dialog.getWindow().setAttributes(lp);
629 631
@@ -758,7 +760,7 @@ public class ReportExpandableListAdapter extends AnimatedExpandableListView.Anim @@ -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 dialog.dismiss(); 764 dialog.dismiss();
763 } 765 }
764 766