diff --git a/app/src/main/java/com/example/beijing_daxing/CheckActivity.java b/app/src/main/java/com/example/beijing_daxing/CheckActivity.java index 7eafca5..f985146 100644 --- a/app/src/main/java/com/example/beijing_daxing/CheckActivity.java +++ b/app/src/main/java/com/example/beijing_daxing/CheckActivity.java @@ -71,7 +71,7 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP // // } // }); - initRequest(); + initRequest(getIntent().getIntExtra("id",0)); inputDialog = new InPutDialog(this); inputDialog.setInPutDialogCall(this); tagList = new ArrayList<>(); @@ -80,8 +80,10 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP } // 初始化数据 - private void initRequest() { - OkGo.post(url + "/xj/select").params("user", SharedPreferencesUtils.getstring("user", "")).execute(new MyRecultCall(dialog, this) { + private void initRequest(int id) { + OkGo.post(url + "/xj/select") + .params("id", id) + .execute(new MyRecultCall(dialog, this) { @Override public void onSuccess(Response response) { super.onSuccess(response); diff --git a/app/src/main/java/com/example/beijing_daxing/CheckListActivity.java b/app/src/main/java/com/example/beijing_daxing/CheckListActivity.java index 7367da4..63410b6 100644 --- a/app/src/main/java/com/example/beijing_daxing/CheckListActivity.java +++ b/app/src/main/java/com/example/beijing_daxing/CheckListActivity.java @@ -2,15 +2,20 @@ package com.example.beijing_daxing; import androidx.appcompat.app.AppCompatActivity; import androidx.databinding.DataBindingUtil; +import androidx.databinding.ObservableBoolean; +import android.annotation.SuppressLint; +import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Toast; import com.example.beijing_daxing.adapter.CheckListAdapter; +import com.example.beijing_daxing.base.AdapterClickCall; import com.example.beijing_daxing.base.BaseActivity; import com.example.beijing_daxing.base.MyRecultCall; import com.example.beijing_daxing.base.MyResult; +import com.example.beijing_daxing.been.CheckTaskInfo; import com.example.beijing_daxing.been.Stock; import com.example.beijing_daxing.databinding.ActivityCheckListBinding; import com.example.beijing_daxing.uitls.SharedPreferencesUtils; @@ -21,15 +26,43 @@ import com.uhf.api.cls.Reader; import java.util.List; -public class CheckListActivity extends BaseActivity { - private CheckListAdapter checkListAdapter; - +public class CheckListActivity extends BaseActivity implements AdapterClickCall { + private CheckListAdapter adapter; + private List list; + private ObservableBoolean createState; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ActivityCheckListBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_check_list); - checkListAdapter = new CheckListAdapter(this); - binding.setAdapter(checkListAdapter); + adapter = new CheckListAdapter(this,this); + + binding.setAdapter(adapter); + createState=new ObservableBoolean(); + createState.set(false); + binding.setState(createState); + initRequest(); + } + + private void initRequest() { + OkGo.post(url+"/inspection/selectTask") + .params("user", SharedPreferencesUtils.getstring("user", "")) + .execute(new MyRecultCall(dialog, this) { + @SuppressLint("NotifyDataSetChanged") + @Override + public void onSuccess(Response response) { + super.onSuccess(response); + MyResult body = response.body(); + if (body.getCode()==0){ + createState.set(false); + list=gson.fromJson(body.getData().toString(),new TypeToken>(){}.getType()); + adapter.setList(list); + adapter.notifyDataSetChanged(); + }else { + createState.set(true); + } + + } + }); } @Override @@ -46,18 +79,18 @@ public class CheckListActivity extends BaseActivity { super.onSuccess(response); var body = response.body(); if (body.getCode() == 0) { - // list = gson.fromJson(body.getData().toString(), new TypeToken>() { - // }.getType()); - // if (list == null || list.isEmpty()) { - // Toast.makeText(CheckActivity.this, "没有维护巡检区域", Toast.LENGTH_SHORT).show(); - // return; - // } - // adapter.setList(list); - // adapter.notifyDataSetChanged(); + initRequest(); return; } - // Toast.makeText(this, body.getMsg(), Toast.LENGTH_SHORT).show(); + Toast.makeText(CheckListActivity.this, body.getMsg(), Toast.LENGTH_SHORT).show(); } }); } + + @Override + public void clickItem(int index) { + Intent intent=new Intent(this,CheckActivity.class); + intent.putExtra("id",list.get(index).getId()); + startActivity(intent); + } } \ No newline at end of file diff --git a/app/src/main/java/com/example/beijing_daxing/HomePageActivity.java b/app/src/main/java/com/example/beijing_daxing/HomePageActivity.java index ba3f464..6e6a1c5 100644 --- a/app/src/main/java/com/example/beijing_daxing/HomePageActivity.java +++ b/app/src/main/java/com/example/beijing_daxing/HomePageActivity.java @@ -13,6 +13,7 @@ import android.view.View; import android.widget.AdapterView; import android.widget.Toast; +import com.example.beijing_daxing.adapter.CheckListAdapter; import com.example.beijing_daxing.adapter.HomePageAdapter; import com.example.beijing_daxing.base.MyApplication; import com.example.beijing_daxing.broadcast.MyNetWorkReceiver; @@ -74,12 +75,11 @@ public class HomePageActivity extends AppCompatActivity { list.add(new HomeIcon(R.mipmap.home_in1, "轮挡入库", InActivity.class)); list.add(new HomeIcon(R.mipmap.home_out1, "轮挡领用出库", OutActivity.class)); list.add(new HomeIcon(R.mipmap.home_store_check, "仓库盘点", StoreCheckActivity.class)); - list.add(new HomeIcon(R.mipmap.home_check, "轮挡巡检", CheckActivity.class)); - // list.add(new HomeIcon(R.mipmap.home_check, "轮挡巡检", OffLineCheckActivity.class)); + list.add(new HomeIcon(R.mipmap.home_check, "轮挡巡检", CheckListActivity.class)); list.add(new HomeIcon(R.mipmap.home_bf, "轮挡报废", BFActivity.class)); list.add(new HomeIcon(R.mipmap.home_in, "废品入库", FpInActivity.class)); list.add(new HomeIcon(R.mipmap.home_out, "废品出库", FpOutActivity.class)); - // list.add(new HomeIcon(R.mipmap.home_out, "功率设置", FpOutActivity.class)); + list.add(new HomeIcon(R.mipmap.home_out, "功率设置", SetingPowerActivity.class)); var intent = getIntent(); try { if (!intent.getStringExtra("user").equals("admin")) { diff --git a/app/src/main/java/com/example/beijing_daxing/InActivity.java b/app/src/main/java/com/example/beijing_daxing/InActivity.java index 1c69c1d..a0c8d66 100644 --- a/app/src/main/java/com/example/beijing_daxing/InActivity.java +++ b/app/src/main/java/com/example/beijing_daxing/InActivity.java @@ -20,6 +20,7 @@ import com.example.beijing_daxing.base.MyRecultCall; import com.example.beijing_daxing.base.MyResult; import com.example.beijing_daxing.been.InStoreSelectBody; import com.example.beijing_daxing.databinding.ActivityInBinding; +import com.example.beijing_daxing.uitls.HexAscii; import com.example.beijing_daxing.uitls.SharedPreferencesUtils; import com.example.beijing_daxing.vm.InStoreVM; import com.lzy.okgo.OkGo; @@ -36,6 +37,7 @@ public class InActivity extends BaseActivity implements AdapterClickCall { private InStoreVM vm; private InAdapter adapter; private List epcList; + private List tagList; private ActivityInBinding binding; private ObservableBoolean checkState; @Override @@ -50,30 +52,25 @@ public class InActivity extends BaseActivity implements AdapterClickCall { adapter.setList(epcList); adapter.setAdapterClickCall(this); binding.setAdapter(adapter); - checkState=new ObservableBoolean(); binding.setCheckState(checkState); + tagList=new ArrayList<>(); } @Override protected void onResume() { super.onResume(); - setPower(33); + setPower(SharedPreferencesUtils.getInt("powerIn",33)); } @Override protected void sanRfid(List epcs) { - // Log.e("TAG", "sanRfid:" + epcs); - epcs.stream().forEach(t -> { var epc = Tools.Bytes2HexString(t.EpcId,t.EpcId.length); - - if (!epcList.contains(epc)) { - Log.e("TAG", "sanRfid:" + epc); - if (epc.substring(0,8).equals("53574C44")){ - epcList.add(epc); - } - } + if (!epc.substring(0,8).equals("53574C44")) return; + if (tagList.contains(epc)) return; + tagList.add(epc); + epcList.add(HexAscii.hex2Str(epc)); }); vm.setSanLength(epcList.size()); adapter.notifyDataSetChanged(); @@ -85,7 +82,6 @@ public class InActivity extends BaseActivity implements AdapterClickCall { @Override public void onSuccess(Response response) { super.onSuccess(response); - // Log.e("TAG", "onSuccess:" + );response.body() InStoreSelectBody inStoreSelectBody = gson.fromJson(response.body().getData().toString(), InStoreSelectBody.class); vm.initSelect(inStoreSelectBody.getBaseLocationList(), inStoreSelectBody.getBaseManufacturerList()); } @@ -94,6 +90,7 @@ public class InActivity extends BaseActivity implements AdapterClickCall { @Override public void clickItem(int index) { + tagList.remove(HexAscii.str2Hex(epcList.get(index))); epcList.remove(index); adapter.notifyDataSetChanged(); vm.setSanLength(epcList.size()); @@ -114,8 +111,6 @@ public class InActivity extends BaseActivity implements AdapterClickCall { if (response.body().getCode() == 0) { finish(); } - - } }); } diff --git a/app/src/main/java/com/example/beijing_daxing/OffLineCheckActivity.java b/app/src/main/java/com/example/beijing_daxing/OffLineCheckActivity.java deleted file mode 100644 index db1f329..0000000 --- a/app/src/main/java/com/example/beijing_daxing/OffLineCheckActivity.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.example.beijing_daxing; - -import androidx.annotation.NonNull; -import androidx.appcompat.app.AppCompatActivity; -import androidx.databinding.DataBindingUtil; -import androidx.databinding.ObservableBoolean; -import androidx.databinding.ViewDataBinding; - -import android.annotation.SuppressLint; -import android.os.Bundle; -import android.os.Handler; -import android.os.Message; -import android.view.View; -import android.widget.Toast; - -import com.example.beijing_daxing.adapter.StoreCheckAdapter; -import com.example.beijing_daxing.base.BaseActivity; -import com.example.beijing_daxing.been.RFIDLocation; -import com.example.beijing_daxing.been.Stock; -import com.example.beijing_daxing.databinding.ActivityOffLineCheckBinding; -import com.uhf.api.cls.Reader; - -import org.litepal.LitePal; - -import java.util.ArrayList; -import java.util.List; - -public class OffLineCheckActivity extends BaseActivity { - private StoreCheckAdapter checkAdapter; - private ObservableBoolean checkState; - private List list; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - ActivityOffLineCheckBinding binding; - binding = DataBindingUtil.setContentView(this, R.layout.activity_off_line_check); - checkState = new ObservableBoolean(); - binding.setCheckState(checkState); - /* var all = LitePal.findAll(RFIDLocation.class); - if (all == null || all.isEmpty()) { - Toast.makeText(this, "", Toast.LENGTH_SHORT).show(); - return; - }*/ - list = new ArrayList<>(); - // all.forEach(t -> { - // Stock stock = new Stock(); - // stock.setLocationCode(t.getLocationCode()); - // stock.setEpcCode(t.getEpcCode()); - // list.add(stock); - // }); - checkAdapter=new StoreCheckAdapter(this); - checkAdapter.setList(list); - checkAdapter = new StoreCheckAdapter(this); - binding.setAdapter(checkAdapter); - } - - @Override - protected void sanRfid(List epcs) { - - } - - public void offCheckRead(View view) { - var b = checkState.get(); - if (b) { - handler.removeCallbacks(runnable); - } else { - handler.postDelayed(runnable, 0); - } - checkState.set(!b); - } - - @SuppressLint("HandlerLeak") - private Handler handler = new Handler() { - @Override - public void handleMessage(@NonNull Message msg) { - super.handleMessage(msg); - } - }; - private Runnable runnable = new Runnable() { - @Override - public void run() { - // sendBroadcast(broadcastIntent); - sanEpc(); - handler.postDelayed(runnable, 1000); - } - }; -} \ No newline at end of file diff --git a/app/src/main/java/com/example/beijing_daxing/OutActivity.java b/app/src/main/java/com/example/beijing_daxing/OutActivity.java index 081b858..03afca6 100644 --- a/app/src/main/java/com/example/beijing_daxing/OutActivity.java +++ b/app/src/main/java/com/example/beijing_daxing/OutActivity.java @@ -1,6 +1,8 @@ package com.example.beijing_daxing; import androidx.databinding.DataBindingUtil; + +import android.annotation.SuppressLint; import android.os.Bundle; import android.view.View; import android.widget.Toast; @@ -11,6 +13,7 @@ import com.example.beijing_daxing.base.MyRecultCall; import com.example.beijing_daxing.base.MyResult; import com.example.beijing_daxing.databinding.ActivityOutBinding; import com.example.beijing_daxing.been.BaseLocation; +import com.example.beijing_daxing.uitls.HexAscii; import com.example.beijing_daxing.uitls.SharedPreferencesUtils; import com.example.beijing_daxing.vm.OutStoreVm; import com.google.gson.reflect.TypeToken; @@ -28,12 +31,14 @@ public class OutActivity extends BaseActivity implements AdapterClickCall { private InAdapter adapter; private OutStoreVm outVm; private List epcList; + private List tagList; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ActivityOutBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_out); adapter=new InAdapter(this); epcList=new ArrayList<>(); + tagList=new ArrayList<>(); adapter.setList(epcList); adapter.setAdapterClickCall(this); binding.setAdapter(adapter); @@ -45,23 +50,25 @@ public class OutActivity extends BaseActivity implements AdapterClickCall { @Override protected void onResume() { super.onResume(); - setPower(17); + setPower(SharedPreferencesUtils.getInt("powerOut",17)); } + @SuppressLint("NotifyDataSetChanged") @Override protected void sanRfid(List epcs) { - epcs.stream().forEach(t -> { + epcs.forEach(t -> { var epc = Tools.Bytes2HexString(t.EpcId,t.EpcId.length); - if (!epcList.contains(epc)) { - if (epc.substring(0,8).equals("53574C44")) { - epcList.add(epc); - } - } + if (!epc.startsWith("53574C44")) return; + if (tagList.contains(epc)) return; + tagList.add(epc); + epcList.add(HexAscii.hex2Str(epc)); }); adapter.notifyDataSetChanged(); } + @SuppressLint("NotifyDataSetChanged") @Override public void clickItem(int index) { + tagList.remove(index); epcList.remove(index); adapter.notifyDataSetChanged(); } diff --git a/app/src/main/java/com/example/beijing_daxing/SetingPowerActivity.java b/app/src/main/java/com/example/beijing_daxing/SetingPowerActivity.java index 4a09dda..0c78366 100644 --- a/app/src/main/java/com/example/beijing_daxing/SetingPowerActivity.java +++ b/app/src/main/java/com/example/beijing_daxing/SetingPowerActivity.java @@ -1,14 +1,47 @@ package com.example.beijing_daxing; import androidx.appcompat.app.AppCompatActivity; +import androidx.databinding.DataBindingUtil; +import androidx.databinding.ViewDataBinding; +import android.app.Activity; import android.os.Bundle; +import android.view.View; + +import com.example.beijing_daxing.databinding.ActivitySetingPowerBinding; +import com.example.beijing_daxing.uitls.SharedPreferencesUtils; +import com.example.beijing_daxing.vm.PowerData; public class SetingPowerActivity extends AppCompatActivity { + private PowerData powerData; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_seting_power); + ActivitySetingPowerBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_seting_power); + powerData = new PowerData(); + powerData.setPowerIn( SharedPreferencesUtils.getInt("powerIn",0)); + powerData.setPowerOut( SharedPreferencesUtils.getInt("powerOut",0)); + powerData.setPowerStockCheck( SharedPreferencesUtils.getInt("powerStoreCheck",0)); + powerData.setPowerCheck( SharedPreferencesUtils.getInt("powerCheck",0)); + powerData.setPowerScrap( SharedPreferencesUtils.getInt("powerScrap",0)); + powerData.setPowerScrapIn( SharedPreferencesUtils.getInt("powerScrapIn",0)); + powerData.setPowerScrapOut( SharedPreferencesUtils.getInt("powerScrapOut",0)); + + binding.setVm(powerData); + + } + + public void settingSeva(View view) { + SharedPreferencesUtils.putInt("powerIn", powerData.getPowerIn()); + SharedPreferencesUtils.putInt("powerOut", powerData.getPowerOut()); + SharedPreferencesUtils.putInt("powerStoreCheck", powerData.getPowerStockCheck()); + SharedPreferencesUtils.putInt("powerCheck", powerData.getPowerCheck()); + SharedPreferencesUtils.putInt("powerScrap", powerData.getPowerScrap()); + SharedPreferencesUtils.putInt("powerScrapIn", powerData.getPowerScrapIn()); + SharedPreferencesUtils.putInt("powerScrapOut", powerData.getPowerScrapOut()); + + finish(); + } } \ No newline at end of file diff --git a/app/src/main/java/com/example/beijing_daxing/StoreCheckActivity.java b/app/src/main/java/com/example/beijing_daxing/StoreCheckActivity.java index 92d4e01..78fa7b0 100644 --- a/app/src/main/java/com/example/beijing_daxing/StoreCheckActivity.java +++ b/app/src/main/java/com/example/beijing_daxing/StoreCheckActivity.java @@ -22,6 +22,7 @@ import com.example.beijing_daxing.base.MyResult; import com.example.beijing_daxing.been.InStoreSelectBody; import com.example.beijing_daxing.been.Stock; import com.example.beijing_daxing.databinding.ActivityStoreCheckBinding; +import com.example.beijing_daxing.uitls.HexAscii; import com.example.beijing_daxing.uitls.SharedPreferencesUtils; import com.google.gson.reflect.TypeToken; import com.lzy.okgo.OkGo; @@ -47,7 +48,6 @@ public class StoreCheckActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - binding = DataBindingUtil.setContentView(this, R.layout.activity_store_check); checkState = new ObservableBoolean(); binding.setCheckState(checkState); @@ -56,11 +56,12 @@ public class StoreCheckActivity extends BaseActivity { initRequest(); checkNumber=0; binding.setCheckNumber(checkNumber); - setPower(33); + setPower(SharedPreferencesUtils.getInt("powerStoreCheck",33)); } private List tagList; + @SuppressLint("NotifyDataSetChanged") @Override protected void sanRfid(List epcs) { if (tagList == null) return; @@ -70,9 +71,8 @@ public class StoreCheckActivity extends BaseActivity { return; } tagList.add(epc); - Log.e("TAG", "sanRfid:" + epc); var stock = new Stock(); - stock.setEpcCode(epc); + stock.setEpcCode(HexAscii.hex2Str(epc)); var index = list.indexOf(stock); if (index != -1) { list.get(index).setState("Y"); diff --git a/app/src/main/java/com/example/beijing_daxing/adapter/CheckListAdapter.java b/app/src/main/java/com/example/beijing_daxing/adapter/CheckListAdapter.java index 1952b75..e2269d6 100644 --- a/app/src/main/java/com/example/beijing_daxing/adapter/CheckListAdapter.java +++ b/app/src/main/java/com/example/beijing_daxing/adapter/CheckListAdapter.java @@ -1,17 +1,22 @@ package com.example.beijing_daxing.adapter; import android.content.Context; +import android.util.Log; import android.view.LayoutInflater; import android.view.ViewGroup; +import android.widget.TextView; +import androidx.databinding.BindingAdapter; import androidx.databinding.DataBindingUtil; import androidx.recyclerview.widget.RecyclerView; import com.example.beijing_daxing.BR; import com.example.beijing_daxing.R; import com.example.beijing_daxing.base.AdapterClickCall; +import com.example.beijing_daxing.been.CheckTaskInfo; import com.example.beijing_daxing.been.Stock; import com.example.beijing_daxing.databinding.ItemCheckBinding; +import com.example.beijing_daxing.databinding.ItemCheckListBinding; import java.util.List; @@ -21,30 +26,32 @@ import java.util.List; */ public class CheckListAdapter extends RecyclerView.Adapter { private Context context; - private List list; + private List list; private LayoutInflater inflater; private AdapterClickCall call; - public CheckListAdapter(Context context) { + public CheckListAdapter(Context context,AdapterClickCall call) { this.context = context; inflater = LayoutInflater.from(context); this.call=call; } - public void setList(List list) { + public void setList(List list) { this.list = list; } @Override public MyViewHoder onCreateViewHolder(ViewGroup parent, int viewType) { - ItemCheckBinding binding = DataBindingUtil.inflate(inflater, R.layout.item_check, parent, false); + ItemCheckListBinding binding = DataBindingUtil.inflate(inflater, R.layout.item_check_list, parent, false); return new MyViewHoder(binding); } @Override public void onBindViewHolder(MyViewHoder holder, int position) { var binding = holder.getBinding(); - binding.setVariable(BR.item,list.get(position)); - binding.itemCheckClick.setOnClickListener(v -> call.clickItem(position)); + binding.setVariable(BR.vm, list.get(position)); + binding.checkListStart.setOnClickListener(v -> call.clickItem(position)); + binding.executePendingBindings(); + } @Override @@ -53,15 +60,26 @@ public class CheckListAdapter extends RecyclerView.Adapter= 24) { img_uri = FileProvider.getUriForFile(this, "com.example.beijing_daxing", outputImage); - Log.e("TAG", "teke_photo1"+img_uri.toString() ); } else { img_uri = Uri.fromFile(outputImage); - Log.e("TAG", "teke_photo2" ); } - if ( - PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) - - ) { + if (PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA)) { Intent intent = new Intent("android.media.action.IMAGE_CAPTURE"); intent.putExtra(MediaStore.EXTRA_OUTPUT, img_uri); startActivityForResult(intent, CAMERA_PHOTO); @@ -188,30 +176,6 @@ public abstract class BaseActivity extends AppCompatActivity { protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { -/* - try { - Bitmap bitmap; - InputStream inputStream = getContentResolver().openInputStream(img_uri); - if (inputStream!= null) { - bitmap = BitmapFactory.decodeStream(inputStream); - FileOutputStream outputStream = new FileOutputStream(outputImage); - if (bitmap!= null) { - bitmap.compress(Bitmap.CompressFormat.JPEG, 70, outputStream); - takePhotoCall(outputImage, bitmap); - outputStream.close(); - } else { - Log.e("Error", "Bitmap is null after decoding."); - } - } else { - Log.e("Error", "InputStream is null."); - } - } catch (IOException e) { - Log.e("Error", "Error reading or writing file.", e); - } - -*/ - - Bitmap bitmap = null; try { Log.e("TAG", "onActivityResult:" + img_uri.getPath()); diff --git a/app/src/main/java/com/example/beijing_daxing/been/CheckTaskInfo.java b/app/src/main/java/com/example/beijing_daxing/been/CheckTaskInfo.java new file mode 100644 index 0000000..b1441ee --- /dev/null +++ b/app/src/main/java/com/example/beijing_daxing/been/CheckTaskInfo.java @@ -0,0 +1,62 @@ +package com.example.beijing_daxing.been; + +import androidx.databinding.BaseObservable; + +public class CheckTaskInfo extends BaseObservable { + private int index; + private Long id; + private String locationCode; + private String areaName; + private String taskState; + + public String getTaskState() { + return taskState; + } + + public void setTaskState(String taskState) { + this.taskState = taskState; + } + + public int getIndex() { + return index; + } + + public void setIndex(int index) { + this.index = index; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getLocationCode() { + return locationCode; + } + + public void setLocationCode(String locationCode) { + this.locationCode = locationCode; + } + + public String getAreaName() { + return areaName; + } + + public void setAreaName(String areaName) { + this.areaName = areaName; + } + + @Override + public String toString() { + return "CheckTaskInfo{" + + "index=" + index + + ", id=" + id + + ", locationCode='" + locationCode + '\'' + + ", areaName='" + areaName + '\'' + + ", taskState='" + taskState + '\'' + + '}'; + } +} diff --git a/app/src/main/res/drawable/state_n_bg.xml b/app/src/main/res/drawable/state_n_bg.xml new file mode 100644 index 0000000..50c67dd --- /dev/null +++ b/app/src/main/res/drawable/state_n_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_check.xml b/app/src/main/res/layout/activity_check.xml index 20e6d1c..efc4466 100644 --- a/app/src/main/res/layout/activity_check.xml +++ b/app/src/main/res/layout/activity_check.xml @@ -137,7 +137,6 @@ android:layout_weight="1" android:backgroundTint="@{checkState?@color/yellow:@color/black}" android:onClick="offCheckRead" - android:visibility="gone" android:text='@{checkState?"停止读取":"开始扫描"}' android:textSize="20sp" /> diff --git a/app/src/main/res/layout/activity_check_list.xml b/app/src/main/res/layout/activity_check_list.xml index f54ec81..8a03dc5 100644 --- a/app/src/main/res/layout/activity_check_list.xml +++ b/app/src/main/res/layout/activity_check_list.xml @@ -7,6 +7,11 @@ + + + + + + + + @@ -90,6 +109,7 @@ android:layout_height="55dp" android:layout_margin="15dp" android:onClick="check_start" - android:text="开始巡检" /> + android:visibility="@{state?View.VISIBLE:View.GONE}" + android:text="创建巡检列表" /> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_off_line_check.xml b/app/src/main/res/layout/activity_off_line_check.xml index bb18ae5..4275979 100644 --- a/app/src/main/res/layout/activity_off_line_check.xml +++ b/app/src/main/res/layout/activity_off_line_check.xml @@ -20,47 +20,30 @@ android:orientation="vertical" tools:context=".OffLineCheckActivity"> - - - - - - -