|
|
@ -53,6 +53,7 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
|
|
|
|
private long inspectionId;
|
|
|
|
private long inspectionId;
|
|
|
|
private int backIndex;
|
|
|
|
private int backIndex;
|
|
|
|
private String code;
|
|
|
|
private String code;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
@ -105,7 +106,7 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
|
|
|
|
Toast.makeText(CheckActivity.this, "没有维护巡检区域", Toast.LENGTH_SHORT).show();
|
|
|
|
Toast.makeText(CheckActivity.this, "没有维护巡检区域", Toast.LENGTH_SHORT).show();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}*/
|
|
|
|
}*/
|
|
|
|
binding.setListNumber(list.size()+"");
|
|
|
|
binding.setListNumber(list.size() + "");
|
|
|
|
list1 = new ArrayList<>();
|
|
|
|
list1 = new ArrayList<>();
|
|
|
|
adapter.setList(list1);
|
|
|
|
adapter.setList(list1);
|
|
|
|
// adapter.notifyDataSetChanged();
|
|
|
|
// adapter.notifyDataSetChanged();
|
|
|
@ -125,32 +126,18 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
|
|
|
|
public void sanRfid(List<Reader.TAGINFO> epcs) {
|
|
|
|
public void sanRfid(List<Reader.TAGINFO> epcs) {
|
|
|
|
epcs.forEach(t -> {
|
|
|
|
epcs.forEach(t -> {
|
|
|
|
var epc = Tools.Bytes2HexString(t.EpcId, t.EpcId.length);
|
|
|
|
var epc = Tools.Bytes2HexString(t.EpcId, t.EpcId.length);
|
|
|
|
try {
|
|
|
|
if (!tagList.contains(epc)) {
|
|
|
|
if (!epc.substring(0,8).equals("53574C44")) return;
|
|
|
|
tagList.add(epc);
|
|
|
|
}catch (Exception e){
|
|
|
|
String s = HexAscii.hex2Str(epc);
|
|
|
|
return;
|
|
|
|
var stock = new Stock();
|
|
|
|
}
|
|
|
|
stock.setEpcCode(s);
|
|
|
|
|
|
|
|
stock.setLocationCode(code);
|
|
|
|
if (tagList.contains(epc)) {
|
|
|
|
stock.setState("正常");
|
|
|
|
return;
|
|
|
|
list1.add(stock);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tagList.add(epc);
|
|
|
|
|
|
|
|
String s = HexAscii.hex2Str(epc);
|
|
|
|
|
|
|
|
var stock = new Stock();
|
|
|
|
|
|
|
|
stock.setEpcCode(s);
|
|
|
|
|
|
|
|
stock.setLocationCode(code);
|
|
|
|
|
|
|
|
stock.setState("正常");
|
|
|
|
|
|
|
|
list1.add(stock);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// var stock = new Stock();
|
|
|
|
|
|
|
|
// stock.setEpcCode(HexAscii.hex2Str(epc));
|
|
|
|
|
|
|
|
// var index = list.indexOf(stock);
|
|
|
|
|
|
|
|
// if (index != -1) {
|
|
|
|
|
|
|
|
// list.get(index).setState("正常");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
adapter.notifyDataSetChanged();
|
|
|
|
adapter.notifyDataSetChanged();
|
|
|
|
binding.setSanNumber(list1.size()+"");
|
|
|
|
binding.setSanNumber(list1.size() + "");
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -159,7 +146,7 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
|
|
|
|
// var type = list.stream().anyMatch(t -> t.getState().equals("未检"));
|
|
|
|
// var type = list.stream().anyMatch(t -> t.getState().equals("未检"));
|
|
|
|
// if (type) {
|
|
|
|
// if (type) {
|
|
|
|
// 数量必须相同
|
|
|
|
// 数量必须相同
|
|
|
|
if (list.size()>list1.size()&&files.size()==0) {
|
|
|
|
if (list.size() > list1.size() && files.size() == 0) {
|
|
|
|
Toast.makeText(this, "未检完全部轮挡,不允许提交", Toast.LENGTH_SHORT).show();
|
|
|
|
Toast.makeText(this, "未检完全部轮挡,不允许提交", Toast.LENGTH_SHORT).show();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -167,19 +154,19 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
|
|
|
|
.params("json", gson.toJson(list1))
|
|
|
|
.params("json", gson.toJson(list1))
|
|
|
|
.params("inspectionId", inspectionId)
|
|
|
|
.params("inspectionId", inspectionId)
|
|
|
|
.params("user", SharedPreferencesUtils.getstring("user", ""))
|
|
|
|
.params("user", SharedPreferencesUtils.getstring("user", ""))
|
|
|
|
.params("locationCode",code)
|
|
|
|
.params("locationCode", code)
|
|
|
|
.addFileParams("files", files).execute(new MyRecultCall(dialog, this) {
|
|
|
|
.addFileParams("files", files).execute(new MyRecultCall(dialog, this) {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onSuccess(Response<MyResult> response) {
|
|
|
|
public void onSuccess(Response<MyResult> response) {
|
|
|
|
super.onSuccess(response);
|
|
|
|
super.onSuccess(response);
|
|
|
|
Toast.makeText(CheckActivity.this, "提交成功", Toast.LENGTH_SHORT).show();
|
|
|
|
Toast.makeText(CheckActivity.this, "提交成功", Toast.LENGTH_SHORT).show();
|
|
|
|
Intent resultIntent = new Intent();
|
|
|
|
Intent resultIntent = new Intent();
|
|
|
|
resultIntent.putExtra("backIndex", backIndex);
|
|
|
|
resultIntent.putExtra("backIndex", backIndex);
|
|
|
|
files.forEach(File::delete);
|
|
|
|
files.forEach(File::delete);
|
|
|
|
setResult(RESULT_OK, resultIntent);
|
|
|
|
setResult(RESULT_OK, resultIntent);
|
|
|
|
finish();
|
|
|
|
finish();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 一条数据保存
|
|
|
|
// 一条数据保存
|
|
|
|
// public void check_stock(View view) {
|
|
|
|
// public void check_stock(View view) {
|
|
|
|