|
@@ -103,6 +103,9 @@ public class TallyMainActivity extends BaseActivity implements StoJNI.ScanCallB
|
|
|
@BindView(R.id.mt_send_way)
|
|
|
MarqueeTextView mtSendWay;
|
|
|
|
|
|
+ @BindView(R.id.mt_pallet_type)
|
|
|
+ MarqueeTextView mtPalletType;
|
|
|
+
|
|
|
@BindView(R.id.mt_putin_qty)
|
|
|
MarqueeTextView mtPutinQty;
|
|
|
|
|
@@ -796,7 +799,6 @@ public class TallyMainActivity extends BaseActivity implements StoJNI.ScanCallB
|
|
|
try {
|
|
|
String number = item.has("tracking_number")?item.getString("tracking_number"):"";
|
|
|
helper.setText(R.id.tv_number,number);
|
|
|
- helper.getView(R.id.ib_clear).setVisibility(View.GONE);
|
|
|
} catch (Exception e) {
|
|
|
XLog.e("列表赋值错误",e);
|
|
|
e.printStackTrace();
|
|
@@ -813,9 +815,85 @@ public class TallyMainActivity extends BaseActivity implements StoJNI.ScanCallB
|
|
|
mAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
|
|
|
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
|
|
recyclerView.setAdapter(mAdapter);
|
|
|
+ mAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
+ final int finalPosition = position;
|
|
|
+ new AlertDialog.Builder(mContext)
|
|
|
+ .setTitle(R.string.dl_hint)
|
|
|
+ .setMessage("确定要删除?")
|
|
|
+ .setNegativeButton(R.string.str_submit, new DialogInterface.OnClickListener() {
|
|
|
+ @RequiresApi(api = Build.VERSION_CODES.KITKAT)
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialogInterface, int i) {
|
|
|
+ cancelScanTracking(finalPosition);
|
|
|
+ }
|
|
|
+ }).setPositiveButton(R.string.str_cancel, new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialogInterface, int i) {
|
|
|
+ //取消不做操作
|
|
|
+
|
|
|
+ }
|
|
|
+ }).show();
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 取消扫描
|
|
|
+ * @param position
|
|
|
+ */
|
|
|
+ private void cancelScanTracking(int position){
|
|
|
+ try {
|
|
|
+ if (tallyDataList==null || tallyDataList.size()==0){
|
|
|
+ showWarningToast("暂无数据");
|
|
|
+ mAdapter.setEmptyView(emptyView);
|
|
|
+ mAdapter.notifyDataSetChanged();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ JSONObject itemObject = tallyDataList.get(position);
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("tracking_number",itemObject.getString("tracking_number"));
|
|
|
+ jsonObject.put("pallet_code",etContainerCode.getText().toString().trim());
|
|
|
+
|
|
|
+ if (!checkRepeat(Urls.FXY_PICTURE_CANCEL_SCAN_TRACKING+(jsonObject.toString()))){
|
|
|
+ Toast.makeText(mContext, getString(R.string.error_data_processed), Toast.LENGTH_LONG).show();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ OkGo.<String>post(Urls.getServiceAddress(mContext) + Urls.FXY_PICTURE_CANCEL_SCAN_TRACKING).upJson(jsonObject)
|
|
|
+ .execute(new MyDialogCallback(mContext, true, true) {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(Response<String> response) {
|
|
|
+ super.onSuccess(response);
|
|
|
+ try {
|
|
|
+ ActionBean bean = JsonUtil.getObject(response.body(), ActionBean.class);
|
|
|
+
|
|
|
+ JSONObject result = new JSONObject();
|
|
|
+ if (bean.data!=null && !bean.data.isEmpty() && !bean.data.equals("[]")){
|
|
|
+ result = new JSONObject(bean.data);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(bean.code == 1){
|
|
|
+ setPageViewData(result);
|
|
|
+ }else{
|
|
|
+ showWarningToast(bean.msg);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ showEmptyView("托盘信息解析错误:"+e.getMessage());
|
|
|
+ XLog.e("删除出库解析错误",e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }catch (Exception e){
|
|
|
+ XLog.e("删除出库错误:"+e.getMessage(),e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 显示
|
|
|
* @param str
|
|
@@ -828,18 +906,19 @@ public class TallyMainActivity extends BaseActivity implements StoJNI.ScanCallB
|
|
|
try {
|
|
|
String send_way = "";
|
|
|
String putin_qty = "";
|
|
|
+ String pallet_type = "";
|
|
|
if (jsonObject.has("list")){
|
|
|
String listStr = jsonObject.getString("list");
|
|
|
+ tallyDataList.clear();
|
|
|
if ( !listStr.isEmpty() && !listStr.equals("[]")){
|
|
|
- tallyDataList.clear();
|
|
|
JSONArray jsonArray = new JSONArray(listStr);
|
|
|
for (int i = 0;i < jsonArray.length(); i++){
|
|
|
JSONObject tallyObject = jsonArray.getJSONObject(i);
|
|
|
tallyDataList.add(tallyObject);
|
|
|
}
|
|
|
- mAdapter.setNewData(tallyDataList);
|
|
|
- mAdapter.notifyDataSetChanged();
|
|
|
}
|
|
|
+ mAdapter.setNewData(tallyDataList);
|
|
|
+ mAdapter.notifyDataSetChanged();
|
|
|
}
|
|
|
if (jsonObject.has("send_way")){
|
|
|
send_way = jsonObject.getString("send_way");
|
|
@@ -848,7 +927,11 @@ public class TallyMainActivity extends BaseActivity implements StoJNI.ScanCallB
|
|
|
putin_qty = String.valueOf(jsonObject.getInt("qty"));
|
|
|
}
|
|
|
|
|
|
+ if (jsonObject.has("pallet_type")){
|
|
|
+ pallet_type = jsonObject.getString("pallet_type");
|
|
|
+ }
|
|
|
mtSendWay.setText(send_way);
|
|
|
+ mtPalletType.setText(pallet_type);
|
|
|
mtPutinQty.setText(putin_qty);
|
|
|
|
|
|
if (jsonObject.has("hold_remark") && !jsonObject.getString("hold_remark").isEmpty()){
|
|
@@ -879,6 +962,7 @@ public class TallyMainActivity extends BaseActivity implements StoJNI.ScanCallB
|
|
|
llHoldRemark.setVisibility(View.GONE);
|
|
|
mtContainerCode.setText("");
|
|
|
mtSendWay.setText("");
|
|
|
+ mtPalletType.setText("");
|
|
|
mtPutinQty.setText("");
|
|
|
mtHoldRemark.setText("");
|
|
|
etContainerCode.setText("");
|