@@ -53,6 +53,8 @@ public class MyRetrofit { | |||
// private final String BaseUrl = "http://192.168.100.63:8087/ifzt/api/"; //VPN访问请求地址 | |||
private final String FileUrl = "http://222.85.144.89:19003/ifzt/api/"; //文件服务 | |||
public static final String URL_DOWNLOAD_FILE = "http://192.168.100.63:8087/user-export-excel/";//通行流水下载路径前缀 | |||
private final String appId = "admin001"; | |||
private final String IFCODE = ""; | |||
private final String bizContent = ""; |
@@ -158,9 +158,9 @@ public class IFCode { | |||
public static final String IFCODE916 = "916"; //欠费补缴支付下单接口 | |||
public static final String IFCODE915 = "915"; //欠费补缴支付查询接口 | |||
public static final String IFCODEXX1 = "XX1"; //用户卡列表查询(等待提供) | |||
public static final String IFCODEXX2 = "XX2"; //用户通行流水统计(等待提供) | |||
public static final String IFCODEXX3 = "XX3"; //用户通行流水记录下载(等待提供) | |||
public static final String IFCODE152 = "152"; //用户卡列表查询 | |||
public static final String IFCODE_FLOWING_COUNT = "db62a6c55461498ab2f412868eea6d24"; //用户通行流水统计(等待提供) | |||
public static final String IFCODE_FLOWING_DOWNLOAD = "558c8a96265445c78b59b4473ad01d42"; //用户通行流水记录下载(等待提供) | |||
public static final String IFCODE925 = "925"; //车辆通行流水分页查询接口 | |||
public static final String IFCODE151 = "151"; //通过证件号 + 证件类型查询用户信息 |
@@ -251,6 +251,14 @@ public class ResultBean<T> { | |||
public List<BizContent> customers; //用户信息查询列表 | |||
public List<BizContent> vehicles; //车辆信息查询列表 | |||
public List<BizContent> transferLogs; //卡签列表 | |||
public List<BizContent> cards; //卡列表 | |||
public long passTotal; //通行合计 | |||
public long parkTotal; //停车合计 | |||
public long aggregateAmount; //总金额 | |||
public String DetailDownLoadURL; //下载 文件服务地址 | |||
public String cardType; //卡类型 | |||
public String tel; //用户手机 | |||
public boolean hasMore; //是否有更多数据 | |||
private String customerIdnum; | |||
private String customerIdtype; | |||
@@ -267,8 +275,10 @@ public class ResultBean<T> { | |||
public Long serviceFee; //服务金额 | |||
public String totalFee; //服务金额 + 消费金额 | |||
public String entolllaneName; //入口站名 | |||
public String enName; //入口站名 | |||
public String enTime; //入口站时间 | |||
public String extolllaneName; //出口站站名 | |||
public String exName; //出口站站名 | |||
public String exTime; //出口站时间 | |||
public String customerPosImgUrl; //开户人正面图片地址、营业执照 | |||
public String customerNegImgUrl; //开户人反面图片地址 |
@@ -5,29 +5,23 @@ import android.view.View; | |||
import android.widget.EditText; | |||
import com.alibaba.fastjson.JSON; | |||
import com.chad.library.adapter.base.BaseQuickAdapter; | |||
import com.huntersun.vkyes.etcopencard.databinding.ActivityCheckRunningWaterStep1Binding; | |||
import com.huntersun.vkyes.etcopencard.project.api.MyRetrofit; | |||
import com.huntersun.vkyes.etcopencard.project.api.Result; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.IFCode; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.ResultBean; | |||
import com.huntersun.vkyes.etcopencard.project.ui.adapter.BalanceReplacementAdapter; | |||
import com.huntersun.vkyes.etcopencard.project.ui.adapter.CheckRunningCardListAdapter; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper; | |||
import com.huntersun.vkyes.etcopencard.project.utils.SearchCarInfoUtils; | |||
import com.huntersun.vkyes.etcopencard.src.action.StatusAction; | |||
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
import com.huntersun.vkyes.etcopencard.src.other.CodeCountDown; | |||
import com.huntersun.vkyes.etcopencard.src.widget.StatusLayout; | |||
import com.scwang.smart.refresh.layout.api.RefreshLayout; | |||
import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; | |||
import org.jetbrains.annotations.NotNull; | |||
import java.util.ArrayList; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import androidx.annotation.NonNull; | |||
@@ -41,7 +35,6 @@ public class CheckRunningWaterStep1Activity extends AppActivity implements OnRef | |||
private ActivityCheckRunningWaterStep1Binding binding; | |||
private CheckRunningCardListAdapter adapter; | |||
private List<ResultBean.BizContent> list; | |||
private String curVehicleId; | |||
private EditText etSearch; | |||
@@ -53,10 +46,14 @@ public class CheckRunningWaterStep1Activity extends AppActivity implements OnRef | |||
@Override | |||
protected void initView() { | |||
list = new ArrayList<>(); | |||
adapter = new CheckRunningCardListAdapter(this, new CheckRunningCardListAdapter.OnItemClickListener() { | |||
@Override | |||
public void doItemClick(ResultBean.BizContent bizContent) { | |||
if (FunHelper.isEmpty(bizContent.tel)){ | |||
toast("获取用户手机号为空!"); | |||
return; | |||
} | |||
Bundle bundle = new Bundle(); | |||
bundle.putString("dataJson",JSON.toJSONString(bizContent)); | |||
jumpToPage(CheckRunningWaterStep2Activity.class,bundle); | |||
@@ -82,17 +79,16 @@ public class CheckRunningWaterStep1Activity extends AppActivity implements OnRef | |||
private void getList() { | |||
Map<String, String> params = new HashMap<>(); | |||
params.put("vehicleId", curVehicleId); | |||
MyRetrofit.newInstance(IFCode.IFCODE924, params, new MyRetrofit.ReturnResult() { | |||
MyRetrofit.newInstance(IFCode.IFCODE152, params, new MyRetrofit.ReturnResult() { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
FunHelper.closeKeyboard(etSearch); | |||
if (FunHelper.isEmpty(bizContent.getData())) { | |||
if (FunHelper.isEmpty(bizContent.cards)) { | |||
postDelayed(CheckRunningWaterStep1Activity.this::showEmpty, 300); | |||
return; | |||
} | |||
showComplete(); | |||
adapter.replaceData(bizContent.getData()); | |||
adapter.replaceData(bizContent.cards); | |||
} | |||
@Override |
@@ -40,7 +40,7 @@ public class CheckRunningWaterStep2Activity extends AppActivity { | |||
curBizContent = JSON.parseObject(json, ResultBean.BizContent.class); | |||
} | |||
binding.tvMobile.setText(FunHelper.isEmpty(curBizContent.getCustomerTel()) ? "" : curBizContent.getCustomerTel()); | |||
binding.tvMobile.setText(FunHelper.isEmpty(curBizContent.tel) ? "" : curBizContent.tel); | |||
binding.btnNext.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
@SingleClick | |||
@@ -69,7 +69,7 @@ public class CheckRunningWaterStep2Activity extends AppActivity { | |||
private void checkUser() { | |||
showDialog("用户校验中..."); | |||
Map<String, String> params = new HashMap<>(); | |||
params.put("mobile", curBizContent.getCustomerTel()); | |||
params.put("mobile", curBizContent.tel); | |||
params.put("code", FunHelper.getText(binding.etCode)); | |||
MyRetrofit.newInstance(IFCode.IFCODE966, params, new MyRetrofit.ReturnResult() { | |||
@Override | |||
@@ -84,11 +84,6 @@ public class CheckRunningWaterStep2Activity extends AppActivity { | |||
public void onError() { | |||
MyRetrofit.ReturnResult.super.onError(); | |||
hideDialog(); | |||
//TODO 测试 | |||
Bundle bundle = new Bundle(); | |||
bundle.putString("dataJson", JSON.toJSONString(curBizContent)); | |||
jumpToPage(CheckRunningWaterStep3Activity.class, bundle); | |||
} | |||
}); | |||
} | |||
@@ -99,7 +94,7 @@ public class CheckRunningWaterStep2Activity extends AppActivity { | |||
private void sendCode() { | |||
showDialog("发送中..."); | |||
Map<String, String> params = new HashMap<>(); | |||
params.put("mobile", curBizContent.getCustomerTel()); | |||
params.put("mobile", curBizContent.tel); | |||
MyRetrofit.newInstance(IFCode.IFCODE2, params, new MyRetrofit.ReturnResult() { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { |
@@ -7,6 +7,7 @@ import android.app.PendingIntent; | |||
import android.content.Intent; | |||
import android.graphics.BitmapFactory; | |||
import android.os.Build; | |||
import android.os.Bundle; | |||
import android.os.Environment; | |||
import android.view.View; | |||
import android.widget.TextView; | |||
@@ -30,6 +31,7 @@ import com.huntersun.vkyes.etcopencard.project.api.bean.IFCode; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.ResultBean; | |||
import com.huntersun.vkyes.etcopencard.project.dialog.ConfirmDialog; | |||
import com.huntersun.vkyes.etcopencard.project.tool.DateUtils; | |||
import com.huntersun.vkyes.etcopencard.project.tool.Utils; | |||
import com.huntersun.vkyes.etcopencard.project.ui.adapter.CheckRunningAdapter; | |||
import com.huntersun.vkyes.etcopencard.project.utils.Constants; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper; | |||
@@ -38,6 +40,8 @@ import com.huntersun.vkyes.etcopencard.src.aop.CheckNet; | |||
import com.huntersun.vkyes.etcopencard.src.aop.Permissions; | |||
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
import com.huntersun.vkyes.etcopencard.src.manager.ActivityManager; | |||
import com.huntersun.vkyes.etcopencard.src.ui.activity.LoginActivity; | |||
import com.huntersun.vkyes.etcopencard.src.ui.dialog.DateDialog; | |||
import com.huntersun.vkyes.etcopencard.src.widget.StatusLayout; | |||
import com.scwang.smart.refresh.layout.api.RefreshLayout; | |||
@@ -46,7 +50,9 @@ import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; | |||
import org.jetbrains.annotations.NotNull; | |||
import java.io.File; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import androidx.annotation.NonNull; | |||
import androidx.annotation.RequiresApi; | |||
@@ -71,6 +77,9 @@ public class CheckRunningWaterStep3Activity extends AppActivity implements OnRef | |||
//当前是否下载完毕 | |||
private boolean mDownloadComplete; | |||
//是否有下一页 | |||
private boolean hasMore; | |||
@Override | |||
protected View getLayoutView() { | |||
binding = ActivityCheckRunningWaterStep3Binding.inflate(getLayoutInflater()); | |||
@@ -94,8 +103,9 @@ public class CheckRunningWaterStep3Activity extends AppActivity implements OnRef | |||
binding.tvEndTime.setOnClickListener(this::initClick); | |||
binding.LLEndTime.setOnClickListener(this::initClick); | |||
binding.btnDownload.setOnClickListener(this::initClick); | |||
binding.btnCheck.setOnClickListener(this::initClick); | |||
binding.tvTotalFee.setText("金额合计:0"); | |||
binding.tvTotalFee.setText("金额合计:¥ 0"); | |||
binding.tvTotalPassNum.setText("通行次数:0"); | |||
binding.tvStopNum.setText("停车次数:0"); | |||
@@ -117,81 +127,122 @@ public class CheckRunningWaterStep3Activity extends AppActivity implements OnRef | |||
days = DateUtils.daysBetween(FunHelper.getText(binding.tvStartTime),time); | |||
} | |||
if (days > 62){ | |||
//TODO 测试 | |||
/*if (days > 62){ | |||
toast("最大查询月份只能为2个月"); | |||
return; | |||
} | |||
}*/ | |||
textView.setText(time); | |||
}).show(); | |||
} | |||
@Override | |||
protected void initData() { | |||
showLoading(); | |||
LoadData(); | |||
refreshList(); | |||
} | |||
@Override | |||
public StatusLayout getStatusLayout() { | |||
return binding.hlStatusHint; | |||
} | |||
@RequiresApi(api = Build.VERSION_CODES.M) | |||
@SingleClick | |||
private void initClick(View view) { | |||
if (view == binding.tvStartTime || view == binding.LLStartTime) { | |||
showTimeDialog(binding.tvStartTime,true); | |||
refreshList(); | |||
} else if (view == binding.tvEndTime || view == binding.LLEndTime) { | |||
showTimeDialog(binding.tvEndTime,false); | |||
refreshList(); | |||
} else if (view == binding.btnDownload) { | |||
String msg = "请确认是否下载" + bizContent.getCardId() + "卡在" + FunHelper.getText(binding.tvStartTime) + "~" + FunHelper.getText(binding.tvEndTime) + "时间内的通行流水?"; | |||
new ConfirmDialog.Builder(CheckRunningWaterStep3Activity.this).setMsg(msg, "下载提示", "确定", "取消", R.mipmap.icon_lotgout_etc_hint, 0, false) | |||
.onClick(new ConfirmDialog.Result() { | |||
@Override | |||
public void confirm() { | |||
downLoadExcel("http://cachefly.cachefly.net/100mb.test"); | |||
} | |||
}).show(); | |||
public void onLoadMore(@NonNull @NotNull RefreshLayout refreshLayout) { | |||
if (!hasMore) { | |||
binding.rlStatusRefresh.finishLoadMore(); | |||
return; | |||
} | |||
} | |||
@Override | |||
public void onLoadMore(@NonNull @NotNull RefreshLayout refreshLayout) { | |||
postDelayed(() -> { | |||
refreshList(); | |||
page = page + 1; | |||
loadData(); | |||
binding.rlStatusRefresh.finishLoadMore(); | |||
}, 1000); | |||
} | |||
@Override | |||
public void onRefresh(@NonNull @NotNull RefreshLayout refreshLayout) { | |||
postDelayed(() -> { | |||
page = 1; | |||
LoadData(); | |||
binding.rlStatusRefresh.finishRefresh(); | |||
refreshList(); | |||
}, 1000); | |||
} | |||
/** | |||
* 刷新数据 | |||
*/ | |||
private void refreshList() { | |||
page = page + 1; | |||
LoadData(); | |||
binding.rlStatusRefresh.finishLoadMore(); | |||
loadCountData(); | |||
page = 1; | |||
loadData(); | |||
binding.rlStatusRefresh.finishRefresh(); | |||
} | |||
/** | |||
* 账单合计接口 | |||
*/ | |||
private void loadCountData(){ | |||
showDialog("查询中..."); | |||
Map<String, String> params = new HashMap<>(); | |||
params.put("cardId", bizContent.getCardId()); | |||
params.put("starDate",FunHelper.getText(binding.tvStartTime)); | |||
params.put("endDate",FunHelper.getText(binding.tvEndTime)); | |||
MyRetrofit.newInstance(IFCode.IFCODE_FLOWING_COUNT, params, new MyRetrofit.ReturnResult() { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
hideDialog(); | |||
binding.tvTotalFee.setText("金额合计:¥" + FunHelper.changeF2Y(bizContent.aggregateAmount)); | |||
binding.tvTotalPassNum.setText("通行次数:" + bizContent.passTotal); | |||
binding.tvStopNum.setText("停车次数:" + bizContent.parkTotal); | |||
} | |||
@Override | |||
public void onError() { | |||
MyRetrofit.ReturnResult.super.onError(); | |||
hideDialog(); | |||
} | |||
}); | |||
} | |||
/** | |||
* 下载 | |||
*/ | |||
private void downloadData(){ | |||
showDialog("下载中..."); | |||
Map<String, String> params = new HashMap<>(); | |||
params.put("cardId", bizContent.getCardId()); | |||
params.put("starDate",FunHelper.getText(binding.tvStartTime)); | |||
params.put("endDate",FunHelper.getText(binding.tvEndTime)); | |||
MyRetrofit.newInstance(IFCode.IFCODE_FLOWING_DOWNLOAD, params, new MyRetrofit.ReturnResult() { | |||
@RequiresApi(api = Build.VERSION_CODES.M) | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
hideDialog(); | |||
LogUtils.e(">>>>>",JSON.toJSONString(bizContent)); | |||
if (!FunHelper.isEmpty(bizContent.DetailDownLoadURL)){ | |||
downLoadExcel(MyRetrofit.URL_DOWNLOAD_FILE + bizContent.DetailDownLoadURL); | |||
}else{ | |||
toast("下载链接不存在"); | |||
} | |||
} | |||
@Override | |||
public void onError() { | |||
MyRetrofit.ReturnResult.super.onError(); | |||
hideDialog(); | |||
} | |||
}); | |||
} | |||
/* 获取列表 */ | |||
private void LoadData() { | |||
private void loadData() { | |||
Parameters parameters = new Parameters(); | |||
parameters.setCardId(bizContent.getCardId()); | |||
parameters.setPageNo(String.valueOf(page)); | |||
parameters.setPageSize(Constants.pageSize); | |||
parameters.setCardId(bizContent.getCardId()); | |||
if (!FunHelper.isEmpty(FunHelper.getText(binding.tvStartTime))) { | |||
parameters.setBeforeDate(FunHelper.getText(binding.tvStartTime)); | |||
} | |||
if (!FunHelper.isEmpty(FunHelper.getText(binding.tvEndTime))) { | |||
parameters.setAfterDate(FunHelper.getText(binding.tvEndTime)); | |||
} | |||
RequestParameters parameters1 = new RequestParameters(IFCode.IFCODE925, new Gson().toJson(parameters)); | |||
if (page == 1) { | |||
showLoading(); | |||
@@ -201,21 +252,21 @@ public class CheckRunningWaterStep3Activity extends AppActivity implements OnRef | |||
@SuppressLint("NotifyDataSetChanged") | |||
@Override | |||
protected void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent1) { | |||
showComplete(); | |||
if (bizContent1.getData() == null) { | |||
postDelayed(CheckRunningWaterStep3Activity.this::showEmpty, 300); | |||
showEmpty(); | |||
return; | |||
} | |||
int pageSize = 10; | |||
int totalSize = Integer.parseInt(bizContent1.getTotalCount()); | |||
List<ResultBean.BizContent> list = bizContent1.getData(); | |||
hasMore = bizContent1.hasMore; | |||
if (page == 1) { | |||
adapter.replaceData(list); | |||
adapter.replaceData(bizContent1.getData()); | |||
} else { | |||
if (totalSize % pageSize == 0) { | |||
adapter.addData(list); | |||
if (!FunHelper.isEmpty(bizContent1.getData())){ | |||
adapter.addData(bizContent1.getData()); | |||
} | |||
} | |||
if (list.size() == 0 && page == 1) { | |||
if (FunHelper.isEmpty(bizContent1.getData()) && page == 1) { | |||
showEmpty(); | |||
} else { | |||
showComplete(); | |||
@@ -228,13 +279,35 @@ public class CheckRunningWaterStep3Activity extends AppActivity implements OnRef | |||
showError(new StatusLayout.OnRetryListener() { | |||
@Override | |||
public void onRetry(StatusLayout layout) { | |||
LoadData(); | |||
refreshList(); | |||
} | |||
}); | |||
} | |||
}); | |||
} | |||
@Override | |||
public StatusLayout getStatusLayout() { | |||
return binding.hlStatusHint; | |||
} | |||
@RequiresApi(api = Build.VERSION_CODES.M) | |||
@SingleClick | |||
private void initClick(View view) { | |||
if (view == binding.tvStartTime || view == binding.LLStartTime) { | |||
showTimeDialog(binding.tvStartTime,true); | |||
} else if (view == binding.tvEndTime || view == binding.LLEndTime) { | |||
showTimeDialog(binding.tvEndTime,false); | |||
} else if (view == binding.btnDownload) { | |||
String msg = "请确认是否下载" + bizContent.getCardId() + "卡在" + FunHelper.getText(binding.tvStartTime) + "~" + FunHelper.getText(binding.tvEndTime) + "时间内的通行流水?"; | |||
new Utils().showMessDialog(getActivity(), msg, dialog -> { | |||
downloadData(); | |||
}); | |||
}else if (view == binding.btnCheck){ | |||
refreshList(); | |||
} | |||
} | |||
/** | |||
* 下载 文件 | |||
*/ |
@@ -377,6 +377,7 @@ public class ReplaceEtcStep4Activity extends AppActivity { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
hideDialog(); | |||
//TODO 据说要改成只有一条 | |||
if (!FunHelper.isEmpty(bizContent.list)){ | |||
//永远获取最新一条 | |||
applyData = (ResultBean.BizContent) bizContent.list.get(bizContent.list.size() - 1); |
@@ -18,6 +18,7 @@ import com.huntersun.vkyes.etcopencard.project.api.bean.EnumBean; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.IFCode; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.ResultBean; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.SendTheVerificationCodeBean; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper; | |||
import com.huntersun.vkyes.etcopencard.src.action.StatusAction; | |||
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
@@ -38,6 +39,7 @@ import retrofit2.Response; | |||
public class ListDeliveryActivity extends AppActivity implements OnRefreshLoadMoreListener, StatusAction { | |||
private ActivityListDeliveryBinding binding; | |||
private int Page = 1; | |||
private boolean hasMore; | |||
@Override | |||
protected View getLayoutView() { | |||
@@ -59,6 +61,7 @@ public class ListDeliveryActivity extends AppActivity implements OnRefreshLoadMo | |||
@Override | |||
protected void initData() { | |||
if (Page == 1) hasMore = true; | |||
SendTheVerificationCodeBean bizContent = new SendTheVerificationCodeBean(); | |||
bizContent.setPageNo(Page); | |||
RequestParameters parameters = | |||
@@ -67,30 +70,25 @@ public class ListDeliveryActivity extends AppActivity implements OnRefreshLoadMo | |||
.enqueue(new Converter<Result>(this, "列表数据加载中...") { | |||
@Override | |||
protected void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
showComplete(); | |||
if (bizContent.getData() == null) { | |||
showEmpty(); | |||
return; | |||
} | |||
int pageSize = 10; // 每页的数据条数 | |||
int totalSize = Integer.parseInt(bizContent.getTotalCount()); // 获取总的数据条数 | |||
int pageCount = totalSize / pageSize; // 计算总页数 | |||
List<ResultBean.BizContent> list = bizContent.getData(); | |||
if (Page == 1) { | |||
adapter.replaceData(list); | |||
adapter.replaceData(bizContent.getData()); | |||
} else { | |||
if (totalSize % pageSize == 0) { | |||
adapter.addData(list); | |||
} else { | |||
toast("没有更多数据了!"); | |||
if (!FunHelper.isEmpty(bizContent.getData())){ | |||
adapter.addData(bizContent.getData()); | |||
} | |||
} | |||
if (list.size() == 0 && Page == 1) { | |||
if (FunHelper.isEmpty(bizContent.getData()) && Page == 1) { | |||
showEmpty(); | |||
} else { | |||
showComplete(); | |||
} | |||
if (adapter.getData().size() >= totalSize){ | |||
hasMore = false; | |||
}else{ | |||
hasMore = true; | |||
} | |||
} | |||
@Override | |||
@@ -138,6 +136,11 @@ public class ListDeliveryActivity extends AppActivity implements OnRefreshLoadMo | |||
@Override | |||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) { | |||
if (!hasMore) { | |||
binding.rlStatusRefresh.finishLoadMore(); | |||
return; | |||
} | |||
postDelayed(() -> { | |||
Page++; | |||
initData(); |
@@ -16,7 +16,7 @@ import androidx.annotation.NonNull; | |||
* Date :2023-03-17 | |||
* Description:通行流水查询adapter | |||
*/ | |||
public class CheckRunningAdapter extends BaseQuickAdapter<ResultBean.BizContent, BaseViewHolder>{ | |||
public class CheckRunningAdapter extends BaseQuickAdapter<ResultBean.BizContent, BaseViewHolder> { | |||
private Context mContext; | |||
public CheckRunningAdapter(Context mContext) { | |||
@@ -30,20 +30,24 @@ public class CheckRunningAdapter extends BaseQuickAdapter<ResultBean.BizContent, | |||
holder.setText(R.id.tvVehiclePlate, FunHelper.isEmpty(bizContent.getVehiclePlate()) ? "" : bizContent.getVehiclePlate()); | |||
holder.setText(R.id.tvEtcNum, FunHelper.isEmpty(bizContent.getCardId()) ? "" : bizContent.getCardId()); | |||
holder.setText(R.id.tvFee, "¥" + (FunHelper.changeF2Y(bizContent.fee))); | |||
holder.setText(R.id.tvServiceFee, "¥" + (FunHelper.changeF2Y(bizContent.serviceFee))); | |||
holder.setText(R.id.tvTotalFee, (FunHelper.changeF2Y(Long.parseLong(FunHelper.isEmpty(bizContent.totalFee) ? "0" : bizContent.totalFee)))); | |||
holder.setText(R.id.tvStartAddr,FunHelper.isEmpty(bizContent.entolllaneName) ? "" : bizContent.entolllaneName); | |||
holder.setText(R.id.tvEndAddr,FunHelper.isEmpty(bizContent.extolllaneName) ? "" : bizContent.extolllaneName); | |||
if (!FunHelper.isEmpty(bizContent.enTime)){//入站时间 | |||
String[] times = bizContent.enTime.split("T"); | |||
holder.setText(R.id.tvStartTime,FunHelper.isEmpty(times[1]) ? "00:00" : times[1]); | |||
holder.setText(R.id.tvDate,FunHelper.isEmpty(times[0]) ? "0000-00-00" : times[0]); | |||
holder.setText(R.id.tvServiceFee, "¥ 0.00"); | |||
holder.setText(R.id.tvTotalFee,"¥" + FunHelper.changeF2Y(bizContent.fee) ); | |||
holder.setText(R.id.tvStartAddr, FunHelper.isEmpty(bizContent.enName) ? "" : bizContent.enName); | |||
holder.setText(R.id.tvEndAddr, FunHelper.isEmpty(bizContent.exName) ? "" : bizContent.exName); | |||
if (!FunHelper.isEmpty(bizContent.enTime)) {//入站时间 | |||
String[] times = bizContent.enTime.split(" "); | |||
if (times.length > 1) { | |||
holder.setText(R.id.tvStartTime, FunHelper.isEmpty(times[1]) ? "00:00" : times[1]); | |||
holder.setText(R.id.tvDate, FunHelper.isEmpty(times[0]) ? "0000-00-00" : times[0]); | |||
} | |||
} | |||
if (!FunHelper.isEmpty(bizContent.exTime)) {//出站时间 | |||
String[] times = bizContent.exTime.split("T"); | |||
holder.setText(R.id.tvEndTime, FunHelper.isEmpty(times[1]) ? "00:00" : times[1]); | |||
holder.setText(R.id.tvEndDate, FunHelper.isEmpty(times[0]) ? "0000-00-00" : times[0]); | |||
String[] times = bizContent.exTime.split(" "); | |||
if (times.length > 1) { | |||
holder.setText(R.id.tvEndTime, FunHelper.isEmpty(times[1]) ? "00:00" : times[1]); | |||
holder.setText(R.id.tvEndDate, FunHelper.isEmpty(times[0]) ? "0000-00-00" : times[0]); | |||
} | |||
} | |||
} | |||
@@ -20,6 +20,7 @@ import androidx.annotation.NonNull; | |||
public class CheckRunningCardListAdapter extends BaseQuickAdapter<ResultBean.BizContent, BaseViewHolder>{ | |||
private Context mContext; | |||
private OnItemClickListener listener; | |||
private ResultBean.BizContent beforeBean; | |||
public CheckRunningCardListAdapter(Context mContext,OnItemClickListener listener) { | |||
super(R.layout.layout_check_running_water_card_item); | |||
@@ -31,13 +32,25 @@ public class CheckRunningCardListAdapter extends BaseQuickAdapter<ResultBean.Biz | |||
protected void convert(@NonNull @NotNull BaseViewHolder holder, ResultBean.BizContent bizContent) { | |||
if (!FunHelper.isEmpty(bizContent.getCardStatus()) && bizContent.getCardStatus().equals("1")){ | |||
holder.setText(R.id.tvTitle,"正常卡信息"); | |||
//holder.setVisible(R.id.tvTitle,true); | |||
if (beforeBean != null && beforeBean.getCardStatus().equals("1")){ | |||
holder.setVisible(R.id.tvTitle,false); | |||
}else{ | |||
holder.setVisible(R.id.tvTitle,true); | |||
} | |||
}else{ | |||
holder.setText(R.id.tvTitle,"异常卡信息"); | |||
if (beforeBean != null && !beforeBean.getCardStatus().equals("1")){ | |||
holder.setVisible(R.id.tvTitle,false); | |||
}else{ | |||
holder.setVisible(R.id.tvTitle,true); | |||
} | |||
} | |||
holder.setText(R.id.tvCardId, FunHelper.isEmpty(bizContent.getCardId()) ? "" : bizContent.getCardId()); | |||
holder.setText(R.id.tvCardType, FunHelper.isEmpty(bizContent.getIsValueCard()) ? "" : (bizContent.getIsValueCard().equals("1") ? "记账卡" : "储值卡")); | |||
holder.setText(R.id.tvCardType, FunHelper.isEmpty(bizContent.cardType) ? "" : (bizContent.cardType.startsWith("1") ? "记账卡" : "储值卡")); | |||
holder.setText(R.id.tvCardStatus, FunHelper.isEmpty(bizContent.getCardStatus()) ? "" : (FunHelper.getETCStatusName(Integer.parseInt(bizContent.getCardStatus())))); | |||
beforeBean = bizContent; | |||
holder.setOnClickListener(R.id.btnNext, new View.OnClickListener() { | |||
@Override |
@@ -54,7 +54,6 @@ public class FragmentHomeTow extends TitleBarFragment<MainActivity> { | |||
{R.mipmap.card3, "充值圈存"}, | |||
{R.mipmap.card1, "卡签信息查询"}, | |||
{R.mipmap.card5, "卡签挂失/解挂"}, | |||
{R.mipmap.card6, "卡签挂起/解挂"}, | |||
{R.mipmap.card4, "卡签注销"}, | |||
{R.mipmap.card10, "更换卡签"}, | |||
{R.mipmap.card9, "储值卡转记账卡"}, | |||
@@ -82,7 +81,8 @@ public class FragmentHomeTow extends TitleBarFragment<MainActivity> { | |||
{R.mipmap.card7, "满意度评价"}, | |||
{R.mipmap.card18, "发票管理"}, | |||
{R.mipmap.card3, "卡签版本查询"}, | |||
{R.mipmap.card6, "公务车发行"},*/ | |||
{R.mipmap.card6, "公务车发行"}, | |||
{R.mipmap.card6, "卡签挂起/解挂"}, APP端 */ | |||
}; | |||
public static AppFragment<MainActivity> newInstance() { |
@@ -27,6 +27,7 @@ import com.huntersun.vkyes.etcopencard.project.ui.activity.order.OrderDetailsAct | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.MainActivity; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.order.OrderUtils; | |||
import com.huntersun.vkyes.etcopencard.project.utils.Constants; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper; | |||
import com.huntersun.vkyes.etcopencard.src.action.StatusAction; | |||
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppFragment; | |||
@@ -53,6 +54,7 @@ public class FragmentSonOne extends TitleBarFragment<MainActivity> | |||
private int page = 1; | |||
private int orderStep = 0; | |||
private String licensePlate; | |||
private boolean hasMore; | |||
public static AppFragment<MainActivity> newInstance(int start) { | |||
return new FragmentSonOne(start); | |||
@@ -132,6 +134,8 @@ public class FragmentSonOne extends TitleBarFragment<MainActivity> | |||
} | |||
public void LoadData() { | |||
if (page == 1 ) hasMore = true; | |||
List<String> list = null; | |||
Parameters parameters = new Parameters(); | |||
//0 - 全部 1 - 申办中 2 - 待发货 3 - 待激活 4 - 已完成 | |||
@@ -153,29 +157,25 @@ public class FragmentSonOne extends TitleBarFragment<MainActivity> | |||
@SuppressLint("NotifyDataSetChanged") | |||
@Override | |||
protected void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent1) { | |||
if (bizContent1.getData() == null) { | |||
postDelayed(FragmentSonOne.this::showEmpty, 300); | |||
return; | |||
} | |||
int pageSize = 10; // 每页的数据条数 | |||
int totalSize = Integer.parseInt(bizContent1.getTotalCount()); // 获取总的数据条数 | |||
int pageCount = totalSize / pageSize; // 计算总页数 | |||
List<ResultBean.BizContent> list = bizContent1.getData(); | |||
if (page == 1) { | |||
adapter.replaceData(list); | |||
adapter.replaceData(bizContent1.getData()); | |||
} else { | |||
if (totalSize % pageSize == 0) { | |||
adapter.addData(list); | |||
} else { | |||
toast("没有更多数据了!"); | |||
if (!FunHelper.isEmpty(bizContent1.getData())){ | |||
adapter.addData(bizContent1.getData()); | |||
} | |||
} | |||
if (list.size() == 0 && page == 1) { | |||
if (FunHelper.isEmpty(bizContent1.getData()) && page == 1) { | |||
showEmpty(); | |||
} else { | |||
showComplete(); | |||
} | |||
if (adapter.getData().size() >= totalSize){ | |||
hasMore = false; | |||
}else{ | |||
hasMore = true; | |||
} | |||
} | |||
@Override | |||
@@ -235,6 +235,11 @@ public class FragmentSonOne extends TitleBarFragment<MainActivity> | |||
@Override | |||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) { | |||
if (!hasMore) { | |||
binding.rlStatusRefresh.finishLoadMore(); | |||
return; | |||
} | |||
postDelayed(() -> { | |||
page = page + 1; | |||
LoadData(); |
@@ -1,9 +1,7 @@ | |||
package com.huntersun.vkyes.etcopencard.project.utils; | |||
import android.content.Context; | |||
import android.view.View; | |||
import android.view.animation.AnimationUtils; | |||
import android.view.inputmethod.InputMethodManager; | |||
import android.widget.Button; | |||
import android.widget.EditText; | |||
import android.widget.LinearLayout; | |||
@@ -115,6 +113,7 @@ public class SearchCarInfoUtils { | |||
btnYellowGreen.setOnClickListener(this::initClick); | |||
btnGreen.setOnClickListener(this::initClick); | |||
btnSearch.setOnClickListener(this::initClick); | |||
} | |||
private void initClick(View view) { |
@@ -174,6 +174,7 @@ | |||
android:layout_height="match_parent"> | |||
<com.scwang.smart.refresh.layout.SmartRefreshLayout | |||
android:id="@+id/rl_status_refresh" | |||
android:layout_marginBottom="@dimen/dp_65" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
app:srlEnablePreviewInEditMode="false"> | |||
@@ -181,7 +182,6 @@ | |||
<androidx.recyclerview.widget.RecyclerView | |||
android:id="@+id/recycler" | |||
style="@style/MatchMatch" | |||
android:layout_marginBottom="@dimen/dp_65" | |||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" | |||
tools:listitem="@layout/item_check_running_water" /> | |||
</com.scwang.smart.refresh.layout.SmartRefreshLayout> |
@@ -108,6 +108,7 @@ | |||
android:gravity="center"> | |||
<TextView | |||
android:id="@+id/tvStartAddr" | |||
android:maxWidth="@dimen/dp_80" | |||
style="@style/WrapWrap" | |||
android:textColor="@color/color_333333" | |||
android:textSize="@dimen/sp_15"/> | |||
@@ -150,6 +151,7 @@ | |||
<TextView | |||
android:id="@+id/tvEndAddr" | |||
style="@style/WrapWrap" | |||
android:maxWidth="@dimen/dp_80" | |||
android:textColor="@color/color_333333" | |||
android:textSize="@dimen/sp_15"/> | |||
@@ -139,6 +139,7 @@ | |||
<TextView | |||
android:id="@+id/tvStartAddr" | |||
style="@style/WrapWrap" | |||
android:maxWidth="@dimen/dp_80" | |||
android:textColor="@color/color_333333" | |||
android:textSize="@dimen/sp_15"/> | |||
@@ -172,6 +173,7 @@ | |||
<TextView | |||
android:id="@+id/tvEndAddr" | |||
style="@style/WrapWrap" | |||
android:maxWidth="@dimen/dp_80" | |||
android:textColor="@color/color_333333" | |||
android:textSize="@dimen/sp_15"/> | |||
@@ -25,6 +25,7 @@ | |||
android:id="@+id/tvStartAddr" | |||
style="@style/WrapWrap" | |||
android:text="贵阳西" | |||
android:maxWidth="@dimen/dp_80" | |||
android:textColor="@color/color_333333" | |||
android:textSize="@dimen/sp_15" /> | |||
@@ -57,6 +58,7 @@ | |||
<TextView | |||
android:id="@+id/tvEndAddr" | |||
style="@style/WrapWrap" | |||
android:maxWidth="@dimen/dp_80" | |||
android:text="贵阳西" | |||
android:textColor="@color/color_333333" | |||
android:textSize="@dimen/sp_15" /> |