Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
supplier
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王宇航
supplier
Commits
2718aa3f
Commit
2718aa3f
authored
Feb 29, 2020
by
宁斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、套餐細項顯示及表調整
2、未送單直接結賬 導致結賬失敗問題
parent
72663cb3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
648 additions
and
473 deletions
+648
-473
download-data/src/main/java/com/gingersoft/gsa/cloud/download/mvp/ui/activity/DownloadActivity.java
+2
-1
public-base/build.gradle
+1
-1
public-base/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/CurrentAndroidSetting.java
+1
-1
public-base/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/OrderBean.java
+3
-1
public-base/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/OrderDetail.java
+8
-3
public-base/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/mealManage/MyOrderManage.java
+6
-0
public-base/src/main/java/com/gingersoft/gsa/cloud/database/bean/ComboItem.java
+136
-0
public-base/src/main/java/com/gingersoft/gsa/cloud/database/bean/Food.java
+0
-88
public-base/src/main/java/com/gingersoft/gsa/cloud/database/bean/FoodCombo.java
+41
-120
public-base/src/main/java/com/gingersoft/gsa/cloud/database/bean/FoodModifier.java
+158
-89
public-base/src/main/java/com/gingersoft/gsa/cloud/database/bean/Modifier.java
+10
-9
public-base/src/main/java/com/gingersoft/gsa/cloud/database/greendao/ComboItemDao.java
+0
-21
public-base/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DaoMaster.java
+8
-8
public-base/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DaoSession.java
+28
-28
public-base/src/main/java/com/gingersoft/gsa/cloud/database/greendao/FoodDao.java
+0
-9
public-base/src/main/java/com/gingersoft/gsa/cloud/database/greendao/FoodModifierDao.java
+0
-0
public-base/src/main/java/com/gingersoft/gsa/cloud/database/greendao/ModifierDao.java
+0
-18
public-base/src/main/java/com/gingersoft/gsa/cloud/database/utils/ComboItemDaoUtils.java
+30
-0
public-base/src/main/java/com/gingersoft/gsa/cloud/database/utils/FoodComboDaoUtils.java
+2
-2
public-base/src/main/java/com/gingersoft/gsa/cloud/database/utils/FoodDaoUtils.java
+2
-14
public-base/src/main/java/com/gingersoft/gsa/cloud/database/utils/FoodModifierDaoUtils.java
+7
-6
public-base/src/main/java/com/gingersoft/gsa/cloud/database/utils/ModifierDaoUtils.java
+0
-0
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/contract/BaseOrderContract.java
+4
-0
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/contract/MealStandContract.java
+5
-4
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/contract/OrderContentContract.java
+3
-3
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/MealStandModel.java
+7
-8
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/OrderPayModel.java
+13
-0
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/BaseOrderPresenter.java
+30
-4
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/FineItemAllPresenter.java
+1
-1
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/FineItemKindPresenter.java
+1
-1
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/MealStandPresenter.java
+27
-19
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderContentPresenter.java
+5
-2
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderPayPresenter.java
+94
-1
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/MealStandActivity.java
+4
-0
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/OrderPayActivity.java
+1
-1
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/meal/ComboAdapter.java
+9
-9
table-mode/src/main/res/mipmap-xhdpi/meal_down.png
+0
-0
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/LoginActivity.java
+1
-1
No files found.
download-data/src/main/java/com/gingersoft/gsa/cloud/download/mvp/ui/activity/DownloadActivity.java
View file @
2718aa3f
...
@@ -99,6 +99,7 @@ public class DownloadActivity extends BaseActivity<DownloadPresenter> implements
...
@@ -99,6 +99,7 @@ public class DownloadActivity extends BaseActivity<DownloadPresenter> implements
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
killMyself
();
killMyself
();
}
}
});
});
QMUIAlphaImageButton
rightButton
=
mTopBar
.
addRightImageButton
(
R
.
drawable
.
icon_refresh
,
R
.
id
.
btn_back
);
QMUIAlphaImageButton
rightButton
=
mTopBar
.
addRightImageButton
(
R
.
drawable
.
icon_refresh
,
R
.
id
.
btn_back
);
...
@@ -188,7 +189,7 @@ public class DownloadActivity extends BaseActivity<DownloadPresenter> implements
...
@@ -188,7 +189,7 @@ public class DownloadActivity extends BaseActivity<DownloadPresenter> implements
return
;
return
;
}
}
transparentStatusBar
(
activity
);
transparentStatusBar
(
activity
);
//
setRootView(activity);
setRootView
(
activity
);
}
}
/**
/**
...
...
public-base/build.gradle
View file @
2718aa3f
...
@@ -41,7 +41,7 @@ android {
...
@@ -41,7 +41,7 @@ android {
/**
/**
* 版本号
* 版本号
*/
*/
schemaVersion
8
schemaVersion
14
/**
/**
* greendao输出dao的数据库操作实体类文件夹(相对路径 包名+自定义路径名称,包将创建于包名的直接路径下)
* greendao输出dao的数据库操作实体类文件夹(相对路径 包名+自定义路径名称,包将创建于包名的直接路径下)
*/
*/
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/CurrentAndroidSetting.java
View file @
2718aa3f
...
@@ -39,7 +39,7 @@ public class CurrentAndroidSetting {
...
@@ -39,7 +39,7 @@ public class CurrentAndroidSetting {
private
int
LayoutQuitHeight
=
40
;
private
int
LayoutQuitHeight
=
40
;
private
int
LayoutFoodTypeHeight
=
100
;
private
int
LayoutFoodTypeHeight
=
100
;
private
int
FoodBtnHeight
=
120
;
private
int
FoodBtnHeight
=
120
;
private
int
ModBtnHeight
=
55
;
private
int
ModBtnHeight
=
68
;
private
int
FoodTypeCol
=
4
;
private
int
FoodTypeCol
=
4
;
private
int
FoodTypeRow
=
1
;
private
int
FoodTypeRow
=
1
;
private
int
FoodCol
=
4
;
private
int
FoodCol
=
4
;
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/OrderBean.java
View file @
2718aa3f
...
@@ -2,7 +2,6 @@ package com.gingersoft.gsa.cloud.base.common.bean;
...
@@ -2,7 +2,6 @@ package com.gingersoft.gsa.cloud.base.common.bean;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.OpenTableManage
;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.OpenTableManage
;
import
com.gingersoft.gsa.cloud.database.bean.Food
;
import
com.gingersoft.gsa.cloud.database.bean.Food
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -32,6 +31,9 @@ public class OrderBean {
...
@@ -32,6 +31,9 @@ public class OrderBean {
public
OrderBean
()
{
public
OrderBean
()
{
}
}
public
OrderBean
(
int
orderId
)
{
this
.
id
=
orderId
;
}
public
OrderBean
(
OrderBean
orderBean
)
{
public
OrderBean
(
OrderBean
orderBean
)
{
this
.
id
=
orderBean
.
id
;
this
.
id
=
orderBean
.
id
;
this
.
status
=
orderBean
.
status
;
this
.
status
=
orderBean
.
status
;
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/OrderDetail.java
View file @
2718aa3f
package
com
.
gingersoft
.
gsa
.
cloud
.
base
.
common
.
bean
;
package
com
.
gingersoft
.
gsa
.
cloud
.
base
.
common
.
bean
;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage
;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage
;
import
com.gingersoft.gsa.cloud.database.bean.ComboItem
;
import
com.gingersoft.gsa.cloud.database.bean.FoodCombo
;
import
com.gingersoft.gsa.cloud.database.bean.FoodCombo
;
import
com.gingersoft.gsa.cloud.database.bean.Food
;
import
com.gingersoft.gsa.cloud.database.bean.Food
;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
...
@@ -567,12 +568,16 @@ public class OrderDetail implements Serializable {
...
@@ -567,12 +568,16 @@ public class OrderDetail implements Serializable {
* @param isRvMealClicked
* @param isRvMealClicked
* @return
* @return
*/
*/
public
static
OrderDetail
comboTransOrderDetail
(
FoodCombo
foodCombo
,
int
number
,
String
prop
,
boolean
isRvMealClicked
)
{
public
static
OrderDetail
comboTransOrderDetail
(
ComboItem
foodCombo
,
int
number
,
long
fid
,
String
prop
,
boolean
isRvMealClicked
)
{
OrderDetail
orderDetail
=
new
OrderDetail
();
OrderDetail
orderDetail
=
new
OrderDetail
();
orderDetail
.
setProductName
(
foodCombo
.
getName
());
orderDetail
.
setProductName
(
foodCombo
.
getName
());
orderDetail
.
setId
(
foodCombo
.
getId
());
if
(
foodCombo
.
getFid
()
!=
null
)
{
orderDetail
.
setId
(
foodCombo
.
getFid
());
}
if
(
foodCombo
.
getComId
()
!=
null
)
{
orderDetail
.
setProductId
(
foodCombo
.
getComId
());
orderDetail
.
setProductId
(
foodCombo
.
getComId
());
orderDetail
.
setParentId
(
foodCombo
.
getFid
());
}
orderDetail
.
setParentId
(
fid
);
orderDetail
.
setUnit_price
(
foodCombo
.
getPrice
());
orderDetail
.
setUnit_price
(
foodCombo
.
getPrice
());
orderDetail
.
setPrice
(
number
*
orderDetail
.
getUnit_price
());
orderDetail
.
setPrice
(
number
*
orderDetail
.
getUnit_price
());
orderDetail
.
setNumber
(
number
);
orderDetail
.
setNumber
(
number
);
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/mealManage/MyOrderManage.java
View file @
2718aa3f
...
@@ -94,6 +94,12 @@ public class MyOrderManage {
...
@@ -94,6 +94,12 @@ public class MyOrderManage {
return
new
Date
();
return
new
Date
();
}
}
public
void
setOrderId
(
double
orderId
)
{
if
(
orderBean
!=
null
)
{
orderBean
.
setId
((
int
)
orderId
);
}
}
public
void
setOrderBean
(
OrderBean
orderBean
)
{
public
void
setOrderBean
(
OrderBean
orderBean
)
{
this
.
orderBean
=
orderBean
;
this
.
orderBean
=
orderBean
;
}
}
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/database/bean/ComboItem.java
View file @
2718aa3f
package
com
.
gingersoft
.
gsa
.
cloud
.
database
.
bean
;
package
com
.
gingersoft
.
gsa
.
cloud
.
database
.
bean
;
import
android.graphics.Color
;
import
org.greenrobot.greendao.annotation.Entity
;
import
org.greenrobot.greendao.annotation.Entity
;
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
java.util.Date
;
import
java.util.Date
;
import
org.greenrobot.greendao.annotation.Generated
;
import
org.greenrobot.greendao.annotation.Generated
;
import
org.greenrobot.greendao.annotation.Transient
;
/**
/**
* 作者:ELEGANT_BIN
* 作者:ELEGANT_BIN
...
@@ -54,6 +57,50 @@ public class ComboItem {
...
@@ -54,6 +57,50 @@ public class ComboItem {
private
Byte
isMainAccount
;
private
Byte
isMainAccount
;
/**
* 自定義字段
*/
@Transient
private
String
name
;
@Transient
private
String
name1
;
@Transient
private
String
name2
;
@Transient
private
long
parentId
;
/**
* 價格
*/
@Transient
private
double
price
=
0.00
;
/**
* 是否自動展開
*/
@Transient
private
int
autoMode
=
0
;
/**
* 是否备注细项
*/
@Transient
private
boolean
isModifier
;
/**
* 背景顏色
*/
@Transient
private
int
bgColor
=
Color
.
parseColor
(
"#067878"
);
/**
* 字體顏色
*/
@Transient
private
int
fontColor
=
Color
.
parseColor
(
"#FFFFFF"
);
/**
* 套餐細項
*/
@Transient
private
Modifier
modifier
;
@Generated
(
hash
=
1857315418
)
@Generated
(
hash
=
1857315418
)
public
ComboItem
(
Long
id
,
Long
comId
,
Long
fid
,
Long
qty
,
Double
diffAmt
,
public
ComboItem
(
Long
id
,
Long
comId
,
Long
fid
,
Long
qty
,
Double
diffAmt
,
Long
seqNo
,
Long
visible
,
Date
createTime
,
String
createBy
,
Long
seqNo
,
Long
visible
,
Date
createTime
,
String
createBy
,
...
@@ -146,6 +193,54 @@ public class ComboItem {
...
@@ -146,6 +193,54 @@ public class ComboItem {
return
isMainAccount
;
return
isMainAccount
;
}
}
public
String
getName
()
{
return
name
;
}
public
String
getName1
()
{
return
name1
;
}
public
String
getName2
()
{
return
name2
;
}
public
long
getParentId
()
{
return
parentId
;
}
public
double
getPrice
()
{
return
price
;
}
public
int
getAutoMode
()
{
return
autoMode
;
}
public
boolean
isModifier
()
{
return
isModifier
;
}
public
int
getBgColor
()
{
return
bgColor
;
}
public
int
getFontColor
()
{
return
fontColor
;
}
public
void
setName1
(
String
name1
)
{
this
.
name1
=
name1
;
}
public
void
setName2
(
String
name2
)
{
this
.
name2
=
name2
;
}
public
Modifier
getModifier
()
{
return
modifier
;
}
public
void
setId
(
Long
id
)
{
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
this
.
id
=
id
;
}
}
...
@@ -209,4 +304,45 @@ public class ComboItem {
...
@@ -209,4 +304,45 @@ public class ComboItem {
public
void
setIsMainAccount
(
Byte
isMainAccount
)
{
public
void
setIsMainAccount
(
Byte
isMainAccount
)
{
this
.
isMainAccount
=
isMainAccount
;
this
.
isMainAccount
=
isMainAccount
;
}
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
void
setParentId
(
long
parentId
)
{
this
.
parentId
=
parentId
;
}
public
void
setPrice
(
double
price
)
{
this
.
price
=
price
;
}
public
void
setAutoMode
(
int
autoMode
)
{
this
.
autoMode
=
autoMode
;
}
public
void
setModifier
(
boolean
modifier
)
{
isModifier
=
modifier
;
}
public
void
setBgColor
(
int
bgColor
)
{
this
.
bgColor
=
bgColor
;
}
public
void
setFontColor
(
int
fontColor
)
{
this
.
fontColor
=
fontColor
;
}
public
void
setModifier
(
Modifier
modifier
)
{
this
.
modifier
=
modifier
;
}
public
static
ComboItem
addFoodInfo
(
Food
food
,
ComboItem
foodCombo
)
{
foodCombo
.
setName
(
food
.
getFoodName
());
foodCombo
.
setFid
(
food
.
getId
());
foodCombo
.
setPrice
(
food
.
getPrice
());
foodCombo
.
setAutoMode
(
food
.
getAutoMod
());
return
foodCombo
;
}
}
}
public-base/src/main/java/com/gingersoft/gsa/cloud/database/bean/Food.java
View file @
2718aa3f
...
@@ -35,9 +35,6 @@ public class Food {
...
@@ -35,9 +35,6 @@ public class Food {
@Id
(
autoincrement
=
true
)
@Id
(
autoincrement
=
true
)
private
Long
id
;
private
Long
id
;
@ToMany
@JoinEntity
(
entity
=
FoodCombo
.
class
,
sourceProperty
=
"fid"
,
targetProperty
=
"comId"
)
private
List
<
ComboItem
>
comboItems
;
/**
/**
* 上級ID (如0=最高級)
* 上級ID (如0=最高級)
*/
*/
...
@@ -324,14 +321,6 @@ public class Food {
...
@@ -324,14 +321,6 @@ public class Food {
/**是否组合食品*/
/**是否组合食品*/
private
boolean
isComboFood
=
false
;
private
boolean
isComboFood
=
false
;
/** Used to resolve relations */
@Generated
(
hash
=
2040040024
)
private
transient
DaoSession
daoSession
;
/** Used for active entity operations. */
@Generated
(
hash
=
1296197325
)
private
transient
FoodDao
myDao
;
@Generated
(
hash
=
866324199
)
@Generated
(
hash
=
866324199
)
public
Food
()
{
public
Food
()
{
}
}
...
@@ -1007,81 +996,4 @@ public class Food {
...
@@ -1007,81 +996,4 @@ public class Food {
isComboFood
=
comboFood
;
isComboFood
=
comboFood
;
}
}
/**
* To-many relationship, resolved on first access (and after reset).
* Changes to to-many relations are not persisted, make changes to the target entity.
*/
@Generated
(
hash
=
929118398
)
public
List
<
ComboItem
>
getComboItems
()
{
if
(
comboItems
==
null
)
{
final
DaoSession
daoSession
=
this
.
daoSession
;
if
(
daoSession
==
null
)
{
throw
new
DaoException
(
"Entity is detached from DAO context"
);
}
ComboItemDao
targetDao
=
daoSession
.
getComboItemDao
();
List
<
ComboItem
>
comboItemsNew
=
targetDao
.
_queryFood_ComboItems
(
id
);
synchronized
(
this
)
{
if
(
comboItems
==
null
)
{
comboItems
=
comboItemsNew
;
}
}
}
return
comboItems
;
}
/** Resets a to-many relationship, making the next get call to query for a fresh result. */
@Generated
(
hash
=
1344176234
)
public
synchronized
void
resetComboItems
()
{
comboItems
=
null
;
}
/**
* Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
* Entity must attached to an entity context.
*/
@Generated
(
hash
=
128553479
)
public
void
delete
()
{
if
(
myDao
==
null
)
{
throw
new
DaoException
(
"Entity is detached from DAO context"
);
}
myDao
.
delete
(
this
);
}
/**
* Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
* Entity must attached to an entity context.
*/
@Generated
(
hash
=
1942392019
)
public
void
refresh
()
{
if
(
myDao
==
null
)
{
throw
new
DaoException
(
"Entity is detached from DAO context"
);
}
myDao
.
refresh
(
this
);
}
/**
* Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
* Entity must attached to an entity context.
*/
@Generated
(
hash
=
713229351
)
public
void
update
()
{
if
(
myDao
==
null
)
{
throw
new
DaoException
(
"Entity is detached from DAO context"
);
}
myDao
.
update
(
this
);
}
/** called by internal mechanisms, do not call yourself. */
@Generated
(
hash
=
505459956
)
public
void
__setDaoSession
(
DaoSession
daoSession
)
{
this
.
daoSession
=
daoSession
;
myDao
=
daoSession
!=
null
?
daoSession
.
getFoodDao
()
:
null
;
}
}
}
public-base/src/main/java/com/gingersoft/gsa/cloud/database/bean/FoodCombo.java
View file @
2718aa3f
...
@@ -27,46 +27,43 @@ public class FoodCombo {
...
@@ -27,46 +27,43 @@ public class FoodCombo {
private
Long
fid
;
//食品ID
private
Long
fid
;
//食品ID
private
int
comId
;
//套餐ID
private
int
comId
;
//套餐ID
// @ToMany
// /**
// @JoinEntity(entity = ComboItem.class, sourceProperty = "comId", targetProperty = "fid")
// * 自定義字段
// private List<ComboItem> comboItems;
// */
/**
// @Transient
* 自定義字段
// private String name;
*/
// @Transient
@Transient
// private long parentId;
private
String
name
;
// /**
@Transient
// * 價格
private
long
parentId
;
// */
/**
// @Transient
* 價格
// private double price = 0.00;
*/
// /**
@Transient
// * 是否自動展開
private
double
price
=
0.00
;
// */
/**
// @Transient
* 是否自動展開
// private int autoMode = 0;
*/
// /**
@Transient
// * 是否备注细项
private
int
autoMode
=
0
;
// */
/**
// @Transient
* 是否备注细项
// private boolean isModifier;
*/
// /**
@Transient
// * 背景顏色
private
boolean
isModifier
;
// */
/**
// @Transient
* 背景顏色
// private int bgColor = Color.parseColor("#067878");
*/
// /**
@Transient
// * 字體顏色
private
int
bgColor
=
Color
.
parseColor
(
"#067878"
);
// */
/**
// @Transient
* 字體顏色
// private int fontColor = Color.parseColor("#FFFFFF");
*/
// /**
@Transient
// * 套餐細項
private
int
fontColor
=
Color
.
parseColor
(
"#FFFFFF"
);
// */
/**
// @Transient
* 套餐細項
// private Modifier modifier;
*/
@Transient
private
Modifier
modifier
;
...
@@ -81,26 +78,16 @@ public class FoodCombo {
...
@@ -81,26 +78,16 @@ public class FoodCombo {
public
FoodCombo
()
{
public
FoodCombo
()
{
}
}
public
long
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
long
parentId
)
{
this
.
parentId
=
parentId
;
}
public
Long
getId
()
{
public
Long
getId
()
{
return
id
;
return
this
.
id
;
}
}
public
void
setId
(
l
ong
id
)
{
public
void
setId
(
L
ong
id
)
{
this
.
id
=
id
;
this
.
id
=
id
;
}
}
public
Long
getFid
()
{
public
Long
getFid
()
{
return
fid
;
return
this
.
fid
;
}
}
public
void
setFid
(
Long
fid
)
{
public
void
setFid
(
Long
fid
)
{
...
@@ -108,79 +95,13 @@ public class FoodCombo {
...
@@ -108,79 +95,13 @@ public class FoodCombo {
}
}
public
int
getComId
()
{
public
int
getComId
()
{
return
comId
;
return
this
.
comId
;
}
}
public
void
setComId
(
int
comId
)
{
public
void
setComId
(
int
comId
)
{
this
.
comId
=
comId
;
this
.
comId
=
comId
;
}
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
int
getAutoMode
()
{
return
autoMode
;
}
public
void
setAutoMode
(
int
autoMode
)
{
this
.
autoMode
=
autoMode
;
}
public
double
getPrice
()
{
return
price
;
}
public
void
setPrice
(
double
price
)
{
this
.
price
=
price
;
}
public
boolean
isModifier
()
{
return
isModifier
;
}
public
void
setModifier
(
boolean
modifier
)
{
isModifier
=
modifier
;
}
public
int
getBgColor
()
{
return
bgColor
;
}
public
void
setBgColor
(
int
bgColor
)
{
this
.
bgColor
=
bgColor
;
}
public
int
getFontColor
()
{
return
fontColor
;
}
public
void
setFontColor
(
int
fontColor
)
{
this
.
fontColor
=
fontColor
;
}
public
Modifier
getModifier
()
{
return
modifier
;
}
public
void
setModifier
(
Modifier
modifier
)
{
this
.
modifier
=
modifier
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
static
FoodCombo
addFoodInfo
(
Food
food
,
FoodCombo
foodCombo
)
{
foodCombo
.
setName
(
food
.
getFoodName
());
foodCombo
.
setFid
(
food
.
getId
());
foodCombo
.
setPrice
(
food
.
getPrice
());
foodCombo
.
setAutoMode
(
food
.
getAutoMod
());
return
foodCombo
;
}
}
}
public-base/src/main/java/com/gingersoft/gsa/cloud/database/bean/FoodModifier.java
View file @
2718aa3f
package
com
.
gingersoft
.
gsa
.
cloud
.
database
.
bean
;
package
com
.
gingersoft
.
gsa
.
cloud
.
database
.
bean
;
import
com.google.gson.annotations.SerializedName
;
import
org.greenrobot.greendao.annotation.Entity
;
import
org.greenrobot.greendao.annotation.Entity
;
import
org.greenrobot.greendao.annotation.Generated
;
import
org.greenrobot.greendao.annotation.Id
;
import
org.greenrobot.greendao.annotation.Id
;
import
org.greenrobot.greendao.annotation.NotNull
;
import
org.greenrobot.greendao.annotation.NotNull
;
import
org.greenrobot.greendao.annotation.Property
;
import
org.greenrobot.greendao.annotation.Property
;
import
org.greenrobot.greendao.annotation.Generated
;
import
org.greenrobot.greendao.annotation.ToMany
;
import
java.util.List
;
import
java.util.List
;
import
org.greenrobot.greendao.DaoException
;
import
com.gingersoft.gsa.cloud.database.greendao.DaoSession
;
import
com.gingersoft.gsa.cloud.database.greendao.FoodDao
;
import
com.gingersoft.gsa.cloud.database.greendao.FoodModifierDao
;
import
com.gingersoft.gsa.cloud.database.greendao.ModifierDao
;
/**
/**
* 作者:ELEGANT_BIN
* 作者:ELEGANT_BIN
...
@@ -24,47 +20,62 @@ import com.gingersoft.gsa.cloud.database.greendao.ModifierDao;
...
@@ -24,47 +20,62 @@ import com.gingersoft.gsa.cloud.database.greendao.ModifierDao;
@Entity
@Entity
public
class
FoodModifier
{
public
class
FoodModifier
{
@Property
(
nameInDb
=
"_id"
)
@Property
(
nameInDb
=
"_id"
)
@Id
(
autoincrement
=
true
)
@Id
(
autoincrement
=
true
)
private
Long
db
id
;
private
Long
id
;
@NotNull
@NotNull
private
Long
id
;
private
Long
fid
;
private
Long
mid
;
private
Long
mid
;
private
Long
fid
;
//關聯食品表
private
int
minQty
;
@ToMany
(
referencedJoinProperty
=
"mid"
)
private
int
maxQty
;
private
List
<
Modifier
>
modifiers
;
private
int
seqNo
;
private
String
createTime
;
/** Used to resolve relations */
private
String
createBy
;
@Generated
(
hash
=
2040040024
)
private
String
updateTime
;
private
transient
DaoSession
daoSession
;
private
int
showType
;
private
int
autoNext
;
/** Used for active entity operations. */
private
int
multipleSelect
;
@Generated
(
hash
=
1456075793
)
private
String
defmodifier
;
private
transient
FoodModifierDao
myDao
;
private
String
excmodifier
;
private
int
conditions
;
private
int
isRT
;
private
int
restaurantId
;
private
int
preferentialPrice
;
private
int
posId
;
@Generated
(
hash
=
969556490
)
public
FoodModifier
(
Long
dbid
,
@NotNull
Long
id
,
Long
fid
,
Long
mid
)
{
this
.
dbid
=
dbid
;
this
.
id
=
id
;
this
.
fid
=
fid
;
this
.
mid
=
mid
;
}
@Generated
(
hash
=
1385518392
)
@Generated
(
hash
=
1385518392
)
public
FoodModifier
()
{
public
FoodModifier
()
{
}
}
@Generated
(
hash
=
101316338
)
public
Long
getDbid
()
{
public
FoodModifier
(
Long
id
,
@NotNull
Long
mid
,
Long
fid
,
int
minQty
,
return
dbid
;
int
maxQty
,
int
seqNo
,
String
createTime
,
String
createBy
,
}
String
updateTime
,
int
showType
,
int
autoNext
,
int
multipleSelect
,
String
defmodifier
,
String
excmodifier
,
int
conditions
,
int
isRT
,
public
void
setDbid
(
Long
dbid
)
{
int
restaurantId
,
int
preferentialPrice
,
int
posId
)
{
this
.
dbid
=
dbid
;
this
.
id
=
id
;
this
.
mid
=
mid
;
this
.
fid
=
fid
;
this
.
minQty
=
minQty
;
this
.
maxQty
=
maxQty
;
this
.
seqNo
=
seqNo
;
this
.
createTime
=
createTime
;
this
.
createBy
=
createBy
;
this
.
updateTime
=
updateTime
;
this
.
showType
=
showType
;
this
.
autoNext
=
autoNext
;
this
.
multipleSelect
=
multipleSelect
;
this
.
defmodifier
=
defmodifier
;
this
.
excmodifier
=
excmodifier
;
this
.
conditions
=
conditions
;
this
.
isRT
=
isRT
;
this
.
restaurantId
=
restaurantId
;
this
.
preferentialPrice
=
preferentialPrice
;
this
.
posId
=
posId
;
}
}
public
Long
getId
()
{
public
Long
getId
()
{
...
@@ -91,74 +102,132 @@ public class FoodModifier {
...
@@ -91,74 +102,132 @@ public class FoodModifier {
this
.
mid
=
mid
;
this
.
mid
=
mid
;
}
}
/**
* Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
public
int
getMinQty
()
{
* Entity must attached to an entity context.
return
minQty
;
*/
@Generated
(
hash
=
128553479
)
public
void
delete
()
{
if
(
myDao
==
null
)
{
throw
new
DaoException
(
"Entity is detached from DAO context"
);
}
}
myDao
.
delete
(
this
);
public
void
setMinQty
(
int
minQty
)
{
this
.
minQty
=
minQty
;
}
}
/**
public
int
getMaxQty
()
{
* Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
return
maxQty
;
* Entity must attached to an entity context.
}
*/
@Generated
(
hash
=
1942392019
)
public
void
setMaxQty
(
int
maxQty
)
{
public
void
refresh
()
{
this
.
maxQty
=
maxQty
;
if
(
myDao
==
null
)
{
throw
new
DaoException
(
"Entity is detached from DAO context"
);
}
}
myDao
.
refresh
(
this
);
public
int
getSeqNo
()
{
return
seqNo
;
}
}
/**
public
void
setSeqNo
(
int
seqNo
)
{
* Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
this
.
seqNo
=
seqNo
;
* Entity must attached to an entity context.
*/
@Generated
(
hash
=
713229351
)
public
void
update
()
{
if
(
myDao
==
null
)
{
throw
new
DaoException
(
"Entity is detached from DAO context"
);
}
}
myDao
.
update
(
this
);
public
String
getCreateTime
()
{
return
createTime
;
}
}
/** called by internal mechanisms, do not call yourself. */
public
void
setCreateTime
(
String
createTime
)
{
@Generated
(
hash
=
638717814
)
this
.
createTime
=
createTime
;
public
void
__setDaoSession
(
DaoSession
daoSession
)
{
this
.
daoSession
=
daoSession
;
myDao
=
daoSession
!=
null
?
daoSession
.
getFoodModifierDao
()
:
null
;
}
}
/**
public
String
getCreateBy
()
{
* To-many relationship, resolved on first access (and after reset).
return
createBy
;
* Changes to to-many relations are not persisted, make changes to the target entity.
*/
@Generated
(
hash
=
1902490580
)
public
List
<
Modifier
>
getModifiers
()
{
if
(
modifiers
==
null
)
{
final
DaoSession
daoSession
=
this
.
daoSession
;
if
(
daoSession
==
null
)
{
throw
new
DaoException
(
"Entity is detached from DAO context"
);
}
}
ModifierDao
targetDao
=
daoSession
.
getModifierDao
();
List
<
Modifier
>
modifiersNew
=
targetDao
.
_queryFoodModifier_Modifiers
(
dbid
);
public
void
setCreateBy
(
String
createBy
)
{
synchronized
(
this
)
{
this
.
createBy
=
createBy
;
if
(
modifiers
==
null
)
{
modifiers
=
modifiersNew
;
}
}
public
String
getUpdateTime
()
{
return
updateTime
;
}
}
public
void
setUpdateTime
(
String
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
}
return
modifiers
;
public
int
getShowType
()
{
return
showType
;
}
public
void
setShowType
(
int
showType
)
{
this
.
showType
=
showType
;
}
public
int
getAutoNext
()
{
return
autoNext
;
}
public
void
setAutoNext
(
int
autoNext
)
{
this
.
autoNext
=
autoNext
;
}
public
int
getMultipleSelect
()
{
return
multipleSelect
;
}
public
void
setMultipleSelect
(
int
multipleSelect
)
{
this
.
multipleSelect
=
multipleSelect
;
}
public
String
getDefmodifier
()
{
return
defmodifier
;
}
public
void
setDefmodifier
(
String
defmodifier
)
{
this
.
defmodifier
=
defmodifier
;
}
public
String
getExcmodifier
()
{
return
excmodifier
;
}
public
void
setExcmodifier
(
String
excmodifier
)
{
this
.
excmodifier
=
excmodifier
;
}
public
int
getConditions
()
{
return
conditions
;
}
public
void
setConditions
(
int
conditions
)
{
this
.
conditions
=
conditions
;
}
public
int
getIsRT
()
{
return
isRT
;
}
public
void
setIsRT
(
int
isRT
)
{
this
.
isRT
=
isRT
;
}
public
int
getRestaurantId
()
{
return
restaurantId
;
}
public
void
setRestaurantId
(
int
restaurantId
)
{
this
.
restaurantId
=
restaurantId
;
}
public
int
getPreferentialPrice
()
{
return
preferentialPrice
;
}
public
void
setPreferentialPrice
(
int
preferentialPrice
)
{
this
.
preferentialPrice
=
preferentialPrice
;
}
public
int
getPosId
()
{
return
posId
;
}
}
/** Resets a to-many relationship, making the next get call to query for a fresh result. */
public
void
setPosId
(
int
posId
)
{
@Generated
(
hash
=
51124353
)
this
.
posId
=
posId
;
public
synchronized
void
resetModifiers
()
{
modifiers
=
null
;
}
}
}
}
public-base/src/main/java/com/gingersoft/gsa/cloud/database/bean/Modifier.java
View file @
2718aa3f
...
@@ -207,8 +207,8 @@ public class Modifier {
...
@@ -207,8 +207,8 @@ public class Modifier {
/**
/**
* 自定義字段
* 自定義字段
*/
*/
@Transient
/**當前食品ID*/
/**當前食品ID*/
@Transient
private
long
fid
;
private
long
fid
;
@Transient
@Transient
/**選中數量*/
/**選中數量*/
...
@@ -308,7 +308,7 @@ public class Modifier {
...
@@ -308,7 +308,7 @@ public class Modifier {
return
mid
;
return
mid
;
}
}
public
l
ong
getTopId
()
{
public
L
ong
getTopId
()
{
return
topId
;
return
topId
;
}
}
...
@@ -328,7 +328,7 @@ public class Modifier {
...
@@ -328,7 +328,7 @@ public class Modifier {
return
marketPrice
;
return
marketPrice
;
}
}
public
d
ouble
getPrice
()
{
public
D
ouble
getPrice
()
{
return
price
;
return
price
;
}
}
...
@@ -417,9 +417,14 @@ public class Modifier {
...
@@ -417,9 +417,14 @@ public class Modifier {
}
}
public
boolean
isParent
()
{
public
boolean
isParent
()
{
if
(
isParent
==
null
)
if
(
isParent
==
1
)
{
return
true
;
}
return
false
;
return
false
;
return
isParent
==
1
?
true
:
false
;
}
public
Long
getIsParent
()
{
return
isParent
;
}
}
public
String
getModifierName1
()
{
public
String
getModifierName1
()
{
...
@@ -757,8 +762,4 @@ public class Modifier {
...
@@ -757,8 +762,4 @@ public class Modifier {
public
void
setPId
(
String
pId
)
{
public
void
setPId
(
String
pId
)
{
this
.
pId
=
pId
;
this
.
pId
=
pId
;
}
}
public
Long
getIsParent
()
{
return
this
.
isParent
;
}
}
}
public-base/src/main/java/com/gingersoft/gsa/cloud/database/greendao/ComboItemDao.java
View file @
2718aa3f
package
com
.
gingersoft
.
gsa
.
cloud
.
database
.
greendao
;
package
com
.
gingersoft
.
gsa
.
cloud
.
database
.
greendao
;
import
java.util.List
;
import
android.database.Cursor
;
import
android.database.Cursor
;
import
android.database.sqlite.SQLiteStatement
;
import
android.database.sqlite.SQLiteStatement
;
...
@@ -9,10 +8,6 @@ import org.greenrobot.greendao.Property;
...
@@ -9,10 +8,6 @@ import org.greenrobot.greendao.Property;
import
org.greenrobot.greendao.internal.DaoConfig
;
import
org.greenrobot.greendao.internal.DaoConfig
;
import
org.greenrobot.greendao.database.Database
;
import
org.greenrobot.greendao.database.Database
;
import
org.greenrobot.greendao.database.DatabaseStatement
;
import
org.greenrobot.greendao.database.DatabaseStatement
;
import
org.greenrobot.greendao.query.Query
;
import
org.greenrobot.greendao.query.QueryBuilder
;
import
com.gingersoft.gsa.cloud.database.bean.FoodCombo
;
import
com.gingersoft.gsa.cloud.database.bean.ComboItem
;
import
com.gingersoft.gsa.cloud.database.bean.ComboItem
;
...
@@ -47,7 +42,6 @@ public class ComboItemDao extends AbstractDao<ComboItem, Long> {
...
@@ -47,7 +42,6 @@ public class ComboItemDao extends AbstractDao<ComboItem, Long> {
public
final
static
Property
IsMainAccount
=
new
Property
(
15
,
Byte
.
class
,
"isMainAccount"
,
false
,
"IS_MAIN_ACCOUNT"
);
public
final
static
Property
IsMainAccount
=
new
Property
(
15
,
Byte
.
class
,
"isMainAccount"
,
false
,
"IS_MAIN_ACCOUNT"
);
}
}
private
Query
<
ComboItem
>
food_ComboItemsQuery
;
public
ComboItemDao
(
DaoConfig
config
)
{
public
ComboItemDao
(
DaoConfig
config
)
{
super
(
config
);
super
(
config
);
...
@@ -328,19 +322,4 @@ public class ComboItemDao extends AbstractDao<ComboItem, Long> {
...
@@ -328,19 +322,4 @@ public class ComboItemDao extends AbstractDao<ComboItem, Long> {
return
true
;
return
true
;
}
}
/** Internal query to resolve the "comboItems" to-many relationship of Food. */
public
List
<
ComboItem
>
_queryFood_ComboItems
(
Long
fid
)
{
synchronized
(
this
)
{
if
(
food_ComboItemsQuery
==
null
)
{
QueryBuilder
<
ComboItem
>
queryBuilder
=
queryBuilder
();
queryBuilder
.
join
(
FoodCombo
.
class
,
FoodComboDao
.
Properties
.
ComId
)
.
where
(
FoodComboDao
.
Properties
.
Fid
.
eq
(
fid
));
food_ComboItemsQuery
=
queryBuilder
.
build
();
}
}
Query
<
ComboItem
>
query
=
food_ComboItemsQuery
.
forCurrentThread
();
query
.
setParameter
(
0
,
fid
);
return
query
.
list
();
}
}
}
public-base/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DaoMaster.java
View file @
2718aa3f
...
@@ -14,31 +14,31 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType;
...
@@ -14,31 +14,31 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
/**
* Master of DAO (schema version
8
): knows all DAOs.
* Master of DAO (schema version
14
): knows all DAOs.
*/
*/
public
class
DaoMaster
extends
AbstractDaoMaster
{
public
class
DaoMaster
extends
AbstractDaoMaster
{
public
static
final
int
SCHEMA_VERSION
=
8
;
public
static
final
int
SCHEMA_VERSION
=
14
;
/** Creates underlying database table using DAOs. */
/** Creates underlying database table using DAOs. */
public
static
void
createAllTables
(
Database
db
,
boolean
ifNotExists
)
{
public
static
void
createAllTables
(
Database
db
,
boolean
ifNotExists
)
{
ComboItemDao
.
createTable
(
db
,
ifNotExists
);
FoodDao
.
createTable
(
db
,
ifNotExists
);
FoodDao
.
createTable
(
db
,
ifNotExists
);
FoodComboDao
.
createTable
(
db
,
ifNotExists
);
FoodModifierDao
.
createTable
(
db
,
ifNotExists
);
FoodModifierDao
.
createTable
(
db
,
ifNotExists
);
FunctionDao
.
createTable
(
db
,
ifNotExists
);
FunctionDao
.
createTable
(
db
,
ifNotExists
);
ModifierDao
.
createTable
(
db
,
ifNotExists
);
ModifierDao
.
createTable
(
db
,
ifNotExists
);
PrinterDeviceBeanDao
.
createTable
(
db
,
ifNotExists
);
PrinterDeviceBeanDao
.
createTable
(
db
,
ifNotExists
);
ComboItemDao
.
createTable
(
db
,
ifNotExists
);
FoodComboDao
.
createTable
(
db
,
ifNotExists
);
}
}
/** Drops underlying database table using DAOs. */
/** Drops underlying database table using DAOs. */
public
static
void
dropAllTables
(
Database
db
,
boolean
ifExists
)
{
public
static
void
dropAllTables
(
Database
db
,
boolean
ifExists
)
{
ComboItemDao
.
dropTable
(
db
,
ifExists
);
FoodDao
.
dropTable
(
db
,
ifExists
);
FoodDao
.
dropTable
(
db
,
ifExists
);
FoodComboDao
.
dropTable
(
db
,
ifExists
);
FoodModifierDao
.
dropTable
(
db
,
ifExists
);
FoodModifierDao
.
dropTable
(
db
,
ifExists
);
FunctionDao
.
dropTable
(
db
,
ifExists
);
FunctionDao
.
dropTable
(
db
,
ifExists
);
ModifierDao
.
dropTable
(
db
,
ifExists
);
ModifierDao
.
dropTable
(
db
,
ifExists
);
PrinterDeviceBeanDao
.
dropTable
(
db
,
ifExists
);
PrinterDeviceBeanDao
.
dropTable
(
db
,
ifExists
);
ComboItemDao
.
dropTable
(
db
,
ifExists
);
FoodComboDao
.
dropTable
(
db
,
ifExists
);
}
}
/**
/**
...
@@ -57,13 +57,13 @@ public class DaoMaster extends AbstractDaoMaster {
...
@@ -57,13 +57,13 @@ public class DaoMaster extends AbstractDaoMaster {
public
DaoMaster
(
Database
db
)
{
public
DaoMaster
(
Database
db
)
{
super
(
db
,
SCHEMA_VERSION
);
super
(
db
,
SCHEMA_VERSION
);
registerDaoClass
(
ComboItemDao
.
class
);
registerDaoClass
(
FoodDao
.
class
);
registerDaoClass
(
FoodDao
.
class
);
registerDaoClass
(
FoodComboDao
.
class
);
registerDaoClass
(
FoodModifierDao
.
class
);
registerDaoClass
(
FoodModifierDao
.
class
);
registerDaoClass
(
FunctionDao
.
class
);
registerDaoClass
(
FunctionDao
.
class
);
registerDaoClass
(
ModifierDao
.
class
);
registerDaoClass
(
ModifierDao
.
class
);
registerDaoClass
(
PrinterDeviceBeanDao
.
class
);
registerDaoClass
(
PrinterDeviceBeanDao
.
class
);
registerDaoClass
(
ComboItemDao
.
class
);
registerDaoClass
(
FoodComboDao
.
class
);
}
}
public
DaoSession
newSession
()
{
public
DaoSession
newSession
()
{
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DaoSession.java
View file @
2718aa3f
...
@@ -8,21 +8,21 @@ import org.greenrobot.greendao.database.Database;
...
@@ -8,21 +8,21 @@ import org.greenrobot.greendao.database.Database;
import
org.greenrobot.greendao.identityscope.IdentityScopeType
;
import
org.greenrobot.greendao.identityscope.IdentityScopeType
;
import
org.greenrobot.greendao.internal.DaoConfig
;
import
org.greenrobot.greendao.internal.DaoConfig
;
import
com.gingersoft.gsa.cloud.database.bean.ComboItem
;
import
com.gingersoft.gsa.cloud.database.bean.Food
;
import
com.gingersoft.gsa.cloud.database.bean.Food
;
import
com.gingersoft.gsa.cloud.database.bean.FoodCombo
;
import
com.gingersoft.gsa.cloud.database.bean.FoodModifier
;
import
com.gingersoft.gsa.cloud.database.bean.FoodModifier
;
import
com.gingersoft.gsa.cloud.database.bean.Function
;
import
com.gingersoft.gsa.cloud.database.bean.Function
;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
import
com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean
;
import
com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean
;
import
com.gingersoft.gsa.cloud.database.bean.ComboItem
;
import
com.gingersoft.gsa.cloud.database.bean.FoodCombo
;
import
com.gingersoft.gsa.cloud.database.greendao.ComboItemDao
;
import
com.gingersoft.gsa.cloud.database.greendao.FoodDao
;
import
com.gingersoft.gsa.cloud.database.greendao.FoodDao
;
import
com.gingersoft.gsa.cloud.database.greendao.FoodComboDao
;
import
com.gingersoft.gsa.cloud.database.greendao.FoodModifierDao
;
import
com.gingersoft.gsa.cloud.database.greendao.FoodModifierDao
;
import
com.gingersoft.gsa.cloud.database.greendao.FunctionDao
;
import
com.gingersoft.gsa.cloud.database.greendao.FunctionDao
;
import
com.gingersoft.gsa.cloud.database.greendao.ModifierDao
;
import
com.gingersoft.gsa.cloud.database.greendao.ModifierDao
;
import
com.gingersoft.gsa.cloud.database.greendao.PrinterDeviceBeanDao
;
import
com.gingersoft.gsa.cloud.database.greendao.PrinterDeviceBeanDao
;
import
com.gingersoft.gsa.cloud.database.greendao.ComboItemDao
;
import
com.gingersoft.gsa.cloud.database.greendao.FoodComboDao
;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
...
@@ -33,29 +33,35 @@ import com.gingersoft.gsa.cloud.database.greendao.FoodComboDao;
...
@@ -33,29 +33,35 @@ import com.gingersoft.gsa.cloud.database.greendao.FoodComboDao;
*/
*/
public
class
DaoSession
extends
AbstractDaoSession
{
public
class
DaoSession
extends
AbstractDaoSession
{
private
final
DaoConfig
comboItemDaoConfig
;
private
final
DaoConfig
foodDaoConfig
;
private
final
DaoConfig
foodDaoConfig
;
private
final
DaoConfig
foodComboDaoConfig
;
private
final
DaoConfig
foodModifierDaoConfig
;
private
final
DaoConfig
foodModifierDaoConfig
;
private
final
DaoConfig
functionDaoConfig
;
private
final
DaoConfig
functionDaoConfig
;
private
final
DaoConfig
modifierDaoConfig
;
private
final
DaoConfig
modifierDaoConfig
;
private
final
DaoConfig
printerDeviceBeanDaoConfig
;
private
final
DaoConfig
printerDeviceBeanDaoConfig
;
private
final
DaoConfig
comboItemDaoConfig
;
private
final
DaoConfig
foodComboDaoConfig
;
private
final
ComboItemDao
comboItemDao
;
private
final
FoodDao
foodDao
;
private
final
FoodDao
foodDao
;
private
final
FoodComboDao
foodComboDao
;
private
final
FoodModifierDao
foodModifierDao
;
private
final
FoodModifierDao
foodModifierDao
;
private
final
FunctionDao
functionDao
;
private
final
FunctionDao
functionDao
;
private
final
ModifierDao
modifierDao
;
private
final
ModifierDao
modifierDao
;
private
final
PrinterDeviceBeanDao
printerDeviceBeanDao
;
private
final
PrinterDeviceBeanDao
printerDeviceBeanDao
;
private
final
ComboItemDao
comboItemDao
;
private
final
FoodComboDao
foodComboDao
;
public
DaoSession
(
Database
db
,
IdentityScopeType
type
,
Map
<
Class
<?
extends
AbstractDao
<?,
?>>,
DaoConfig
>
public
DaoSession
(
Database
db
,
IdentityScopeType
type
,
Map
<
Class
<?
extends
AbstractDao
<?,
?>>,
DaoConfig
>
daoConfigMap
)
{
daoConfigMap
)
{
super
(
db
);
super
(
db
);
comboItemDaoConfig
=
daoConfigMap
.
get
(
ComboItemDao
.
class
).
clone
();
comboItemDaoConfig
.
initIdentityScope
(
type
);
foodDaoConfig
=
daoConfigMap
.
get
(
FoodDao
.
class
).
clone
();
foodDaoConfig
=
daoConfigMap
.
get
(
FoodDao
.
class
).
clone
();
foodDaoConfig
.
initIdentityScope
(
type
);
foodDaoConfig
.
initIdentityScope
(
type
);
foodComboDaoConfig
=
daoConfigMap
.
get
(
FoodComboDao
.
class
).
clone
();
foodComboDaoConfig
.
initIdentityScope
(
type
);
foodModifierDaoConfig
=
daoConfigMap
.
get
(
FoodModifierDao
.
class
).
clone
();
foodModifierDaoConfig
=
daoConfigMap
.
get
(
FoodModifierDao
.
class
).
clone
();
foodModifierDaoConfig
.
initIdentityScope
(
type
);
foodModifierDaoConfig
.
initIdentityScope
(
type
);
...
@@ -68,43 +74,45 @@ public class DaoSession extends AbstractDaoSession {
...
@@ -68,43 +74,45 @@ public class DaoSession extends AbstractDaoSession {
printerDeviceBeanDaoConfig
=
daoConfigMap
.
get
(
PrinterDeviceBeanDao
.
class
).
clone
();
printerDeviceBeanDaoConfig
=
daoConfigMap
.
get
(
PrinterDeviceBeanDao
.
class
).
clone
();
printerDeviceBeanDaoConfig
.
initIdentityScope
(
type
);
printerDeviceBeanDaoConfig
.
initIdentityScope
(
type
);
comboItemDaoConfig
=
daoConfigMap
.
get
(
ComboItemDao
.
class
).
clone
();
comboItemDao
=
new
ComboItemDao
(
comboItemDaoConfig
,
this
);
comboItemDaoConfig
.
initIdentityScope
(
type
);
foodComboDaoConfig
=
daoConfigMap
.
get
(
FoodComboDao
.
class
).
clone
();
foodComboDaoConfig
.
initIdentityScope
(
type
);
foodDao
=
new
FoodDao
(
foodDaoConfig
,
this
);
foodDao
=
new
FoodDao
(
foodDaoConfig
,
this
);
foodComboDao
=
new
FoodComboDao
(
foodComboDaoConfig
,
this
);
foodModifierDao
=
new
FoodModifierDao
(
foodModifierDaoConfig
,
this
);
foodModifierDao
=
new
FoodModifierDao
(
foodModifierDaoConfig
,
this
);
functionDao
=
new
FunctionDao
(
functionDaoConfig
,
this
);
functionDao
=
new
FunctionDao
(
functionDaoConfig
,
this
);
modifierDao
=
new
ModifierDao
(
modifierDaoConfig
,
this
);
modifierDao
=
new
ModifierDao
(
modifierDaoConfig
,
this
);
printerDeviceBeanDao
=
new
PrinterDeviceBeanDao
(
printerDeviceBeanDaoConfig
,
this
);
printerDeviceBeanDao
=
new
PrinterDeviceBeanDao
(
printerDeviceBeanDaoConfig
,
this
);
comboItemDao
=
new
ComboItemDao
(
comboItemDaoConfig
,
this
);
foodComboDao
=
new
FoodComboDao
(
foodComboDaoConfig
,
this
);
registerDao
(
ComboItem
.
class
,
comboItemDao
);
registerDao
(
Food
.
class
,
foodDao
);
registerDao
(
Food
.
class
,
foodDao
);
registerDao
(
FoodCombo
.
class
,
foodComboDao
);
registerDao
(
FoodModifier
.
class
,
foodModifierDao
);
registerDao
(
FoodModifier
.
class
,
foodModifierDao
);
registerDao
(
Function
.
class
,
functionDao
);
registerDao
(
Function
.
class
,
functionDao
);
registerDao
(
Modifier
.
class
,
modifierDao
);
registerDao
(
Modifier
.
class
,
modifierDao
);
registerDao
(
PrinterDeviceBean
.
class
,
printerDeviceBeanDao
);
registerDao
(
PrinterDeviceBean
.
class
,
printerDeviceBeanDao
);
registerDao
(
ComboItem
.
class
,
comboItemDao
);
registerDao
(
FoodCombo
.
class
,
foodComboDao
);
}
}
public
void
clear
()
{
public
void
clear
()
{
comboItemDaoConfig
.
clearIdentityScope
();
foodDaoConfig
.
clearIdentityScope
();
foodDaoConfig
.
clearIdentityScope
();
foodComboDaoConfig
.
clearIdentityScope
();
foodModifierDaoConfig
.
clearIdentityScope
();
foodModifierDaoConfig
.
clearIdentityScope
();
functionDaoConfig
.
clearIdentityScope
();
functionDaoConfig
.
clearIdentityScope
();
modifierDaoConfig
.
clearIdentityScope
();
modifierDaoConfig
.
clearIdentityScope
();
printerDeviceBeanDaoConfig
.
clearIdentityScope
();
printerDeviceBeanDaoConfig
.
clearIdentityScope
();
comboItemDaoConfig
.
clearIdentityScope
();
}
foodComboDaoConfig
.
clearIdentityScope
();
public
ComboItemDao
getComboItemDao
()
{
return
comboItemDao
;
}
}
public
FoodDao
getFoodDao
()
{
public
FoodDao
getFoodDao
()
{
return
foodDao
;
return
foodDao
;
}
}
public
FoodComboDao
getFoodComboDao
()
{
return
foodComboDao
;
}
public
FoodModifierDao
getFoodModifierDao
()
{
public
FoodModifierDao
getFoodModifierDao
()
{
return
foodModifierDao
;
return
foodModifierDao
;
}
}
...
@@ -121,12 +129,4 @@ public class DaoSession extends AbstractDaoSession {
...
@@ -121,12 +129,4 @@ public class DaoSession extends AbstractDaoSession {
return
printerDeviceBeanDao
;
return
printerDeviceBeanDao
;
}
}
public
ComboItemDao
getComboItemDao
()
{
return
comboItemDao
;
}
public
FoodComboDao
getFoodComboDao
()
{
return
foodComboDao
;
}
}
}
public-base/src/main/java/com/gingersoft/gsa/cloud/database/greendao/FoodDao.java
View file @
2718aa3f
...
@@ -93,8 +93,6 @@ public class FoodDao extends AbstractDao<Food, Long> {
...
@@ -93,8 +93,6 @@ public class FoodDao extends AbstractDao<Food, Long> {
public
final
static
Property
IsStatistic
=
new
Property
(
66
,
Long
.
class
,
"isStatistic"
,
false
,
"IS_STATISTIC"
);
public
final
static
Property
IsStatistic
=
new
Property
(
66
,
Long
.
class
,
"isStatistic"
,
false
,
"IS_STATISTIC"
);
}
}
private
DaoSession
daoSession
;
public
FoodDao
(
DaoConfig
config
)
{
public
FoodDao
(
DaoConfig
config
)
{
super
(
config
);
super
(
config
);
...
@@ -102,7 +100,6 @@ public class FoodDao extends AbstractDao<Food, Long> {
...
@@ -102,7 +100,6 @@ public class FoodDao extends AbstractDao<Food, Long> {
public
FoodDao
(
DaoConfig
config
,
DaoSession
daoSession
)
{
public
FoodDao
(
DaoConfig
config
,
DaoSession
daoSession
)
{
super
(
config
,
daoSession
);
super
(
config
,
daoSession
);
this
.
daoSession
=
daoSession
;
}
}
/** Creates the underlying database table. */
/** Creates the underlying database table. */
...
@@ -865,12 +862,6 @@ public class FoodDao extends AbstractDao<Food, Long> {
...
@@ -865,12 +862,6 @@ public class FoodDao extends AbstractDao<Food, Long> {
}
}
@Override
@Override
protected
final
void
attachEntity
(
Food
entity
)
{
super
.
attachEntity
(
entity
);
entity
.
__setDaoSession
(
daoSession
);
}
@Override
public
Long
readKey
(
Cursor
cursor
,
int
offset
)
{
public
Long
readKey
(
Cursor
cursor
,
int
offset
)
{
return
cursor
.
isNull
(
offset
+
0
)
?
null
:
cursor
.
getLong
(
offset
+
0
);
return
cursor
.
isNull
(
offset
+
0
)
?
null
:
cursor
.
getLong
(
offset
+
0
);
}
}
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/database/greendao/FoodModifierDao.java
View file @
2718aa3f
This diff is collapsed.
Click to expand it.
public-base/src/main/java/com/gingersoft/gsa/cloud/database/greendao/ModifierDao.java
View file @
2718aa3f
package
com
.
gingersoft
.
gsa
.
cloud
.
database
.
greendao
;
package
com
.
gingersoft
.
gsa
.
cloud
.
database
.
greendao
;
import
java.util.List
;
import
android.database.Cursor
;
import
android.database.Cursor
;
import
android.database.sqlite.SQLiteStatement
;
import
android.database.sqlite.SQLiteStatement
;
...
@@ -9,8 +8,6 @@ import org.greenrobot.greendao.Property;
...
@@ -9,8 +8,6 @@ import org.greenrobot.greendao.Property;
import
org.greenrobot.greendao.internal.DaoConfig
;
import
org.greenrobot.greendao.internal.DaoConfig
;
import
org.greenrobot.greendao.database.Database
;
import
org.greenrobot.greendao.database.Database
;
import
org.greenrobot.greendao.database.DatabaseStatement
;
import
org.greenrobot.greendao.database.DatabaseStatement
;
import
org.greenrobot.greendao.query.Query
;
import
org.greenrobot.greendao.query.QueryBuilder
;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
...
@@ -78,7 +75,6 @@ public class ModifierDao extends AbstractDao<Modifier, Long> {
...
@@ -78,7 +75,6 @@ public class ModifierDao extends AbstractDao<Modifier, Long> {
public
final
static
Property
IsStatistic
=
new
Property
(
48
,
Long
.
class
,
"isStatistic"
,
false
,
"IS_STATISTIC"
);
public
final
static
Property
IsStatistic
=
new
Property
(
48
,
Long
.
class
,
"isStatistic"
,
false
,
"IS_STATISTIC"
);
}
}
private
Query
<
Modifier
>
foodModifier_ModifiersQuery
;
public
ModifierDao
(
DaoConfig
config
)
{
public
ModifierDao
(
DaoConfig
config
)
{
super
(
config
);
super
(
config
);
...
@@ -788,18 +784,4 @@ public class ModifierDao extends AbstractDao<Modifier, Long> {
...
@@ -788,18 +784,4 @@ public class ModifierDao extends AbstractDao<Modifier, Long> {
return
true
;
return
true
;
}
}
/** Internal query to resolve the "modifiers" to-many relationship of FoodModifier. */
public
List
<
Modifier
>
_queryFoodModifier_Modifiers
(
Long
mid
)
{
synchronized
(
this
)
{
if
(
foodModifier_ModifiersQuery
==
null
)
{
QueryBuilder
<
Modifier
>
queryBuilder
=
queryBuilder
();
queryBuilder
.
where
(
Properties
.
Mid
.
eq
(
null
));
foodModifier_ModifiersQuery
=
queryBuilder
.
build
();
}
}
Query
<
Modifier
>
query
=
foodModifier_ModifiersQuery
.
forCurrentThread
();
query
.
setParameter
(
0
,
mid
);
return
query
.
list
();
}
}
}
public-base/src/main/java/com/gingersoft/gsa/cloud/database/utils/ComboItemDaoUtils.java
View file @
2718aa3f
package
com
.
gingersoft
.
gsa
.
cloud
.
database
.
utils
;
package
com
.
gingersoft
.
gsa
.
cloud
.
database
.
utils
;
import
android.content.Context
;
import
android.content.Context
;
import
android.database.Cursor
;
import
android.util.Log
;
import
android.util.Log
;
import
com.gingersoft.gsa.cloud.database.DaoManager
;
import
com.gingersoft.gsa.cloud.database.DaoManager
;
...
@@ -157,6 +158,35 @@ public class ComboItemDaoUtils {
...
@@ -157,6 +158,35 @@ public class ComboItemDaoUtils {
return
mManager
.
getDaoSession
().
queryRaw
(
ComboItem
.
class
,
sql
,
conditions
);
return
mManager
.
getDaoSession
().
queryRaw
(
ComboItem
.
class
,
sql
,
conditions
);
}
}
public
ArrayList
<
ComboItem
>
queryComboItemsByFidQueryBuilder
(
long
fid
)
{
ArrayList
<
ComboItem
>
comboItems
=
new
ArrayList
<>();
String
sql
=
"SELECT c.*,f.FOOD_NAME,f.FOOD_NAME1,f.FOOD_NAME2,f.PRICE,f.AUTO_MOD FROM COMBO_ITEM c join FOOD f on c.FID=f._id join FOOD_COMBO r on r.COM_ID=c.COM_ID "
;
if
(
fid
>
0
)
{
sql
=
sql
+
" where r.FID='"
+
fid
+
"'"
;
}
Cursor
c
=
mManager
.
getDaoSession
().
getFoodDao
().
getDatabase
().
rawQuery
(
sql
,
null
);
while
(
c
.
moveToNext
())
{
ComboItem
order
=
new
ComboItem
();
order
.
setFid
(
c
.
getLong
(
c
.
getColumnIndex
(
"_id"
)));
order
.
setComId
(
c
.
getLong
(
c
.
getColumnIndex
(
"COM_ID"
)));
order
.
setPrice
(
c
.
getDouble
(
c
.
getColumnIndex
(
"PRICE"
)));
order
.
setSeqNo
(
c
.
getLong
(
c
.
getColumnIndex
(
"SEQ_NO"
)));
order
.
setQty
(
c
.
getLong
(
c
.
getColumnIndex
(
"QTY"
)));
order
.
setName
(
c
.
getString
(
c
.
getColumnIndex
(
"FOOD_NAME"
)));
order
.
setName1
(
c
.
getString
(
c
.
getColumnIndex
(
"FOOD_NAME1"
)));
order
.
setName2
(
c
.
getString
(
c
.
getColumnIndex
(
"FOOD_NAME2"
)));
order
.
setVisible
(
c
.
getLong
(
c
.
getColumnIndex
(
"VISIBLE"
)));
order
.
setAutoMode
(
c
.
getInt
(
c
.
getColumnIndex
(
"AUTO_MOD"
))
);
// if (order.isVisible()) {
comboItems
.
add
(
order
);
// }
}
c
.
close
();
return
comboItems
;
}
/**
/**
* 使用queryBuilder进行查询食品
* 使用queryBuilder进行查询食品
*
*
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/database/utils/FoodComboDaoUtils.java
View file @
2718aa3f
...
@@ -173,7 +173,7 @@ public class FoodComboDaoUtils {
...
@@ -173,7 +173,7 @@ public class FoodComboDaoUtils {
for
(
int
i
=
0
;
i
<
foodCombos
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
foodCombos
.
size
();
i
++)
{
Food
food
=
foodDao
.
queryFoodByFidQueryBuilder
(
foodCombos
.
get
(
i
).
getFid
());
Food
food
=
foodDao
.
queryFoodByFidQueryBuilder
(
foodCombos
.
get
(
i
).
getFid
());
if
(
food
!=
null
)
{
if
(
food
!=
null
)
{
list
.
add
(
FoodCombo
.
addFoodInfo
(
food
,
foodCombos
.
get
(
i
)
));
list
.
add
(
foodCombos
.
get
(
i
));
}
}
}
}
}
}
...
@@ -192,7 +192,7 @@ public class FoodComboDaoUtils {
...
@@ -192,7 +192,7 @@ public class FoodComboDaoUtils {
for
(
int
i
=
0
;
i
<
foodCombos
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
foodCombos
.
size
();
i
++)
{
Food
food
=
foodDao
.
queryFoodByFidQueryBuilder
(
foodCombos
.
get
(
i
).
getFid
());
Food
food
=
foodDao
.
queryFoodByFidQueryBuilder
(
foodCombos
.
get
(
i
).
getFid
());
if
(
food
!=
null
)
{
if
(
food
!=
null
)
{
list
.
add
(
FoodCombo
.
addFoodInfo
(
food
,
foodCombos
.
get
(
i
)
));
list
.
add
(
foodCombos
.
get
(
i
));
}
}
}
}
}
}
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/database/utils/FoodDaoUtils.java
View file @
2718aa3f
package
com
.
gingersoft
.
gsa
.
cloud
.
database
.
utils
;
package
com
.
gingersoft
.
gsa
.
cloud
.
database
.
utils
;
import
android.content.Context
;
import
android.content.Context
;
import
android.database.Cursor
;
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.ComboItem
;
import
com.gingersoft.gsa.cloud.database.bean.Food
;
import
com.gingersoft.gsa.cloud.database.bean.Food
;
import
com.gingersoft.gsa.cloud.database.bean.FoodCombo
;
import
com.gingersoft.gsa.cloud.database.bean.FoodCombo
;
import
com.gingersoft.gsa.cloud.database.greendao.FoodComboDao
;
import
com.gingersoft.gsa.cloud.database.greendao.FoodComboDao
;
...
@@ -203,21 +205,7 @@ public class FoodDaoUtils {
...
@@ -203,21 +205,7 @@ public class FoodDaoUtils {
public
Food
queryFoodByQueryBuilder
(
String
plu
)
{
public
Food
queryFoodByQueryBuilder
(
String
plu
)
{
QueryBuilder
<
Food
>
queryBuilder
=
mManager
.
getDaoSession
().
queryBuilder
(
Food
.
class
);
QueryBuilder
<
Food
>
queryBuilder
=
mManager
.
getDaoSession
().
queryBuilder
(
Food
.
class
);
return
queryBuilder
.
where
(
FoodDao
.
Properties
.
Plu
.
eq
(
plu
)).
build
().
unique
();
return
queryBuilder
.
where
(
FoodDao
.
Properties
.
Plu
.
eq
(
plu
)).
build
().
unique
();
}
}
public
Food
queryFoodByFidQueryBuilder2
(
long
fid
)
{
QueryBuilder
<
Food
>
queryBuilder
=
mManager
.
getDaoSession
().
queryBuilder
(
Food
.
class
);
queryBuilder
.
join
(
FoodCombo
.
class
,
FoodComboDao
.
Properties
.
ComId
).
where
(
FoodComboDao
.
Properties
.
Fid
.
eq
(
fid
));
String
sql
;
sql
=
"SELECT c.*,f.FOOD_NAME,f.FOOD_NAME1,f.FOOD_NAME2 FROM COMBO_ITEM c join FOOD f on c.FID=f._id join FOOD_COMBO r on r.COMID=c.COMID "
;
if
(
fid
>
0
)
{
sql
=
sql
+
" where r.FID='"
+
fid
+
"'"
;
}
List
<
Food
>
foodList
=
queryFoodByNativeSql
(
sql
,
null
);
return
queryBuilder
.
where
(
FoodDao
.
Properties
.
Id
.
eq
(
fid
)).
build
().
unique
();
}
}
}
public-base/src/main/java/com/gingersoft/gsa/cloud/database/utils/FoodModifierDaoUtils.java
View file @
2718aa3f
...
@@ -147,19 +147,20 @@ public class FoodModifierDaoUtils {
...
@@ -147,19 +147,20 @@ public class FoodModifierDaoUtils {
* @return
* @return
*/
*/
public
List
<
Modifier
>
queryModifiersByQueryBuilder
(
long
fid
)
{
public
List
<
Modifier
>
queryModifiersByQueryBuilder
(
long
fid
)
{
List
<
FoodModifier
>
foodModifiers
=
queryFoodModifiersByMidQueryBuilder
(
fid
);
List
<
FoodModifier
>
foodModifiers
=
queryFoodModifiersByMidQueryBuilder
(
fid
);
List
<
Modifier
>
list
=
new
ArrayList
<>();
List
<
Modifier
>
list
=
new
ArrayList
<>();
ModifierDaoUtils
modifierDao
=
new
ModifierDaoUtils
(
mContext
);
ModifierDaoUtils
modifierDao
=
new
ModifierDaoUtils
(
mContext
);
if
(
foodModifiers
!=
null
)
{
if
(
foodModifiers
!=
null
)
{
for
(
int
i
=
0
;
i
<
foodModifiers
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
foodModifiers
.
size
();
i
++)
{
Modifier
modifier
=
modifierDao
.
queryModifierByQueryBuilder
(
foodModifiers
.
get
(
i
).
getMid
());
// Modifier modifier = modifierDao.queryModifierByQueryBuilder(foodModifiers.get(i).getMid());
if
(
modifier
!=
null
)
{
// List<Modifier> modifiers = foodModifiers.get(i).getModifiers();
modifier
.
setFid
(
fid
);
// if (modifiers != null) {
list
.
add
(
modifier
);
//// modifier.setFid(fid);
}
// list.addAll(modifiers);
// }
}
}
}
}
return
list
;
return
list
;
}
}
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/database/utils/ModifierDaoUtils.java
View file @
2718aa3f
This diff is collapsed.
Click to expand it.
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/contract/BaseOrderContract.java
View file @
2718aa3f
...
@@ -35,6 +35,10 @@ public interface BaseOrderContract {
...
@@ -35,6 +35,10 @@ public interface BaseOrderContract {
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface
Model
extends
IModel
{
interface
Model
extends
IModel
{
Observable
<
BaseResult
>
createOrder
(
RequestBody
requestBody
);
Observable
<
BaseResult
>
addFood
(
RequestBody
requestBody
);
Observable
<
BaseResult
>
updateOrderStatus
(
RequestBody
formBody
);
Observable
<
BaseResult
>
updateOrderStatus
(
RequestBody
formBody
);
}
}
...
...
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/contract/MealStandContract.java
View file @
2718aa3f
...
@@ -4,6 +4,7 @@ import android.app.Activity;
...
@@ -4,6 +4,7 @@ import android.app.Activity;
import
android.widget.BaseAdapter
;
import
android.widget.BaseAdapter
;
import
com.gingersoft.gsa.cloud.base.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.base.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.database.bean.ComboItem
;
import
com.gingersoft.gsa.cloud.database.bean.FoodCombo
;
import
com.gingersoft.gsa.cloud.database.bean.FoodCombo
;
import
com.gingersoft.gsa.cloud.database.bean.FoodModifier
;
import
com.gingersoft.gsa.cloud.database.bean.FoodModifier
;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
...
@@ -96,9 +97,9 @@ public interface MealStandContract {
...
@@ -96,9 +97,9 @@ public interface MealStandContract {
Observable
<
BaseRespose
>
loadOrder
(
int
orderId
);
Observable
<
BaseRespose
>
loadOrder
(
int
orderId
);
Observable
<
BaseResult
>
createOrder
(
RequestBody
requestBody
);
//
Observable<BaseResult> createOrder(RequestBody requestBody);
//
Observable
<
BaseResult
>
addFood
(
RequestBody
requestBody
);
//
Observable<BaseResult> addFood(RequestBody requestBody);
Observable
<
BaseRespose
>
deleteFood
(
RequestBody
requestBody
);
Observable
<
BaseRespose
>
deleteFood
(
RequestBody
requestBody
);
...
@@ -110,7 +111,7 @@ public interface MealStandContract {
...
@@ -110,7 +111,7 @@ public interface MealStandContract {
List
<
Modifier
>
queryDB_ModifierList
(
long
fid
);
List
<
Modifier
>
queryDB_ModifierList
(
long
fid
);
List
<
FoodCombo
>
queryDB_ComboList
(
long
fid
);
List
<
ComboItem
>
queryDB_ComboList
(
long
fid
);
List
<
FoodCombo
>
isComboFood
(
long
fid
);
List
<
FoodCombo
>
isComboFood
(
long
fid
);
...
...
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/contract/OrderContentContract.java
View file @
2718aa3f
...
@@ -54,9 +54,9 @@ public interface OrderContentContract {
...
@@ -54,9 +54,9 @@ public interface OrderContentContract {
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface
Model
extends
BaseOrderContract
.
Model
{
interface
Model
extends
BaseOrderContract
.
Model
{
Observable
<
BaseResult
>
createOrder
(
RequestBody
requestBody
);
//
Observable<BaseResult> createOrder(RequestBody requestBody);
//
Observable
<
BaseResult
>
addFood
(
RequestBody
requestBody
);
//
Observable<BaseResult> addFood(RequestBody requestBody);
Observable
<
BaseRespose
>
printOrder
(
RequestBody
request
);
Observable
<
BaseRespose
>
printOrder
(
RequestBody
request
);
}
}
...
...
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/MealStandModel.java
View file @
2718aa3f
...
@@ -8,8 +8,10 @@ import com.gingersoft.gsa.cloud.database.bean.ComboItem;
...
@@ -8,8 +8,10 @@ import com.gingersoft.gsa.cloud.database.bean.ComboItem;
import
com.gingersoft.gsa.cloud.database.bean.FoodCombo
;
import
com.gingersoft.gsa.cloud.database.bean.FoodCombo
;
import
com.gingersoft.gsa.cloud.database.bean.FoodModifier
;
import
com.gingersoft.gsa.cloud.database.bean.FoodModifier
;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
import
com.gingersoft.gsa.cloud.database.utils.ComboItemDaoUtils
;
import
com.gingersoft.gsa.cloud.database.utils.FoodComboDaoUtils
;
import
com.gingersoft.gsa.cloud.database.utils.FoodComboDaoUtils
;
import
com.gingersoft.gsa.cloud.database.utils.FoodModifierDaoUtils
;
import
com.gingersoft.gsa.cloud.database.utils.FoodModifierDaoUtils
;
import
com.gingersoft.gsa.cloud.database.utils.ModifierDaoUtils
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.BaseRespose
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.BaseRespose
;
import
com.gingersoft.gsa.cloud.database.bean.Food
;
import
com.gingersoft.gsa.cloud.database.bean.Food
;
import
com.gingersoft.gsa.cloud.database.utils.FoodDaoUtils
;
import
com.gingersoft.gsa.cloud.database.utils.FoodDaoUtils
;
...
@@ -116,17 +118,14 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
...
@@ -116,17 +118,14 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
@Override
@Override
public
List
<
Modifier
>
queryDB_ModifierList
(
long
fid
)
{
public
List
<
Modifier
>
queryDB_ModifierList
(
long
fid
)
{
FoodModifierDaoUtils
modifierDao
=
new
Food
ModifierDaoUtils
(
mApplication
);
ModifierDaoUtils
daoUtils
=
new
ModifierDaoUtils
(
mApplication
);
return
modifierDao
.
queryModifiersByQueryBuilder
(
fid
);
return
daoUtils
.
queryModifiersByFid
(
fid
,
ModifierDaoUtils
.
modifierMode_All
);
}
}
@Override
@Override
public
List
<
FoodCombo
>
queryDB_ComboList
(
long
fid
)
{
public
List
<
ComboItem
>
queryDB_ComboList
(
long
fid
)
{
FoodComboDaoUtils
foodComboDaoUtils
=
new
FoodComboDaoUtils
(
mApplication
);
ComboItemDaoUtils
comboItemDao
=
new
ComboItemDaoUtils
(
mApplication
);
List
<
FoodCombo
>
foodCombo
=
foodComboDaoUtils
.
queryCombosByQueryBuilder
(
fid
);
List
<
ComboItem
>
foodCombo
=
comboItemDao
.
queryComboItemsByFidQueryBuilder
(
fid
);
FoodDaoUtils
foodDaoUtils
=
new
FoodDaoUtils
(
mApplication
);
Food
food
=
foodDaoUtils
.
queryFoodByFidQueryBuilder2
(
fid
);
return
foodCombo
;
return
foodCombo
;
}
}
...
...
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/OrderPayModel.java
View file @
2718aa3f
...
@@ -4,6 +4,7 @@ import android.app.Application;
...
@@ -4,6 +4,7 @@ import android.app.Application;
import
com.gingersoft.gsa.cloud.base.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.base.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.table.mvp.contract.OrderPayContract
;
import
com.gingersoft.gsa.cloud.table.mvp.contract.OrderPayContract
;
import
com.gingersoft.gsa.cloud.table.mvp.model.service.MealService
;
import
com.gingersoft.gsa.cloud.table.mvp.model.service.OrderPayService
;
import
com.gingersoft.gsa.cloud.table.mvp.model.service.OrderPayService
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.di.scope.ActivityScope
;
...
@@ -54,6 +55,18 @@ public class OrderPayModel extends BaseModel implements OrderPayContract.Model {
...
@@ -54,6 +55,18 @@ public class OrderPayModel extends BaseModel implements OrderPayContract.Model {
}
}
@Override
@Override
public
Observable
<
BaseResult
>
createOrder
(
RequestBody
requestBody
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
MealService
.
class
)
.
createOrder
(
requestBody
);
}
@Override
public
Observable
<
BaseResult
>
addFood
(
RequestBody
requestBody
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
MealService
.
class
)
.
addFood
(
requestBody
);
}
@Override
public
Observable
<
BaseResult
>
updateOrderStatus
(
RequestBody
formBody
)
{
public
Observable
<
BaseResult
>
updateOrderStatus
(
RequestBody
formBody
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
OrderPayService
.
class
)
return
mRepositoryManager
.
obtainRetrofitService
(
OrderPayService
.
class
)
.
updateOrderStatus
(
formBody
);
.
updateOrderStatus
(
formBody
);
...
...
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/BaseOrderPresenter.java
View file @
2718aa3f
...
@@ -138,9 +138,9 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
...
@@ -138,9 +138,9 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
if
(
datasBean
.
getNumber
()
==
1
)
{
if
(
datasBean
.
getNumber
()
==
1
)
{
mSelectMealAdapter
.
removeFoodItem
();
mSelectMealAdapter
.
removeFoodItem
();
}
else
{
}
else
{
MyOrderManage
.
getInstance
().
changeNumber
(
datasBean
.
getNumber
()
-
1
);
changeNumber
(
datasBean
.
getNumber
()
-
1
);
}
}
mSelectMealAdapter
.
notify
ItemChanged
(
position
);
mSelectMealAdapter
.
notify
DataSetChanged
(
);
// recalcOrderMoneyCount(false, true);
// recalcOrderMoneyCount(false, true);
if
(
mOrderContentActivity
!=
null
)
{
if
(
mOrderContentActivity
!=
null
)
{
mOrderContentActivity
.
initOrderDetail
();
mOrderContentActivity
.
initOrderDetail
();
...
@@ -149,8 +149,7 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
...
@@ -149,8 +149,7 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
@Override
@Override
public
void
onMealCountAdd
(
OrderDetail
datasBean
,
int
position
)
{
public
void
onMealCountAdd
(
OrderDetail
datasBean
,
int
position
)
{
MyOrderManage
.
getInstance
().
changeNumber
(
datasBean
.
getNumber
()
+
1
);
changeNumber
(
datasBean
.
getNumber
()
-
1
);
mSelectMealAdapter
.
notifyItemChanged
(
position
);
if
(
mOrderContentActivity
!=
null
)
{
if
(
mOrderContentActivity
!=
null
)
{
mOrderContentActivity
.
initOrderDetail
();
mOrderContentActivity
.
initOrderDetail
();
}
}
...
@@ -214,6 +213,19 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
...
@@ -214,6 +213,19 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
return
true
;
return
true
;
}
}
/**
* 創建訂單后保存OrderId
* @param orderId
*/
protected
void
setOrderId
(
double
orderId
){
OrderBean
orderBean
=
new
OrderBean
();
orderBean
.
setId
((
int
)
orderId
);
MyOrderManage
.
getInstance
().
setOrderBean
(
orderBean
);
}
/**
* 重置選中狀態
*/
public
void
resetSelected
()
{
public
void
resetSelected
()
{
for
(
int
i
=
0
;
i
<
orderFoodList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
orderFoodList
.
size
();
i
++)
{
OrderDetail
datasBean
=
orderFoodList
.
get
(
i
);
OrderDetail
datasBean
=
orderFoodList
.
get
(
i
);
...
@@ -307,6 +319,20 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
...
@@ -307,6 +319,20 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
return
orderDetails
;
return
orderDetails
;
}
}
protected
boolean
hasNesOrderFoods
()
{
if
(
getNewOrderFoodLists
().
size
()
>
0
)
{
return
true
;
}
return
false
;
}
protected
boolean
hasOldOrderFoods
()
{
if
(
getOldOrderFoodLists
().
size
()
>
0
)
{
return
true
;
}
return
false
;
}
public
List
<
OrderDetail
>
getOrderFoodLists
()
{
public
List
<
OrderDetail
>
getOrderFoodLists
()
{
return
myOrderManage
.
getOrderFoodList
();
return
myOrderManage
.
getOrderFoodList
();
}
}
...
...
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/FineItemAllPresenter.java
View file @
2718aa3f
...
@@ -259,7 +259,7 @@ public class FineItemAllPresenter extends BasePresenter<FineItemAllContract.Mode
...
@@ -259,7 +259,7 @@ public class FineItemAllPresenter extends BasePresenter<FineItemAllContract.Mode
//获取数据
//获取数据
ModifierDaoUtils
modifierDaoUtils
=
new
ModifierDaoUtils
(
mApplication
);
ModifierDaoUtils
modifierDaoUtils
=
new
ModifierDaoUtils
(
mApplication
);
List
<
Modifier
>
modifierList
=
modifierDaoUtils
.
queryModifierByTopidAndVisibleQueryBuilder
(
fid
,
0
);
List
<
Modifier
>
modifierList
=
modifierDaoUtils
.
queryModifierByTopidAndVisibleQueryBuilder
(
fid
);
if
(
modifierList
==
null
||
modifierList
.
size
()
==
0
)
{
if
(
modifierList
==
null
||
modifierList
.
size
()
==
0
)
{
return
;
return
;
...
...
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/FineItemKindPresenter.java
View file @
2718aa3f
...
@@ -266,7 +266,7 @@ public class FineItemKindPresenter extends BasePresenter<FineItemKindContract.Mo
...
@@ -266,7 +266,7 @@ public class FineItemKindPresenter extends BasePresenter<FineItemKindContract.Mo
//获取数据
//获取数据
ModifierDaoUtils
modifierDaoUtils
=
new
ModifierDaoUtils
(
mApplication
);
ModifierDaoUtils
modifierDaoUtils
=
new
ModifierDaoUtils
(
mApplication
);
List
<
Modifier
>
modifierList
=
modifierDaoUtils
.
queryModifierByTopidAndVisibleQueryBuilder
(
fid
,
0
);
List
<
Modifier
>
modifierList
=
modifierDaoUtils
.
queryModifierByTopidAndVisibleQueryBuilder
(
fid
);
if
(
modifierList
==
null
||
modifierList
.
size
()
==
0
)
{
if
(
modifierList
==
null
||
modifierList
.
size
()
==
0
)
{
return
;
return
;
...
...
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/MealStandPresenter.java
View file @
2718aa3f
...
@@ -12,6 +12,7 @@ import com.gingersoft.gsa.cloud.base.common.bean.OrderDetail;
...
@@ -12,6 +12,7 @@ import com.gingersoft.gsa.cloud.base.common.bean.OrderDetail;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage
;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage
;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.OpenTableManage
;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.OpenTableManage
;
import
com.gingersoft.gsa.cloud.base.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.base.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.database.bean.ComboItem
;
import
com.gingersoft.gsa.cloud.database.bean.FoodCombo
;
import
com.gingersoft.gsa.cloud.database.bean.FoodCombo
;
import
com.gingersoft.gsa.cloud.database.bean.Food
;
import
com.gingersoft.gsa.cloud.database.bean.Food
;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
...
@@ -82,9 +83,9 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -82,9 +83,9 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
private
List
<
Food
>
mFoodGroupList
=
new
ArrayList
<>();
private
List
<
Food
>
mFoodGroupList
=
new
ArrayList
<>();
private
List
<
Food
>
mFoodList
=
new
ArrayList
<>();
private
List
<
Food
>
mFoodList
=
new
ArrayList
<>();
//套餐细项数据
//套餐细项数据
private
List
<
FoodCombo
>
mFoodComboList
=
new
ArrayList
<>();
private
List
<
ComboItem
>
mFoodComboList
=
new
ArrayList
<>();
private
List
<
FoodCombo
>
mCurrentFoodComboList
;
private
List
<
ComboItem
>
mCurrentFoodComboList
;
private
OrderDetail
mCurrentOrderDetailBean
;
private
OrderDetail
mCurrentOrderDetailBean
;
private
boolean
RvMealClicked
;
private
boolean
RvMealClicked
;
...
@@ -147,6 +148,10 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -147,6 +148,10 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
public
void
onItemClick
(
OrderDetail
datasBean
,
int
position
)
{
public
void
onItemClick
(
OrderDetail
datasBean
,
int
position
)
{
RvMealClicked
=
true
;
RvMealClicked
=
true
;
mRootView
.
recordOperat
(
true
);
mRootView
.
recordOperat
(
true
);
//设置当前操作的食品
mCurrentOrderDetailBean
=
datasBean
;
mSelectMealAdapter
.
setMyOrderManageSelectPosition
();
mSelectMealAdapter
.
setMyOrderManageSelectPosition
();
loadComboData
(
datasBean
,
true
);
loadComboData
(
datasBean
,
true
);
}
}
...
@@ -178,7 +183,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -178,7 +183,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
mComboAdapter
.
setOnItemClickListener
(
new
ComboAdapter
.
OnItemClickListener
()
{
mComboAdapter
.
setOnItemClickListener
(
new
ComboAdapter
.
OnItemClickListener
()
{
@Override
@Override
public
void
onItemClick
(
FoodCombo
datasBean
,
int
position
)
{
public
void
onItemClick
(
ComboItem
datasBean
,
int
position
)
{
mRootView
.
recordOperat
(
true
);
mRootView
.
recordOperat
(
true
);
...
@@ -197,7 +202,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -197,7 +202,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
addModifierItem
(
datasBean
.
getModifier
());
addModifierItem
(
datasBean
.
getModifier
());
}
else
{
}
else
{
//设置当前操作的套餐细项
//设置当前操作的套餐细项
mCurrentOrderDetailBean
=
OrderDetail
.
comboTransOrderDetail
(
datasBean
,
1
,
"combo"
,
RvMealClicked
);
mCurrentOrderDetailBean
=
OrderDetail
.
comboTransOrderDetail
(
datasBean
,
1
,
mCurrentOrderDetailBean
.
getId
(),
"combo"
,
RvMealClicked
);
//先清除上一次选择的子项最大数
//先清除上一次选择的子项最大数
// mModel.clearComboQty();
// mModel.clearComboQty();
//添加子项
//添加子项
...
@@ -222,16 +227,16 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -222,16 +227,16 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
int
addPosition
=
mSelectMealAdapter
.
addFoodItem
(
orderDetail
);
int
addPosition
=
mSelectMealAdapter
.
addFoodItem
(
orderDetail
);
if
(
orderDetail
.
getComboLevel
()
>
0
)
{
//
if (orderDetail.getComboLevel() > 0) {
//自动添加组合子食品
//
//自动添加组合子食品
if
(
mCurrentFoodComboList
!=
null
&&
mCurrentFoodComboList
.
size
()
>
0
)
{
//
if (mCurrentFoodComboList != null && mCurrentFoodComboList.size() > 0) {
for
(
int
i
=
0
;
i
<
mCurrentFoodComboList
.
size
();
i
++)
{
//
for (int i = 0; i < mCurrentFoodComboList.size(); i++) {
FoodCombo
foodComboItem
=
mCurrentFoodComboList
.
get
(
i
);
// ComboItem
foodComboItem = mCurrentFoodComboList.get(i);
mCurrentOrderDetailBean
=
OrderDetail
.
comboTransOrderDetail
(
foodComboItem
,
1
,
"combo"
,
RvMealClicked
);
// mCurrentOrderDetailBean = OrderDetail.comboTransOrderDetail(foodComboItem, 1, mCurrentOrderDetailBean.getId(),
"combo", RvMealClicked);
addPosition
=
addComboItem
(
mCurrentOrderDetailBean
);
//
addPosition = addComboItem(mCurrentOrderDetailBean);
}
//
}
}
//
}
}
//
}
// if (mAutoModifierList != null && mAutoModifierList.size() > 0) {
// if (mAutoModifierList != null && mAutoModifierList.size() > 0) {
// //自动添加mixqty>1細項
// //自动添加mixqty>1細項
...
@@ -282,7 +287,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -282,7 +287,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
//设置备注细项背景、字体颜色
//设置备注细项背景、字体颜色
modfier
.
setBgColor
(
Color
.
parseColor
(
"#ffeb3b"
));
modfier
.
setBgColor
(
Color
.
parseColor
(
"#ffeb3b"
));
FoodCombo
foodComboItem
=
new
FoodCombo
();
ComboItem
foodComboItem
=
new
ComboItem
();
foodComboItem
.
setModifier
(
true
);
foodComboItem
.
setModifier
(
true
);
// if (modfier.isParent()) {
// if (modfier.isParent()) {
// foodComboItem.setModKeyboard(modfier.isModKeyboard());
// foodComboItem.setModKeyboard(modfier.isModKeyboard());
...
@@ -296,7 +301,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -296,7 +301,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
updateComboData
(
mCurrentFoodComboList
);
updateComboData
(
mCurrentFoodComboList
);
// if (food.getAutoMod() == 1) {
// if (food.getAutoMod() == 1) {
if
(
isSelectedMeal
)
{
if
(
isSelectedMeal
||
mCurrentFoodComboList
.
size
()
>
0
)
{
mRootView
.
showViewModeVisibility
(
MealConstant
.
combo_ViewMode
);
mRootView
.
showViewModeVisibility
(
MealConstant
.
combo_ViewMode
);
}
}
// }
// }
...
@@ -317,6 +322,9 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -317,6 +322,9 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
@Override
@Override
public
void
onNext
(
@NonNull
BaseResult
info
)
{
public
void
onNext
(
@NonNull
BaseResult
info
)
{
if
(
info
!=
null
&&
info
.
isSuccess
())
{
if
(
info
!=
null
&&
info
.
isSuccess
())
{
if
(
info
.
getData
()
!=
null
)
{
setOrderId
((
Double
)
info
.
getData
());
}
mRootView
.
showMessage
(
"送單成功"
);
mRootView
.
showMessage
(
"送單成功"
);
printSendOrder
(
MyOrderManage
.
getInstance
().
getOrderFoodList
());
printSendOrder
(
MyOrderManage
.
getInstance
().
getOrderFoodList
());
IActivity
.
returnTableActivity
(
true
);
IActivity
.
returnTableActivity
(
true
);
...
@@ -353,8 +361,8 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -353,8 +361,8 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
printSendOrder
(
newFoods
);
printSendOrder
(
newFoods
);
mRootView
.
killMyself
();
mRootView
.
killMyself
();
}
else
{
}
else
{
if
(
getNewOrderFoodLists
().
size
()
==
0
)
{
if
(
!
hasNesOrderFoods
()
)
{
//未新增食品點擊送單 後台不讓過直接提示即可
//
TODO
未新增食品點擊送單 後台不讓過直接提示即可
mRootView
.
showMessage
(
"送單成功"
);
mRootView
.
showMessage
(
"送單成功"
);
if
(
OpenTableManage
.
getDefault
()
!=
null
)
{
if
(
OpenTableManage
.
getDefault
()
!=
null
)
{
//通知更新餐台状态
//通知更新餐台状态
...
@@ -789,7 +797,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -789,7 +797,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
mFoodAdapter
.
notifyDataSetChanged
();
mFoodAdapter
.
notifyDataSetChanged
();
}
}
private
void
updateComboData
(
List
<
FoodCombo
>
foodComboList
)
{
private
void
updateComboData
(
List
<
ComboItem
>
foodComboList
)
{
mFoodComboList
.
clear
();
mFoodComboList
.
clear
();
mFoodComboList
.
addAll
(
foodComboList
);
mFoodComboList
.
addAll
(
foodComboList
);
//根据Item个数显示每一行的个数
//根据Item个数显示每一行的个数
...
...
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderContentPresenter.java
View file @
2718aa3f
...
@@ -144,6 +144,9 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -144,6 +144,9 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
@Override
@Override
public
void
onNext
(
@NonNull
BaseResult
info
)
{
public
void
onNext
(
@NonNull
BaseResult
info
)
{
if
(
info
!=
null
&&
info
.
isSuccess
())
{
if
(
info
!=
null
&&
info
.
isSuccess
())
{
if
(
info
.
getData
()
!=
null
)
{
setOrderId
((
Double
)
info
.
getData
());
}
if
(
isPrint
)
{
if
(
isPrint
)
{
printOrder
(
OpenTableManage
.
getDefault
().
getTableBean
().
getId
());
printOrder
(
OpenTableManage
.
getDefault
().
getTableBean
().
getId
());
}
else
{
}
else
{
...
@@ -193,8 +196,8 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -193,8 +196,8 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
if
(
isPrint
)
{
if
(
isPrint
)
{
printOrder
(
OpenTableManage
.
getDefault
().
getTableBean
().
getId
());
printOrder
(
OpenTableManage
.
getDefault
().
getTableBean
().
getId
());
}
else
{
}
else
{
if
(
getNewOrderFoodLists
().
size
()
==
0
){
if
(
!
hasNesOrderFoods
()
){
//未新增食品點擊送單 後台不讓過直接提示即可
//
TODO
未新增食品點擊送單 後台不讓過直接提示即可
mRootView
.
showMessage
(
"送單成功"
);
mRootView
.
showMessage
(
"送單成功"
);
printSendOrder
(
newFoods
);
printSendOrder
(
newFoods
);
mRootView
.
sendSuccess
();
mRootView
.
sendSuccess
();
...
...
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderPayPresenter.java
View file @
2718aa3f
...
@@ -7,6 +7,8 @@ import android.view.View;
...
@@ -7,6 +7,8 @@ import android.view.View;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.base.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.base.common.bean.OrderBean
;
import
com.gingersoft.gsa.cloud.base.common.bean.OrderDetail
;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage
;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage
;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.OpenTableManage
;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.OpenTableManage
;
import
com.gingersoft.gsa.cloud.base.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.base.utils.JsonUtils
;
...
@@ -14,6 +16,8 @@ import com.gingersoft.gsa.cloud.base.utils.MoneyUtil;
...
@@ -14,6 +16,8 @@ import com.gingersoft.gsa.cloud.base.utils.MoneyUtil;
import
com.gingersoft.gsa.cloud.table.app.payment.PayConstant
;
import
com.gingersoft.gsa.cloud.table.app.payment.PayConstant
;
import
com.gingersoft.gsa.cloud.table.mvp.contract.OrderPayContract
;
import
com.gingersoft.gsa.cloud.table.mvp.contract.OrderPayContract
;
import
com.gingersoft.gsa.cloud.base.common.bean.PayMethod
;
import
com.gingersoft.gsa.cloud.base.common.bean.PayMethod
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.request.OrderRequest
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.MealStandActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.OrderPayActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.OrderPayActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.adapter.BillMethodAdapter
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.adapter.BillMethodAdapter
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.adapter.BillMoneyAdapter
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.adapter.BillMoneyAdapter
;
...
@@ -28,10 +32,12 @@ import java.util.List;
...
@@ -28,10 +32,12 @@ import java.util.List;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.annotations.NonNull
;
import
io.reactivex.schedulers.Schedulers
;
import
io.reactivex.schedulers.Schedulers
;
import
me.jessyan.rxerrorhandler.core.RxErrorHandler
;
import
me.jessyan.rxerrorhandler.core.RxErrorHandler
;
import
me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber
;
import
me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber
;
import
okhttp3.FormBody
;
import
okhttp3.FormBody
;
import
okhttp3.MediaType
;
import
okhttp3.RequestBody
;
import
okhttp3.RequestBody
;
...
@@ -187,12 +193,12 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
...
@@ -187,12 +193,12 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
.
build
();
.
build
();
mModel
.
updateOrderStatus
(
requestBody
)
mModel
.
updateOrderStatus
(
requestBody
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
null
))
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doAfterTerminate
(()
->
mRootView
.
hideLoading
())
.
doAfterTerminate
(()
->
mRootView
.
hideLoading
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
@Override
@Override
public
void
onNext
(
BaseResult
baseResult
)
{
public
void
onNext
(
BaseResult
baseResult
)
{
if
(
baseResult
.
isSuccess
())
{
if
(
baseResult
.
isSuccess
())
{
...
@@ -203,6 +209,93 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
...
@@ -203,6 +209,93 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
});
});
}
}
private
void
createOrder
()
{
OrderRequest
request
=
getCreateOrderRequest
(
getOrderFoodLists
());
RequestBody
requestBody
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
JsonUtils
.
toJson
(
request
));
mModel
.
createOrder
(
requestBody
)
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
null
))
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
@NonNull
BaseResult
info
)
{
if
(
info
!=
null
&&
info
.
isSuccess
())
{
if
(
info
.
getData
()
!=
null
)
{
setOrderId
((
Double
)
info
.
getData
());
}
updateOrderState
(
"4"
);
}
else
{
mRootView
.
showMessage
(
"結賬失敗!"
);
}
}
@Override
public
void
onError
(
Throwable
t
)
{
super
.
onError
(
t
);
mRootView
.
hideLoading
();
}
});
}
private
void
addOrderFood
()
{
List
<
OrderDetail
>
newFoods
=
getNewOrderFoodLists
();
for
(
OrderDetail
food
:
newFoods
)
{
food
.
setOrderId
(
MyOrderManage
.
getInstance
().
getOrderId
());
}
List
<
OrderBean
.
OrderDetailsBean
>
orderBeans
=
OrderBean
.
transOrderDetails
(
newFoods
);
RequestBody
requestBody
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
JsonUtils
.
toJson
(
orderBeans
));
mModel
.
addFood
(
requestBody
)
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
null
))
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
@NonNull
BaseResult
info
)
{
if
(
info
!=
null
&&
info
.
isSuccess
())
{
updateOrderState
(
"4"
);
}
else
{
mRootView
.
showMessage
(
"結賬失敗!"
);
}
}
@Override
public
void
onError
(
Throwable
t
)
{
super
.
onError
(
t
);
mRootView
.
hideLoading
();
}
});
}
/**
* 結賬
*/
public
void
sendOrderPay
()
{
if
(
hasNesOrderFoods
())
{
//有食品未送單 先送單
sendOrder
();
}
else
{
//直接結賬
updateOrderState
(
"4"
);
}
}
/**
* 送單
*/
public
void
sendOrder
()
{
if
(
MyOrderManage
.
getInstance
().
getOrderId
()
==
-
1
)
{
createOrder
();
}
else
{
addOrderFood
();
}
}
public
void
pressExact
()
{
public
void
pressExact
()
{
double
differenceMoney
=
getDifferenceMoney
();
double
differenceMoney
=
getDifferenceMoney
();
PayMethod
billMoneyBean
=
getSelectBillMoney
();
PayMethod
billMoneyBean
=
getSelectBillMoney
();
...
...
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/MealStandActivity.java
View file @
2718aa3f
...
@@ -946,6 +946,10 @@ public class MealStandActivity extends BaseActivity<MealStandPresenter> implemen
...
@@ -946,6 +946,10 @@ public class MealStandActivity extends BaseActivity<MealStandPresenter> implemen
}
else
{
}
else
{
fineItemAllFragment
.
onMidEvent
(
mPresenter
.
getCurrentOrderDetailBean
().
getProductId
());
fineItemKindFragment
.
onMidEvent
(
mPresenter
.
getCurrentOrderDetailBean
().
getProductId
());
showFinePage
();
showFinePage
();
showViewModeVisibility
(
MealConstant
.
fine_ViewMode
,
MealConstant
.
fine_tabs_ViewMode
);
showViewModeVisibility
(
MealConstant
.
fine_ViewMode
,
MealConstant
.
fine_tabs_ViewMode
);
...
...
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/OrderPayActivity.java
View file @
2718aa3f
...
@@ -300,7 +300,7 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
...
@@ -300,7 +300,7 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
tipMoneyInsufficient
();
tipMoneyInsufficient
();
return
;
return
;
}
}
mPresenter
.
updateOrderState
(
"4"
);
mPresenter
.
sendOrderPay
(
);
}
else
if
(
id
==
R
.
id
.
btn_exact
)
{
}
else
if
(
id
==
R
.
id
.
btn_exact
)
{
if
(
mPresenter
.
getSelectBillMoney
()
==
null
)
{
if
(
mPresenter
.
getSelectBillMoney
()
==
null
)
{
showMessage
(
"請選擇支付方式"
);
showMessage
(
"請選擇支付方式"
);
...
...
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/meal/ComboAdapter.java
View file @
2718aa3f
...
@@ -10,7 +10,7 @@ import android.widget.ImageView;
...
@@ -10,7 +10,7 @@ import android.widget.ImageView;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.database.bean.
FoodCombo
;
import
com.gingersoft.gsa.cloud.database.bean.
ComboItem
;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.gingersoft.gsa.cloud.table.R2
;
import
com.gingersoft.gsa.cloud.table.R2
;
...
@@ -31,7 +31,7 @@ import butterknife.BindView;
...
@@ -31,7 +31,7 @@ import butterknife.BindView;
* 描述:
* 描述:
*/
*/
public
class
ComboAdapter
extends
DefaultAdapter
<
FoodCombo
>
{
public
class
ComboAdapter
extends
DefaultAdapter
<
ComboItem
>
{
private
Context
mContext
;
private
Context
mContext
;
...
@@ -43,7 +43,7 @@ public class ComboAdapter extends DefaultAdapter<FoodCombo> {
...
@@ -43,7 +43,7 @@ public class ComboAdapter extends DefaultAdapter<FoodCombo> {
private
int
OrderNumberChildFontSize
;
private
int
OrderNumberChildFontSize
;
public
ComboAdapter
(
Context
context
,
List
<
FoodCombo
>
infos
)
{
public
ComboAdapter
(
Context
context
,
List
<
ComboItem
>
infos
)
{
super
(
infos
);
super
(
infos
);
this
.
mContext
=
context
;
this
.
mContext
=
context
;
...
@@ -62,7 +62,7 @@ public class ComboAdapter extends DefaultAdapter<FoodCombo> {
...
@@ -62,7 +62,7 @@ public class ComboAdapter extends DefaultAdapter<FoodCombo> {
}
}
@Override
@Override
public
BaseHolder
<
FoodCombo
>
getHolder
(
View
v
,
int
viewType
)
{
public
BaseHolder
<
ComboItem
>
getHolder
(
View
v
,
int
viewType
)
{
return
new
ComboItemHolder
(
v
);
return
new
ComboItemHolder
(
v
);
}
}
...
@@ -71,7 +71,7 @@ public class ComboAdapter extends DefaultAdapter<FoodCombo> {
...
@@ -71,7 +71,7 @@ public class ComboAdapter extends DefaultAdapter<FoodCombo> {
return
R
.
layout
.
table_item_combo
;
return
R
.
layout
.
table_item_combo
;
}
}
class
ComboItemHolder
extends
BaseHolder
<
FoodCombo
>
{
class
ComboItemHolder
extends
BaseHolder
<
ComboItem
>
{
@BindView
(
R2
.
id
.
tv_name
)
@BindView
(
R2
.
id
.
tv_name
)
TextView
tv_name
;
TextView
tv_name
;
...
@@ -88,7 +88,7 @@ public class ComboAdapter extends DefaultAdapter<FoodCombo> {
...
@@ -88,7 +88,7 @@ public class ComboAdapter extends DefaultAdapter<FoodCombo> {
}
}
@Override
@Override
public
void
setData
(
FoodCombo
datasBean
,
int
position
)
{
public
void
setData
(
ComboItem
datasBean
,
int
position
)
{
iv_qty_sold
.
setVisibility
(
View
.
INVISIBLE
);
iv_qty_sold
.
setVisibility
(
View
.
INVISIBLE
);
tv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
tv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
...
@@ -188,7 +188,7 @@ public class ComboAdapter extends DefaultAdapter<FoodCombo> {
...
@@ -188,7 +188,7 @@ public class ComboAdapter extends DefaultAdapter<FoodCombo> {
tv_soldout
.
setTextSize
(
OrderNumberChildFontSize
);
tv_soldout
.
setTextSize
(
OrderNumberChildFontSize
);
}
}
private
void
initComboName
(
FoodCombo
datasBean
)
{
private
void
initComboName
(
ComboItem
datasBean
)
{
String
Fname
=
datasBean
.
getName
();
String
Fname
=
datasBean
.
getName
();
tv_name
.
setText
(
Fname
);
tv_name
.
setText
(
Fname
);
tv_name
.
setTextSize
(
FontSize
);
tv_name
.
setTextSize
(
FontSize
);
...
@@ -196,7 +196,7 @@ public class ComboAdapter extends DefaultAdapter<FoodCombo> {
...
@@ -196,7 +196,7 @@ public class ComboAdapter extends DefaultAdapter<FoodCombo> {
initComboColor
(
datasBean
);
initComboColor
(
datasBean
);
}
}
private
void
initComboColor
(
FoodCombo
datasBean
)
{
private
void
initComboColor
(
ComboItem
datasBean
)
{
GradientDrawable
drawable
=
new
GradientDrawable
();
GradientDrawable
drawable
=
new
GradientDrawable
();
drawable
.
setShape
(
GradientDrawable
.
RECTANGLE
);
drawable
.
setShape
(
GradientDrawable
.
RECTANGLE
);
drawable
.
setGradientType
(
GradientDrawable
.
RECTANGLE
);
drawable
.
setGradientType
(
GradientDrawable
.
RECTANGLE
);
...
@@ -224,7 +224,7 @@ public class ComboAdapter extends DefaultAdapter<FoodCombo> {
...
@@ -224,7 +224,7 @@ public class ComboAdapter extends DefaultAdapter<FoodCombo> {
public
interface
OnItemClickListener
{
public
interface
OnItemClickListener
{
void
onItemClick
(
FoodCombo
datasBean
,
int
position
);
void
onItemClick
(
ComboItem
datasBean
,
int
position
);
}
}
}
}
table-mode/src/main/res/mipmap-xhdpi/meal_down.png
View file @
2718aa3f
1.87 KB
|
W:
|
H:
884 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/LoginActivity.java
View file @
2718aa3f
...
@@ -245,7 +245,7 @@ public class LoginActivity extends BaseActivity<LoginPresenter> implements Login
...
@@ -245,7 +245,7 @@ public class LoginActivity extends BaseActivity<LoginPresenter> implements Login
}
}
jumpDownloadActivity
();
jumpDownloadActivity
();
killMyself
();
//
killMyself();
// dialog.dismiss();
// dialog.dismiss();
}
}
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment