|
@@ -8,6 +8,7 @@ import android.content.Context;
|
|
|
import android.content.IntentFilter;
|
|
import android.content.IntentFilter;
|
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
|
import android.os.Handler;
|
|
import android.os.Handler;
|
|
|
|
|
+import android.os.Looper;
|
|
|
import android.view.View;
|
|
import android.view.View;
|
|
|
import android.widget.AdapterView;
|
|
import android.widget.AdapterView;
|
|
|
import android.widget.Button;
|
|
import android.widget.Button;
|
|
@@ -43,6 +44,7 @@ import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Optional;
|
|
import java.util.Optional;
|
|
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
|
|
|
|
|
public class StockOutNewActivity extends BaseActivity {
|
|
public class StockOutNewActivity extends BaseActivity {
|
|
@@ -613,12 +615,14 @@ public class StockOutNewActivity extends BaseActivity {
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true, priority = 1)
|
|
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true, priority = 1)
|
|
|
public void onReceiveMsg(EventMessage message){
|
|
public void onReceiveMsg(EventMessage message){
|
|
|
if(message.getType() == 3){
|
|
if(message.getType() == 3){
|
|
|
- if(StringUtils.isEmpty(erpOutstockCode)){
|
|
|
|
|
- erpOutstockCode = message.getMessage();
|
|
|
|
|
- }
|
|
|
|
|
- if(!StringUtils.isEmpty(erpOutstockCode)) {
|
|
|
|
|
- loadErpTask(1);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
|
|
|
|
+ if(StringUtils.isEmpty(erpOutstockCode)){
|
|
|
|
|
+ erpOutstockCode = message.getMessage();
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!StringUtils.isEmpty(erpOutstockCode)) {
|
|
|
|
|
+ loadErpTask(1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 1000);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -626,6 +630,7 @@ public class StockOutNewActivity extends BaseActivity {
|
|
|
protected void onDestroy() {
|
|
protected void onDestroy() {
|
|
|
super.onDestroy();
|
|
super.onDestroy();
|
|
|
handler.removeCallbacks(runnable);
|
|
handler.removeCallbacks(runnable);
|
|
|
|
|
+ EventBus.getDefault().unregister(this);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|