|
@@ -26,8 +26,10 @@ import com.emato.ich.entity.vo.PreparedOrderVo;
|
|
|
import com.emato.ich.local.LocalStorage;
|
|
|
import com.emato.ich.utils.BaseUtils;
|
|
|
import com.emato.ich.utils.JacksonUtils;
|
|
|
+import com.emato.ich.utils.LoggingUtils;
|
|
|
import com.emato.ich.utils.StringUtils;
|
|
|
import com.emato.ich.utils.TimeOutUtils;
|
|
|
+import com.emato.ich.utils.ToastUtils;
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
@@ -78,6 +80,7 @@ public class InputInfoFragment extends Fragment {
|
|
|
timer.start();
|
|
|
} catch (Exception e) {
|
|
|
Log.e(TAG, "onViewCreated: 倒计时出现异常! ", e);
|
|
|
+ LoggingUtils.sendErrorLog("业务异常: 输入投递信息页面倒计时出现异常! ", e);
|
|
|
}
|
|
|
|
|
|
Bundle arguments = null;
|
|
@@ -102,7 +105,10 @@ public class InputInfoFragment extends Fragment {
|
|
|
@Override
|
|
|
public void onFailure(@NotNull Call call, @NotNull IOException e) {
|
|
|
// 请求失败
|
|
|
- Snackbar.make(view, "服务器异常! 请手动输入! ", Snackbar.LENGTH_LONG).show();
|
|
|
+ Log.e(TAG, "onFailure: 请求oms获取手机号失败! 网络异常! ", e);
|
|
|
+ LoggingUtils.sendErrorLog("请求oms获取手机号失败! 网络异常! ", e);
|
|
|
+ ToastUtils.make(getContext(), "服务器异常! 请手动输入!");
|
|
|
+ mailNoLock.set(1);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -124,11 +130,14 @@ public class InputInfoFragment extends Fragment {
|
|
|
|
|
|
} catch (JsonProcessingException e) {
|
|
|
Log.e(TAG, "onResponse: 服务器响应错误! 自动获取用户手机号失败! ", e);
|
|
|
- Snackbar.make(view, "网络异常! 请手动输入手机号! ", Snackbar.LENGTH_LONG).show();
|
|
|
+ ToastUtils.make(getContext(), "网络异常! 请手动输入手机号! ");
|
|
|
+ LoggingUtils.sendErrorLog("业务异常: 服务器响应错误! 自动获取用户手机号失败! ", e);
|
|
|
} catch (RuntimeException e) {
|
|
|
Log.e(TAG, "onResponse: 获取用户手机号未知错误! ", e);
|
|
|
- Snackbar.make(view, "未查询到手机号! 请手动输入! ", Snackbar.LENGTH_LONG).show();
|
|
|
+ ToastUtils.make(getContext(), "未查询到手机号! 请手动输入! ");
|
|
|
+ LoggingUtils.sendErrorLog("业务异常: 获取用户手机号未知错误! ", e);
|
|
|
}
|
|
|
+ mailNoLock.set(1);
|
|
|
});
|
|
|
|
|
|
}
|
|
@@ -138,6 +147,7 @@ public class InputInfoFragment extends Fragment {
|
|
|
|
|
|
} catch (RuntimeException e) {
|
|
|
Log.e(TAG, "onViewCreated: InputInfoFragment页面获取ChooseCabinetFragment传值错误! ", e);
|
|
|
+ LoggingUtils.sendErrorLog("业务异常: InputInfoFragment页面获取ChooseCabinetFragment传值错误! ", e);
|
|
|
}
|
|
|
|
|
|
// TODO 离线逻辑, 暂时不做
|
|
@@ -153,9 +163,9 @@ public class InputInfoFragment extends Fragment {
|
|
|
// String phone = binding.delivererPhone.getText().toString();
|
|
|
String phoneConfirm = binding.delivererPhoneConfirm.getText().toString();
|
|
|
if (!phonePattern.matcher(phoneConfirm).matches()) {
|
|
|
- Snackbar.make(view1, "请输入正确的手机号!", Snackbar.LENGTH_LONG).show();
|
|
|
+ ToastUtils.make(getContext(), "请输入正确的手机号!");
|
|
|
} else if (StringUtils.isNullOrEmpty(mailNo)) {
|
|
|
- Snackbar.make(view1, "运单号不能为空!请扫描运单号!", Snackbar.LENGTH_LONG).show();
|
|
|
+ ToastUtils.make(getContext(), "运单号不能为空!请扫描运单号!");
|
|
|
} else {
|
|
|
// 验证完 预下单
|
|
|
PreparedOrderVo preparedOrderVo = new PreparedOrderVo();
|
|
@@ -170,8 +180,9 @@ public class InputInfoFragment extends Fragment {
|
|
|
@Override
|
|
|
public void onFailure(@NotNull Call call, @NotNull IOException e) {
|
|
|
// TODO 预下单调用失败
|
|
|
- Snackbar.make(view, "请求服务器失败!网络异常!", Snackbar.LENGTH_LONG).show();
|
|
|
+ ToastUtils.make(getContext(), "请求服务器失败!网络异常!");
|
|
|
Log.e(TAG, "onFailure: 预下单失败! call: " + call.timeout().toString(), e);
|
|
|
+ LoggingUtils.sendErrorLog("业务异常: 预下单失败! call: " + call.timeout().toString(), e);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -194,17 +205,22 @@ public class InputInfoFragment extends Fragment {
|
|
|
activity.getBundleMap().put(InputInfoFragment.class.getName(), bundle);
|
|
|
} catch (RuntimeException e) {
|
|
|
Log.e(TAG, "onResponse: InputInfoFragment页面获取SendInfoConfirmFragment传值错误! ", e);
|
|
|
+ LoggingUtils.sendErrorLog("业务异常: InputInfoFragment页面获取SendInfoConfirmFragment传值错误! ", e);
|
|
|
}
|
|
|
timer.cancel();
|
|
|
NavHostFragment.findNavController(InputInfoFragment.this).navigate(R.id.action_inputInfoFragment_to_sendInfoConfirmFragment);
|
|
|
} else {
|
|
|
- ICSPResponseCodeEnum.responseHint(getContext(), responseData);
|
|
|
- Log.e(TAG, "onResponse: ICSP返回码: " + responseData.getCode() + ", 返回信息: " + responseData.getMsg(), new RuntimeException("系统异常"));
|
|
|
+ RuntimeException exception = new RuntimeException("系统异常");
|
|
|
+ Log.e(TAG, "onResponse: ICSP返回码: " + responseData.getCode() + ", 返回信息: " + responseData.getMsg(), exception);
|
|
|
+ LoggingUtils.sendErrorLog("业务异常: ICSP返回码: " + responseData.getCode() + ", 返回信息: " + responseData.getMsg(), exception);
|
|
|
}
|
|
|
+ ToastUtils.make(getContext(), responseData.getMsg());
|
|
|
} catch (JsonProcessingException e) {
|
|
|
Log.e(TAG, "onResponse: 预下单转换成JSON出错! ", e);
|
|
|
+ LoggingUtils.sendErrorLog("业务异常: 预下单转换成JSON出错! ", e);
|
|
|
} catch (RuntimeException e) {
|
|
|
Log.e(TAG, "onResponse: 预下单失败! ", e);
|
|
|
+ LoggingUtils.sendErrorLog("业务异常: 预下单失败! ", e);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -221,7 +237,7 @@ public class InputInfoFragment extends Fragment {
|
|
|
binding.inputButton0.setOnClickListener(v -> {
|
|
|
int length = binding.delivererPhoneConfirm.getText().length();
|
|
|
if (length >= 11) {
|
|
|
- Snackbar.make(view1, "手机号不能超过11位", Snackbar.LENGTH_LONG).show();
|
|
|
+ ToastUtils.make(getContext(), "手机号不能超过11位! ");
|
|
|
return;
|
|
|
}
|
|
|
int start = binding.delivererPhoneConfirm.getSelectionStart();
|
|
@@ -230,7 +246,7 @@ public class InputInfoFragment extends Fragment {
|
|
|
binding.inputButton1.setOnClickListener(v -> {
|
|
|
int length = binding.delivererPhoneConfirm.getText().length();
|
|
|
if (length >= 11) {
|
|
|
- Snackbar.make(view1, "手机号不能超过11位", Snackbar.LENGTH_LONG).show();
|
|
|
+ ToastUtils.make(getContext(), "手机号不能超过11位! ");
|
|
|
return;
|
|
|
}
|
|
|
int start = binding.delivererPhoneConfirm.getSelectionStart();
|
|
@@ -239,7 +255,7 @@ public class InputInfoFragment extends Fragment {
|
|
|
binding.inputButton2.setOnClickListener(v -> {
|
|
|
int length = binding.delivererPhoneConfirm.getText().length();
|
|
|
if (length >= 11) {
|
|
|
- Snackbar.make(view1, "手机号不能超过11位", Snackbar.LENGTH_LONG).show();
|
|
|
+ ToastUtils.make(getContext(), "手机号不能超过11位! ");
|
|
|
return;
|
|
|
}
|
|
|
int start = binding.delivererPhoneConfirm.getSelectionStart();
|
|
@@ -248,7 +264,7 @@ public class InputInfoFragment extends Fragment {
|
|
|
binding.inputButton3.setOnClickListener(v -> {
|
|
|
int length = binding.delivererPhoneConfirm.getText().length();
|
|
|
if (length >= 11) {
|
|
|
- Snackbar.make(view1, "手机号不能超过11位", Snackbar.LENGTH_LONG).show();
|
|
|
+ ToastUtils.make(getContext(), "手机号不能超过11位! ");
|
|
|
return;
|
|
|
}
|
|
|
int start = binding.delivererPhoneConfirm.getSelectionStart();
|
|
@@ -257,7 +273,7 @@ public class InputInfoFragment extends Fragment {
|
|
|
binding.inputButton4.setOnClickListener(v -> {
|
|
|
int length = binding.delivererPhoneConfirm.getText().length();
|
|
|
if (length >= 11) {
|
|
|
- Snackbar.make(view1, "手机号不能超过11位", Snackbar.LENGTH_LONG).show();
|
|
|
+ ToastUtils.make(getContext(), "手机号不能超过11位! ");
|
|
|
return;
|
|
|
}
|
|
|
int start = binding.delivererPhoneConfirm.getSelectionStart();
|
|
@@ -266,7 +282,7 @@ public class InputInfoFragment extends Fragment {
|
|
|
binding.inputButton5.setOnClickListener(v -> {
|
|
|
int length = binding.delivererPhoneConfirm.getText().length();
|
|
|
if (length >= 11) {
|
|
|
- Snackbar.make(view1, "手机号不能超过11位", Snackbar.LENGTH_LONG).show();
|
|
|
+ ToastUtils.make(getContext(), "手机号不能超过11位! ");
|
|
|
return;
|
|
|
}
|
|
|
int start = binding.delivererPhoneConfirm.getSelectionStart();
|
|
@@ -275,7 +291,7 @@ public class InputInfoFragment extends Fragment {
|
|
|
binding.inputButton6.setOnClickListener(v -> {
|
|
|
int length = binding.delivererPhoneConfirm.getText().length();
|
|
|
if (length >= 11) {
|
|
|
- Snackbar.make(view1, "手机号不能超过11位", Snackbar.LENGTH_LONG).show();
|
|
|
+ ToastUtils.make(getContext(), "手机号不能超过11位! ");
|
|
|
return;
|
|
|
}
|
|
|
int start = binding.delivererPhoneConfirm.getSelectionStart();
|
|
@@ -284,7 +300,7 @@ public class InputInfoFragment extends Fragment {
|
|
|
binding.inputButton7.setOnClickListener(v -> {
|
|
|
int length = binding.delivererPhoneConfirm.getText().length();
|
|
|
if (length >= 11) {
|
|
|
- Snackbar.make(view1, "手机号不能超过11位", Snackbar.LENGTH_LONG).show();
|
|
|
+ ToastUtils.make(getContext(), "手机号不能超过11位! ");
|
|
|
return;
|
|
|
}
|
|
|
int start = binding.delivererPhoneConfirm.getSelectionStart();
|
|
@@ -293,7 +309,7 @@ public class InputInfoFragment extends Fragment {
|
|
|
binding.inputButton8.setOnClickListener(v -> {
|
|
|
int length = binding.delivererPhoneConfirm.getText().length();
|
|
|
if (length >= 11) {
|
|
|
- Snackbar.make(view1, "手机号不能超过11位", Snackbar.LENGTH_LONG).show();
|
|
|
+ ToastUtils.make(getContext(), "手机号不能超过11位! ");
|
|
|
return;
|
|
|
}
|
|
|
int start = binding.delivererPhoneConfirm.getSelectionStart();
|
|
@@ -302,7 +318,7 @@ public class InputInfoFragment extends Fragment {
|
|
|
binding.inputButton9.setOnClickListener(v -> {
|
|
|
int length = binding.delivererPhoneConfirm.getText().length();
|
|
|
if (length >= 11) {
|
|
|
- Snackbar.make(view1, "手机号不能超过11位", Snackbar.LENGTH_LONG).show();
|
|
|
+ ToastUtils.make(getContext(), "手机号不能超过11位");
|
|
|
return;
|
|
|
}
|
|
|
int start = binding.delivererPhoneConfirm.getSelectionStart();
|
|
@@ -316,6 +332,11 @@ public class InputInfoFragment extends Fragment {
|
|
|
binding.delivererPhoneConfirm.setSelection(binding.delivererPhoneConfirm.getText().length());
|
|
|
}
|
|
|
});
|
|
|
+ // 长按删除
|
|
|
+ binding.inputButtonCancel.setOnLongClickListener(v -> {
|
|
|
+ binding.delivererPhoneConfirm.getText().clear();
|
|
|
+ return false;
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -369,6 +390,11 @@ public class InputInfoFragment extends Fragment {
|
|
|
binding.mailNo.setSelection(binding.mailNo.getText().length());
|
|
|
}
|
|
|
});
|
|
|
+ // 长按删除
|
|
|
+ binding.inputButtonCancel.setOnLongClickListener(v -> {
|
|
|
+ binding.mailNo.getText().clear();
|
|
|
+ return false;
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
|