排程编辑更新

This commit is contained in:
fengjignqi
2026-05-26 17:41:27 +08:00
parent 9ab6d134ab
commit f2b8062398
5 changed files with 23 additions and 42 deletions

View File

@@ -48,40 +48,21 @@ public class WaterDeviceEntity implements Serializable {
@NoArgsConstructor
@Data
public static class DeviceListBean implements Serializable{
/**
* id : 2056641699765178369
* deviceNo : 1779176568237
* userId : 2056543507514097665
* deviceName : 40号设备
* deviceImg : null
* status : 0
* workStatus : 0
* powerLevel : null
* powerLevelUpdatatime : null
* wifiName : 橙空科技WiFi
* wifiPassword : 12321212
* deviceEm : 213123123123
* deviceSn : sdfsd32423gdfgdf3
* fwVer : fwVer-56565644
* macAddress : 2E:8H:00:KK:N7
* expirationTime : null
*/
private String idX;
private String deviceNoX;
private String userIdX;
private String deviceNameX;
private Object deviceImgX;
private String statusX;
private String id;
private String deviceNo;
private String userId;
private String deviceName;
private Object deviceImg;
private String status;
private String workStatus;
private Object powerLevelX;
private Object powerLevelUpdatatimeX;
private String wifiNameX;
private String wifiPasswordX;
private String deviceEmX;
private String deviceSnX;
private String fwVerX;
private String macAddressX;
private Object expirationTimeX;
private Object powerLevel;
private Object powerLevelUpdatatime;
private String wifiName;
private String wifiPassword;
private String deviceEm;
private String deviceSn;
private String fwVer;
private String macAddress;
private Object expirationTime;
}
}

View File

@@ -83,7 +83,7 @@ public interface Request {
//查询排程可绑定设备列表
@GET("app/v1/scheduleDeviceList/{id}")
Observable<BaseBean<WaterDeviceEntity.DeviceListBean>> getPlanBindDeviceList(@HeaderMap Map<String, String> headMap, @Path("id") String id);
Observable<BaseBean<WaterDeviceEntity>> getPlanBindDeviceList(@HeaderMap Map<String, String> headMap, @Path("id") String id);
//查询排程详情
@GET("app/v1/schedule/{id}")

View File

@@ -42,10 +42,10 @@ public class BindDeviceFragment extends BaseFragment<PlanBindDeviceLayoutBinding
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
mAdapter.toggleSelection(position);
if(mDeviceList.get(position).getStatusX().equals("0")){
mDeviceList.get(position).setStatusX("1");
if(mDeviceList.get(position).getStatus().equals("0")){
mDeviceList.get(position).setStatus("1");
}else{
mDeviceList.get(position).setStatusX("0");
mDeviceList.get(position).setStatus("0");
}
// syncSelectedDevices();
}

View File

@@ -27,8 +27,8 @@ public class BindDeviceAdapter extends BaseQuickAdapter<WaterDeviceEntity.Device
@Override
protected void convert(BaseViewHolder helper, WaterDeviceEntity.DeviceListBean item) {
CheckBox checkBox = helper.getView(R.id.radio);
helper.setText(R.id.tv_device_name, item.getDeviceNameX());
helper.setText(R.id.tv_device_serial, item.getDeviceSnX());
helper.setText(R.id.tv_device_name, item.getDeviceName());
helper.setText(R.id.tv_device_serial, item.getDeviceSn());
checkBox.setChecked(mSelectedPositions.contains(helper.getLayoutPosition()));
}

View File

@@ -144,13 +144,13 @@ public class WaterPlanImpl implements WaterPlanContract.DataModel{
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseBean<WaterDeviceEntity.DeviceListBean>>() {
.subscribe(new Observer<BaseBean<WaterDeviceEntity>>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseBean<WaterDeviceEntity.DeviceListBean> bean) {
public void onNext(@NonNull BaseBean<WaterDeviceEntity> bean) {
if (bean.getCode() == 200) {
callBack.success(bean.getData(),0);
}