Commit a4496333 by Wyh

1、合併代碼、針式打印優化

parent a45cdb6d
...@@ -194,7 +194,6 @@ public class OrderDetailsActivity extends BaseActivity<OrderDetailsPresenter> im ...@@ -194,7 +194,6 @@ public class OrderDetailsActivity extends BaseActivity<OrderDetailsPresenter> im
@Override @Override
public void hideLoading() { public void hideLoading() {
Log.e("eee", "hideLoading");
LoadingDialog.cancelDialogForLoading(); LoadingDialog.cancelDialogForLoading();
} }
......
...@@ -281,7 +281,6 @@ public class OrderListFragment extends BaseFragment<OrderListPresenter> implemen ...@@ -281,7 +281,6 @@ public class OrderListFragment extends BaseFragment<OrderListPresenter> implemen
// if (resultCode == 1001 && data != null && mPresenter != null) { // if (resultCode == 1001 && data != null && mPresenter != null) {
// int position = data.getIntExtra("position", -1); // int position = data.getIntExtra("position", -1);
// boolean isPrint = data.getBooleanExtra("printPdf", false); // boolean isPrint = data.getBooleanExtra("printPdf", false);
// Log.e("eee", "Position:" + position + "----isPrint:" + isPrint);
// if (isPrint) { // if (isPrint) {
// mPresenter.notifyDataPrintStateByPosition(position, true); // mPresenter.notifyDataPrintStateByPosition(position, true);
// } else { // } else {
......
...@@ -75,6 +75,10 @@ android { ...@@ -75,6 +75,10 @@ android {
outputFileName = fileName outputFileName = fileName
} }
} }
dexOptions {
// incremental true
javaMaxHeapSize "4g"
}
} }
//dokit 扩展 //dokit 扩展
dokitExt { dokitExt {
......
...@@ -15,6 +15,7 @@ import com.gingersoft.gsa.cloud.print.PrintSocketHolder; ...@@ -15,6 +15,7 @@ import com.gingersoft.gsa.cloud.print.PrintSocketHolder;
import com.joe.print.mvp.model.bean.PrintInfoBean; import com.joe.print.mvp.model.bean.PrintInfoBean;
import com.joe.print.mvp.print.utils.MyPrintUtils; import com.joe.print.mvp.print.utils.MyPrintUtils;
import java.net.ConnectException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -269,11 +270,16 @@ public class EpsonPrint implements ReceiveListener { ...@@ -269,11 +270,16 @@ public class EpsonPrint implements ReceiveListener {
} }
} }
public void putPrintData(String ip, Bitmap bitmap,String foodId) { public void putPrintData(String ip, Bitmap bitmap, String foodId) {
//把bitmap存隊列中,下次打印 //把bitmap存隊列中,下次打印
if (bitmaps.size() <= 0) {
isPrint = false;
}
bitmaps.add(bitmap); bitmaps.add(bitmap);
ids.add(foodId); ids.add(foodId);
if (isPrint) { if (isPrint) {
Log.d("eee", "針式打印機隊列中,前面還有" + bitmaps.size() + "個任務");
PrinterPlugins.getOnPrinterFlowHandler().connectionBefore("針式打印機隊列中,前面還有" + bitmaps.size() + "個任務", ip, 0, 0, 0);
return; return;
} }
isPrint = true; isPrint = true;
...@@ -281,33 +287,52 @@ public class EpsonPrint implements ReceiveListener { ...@@ -281,33 +287,52 @@ public class EpsonPrint implements ReceiveListener {
} }
private void printData(String ip, Bitmap bitmap) { private void printData(String ip, Bitmap bitmap) {
PrinterPlugins.getOnPrinterFlowHandler().connectionBefore("針式打印機開始連接", ip, 0, 0, 0);
mPrinter.clearCommandBuffer(); mPrinter.clearCommandBuffer();
Log.d("eee", "針式打印機創建數據中,任務數:" + bitmaps.size());
if (!createPrintData(bitmap)) { if (!createPrintData(bitmap)) {
Log.d("eee", "針式打印機創建數據失敗");
//如果是創建數據失敗,說明這個數據有問題,移除掉
bitmaps.remove(bitmap);
PrinterPlugins.getOnPrinterFlowHandler().connectionError(new Exception("針式打印機添加數據失敗" + ip));
updatePrintState(PrintSocketHolder.ERROR_6); updatePrintState(PrintSocketHolder.ERROR_6);
isPrint = false;
return; return;
} }
//連接打印機 //連接打印機
connectByIp(ip, mPrinter.getStatus()); connectByIp(ip, mPrinter.getStatus());
if (mPrinter == null) { if (mPrinter == null) {
Log.d("eee", "針式打印機為空");
//連接失敗 //連接失敗
updatePrintState(PrintSocketHolder.ERROR_7); updatePrintState(PrintSocketHolder.ERROR_7);
PrinterPlugins.getOnPrinterFlowHandler().connectionError(new Exception("連接針式打印機失敗:" + ip)); PrinterPlugins.getOnPrinterFlowHandler().connectionError(new ConnectException("針式打印機連接失敗" + ip));
isPrint = false;
return; return;
} }
PrinterStatusInfo statusInfo = mPrinter.getStatus(); PrinterStatusInfo statusInfo = mPrinter.getStatus();
Log.d("eee", "針式打印機:" + "紙張狀態:" + statusInfo.getPaper() + "連接狀態:" + statusInfo.getConnection() + ",任務數:" + bitmaps.size());
if (statusInfo.getPaper() == 2) { if (statusInfo.getPaper() == 2) {
//沒紙了 //沒紙了
updatePrintState(PrintSocketHolder.ERROR_11); updatePrintState(PrintSocketHolder.ERROR_11);
PrinterPlugins.getOnPrinterFlowHandler().connectionError(new Exception("針式打印機缺紙,打印失敗" + ip));
isPrint = false;
return; return;
} else if (statusInfo.getConnection() != 1) { } else if (statusInfo.getConnection() != 1) {
//未連接到打印機 //未連接到打印機
updatePrintState(PrintSocketHolder.ERROR_7); updatePrintState(PrintSocketHolder.ERROR_7);
PrinterPlugins.getOnPrinterFlowHandler().connectionError(new ConnectException("針式打印機連接失敗" + ip));
isPrint = false;
return; return;
} }
try { try {
mPrinter.sendData(Printer.PARAM_DEFAULT); mPrinter.sendData(Printer.PARAM_DEFAULT);
isPrint = false;
PrinterPlugins.getOnPrinterFlowHandler().onPrintSuccess();
Log.d("eee", "針式打印機打印成功" + ",任務數:" + bitmaps.size());
} catch (Exception e) { } catch (Exception e) {
Log.d("eee", "針式打印機打印失敗" + ",任務數:" + bitmaps.size() + e.getMessage());
updatePrintState(PrintSocketHolder.ERROR_10); updatePrintState(PrintSocketHolder.ERROR_10);
PrinterPlugins.getOnPrinterFlowHandler().connectionError(new Exception("針式打印機打印報錯" + ip));
mPrinter.clearCommandBuffer(); mPrinter.clearCommandBuffer();
disconnectPrinter(); disconnectPrinter();
isPrint = false; isPrint = false;
...@@ -316,7 +341,7 @@ public class EpsonPrint implements ReceiveListener { ...@@ -316,7 +341,7 @@ public class EpsonPrint implements ReceiveListener {
private void connectByIp(String ip, PrinterStatusInfo statusInfo) { private void connectByIp(String ip, PrinterStatusInfo statusInfo) {
if (statusInfo != null) { if (statusInfo != null) {
LoganManager.w_printer(TAG, "連接狀態1111:"+statusInfo.getConnection()); LoganManager.w_printer(TAG, "連接狀態1111:" + statusInfo.getConnection());
if (statusInfo.getConnection() != 1) { if (statusInfo.getConnection() != 1) {
//未連接 //未連接
if (connectPrinter(ip)) { if (connectPrinter(ip)) {
...@@ -337,7 +362,7 @@ public class EpsonPrint implements ReceiveListener { ...@@ -337,7 +362,7 @@ public class EpsonPrint implements ReceiveListener {
ipAddress = ip; ipAddress = ip;
} }
} }
LoganManager.w_printer(TAG, "連接狀態222:"+statusInfo.getConnection()); LoganManager.w_printer(TAG, "連接狀態222:" + statusInfo.getConnection());
} }
private void loginfo(PrinterStatusInfo statusInfo) { private void loginfo(PrinterStatusInfo statusInfo) {
...@@ -366,7 +391,7 @@ public class EpsonPrint implements ReceiveListener { ...@@ -366,7 +391,7 @@ public class EpsonPrint implements ReceiveListener {
} catch (Exception e) { } catch (Exception e) {
Log.e(TAG, "連接打印機報錯" + e.getMessage() + e.getClass().getName()); Log.e(TAG, "連接打印機報錯" + e.getMessage() + e.getClass().getName());
e.printStackTrace(); e.printStackTrace();
LoganManager.w_printer(TAG, "連接打印機報錯:"+ e.getMessage()); LoganManager.w_printer(TAG, "連接打印機報錯:" + e.getMessage());
disconnectPrinter(); disconnectPrinter();
finalizeObject(); finalizeObject();
PrinterPlugins.getOnPrinterFlowHandler().connectionError(e); PrinterPlugins.getOnPrinterFlowHandler().connectionError(e);
...@@ -390,6 +415,7 @@ public class EpsonPrint implements ReceiveListener { ...@@ -390,6 +415,7 @@ public class EpsonPrint implements ReceiveListener {
if (receiveListener != null) { if (receiveListener != null) {
receiveListener.onPtrReceive(printer, i, printerStatusInfo, ids.get(0)); receiveListener.onPtrReceive(printer, i, printerStatusInfo, ids.get(0));
} }
Log.d("eee", "移除前:onPtrReceive" + ids.get(0) + ",任務數:" + bitmaps.size());
bitmaps.remove(0); bitmaps.remove(0);
ids.remove(0); ids.remove(0);
} }
......
...@@ -280,7 +280,7 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket ...@@ -280,7 +280,7 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket
@Override @Override
public void onRaiseException(int code, String msg) { public void onRaiseException(int code, String msg) {
//接⼝执⾏失败时,返回的异常状态 //接⼝执⾏失败时,返回的异常状态
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(code); PrinterPlugins.getOnPrinterFlowHandler().onPrintError(null, code);
LoganManager.w_printer(TAG, "商米onRaiseException: " + code + msg); LoganManager.w_printer(TAG, "商米onRaiseException: " + code + msg);
} }
...@@ -305,7 +305,7 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket ...@@ -305,7 +305,7 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket
} else { } else {
//打印失敗 //打印失敗
listener.printFailure("打印失敗"); listener.printFailure("打印失敗");
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(i); PrinterPlugins.getOnPrinterFlowHandler().onPrintError(null, i);
} }
} }
...@@ -459,7 +459,7 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket ...@@ -459,7 +459,7 @@ public abstract class PrinterRoot<T extends PrintContent> implements PrintSocket
LoganManager.w_printer(TAG, "关闭Socket出错"); LoganManager.w_printer(TAG, "关闭Socket出错");
break; break;
} }
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(null,errorCode); PrinterPlugins.getOnPrinterFlowHandler().onPrintError(null, errorCode);
setPrintState(errorCode); setPrintState(errorCode);
} }
......
...@@ -12,11 +12,9 @@ import android.util.Log; ...@@ -12,11 +12,9 @@ import android.util.Log;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.epson.epos2.Epos2Exception;
import com.epson.epos2.printer.Printer; import com.epson.epos2.printer.Printer;
import com.epson.epos2.printer.PrinterStatusInfo; import com.epson.epos2.printer.PrinterStatusInfo;
import com.epson.epos2.printer.ReceiveListener; import com.epson.epos2.printer.ReceiveListener;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import com.gingersoft.gsa.cloud.common.constans.HttpsConstans; import com.gingersoft.gsa.cloud.common.constans.HttpsConstans;
import com.gingersoft.gsa.cloud.common.constans.PrintConstans; import com.gingersoft.gsa.cloud.common.constans.PrintConstans;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager; import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
...@@ -43,9 +41,7 @@ import com.hyweb.n5.lib.constant.PrinterConstant; ...@@ -43,9 +41,7 @@ import com.hyweb.n5.lib.constant.PrinterConstant;
import com.hyweb.n5.lib.util.PrinterUtil; import com.hyweb.n5.lib.util.PrinterUtil;
import com.hyweb.n5.server.aidl.IOnPrintCallback; import com.hyweb.n5.server.aidl.IOnPrintCallback;
import com.joe.print.mvp.print.EpsonPrint; import com.joe.print.mvp.print.EpsonPrint;
import com.joe.print.mvp.print.IpPrintMaker;
import com.joe.print.mvp.print.PrintPrjKitchen; import com.joe.print.mvp.print.PrintPrjKitchen;
import com.joe.print.mvp.print.PrinterRoot;
import com.joe.print.mvp.print.common.PrinterFinderCallback; import com.joe.print.mvp.print.common.PrinterFinderCallback;
import com.joe.print.mvp.print.common.SendResultCode; import com.joe.print.mvp.print.common.SendResultCode;
import com.joe.print.mvp.print.maker.PrjPrintMaker; import com.joe.print.mvp.print.maker.PrjPrintMaker;
...@@ -56,7 +52,6 @@ import com.joe.print.mvp.print.usb.UsbPrinterFinder; ...@@ -56,7 +52,6 @@ import com.joe.print.mvp.print.usb.UsbPrinterFinder;
import com.joe.print.mvp.print.utils.MyPrintUtils; import com.joe.print.mvp.print.utils.MyPrintUtils;
import com.sunmi.peripheral.printer.InnerResultCallbcak; import com.sunmi.peripheral.printer.InnerResultCallbcak;
import com.xuexiang.rxutil2.rxjava.RxJavaUtils; import com.xuexiang.rxutil2.rxjava.RxJavaUtils;
import com.xuexiang.rxutil2.rxjava.task.RxIOTask;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
...@@ -73,9 +68,7 @@ import java.util.Set; ...@@ -73,9 +68,7 @@ import java.util.Set;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import io.reactivex.Observer; import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
import jcifs.smb.SmbFile; import jcifs.smb.SmbFile;
import jcifs.smb.SmbFileOutputStream; import jcifs.smb.SmbFileOutputStream;
...@@ -529,10 +522,11 @@ public class PrjService extends Service implements ReceiveListener { ...@@ -529,10 +522,11 @@ public class PrjService extends Service implements ReceiveListener {
updatePrjState(UpdateBean.FAIL_EPSON_INIT, epsonIds); updatePrjState(UpdateBean.FAIL_EPSON_INIT, epsonIds);
return; return;
} }
PrinterPlugins.getOnPrinterFlowHandler().connectionBefore("針式打印機", printerDeviceBean.getIp(), printerDeviceBean.getPort(), 0, 0); PrinterPlugins.getOnPrinterFlowHandler().connectionBefore("針式打印機" + bitmapMaps.size(), printerDeviceBean.getIp(), printerDeviceBean.getPort(), 0, 0);
Log.d("eee", "針式打印機本次PRJ數量:" + bitmapMaps.size());
for (int i = 0; i < bitmapMaps.size(); i++) { for (int i = 0; i < bitmapMaps.size(); i++) {
for (Map.Entry<String, Bitmap> mapEntry : bitmapMaps.get(i).entrySet()) { for (Map.Entry<String, Bitmap> mapEntry : bitmapMaps.get(i).entrySet()) {
mPrinter.putPrintData(printerDeviceBean.getIp(), mapEntry.getValue(), epsonIds); mPrinter.putPrintData(printerDeviceBean.getIp(), mapEntry.getValue(), mapEntry.getKey());
} }
} }
} }
...@@ -687,7 +681,7 @@ public class PrjService extends Service implements ReceiveListener { ...@@ -687,7 +681,7 @@ public class PrjService extends Service implements ReceiveListener {
@Override @Override
public void onRaiseException(int code, String msg) { public void onRaiseException(int code, String msg) {
//接⼝执⾏失败时,返回的异常状态 //接⼝执⾏失败时,返回的异常状态
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(code); PrinterPlugins.getOnPrinterFlowHandler().onPrintError(null, code);
LoganManager.w_printer(TAG, "商米onRaiseException: " + code + msg); LoganManager.w_printer(TAG, "商米onRaiseException: " + code + msg);
switch (code) { switch (code) {
case 3: case 3:
...@@ -751,7 +745,7 @@ public class PrjService extends Service implements ReceiveListener { ...@@ -751,7 +745,7 @@ public class PrjService extends Service implements ReceiveListener {
} else { } else {
//打印失敗 //打印失敗
updatePrjFailure(ids); updatePrjFailure(ids);
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(i); PrinterPlugins.getOnPrinterFlowHandler().onPrintError(null, i);
} }
} }
...@@ -874,7 +868,7 @@ public class PrjService extends Service implements ReceiveListener { ...@@ -874,7 +868,7 @@ public class PrjService extends Service implements ReceiveListener {
updateBeans.add(new UpdateBean(id, printState, time)); updateBeans.add(new UpdateBean(id, printState, time));
} }
String json = JsonUtils.toJson(updateBeans); String json = JsonUtils.toJson(updateBeans);
Log.e(TAG, "" + json); Log.e(TAG, "修改打印狀態:" + json);
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), json); RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), json);
//打印過後,直接再讀數據,不用管是否已更新狀態。 //打印過後,直接再讀數據,不用管是否已更新狀態。
...@@ -912,7 +906,7 @@ public class PrjService extends Service implements ReceiveListener { ...@@ -912,7 +906,7 @@ public class PrjService extends Service implements ReceiveListener {
//打印成功 //打印成功
updatePrjSuccess(s); updatePrjSuccess(s);
} else { } else {
PrinterPlugins.getOnPrinterFlowHandler().onPrintError(null,i); PrinterPlugins.getOnPrinterFlowHandler().onPrintError(null, i);
//打印失敗 //打印失敗
updatePrjFailure(s); updatePrjFailure(s);
} }
......
package com.joe.print.mvp.ui.activity; package com.joe.print.mvp.ui.activity;
import android.app.Dialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View;
import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.billy.cc.core.component.CC; import com.billy.cc.core.component.CC;
import com.billy.cc.core.component.CCResult; import com.billy.cc.core.component.CCResult;
import com.billy.cc.core.component.CCUtil; import com.billy.cc.core.component.CCUtil;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.listener.OnItemClickListener;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication; import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import com.gingersoft.gsa.cloud.common.constans.PrintConstans; import com.gingersoft.gsa.cloud.common.constans.PrintConstans;
import com.gingersoft.gsa.cloud.common.logan.LoganManager; import com.gingersoft.gsa.cloud.common.logan.LoganManager;
import com.gingersoft.gsa.cloud.common.printer.plugins.PrinterFlowListener; import com.gingersoft.gsa.cloud.common.printer.plugins.PrinterFlowListener;
import com.gingersoft.gsa.cloud.common.printer.plugins.PrinterPlugins; import com.gingersoft.gsa.cloud.common.printer.plugins.PrinterPlugins;
import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils; import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.print.PrintExecutor;
import com.gingersoft.gsa.cloud.print.PrintSocketHolder;
import com.gingersoft.gsa.cloud.print.bean.PrintContent;
import com.gingersoft.gsa.cloud.print.bean.PrjBean;
import com.gingersoft.gsa.cloud.common.utils.other.SPUtils; import com.gingersoft.gsa.cloud.common.utils.other.SPUtils;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil; import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils; import com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.database.bean.PrintCurrencyBean; import com.gingersoft.gsa.cloud.database.bean.PrintCurrencyBean;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean; import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.gingersoft.gsa.cloud.ui.utils.DialogUtils; import com.gingersoft.gsa.cloud.print.PrintExecutor;
import com.gingersoft.gsa.cloud.print.PrintSocketHolder;
import com.gingersoft.gsa.cloud.print.bean.PrintContent;
import com.gingersoft.gsa.cloud.print.bean.PrjBean;
import com.jess.arms.base.BaseActivity; import com.jess.arms.base.BaseActivity;
import com.jess.arms.di.component.AppComponent; import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils; import com.jess.arms.utils.ArmsUtils;
import com.joe.print.R;
import com.joe.print.di.component.DaggerPrintComponent; import com.joe.print.di.component.DaggerPrintComponent;
import com.joe.print.mvp.contract.PrintContract; import com.joe.print.mvp.contract.PrintContract;
import com.joe.print.mvp.presenter.PrintPresenter; import com.joe.print.mvp.presenter.PrintPresenter;
import com.joe.print.mvp.print.EpsonPrint; import com.joe.print.mvp.print.EpsonPrint;
import com.joe.print.mvp.print.OpenCashBoxMaker;
import com.joe.print.mvp.print.PrintInstruction; import com.joe.print.mvp.print.PrintInstruction;
import com.joe.print.mvp.print.PrintListener; import com.joe.print.mvp.print.PrintListener;
import com.joe.print.mvp.print.PrintPrjKitchen; import com.joe.print.mvp.print.PrintPrjKitchen;
import com.joe.print.mvp.print.PrinterRoot; import com.joe.print.mvp.print.PrinterRoot;
import com.joe.print.mvp.print.maker.OpenCashBoxMaker;
import com.joe.print.mvp.print.utils.MyPrintUtils; import com.joe.print.mvp.print.utils.MyPrintUtils;
import com.joe.print.mvp.ui.adapter.DialogPrinterListAdapter;
import com.joe.print.mvp.ui.adapter.PrintProgressAdapter;
import com.joe.print.mvp.ui.view.PrinterLoadingDialog; import com.joe.print.mvp.ui.view.PrinterLoadingDialog;
import com.joe.print.mvp.ui.view.SelectPrintDevicePopup; import com.joe.print.mvp.ui.view.SelectPrintDevicePopup;
import com.lxj.xpopup.XPopup; import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.core.CenterPopupView;
import com.lxj.xpopup.enums.PopupAnimation;
import com.lxj.xpopup.impl.LoadingPopupView;
import com.xuexiang.rxutil2.rxjava.RxJavaUtils;
import com.xuexiang.rxutil2.rxjava.task.RxAsyncTask;
import com.xuexiang.rxutil2.rxjava.task.RxUITask;
import com.yanzhenjie.recyclerview.widget.DefaultItemDecoration;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import static com.gingersoft.gsa.cloud.common.constans.PrintConstans.PRINT_BILL; import static com.gingersoft.gsa.cloud.common.constans.PrintConstans.PRINT_BILL;
import static com.gingersoft.gsa.cloud.common.constans.PrintConstans.PRINT_OTHER_CLOSING; import static com.gingersoft.gsa.cloud.common.constans.PrintConstans.PRINT_OTHER_CLOSING;
import static com.gingersoft.gsa.cloud.common.constans.PrintConstans.PRINT_OTHER_ORDER; import static com.gingersoft.gsa.cloud.common.constans.PrintConstans.PRINT_OTHER_ORDER;
......
...@@ -37,7 +37,6 @@ public class ComponentScan implements IComponent { ...@@ -37,7 +37,6 @@ public class ComponentScan implements IComponent {
@Override @Override
public boolean onCall(CC cc) { public boolean onCall(CC cc) {
String actionName = cc.getActionName(); String actionName = cc.getActionName();
Log.e("eee", "調用掃碼" + actionName);
switch (actionName) { switch (actionName) {
case "openScanActivity": case "openScanActivity":
openScanActivity(cc); openScanActivity(cc);
......
...@@ -202,7 +202,6 @@ public class FoodListAdapter extends BaseQuickAdapter<PurchaseFoodBean, BaseView ...@@ -202,7 +202,6 @@ public class FoodListAdapter extends BaseQuickAdapter<PurchaseFoodBean, BaseView
viewHolder.getView(R.id.btn_food_operation_sub).setOnLongClickListener(new View.OnLongClickListener() { viewHolder.getView(R.id.btn_food_operation_sub).setOnLongClickListener(new View.OnLongClickListener() {
@Override @Override
public boolean onLongClick(View v) { public boolean onLongClick(View v) {
// Log.e("eee", "長按:" + System.currentTimeMillis());
return false; return false;
} }
}); });
......
...@@ -113,7 +113,6 @@ public class HideUtil { ...@@ -113,7 +113,6 @@ public class HideUtil {
content.setOnTouchListener(new View.OnTouchListener() { content.setOnTouchListener(new View.OnTouchListener() {
@Override @Override
public boolean onTouch(View view, MotionEvent motionEvent) { public boolean onTouch(View view, MotionEvent motionEvent) {
Log.e("eee", "出賣人");
dispatchTouchEvent(activity, motionEvent); dispatchTouchEvent(activity, motionEvent);
return false; return false;
......
...@@ -36,7 +36,6 @@ public class ComponentWebview implements IComponent { ...@@ -36,7 +36,6 @@ public class ComponentWebview implements IComponent {
@Override @Override
public boolean onCall(CC cc) { public boolean onCall(CC cc) {
String actionName = cc.getActionName(); String actionName = cc.getActionName();
Log.e("eee", "調用webview組件" + actionName);
switch (actionName) { switch (actionName) {
case "openWebActivity": case "openWebActivity":
openWebActivity(cc); openWebActivity(cc);
......
...@@ -166,6 +166,7 @@ public class GsaCloudApplication extends BaseApplication { ...@@ -166,6 +166,7 @@ public class GsaCloudApplication extends BaseApplication {
//上傳餐廳擴展信息 //上傳餐廳擴展信息
ExpandInfoSetting.initUpdateExtendedConfiguration(uiStyleConfiguration, functionConfiguration); ExpandInfoSetting.initUpdateExtendedConfiguration(uiStyleConfiguration, functionConfiguration);
LoganManager.w_action(TAG, TAG + ": onCreate end....."); LoganManager.w_action(TAG, TAG + ": onCreate end.....");
} }
......
package com.gingersoft.gsa.cloud.print; package com.gingersoft.gsa.cloud.print;
import android.util.Log;
import com.gingersoft.gsa.cloud.common.constans.PrintConstans; import com.gingersoft.gsa.cloud.common.constans.PrintConstans;
import com.gingersoft.gsa.cloud.common.logan.LoganManager; import com.gingersoft.gsa.cloud.common.logan.LoganManager;
import com.gingersoft.gsa.cloud.common.printer.plugins.PrinterPlugins; import com.gingersoft.gsa.cloud.common.printer.plugins.PrinterPlugins;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil; import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.scwang.smartrefresh.layout.listener.OnStateChangedListener;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.net.ConnectException;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.Socket; import java.net.Socket;
import java.net.SocketTimeoutException;
import java.util.List; import java.util.List;
/** /**
...@@ -79,10 +77,6 @@ public class PrintSocketHolder { ...@@ -79,10 +77,6 @@ public class PrintSocketHolder {
e.printStackTrace(); e.printStackTrace();
LoganManager.w_printer(TAG, "連接打印機失敗: " + ip + ":" + port + "." + e.getMessage()); LoganManager.w_printer(TAG, "連接打印機失敗: " + ip + ":" + port + "." + e.getMessage());
return ERROR_7; return ERROR_7;
} catch (SocketException e) {
e.printStackTrace();
PrinterPlugins.getOnPrinterFlowHandler().connectionError(e);
return ERROR_7;
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
PrinterPlugins.getOnPrinterFlowHandler().connectionError(e); PrinterPlugins.getOnPrinterFlowHandler().connectionError(e);
......
...@@ -83,7 +83,7 @@ public class UpdateBean { ...@@ -83,7 +83,7 @@ public class UpdateBean {
*/ */
public static final int FAIL_SUNMI_NO_BLACK_MARK_DETECTED = 16; public static final int FAIL_SUNMI_NO_BLACK_MARK_DETECTED = 16;
/** /**
* 18 本地打印但是沒有找到這個型號的打印機 * 17 本地打印但是沒有找到這個型號的打印機
*/ */
public static final int FAIL_LOCAL_PRINT_NOT_DEVICE = 17; public static final int FAIL_LOCAL_PRINT_NOT_DEVICE = 17;
/** /**
...@@ -137,7 +137,7 @@ public class UpdateBean { ...@@ -137,7 +137,7 @@ public class UpdateBean {
case FAIL_NOT_PAPER: case FAIL_NOT_PAPER:
return "打印機缺紙,請檢查打印紙"; return "打印機缺紙,請檢查打印紙";
case FAIL_EPSON_INIT: case FAIL_EPSON_INIT:
return "打印機初始化失敗,請檢查設備"; return "針式打印機初始化失敗,請檢查設備";
case FAIL_SUNMI_PRINT_HOT: case FAIL_SUNMI_PRINT_HOT:
return "sunmi打印機過熱,導致無法打印,請檢查設備"; return "sunmi打印機過熱,導致無法打印,請檢查設備";
case FAIL_LID_NOT_CLOSED_SUNMI: case FAIL_LID_NOT_CLOSED_SUNMI:
......
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