Commit c18e0afb by 宁斌

设置食品颜色

parent 1f6e49aa
...@@ -198,6 +198,7 @@ public class OrderCenterAdapter extends DefaultAdapter<OrderManagerResponse> { ...@@ -198,6 +198,7 @@ public class OrderCenterAdapter extends DefaultAdapter<OrderManagerResponse> {
} else { } else {
ll_pos_bottom.setVisibility(View.GONE); ll_pos_bottom.setVisibility(View.GONE);
} }
cb_order.setChecked(item.isChecked());
} }
int orderType = item.getOrderType(); int orderType = item.getOrderType();
if (orderType == OrderTypeConstans.order_type_2 || orderType == OrderTypeConstans.order_type_7) { if (orderType == OrderTypeConstans.order_type_2 || orderType == OrderTypeConstans.order_type_7) {
...@@ -258,7 +259,7 @@ public class OrderCenterAdapter extends DefaultAdapter<OrderManagerResponse> { ...@@ -258,7 +259,7 @@ public class OrderCenterAdapter extends DefaultAdapter<OrderManagerResponse> {
OrderManagerResponse item = mInfos.get(i); OrderManagerResponse item = mInfos.get(i);
item.setChecked(false); item.setChecked(false);
} }
mInfos.get(position).setChecked(isChecked); item.setChecked(isChecked);
notifyDataSetChanged(); notifyDataSetChanged();
} }
}); });
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
android:layout_weight="1" android:layout_weight="1"
android:divider="@null" android:divider="@null"
app:spanCount="1" app:spanCount="1"
app:layoutManager="com.gingersoft.gsa.cloud.ui.view.RecyclerViewNoBugLinearLayoutManager" /> app:layoutManager="com.gingersoft.gsa.cloud.ui.recylcler.RecyclerViewNoBugLinearLayoutManager" />
<!-- </LinearLayout>--> <!-- </LinearLayout>-->
</LinearLayout> </LinearLayout>
......
...@@ -5,6 +5,7 @@ import org.greenrobot.greendao.annotation.Entity; ...@@ -5,6 +5,7 @@ import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated; import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id; import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property; import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.ToOne;
import org.greenrobot.greendao.annotation.Transient; import org.greenrobot.greendao.annotation.Transient;
import java.util.Date; import java.util.Date;
...@@ -246,10 +247,6 @@ public class Food { ...@@ -246,10 +247,6 @@ public class Food {
*/ */
private byte serviceCharge; private byte serviceCharge;
/** /**
* 顏色ID
*/
private long colorId;
/**
* 0:新增;1:修改;2:刪除 * 0:新增;1:修改;2:刪除
*/ */
private long conditions; private long conditions;
...@@ -287,6 +284,13 @@ public class Food { ...@@ -287,6 +284,13 @@ public class Food {
* 是否參與會員喜好統計 0 參與 1 不參與 * 是否參與會員喜好統計 0 參與 1 不參與
*/ */
private long isStatistic; private long isStatistic;
/**
* 顏色ID
*/
private long colorId;
@Transient
@ToOne(joinProperty = "colorId") //这个是注解绑定 hid就是上面一行的colorId
private ColorBean colorBean;
/** /**
* 自定義字段 * 自定義字段
...@@ -301,6 +305,14 @@ public class Food { ...@@ -301,6 +305,14 @@ public class Food {
/**背景顏色*/ /**背景顏色*/
@Transient @Transient
private int bgColor = Color.parseColor("#03a9f4"); private int bgColor = Color.parseColor("#03a9f4");
@Transient
private String colorStart;
@Transient
private String colorStop;
@Transient
private String androidColor;
@Transient
private String androidFontColor;
/**字體顏色*/ /**字體顏色*/
@Transient @Transient
private int fontColor = Color.parseColor("#FFFFFF"); private int fontColor = Color.parseColor("#FFFFFF");
...@@ -317,7 +329,11 @@ public class Food { ...@@ -317,7 +329,11 @@ public class Food {
@Transient @Transient
private boolean isComboFood = false; private boolean isComboFood = false;
@Generated(hash = 1680701141)
@Generated(hash = 60268763)
public Food(Long id, long parentId, long restaurantId, byte isParent, public Food(Long id, long parentId, long restaurantId, byte isParent,
long seqNo, String foodName, String foodName1, String foodName2, long seqNo, String foodName, String foodName1, String foodName2,
String plu, String posFid, String foodDesc, long limitAmount, String plu, String posFid, String foodDesc, long limitAmount,
...@@ -332,10 +348,10 @@ public class Food { ...@@ -332,10 +348,10 @@ public class Food {
long advPrice, long printToBill, double pointsAdd, long pointsRatio, long advPrice, long printToBill, double pointsAdd, long pointsRatio,
double pointsRedeem, long ktPrintMainItem, long ktShowPrice, double pointsRedeem, long ktPrintMainItem, long ktShowPrice,
long printTo, long toPax, long foodType, long majorMainId, long deptId, long printTo, long toPax, long foodType, long majorMainId, long deptId,
byte serviceCharge, long colorId, long conditions, long isRt, byte serviceCharge, long conditions, long isRt, long deletes,
long deletes, long isTimingFood, long minLongTime, long unitTime, long isTimingFood, long minLongTime, long unitTime, double unitPrice,
double unitPrice, long freeLongTime, Date freePeriodBegin, long freeLongTime, Date freePeriodBegin, long isStatistic,
long isStatistic) { long colorId) {
this.id = id; this.id = id;
this.parentId = parentId; this.parentId = parentId;
this.restaurantId = restaurantId; this.restaurantId = restaurantId;
...@@ -392,7 +408,6 @@ public class Food { ...@@ -392,7 +408,6 @@ public class Food {
this.majorMainId = majorMainId; this.majorMainId = majorMainId;
this.deptId = deptId; this.deptId = deptId;
this.serviceCharge = serviceCharge; this.serviceCharge = serviceCharge;
this.colorId = colorId;
this.conditions = conditions; this.conditions = conditions;
this.isRt = isRt; this.isRt = isRt;
this.deletes = deletes; this.deletes = deletes;
...@@ -403,6 +418,7 @@ public class Food { ...@@ -403,6 +418,7 @@ public class Food {
this.freeLongTime = freeLongTime; this.freeLongTime = freeLongTime;
this.freePeriodBegin = freePeriodBegin; this.freePeriodBegin = freePeriodBegin;
this.isStatistic = isStatistic; this.isStatistic = isStatistic;
this.colorId = colorId;
} }
@Generated(hash = 866324199) @Generated(hash = 866324199)
...@@ -412,6 +428,7 @@ public class Food { ...@@ -412,6 +428,7 @@ public class Food {
public Long getId() { public Long getId() {
return id; return id;
} }
......
...@@ -4,7 +4,9 @@ import android.content.Context; ...@@ -4,7 +4,9 @@ import android.content.Context;
import android.util.Log; import android.util.Log;
import com.gingersoft.gsa.cloud.database.DaoManager; 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.bean.Food;
import com.gingersoft.gsa.cloud.database.greendao.ColorBeanDao;
import com.gingersoft.gsa.cloud.database.greendao.FoodDao; import com.gingersoft.gsa.cloud.database.greendao.FoodDao;
import org.greenrobot.greendao.query.QueryBuilder; import org.greenrobot.greendao.query.QueryBuilder;
...@@ -161,10 +163,12 @@ public class FoodDaoUtils { ...@@ -161,10 +163,12 @@ public class FoodDaoUtils {
public List<Food> queryFoodGroupByQueryBuilder() { public List<Food> queryFoodGroupByQueryBuilder() {
QueryBuilder<Food> queryBuilder = mManager.getDaoSession().queryBuilder(Food.class); QueryBuilder<Food> queryBuilder = mManager.getDaoSession().queryBuilder(Food.class);
long currentTime = System.currentTimeMillis(); long currentTime = System.currentTimeMillis();
return queryBuilder.where(queryBuilder.and( queryBuilder.where(queryBuilder.and(
FoodDao.Properties.ParentId.eq(0), FoodDao.Properties.ParentId.eq(0),
FoodDao.Properties.StartDate.le(currentTime), 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