Commit 5d2696f1 by 宁斌

代碼整合

parents 493bcad8 fa3ae8bf
......@@ -262,7 +262,6 @@ public class ColdChainMainPresenter extends BasePresenter<ColdChainMainContract.
if (info.getData().getData() != null && info.getData().getData().size() > 0) {
List<OrderList.DataBeanX.DataBean> dataBeans = info.getData().getData();
dataBeans.remove(dataBeans.size() - 1);
ids = new ArrayList<>();
for (int i = 0; i < dataBeans.size(); i++) {
ids.add(dataBeans.get(i).getId());
......@@ -306,7 +305,7 @@ public class ColdChainMainPresenter extends BasePresenter<ColdChainMainContract.
if (info != null && info.getData() != null && info.getData().size() > 0) {
thirdDelivery(info.getData().get(0));
} else {
if (errorCount < 5) {
if (errorCount < maxErrorCount) {
startToBeConfirmedOrderList(ResturantInfoManager.newInstance().getRestaurantId());
errorCount++;
}
......@@ -316,11 +315,20 @@ public class ColdChainMainPresenter extends BasePresenter<ColdChainMainContract.
}
private int errorCount = 0;
private int maxErrorCount = 5;
/**
* 指派到第三方物流配送
* @param dataBean
*/
public void thirdDelivery(OrderDetails.DataBean dataBean) {
if (!isAutoReceiving) {
return;
}
//驗證訂單金額是否正確
if(OrderDetails.verificationAmount(dataBean)){
return;
}
ThirdItem third = new ThirdItem();
if (dataBean.getPRODUCT_NAME() != null) {
for (OrderDetails.DataBean.PRODUCTNAMEBean productnameBean : dataBean.getPRODUCT_NAME()) {
......@@ -374,6 +382,10 @@ public class ColdChainMainPresenter extends BasePresenter<ColdChainMainContract.
if (!isAutoReceiving) {
return;
}
//驗證訂單金額是否正確
if(OrderDetails.verificationAmount(dataBean)){
return;
}
//添加PRJ
addPrj(dataBean);
RequestBody requestBody = new FormBody.Builder()
......
......@@ -10,13 +10,13 @@ import com.gingersoft.coldchain_module.mvp.model.bean.ShipAnyOrdersNewBean;
import com.gingersoft.coldchain_module.mvp.model.bean.ThirdItem;
import com.gingersoft.coldchain_module.mvp.model.bean.UpdateOrderStatusBean;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.core.print.bean.OrderDetails;
import com.gingersoft.gsa.cloud.common.core.restaurant.ResturantInfoManager;
import com.gingersoft.gsa.cloud.common.core.user.UserContext;
import com.gingersoft.gsa.cloud.common.utils.FileUtils;
import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.common.utils.log.LogUtil;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.common.core.print.bean.OrderDetails;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.http.imageloader.ImageLoader;
import com.jess.arms.integration.AppManager;
......@@ -70,6 +70,10 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
this.mAppManager = null;
this.mImageLoader = null;
this.mApplication = null;
if (downloadDisposable != null) {
downloadDisposable.dispose();
downloadDisposable = null;
}
}
public void findOrderDetails(int orderId, int isRead) {
......@@ -142,6 +146,11 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
}
public void thirdDelivery(OrderDetails.DataBean dataBean) {
//驗證訂單金額是否正確
if(OrderDetails.verificationAmount(dataBean)){
mRootView.showMessage("訂單金額不正確,請檢查");
return;
}
ThirdItem third = new ThirdItem();
if (dataBean.getPRODUCT_NAME() != null) {
for (OrderDetails.DataBean.PRODUCTNAMEBean productnameBean : dataBean.getPRODUCT_NAME()) {
......@@ -199,6 +208,11 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
}
public void updateOrderState(OrderDetails.DataBean dataBean, int status, String labUrl) {
//驗證訂單金額是否正確
if(OrderDetails.verificationAmount(dataBean)){
mRootView.showMessage("訂單金額不正確,請檢查");
return;
}
//添加PRJ
addPrj(dataBean);
RequestBody requestBody = new FormBody.Builder()
......@@ -275,10 +289,12 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
}
}
Disposable downloadDisposable;
public void download(int orderId, String url) {
try {
updatePrintPdfStatus(orderId);
Disposable download_success = Observable.create((ObservableOnSubscribe<File>) emitter -> {
downloadDisposable = Observable.create((ObservableOnSubscribe<File>) emitter -> {
OkHttpClient client = new OkHttpClient.Builder().build();
Request request = new Request.Builder()
.url(url)
......@@ -308,6 +324,9 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
fos.write(buf, 0, len);
sum += len;
int progress = (int) (sum * 1.0f / total * 100);
if (downloadDisposable == null || downloadDisposable.isDisposed()) {
return;
}
mRootView.showLoading("下載打印文檔中" + progress + "%");
LogUtil.e(TAG, "download progress : " + progress);
}
......@@ -319,14 +338,16 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
LogUtil.e(TAG, "download failed : " + e.getMessage());
} finally {
try {
if (is != null)
if (is != null) {
is.close();
}
} catch (IOException e) {
e.printStackTrace();
}
try {
if (fos != null)
if (fos != null) {
fos.close();
}
} catch (IOException e) {
e.printStackTrace();
}
......@@ -443,7 +464,8 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
.build();
mModel.updatePrintPdfStatus(requestBody)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> { })
.doOnSubscribe(disposable -> {
})
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))
......
......@@ -7,15 +7,15 @@ import android.os.Bundle;
import android.print.PrintManager;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.gingersoft.coldchain_module.R;
import com.gingersoft.coldchain_module.R2;
import com.gingersoft.coldchain_module.di.component.DaggerOrderDetailsComponent;
......@@ -96,8 +96,12 @@ public class OrderDetailsActivity extends BaseActivity<OrderDetailsPresenter> im
TextView mTvLunchboxCost;
@BindView(R2.id.tv_delivery_fee)
TextView mTvDeliveryFee;
@BindView(R2.id.tv_discount)
TextView mTvDiscount;
// @BindView(R2.id.tv_discount)
// TextView mTvDiscount;
@BindView(R2.id.layout_discount)
LinearLayout layoutDiscount;
@BindView(R2.id.tv_total_amount2)
TextView mTvTotalAmount2;
@BindView(R2.id.tv_pay_amount)
......@@ -244,9 +248,19 @@ public class OrderDetailsActivity extends BaseActivity<OrderDetailsPresenter> im
mTvTotalAmount.setText(amountUnit + MoneyUtil.sub(MoneyUtil.sub(Double.parseDouble(bean.getTOTAL_AMOUNT()), bean.getLunchbox()), bean.getDELIVERY_CHARGE()));
mTvLunchboxCost.setText(amountUnit + bean.getLunchbox());
mTvDeliveryFee.setText(amountUnit + bean.getDELIVERY_CHARGE());
mTvDiscount.setText(amountUnit + bean.getDiscount_amount());
mTvTotalAmount2.setText(amountUnit + MoneyUtil.sub(Double.parseDouble(bean.getTOTAL_AMOUNT()), bean.getDiscount_amount()));
mTvPayAmount.setText(amountUnit + MoneyUtil.sub(Double.parseDouble(bean.getTOTAL_AMOUNT()), bean.getDiscount_amount()));
double totalAmount = Double.parseDouble(bean.getTOTAL_AMOUNT());
if (bean.getCouponList() != null) {
for (OrderDetails.DataBean.CouponBean couponBean : bean.getCouponList()) {
View view = View.inflate(mContext, R.layout.item_discount, null);
((TextView) view.findViewById(R.id.tv_discount_text)).setText(couponBean.getCouponName() + ":");
((TextView) view.findViewById(R.id.tv_discount_amount)).setText("$" + couponBean.getDiscount_amount());
layoutDiscount.addView(view);
totalAmount = MoneyUtil.sub(totalAmount, couponBean.getDiscount_amount());
}
}
mTvTotalAmount2.setText(amountUnit + totalAmount);
mTvPayAmount.setText(amountUnit + totalAmount);
if (bean.getOrderPayType() == 2 && bean.getPayMultiple() != null) {
StringBuilder sb = new StringBuilder();
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="@dimen/dp_10">
<TextView
android:id="@+id/tv_discount_text"
style="@style/otherOrder_bill_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="折扣名:" />
<TextView
android:id="@+id/tv_discount_amount"
style="@style/otherOrder_bill_info_textStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
tools:text="折扣金額" />
</LinearLayout>
\ No newline at end of file
package com.gingersoft.gsa.delivery_pick_mode;
package delivery_pick_module;
import com.billy.cc.core.component.CC;
import com.jess.arms.base.BaseApplication;
......
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean;
import com.gingersoft.gsa.cloud.common.core.pay.bean.PayMethod;
import java.util.List;
......
package com.gingersoft.gsa.delivery_pick_mode.data.network
import com.gingersoft.gsa.cloud.common.config.globalconfig.applyOptions.intercept.HeadersInterceptor
import com.gingersoft.gsa.cloud.common.config.globalconfig.applyOptions.intercept.LoggingInterceptor
import com.gingersoft.gsa.cloud.common.constans.HttpsConstans
import com.gingersoft.gsa.cloud.common.constans.HttpsConstans.ROOT_SERVER
import com.gingersoft.gsa.cloud.common.constans.HttpsConstans.URK_RICEPON_GSA
......@@ -20,6 +21,7 @@ object ServiceCreator {
.writeTimeout(30, TimeUnit.SECONDS)
.addInterceptor(RequestInterceptor())
.addInterceptor(HeadersInterceptor())
.addInterceptor(LoggingInterceptor())
private lateinit var builder: Retrofit.Builder
private lateinit var builder2: Retrofit.Builder
......
......@@ -32,9 +32,9 @@ public interface AddressListComponent {
@Component.Builder
interface Builder {
@BindsInstance
AddressListComponent.Builder view(AddressListContract.View view);
Builder view(AddressListContract.View view);
AddressListComponent.Builder appComponent(AppComponent appComponent);
Builder appComponent(AppComponent appComponent);
AddressListComponent build();
}
......
......@@ -32,9 +32,9 @@ public interface PrjQueryComponent {
@Component.Builder
interface Builder {
@BindsInstance
PrjQueryComponent.Builder view(PrjQueryContract.View view);
Builder view(PrjQueryContract.View view);
PrjQueryComponent.Builder appComponent(AppComponent appComponent);
Builder appComponent(AppComponent appComponent);
PrjQueryComponent build();
}
......
......@@ -30,9 +30,9 @@ public interface SendOrderComponent {
@Component.Builder
interface Builder {
@BindsInstance
SendOrderComponent.Builder view(SendOrderContract.View view);
Builder view(SendOrderContract.View view);
SendOrderComponent.Builder appComponent(AppComponent appComponent);
Builder appComponent(AppComponent appComponent);
SendOrderComponent build();
}
......
......@@ -12,23 +12,24 @@ import androidx.lifecycle.viewModelScope
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.billy.cc.core.component.CC
import com.gingersoft.gsa.cloud.common.core.restaurant.ResturantInfoManager
import com.gingersoft.gsa.cloud.common.core.user.UserContext
import com.gingersoft.gsa.cloud.app.GsaCloudApplication
import com.gingersoft.gsa.cloud.common.core.pay.bean.PayMethod
import com.gingersoft.gsa.cloud.common.constans.AppConstans
import com.gingersoft.gsa.cloud.common.constans.FoodSummaryConstans
import com.gingersoft.gsa.cloud.common.constans.PrintConstans
import com.gingersoft.gsa.cloud.common.core.order.order.TakeawayOrder
import com.gingersoft.gsa.cloud.common.core.pay.bean.PayMethod
import com.gingersoft.gsa.cloud.common.core.print.bean.OrderDetails
import com.gingersoft.gsa.cloud.common.core.print.bean.OrderDetails.Companion.verificationAmount
import com.gingersoft.gsa.cloud.common.core.print.bean.adapter.PrintContentAdapter
import com.gingersoft.gsa.cloud.common.core.restaurant.ResturantInfoManager
import com.gingersoft.gsa.cloud.common.core.user.UserContext
import com.gingersoft.gsa.cloud.common.service.GetInfoUpdateService
import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils
import com.gingersoft.gsa.cloud.common.utils.okhttpUtils.OkHttp3Utils
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil
import com.gingersoft.gsa.cloud.common.utils.time.TimeUtils
import com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils
import com.gingersoft.gsa.cloud.component.ComponentName
import com.gingersoft.gsa.cloud.common.constans.AppConstans
import com.gingersoft.gsa.cloud.common.constans.FoodSummaryConstans
import com.gingersoft.gsa.cloud.common.constans.PrintConstans
import com.gingersoft.gsa.cloud.common.core.print.bean.OrderDetails
import com.gingersoft.gsa.cloud.common.core.print.bean.adapter.PrintContentAdapter
import com.gingersoft.gsa.cloud.common.service.GetInfoUpdateService
import com.gingersoft.gsa.cloud.ui.utils.DialogUtils
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.data.WeatherRepository
......@@ -55,6 +56,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
val ProductionComplete = 1007//製作完成
val DeliveryPrint = 1008//訂單確認成功,是否成功打印回調
val Transportation = 1009//修改運輸工具成功
val AmountError = 1010//訂單金額有錯
}
val restaurantId by lazy { ResturantInfoManager.newInstance().getRestaurantId() }
......@@ -192,9 +194,11 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
//確認訂單之前得先獲取訂單詳情
val orderInfo = repository.getOrderInfo(dataList[0].Id.toString())
if (orderInfo.data != null && orderInfo.data!!.isNotEmpty()) {
orderInfo.data!![0].order_type = dataList[0].order_type
orderInfo.data!![0].orderPayType = dataList[0].orderPayType
val orderDetail = orderInfo.data!![0]
orderInfo.data?.let { it ->
val orderDetail = it[0]
if (verificationAmount(orderDetail)) return@launch
orderDetail.order_type = dataList[0].order_type
orderDetail.orderPayType = dataList[0].orderPayType
if (orderDetail.order_type == 7) {
//如果是自取單,將物流類型改為本店
orderDetail.companyType = 0
......@@ -216,6 +220,9 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
//確認之後,刷新列表
refreshState.postValue(0)
}
}
}
} else {
......@@ -239,6 +246,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
val orderInfo = repository.getOrderInfo(dataList[0].Id.toString())
if (orderInfo.data != null && orderInfo.data!!.isNotEmpty()) {
val orderDetail = orderInfo.data!![0]
if (verificationAmount(orderDetail)) return@launch
updateOrderAndPrint(restaurantId, orderDetail, 8, false) {
refreshState.postValue(0)
}
......@@ -397,6 +405,10 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
}
fun confirmOrder(dataBean: OrderDetails.DataBean, status: Int, trafficType: String = "", restaurantId: Int, isPrintPrj: Boolean = true, isPrintBill: Boolean = true, listener: (MessageBean) -> Unit) {
if (verificationAmount(dataBean)) {
listener.invoke(getMsgBean(0, "訂單金額不正確,請取消", false))
return
}
launch({
when (dataBean.companyType) {
0 -> {
......@@ -490,6 +502,11 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
fun gsUpdateOrderStatus(orderDetails: OrderDetails.DataBean, orderPayInfoVO: List<OrderDetails.DataBean.PayMultiple>?, listener: (Int, Boolean) -> Unit) {
//驗證訂單金額是否正確
if (verificationAmount(orderDetails)) {
listener.invoke(AmountError, false)
return
}
launch({
repository.gsUpdateOrderStatus(orderDetails.ID, 4, orderDetails.order_type, 3, orderFrom = 0).apply {
orderDetails.payMultiple = orderPayInfoVO
......@@ -517,9 +534,14 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
* 修改訂單狀態並打印,狀態為0,1,2才打印
*/
fun updateOrderAndPrint(restaurantId: Int, dataBean: OrderDetails.DataBean, status: Int, isPrintPrj: Boolean = true, isPrintBill: Boolean = true, listener: (MessageBean) -> Unit) {
if (verificationAmount(dataBean)) {
listener.invoke(getMsgBean(0, "訂單金額不正確,請取消", false))
return
}
launch({
repository.gsUpdateOrderStatus(dataBean.ID, status, dataBean.order_type, 1, "", "", "", "0", "", 1, 0).apply {
if (status == 0 || status == 1 || status == 2 || status == 8) {
if (this.code == "1") {
//確認送單
//添加數據到prj
if (isPrintPrj) {
......@@ -556,7 +578,6 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
GetInfoUpdateService.loginfo.append("\n")
})
}
if (this.code == "1") {
if (isPrintBill) {
// 打印印單
// 初始化用於打印的view
......@@ -782,6 +803,11 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
confirmBtn.setOnClickListener {
if (selectIndex != -1) {
//驗證訂單金額是否正確
if (verificationAmount(dataBean)) {
ToastUtils.show(context, "訂單金額不正確,請檢查")
return@setOnClickListener
}
launch({
repository.gsUpdateOrderStatus(dataBean.ID, status, dataBean.order_type, 1, "", deliveryBean!!.data[deliveryAdapter.selectIndex].userName, deliveryBean!!.data[deliveryAdapter.selectIndex].mobile, "0", "", 1, 0).apply {
if (code == "1") {
......
......@@ -8,12 +8,14 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RadioGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.gingersoft.gsa.cloud.common.core.order.billItem.BillItem;
import com.gingersoft.gsa.cloud.common.core.order.cart.ShoppingCart;
import com.gingersoft.gsa.cloud.common.core.order.commodity.OrderDetail;
......@@ -148,8 +150,6 @@ public class SendOrderActivity extends BaseActivity<SendOrderPresenter> implemen
@Override
public void initData(@Nullable Bundle savedInstanceState) {
sendTime = deliveryTimes.get(0);
List<OrderDetails.DataBean.PRODUCTNAMEBean> productnameBeans = mPresenter.productnameBeans;
for (int i = 0; i < orderDetails.size(); i++) {
......
......@@ -4,10 +4,10 @@ import android.os.Bundle
import android.view.View
import androidx.lifecycle.ViewModelProvider
import com.billy.cc.core.component.CCUtil
import com.gingersoft.gsa.cloud.ui.utils.TimePickerUtils
import com.gingersoft.gsa.cloud.common.utils.time.TimeUtils
import com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils
import com.gingersoft.gsa.cloud.common.constans.DeliveryPickConstans
import com.gingersoft.gsa.cloud.ui.utils.TimePickerUtils
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.HistoryOrderViewModel
import com.gingersoft.gsa.delivery_pick_mode.ui.base.BaseActivity
......
......@@ -17,14 +17,15 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.ethanhua.skeleton.Skeleton
import com.ethanhua.skeleton.ViewSkeletonScreen
import com.gingersoft.gsa.cloud.common.constans.FunctionManagerConstants
import com.gingersoft.gsa.cloud.common.core.print.bean.OrderDetails
import com.gingersoft.gsa.cloud.common.core.restaurant.ResturantInfoManager
import com.gingersoft.gsa.cloud.common.core.user.UserContext
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil
import com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils
import com.gingersoft.gsa.cloud.common.constans.FunctionManagerConstants
import com.gingersoft.gsa.cloud.common.function.FunctionManager
import com.gingersoft.gsa.cloud.common.core.print.bean.OrderDetails
import com.gingersoft.gsa.cloud.common.ui.utils.BtnBuilder
import com.gingersoft.gsa.cloud.common.utils.MoneyUtil
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil
import com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils
import com.gingersoft.gsa.cloud.ui.utils.AppDialog
import com.gingersoft.gsa.cloud.ui.utils.DialogUtils
import com.gingersoft.gsa.cloud.ui.view.AddKeyBoard
......@@ -34,6 +35,7 @@ import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.ServiceChargeRecord
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.TransportationBean
import com.gingersoft.gsa.delivery_pick_mode.databinding.ActivityOrderDetailsBinding
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.PageViewModel
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.PageViewModel.Companion.AmountError
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.PageViewModel.Companion.DeliveryPrint
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.PageViewModel.Companion.OrderDelivery
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.PageViewModel.Companion.PrintCode
......@@ -51,7 +53,6 @@ import com.gingersoft.gsa.delivery_pick_mode.util.showWaringDialog
import com.jess.arms.mvp.IPresenter
import com.qmuiteam.qmui.widget.QMUITopBar
import kotlinx.android.synthetic.main.activity_order_details.*
import java.lang.StringBuilder
import java.util.*
class OrderDetailsActivity : BaseActivity<IPresenter>() {
......@@ -114,10 +115,9 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
}
private fun initTopBar(topbar: QMUITopBar) {
topbar.setTitle(ResturantInfoManager.newInstance().getRestaurantName())
topbar.setTitle(ResturantInfoManager.newInstance().restaurantName)
topbar.addLeftImageButton(R.drawable.icon_return, R.id.iv_left_back).setOnClickListener { finish() }
topbar.setBackgroundColor(ContextCompat.getColor(this, R.color.theme_color))
}
private fun PageViewModel.getOrderDetails(orderId: String, binding: ActivityOrderDetailsBinding) {
......@@ -134,16 +134,32 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
}
orderDetails.order_type = orderType
orderDetails.orderPayType = orderPayType
//總金額
var totalAmount = orderDetails.TOTAL_AMOUNT!!.toDouble()
//合計:總金額減去餐盒費,配送費
val total = MoneyUtil.sub(MoneyUtil.sub(totalAmount, orderDetails.Lunchbox), orderDetails.DELIVERY_CHARGE)
//總金額減去折扣
orderDetails.couponList?.let {
for (coupon in it) {
val view = View.inflate(mContext, R.layout.item_discount, null)
view.findViewById<TextView>(R.id.tv_discount_text).text = coupon.couponName + ":"
view.findViewById<TextView>(R.id.tv_discount_amount).text = "$" + coupon.discount_amount
layout_takeaway_discount.addView(view)
totalAmount = MoneyUtil.sub(totalAmount, coupon.discount_amount)
}
}
binding.total = total
binding.totalAmount = totalAmount
binding.data = orderDetails
binding.totalAmount = orderDetails.TOTAL_AMOUNT!!.toDouble()
binding.isSelf = orderDetails.order_type == 7
val btnList = ArrayList<BtnBuilder.BtnBean>()
val orderStatusText: String
val type = if (orderDetails.order_type == 7) "自取" else "外送"
when (orderDetails.orderStatus) {
2 -> {//製作中
//製作中訂單狀態為2,但是列表中的狀態為0的話,可能是調用了指派物流,沒修改訂單狀態
if (state == 0) {
//防止調用了第三方物流接口,沒調用到確認訂單接口
btnBuilder.getSureBtn()?.let {
......@@ -284,10 +300,10 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
} else {
GridLayoutManager(this@OrderDetailsActivity, spanCount)
}
//recyclerview按鈕數量佈局
gridLayoutManager.spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() {
override fun getSpanSize(position: Int): Int {
//5個按鈕,第五個的position=4. 4
//5個按鈕,第五個的position=4
return if (position < spanCount) {
1
} else {
......@@ -343,6 +359,10 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
}
}
} else {
if (OrderDetails.verificationAmount(orderDetails)) {
ToastUtils.show(this@OrderDetailsActivity, "訂單金額不正確,請檢查")
return@setOnItemClickListener
}
val intent = Intent(this@OrderDetailsActivity, PayActivity::class.java)
intent.putExtra("orderDetails", orderDetails)
startActivityForResult(intent, 1001)
......@@ -419,14 +439,6 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
}
}
})
// getAdditionalByOrderId(orderId) {
// if (it != null && it.data.isNotEmpty()) {
// thirdExpensesLayout.visibility = View.VISIBLE
// it.data.add(0, ServiceChargeRecordBean.DataX(0, 0, 0, 0, 0, 0, 0.0, 0, 0, 0, 0, 0, "", ""))
// rvThirdExpenses.adapter = ThirdExpensesAdapter(it.data)
// rvThirdExpenses.layoutManager = LinearLayoutManager(this@OrderDetailsActivity)
// }
// }
serviceChargeRecordBeans.observe(this@OrderDetailsActivity, Observer {
if (it != null && it.data.isNotEmpty()) {
for (value in it.data) {
......@@ -587,7 +599,13 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
}
finish()
}
AmountError.toString() -> {
ToastUtils.show(this@OrderDetailsActivity, "訂單金額錯誤,請檢查")
}
else -> {
if (TextUtil.isNotEmptyOrNullOrUndefined(msg.errorMsg)) {
ToastUtils.show(this@OrderDetailsActivity, msg.errorMsg)
}
cancelDialogForLoading()
}
}
......
......@@ -7,11 +7,12 @@ import androidx.core.content.ContextCompat
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import com.gingersoft.gsa.cloud.common.core.restaurant.ResturantInfoManager
import com.gingersoft.gsa.cloud.common.core.pay.bean.PayMethod
import com.gingersoft.gsa.cloud.common.core.print.bean.OrderDetails
import com.gingersoft.gsa.cloud.common.core.print.bean.OrderDetails.DataBean
import com.gingersoft.gsa.cloud.common.core.restaurant.ResturantInfoManager
import com.gingersoft.gsa.cloud.common.utils.MoneyUtil
import com.gingersoft.gsa.cloud.common.utils.toast.ToastUtils
import com.gingersoft.gsa.cloud.common.core.print.bean.OrderDetails.DataBean
import com.gingersoft.gsa.cloud.ui.utils.DialogUtils
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.BillBean
......@@ -57,7 +58,13 @@ class PayActivity : BaseActivity<IPresenter>() {
foodCount += bean.num!!.toInt()
}
}
other_pay_view.loadInfo(this, ArrayList<PayMethod>(), MoneyUtil.sub(orderDetails.TOTAL_AMOUNT!!.toDouble(), orderDetails.discount_amount), foodCount)
var totalAmount = orderDetails.TOTAL_AMOUNT!!.toDouble()
orderDetails.couponList?.let {
for (coupon in it){
totalAmount = MoneyUtil.sub(totalAmount, coupon.discount_amount)
}
}
other_pay_view.loadInfo(this, ArrayList<PayMethod>(), totalAmount, foodCount)
pageViewModel.getPayMethod(ResturantInfoManager.newInstance().getBrandId(), ResturantInfoManager.newInstance().getRestaurantId())
pageViewModel.payTypeBean.observe(this, Observer {
......@@ -78,6 +85,10 @@ class PayActivity : BaseActivity<IPresenter>() {
hepler.getView<TextView>(R.id.tv_dialog_confirm).setOnClickListener {
dialog.dismiss()
showLoading()
if (OrderDetails.verificationAmount(orderDetails)) {
ToastUtils.show(this@PayActivity, "訂單金額不正確,請檢查")
return@setOnClickListener
}
pageViewModel.closingBill(orderDetails, payMethods) { _, _ ->
cancelDialogForLoading()
setResult(RESULT_OK)
......@@ -106,10 +117,12 @@ class PayActivity : BaseActivity<IPresenter>() {
if (orderDetails.DELIVERY_CHARGE > 0) {
billBeans.add(BillBean("送貨費:", orderDetails.DELIVERY_CHARGE))
}
if (orderDetails.discount_amount > 0) {
billBeans.add(BillBean("折扣:", orderDetails.discount_amount, 1))
orderDetails.couponList?.let {
for (coupon in it){
billBeans.add(BillBean(coupon.couponName+":", coupon.discount_amount, 1))
}
}
billBeans.add(BillBean("支付金額:", MoneyUtil.sub(orderDetails.TOTAL_AMOUNT!!.toDouble(), orderDetails.discount_amount)))
billBeans.add(BillBean("支付金額:", totalAmount))
rv_order_pay_bill.layoutManager = LinearLayoutManager(this)
rv_order_pay_bill.adapter = PayBillAdapter(R.layout.item_pay_bill, billBeans)
}
......
......@@ -13,9 +13,9 @@ import androidx.core.content.ContextCompat
import androidx.databinding.DataBindingUtil
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.gingersoft.gsa.cloud.common.core.print.bean.OrderDetails
import com.gingersoft.gsa.cloud.common.utils.MoneyUtil
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil
import com.gingersoft.gsa.cloud.common.core.print.bean.OrderDetails
import com.gingersoft.gsa.cloud.ui.utils.DialogUtils
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.BillBean
......@@ -34,8 +34,12 @@ object OtherOrderUtils {
val tvStatus = hepler.getView<TextView>(R.id.tv_order_state)
val orderData = data.data!![0]
val layoutOrderInfoDialogBinding: LayoutOrderInfoDialogNewBinding = DataBindingUtil.bind(hepler.contentView)!!
val totalAmount = orderData.TOTAL_AMOUNT!!.toDouble()
var totalAmount = orderData.TOTAL_AMOUNT!!.toDouble()
orderData.couponList?.let {
for(coupon in it){
totalAmount = MoneyUtil.sub(totalAmount, coupon.discount_amount)
}
}
layoutOrderInfoDialogBinding.data = orderData
layoutOrderInfoDialogBinding.isSelf = orderType == 7
layoutOrderInfoDialogBinding.totalAmount = totalAmount
......@@ -131,7 +135,7 @@ object OtherOrderUtils {
}
}
}
billBeans.add(BillBean("支付金額:", MoneyUtil.sub(totalAmount, orderData.discount_amount), 1))
billBeans.add(BillBean("支付金額:", totalAmount, 1))
orderData.payMultiple?.let {
for (payMultiple in it) {
......
......@@ -15,6 +15,9 @@
type="Double" />
<variable
name="total"
type="Double" />
<variable
name="data"
type="com.gingersoft.gsa.cloud.common.core.print.bean.OrderDetails.DataBean" />
......@@ -475,7 +478,7 @@
android:layout_alignParentRight="true"
android:layout_toRightOf="@id/tv_total_text"
android:gravity="right"
android:text="@{@string/amount_unit + MoneyUtil.sub(MoneyUtil.sub(totalAmount, data.lunchbox),data.dELIVERY_CHARGE)}" />
android:text="@{@string/amount_unit + total}" />
</RelativeLayout>
<RelativeLayout
......@@ -531,32 +534,13 @@
android:text="@{@string/amount_unit + data.dELIVERY_CHARGE}" />
</RelativeLayout>
<RelativeLayout
<LinearLayout
android:id="@+id/layout_takeaway_discount"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:paddingLeft="@dimen/other_order_info_dialog_content_marginLeft"
android:paddingRight="@dimen/other_order_info_dialog_content_marginLeft"
android:visibility="@{data.discount_amount==0?View.GONE:View.VISIBLE}">
<TextView
android:id="@+id/tv_discount_text"
style="@style/otherOrder_bill_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="折扣:" />
<TextView
android:id="@+id/tv_discount"
style="@style/otherOrder_bill_info_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_toRightOf="@id/tv_discount_text"
android:gravity="right"
android:text="@{@string/minus_amount_unit + data.discount_amount}" />
</RelativeLayout>
android:paddingRight="@dimen/other_order_info_dialog_content_marginLeft"/>
<RelativeLayout
android:layout_width="match_parent"
......@@ -580,7 +564,7 @@
android:layout_alignParentRight="true"
android:layout_toRightOf="@id/tv_total_amount_text2"
android:gravity="right"
android:text="@{@string/amount_unit + MoneyUtil.sub(totalAmount, data.discount_amount)}" />
android:text="@{@string/amount_unit + totalAmount}" />
</RelativeLayout>
<RelativeLayout
......@@ -605,7 +589,7 @@
android:layout_alignParentRight="true"
android:layout_toRightOf="@id/tv_pay_amount_text"
android:gravity="right"
android:text="@{@string/amount_unit + MoneyUtil.sub(totalAmount, data.discount_amount)}"
android:text="@{@string/amount_unit + data.PAY_AMOUNT}"
android:textColor="#FF0000" />
</RelativeLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="@dimen/dp_10">
<TextView
android:id="@+id/tv_discount_text"
style="@style/otherOrder_bill_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="折扣名:" />
<TextView
android:id="@+id/tv_discount_amount"
style="@style/otherOrder_bill_info_textStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
tools:text="折扣金額" />
</LinearLayout>
\ No newline at end of file
......@@ -60,7 +60,7 @@
</LinearLayout>
<com.gingersoft.gsa.cloud.ui.view.AddKeyBoard
<com.gingersoft.gsa.cloud.common.ui.view.AddKeyBoard
android:id="@+id/keyboard_addservice_charge"
android:layout_width="match_parent"
android:layout_height="match_parent"
......
......@@ -8,15 +8,16 @@
android:id="@+id/tv_new_order"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_20"
android:layout_gravity="center_horizontal"
android:paddingTop="@dimen/dp_10"
android:paddingRight="@dimen/dp_20"
android:paddingBottom="@dimen/dp_10"
android:text="新訂單"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_14" />
android:textSize="@dimen/dp_14"
android:visibility="gone" />
<include layout="@layout/include_horizontal_color_ccc_dividing_line" />
......
......@@ -115,7 +115,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
android:text="@{@string/amount_unit + MoneyUtil.sub(total_amount, data.discount_amount)}"
android:text="@{@string/amount_unit + total_amount}"
android:textColor="#BE1C42"
android:textSize="@dimen/dp_24"
app:layout_constraintLeft_toLeftOf="parent"
......
......@@ -22,6 +22,7 @@
android:networkSecurityConfig="@xml/network_android"
android:resizeableActivity="true"
android:roundIcon="@mipmap/ic_launcher"
android:requestLegacyExternalStorage="true"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="android:label">
......@@ -70,6 +71,17 @@
<meta-data
android:name="notch.config"
android:value="portrait|landscape" />
<!--适配android 7.0文件访问 -->
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.gingersoft.gsa.cloud.login"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
</application>
</manifest>
......@@ -153,46 +153,24 @@
<CheckBox
android:id="@+id/rb_auto_login"
android:layout_width="@dimen/dp_25"
android:layout_height="@dimen/dp_25"
android:background="@drawable/selector_checkbox"
android:button="@null" />
<TextView
android:id="@+id/tv_auto_login_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_11"
android:button="@drawable/selector_checkbox"
android:gravity="center_vertical"
android:text="自動登陸"
android:textColor="@color/color_86"
android:textSize="@dimen/sp_14"
app:layout_constraintBottom_toBottomOf="@id/rb_auto_login"
app:layout_constraintLeft_toRightOf="@id/rb_auto_login"
app:layout_constraintTop_toTopOf="@id/rb_auto_login" />
android:textSize="@dimen/sp_14" />
<CheckBox
android:id="@+id/rb_remember_password"
android:layout_width="@dimen/dp_25"
android:layout_height="@dimen/dp_25"
android:layout_marginLeft="@dimen/dp_15"
android:background="@drawable/selector_checkbox"
android:button="@null"
app:layout_constraintLeft_toRightOf="@id/tv_auto_login_text"
app:layout_constraintTop_toTopOf="@id/rb_auto_login" />
<TextView
android:id="@+id/tv_remember_pwd_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_11"
android:layout_marginLeft="@dimen/dp_15"
android:button="@drawable/selector_checkbox"
android:gravity="center_vertical"
android:text="記住密碼"
android:textColor="@color/color_86"
android:textSize="@dimen/sp_14"
app:layout_constraintBottom_toBottomOf="@id/rb_remember_password"
app:layout_constraintLeft_toRightOf="@id/rb_remember_password"
app:layout_constraintTop_toTopOf="@id/rb_remember_password" />
android:textSize="@dimen/sp_14" />
<TextView
android:id="@+id/tv_forget_pwd"
......
......@@ -9,7 +9,6 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.gingersoft.gsa.cloud.common.utils.glide.GlideUtils;
import com.gingersoft.gsa.cloud.database.bean.Function;
import com.gingersoft.gsa.cloud.main.R;
......@@ -65,7 +64,7 @@ public class FunctionAdapter extends BaseAdapter {
viewholder = (ViewHolder) convertView.getTag();
}
GlideUtils.display(mContext, viewholder.iv_image, dataBean.getImageURL(), R.drawable.ic_selected_main, R.drawable.ic_selected_main, R.drawable.ic_selected_main);
com.gingersoft.gsa.cloud.base.utils.glide.GlideUtils.display(mContext, viewholder.iv_image, dataBean.getImageURL(), R.drawable.ic_selected_main, R.drawable.ic_selected_main, R.drawable.ic_selected_main);
viewholder.tv_title.setText(dataBean.getResName());
viewholder.ll_container.setOnClickListener(new View.OnClickListener() {
......
......@@ -65,12 +65,6 @@ public class FoodMenuMangerRightAdapter extends BaseDelegateMultiAdapter<Food, B
@Override
public int getSectionForPosition(int position) {
// int i1 = foodGroups.indexOf(foods.get(position));
// for (int i = 0; i < foodGroups.size(); i++) {
// if (foods.get(position).getId().equals(foodGroups.get(i).getId())) {
// return i;
// }
// }
return foodGroups.indexOf(foods.get(position));
}
......
......@@ -25,6 +25,6 @@ public class PicUploadPicProvider extends FoodMenuItemProvider {
@Override
public int getLayoutId() {
return R.layout.item_upload_pic;
return R.layout.item_multi_upload_pic;
}
}
......@@ -11,7 +11,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableLeft="@drawable/selector_radio_bg"
android:drawableLeft="@drawable/selector_radio_hook_bg"
android:button="@null"
android:background="@null"
android:drawablePadding="@dimen/dp_6"
......
......@@ -18,7 +18,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:button="@drawable/selector_radio_bg"
android:button="@drawable/selector_radio_hook_bg"
android:background="@null"
android:drawablePadding="@dimen/dp_6"/>
......
......@@ -448,16 +448,18 @@ public class PrintInfoBean {
if (data.getDELIVERY_CHARGE() != 0) {
printInfoBeans.add(new PrintInfoBean(new String[]{getLeftRightText("送貨費啊啥的和發哈是打飛機:", "$" + data.getDELIVERY_CHARGE(), paperWidth)}, new Boolean[]{false}, new Double[]{1d}));
}
double totalAmount = Double.parseDouble(data.getTOTAL_AMOUNT());
if (data.getCouponList() != null && data.getCouponList().size() > 0) {
for (OrderDetails.DataBean.CouponBean coupon : data.getCouponList()) {
printInfoBeans.add(new PrintInfoBean(new String[]{getLeftRightText(coupon.getCouponName() + ":", "-$" + coupon.getDiscount_amount(), paperWidth)}, new Boolean[]{false}, new Double[]{1d}));
totalAmount = MoneyUtil.sub(totalAmount, coupon.getDiscount_amount());
}
}
printInfoBeans.add(new PrintInfoBean(new String[]{getLeftRightText("總金額啊啥的和發哈是打飛機:", "$" + data.getTOTAL_AMOUNT(), paperWidth / 2)}, new Boolean[]{true}, new Double[]{2d}));
printInfoBeans.add(new PrintInfoBean(new String[]{getLineBorder("", 1, paperWidth)}, new Double[]{1d}));
printInfoBeans.add(new PrintInfoBean(new String[]{"支付金額:", "$" + MoneyUtil.sub(Double.parseDouble(data.getTOTAL_AMOUNT()), data.getDiscount_amount())}, new Boolean[]{true}, new Double[]{2d}, 0));
printInfoBeans.add(new PrintInfoBean(new String[]{"支付金額:", "$" + totalAmount}, new Boolean[]{true}, new Double[]{2d}, 0));
printInfoBeans.add(new PrintInfoBean(new String[]{getLineBorder("", 1, paperWidth)}, new Double[]{1d}));
......
......@@ -96,9 +96,11 @@ public class PrintOtherOrder extends PrinterRoot<PrintTakeawayFormContent> {
if (data.getDELIVERY_CHARGE() != 0) {
billData.add(getBillBean("送貨費:", MONETARY_UNIT + data.getDELIVERY_CHARGE()));
}
double totalAmount = Double.parseDouble(data.getTOTAL_AMOUNT());
if (data.getCouponList() != null && data.getCouponList().size() > 0) {
for (OrderDetails.DataBean.CouponBean coupon : data.getCouponList()) {
billData.add(getBillBean(coupon.getCouponName() + ":", "-" + MONETARY_UNIT + coupon.getDiscount_amount()));
totalAmount = MoneyUtil.sub(totalAmount, coupon.getDiscount_amount());
}
}
layout.addView(getTakeawayBillInfoView(mContext, billData));
......@@ -107,7 +109,7 @@ public class PrintOtherOrder extends PrinterRoot<PrintTakeawayFormContent> {
layout.addView(getTakeawayLargeAmount(mContext, "總金額:", MONETARY_UNIT + data.getTOTAL_AMOUNT()));
layout.addView(getLine(mContext));
//支付信息
addTakeawayPayViews(mContext, layout, data.getPayMultiple(), MoneyUtil.sub(Double.parseDouble(data.getTOTAL_AMOUNT()), data.getDiscount_amount()));
addTakeawayPayViews(mContext, layout, data.getPayMultiple(), totalAmount);
//用戶信息
getTakeawayReceiver(mContext, data, layout);
//尾部
......
......@@ -227,9 +227,11 @@ public class PrintOtherOrderClosing extends PrinterRoot<PrintTakeawayCheckoutCon
if (data.getDELIVERY_CHARGE() != 0) {
billData.add(getBillBean("送貨費:", MONETARY_UNIT + data.getDELIVERY_CHARGE()));
}
double totalAmount = Double.parseDouble(data.getTOTAL_AMOUNT());
if (data.getCouponList() != null && data.getCouponList().size() > 0) {
for (OrderDetails.DataBean.CouponBean coupon : data.getCouponList()) {
billData.add(getBillBean(coupon.getCouponName() + ":", "-" + MONETARY_UNIT + coupon.getDiscount_amount()));
totalAmount = MoneyUtil.sub(totalAmount, coupon.getDiscount_amount());
}
}
layout.addView(getTakeawayBillInfoView(mContext, billData));
......@@ -237,17 +239,7 @@ public class PrintOtherOrderClosing extends PrinterRoot<PrintTakeawayCheckoutCon
//總金額34sp
layout.addView(getTakeawayLargeAmount(mContext, "總金額:", MONETARY_UNIT + data.getTOTAL_AMOUNT()));
layout.addView(getLine(mContext));
// if (data.getPayMultiple() != null && data.getPayMultiple().size() > 0) {
// for (OrderDetails.DataBean.PayMultiple payMultiple : data.getPayMultiple()) {
// if (!TextUtil.isEmptyOrNullOrUndefined(payMultiple.getPayName())) {
// layout.addView(getTakeawayLargeAmount(mContext, payMultiple.getPayName(), MONETARY_UNIT + payMultiple.getAmount()));
// }
// }
// layout.addView(getLine(mContext));
// } else {
// layout.addView(getTakeawayLargeAmount(mContext, "支付金額:", MONETARY_UNIT + MoneyUtil.sub(Double.parseDouble(data.getTOTAL_AMOUNT()), data.getDiscount_amount()) + ""));
// }
addTakeawayPayViews(mContext, layout, data.getPayMultiple(), MoneyUtil.sub(Double.parseDouble(data.getTOTAL_AMOUNT()), data.getDiscount_amount()));
addTakeawayPayViews(mContext, layout, data.getPayMultiple(), totalAmount);
//會員信息
layout.addView(getTakeawayMemberIntegerView(mContext, data));
......
......@@ -14,10 +14,10 @@ import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.common.utils.time.TimeUtils;
import com.gingersoft.gsa.cloud.common.constans.ExpandConstant;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.joe.print.R;
import com.gingersoft.gsa.cloud.common.core.print.bean.PrjBean;
import com.joe.print.mvp.model.bean.HtmlLable;
import com.joe.print.mvp.print.common.HtmlContract;
import com.joe.print.R;
import com.joe.print.mvp.ui.adapter.KitChenPrjPrintFoodAdapter;
import java.util.ArrayList;
......@@ -367,8 +367,10 @@ public class PrintPrjKitchen extends PrinterRoot {
//操作人員
tvOperator.setText(prjBean.getUserName());
if (RestaurantExpandInfoUtils.getValue(ExpandConstant.PrintPage, false)) {
if (prjBean.getCurrentIndex() <= prjBean.getTotalPrj()) {
tvCurrentPageIndex.setText(prjBean.getCurrentIndex() + "/" + prjBean.getTotalPrj());
}
}
return viewToZoomBitmap(context, view, printerDeviceBean);
}
......
......@@ -200,7 +200,6 @@ public class PrjService extends Service implements ReceiveListener {
@Override
public void onNext(String s) {
Log.e(TAG, "請求到PRJ數據:" + s);
//請求到數據,停止輪詢,開始打印,在打印完之後再重新開始輪詢
// startPrint(s);
newPrint(s);
......@@ -336,7 +335,6 @@ public class PrjService extends Service implements ReceiveListener {
private void newPrint(String json) {
printDatas.clear();
// listMap.clear();
Map<String, List<PrjBean.DataBean.Bean>> listMap = new HashMap<>();
currentIndex = 0;
totalPrj = 0;
......
......@@ -55,4 +55,7 @@ dependencies {
annotationProcessor rootProject.ext.dependencies["dagger2-compiler"]
annotationProcessor rootProject.ext.dependencies["butterknife-compiler"]
implementation rootProject.ext.dependencies["BaseRecyclerViewAdapter"]
implementation rootProject.ext.dependencies["glide"]
annotationProcessor rootProject.ext.dependencies["glide-compiler"]
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gingersoft.supply_chain">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application android:networkSecurityConfig="@xml/network_android">
<application android:networkSecurityConfig="@xml/network_android"
android:requestLegacyExternalStorage="true">
<activity
android:name=".mvp.ui.activity.SupplyChainMainActivity"
android:screenOrientation="portrait" />
<meta-data
android:name="com.gingersoft.gsa.cloud.common.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
......
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gingersoft.supply_chain" >
package="com.gingersoft.supply_chain">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<application
android:name="com.gingersoft.gsa.cloud.app.GsaCloudApplication"
android:networkSecurityConfig="@xml/network_android" >
<activity android:name=".mvp.ui.activity.SupplyChainMainActivity" >
android:networkSecurityConfig="@xml/network_android"
android:requestLegacyExternalStorage="true">
<activity android:name=".mvp.ui.activity.SupplyChainMainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
......@@ -28,7 +30,16 @@
android:value="360" />
<meta-data
android:name="design_height_in_dp"
android:value="640" />
android:value="640" /> <!-- 适配android 7.0文件访问 -->
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.gingersoft.supply_chain"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
</application>
</manifest>
\ No newline at end of file
package com.gingersoft.supply_chain.di.component;
import dagger.BindsInstance;
import dagger.Component;
import com.jess.arms.di.component.AppComponent;
import com.gingersoft.supply_chain.di.module.CategoryModule;
import com.gingersoft.supply_chain.mvp.contract.CategoryContract;
import com.jess.arms.di.scope.FragmentScope;
import com.gingersoft.supply_chain.mvp.ui.fragment.category.CategoryFragment;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 11/28/2020 10:14
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
@Component(modules = CategoryModule.class, dependencies = AppComponent.class)
public interface CategoryComponent {
void inject(CategoryFragment fragment);
@Component.Builder
interface Builder {
@BindsInstance
Builder view(CategoryContract.View view);
Builder appComponent(AppComponent appComponent);
CategoryComponent build();
}
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.component;
import dagger.BindsInstance;
import dagger.Component;
import com.gingersoft.supply_chain.mvp.ui.fragment.category.CategorySelectFragment;
import com.jess.arms.di.component.AppComponent;
import com.gingersoft.supply_chain.di.module.CategorySelectModule;
import com.gingersoft.supply_chain.mvp.contract.CategorySelectContract;
import com.jess.arms.di.scope.FragmentScope;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 11/26/2020 14:39
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
@Component(modules = CategorySelectModule.class, dependencies = AppComponent.class)
public interface CategorySelectComponent {
void inject(CategorySelectFragment fragment);
@Component.Builder
interface Builder {
@BindsInstance
Builder view(CategorySelectContract.View view);
Builder appComponent(AppComponent appComponent);
CategorySelectComponent build();
}
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.component;
import dagger.BindsInstance;
import dagger.Component;
import com.gingersoft.supply_chain.mvp.ui.fragment.order.ConfirmOrderFragment;
import com.jess.arms.di.component.AppComponent;
import com.gingersoft.supply_chain.di.module.ConfirmOrderModule;
import com.gingersoft.supply_chain.mvp.contract.ConfirmOrderContract;
import com.jess.arms.di.scope.FragmentScope;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/17/2020 10:24
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
@Component(modules = ConfirmOrderModule.class, dependencies = AppComponent.class)
public interface ConfirmOrderComponent {
void inject(ConfirmOrderFragment fragment);
@Component.Builder
interface Builder {
@BindsInstance
Builder view(ConfirmOrderContract.View view);
Builder appComponent(AppComponent appComponent);
ConfirmOrderComponent build();
}
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.component;
import dagger.BindsInstance;
import dagger.Component;
import com.gingersoft.supply_chain.mvp.ui.fragment.food.FoodIngredientCategoryFragment;
import com.jess.arms.di.component.AppComponent;
import com.gingersoft.supply_chain.di.module.FoodIngredientCategoryModule;
import com.gingersoft.supply_chain.mvp.contract.FoodIngredientCategoryContract;
import com.jess.arms.di.scope.FragmentScope;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 11/25/2020 11:42
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
@Component(modules = FoodIngredientCategoryModule.class, dependencies = AppComponent.class)
public interface FoodIngredientCategoryComponent {
void inject(FoodIngredientCategoryFragment fragment);
@Component.Builder
interface Builder {
@BindsInstance
Builder view(FoodIngredientCategoryContract.View view);
Builder appComponent(AppComponent appComponent);
FoodIngredientCategoryComponent build();
}
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.component;
import dagger.BindsInstance;
import dagger.Component;
import com.gingersoft.supply_chain.mvp.ui.fragment.food.FoodIngredientsFragment;
import com.jess.arms.di.component.AppComponent;
import com.gingersoft.supply_chain.di.module.FoodIngredientsModule;
import com.gingersoft.supply_chain.mvp.contract.FoodIngredientsContract;
import com.jess.arms.di.scope.FragmentScope;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 11/24/2020 15:28
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
@Component(modules = FoodIngredientsModule.class, dependencies = AppComponent.class)
public interface FoodIngredientsComponent {
void inject(FoodIngredientsFragment fragment);
@Component.Builder
interface Builder {
@BindsInstance
Builder view(FoodIngredientsContract.View view);
Builder appComponent(AppComponent appComponent);
FoodIngredientsComponent build();
}
}
\ No newline at end of file
......@@ -32,9 +32,9 @@ public interface FunctionListComponent {
@Component.Builder
interface Builder {
@BindsInstance
FunctionListComponent.Builder view(FunctionListContract.View view);
Builder view(FunctionListContract.View view);
FunctionListComponent.Builder appComponent(AppComponent appComponent);
Builder appComponent(AppComponent appComponent);
FunctionListComponent build();
}
......
......@@ -2,7 +2,7 @@ package com.gingersoft.supply_chain.di.component;
import com.gingersoft.supply_chain.di.module.MeasurementUnitModule;
import com.gingersoft.supply_chain.mvp.contract.MeasurementUnitContract;
import com.gingersoft.supply_chain.mvp.ui.fragment.MeasurementUnitFragment;
import com.gingersoft.supply_chain.mvp.ui.fragment.food.MeasurementUnitFragment;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.di.scope.FragmentScope;
......@@ -30,9 +30,9 @@ public interface MeasurementUnitComponent {
@Component.Builder
interface Builder {
@BindsInstance
MeasurementUnitComponent.Builder view(MeasurementUnitContract.View view);
Builder view(MeasurementUnitContract.View view);
MeasurementUnitComponent.Builder appComponent(AppComponent appComponent);
Builder appComponent(AppComponent appComponent);
MeasurementUnitComponent build();
}
......
package com.gingersoft.supply_chain.di.component;
import dagger.BindsInstance;
import dagger.Component;
import com.gingersoft.supply_chain.mvp.ui.fragment.food.NewFoodIngredientsFragment;
import com.jess.arms.di.component.AppComponent;
import com.gingersoft.supply_chain.di.module.NewFoodIngredientsModule;
import com.gingersoft.supply_chain.mvp.contract.NewFoodIngredientsContract;
import com.jess.arms.di.scope.FragmentScope;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 11/24/2020 16:13
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
@Component(modules = NewFoodIngredientsModule.class, dependencies = AppComponent.class)
public interface NewFoodIngredientsComponent {
void inject(NewFoodIngredientsFragment fragment);
@Component.Builder
interface Builder {
@BindsInstance
Builder view(NewFoodIngredientsContract.View view);
Builder appComponent(AppComponent appComponent);
NewFoodIngredientsComponent build();
}
}
\ No newline at end of file
......@@ -3,13 +3,13 @@ package com.gingersoft.supply_chain.di.component;
import dagger.BindsInstance;
import dagger.Component;
import com.gingersoft.supply_chain.mvp.ui.fragment.food.NewFoodUnitFragment;
import com.jess.arms.di.component.AppComponent;
import com.gingersoft.supply_chain.di.module.NewFoodUnitModule;
import com.gingersoft.supply_chain.mvp.contract.NewFoodUnitContract;
import com.jess.arms.di.scope.FragmentScope;
import com.gingersoft.supply_chain.mvp.ui.fragment.NewFoodUnitFragment;
/**
......@@ -32,9 +32,9 @@ public interface NewFoodUnitComponent {
@Component.Builder
interface Builder {
@BindsInstance
NewFoodUnitComponent.Builder view(NewFoodUnitContract.View view);
Builder view(NewFoodUnitContract.View view);
NewFoodUnitComponent.Builder appComponent(AppComponent appComponent);
Builder appComponent(AppComponent appComponent);
NewFoodUnitComponent build();
}
......
......@@ -3,13 +3,13 @@ package com.gingersoft.supply_chain.di.component;
import dagger.BindsInstance;
import dagger.Component;
import com.gingersoft.supply_chain.mvp.ui.fragment.supplier.NewSupplierFragment;
import com.jess.arms.di.component.AppComponent;
import com.gingersoft.supply_chain.di.module.NewSupplierModule;
import com.gingersoft.supply_chain.mvp.contract.NewSupplierContract;
import com.jess.arms.di.scope.FragmentScope;
import com.gingersoft.supply_chain.mvp.ui.fragment.NewSupplierFragment;
/**
......@@ -32,9 +32,9 @@ public interface NewSupplierComponent {
@Component.Builder
interface Builder {
@BindsInstance
NewSupplierComponent.Builder view(NewSupplierContract.View view);
Builder view(NewSupplierContract.View view);
NewSupplierComponent.Builder appComponent(AppComponent appComponent);
Builder appComponent(AppComponent appComponent);
NewSupplierComponent build();
}
......
package com.gingersoft.supply_chain.di.component;
import dagger.BindsInstance;
import dagger.Component;
import com.jess.arms.di.component.AppComponent;
import com.gingersoft.supply_chain.di.module.OrderDetailsModule;
import com.gingersoft.supply_chain.mvp.contract.OrderDetailsContract;
import com.jess.arms.di.scope.FragmentScope;
import com.gingersoft.supply_chain.mvp.ui.fragment.order.OrderDetailsFragment;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/22/2020 16:57
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
@Component(modules = OrderDetailsModule.class, dependencies = AppComponent.class)
public interface OrderDetailsComponent {
void inject(OrderDetailsFragment fragment);
@Component.Builder
interface Builder {
@BindsInstance
Builder view(OrderDetailsContract.View view);
Builder appComponent(AppComponent appComponent);
OrderDetailsComponent build();
}
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.component;
import dagger.BindsInstance;
import dagger.Component;
import com.jess.arms.di.component.AppComponent;
import com.gingersoft.supply_chain.di.module.PackageSpecificationModule;
import com.gingersoft.supply_chain.mvp.contract.PackageSpecificationContract;
import com.jess.arms.di.scope.FragmentScope;
import com.gingersoft.supply_chain.mvp.ui.fragment.food.PackageSpecificationFragment;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 11/24/2020 18:40
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
@Component(modules = PackageSpecificationModule.class, dependencies = AppComponent.class)
public interface PackageSpecificationComponent {
void inject(PackageSpecificationFragment fragment);
@Component.Builder
interface Builder {
@BindsInstance
Builder view(PackageSpecificationContract.View view);
Builder appComponent(AppComponent appComponent);
PackageSpecificationComponent build();
}
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.component;
import dagger.BindsInstance;
import dagger.Component;
import com.gingersoft.supply_chain.mvp.ui.fragment.order.PurchaseListFragment;
import com.jess.arms.di.component.AppComponent;
import com.gingersoft.supply_chain.di.module.PurchaseListModule;
import com.gingersoft.supply_chain.mvp.contract.PurchaseListContract;
import com.jess.arms.di.scope.FragmentScope;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/02/2020 16:05
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
@Component(modules = PurchaseListModule.class, dependencies = AppComponent.class)
public interface PurchaseListComponent {
void inject(PurchaseListFragment fragment);
@Component.Builder
interface Builder {
@BindsInstance
Builder view(PurchaseListContract.View view);
Builder appComponent(AppComponent appComponent);
PurchaseListComponent build();
}
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.component;
import dagger.BindsInstance;
import dagger.Component;
import com.gingersoft.supply_chain.mvp.ui.fragment.order.SendMsgFragment;
import com.jess.arms.di.component.AppComponent;
import com.gingersoft.supply_chain.di.module.SendMsgModule;
import com.gingersoft.supply_chain.mvp.contract.SendMsgContract;
import com.jess.arms.di.scope.FragmentScope;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/08/2020 09:17
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
@Component(modules = SendMsgModule.class, dependencies = AppComponent.class)
public interface SendMsgComponent {
void inject(SendMsgFragment fragment);
@Component.Builder
interface Builder {
@BindsInstance
Builder view(SendMsgContract.View view);
Builder appComponent(AppComponent appComponent);
SendMsgComponent build();
}
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.component;
import dagger.BindsInstance;
import dagger.Component;
import com.gingersoft.supply_chain.mvp.contract.ShoppingCatContract;
import com.gingersoft.supply_chain.mvp.ui.fragment.order.ShoppingCatFragment;
import com.jess.arms.di.component.AppComponent;
import com.gingersoft.supply_chain.di.module.ShoppingCatModule;
import com.jess.arms.di.scope.FragmentScope;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/03/2020 17:16
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
@Component(modules = ShoppingCatModule.class, dependencies = AppComponent.class)
public interface ShoppingCatComponent {
void inject(ShoppingCatFragment fragment);
@Component.Builder
interface Builder {
@BindsInstance
Builder view(ShoppingCatContract.View view);
Builder appComponent(AppComponent appComponent);
ShoppingCatComponent build();
}
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.component;
import dagger.BindsInstance;
import dagger.Component;
import com.jess.arms.di.component.AppComponent;
import com.gingersoft.supply_chain.di.module.StorageListModule;
import com.gingersoft.supply_chain.mvp.contract.StorageListContract;
import com.jess.arms.di.scope.FragmentScope;
import com.gingersoft.supply_chain.mvp.ui.fragment.inventory.StorageListFragment;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/10/2020 18:09
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
@Component(modules = StorageListModule.class, dependencies = AppComponent.class)
public interface StorageListComponent {
void inject(StorageListFragment fragment);
@Component.Builder
interface Builder {
@BindsInstance
Builder view(StorageListContract.View view);
Builder appComponent(AppComponent appComponent);
StorageListComponent build();
}
}
\ No newline at end of file
......@@ -3,13 +3,13 @@ package com.gingersoft.supply_chain.di.component;
import dagger.BindsInstance;
import dagger.Component;
import com.gingersoft.supply_chain.mvp.ui.fragment.supplier.SupplierListFragment;
import com.jess.arms.di.component.AppComponent;
import com.gingersoft.supply_chain.di.module.SupplierListModule;
import com.gingersoft.supply_chain.mvp.contract.SupplierListContract;
import com.jess.arms.di.scope.FragmentScope;
import com.gingersoft.supply_chain.mvp.ui.fragment.SupplierListFragment;
/**
......@@ -32,9 +32,9 @@ public interface SupplierListComponent {
@Component.Builder
interface Builder {
@BindsInstance
SupplierListComponent.Builder view(SupplierListContract.View view);
Builder view(SupplierListContract.View view);
SupplierListComponent.Builder appComponent(AppComponent appComponent);
Builder appComponent(AppComponent appComponent);
SupplierListComponent build();
}
......
......@@ -32,9 +32,9 @@ public interface SupplyChainMainComponent {
@Component.Builder
interface Builder {
@BindsInstance
SupplyChainMainComponent.Builder view(SupplyChainMainContract.View view);
Builder view(SupplyChainMainContract.View view);
SupplyChainMainComponent.Builder appComponent(AppComponent appComponent);
Builder appComponent(AppComponent appComponent);
SupplyChainMainComponent build();
}
......
package com.gingersoft.supply_chain.di.module;
import com.jess.arms.di.scope.FragmentScope;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import com.gingersoft.supply_chain.mvp.contract.CategoryContract;
import com.gingersoft.supply_chain.mvp.model.CategoryModel;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 11/28/2020 10:14
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@Module
public abstract class CategoryModule {
@Binds
abstract CategoryContract.Model bindCategoryModel(CategoryModel model);
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.module;
import com.jess.arms.di.scope.FragmentScope;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import com.gingersoft.supply_chain.mvp.contract.CategorySelectContract;
import com.gingersoft.supply_chain.mvp.model.CategorySelectModel;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 11/26/2020 14:39
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@Module
public abstract class CategorySelectModule {
@Binds
abstract CategorySelectContract.Model bindCategorySelectModel(CategorySelectModel model);
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.module;
import com.jess.arms.di.scope.FragmentScope;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import com.gingersoft.supply_chain.mvp.contract.ConfirmOrderContract;
import com.gingersoft.supply_chain.mvp.model.ConfirmOrderModel;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/17/2020 10:24
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@Module
public abstract class ConfirmOrderModule {
@Binds
abstract ConfirmOrderContract.Model bindConfirmOrderModel(ConfirmOrderModel model);
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.module;
import com.jess.arms.di.scope.FragmentScope;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import com.gingersoft.supply_chain.mvp.contract.FoodIngredientCategoryContract;
import com.gingersoft.supply_chain.mvp.model.FoodIngredientCategoryModel;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 11/25/2020 11:42
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@Module
public abstract class FoodIngredientCategoryModule {
@Binds
abstract FoodIngredientCategoryContract.Model bindFoodIngredientCategoryModel(FoodIngredientCategoryModel model);
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.module;
import com.jess.arms.di.scope.FragmentScope;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import com.gingersoft.supply_chain.mvp.contract.FoodIngredientsContract;
import com.gingersoft.supply_chain.mvp.model.FoodIngredientsModel;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 11/24/2020 15:28
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@Module
public abstract class FoodIngredientsModule {
@Binds
abstract FoodIngredientsContract.Model bindFoodIngredientsModel(FoodIngredientsModel model);
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.module;
import com.jess.arms.di.scope.FragmentScope;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import com.gingersoft.supply_chain.mvp.contract.NewFoodIngredientsContract;
import com.gingersoft.supply_chain.mvp.model.NewFoodIngredientsModel;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 11/24/2020 16:13
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@Module
public abstract class NewFoodIngredientsModule {
@Binds
abstract NewFoodIngredientsContract.Model bindNewFoodIngredientsModel(NewFoodIngredientsModel model);
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.module;
import com.jess.arms.di.scope.FragmentScope;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import com.gingersoft.supply_chain.mvp.contract.OrderDetailsContract;
import com.gingersoft.supply_chain.mvp.model.OrderDetailsModel;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/22/2020 16:57
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@Module
public abstract class OrderDetailsModule {
@Binds
abstract OrderDetailsContract.Model bindOrderDetailsModel(OrderDetailsModel model);
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.module;
import com.jess.arms.di.scope.FragmentScope;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import com.gingersoft.supply_chain.mvp.contract.PackageSpecificationContract;
import com.gingersoft.supply_chain.mvp.model.PackageSpecificationModel;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 11/24/2020 18:40
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@Module
public abstract class PackageSpecificationModule {
@Binds
abstract PackageSpecificationContract.Model bindPackageSpecificationModel(PackageSpecificationModel model);
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.module;
import com.jess.arms.di.scope.FragmentScope;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import com.gingersoft.supply_chain.mvp.contract.PurchaseListContract;
import com.gingersoft.supply_chain.mvp.model.PurchaseListModel;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/02/2020 16:05
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@Module
public abstract class PurchaseListModule {
@Binds
abstract PurchaseListContract.Model bindPurchaseListModel(PurchaseListModel model);
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.module;
import com.jess.arms.di.scope.FragmentScope;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import com.gingersoft.supply_chain.mvp.contract.SendMsgContract;
import com.gingersoft.supply_chain.mvp.model.SendMsgModel;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/08/2020 09:17
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@Module
public abstract class SendMsgModule {
@Binds
abstract SendMsgContract.Model bindSendMsgModel(SendMsgModel model);
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.module;
import com.gingersoft.supply_chain.mvp.model.ShoppingCatModel;
import dagger.Binds;
import dagger.Module;
import com.gingersoft.supply_chain.mvp.contract.ShoppingCatContract;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/03/2020 17:16
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@Module
public abstract class ShoppingCatModule {
@Binds
abstract ShoppingCatContract.Model bindOrderContentModel(ShoppingCatModel model);
}
\ No newline at end of file
package com.gingersoft.supply_chain.di.module;
import com.jess.arms.di.scope.FragmentScope;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import com.gingersoft.supply_chain.mvp.contract.StorageListContract;
import com.gingersoft.supply_chain.mvp.model.StorageListModel;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/10/2020 18:09
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@Module
public abstract class StorageListModule {
@Binds
abstract StorageListContract.Model bindStorageListModel(StorageListModel model);
}
\ No newline at end of file
package com.gingersoft.supply_chain.mvp.bean;
import com.gingersoft.gsa.cloud.common.core.restaurant.ResturantInfoManager;
import com.gingersoft.gsa.cloud.common.utils.MoneyUtil;
import com.gingersoft.gsa.cloud.common.utils.time.TimeUtils;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/17
* Time: 11:36
* Use:
*/
@Data
public class ConfirmOrderBean {
private PurchaseOrder purchaseOrder;
private List<PurchaseOrderDetails> purchaseOrderDetails;
@Data
public static class PurchaseOrder implements Serializable {
private static final long serialVersionUID = -8777410033061311699L;
private int id;
private int supplierId;
private String supplierName;
private int brandId;
private int restaurantId;
private String sendingAddress;
//默認第二天
private long initialShippingTime;
private double totalAmount;
private int shipping;
private double actualPayment;
private String remarks;
}
public static PurchaseOrder conversionPurchaseOrder(PurchaseFoodListVosBean cartFood) {
PurchaseOrder purchaseOrder = new PurchaseOrder();
purchaseOrder.setSupplierId(cartFood.getSupplierId());
purchaseOrder.setSupplierName(cartFood.getSupplierName());
purchaseOrder.setBrandId(ResturantInfoManager.newInstance().getBrandId());
purchaseOrder.setRestaurantId(ResturantInfoManager.newInstance().getRestaurantId());
purchaseOrder.setInitialShippingTime(TimeUtils.getNextDayLong(1));
purchaseOrder.setTotalAmount(MoneyUtil.priceCalculation(cartFood.getUnitPrice(), cartFood.getFoodQuantity()));
purchaseOrder.setActualPayment(MoneyUtil.sum(purchaseOrder.getTotalAmount(), purchaseOrder.getShipping()));
return purchaseOrder;
}
@Data
public static class PurchaseOrderDetails {
private int purchaseFoodId;
private int foodQuantity;
private double foodPrice;
private int orderId;
}
public static PurchaseOrderDetails conversionPurchaseOrderDetails(PurchaseFoodListVosBean cartFood) {
PurchaseOrderDetails purchaseOrderDetails = new PurchaseOrderDetails();
purchaseOrderDetails.setPurchaseFoodId(cartFood.getId());
purchaseOrderDetails.setFoodQuantity(cartFood.getFoodQuantity());
purchaseOrderDetails.setFoodPrice(cartFood.getUnitPrice());
return purchaseOrderDetails;
}
}
package com.gingersoft.supply_chain.mvp.bean;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/18
* Time: 16:41
* Use:
*/
public class ConfirmOrderResultBean {
}
package com.gingersoft.supply_chain.mvp.bean;
import java.util.List;
import lombok.Data;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/9
* Time: 18:33
* Use: 根據分類獲取食材信息的接口返回數據
*/
@Data
public class FoodByCategoryResultBean {
private boolean success;
private long sysTime;
private String errMsg;
private List<PurchaseFoodListVosBean> data;
}
package com.gingersoft.supply_chain.mvp.bean;
import java.util.List;
import lombok.Data;
/**
* @author 宇航.
* User: admin
* Date: 2020/11/26
* Time: 16:00
* Use: 食品分類
*/
@Data
public class FoodCategoryResultBean {
private boolean success;
private long sysTime;
private DataBean data;
private String errMsg;
@Data
public static class DataBean {
/**
* count : 1
* list : [{"id":6,"uid":26,"brandId":1,"restaurantId":26,"parentId":0,"name":"果蔬品","sort":1,"remarks":"備註","createTime":1605944097385,"updateTime":1605944097044}]
*/
private int count;
private List<FoodCategoryBean> list;
@Data
public static class FoodCategoryBean {
/**
* id : 6
* uid : 26
* brandId : 1
* restaurantId : 26
* parentId : 0
* name : 果蔬品
* sort : 1
* remarks : 備註
* createTime : 1605944097385
* updateTime : 1605944097044
*/
private int id;
private int uid;
private int brandId;
private int restaurantId;
private int parentId;
private String name;
private int sort;
private String remarks;
private long createTime;
private long updateTime;
private int deletes;
/**
* 子類
*/
private List<FoodCategoryBean> list;
}
}
}
package com.gingersoft.supply_chain.mvp.bean;//package com.gingersoft.supply_chain.mvp.bean;
//
//import java.util.List;
//
//import lombok.Data;
//
///**
// * @author 宇航.
// * User: admin
// * Date: 2020/12/1
// * Time: 18:14
// * Use:
// * implements Commodity
// */
//@Data
//public class FoodInfoBean {
// private int brandId;
// private int restaurantId;
// private String foodNo;
// private String name;
// private String images;
// //供應商名稱
// private String supplierName;
// private String foodCategoryName;
// private Double unitPrice;
// //是否需要審核
// private boolean reviews;
// private String remarks;
// private InventoryAlarm inventoryAlarm;
// @Data
// public static class InventoryAlarm {
// //庫存預警,單位id
// private int foodUnitId;
// //最低庫存
// private int minimumInventory;
// }
// //包裝規格
// private List<FoodPackingSpecificationBean> foodPackingSpecifications;
//
//
//}
package com.gingersoft.supply_chain.mvp.bean;
import java.util.List;
import lombok.Data;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/2
* Time: 10:26
* Use: 食材訂購列表信息
*/
@Data
public class FoodListInfoBean {
private boolean success;
private long sysTime;
private List<DataBean> data;
@Data
public static class DataBean {
//供應商id
private int id;
//供應商名稱
private String supplierName;
private long createTime;
//食材集合
private List<PurchaseFoodListVosBean> purchaseFoodListVOS;
}
}
package com.gingersoft.supply_chain.mvp.bean;
import java.io.Serializable;
import lombok.Data;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/1
* Time: 15:14
* Use:
*/
@Data
public class FoodPackingSpecificationBean implements Serializable {
private static final long serialVersionUID = -2313739462020089855L;
private int foodUnitId;
/**
* 包裝類型規格
* 1、訂貨
* 2、收貨
*/
private int type;
public final static int ORDERING_TYPE = 1;
public final static int RECEIVING_TYPE = 2;
private double quantityStarts;
private double quantityEnd;
/**
* 自定義屬性
*/
private String typeName;
public FoodPackingSpecificationBean() {
}
}
package com.gingersoft.supply_chain.mvp.bean;
import java.util.List;
import lombok.Data;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/5
* Time: 17:23
* Use:新增採購單時,需要傳遞的數據
*/
@Data
public class NewPurchaseOrderBean {
private int brandId;
private int restaurantId;
private double totalAmount;
private String remarks;
private List<PurchaseOrderDetailsBean> purchaseOrderDetailsVOS;
@Data
public static class PurchaseOrderDetailsBean {
private int foodId;
private int foodQuantity;
private double foodPrice;
private int supplierId;
}
}
package com.gingersoft.supply_chain.mvp.bean;
import lombok.Data;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/5
* Time: 17:01
* Use: 採購單對象
*/
@Data
public class OrderBean {
private int id;
private int uid;
private String orderNo;
//訂單內的食品
private String name;
private int purchaseFoodCount;
private double totalAmount;
private int status;
private boolean visibleState;
private String remarks;
private long updateTime;
private long createTime;
private int deletes;
}
package com.gingersoft.supply_chain.mvp.bean;
import java.util.List;
import lombok.Data;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/8
* Time: 16:24
* Use: 下單頁面的分類
*/
@Data
public class OrderCategoryBean {
private boolean success;
private long sysTime;
private String errMsg;
private List<FoodCategoryTrees> data;
@Data
public static class FoodCategoryTrees {
private int id;
private String name;
private int parentId;
private List<FoodCategoryTrees> foodCategoryTrees;
}
}
package com.gingersoft.supply_chain.mvp.bean;
import java.util.List;
import lombok.Data;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/23
* Time: 18:00
* Use:
*/
@Data
public class OrderDetailsBean {
/**
* id : 92
* orderNo : JK1630553667
* createTime : 1608365460896
* initialShippingTime : 1608451855391
* totalAmount : 100.1
* shipping : 0
* actualPayment : 100.1
* status : 1
* purchaseOrderDetailsInfoVOS : [{"id":65,"foodQuantity":1,"foodPrice":100,"status":1,"purchaseFoodId":3,"images":"https://baike.baidu.com/pic/%E9%A6%99%E8%95%89/150475/1/5d6034a85edf8db12c69 f8ef0f23dd54574e74f2?fr=lemma&amp;ct=single#aid=1&amp;pic=5d6034a85edf8db12c69f8ef0f23dd54574e74f2","foodNo":"1606560266815","quantityStarts":4,"quantityEnd":9,"type":1,"unit_content":"ML"}]
*/
private int id;
private String orderNo;
private long createTime;
private String initialShippingTime;
private double totalAmount;
private int shipping;
private double actualPayment;
private int status;
private String supplierName;
private List<PurchaseOrderDetailsInfoVosBean> purchaseOrderDetailsInfoVOS;
@Data
public static class PurchaseOrderDetailsInfoVosBean {
/**
* id : 65
* foodQuantity : 1
* foodPrice : 100
* status : 1
* purchaseFoodId : 3
* images : https://baike.baidu.com/pic/%E9%A6%99%E8%95%89/150475/1/5d6034a85edf8db12c69 f8ef0f23dd54574e74f2?fr=lemma&amp;ct=single#aid=1&amp;pic=5d6034a85edf8db12c69f8ef0f23dd54574e74f2
* foodNo : 1606560266815
* quantityStarts : 4
* quantityEnd : 9
* type : 1
* unit_content : ML
*/
private int id;
private int foodQuantity;
private int foodPrice;
private int status;
private int purchaseFoodId;
private String images;
private String foodNo;
private int quantityStarts;
private int quantityEnd;
private int type;
private String unit_content;
private String name;
//自定義字段,總價
private double totalAmount;
//是否被選中
private boolean isChecked = false;
}
}
package com.gingersoft.supply_chain.mvp.bean;
import lombok.Data;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/24
* Time: 14:14
* Use: 入庫接口上傳實體類
*/
@Data
public class OrderWareHouseBean {
private int status;
private int orderId;
@Data
public static class PurchaseWarehousingOrder {
private String files;
private String remarks;
private double totalPrice;
}
@Data
public static class PurchaseWarehousingOrderDetails {
private int orderDetailsId;
private int purchaseFoodId;
private int foodQuantity;
private double foodPrice;
private double totalPrice;
private int type;
private String unitContent;
}
}
package com.gingersoft.supply_chain.mvp.bean;
import com.gingersoft.supply_chain.mvp.content.Constant;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/4
* Time: 11:41
* Use:食材信息
*/
@Data
public class PurchaseFoodListVosBean implements Serializable {
private static final long serialVersionUID = 7084280906070243339L;
private int id;
private String supplierName;
private String images;
private String foodNo;
private String name;
private double unitPrice;
private String foodCategoryName;
private String remarks;
private int quantityStarts;
private int quantityEnd;
private int type;
private String unitContent;
private long createTime;
private int foodQuantity;
/**
* 分類id
*/
private int categoryId;
/**
* 所屬供應商id
*/
private int supplierId;
/**
* 是否選中
*/
private boolean isChecked;
/**
* 是否刪除
* {@link Constant.DELETE,Constant.NORMAL}
*
*/
private int deletes;
private int restaurantId;
private int brandId;
private InventoryAlarm inventoryAlarm;
@Data
public static class InventoryAlarm {
//庫存預警,單位id
private int foodUnitId;
//最低庫存
private int minimumInventory;
}
//包裝規格
private List<FoodPackingSpecificationBean> foodPackingSpecifications;
public boolean isChecked() {
return isChecked;
}
public void setChecked(boolean checked) {
isChecked = checked;
}
}
package com.gingersoft.supply_chain.mvp.bean;
import java.util.List;
import lombok.Data;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/5
* Time: 16:42
* Use: 供應鏈採購單
*/
@Data
public class PurchaseOrderResultBean {
private boolean success;
private long sysTime;
private DataBean data;
@Data
public static class DataBean {
private int count;
private List<OrderBean> list;
}
}
......@@ -32,7 +32,6 @@ public class SupplierInfoBean implements Serializable {
private long updateTime;
private int deletes;
private List<SupplierContacts> supplierContacts;
public SupplierInfoBean(String supplierName, String address, String contactInformation, String contacts, String createDate) {
......@@ -49,29 +48,34 @@ public class SupplierInfoBean implements Serializable {
@Data
public static class SupplierContacts implements Serializable {
private static final long serialVersionUID = -4586838211196656718L;
private int id;
private int supplierId;
private String configText;
private long createTime;
private long updateTime;
/**
* 聯繫方式
* 1、郵箱
* 2、座機
* 3、Whatsapp
* 4、wehat
* 5、line
* 6、Kakao
* 7、Talk
* 8、SMS
* 9、efax
* 2、Whatsapp
* 3、ehat
* 4、line
* 5、Kakao
* 6、Talk
* 7、SMS
* 8、efax
*/
private int type;
public final static int Email = 1;
public final static int Landline = 2;
public final static int Whatsapp = 3;
public final static int WeChat = 4;
public final static int Line = 5;
public final static int Kakao = 6;
public final static int Talk = 7;
public final static int SMS = 8;
public final static int Efax = 9;
public final static int SMS = 6;
public final static int Efax = 7;
//接收軟件
public final static int Whatsapp = 2;
public final static int WeChat = 3;
public final static int Line = 4;
public final static int Kakao_Talk= 5;
public SupplierContacts() {
}
public SupplierContacts(String configText, int type) {
this.configText = configText;
......
package com.gingersoft.supply_chain.mvp.content;
import com.gingersoft.gsa.cloud.common.core.restaurant.ResturantInfoManager;
import java.util.Map;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/5
* Time: 16:27
* Use:
*/
public class Constant {
public static final int DELETE = 1;
public static final int NORMAL = 0;
public static final String GET_INFO_ERROR = "數據獲取失敗,請稍候再試";
public static final String INFO_SYNTAX_ERROR = "數據解析失敗,請聯繫開發人員";
public static final String GET_INFO_LOADING = "數據獲取中...";
public static void addBrandId(Map<String, Object> map) {
map.put("brandId", ResturantInfoManager.newInstance().getBrandId());
}
public static void addRestaurantId(Map<String, Object> map) {
map.put("restaurantId", ResturantInfoManager.newInstance().getRestaurantId());
}
public static void addPageSize(Map<String, Object> map) {
map.put("pageSize", 10);
}
}
package com.gingersoft.supply_chain.mvp.content;
import android.util.Log;
import com.gingersoft.supply_chain.mvp.bean.PurchaseFoodListVosBean;
import java.util.ArrayList;
import java.util.List;
import java.util.Observable;
/**
* @author 宇航.
* User: admin
* Date: 2020/12/4
* Time: 11:21
* Use: 供應鏈購物車,需要緩存用戶選中的食品
*/
public class SupplyShoppingCart extends Observable {
/**
* key為食品id
* value為食品信息
*/
private static List<PurchaseFoodListVosBean> cartFoods;
private static SupplyShoppingCart shoppingCart;
private int goodsNumber = 0;
public static SupplyShoppingCart getInstance() {
if (shoppingCart == null) {
shoppingCart = new SupplyShoppingCart();
}
return shoppingCart;
}
public List<PurchaseFoodListVosBean> getCartFoods() {
if (cartFoods == null) {
cartFoods = new ArrayList<>();
}
if (cartFoods.size() != goodsNumber) {
notifyObservers(cartFoods.size());
goodsNumber = cartFoods.size();
}
return cartFoods;
}
public void setCartFoods(List<PurchaseFoodListVosBean> cartFoods) {
SupplyShoppingCart.cartFoods = cartFoods;
}
}
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.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
import java.util.List;
import java.util.Map;
import io.reactivex.Observable;
import okhttp3.RequestBody;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 11/28/2020 10:14
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public interface CategoryContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
void loadCategoryInfo(List<FoodCategoryResultBean.DataBean.FoodCategoryBean> list, int hierarchy);
void refreshInfo(int hierarchy, int position);
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
Observable<FoodCategoryResultBean> getFoodCategoryList(Map<String, Object> map);
Observable<BaseResult> createFoodCategory(RequestBody requestBody);
Observable<BaseResult> updateFoodCategory(RequestBody requestBody);
}
}
package com.gingersoft.supply_chain.mvp.contract;
import com.gingersoft.gsa.cloud.ui.bean.SectionCheckItem;
import com.gingersoft.supply_chain.mvp.bean.FoodCategoryResultBean;
import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
import com.qmuiteam.qmui.widget.section.QMUISection;
import java.util.List;
import java.util.Map;
import io.reactivex.Observable;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 11/26/2020 14:39
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public interface CategorySelectContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
void loadFoodCategory(List<QMUISection<SectionCheckItem, SectionCheckItem>> sections);
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
Observable<FoodCategoryResultBean> getFoodCategoryList(Map<String, Object> map);
}
}
package com.gingersoft.supply_chain.mvp.contract;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.supply_chain.mvp.bean.ConfirmOrderBean;
import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
import java.util.List;
import io.reactivex.Observable;
import okhttp3.RequestBody;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/17/2020 10:24
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public interface ConfirmOrderContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
void loadInfo(List<ConfirmOrderBean> confirmOrderBeans);
void addOrderSuccess(List<ConfirmOrderBean.PurchaseOrder> purchaseOrders);
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
Observable<BaseResult> addPurchaseOrder(RequestBody requestBody);
}
}
package com.gingersoft.supply_chain.mvp.contract;
import com.jess.arms.mvp.IView;
import com.jess.arms.mvp.IModel;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 11/25/2020 11:42
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public interface FoodIngredientCategoryContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
}
}
package com.gingersoft.supply_chain.mvp.contract;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.ui.bean.view.CategoryBean;
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.PurchaseFoodListVosBean;
import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
import java.util.List;
import java.util.Map;
import io.reactivex.Observable;
import okhttp3.RequestBody;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 11/24/2020 15:28
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public interface FoodIngredientsContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
void loadLeftSupplierInfo(List<CategoryBean> categoryBeans);
void loadRightFoodIngredients(List<PurchaseFoodListVosBean> purchaseFoodListVOS);
/**
* 刪除食品成功回調
*
* @param position
*/
void onDeleteFoodSuccess(int position);
/**
* 加載左側分類
*
* @param foodCategoryTrees 所有分類層級信息
*/
void loadCategory(List<OrderCategoryBean.FoodCategoryTrees> foodCategoryTrees);
void loadFail();
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
Observable<FoodListInfoBean> getFoodIngredientsData(Map<String, Object> map);
Observable<BaseResult> getFoodBySupplierId(Map<String, Object> map);
Observable<BaseResult> updateFood(RequestBody requestBody);
Observable<OrderCategoryBean> getCategoryTrees(Map<String, Object> map);
Observable<FoodByCategoryResultBean> getFoodByCategory(Map<String, Object> map);
}
}
package com.gingersoft.supply_chain.mvp.contract;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
import java.util.List;
import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 11/24/2020 16:13
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public interface NewFoodIngredientsContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
void refreshAdapterByPosition(int position);
void uploadPicSuccess(List<String> picUrl);
void saveFoodInfoSuccess();
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
Observable<BaseResult> upLoadPic(List<MultipartBody.Part> parts);
Observable<BaseResult> addFood(RequestBody requestBody);
}
}
package com.gingersoft.supply_chain.mvp.contract;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.jess.arms.mvp.IView;
import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
import io.reactivex.Observable;
import okhttp3.RequestBody;
......@@ -32,5 +32,7 @@ public interface NewSupplierContract {
Observable<BaseResult> updateSupplier(RequestBody requestBody);
Observable<BaseResult> getSupplierContact(String supplierId);
}
}
package com.gingersoft.supply_chain.mvp.contract;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.supply_chain.mvp.bean.OrderDetailsBean;
import com.jess.arms.mvp.IView;
import com.jess.arms.mvp.IModel;
import io.reactivex.Observable;
import okhttp3.RequestBody;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/22/2020 16:57
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public interface OrderDetailsContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
void loadOrderDetails(OrderDetailsBean orderDetailsBean);
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
Observable<BaseResult> getOrderDetails(int orderId);
/**
* 入庫
*/
Observable<BaseResult> addWarehouse(RequestBody requestBody);
}
}
package com.gingersoft.supply_chain.mvp.contract;
import com.jess.arms.mvp.IView;
import com.jess.arms.mvp.IModel;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 11/24/2020 18:40
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public interface PackageSpecificationContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
}
}
package com.gingersoft.supply_chain.mvp.contract;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.supply_chain.mvp.bean.OrderBean;
import com.gingersoft.supply_chain.mvp.bean.PurchaseOrderResultBean;
import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
import java.util.List;
import java.util.Map;
import io.reactivex.Observable;
import okhttp3.RequestBody;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/02/2020 16:05
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public interface PurchaseListContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
void loadOrderList(List<OrderBean> list);
void deleteOrder(int position);
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
Observable<PurchaseOrderResultBean> getOrderList(Map<String, Object> map);
Observable<BaseResult> updateOrder(RequestBody requestBody);
}
}
package com.gingersoft.supply_chain.mvp.contract;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
import io.reactivex.Observable;
import okhttp3.RequestBody;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/08/2020 09:17
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public interface SendMsgContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
void loadQrCode(String url);
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
Observable<BaseResult> getPurchaseOrderQrCode(String orderId);
Observable<BaseResult> senMsg(RequestBody requestBody);
}
}
package com.gingersoft.supply_chain.mvp.contract;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.supply_chain.mvp.bean.PurchaseFoodListVosBean;
import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
import java.util.List;
import io.reactivex.Observable;
import okhttp3.RequestBody;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/03/2020 17:16
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public interface ShoppingCatContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
void loadAdapter(List<List<PurchaseFoodListVosBean>> supplierFoods);
void setTotalInfo(int typeTotal, double totalPrice);
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
Observable<BaseResult> addNewPurchaseOrder(RequestBody requestBody);
}
}
package com.gingersoft.supply_chain.mvp.contract;
import com.jess.arms.mvp.IView;
import com.jess.arms.mvp.IModel;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 12/10/2020 18:09
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public interface StorageListContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
}
}
package com.gingersoft.supply_chain.mvp.model;
import android.app.Application;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.supply_chain.mvp.bean.FoodCategoryResultBean;
import com.gingersoft.supply_chain.mvp.contract.CategoryContract;
import com.gingersoft.supply_chain.mvp.server.SupplierServer;
import com.google.gson.Gson;
import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;
import java.util.Map;
import javax.inject.Inject;
import io.reactivex.Observable;
import okhttp3.RequestBody;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 11/28/2020 10:14
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@FragmentScope
public class CategoryModel extends BaseModel implements CategoryContract.Model {
@Inject
Gson mGson;
@Inject
Application mApplication;
@Inject
public CategoryModel(IRepositoryManager repositoryManager) {
super(repositoryManager);
}
@Override
public void onDestroy() {
super.onDestroy();
this.mGson = null;
this.mApplication = null;
}
@Override
public Observable<FoodCategoryResultBean> getFoodCategoryList(Map<String, Object> map) {
return mRepositoryManager.obtainRetrofitService(SupplierServer.class).getFoodCategoryList(map);
}
@Override
public Observable<BaseResult> createFoodCategory(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(SupplierServer.class).addFoodCategory(requestBody);
}
@Override
public Observable<BaseResult> updateFoodCategory(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(SupplierServer.class).updateFoodCategory(requestBody);
}
}
\ 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