排程编辑更新
This commit is contained in:
@@ -48,40 +48,21 @@ public class WaterDeviceEntity implements Serializable {
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Data
|
@Data
|
||||||
public static class DeviceListBean implements Serializable{
|
public static class DeviceListBean implements Serializable{
|
||||||
/**
|
private String id;
|
||||||
* id : 2056641699765178369
|
private String deviceNo;
|
||||||
* deviceNo : 1779176568237
|
private String userId;
|
||||||
* userId : 2056543507514097665
|
private String deviceName;
|
||||||
* deviceName : 40号设备
|
private Object deviceImg;
|
||||||
* deviceImg : null
|
private String status;
|
||||||
* 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 workStatus;
|
private String workStatus;
|
||||||
private Object powerLevelX;
|
private Object powerLevel;
|
||||||
private Object powerLevelUpdatatimeX;
|
private Object powerLevelUpdatatime;
|
||||||
private String wifiNameX;
|
private String wifiName;
|
||||||
private String wifiPasswordX;
|
private String wifiPassword;
|
||||||
private String deviceEmX;
|
private String deviceEm;
|
||||||
private String deviceSnX;
|
private String deviceSn;
|
||||||
private String fwVerX;
|
private String fwVer;
|
||||||
private String macAddressX;
|
private String macAddress;
|
||||||
private Object expirationTimeX;
|
private Object expirationTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public interface Request {
|
|||||||
|
|
||||||
//查询排程可绑定设备列表
|
//查询排程可绑定设备列表
|
||||||
@GET("app/v1/scheduleDeviceList/{id}")
|
@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}")
|
@GET("app/v1/schedule/{id}")
|
||||||
|
|||||||
@@ -42,10 +42,10 @@ public class BindDeviceFragment extends BaseFragment<PlanBindDeviceLayoutBinding
|
|||||||
@Override
|
@Override
|
||||||
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
||||||
mAdapter.toggleSelection(position);
|
mAdapter.toggleSelection(position);
|
||||||
if(mDeviceList.get(position).getStatusX().equals("0")){
|
if(mDeviceList.get(position).getStatus().equals("0")){
|
||||||
mDeviceList.get(position).setStatusX("1");
|
mDeviceList.get(position).setStatus("1");
|
||||||
}else{
|
}else{
|
||||||
mDeviceList.get(position).setStatusX("0");
|
mDeviceList.get(position).setStatus("0");
|
||||||
}
|
}
|
||||||
// syncSelectedDevices();
|
// syncSelectedDevices();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ public class BindDeviceAdapter extends BaseQuickAdapter<WaterDeviceEntity.Device
|
|||||||
@Override
|
@Override
|
||||||
protected void convert(BaseViewHolder helper, WaterDeviceEntity.DeviceListBean item) {
|
protected void convert(BaseViewHolder helper, WaterDeviceEntity.DeviceListBean item) {
|
||||||
CheckBox checkBox = helper.getView(R.id.radio);
|
CheckBox checkBox = helper.getView(R.id.radio);
|
||||||
helper.setText(R.id.tv_device_name, item.getDeviceNameX());
|
helper.setText(R.id.tv_device_name, item.getDeviceName());
|
||||||
helper.setText(R.id.tv_device_serial, item.getDeviceSnX());
|
helper.setText(R.id.tv_device_serial, item.getDeviceSn());
|
||||||
checkBox.setChecked(mSelectedPositions.contains(helper.getLayoutPosition()));
|
checkBox.setChecked(mSelectedPositions.contains(helper.getLayoutPosition()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -144,13 +144,13 @@ public class WaterPlanImpl implements WaterPlanContract.DataModel{
|
|||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.unsubscribeOn(Schedulers.io())
|
.unsubscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Observer<BaseBean<WaterDeviceEntity.DeviceListBean>>() {
|
.subscribe(new Observer<BaseBean<WaterDeviceEntity>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(@NonNull BaseBean<WaterDeviceEntity.DeviceListBean> bean) {
|
public void onNext(@NonNull BaseBean<WaterDeviceEntity> bean) {
|
||||||
if (bean.getCode() == 200) {
|
if (bean.getCode() == 200) {
|
||||||
callBack.success(bean.getData(),0);
|
callBack.success(bean.getData(),0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user