Commit 80964ac0 by Wyh

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	component-print/src/main/java/com/joe/print/mvp/print/EpsonPrint.java
#	component-print/src/main/java/com/joe/print/mvp/print/service/PrjService.java
#	component-print/src/main/java/com/joe/print/mvp/ui/activity/PrintActivity.java
parents 31f65a09 17910593
......@@ -2,9 +2,7 @@ package com.gingersoft.gsa.delivery_pick_mode.ui.activity;
import android.os.Bundle;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.gingersoft.gsa.cloud.common.service.GetInfoUpdateService;
import com.gingersoft.gsa.delivery_pick_mode.R;
......
......@@ -126,7 +126,7 @@ dependencies {
addComponent 'component-delivery-pick'
addComponent 'component-manager'
addComponent 'component-coldchain'
addComponent 'component-supply-chain'
// addComponent 'component-supply-chain'
addComponent 'component-webview'
addComponent 'component-scan'
addComponent 'component-pay'
......
......@@ -4,9 +4,12 @@ import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.os.Message;
import android.text.TextUtils;
import android.util.SparseArray;
......@@ -35,6 +38,7 @@ import com.gingersoft.gsa.cloud.common.function.FunctionManager;
import com.gingersoft.gsa.cloud.common.function.jump.ActivityJumpBean;
import com.gingersoft.gsa.cloud.common.function.jump.ActivityJumpStrategy;
import com.gingersoft.gsa.cloud.common.logan.LoganManager;
import com.gingersoft.gsa.cloud.common.service.GetInfoUpdateService;
import com.gingersoft.gsa.cloud.common.utils.AppDevices;
import com.gingersoft.gsa.cloud.common.utils.JsonUtils;
import com.gingersoft.gsa.cloud.common.utils.StytemUtils;
......@@ -196,19 +200,34 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
}
@Override
protected void onResume() {
super.onResume();
initService();
initFuncationData();
if (((int) SPUtils.get("isFormal", 0)) != 0) {
tv_version_name.setText("v_" + DeviceUtils.getVersionName(this) + "\u3000Beta");
} else {
tv_version_name.setText("v_" + DeviceUtils.getVersionName(this));
}
}
@Override
protected void onRestart() {
super.onRestart();
updateTitleInfo();
}
private void initService() {
// boolean deliveryOrderServiceRunning = StytemUtils.isServiceRunning("com.gingersoft.gsa.cloud.common.service.GetInfoUpdateService", this);
// if (!deliveryOrderServiceRunning) {
// Intent service = new Intent(GsaCloudApplication.getAppContext(), GetInfoUpdateService.class);
// service.putExtra(GetInfoUpdateService.CONNECTION_TYPE, GetInfoUpdateService.mCurrConnectionType);
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// startForegroundService(service);
// } else {
// startService(service);
// }
// }
boolean prjServiceRunning = StytemUtils.isServiceRunning("com.joe.print.mvp.print.service.PrjService", this);
if (!prjServiceRunning) {
//開啟Prj打印服務
......@@ -217,12 +236,7 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
.build()
.call();
}
}
@Override
protected void onRestart() {
super.onRestart();
updateTitleInfo();
}
/**
......
......@@ -10,6 +10,7 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name="com.gingersoft.gsa.cloud.app.GsaCloudApplication"
android:allowBackup="true"
......@@ -19,8 +20,10 @@
android:roundIcon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".mvp.ui.activity.PrintAddCurrencyActivity"/>
<activity android:name=".mvp.ui.activity.PrintActivity" />
<activity android:name=".mvp.ui.activity.PrintAddCurrencyActivity" />
<activity
android:name=".mvp.ui.activity.PrintActivity"
android:launchMode="singleTop" />
<activity android:name=".mvp.ui.activity.PrinterAddActivity" />
<activity android:name=".mvp.ui.activity.PrintTestActivity">
<intent-filter>
......
......@@ -6,8 +6,10 @@ import com.billy.cc.core.component.CC;
import com.billy.cc.core.component.CCResult;
import com.billy.cc.core.component.CCUtil;
import com.billy.cc.core.component.IComponent;
import com.gingersoft.gsa.cloud.common.constans.PrintConstans;
import com.gingersoft.gsa.cloud.component.ComponentName;
import com.jess.arms.utils.ArmsUtils;
import com.joe.print.mvp.print.PrinterManger.PrjPtinterManager;
import com.joe.print.mvp.print.service.PrjService;
import com.joe.print.mvp.ui.activity.PrintActivity;
import com.joe.print.mvp.ui.activity.PrinterListActivity;
......@@ -64,11 +66,14 @@ public class PrintComponent implements IComponent {
cc.getContext().stopService(new Intent(cc.getContext(), PrjService.class));
CC.sendCCResult(cc.getCallId(), CCResult.success());
break;
case "getPrjData":
PrjPtinterManager.getInstance(cc.getContext()).initUsbPrint();
PrjPtinterManager.getInstance(cc.getContext()).getPrjInfo();
break;
default:
// cc.callAsync(new IComponentCallback() {
// @Override
// public void onResult(CC cc, CCResult result) {
//
// }
// });
//这个逻辑分支上没有调用CC.sendCCResult(...),是一种错误的示例
......
......@@ -414,11 +414,10 @@ public class EpsonPrint implements ReceiveListener {
/**
* 打印結果回調
*
* @param printer 打印類
* @param i 打印結果
* @param printerStatusInfo 打印機狀態
* @param s 沒值
* @param s
*/
@Override
public void onPtrReceive(Printer printer, int i, PrinterStatusInfo printerStatusInfo, String s) {
......
......@@ -26,4 +26,7 @@ public class PrinterManager {
public void setDeviceBeans(List<PrinterDeviceBean> deviceBeans) {
this.deviceBeans = deviceBeans;
}
}
......@@ -49,6 +49,7 @@ import com.gingersoft.gsa.cloud.print.PrinterWriter58mm;
import com.gingersoft.gsa.cloud.print.bean.PrintContent;
import com.gingersoft.gsa.cloud.print.bean.PrintTakeawayCheckoutContent;
import com.gingersoft.gsa.cloud.print.bean.PrintTakeawayFormContent;
import com.gingersoft.gsa.cloud.print.bean.UpdateBean;
import com.gingersoft.gsa.cloud.print.bean.base.PrintBillItem;
import com.gingersoft.gsa.cloud.print.bean.base.PrintFoodItem;
import com.gingersoft.gsa.cloud.print.bean.base.PrintPayTypeItem;
......@@ -283,7 +284,7 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket
@Override
public void onRaiseException(int code, String msg) {
//接⼝执⾏失败时,返回的异常状态
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(null, code);
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(new Exception(msg), code);
LoganManager.w_printer(TAG, "商米onRaiseException: " + code + msg);
}
......@@ -308,7 +309,7 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket
} else {
//打印失敗
listener.printFailure("打印失敗");
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(null, i);
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(new Exception(UpdateBean.getStateByCode(i)), i);
}
}
......@@ -382,6 +383,7 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket
if (code == SendResultCode.SEND_SUCCESS) {
printSuccess();
} else if (code == SendResultCode.SEND_FAILED) {
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(new Exception("usb打印失敗"), 0);
printFailure("打印失敗");
}
});
......@@ -452,7 +454,6 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket
@Override
public void onResult(int errorCode) {
Log.e("eee", "打印結果:" + errorCode);
switch (errorCode) {
case PrintSocketHolder.ERROR_0:
PrinterPlugins.getOnPrinterFlowHandler().onPrintSuccess();
......@@ -460,25 +461,31 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket
return;
case PrintSocketHolder.ERROR_6:
LoganManager.w_printer(TAG, "生成打印數據失敗");
PrinterPlugins.getOnPrinterFlowHandler().connectionError(new Exception("生成打印數據失敗"));
printFailure("生成打印數據失敗");
break;
case PrintSocketHolder.ERROR_7:
LoganManager.w_printer(TAG, "連接打印機失敗");
PrinterPlugins.getOnPrinterFlowHandler().connectionError(new Exception("連接打印機失敗"));
printFailure("連接打印機失敗");
break;
case PrintSocketHolder.ERROR_10:
LoganManager.w_printer(TAG, "連接打印機失敗(写入页面数据失败),Code:" + PrintSocketHolder.ERROR_10);
LoganManager.w_printer(TAG, "打印機連接成功,發送數據出現問題" );
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(new Exception("打印機連接成功,發送數據出現問題"), errorCode);
printFailure("打印失敗,錯誤碼:" + errorCode);
break;
case PrintSocketHolder.ERROR_9:
LoganManager.w_printer(TAG, "連接打印機失敗(必要参数不能为空)");
printFailure("連接打印機失敗,沒有ip地址,錯誤碼:" + errorCode);
LoganManager.w_printer(TAG, "IP地址為空");
PrinterPlugins.getOnPrinterFlowHandler().connectionError(new Exception("IP地址為空"));
printFailure("IP地址為空");
break;
case PrintSocketHolder.ERROR_66:
LoganManager.w_printer(TAG, "关闭Socket出错");
LoganManager.w_printer(TAG, "關閉Socket出錯");
PrinterPlugins.getOnPrinterFlowHandler().disconnect(new Exception("關閉打印機連接出错"));
break;
default:
break;
}
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(null, errorCode);
setPrintState(errorCode);
}
......
......@@ -61,6 +61,7 @@ import org.json.JSONObject;
import java.io.IOException;
import java.io.PrintStream;
import java.net.ConnectException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
......@@ -539,10 +540,10 @@ public class PrjService extends Service implements ReceiveListener {
//將打印的圖片保存到手機中
hookPrinterBitmap(bitmapMaps, beans);
EpsonPrint mPrinter = EpsonPrint.getInstance();
boolean initResult = EpsonPrint.getInstance().initializeObject(this, this, this::updatePrjState);
if (!initResult) {
//初始化打印機失敗
PrinterPlugins.getOnPrinterFlowHandler().connectionError(new ConnectException("初始化針式打印機失敗"));
Log.e("eee", "prj初始化打印失敗" + getPrintIds(bitmapMaps));
updatePrjState(UpdateBean.FAIL_EPSON_INIT, getPrintIds(bitmapMaps));
return;
......@@ -551,7 +552,7 @@ public class PrjService extends Service implements ReceiveListener {
Log.d("eee", "針式打印機本次PRJ數量:" + bitmapMaps.size());
for (int i = 0; i < bitmapMaps.size(); i++) {
for (Map.Entry<String, Bitmap> mapEntry : bitmapMaps.get(i).entrySet()) {
mPrinter.putPrintData(printerDeviceBean.getIp(), mapEntry.getValue(), mapEntry.getKey());
EpsonPrint.getInstance().putPrintData(printerDeviceBean.getIp(), mapEntry.getValue(), mapEntry.getKey());
}
}
}
......@@ -595,7 +596,7 @@ public class PrjService extends Service implements ReceiveListener {
PrinterPlugins.getOnPrinterFlowHandler().onPrintSuccess();
updatePrjSuccess(key);
} else if (code == SendResultCode.SEND_FAILED) {
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(null, code);
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(new Exception("發送打印數據失敗"), code);
updatePrjFailure(key);
}
});
......@@ -706,7 +707,7 @@ public class PrjService extends Service implements ReceiveListener {
@Override
public void onRaiseException(int code, String msg) {
//接⼝执⾏失败时,返回的异常状态
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(null, code);
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(new Exception(msg), code);
LoganManager.w_printer(TAG, "商米onRaiseException: " + code + msg);
switch (code) {
case 3:
......@@ -769,8 +770,8 @@ public class PrjService extends Service implements ReceiveListener {
updatePrjSuccess(ids);
} else {
//打印失敗
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(new Exception(UpdateBean.getStateByCode(i)), i);
updatePrjState(i, ids);
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(null, i);
}
}
......@@ -782,6 +783,7 @@ public class PrjService extends Service implements ReceiveListener {
});
} catch (RemoteException e) {
e.printStackTrace();
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(e, i);
LoganManager.w_printer(TAG, "N5 RemoteException :" + e.getLocalizedMessage());
updatePrjFailure(ids);
}
......@@ -1113,7 +1115,7 @@ public class PrjService extends Service implements ReceiveListener {
//打印成功
updatePrjSuccess(s);
} else {
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(null, i);
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(new Exception("打印失敗"), i);
//打印失敗
updatePrjFailure(s);
}
......
......@@ -2,22 +2,31 @@ package com.joe.print.mvp.ui.view;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Looper;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import com.airbnb.lottie.LottieAnimationView;
import com.gingersoft.gsa.cloud.pay.pos.hywebpos.constant.HywebActionStatusCode;
import com.gingersoft.gsa.cloud.ui.widget.dialog.BaseRetryDialog;
import com.joe.print.R;
import com.qmuiteam.qmui.layout.QMUILinearLayout;
import com.qmuiteam.qmui.util.QMUIDisplayHelper;
import butterknife.BindDrawable;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
......@@ -31,14 +40,7 @@ public class PrinterLoadingDialog extends BaseRetryDialog {
private Context mContext;
private TextView tv_generate_print_data, tv_connecting, tv_printing, tv_print_result;
// @BindDrawable(R.drawable.print_grey_point)
// Drawable mGreyDrawable;
// @BindDrawable(R.drawable.print_green_point)
// Drawable mGreedDrawable;
// @BindDrawable(R.drawable.print_red_point)
// Drawable mReaDrawable;
private TextView tv_generate_print_data, tv_connecting, tv_print_result, tv_error_msg;
public static final byte status_default = 0;
public static final byte status_success = 1;
......@@ -52,10 +54,6 @@ public class PrinterLoadingDialog extends BaseRetryDialog {
super(context, R.style.MyDialogTheme2);
mContext = context;
mRadius = QMUIDisplayHelper.dp2px(mContext, 8);
drawables = new Drawable[3];
drawables[0] = getDrawableByResId(R.drawable.print_grey_point);
drawables[1] = getDrawableByResId(R.drawable.print_green_point);
drawables[2] = getDrawableByResId(R.drawable.print_red_point);
}
@Override
......@@ -77,7 +75,7 @@ public class PrinterLoadingDialog extends BaseRetryDialog {
public PrinterLoadingDialog build() {
View contentView = buildViews();
int screenWidth = (int) (QMUIDisplayHelper.getScreenWidth(mContext) * 0.9);
int screenWidth = (int) (QMUIDisplayHelper.getScreenWidth(mContext) * 0.85);
int screenHeight = (int) (QMUIDisplayHelper.getScreenHeight(mContext) * 0.5);
setContentView(contentView, new LinearLayout.LayoutParams(screenWidth, screenHeight));
return this;
......@@ -89,43 +87,117 @@ public class PrinterLoadingDialog extends BaseRetryDialog {
LottieAnimationView printLottieView = view.findViewById(R.id.lottieAnimationView);
tv_generate_print_data = view.findViewById(R.id.tv_generate_print_data);
tv_connecting = view.findViewById(R.id.tv_connecting);
tv_printing = view.findViewById(R.id.tv_printing);
tv_print_result = view.findViewById(R.id.tv_print_result);
tv_error_msg = view.findViewById(R.id.tv_error_msg);
textViews = new TextView[]{tv_generate_print_data, tv_connecting, tv_printing, tv_print_result};
ll_container.setRadiusAndShadow(mRadius, QMUIDisplayHelper.dp2px(mContext, mShadowElevationDp), mShadowAlpha);
printLottieView.setAnimation(R.raw.printer_loading3);
printLottieView.setRepeatCount(ValueAnimator.INFINITE);
printLottieView.loop(true);
// printLottieView.addAnimatorUpdateListener((animation) -> {
// // Do something.动画状态监听回调
//
// });
printLottieView.playAnimation();//播放动画
// //progress范围0~1f,设置动画进度
// printLottieView.setProgress(0.5f);
// // 自定义动画时长,此处利用ValueAnimator值动画来实时更新AnimationView的进度来达到控制动画时长。
// ValueAnimator animator = ValueAnimator.ofFloat(0f, 1f).setDuration(500);
// animator.start();//启动动画
return view;
}
private Drawable[] drawables;
private TextView[] textViews;
public void setStep(int step, int status) {
tv_generate_print_data.post(() -> setCompoundDrawableByStatus(status, textViews[step - 1]));
public void setStep(int step, int status, String errorMsg) {
tv_generate_print_data.post(new Runnable() {
@Override
public void run() {
if (!TextUtils.isEmpty(errorMsg)) {
tv_error_msg.setText(errorMsg);
tv_error_msg.setVisibility(View.VISIBLE);
} else {
tv_error_msg.setVisibility(View.GONE);
}
switch (step) {
case 1:
if (status == PrinterLoadingDialog.status_success) {
tv_generate_print_data.setCompoundDrawables(null, getDrawableByResId(R.drawable.print_green_point), null, null);
} else if (status == PrinterLoadingDialog.status_error) {
tv_generate_print_data.setCompoundDrawables(null, getDrawableByResId(R.drawable.print_red_point), null, null);
} else {
tv_generate_print_data.setCompoundDrawables(null, getDrawableByResId(R.drawable.print_grey_point), null, null);
}
break;
case 2:
tv_generate_print_data.setCompoundDrawables(null, getDrawableByResId(R.drawable.print_green_point), null, null);
if (status == PrinterLoadingDialog.status_success) {
tv_connecting.setCompoundDrawables(null, getDrawableByResId(R.drawable.print_green_point), null, null);
} else if (status == PrinterLoadingDialog.status_error) {
tv_connecting.setCompoundDrawables(null, getDrawableByResId(R.drawable.print_red_point), null, null);
} else {
tv_connecting.setCompoundDrawables(null, getDrawableByResId(R.drawable.print_grey_point), null, null);
}
break;
case 3:
if (status == PrinterLoadingDialog.status_success) {
tv_print_result.setCompoundDrawables(null, getDrawableByResId(R.drawable.print_green_point), null, null);
} else if (status == PrinterLoadingDialog.status_error) {
tv_print_result.setCompoundDrawables(null, getDrawableByResId(R.drawable.print_red_point), null, null);
} else {
tv_print_result.setCompoundDrawables(null, getDrawableByResId(R.drawable.print_grey_point), null, null);
}
break;
default:
break;
}
setStatusResult(step, status);
}
});
}
private void setCompoundDrawableByStatus(int status, TextView textView) {
textView.setCompoundDrawablesWithIntrinsicBounds(textView.getCompoundDrawables()[0], drawables[status], textView.getCompoundDrawables()[2], textView.getCompoundDrawables()[0]);
private void setStatusResult(int step, int status) {
switch (step) {
case 2:
tv_generate_print_data.setText("生成成功");
if (status == PrinterLoadingDialog.status_success) {
tv_connecting.setText("連接成功");
} else if (status == PrinterLoadingDialog.status_error) {
tv_connecting.setText("連接失敗");
} else {
tv_connecting.setText("連接中");
}
break;
case 3:
if (status == PrinterLoadingDialog.status_success) {
tv_connecting.setText("打印成功");
} else if (status == PrinterLoadingDialog.status_error) {
tv_connecting.setText("打印失敗");
} else {
tv_connecting.setText("打印結果");
}
break;
default:
break;
}
}
private Drawable getDrawableByResId(int resId) {
return ContextCompat.getDrawable(mContext, resId);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Drawable drawable = mContext.getDrawable(resId);
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
return drawable;
}
Drawable drawable = mContext.getResources().getDrawable(resId);
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
return drawable;
}
protected int getContentViewLayoutId() {
return R.layout.print_dialog_loading;
}
private OnClickListener onClickListener;
public void setOnClickListener(OnClickListener onClickListener) {
this.onClickListener = onClickListener;
}
public interface OnClickListener {
// void onItemClick(FoodReason item, int position, int deleteNumber);
}
}
......@@ -10,8 +10,8 @@
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/lottieAnimationView"
android:layout_width="@dimen/dp_150"
android:layout_height="@dimen/dp_150"
android:layout_width="@dimen/dp_180"
android:layout_height="@dimen/dp_180"
android:layout_gravity="center_horizontal"
app:lottie_autoPlay="true"
app:lottie_loop="true" />
......@@ -28,7 +28,7 @@
android:id="@+id/tv_generate_print_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/print_grey_point"
android:drawableTop="@drawable/print_green_point"
android:text="生成打印數據"
android:textColor="@color/black"
android:textSize="@dimen/sp_10" />
......@@ -53,28 +53,23 @@
android:background="@color/black" />
<TextView
android:id="@+id/tv_printing"
android:id="@+id/tv_print_result"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/print_grey_point"
android:text="打印中"
android:text="結果"
android:textColor="@color/black"
android:textSize="@dimen/sp_10" />
<View
android:layout_width="@dimen/dp_50"
android:layout_height="1px"
android:background="@color/black" />
</LinearLayout>
<TextView
android:id="@+id/tv_print_result"
android:id="@+id/tv_error_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/print_grey_point"
android:text="結果"
android:textColor="@color/black"
android:textSize="@dimen/sp_10" />
</LinearLayout>
android:layout_marginTop="@dimen/dp_10"
android:textColor="@color/red"
android:textSize="@dimen/font_small"
android:text="連接打印機超時"/>
</com.qmuiteam.qmui.layout.QMUILinearLayout>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -173,6 +173,11 @@ public class GsaCloudApplication extends BaseApplication {
* 初始化美團日誌框架
*/
private void initLogan() {
if (BuildConfig.DEBUG) {
LoganConfig.UPLOAD_LOG_URL = "http://192.168.1.131:8080/logan-web/logan/upload.json";
} else {
LoganConfig.UPLOAD_LOG_URL = HttpsConstans.HTTP_ADDRESS_URL_HK + "/logan-web/logan/upload.json";
}
com.dianping.logan.LoganConfig config = new com.dianping.logan.LoganConfig.Builder()
.setCachePath(getFilesDir().getAbsolutePath())
.setPath(getExternalFilesDir(null).getAbsolutePath()
......@@ -384,9 +389,13 @@ public class GsaCloudApplication extends BaseApplication {
}
@Override
public void disconnect() {
public void disconnect(Exception e) {
if (e != null) {
LoganManager.w_printer(TAG, e.getMessage());
} else {
LoganManager.w_printer(TAG, "斷開打印機連接");
}
}
});
}
......
......@@ -15,7 +15,7 @@ public class LoganConfig {
public static final String EncryptIV16 = "0123456789012345";
public static final String APP_ID = "gingersoft1008611";
// public static final String UPLOAD_LOG_URL = HttpsConstans.HTTP_ADDRESS_URL_HK+ "/logan-web/logan/upload.json";
public static final String UPLOAD_LOG_URL = "http://192.168.1.131:8080/logan-web/logan/upload.json";
public static String UPLOAD_LOG_URL = "http://192.168.1.131:8080/logan-web/logan/upload.json";
/**
* 日誌保留天數
......
......@@ -14,5 +14,5 @@ public interface ExternalPrinterConnection {
void connectionError(Exception e);
void disconnect();
void disconnect(Exception e);
}
......@@ -182,7 +182,7 @@ public class PrintSocketHolder {
socket = null;
error = true;
}
PrinterPlugins.getOnPrinterFlowHandler().disconnect();
PrinterPlugins.getOnPrinterFlowHandler().disconnect(null);
return error ? ERROR_66 : ERROR_0;
}
......
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