Commit 73b28016 by Wyh

9.24 1.顯示是否打印PDF 2、獲取登陸人數優化

Signed-off-by: Wyh <1239658231>
parent ea884f5b
package com.gingersoft.gsa.cloud.base;
import android.content.Context;
import org.junit.Test;
import org.junit.runner.RunWith;
import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;
import static org.junit.Assert.assertEquals;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
@SmallTest
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.joe.public_base.test", appContext.getPackageName());
}
}
...@@ -156,8 +156,7 @@ class OrderDetails { ...@@ -156,8 +156,7 @@ class OrderDetails {
//1食品清单不打印 账单不打印 //1食品清单不打印 账单不打印
//2食品清单打印 账单不打印 //2食品清单打印 账单不打印
//3食品清单不打印 账单打印 //3食品清单不打印 账单打印
// var printTo: Int = 0 //var printTo: Int = 0
class ChildBean : Serializable { class ChildBean : Serializable {
/** /**
* odsId : 1654488 * odsId : 1654488
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_checkbox_checked" android:state_checked="true" />
<item android:drawable="@drawable/ic_checkbox_uncheck" />
</selector>
\ No newline at end of file
package com.gingersoft.gsa.cloud.base;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
\ No newline at end of file
...@@ -127,7 +127,7 @@ public class ColdChainMainActivity extends BaseFragmentActivity<ColdChainMainPre ...@@ -127,7 +127,7 @@ public class ColdChainMainActivity extends BaseFragmentActivity<ColdChainMainPre
@Override @Override
public int initView(@Nullable Bundle savedInstanceState) { public int initView(@Nullable Bundle savedInstanceState) {
return R.layout.activity_main; //如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0 return R.layout.frozen_chain_main; //如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
} }
@Override @Override
......
...@@ -32,6 +32,12 @@ public class OrderListAdapter extends BaseQuickAdapter<OrderList.DataBeanX.DataB ...@@ -32,6 +32,12 @@ public class OrderListAdapter extends BaseQuickAdapter<OrderList.DataBeanX.DataB
@Override @Override
protected void convert(@NotNull BaseViewHolder baseViewHolder, OrderList.DataBeanX.DataBean dataBean) { protected void convert(@NotNull BaseViewHolder baseViewHolder, OrderList.DataBeanX.DataBean dataBean) {
if (dataBean.getIsPrintPdf() == 0) {
baseViewHolder.setText(R.id.tv_logistics_order_print_state, "未打印物流單");
baseViewHolder.setGone(R.id.tv_logistics_order_print_state, false);
} else {
baseViewHolder.setGone(R.id.tv_logistics_order_print_state, true);
}
baseViewHolder.setText(R.id.tv_pay_method, dataBean.getOrderPayType() == 1 ? "貨到付款" : "在線支付"); baseViewHolder.setText(R.id.tv_pay_method, dataBean.getOrderPayType() == 1 ? "貨到付款" : "在線支付");
baseViewHolder.setText(R.id.tv_order_time, TimeUtils.parseTimeRepeat(dataBean.getCREATE_TIME(), TimeUtils.DEFAULT_DATE_FORMAT)); baseViewHolder.setText(R.id.tv_order_time, TimeUtils.parseTimeRepeat(dataBean.getCREATE_TIME(), TimeUtils.DEFAULT_DATE_FORMAT));
if (TextUtil.isEmptyOrNullOrUndefined(dataBean.getRECEIVER())) { if (TextUtil.isEmptyOrNullOrUndefined(dataBean.getRECEIVER())) {
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingTop="@dimen/dp_10"
android:paddingLeft="@dimen/dp_14" android:paddingLeft="@dimen/dp_14"
android:paddingTop="@dimen/dp_10"
android:paddingRight="@dimen/dp_14" android:paddingRight="@dimen/dp_14"
android:paddingBottom="@dimen/dp_6"> android:paddingBottom="@dimen/dp_6">
...@@ -83,16 +83,29 @@ ...@@ -83,16 +83,29 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_15" android:layout_marginTop="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_10" android:layout_marginRight="@dimen/dp_10"
android:textColor="@color/color_3c"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_order_amount" app:layout_constraintRight_toLeftOf="@id/tv_order_amount"
app:layout_constraintTop_toBottomOf="@id/tv_order_user_name" app:layout_constraintTop_toBottomOf="@id/tv_order_user_name"
app:layout_constraintVertical_bias="1" app:layout_constraintVertical_bias="1"
android:textColor="@color/color_3c"
tools:text="用戶收貨地址" tools:text="用戶收貨地址"
tools:textColor="#868686" /> tools:textColor="#868686" />
<TextView <TextView
android:id="@+id/tv_logistics_order_print_state"
style="@style/order_item_info_title_textStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_9"
android:gravity="right"
android:text="物流單已打印"
android:textColor="@color/color_3c"
app:layout_constraintLeft_toRightOf="@id/tv_pay_method"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_order_time" />
<TextView
android:id="@+id/tv_delivery_state" android:id="@+id/tv_delivery_state"
style="@style/order_item_info_title_textStyle" style="@style/order_item_info_title_textStyle"
android:layout_width="0dp" android:layout_width="0dp"
...@@ -102,7 +115,7 @@ ...@@ -102,7 +115,7 @@
android:textColor="@color/color_3c" android:textColor="@color/color_3c"
app:layout_constraintLeft_toRightOf="@id/tv_pay_method" app:layout_constraintLeft_toRightOf="@id/tv_pay_method"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_order_time" app:layout_constraintTop_toBottomOf="@id/tv_logistics_order_print_state"
tools:text="已通知物流" tools:text="已通知物流"
tools:textColor="@color/theme_333_color" /> tools:textColor="@color/theme_333_color" />
......
...@@ -161,6 +161,7 @@ ...@@ -161,6 +161,7 @@
style="@style/otherOrder_restaurant_state_style" style="@style/otherOrder_restaurant_state_style"
android:background="@drawable/shape_restaurant_state_bg" android:background="@drawable/shape_restaurant_state_bg"
android:text="營業中 " android:text="營業中 "
android:layout_marginRight="@dimen/dp_10"
app:layout_constraintBottom_toBottomOf="@id/ed_cold_chain_order_num_search" app:layout_constraintBottom_toBottomOf="@id/ed_cold_chain_order_num_search"
app:layout_constraintRight_toLeftOf="@id/cb_auto_receiving_orders" app:layout_constraintRight_toLeftOf="@id/cb_auto_receiving_orders"
app:layout_constraintTop_toTopOf="@id/ed_cold_chain_order_num_search" /> app:layout_constraintTop_toTopOf="@id/ed_cold_chain_order_num_search" />
...@@ -179,9 +180,10 @@ ...@@ -179,9 +180,10 @@
android:id="@+id/cb_auto_receiving_orders" android:id="@+id/cb_auto_receiving_orders"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:buttonTint="@color/color_a9"
android:text="自動接單" android:text="自動接單"
android:button="@drawable/selector_checkbox"
android:textColor="@color/color_a9" android:textColor="@color/color_a9"
app:layout_constraintBottom_toBottomOf="@id/tv_cold_chain_restaurant_state"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_cold_chain_restaurant_state" /> app:layout_constraintTop_toTopOf="@id/tv_cold_chain_restaurant_state" />
......
...@@ -141,7 +141,7 @@ class OrderDetailsActivity : BaseActivity() { ...@@ -141,7 +141,7 @@ class OrderDetailsActivity : BaseActivity() {
btnList.add(it) btnList.add(it)
} }
orderStatusText = "待確認" orderStatusText = "待確認"
tv_order_state.setTextColor(ContextCompat.getColor(this@OrderDetailsActivity, R.color.order_state0_color)) tv_order_state.setTextColor(getmColor(R.color.order_state0_color))
if (orderDetails.isDelete == 0) { if (orderDetails.isDelete == 0) {
btnBuilder.getLogisticsBtn()?.let { btnBuilder.getLogisticsBtn()?.let {
btnList.add(it) btnList.add(it)
...@@ -162,7 +162,7 @@ class OrderDetailsActivity : BaseActivity() { ...@@ -162,7 +162,7 @@ class OrderDetailsActivity : BaseActivity() {
btnBuilder.getProductionCompletedBtn()?.let { btnBuilder.getProductionCompletedBtn()?.let {
btnList.add(it) btnList.add(it)
} }
tv_order_state.setTextColor(ContextCompat.getColor(this@OrderDetailsActivity, R.color.order_state0_color)) tv_order_state.setTextColor(getmColor(R.color.order_state0_color))
} else { } else {
//製作中的外賣,應該有打印、取消物流、取消訂單 //製作中的外賣,應該有打印、取消物流、取消訂單
if (orderDetails.isDelete == 0) { if (orderDetails.isDelete == 0) {
...@@ -185,7 +185,7 @@ class OrderDetailsActivity : BaseActivity() { ...@@ -185,7 +185,7 @@ class OrderDetailsActivity : BaseActivity() {
btnList.add(it) btnList.add(it)
} }
} }
tv_order_state.setTextColor(resources.getColor(R.color.order_state1_color)) tv_order_state.setTextColor(getmColor(R.color.order_state1_color))
} }
orderStatusText = "製作中" orderStatusText = "製作中"
} }
...@@ -203,7 +203,7 @@ class OrderDetailsActivity : BaseActivity() { ...@@ -203,7 +203,7 @@ class OrderDetailsActivity : BaseActivity() {
btnBuilder.getClosingBtn()?.let { btnBuilder.getClosingBtn()?.let {
btnList.add(it) btnList.add(it)
} }
tv_order_state.setTextColor(ContextCompat.getColor(this@OrderDetailsActivity, R.color.order_state3_color)) tv_order_state.setTextColor(getmColor(R.color.order_state3_color))
} else { } else {
// 外賣有打印 // 外賣有打印
// 如果是第三方物流,不顯示結賬 // 如果是第三方物流,不顯示結賬
......
...@@ -125,8 +125,6 @@ public class ChooseRestaurantPresenter extends BasePresenter<ChooseRestaurantCon ...@@ -125,8 +125,6 @@ public class ChooseRestaurantPresenter extends BasePresenter<ChooseRestaurantCon
public void onError(Throwable t) { public void onError(Throwable t) {
super.onError(t); super.onError(t);
mRootView.showLoginLimit(null); mRootView.showLoginLimit(null);
// mRootView.launchActivity(new Intent(IAcitivity, LoginActivity.class));
// mRootView.jumpDownloadActivity();
} }
}); });
} }
......
...@@ -105,7 +105,7 @@ public class ChooseRestaurantActivity extends BaseActivity<ChooseRestaurantPrese ...@@ -105,7 +105,7 @@ public class ChooseRestaurantActivity extends BaseActivity<ChooseRestaurantPrese
private QMUISection<SectionHeader, SectionRestaurantItem> createSection(BrandsBean.BrandsData brandsBean) { private QMUISection<SectionHeader, SectionRestaurantItem> createSection(BrandsBean.BrandsData brandsBean) {
SectionHeader header = new SectionHeader(brandsBean.getBrandName()); SectionHeader header = new SectionHeader(brandsBean.getBrandName());
ArrayList<SectionRestaurantItem> contents = new ArrayList<>(); ArrayList<SectionRestaurantItem> contents = new ArrayList<>();
for (int i = 0; i < Objects.requireNonNull(brandsBean.getRestaurants().size()); i++) { for (int i = 0; i < brandsBean.getRestaurants().size(); i++) {
contents.add(new SectionRestaurantItem(Objects.requireNonNull(brandsBean.getRestaurants().get(i)))); contents.add(new SectionRestaurantItem(Objects.requireNonNull(brandsBean.getRestaurants().get(i))));
} }
return new QMUISection<>(header, contents, false); return new QMUISection<>(header, contents, false);
...@@ -343,6 +343,7 @@ public class ChooseRestaurantActivity extends BaseActivity<ChooseRestaurantPrese ...@@ -343,6 +343,7 @@ public class ChooseRestaurantActivity extends BaseActivity<ChooseRestaurantPrese
}).setGravity(Gravity.BOTTOM).show(); }).setGravity(Gravity.BOTTOM).show();
} else { } else {
showMessage("獲取登陸人數失敗"); showMessage("獲取登陸人數失敗");
GsaCloudApplication.logOut();
launchActivity(new Intent(mContext, LoginActivity.class)); launchActivity(new Intent(mContext, LoginActivity.class));
} }
} }
......
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