Commit e8e904bd by Wyh

1、去掉PrjService的wakeDisposable定時 2、修復供應鏈入庫單刷新問題

parent 7b55a06f
...@@ -5,7 +5,7 @@ buildscript { ...@@ -5,7 +5,7 @@ buildscript {
repositories { repositories {
maven { url 'https://maven.google.com' } maven { url 'https://maven.google.com' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } //gradle 国内镜像仓 // maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } //gradle 国内镜像仓
maven { url 'https://maven.aliyun.com/repository/google' } //google 国内镜像仓 maven { url 'https://maven.aliyun.com/repository/google' } //google 国内镜像仓
maven { url 'https://maven.aliyun.com/repository/jcenter' } //jcenter 国内镜像仓 maven { url 'https://maven.aliyun.com/repository/jcenter' } //jcenter 国内镜像仓
// 添加阿里云 maven 地址 // 添加阿里云 maven 地址
...@@ -38,7 +38,7 @@ buildscript { ...@@ -38,7 +38,7 @@ buildscript {
allprojects { allprojects {
repositories { repositories {
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } //gradle 国内镜像仓 // maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } //gradle 国内镜像仓
maven { url 'https://maven.aliyun.com/repository/google' } //google 国内镜像仓 maven { url 'https://maven.aliyun.com/repository/google' } //google 国内镜像仓
maven { url 'https://maven.aliyun.com/repository/jcenter' } //jcenter 国内镜像仓 maven { url 'https://maven.aliyun.com/repository/jcenter' } //jcenter 国内镜像仓
......
...@@ -37,7 +37,21 @@ android { ...@@ -37,7 +37,21 @@ android {
} }
resourcePrefix "user_login" resourcePrefix "user_login"
bundle {
density {
// Different APKs are generated for devices with different screen densities; true by default.
enableSplit true
}
abi {
// Different APKs are generated for devices with different CPU architectures; true by default.
enableSplit true
}
language {
// This is disabled so that the App Bundle does NOT split the APK for each language.
// We're gonna use the same APK for all languages.
enableSplit true
}
}
buildTypes { buildTypes {
debug { debug {
buildConfigField "boolean", "LOG_DEBUG", rootProject.ext.buildType["debugLogDebug"] buildConfigField "boolean", "LOG_DEBUG", rootProject.ext.buildType["debugLogDebug"]
......
...@@ -121,3 +121,6 @@ ...@@ -121,3 +121,6 @@
#xpopup #xpopup
-dontwarn com.lxj.xpopup.widget.** -dontwarn com.lxj.xpopup.widget.**
-keep class com.lxj.xpopup.widget.**{*;} -keep class com.lxj.xpopup.widget.**{*;}
-keep class me.jessyan.autosize.** { *; }
-keep interface me.jessyan.autosize.** { *; }
...@@ -132,7 +132,7 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem ...@@ -132,7 +132,7 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem
mPresenter.getLoginLimit(restaurantId, true); mPresenter.getLoginLimit(restaurantId, true);
return; return;
} }
//调整选择餐厅页面 //跳轉到选择餐厅页面
Intent intent = new Intent(mContext, ChooseRestaurantActivity.class); Intent intent = new Intent(mContext, ChooseRestaurantActivity.class);
Class clazz = WelcomeActivity.this.getClass(); Class clazz = WelcomeActivity.this.getClass();
intent.putExtra("form", clazz.getName()); intent.putExtra("form", clazz.getName());
......
...@@ -199,13 +199,6 @@ public class PrjService extends Service implements ReceiveListener { ...@@ -199,13 +199,6 @@ public class PrjService extends Service implements ReceiveListener {
LoganManager.w_printer(TAG, "獲取Prj數據 onNext: " + prjInfo); LoganManager.w_printer(TAG, "獲取Prj數據 onNext: " + prjInfo);
//請求到數據,停止輪詢,開始打印,在打印完之後再重新開始輪詢 //請求到數據,停止輪詢,開始打印,在打印完之後再重新開始輪詢
newPrint(prjInfo); newPrint(prjInfo);
//開啟另一個定時,三十秒之後自動請求,避免上面的打印成功或失敗時沒有回調。
cancel(wakeDisposable);
wakeDisposable = RxJavaUtils.delay(30, TimeUnit.SECONDS)
.subscribe(aLong -> {
LoganManager.w_printer(TAG, "輪詢獲取Prj數據-->");
startGetPrjInfo();
});
} }
@Override @Override
...@@ -240,7 +233,9 @@ public class PrjService extends Service implements ReceiveListener { ...@@ -240,7 +233,9 @@ public class PrjService extends Service implements ReceiveListener {
return; return;
} }
//有數據,取消輪詢,等待打印結束。 //有數據,取消輪詢,等待打印結束。
cancel(pollDisposable); // cancel(pollDisposable);
//開啟另一個定時,六十秒之後自動請求,避免上面的打印成功或失敗時沒有回調。
// startBplan();
//第一步:解析PRJ數據,格式為 Map<廚房位置,需要打印的數據> //第一步:解析PRJ數據,格式為 Map<廚房位置,需要打印的數據>
try { try {
JSONObject jsonObject = new JSONObject(GsonUtils.GsonString(prjBean.getData())); JSONObject jsonObject = new JSONObject(GsonUtils.GsonString(prjBean.getData()));
...@@ -270,6 +265,15 @@ public class PrjService extends Service implements ReceiveListener { ...@@ -270,6 +265,15 @@ public class PrjService extends Service implements ReceiveListener {
foreachPrint(listMap, getPrinterDevices()); foreachPrint(listMap, getPrinterDevices());
} }
// private void startBplan() {
// cancel(wakeDisposable);
// wakeDisposable = RxJavaUtils.delay(60, TimeUnit.SECONDS)
// .subscribe(aLong -> {
// LoganManager.w_printer(TAG, "輪詢獲取Prj數據-->");
// startGetPrjInfo();
// });
// }
/** /**
* 計算出prj總數 * 計算出prj總數
* *
......
...@@ -326,6 +326,8 @@ public class WarehousingOrderDetailsPresenter extends BasePresenter<WarehousingO ...@@ -326,6 +326,8 @@ public class WarehousingOrderDetailsPresenter extends BasePresenter<WarehousingO
public void onNext(BaseResult baseResult) { public void onNext(BaseResult baseResult) {
if (baseResult != null && baseResult.isSuccess()) { if (baseResult != null && baseResult.isSuccess()) {
mRootView.showMessage("入庫成功"); mRootView.showMessage("入庫成功");
//清空購物車
SupplyShoppingCart.getInstance().clear();
mRootView.addOrderSuccess(); mRootView.addOrderSuccess();
} else if (baseResult != null && TextUtil.isNotEmptyOrNullOrUndefined(baseResult.getErrMsg())) { } else if (baseResult != null && TextUtil.isNotEmptyOrNullOrUndefined(baseResult.getErrMsg())) {
mRootView.showMessage(baseResult.getErrMsg()); mRootView.showMessage(baseResult.getErrMsg());
......
...@@ -29,6 +29,9 @@ import com.gingersoft.supply_chain.mvp.ui.fragment.warehouse.SnInOutboundRecords ...@@ -29,6 +29,9 @@ import com.gingersoft.supply_chain.mvp.ui.fragment.warehouse.SnInOutboundRecords
import com.gingersoft.supply_chain.mvp.ui.fragment.warehouse.WareHouseListFragment; import com.gingersoft.supply_chain.mvp.ui.fragment.warehouse.WareHouseListFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.warehouse.WarehousingOrderListFragment; import com.gingersoft.supply_chain.mvp.ui.fragment.warehouse.WarehousingOrderListFragment;
import com.jess.arms.di.component.AppComponent; import com.jess.arms.di.component.AppComponent;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.impl.ConfirmPopupView;
import com.lxj.xpopup.interfaces.OnConfirmListener;
import com.qmuiteam.qmui.widget.QMUITopBar; import com.qmuiteam.qmui.widget.QMUITopBar;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -98,6 +101,7 @@ public class FunctionListFragment extends BaseSupplyChainFragment<FunctionListPr ...@@ -98,6 +101,7 @@ public class FunctionListFragment extends BaseSupplyChainFragment<FunctionListPr
storage.add(new Function("SN查詢", R.drawable.ic_inventory)); storage.add(new Function("SN查詢", R.drawable.ic_inventory));
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
storage.add(new Function("切換環境", R.drawable.ic_seekbar_btn)); storage.add(new Function("切換環境", R.drawable.ic_seekbar_btn));
storage.add(new Function("設置", R.drawable.ic_setting));
} }
purchaseFunctionBeans.add(new PurchaseFunctionBean("庫存管理", storage)); purchaseFunctionBeans.add(new PurchaseFunctionBean("庫存管理", storage));
...@@ -144,6 +148,14 @@ public class FunctionListFragment extends BaseSupplyChainFragment<FunctionListPr ...@@ -144,6 +148,14 @@ public class FunctionListFragment extends BaseSupplyChainFragment<FunctionListPr
SPUtils.put("isFormal", 3); SPUtils.put("isFormal", 3);
} }
break; break;
case "設置":
ConfirmPopupView po = new XPopup.Builder(requireContext()).asConfirm("修改餐廳信息", null, null, null, new OnConfirmListener() {
@Override
public void onConfirm() {
}
}, null, false, R.layout.layout_update_restaurant_info);
break;
default: default:
break; break;
......
...@@ -131,11 +131,11 @@ public class WarehousingOrderListFragment extends BaseSupplyChainFragment<Wareho ...@@ -131,11 +131,11 @@ public class WarehousingOrderListFragment extends BaseSupplyChainFragment<Wareho
loadService.showCallback(EmptyCallback.class); loadService.showCallback(EmptyCallback.class);
} else { } else {
loadService.showSuccess(); loadService.showSuccess();
warehousingOrderListAdapter.setOnItemClickListener((adapter, view, position) -> {
start(WarehousingOrderDetailsFragment.newInstance(warehousingOrderListAdapter.getItem(position).getId(), warehousingOrderListAdapter.getItem(position).getStorageType()));
});
rvSecondCategory.setAdapter(warehousingOrderListAdapter);
} }
warehousingOrderListAdapter.setOnItemClickListener((adapter, view, position) -> {
start(WarehousingOrderDetailsFragment.newInstance(warehousingOrderListAdapter.getItem(position).getId(), warehousingOrderListAdapter.getItem(position).getStorageType()));
});
rvSecondCategory.setAdapter(warehousingOrderListAdapter);
} }
@Override @Override
......
package com.gingersoft.supply_chain.mvp.ui.widget;
import android.content.Context;
import android.view.View;
import androidx.annotation.NonNull;
import com.gingersoft.supply_chain.R;
import com.lxj.xpopup.core.CenterPopupView;
import com.lxj.xpopup.impl.ConfirmPopupView;
/**
* @author 宇航. 1239658231@qq.com
* User: admin
* Date: 2021/5/14
* Time: 12:25
* Use:
*/
public class UpdateRestaurantInfoPop extends ConfirmPopupView {
public UpdateRestaurantInfoPop(@NonNull Context context) {
super(context, R.layout.layout_update_restaurant_info);
}
@Override
protected void onCreate() {
super.onCreate();
findViewById(R.id.tv_confirm).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
}
});
}
}
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shape_white_eight_corners_bg"
android:padding="@dimen/dp_20">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_16"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="標題" />
<TextView
android:id="@+id/tv_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_16"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title"
tools:text="標題" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/layout_brand_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_content">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="請輸入品牌ID"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_14" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/layout_restaurant_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/layout_brand_input">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="請輸入餐廳ID"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_14" />
</com.google.android.material.textfield.TextInputLayout>
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/tv_confirm"
style="@style/Save_Btn_Style"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:text="確定"
android:visibility="visible"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_cancel"
app:layout_constraintTop_toBottomOf="@id/layout_restaurant_input" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/tv_cancel"
style="@style/Cancel_Btn_Style"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:layout_weight="1"
android:text="取消"
android:visibility="visible"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toRightOf="@id/tv_confirm"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/layout_restaurant_input" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -51,4 +51,5 @@ kapt.include.compile.classpath=false ...@@ -51,4 +51,5 @@ kapt.include.compile.classpath=false
org.gradle.daemon=true org.gradle.daemon=true
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true org.gradle.parallel=true
org.gradle.configureondemand=true org.gradle.configureondemand=true
\ No newline at end of file android.enableAapt2=false
\ No newline at end of file
...@@ -3,7 +3,6 @@ package com.gingersoft.gsa.cloud.common.utils.inputFilter; ...@@ -3,7 +3,6 @@ package com.gingersoft.gsa.cloud.common.utils.inputFilter;
import android.content.Context; import android.content.Context;
import android.text.Editable; import android.text.Editable;
import android.text.InputFilter; import android.text.InputFilter;
import android.text.Spanned;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.util.Log; import android.util.Log;
...@@ -14,8 +13,6 @@ import com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils; ...@@ -14,8 +13,6 @@ import com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import me.jessyan.autosize.utils.LogUtils;
/** /**
* @author 宇航. * @author 宇航.
* User: admin * User: admin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment