Commit cae7d692 by Wyh

1、引入aspectjx 2、外送在線支付結賬報錯問題 3、自取訂單加上預留號碼 4、心跳長連接增加會員和設備號 5、供應鏈增加多個缺省頁

parent 6030444d
......@@ -13,8 +13,6 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
// classpath 'com.android.tools.build:gradle:3.0.1'
// classpath "com.android.tools.build:gradle:4.0.1"
classpath 'com.android.tools:r8:2.1.67'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
......@@ -30,10 +28,7 @@ buildscript {
classpath 'org.greenrobot:greendao-gradle-plugin:3.3.0'
classpath 'com.didichuxing.doraemonkit:dokitx-plugin:3.3.3'
// classpath 'org.aspectj:aspectjtools:1.8.13' // add
// classpath 'org.aspectj:aspectjrt:1.8.13' // add
// classpath fileTree(dir: 'plugins', include: ['*.jar'])
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.4'
}
}
......
......@@ -147,6 +147,7 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
network.thirdDelivery(requestBody.build())
}
@Deprecated("統一使用gsUpdateOrderStatus")
suspend fun updateSelfOrderStatus(ids: String, status: String, restaurantId: String) = withContext(Dispatchers.IO) {
val requestBody = FormBody.Builder()
.add("ids", ids)
......
......@@ -44,6 +44,8 @@ public class OrderListBean {
private int status;
//收貨電話
private String phone;
//會員電話
private String memberPhone;
//收貨聯繫人
private String receiver;
//訂單支付類型:0 店內支付,1 貨到付款,2 在線支付
......@@ -285,6 +287,14 @@ public class OrderListBean {
this.transportationType = transportationType;
}
public String getMemberPhone() {
return memberPhone;
}
public void setMemberPhone(String memberPhone) {
this.memberPhone = memberPhone;
}
public int getPaymentValue() {
return paymentValue;
}
......
......@@ -33,6 +33,7 @@ class CoolWeatherNetwork {
private val rootGsaService = ServiceCreator.createRootGSA(WeatherService::class.java)
//獲取訂單列表
@Deprecated("使用getOrderList")
suspend fun fetchOrderList(requestBody: RequestBody) = ricepon_WechatService.getOrderList(requestBody).await()
//新的獲取訂單列表
......@@ -57,6 +58,7 @@ class CoolWeatherNetwork {
suspend fun getShipanyOrderTime(requestBody: RequestBody) = gsposService.getShipanyOrderTime(requestBody).await()
//修改訂單狀態
@Deprecated("使用gsUpdateOrderStatus")
suspend fun updateOrderStatus(requestBody: RequestBody) = ricepon_WechatService.updateOrderStatus(requestBody).await()
//gspost修改訂單狀態
......@@ -71,6 +73,7 @@ class CoolWeatherNetwork {
suspend fun updateIsRead(requestBody: RequestBody) = service.updateIsRead(requestBody).await()
//修改自取訂單狀態
@Deprecated("統一使用gsUpdateOrderStatus")
suspend fun updateSelfOrderStatus(requestBody: RequestBody) = ricepon_WechatService.updateSelfOrderStatus(requestBody).await()
// 獲取餐廳配送人員信息
......
......@@ -10,6 +10,7 @@ import retrofit2.http.*
interface WeatherService {
@POST("wechat/findOrderList")
@Deprecated("不用了,換getNewOrderList")
fun getOrderList(@Body requestBody: RequestBody): Call<OrderList>
@GET("orderInfo/getOrderList")
......@@ -34,6 +35,7 @@ interface WeatherService {
fun getShipanyOrderTime(@Body requestBody: RequestBody): Call<EstimatedBean>
@POST("wechat/updateOrderStatus")
@Deprecated("使用gsUpdateOrderStatus")
fun updateOrderStatus(@Body requestBody: RequestBody): Call<UpdateOrderBean>
@POST("order/updateOrderStatus")
......@@ -49,6 +51,7 @@ interface WeatherService {
fun updateIsRead(@Body requestBody: RequestBody): Call<String>
@POST("wechat/updateSelfOrderStatus")
@Deprecated("統一使用gsUpdateOrderStatus")
fun updateSelfOrderStatus(@Body requestBody: RequestBody): Call<UpdateOrderBean>
@POST("wechat/findRestDelivery")
......
......@@ -638,11 +638,13 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
}
orderDetails.payTime = TimeUtils.getCurrentTimeInString(TimeUtils.DEFAULT_DATE_FORMAT)
val bean = GsonUtils.GsonToBean(GsonUtils.GsonString(data), OrderClosingBean::class.java)
bean?.let {
orderDetails.oldPoints = bean.oldPoints
orderDetails.nowPoints = bean.nowPoints
orderDetails.addPoints = bean.addPoints
printOrderClosing(orderDetails, listener)
}
}
}, {
listener.invoke(ErrorCode, false)
it.printStackTrace()
......
......@@ -361,10 +361,10 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
finish()
}
errorCode == PageViewModel.ErrorCode -> {
ToastUtils.show(this@OrderDetailsActivity, "程序出現異常,請退出重試")
ToastUtils.show(this@OrderDetailsActivity, "出問題啦,請退出重試")
}
else -> {
ToastUtils.show(this@OrderDetailsActivity, "結賬失敗,請退出重試")
ToastUtils.show(this@OrderDetailsActivity, "結賬失敗,請退出重試")
}
}
}
......
......@@ -18,7 +18,7 @@ import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.OrderListBean
import com.gingersoft.gsa.delivery_pick_mode.databinding.LayoutDeliveryOrderItemBinding
import com.scwang.smartrefresh.layout.util.SmartUtil.dp2px
class OrderListAdapter(var outTime: Int, var dataBean: List<OrderListBean> = ArrayList()) : Adapter<OrderListAdapter.ViewHolder>() {
class OrderListAdapter(var context: Context, var outTime: Int, var dataBean: List<OrderListBean> = ArrayList()) : Adapter<OrderListAdapter.ViewHolder>() {
private var listener: ((item: OrderListBean) -> Unit)? = null
......@@ -29,6 +29,13 @@ class OrderListAdapter(var outTime: Int, var dataBean: List<OrderListBean> = Arr
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val data = dataBean[position]
holder.binding.data = data
//收貨人名稱那一列的數據為 收貨人(會員手機號)
var nameColumn: String = data.receiver + String.format(context.getString(R.string.str_parenthesis_format), data.memberPhone)
if (data.memberPhone != data.phone) {
//如果會員手機號和預留號碼不一致,需要再加上預留號碼
nameColumn += String.format(context.getString(R.string.str_parenthesis_format), data.phone)
}
holder.binding.nameColumnData = nameColumn
holder.binding.isSelf = data.orderType == 7
if (data.orderType != 7 && data.isDelete == 0) {
holder.binding.deliveryState = when (data.curStatNumber) {
......
......@@ -2,7 +2,6 @@ package com.gingersoft.gsa.delivery_pick_mode.ui.fragment
import android.content.Intent
import android.os.Bundle
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
......@@ -75,7 +74,7 @@ class PlaceholderFragment : BaseFragment(R.layout.fragment_other_order) {
private fun initRecyclerView() {
rv_other_order.layoutManager = LinearLayoutManager(activity)
adapter = OrderListAdapter(pageViewModel.timeOut * 60 * 1000)
adapter = OrderListAdapter(requireContext().applicationContext, pageViewModel.timeOut * 60 * 1000)
adapter.setOnItemClickListener { data ->
// 點擊查詢食品詳情
val intent = Intent(activity, OrderDetailsActivity::class.java)
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
......@@ -97,7 +98,8 @@
android:layout_margin="@dimen/other_order_info_dialog_content_marginLeft"
android:text="@{data.order_from==7?@string/h5_order:@string/ricepon_order}"
android:textSize="@dimen/dp_16"
android:textStyle="normal" />
android:textStyle="normal"
tools:text="訂單來源" />
<TextView
android:id="@+id/tv_order_state"
......@@ -107,7 +109,8 @@
android:layout_margin="@dimen/other_order_info_dialog_content_marginRight"
android:text="@{orderStatus}"
android:textColor="#009788"
android:textSize="@dimen/dp_15" />
android:textSize="@dimen/dp_15"
tools:text="訂單狀態" />
</RelativeLayout>
<include layout="@layout/include_horizontal_color_eee_dividing_line" />
......@@ -123,7 +126,8 @@
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="@{@string/order_no + data.oRDER_NO}" />
android:text="@{@string/order_no + data.oRDER_NO}"
tools:text="@string/order_no" />
<TextView
android:id="@+id/tv_create_time"
......@@ -132,7 +136,8 @@
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/other_order_info_dialog_content_marginLeft"
android:layout_marginRight="@dimen/dp_10"
android:text="@{@string/create_order_time + TimeUtils.parseTimeRepeat(data.cREATE_TIME,TimeUtils.DEFAULT_DATE_FORMAT)}" />
android:text="@{@string/create_order_time + TimeUtils.parseTimeRepeat(data.cREATE_TIME,TimeUtils.DEFAULT_DATE_FORMAT)}"
tools:text="@string/create_order_time" />
<TextView
style="@style/otherOrder_details_twelve_text_Style"
......@@ -254,7 +259,8 @@
style="@style/otherOrderReceiving_title_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{isSelf?@string/reserved_telephone:@string/receiving_telephone}" />
android:text="@{isSelf?@string/reserved_telephone:@string/receiving_telephone}"
tools:text="@string/reserved_telephone" />
<TextView
android:id="@+id/tv_receive_phone"
......@@ -264,7 +270,7 @@
android:layout_alignParentRight="true"
android:layout_toRightOf="@id/tv_receive_phone_text"
android:gravity="right"
android:text="@{data.pHONE}" />
android:text="@{data.pHONE.equals(data.memberPhone)?data.pHONE:data.memberPhone +'(' + data.pHONE + ')'}" />
</RelativeLayout>
<RelativeLayout
......@@ -279,7 +285,8 @@
style="@style/otherOrderReceiving_title_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{isSelf?@string/self_taking_time:@string/receiving_time}" />
android:text="@{isSelf?@string/self_taking_time:@string/receiving_time}"
tools:text="@string/self_taking_time" />
<TextView
android:id="@+id/tv_receive_time"
......
......@@ -53,6 +53,10 @@
<variable
name="isTimeOut"
type="Boolean" />
<variable
name="nameColumnData"
type="String" />
</data>
<FrameLayout
......@@ -151,11 +155,11 @@
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_2"
android:layout_marginRight="@dimen/dp_10"
android:text="@{data.receiver + @string/left_parenthesis+data.phone + @string/right_parenthesis}"
android:text="@{nameColumnData}"
android:textColor="@color/theme_text_color"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
tools:text="用戶名+手機號(1234567862)"
tools:text="用戶名+會員號(預留號碼)如果會員手機號和預留號碼一致,只顯示一個"
tools:textColor="@color/theme_333_color" />
<TextView
......
......@@ -167,39 +167,39 @@ public class HomePresenter extends BasePresenter<HomeContract.Model, HomeContrac
// .add("version", )
// .add("type", "2")
// .build();
mModel.checkAppVersion(DeviceUtils.getVersionName(mApplication) + "|" + DeviceUtils.getVersionCode(mApplication))
.subscribeOn(Schedulers.io())
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<CheckVersionRequest>(mErrorHandler) {
@Override
public void onNext(@NonNull CheckVersionRequest info) {
if (info != null) {
/**
* 操作类型:
* 1、不提示更新
* 2、提示更新可选择更新
* 3、强行更新
* 4、跳转goole play下载app 没安装goole play就用webview打开goole网页下载
* 5、跳转goole play下载app 没安装goole play就用浏览器打开goole网页下载
*/
int operate = info.getOperate();
if (operate == 2 || operate == 3 || operate == 4 || operate == 5) {
String updatePath = info.getUpdatePath();
if (!TextUtils.isEmpty(updatePath) && !updatePath.equals("null")) {
updateAPK(operate, updatePath);
} else {
if (operate == 3) {
mAppManager.appExit();
}
}
}
} else {
}
}
});
// mModel.checkAppVersion(DeviceUtils.getVersionName(mApplication) + "|" + DeviceUtils.getVersionCode(mApplication))
// .subscribeOn(Schedulers.io())
// .subscribeOn(AndroidSchedulers.mainThread())
// .observeOn(AndroidSchedulers.mainThread())
// .compose(RxLifecycleUtils.bindToLifecycle(mRootView))
// .subscribe(new ErrorHandleSubscriber<CheckVersionRequest>(mErrorHandler) {
//
// @Override
// public void onNext(@NonNull CheckVersionRequest info) {
// if (info != null) {
// /**
// * 操作类型:
// * 1、不提示更新
// * 2、提示更新可选择更新
// * 3、强行更新
// * 4、跳转goole play下载app 没安装goole play就用webview打开goole网页下载
// * 5、跳转goole play下载app 没安装goole play就用浏览器打开goole网页下载
// */
// int operate = info.getOperate();
// if (operate == 2 || operate == 3 || operate == 4 || operate == 5) {
// String updatePath = info.getUpdatePath();
// if (!TextUtils.isEmpty(updatePath) && !updatePath.equals("null")) {
// updateAPK(operate, updatePath);
// } else {
// if (operate == 3) {
// mAppManager.appExit();
// }
// }
// }
// } else {
// }
// }
// });
}
public void loginOut() {
......
......@@ -101,39 +101,39 @@ public class NewMainPresenter extends BasePresenter<NewMainContract.Model, NewMa
// .add("version", )
// .add("type", "2")
// .build();
mModel.checkAppVersion(DeviceUtils.getVersionName(mApplication) + "|" + DeviceUtils.getVersionCode(mApplication))
.subscribeOn(Schedulers.io())
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<CheckVersionRequest>(mErrorHandler) {
@Override
public void onNext(@NonNull CheckVersionRequest info) {
if (info != null) {
/**
* 操作类型:
* 1、不提示更新
* 2、提示更新可选择更新
* 3、强行更新
* 4、跳转goole play下载app 没安装goole play就用webview打开goole网页下载
* 5、跳转goole play下载app 没安装goole play就用浏览器打开goole网页下载
*/
int operate = info.getOperate();
if (operate == 2 || operate == 3 || operate == 4 || operate == 5) {
String updatePath = info.getUpdatePath();
if (!TextUtils.isEmpty(updatePath) && !updatePath.equals("null")) {
updateAPK(operate, updatePath);
} else {
if (operate == 3) {
mAppManager.appExit();
}
}
}
} else {
}
}
});
// mModel.checkAppVersion(DeviceUtils.getVersionName(mApplication) + "|" + DeviceUtils.getVersionCode(mApplication))
// .subscribeOn(Schedulers.io())
// .subscribeOn(AndroidSchedulers.mainThread())
// .observeOn(AndroidSchedulers.mainThread())
// .compose(RxLifecycleUtils.bindToLifecycle(mRootView))
// .subscribe(new ErrorHandleSubscriber<CheckVersionRequest>(mErrorHandler) {
//
// @Override
// public void onNext(@NonNull CheckVersionRequest info) {
// if (info != null) {
// /**
// * 操作类型:
// * 1、不提示更新
// * 2、提示更新可选择更新
// * 3、强行更新
// * 4、跳转goole play下载app 没安装goole play就用webview打开goole网页下载
// * 5、跳转goole play下载app 没安装goole play就用浏览器打开goole网页下载
// */
// int operate = info.getOperate();
// if (operate == 2 || operate == 3 || operate == 4 || operate == 5) {
// String updatePath = info.getUpdatePath();
// if (!TextUtils.isEmpty(updatePath) && !updatePath.equals("null")) {
// updateAPK(operate, updatePath);
// } else {
// if (operate == 3) {
// mAppManager.appExit();
// }
// }
// }
// } else {
// }
// }
// });
}
public void loginOut() {
......
......@@ -3,6 +3,7 @@ package com.joe.print.mvp.presenter;
import android.app.Application;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.http.imageloader.ImageLoader;
......@@ -121,6 +122,10 @@ public class PrinterAddPresenter extends BasePresenter<PrinterAddContract.Model,
if (baseResult.isSuccess()) {
mRootView.showMessage("保存成功");
mRootView.killMyself();
} else if(TextUtil.isEmptyOrNullOrUndefined(baseResult.getErrMsg())){
mRootView.showMessage("出錯啦,請稍候重試");
} else {
mRootView.showMessage(baseResult.getErrMsg());
}
}
});
......
......@@ -253,21 +253,21 @@ public class PrintPrjKitchen extends PrinterRoot {
}
setFoodItemType(data);
View view;
if (PrjService.isPinPrinter(printerDeviceBean)) {
// if (PrjService.isPinPrinter(printerDeviceBean)) {
//针式暂时用这个新的布局
view = LinearLayout.inflate(context, R.layout.print_dot_matrix_kitchen, null);
} else {
view = LinearLayout.inflate(context, R.layout.print_kitchen, null);
}
view = LinearLayout.inflate(context, R.layout.print_dot_matrix_kitchen2, null);
// } else {
// view = LinearLayout.inflate(context, R.layout.print_kitchen, null);
// }
TextView tvTableNumber = view.findViewById(R.id.tv_kitchen_print_table_number);
TextView tvOrderNumberText = view.findViewById(R.id.tv_order_num_text);
TextView tvOrderNumber = view.findViewById(R.id.tv_order_num);
TextView tvTakeCodeText = view.findViewById(R.id.tv_take_code_text);
// TextView tvTakeCodeText = view.findViewById(R.id.tv_take_code_text);
TextView tvTakeCode = view.findViewById(R.id.tv_take_code);
TextView tvTakeTime = view.findViewById(R.id.tv_food_time);
TextView tvOpeningTime = view.findViewById(R.id.tv_opening_time);
TextView tvOrderTime = view.findViewById(R.id.tv_order_time);
TextView tvKitChenLocationText = view.findViewById(R.id.tv_kitchen_location_text);
// TextView tvKitChenLocationText = view.findViewById(R.id.tv_kitchen_location_text);
TextView tvKitChenLocation = view.findViewById(R.id.tv_kitchen_location);
TextView tvPeople = view.findViewById(R.id.tv_people);
TextView tvCurrentPageIndex = view.findViewById(R.id.tv_prj_page_index);
......@@ -278,25 +278,21 @@ public class PrintPrjKitchen extends PrinterRoot {
TextView tvOrderReserved = view.findViewById(R.id.tv_order_reserved);
LinearLayout llWaiter = view.findViewById(R.id.ll_waiter);
TextView tvWaiterText = view.findViewById(R.id.tv_waiter_text);
TextView tvWaiter = view.findViewById(R.id.tv_waiter);
LinearLayout layoutOpenTableTime = view.findViewById(R.id.ll_opening_table_time);
// LinearLayout layoutOpenTableTime = view.findViewById(R.id.ll_opening_table_time);
foodLayout.addView(new KitChenPrjFoodView(context, data, printerDeviceBean));
//廚房位置
if (!TextUtil.isEmptyOrNullOrUndefined(key) && !key.equals("-1")) {
tvKitChenLocationText.setVisibility(View.VISIBLE);
tvKitChenLocation.setVisibility(View.VISIBLE);
tvKitChenLocation.setText(key);
} else {
tvKitChenLocationText.setVisibility(View.GONE);
tvKitChenLocation.setVisibility(View.GONE);
}
if (!TextUtil.isEmptyOrNullOrUndefined(prjBean.getBillNo())) {
//訂單碼不為空
tvOrderNumberText.setText("訂單碼:");
tvOrderNumberText.setText(String.format(context.getString(R.string.str_order_code), ""));
tvOrderNumber.setText(prjBean.getBillNo());
} else {
//訂單號
......@@ -305,52 +301,52 @@ public class PrintPrjKitchen extends PrinterRoot {
switch (prjBean.getOrderType()) {
case OrderTypeConstans.order_type_1:
case OrderTypeConstans.order_type_3:
tvTableNumber.setText("堂食");
tvTableNumber2.setText("堂食");
tvTableNumber.setText(context.getString(R.string.str_dine));
tvTableNumber2.setText(context.getString(R.string.str_dine));
tvTableNumber.setText(prjBean.getTableName());
tvTableNumber2.setText(prjBean.getTableName());
break;
case OrderTypeConstans.order_type_7:
layoutOpenTableTime.setVisibility(View.GONE);
tvTableNumber.setText("自取");
tvTableNumber2.setText("自取");
tvOpeningTime.setVisibility(View.GONE);
tvTableNumber.setText(context.getString(R.string.str_self_collection));
tvTableNumber2.setText(context.getString(R.string.str_self_collection));
if (!TextUtil.isEmptyOrNullOrUndefined(prjBean.getTakeFoodCode())) {
tvTakeCodeText.setVisibility(View.VISIBLE);
tvTakeCode.setVisibility(View.VISIBLE);
tvTakeCode.setText(prjBean.getTakeFoodCode());
tvTakeCode.setText(String.format(context.getString(R.string.str_take_meal_code), prjBean.getTakeFoodCode()));
}
break;
case OrderTypeConstans.order_type_8:
layoutOpenTableTime.setVisibility(View.GONE);
tvTableNumber.setText("凍鏈");
tvTableNumber2.setText("凍鏈");
tvOrderNumberText.setText("訂單碼:");
tvOpeningTime.setVisibility(View.GONE);
tvTableNumber.setText(context.getString(R.string.str_cold_chain));
tvTableNumber2.setText(context.getString(R.string.str_cold_chain));
tvOrderNumberText.setText(String.format(context.getString(R.string.str_order_code), ""));
tvOrderNumber.setText(prjBean.getTakeFoodCode());
break;
default:
layoutOpenTableTime.setVisibility(View.GONE);
tvTableNumber.setText("外賣");
tvTableNumber2.setText("外賣");
tvOrderNumberText.setText("訂單碼:");
tvOpeningTime.setVisibility(View.GONE);
tvTableNumber.setText(context.getString(R.string.str_takeaway));
tvTableNumber2.setText(context.getString(R.string.str_takeaway));
tvOrderNumberText.setText(String.format(context.getString(R.string.str_order_code), ""));
tvOrderNumber.setText(prjBean.getTakeFoodCode());
break;
}
//操作人員名稱0
//操作人員名稱
if (!TextUtils.isEmpty(prjBean.getUserName())) {
tvWaiter.setText(prjBean.getUserName());
tvWaiter.setText(String.format(context.getString(R.string.str_waiter), prjBean.getUserName()));
} else if (TextUtil.isNotEmptyOrNullOrUndefined(prjBean.getMemberName())) {
tvWaiter.setText(String.format(context.getString(R.string.str_waiter), prjBean.getMemberName()));
} else {
tvWaiter.setText(prjBean.getMemberName());
tvWaiter.setVisibility(View.GONE);
}
//人數
tvPeople.setText(prjBean.getPerson() + "");
tvPeople.setText(String.valueOf(prjBean.getPerson()));
int visibility = prjBean.getPerson() == 0 ? View.GONE : View.VISIBLE;
view.findViewById(R.id.tv_people_text).setVisibility(visibility);
tvPeople.setVisibility(visibility);
if (TextUtil.isNotEmptyOrNullOrUndefined(prjBean.getTakeTime())) {
tvTakeTime.setText("取餐:" + prjBean.getTakeTime());
tvTakeTime.setText(String.format(context.getString(R.string.str_take_meal), prjBean.getTakeTime()));
} else if (TextUtil.isNotEmptyOrNullOrUndefined(prjBean.getSendTime())) {
tvTakeTime.setText("送達:" + prjBean.getSendTime());
tvTakeTime.setText(String.format(context.getString(R.string.str_service), prjBean.getSendTime()));
} else {
tvTakeTime.setVisibility(View.GONE);
}
......@@ -362,14 +358,14 @@ public class PrintPrjKitchen extends PrinterRoot {
}
if (RestaurantExpandInfoUtils.getValue(ExpandConstant.PrintStatisticsAmount, false)) {
tvPrintQuantity.setText(prjBean.getQuantity() + "");
tvPrintQuantity.setText(String.valueOf(prjBean.getQuantity()));
} else {
tvPrintQuantity.setVisibility(View.GONE);
}
//開台時間
tvOpeningTime.setText(TimeUtils.parseTimeRepeat(prjBean.getOrderDetailsTime(), TimeUtils.DEFAULT_DATE_MDHM));
tvOpeningTime.setText(String.format(context.getString(R.string.str_set_up_table), TimeUtils.parseTimeRepeat(prjBean.getOrderDetailsTime(), TimeUtils.DEFAULT_DATE_MDHM)));
//落單時間,為當前時間
tvOrderTime.setText(TimeUtils.getCurrentTimeInString(TimeUtils.DEFAULT_DATE_MDHM));
tvOrderTime.setText(String.format(context.getString(R.string.str_place_an_order), TimeUtils.getCurrentTimeInString(TimeUtils.DEFAULT_DATE_MDHM)));
if (RestaurantExpandInfoUtils.getValue(ExpandConstant.PrintPage, false)) {
if (prjBean.getCurrentIndex() <= prjBean.getTotalPrj()) {
tvCurrentPageIndex.setText(prjBean.getCurrentIndex() + "/" + prjBean.getTotalPrj());
......
......@@ -158,6 +158,7 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
String[] ips = new String[4];
//如果不為空,則是編輯打印機,初始化信息
if (printerDeviceBean != null) {
//初始化頁面數據項
mEdPrintName.setText(String.valueOf(printerDeviceBean.getName()));
ips = printerDeviceBean.getIp().split("[.]");
etPort.setText(printerDeviceBean.getPort() + "");
......@@ -173,7 +174,6 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
} else {
modifierFontSize = Integer.parseInt(printerDeviceBean.getModifierFont());
}
if (printerDeviceBean.getPrinterName() != null) {
mTvModel.setTextColor(getResources().getColor(R.color.color_3c));
mTvModel.setText(printerDeviceBean.getPrinterName());
......
apply from: rootProject.file('cc-settings.gradle')
apply plugin: 'com.jakewharton.butterknife'
apply plugin: 'android-aspectjx'
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......@@ -49,8 +50,25 @@ android {
shrinkResources false
zipAlignEnabled false
proguardFiles 'proguard.cfg'
//修改生成的apk名字
if (project.ext.runAsApp) {
applicationVariants.all { variant ->
variant.outputs.all {
def fileName
def date = new Date()
def formattedDate = date.format('yyyy-MM-dd')
if (variant.buildType.name == 'release') {
fileName = "採購_${variant.mergedFlavor.versionName}_${formattedDate}.apk"
} else if (variant.buildType.name == 'debug') {
fileName = "採購_${variant.mergedFlavor.versionName}_${formattedDate}.apk"
}
outputFileName = fileName
}
}
}
}
}
}
dependencies {
......@@ -71,4 +89,54 @@ dependencies {
if (project.ext.runAsApp) {
addComponent 'component-scan'
}
aspectjx {
enabled true
exclude 'androidx', 'org.jetbrains.kotlin',"module-info", 'com.google', 'com.squareup', 'org.apache', 'versions.9', 'com.squareup.okio', 'okio', 'leakcanary', 'com.google.firebase', 'com.google.android'
}
}
//import org.aspectj.bridge.IMessage
//import org.aspectj.bridge.MessageHandler
//import org.aspectj.tools.ajc.Main
//final def log = project.logger
//final def variants = project.android.applicationVariants
//
//variants.all { variant ->
// if (!variant.buildType.isDebuggable()) {
// log.debug("Skipping non-debuggable build type '${variant.buildType.name}'.")
// return;
// }
//
// JavaCompile javaCompile = variant.javaCompile
// javaCompile.doLast {
// String[] args = ["-showWeaveInfo",
// "-1.8",
// "-inpath", javaCompile.destinationDir.toString(),
// "-aspectpath", javaCompile.classpath.asPath,
// "-d", javaCompile.destinationDir.toString(),
// "-classpath", javaCompile.classpath.asPath,
// "-bootclasspath", project.android.bootClasspath.join(File.pathSeparator)]
// log.debug "ajc args: " + Arrays.toString(args)
//
// MessageHandler handler = new MessageHandler(true);
// new Main().run(args, handler);
// for (IMessage message : handler.getMessages(null, true)) {
// switch (message.getKind()) {
// case IMessage.ABORT:
// case IMessage.ERROR:
// case IMessage.FAIL:
// log.error message.message, message.thrown
// break;
// case IMessage.WARNING:
// log.warn message.message, message.thrown
// break;
// case IMessage.INFO:
// log.info message.message, message.thrown
// break;
// case IMessage.DEBUG:
// log.debug message.message, message.thrown
// break;
// }
// }
// }
//}
\ No newline at end of file
package com.gingersoft.supply_chain.mvp.bean;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import com.gingersoft.gsa.cloud.common.utils.MoneyUtil;
import com.gingersoft.gsa.cloud.common.utils.time.TimeUtils;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.gingersoft.supply_chain.mvp.content.PurchaseConstant;
import java.io.Serializable;
import java.util.List;
......@@ -53,8 +51,8 @@ public class ConfirmOrderBean {
PurchaseOrder purchaseOrder = new PurchaseOrder();
purchaseOrder.setSupplierId(shoppingCartBean.getSupplierId());
purchaseOrder.setSupplierName(shoppingCartBean.getSupplierName());
purchaseOrder.setBrandId(Constant.getBrandId());
purchaseOrder.setRestaurantId(Constant.getRestaurantId());
purchaseOrder.setBrandId(PurchaseConstant.getBrandId());
purchaseOrder.setRestaurantId(PurchaseConstant.getRestaurantId());
purchaseOrder.setRemarks(shoppingCartBean.getRemarks());
purchaseOrder.setInitialShippingTime(shoppingCartBean.getInitialShippingTime());
purchaseOrder.setShipping(shoppingCartBean.getShipping());
......
package com.gingersoft.supply_chain.mvp.bean;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.gingersoft.supply_chain.mvp.content.PurchaseConstant;
import com.qmuiteam.qmui.widget.section.QMUISection;
import java.io.ByteArrayInputStream;
......@@ -82,7 +82,7 @@ public class PurchaseFoodBean implements Serializable, QMUISection.Model<Purchas
private boolean isChecked = true;
/**
* 是否刪除
* {@link Constant.DELETE,Constant.NORMAL}
* {@link PurchaseConstant.DELETE, PurchaseConstant.NORMAL}
*/
private int deletes;
private int restaurantId;
......
......@@ -17,7 +17,7 @@ import okhttp3.FormBody;
* Time: 16:27
* Use:
*/
public class Constant {
public class PurchaseConstant {
public static final int PAGE_SIZE = 10;
public static final int PURCHASE_FOOD_MAX = 9999;
/**
......
......@@ -3,7 +3,6 @@ package com.gingersoft.supply_chain.mvp.contract;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.supply_chain.mvp.bean.FoodCategoryResultBean;
import com.gingersoft.supply_chain.mvp.bean.OrderCategoryBean;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
......
......@@ -5,7 +5,7 @@ import android.app.Application;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.supply_chain.mvp.bean.FoodCategoryResultBean;
import com.gingersoft.supply_chain.mvp.bean.OrderCategoryBean;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.gingersoft.supply_chain.mvp.content.PurchaseConstant;
import com.gingersoft.supply_chain.mvp.contract.CategorySelectContract;
import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.http.imageloader.ImageLoader;
......@@ -70,11 +70,11 @@ public class CategorySelectPresenter extends BasePresenter<CategorySelectContrac
*/
public void getCategoryTrees() {
Map<String, Object> map = new HashMap<>(2);
Constant.addBrandId(map);
Constant.addRestaurantId(map);
PurchaseConstant.addBrandId(map);
PurchaseConstant.addRestaurantId(map);
mModel.getCategoryTrees(map)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.GET_INFO_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.GET_INFO_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -88,7 +88,7 @@ public class CategorySelectPresenter extends BasePresenter<CategorySelectContrac
} else if (TextUtil.isNotEmptyOrNullOrUndefined(orderCategoryBean.getErrMsg())) {
mRootView.showMessage(orderCategoryBean.getErrMsg());
} else {
mRootView.showMessage(Constant.GET_INFO_ERROR);
mRootView.showMessage(PurchaseConstant.GET_INFO_ERROR);
}
}
});
......
package com.gingersoft.supply_chain.mvp.presenter;
import android.app.Application;
import android.os.AsyncTask;
import android.util.Log;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import com.gingersoft.gsa.cloud.common.utils.JsonUtils;
import com.gingersoft.gsa.cloud.common.utils.MoneyUtil;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.ui.bean.view.CategoryBean;
import com.gingersoft.supply_chain.R;
import com.gingersoft.supply_chain.mvp.bean.CategoryFoodTreeBean;
import com.gingersoft.supply_chain.mvp.bean.FoodByCategoryResultBean;
import com.gingersoft.supply_chain.mvp.bean.FoodListInfoBean;
import com.gingersoft.supply_chain.mvp.bean.OrderCategoryBean;
import com.gingersoft.supply_chain.mvp.bean.PurchaseFoodBean;
import com.gingersoft.supply_chain.mvp.bean.ShoppingCartBean;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.gingersoft.supply_chain.mvp.content.PurchaseConstant;
import com.gingersoft.supply_chain.mvp.content.SupplyShoppingCart;
import com.gingersoft.supply_chain.mvp.contract.FoodIngredientsContract;
import com.jess.arms.di.scope.FragmentScope;
......@@ -42,13 +36,9 @@ import javax.inject.Inject;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
import me.jessyan.rxerrorhandler.core.RxErrorHandler;
import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber;
import okhttp3.MediaType;
import okhttp3.RequestBody;
/**
......@@ -122,14 +112,14 @@ public class FoodIngredientsPresenter extends BasePresenter<FoodIngredientsContr
Map<String, Object> map = new HashMap<>(5);
map.put("pageSize", 1000);
map.put("pageIndex", 0);
Constant.addBrandId(map);
Constant.addRestaurantId(map);
PurchaseConstant.addBrandId(map);
PurchaseConstant.addRestaurantId(map);
if (supplierId != -1) {
map.put("supplierId", supplierId);
}
mModel.getFoodIngredientsData(map)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.GET_INFO_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.GET_INFO_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -222,14 +212,14 @@ public class FoodIngredientsPresenter extends BasePresenter<FoodIngredientsContr
Map<String, Object> map = new HashMap<>(5);
map.put("pageSize", 1000);
map.put("pageIndex", 0);
Constant.addBrandId(map);
Constant.addRestaurantId(map);
PurchaseConstant.addBrandId(map);
PurchaseConstant.addRestaurantId(map);
if (supplierId != -1) {
map.put("supplierId", supplierId);
}
mModel.getFoodBySupplierId(map)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.GET_INFO_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.GET_INFO_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -365,11 +355,11 @@ public class FoodIngredientsPresenter extends BasePresenter<FoodIngredientsContr
return;
}
Map<String, Object> map = new HashMap<>(2);
Constant.addBrandId(map);
Constant.addRestaurantId(map);
PurchaseConstant.addBrandId(map);
PurchaseConstant.addRestaurantId(map);
mModel.getCategoryTrees(map)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.GET_INFO_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.GET_INFO_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -398,7 +388,7 @@ public class FoodIngredientsPresenter extends BasePresenter<FoodIngredientsContr
} else if (TextUtil.isNotEmptyOrNullOrUndefined(orderCategoryBean.getErrMsg())) {
mRootView.showMessage(orderCategoryBean.getErrMsg());
} else {
mRootView.showMessage(Constant.GET_INFO_ERROR);
mRootView.showMessage(PurchaseConstant.GET_INFO_ERROR);
}
}
......@@ -578,8 +568,8 @@ public class FoodIngredientsPresenter extends BasePresenter<FoodIngredientsContr
Map<String, Object> map = new HashMap<>(5);
map.put("pageSize", 1000);
map.put("pageIndex", 0);
Constant.addBrandId(map);
Constant.addRestaurantId(map);
PurchaseConstant.addBrandId(map);
PurchaseConstant.addRestaurantId(map);
map.put("parentId", parentCategoryId);
mModel.getFoodByCategory(map)
.subscribeOn(Schedulers.io())
......
......@@ -2,16 +2,14 @@ package com.gingersoft.supply_chain.mvp.presenter;
import android.app.Application;
import android.os.Bundle;
import android.util.Log;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import com.gingersoft.gsa.cloud.common.utils.CollectionUtils;
import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.supply_chain.mvp.bean.BasicUnitBean;
import com.gingersoft.supply_chain.mvp.bean.DeputyUnitBean;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.gingersoft.supply_chain.mvp.content.PurchaseConstant;
import com.gingersoft.supply_chain.mvp.ui.fragment.food.FoodUnitPageFragment;
import com.jess.arms.integration.AppManager;
import com.jess.arms.di.scope.FragmentScope;
......@@ -22,7 +20,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import me.jessyan.rxerrorhandler.core.RxErrorHandler;
import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber;
import okhttp3.FormBody;
import okhttp3.MediaType;
import okhttp3.RequestBody;
......@@ -31,17 +28,15 @@ import javax.inject.Inject;
import com.gingersoft.supply_chain.mvp.contract.FoodUnitPageContract;
import com.jess.arms.utils.RxLifecycleUtils;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import static com.gingersoft.supply_chain.mvp.content.Constant.GET_INFO_ERROR;
import static com.gingersoft.supply_chain.mvp.content.Constant.GET_INFO_LOADING;
import static com.gingersoft.supply_chain.mvp.content.PurchaseConstant.GET_INFO_ERROR;
import static com.gingersoft.supply_chain.mvp.content.PurchaseConstant.GET_INFO_LOADING;
/**
......@@ -125,7 +120,7 @@ public class FoodUnitPagePresenter extends BasePresenter<FoodUnitPageContract.Mo
* 獲取副單位 快捷輸入列表數據集合
*/
public void getDeputyUnitList() {
mModel.getDeputyUnitList(Constant.getBrandId(), Constant.getRestaurantId())
mModel.getDeputyUnitList(PurchaseConstant.getBrandId(), PurchaseConstant.getRestaurantId())
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(GET_INFO_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
......@@ -183,10 +178,10 @@ public class FoodUnitPagePresenter extends BasePresenter<FoodUnitPageContract.Mo
mRootView.deleteDeputyUnit(position);
return;
}
deputyUnitBean.setDeletes(Constant.DELETE);
deputyUnitBean.setDeletes(PurchaseConstant.DELETE);
mModel.updateDeputyUnit(RequestBody.create(MediaType.parse("application/json"), GsonUtils.GsonString(deputyUnitBean)))
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.DELETE_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.DELETE_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -200,7 +195,7 @@ public class FoodUnitPagePresenter extends BasePresenter<FoodUnitPageContract.Mo
} else if (TextUtil.isNotEmptyOrNullOrUndefined(baseResult.getErrMsg())) {
mRootView.showMessage(baseResult.getErrMsg());
} else {
mRootView.showMessage(Constant.DELETE_FAIL);
mRootView.showMessage(PurchaseConstant.DELETE_FAIL);
}
}
});
......@@ -212,7 +207,7 @@ public class FoodUnitPagePresenter extends BasePresenter<FoodUnitPageContract.Mo
public void batchUpdateDeputyUnit(List<DeputyUnitBean> data) {
mModel.updateDeputyUnitList(RequestBody.create(MediaType.parse("application/json"), GsonUtils.GsonString(data)))
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.SAVE_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.SAVE_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -245,8 +240,8 @@ public class FoodUnitPagePresenter extends BasePresenter<FoodUnitPageContract.Mo
}
}
DeputyUnitBean unitBean = new DeputyUnitBean();
unitBean.setBrandId(Constant.getBrandId());
unitBean.setRestaurantId(Constant.getRestaurantId());
unitBean.setBrandId(PurchaseConstant.getBrandId());
unitBean.setRestaurantId(PurchaseConstant.getRestaurantId());
unitBean.setPurchaseFoodId(foodId);
deputyUnitBeans.add(unitBean);
mRootView.loadDeputyUnitAdapter(deputyUnitBeans);
......@@ -268,14 +263,14 @@ public class FoodUnitPagePresenter extends BasePresenter<FoodUnitPageContract.Mo
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("content", content);
jsonObject.put("brandId", Constant.getBrandId() + "");
jsonObject.put("restaurantId", Constant.getRestaurantId() + "");
jsonObject.put("brandId", PurchaseConstant.getBrandId() + "");
jsonObject.put("restaurantId", PurchaseConstant.getRestaurantId() + "");
} catch (JSONException e) {
e.printStackTrace();
}
mModel.addBasicUnit(RequestBody.create(MediaType.parse("application/json"), jsonObject.toString()))
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.SAVE_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.SAVE_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -303,7 +298,7 @@ public class FoodUnitPagePresenter extends BasePresenter<FoodUnitPageContract.Mo
public void deleteUnitKey(int id, int position){
mModel.deleteUnitKey(id)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.SAVE_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.SAVE_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......
......@@ -2,12 +2,11 @@ package com.gingersoft.supply_chain.mvp.presenter;
import android.app.Application;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.supply_chain.mvp.bean.MeasurementUnitBean;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.gingersoft.supply_chain.mvp.content.PurchaseConstant;
import com.gingersoft.supply_chain.mvp.contract.MeasurementUnitContract;
import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.http.imageloader.ImageLoader;
......@@ -76,8 +75,8 @@ public class MeasurementUnitPresenter extends BasePresenter<MeasurementUnitContr
if (!TextUtil.isEmptyOrNullOrUndefined(unitContent)) {
map.put("unitContent", unitContent);
}
map.put("brandId", Constant.getBrandId());
map.put("restaurantId", Constant.getRestaurantId());
map.put("brandId", PurchaseConstant.getBrandId());
map.put("restaurantId", PurchaseConstant.getRestaurantId());
map.put("pageIndex", pageIndex);
mModel.getMeasurementUnitList(map)
.subscribeOn(Schedulers.io())
......
......@@ -2,13 +2,12 @@ package com.gingersoft.supply_chain.mvp.presenter;
import android.app.Application;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.ui.adapter.bean.InfoMultiBean;
import com.gingersoft.supply_chain.mvp.bean.MeasurementUnitBean;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.gingersoft.supply_chain.mvp.content.PurchaseConstant;
import com.gingersoft.supply_chain.mvp.contract.NewFoodUnitContract;
import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.http.imageloader.ImageLoader;
......@@ -130,8 +129,8 @@ public class NewFoodUnitPresenter extends BasePresenter<NewFoodUnitContract.Mode
if (foodUnit == null) {
foodUnit = new MeasurementUnitBean.DataBean.Unit();
}
foodUnit.setBrandId(Constant.getBrandId());
foodUnit.setRestaurantId(Constant.getRestaurantId());
foodUnit.setBrandId(PurchaseConstant.getBrandId());
foodUnit.setRestaurantId(PurchaseConstant.getRestaurantId());
List<InfoMultiBean> units = infoMultiBeans.get(0).getInfoMultiBeans();
for (int i = 0; i < units.size(); i++) {
if (units.get(i).isChecked()) {
......
......@@ -10,7 +10,6 @@ import android.widget.EditText;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.constans.AppConstans;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import com.gingersoft.gsa.cloud.common.utils.MatchUtils;
import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.common.utils.inputFilter.InputFilterUtils;
......@@ -18,13 +17,11 @@ import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.ui.adapter.bean.InfoMultiBean;
import com.gingersoft.gsa.cloud.ui.adapter.bean.MultiCheckInputBean;
import com.gingersoft.gsa.cloud.ui.adapter.bean.MultiInputBean;
import com.gingersoft.gsa.cloud.ui.adapter.bean.MultiSelectBean;
import com.gingersoft.gsa.cloud.ui.adapter.multi.InfoMultiAdapter;
import com.gingersoft.gsa.cloud.ui.adapter.multi.RemarkProvider;
import com.gingersoft.supply_chain.R;
import com.gingersoft.supply_chain.mvp.bean.PurchaseFoodBean;
import com.gingersoft.supply_chain.mvp.bean.SupplierInfoBean;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.gingersoft.supply_chain.mvp.content.PurchaseConstant;
import com.gingersoft.supply_chain.mvp.content.SupplyShoppingCart;
import com.gingersoft.supply_chain.mvp.contract.NewSupplierContract;
import com.jess.arms.di.scope.FragmentScope;
......@@ -33,8 +30,6 @@ import com.jess.arms.integration.AppManager;
import com.jess.arms.mvp.BasePresenter;
import com.jess.arms.utils.EnAndNumInputFilter;
import com.jess.arms.utils.RxLifecycleUtils;
import com.xuexiang.rxutil2.rxjava.RxJavaUtils;
import com.xuexiang.rxutil2.rxjava.task.RxIOTask;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -134,11 +129,11 @@ public class NewSupplierPresenter extends BasePresenter<NewSupplierContract.Mode
infoMultiBeans.add(new InfoMultiBean(InfoMultiBean.ITEM_TYPE_LINE));
infoMultiBeans.add(new InfoMultiBean(InfoMultiBean.ITEM_TYPE_TITLE, "基本信息"));
infoMultiBeans.add(new MultiInputBean(InfoMultiBean.ITEM_TYPE_INPUT, "供應商編號", false, "請輸入編號", new InputFilter[]{new InputFilter.LengthFilter(11), new EnAndNumInputFilter()}));
MultiInputBean multiInputSupplierName = new MultiInputBean(InfoMultiBean.ITEM_TYPE_INPUT, "名稱", true, "請輸入名稱", new InputFilter[]{InputFilterUtils.getLengthFilter(mContext, 100), InputFilterUtils.getChAndEnAndNumAndPtInputFilter(mContext)}, mSupplierNameChangeListener);
MultiInputBean multiInputSupplierName = new MultiInputBean(InfoMultiBean.ITEM_TYPE_INPUT, "名稱", true, "請輸入名稱", new InputFilter[]{InputFilterUtils.getLengthFilter(mContext, 40), InputFilterUtils.getChAndEnAndNumAndPtInputFilter(mContext)}, mSupplierNameChangeListener);
multiInputSupplierName.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);
infoMultiBeans.add(multiInputSupplierName);
infoMultiBeans.add(new MultiInputBean(InfoMultiBean.ITEM_TYPE_INPUT, "聯繫人", true, "請輸入聯繫人", new InputFilter[]{InputFilterUtils.getLengthFilter(mContext, 20), InputFilterUtils.getChAndEnAndNumInputFilter(mContext)}, InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_WORDS));
infoMultiBeans.add(new MultiInputBean(InfoMultiBean.ITEM_TYPE_INPUT, "詳細地址", true, "請輸入詳細地址", new InputFilter[]{InputFilterUtils.getLengthFilter(mContext, 150), InputFilterUtils.getChAndEnAndNumAndPtInputFilter(mContext)}, InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES));
infoMultiBeans.add(new MultiInputBean(InfoMultiBean.ITEM_TYPE_INPUT, "詳細地址", true, "請輸入詳細地址", new InputFilter[]{InputFilterUtils.getLengthFilter(mContext, 200), InputFilterUtils.getChAndEnAndNumAndPtInputFilter(mContext)}, InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES));
infoMultiBeans.add(new MultiInputBean(InfoMultiBean.ITEM_TYPE_INPUT, "聯繫人電話", true, "請輸入聯繫人電話", new InputFilter[]{InputFilterUtils.getLengthFilter(mContext, 11)}, EditorInfo.TYPE_CLASS_PHONE));
infoMultiBeans.add(new MultiInputBean(InfoMultiBean.ITEM_TYPE_INPUT, "最低採購金額", false, "請輸入最低金額", new InputFilter[]{InputFilterUtils.getLengthFilter(mContext, 9)}, EditorInfo.TYPE_CLASS_NUMBER | EditorInfo.TYPE_NUMBER_FLAG_DECIMAL));
infoMultiBeans.add(new MultiInputBean(InfoMultiBean.ITEM_TYPE_INPUT, "運費", false, "請輸入運費", new InputFilter[]{InputFilterUtils.getLengthFilter(mContext, 9)}, EditorInfo.TYPE_CLASS_NUMBER | EditorInfo.TYPE_NUMBER_FLAG_DECIMAL));
......@@ -154,9 +149,7 @@ public class NewSupplierPresenter extends BasePresenter<NewSupplierContract.Mode
// childInfoMulti.add(new MultiInputBean(InfoMultiBean.ITEM_TYPE_INPUT, "Kakao Talk", false, "請輸入Kakao Talk"));
// receivingMode.setInfoMultiBeans(childInfoMulti);
// infoMultiBeans.add(receivingMode);
MultiCheckInputBean emailInputBean = new MultiCheckInputBean(InfoMultiBean.ITEM_MULTIPLE_CHECKBOX, "Email", false, "請輸入Email", new InputFilter[]{InputFilterUtils.getLengthFilter(mContext, 40)}, R.drawable.ic_email, false);
emailInputBean.setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
contactInfo.add(emailInputBean);
contactInfo.add(new MultiCheckInputBean(InfoMultiBean.ITEM_MULTIPLE_CHECKBOX, "Email", false, "請輸入Email", new InputFilter[]{InputFilterUtils.getLengthFilter(mContext, 40)}, R.drawable.ic_email, false).setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS));
contactInfo.add(new MultiCheckInputBean(InfoMultiBean.ITEM_MULTIPLE_CHECKBOX, "WhatsApp", false, "請輸入WhatsApp", new InputFilter[]{InputFilterUtils.getLengthFilter(mContext, 20), InputFilterUtils.getChAndEnAndNumInputFilter(mContext)}, R.drawable.ic_whatsapp, false).setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES));
contactInfo.add(new MultiCheckInputBean(InfoMultiBean.ITEM_MULTIPLE_CHECKBOX, "WeChat", false, "請輸入WeChat", new InputFilter[]{InputFilterUtils.getLengthFilter(mContext, 20), InputFilterUtils.getChAndEnAndNumInputFilter(mContext)}, R.drawable.ic_wechat, false));
contactInfo.add(new MultiCheckInputBean(InfoMultiBean.ITEM_MULTIPLE_CHECKBOX, "Line", false, "請輸入Line", new InputFilter[]{InputFilterUtils.getLengthFilter(mContext, 20), InputFilterUtils.getChAndEnAndNumInputFilter(mContext)}, R.drawable.ic_line, false));
......@@ -241,8 +234,8 @@ public class NewSupplierPresenter extends BasePresenter<NewSupplierContract.Mode
*/
public void getSupplierInfo(EditText editText, String supplierName) {
Map<String, Object> map = new HashMap<>(3);
Constant.addRestaurantId(map);
Constant.addBrandId(map);
PurchaseConstant.addRestaurantId(map);
PurchaseConstant.addBrandId(map);
map.put("supplierName", supplierName);
mModel.getSupplierInfo(map)
.subscribeOn(Schedulers.io())
......@@ -319,7 +312,7 @@ public class NewSupplierPresenter extends BasePresenter<NewSupplierContract.Mode
public void deleteSupplier(int supplierId) {
mModel.deleteSupplier(supplierId)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.SAVE_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.SAVE_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -335,7 +328,7 @@ public class NewSupplierPresenter extends BasePresenter<NewSupplierContract.Mode
} else if (TextUtil.isNotEmptyOrNullOrUndefined(info.getErrMsg())) {
mRootView.showMessage(info.getErrMsg());
} else {
mRootView.showMessage(Constant.SAVE_FAIL);
mRootView.showMessage(PurchaseConstant.SAVE_FAIL);
}
}
}
......@@ -521,8 +514,8 @@ public class NewSupplierPresenter extends BasePresenter<NewSupplierContract.Mode
//地址
supplierInfoBean.setAddress(TextUtil.getNotNullStrAndTrim(infoMultiBeans.get(addressIndex).getShowValue()));
//餐廳信息
supplierInfoBean.setRestaurantId(Constant.getRestaurantId());
supplierInfoBean.setBrandId(Constant.getBrandId());
supplierInfoBean.setRestaurantId(PurchaseConstant.getRestaurantId());
supplierInfoBean.setBrandId(PurchaseConstant.getBrandId());
//最低採購金額
String minimumAmount = infoMultiBeans.get(lowPurchaseAmount).getShowValue();
if (TextUtil.isNotEmptyOrNullOrUndefined(minimumAmount)) {
......
......@@ -3,7 +3,6 @@ package com.gingersoft.supply_chain.mvp.presenter;
import android.app.Application;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import com.gingersoft.gsa.cloud.common.utils.CollectionUtils;
import com.gingersoft.gsa.cloud.common.utils.JsonUtils;
import com.gingersoft.gsa.cloud.common.utils.MoneyUtil;
......@@ -16,7 +15,7 @@ import com.gingersoft.supply_chain.mvp.bean.PurchaseFoodEncodeSn;
import com.gingersoft.supply_chain.mvp.bean.PurchaseOrderDetailsBean;
import com.gingersoft.supply_chain.mvp.bean.OrderWareHouseBean;
import com.gingersoft.supply_chain.mvp.bean.WareHousingUnitBean;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.gingersoft.supply_chain.mvp.content.PurchaseConstant;
import com.gingersoft.supply_chain.mvp.content.SupplyShoppingCart;
import com.jess.arms.integration.AppManager;
import com.jess.arms.di.scope.FragmentScope;
......@@ -39,19 +38,16 @@ import com.jess.arms.utils.RxLifecycleUtils;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import static com.gingersoft.supply_chain.mvp.content.Constant.GET_INFO_ERROR;
import static com.gingersoft.supply_chain.mvp.content.Constant.GET_INFO_LOADING;
import static com.gingersoft.supply_chain.mvp.content.Constant.NULL_INFO_ERROR;
import static com.gingersoft.supply_chain.mvp.content.Constant.SAVE_FAIL;
import static com.gingersoft.supply_chain.mvp.content.Constant.SAVE_LOADING;
import static com.gingersoft.supply_chain.mvp.content.PurchaseConstant.GET_INFO_ERROR;
import static com.gingersoft.supply_chain.mvp.content.PurchaseConstant.GET_INFO_LOADING;
import static com.gingersoft.supply_chain.mvp.content.PurchaseConstant.NULL_INFO_ERROR;
import static com.gingersoft.supply_chain.mvp.content.PurchaseConstant.SAVE_FAIL;
import static com.gingersoft.supply_chain.mvp.content.PurchaseConstant.SAVE_LOADING;
/**
......@@ -293,11 +289,11 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
return;
}
Map<String, Object> map = new HashMap<>(3);
Constant.addRestaurantId(map);
Constant.addBrandId(map);
PurchaseConstant.addRestaurantId(map);
PurchaseConstant.addBrandId(map);
StringBuilder stringBuilder = new StringBuilder();
for (PurchaseOrderDetailsBean.PurchaseOrderDetailsInfoVosBean item : data) {
stringBuilder.append(item.getPurchaseFoodId()).append(Constant.COMMA_SEPARATED);
stringBuilder.append(item.getPurchaseFoodId()).append(PurchaseConstant.COMMA_SEPARATED);
}
map.put("ids", stringBuilder.substring(0, stringBuilder.length() - 1));
mModel.buyAgainByFoodIds(map)
......@@ -350,8 +346,8 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
String substring = files.substring(0, files.length());
purchaseWarehousingOrder.setFiles(substring);
}
purchaseWarehousingOrder.setRestaurantId(Constant.getRestaurantId());
purchaseWarehousingOrder.setBrandId(Constant.getBrandId());
purchaseWarehousingOrder.setRestaurantId(PurchaseConstant.getRestaurantId());
purchaseWarehousingOrder.setBrandId(PurchaseConstant.getBrandId());
purchaseWarehousingOrder.setRemarks(remark);
purchaseWarehousingOrder.setTotalPrice(totalAmount);
orderWareHouseBean.setPurchaseWarehousingOrder(purchaseWarehousingOrder);
......@@ -393,8 +389,8 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
//不是待收貨狀態才設置id,因為如果已經收過貨才有id
wareHousingUnitBean.setId(deputyUnitBean.getId());
}
wareHousingUnitBean.setBrandId(Constant.getBrandId());
wareHousingUnitBean.setRestaurantId(Constant.getRestaurantId());
wareHousingUnitBean.setBrandId(PurchaseConstant.getBrandId());
wareHousingUnitBean.setRestaurantId(PurchaseConstant.getRestaurantId());
purchaseWarehousingOrderDetail.setPurchaseWarehousingUnit(wareHousingUnitBean);
//sn碼
List<PurchaseFoodEncodeSn> snList = null;
......@@ -425,7 +421,7 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
public void deleteOrder() {
mModel.deleteOrder(orderId)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.DELETE_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.DELETE_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -434,7 +430,7 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
@Override
public void onNext(@NonNull BaseResult info) {
if (info.isSuccess()) {
mRootView.showMessage(Constant.DELETE_SUCCESS);
mRootView.showMessage(PurchaseConstant.DELETE_SUCCESS);
mRootView.killMyself();
}
}
......@@ -487,7 +483,7 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
map.put("encodeSnNo", encodeSnNo);
mModel.deleteSnCode(map)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.DELETE_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.DELETE_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -496,7 +492,7 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
@Override
public void onNext(@NonNull BaseResult info) {
if (info.isSuccess()) {
mRootView.showMessage(Constant.DELETE_SUCCESS);
mRootView.showMessage(PurchaseConstant.DELETE_SUCCESS);
}
}
......@@ -509,7 +505,7 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
public void querySnCodes(int position, PurchaseOrderDetailsBean.PurchaseOrderDetailsInfoVosBean infoVosBean, boolean singerFood) {
mModel.querySnCodes(infoVosBean.getFoodNo(), infoVosBean.getOrderNo())
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.QUERY_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.QUERY_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -556,10 +552,10 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
List<MultipartBody.Part> multipartBodies = new ArrayList<>();
multipartBodies.add(MultipartBody.Part.createFormData("files", file.getName(), RequestBody.create(MediaType.parse("image/png"), file)));
Map<String, Object> map = new HashMap<>(1);
map.put("type", Constant.UPLOAD_PIC_TYPE_ORDER);
map.put("type", PurchaseConstant.UPLOAD_PIC_TYPE_ORDER);
mModel.upLoadPic(multipartBodies, map)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.IMG_UPLOAD_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.IMG_UPLOAD_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......
......@@ -3,12 +3,10 @@ package com.gingersoft.supply_chain.mvp.presenter;
import android.app.Application;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.supply_chain.mvp.bean.OrderBean;
import com.gingersoft.supply_chain.mvp.bean.PurchaseOrderDetailsBean;
import com.gingersoft.supply_chain.mvp.bean.PurchaseOrderResultBean;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.gingersoft.supply_chain.mvp.content.PurchaseConstant;
import com.gingersoft.supply_chain.mvp.contract.PurchaseListContract;
import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.http.imageloader.ImageLoader;
......@@ -28,11 +26,8 @@ import io.reactivex.annotations.NonNull;
import io.reactivex.schedulers.Schedulers;
import me.jessyan.rxerrorhandler.core.RxErrorHandler;
import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import static com.gingersoft.supply_chain.mvp.bean.PurchaseOrderDetailsBean.WAIT_RECEIVED;
import static com.gingersoft.supply_chain.mvp.content.Constant.PAGE_SIZE;
import static com.gingersoft.supply_chain.mvp.content.PurchaseConstant.PAGE_SIZE;
/**
......@@ -65,9 +60,9 @@ public class PurchaseListPresenter extends BasePresenter<PurchaseListContract.Mo
public void getOrderList(String orderNo, int orderStatus, int pageIndex) {
Map<String, Object> map = new HashMap<>(6);
Constant.addRestaurantId(map);
Constant.addBrandId(map);
Constant.addPageSize(map);
PurchaseConstant.addRestaurantId(map);
PurchaseConstant.addBrandId(map);
PurchaseConstant.addPageSize(map);
if (TextUtil.isNotEmptyOrNullOrUndefined(orderNo)) {
map.put("orderNo", orderNo);
}
......@@ -85,7 +80,7 @@ public class PurchaseListPresenter extends BasePresenter<PurchaseListContract.Mo
map.put("pageIndex", pageIndex * PAGE_SIZE);
mModel.getOrderList(map)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.GET_INFO_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.GET_INFO_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -120,7 +115,7 @@ public class PurchaseListPresenter extends BasePresenter<PurchaseListContract.Mo
public void deleteOrder(int position, int orderId) {
mModel.deleteOrder(orderId)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.DELETE_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.DELETE_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......
......@@ -4,7 +4,6 @@ import android.annotation.SuppressLint;
import android.app.Application;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import com.gingersoft.gsa.cloud.common.utils.JsonUtils;
import com.gingersoft.gsa.cloud.common.utils.MoneyUtil;
import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils;
......@@ -15,7 +14,7 @@ import com.gingersoft.supply_chain.mvp.bean.NewPurchaseOrderBean;
import com.gingersoft.supply_chain.mvp.bean.PurchaseFoodBean;
import com.gingersoft.supply_chain.mvp.bean.ShoppingCartBean;
import com.gingersoft.supply_chain.mvp.bean.SupplierInfoBean;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.gingersoft.supply_chain.mvp.content.PurchaseConstant;
import com.gingersoft.supply_chain.mvp.content.SupplyShoppingCart;
import com.gingersoft.supply_chain.mvp.contract.ShoppingCatContract;
import com.jess.arms.di.scope.FragmentScope;
......@@ -226,8 +225,8 @@ public class ShoppingCatPresenter extends BasePresenter<ShoppingCatContract.Mode
@SuppressLint("CheckResult")
public void addNewPurchaseOrder(List<PurchaseFoodBean> purchaseFoodBeans, String remarks) {
NewPurchaseOrderBean newPurchaseOrderBean = new NewPurchaseOrderBean();
newPurchaseOrderBean.setBrandId(Constant.getBrandId());
newPurchaseOrderBean.setRestaurantId(Constant.getRestaurantId());
newPurchaseOrderBean.setBrandId(PurchaseConstant.getBrandId());
newPurchaseOrderBean.setRestaurantId(PurchaseConstant.getRestaurantId());
double totalAmount = 0;
for (PurchaseFoodBean purchaseFoodBean : purchaseFoodBeans) {
totalAmount = MoneyUtil.sum(totalAmount, MoneyUtil.priceCalculation(purchaseFoodBean.getUnitPrice(), purchaseFoodBean.getFoodQuantity()));
......
......@@ -6,7 +6,7 @@ import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.supply_chain.mvp.bean.PurchaseFoodEncodeSn;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.gingersoft.supply_chain.mvp.content.PurchaseConstant;
import com.jess.arms.integration.AppManager;
import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.mvp.BasePresenter;
......@@ -23,7 +23,6 @@ import com.gingersoft.supply_chain.mvp.contract.SnCodeListContract;
import com.jess.arms.utils.RxLifecycleUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -79,7 +78,7 @@ public class SnCodeListPresenter extends BasePresenter<SnCodeListContract.Model,
}
mModel.querySnCodeList(map)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.QUERY_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.QUERY_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -100,7 +99,7 @@ public class SnCodeListPresenter extends BasePresenter<SnCodeListContract.Model,
public void queryInStockSnCodes(String foodNo) {
mModel.queryInStockSnCodes(foodNo)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.QUERY_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.QUERY_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......
......@@ -3,11 +3,10 @@ package com.gingersoft.supply_chain.mvp.presenter;
import android.app.Application;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.supply_chain.mvp.bean.WareHousingOrderBean;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.gingersoft.supply_chain.mvp.content.PurchaseConstant;
import com.gingersoft.supply_chain.mvp.contract.StorageListContract;
import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.http.imageloader.ImageLoader;
......@@ -71,8 +70,8 @@ public class StorageListPresenter extends BasePresenter<StorageListContract.Mode
Map<String, Object> map = new HashMap<>(6);
map.put("pageSize", 10);
map.put("pageIndex", pageIndex);
Constant.addBrandId(map);
Constant.addRestaurantId(map);
PurchaseConstant.addBrandId(map);
PurchaseConstant.addRestaurantId(map);
map.put("status", status);
if (TextUtil.isNotEmptyOrNullOrUndefined(orderNo)) {
map.put("orderNo", orderNo);
......
......@@ -2,14 +2,11 @@ package com.gingersoft.supply_chain.mvp.presenter;
import android.app.Application;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.supply_chain.mvp.bean.PurchaseFoodBean;
import com.gingersoft.supply_chain.mvp.bean.SupplierInfoBean;
import com.gingersoft.supply_chain.mvp.bean.SupplierResultBean;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.gingersoft.supply_chain.mvp.content.PurchaseConstant;
import com.gingersoft.supply_chain.mvp.content.SupplyShoppingCart;
import com.gingersoft.supply_chain.mvp.contract.SupplierListContract;
import com.jess.arms.di.scope.FragmentScope;
......@@ -19,11 +16,9 @@ import com.jess.arms.mvp.BasePresenter;
import com.jess.arms.utils.RxLifecycleUtils;
import com.xuexiang.rxutil2.rxjava.RxJavaUtils;
import com.xuexiang.rxutil2.rxjava.task.RxAsyncTask;
import com.xuexiang.rxutil2.rxjava.task.RxIOTask;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
......@@ -34,8 +29,6 @@ import io.reactivex.annotations.NonNull;
import io.reactivex.schedulers.Schedulers;
import me.jessyan.rxerrorhandler.core.RxErrorHandler;
import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber;
import okhttp3.MediaType;
import okhttp3.RequestBody;
/**
......@@ -91,10 +84,10 @@ public class SupplierListPresenter extends BasePresenter<SupplierListContract.Mo
*/
public void getSupplierList(String content, int pageIndex, boolean needGetIndex) {
Map<String, Object> map = new HashMap<>(5);
map.put("pageSize", Constant.PAGE_SIZE);
map.put("pageIndex", pageIndex * Constant.PAGE_SIZE);
Constant.addRestaurantId(map);
Constant.addBrandId(map);
map.put("pageSize", PurchaseConstant.PAGE_SIZE);
map.put("pageIndex", pageIndex * PurchaseConstant.PAGE_SIZE);
PurchaseConstant.addRestaurantId(map);
PurchaseConstant.addBrandId(map);
if (!TextUtil.isEmptyOrNullOrUndefined(content)) {
map.put("content", content);
}
......@@ -175,7 +168,7 @@ public class SupplierListPresenter extends BasePresenter<SupplierListContract.Mo
public void deleteSupplier(int id, int position) {
mModel.deleteSupplier(id)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.DELETE_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.DELETE_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -191,7 +184,7 @@ public class SupplierListPresenter extends BasePresenter<SupplierListContract.Mo
} else if (TextUtil.isNotEmptyOrNullOrUndefined(info.getErrMsg())) {
mRootView.showMessage(info.getErrMsg());
} else {
mRootView.showMessage(Constant.DELETE_FAIL);
mRootView.showMessage(PurchaseConstant.DELETE_FAIL);
}
}
}
......
package com.gingersoft.supply_chain.mvp.presenter;
import android.app.Application;
import android.util.Log;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.utils.CollectionUtils;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.supply_chain.mvp.bean.PurchaseWarehousingOrderDetailsVO;
import com.gingersoft.supply_chain.mvp.bean.SupplierResultBean;
import com.gingersoft.supply_chain.mvp.bean.WareHouseListBean;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.gingersoft.supply_chain.mvp.content.PurchaseConstant;
import com.jess.arms.integration.AppManager;
import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.mvp.BasePresenter;
......@@ -17,7 +14,6 @@ import com.jess.arms.http.imageloader.ImageLoader;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import lombok.experimental.FieldDefaults;
import me.jessyan.rxerrorhandler.core.RxErrorHandler;
import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber;
......@@ -26,11 +22,7 @@ import javax.inject.Inject;
import com.gingersoft.supply_chain.mvp.contract.WareHouseListContract;
import com.jess.arms.utils.RxLifecycleUtils;
import org.w3c.dom.Text;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -122,13 +114,13 @@ public class WareHouseListPresenter extends BasePresenter<WareHouseListContract.
if (TextUtil.isNotEmptyOrNullOrUndefined(foodName)) {
map.put("name", foodName);
}
Constant.addRestaurantId(map);
Constant.addBrandId(map);
PurchaseConstant.addRestaurantId(map);
PurchaseConstant.addBrandId(map);
map.put("pageSize", 30);
map.put("pageIndex", pageIndex * 30);
mModel.getWarehousing(map)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.GET_INFO_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.GET_INFO_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -153,7 +145,7 @@ public class WareHouseListPresenter extends BasePresenter<WareHouseListContract.
mRootView.showMessage(wareHouseListBean.getErrMsg());
mRootView.loadFail();
} else {
mRootView.showMessage(Constant.GET_INFO_ERROR);
mRootView.showMessage(PurchaseConstant.GET_INFO_ERROR);
mRootView.loadFail();
}
}
......
......@@ -4,20 +4,15 @@ import android.app.Application;
import android.view.View;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import com.gingersoft.gsa.cloud.common.utils.CollectionUtils;
import com.gingersoft.gsa.cloud.common.utils.JsonUtils;
import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.supply_chain.mvp.bean.ConsumeReasonBean;
import com.gingersoft.supply_chain.mvp.bean.ConsumeWareHousingBean;
import com.gingersoft.supply_chain.mvp.bean.PurchaseConsumeSnBean;
import com.gingersoft.supply_chain.mvp.bean.PurchaseFoodEncodeSn;
import com.gingersoft.supply_chain.mvp.bean.PurchaseWarehousingOrderDetailsVO;
import com.gingersoft.supply_chain.mvp.bean.WareHouseListBean;
import com.gingersoft.supply_chain.mvp.bean.WarehouseDetailsBean;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.google.gson.Gson;
import com.gingersoft.supply_chain.mvp.content.PurchaseConstant;
import com.jess.arms.integration.AppManager;
import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.mvp.BasePresenter;
......@@ -27,7 +22,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import me.jessyan.rxerrorhandler.core.RxErrorHandler;
import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber;
import okhttp3.FormBody;
import okhttp3.MediaType;
import okhttp3.RequestBody;
......@@ -36,11 +30,9 @@ import javax.inject.Inject;
import com.gingersoft.supply_chain.mvp.contract.WarehouseDetailsContract;
import com.jess.arms.utils.RxLifecycleUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
......@@ -88,12 +80,12 @@ public class WarehouseDetailsPresenter extends BasePresenter<WarehouseDetailsCon
*/
public void getWarehousingOrderDetails(String foodNo) {
Map<String, Object> map = new HashMap<>(4);
Constant.addBrandId(map);
Constant.addRestaurantId(map);
PurchaseConstant.addBrandId(map);
PurchaseConstant.addRestaurantId(map);
map.put("foodNo", foodNo);
mModel.getWarehousingOrderDetails(map)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.GET_INFO_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.GET_INFO_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -107,7 +99,7 @@ public class WarehouseDetailsPresenter extends BasePresenter<WarehouseDetailsCon
} else if (baseResult != null && TextUtil.isNotEmptyOrNullOrUndefined(baseResult.getErrMsg())) {
mRootView.showMessage(baseResult.getErrMsg());
} else {
mRootView.showMessage(Constant.GET_INFO_ERROR);
mRootView.showMessage(PurchaseConstant.GET_INFO_ERROR);
}
}
});
......@@ -120,12 +112,12 @@ public class WarehouseDetailsPresenter extends BasePresenter<WarehouseDetailsCon
*/
public void getOutStockDetails(String foodNo) {
Map<String, Object> map = new HashMap<>(4);
Constant.addBrandId(map);
Constant.addRestaurantId(map);
PurchaseConstant.addBrandId(map);
PurchaseConstant.addRestaurantId(map);
map.put("foodNo", foodNo);
mModel.getOutStockDetails(map)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.GET_INFO_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.GET_INFO_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -139,7 +131,7 @@ public class WarehouseDetailsPresenter extends BasePresenter<WarehouseDetailsCon
} else if (baseResult != null && TextUtil.isNotEmptyOrNullOrUndefined(baseResult.getErrMsg())) {
mRootView.showMessage(baseResult.getErrMsg());
} else {
mRootView.showMessage(Constant.GET_INFO_ERROR);
mRootView.showMessage(PurchaseConstant.GET_INFO_ERROR);
}
}
});
......@@ -151,7 +143,7 @@ public class WarehouseDetailsPresenter extends BasePresenter<WarehouseDetailsCon
public void getWarehouseInventoryReason() {
mModel.getWarehouseInventoryReason()
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.GET_INFO_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.GET_INFO_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -165,7 +157,7 @@ public class WarehouseDetailsPresenter extends BasePresenter<WarehouseDetailsCon
} else if (baseResult != null && TextUtil.isNotEmptyOrNullOrUndefined(baseResult.getErrMsg())) {
mRootView.showMessage(baseResult.getErrMsg());
} else {
mRootView.showMessage(Constant.GET_INFO_ERROR);
mRootView.showMessage(PurchaseConstant.GET_INFO_ERROR);
}
}
});
......@@ -181,8 +173,8 @@ public class WarehouseDetailsPresenter extends BasePresenter<WarehouseDetailsCon
*/
public void consumeWareHousing(PurchaseWarehousingOrderDetailsVO purchaseWarehousingOrderDetailsVO, int consumeQuantity, ConsumeReasonBean consumeReasonBean, String remarks, List<String> snCodes, boolean whetherPrint) {
PurchaseConsumeSnBean purchaseConsumeSnBean = new PurchaseConsumeSnBean();
purchaseConsumeSnBean.brandId = Constant.getBrandId();
purchaseConsumeSnBean.restaurantId = Constant.getRestaurantId();
purchaseConsumeSnBean.brandId = PurchaseConstant.getBrandId();
purchaseConsumeSnBean.restaurantId = PurchaseConstant.getRestaurantId();
purchaseConsumeSnBean.foodNo = purchaseWarehousingOrderDetailsVO.getFoodNo();
purchaseConsumeSnBean.purchaseConsumeReasonId = consumeReasonBean.getId();
purchaseConsumeSnBean.remarks = remarks;
......@@ -195,7 +187,7 @@ public class WarehouseDetailsPresenter extends BasePresenter<WarehouseDetailsCon
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), GsonUtils.GsonString(purchaseConsumeSnBean));
mModel.consumeWareHousing(requestBody)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.UPDATE_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.UPDATE_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -219,7 +211,7 @@ public class WarehouseDetailsPresenter extends BasePresenter<WarehouseDetailsCon
} else if (baseResult != null && TextUtil.isNotEmptyOrNullOrUndefined(baseResult.getErrMsg())) {
mRootView.showMessage(baseResult.getErrMsg());
} else {
mRootView.showMessage(Constant.GET_INFO_ERROR);
mRootView.showMessage(PurchaseConstant.GET_INFO_ERROR);
}
}
});
......@@ -230,12 +222,12 @@ public class WarehouseDetailsPresenter extends BasePresenter<WarehouseDetailsCon
*/
public void getWarehousingNum(String foodNo) {
Map<String, Object> map = new HashMap<>(3);
Constant.addBrandId(map);
Constant.addRestaurantId(map);
PurchaseConstant.addBrandId(map);
PurchaseConstant.addRestaurantId(map);
map.put("foodNo", foodNo);
mModel.getWarehousingNum(map)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.QUERY_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.QUERY_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......
......@@ -9,8 +9,7 @@ import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.supply_chain.mvp.bean.InventoryRecordBean;
import com.gingersoft.supply_chain.mvp.bean.PurchaseConsumeSnBean;
import com.gingersoft.supply_chain.mvp.bean.PurchaseFoodEncodeSn;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.google.gson.Gson;
import com.gingersoft.supply_chain.mvp.content.PurchaseConstant;
import com.jess.arms.integration.AppManager;
import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.mvp.BasePresenter;
......@@ -20,9 +19,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import me.jessyan.rxerrorhandler.core.RxErrorHandler;
import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber;
import okhttp3.FormBody;
import okhttp3.MediaType;
import okhttp3.Request;
import okhttp3.RequestBody;
import javax.inject.Inject;
......@@ -86,11 +83,11 @@ public class WarehousingInventoryPresenter extends BasePresenter<WarehousingInve
public PurchaseConsumeSnBean getPurchaseConsumeSnBean(String foodNo, int consumeQuantity, List<PurchaseFoodEncodeSn> snCodes) {
PurchaseConsumeSnBean purchaseConsumeSnBean = new PurchaseConsumeSnBean();
purchaseConsumeSnBean.brandId = Constant.getBrandId();
purchaseConsumeSnBean.restaurantId = Constant.getRestaurantId();
purchaseConsumeSnBean.brandId = PurchaseConstant.getBrandId();
purchaseConsumeSnBean.restaurantId = PurchaseConstant.getRestaurantId();
purchaseConsumeSnBean.foodNo = foodNo;
purchaseConsumeSnBean.consumeQuantity = consumeQuantity;
purchaseConsumeSnBean.purchaseConsumeReasonId = Constant.INVENTORY_CONSUME_ID;
purchaseConsumeSnBean.purchaseConsumeReasonId = PurchaseConstant.INVENTORY_CONSUME_ID;
if (CollectionUtils.isNotNullOrEmpty(snCodes)) {
purchaseConsumeSnBean.encodeFoodNos = new ArrayList<>();
for (PurchaseFoodEncodeSn snCode : snCodes) {
......@@ -107,7 +104,7 @@ public class WarehousingInventoryPresenter extends BasePresenter<WarehousingInve
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), GsonUtils.GsonString(purchaseConsumeSnBean));
mModel.wareHousingInventory(requestBody)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.SAVE_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.SAVE_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -117,12 +114,12 @@ public class WarehousingInventoryPresenter extends BasePresenter<WarehousingInve
public void onNext(BaseResult baseResult) {
if (baseResult != null && baseResult.isSuccess()) {
//消耗完之後,關閉頁面
mRootView.showMessage(Constant.SAVE_SUCCESS);
mRootView.showMessage(PurchaseConstant.SAVE_SUCCESS);
mRootView.updateSuccess(purchaseConsumeSnBean.consumeQuantity);
} else if (baseResult != null && TextUtil.isNotEmptyOrNullOrUndefined(baseResult.getErrMsg())) {
mRootView.showMessage(baseResult.getErrMsg());
} else {
mRootView.showMessage(Constant.SAVE_FAIL);
mRootView.showMessage(PurchaseConstant.SAVE_FAIL);
}
}
});
......@@ -134,11 +131,11 @@ public class WarehousingInventoryPresenter extends BasePresenter<WarehousingInve
public void getWarehousingRecord(String foodNo, int pageIndex) {
Map<String, Object> map = new HashMap<>(3);
map.put("foodNo", foodNo);
Constant.addPageSize(map);
map.put("pageIndex", pageIndex * Constant.PAGE_SIZE);
PurchaseConstant.addPageSize(map);
map.put("pageIndex", pageIndex * PurchaseConstant.PAGE_SIZE);
mModel.getWarehousingRecord(map)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(Constant.QUERY_LOADING))
.doOnSubscribe(disposable -> mRootView.showLoading(PurchaseConstant.QUERY_LOADING))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
......@@ -159,7 +156,7 @@ public class WarehousingInventoryPresenter extends BasePresenter<WarehousingInve
} else if (baseResult != null && TextUtil.isNotEmptyOrNullOrUndefined(baseResult.getErrMsg())) {
mRootView.showMessage(baseResult.getErrMsg());
} else {
mRootView.showMessage(Constant.SAVE_FAIL);
mRootView.showMessage(PurchaseConstant.SAVE_FAIL);
}
}
});
......
......@@ -13,6 +13,7 @@ import com.gingersoft.gsa.cloud.common.utils.threadPool.ThreadPoolManager;
import com.gingersoft.supply_chain.R;
import com.gingersoft.supply_chain.mvp.bean.BuyIngredientsBean;
import com.gingersoft.supply_chain.mvp.bean.PurchaseFoodBean;
import com.gingersoft.supply_chain.mvp.ui.fragment.food.BuyIngredientsFragment;
import java.util.List;
......@@ -24,16 +25,25 @@ import java.util.List;
* Use: 食材列表
*/
public class BuyIngredientsAdapter extends GroupedRecyclerViewAdapter<BuyIngredientsBean> {
/**
* 編輯或者下單
* FOOD_INGREDIENTS
* ADD_ORDER
* ORDER_TYPE
*/
private int adapterType;
private boolean isSinger = true;
private OnFoodNumberChangeListener onFoodNumberChangeListener;
private boolean longClick = false;
private int delayTime = 500;
public BuyIngredientsAdapter(Context context, List<BuyIngredientsBean> buyIngredientsBeans) {
public BuyIngredientsAdapter(Context context, List<BuyIngredientsBean> buyIngredientsBeans, int adapterType) {
super(context, buyIngredientsBeans);
addChildClickViewIds(R.id.iv_commodity_edit, R.id.iv_commodity_delete);
this.adapterType = adapterType;
}
public void setShowSingerRow(boolean showType) {
isSinger = showType;
}
......@@ -133,7 +143,16 @@ public class BuyIngredientsAdapter extends GroupedRecyclerViewAdapter<BuyIngredi
}
}
});
if (adapterType == BuyIngredientsFragment.FOOD_INGREDIENTS) {
//編輯食材頁面,顯示編輯和刪除,隱藏加減和數量
setDisplayStateByType(itemViewHolder, true, false, false);
} else if (adapterType == BuyIngredientsFragment.ADD_ORDER) {
//創建採購單頁面,隱藏編輯和刪除,顯示加減和數量
setDisplayStateByType(itemViewHolder, false, true, true);
} else if (adapterType == BuyIngredientsFragment.GET_FOOD_BY_SUPPLIER) {
//供應商商品列表,編輯和數量都顯示
setDisplayStateByType(itemViewHolder, true, purchaseFoodBean.getFoodQuantity() > 0, true);
}
//輸入框焦點監聽
// itemViewHolder.setOnFocusChangeListener(R.id.ed_food_ingredient_number, (v, hasFocus) -> {
// CharSequence text = itemViewHolder.getText(R.id.ed_food_ingredient_number);
......@@ -147,6 +166,14 @@ public class BuyIngredientsAdapter extends GroupedRecyclerViewAdapter<BuyIngredi
}
private void setDisplayStateByType(BaseViewHolder itemViewHolder, boolean b, boolean b2, boolean b3) {
itemViewHolder.setVisible(R.id.iv_commodity_edit, b);
itemViewHolder.setVisible(R.id.iv_commodity_delete, b);
itemViewHolder.setVisible(R.id.btn_food_operation_sub, b2);
itemViewHolder.setVisible(R.id.ed_food_ingredient_number, b2);
itemViewHolder.setVisible(R.id.btn_food_operation_add, b3);
}
/**
* 設置減少按鈕和輸入框的顯示或隱藏
*
......
......@@ -34,6 +34,8 @@ public class FirstLevelCategoryAdapter extends BaseQuickAdapter<OrderCategoryBea
private int selectColor = -1;
private int unSelectColor = -1;
private boolean showNumber = true;
public FirstLevelCategoryAdapter(@Nullable List<OrderCategoryBean.FoodCategoryTrees> data, Context context) {
super(R.layout.item_first_level_category, data);
selectColor = ContextCompat.getColor(context, R.color.other_order_details_sure_btn_color);
......@@ -45,7 +47,7 @@ public class FirstLevelCategoryAdapter extends BaseQuickAdapter<OrderCategoryBea
TextView tvCategoryName = viewHolder.getView(R.id.tv_category_name);
tvCategoryName.setText(categoryBean.getName());
CardView view = viewHolder.getView(R.id.layout_category);
if (categoryBean.getSize() > 0) {
if (categoryBean.getSize() > 0 && showNumber) {
viewHolder.setText(R.id.tv_category_number, String.valueOf(categoryBean.getSize()));
viewHolder.setGone(R.id.tv_category_number, false);
} else {
......@@ -81,6 +83,11 @@ public class FirstLevelCategoryAdapter extends BaseQuickAdapter<OrderCategoryBea
}
}
public FirstLevelCategoryAdapter setIsShowNumber(boolean showNumber) {
this.showNumber = showNumber;
return this;
}
public FirstLevelCategoryAdapter setSelectColor(int selectColor) {
this.selectColor = selectColor;
return this;
......
......@@ -3,7 +3,6 @@ package com.gingersoft.supply_chain.mvp.ui.adapter;
import android.content.Context;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.widget.CheckBox;
import android.widget.EditText;
......@@ -27,7 +26,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.gingersoft.supply_chain.mvp.content.Constant.PURCHASE_FOOD_MAX;
import static com.gingersoft.supply_chain.mvp.content.PurchaseConstant.PURCHASE_FOOD_MAX;
import static com.gingersoft.supply_chain.mvp.ui.fragment.food.FoodIngredientsFragment.FOOD_INGREDIENTS;
import static com.gingersoft.supply_chain.mvp.ui.fragment.food.FoodIngredientsFragment.ORDER_TYPE;
......
......@@ -23,7 +23,6 @@ import com.chad.library.adapter.base.animation.SlideInBottomAnimation;
import com.chad.library.adapter.base.animation.SlideInLeftAnimation;
import com.chad.library.adapter.base.animation.SlideInRightAnimation;
import com.gingersoft.supply_chain.R;
import com.gingersoft.supply_chain.mvp.bean.BuyIngredientsBean;
import com.gingersoft.supply_chain.mvp.bean.GroupStructure;
import java.util.ArrayList;
......@@ -48,10 +47,11 @@ public abstract class GroupedRecyclerViewAdapter<T>
private OnHeaderClickListener mOnHeaderClickListener;
private OnFooterClickListener mOnFooterClickListener;
private OnChildClickListener mOnChildClickListener;
private OnItemClickListener mOnItemClickListener;
private OnHeaderLongClickListener mOnHeaderLongClickListener;
private OnFooterLongClickListener mOnFooterLongClickListener;
private OnChildLongClickListener mOnChildLongClickListener;
private OnItemLongClickListener mOnItemLongClickListener;
private OnItemChildClickListener mOnItemChildClickListener;
protected Context mContext;
//保存分组列表的组结构
......@@ -66,6 +66,10 @@ public abstract class GroupedRecyclerViewAdapter<T>
private boolean showEmptyView = false;
private List<T> data;
/**
* 子view點擊id
*/
private List<Integer> childClickViewIds = new ArrayList<>();
public GroupedRecyclerViewAdapter(Context context, List<T> data) {
this(context, false, data);
......@@ -164,14 +168,33 @@ public abstract class GroupedRecyclerViewAdapter<T>
if (viewType == TYPE_EMPTY) {
return new BaseViewHolder(getEmptyView(parent));
} else {
BaseViewHolder viewHolder;
if (mUseBinding) {
ViewDataBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext),
getLayoutId(mTempPosition, viewType), parent, false);
return new BaseViewHolder(binding.getRoot());
viewHolder = new BaseViewHolder(binding.getRoot());
} else {
View view = LayoutInflater.from(mContext).inflate(
getLayoutId(mTempPosition, viewType), parent, false);
return new BaseViewHolder(view);
viewHolder = new BaseViewHolder(view);
}
bindViewClickListener(viewHolder, viewType);
return viewHolder;
}
}
protected void bindViewClickListener(BaseViewHolder viewHolder, int viewType) {
if (mOnItemChildClickListener != null && viewType == TYPE_CHILD) {
for (Integer childClickViewId : childClickViewIds) {
View childView = viewHolder.get(childClickViewId);
if (!childView.isClickable()) {
childView.setClickable(true);
}
childView.setOnClickListener(v -> {
int groupPosition = getGroupPositionForPosition(viewHolder.getAdapterPosition());
mOnItemChildClickListener.onItemChildClick(GroupedRecyclerViewAdapter.this, v, groupPosition, getChildPositionForPosition(groupPosition, viewHolder.getAdapterPosition()));
});
}
}
}
......@@ -248,16 +271,16 @@ public abstract class GroupedRecyclerViewAdapter<T>
onBindFooterViewHolder((BaseViewHolder) holder, groupPosition, data.get(groupPosition));
} else if (type == TYPE_CHILD) {
int childPosition = getChildPositionForPosition(groupPosition, position);
if (mOnChildClickListener != null) {
if (mOnItemClickListener != null) {
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mOnChildClickListener != null) {
if (mOnItemClickListener != null) {
int gPosition = getGroupPositionForPosition(holder.getLayoutPosition());
int cPosition = getChildPositionForPosition(gPosition, holder.getLayoutPosition());
if (gPosition >= 0 && gPosition < mStructures.size() && cPosition >= 0
&& cPosition < mStructures.get(gPosition).getChildrenCount()) {
mOnChildClickListener.onChildClick(GroupedRecyclerViewAdapter.this,
mOnItemClickListener.onChildClick(GroupedRecyclerViewAdapter.this,
(BaseViewHolder) holder, gPosition, cPosition);
}
}
......@@ -265,16 +288,16 @@ public abstract class GroupedRecyclerViewAdapter<T>
});
}
if (mOnChildLongClickListener != null) {
if (mOnItemLongClickListener != null) {
holder.itemView.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
if (mOnChildLongClickListener != null) {
if (mOnItemLongClickListener != null) {
int gPosition = getGroupPositionForPosition(holder.getLayoutPosition());
int cPosition = getChildPositionForPosition(gPosition, holder.getLayoutPosition());
if (gPosition >= 0 && gPosition < mStructures.size() && cPosition >= 0
&& cPosition < mStructures.get(gPosition).getChildrenCount()) {
return mOnChildLongClickListener.onChildLongClick(GroupedRecyclerViewAdapter.this,
return mOnItemLongClickListener.onChildLongClick(GroupedRecyclerViewAdapter.this,
(BaseViewHolder) holder, gPosition, cPosition);
}
}
......@@ -1303,6 +1326,16 @@ public abstract class GroupedRecyclerViewAdapter<T>
}
}
/**
* 设置需要点击事件的子view
*
* @param viewIds IntArray
*/
public void addChildClickViewIds(int... viewIds) {
for (int viewId : viewIds) {
childClickViewIds.add(viewId);
}
}
//****** 设置点击事件 *****//
/**
......@@ -1328,8 +1361,12 @@ public abstract class GroupedRecyclerViewAdapter<T>
*
* @param listener
*/
public void setOnChildLongClickListener(OnChildLongClickListener listener) {
mOnChildLongClickListener = listener;
public void setOnItemLongClickListener(OnItemLongClickListener listener) {
mOnItemLongClickListener = listener;
}
public void setOnItemChildClickListener(OnItemChildClickListener mOnItemChildClickListener) {
this.mOnItemChildClickListener = mOnItemChildClickListener;
}
/**
......@@ -1355,8 +1392,8 @@ public abstract class GroupedRecyclerViewAdapter<T>
*
* @param listener
*/
public void setOnChildClickListener(OnChildClickListener listener) {
mOnChildClickListener = listener;
public void setOnItemClickListener(OnItemClickListener listener) {
mOnItemClickListener = listener;
}
public abstract int getGroupCount();
......@@ -1427,11 +1464,15 @@ public abstract class GroupedRecyclerViewAdapter<T>
void onFooterClick(GroupedRecyclerViewAdapter adapter, BaseViewHolder holder, int groupPosition);
}
public interface OnChildClickListener {
public interface OnItemClickListener {
void onChildClick(GroupedRecyclerViewAdapter adapter, BaseViewHolder holder,
int groupPosition, int childPosition);
}
public interface OnItemChildClickListener {
void onItemChildClick(@NonNull GroupedRecyclerViewAdapter adapter, @NonNull View view, int groupPosition, int position);
}
public interface OnHeaderLongClickListener {
boolean onHeaderLongClick(GroupedRecyclerViewAdapter adapter, BaseViewHolder holder, int groupPosition);
}
......@@ -1440,7 +1481,7 @@ public abstract class GroupedRecyclerViewAdapter<T>
boolean onFooterLongClick(GroupedRecyclerViewAdapter adapter, BaseViewHolder holder, int groupPosition);
}
public interface OnChildLongClickListener {
public interface OnItemLongClickListener {
boolean onChildLongClick(GroupedRecyclerViewAdapter adapter, BaseViewHolder holder,
int groupPosition, int childPosition);
}
......
......@@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.listener.OnItemClickListener;
import com.gingersoft.gsa.cloud.common.BuildConfig;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import com.gingersoft.gsa.cloud.common.function.click.SingleClick;
import com.gingersoft.gsa.cloud.common.utils.other.SPUtils;
import com.gingersoft.gsa.cloud.database.bean.Function;
import com.gingersoft.supply_chain.R;
......@@ -25,16 +25,13 @@ import com.gingersoft.supply_chain.mvp.ui.adapter.FunctionChildAdapter;
import com.gingersoft.supply_chain.mvp.ui.adapter.PurchaseFunctionAdapter;
import com.gingersoft.supply_chain.mvp.ui.fragment.category.CategoryFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.food.BuyIngredientsFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.food.FoodIngredientsFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.food.MeasurementUnitFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.inventory.StorageListFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.order.OrderDetailsFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.order.PurchaseListFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.food.MeasurementUnitFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.supplier.SupplierListFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.food.FoodIngredientsFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.warehouse.WareHouseListFragment;
import com.gingersoft.supply_chain.mvp.ui.widget.GoodsDetailsPopup;
import com.jess.arms.di.component.AppComponent;
import com.lxj.xpopup.XPopup;
import com.qmuiteam.qmui.widget.QMUITopBar;
import java.util.ArrayList;
......@@ -116,7 +113,8 @@ public class FunctionListFragment extends BaseSupplyChainFragment<FunctionListPr
start(SupplierListFragment.newInstance(false, null));
break;
case "食材":
start(FoodIngredientsFragment.newInstance(FOOD_INGREDIENTS));
// start(FoodIngredientsFragment.newInstance(FOOD_INGREDIENTS));
start(BuyIngredientsFragment.newInstance(FOOD_INGREDIENTS));
break;
case "種類":
start(CategoryFragment.newInstance());
......
......@@ -363,7 +363,9 @@ public class FoodIngredientsFragment extends BaseSupplyChainFragment<FoodIngredi
}
if (listSelectAdapter == null) {
listSelectAdapter = new LeftCategoryAdapter(categoryBeans);
listSelectAdapter.setUnSelectColor(ContextCompat.getColor(mContext, R.color.color_3c))
listSelectAdapter.setSelectedBg(R.drawable.shape_left_radio_shadow)
.setUnSelectedBg(R.color.trans)
.setUnSelectColor(ContextCompat.getColor(mContext, R.color.color_3c))
.setSelectColor(ContextCompat.getColor(mContext, R.color.theme_color));
listSelectAdapter.setOnItemClickListener((adapter, view, position) -> {
listSelectAdapter.setSelectedIndex(position);
......
......@@ -31,6 +31,7 @@ import com.gingersoft.supply_chain.mvp.bean.SupplierInfoBean;
import com.gingersoft.supply_chain.mvp.contract.NewFoodIngredientsContract;
import com.gingersoft.supply_chain.mvp.presenter.NewFoodIngredientsPresenter;
import com.gingersoft.supply_chain.mvp.ui.fragment.BaseSupplyChainFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.category.CategoryFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.category.CategorySelectFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.supplier.SupplierListFragment;
import com.gingersoft.supply_chain.mvp.utils.SelectPicture;
......@@ -48,6 +49,7 @@ import butterknife.BindView;
import butterknife.OnClick;
import static com.gingersoft.gsa.cloud.ui.recylcler.decorator.DividerItemDecoration.VERTICAL_LIST;
import static com.gingersoft.supply_chain.mvp.ui.fragment.category.CategoryFragment.SELECT_CATEGORY;
import static com.gingersoft.supply_chain.mvp.ui.fragment.category.CategorySelectFragment.SELECT_CATEGORY_DATA_KEY;
import static com.gingersoft.supply_chain.mvp.ui.fragment.category.CategorySelectFragment.SELECT_FOOD_CATEGORY_REQUEST_CODE;
import static com.gingersoft.supply_chain.mvp.ui.fragment.food.FoodUnitPageFragment.BASIC_UNIT_KEY;
......@@ -180,7 +182,7 @@ public class NewFoodIngredientsFragment extends BaseSupplyChainFragment<NewFoodI
startForResult(SupplierListFragment.newInstance(true, multiBean.getShowValue()), multiBean.getRequestCode());
} else if (infoMultiBean.getFragment() == CategorySelectFragment.class) {
//選擇分類
startForResult(CategorySelectFragment.newInstance(mPresenter.getCategoryName()), multiBean.getRequestCode());
startForResult(CategoryFragment.newInstance(mPresenter.getCategoryName(), SELECT_CATEGORY), multiBean.getRequestCode());
} else if (infoMultiBean.getFragment() == FoodUnitPageFragment.class) {
//食品單位
startForResult(FoodUnitPageFragment.newInstance(mPresenter.getBasicUnit(data), mPresenter.getDeputyUnitBeans(), isUpdate, mPresenter.getFoodId()), multiBean.getRequestCode());
......
......@@ -60,6 +60,7 @@ import com.gingersoft.supply_chain.mvp.utils.ViewUtils;
import com.google.android.material.checkbox.MaterialCheckBox;
import com.google.android.material.textfield.TextInputLayout;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.http.imageloader.ImageLoader;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.enums.PopupPosition;
import com.lxj.xpopup.interfaces.OnSelectListener;
......@@ -229,10 +230,18 @@ public class OrderDetailsFragment extends BaseSupplyChainFragment<OrderDetailsPr
* @param state 狀態,全部收貨還是部分收貨
*/
private void addWarehouse(int state) {
AppDialog.getInstance().showTipDialog(requireContext(), "是否確認收貨?", (view, dialog) -> {
for (PurchaseOrderDetailsBean.PurchaseOrderDetailsInfoVosBean data : orderDetailsFoodAdapter.getData()) {
//只要有一個是選中的,就不循環了,開始收貨
if (data.isChecked()) {
AppDialog.getInstance().showTipDialog(requireContext(), getString(R.string.str_confirm_receipt), (view, dialog) -> {
mPresenter.addWarehouse(state, edRemark.getText() + "", totalAmount, orderDetailsFoodAdapter.getData());
setFragmentResult(RESULT_OK, null);
});
return;
}
}
//循環完了,沒有一個選中的,提示用戶
showMessage(getString(R.string.str_select_least_one_product));
}
private OnSelectListener mOnSelectListener = (position, text) -> {
......
......@@ -28,6 +28,7 @@ import com.gingersoft.supply_chain.mvp.contract.SupplierListContract;
import com.gingersoft.supply_chain.mvp.presenter.SupplierListPresenter;
import com.gingersoft.supply_chain.mvp.ui.adapter.SupplierAdapter;
import com.gingersoft.supply_chain.mvp.ui.fragment.BaseSupplyChainFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.food.BuyIngredientsFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.food.FoodIngredientsFragment;
import com.jess.arms.di.component.AppComponent;
import com.kingja.loadsir.callback.Callback;
......@@ -243,7 +244,7 @@ public class SupplierListFragment extends BaseSupplyChainFragment<SupplierListPr
} else if (view.getId() == R.id.layout_see_ingredients) {
//跳轉到供應商食品詳情
List<SupplierInfoBean> data = supplierAdapter.getData();
start(FoodIngredientsFragment.newInstance(data.get(position).getId(), data.get(position).getSupplierName()));
start(BuyIngredientsFragment.newInstance(data.get(position).getId(), data.get(position).getSupplierName()));
}
});
} else {
......
package com.gingersoft.supply_chain.mvp.ui.widget;
import android.content.Context;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
......@@ -20,10 +19,8 @@ import com.gingersoft.gsa.cloud.ui.view.imageview.mask.PorterShapeImageView;
import com.gingersoft.supply_chain.R;
import com.gingersoft.supply_chain.R2;
import com.gingersoft.supply_chain.mvp.bean.PurchaseFoodBean;
import com.gingersoft.supply_chain.mvp.content.Constant;
import com.gingersoft.supply_chain.mvp.content.PurchaseConstant;
import com.gingersoft.supply_chain.mvp.ui.adapter.BuyIngredientsAdapter;
import com.google.android.material.textfield.TextInputEditText;
import com.lxj.xpopup.core.BasePopupView;
import com.lxj.xpopup.core.CenterPopupView;
import com.lxj.xpopup.util.KeyboardUtils;
import com.qmuiteam.qmui.layout.QMUIButton;
......@@ -68,6 +65,10 @@ public class GoodsDetailsPopup extends CenterPopupView {
ImageView ivPopupClose;
private PurchaseFoodBean purchaseFoodBean;
private BuyIngredientsAdapter.OnFoodNumberChangeListener onFoodNumberChangeListener;
/**
* 是否可以編輯數量
*/
private boolean isEditNumber;
public GoodsDetailsPopup(@NonNull Context context, PurchaseFoodBean purchaseFoodBean) {
super(context);
......@@ -102,9 +103,13 @@ public class GoodsDetailsPopup extends CenterPopupView {
} else {
tvGoodsSpecification.setText(purchaseFoodBean.getBasicUnitName());
}
edFoodIngredientNumber.setText(purchaseFoodBean.getFoodQuantity() + "");
KeyboardUtils.hideSoftInput(this);
ivPopupClose.setOnClickListener(this::onClick);
if (!isEditNumber) {
layoutOperationFoodNum.setVisibility(GONE);
return;
}
edFoodIngredientNumber.setText(purchaseFoodBean.getFoodQuantity() + "");
btnFoodOperationSub.setOnClickListener(v -> {
//减
if (purchaseFoodBean.getFoodQuantity() > 0) {
......@@ -127,12 +132,15 @@ public class GoodsDetailsPopup extends CenterPopupView {
btnFoodOperationAdd.setOnClickListener(v -> {
//加
if (purchaseFoodBean.getFoodQuantity() < Constant.PURCHASE_FOOD_MAX) {
if (purchaseFoodBean.getFoodQuantity() < PurchaseConstant.PURCHASE_FOOD_MAX) {
foodNumberChange(1);
}
});
ivPopupClose.setOnClickListener(this::onClick);
KeyboardUtils.hideSoftInput(this);
}
public GoodsDetailsPopup setEditNumber(boolean editNumber) {
isEditNumber = editNumber;
return this;
}
/**
......@@ -147,7 +155,7 @@ public class GoodsDetailsPopup extends CenterPopupView {
return false;
};
private int delayTime = Constant.LONG_CLICK_INIT_TIME;
private int delayTime = PurchaseConstant.LONG_CLICK_INIT_TIME;
private boolean longClick = false;
/**
......@@ -159,16 +167,16 @@ public class GoodsDetailsPopup extends CenterPopupView {
//開啟線程
ThreadPoolManager.getInstence().putExecutableTasks(() -> {
int number = purchaseFoodBean.getFoodQuantity();
delayTime = Constant.LONG_CLICK_INIT_TIME;
delayTime = PurchaseConstant.LONG_CLICK_INIT_TIME;
if (addOrSub) {
//+
while (longClick) {
if (number < Constant.PURCHASE_FOOD_MAX) {
if (number < PurchaseConstant.PURCHASE_FOOD_MAX) {
try {
Thread.sleep(delayTime);
number++;
if (delayTime > Constant.LONG_CLICK_DECREASE_TIME) {
delayTime -= Constant.LONG_CLICK_DECREASE_TIME;
if (delayTime > PurchaseConstant.LONG_CLICK_DECREASE_TIME) {
delayTime -= PurchaseConstant.LONG_CLICK_DECREASE_TIME;
}
edFoodIngredientNumber.post(() -> foodNumberChange(1));
} catch (InterruptedException e) {
......@@ -185,8 +193,8 @@ public class GoodsDetailsPopup extends CenterPopupView {
try {
Thread.sleep(delayTime);
number--;
if (delayTime > Constant.LONG_CLICK_DECREASE_TIME) {
delayTime -= Constant.LONG_CLICK_DECREASE_TIME;
if (delayTime > PurchaseConstant.LONG_CLICK_DECREASE_TIME) {
delayTime -= PurchaseConstant.LONG_CLICK_DECREASE_TIME;
}
edFoodIngredientNumber.post(() -> foodNumberChange(-1));
} catch (InterruptedException e) {
......
package com.gingersoft.supply_chain.mvp.utils;
import android.app.Activity;
import android.os.Build;
import android.util.Log;
import android.view.View;
import android.view.ViewTreeObserver;
/**
* simple and powerful Keyboard show/hidden listener,view {@android.R.id.content} and {@ViewTreeObserver.OnGlobalLayoutListener}
* Created by yes.cpu@gmail.com 2016/7/13.
*/
public class KeyboardChangeListener implements ViewTreeObserver.OnGlobalLayoutListener {
private static final String TAG = "ListenerHandler";
private View mContentView;
private int mOriginHeight;
private int mPreHeight;
private KeyBoardListener mKeyBoardListen;
public interface KeyBoardListener {
/**
* call back
* @param isShow true is show else hidden
* @param keyboardHeight keyboard height
*/
void onKeyboardChange(boolean isShow, int keyboardHeight);
}
public void setKeyBoardListener(KeyBoardListener keyBoardListen) {
this.mKeyBoardListen = keyBoardListen;
}
public KeyboardChangeListener(Activity contextObj) {
if (contextObj == null) {
Log.i(TAG, "contextObj is null");
return;
}
mContentView = findContentView(contextObj);
if (mContentView != null) {
addContentTreeObserver();
}
}
private View findContentView(Activity contextObj) {
return contextObj.findViewById(android.R.id.content);
}
private void addContentTreeObserver() {
mContentView.getViewTreeObserver().addOnGlobalLayoutListener(this);
}
@Override
public void onGlobalLayout() {
int currHeight = mContentView.getHeight();
if (currHeight == 0) {
Log.i(TAG, "currHeight is 0");
return;
}
boolean hasChange = false;
if (mPreHeight == 0) {
mPreHeight = currHeight;
mOriginHeight = currHeight;
} else {
if (mPreHeight != currHeight) {
hasChange = true;
mPreHeight = currHeight;
} else {
hasChange = false;
}
}
if (hasChange) {
boolean isShow;
int keyboardHeight = 0;
if (mOriginHeight == currHeight) {
//hidden
isShow = false;
} else {
//show
keyboardHeight = mOriginHeight - currHeight;
isShow = true;
}
if (mKeyBoardListen != null) {
mKeyBoardListen.onKeyboardChange(isShow, keyboardHeight);
}
}
}
public void destroy() {
if (mContentView != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
mContentView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
}
}
}
}
......@@ -121,7 +121,6 @@ public class SelectPicture {
if (takePictureIntent.resolveActivity(activity.getPackageManager()) != null) {
File photoFile;
photoFile = createImageFile(activity);
// currentPhotoPath = image.getAbsolutePath();
mCameraUri = Uri.fromFile(photoFile);
try {
Uri photoUri = FileProvider.getUriForFile(activity,
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_10"
android:background="@drawable/shape_dialog_bg"
android:orientation="vertical">
......@@ -18,7 +22,7 @@
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_15"
android:text="新增類別"
android:text="@string/str_new_add_category"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_17"
android:textStyle="bold" />
......@@ -45,7 +49,6 @@
<include layout="@layout/include_horizontal_color_eee_dividing_line" />
<TextView
android:id="@+id/tv_content"
android:layout_width="wrap_content"
......@@ -63,10 +66,10 @@
android:layout_height="@dimen/dp_40"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginRight="@dimen/new_category_dialog_marginLeft"
android:inputType="text|textCapWords"
android:background="@null"
android:gravity="left|center_vertical"
android:hint="請輸入類別名稱"
android:inputType="text|textCapWords"
android:maxLength="4"
android:paddingLeft="@dimen/new_category_dialog_marginLeft"
android:paddingRight="@dimen/new_category_dialog_marginLeft"
......@@ -76,7 +79,6 @@
<include layout="@layout/include_horizontal_color_eee_dividing_line" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -111,4 +113,5 @@
android:text="取消" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
</LinearLayout>
</FrameLayout>
......@@ -4,6 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/supply_chain_bg_color"
android:animateLayoutChanges="true"
android:orientation="vertical">
<com.qmuiteam.qmui.widget.QMUITopBar
......@@ -117,47 +118,31 @@
<!-- 二級分類 -->
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/layout_category"
android:background="@color/white"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_40">
android:layout_height="@dimen/dp_40"
android:visibility="gone"
android:background="@color/white">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_food_ingredients_second_category"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_58" />
android:layout_marginRight="@dimen/dp_40" />
<androidx.cardview.widget.CardView
android:id="@+id/card_show_more_category"
android:layout_width="@dimen/dp_58"
android:layout_width="@dimen/dp_40"
android:layout_height="match_parent"
android:layout_gravity="right"
android:background="@color/white"
app:cardElevation="@dimen/dp_10">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_unfold_arrow"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:src="@drawable/ic_inverted_triangle_66" />
<TextView
android:id="@+id/tv_unfold_category"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_3"
android:text="展開"
android:textColor="@color/color_3c"
android:textSize="@dimen/dp_12" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</com.google.android.material.appbar.CollapsingToolbarLayout>
......
......@@ -61,6 +61,7 @@
</LinearLayout>
<LinearLayout
android:id="@+id/layout_category_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_10"
......@@ -95,7 +96,8 @@
</LinearLayout>
<LinearLayout
<RelativeLayout
android:id="@+id/layout_category_right"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"
......@@ -112,13 +114,14 @@
android:textColor="@color/white"
android:textSize="@dimen/dp_14"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent"
tools:text="水果類" />
<androidx.cardview.widget.CardView
android:id="@+id/card_second_category"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/dp_70"
android:minHeight="@dimen/dp_100"
app:cardCornerRadius="@dimen/dp_0"
app:cardElevation="@dimen/dp_5">
......@@ -135,27 +138,32 @@
style="@style/Second_Category_Style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_8"
android:background="@drawable/shape_border_white_bg"
android:gravity="center"
android:text="@string/str_add_subtype"
android:textColor="@color/theme_color" />
android:textColor="@color/theme_color"
android:visibility="gone" />
</androidx.cardview.widget.CardView>
<FrameLayout
android:id="@+id/layout_third_category"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/layout_select_category_btn"
android:layout_below="@id/card_second_category"
android:layout_marginTop="@dimen/dp_7"
android:layout_marginRight="@dimen/dp_4">
android:layout_marginRight="@dimen/dp_4"
android:paddingBottom="@dimen/dp_10"
android:background="@color/white"
android:minHeight="@dimen/dp_100">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_third_category"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/dp_4"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
......@@ -166,13 +174,47 @@
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_13"
android:layout_marginTop="@dimen/dp_8"
android:visibility="gone"
android:background="@drawable/shape_color_da_stoke_fifteen_corners"
android:gravity="center"
android:text="@string/str_add_subtype"
android:textColor="@color/theme_color" />
android:textColor="@color/theme_color"
android:visibility="gone" />
</FrameLayout>
<LinearLayout
android:id="@+id/layout_select_category_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_food_ingredients_confirm"
style="@style/Save_Btn_Style"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:layout_weight="1"
android:text="確定"
android:visibility="visible" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_food_ingredients_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_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:layout_weight="1"
android:text="取消"
android:visibility="visible" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
......
......@@ -114,6 +114,24 @@
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_commodity_edit"
android:layout_width="@dimen/dp_26"
android:layout_height="@dimen/dp_26"
android:src="@drawable/ic_blue_edit"
android:padding="@dimen/dp_3"
android:visibility="gone" />
<ImageView
android:id="@+id/iv_commodity_delete"
android:layout_width="@dimen/dp_26"
android:layout_height="@dimen/dp_26"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_5"
android:src="@drawable/ic_red_delete"
android:padding="@dimen/dp_3"
android:visibility="gone" />
<com.qmuiteam.qmui.layout.QMUIButton
android:id="@+id/btn_food_operation_sub"
android:layout_width="@dimen/dp_24"
......
......@@ -126,12 +126,31 @@
<!-- android:divider="@color/color_3c"-->
<!-- android:gravity="center_vertical"-->
<!-- android:orientation="horizontal">-->
<ImageView
android:id="@+id/iv_commodity_edit"
android:layout_width="@dimen/dp_26"
android:layout_height="@dimen/dp_26"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:src="@drawable/ic_blue_edit"
android:padding="@dimen/dp_3"
android:visibility="gone" />
<ImageView
android:id="@+id/iv_commodity_delete"
android:layout_width="@dimen/dp_26"
android:layout_height="@dimen/dp_26"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_5"
android:padding="@dimen/dp_3"
android:src="@drawable/ic_red_delete"
android:visibility="gone" />
<com.qmuiteam.qmui.layout.QMUIButton
android:id="@+id/btn_food_operation_sub"
android:layout_width="@dimen/dp_24"
android:layout_height="@dimen/dp_24"
android:layout_marginLeft="@dimen/dp_2"
android:layout_marginLeft="@dimen/dp_5"
android:background="@drawable/ic_circle_gray_sub" />
<com.google.android.material.textfield.TextInputEditText
......
......@@ -52,4 +52,9 @@
<string name="str_amount">金額</string>
<string name="str_inventory_reason">消耗原因</string>
<string name="str_only_allowed_input_number">只允許輸入數字</string>
<string name="str_category_manager">類別管理</string>
<string name="str_choice_category">選擇類別</string>
<string name="str_select_least_one_product">至少選擇一個商品</string>
<string name="str_confirm_receipt">是否確認收貨?</string>
</resources>
\ No newline at end of file
......@@ -4,7 +4,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.jakewharton.butterknife'
apply plugin: 'kotlin-kapt'
apply plugin: 'android-aspectjx'
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
......@@ -133,7 +133,58 @@ dependencies {
api 'com.github.huangyanbin:SmartTable:2.2.0'
implementation 'com.lxj:xpopup:2.2.10'
implementation "androidx.documentfile:documentfile:1.0.1"
implementation 'org.aspectj:aspectjrt:1.8.14'
aspectjx {
exclude 'androidx', 'org.jetbrains.kotlin', "module-info", 'com.google', 'com.squareup', 'org.apache', 'versions.9', 'com.squareup.okio', 'okio', 'leakcanary', 'com.google.firebase', 'com.google.android'
}
}
repositories {
mavenCentral()
}
import org.aspectj.bridge.IMessage
import org.aspectj.bridge.MessageHandler
import org.aspectj.tools.ajc.Main
final def log = project.logger
android.libraryVariants.all { variant ->
if (!variant.buildType.isDebuggable()) {
log.debug("Skipping non-debuggable build type '${variant.buildType.name}'.")
return
}
JavaCompile javaCompile = variant.javaCompiler
javaCompile.doLast {
String[] args = ["-showWeaveInfo",
"-1.8",
"-inpath", javaCompile.destinationDir.toString(),
"-aspectpath", javaCompile.classpath.asPath,
"-d", javaCompile.destinationDir.toString(),
"-classpath", javaCompile.classpath.asPath,
"-bootclasspath", project.android.bootClasspath.join(File.pathSeparator)]
log.debug "ajc args: " + Arrays.toString(args)
MessageHandler handler = new MessageHandler(true)
new Main().run(args, handler)
for (IMessage message : handler.getMessages(null, true)) {
switch (message.getKind()) {
case IMessage.ABORT:
case IMessage.ERROR:
case IMessage.FAIL:
log.error message.message, message.thrown
break
case IMessage.WARNING:
log.warn message.message, message.thrown
break
case IMessage.INFO:
log.info message.message, message.thrown
break
case IMessage.DEBUG:
log.debug message.message, message.thrown
break
}
}
}
}
......@@ -32,6 +32,8 @@ import com.gingersoft.gsa.cloud.common.loadsir.pos.PosRefundStatusExceptionCallb
import com.gingersoft.gsa.cloud.common.loadsir.pos.PosSettlementStatusExceptionCallback;
import com.gingersoft.gsa.cloud.common.loadsir.pos.PosTipsStatusExceptionCallback;
import com.gingersoft.gsa.cloud.common.loadsir.pos.PosVoidStatusExceptionCallback;
import com.gingersoft.gsa.cloud.common.loadsir.purchase.EmptyCategoryCallback;
import com.gingersoft.gsa.cloud.common.loadsir.purchase.NotGoodsCallback;
import com.gingersoft.gsa.cloud.common.logan.LoganManager;
import com.gingersoft.gsa.cloud.common.oaId.DeviceID;
import com.gingersoft.gsa.cloud.common.printer.AidlUtil;
......@@ -270,6 +272,8 @@ public class GsaCloudApplication extends BaseApplication {
.addCallback(new PosVoidStatusExceptionCallback())
.addCallback(new PosTipsStatusExceptionCallback())
.addCallback(new PosSettlementStatusExceptionCallback())
.addCallback(new NotGoodsCallback())
.addCallback(new EmptyCategoryCallback())
.commit();
}
......
......@@ -86,6 +86,8 @@ class OrderDetails {
//是否是預約單 0 :即時單 1:是預約單
var appointmentType: Int = 0
//會員號碼
var memberPhone: String? = null
var orderPayType: Int = 0//0店內支付,1為貨到付款,2是在線支付
var isDelete: Int = 1 //默認為1,為0是第三方物流,其他則是本店配送
var payTime: String? = null
......
package com.gingersoft.gsa.cloud.common.function.click;
import android.util.Log;
import android.view.View;
import com.gingersoft.gsa.cloud.common.R;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import java.util.Calendar;
/**
* 全局BaseQuickAdapter item點擊事件AOP
*/
@Aspect
public class BaseQueicItemClickAspect {
static int TIME_TAG = R.id.click_time;
/**
* 方法切入点
*/
@Pointcut("execution(* com.chad.library.adapter.base.listener.OnItemClickListener.onItemClick(..))")
public void onItemSingleClickMethod() {
}
/**
* 在连接点进行方法替换
*
* @param joinPoint
* @throws Throwable
*/
@Around("onItemSingleClickMethod()")
public void doItemSingleClickMethod(ProceedingJoinPoint joinPoint) throws Throwable {
Log.d("SingleClickAspect", "來了");
View view = null;
for (Object arg : joinPoint.getArgs()) {
if (arg instanceof View) {
view = (View) arg;
}
if (view != null) {
Object tag = view.getTag(TIME_TAG);
long lastClickTime = ((tag != null) ? (long) tag : 0);
Log.d("SingleClickAspect", "lastClickTime:" + lastClickTime);
long currentTime = Calendar.getInstance().getTimeInMillis();
if (currentTime - lastClickTime > 500) {//过滤掉500毫秒内的连续点击
view.setTag(TIME_TAG, currentTime);
Log.d("SingleClickAspect", "currentTime:" + currentTime);
joinPoint.proceed();//执行原方法
} else {
Log.d("SingleClickAspect", "連點了");
}
}
}
}
}
package com.gingersoft.gsa.cloud.common.function.click;
import android.view.View;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
......@@ -16,6 +18,7 @@ import java.lang.annotation.Target;
@Target(ElementType.METHOD)
public @interface SingleClick {
long value() default 1000;
long value() default 100;
int[] ids() default {View.NO_ID};
}
//package com.gingersoft.gsa.cloud.common.function.click;
//
//import android.util.Log;
//import android.view.View;
//
//import org.aspectj.lang.ProceedingJoinPoint;
//import org.aspectj.lang.annotation.Around;
//import org.aspectj.lang.annotation.Aspect;
//import org.aspectj.lang.annotation.Pointcut;
//import org.aspectj.lang.reflect.MethodSignature;
//
//import java.lang.reflect.Method;
//
///**
// * @author 宇航.
// * User: admin
// * Date: 2021/3/3
// * Time: 11:46
// * Use:
// */
//@Aspect
//public class SingleClickAspect {
// private static final long DEFAULT_TIME_INTERVAL = 5000;
// /**
// * 定义切点,标记切点为所有被@SingleClick注解的方法
// 注意:这里me.baron.test.annotation.SingleClick需要替换成
// * 你自己项目中SingleClick这个类的全路径哦
// */
// @Pointcut("execution(@com.gingersoft.gsa.cloud.common.function.click.SingleClick * *(..))")
// public void methodAnnotated() {}
//
// /**
// * 定义一个切面方法,包裹切点方法
// */
// @Around("methodAnnotated()")
// public void aroundJoinPoint(ProceedingJoinPoint joinPoint) throws Throwable {
// // 取出方法的参数
//// View view = null;
//// for (Object arg : joinPoint.getArgs()) {
//// if (arg instanceof View) {
//// view = (View) arg;
//// break;
//// }
//// }
//// if (view == null) {
//// return;
//// }
// // 取出方法的注解
// MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
// Method method = methodSignature.getMethod();
// Log.e("eee", "aroundJoinPoint");
// if (!method.isAnnotationPresent(SingleClick.class)) {
// Log.e("eee", "isAnnotationPresent");
// return;
// }
// SingleClick singleClick = method.getAnnotation(SingleClick.class);
// // 判断是否快速点击
// if (!isFastDoubleClick(method.getName(), singleClick.value())) {
// Log.e("eee", "不是快速點擊");
// // 不是快速点击,执行原方法
// joinPoint.proceed();
// } else {
// Log.e("eee", "快速點擊");
// }
// }
//
// /**
// * 最近一次点击的时间
// */
// private static long mLastClickTime;
// /**
// * 最近一次点击的方法
// */
// private static String mLastMethodName;
//
// /**
// * 是否是快速点击
// * @param intervalMillis 时间间期(毫秒)
// * @return true:是,false:不是
// */
// public static boolean isFastDoubleClick(String methodName, long intervalMillis) {
// long time = System.currentTimeMillis();
// long timeInterval = Math.abs(time - mLastClickTime);
// if (timeInterval < intervalMillis && methodName.equals(mLastMethodName)) {
// return true;
// } else {
// mLastClickTime = time;
// mLastMethodName = methodName;
// return false;
// }
// }
//}
package com.gingersoft.gsa.cloud.common.function.click;
import android.util.Log;
import android.view.View;
import com.gingersoft.gsa.cloud.common.R;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import java.util.Calendar;
/**
* Created by jerry on 2018/6/13.
*/
@Aspect
public class SingleClickAspect {
static int TIME_TAG = R.id.click_time;
@Pointcut("execution(@com.gingersoft.gsa.cloud.common.function.click.SingleClick * *(..))")
//方法切入点
public void onSingleClickMethod() {
}
@Around("onSingleClickMethod() && @annotation(singleClick)")//在连接点进行方法替换
public void doSingleClickMethod(ProceedingJoinPoint joinPoint, SingleClick singleClick) throws Throwable {
View view = null;
for (Object arg : joinPoint.getArgs())
if (arg instanceof View) view = (View) arg;
if (view != null) {
Object tag = view.getTag(TIME_TAG);
long lastClickTime = ((tag != null) ? (long) tag : 0);
Log.d("SingleClickAspect", "lastClickTime:" + lastClickTime);
long currentTime = Calendar.getInstance().getTimeInMillis();
long value = singleClick.value();
int[] ids = singleClick.ids();
if (currentTime - lastClickTime > value || !hasId(ids, view.getId())) {//过滤掉500毫秒内的连续点击
view.setTag(TIME_TAG, currentTime);
Log.d("SingleClickAspect", "currentTime:" + currentTime);
joinPoint.proceed();//执行原方法
} else {
Log.d("SingleClickAspect", "連點了");
}
}
}
public static boolean hasId(int[] arr, int value) {
for (int i : arr) {
if (i == value)
return true;
}
return false;
}
}
package com.gingersoft.gsa.cloud.common.loadsir.purchase;
import android.content.Context;
import android.view.View;
import com.gingersoft.gsa.cloud.common.R;
import com.kingja.loadsir.callback.Callback;
import butterknife.ButterKnife;
/**
* @author : bin
* @create date: 2020-10-27
* @update date: 2020-10-27
* @description:
*/
public class EmptyCategoryCallback extends Callback {
@Override
protected int onCreateView() {
return R.layout.loadsir_empty_category;
}
@Override
protected void onViewCreate(Context context, View view) {
super.onViewCreate(context, view);
ButterKnife.bind(this, view);
}
}
package com.gingersoft.gsa.cloud.common.loadsir.purchase;
import android.content.Context;
import android.view.View;
import com.gingersoft.gsa.cloud.common.R;
import com.kingja.loadsir.callback.Callback;
import butterknife.ButterKnife;
/**
* @author 宇航. 1239658231@qq.com
* User: admin
* Date: 2021/4/23
* Time: 9:50
* Use: 沒有商品時默認頁面
*/
public class NotGoodsCallback extends Callback {
@Override
protected int onCreateView() {
return R.layout.loadsir_not_have_goods;
}
@Override
protected void onViewCreate(Context context, View view) {
super.onViewCreate(context, view);
ButterKnife.bind(this, view);
}
}
......@@ -29,6 +29,7 @@ import com.gingersoft.gsa.cloud.common.utils.okhttpUtils.OkHttp3Utils
import com.gingersoft.gsa.cloud.common.utils.time.TimeUtils
import com.gingersoft.gsa.cloud.component.ComponentName
import com.google.gson.Gson
import com.jess.arms.utils.DeviceUtils
import com.xuexiang.rxutil2.rxjava.RxJavaUtils
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
......@@ -416,7 +417,7 @@ class ICommandService : Service() {
val token = "weixin_" + RestaurantInfoManager.newInstance().restaurantId + "_" + getRandomString(24)
LoganManager.w_code(TAG, "token=" + token)
if (mWebSocket != null) {
mWebSocket?.send(Gson().toJson(MsgBean(1, getConnectiontype(), token)))
mWebSocket?.send(Gson().toJson(MsgBean(1, getConnectiontype(), token, UserContext.newInstance().memberId, DeviceUtils.getDeviceId(this))))
}
}
......@@ -521,6 +522,6 @@ class ICommandService : Service() {
LoganManager.w_network("$TAG -> $content")
}
class MsgBean(var type: Int, var data: String, var token: String)
class MsgBean(var type: Int, var data: String, var token: String, var userId: Int, var deviceId: String)
}
\ No newline at end of file
......@@ -229,10 +229,10 @@ public class FileUtils {
return new File(folderPath, fileName + fileName);
}
/*
/**
* 在SD卡上创建目录
*/
public static File creatSDDir(String dirName) {
public static File createSDDir(String dirName) {
File dir = new File(dirName);
if (!dir.exists()) {
dir.mkdirs();
......
......@@ -58,17 +58,22 @@ public class MatchUtils {
")" +
"\\d{8}" +
")";
private static final int PHONE_LENGTH = 11;
//
// private static final Pattern emailPattern = Pattern.compile("^([a-zA-Z0-9]*[-_]?[a-zA-Z0-9]+)*@([a-zA-Z0-9]*[-_]?[a-zA-Z0-9]+)+[\\.][A-Za-z]{2,3}([\\.][A-Za-z]{2})?$");
/**
* 郵箱驗證
*/
private static final Pattern EMAIL_PATTERN = Pattern.compile("[\\w!#$%&'*+/=?^_`{|}~-]+(?:\\.[\\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\\w](?:[\\w-]*[\\w])?\\.)+[\\w](?:[\\w-]*[\\w])?");
public static boolean checkMobile(String phone) {
if (phone.length() != 11) {
if (phone.length() != PHONE_LENGTH) {
return false;
} else {
Pattern p = Pattern.compile(REGEX_MOBILE);
Matcher m = p.matcher(phone);
boolean isMatch = m.matches();
if (!isMatch) {
}
return isMatch;
return m.matches();
}
}
......@@ -82,9 +87,7 @@ public class MatchUtils {
if (TextUtils.isEmpty(email)) {
return false;
}
Pattern p = Pattern.compile("^([a-zA-Z0-9]*[-_]?[a-zA-Z0-9]+)*@([a-zA-Z0-9]*[-_]?[a-zA-Z0-9]+)+[\\.][A-Za-z]{2,3}([\\.][A-Za-z]{2})?$");
Matcher m = p.matcher(email);
Matcher m = EMAIL_PATTERN.matcher(email);
return m.matches();
}
......
......@@ -97,7 +97,7 @@ public class InputFilterUtils {
}
public static InputFilter getLengthFilter(Context mContext, int maxLength) {
return InputFilterUtils.getMaxLengthFilter(mContext, "最多輸入" + maxLength + "個字", maxLength);
return InputFilterUtils.getMaxLengthFilter(mContext, "最多輸入" + maxLength + "英文/" + maxLength / 2 + "中文", maxLength);
}
public static InputFilter getNumberFilter(Context context) {
......@@ -216,18 +216,18 @@ public class InputFilterUtils {
* 這裡就先注釋
*/
private static int getCurLength(CharSequence s) {
// int length = 0;
// if (s == null) {
// return length;
// } else {
// for (int i = 0; i < s.length(); i++) {
// if (s.charAt(i) < 128) {
// length += 1;
// } else {
// length += 2;
// }
// }
// }
int length = 0;
if (s == null) {
return length;
} else {
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) < 128) {
length += 1;
} else {
length += 2;
}
}
}
return s.length();
}
......
<?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"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_not_have_goods"
android:gravity="center"
android:drawablePadding="@dimen/dp_20"
android:textColor="#999999"
android:textSize="@dimen/load_dialog_text_size"
android:text="@string/emptyView_click_new_add_category"
android:layout_marginBottom="@dimen/head_height"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?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"
android:id="@+id/layout_not_commodity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/tv_not_goods_tip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_not_have_goods"
android:drawablePadding="@dimen/dp_20"
android:gravity="center"
android:text="@string/emptyView_not_have_commodity"
android:textColor="@color/dk_color_99"
android:textSize="@dimen/load_dialog_text_size"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_11"
android:background="@drawable/shape_theme_five_corners_bg"
android:gravity="center"
android:paddingTop="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10"
android:text="@string/str_new_add_commodity"
android:textColor="@color/white"
android:textSize="@dimen/dp_16"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -539,7 +539,7 @@
<color name="dotted_color">#9FA0A2</color>
<color name="brick_red">#EC6941</color>
<color name="add_deputy_unit_bg">#F19149</color>
<color name="dk_color_999999">#999</color>
<color name="dk_color_99">#999</color>
<color name="bright_orange">#FF7A0E</color>
<color name="print_success_color">#019944</color>
</resources>
\ No newline at end of file
......@@ -51,5 +51,6 @@
<item name="split" type="id"/>
<item name="layout_replace" type="id"/>
<item name="iv_prj_history" type="id"/>
<item name="click_time" type="id" />
</resources>
\ No newline at end of file
......@@ -133,6 +133,9 @@
<string name="emptyView_mode_desc_retry">點擊重試</string>
<string name="emptyView_mode_desc_double">未獲取到數據</string>
<string name="emptyView_mode_desc_retry_query">點擊重試查詢</string>
<string name="emptyView_not_have_commodity">還沒有添加商品哦</string>
<string name="emptyView_click_new_add_category">沒有類別,點擊新增類別</string>
<string name="emptyView_mode_desc_pos_pay">支付狀態異常,請嘗試重試查詢</string>
<string name="emptyView_mode_desc_pos_refund">退款狀態異常,請嘗試重試查詢</string>
......@@ -214,6 +217,7 @@
<string name="left_parenthesis"></string>
<string name="right_parenthesis"></string>
<string name="str_parenthesis_format">(%1$s)</string>
<string name="delivery_type">配送類型:</string>
<string name="delivery_expenses">配送費範圍:</string>
......@@ -244,4 +248,29 @@
<string name="str_yes"></string>
<string name="str_no"></string>
<string name="str_place_an_order">落單:%1$s</string>
<string name="str_take_meal">取餐:%1$s</string>
<string name="str_service">送達:%1$s</string>
<string name="str_set_up_table">開台:%1$s</string>
<string name="str_take_meal_code">取餐碼:%1$s</string>
<string name="str_order_code">訂單碼:%1$s</string>
<string name="str_waiter">服務員:%1$s</string>
<string name="str_dine">堂食</string>
<string name="str_self_collection">自取</string>
<string name="str_cold_chain">凍鏈</string>
<string name="str_takeaway">外賣</string>
<string name="str_email_format_incorrect">郵箱格式不正確</string>
<string name="str_new_add_commodity">+新增商品</string>
<string name="str_new_add_category">新增類別</string>
<string name="str_please_input_category_name">請輸入類別名稱</string>
<string name="str_category_name">類別名稱</string>
<string name="str_please_choise_category">請選擇類別</string>
<string name="str_please_reselect_category">請重新選擇類別</string>
<string name="str_modify">修改</string>
<string name="str_please_modify_current_category_name">请修改當前類別名稱</string>
<string name="str_data_info">出錯啦,請重新進入後再試</string>
</resources>
......@@ -306,7 +306,7 @@
<!-- 廚房單台號體樣式-->
<style name="Print_kitchen_table_number_text_style">
<item name="android:textColor">@color/black</item>
<item name="android:textSize">@dimen/sp_38</item>
<item name="android:textSize">@dimen/dp_40</item>
</style>
<style name="report_food_ranking">
......
......@@ -46,6 +46,7 @@ public class AppDialog {
}
private void showWaringDialog(Context context, String title, String confimText, String cancelText, DialogOnClickListenter sureOnclickListener, DialogOnClickListenter cancelOnclickListener, boolean isDismiss) {
//DialogUtils內存洩漏,換Xpopup
new DialogUtils(context, R.layout.other_order_pause_orders) {
@Override
public void initLayout(ViewHepler hepler, Dialog dialog) {
......
......@@ -49,7 +49,7 @@ public abstract class DialogUtils implements LifecycleObserver {
private void init(Context context) {
dialog = new Dialog(context);
viewHepler = getViewHepler(context);
viewHepler = getViewHepler();
initLayout(viewHepler, dialog);
dialog.setContentView(viewHepler.getContentView());
......@@ -204,8 +204,8 @@ public abstract class DialogUtils implements LifecycleObserver {
public abstract void initLayout(ViewHepler hepler, Dialog dialog);
private ViewHepler getViewHepler(Context context) {
return new ViewHepler(context, view);
private ViewHepler getViewHepler() {
return new ViewHepler(view);
}
......@@ -223,7 +223,7 @@ public abstract class DialogUtils implements LifecycleObserver {
mConvertView = LayoutInflater.from(context).inflate(layoutId, null);
}
private ViewHepler(Context context, View view) {
private ViewHepler(View view) {
this.mViews = new SparseArray<>();
mConvertView = view;
}
......
......@@ -19,6 +19,7 @@
tools:text="" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:counterEnabled="true"
......
......@@ -45,7 +45,7 @@
<TextView
android:id="@+id/tv_food_time"
style="@style/Print_eighteen_text"
style="@style/Print_dot_matrix_normal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
......@@ -64,14 +64,14 @@
<TextView
android:id="@+id/tv_order_time_text"
style="@style/Print_eighteen_text"
style="@style/Print_dot_matrix_normal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="落單:" />
<TextView
android:id="@+id/tv_order_time"
style="@style/Print_eighteen_text"
style="@style/Print_dot_matrix_normal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="01-04 19:32" />
......@@ -88,14 +88,14 @@
<TextView
android:id="@+id/tv_opening_time_text"
style="@style/Print_eighteen_text"
style="@style/Print_dot_matrix_normal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="開檯:" />
<TextView
android:id="@+id/tv_opening_time"
style="@style/Print_eighteen_text"
style="@style/Print_dot_matrix_normal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="01-20 12:00" />
......@@ -113,7 +113,7 @@
<TextView
android:id="@+id/tv_people_text"
style="@style/Print_eighteen_text"
style="@style/Print_dot_matrix_normal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="人數:"
......@@ -121,7 +121,7 @@
<TextView
android:id="@+id/tv_people"
style="@style/Print_eighteen_text"
style="@style/Print_dot_matrix_normal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
......@@ -129,7 +129,7 @@
<TextView
android:id="@+id/tv_kitchen_location_text"
style="@style/Print_eighteen_text"
style="@style/Print_dot_matrix_normal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
......@@ -138,7 +138,7 @@
<TextView
android:id="@+id/tv_kitchen_location"
style="@style/Print_eighteen_text"
style="@style/Print_dot_matrix_normal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
......@@ -156,7 +156,7 @@
<TextView
android:id="@+id/tv_order_num_text"
style="@style/Print_eighteen_text"
style="@style/Print_dot_matrix_normal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="單號:" />
......@@ -186,7 +186,7 @@
android:layout_height="wrap_content"
android:text="取餐碼:"
android:textSize="@dimen/sp_18"
android:visibility="gone" />
android:visibility="visible" />
<TextView
android:id="@+id/tv_take_code"
......@@ -194,7 +194,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_18"
android:visibility="gone" />
android:visibility="visible" />
</LinearLayout>
<!--服務員-->
......@@ -208,14 +208,14 @@
<TextView
android:id="@+id/tv_waiter_text"
style="@style/Print_eighteen_text"
style="@style/Print_dot_matrix_normal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="服務員:" />
<TextView
android:id="@+id/tv_waiter"
style="@style/Print_eighteen_text"
style="@style/Print_dot_matrix_normal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="GSPOS" />
......
<?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:orientation="vertical">
<!--廚房單-->
<!-- 頭單-->
<TextView
android:id="@+id/tv_kitchen_print_first_order"
style="@style/Print_kitchen_table_number_text_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="頭單"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/layout_time_and_order_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_kitchen_print_first_order">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<!-- 台號-->
<TextView
android:id="@+id/tv_kitchen_print_table_number"
style="@style/Print_kitchen_table_number_text_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="外賣19"
android:textSize="@dimen/sp_42"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_kitchen_print_first_order" />
<TextView
android:id="@+id/tv_food_time"
style="@style/Print_twenty_two_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_kitchen_print_table_number"
tools:text="盡快送達" />
<!--落單時間-->
<TextView
android:id="@+id/tv_order_time"
style="@style/Print_twenty_two_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="落單:01-04 19:31" />
<!--開台時間-->
<TextView
android:id="@+id/tv_opening_time"
style="@style/Print_twenty_two_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="開台:01-20 12:00" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_people"
style="@style/Print_twenty_four_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
tools:text="人數:0" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:id="@+id/tv_kitchen_location"
style="@style/Print_twenty_four_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:visibility="visible"
tools:text="廚房:K1" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="@dimen/dp_1"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical">
<!--預留-->
<TextView
android:id="@+id/tv_order_reserved"
style="@style/Print_kitchen_table_number_text_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_kitchen_print_first_order"
tools:text="預存" />
<!--單號-->
<LinearLayout
android:id="@+id/ll_order"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_order_num_text"
style="@style/Print_twenty_two_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="單號:" />
<TextView
android:id="@+id/tv_order_num"
style="@style/Print_thirty_eight_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="AE00" />
</LinearLayout>
<!--自取取餐碼-->
<TextView
android:id="@+id/tv_take_code"
style="@style/Print_twenty_four_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
tools:text="取餐碼:12" />
<TextView
android:id="@+id/tv_waiter"
style="@style/Print_twenty_four_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="服務員:GSPOS" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/line_kitchen_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="————————————————————————————————————————————"
android:textSize="@dimen/sp_18"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/layout_time_and_order_number" />
<LinearLayout
android:id="@+id/ll_kitchen_food"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:orientation="vertical"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/line_kitchen_info" />
<TextView
android:id="@+id/tv_kitchen_food_end_line"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
android:maxLines="1"
android:text="————————————————————————————————————————————"
android:textSize="@dimen/sp_18"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ll_kitchen_food" />
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_kitchen_food_end_line">
<TextView
android:id="@+id/tv_prj_page_index"
style="@style/Print_kitchen_table_number_text_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textSize="@dimen/sp_28"
tools:text="1/2" />
<TextView
android:id="@+id/tv_kitchen_print_table_number_bottom"
style="@style/Print_kitchen_table_number_text_style"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="外賣19"
android:textSize="@dimen/sp_42"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_kitchen_print_quantity"
style="@style/Print_kitchen_table_number_text_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textSize="@dimen/sp_28"
tools:text="統計數量" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Print_eighteen_text">
<item name="android:textSize">@dimen/dp_18</item>
<style name="Print_default_text">
<item name="android:textSize">@dimen/dp_20</item>
<item name="android:textColor">@color/black</item>
<item name="android:includeFontPadding">false</item>
</style>
<style name="Print_twenty_four_text">
<style name="Print_eighteen_text" parent="@style/Print_default_text">
<item name="android:textSize">@dimen/dp_18</item>
</style>
<style name="Print_twenty_two_text" parent="@style/Print_default_text">
<item name="android:textSize">@dimen/dp_22</item>
</style>
<style name="Print_twenty_four_text" parent="@style/Print_default_text">
<item name="android:textSize">@dimen/dp_24</item>
<item name="android:textColor">@color/black</item>
<item name="android:includeFontPadding">false</item>
</style>
<style name="Print_twenty_six_text">
<style name="Print_twenty_six_text" parent="@style/Print_default_text">
<item name="android:textSize">@dimen/dp_26</item>
<item name="android:textColor">@color/black</item>
<item name="android:includeFontPadding">false</item>
</style>
<style name="Print_twenty_eight_text">
<style name="Print_twenty_eight_text" parent="@style/Print_default_text">
<item name="android:textSize">@dimen/dp_28</item>
<item name="android:textColor">@color/black</item>
<item name="android:includeFontPadding">false</item>
</style>
<style name="Print_thirty_two_text">
<style name="Print_thirty_two_text" parent="@style/Print_default_text">
<item name="android:textSize">@dimen/dp_32</item>
<item name="android:textColor">@color/black</item>
<item name="android:includeFontPadding">false</item>
</style>
<style name="Print_forty_two_text">
<style name="Print_thirty_eight_text" parent="@style/Print_default_text">
<item name="android:textSize">@dimen/dp_38</item>
</style>
<style name="Print_forty_two_text" parent="@style/Print_default_text">
<item name="android:textSize">@dimen/dp_42</item>
<item name="android:textColor">@color/black</item>
<item name="android:includeFontPadding">false</item>
</style>
<style name="Print_thermal_printing_normal" parent="@style/Print_twenty_four_text" />
<style name="Print_dot_matrix_normal" parent="@style/Print_twenty_six_text" />
</resources>
\ No newline at end of file
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