Commit c18e0afb by 宁斌

设置食品颜色

parent 1f6e49aa
......@@ -198,6 +198,7 @@ public class OrderCenterAdapter extends DefaultAdapter<OrderManagerResponse> {
} else {
ll_pos_bottom.setVisibility(View.GONE);
}
cb_order.setChecked(item.isChecked());
}
int orderType = item.getOrderType();
if (orderType == OrderTypeConstans.order_type_2 || orderType == OrderTypeConstans.order_type_7) {
......@@ -258,7 +259,7 @@ public class OrderCenterAdapter extends DefaultAdapter<OrderManagerResponse> {
OrderManagerResponse item = mInfos.get(i);
item.setChecked(false);
}
mInfos.get(position).setChecked(isChecked);
item.setChecked(isChecked);
notifyDataSetChanged();
}
});
......
......@@ -52,7 +52,7 @@
android:layout_weight="1"
android:divider="@null"
app:spanCount="1"
app:layoutManager="com.gingersoft.gsa.cloud.ui.view.RecyclerViewNoBugLinearLayoutManager" />
app:layoutManager="com.gingersoft.gsa.cloud.ui.recylcler.RecyclerViewNoBugLinearLayoutManager" />
<!-- </LinearLayout>-->
</LinearLayout>
......
......@@ -5,6 +5,7 @@ import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.ToOne;
import org.greenrobot.greendao.annotation.Transient;
import java.util.Date;
......@@ -246,10 +247,6 @@ public class Food {
*/
private byte serviceCharge;
/**
* 顏色ID
*/
private long colorId;
/**
* 0:新增;1:修改;2:刪除
*/
private long conditions;
......@@ -287,6 +284,13 @@ public class Food {
* 是否參與會員喜好統計 0 參與 1 不參與
*/
private long isStatistic;
/**
* 顏色ID
*/
private long colorId;
@Transient
@ToOne(joinProperty = "colorId") //这个是注解绑定 hid就是上面一行的colorId
private ColorBean colorBean;
/**
* 自定義字段
......@@ -301,6 +305,14 @@ public class Food {
/**背景顏色*/
@Transient
private int bgColor = Color.parseColor("#03a9f4");
@Transient
private String colorStart;
@Transient
private String colorStop;
@Transient
private String androidColor;
@Transient
private String androidFontColor;
/**字體顏色*/
@Transient
private int fontColor = Color.parseColor("#FFFFFF");
......@@ -317,7 +329,11 @@ public class Food {
@Transient
private boolean isComboFood = false;
@Generated(hash = 1680701141)
@Generated(hash = 60268763)
public Food(Long id, long parentId, long restaurantId, byte isParent,
long seqNo, String foodName, String foodName1, String foodName2,
String plu, String posFid, String foodDesc, long limitAmount,
......@@ -332,10 +348,10 @@ public class Food {
long advPrice, long printToBill, double pointsAdd, long pointsRatio,
double pointsRedeem, long ktPrintMainItem, long ktShowPrice,
long printTo, long toPax, long foodType, long majorMainId, long deptId,
byte serviceCharge, long colorId, long conditions, long isRt,
long deletes, long isTimingFood, long minLongTime, long unitTime,
double unitPrice, long freeLongTime, Date freePeriodBegin,
long isStatistic) {
byte serviceCharge, long conditions, long isRt, long deletes,
long isTimingFood, long minLongTime, long unitTime, double unitPrice,
long freeLongTime, Date freePeriodBegin, long isStatistic,
long colorId) {
this.id = id;
this.parentId = parentId;
this.restaurantId = restaurantId;
......@@ -392,7 +408,6 @@ public class Food {
this.majorMainId = majorMainId;
this.deptId = deptId;
this.serviceCharge = serviceCharge;
this.colorId = colorId;
this.conditions = conditions;
this.isRt = isRt;
this.deletes = deletes;
......@@ -403,6 +418,7 @@ public class Food {
this.freeLongTime = freeLongTime;
this.freePeriodBegin = freePeriodBegin;
this.isStatistic = isStatistic;
this.colorId = colorId;
}
@Generated(hash = 866324199)
......@@ -412,6 +428,7 @@ public class Food {
public Long getId() {
return id;
}
......
......@@ -80,17 +80,17 @@ public class FoodDao extends AbstractDao<Food, Long> {
public final static Property MajorMainId = new Property(53, long.class, "majorMainId", false, "MAJOR_MAIN_ID");
public final static Property DeptId = new Property(54, long.class, "deptId", false, "DEPT_ID");
public final static Property ServiceCharge = new Property(55, byte.class, "serviceCharge", false, "SERVICE_CHARGE");
public final static Property ColorId = new Property(56, long.class, "colorId", false, "COLOR_ID");
public final static Property Conditions = new Property(57, long.class, "conditions", false, "CONDITIONS");
public final static Property IsRt = new Property(58, long.class, "isRt", false, "IS_RT");
public final static Property Deletes = new Property(59, long.class, "deletes", false, "DELETES");
public final static Property IsTimingFood = new Property(60, long.class, "isTimingFood", false, "IS_TIMING_FOOD");
public final static Property MinLongTime = new Property(61, long.class, "minLongTime", false, "MIN_LONG_TIME");
public final static Property UnitTime = new Property(62, long.class, "unitTime", false, "UNIT_TIME");
public final static Property UnitPrice = new Property(63, double.class, "unitPrice", false, "UNIT_PRICE");
public final static Property FreeLongTime = new Property(64, long.class, "freeLongTime", false, "FREE_LONG_TIME");
public final static Property FreePeriodBegin = new Property(65, java.util.Date.class, "freePeriodBegin", false, "FREE_PERIOD_BEGIN");
public final static Property IsStatistic = new Property(66, long.class, "isStatistic", false, "IS_STATISTIC");
public final static Property Conditions = new Property(56, long.class, "conditions", false, "CONDITIONS");
public final static Property IsRt = new Property(57, long.class, "isRt", false, "IS_RT");
public final static Property Deletes = new Property(58, long.class, "deletes", false, "DELETES");
public final static Property IsTimingFood = new Property(59, long.class, "isTimingFood", false, "IS_TIMING_FOOD");
public final static Property MinLongTime = new Property(60, long.class, "minLongTime", false, "MIN_LONG_TIME");
public final static Property UnitTime = new Property(61, long.class, "unitTime", false, "UNIT_TIME");
public final static Property UnitPrice = new Property(62, double.class, "unitPrice", false, "UNIT_PRICE");
public final static Property FreeLongTime = new Property(63, long.class, "freeLongTime", false, "FREE_LONG_TIME");
public final static Property FreePeriodBegin = new Property(64, java.util.Date.class, "freePeriodBegin", false, "FREE_PERIOD_BEGIN");
public final static Property IsStatistic = new Property(65, long.class, "isStatistic", false, "IS_STATISTIC");
public final static Property ColorId = new Property(66, long.class, "colorId", false, "COLOR_ID");
}
......@@ -162,17 +162,17 @@ public class FoodDao extends AbstractDao<Food, Long> {
"\"MAJOR_MAIN_ID\" INTEGER NOT NULL ," + // 53: majorMainId
"\"DEPT_ID\" INTEGER NOT NULL ," + // 54: deptId
"\"SERVICE_CHARGE\" INTEGER NOT NULL ," + // 55: serviceCharge
"\"COLOR_ID\" INTEGER NOT NULL ," + // 56: colorId
"\"CONDITIONS\" INTEGER NOT NULL ," + // 57: conditions
"\"IS_RT\" INTEGER NOT NULL ," + // 58: isRt
"\"DELETES\" INTEGER NOT NULL ," + // 59: deletes
"\"IS_TIMING_FOOD\" INTEGER NOT NULL ," + // 60: isTimingFood
"\"MIN_LONG_TIME\" INTEGER NOT NULL ," + // 61: minLongTime
"\"UNIT_TIME\" INTEGER NOT NULL ," + // 62: unitTime
"\"UNIT_PRICE\" REAL NOT NULL ," + // 63: unitPrice
"\"FREE_LONG_TIME\" INTEGER NOT NULL ," + // 64: freeLongTime
"\"FREE_PERIOD_BEGIN\" INTEGER," + // 65: freePeriodBegin
"\"IS_STATISTIC\" INTEGER NOT NULL );"); // 66: isStatistic
"\"CONDITIONS\" INTEGER NOT NULL ," + // 56: conditions
"\"IS_RT\" INTEGER NOT NULL ," + // 57: isRt
"\"DELETES\" INTEGER NOT NULL ," + // 58: deletes
"\"IS_TIMING_FOOD\" INTEGER NOT NULL ," + // 59: isTimingFood
"\"MIN_LONG_TIME\" INTEGER NOT NULL ," + // 60: minLongTime
"\"UNIT_TIME\" INTEGER NOT NULL ," + // 61: unitTime
"\"UNIT_PRICE\" REAL NOT NULL ," + // 62: unitPrice
"\"FREE_LONG_TIME\" INTEGER NOT NULL ," + // 63: freeLongTime
"\"FREE_PERIOD_BEGIN\" INTEGER," + // 64: freePeriodBegin
"\"IS_STATISTIC\" INTEGER NOT NULL ," + // 65: isStatistic
"\"COLOR_ID\" INTEGER NOT NULL );"); // 66: colorId
}
/** Drops the underlying database table. */
......@@ -308,21 +308,21 @@ public class FoodDao extends AbstractDao<Food, Long> {
stmt.bindLong(54, entity.getMajorMainId());
stmt.bindLong(55, entity.getDeptId());
stmt.bindLong(56, entity.getServiceCharge());
stmt.bindLong(57, entity.getColorId());
stmt.bindLong(58, entity.getConditions());
stmt.bindLong(59, entity.getIsRt());
stmt.bindLong(60, entity.getDeletes());
stmt.bindLong(61, entity.getIsTimingFood());
stmt.bindLong(62, entity.getMinLongTime());
stmt.bindLong(63, entity.getUnitTime());
stmt.bindDouble(64, entity.getUnitPrice());
stmt.bindLong(65, entity.getFreeLongTime());
stmt.bindLong(57, entity.getConditions());
stmt.bindLong(58, entity.getIsRt());
stmt.bindLong(59, entity.getDeletes());
stmt.bindLong(60, entity.getIsTimingFood());
stmt.bindLong(61, entity.getMinLongTime());
stmt.bindLong(62, entity.getUnitTime());
stmt.bindDouble(63, entity.getUnitPrice());
stmt.bindLong(64, entity.getFreeLongTime());
java.util.Date freePeriodBegin = entity.getFreePeriodBegin();
if (freePeriodBegin != null) {
stmt.bindLong(66, freePeriodBegin.getTime());
stmt.bindLong(65, freePeriodBegin.getTime());
}
stmt.bindLong(67, entity.getIsStatistic());
stmt.bindLong(66, entity.getIsStatistic());
stmt.bindLong(67, entity.getColorId());
}
@Override
......@@ -452,21 +452,21 @@ public class FoodDao extends AbstractDao<Food, Long> {
stmt.bindLong(54, entity.getMajorMainId());
stmt.bindLong(55, entity.getDeptId());
stmt.bindLong(56, entity.getServiceCharge());
stmt.bindLong(57, entity.getColorId());
stmt.bindLong(58, entity.getConditions());
stmt.bindLong(59, entity.getIsRt());
stmt.bindLong(60, entity.getDeletes());
stmt.bindLong(61, entity.getIsTimingFood());
stmt.bindLong(62, entity.getMinLongTime());
stmt.bindLong(63, entity.getUnitTime());
stmt.bindDouble(64, entity.getUnitPrice());
stmt.bindLong(65, entity.getFreeLongTime());
stmt.bindLong(57, entity.getConditions());
stmt.bindLong(58, entity.getIsRt());
stmt.bindLong(59, entity.getDeletes());
stmt.bindLong(60, entity.getIsTimingFood());
stmt.bindLong(61, entity.getMinLongTime());
stmt.bindLong(62, entity.getUnitTime());
stmt.bindDouble(63, entity.getUnitPrice());
stmt.bindLong(64, entity.getFreeLongTime());
java.util.Date freePeriodBegin = entity.getFreePeriodBegin();
if (freePeriodBegin != null) {
stmt.bindLong(66, freePeriodBegin.getTime());
stmt.bindLong(65, freePeriodBegin.getTime());
}
stmt.bindLong(67, entity.getIsStatistic());
stmt.bindLong(66, entity.getIsStatistic());
stmt.bindLong(67, entity.getColorId());
}
@Override
......@@ -533,17 +533,17 @@ public class FoodDao extends AbstractDao<Food, Long> {
cursor.getLong(offset + 53), // majorMainId
cursor.getLong(offset + 54), // deptId
(byte) cursor.getShort(offset + 55), // serviceCharge
cursor.getLong(offset + 56), // colorId
cursor.getLong(offset + 57), // conditions
cursor.getLong(offset + 58), // isRt
cursor.getLong(offset + 59), // deletes
cursor.getLong(offset + 60), // isTimingFood
cursor.getLong(offset + 61), // minLongTime
cursor.getLong(offset + 62), // unitTime
cursor.getDouble(offset + 63), // unitPrice
cursor.getLong(offset + 64), // freeLongTime
cursor.isNull(offset + 65) ? null : new java.util.Date(cursor.getLong(offset + 65)), // freePeriodBegin
cursor.getLong(offset + 66) // isStatistic
cursor.getLong(offset + 56), // conditions
cursor.getLong(offset + 57), // isRt
cursor.getLong(offset + 58), // deletes
cursor.getLong(offset + 59), // isTimingFood
cursor.getLong(offset + 60), // minLongTime
cursor.getLong(offset + 61), // unitTime
cursor.getDouble(offset + 62), // unitPrice
cursor.getLong(offset + 63), // freeLongTime
cursor.isNull(offset + 64) ? null : new java.util.Date(cursor.getLong(offset + 64)), // freePeriodBegin
cursor.getLong(offset + 65), // isStatistic
cursor.getLong(offset + 66) // colorId
);
return entity;
}
......@@ -606,17 +606,17 @@ public class FoodDao extends AbstractDao<Food, Long> {
entity.setMajorMainId(cursor.getLong(offset + 53));
entity.setDeptId(cursor.getLong(offset + 54));
entity.setServiceCharge((byte) cursor.getShort(offset + 55));
entity.setColorId(cursor.getLong(offset + 56));
entity.setConditions(cursor.getLong(offset + 57));
entity.setIsRt(cursor.getLong(offset + 58));
entity.setDeletes(cursor.getLong(offset + 59));
entity.setIsTimingFood(cursor.getLong(offset + 60));
entity.setMinLongTime(cursor.getLong(offset + 61));
entity.setUnitTime(cursor.getLong(offset + 62));
entity.setUnitPrice(cursor.getDouble(offset + 63));
entity.setFreeLongTime(cursor.getLong(offset + 64));
entity.setFreePeriodBegin(cursor.isNull(offset + 65) ? null : new java.util.Date(cursor.getLong(offset + 65)));
entity.setIsStatistic(cursor.getLong(offset + 66));
entity.setConditions(cursor.getLong(offset + 56));
entity.setIsRt(cursor.getLong(offset + 57));
entity.setDeletes(cursor.getLong(offset + 58));
entity.setIsTimingFood(cursor.getLong(offset + 59));
entity.setMinLongTime(cursor.getLong(offset + 60));
entity.setUnitTime(cursor.getLong(offset + 61));
entity.setUnitPrice(cursor.getDouble(offset + 62));
entity.setFreeLongTime(cursor.getLong(offset + 63));
entity.setFreePeriodBegin(cursor.isNull(offset + 64) ? null : new java.util.Date(cursor.getLong(offset + 64)));
entity.setIsStatistic(cursor.getLong(offset + 65));
entity.setColorId(cursor.getLong(offset + 66));
}
@Override
......
......@@ -4,7 +4,9 @@ import android.content.Context;
import android.util.Log;
import com.gingersoft.gsa.cloud.database.DaoManager;
import com.gingersoft.gsa.cloud.database.bean.ColorBean;
import com.gingersoft.gsa.cloud.database.bean.Food;
import com.gingersoft.gsa.cloud.database.greendao.ColorBeanDao;
import com.gingersoft.gsa.cloud.database.greendao.FoodDao;
import org.greenrobot.greendao.query.QueryBuilder;
......@@ -161,10 +163,12 @@ public class FoodDaoUtils {
public List<Food> queryFoodGroupByQueryBuilder() {
QueryBuilder<Food> queryBuilder = mManager.getDaoSession().queryBuilder(Food.class);
long currentTime = System.currentTimeMillis();
return queryBuilder.where(queryBuilder.and(
queryBuilder.where(queryBuilder.and(
FoodDao.Properties.ParentId.eq(0),
FoodDao.Properties.StartDate.le(currentTime),
FoodDao.Properties.EndDate.ge(currentTime))).orderAsc(FoodDao.Properties.SeqNo).list();
FoodDao.Properties.EndDate.ge(currentTime)))
.join(ColorBean.class, ColorBeanDao.Properties.ColorId);
return queryBuilder.orderAsc(FoodDao.Properties.SeqNo).list();
}
/**
......
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