Commit 5cf2e2a2 by 宁斌

添加餐台模式埋点

parent 890979d5
......@@ -22,6 +22,7 @@ import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import com.gingersoft.gsa.cloud.common.core.restaurant.bean.BrandsBean;
import com.gingersoft.gsa.cloud.common.core.restaurant.utils.RestaurantInfoUtils;
import com.gingersoft.gsa.cloud.common.core.user.UserContext;
import com.gingersoft.gsa.cloud.common.logan.LoganManager;
import com.gingersoft.gsa.cloud.common.utils.JsonUtils;
import com.gingersoft.gsa.cloud.common.utils.log.LogUtil;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
......@@ -210,8 +211,8 @@ public class ChooseRestaurantActivity extends BaseActivity<ChooseRestaurantPrese
protected void saveBrandAndRestaurantInfo(int brandId, String brandName, BrandsBean.BrandsData.RestaurantsBean restaurantsBean) {
RestaurantInfoManager.newInstance().setBrandInfo(new BrandInfo(brandId, brandName));
if (restaurantsBean != null) {
RestaurantInfoManager.newInstance().setResturantInfo(new RestaurantInfo(restaurantsBean.getRestaurantId(),restaurantsBean.getRestaurantName()
,restaurantsBean.getGsPosShopId()));
RestaurantInfoManager.newInstance().setResturantInfo(new RestaurantInfo(restaurantsBean.getRestaurantId(), restaurantsBean.getRestaurantName()
, restaurantsBean.getGsPosShopId()));
}
}
......@@ -266,6 +267,7 @@ public class ChooseRestaurantActivity extends BaseActivity<ChooseRestaurantPrese
.call();
BrandsBean.BrandsData brandsBean = RestaurantInfoUtils.getBrandByRestaurantId(brands, item.getRestaurantId());
if (brandsBean != null) {
LoganManager.w_login(TAG, LoganManager.EVENT_SELECTED, "品牌=" + brandsBean.getBrandName() + " 餐廳=" + item.getRestaurantName());
saveBrandAndRestaurantInfo(brandsBean.getBrandId(), brandsBean.getBrandName(), item);
mPresenter.getLoginLimit(item.getRestaurantId(), true);
}
......@@ -301,6 +303,7 @@ public class ChooseRestaurantActivity extends BaseActivity<ChooseRestaurantPrese
}
}
}
@Override
public void jumpActivity(Class activity) {
startActivity(new Intent(this, activity));
......@@ -352,10 +355,6 @@ public class ChooseRestaurantActivity extends BaseActivity<ChooseRestaurantPrese
}).setGravity(Gravity.BOTTOM).show();
} else {
showMessage("獲取登陸人數失敗");
// GsaCloudApplication.logOut();
// UserContext.newInstance().logOut();
// launchActivity(new Intent(mContext, LoginActivity.class));
UserContext.newInstance().logOut();
}
}
......
......@@ -9,7 +9,8 @@
android:screenOrientation="portrait" />
<activity
android:name=".mvp.ui.activity.NewMainActivity"
android:launchMode="singleTop"
android:alwaysRetainTaskState="true"
android:launchMode="singleTask"
android:screenOrientation="portrait"/>
<activity
android:name=".mvp.ui.activity.ExpandListActivity"
......
......@@ -20,7 +20,8 @@
<activity android:name=".mvp.ui.activity.menu.ShellActivity" />
<activity
android:name=".mvp.ui.activity.NewMainActivity"
android:launchMode="singleTop" />
android:launchMode="singleTask"
android:alwaysRetainTaskState="true" />
<activity android:name=".mvp.ui.activity.ExpandListActivity" />
<activity android:name=".mvp.ui.activity.RestaurantQrCodeActivity" />
<activity android:name=".mvp.ui.activity.LanguageActivity" />
......
......@@ -6,7 +6,9 @@ import android.content.Intent;
import com.billy.cc.core.component.CC;
import com.billy.cc.core.component.CCResult;
import com.billy.cc.core.component.CCUtil;
import com.billy.cc.core.component.IComponent;
import com.gingersoft.gsa.cloud.common.logan.LoganManager;
import com.gingersoft.gsa.cloud.component.ComponentAction;
import com.gingersoft.gsa.cloud.component.ComponentName;
import com.gingersoft.gsa.cloud.common.function.FModule;
......@@ -18,6 +20,8 @@ import com.jess.arms.utils.ArmsUtils;
public class ComponentMain implements IComponent {
private final String TAG = getClass().getSimpleName();
public static final class main {
/**
* 首頁- 點餐
......@@ -79,6 +83,7 @@ public class ComponentMain implements IComponent {
String actionName = cc.getActionName();
switch (actionName) {
case "showMainActivity":
LoganManager.w_code(TAG,"onCall showMainActivity");
openActivity(cc);
break;
case "foodMenuActivity":
......@@ -129,8 +134,9 @@ public class ComponentMain implements IComponent {
Intent intent = new Intent(cc.getContext(), NewMainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
cc.getContext().startActivity(intent);
// CCUtil.createNavigateIntent(cc, MainActivity.class);
// CCUtil.createNavigateIntent(cc, NewMainActivity.class);
// CC.sendCCResult(cc.getCallId(), CCResult.success());
}
}
......@@ -196,6 +196,11 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
}
@Override
protected void onResume() {
super.onResume();
initFuncationData();
......@@ -246,7 +251,12 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
MainSideMenuAdapter adapter = new MainSideMenuAdapter(mainSideMenuBeans);
mRvSideMenu.setAdapter(adapter);
adapter.setOnItemClickListener((adapter1, view, position) -> {
switch (mainSideMenuBeans.get(position).getFunctionName()) {
String functionName = mainSideMenuBeans.get(position).getFunctionName();
LoganManager.w_home(TAG, LoganManager.EVENT_CLICK + functionName);
switch (functionName) {
case "切換環境":
//切換環境
CC.obtainBuilder(ComponentName.COMPONENT_LOGIN)
......@@ -388,6 +398,9 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
}
private void functionClick(String name, int status) {
LoganManager.w_home(TAG, LoganManager.EVENT_CLICK + name);
switch (name) {
case "餐檯模式":
CC.obtainBuilder(ComponentName.COMPONENT_TABLE)
......@@ -591,9 +604,7 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
showMessage("再按一次退出應用");
mExitTime = System.currentTimeMillis();
} else {
finish();
ArmsUtils.exitApp();
// System.exit(0);
}
}
return true;
......
......@@ -525,8 +525,10 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
public void onPageSelected(int position) {
currentFinePage = position;
if (currentFinePage == 0) {
LoganManager.w_tableMode(TAG, LoganManager.EVENT_CLICK + "口味");
tv_fine_type.setText("口味");
} else {
LoganManager.w_tableMode(TAG, LoganManager.EVENT_CLICK + "訊息");
tv_fine_type.setText("訊息");
}
}
......@@ -589,12 +591,14 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@OnClick(R2.id.btn_meal_discount)
void onClickDiscount() {
LoganManager.w_tableMode(TAG, LoganManager.EVENT_CLICK + "食品折扣");
OrderDetail mainOrderDetail = mPresenter.getSelectMealAdapter().getCurrentMainOrderDetail();
if (mainOrderDetail != null && mainOrderDetail.getAblediscount() == 0) {
showMessage("此食品不能參與折扣!");
return;
}
LoganManager.w_tableMode(TAG, LoganManager.EVENT_CLICK + "食品折扣");
//更新折扣数据
mPresenter.loadDiscountData();
......@@ -655,7 +659,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
DoshokuOrder.getInstance().setMemberInfo(null);
DiscountItem memberDiscountBillItem = (DiscountItem) mPresenter.findBillItemByClass(MemberDiscount.class);
if(memberDiscountBillItem != null){
if (memberDiscountBillItem != null) {
ShoppingCart shoppingCart = mPresenter.getShoppingCart();
shoppingCart.delMultyDiscount(memberDiscountBillItem.getDiscount());
//更新賬單信息
......@@ -690,6 +694,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@OnClick(R2.id.btn_multiple_selection)
void onClickMultipleSelection() {
LoganManager.w_tableMode(TAG, LoganManager.EVENT_CLICK, "多选");
currentFinePage = 0;
if (mPresenter.getSelectMealAdapter().getSelectedMode() == SelectMealAdapter.MULTIPLE_SELECTED) {
mPresenter.getSelectMealAdapter().setSelectedMode(SelectMealAdapter.SINGLE_SELECTED);
......@@ -706,13 +711,13 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@OnClick(R2.id.btn_select_all)
void onClickSelectAll() {
LoganManager.w_tableMode(TAG, "全選食品");
LoganManager.w_tableMode(TAG, LoganManager.EVENT_CLICK, "全選");
mPresenter.setSelectAll();
}
@OnClick(R2.id.btn_anti_selection)
void onClickAntiSelection() {
LoganManager.w_tableMode(TAG, "反選食品");
LoganManager.w_tableMode(TAG, LoganManager.EVENT_CLICK, "反選");
mPresenter.setAntiSelect();
}
......@@ -722,7 +727,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
public void onClick(View v) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
LoganManager.w_tableMode(TAG, LoganManager.EVENT_CLICK,v.getTransitionName());
LoganManager.w_tableMode(TAG, LoganManager.EVENT_CLICK, v.getTransitionName());
}
recordOperat(true);
......@@ -1365,6 +1370,9 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@Override
public void onPageSelect(int pageIndex) {
mPageIndex = pageIndex;
LoganManager.w_tableMode(TAG, LoganManager.EVENT_SCOLL + "食品組頁=" + (pageIndex + 1));
for (int i = 0; i < totalPage; i++) {
if (i == pageIndex) {
ivPoints[i].setImageResource(R.drawable.meal_food_group_point_focuese);
......
......@@ -150,7 +150,8 @@ public class CancelFoodDialog extends BaseRetryDialog implements Slider.OnSlider
@Override
public void onClick(View v) {
mCurrCancelNumber = mMaxCancelNumber;
slider_food_count.setValue(mMaxCancelNumber);
slider_food_count.setValue(mCurrCancelNumber);
tv_number_value.setText(String.valueOf(mCurrCancelNumber));
}
});
ll_container.setRadiusAndShadow(mRadius, QMUIDisplayHelper.dp2px(mContext, mShadowElevationDp), mShadowAlpha);
......
......@@ -7,8 +7,8 @@ ext {
targetSdkVersion : 29,
//正式版: 1.0.3 3
//內部測試版:1.2.0 20
versionCode : 22,
versionName : "1.2.2"
versionCode : 23,
versionName : "1.2.3"
]
version = [
......
......@@ -348,12 +348,12 @@ public class GsaCloudApplication extends BaseApplication {
@Override
public void onPrinterDataBefore(int orderType, int printType, String printerData, String printerDeviceInfo) {
LoganManager.w_printer(TAG, "打印前数据--> printerData=" + printerData + " printerDeviceInfo=" + printerDeviceInfo);
LoganManager.w_printer(TAG, "打印前数据-> printerData=" + printerData + " printerDeviceInfo=" + printerDeviceInfo);
}
@Override
public void onPrinterBitmapBefore(int orderType, int printType, String directoryName, List<Bitmap> bitmaps) {
LoganManager.w_printer(TAG, "生成的打印圖片-->");
LoganManager.w_printer(TAG, "生成的打印圖片->");
PrinterFileUtils.savePrinterBitmapByType(orderType, printType, directoryName, bitmaps);
}
......@@ -370,7 +370,7 @@ public class GsaCloudApplication extends BaseApplication {
@Override
public void connectionBefore(String deviceName, String ip, int port, long ioTimeout, long printTimeout) {
Object[] objs = {deviceName, ip, port, ioTimeout, printTimeout};
LoganManager.w_printer(TAG, String.format("連接打印機前--> deviceName=%s ,IP=%s ,port=%s ,ioTimeout=%s ,printTimeout=%s", objs));
LoganManager.w_printer(TAG, String.format("連接打印機前-> deviceName=%s ,IP=%s ,port=%s ,ioTimeout=%s ,printTimeout=%s", objs));
}
@Override
......
......@@ -15,6 +15,7 @@ public class LoganConfig {
public static final String EncryptIV16 = "0123456789012345";
public static final String APP_ID = "gingersoft1008611";
public static final String UPLOAD_LOG_URL = HttpsConstans.HTTP_ADDRESS_URL_HK+ "/logan-web/logan/upload.json";
// public static final String UPLOAD_LOG_URL = "http://192.168.1.131:8080/logan-web/logan/upload.json";
/**
* 日誌保留天數
......
......@@ -34,7 +34,7 @@ public class HeadersInterceptor implements Interceptor {
String deviceId = DeviceID.getDeviceId();
if (deviceId != null) {
builder.set("deviceId", DeviceID.getDeviceId());
builder.set("deviceId", deviceId);
}
Headers headers = originalRequest.headers();
for (int i = 0; i < headers.size(); i++) {
......
......@@ -62,6 +62,8 @@ public class LoganManager {
/*******************************自定義業務日誌類型**************************************/
private static final String LOGIN_BUSINESS_TAG = "login-> ";
private static final String HOME_BUSINESS_TAG = "home-> ";
private static final String DATABASE_BUSINESS_TAG = "database-> ";
private static final String PRINTER_BUSINESS_TAG = "printer-> ";
private static final String TABLEMODE_BUSINESS_TAG = "tableMode-> ";
......@@ -71,6 +73,7 @@ public class LoganManager {
/*******************************交互事件類型**************************************/
public static final String EVENT_CLICK = "點擊->";
public static final String EVENT_LONG_CLICK = "長按->";
public static final String EVENT_SELECTED = "選中->";
public static final String EVENT_TOUCH = "觸摸->";
public static final String EVENT_SCOLL = "滑動->";
public static final String EVENT_RETRY = "重試加載->";
......@@ -84,6 +87,14 @@ public class LoganManager {
public static final String EVENT_MODIFY = "修改->";
public static final String EVENT_QUERY = "查詢->";
public static void w_login(String TAG,String... eventAndLog) {
w_business(LOGIN_BUSINESS_TAG, TAG, eventAndLog);
}
public static void w_home(String TAG,String... eventAndLog) {
w_business(HOME_BUSINESS_TAG, TAG, eventAndLog);
}
public static void w_database(String TAG,String... eventAndLog) {
w_business(DATABASE_BUSINESS_TAG, TAG, eventAndLog);
}
......
package com.gingersoft.gsa.cloud.common.printer;
import android.graphics.Bitmap;
import android.os.Environment;
import android.text.TextUtils;
import com.gingersoft.gsa.cloud.app.GsaCloudApplication;
import com.gingersoft.gsa.cloud.common.constans.PrintConstans;
import com.gingersoft.gsa.cloud.common.logan.LoganManager;
import com.gingersoft.gsa.cloud.common.utils.FileUtils;
......
......@@ -63,38 +63,6 @@ public class FileUtils {
public final static String ERRORLOG_PATH = LOG_PATH + ErrorLog + File.separator;
public final static String APK_PATH = Environment.getExternalStorageDirectory() + File.separator + APK + File.separator;
/**
* 打印前圖片存儲路徑
*/
// public final static class PrinterImagePath {
// //Prj圖片文件最大文件大小不能超過100M
// public static final int PRINTER_MAX_FILE_SIZE = 100 * 1024 * 1024;
// //Prj最少保留文件大小
// public static final int PRINTER_KEEP_FILE_SIZE = 20 * 1024 * 1024;
//
// public static String PrinterImagesRootPath = "PrinterImages";
// public static String KitchenImage = "KitchenImages";
// public static String PrintOrderImage = "PrintOrderImages";
// public static String BillImage = "BillImages";
// public static String ServingPaperImage = "ServingPaperImages";
// public static String DeliveryPrintOrderImage = "DeliveryPrintOrderImages";
// public static String DeliveryBillImage = "DeliveryBillImages";
// public static String QrcodeImage = "QrcodeImages";
// public static String SettlementImage = "SettlementImages";
//
// public final static String ROOT_PATH = ALBUM_PATH + PrinterImagesRootPath + File.separator;
// public final static String KITCHEN_PRJ_IMAGE_PATH = ROOT_PATH + KitchenImage + File.separator;
// public final static String PRINT_ORDER_IMAGE_PATH = ROOT_PATH + PrintOrderImage + File.separator;
// public final static String BILL_IMAGE_PATH = ROOT_PATH + BillImage + File.separator;
// public final static String SERVING_PAPER_IMAGE_PATH = ROOT_PATH + ServingPaperImage + File.separator;
// public final static String DELIVERY_PRINT_ORDER_IMAGE_PATH = ROOT_PATH + DeliveryPrintOrderImage + File.separator;
// public final static String DELIVERY_BILL_IMAGE_PATH = ROOT_PATH + DeliveryBillImage + File.separator;
// public final static String QRCODE_IMAGE_PATH = ROOT_PATH + QrcodeImage + File.separator;
// public final static String SETTLEMENT_IMAGE_PATH = ROOT_PATH + SettlementImage + File.separator;
// }
public final static String FILE_EXTENSION_SEPARATOR = ".";
//操作日志單最大文件大小
public final static int ACTION_MAX_SIZE = 1024 * 1024 * 5;
//操作日志文件按照時間刪除
......@@ -246,7 +214,6 @@ public class FileUtils {
inStream.close();
return outStream.toString();
} catch (IOException e) {
XLog.tag("FileTest").d(e.getMessage());
}
return null;
}
......
......@@ -234,13 +234,11 @@ public class AppCrashHandler implements UncaughtExceptionHandler {
LogUtil.d(TAG, "delete result : " + delete);
}
}
XLog.d(TAG, "sendFileMultipart onNext: " + data);
}
}
@Override
public void onError(Throwable t) {
XLog.d(TAG, "sendFileMultipart onError: " + t.getMessage());
}
@Override
......
......@@ -18,13 +18,10 @@ package com.gingersoft.gsa.cloud.print;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import com.elvishew.xlog.XLog;
import com.gingersoft.gsa.cloud.common.constans.PrintConstans;
import com.gingersoft.gsa.cloud.common.logan.LoganManager;
import com.gingersoft.gsa.cloud.common.printer.plugins.PrinterPlugins;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.ref.WeakReference;
......
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