Commit 5f8fe0fe by 宁斌

1、餐台 区域添加限制空格 2、Prj打印格式調整 3、堂食Prj打印不了的問題 4、冷鏈訂單號顯示字段改為TakeFoodCode

parent 048529c4
...@@ -5,10 +5,12 @@ import android.content.Context; ...@@ -5,10 +5,12 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.print.PrintManager; import android.print.PrintManager;
import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
...@@ -69,6 +71,8 @@ public class OrderDetailsActivity extends BaseActivity<OrderDetailsPresenter> im ...@@ -69,6 +71,8 @@ public class OrderDetailsActivity extends BaseActivity<OrderDetailsPresenter> im
TextView mTvCreateTime; TextView mTvCreateTime;
@BindView(R2.id.tv_receiver) @BindView(R2.id.tv_receiver)
TextView mTvReceiver; TextView mTvReceiver;
@BindView(R2.id.rl_bill_num)
RelativeLayout rl_bill_num;
@BindView(R2.id.tv_bill_num) @BindView(R2.id.tv_bill_num)
TextView mTvOrderNum; TextView mTvOrderNum;
@BindView(R2.id.tv_receive_phone) @BindView(R2.id.tv_receive_phone)
...@@ -233,10 +237,15 @@ public class OrderDetailsActivity extends BaseActivity<OrderDetailsPresenter> im ...@@ -233,10 +237,15 @@ public class OrderDetailsActivity extends BaseActivity<OrderDetailsPresenter> im
} }
mTvOrderNo.setText(getResources().getString(R.string.order_no) + bean.getORDER_NO()); mTvOrderNo.setText(getResources().getString(R.string.order_no) + bean.getORDER_NO());
mTvCreateTime.setText(getResources().getString(R.string.create_order_time) + TimeUtils.parseTimeRepeat(bean.getCREATE_TIME(), TimeUtils.DEFAULT_DATE_FORMAT)); mTvCreateTime.setText(getResources().getString(R.string.create_order_time) + TimeUtils.parseTimeRepeat(bean.getCREATE_TIME(), TimeUtils.DEFAULT_DATE_FORMAT));
if(TextUtil.isNotEmptyOrNullOrUndefined(bean.getRECEIVER())) { if (TextUtil.isNotEmptyOrNullOrUndefined(bean.getRECEIVER())) {
mTvReceiver.setText(bean.getRECEIVER()); mTvReceiver.setText(bean.getRECEIVER());
} }
mTvOrderNum.setText(bean.getBillNo()); if (!TextUtils.isEmpty(bean.getTakeFoodCode()) && !bean.getTakeFoodCode().equals("0")) {
rl_bill_num.setVisibility(View.VISIBLE);
mTvOrderNum.setText(bean.getTakeFoodCode());
} else {
rl_bill_num.setVisibility(View.GONE);
}
mTvReceiverPhone.setText(bean.getPHONE()); mTvReceiverPhone.setText(bean.getPHONE());
mTvReceiverTime.setText(TextUtil.isNotEmptyOrNullOrUndefined(bean.getTakeTime()) ? bean.getTakeTime() : bean.getSEND_TIME()); mTvReceiverTime.setText(TextUtil.isNotEmptyOrNullOrUndefined(bean.getTakeTime()) ? bean.getTakeTime() : bean.getSEND_TIME());
mTvReceiverAddress.setText(bean.getAddressDetail()); mTvReceiverAddress.setText(bean.getAddressDetail());
......
...@@ -137,6 +137,7 @@ ...@@ -137,6 +137,7 @@
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/rl_bill_num"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_14" android:layout_marginTop="@dimen/dp_14"
......
...@@ -144,12 +144,12 @@ class HistoryOrderAdapter(var stauts: String?, private val context: Context, var ...@@ -144,12 +144,12 @@ class HistoryOrderAdapter(var stauts: String?, private val context: Context, var
return "退款完成" return "退款完成"
} }
else -> { else -> {
when (payType) { when (orderPayType) {
1 -> { 1 -> {
return "無" return "無"
} }
else -> { else -> {
when (orderPayType) { when (payType) {
PayTypeContract.PAY_METHOD_ID_1021 -> { //Google pay需要5-7天 PayTypeContract.PAY_METHOD_ID_1021 -> { //Google pay需要5-7天
return "退款中(預計5-7個工作日退回原賬戶)" return "退款中(預計5-7個工作日退回原賬戶)"
} }
......
...@@ -49,9 +49,9 @@ class HistoryFragment : BaseFragment(R.layout.fragment_other_order) { ...@@ -49,9 +49,9 @@ class HistoryFragment : BaseFragment(R.layout.fragment_other_order) {
context?.let { context -> context?.let { context ->
var reasonDesc = it.reasonDesc var reasonDesc = it.reasonDesc
if (reasonDesc == null) { if (reasonDesc == null) {
reasonDesc = ""; reasonDesc = ""
} }
OtherOrderUtils.showOrderDetailsDialog(context, it2, it.orderStatus, it.orderType,it.payType, it.status, reasonDesc, true) { _, _, _ -> OtherOrderUtils.showOrderDetailsDialog(context, it2, it.orderStatus, it.orderType,it.orderPayType,it.payType, it.status, reasonDesc, true) { _, _, _ ->
//重印 //重印
showLoading() showLoading()
viewModel.printOrder(context, it) { viewModel.printOrder(context, it) {
......
...@@ -31,7 +31,7 @@ import java.lang.Double.parseDouble ...@@ -31,7 +31,7 @@ import java.lang.Double.parseDouble
object OtherOrderUtils { object OtherOrderUtils {
fun showOrderDetailsDialog(context: Context, data: OrderDetails, orderStuats: Int, orderType: Int, payType: Int, refundStatus: Int, reasonDesc: String = "", isHistory: Boolean = false, listenter: ((view: View, data: OrderDetails.DataBean, dialog: Dialog) -> Unit)?) { fun showOrderDetailsDialog(context: Context, data: OrderDetails, orderStuats: Int, orderType: Int,orderPayType :Int, payType: Int, refundStatus: Int, reasonDesc: String = "", isHistory: Boolean = false, listenter: ((view: View, data: OrderDetails.DataBean, dialog: Dialog) -> Unit)?) {
object : DialogUtils(context, R.layout.layout_order_info_dialog_new) { object : DialogUtils(context, R.layout.layout_order_info_dialog_new) {
override fun initLayout(hepler: ViewHepler, dialog: Dialog) { override fun initLayout(hepler: ViewHepler, dialog: Dialog) {
if (data.data != null) { if (data.data != null) {
...@@ -117,7 +117,7 @@ object OtherOrderUtils { ...@@ -117,7 +117,7 @@ object OtherOrderUtils {
6 -> { 6 -> {
//已取消訂單 //已取消訂單
ivOrderState.setImageResource(R.drawable.img_cancelled) ivOrderState.setImageResource(R.drawable.img_cancelled)
setOrderReason(hepler, orderStuats, refundStatus, orderType,payType, reasonDesc) setOrderReason(hepler, orderStuats, refundStatus, orderPayType,payType, reasonDesc)
} }
} }
// val payName = StringBuffer() // val payName = StringBuffer()
...@@ -257,12 +257,12 @@ object OtherOrderUtils { ...@@ -257,12 +257,12 @@ object OtherOrderUtils {
return "退款完成" return "退款完成"
} }
else -> { else -> {
when (payType) { when (orderPayType) {
1 -> { 1 -> {
return "無" return "無"
} }
else -> { else -> {
when (orderPayType) { when (payType) {
PayTypeContract.PAY_METHOD_ID_1021 -> { //Google pay需要5-7天 PayTypeContract.PAY_METHOD_ID_1021 -> { //Google pay需要5-7天
return "退款中(預計5-7個工作日退回原賬戶)" return "退款中(預計5-7個工作日退回原賬戶)"
} }
......
...@@ -85,6 +85,12 @@ public class DownloadActivity extends BaseActivity<DownloadPresenter> implements ...@@ -85,6 +85,12 @@ public class DownloadActivity extends BaseActivity<DownloadPresenter> implements
} }
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTransparent(this);
}
@Override
public int initView(@Nullable Bundle savedInstanceState) { public int initView(@Nullable Bundle savedInstanceState) {
return R.layout.download_data_activity_download; //如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0 return R.layout.download_data_activity_download; //如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -4,7 +4,6 @@ import android.animation.AnimatorSet; ...@@ -4,7 +4,6 @@ import android.animation.AnimatorSet;
import android.animation.ObjectAnimator; import android.animation.ObjectAnimator;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.PersistableBundle;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.view.animation.Animation; import android.view.animation.Animation;
...@@ -13,12 +12,10 @@ import android.view.animation.DecelerateInterpolator; ...@@ -13,12 +12,10 @@ import android.view.animation.DecelerateInterpolator;
import android.view.animation.ScaleAnimation; import android.view.animation.ScaleAnimation;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.viewpager2.widget.ViewPager2; import androidx.viewpager2.widget.ViewPager2;
import com.gingersoft.gsa.cloud.common.core.login.LoginBean; import com.gingersoft.gsa.cloud.common.core.login.LoginBean;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager; import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import com.gingersoft.gsa.cloud.common.core.user.UserConstans; import com.gingersoft.gsa.cloud.common.core.user.UserConstans;
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity <activity
android:name=".mvp.ui.activity.NewMainActivity" android:name=".mvp.ui.activity.NewMainActivity"
android:launchMode="singleTop" /> android:launchMode="singleTop"
android:screenOrientation="portrait"/>
<activity <activity
android:name=".mvp.ui.activity.ExpandListActivity" android:name=".mvp.ui.activity.ExpandListActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
......
...@@ -24,6 +24,7 @@ import androidx.recyclerview.widget.LinearLayoutManager; ...@@ -24,6 +24,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.billy.cc.core.component.CC; import com.billy.cc.core.component.CC;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import com.gingersoft.gsa.cloud.common.constans.AppConstans; import com.gingersoft.gsa.cloud.common.constans.AppConstans;
import com.gingersoft.gsa.cloud.common.constans.ResultConstans; import com.gingersoft.gsa.cloud.common.constans.ResultConstans;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager; import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
...@@ -36,6 +37,7 @@ import com.gingersoft.gsa.cloud.common.function.jump.ActivityJumpStrategy; ...@@ -36,6 +37,7 @@ import com.gingersoft.gsa.cloud.common.function.jump.ActivityJumpStrategy;
import com.gingersoft.gsa.cloud.common.logan.LoganManager; import com.gingersoft.gsa.cloud.common.logan.LoganManager;
import com.gingersoft.gsa.cloud.common.utils.AppDevices; import com.gingersoft.gsa.cloud.common.utils.AppDevices;
import com.gingersoft.gsa.cloud.common.utils.JsonUtils; import com.gingersoft.gsa.cloud.common.utils.JsonUtils;
import com.gingersoft.gsa.cloud.common.utils.StytemUtils;
import com.gingersoft.gsa.cloud.common.utils.encryption.Aes; import com.gingersoft.gsa.cloud.common.utils.encryption.Aes;
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.toast.ToastUtils; import com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils;
...@@ -202,12 +204,15 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl ...@@ -202,12 +204,15 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
} else { } else {
tv_version_name.setText("v_" + DeviceUtils.getVersionName(this)); tv_version_name.setText("v_" + DeviceUtils.getVersionName(this));
} }
boolean prjServiceRunning = StytemUtils.isServiceRunning("com.joe.print.mvp.print.service.PrjService", this);
if (!prjServiceRunning) {
//開啟Prj打印服務 //開啟Prj打印服務
CC.obtainBuilder(ComponentName.COMPONENT_PRINT) CC.obtainBuilder(ComponentName.COMPONENT_PRINT)
.setActionName("openPrintService") .setActionName("openPrintService")
.build() .build()
.call(); .call();
} }
}
@Override @Override
protected void onRestart() { protected void onRestart() {
...@@ -230,16 +235,14 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl ...@@ -230,16 +235,14 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_about_us, "關於我們")); mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_about_us, "關於我們"));
mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_password, "修改密碼")); mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_password, "修改密碼"));
mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_setting, "設置")); mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_setting, "設置"));
}
mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_setting, "查看日誌")); mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_setting, "查看日誌"));
mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_setting, "上傳日誌")); mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_setting, "上傳日誌"));
mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_setting, "切換環境"));
}
mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_settlement_report, "清機")); mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_settlement_report, "清機"));
if (AppDevices.isHywebPos()) { if (AppDevices.isHywebPos()) {
mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_settlement_report, "N5清機")); mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_settlement_report, "N5清機"));
} }
if (BuildConfig.DEBUG) {
mainSideMenuBeans.add(new MainSideMenuBean(R.drawable.ic_setting, "切換環境"));
}
MainSideMenuAdapter adapter = new MainSideMenuAdapter(mainSideMenuBeans); MainSideMenuAdapter adapter = new MainSideMenuAdapter(mainSideMenuBeans);
mRvSideMenu.setAdapter(adapter); mRvSideMenu.setAdapter(adapter);
adapter.setOnItemClickListener((adapter1, view, position) -> { adapter.setOnItemClickListener((adapter1, view, position) -> {
......
...@@ -324,6 +324,7 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent ...@@ -324,6 +324,7 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
} }
} }
public List<TableArea> getTableAreaList() { public List<TableArea> getTableAreaList() {
return mTableAreaList; return mTableAreaList;
} }
......
...@@ -230,9 +230,13 @@ public class AddAreaFragment extends BaseFragment<AddAreaPresenter> implements A ...@@ -230,9 +230,13 @@ public class AddAreaFragment extends BaseFragment<AddAreaPresenter> implements A
@Override @Override
public void killMyself() { public void killMyself() {
_mActivity.onBackPressed(); _mActivity.onBackPressedSupport();
} }
@Override
public boolean onBackPressedSupport() {
return super.onBackPressedSupport();
}
public AreaRequest.Add createAddAreaRequest() { public AreaRequest.Add createAddAreaRequest() {
int restaurantId = RestaurantInfoManager.newInstance().getRestaurantId(); int restaurantId = RestaurantInfoManager.newInstance().getRestaurantId();
......
...@@ -425,7 +425,12 @@ public class AddTableFragment extends BaseFragment<AddTablePresenter> implements ...@@ -425,7 +425,12 @@ public class AddTableFragment extends BaseFragment<AddTablePresenter> implements
@Override @Override
public void killMyself() { public void killMyself() {
_mActivity.onBackPressed(); _mActivity.onBackPressedSupport();
}
@Override
public boolean onBackPressedSupport() {
return super.onBackPressedSupport();
} }
public TableRequest.Add createAddTableRequest() { public TableRequest.Add createAddTableRequest() {
......
...@@ -382,7 +382,7 @@ public class AreaListFragment extends BaseFragment<AreaListPresenter> implements ...@@ -382,7 +382,7 @@ public class AreaListFragment extends BaseFragment<AreaListPresenter> implements
@Override @Override
public void killMyself() { public void killMyself() {
_mActivity.onBackPressed(); _mActivity.onBackPressedSupport();
} }
private View.OnClickListener onRetryClickListener = new View.OnClickListener() { private View.OnClickListener onRetryClickListener = new View.OnClickListener() {
......
...@@ -2,6 +2,7 @@ package com.joe.print.mvp.print; ...@@ -2,6 +2,7 @@ package com.joe.print.mvp.print;
import android.content.Context; import android.content.Context;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
...@@ -293,7 +294,7 @@ public class PrintPrjKitchen extends PrinterRoot { ...@@ -293,7 +294,7 @@ public class PrintPrjKitchen extends PrinterRoot {
if (!TextUtil.isEmptyOrNullOrUndefined(prjBean.getBillNo())) { if (!TextUtil.isEmptyOrNullOrUndefined(prjBean.getBillNo())) {
//訂單碼不為空 //訂單碼不為空
tvOrderNumberText.setText("訂單碼"); tvOrderNumberText.setText("訂單碼:");
tvOrderNumber.setText(prjBean.getBillNo()); tvOrderNumber.setText(prjBean.getBillNo());
} else { } else {
//訂單號 //訂單號
...@@ -326,12 +327,16 @@ public class PrintPrjKitchen extends PrinterRoot { ...@@ -326,12 +327,16 @@ public class PrintPrjKitchen extends PrinterRoot {
layoutOpenTableTime.setVisibility(View.GONE); layoutOpenTableTime.setVisibility(View.GONE);
tvTableNumber.setText("外賣"); tvTableNumber.setText("外賣");
tvTableNumber2.setText("外賣"); tvTableNumber2.setText("外賣");
tvOrderNumberText.setText("訂單碼"); tvOrderNumberText.setText("訂單碼:");
tvOrderNumber.setText(prjBean.getTakeFoodCode()); tvOrderNumber.setText(prjBean.getTakeFoodCode());
break; break;
} }
//操作人員名稱 //操作人員名稱0
if (!TextUtils.isEmpty(prjBean.getUserName())) {
tvWaiter.setText(prjBean.getUserName()); tvWaiter.setText(prjBean.getUserName());
} else {
tvWaiter.setText(prjBean.getMemberName());
}
// if (TextUtil.isEmptyOrNullOrUndefined(prjBean.getTableName())) { // if (TextUtil.isEmptyOrNullOrUndefined(prjBean.getTableName())) {
// layoutOpenTableTime.setVisibility(View.GONE); // layoutOpenTableTime.setVisibility(View.GONE);
// switch (prjBean.getOrderType()) { // switch (prjBean.getOrderType()) {
...@@ -372,9 +377,9 @@ public class PrintPrjKitchen extends PrinterRoot { ...@@ -372,9 +377,9 @@ public class PrintPrjKitchen extends PrinterRoot {
view.findViewById(R.id.tv_people).setVisibility(View.VISIBLE); view.findViewById(R.id.tv_people).setVisibility(View.VISIBLE);
} }
if (TextUtil.isNotEmptyOrNullOrUndefined(prjBean.getTakeTime())) { if (TextUtil.isNotEmptyOrNullOrUndefined(prjBean.getTakeTime())) {
tvTakeTime.setText("取餐時間:" + prjBean.getTakeTime()); tvTakeTime.setText("取餐:" + prjBean.getTakeTime());
} else if (TextUtil.isNotEmptyOrNullOrUndefined(prjBean.getSendTime())) { } else if (TextUtil.isNotEmptyOrNullOrUndefined(prjBean.getSendTime())) {
tvTakeTime.setText("送達時間:" + prjBean.getSendTime()); tvTakeTime.setText("送達:" + prjBean.getSendTime());
} else { } else {
tvTakeTime.setVisibility(View.GONE); tvTakeTime.setVisibility(View.GONE);
} }
......
...@@ -8,6 +8,7 @@ import android.graphics.Bitmap; ...@@ -8,6 +8,7 @@ import android.graphics.Bitmap;
import android.os.Build; import android.os.Build;
import android.os.IBinder; import android.os.IBinder;
import android.os.RemoteException; import android.os.RemoteException;
import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
...@@ -119,7 +120,7 @@ public class PrjService extends Service implements ReceiveListener { ...@@ -119,7 +120,7 @@ public class PrjService extends Service implements ReceiveListener {
public int onStartCommand(Intent intent, int flags, int startId) { public int onStartCommand(Intent intent, int flags, int startId) {
mContext = this; mContext = this;
ThreadPoolManager.getInstence().putExecutableTasks(() -> { ThreadPoolManager.getInstence().putExecutableTasks(() -> {
LoganManager.w_printer(TAG, "currentThreadName: "+Thread.currentThread().getName()); LoganManager.w_printer(TAG, "currentThreadName: " + Thread.currentThread().getName());
LoganManager.w_printer(TAG, "開始請求 PRJ 數據"); LoganManager.w_printer(TAG, "開始請求 PRJ 數據");
getPrintList(); getPrintList();
//開始請求 //開始請求
...@@ -214,7 +215,7 @@ public class PrjService extends Service implements ReceiveListener { ...@@ -214,7 +215,7 @@ public class PrjService extends Service implements ReceiveListener {
@Override @Override
public void onSubscribe(Disposable d) { public void onSubscribe(Disposable d) {
LoganManager.w_printer(TAG, "RxCurrentThreadName: "+Thread.currentThread().getName()); LoganManager.w_printer(TAG, "RxCurrentThreadName: " + Thread.currentThread().getName());
LoganManager.w_printer(TAG, "getPrjInfo onSubscribe"); LoganManager.w_printer(TAG, "getPrjInfo onSubscribe");
} }
...@@ -533,7 +534,7 @@ public class PrjService extends Service implements ReceiveListener { ...@@ -533,7 +534,7 @@ public class PrjService extends Service implements ReceiveListener {
if (beans.size() > 0) { if (beans.size() > 0) {
orderType = beans.get(0).getOrderType(); orderType = beans.get(0).getOrderType();
} }
PrintPaperPlugins.getOnPrinterFlowHandler().onPrinterDataBefore(orderType,GsonUtils.GsonString(beans), GsonUtils.GsonString(printerDeviceBean)); PrintPaperPlugins.getOnPrinterFlowHandler().onPrinterDataBefore(orderType, GsonUtils.GsonString(beans), GsonUtils.GsonString(printerDeviceBean));
if (isPinPrinter(printerDeviceBean) && printerDeviceBean.getPrinterDeviceType() == PRINT_IP) { if (isPinPrinter(printerDeviceBean) && printerDeviceBean.getPrinterDeviceType() == PRINT_IP) {
//針式打印機並且打印機類型為IP打印,生成獨特的格式 //針式打印機並且打印機類型為IP打印,生成獨特的格式
...@@ -931,13 +932,20 @@ public class PrjService extends Service implements ReceiveListener { ...@@ -931,13 +932,20 @@ public class PrjService extends Service implements ReceiveListener {
} }
if (bitmapMaps.size() > 0) { if (bitmapMaps.size() > 0) {
String prjName = null; String prjName = String.valueOf(System.currentTimeMillis());
int orderType = 1; int orderType = 1;
if (beans.size() > 0) { if (beans.size() > 0) {
prjName = beans.get(0).getBillNo().isEmpty() ? beans.get(0).getOrderNo() : beans.get(0).getBillNo(); PrjBean.DataBean.Bean prjBean = beans.get(0);
orderType = beans.get(0).getOrderType(); if (prjBean != null) {
if (!TextUtils.isEmpty(prjBean.getBillNo())) {
prjName = prjBean.getBillNo();
} else {
prjName = prjBean.getOrderNo();
}
orderType = prjBean.getOrderType();
}
} }
PrintPaperPlugins.getOnPrinterFlowHandler().onPrinterBitmapBefore(orderType,prjName, bitmapMaps); PrintPaperPlugins.getOnPrinterFlowHandler().onPrinterBitmapBefore(orderType, prjName, bitmapMaps);
} }
return bitmapMaps; return bitmapMaps;
......
...@@ -168,7 +168,6 @@ public class OrderCenterAdapter extends DefaultAdapter<OrderManagerResponse> { ...@@ -168,7 +168,6 @@ public class OrderCenterAdapter extends DefaultAdapter<OrderManagerResponse> {
private void setBtnListener(OrderManagerResponse orderBean) { private void setBtnListener(OrderManagerResponse orderBean) {
if (orderBean.getStatus() != OrderStatusContract.STATUS_6) { if (orderBean.getStatus() != OrderStatusContract.STATUS_6) {
if (orderBean.isCurrDeviceOrder()) { if (orderBean.isCurrDeviceOrder()) {
if (orderBean.getMatterStatus() == OrderManagerResponse.MATTER_STATUS_SUCCESS) { if (orderBean.getMatterStatus() == OrderManagerResponse.MATTER_STATUS_SUCCESS) {
cb_order.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { cb_order.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
...@@ -226,16 +225,6 @@ public class OrderCenterAdapter extends DefaultAdapter<OrderManagerResponse> { ...@@ -226,16 +225,6 @@ public class OrderCenterAdapter extends DefaultAdapter<OrderManagerResponse> {
void onItemClick(OrderManagerResponse datasBean, int position); void onItemClick(OrderManagerResponse datasBean, int position);
// void onPrintClick(OrderManagerResponse datasBean, int position);
//
// void onModifyClick(OrderManagerResponse datasBean, int position);
//
// void onCancelClick(OrderManagerResponse datasBean, int position);
//
// void onRefundClick(OrderManagerResponse datasBean, int position);
//
// void onTipsClick(OrderManagerResponse datasBean, int position);
void onCheckedChanged(OrderManagerResponse checkedOrder); void onCheckedChanged(OrderManagerResponse checkedOrder);
void onReloadExceptionStatus(OrderManagerResponse datasBean, String txnId); void onReloadExceptionStatus(OrderManagerResponse datasBean, String txnId);
......
...@@ -58,7 +58,7 @@ import static com.jess.arms.utils.ThirdViewUtil.convertAutoView; ...@@ -58,7 +58,7 @@ import static com.jess.arms.utils.ThirdViewUtil.convertAutoView;
* <a href="https://github.com/JessYanCoding">Follow me</a> * <a href="https://github.com/JessYanCoding">Follow me</a>
* ================================================ * ================================================
*/ */
public abstract class BaseActivity<P extends IPresenter> extends QMUIActivity implements IActivity, ActivityLifecycleable { public abstract class BaseActivity<P extends IPresenter> extends AppCompatActivity implements IActivity, ActivityLifecycleable {
protected final String TAG = this.getClass().getSimpleName(); protected final String TAG = this.getClass().getSimpleName();
private final BehaviorSubject<ActivityEvent> mLifecycleSubject = BehaviorSubject.create(); private final BehaviorSubject<ActivityEvent> mLifecycleSubject = BehaviorSubject.create();
private Cache<String, Object> mCache; private Cache<String, Object> mCache;
......
...@@ -61,7 +61,7 @@ import me.yokeyword.fragmentation.anim.FragmentAnimator; ...@@ -61,7 +61,7 @@ import me.yokeyword.fragmentation.anim.FragmentAnimator;
* <a href="https://github.com/JessYanCoding">Follow me</a> * <a href="https://github.com/JessYanCoding">Follow me</a>
* ================================================ * ================================================
*/ */
public abstract class BaseFragment<P extends IPresenter> extends QMUIFragment implements IFragment, ISupportFragment, FragmentLifecycleable { public abstract class BaseFragment<P extends IPresenter> extends Fragment implements IFragment, ISupportFragment, FragmentLifecycleable {
protected final String TAG = this.getClass().getSimpleName(); protected final String TAG = this.getClass().getSimpleName();
private final BehaviorSubject<FragmentEvent> mLifecycleSubject = BehaviorSubject.create(); private final BehaviorSubject<FragmentEvent> mLifecycleSubject = BehaviorSubject.create();
private Cache<String, Object> mCache; private Cache<String, Object> mCache;
...@@ -140,30 +140,32 @@ public abstract class BaseFragment<P extends IPresenter> extends QMUIFragment im ...@@ -140,30 +140,32 @@ public abstract class BaseFragment<P extends IPresenter> extends QMUIFragment im
mDelegate.onActivityCreated(savedInstanceState); mDelegate.onActivityCreated(savedInstanceState);
} }
@Override
protected View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container) {
mCacheRootView = initView(inflater, container, null);
return mCacheRootView;
}
// @Nullable
// @Override // @Override
// public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { // protected View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container) {
// if (view != null) { // mCacheRootView = initView(inflater, container, null);
// ViewGroup viewGroup = (ViewGroup) view.getRootView(); // return mCacheRootView;
// if (viewGroup != null) {
// viewGroup.removeView(view);
// }
// return view;
// }
// view = initView(inflater, container, savedInstanceState);
// return view;
// } // }
private View view;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
if (view != null) {
ViewGroup viewGroup = (ViewGroup) view.getRootView();
if (viewGroup != null) {
viewGroup.removeView(view);
}
return view;
}
view = initView(inflater, container, savedInstanceState);
return view;
}
@Nullable @Nullable
@Override @Override
public View getView() { public View getView() {
return mCacheRootView; return view;
} }
/** /**
......
...@@ -64,7 +64,7 @@ import static com.jess.arms.utils.ThirdViewUtil.convertAutoView; ...@@ -64,7 +64,7 @@ import static com.jess.arms.utils.ThirdViewUtil.convertAutoView;
* <a href="https://github.com/JessYanCoding">Follow me</a> * <a href="https://github.com/JessYanCoding">Follow me</a>
* ================================================ * ================================================
*/ */
public abstract class BaseFragmentActivity<P extends IPresenter> extends QMUIActivity implements IActivity, ISupportActivity, ActivityLifecycleable { public abstract class BaseFragmentActivity<P extends IPresenter> extends FragmentActivity implements IActivity, ISupportActivity, ActivityLifecycleable {
protected final String TAG = this.getClass().getSimpleName(); protected final String TAG = this.getClass().getSimpleName();
private final BehaviorSubject<ActivityEvent> mLifecycleSubject = BehaviorSubject.create(); private final BehaviorSubject<ActivityEvent> mLifecycleSubject = BehaviorSubject.create();
private Cache<String, Object> mCache; private Cache<String, Object> mCache;
...@@ -182,7 +182,7 @@ public abstract class BaseFragmentActivity<P extends IPresenter> extends QMUIAct ...@@ -182,7 +182,7 @@ public abstract class BaseFragmentActivity<P extends IPresenter> extends QMUIAct
*/ */
@Override @Override
final public void onBackPressed() { final public void onBackPressed() {
super.onBackPressed(); // super.onBackPressed();
mDelegate.onBackPressed(); mDelegate.onBackPressed();
} }
......
...@@ -17,6 +17,7 @@ package com.jess.arms.utils; ...@@ -17,6 +17,7 @@ package com.jess.arms.utils;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.app.Activity; import android.app.Activity;
import android.app.ActivityManager;
import android.app.Dialog; import android.app.Dialog;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
import android.content.ClipboardManager; import android.content.ClipboardManager;
...@@ -1142,6 +1143,27 @@ public class DeviceUtils { ...@@ -1142,6 +1143,27 @@ public class DeviceUtils {
} }
return sb.toString().toUpperCase(Locale.CHINA); return sb.toString().toUpperCase(Locale.CHINA);
} }
/**
* 判断服务是否正在运行
*
* @param serviceName 服务类的全路径名称 例如: com.jaychan.demo.service.PushService
* @param context 上下文对象
* @return
*/
public static boolean isServiceRunning(String serviceName, Context context) {
//活动管理器
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningServiceInfo> runningServices = am.getRunningServices(100); //获取运行的服务,参数表示最多返回的数量
for (ActivityManager.RunningServiceInfo runningServiceInfo : runningServices) {
String className = runningServiceInfo.service.getClassName();
if (className.equals(serviceName)) {
return true; //判断服务是否运行
}
}
return false;
}
} }
package com.gingersoft.gsa.cloud.common.utils; package com.gingersoft.gsa.cloud.common.utils;
import android.app.ActivityManager;
import android.content.Context;
import java.util.List;
/** /**
* @作者: bin * @作者: bin
* @創建時間: 2021-01-28 15:18 * @創建時間: 2021-01-28 15:18
...@@ -7,4 +12,27 @@ package com.gingersoft.gsa.cloud.common.utils; ...@@ -7,4 +12,27 @@ package com.gingersoft.gsa.cloud.common.utils;
* @描述: * @描述:
*/ */
public class StytemUtils { public class StytemUtils {
/**
* 判断服务是否正在运行
*
* @param serviceName 服务类的全路径名称 例如: com.jaychan.demo.service.PushService
* @param context 上下文对象
* @return
*/
public static boolean isServiceRunning(String serviceName, Context context) {
//活动管理器
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningServiceInfo> runningServices = am.getRunningServices(100); //获取运行的服务,参数表示最多返回的数量
for (ActivityManager.RunningServiceInfo runningServiceInfo : runningServices) {
String className = runningServiceInfo.service.getClassName();
if (className.equals(serviceName)) {
return true; //判断服务是否运行
}
}
return false;
}
} }
...@@ -68,9 +68,13 @@ public class PrjBean { ...@@ -68,9 +68,13 @@ public class PrjBean {
*/ */
private int orderType; private int orderType;
/** /**
* 服務員名稱 * 用户名称
*/ */
private String userName; private String userName;
/**
* 服務員名稱
*/
private String memberName;
/*** /***
* 層級 * 層級
* 1:主食品 * 1:主食品
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
style="@style/Print_text_style" style="@style/Print_text_style"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="落單時間:" android:text="落單:"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/sp_18" /> android:textSize="@dimen/sp_18" />
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
style="@style/Print_text_style" style="@style/Print_text_style"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="開檯時間:" android:text="開檯:"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/sp_18" /> android:textSize="@dimen/sp_18" />
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
style="@style/Print_text_style" style="@style/Print_text_style"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="人數" android:text="人數:"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/sp_18" android:textSize="@dimen/sp_18"
android:visibility="visible" /> android:visibility="visible" />
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20" android:layout_marginLeft="@dimen/dp_20"
android:text="廚房" android:text="廚房:"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/sp_18" android:textSize="@dimen/sp_18"
android:visibility="visible" /> android:visibility="visible" />
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
android:id="@+id/tv_order_num_text" android:id="@+id/tv_order_num_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="單號" android:text="單號:"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/sp_18" /> android:textSize="@dimen/sp_18" />
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
style="@style/Print_text_style" style="@style/Print_text_style"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="取餐碼" android:text="取餐碼:"
android:textSize="@dimen/sp_18" android:textSize="@dimen/sp_18"
android:visibility="gone" /> android:visibility="gone" />
...@@ -221,7 +221,7 @@ ...@@ -221,7 +221,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
app:layout_constraintLeft_toLeftOf="@+id/ll_order" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ll_take_code"> app:layout_constraintTop_toBottomOf="@+id/ll_take_code">
<TextView <TextView
...@@ -229,7 +229,7 @@ ...@@ -229,7 +229,7 @@
style="@style/Print_text_style" style="@style/Print_text_style"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="服務員" android:text="服務員:"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/sp_18" /> android:textSize="@dimen/sp_18" />
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
android:id="@+id/line_kitchen_info" android:id="@+id/line_kitchen_info"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5" android:layout_marginTop="@dimen/dp_12"
android:maxLines="1" android:maxLines="1"
android:text="————————————————————————————————————————————" android:text="————————————————————————————————————————————"
android:textSize="@dimen/sp_18" android:textSize="@dimen/sp_18"
...@@ -359,7 +359,7 @@ ...@@ -359,7 +359,7 @@
<!-- style="@style/Print_text_style"--> <!-- style="@style/Print_text_style"-->
<!-- android:layout_width="wrap_content"--> <!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"--> <!-- android:layout_height="wrap_content"-->
<!-- android:text="落單時間"--> <!-- android:text="落單時間:"-->
<!-- android:textColor="@color/black"--> <!-- android:textColor="@color/black"-->
<!-- android:textSize="@dimen/sp_18" />--> <!-- android:textSize="@dimen/sp_18" />-->
...@@ -382,7 +382,7 @@ ...@@ -382,7 +382,7 @@
<!-- android:id="@+id/tv_order_num_text"--> <!-- android:id="@+id/tv_order_num_text"-->
<!-- android:layout_width="wrap_content"--> <!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"--> <!-- android:layout_height="wrap_content"-->
<!-- android:text="單號"--> <!-- android:text="單號:"-->
<!-- android:textColor="@color/black"--> <!-- android:textColor="@color/black"-->
<!-- android:textSize="@dimen/sp_18" />--> <!-- android:textSize="@dimen/sp_18" />-->
...@@ -406,7 +406,7 @@ ...@@ -406,7 +406,7 @@
<!-- style="@style/Print_text_style"--> <!-- style="@style/Print_text_style"-->
<!-- android:layout_width="wrap_content"--> <!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"--> <!-- android:layout_height="wrap_content"-->
<!-- android:text="取餐碼"--> <!-- android:text="取餐碼:"-->
<!-- android:textSize="@dimen/dp_20"--> <!-- android:textSize="@dimen/dp_20"-->
<!-- android:visibility="gone" />--> <!-- android:visibility="gone" />-->
...@@ -429,7 +429,7 @@ ...@@ -429,7 +429,7 @@
<!-- style="@style/Print_text_style"--> <!-- style="@style/Print_text_style"-->
<!-- android:layout_width="wrap_content"--> <!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"--> <!-- android:layout_height="wrap_content"-->
<!-- android:text="落單時間"--> <!-- android:text="落單時間:"-->
<!-- android:textColor="@color/black"--> <!-- android:textColor="@color/black"-->
<!-- android:textSize="@dimen/sp_18" />--> <!-- android:textSize="@dimen/sp_18" />-->
...@@ -462,7 +462,7 @@ ...@@ -462,7 +462,7 @@
<!-- style="@style/Print_text_style"--> <!-- style="@style/Print_text_style"-->
<!-- android:layout_width="wrap_content"--> <!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"--> <!-- android:layout_height="wrap_content"-->
<!-- android:text="開檯時間"--> <!-- android:text="開檯時間:"-->
<!-- android:textColor="@color/black"--> <!-- android:textColor="@color/black"-->
<!-- android:textSize="@dimen/sp_18" />--> <!-- android:textSize="@dimen/sp_18" />-->
...@@ -508,7 +508,7 @@ ...@@ -508,7 +508,7 @@
<!-- style="@style/Print_text_style"--> <!-- style="@style/Print_text_style"-->
<!-- android:layout_width="wrap_content"--> <!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"--> <!-- android:layout_height="wrap_content"-->
<!-- android:text="人數"--> <!-- android:text="人數:"-->
<!-- android:textColor="@color/black"--> <!-- android:textColor="@color/black"-->
<!-- android:textSize="@dimen/sp_18"--> <!-- android:textSize="@dimen/sp_18"-->
<!-- android:visibility="visible" />--> <!-- android:visibility="visible" />-->
......
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