diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 3518080771..4223f6d335 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -4,7 +4,7 @@ diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckResultData.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckResultData.java index be4a9d110c..1ecd01ae5a 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckResultData.java +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckResultData.java @@ -2,19 +2,337 @@ package com.mogo.eagle.core.function.check.net; import com.mogo.commons.data.BaseData; +import java.util.ArrayList; +import java.util.List; + /** * @author liujing * @description 描述 * @since: 8/13/21 */ public class CheckResultData extends BaseData { - public Data data; + private Data data; + private boolean success; + + public Data getData() { + return data; + } + + public void setData(Data data) { + this.data = data; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + @Override + public String toString() { + return "CheckResultData{" + + "data=" + data + + ", success=" + success + + '}'; + } public static class Data { - public vehicle mVehicle; + private Vehicle vehicle; + private List soft; + private List devices; + + // + public Vehicle getVehicle() { + return vehicle; + } + + public void setVehicle(Vehicle vehicle) { + this.vehicle = vehicle; + } + + public List getSoft() { + return soft; + } + + public void setSoft(List soft) { + this.soft = soft; + } + + public List getDevices() { + return devices; + } + + public void setDevices(List devices) { + this.devices = devices; + } + + @Override + public String toString() { + return "Data{" + + "vehicle=" + vehicle + + ", soft=" + soft + + ", devices=" + devices + + '}'; + } } - public static class vehicle { + public static class Vehicle { + private String id; + private String sn; + private String vin; + private String carBrand; + private String carLicense; + private String carType; + private String userName; + private String userPhone; + private String carImage; + private double createTime; + private Integer state; + private Integer ipcState; + private Integer autoState; + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getSn() { + return sn; + } + + public void setSn(String sn) { + this.sn = sn; + } + + public String getVin() { + return vin; + } + + public void setVin(String vin) { + this.vin = vin; + } + + public String getCarBrand() { + return carBrand; + } + + public void setCarBrand(String carBrand) { + this.carBrand = carBrand; + } + + public String getCarLicense() { + return carLicense; + } + + public void setCarLicense(String carLicense) { + this.carLicense = carLicense; + } + + public String getCarType() { + return carType; + } + + public void setCarType(String carType) { + this.carType = carType; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getUserPhone() { + return userPhone; + } + + public void setUserPhone(String userPhone) { + this.userPhone = userPhone; + } + + public String getCarImage() { + return carImage; + } + + public void setCarImage(String carImage) { + this.carImage = carImage; + } + + public double getCreateTime() { + return createTime; + } + + public void setCreateTime(double createTime) { + this.createTime = createTime; + } + + public Integer getState() { + return state; + } + + public void setState(Integer state) { + this.state = state; + } + + public Integer getIpcState() { + return ipcState; + } + + public void setIpcState(Integer ipcState) { + this.ipcState = ipcState; + } + + public Integer getAutoState() { + return autoState; + } + + public void setAutoState(Integer autoState) { + this.autoState = autoState; + } + + @Override + public String toString() { + return "vehicle{" + + "id='" + id + '\'' + + ", sn='" + sn + '\'' + + ", vin='" + vin + '\'' + + ", carBrand='" + carBrand + '\'' + + ", carLicense='" + carLicense + '\'' + + ", carType='" + carType + '\'' + + ", userName='" + userName + '\'' + + ", userPhone='" + userPhone + '\'' + + ", carImage='" + carImage + '\'' + + ", createTime='" + createTime + '\'' + + ", state='" + state + '\'' + + ", ipcState='" + ipcState + '\'' + + ", autoState='" + autoState + '\'' + + '}'; + } } + + public static class SoftItem { + private String name; + private String stateValue; + private List items; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Object getStateValue() { + return stateValue; + } + + public void setStateValue(String stateValue) { + this.stateValue = stateValue; + } + + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + @Override + public String toString() { + return "soft{" + + "name='" + name + '\'' + + ", stateValue=" + stateValue + + ", items=" + items + + '}'; + } + } + + public static class DevicesItem { + private String name; + private String stateValue; + private ArrayList items; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Object getStateValue() { + return stateValue; + } + + public void setStateValue(String stateValue) { + this.stateValue = stateValue; + } + + public ArrayList getItems() { + return items; + } + + public void setItems(ArrayList items) { + this.items = items; + } + + @Override + public String toString() { + return "devices{" + + "name='" + name + '\'' + + ", stateValue=" + stateValue + + ", items=" + items + + '}'; + } + } + + + public static class ItemClass { + private String name; + private String stateValue; + private ArrayList items; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Object getStateValue() { + return stateValue; + } + + public void setStateValue(String stateValue) { + this.stateValue = stateValue; + } + + public ArrayList getItems() { + return items; + } + + public void setItems(ArrayList items) { + this.items = items; + } + + @Override + public String toString() { + return "softItem{" + + "name='" + name + '\'' + + ", stateValue=" + stateValue + + ", items=" + items + + '}'; + } + } + } diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckActivity.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckActivity.java index 9cc6cea3ef..bc925c03d8 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckActivity.java +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckActivity.java @@ -25,7 +25,6 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig; import com.mogo.commons.data.BaseData; import com.mogo.commons.network.ParamsProvider; import com.mogo.commons.network.SubscribeImpl; -import com.mogo.commons.voice.AIAssist; import com.mogo.eagle.core.function.call.check.CallerCheckManager; import com.mogo.eagle.core.function.check.R; import com.mogo.eagle.core.function.check.model.CheckItemInfo; @@ -34,18 +33,12 @@ import com.mogo.eagle.core.function.check.net.CheckResultData; import com.mogo.module.common.view.ImageViewClipBounds; import com.mogo.module.common.view.SpacesItemDecoration; import com.mogo.module.service.receiver.MogoReceiver; -import com.mogo.utils.CommonUtils; import com.mogo.utils.network.RequestOptions; -import com.mogo.utils.network.utils.GsonUtil; import com.mogo.utils.network.utils.NetworkStatusUtil; -import com.tencent.bugly.beta.Beta; -import com.tencent.bugly.beta.UpgradeInfo; import java.math.BigDecimal; import java.util.ArrayList; -import java.util.HashMap; import java.util.Map; -import java.util.concurrent.TimeUnit; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.schedulers.Schedulers; @@ -126,6 +119,30 @@ public class CheckActivity extends AppCompatActivity { return true; } + //网络请求,获取自车检测结果(工控机上报云端)append("sn", MoGoAiCloudClientConfig.getInstance().getSn()) + public static void loadDetail() { + final Map params = ParamsBuilder.of(false) + .append("sn", "X2020210915BEAEDAE69E1E745A")//测试代码 + .build(); + CheckApiServiceFactory.getDataApiService(context).loadMonitorDetail(params) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new SubscribeImpl(RequestOptions.create(context)) { + @Override + public void onSuccess(CheckResultData o) { + super.onSuccess(o); + Log.d(TAG, "车辆自检结果是:" + o.toString()); + } + + @Override + public void onError(String message, int code) { + Log.d(TAG, "车辆自检失败:" + "message:" + message + "code:" + code); + super.onError(message, code); + } + }); + + } + /** * 自动驾驶是否存在风险 */ @@ -242,30 +259,6 @@ public class CheckActivity extends AppCompatActivity { } } - //网络请求,获取自车检测结果(工控机上报云端)append("sn", MoGoAiCloudClientConfig.getInstance().getSn()) - public static void loadDetail() { - final Map params = ParamsBuilder.of(false) - .append("sn", "SNDFD05063")//测试代码 - .build(); - CheckApiServiceFactory.getDataApiService(context).loadMonitorDetail(params) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(new SubscribeImpl(RequestOptions.create(context)) { - @Override - public void onSuccess(CheckResultData o) { - super.onSuccess(o); - Log.d(TAG, "车辆自检结果是:" + o.toString()); - } - - @Override - public void onError(String message, int code) { - Log.d(TAG, "车辆自检失败:" + "message:" + message + "code:" + code); - super.onError(message, code); - } - }); - - } - public static void start(Context context) { Intent starter = new Intent(context, CheckActivity.class); context.startActivity(starter); diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckAdapter.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckAdapter.java index ae4b005ab2..7ed30862ac 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckAdapter.java +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckAdapter.java @@ -28,6 +28,7 @@ public class CheckAdapter extends RecyclerView.Adapter LayoutInflater mLayoutInflater; ArrayList dataArrayList; private Context mContext; + private CheckInfoListDialog mCheckInfoListDialog; public CheckAdapter(@NonNull Context context, @NonNull ArrayList checkArray) { mContext = context; @@ -135,29 +136,22 @@ public class CheckAdapter extends RecyclerView.Adapter @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { try { - Object list = dataArrayList.get(position); if (position == 0) { ((CheckTitleViewHolder) holder).errorImage.setImageResource(R.drawable.check_right); - - if (list instanceof ArrayList && ((ArrayList) list).size() > 0) { - CheckItemInfo item = (CheckItemInfo) ((ArrayList) list).get(0); - ((CheckTitleViewHolder) holder).mTextView.setText(item.getTitle()); - if (item.isUsual() == true) { - ((CheckTitleViewHolder) holder).errorImage.setImageResource(R.drawable.check_right); - } else { - ((CheckTitleViewHolder) holder).errorImage.setImageResource(R.drawable.check_wrong); - } - } } else if (position == 1) { ((CheckListViewHolder) holder).viewTitle.setText("硬件检测:"); ((CheckListViewHolder) holder).iconAuto.setOnClickListener(v -> { Log.d(TAG, "硬件检测结果:"); + mCheckInfoListDialog = new CheckInfoListDialog(mContext); + mCheckInfoListDialog.show(); + }); } else if (position == 2) { ((CheckListViewHolder) holder).viewTitle.setText("系统检测:"); ((CheckListViewHolder) holder).iconAuto.setOnClickListener(v -> { Log.d(TAG, "系统检测结果:"); - + mCheckInfoListDialog = new CheckInfoListDialog(mContext); + mCheckInfoListDialog.show(); }); } diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckListDialog.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoListDialog.java similarity index 81% rename from core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckListDialog.java rename to core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoListDialog.java index 9711fa4c4a..16b7ef64c6 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckListDialog.java +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoListDialog.java @@ -14,20 +14,20 @@ import com.mogo.module.common.dialog.BaseFloatDialog; * @description 描述 * @since: 9/22/21 */ -public class CheckListDialog extends BaseFloatDialog { +public class CheckInfoListDialog extends BaseFloatDialog { private RecyclerView mRecyclerView; private Context mContext; private int span; - public CheckListDialog(@NonNull Context context) { + public CheckInfoListDialog(@NonNull Context context) { super(context); mContext = context; initView(); } - public CheckListDialog(@NonNull Context context, int themeResId) { + public CheckInfoListDialog(@NonNull Context context, int themeResId) { super(context, themeResId); } @@ -37,7 +37,7 @@ public class CheckListDialog extends BaseFloatDialog { GridLayoutManager layoutManager = new GridLayoutManager(mContext, 4); //表示竖直显示.默认VERTICAL layoutManager.setOrientation(GridLayoutManager.HORIZONTAL); - mRecyclerView.addItemDecoration(new CheckListGridItem()); + mRecyclerView.addItemDecoration(new CheckInfoListGridItemDec()); mRecyclerView.setLayoutManager(layoutManager); findViewById(R.id.cancel_info_list_button).setOnClickListener(v -> { cancel(); diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckListGridItem.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoListGridItemDec.java similarity index 95% rename from core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckListGridItem.java rename to core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoListGridItemDec.java index 550a16330d..bc0b27e7be 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckListGridItem.java +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoListGridItemDec.java @@ -14,13 +14,13 @@ import androidx.recyclerview.widget.RecyclerView; * @description 描述 * @since: 9/22/21 */ -class CheckListGridItem extends RecyclerView.ItemDecoration { +class CheckInfoListGridItemDec extends RecyclerView.ItemDecoration { //分割线的宽度 private static final int DIVIDER_SIZE = 5; private final Paint mPaint = new Paint(); - public CheckListGridItem() { + public CheckInfoListGridItemDec() { init(); } diff --git a/core/function-impl/mogo-core-function-check/src/main/res/layout/check_list.xml b/core/function-impl/mogo-core-function-check/src/main/res/layout/check_list.xml index 1378233565..e8ab3ddfe3 100644 --- a/core/function-impl/mogo-core-function-check/src/main/res/layout/check_list.xml +++ b/core/function-impl/mogo-core-function-check/src/main/res/layout/check_list.xml @@ -31,7 +31,6 @@ android:layout_height="wrap_content" android:layout_marginLeft="@dimen/dp_318" android:layout_marginBottom="@dimen/dp_70" - android:clickable="true" android:descendantFocusability="blocksDescendants" android:orientation="vertical" app:layout_constraintBottom_toBottomOf="parent" @@ -43,8 +42,8 @@ android:layout_width="@dimen/dp_150" android:layout_height="@dimen/dp_150" android:layout_gravity="center" - android:clickable="true" - android:src="@drawable/auto" /> + android:src="@drawable/auto" + android:clickable="true"/>