Commit 495d306d by 宁斌

1、餐牌返回餐檯為紅檯問題 2、分檯重置 3、折扣結構邏輯問題

parent 8c343e7a
...@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.base.common.bean; ...@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.base.common.bean;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication; import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.utils.MoneyUtil; import com.gingersoft.gsa.cloud.base.utils.MoneyUtil;
import com.gingersoft.gsa.cloud.constans.ExpandConstant;
import com.gingersoft.gsa.cloud.database.bean.ExpandInfo; import com.gingersoft.gsa.cloud.database.bean.ExpandInfo;
import java.util.List; import java.util.List;
...@@ -23,16 +24,16 @@ public class RestaurantExpandInfoUtils { ...@@ -23,16 +24,16 @@ public class RestaurantExpandInfoUtils {
*/ */
public static void setCommonExpandInfo(List<ExpandInfo> expandInfoList) { public static void setCommonExpandInfo(List<ExpandInfo> expandInfoList) {
for (ExpandInfo expandInfo : expandInfoList) { for (ExpandInfo expandInfo : expandInfoList) {
if (expandInfo.getSettingName().equals("Rounding")) { if (expandInfo.getSettingName().equals(ExpandConstant.Rounding)) {
MoneyUtil.rounding = expandInfo.getValueInt(); MoneyUtil.rounding = expandInfo.getValueInt();
} }
if (expandInfo.getSettingName().equals("RoundingDecimal")) { if (expandInfo.getSettingName().equals(ExpandConstant.RoundingDecimal)) {
MoneyUtil.RoundingDecimal = expandInfo.getValueInt(); MoneyUtil.RoundingDecimal = expandInfo.getValueInt();
} }
if (expandInfo.getSettingName().equals("ItemDecimals")) { if (expandInfo.getSettingName().equals(ExpandConstant.ItemDecimals)) {
MoneyUtil.ItemDecimals = expandInfo.getValueInt(); MoneyUtil.ItemDecimals = expandInfo.getValueInt();
} }
if (expandInfo.getSettingName().equals("MergeSendFood")) { if (expandInfo.getSettingName().equals(ExpandConstant.MergeSendFood)) {
GsaCloudApplication.androidSetting.setMergeSendFood(Boolean.parseBoolean(expandInfo.getValueChar())); GsaCloudApplication.androidSetting.setMergeSendFood(Boolean.parseBoolean(expandInfo.getValueChar()));
} }
......
...@@ -4,4 +4,13 @@ public class ExpandConstant { ...@@ -4,4 +4,13 @@ public class ExpandConstant {
public final static String DeliveryPrintCount = "DeliveryPrintCount"; public final static String DeliveryPrintCount = "DeliveryPrintCount";
public final static String Rounding = "Rounding";
public final static String RoundingDecimal = "RoundingDecimal";
public final static String ItemDecimals = "ItemDecimals";
public final static String MergeSendFood = "MergeSendFood";
} }
...@@ -37,7 +37,7 @@ public class Discount { ...@@ -37,7 +37,7 @@ public class Discount {
/**类型#0:金额;1:折扣;*/ /**类型#0:金额;1:折扣;*/
private int type; private int type;
/**折扣可使用范围#0:食品;1:账单;*/ /**折扣可使用范围#0:食品;1:账单;*/
private String discount_type; private String discountType ;
/**状态#0:启用;1:禁用;*/ /**状态#0:启用;1:禁用;*/
private int status; private int status;
/**折扣描述*/ /**折扣描述*/
...@@ -50,16 +50,22 @@ public class Discount { ...@@ -50,16 +50,22 @@ public class Discount {
@Generated(hash = 650388607)
@Generated(hash = 901376651)
public Discount(Long id, int restaurant_id, double amount, double discount_value, public Discount(Long id, int restaurant_id, double amount, double discount_value,
int type, String discount_type, int status, String remark, String begin_time, int type, String discountType, int status, String remark, String begin_time,
String end_time) { String end_time) {
this.id = id; this.id = id;
this.restaurant_id = restaurant_id; this.restaurant_id = restaurant_id;
this.amount = amount; this.amount = amount;
this.discount_value = discount_value; this.discount_value = discount_value;
this.type = type; this.type = type;
this.discount_type = discount_type; this.discountType = discountType;
this.status = status; this.status = status;
this.remark = remark; this.remark = remark;
this.begin_time = begin_time; this.begin_time = begin_time;
...@@ -80,6 +86,12 @@ public class Discount { ...@@ -80,6 +86,12 @@ public class Discount {
/** /**
* 計算折扣金額 * 計算折扣金額
* @param discount * @param discount
...@@ -200,24 +212,6 @@ public class Discount { ...@@ -200,24 +212,6 @@ public class Discount {
public String getDiscount_type() {
return this.discount_type;
}
public void setDiscount_type(String discount_type) {
this.discount_type = discount_type;
}
public int getStatus() { public int getStatus() {
return this.status; return this.status;
} }
...@@ -288,4 +282,22 @@ public class Discount { ...@@ -288,4 +282,22 @@ public class Discount {
public String getDiscountType() {
return this.discountType;
}
public void setDiscountType(String discountType) {
this.discountType = discountType;
}
} }
...@@ -29,7 +29,7 @@ public class DiscountDao extends AbstractDao<Discount, Long> { ...@@ -29,7 +29,7 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
public final static Property Amount = new Property(2, double.class, "amount", false, "AMOUNT"); public final static Property Amount = new Property(2, double.class, "amount", false, "AMOUNT");
public final static Property Discount_value = new Property(3, double.class, "discount_value", false, "DISCOUNT_VALUE"); public final static Property Discount_value = new Property(3, double.class, "discount_value", false, "DISCOUNT_VALUE");
public final static Property Type = new Property(4, int.class, "type", false, "TYPE"); public final static Property Type = new Property(4, int.class, "type", false, "TYPE");
public final static Property Discount_type = new Property(5, String.class, "discount_type", false, "DISCOUNT_TYPE"); public final static Property DiscountType = new Property(5, String.class, "discountType", false, "DISCOUNT_TYPE");
public final static Property Status = new Property(6, int.class, "status", false, "STATUS"); public final static Property Status = new Property(6, int.class, "status", false, "STATUS");
public final static Property Remark = new Property(7, String.class, "remark", false, "REMARK"); public final static Property Remark = new Property(7, String.class, "remark", false, "REMARK");
public final static Property Begin_time = new Property(8, String.class, "begin_time", false, "BEGIN_TIME"); public final static Property Begin_time = new Property(8, String.class, "begin_time", false, "BEGIN_TIME");
...@@ -54,7 +54,7 @@ public class DiscountDao extends AbstractDao<Discount, Long> { ...@@ -54,7 +54,7 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
"\"AMOUNT\" REAL NOT NULL ," + // 2: amount "\"AMOUNT\" REAL NOT NULL ," + // 2: amount
"\"DISCOUNT_VALUE\" REAL NOT NULL ," + // 3: discount_value "\"DISCOUNT_VALUE\" REAL NOT NULL ," + // 3: discount_value
"\"TYPE\" INTEGER NOT NULL ," + // 4: type "\"TYPE\" INTEGER NOT NULL ," + // 4: type
"\"DISCOUNT_TYPE\" TEXT," + // 5: discount_type "\"DISCOUNT_TYPE\" TEXT," + // 5: discountType
"\"STATUS\" INTEGER NOT NULL ," + // 6: status "\"STATUS\" INTEGER NOT NULL ," + // 6: status
"\"REMARK\" TEXT," + // 7: remark "\"REMARK\" TEXT," + // 7: remark
"\"BEGIN_TIME\" TEXT," + // 8: begin_time "\"BEGIN_TIME\" TEXT," + // 8: begin_time
...@@ -80,9 +80,9 @@ public class DiscountDao extends AbstractDao<Discount, Long> { ...@@ -80,9 +80,9 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
stmt.bindDouble(4, entity.getDiscount_value()); stmt.bindDouble(4, entity.getDiscount_value());
stmt.bindLong(5, entity.getType()); stmt.bindLong(5, entity.getType());
String discount_type = entity.getDiscount_type(); String discountType = entity.getDiscountType();
if (discount_type != null) { if (discountType != null) {
stmt.bindString(6, discount_type); stmt.bindString(6, discountType);
} }
stmt.bindLong(7, entity.getStatus()); stmt.bindLong(7, entity.getStatus());
...@@ -115,9 +115,9 @@ public class DiscountDao extends AbstractDao<Discount, Long> { ...@@ -115,9 +115,9 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
stmt.bindDouble(4, entity.getDiscount_value()); stmt.bindDouble(4, entity.getDiscount_value());
stmt.bindLong(5, entity.getType()); stmt.bindLong(5, entity.getType());
String discount_type = entity.getDiscount_type(); String discountType = entity.getDiscountType();
if (discount_type != null) { if (discountType != null) {
stmt.bindString(6, discount_type); stmt.bindString(6, discountType);
} }
stmt.bindLong(7, entity.getStatus()); stmt.bindLong(7, entity.getStatus());
...@@ -150,7 +150,7 @@ public class DiscountDao extends AbstractDao<Discount, Long> { ...@@ -150,7 +150,7 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
cursor.getDouble(offset + 2), // amount cursor.getDouble(offset + 2), // amount
cursor.getDouble(offset + 3), // discount_value cursor.getDouble(offset + 3), // discount_value
cursor.getInt(offset + 4), // type cursor.getInt(offset + 4), // type
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // discount_type cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // discountType
cursor.getInt(offset + 6), // status cursor.getInt(offset + 6), // status
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // remark cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // remark
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // begin_time cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // begin_time
...@@ -166,7 +166,7 @@ public class DiscountDao extends AbstractDao<Discount, Long> { ...@@ -166,7 +166,7 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
entity.setAmount(cursor.getDouble(offset + 2)); entity.setAmount(cursor.getDouble(offset + 2));
entity.setDiscount_value(cursor.getDouble(offset + 3)); entity.setDiscount_value(cursor.getDouble(offset + 3));
entity.setType(cursor.getInt(offset + 4)); entity.setType(cursor.getInt(offset + 4));
entity.setDiscount_type(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); entity.setDiscountType(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setStatus(cursor.getInt(offset + 6)); entity.setStatus(cursor.getInt(offset + 6));
entity.setRemark(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); entity.setRemark(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setBegin_time(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); entity.setBegin_time(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
......
...@@ -162,7 +162,7 @@ public class DiscountDaoUtils { ...@@ -162,7 +162,7 @@ public class DiscountDaoUtils {
// DiscountDao.Properties.Status.eq(0), // DiscountDao.Properties.Status.eq(0),
// DiscountDao.Properties.Begin_time.le(currentTime), // DiscountDao.Properties.Begin_time.le(currentTime),
// DiscountDao.Properties.End_time.ge(currentTime))).list(); // DiscountDao.Properties.End_time.ge(currentTime))).list();
return queryBuilder.where(DiscountDao.Properties.Discount_type.like(discountType)).list(); return queryBuilder.where(DiscountDao.Properties.DiscountType.like(discountType)).list();
} }
} }
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
<color name="table_send">#FF249B65</color> <color name="table_send">#FF249B65</color>
<color name="table_print">#FFE5AC00</color> <color name="table_print">#FFE5AC00</color>
<color name="table_use">#FFD14141</color> <color name="table_use">#FFD14141</color>
<color name="table_split">#31BDF3</color>
<color name="pay_load_success">#03a44e</color> <color name="pay_load_success">#03a44e</color>
<color name="pay_load_failure">#de0e26</color> <color name="pay_load_failure">#de0e26</color>
......
...@@ -168,7 +168,7 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen ...@@ -168,7 +168,7 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
initRecycleScrollListener(); initRecycleScrollListener();
mActivity.queryAreas(null); mActivity.queryAreas(null);
mActivity.queryTables(null); mActivity.queryTables(null);
mActivity.initGetTableTimer(); // mActivity.initGetTableTimer();
cb_all_select.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { cb_all_select.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
...@@ -188,14 +188,14 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen ...@@ -188,14 +188,14 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
super.onResume(); super.onResume();
hideSoftInput(); hideSoftInput();
//開始刷新餐檯數據 //開始刷新餐檯數據
mActivity.onStartRefreshTableData(); // mActivity.onStartRefreshTableData();
} }
@Override @Override
public void onPause() { public void onPause() {
super.onPause(); super.onPause();
//停止刷新餐檯數據 //停止刷新餐檯數據
mActivity.onPauseRefreshTableData(); // mActivity.onPauseRefreshTableData();
} }
@Override @Override
......
...@@ -15,12 +15,14 @@ public interface TableOperatTypeConstant { ...@@ -15,12 +15,14 @@ public interface TableOperatTypeConstant {
* 2#已使用 * 2#已使用
* 3#已送單 * 3#已送單
* 4#已印單 * 4#已印單
* 5#已分檯
*/ */
int table_status_0 = 0; int table_status_0 = 0;
int table_status_1 = 1; int table_status_1 = 1;
int table_status_2 = 2; int table_status_2 = 2;
int table_status_3 = 3; int table_status_3 = 3;
int table_status_4 = 4; int table_status_4 = 4;
int table_status_5 = 5;
/** /**
* 1#分台 * 1#分台
......
...@@ -201,6 +201,13 @@ public class AllTablePresenter extends BasePresenter<AllTableContract.Model, All ...@@ -201,6 +201,13 @@ public class AllTablePresenter extends BasePresenter<AllTableContract.Model, All
} }
} }
break; break;
case TableOperatTypeConstant.table_status_5:
for (int i = 0; i < datasBeans.size(); i++) {
if (datasBeans.get(i).getStatus() == 4 && datasBeans.get(i).getUseStatus() == 0) {
mTableList.add(datasBeans.get(i));
}
}
break;
default: default:
mTableList.addAll(datasBeans); mTableList.addAll(datasBeans);
break; break;
......
...@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.table.mvp.presenter; ...@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.table.mvp.presenter;
import android.app.Activity; import android.app.Activity;
import android.app.Application; import android.app.Application;
import android.text.TextUtils;
import android.widget.TextView; import android.widget.TextView;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication; import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
...@@ -948,7 +949,7 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas ...@@ -948,7 +949,7 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
if (canMerge) { if (canMerge) {
//合并数量 //合并数量
mergeNum += mergeFood.getNumber(); mergeNum += mergeFood.getNumber();
if(!removeIndexs.contains(mergeFood.getMyIndex())){ if (!removeIndexs.contains(mergeFood.getMyIndex())) {
//添加所需移除已合并的食品 //添加所需移除已合并的食品
removeIndexs.add(mergeFood.getMyIndex()); removeIndexs.add(mergeFood.getMyIndex());
} }
...@@ -959,7 +960,7 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas ...@@ -959,7 +960,7 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
for (int i = removeIndexs.size() - 1; i >= 0; i--) { for (int i = removeIndexs.size() - 1; i >= 0; i--) {
for (int j = foodList.size() - 1; j >= 0; j--) { for (int j = foodList.size() - 1; j >= 0; j--) {
if(removeIndexs.get(i) == foodList.get(j).getMyIndex()){ if (removeIndexs.get(i) == foodList.get(j).getMyIndex()) {
foodList.remove(j); foodList.remove(j);
break; break;
} }
...@@ -969,13 +970,14 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas ...@@ -969,13 +970,14 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
/** /**
* 过滤折扣类型 * 过滤折扣类型
*
* @param discountList * @param discountList
* @return * @return
*/ */
protected List<Discount> filterDiscountByType(List<Discount> discountList,String discountType) { protected List<Discount> filterDiscountByType(List<Discount> discountList, String discountType) {
for (int i = discountList.size() - 1; i >= 0; i--) { for (int i = discountList.size() - 1; i >= 0; i--) {
Discount discount = discountList.get(i); Discount discount = discountList.get(i);
if (!discount.getDiscount_type().contains(discountType)) { if (TextUtils.isEmpty(discount.getDiscountType()) || !discount.getDiscountType().contains(discountType)) {
discountList.remove(i); discountList.remove(i);
} }
} }
......
...@@ -189,6 +189,13 @@ public class StateTablePresenter extends BasePresenter<StateTableContract.Model, ...@@ -189,6 +189,13 @@ public class StateTablePresenter extends BasePresenter<StateTableContract.Model,
} }
} }
break; break;
case TableOperatTypeConstant.table_status_5:
for (int i = 0; i < datasBeans.size(); i++) {
if (datasBeans.get(i).getStatus() == 4 && datasBeans.get(i).getUseStatus() == 0) {
mTableList.add(datasBeans.get(i));
}
}
break;
// case 4: // case 4:
// for (int i = 0; i < datasBeans.size(); i++) { // for (int i = 0; i < datasBeans.size(); i++) {
// if (datasBeans.get(i).getStatus() == 2 && datasBeans.get(i).getStatus() != 1) { // if (datasBeans.get(i).getStatus() == 2 && datasBeans.get(i).getStatus() != 1) {
......
...@@ -608,6 +608,7 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen ...@@ -608,6 +608,7 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
"已使用", "已使用",
"已開檯", "已開檯",
"已印單", "已印單",
"已分檯",
}; };
int[] statusIconList = new int[]{ int[] statusIconList = new int[]{
R.drawable.table_shape_status_all, R.drawable.table_shape_status_all,
...@@ -615,6 +616,7 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen ...@@ -615,6 +616,7 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
R.drawable.table_shape_status_used, R.drawable.table_shape_status_used,
R.drawable.table_shape_status_send, R.drawable.table_shape_status_send,
R.drawable.table_shape_status_print, R.drawable.table_shape_status_print,
R.drawable.table_shape_status_split,
}; };
for (int i = 0; i < statusTextList.length; i++) { for (int i = 0; i < statusTextList.length; i++) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/table_split"/>
</shape>
\ 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