|
|
@@ -23,6 +23,9 @@ import com.huntersun.vkyes.etcopencard.project.api.MyRetrofit; |
|
|
|
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.tool.MyShared; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.utils.Constants; |
|
|
|
import com.blankj.utilcode.util.LogUtils; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.dialog.EnumListDialog; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.utils.SearchCarInfoUtils; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.view.CommonItemDecoration; |
|
|
@@ -44,7 +47,7 @@ import java.util.List; |
|
|
|
/** |
|
|
|
* |
|
|
|
* @ClassName: ProgressQueryActivity |
|
|
|
* @Description: 审核进度查询 |
|
|
|
* @Description: 售后订单查询 |
|
|
|
* @Author: lujin |
|
|
|
* @CreateDate: 2024/2/21 17:35 |
|
|
|
*/ |
|
|
@@ -55,7 +58,7 @@ public class ProgressQueryActivity extends AppActivity implements StatusAction, |
|
|
|
|
|
|
|
private String plateNum = "";//车牌号码 |
|
|
|
private String colorNum = "";//车牌颜色 |
|
|
|
private String businessType = "NULL";//审核进度业务类型 |
|
|
|
private String businessType = "NULL";//售后订单类型 |
|
|
|
private String status = "NULL";//审核进度状态 |
|
|
|
private String chooseTime; |
|
|
|
private String endTime; |
|
|
@@ -190,11 +193,11 @@ public class ProgressQueryActivity extends AppActivity implements StatusAction, |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//业务类型选择 |
|
|
|
//业务类型选择 - 改为售后订单类型 |
|
|
|
binding.lyChooseBusiness.setOnClickListener(new View.OnClickListener() { |
|
|
|
@Override |
|
|
|
public void onClick(View view) { |
|
|
|
EnumListDialog.showEnumListSingleDialog(ProgressQueryActivity.this, EnumBean.BUSINESS_PROGRESS_TYPE, new EnumListDialog.OnResultCallback() { |
|
|
|
EnumListDialog.showEnumListSingleDialog(ProgressQueryActivity.this, EnumBean.BUSINESS_AFTER_SALE_TYPE, new EnumListDialog.OnResultCallback() { |
|
|
|
@Override |
|
|
|
public void onResultCallback(String code, String name) { |
|
|
|
binding.tvBusiness.setText(name); |
|
|
@@ -239,31 +242,61 @@ public class ProgressQueryActivity extends AppActivity implements StatusAction, |
|
|
|
list.clear(); |
|
|
|
} |
|
|
|
HashMap<String,String> params = new HashMap<>(); |
|
|
|
|
|
|
|
// 根据新接口要求调整参数 |
|
|
|
params.put("accessToken", MyShared.getInstance().get(MyShared.ACCESSTOKEN, "") + ""); // 登录token |
|
|
|
params.put("loginSource", Constants.LOGIN_SOURCE); // 登录来源 |
|
|
|
params.put("staffId", MyShared.getInstance().get(MyShared.STAFFID, "") + ""); // 员工ID |
|
|
|
|
|
|
|
// 车牌号处理 - 如果有车牌号,需要转换为vehicleId |
|
|
|
if (plateNum.trim().length()>0){ |
|
|
|
if (colorNum.length()>0){ |
|
|
|
params.put("vehiclePlate",plateNum); |
|
|
|
params.put("vehiclePlateColor",colorNum); |
|
|
|
// 这里需要根据实际业务逻辑将车牌号和颜色转换为vehicleId |
|
|
|
// 暂时直接使用车牌号作为vehicleId |
|
|
|
params.put("vehicleId", plateNum + "_" + colorNum); |
|
|
|
}else { |
|
|
|
toast("请选择车牌颜色"); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 订单类型 |
|
|
|
if (!"NULL".equals(businessType)){ |
|
|
|
params.put("orderType",businessType); |
|
|
|
} |
|
|
|
if (!"NULL".equals(status)){ |
|
|
|
params.put("status",status); |
|
|
|
} |
|
|
|
params.put("startTime",chooseTime+" 00:00:00"); |
|
|
|
params.put("endTime",endTime+" 23:59:59"); |
|
|
|
params.put("orderStatus","NORMAL"); |
|
|
|
params.put("pageNo",pageNo+""); |
|
|
|
params.put("pageSize",pageSize+""); |
|
|
|
|
|
|
|
// 分页参数 |
|
|
|
params.put("pageNo", String.valueOf(pageNo)); |
|
|
|
params.put("pageSize", String.valueOf(pageSize)); |
|
|
|
|
|
|
|
// 打印请求参数 - 分段打印避免超长截断 |
|
|
|
printLongJson("售后订单查询", "请求参数", JSONObject.toJSONString(params)); |
|
|
|
LogUtils.i("售后订单查询", "接口代码: " + IFCode.IFCODE_QUERYPROGRESS); |
|
|
|
|
|
|
|
MyRetrofit.newInstanceGZ(this,true, IFCode.IFCODE_QUERYPROGRESS, params, new MyRetrofit.ReturnResult() { |
|
|
|
@Override |
|
|
|
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { |
|
|
|
LinkedTreeMap<String,Object> data = JSONObject.parseObject(resultBean.getData().toString(),LinkedTreeMap.class); |
|
|
|
List<ResultBean.BizContent> result = JSONArray.parseArray(data.get("result").toString(), ResultBean.BizContent.class); |
|
|
|
|
|
|
|
// 打印接口返回结果 - 分段打印避免超长截断 |
|
|
|
printLongJson("售后订单查询", "接口返回结果", JSONObject.toJSONString(result)); |
|
|
|
LogUtils.i("售后订单查询", "总条数: " + data.get("totalCount").toString()); |
|
|
|
LogUtils.i("售后订单查询", "当前页: " + pageNo); |
|
|
|
LogUtils.i("售后订单查询", "每页条数: " + pageSize); |
|
|
|
|
|
|
|
// 打印第一条数据的详细信息,用于调试字段映射 |
|
|
|
if (result.size() > 0) { |
|
|
|
ResultBean.BizContent firstItem = result.get(0); |
|
|
|
LogUtils.i("售后订单查询", "第一条数据详情:"); |
|
|
|
LogUtils.i("售后订单查询", " orderType: " + firstItem.getOrderType()); |
|
|
|
LogUtils.i("售后订单查询", " orderStep: " + firstItem.getOrderStep()); |
|
|
|
LogUtils.i("售后订单查询", " status: " + firstItem.getStatus()); |
|
|
|
LogUtils.i("售后订单查询", " vehiclePlate: " + firstItem.getVehiclePlate()); |
|
|
|
} |
|
|
|
|
|
|
|
printLongJson("售后订单查询", "完整响应数据", JSONObject.toJSONString(data)); |
|
|
|
|
|
|
|
if (result.size()>0){ |
|
|
|
if (list.size()<Integer.parseInt(data.get("totalCount").toString())){ |
|
|
|
list.addAll(result); |
|
|
@@ -279,6 +312,8 @@ public class ProgressQueryActivity extends AppActivity implements StatusAction, |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onError() { |
|
|
|
// 打印错误信息 - 参照系统现有打印方式 |
|
|
|
LogUtils.e("售后订单查询", "接口请求失败"); |
|
|
|
MyRetrofit.ReturnResult.super.onError(); |
|
|
|
binding.smartFresh.finishLoadMore(); |
|
|
|
binding.smartFresh.finishRefresh(); |
|
|
@@ -297,8 +332,9 @@ public class ProgressQueryActivity extends AppActivity implements StatusAction, |
|
|
|
protected void convert(@NonNull BaseViewHolder holder, ResultBean.BizContent bizContent) { |
|
|
|
holder.setText(R.id.text1,bizContent.getVehiclePlate()); |
|
|
|
holder.setText(R.id.text2,EnumBean.backValue(bizContent.getVehiclePlateColor(),EnumBean.VEHICLE_COLOR)); |
|
|
|
holder.setText(R.id.text4,EnumBean.backValue(bizContent.status,EnumBean.PROGRESS_STATUS_TYPE)); |
|
|
|
holder.setText(R.id.text5,EnumBean.backValue(bizContent.orderType,EnumBean.BUSINESS_PROGRESS_TYPE)); |
|
|
|
// 使用orderStep字段显示状态,使用orderType字段显示业务类型 |
|
|
|
holder.setText(R.id.text4,EnumBean.backValue(bizContent.getOrderStep(),EnumBean.ASS_ORDER_STEP)); |
|
|
|
holder.setText(R.id.text5,EnumBean.backValue(bizContent.getOrderType(),EnumBean.ASS_ORDER_TYPE)); |
|
|
|
holder.setText(R.id.text6,bizContent.applyTime); |
|
|
|
LinearLayout layout = holder.getView(R.id.ly_item_detail); |
|
|
|
layout.setOnClickListener(new View.OnClickListener() { |
|
|
@@ -328,4 +364,32 @@ public class ProgressQueryActivity extends AppActivity implements StatusAction, |
|
|
|
pageNo = 1; |
|
|
|
getData(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 分段打印长JSON数据,避免日志被截断 |
|
|
|
* @param tag 日志标签 |
|
|
|
* @param message 消息前缀 |
|
|
|
* @param jsonData JSON数据 |
|
|
|
*/ |
|
|
|
private void printLongJson(String tag, String message, String jsonData) { |
|
|
|
if (jsonData == null || jsonData.isEmpty()) { |
|
|
|
LogUtils.i(tag, message + ": null"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// 如果数据长度小于4000字符,直接打印 |
|
|
|
if (jsonData.length() <= 4000) { |
|
|
|
LogUtils.i(tag, message + ": " + jsonData); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// 分段打印长数据 |
|
|
|
LogUtils.i(tag, message + " (分段打印):"); |
|
|
|
int maxLength = 3000; // 每段最大长度 |
|
|
|
for (int i = 0; i < jsonData.length(); i += maxLength) { |
|
|
|
int end = Math.min(i + maxLength, jsonData.length()); |
|
|
|
String segment = jsonData.substring(i, end); |
|
|
|
LogUtils.i(tag, "[" + (i / maxLength + 1) + "] " + segment); |
|
|
|
} |
|
|
|
} |
|
|
|
} |