Commit 42e42857 by 宁斌

1、新增版本配置

2、版本更新處理
parent f598e606
...@@ -159,6 +159,8 @@ public class GsaCloudApplication extends BaseApplication { ...@@ -159,6 +159,8 @@ public class GsaCloudApplication extends BaseApplication {
RetrofitUrlManager.getInstance().putDomain("wechat_report", HttpsConstans.WECHAR_REPORT_SERVER_ADDRESS); RetrofitUrlManager.getInstance().putDomain("wechat_report", HttpsConstans.WECHAR_REPORT_SERVER_ADDRESS);
//沽清控制請求地址 //沽清控制請求地址
RetrofitUrlManager.getInstance().putDomain("soldoutctrl", HttpsConstans._SERVER_ADDRESS); RetrofitUrlManager.getInstance().putDomain("soldoutctrl", HttpsConstans._SERVER_ADDRESS);
//版本更新請求地址
RetrofitUrlManager.getInstance().putDomain("update_version", HttpsConstans.ROOT_URL);
//友常本地請求地址 //友常本地請求地址
RetrofitUrlManager.getInstance().putDomain("yc_location", HttpsConstans.ROOT_SERVER_YOU_CHANG_HK); RetrofitUrlManager.getInstance().putDomain("yc_location", HttpsConstans.ROOT_SERVER_YOU_CHANG_HK);
} }
......
package com.gingersoft.gsa.cloud.database.bean; package com.gingersoft.gsa.cloud.database.bean;
import android.graphics.Color; import android.graphics.Color;
import android.text.TextUtils;
import org.greenrobot.greendao.annotation.Entity; import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id; import org.greenrobot.greendao.annotation.Id;
...@@ -147,9 +148,9 @@ public class ComboItem { ...@@ -147,9 +148,9 @@ public class ComboItem {
@Generated(hash = 1123579083) @Generated(hash = 1123579083)
public ComboItem(Long id, long comId, long fid, long qty, double diffAmt, long seqNo, public ComboItem(Long id, long comId, long fid, long qty, double diffAmt, long seqNo, long visible, Date createTime,
long visible, Date createTime, String createBy, Date updateTime, long conditions, String createBy, Date updateTime, long conditions, long isRT, byte deletes, long posId, long restaurant_id,
long isRT, byte deletes, long posId, long restaurant_id, byte isMainAccount) { byte isMainAccount) {
this.id = id; this.id = id;
this.comId = comId; this.comId = comId;
this.fid = fid; this.fid = fid;
...@@ -173,6 +174,13 @@ public class ComboItem { ...@@ -173,6 +174,13 @@ public class ComboItem {
} }
public boolean isSold() {
if(!TextUtils.isEmpty(currentMaxNumber) && ("售罄".equals(currentMaxNumber) || "暫停".equals(currentMaxNumber))){
return true;
}
return false;
}
public Long getId() { public Long getId() {
return id; return id;
} }
...@@ -209,6 +217,7 @@ public class ComboItem { ...@@ -209,6 +217,7 @@ public class ComboItem {
this.currentMaxNumber = currentMaxNumber; this.currentMaxNumber = currentMaxNumber;
} }
public Long getQty() { public Long getQty() {
return qty; return qty;
} }
......
...@@ -28,14 +28,28 @@ public class Function { ...@@ -28,14 +28,28 @@ public class Function {
private int parentId; private int parentId;
private int groupId; private int groupId;
private int status;
private long effectiveTime; private long effectiveTime;
private String resName; private String resName;
private String resUrl; private String resUrl;
private String imageURL; private String imageURL;
//暫時沒有imageURL,用本地資源代替 //暫時沒有imageURL,用本地資源代替
private int icRes; private int icRes;
/**狀態
* 0 未开通
* 1 正常
* 2 有時間限制
* 3 關閉
* */
private int status;
@Transient
public static final int STATUS_NONACTIVATED = 0;
@Transient
public static final int STATUS_NONAL = 1;
@Transient
public static final int STATUS_TIME_LIMIT = 2;
@Transient
public static final int STATUS_CLOSE = 3;
/** /**
* 自定義字段 * 自定義字段
*/ */
...@@ -60,19 +74,19 @@ public class Function { ...@@ -60,19 +74,19 @@ public class Function {
@Transient @Transient
private String lable; private String lable;
@Generated(hash = 816556116) @Generated(hash = 756881616)
public Function(Long dbid, @NotNull Long id, int parentId, int groupId, int status, public Function(Long dbid, @NotNull Long id, int parentId, int groupId, long effectiveTime,
long effectiveTime, String resName, String resUrl, String imageURL, int icRes) { String resName, String resUrl, String imageURL, int icRes, int status) {
this.dbid = dbid; this.dbid = dbid;
this.id = id; this.id = id;
this.parentId = parentId; this.parentId = parentId;
this.groupId = groupId; this.groupId = groupId;
this.status = status;
this.effectiveTime = effectiveTime; this.effectiveTime = effectiveTime;
this.resName = resName; this.resName = resName;
this.resUrl = resUrl; this.resUrl = resUrl;
this.imageURL = imageURL; this.imageURL = imageURL;
this.icRes = icRes; this.icRes = icRes;
this.status = status;
} }
@Generated(hash = 133141990) @Generated(hash = 133141990)
......
package com.gingersoft.gsa.cloud.database.bean; package com.gingersoft.gsa.cloud.database.bean;
import android.graphics.Color; import android.graphics.Color;
import android.text.TextUtils;
import org.greenrobot.greendao.annotation.Entity; import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated; import org.greenrobot.greendao.annotation.Generated;
...@@ -422,25 +423,15 @@ public class Modifier { ...@@ -422,25 +423,15 @@ public class Modifier {
@Generated(hash = 385685553)
public Modifier() {
}
@Generated(hash = 1490458360) @Generated(hash = 1490458360)
public Modifier(Long dbid, long mid, long topId, long restaurantId, public Modifier(Long dbid, long mid, long topId, long restaurantId, String modifierName, long seqNo, double marketPrice,
String modifierName, long seqNo, double marketPrice, double price, double price, double lunchboxPrice, long colorId, String imageUrl, long invisible, double cost, Date startDate,
double lunchboxPrice, long colorId, String imageUrl, long invisible, Date endDate, long like, long totalSold, long majorMainId, long deptId, String createBy, Date createTime,
double cost, Date startDate, Date endDate, long like, long totalSold, String updateBy, Date updateTime, String posFid, String pId, long autoMod, long blueEdit, long autoMerge,
long majorMainId, long deptId, String createBy, Date createTime, long customMsg, long isParent, String modifierName1, String modifierName2, double multiple, String printSet,
String updateBy, Date updateTime, String posFid, String pId, String ktSetting, long modComm, long modTaste, long modMsg, long ktFireCourse, long ableDisCount,
long autoMod, long blueEdit, long autoMerge, long customMsg, long printToBill, long ktPrintMainItem, long ktShowPrice, long ktFont, long conditions, long isRt, byte visible,
long isParent, String modifierName1, String modifierName2, long deletes, long isStatistic) {
double multiple, String printSet, String ktSetting, long modComm,
long modTaste, long modMsg, long ktFireCourse, long ableDisCount,
long printToBill, long ktPrintMainItem, long ktShowPrice, long ktFont,
long conditions, long isRt, byte visible, long deletes,
long isStatistic) {
this.dbid = dbid; this.dbid = dbid;
this.mid = mid; this.mid = mid;
this.topId = topId; this.topId = topId;
...@@ -492,6 +483,11 @@ public class Modifier { ...@@ -492,6 +483,11 @@ public class Modifier {
this.isStatistic = isStatistic; this.isStatistic = isStatistic;
} }
@Generated(hash = 385685553)
public Modifier() {
}
public Long getDbid() { public Long getDbid() {
return dbid; return dbid;
...@@ -501,6 +497,13 @@ public class Modifier { ...@@ -501,6 +497,13 @@ public class Modifier {
return mid; return mid;
} }
public boolean isSold() {
if(!TextUtils.isEmpty(currentMaxNumber) && ("售罄".equals(currentMaxNumber) || "暫停".equals(currentMaxNumber))){
return true;
}
return false;
}
public Long getTopId() { public Long getTopId() {
return topId; return topId;
} }
......
...@@ -28,12 +28,12 @@ public class FunctionDao extends AbstractDao<Function, Long> { ...@@ -28,12 +28,12 @@ public class FunctionDao extends AbstractDao<Function, Long> {
public final static Property Id = new Property(1, Long.class, "id", false, "ID"); public final static Property Id = new Property(1, Long.class, "id", false, "ID");
public final static Property ParentId = new Property(2, int.class, "parentId", false, "PARENT_ID"); public final static Property ParentId = new Property(2, int.class, "parentId", false, "PARENT_ID");
public final static Property GroupId = new Property(3, int.class, "groupId", false, "GROUP_ID"); public final static Property GroupId = new Property(3, int.class, "groupId", false, "GROUP_ID");
public final static Property Status = new Property(4, int.class, "status", false, "STATUS"); public final static Property EffectiveTime = new Property(4, long.class, "effectiveTime", false, "EFFECTIVE_TIME");
public final static Property EffectiveTime = new Property(5, long.class, "effectiveTime", false, "EFFECTIVE_TIME"); public final static Property ResName = new Property(5, String.class, "resName", false, "RES_NAME");
public final static Property ResName = new Property(6, String.class, "resName", false, "RES_NAME"); public final static Property ResUrl = new Property(6, String.class, "resUrl", false, "RES_URL");
public final static Property ResUrl = new Property(7, String.class, "resUrl", false, "RES_URL"); public final static Property ImageURL = new Property(7, String.class, "imageURL", false, "IMAGE_URL");
public final static Property ImageURL = new Property(8, String.class, "imageURL", false, "IMAGE_URL"); public final static Property IcRes = new Property(8, int.class, "icRes", false, "IC_RES");
public final static Property IcRes = new Property(9, int.class, "icRes", false, "IC_RES"); public final static Property Status = new Property(9, int.class, "status", false, "STATUS");
} }
...@@ -53,12 +53,12 @@ public class FunctionDao extends AbstractDao<Function, Long> { ...@@ -53,12 +53,12 @@ public class FunctionDao extends AbstractDao<Function, Long> {
"\"ID\" INTEGER NOT NULL ," + // 1: id "\"ID\" INTEGER NOT NULL ," + // 1: id
"\"PARENT_ID\" INTEGER NOT NULL ," + // 2: parentId "\"PARENT_ID\" INTEGER NOT NULL ," + // 2: parentId
"\"GROUP_ID\" INTEGER NOT NULL ," + // 3: groupId "\"GROUP_ID\" INTEGER NOT NULL ," + // 3: groupId
"\"STATUS\" INTEGER NOT NULL ," + // 4: status "\"EFFECTIVE_TIME\" INTEGER NOT NULL ," + // 4: effectiveTime
"\"EFFECTIVE_TIME\" INTEGER NOT NULL ," + // 5: effectiveTime "\"RES_NAME\" TEXT," + // 5: resName
"\"RES_NAME\" TEXT," + // 6: resName "\"RES_URL\" TEXT," + // 6: resUrl
"\"RES_URL\" TEXT," + // 7: resUrl "\"IMAGE_URL\" TEXT," + // 7: imageURL
"\"IMAGE_URL\" TEXT," + // 8: imageURL "\"IC_RES\" INTEGER NOT NULL ," + // 8: icRes
"\"IC_RES\" INTEGER NOT NULL );"); // 9: icRes "\"STATUS\" INTEGER NOT NULL );"); // 9: status
} }
/** Drops the underlying database table. */ /** Drops the underlying database table. */
...@@ -78,24 +78,24 @@ public class FunctionDao extends AbstractDao<Function, Long> { ...@@ -78,24 +78,24 @@ public class FunctionDao extends AbstractDao<Function, Long> {
stmt.bindLong(2, entity.getId()); stmt.bindLong(2, entity.getId());
stmt.bindLong(3, entity.getParentId()); stmt.bindLong(3, entity.getParentId());
stmt.bindLong(4, entity.getGroupId()); stmt.bindLong(4, entity.getGroupId());
stmt.bindLong(5, entity.getStatus()); stmt.bindLong(5, entity.getEffectiveTime());
stmt.bindLong(6, entity.getEffectiveTime());
String resName = entity.getResName(); String resName = entity.getResName();
if (resName != null) { if (resName != null) {
stmt.bindString(7, resName); stmt.bindString(6, resName);
} }
String resUrl = entity.getResUrl(); String resUrl = entity.getResUrl();
if (resUrl != null) { if (resUrl != null) {
stmt.bindString(8, resUrl); stmt.bindString(7, resUrl);
} }
String imageURL = entity.getImageURL(); String imageURL = entity.getImageURL();
if (imageURL != null) { if (imageURL != null) {
stmt.bindString(9, imageURL); stmt.bindString(8, imageURL);
} }
stmt.bindLong(10, entity.getIcRes()); stmt.bindLong(9, entity.getIcRes());
stmt.bindLong(10, entity.getStatus());
} }
@Override @Override
...@@ -109,24 +109,24 @@ public class FunctionDao extends AbstractDao<Function, Long> { ...@@ -109,24 +109,24 @@ public class FunctionDao extends AbstractDao<Function, Long> {
stmt.bindLong(2, entity.getId()); stmt.bindLong(2, entity.getId());
stmt.bindLong(3, entity.getParentId()); stmt.bindLong(3, entity.getParentId());
stmt.bindLong(4, entity.getGroupId()); stmt.bindLong(4, entity.getGroupId());
stmt.bindLong(5, entity.getStatus()); stmt.bindLong(5, entity.getEffectiveTime());
stmt.bindLong(6, entity.getEffectiveTime());
String resName = entity.getResName(); String resName = entity.getResName();
if (resName != null) { if (resName != null) {
stmt.bindString(7, resName); stmt.bindString(6, resName);
} }
String resUrl = entity.getResUrl(); String resUrl = entity.getResUrl();
if (resUrl != null) { if (resUrl != null) {
stmt.bindString(8, resUrl); stmt.bindString(7, resUrl);
} }
String imageURL = entity.getImageURL(); String imageURL = entity.getImageURL();
if (imageURL != null) { if (imageURL != null) {
stmt.bindString(9, imageURL); stmt.bindString(8, imageURL);
} }
stmt.bindLong(10, entity.getIcRes()); stmt.bindLong(9, entity.getIcRes());
stmt.bindLong(10, entity.getStatus());
} }
@Override @Override
...@@ -141,12 +141,12 @@ public class FunctionDao extends AbstractDao<Function, Long> { ...@@ -141,12 +141,12 @@ public class FunctionDao extends AbstractDao<Function, Long> {
cursor.getLong(offset + 1), // id cursor.getLong(offset + 1), // id
cursor.getInt(offset + 2), // parentId cursor.getInt(offset + 2), // parentId
cursor.getInt(offset + 3), // groupId cursor.getInt(offset + 3), // groupId
cursor.getInt(offset + 4), // status cursor.getLong(offset + 4), // effectiveTime
cursor.getLong(offset + 5), // effectiveTime cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // resName
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // resName cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // resUrl
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // resUrl cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // imageURL
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // imageURL cursor.getInt(offset + 8), // icRes
cursor.getInt(offset + 9) // icRes cursor.getInt(offset + 9) // status
); );
return entity; return entity;
} }
...@@ -157,12 +157,12 @@ public class FunctionDao extends AbstractDao<Function, Long> { ...@@ -157,12 +157,12 @@ public class FunctionDao extends AbstractDao<Function, Long> {
entity.setId(cursor.getLong(offset + 1)); entity.setId(cursor.getLong(offset + 1));
entity.setParentId(cursor.getInt(offset + 2)); entity.setParentId(cursor.getInt(offset + 2));
entity.setGroupId(cursor.getInt(offset + 3)); entity.setGroupId(cursor.getInt(offset + 3));
entity.setStatus(cursor.getInt(offset + 4)); entity.setEffectiveTime(cursor.getLong(offset + 4));
entity.setEffectiveTime(cursor.getLong(offset + 5)); entity.setResName(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setResName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setResUrl(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setResUrl(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); entity.setImageURL(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setImageURL(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); entity.setIcRes(cursor.getInt(offset + 8));
entity.setIcRes(cursor.getInt(offset + 9)); entity.setStatus(cursor.getInt(offset + 9));
} }
@Override @Override
......
...@@ -45,11 +45,25 @@ public class FunctionManager { ...@@ -45,11 +45,25 @@ public class FunctionManager {
if (function.getResUrl().startsWith(resLoction)) { if (function.getResUrl().startsWith(resLoction)) {
for (int j = 0; j < fModules.length; j++) { for (int j = 0; j < fModules.length; j++) {
FModule module = fModules[j]; FModule module = fModules[j];
if(function.getResUrl().equals(module.getKeyRes())){ if (function.getResUrl().equals(module.getKeyRes())) {
if (function.getStatus() == 0) { switch (function.getStatus()) {
function.setIconRes(module.getOpenIconRes()); case Function.STATUS_NONAL:
} else { function.setIcRes(module.getOpenIconRes());
function.setIconRes(module.getDisableIconRes()); break;
case Function.STATUS_TIME_LIMIT:
long currentTime = System.currentTimeMillis();
long effectiveTime = function.getEffectiveTime();
if (effectiveTime > currentTime) {
//在有效期内
function.setStatus(Function.STATUS_NONAL);
function.setIcRes(module.getOpenIconRes());
} else {
function.setIcRes(module.getDisableIconRes());
}
break;
default:
function.setIcRes(module.getDisableIconRes());
break;
} }
} }
} }
......
...@@ -6,7 +6,7 @@ ext { ...@@ -6,7 +6,7 @@ ext {
minSdkVersion : 19, //N5收銀機應用安卓開發環境要求Android OS Version: 5.1Android SDK Min Version: 19 minSdkVersion : 19, //N5收銀機應用安卓開發環境要求Android OS Version: 5.1Android SDK Min Version: 19
targetSdkVersion : 28, targetSdkVersion : 28,
versionCode : 1, versionCode : 1,
versionName : "1.8" versionName : "1.0.1"
] ]
version = [ version = [
......
...@@ -99,6 +99,10 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow ...@@ -99,6 +99,10 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL + Api.expand_info, HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL + Api.expand_info,
HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL + Api.printerDevice_list}; HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL + Api.printerDevice_list};
// private String[] downTitles = {"打印機列表"};
// //下載所佔比例
// private int[] ratios = {100};
// private String urlList[] = {HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL + Api.printerDevice_list};
//当前请求响应成功数 //当前请求响应成功数
private int responseSuccessCount; private int responseSuccessCount;
...@@ -269,7 +273,7 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow ...@@ -269,7 +273,7 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
public void downFun(int downTag) { public void downFun(int downTag) {
List<Function> functions = getFunctions(); // List<Function> functions = getFunctions();
long userId = GsaCloudApplication.getMemberId(mApplication); long userId = GsaCloudApplication.getMemberId(mApplication);
...@@ -293,7 +297,7 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow ...@@ -293,7 +297,7 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
if (functionBean.getData() != null) { if (functionBean.getData() != null) {
FunctionDaoUtils functionDao = new FunctionDaoUtils(IActivity); FunctionDaoUtils functionDao = new FunctionDaoUtils(IActivity);
functionDao.deleteAll(); functionDao.deleteAll();
functionDao.insertMultFunction(functions); functionDao.insertMultFunction(functionBean.getData());
} }
DataDownLoadState loadState = mList.get(downTag); DataDownLoadState loadState = mList.get(downTag);
......
...@@ -310,7 +310,7 @@ public class LoginActivity extends LoginInterfaceImpl<LoginPresenter> implements ...@@ -310,7 +310,7 @@ public class LoginActivity extends LoginInterfaceImpl<LoginPresenter> implements
//保存登陸信息 //保存登陸信息
// saveLoginInfo(loginBean); // saveLoginInfo(loginBean);
} }
//158 - 189
@Override @Override
public void showChooseRestaurantDialog(List<LoginBean.DataBean.UserBean.BrandsBean> brandsBeans, List<LoginBean.DataBean.UserBean.BrandsBean> brands) { public void showChooseRestaurantDialog(List<LoginBean.DataBean.UserBean.BrandsBean> brandsBeans, List<LoginBean.DataBean.UserBean.BrandsBean> brands) {
new ChooseRestaurantDialog.BottomListSheetBuilder(mContext) new ChooseRestaurantDialog.BottomListSheetBuilder(mContext)
......
...@@ -30,14 +30,18 @@ ...@@ -30,14 +30,18 @@
android:layout_marginTop="@dimen/dp_60" android:layout_marginTop="@dimen/dp_60"
android:src="@mipmap/png_welcome_center" /> android:src="@mipmap/png_welcome_center" />
<ImageView <TextView
android:id="@+id/iv_welcome_logo" android:id="@+id/iv_welcome_logo"
android:layout_width="@dimen/dp_56" android:layout_width="wrap_content"
android:layout_height="@dimen/dp_56" android:layout_height="wrap_content"
android:layout_below="@+id/iv_welcome_center" android:layout_below="@+id/iv_welcome_center"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_16" android:layout_marginTop="@dimen/dp_30"
android:src="@mipmap/ic_launcher" /> android:drawableTop="@mipmap/ic_launcher"
android:text="Ricepon POS"
android:textSize="@dimen/sp_16"
android:textColor="@color/theme_color"
android:textStyle="bold"/>
<ImageView <ImageView
android:id="@+id/iv_welcome_bottom" android:id="@+id/iv_welcome_bottom"
......
...@@ -12,7 +12,7 @@ import com.gingersoft.gsa.cloud.main.mvp.ui.activity.NewMainActivity; ...@@ -12,7 +12,7 @@ import com.gingersoft.gsa.cloud.main.mvp.ui.activity.NewMainActivity;
public class ComponentMain implements IComponent { public class ComponentMain implements IComponent {
public static final class Function{ public static final class main{
/**首頁- 點餐*/ /**首頁- 點餐*/
public static final FModule[] order = { public static final FModule[] order = {
new FModule("main/order", 0,0) , new FModule("main/order", 0,0) ,
......
...@@ -5,6 +5,10 @@ import android.widget.BaseAdapter; ...@@ -5,6 +5,10 @@ import android.widget.BaseAdapter;
import com.jess.arms.mvp.IView; import com.jess.arms.mvp.IView;
import com.jess.arms.mvp.IModel; import com.jess.arms.mvp.IModel;
import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
/** /**
* ================================================ * ================================================
...@@ -24,8 +28,10 @@ public interface MainContract { ...@@ -24,8 +28,10 @@ public interface MainContract {
void setFunctionAdapter(BaseAdapter adapter); void setFunctionAdapter(BaseAdapter adapter);
} }
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存 //Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel{ interface Model extends IModel {
} }
} }
...@@ -30,6 +30,9 @@ public interface NewMainContract { ...@@ -30,6 +30,9 @@ public interface NewMainContract {
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存 //Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel { interface Model extends IModel {
Observable<Object> checkAppVersion(RequestBody requestBody);
Observable<Object> loginOut(RequestBody requestBody); Observable<Object> loginOut(RequestBody requestBody);
} }
} }
...@@ -2,12 +2,16 @@ package com.gingersoft.gsa.cloud.main.mvp.model; ...@@ -2,12 +2,16 @@ package com.gingersoft.gsa.cloud.main.mvp.model;
import android.app.Application; import android.app.Application;
import com.gingersoft.gsa.cloud.main.mvp.contract.MainContract; import com.gingersoft.gsa.cloud.main.mvp.contract.MainContract;
import com.gingersoft.gsa.cloud.main.mvp.model.service.MainReportService;
import com.gingersoft.gsa.cloud.main.mvp.model.service.MainService;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.jess.arms.integration.IRepositoryManager; import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel; import com.jess.arms.mvp.BaseModel;
import com.jess.arms.di.scope.ActivityScope; import com.jess.arms.di.scope.ActivityScope;
import javax.inject.Inject; import javax.inject.Inject;
import io.reactivex.Observable;
import okhttp3.RequestBody;
/** /**
...@@ -40,4 +44,5 @@ public class MainModel extends BaseModel implements MainContract.Model{ ...@@ -40,4 +44,5 @@ public class MainModel extends BaseModel implements MainContract.Model{
this.mGson = null; this.mGson = null;
this.mApplication = null; this.mApplication = null;
} }
} }
\ No newline at end of file
...@@ -50,6 +50,12 @@ public class NewMainModel extends BaseModel implements NewMainContract.Model { ...@@ -50,6 +50,12 @@ public class NewMainModel extends BaseModel implements NewMainContract.Model {
} }
@Override @Override
public Observable<Object> checkAppVersion(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(MainService.class)
.checkAppVersion(requestBody);
}
@Override
public Observable<Object> loginOut(RequestBody requestBody) { public Observable<Object> loginOut(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(MainService.class) return mRepositoryManager.obtainRetrofitService(MainService.class)
.loginOut(requestBody); .loginOut(requestBody);
......
...@@ -130,6 +130,7 @@ public class SettlementReport { ...@@ -130,6 +130,7 @@ public class SettlementReport {
* tipnum : 0 * tipnum : 0
* tipsPrice : 0 * tipsPrice : 0
* totamount : 256 * totamount : 256
* deliverycharge : 0
* num : 2 * num : 2
* person : 7 * person : 7
*/ */
...@@ -142,9 +143,18 @@ public class SettlementReport { ...@@ -142,9 +143,18 @@ public class SettlementReport {
private int tipnum; private int tipnum;
private double tipsPrice; private double tipsPrice;
private double totamount; private double totamount;
private double deliverycharge;
private int num; private int num;
private int person; private int person;
public double getDeliverycharge() {
return deliverycharge;
}
public void setDeliverycharge(double deliverycharge) {
this.deliverycharge = deliverycharge;
}
public double getPrices() { public double getPrices() {
return prices; return prices;
} }
......
...@@ -23,6 +23,7 @@ import retrofit2.http.QueryMap; ...@@ -23,6 +23,7 @@ import retrofit2.http.QueryMap;
* 首頁和報表 * 首頁和報表
*/ */
public interface MainReportService { public interface MainReportService {
//支付分析報表 //支付分析報表
@Headers({"Domain-Name: wechat_report"}) @Headers({"Domain-Name: wechat_report"})
@POST("wx/findPayMode" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2) @POST("wx/findPayMode" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
......
...@@ -4,6 +4,7 @@ import io.reactivex.Observable; ...@@ -4,6 +4,7 @@ import io.reactivex.Observable;
import me.jessyan.retrofiturlmanager.RetrofitUrlManager; import me.jessyan.retrofiturlmanager.RetrofitUrlManager;
import okhttp3.RequestBody; import okhttp3.RequestBody;
import retrofit2.http.Body; import retrofit2.http.Body;
import retrofit2.http.Headers;
import retrofit2.http.POST; import retrofit2.http.POST;
/** /**
...@@ -13,4 +14,8 @@ public interface MainService { ...@@ -13,4 +14,8 @@ public interface MainService {
@POST("gsa/logout" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2) @POST("gsa/logout" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<Object> loginOut(@Body RequestBody requestBody); Observable<Object> loginOut(@Body RequestBody requestBody);
@Headers({"Domain-Name: update_version"})
@POST("/member-web/api/system/checkAppVersion" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<Object> checkAppVersion(@Body RequestBody requestBody);
} }
package com.gingersoft.gsa.cloud.main.mvp.presenter; package com.gingersoft.gsa.cloud.main.mvp.presenter;
import android.app.Application; import android.app.Application;
import android.text.TextUtils;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication; import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.utils.LanguageUtils; import com.gingersoft.gsa.cloud.base.utils.LanguageUtils;
...@@ -11,6 +12,7 @@ import com.jess.arms.http.imageloader.ImageLoader; ...@@ -11,6 +12,7 @@ import com.jess.arms.http.imageloader.ImageLoader;
import com.jess.arms.integration.AppManager; import com.jess.arms.integration.AppManager;
import com.jess.arms.mvp.BasePresenter; import com.jess.arms.mvp.BasePresenter;
import com.jess.arms.utils.ArmsUtils; import com.jess.arms.utils.ArmsUtils;
import com.jess.arms.utils.DeviceUtils;
import com.jess.arms.utils.PermissionUtil; import com.jess.arms.utils.PermissionUtil;
import com.jess.arms.utils.RxLifecycleUtils; import com.jess.arms.utils.RxLifecycleUtils;
...@@ -64,7 +66,38 @@ public class NewMainPresenter extends BasePresenter<NewMainContract.Model, NewMa ...@@ -64,7 +66,38 @@ public class NewMainPresenter extends BasePresenter<NewMainContract.Model, NewMa
this.mApplication = null; this.mApplication = null;
} }
public void loginOut(){ public void checkAppVersion() {
RequestBody requestBody = new FormBody.Builder()
.add("version", DeviceUtils.getVersionName(mApplication) + "|" + DeviceUtils.getVersionCode(mApplication))
.build();
mModel.checkAppVersion(requestBody)
.subscribeOn(Schedulers.io())
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<Object>(mErrorHandler) {
@Override
public void onNext(@NonNull Object info) {
if (info != null ) {
// int operate = json.optInt("operate");//操作类型:1、不提示更新 2、提示更新可选择更新 3、强行更新
// if (operate == 2 || operate == 3 || operate == 4 || operate == 5) {
// String updatePath = json.optString("updatePath");
// if (!TextUtils.isEmpty("updatePath") && !updatePath.equals("null")) {
// updateAPK(operate, updatePath);
// } else {
// if (operate == 3) {
// ExitAPP();
// }
// }
// }
} else {
}
}
});
}
public void loginOut() {
RequestBody requestBody = new FormBody.Builder() RequestBody requestBody = new FormBody.Builder()
.build(); .build();
mModel.loginOut(requestBody) mModel.loginOut(requestBody)
......
...@@ -61,10 +61,10 @@ public class SettlementReportPresenter extends BasePresenter<SettlementReportCon ...@@ -61,10 +61,10 @@ public class SettlementReportPresenter extends BasePresenter<SettlementReportCon
private SettlementReportActivity IActivity; private SettlementReportActivity IActivity;
private SettlementReportItemAdapter mSettlementReportItemAdapter; private SettlementReportItemAdapter mSettlementReportItemAdapter;
private List<SectionTextItem3> mSettlementReportItemList= new ArrayList<>(); private List<SectionTextItem3> mSettlementReportItemList = new ArrayList<>();
private SettlementReportItem5Adapter mSettlementReportItem5Adapter; private SettlementReportItem5Adapter mSettlementReportItem5Adapter;
private List<SectionTextItem5> mSettlementReportItem5List= new ArrayList<>(); private List<SectionTextItem5> mSettlementReportItem5List = new ArrayList<>();
public SettlementReportItem5Adapter mPrintAdapter; public SettlementReportItem5Adapter mPrintAdapter;
...@@ -92,7 +92,7 @@ public class SettlementReportPresenter extends BasePresenter<SettlementReportCon ...@@ -92,7 +92,7 @@ public class SettlementReportPresenter extends BasePresenter<SettlementReportCon
mSettlementReportItem5Adapter = new SettlementReportItem5Adapter(IActivity, mSettlementReportItem5List); mSettlementReportItem5Adapter = new SettlementReportItem5Adapter(IActivity, mSettlementReportItem5List);
mRootView.setSettlementReportItem5Adapter(mSettlementReportItem5Adapter); mRootView.setSettlementReportItem5Adapter(mSettlementReportItem5Adapter);
} }
if(mPrintAdapter == null){ if (mPrintAdapter == null) {
mPrintAdapter = new SettlementReportItem5Adapter(IActivity, mSettlementReportItem5List, 24); mPrintAdapter = new SettlementReportItem5Adapter(IActivity, mSettlementReportItem5List, 24);
} }
} }
...@@ -142,15 +142,15 @@ public class SettlementReportPresenter extends BasePresenter<SettlementReportCon ...@@ -142,15 +142,15 @@ public class SettlementReportPresenter extends BasePresenter<SettlementReportCon
//打印清機報表 //打印清機報表
mRootView.printRepore(); mRootView.printRepore();
} }
} else if(info.getErrCode().equals("restaurant.operation.0003")){ } else if (info.getErrCode().equals("restaurant.operation.0003")) {
Class[] parameterTypes = {}; Class[] parameterTypes = {};
Object[] parameters = {}; Object[] parameters = {};
CommonTipDialog.showDoubtDialog(IActivity,"今天已清機過,是否繼續清機", SettlementReportPresenter.class, SettlementReportPresenter.this, CommonTipDialog.showDoubtDialog(IActivity, "今天已清機過,是否繼續清機", SettlementReportPresenter.class, SettlementReportPresenter.this,
"sendSettlement", parameterTypes, parameters); "sendSettlement", parameterTypes, parameters);
}else if(info.getErrCode().equals("restaurant.operation.0004")){ } else if (info.getErrCode().equals("restaurant.operation.0004")) {
Class[] parameterTypes = {}; Class[] parameterTypes = {};
Object[] parameters = {}; Object[] parameters = {};
CommonTipDialog.showDoubtDialog(IActivity,"仍有外送訂單未結賬,請先結賬!", SettlementReportPresenter.class, SettlementReportPresenter.this, CommonTipDialog.showDoubtDialog(IActivity, "仍有外送訂單未結賬,請先結賬!", SettlementReportPresenter.class, SettlementReportPresenter.this,
"", parameterTypes, parameters); "", parameterTypes, parameters);
} else { } else {
mRootView.showMessage("清機失敗"); mRootView.showMessage("清機失敗");
...@@ -170,6 +170,15 @@ public class SettlementReportPresenter extends BasePresenter<SettlementReportCon ...@@ -170,6 +170,15 @@ public class SettlementReportPresenter extends BasePresenter<SettlementReportCon
.compose(RxLifecycleUtils.bindToLifecycle(mRootView)) .compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<SettlementReport>(mErrorHandler) { .subscribe(new ErrorHandleSubscriber<SettlementReport>(mErrorHandler) {
//{"success":false,"errCode":"data_002","errMsg":"沒有查詢到數據","sysTime":1583573772290} //{"success":false,"errCode":"data_002","errMsg":"沒有查詢到數據","sysTime":1583573772290}
@Override
public void onSubscribe(Disposable d) {
super.onSubscribe(d);
}
@Override
public void onError(Throwable t) {
super.onError(t);
}
@Override @Override
public void onNext(@NonNull SettlementReport info) { public void onNext(@NonNull SettlementReport info) {
......
...@@ -41,6 +41,7 @@ import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog; ...@@ -41,6 +41,7 @@ import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog;
import com.jess.arms.base.BaseActivity; import com.jess.arms.base.BaseActivity;
import com.jess.arms.base.DefaultAdapter; import com.jess.arms.base.DefaultAdapter;
import com.jess.arms.di.component.AppComponent; import com.jess.arms.di.component.AppComponent;
import com.jess.arms.integration.AppManager;
import com.jess.arms.utils.ArmsUtils; import com.jess.arms.utils.ArmsUtils;
import com.jess.arms.utils.DeviceUtils; import com.jess.arms.utils.DeviceUtils;
import com.qmuiteam.qmui.widget.QMUITopBar; import com.qmuiteam.qmui.widget.QMUITopBar;
...@@ -55,6 +56,8 @@ import java.util.HashMap; ...@@ -55,6 +56,8 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.inject.Inject;
import butterknife.BindView; import butterknife.BindView;
import butterknife.OnClick; import butterknife.OnClick;
...@@ -75,6 +78,9 @@ import static com.jess.arms.utils.Preconditions.checkNotNull; ...@@ -75,6 +78,9 @@ import static com.jess.arms.utils.Preconditions.checkNotNull;
*/ */
public class SettlementReportActivity extends BaseActivity<SettlementReportPresenter> implements SettlementReportContract.View { public class SettlementReportActivity extends BaseActivity<SettlementReportPresenter> implements SettlementReportContract.View {
@Inject
AppManager mAppManager;
@BindView(R2.id.topbar) @BindView(R2.id.topbar)
QMUITopBar mTopBar; QMUITopBar mTopBar;
...@@ -261,6 +267,7 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese ...@@ -261,6 +267,7 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
String projectTotalSalesText = LanguageUtils.get_language_system(this, "total.project.sales", "項目銷售總額"); String projectTotalSalesText = LanguageUtils.get_language_system(this, "total.project.sales", "項目銷售總額");
String discountText = LanguageUtils.get_language_system(this, "", "折扣"); String discountText = LanguageUtils.get_language_system(this, "", "折扣");
String serviceFeeText = LanguageUtils.get_language_system(this, "", "服務費"); String serviceFeeText = LanguageUtils.get_language_system(this, "", "服務費");
String deliveryFeeText = LanguageUtils.get_language_system(this, "", "配送費");
String orderCountallText = LanguageUtils.get_language_system(this, "order.countall_litter", "賬單小數"); String orderCountallText = LanguageUtils.get_language_system(this, "order.countall_litter", "賬單小數");
String netTurnoverText = LanguageUtils.get_language_system(this, "net.turnover", "營業金額淨值"); String netTurnoverText = LanguageUtils.get_language_system(this, "net.turnover", "營業金額淨值");
...@@ -293,8 +300,9 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese ...@@ -293,8 +300,9 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
SettlementReport.DataBean.VoBean voBean = datasBean.getVo(); SettlementReport.DataBean.VoBean voBean = datasBean.getVo();
if (voBean != null) { if (voBean != null) {
settlementReportItem5s.add(new SectionTextItem5(projectTotalSalesText, null, null, null, cashStr + df.format(voBean.getPrices()))); settlementReportItem5s.add(new SectionTextItem5(projectTotalSalesText, null, null, null, cashStr + df.format(voBean.getPrices())));
settlementReportItem5s.add(new SectionTextItem5(discountText, null, null, null, cashStr + df.format(voBean.getDisamount()))); settlementReportItem5s.add(new SectionTextItem5(discountText, null, null, null, "-"+cashStr + df.format(voBean.getDisamount())));
settlementReportItem5s.add(new SectionTextItem5(serviceFeeText, null, null, null, cashStr + df.format(voBean.getScamount()))); settlementReportItem5s.add(new SectionTextItem5(serviceFeeText, null, null, null, cashStr + df.format(voBean.getScamount())));
settlementReportItem5s.add(new SectionTextItem5(deliveryFeeText, null, null, null, cashStr + df.format(voBean.getDeliverycharge())));
settlementReportItem5s.add(new SectionTextItem5(netTurnoverText, null, null, null, cashStr + df.format(voBean.getTotamount()))); settlementReportItem5s.add(new SectionTextItem5(netTurnoverText, null, null, null, cashStr + df.format(voBean.getTotamount())));
// if (voBean.getPayNum() > 0) { // if (voBean.getPayNum() > 0) {
...@@ -523,9 +531,11 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese ...@@ -523,9 +531,11 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
.callAsyncCallbackOnMainThread((cc, result) -> { .callAsyncCallbackOnMainThread((cc, result) -> {
//打印完之後,清除view //打印完之後,清除view
PrintTransitUtils.getInstance().setPrintView(null); PrintTransitUtils.getInstance().setPrintView(null);
if (mPresenter != null) { // if (mPresenter != null) {
mPresenter.getSettlementReport(); // mPresenter.getSettlementReport();
} // }
mAppManager.killActivity(SettlementActivity.class);
killMyself();
}); });
} }
......
package com.gingersoft.gsa.cloud.main.mvp.ui.adapter; package com.gingersoft.gsa.cloud.main.mvp.ui.adapter;
import android.widget.BaseAdapter;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder; import com.chad.library.adapter.base.BaseViewHolder;
import com.gingersoft.gsa.cloud.main.R; import com.gingersoft.gsa.cloud.main.R;
...@@ -16,6 +18,7 @@ public class BusinessInfoAdapter extends BaseQuickAdapter<BusinessBean, BaseView ...@@ -16,6 +18,7 @@ public class BusinessInfoAdapter extends BaseQuickAdapter<BusinessBean, BaseView
public BusinessInfoAdapter(@Nullable List<BusinessBean> data) { public BusinessInfoAdapter(@Nullable List<BusinessBean> data) {
super(R.layout.report_business_info_item, data); super(R.layout.report_business_info_item, data);
} }
// @Override // @Override
......
...@@ -83,6 +83,16 @@ ...@@ -83,6 +83,16 @@
android:textSize="@dimen/dp_17" /> android:textSize="@dimen/dp_17" />
</LinearLayout> </LinearLayout>
<TextView
android:id="@+id/tv_version_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_18"
android:layout_marginBottom="@dimen/dp_35"
android:gravity="center_vertical|bottom"
android:text=""
android:textColor="@color/white"
android:textSize="@dimen/sp_14" />
</LinearLayout> </LinearLayout>
<!-- 主頁內容--> <!-- 主頁內容-->
...@@ -227,11 +237,10 @@ ...@@ -227,11 +237,10 @@
android:layout_marginRight="@dimen/dp_10" android:layout_marginRight="@dimen/dp_10"
app:hl_cornerRadius="@dimen/dp_4" app:hl_cornerRadius="@dimen/dp_4"
app:hl_dy="@dimen/main_shadow_dy" app:hl_dy="@dimen/main_shadow_dy"
android:visibility="gone" android:visibility="visible"
app:hl_shadowBackColor="@color/white" app:hl_shadowBackColor="@color/white"
app:hl_shadowColor="@color/shadow_color" app:hl_shadowColor="@color/shadow_color"
app:hl_shadowLimit="@dimen/main_shadow_limit" app:hl_shadowLimit="@dimen/main_shadow_limit">
>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -268,5 +277,6 @@ ...@@ -268,5 +277,6 @@
</com.scwang.smartrefresh.layout.SmartRefreshLayout> </com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</com.gingersoft.gsa.cloud.main.mvp.ui.view.SlidingMenu> </com.gingersoft.gsa.cloud.main.mvp.ui.view.SlidingMenu>
...@@ -41,8 +41,9 @@ ...@@ -41,8 +41,9 @@
<TextView <TextView
android:id="@+id/tv_item4" android:id="@+id/tv_item4"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:maxLines="1" android:maxLines="1"
android:text="item4" android:text="item4"
...@@ -59,5 +60,4 @@ ...@@ -59,5 +60,4 @@
android:text="item5" android:text="item5"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/settlement_report_text_size" /> android:textSize="@dimen/settlement_report_text_size" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
package com.gingersoft.gsa.other_order_mode.data.model.bean package com.gingersoft.gsa.other_order_mode.data.model.bean
data class MessageBean(val code: String, val errorMsg: String, val success: Boolean = false, val sysTime: Long = 0, val data: DataBean? = null) { data class MessageBean(val code: String, val errorMsg: String, val success: Boolean = false, val sysTime: Long = 0, val data: String? = null)
class DataBean(var msg: String? = null, var num: Int = 0) \ No newline at end of file
/**
* msg : 數據更新成功!
* num : 1
*
* {"code":"1","errorMsg":"成功","data":null}
*/
}
\ No newline at end of file
...@@ -31,10 +31,11 @@ ...@@ -31,10 +31,11 @@
<TextView <TextView
android:id="@+id/tv_order_type" android:id="@+id/tv_order_type"
style="@style/print_other_order_twenty_six_style" style="@style/print_other_order_thirty_bold_style"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:textSize="@dimen/dp_35"
android:text='外送' /> android:text='外送' />
<TextView <TextView
...@@ -91,7 +92,7 @@ ...@@ -91,7 +92,7 @@
<TextView <TextView
android:id="@+id/tv_order_take_food_code" android:id="@+id/tv_order_take_food_code"
style="@style/print_other_order_twenty_six_style" style="@style/print_other_order_thirty_style"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="" android:text=""
......
...@@ -5,27 +5,22 @@ ...@@ -5,27 +5,22 @@
android:orientation="vertical"> android:orientation="vertical">
<!-- 接單的廚房單--> <!-- 接單的廚房單-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<TextView <TextView
android:id="@+id/tv_order_type" android:id="@+id/tv_order_type"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/theme_333_color" android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_26" /> android:textStyle="bold"
android:textSize="@dimen/dp_34" />
<TextView <TextView
android:id="@+id/tv_order_number" android:id="@+id/tv_order_number"
style="@style/print_other_order_twenty_six_style" style="@style/print_other_order_twenty_six_style"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
android:text="單號:" android:text="單號:"
android:textColor="@color/theme_333_color" /> android:textColor="@color/theme_333_color" />
</LinearLayout>
<TextView <TextView
android:id="@+id/tv_order_create_time" android:id="@+id/tv_order_create_time"
...@@ -37,7 +32,7 @@ ...@@ -37,7 +32,7 @@
<TextView <TextView
android:id="@+id/tv_order_take_code" android:id="@+id/tv_order_take_code"
style="@style/print_other_order_twenty_six_style" style="@style/print_other_order_thirty_style"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5" android:layout_marginTop="@dimen/dp_5"
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<style name="print_other_order_thirty_style"> <style name="print_other_order_thirty_style">
<item name="android:textColor">@color/theme_333_color</item> <item name="android:textColor">@color/theme_333_color</item>
<item name="android:textSize">@dimen/dp_30</item> <item name="android:textSize">@dimen/dp_34</item>
</style> </style>
<style name="print_other_order_thirty_bold_style" parent="print_other_order_thirty_style"> <style name="print_other_order_thirty_bold_style" parent="print_other_order_thirty_style">
......
...@@ -12,7 +12,7 @@ import com.gingersoft.gsa.cloud.table.mvp.ui.activity.TableActivity; ...@@ -12,7 +12,7 @@ import com.gingersoft.gsa.cloud.table.mvp.ui.activity.TableActivity;
public class ComponentTable implements IComponent { public class ComponentTable implements IComponent {
public static final class Function{ public static final class table{
/**餐檯頁*/ /**餐檯頁*/
public static final FModule[] bottom = { public static final FModule[] bottom = {
new FModule("table/bottom/init", R.mipmap.table_init,0) , new FModule("table/bottom/init", R.mipmap.table_init,0) ,
......
...@@ -19,8 +19,6 @@ public class DeleteOrderRequest { ...@@ -19,8 +19,6 @@ public class DeleteOrderRequest {
private List<Map<Byte, DeleteOrderRequest.DeleteBean>> mapsDelete; private List<Map<Byte, DeleteOrderRequest.DeleteBean>> mapsDelete;
private long orderId ; private long orderId ;
private byte type; private byte type;
/**賬單小數*/
private Double rounding;
private long reasonId; private long reasonId;
public List<Map<Byte, DeleteOrderRequest.DeleteBean>> getMapsDelete() { public List<Map<Byte, DeleteOrderRequest.DeleteBean>> getMapsDelete() {
...@@ -47,14 +45,6 @@ public class DeleteOrderRequest { ...@@ -47,14 +45,6 @@ public class DeleteOrderRequest {
this.type = type; this.type = type;
} }
public Double getRounding() {
return rounding;
}
public void setRounding(Double rounding) {
this.rounding = rounding;
}
public long getReasonId() { public long getReasonId() {
return reasonId; return reasonId;
} }
......
...@@ -12,6 +12,7 @@ import java.util.Map; ...@@ -12,6 +12,7 @@ import java.util.Map;
import io.reactivex.Observable; import io.reactivex.Observable;
import me.jessyan.retrofiturlmanager.RetrofitUrlManager; import me.jessyan.retrofiturlmanager.RetrofitUrlManager;
import okhttp3.FormBody;
import okhttp3.RequestBody; import okhttp3.RequestBody;
import retrofit2.http.Body; import retrofit2.http.Body;
import retrofit2.http.Field; import retrofit2.http.Field;
...@@ -45,6 +46,7 @@ public interface MealService { ...@@ -45,6 +46,7 @@ public interface MealService {
@POST("food/updateInvisible" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2) @POST("food/updateInvisible" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseResult> updateInvisible(@Body RequestBody requestBody); Observable<BaseResult> updateInvisible(@Body RequestBody requestBody);
@POST("order/send" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2) @POST("order/send" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseResult> createOrder(@Body RequestBody requestBody); Observable<BaseResult> createOrder(@Body RequestBody requestBody);
......
...@@ -663,8 +663,24 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas ...@@ -663,8 +663,24 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
} }
} }
} }
//删除食品后更新下标
mSelectMealAdapter.setIndex();
} }
// protected void reduceSelectedFoodNumber(int number) {
// List<OrderDetail> orderDetails = getOrderFoodLists();
// int start_position = mSelectMealAdapter.getSelect_full_start_position();
// int end_position = mSelectMealAdapter.getSelect_full_end_position();
// for (int i = orderDetails.size() - 1; i >= 0; i--) {
// if (start_position <= i && i <= end_position) {
// OrderDetail orderDetail1 = orderDetails.get(i);
// if (orderDetail1.getType() != DISCOUNT_TYPE) {
// orderDetail1.setNumber(orderDetail1.getNumber() - number);
// }
// }
// }
// }
/** /**
* 返回未选中的食品 * 返回未选中的食品
* *
......
...@@ -159,15 +159,15 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod ...@@ -159,15 +159,15 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
mFoodGroupList.addAll(foodGroupList); mFoodGroupList.addAll(foodGroupList);
Food defalutFoodGroup = getDefalutFoodGroup(mFoodGroupList); Food defalutFoodGroup = getDefalutFoodGroup(mFoodGroupList);
if(defalutFoodGroup != null) { if (defalutFoodGroup != null) {
//默認選中第一組 //默認選中第一組
defalutFoodGroup.setSelected(true); defalutFoodGroup.setSelected(true);
} }
IActivity.initFoodGroupView(mFoodGroupList); IActivity.initFoodGroupView(mFoodGroupList);
if(defalutFoodGroup != null) { if (defalutFoodGroup != null) {
changedMealByParentId(defalutFoodGroup.getId()); changedMealByParentId(defalutFoodGroup.getId());
} }
} }
...@@ -175,8 +175,8 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod ...@@ -175,8 +175,8 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
private Food getDefalutFoodGroup(List<Food> foodGroupList) { private Food getDefalutFoodGroup(List<Food> foodGroupList) {
Food defalutFoodGroup = null; Food defalutFoodGroup = null;
for (Food food: foodGroupList) { for (Food food : foodGroupList) {
if(food.getInvisible() == 0){ if (food.getInvisible() == 0) {
defalutFoodGroup = food; defalutFoodGroup = food;
break; break;
} }
...@@ -352,6 +352,11 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod ...@@ -352,6 +352,11 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
for (int i = 0; i < mFoodComboList.size(); i++) { for (int i = 0; i < mFoodComboList.size(); i++) {
//自动添加组合子食品 //自动添加组合子食品
ComboItem comboItem = mFoodComboList.get(i); ComboItem comboItem = mFoodComboList.get(i);
if (comboItem.isSold()) {
String msg = "[" + comboItem.getName() + "]" + comboItem.getCurrentMaxNumber();
CommonTipDialog.showSurpisedDialog(IActivity, msg, null, null, null, null, null);
continue;
}
if (comboItem.getInvisible() != 2) { if (comboItem.getInvisible() != 2) {
int defNumber = Integer.parseInt(comboItem.getDefmodifier()); int defNumber = Integer.parseInt(comboItem.getDefmodifier());
if (defNumber != 0) { if (defNumber != 0) {
...@@ -366,6 +371,11 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod ...@@ -366,6 +371,11 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
//自动添加mixqty>1細項 //自动添加mixqty>1細項
for (int i = 0; i < mModifierList.size(); i++) { for (int i = 0; i < mModifierList.size(); i++) {
Modifier modfier = mModifierList.get(i); Modifier modfier = mModifierList.get(i);
if (modfier.isSold()) {
String msg = "[" + modfier.getModifierName() + "]" + modfier.getCurrentMaxNumber();
CommonTipDialog.showSurpisedDialog(IActivity, msg, null, null, null, null, null);
continue;
}
if (modfier.getInvisible() != 2) { if (modfier.getInvisible() != 2) {
int defNumber = Integer.parseInt(modfier.getDefmodifier()); int defNumber = Integer.parseInt(modfier.getDefmodifier());
if (defNumber != 0) { if (defNumber != 0) {
...@@ -616,6 +626,18 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod ...@@ -616,6 +626,18 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
.subscribe(new ErrorHandleSubscriber<BaseResult>(mErrorHandler) { .subscribe(new ErrorHandleSubscriber<BaseResult>(mErrorHandler) {
@Override @Override
public void onComplete() {
super.onComplete();
updateFoodSoldoutCtrData(mSoldoutCtrList);
}
@Override
public void onError(Throwable t) {
super.onError(t);
updateFoodSoldoutCtrData(mSoldoutCtrList);
}
@Override
public void onNext(@NonNull BaseResult info) { public void onNext(@NonNull BaseResult info) {
if (info != null && info.isSuccess() && info.getData() != null) { if (info != null && info.isSuccess() && info.getData() != null) {
List<SoldoutCtrFood> soldoutCtrFoods = JsonUtils.parseArray(info.getData(), SoldoutCtrFood.class); List<SoldoutCtrFood> soldoutCtrFoods = JsonUtils.parseArray(info.getData(), SoldoutCtrFood.class);
...@@ -625,7 +647,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod ...@@ -625,7 +647,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
} }
mSoldoutCtrList.addAll(soldoutCtrFoods); mSoldoutCtrList.addAll(soldoutCtrFoods);
updateFoodSoldoutCtrData(mSoldoutCtrList); // updateFoodSoldoutCtrData(mSoldoutCtrList);
//設置細項沽清數 //設置細項沽清數
IActivity.setFineItemSlodoutListFull(mSoldoutCtrList); IActivity.setFineItemSlodoutListFull(mSoldoutCtrList);
} else { } else {
...@@ -666,7 +688,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod ...@@ -666,7 +688,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
MyOrderManage.getInstance().setNewFoodList(getOrderFoodLists()); MyOrderManage.getInstance().setNewFoodList(getOrderFoodLists());
printSendOrder(true); printSendOrder(true);
} else { } else {
mRootView.showMessage("送單失敗"); mRootView.showMessage(info.getErrMsg());
} }
} }
}); });
...@@ -707,7 +729,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod ...@@ -707,7 +729,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
} }
printSendOrder(false); printSendOrder(false);
} else { } else {
mRootView.showMessage("送單失敗"); mRootView.showMessage(info.getErrMsg());
} }
} }
} }
...@@ -750,23 +772,24 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod ...@@ -750,23 +772,24 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
// }); // });
} }
/**
* 問題:刪除數量 1.賬單小數未更新 世維調整
* 刪除已送單食品
*
* @param maxNumber
* @param deleteNumber
* @param reasonId
*/
public void deleteFood(int maxNumber, int deleteNumber, long reasonId) { public void deleteFood(int maxNumber, int deleteNumber, long reasonId) {
//删除食品前先保存一份
List<OrderDetail> recodeOrderFoods = new ArrayList<>();
recodeOrderFoods.addAll(getOrderFoodLists());
String ids = getSelectedOldFoodIds(); String ids = getSelectedOldFoodIds();
if (TextUtils.isEmpty(ids)) { if (TextUtils.isEmpty(ids)) {
return; return;
} }
//删除已选中食品 重新计算账单小数 折扣
removeSelectedFoods();
updateOrderMoneyItem();
DeleteOrderRequest.Request request = getDeleteOrderRequest(ids, reasonId, maxNumber, deleteNumber); DeleteOrderRequest.Request request = getDeleteOrderRequest(ids, reasonId, maxNumber, deleteNumber);
String deleteOrderRequest = GsonUtils.GsonString(request); String deleteOrderRequest = GsonUtils.GsonString(request);
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), deleteOrderRequest+","); RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), deleteOrderRequest);
mModel.deleteFood(requestBody) mModel.deleteFood(requestBody)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
...@@ -777,22 +800,10 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod ...@@ -777,22 +800,10 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
.compose(RxLifecycleUtils.bindToLifecycle(mRootView)) .compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<BaseRespose>(mErrorHandler) { .subscribe(new ErrorHandleSubscriber<BaseRespose>(mErrorHandler) {
private void restoreOrderDetails(){
getOrderFoodLists().addAll(recodeOrderFoods);
recodeOrderFoods.clear();
mSelectMealAdapter.notifyDataSetChanged();
}
@Override
public void onError(Throwable t) {
super.onError(t);
restoreOrderDetails();
}
@Override @Override
public void onNext(@NonNull BaseRespose info) { public void onNext(@NonNull BaseRespose info) {
if (info == null) { if (info == null) {
restoreOrderDetails();
mRootView.showMessage("刪除失敗"); mRootView.showMessage("刪除失敗");
return; return;
} }
...@@ -1633,8 +1644,6 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod ...@@ -1633,8 +1644,6 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
request.setOrderId(orderId); request.setOrderId(orderId);
request.setType(type); request.setType(type);
request.setReasonId(reasonId); request.setReasonId(reasonId);
Double rounding = getRounding();
request.setRounding(rounding != null ? rounding : 0);
return request; return request;
} }
......
...@@ -23,7 +23,11 @@ import com.gingersoft.gsa.cloud.constans.GoldConstants; ...@@ -23,7 +23,11 @@ import com.gingersoft.gsa.cloud.constans.GoldConstants;
import com.gingersoft.gsa.cloud.constans.PrintConstans; import com.gingersoft.gsa.cloud.constans.PrintConstans;
import com.gingersoft.gsa.cloud.database.bean.Discount; import com.gingersoft.gsa.cloud.database.bean.Discount;
import com.gingersoft.gsa.cloud.database.bean.Function; import com.gingersoft.gsa.cloud.database.bean.Function;
import com.gingersoft.gsa.cloud.function.FunctionManager;
import com.gingersoft.gsa.cloud.print.PrinterUtils; import com.gingersoft.gsa.cloud.print.PrinterUtils;
import com.gingersoft.gsa.cloud.table.ComponentTable;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.app.TableOperatTypeConstant;
import com.gingersoft.gsa.cloud.table.mvp.contract.OrderContentContract; import com.gingersoft.gsa.cloud.table.mvp.contract.OrderContentContract;
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.table.mvp.model.bean.TableDetail; import com.gingersoft.gsa.cloud.table.mvp.model.bean.TableDetail;
...@@ -135,6 +139,40 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra ...@@ -135,6 +139,40 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
if (XClickUtil.isFastDoubleClick(v, 1000)) { if (XClickUtil.isFastDoubleClick(v, 1000)) {
return; return;
} }
// if (function.getResUrl().equals(ComponentTable.table.order[0].getKeyRes())) {
// //送單
// sendOrder(false);
// } else if (function.getResUrl().equals(ComponentTable.table.order[1].getKeyRes())) {
// //印單
// if (!canPrint()) {
// return;
// }
// if (hasNesOrderFoods()) {
// //有未送單食品先送單
// sendOrder(true);
// } else {
// printOrder(OpenTableManage.getDefault().getTableBean().getId(), false);
// }
// } else if (function.getResUrl().equals(ComponentTable.table.order[2].getKeyRes())) {
// //結賬
// if (!canPay()) {
// return;
// }
// mRootView.startActivityForResult(OrderContentActivity.BILL_CODE, OrderPayActivity.class, null);
// } else if (function.getResUrl().equals(ComponentTable.table.order[3].getKeyRes())) {
// //轉移
// if (!canTransfer()) {
// return;
// }
// mRootView.showTransferFoodLayout();
// } else if (function.getResUrl().equals(ComponentTable.table.order[4].getKeyRes())) {
// //折扣
// if (!canDiscount()) {
// return;
// }
// showDiscountDialog();
// }
switch (function.getResName()) { switch (function.getResName()) {
case "送單": case "送單":
sendOrder(false); sendOrder(false);
...@@ -174,7 +212,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra ...@@ -174,7 +212,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
@Override @Override
public boolean onItemLongClick(View v, Function datasBean) { public boolean onItemLongClick(View v, Function datasBean) {
if (datasBean.getResName().equals("印單") || datasBean.getResName().equals("送單")) { if (datasBean.getResName().equals("印單") || datasBean.getResName().equals("送單")) {
PrinterUtils.switchPrintMethod(IActivity,datasBean, mOrderTopFunctionAdapter); PrinterUtils.switchPrintMethod(IActivity, datasBean, mOrderTopFunctionAdapter);
} }
return false; return false;
} }
...@@ -206,11 +244,11 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra ...@@ -206,11 +244,11 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
mFunctionList.add(new Function("結賬", Color.parseColor("#FFFFFF"), Color.parseColor("#DC0000"), 24)); mFunctionList.add(new Function("結賬", Color.parseColor("#FFFFFF"), Color.parseColor("#DC0000"), 24));
mFunctionList.add(new Function("轉移", Color.parseColor("#FFFFFF"), Color.parseColor("#FF4B9DFA"), 24)); mFunctionList.add(new Function("轉移", Color.parseColor("#FFFFFF"), Color.parseColor("#FF4B9DFA"), 24));
mFunctionList.add(new Function("折扣", Color.parseColor("#FFFFFF"), Color.parseColor("#008577"), 24)); mFunctionList.add(new Function("折扣", Color.parseColor("#FFFFFF"), Color.parseColor("#008577"), 24));
// List<Function> functions = FunctionManager.getDefault().getFunctionByResModule(IActivity, FunctionModule.Table.class, "order"); // List<Function> functions = FunctionManager.getDefault().getFunctionByResModule(IActivity, ComponentTable.table.class, ComponentTable.table.order, "order");
// for (int i = 0; i < functions.size(); i++) { // for (int i = 0; i < functions.size(); i++) {
// functions.get(i).setTextSize(ArmsUtils.getDimens(IActivity, R.dimen.sp_14)); // if (functions.get(i).getParentId() == 0) {
// functions.get(i).setTextColor(ArmsUtils.getColor(IActivity, R.color.theme_white_color)); // functions.remove(i);
// functions.get(i).setIconRes(FunctionModule.Table.order[i].getOpenIconRes()); // }
// } // }
// mFunctionList.addAll(functions); // mFunctionList.addAll(functions);
} }
...@@ -260,7 +298,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra ...@@ -260,7 +298,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
if (isPrint) { if (isPrint) {
printOrder(OpenTableManage.getDefault().getTableBean().getId(), true); printOrder(OpenTableManage.getDefault().getTableBean().getId(), true);
} else { } else {
mRootView.showMessage("送單失敗"); mRootView.showMessage(info.getErrMsg());
} }
} }
} }
...@@ -302,7 +340,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra ...@@ -302,7 +340,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
mRootView.showMessage("送單成功"); mRootView.showMessage("送單成功");
// mRootView.sendSuccess(); // mRootView.sendSuccess();
} else { } else {
mRootView.showMessage("送單失敗"); mRootView.showMessage(info.getErrMsg());
} }
} }
} }
...@@ -520,7 +558,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra ...@@ -520,7 +558,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
private void transferFood(TableBean.DataBean dataBean) { private void transferFood(TableBean.DataBean dataBean) {
//删除食品前先保存一份 //删除食品前先保存一份
List<OrderDetail> recodeOrderFoods = new ArrayList<>(); List<OrderDetail> recodeOrderFoods = new ArrayList<>();
recodeOrderFoods.addAll(getOrderFoodLists()); recodeOrderFoods.addAll(getOrderFoodLists());
String ids = getSelectedOldFoodIds(); String ids = getSelectedOldFoodIds();
...@@ -547,9 +585,11 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra ...@@ -547,9 +585,11 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
.compose(RxLifecycleUtils.bindToLifecycle(mRootView)) .compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<BaseRespose>(mErrorHandler) { .subscribe(new ErrorHandleSubscriber<BaseRespose>(mErrorHandler) {
private void restoreOrderDetails(){ private void restoreOrderDetails() {
getOrderFoodLists().clear();
getOrderFoodLists().addAll(recodeOrderFoods); getOrderFoodLists().addAll(recodeOrderFoods);
recodeOrderFoods.clear(); recodeOrderFoods.clear();
mSelectMealAdapter.setIndex();
mSelectMealAdapter.notifyDataSetChanged(); mSelectMealAdapter.notifyDataSetChanged();
} }
......
...@@ -13,6 +13,7 @@ import com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage; ...@@ -13,6 +13,7 @@ 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.CommonConfiguration; import com.gingersoft.gsa.cloud.base.utils.CommonConfiguration;
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils; import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils;
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.constans.GoldConstants; import com.gingersoft.gsa.cloud.constans.GoldConstants;
import com.gingersoft.gsa.cloud.database.bean.FoodCombo; import com.gingersoft.gsa.cloud.database.bean.FoodCombo;
import com.gingersoft.gsa.cloud.database.bean.Function; import com.gingersoft.gsa.cloud.database.bean.Function;
...@@ -59,6 +60,8 @@ import okhttp3.RequestBody; ...@@ -59,6 +60,8 @@ import okhttp3.RequestBody;
import static com.gingersoft.gsa.cloud.base.common.bean.OrderDetail.FOOD_TYPE; import static com.gingersoft.gsa.cloud.base.common.bean.OrderDetail.FOOD_TYPE;
import static com.gingersoft.gsa.cloud.base.common.bean.OrderDetail.MODIFIER_TYPE; import static com.gingersoft.gsa.cloud.base.common.bean.OrderDetail.MODIFIER_TYPE;
import static com.gingersoft.gsa.cloud.database.bean.Function.STATUS_NONACTIVATED;
import static com.gingersoft.gsa.cloud.database.bean.Function.STATUS_TIME_LIMIT;
/** /**
...@@ -151,39 +154,59 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont ...@@ -151,39 +154,59 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
@Override @Override
public void onItemClick(View view, int viewType, Object data, int position) { public void onItemClick(View view, int viewType, Object data, int position) {
switch (position) { Function function = (Function) data;
case 0: switch (function.getStatus()) {
//重置 case STATUS_NONACTIVATED:
mRootView.setCurrentOperatType(TableOperatTypeConstant.init_table_3); mRootView.showMessage( "服務暫未開通,敬請期待");
break; return;
case 1: case STATUS_TIME_LIMIT:
//轉檯 mRootView.showMessage( "服務已到期,請前往續費");
mRootView.setCurrentOperatType(TableOperatTypeConstant.move_table_4); return;
break; }
case 2: if (function.getResUrl().equals(ComponentTable.table.bottom[0].getKeyRes())) {
//上菜紙 //重置
mRootView.setCurrentOperatType(TableOperatTypeConstant.print_parper_2); mRootView.setCurrentOperatType(TableOperatTypeConstant.init_table_3);
break; } else if (function.getResUrl().equals(ComponentTable.table.bottom[1].getKeyRes())) {
//轉檯
mRootView.setCurrentOperatType(TableOperatTypeConstant.move_table_4);
} else if (function.getResUrl().equals(ComponentTable.table.bottom[3].getKeyRes())) {
//上菜紙
mRootView.setCurrentOperatType(TableOperatTypeConstant.print_parper_2);
} }
// switch (position) {
// case 0:
// //重置
// mRootView.setCurrentOperatType(TableOperatTypeConstant.init_table_3);
// break;
// case 1:
// //轉檯
// mRootView.setCurrentOperatType(TableOperatTypeConstant.move_table_4);
// break;
// case 2:
// //上菜紙
// mRootView.setCurrentOperatType(TableOperatTypeConstant.print_parper_2);
// break;
// }
} }
}); });
} }
public void initBottomFunctionItem() { public void initBottomFunctionItem() {
// List<Function> functions = FunctionManager.getDefault().getFunctionByResModule(IActivity, ComponentTable.Function.class, ComponentTable.Function.bottom,"bottom"); List<Function> functions = FunctionManager.getDefault().getFunctionByResModule(IActivity, ComponentTable.table.class, ComponentTable.table.bottom,"bottom");
// for (int i = 0; i < functions.size(); i++) { for (int i = 0; i < functions.size(); i++) {
// functions.get(i).setTextSize(ArmsUtils.getDimens(IActivity, R.dimen.sp_14)); if(functions.get(i).getParentId() == 0){
// functions.get(i).setTextColor(ArmsUtils.getColor(IActivity, R.color.theme_black)); functions.remove(i);
// functions.get(i).setIconRes(ComponentTable.Function.bottom[i].getOpenIconRes()); }
// } }
// mBottomFunctionList.addAll(functions); mBottomFunctionList.addAll(functions);
mBottomFunctionList.add(new Function((long) 1, "重置檯號", ArmsUtils.getColor(IActivity, R.color.theme_black), ArmsUtils.getDimens(IActivity, R.dimen.sp_14), R.mipmap.table_init)); // mBottomFunctionList.add(new Function((long) 1, "重置檯號", ArmsUtils.getColor(IActivity, R.color.theme_black), ArmsUtils.getDimens(IActivity, R.dimen.sp_14), R.mipmap.table_init));
mBottomFunctionList.add(new Function((long) 2, "轉檯", ArmsUtils.getColor(IActivity, R.color.theme_black), ArmsUtils.getDimens(IActivity, R.dimen.sp_14), R.mipmap.table_move)); // mBottomFunctionList.add(new Function((long) 2, "轉檯", ArmsUtils.getColor(IActivity, R.color.theme_black), ArmsUtils.getDimens(IActivity, R.dimen.sp_14), R.mipmap.table_move));
// mBottomFunctionList.add(new Function((long) 3, "分檯", ArmsUtils.getColor(IActivity, R.color.theme_black), ArmsUtils.getDimens(IActivity, R.dimen.sp_14), R.mipmap.table_splite)); // mBottomFunctionList.add(new Function((long) 3, "分檯", ArmsUtils.getColor(IActivity, R.color.theme_black), ArmsUtils.getDimens(IActivity, R.dimen.sp_14), R.mipmap.table_splite));
// mBottomFunctionList.add(new Function((long) 4, "skyorder", ArmsUtils.getColor(IActivity, R.color.theme_black), ArmsUtils.getDimens(IActivity, R.dimen.sp_14), R.mipmap.table_skyorder)); // mBottomFunctionList.add(new Function((long) 4, "skyorder", ArmsUtils.getColor(IActivity, R.color.theme_black), ArmsUtils.getDimens(IActivity, R.dimen.sp_14), R.mipmap.table_skyorder));
mBottomFunctionList.add(new Function((long) 5, "上菜紙", ArmsUtils.getColor(IActivity, R.color.theme_black), ArmsUtils.getDimens(IActivity, R.dimen.sp_14), R.mipmap.table_paper)); // mBottomFunctionList.add(new Function((long) 5, "上菜紙", ArmsUtils.getColor(IActivity, R.color.theme_black), ArmsUtils.getDimens(IActivity, R.dimen.sp_14), R.mipmap.table_paper));
} }
public void getTables(boolean show, RefreshLayout refreshLayout) { public void getTables(boolean show, RefreshLayout refreshLayout) {
int restaurantId = GsaCloudApplication.getRestaurantId(mApplication); int restaurantId = GsaCloudApplication.getRestaurantId(mApplication);
mModel.getTables(restaurantId) mModel.getTables(restaurantId)
...@@ -402,7 +425,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont ...@@ -402,7 +425,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
OrderBean.OrderDetailsBean orderDetailsBean = orderDetailsBeans.get(i); OrderBean.OrderDetailsBean orderDetailsBean = orderDetailsBeans.get(i);
if (orderDetailsBean.getType() == FOOD_TYPE) { if (orderDetailsBean.getType() == FOOD_TYPE) {
int nextIndex = i + 1; int nextIndex = i + 1;
if (orderDetailsBean.getParentId() == 0 || (orderDetailsBeans.size() > nextIndex && orderDetailsBeans.get(nextIndex).getType() == MODIFIER_TYPE) ) { if (orderDetailsBean.getParentId() == 0 || (orderDetailsBeans.size() > nextIndex && orderDetailsBeans.get(nextIndex).getType() == MODIFIER_TYPE)) {
paroductId = orderDetailsBean.getProductId(); paroductId = orderDetailsBean.getProductId();
} }
topId = getComboIdByFid(paroductId); topId = getComboIdByFid(paroductId);
......
...@@ -69,7 +69,7 @@ public class BottomFunctionAdapter extends DefaultAdapter<Function> { ...@@ -69,7 +69,7 @@ public class BottomFunctionAdapter extends DefaultAdapter<Function> {
private void initItemData(Function item) { private void initItemData(Function item) {
tv_name.setText(item.getResName()); tv_name.setText(item.getResName());
iv_icon.setImageResource(item.getIconRes()); iv_icon.setImageResource(item.getIcRes());
} }
} }
......
...@@ -193,10 +193,12 @@ public class FoodGroupAdapter extends DefaultAdapter<Food> { ...@@ -193,10 +193,12 @@ public class FoodGroupAdapter extends DefaultAdapter<Food> {
// } else { // } else {
// //后台没有设置颜色当前选中高亮色,没有选中默认使用绿色 // //后台没有设置颜色当前选中高亮色,没有选中默认使用绿色
if (datasBean.isSelected()) { if (datasBean.isSelected()) {
tv_name.setBackgroundColor(ArmsUtils.getColor(mContext, R.color.orange_500)); tv_name.setBackgroundColor(Color.parseColor("#3C3C3C"));
// tv_name.setBackgroundColor(ArmsUtils.getColor(mContext, R.color.orange_500));
tv_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color)); tv_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
} else { } else {
tv_name.setBackgroundColor(ArmsUtils.getColor(mContext, R.color.Grass_green)); tv_name.setBackgroundColor(Color.parseColor("#FF9700"));
// tv_name.setBackgroundColor(ArmsUtils.getColor(mContext, R.color.Grass_green));
tv_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color)); tv_name.setTextColor(ArmsUtils.getColor(mContext, R.color.theme_white_color));
} }
// } // }
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
android:id="@+id/iv_icon" android:id="@+id/iv_icon"
android:layout_width="@dimen/dp_25" android:layout_width="@dimen/dp_25"
android:layout_height="@dimen/dp_25" android:layout_height="@dimen/dp_25"
android:layout_marginTop="@dimen/dp_5" /> android:layout_marginTop="@dimen/dp_5"
android:src="@mipmap/ic_launcher" />
<TextView <TextView
android:id="@+id/tv_name" android:id="@+id/tv_name"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment