|
|
@@ -62,8 +62,7 @@ public class ContentAdapter extends RecyclerView.Adapter<ContentAdapter.ItemView
|
|
|
this.onContentScrollListener = onContentScrollListener;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- public ContentAdapter(Context context, String listType,String type) {
|
|
|
+ public ContentAdapter(Context context, String listType, String type) {
|
|
|
this.context = context;
|
|
|
this.listType = listType;
|
|
|
this.type = type;
|
|
|
@@ -74,18 +73,18 @@ public class ContentAdapter extends RecyclerView.Adapter<ContentAdapter.ItemView
|
|
|
notifyDataSetChanged();
|
|
|
}
|
|
|
|
|
|
- private void setOnItemClick(int position){
|
|
|
+ private void setOnItemClick(int position) {
|
|
|
List<ContractData> newDataList = new ArrayList<>();
|
|
|
- for (int i = 0;i < datas.size();i++){
|
|
|
- if (position == i){
|
|
|
+ for (int i = 0; i < datas.size(); i++) {
|
|
|
+ if (position == i) {
|
|
|
ContractData data1 = datas.get(i);
|
|
|
- if (data1.isOnClick() == 0){
|
|
|
+ if (data1.isOnClick() == 0) {
|
|
|
data1.setOnClick(1);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
data1.setOnClick(0);
|
|
|
}
|
|
|
newDataList.add(data1);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
ContractData newData = datas.get(i);
|
|
|
newData.setOnClick(0);
|
|
|
newDataList.add(newData);
|
|
|
@@ -129,85 +128,85 @@ public class ContentAdapter extends RecyclerView.Adapter<ContentAdapter.ItemView
|
|
|
}
|
|
|
if (listType.equals("1")) {//待点价列表
|
|
|
itemViewHolder.contract_hedges.setVisibility(View.VISIBLE);
|
|
|
- if (type.equals("1")){//采购
|
|
|
- if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots","client_spots_purchase","client_spots_purchase_point","client_spots_purchase_point_point")){
|
|
|
+ if (type.equals("1")) {//采购
|
|
|
+ if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots", "client_spots_purchase", "client_spots_purchase_point", "client_spots_purchase_point_point")) {
|
|
|
itemViewHolder.midpoints_registration.setVisibility(View.VISIBLE);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
itemViewHolder.midpoints_registration.setVisibility(View.GONE);
|
|
|
}
|
|
|
|
|
|
- }else {//销售
|
|
|
- if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots","client_spots_sales","client_spots_sales_point","client_spots_sales_point_point")){
|
|
|
+ } else {//销售
|
|
|
+ if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots", "client_spots_sales", "client_spots_sales_point", "client_spots_sales_point_point")) {
|
|
|
itemViewHolder.midpoints_registration.setVisibility(View.VISIBLE);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
itemViewHolder.midpoints_registration.setVisibility(View.GONE);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} else if (listType.equals("2")) {//履约结算
|
|
|
- if (type.equals("1")){//采购
|
|
|
- if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots","client_spots_purchase","client_spots_purchase_settle","client_spots_purchase_settle_inwarehouse")){//出入库登记
|
|
|
+ if (type.equals("1")) {//采购
|
|
|
+ if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots", "client_spots_purchase", "client_spots_purchase_settle", "client_spots_purchase_settle_inwarehouse")) {//出入库登记
|
|
|
itemViewHolder.warehouse_register.setVisibility(View.VISIBLE);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
itemViewHolder.warehouse_register.setVisibility(View.GONE);
|
|
|
}
|
|
|
- if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots","client_spots_purchase","client_spots_purchase_settle","client_spots_purchase_settle_invoice")){//发票登记
|
|
|
+ if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots", "client_spots_purchase", "client_spots_purchase_settle", "client_spots_purchase_settle_invoice")) {//发票登记
|
|
|
itemViewHolder.invoice_register.setVisibility(View.VISIBLE);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
itemViewHolder.invoice_register.setVisibility(View.GONE);
|
|
|
}
|
|
|
- if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots","client_spots_purchase","client_spots_purchase_settle","client_spots_purchase_settle_money")){//发票登记//款项登记
|
|
|
+ if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots", "client_spots_purchase", "client_spots_purchase_settle", "client_spots_purchase_settle_money")) {//发票登记//款项登记
|
|
|
itemViewHolder.payment_registration.setVisibility(View.VISIBLE);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
itemViewHolder.payment_registration.setVisibility(View.GONE);
|
|
|
}
|
|
|
- if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots","client_spots_purchase","client_spots_purchase_settle","client_spots_purchase_settle_delvery")){//发票登记//结算登记
|
|
|
+ if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots", "client_spots_purchase", "client_spots_purchase_settle", "client_spots_purchase_settle_delvery")) {//发票登记//结算登记
|
|
|
itemViewHolder.settlement_of_registration.setVisibility(View.VISIBLE);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
itemViewHolder.settlement_of_registration.setVisibility(View.GONE);
|
|
|
}
|
|
|
- if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots","client_spots_purchase","client_spots_purchase_settle","client_spots_purchase_settle_finish")){//完结合同
|
|
|
+ if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots", "client_spots_purchase", "client_spots_purchase_settle", "client_spots_purchase_settle_finish")) {//完结合同
|
|
|
itemViewHolder.contract_completion.setVisibility(View.VISIBLE);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
itemViewHolder.contract_completion.setVisibility(View.GONE);
|
|
|
}
|
|
|
- }else {//销售
|
|
|
- if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots","client_spots_sales","client_spots_sales_settle","client_spots_sales_settle_outwarehouse")){//出入库登记
|
|
|
+ } else {//销售
|
|
|
+ if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots", "client_spots_sales", "client_spots_sales_settle", "client_spots_sales_settle_outwarehouse")) {//出入库登记
|
|
|
//出入库登记
|
|
|
itemViewHolder.warehouse_register.setVisibility(View.VISIBLE);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
itemViewHolder.warehouse_register.setVisibility(View.GONE);
|
|
|
}
|
|
|
- if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots","client_spots_sales","client_spots_sales_settle","client_spots_sales_settle_invoice")){//出入库登记
|
|
|
+ if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots", "client_spots_sales", "client_spots_sales_settle", "client_spots_sales_settle_invoice")) {//出入库登记
|
|
|
//发票登记
|
|
|
itemViewHolder.invoice_register.setVisibility(View.VISIBLE);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
itemViewHolder.invoice_register.setVisibility(View.GONE);
|
|
|
}
|
|
|
- if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots","client_spots_sales","client_spots_sales_settle","client_spots_sales_settle_money")){//出入库登记
|
|
|
+ if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots", "client_spots_sales", "client_spots_sales_settle", "client_spots_sales_settle_money")) {//出入库登记
|
|
|
//款项登记
|
|
|
itemViewHolder.payment_registration.setVisibility(View.VISIBLE);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
itemViewHolder.payment_registration.setVisibility(View.GONE);
|
|
|
}
|
|
|
- if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots","client_spots_sales","client_spots_sales_settle","client_spots_sales_settle_delivery")){//出入库登记
|
|
|
+ if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots", "client_spots_sales", "client_spots_sales_settle", "client_spots_sales_settle_delivery")) {//出入库登记
|
|
|
//结算登记
|
|
|
itemViewHolder.settlement_of_registration.setVisibility(View.VISIBLE);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
itemViewHolder.settlement_of_registration.setVisibility(View.GONE);
|
|
|
}
|
|
|
//完结合同
|
|
|
- if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots","client_spots_sales","client_spots_sales_settle","client_spots_sales_settle_finish")){//完结合同
|
|
|
+ if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots", "client_spots_sales", "client_spots_sales_settle", "client_spots_sales_settle_finish")) {//完结合同
|
|
|
itemViewHolder.contract_completion.setVisibility(View.VISIBLE);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
itemViewHolder.contract_completion.setVisibility(View.GONE);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- if (type.equals("1")){
|
|
|
+ if (type.equals("1")) {
|
|
|
itemViewHolder.warehouse_register.setText("入库登记");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
itemViewHolder.warehouse_register.setText("出库登记");
|
|
|
}
|
|
|
itemViewHolder.all_click_View.setOnClickListener(new View.OnClickListener() {
|
|
|
@@ -264,25 +263,25 @@ public class ContentAdapter extends RecyclerView.Adapter<ContentAdapter.ItemView
|
|
|
});
|
|
|
itemViewHolder.contract_completion.setOnClickListener(view -> {
|
|
|
Intent intent = new Intent();
|
|
|
- intent.putExtra("type","4");
|
|
|
- intent.putExtra("data",datas.get(i));
|
|
|
+ intent.putExtra("type", "4");
|
|
|
+ intent.putExtra("data", datas.get(i));
|
|
|
intent.setClass(context, ContractDetailsActivity.class);
|
|
|
ActivityUtils.startActivity(intent);
|
|
|
});
|
|
|
//套保交易
|
|
|
itemViewHolder.contract_hedges.setOnClickListener(view -> {
|
|
|
Intent intent = new Intent();
|
|
|
- intent.putExtra("goodsId",data.getGoodsid());
|
|
|
- intent.putExtra("outGoodsCode",data.getGoodscode());
|
|
|
- intent.putExtra("contractData",data);
|
|
|
+ intent.putExtra("goodsId", data.getGoodsid());
|
|
|
+ intent.putExtra("outGoodsCode", data.getGoodscode());
|
|
|
+ intent.putExtra("contractData", data);
|
|
|
intent.setClass(context, GoodsTradeActivity.class);
|
|
|
ActivityUtils.startActivity(intent);
|
|
|
});
|
|
|
itemViewHolder.details.setOnClickListener(view -> {
|
|
|
Intent intent = new Intent();
|
|
|
intent.putExtra("data", datas.get(i));
|
|
|
- intent.putExtra("isFrom","1");
|
|
|
- intent.putExtra("type",this.type);
|
|
|
+ intent.putExtra("isFrom", "1");
|
|
|
+ intent.putExtra("type", this.type);
|
|
|
intent.setClass(context, ContractDetailActivity.class);
|
|
|
context.startActivity(intent);
|
|
|
});
|