Commit 1190a2a6 by Wyh

9.29 1、餐廳擴展表列表編輯頁面 2、PRJ調整字體大小 3、合併TimeUtil工具類

Signed-off-by: Wyh <1239658231>
parent 1019d223
......@@ -45,7 +45,7 @@ android {
/**
* 版本号
*/
schemaVersion 15
schemaVersion 16
/**
* greendao输出dao的数据库操作实体类文件夹(相对路径 包名+自定义路径名称,包将创建于包名的直接路径下)
*/
......
......@@ -4,7 +4,7 @@ import android.util.Log;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.utils.encryption.Aes;
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtil;
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils;
import com.gingersoft.gsa.cloud.constans.AppConstans;
import com.gingersoft.gsa.cloud.constans.HttpsConstans;
import com.gingersoft.gsa.cloud.globalconfig.applyOptions.intercept.LoggingInterceptor;
......@@ -260,7 +260,7 @@ public class OkHttp3Utils {
public static void noticePersonnel(String errCode, String pushContent) {
String restaurantInfo =
"版本號:" + DeviceUtils.getVersionName(GsaCloudApplication.getAppContext()) + "|" + DeviceUtils.getVersionCode(GsaCloudApplication.getAppContext()) +
"時間:" + TimeUtil.getCurrentDate(TimeUtil.dateFormatYMDHMS) +
"時間:" + TimeUtils.getCurrentDate(TimeUtils.DEFAULT_DATE_FORMAT) +
"報錯CODE:" + errCode +
"品牌名:" + GsaCloudApplication.getBrandName() +
"餐廳名:" + GsaCloudApplication.getRestaurantName() +
......
package com.gingersoft.gsa.cloud.database.bean;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.Generated;
import java.util.Date;
import org.greenrobot.greendao.annotation.Transient;
/**
* 作者:ELEGANT_BIN
......@@ -37,10 +36,15 @@ public class ExpandInfo {
*/
private String remark;
private int dataType;//配置的數據類型 1:整形,2:字符型,3:布爾型,4:日期類型
private String sort;//排序
private int valueBoolean;//是否在雲端GSA上配置:0 否,1 是
@Transient
private boolean isUpdate = false;//是否被編輯了
@Generated(hash = 1553907136)
public ExpandInfo(Long id, int restaurantId, String settingName, Integer valueInt,
String valueChar, String valueDatetime, String remark) {
@Generated(hash = 136088095)
public ExpandInfo(Long id, int restaurantId, String settingName, Integer valueInt, String valueChar,
String valueDatetime, String remark, int dataType, String sort, int valueBoolean) {
this.id = id;
this.restaurantId = restaurantId;
this.settingName = settingName;
......@@ -48,6 +52,9 @@ public class ExpandInfo {
this.valueChar = valueChar;
this.valueDatetime = valueDatetime;
this.remark = remark;
this.dataType = dataType;
this.sort = sort;
this.valueBoolean = valueBoolean;
}
@Generated(hash = 9429432)
......@@ -110,4 +117,44 @@ public class ExpandInfo {
public void setValueDatetime(String valueDatetime) {
this.valueDatetime = valueDatetime;
}
public int getDataType() {
return dataType;
}
public void setDataType(int dataType) {
this.dataType = dataType;
}
public String getSort() {
return sort;
}
public void setSort(String sort) {
this.sort = sort;
}
public int getValueBoolean() {
return valueBoolean;
}
public void setValueBoolean(int valueBoolean) {
this.valueBoolean = valueBoolean;
}
public boolean isUpdate() {
return isUpdate;
}
public void setUpdate(boolean update) {
isUpdate = update;
}
public boolean getIsUpdate() {
return this.isUpdate;
}
public void setIsUpdate(boolean isUpdate) {
this.isUpdate = isUpdate;
}
}
......@@ -14,10 +14,10 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* Master of DAO (schema version 15): knows all DAOs.
* Master of DAO (schema version 16): knows all DAOs.
*/
public class DaoMaster extends AbstractDaoMaster {
public static final int SCHEMA_VERSION = 15;
public static final int SCHEMA_VERSION = 16;
/** Creates underlying database table using DAOs. */
public static void createAllTables(Database db, boolean ifNotExists) {
......
......@@ -3,13 +3,13 @@ package com.gingersoft.gsa.cloud.database.greendao;
import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import com.gingersoft.gsa.cloud.database.bean.ExpandInfo;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.internal.DaoConfig;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import com.gingersoft.gsa.cloud.database.bean.ExpandInfo;
import org.greenrobot.greendao.internal.DaoConfig;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
......@@ -31,6 +31,9 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
public final static Property ValueChar = new Property(4, String.class, "valueChar", false, "VALUE_CHAR");
public final static Property ValueDatetime = new Property(5, String.class, "valueDatetime", false, "VALUE_DATETIME");
public final static Property Remark = new Property(6, String.class, "remark", false, "REMARK");
public final static Property DataType = new Property(7, int.class, "dataType", false, "DATA_TYPE");
public final static Property Sort = new Property(8, String.class, "sort", false, "SORT");
public final static Property ValueBoolean = new Property(9, int.class, "valueBoolean", false, "VALUE_BOOLEAN");
}
......@@ -52,7 +55,10 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
"\"VALUE_INT\" INTEGER," + // 3: valueInt
"\"VALUE_CHAR\" TEXT," + // 4: valueChar
"\"VALUE_DATETIME\" TEXT," + // 5: valueDatetime
"\"REMARK\" TEXT);"); // 6: remark
"\"REMARK\" TEXT," + // 6: remark
"\"DATA_TYPE\" INTEGER NOT NULL ," + // 7: dataType
"\"SORT\" TEXT," + // 8: sort
"\"VALUE_BOOLEAN\" INTEGER NOT NULL );"); // 9: valueBoolean
}
/** Drops the underlying database table. */
......@@ -95,6 +101,13 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
if (remark != null) {
stmt.bindString(7, remark);
}
stmt.bindLong(8, entity.getDataType());
String sort = entity.getSort();
if (sort != null) {
stmt.bindString(9, sort);
}
stmt.bindLong(10, entity.getValueBoolean());
}
@Override
......@@ -131,6 +144,13 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
if (remark != null) {
stmt.bindString(7, remark);
}
stmt.bindLong(8, entity.getDataType());
String sort = entity.getSort();
if (sort != null) {
stmt.bindString(9, sort);
}
stmt.bindLong(10, entity.getValueBoolean());
}
@Override
......@@ -147,7 +167,10 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
cursor.isNull(offset + 3) ? null : cursor.getInt(offset + 3), // valueInt
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // valueChar
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // valueDatetime
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6) // remark
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // remark
cursor.getInt(offset + 7), // dataType
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // sort
cursor.getInt(offset + 9) // valueBoolean
);
return entity;
}
......@@ -161,6 +184,9 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
entity.setValueChar(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setValueDatetime(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setRemark(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setDataType(cursor.getInt(offset + 7));
entity.setSort(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
entity.setValueBoolean(cursor.getInt(offset + 9));
}
@Override
......
......@@ -133,6 +133,4 @@ public class ExpandInfoDaoUtils {
return mManager.getDaoSession().queryRaw(ExpandInfo.class, sql, conditions);
}
}
......@@ -15,16 +15,14 @@ import android.os.Build
import android.os.IBinder
import android.os.PowerManager
import android.util.Log
import android.view.WindowManager
import android.widget.RemoteViews
import androidx.annotation.RequiresApi
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import com.gingersoft.gsa.cloud.base.R
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
import com.gingersoft.gsa.cloud.base.utils.SoundPoolUtils
import com.gingersoft.gsa.cloud.base.utils.okhttpUtils.OkHttp3Utils
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtil
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
import com.gingersoft.gsa.cloud.constans.AppConstans
import com.gingersoft.gsa.cloud.constans.HttpsConstans
import com.google.gson.Gson
......@@ -356,7 +354,7 @@ class GetInfoUpdateService : Service() {
* 向日誌添加數據
*/
private fun putTimeLog(content: String) {
loginfo.append(TimeUtil.getCurrentDate(TimeUtil.dateFormatYMDHMS))
loginfo.append(TimeUtils.getCurrentDate(TimeUtils.DEFAULT_DATE_FORMAT))
loginfo.append(":")
loginfo.append(content)
loginfo.append("\n")
......
......@@ -157,9 +157,7 @@ public class ColdChainMainActivity extends BaseFragmentActivity<ColdChainMainPre
autoReceivingOrders.setChecked(RestaurantExpandInfoUtils.getValue(ExpandConstant.FrozenChainAutoOrder, false));
autoReceivingOrders.setOnCheckedChangeListener((buttonView, isChecked) -> {
RestaurantExpandInfoUtils.setValue(ExpandConstant.FrozenChainAutoOrder, isChecked);
if (autoOrderDisposable != null && !autoOrderDisposable.isDisposed()) {
autoOrderDisposable.dispose();
}
......@@ -192,7 +190,6 @@ public class ColdChainMainActivity extends BaseFragmentActivity<ColdChainMainPre
});
}
public void getNumByOrderTypeInvoke(String functionName) {
Class[] parameterTypes = {SupplementInfoBean.class};
try {
......@@ -274,13 +271,13 @@ public class ColdChainMainActivity extends BaseFragmentActivity<ColdChainMainPre
|| type == 6 || type == 7) {//ColdChainConstants.orderType
fragments.get(viewPager.getCurrentItem()).onRefreshData();
mPresenter.getBalance();
if(autoReceivingOrders.isChecked()){
mPresenter.startToBeConfirmedOrderList(restaurantId);
}
}
if (type == 3 || type == 6 || type == 7) {
getNumByOrderTypeInvoke("loadNumber");
}
if (autoReceivingOrders.isChecked()) {
mPresenter.startToBeConfirmedOrderList(restaurantId);
}
});
bind.execute(aBoolean -> null);
bind.setJumpActivity(ColdChainMainActivity.class);
......
......@@ -50,7 +50,7 @@ ext {
"autosize" : 'me.jessyan:autosize:1.1.2',
"butterknife" : "com.jakewharton:butterknife:${version["butterknifeSdkVersion"]}",
"butterknife-compiler" : "com.jakewharton:butterknife-compiler:${version["butterknifeSdkVersion"]}",
"pickerview" : "com.contrarywind:Android-PickerView:3.2.5",
"pickerview" : "com.contrarywind:Android-PickerView:4.1.9",
"photoview" : "com.github.chrisbanes.photoview:library:1.2.3",
"numberprogressbar" : "com.daimajia.numberprogressbar:library:1.2@aar",
"nineoldandroids" : "com.nineoldandroids:library:2.4.0",
......
......@@ -340,7 +340,7 @@
// * 向日誌添加數據
// */
// private fun putTimeLog(content: String) {
// loginfo.append(TimeUtil.getCurrentDate(TimeUtil.dateFormatYMDHMS))
// loginfo.append(TimeUtils.getCurrentDate(TimeUtil.dateFormatYMDHMS))
// loginfo.append(":")
// loginfo.append(content)
// loginfo.append("\n")
......
......@@ -2,7 +2,7 @@ package com.gingersoft.gsa.delivery_pick_mode.ui.adapter
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtil
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.ServiceChargeRecordBean
......@@ -15,7 +15,7 @@ class ThirdExpensesAdapter(data: MutableList<ServiceChargeRecordBean.DataX>?) :
holder.setText(R.id.tv_third_expenses_amount, "金額")
} else {
holder.setText(R.id.tv_third_expenses_user, "" + item.updateName)
holder.setText(R.id.tv_third_expenses_time, TimeUtil.StampToData(TimeUtil.dateFormatYMDHMS, item.updateTime))
holder.setText(R.id.tv_third_expenses_time, TimeUtils.StampToData(TimeUtils.DEFAULT_DATE_FORMAT, item.updateTime))
holder.setText(R.id.tv_third_expenses_amount, "+$" + item.paymentValue)
}
}
......
......@@ -2,7 +2,7 @@ package com.gingersoft.gsa.cloud.login.mvp.ui.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtil;
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils;
import com.gingersoft.gsa.cloud.login.R;
import com.gingersoft.gsa.cloud.login.mvp.bean.LoginLimitBean;
......@@ -21,6 +21,6 @@ public class LoginLimitAdapter extends BaseQuickAdapter<LoginLimitBean, BaseView
@Override
protected void convert(@NotNull BaseViewHolder baseViewHolder,LoginLimitBean loginLimitBean) {
baseViewHolder.setText(R.id.tv_login_limit_account, loginLimitBean.getUserName());
baseViewHolder.setText(R.id.tv_login_limit_time, TimeUtil.getStringByFormat(loginLimitBean.getDateTime(), TimeUtil.dateFormatYMDHMS));
baseViewHolder.setText(R.id.tv_login_limit_time, TimeUtils.getStringByFormat(loginLimitBean.getDateTime(), TimeUtils.DEFAULT_DATE_FORMAT));
}
}
......@@ -7,6 +7,7 @@
<activity
android:name=".mvp.ui.activity.NewMainActivity"
android:launchMode="singleTask" />
<activity android:name=".mvp.ui.activity.ExpandListActivity"/>
<activity android:name=".mvp.ui.activity.MainActivity" />
<activity android:name=".mvp.ui.activity.ReportActivity" />
<activity android:name=".mvp.ui.activity.SettlementActivity" />
......
......@@ -17,7 +17,7 @@
android:networkSecurityConfig="@xml/network_android"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".mvp.ui.activity.ExpandListActivity"></activity>
<activity android:name=".mvp.ui.activity.ExpandListActivity"/>
<activity android:name=".mvp.ui.activity.RestaurantQrCodeActivity" />
<activity android:name=".mvp.ui.activity.LanguageActivity" />
<activity android:name=".mvp.ui.activity.ReportActivity" />
......
package com.gingersoft.gsa.cloud.main.mvp.contract;
import com.gingersoft.gsa.cloud.database.bean.Function;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.FunctionBean;
import com.jess.arms.mvp.IView;
import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.database.bean.ExpandInfo;
import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
import java.util.List;
......@@ -13,11 +13,11 @@ import io.reactivex.Observable;
public interface ExpandListContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
void loadExpandList(List<Function> data);
void loadExpandList(List<ExpandInfo> data);
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
Observable<FunctionBean> getExpandList(long userId);
Observable<BaseResult> getExpandList(int restaurantId);
}
}
......@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.main.mvp.model;
import android.app.Application;
import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.main.mvp.contract.ExpandListContract;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.FunctionBean;
import com.gingersoft.gsa.cloud.main.mvp.model.service.ExpandListService;
......@@ -36,7 +37,7 @@ public class ExpandListModel extends BaseModel implements ExpandListContract.Mod
@Override
public Observable<FunctionBean> getExpandList(long userId) {
return mRepositoryManager.obtainRetrofitService(ExpandListService.class).getExpandList(userId);
public Observable<BaseResult> getExpandList(int restaurantId) {
return mRepositoryManager.obtainRetrofitService(ExpandListService.class).getExpandList(restaurantId);
}
}
\ No newline at end of file
package com.gingersoft.gsa.cloud.main.mvp.model.service;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.FunctionBean;
import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import io.reactivex.Observable;
import me.jessyan.retrofiturlmanager.RetrofitUrlManager;
......@@ -9,6 +9,6 @@ import retrofit2.http.Query;
public interface ExpandListService {
@GET("user/resource/list" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<FunctionBean> getExpandList(@Query("userId") long userId);
@GET("restaurant/ext/list" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseResult> getExpandList(@Query("restaurantId") int restaurantId);
}
......@@ -3,14 +3,18 @@ package com.gingersoft.gsa.cloud.main.mvp.presenter;
import android.app.Application;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.base.utils.JsonUtils;
import com.gingersoft.gsa.cloud.database.bean.ExpandInfo;
import com.gingersoft.gsa.cloud.main.mvp.contract.ExpandListContract;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.FunctionBean;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.http.imageloader.ImageLoader;
import com.jess.arms.integration.AppManager;
import com.jess.arms.mvp.BasePresenter;
import com.jess.arms.utils.RxLifecycleUtils;
import java.util.List;
import javax.inject.Inject;
import io.reactivex.android.schedulers.AndroidSchedulers;
......@@ -45,17 +49,24 @@ public class ExpandListPresenter extends BasePresenter<ExpandListContract.Model,
}
public void getExpandInfoList() {
mModel.getExpandList(GsaCloudApplication.getMemberId())
mModel.getExpandList(GsaCloudApplication.getRestaurantId())
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(""))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<FunctionBean>(mErrorHandler) {
.subscribe(new ErrorHandleSubscriber<BaseResult>(mErrorHandler) {
@Override
public void onNext(FunctionBean functionBean) {
mRootView.loadExpandList(functionBean.getData());
public void onNext(BaseResult result) {
if (result.isSuccess()) {
if (result.getData() != null) {
List<ExpandInfo> expandInfoList = JsonUtils.parseArray(result.getData(), ExpandInfo.class);
mRootView.loadExpandList(expandInfoList);
}
}
}
});
}
......
......@@ -2,32 +2,45 @@ package com.gingersoft.gsa.cloud.main.mvp.ui.activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.gingersoft.gsa.cloud.database.bean.Function;
import com.gingersoft.gsa.cloud.database.bean.ExpandInfo;
import com.gingersoft.gsa.cloud.main.R;
import com.gingersoft.gsa.cloud.main.R2;
import com.gingersoft.gsa.cloud.main.di.component.DaggerExpandListComponent;
import com.gingersoft.gsa.cloud.main.di.module.ExpandListModule;
import com.gingersoft.gsa.cloud.main.mvp.contract.ExpandListContract;
import com.gingersoft.gsa.cloud.main.mvp.presenter.ExpandListPresenter;
import com.gingersoft.gsa.cloud.main.mvp.ui.adapter.ExpandListAdapter;
import com.jess.arms.base.BaseActivity;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils;
import com.qmuiteam.qmui.alpha.QMUIAlphaButton;
import com.qmuiteam.qmui.widget.QMUITopBar;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.OnClick;
import static com.jess.arms.utils.Preconditions.checkNotNull;
public class ExpandListActivity extends BaseActivity<ExpandListPresenter> implements ExpandListContract.View {
public class ExpandListActivity extends BaseActivity<ExpandListPresenter> implements ExpandListContract.View, View.OnClickListener {
@BindView(R2.id.rv_expand_list)
RecyclerView rvExpandList;
private ExpandListAdapter expandListAdapter;
@BindView(R2.id.topbar_expand_list)
QMUITopBar topBar;
@BindView(R2.id.btn_expand_save)
QMUIAlphaButton btnSave;
@Override
public void setupActivityComponent(@NonNull AppComponent appComponent) {
......@@ -56,7 +69,9 @@ public class ExpandListActivity extends BaseActivity<ExpandListPresenter> implem
@Override
public void initTopBar() {
topBar.setBackgroundColor(ContextCompat.getColor(this, R.color.theme_color));
topBar.addLeftBackImageButton().setOnClickListener(v -> killMyself());
topBar.setTitle("配置列表");
}
@Override
......@@ -102,7 +117,31 @@ public class ExpandListActivity extends BaseActivity<ExpandListPresenter> implem
}
@Override
public void loadExpandList(List<Function> data) {
public void loadExpandList(List<ExpandInfo> data) {
expandListAdapter = new ExpandListAdapter(data);
rvExpandList.setAdapter(expandListAdapter);
rvExpandList.setLayoutManager(new LinearLayoutManager(mContext));
}
@OnClick(R2.id.btn_expand_save)
@Override
public void onClick(View v) {
int viewId = v.getId();
if (viewId == R.id.btn_expand_save) {
//保存
List<ExpandInfo> data = expandListAdapter.getData();
List<ExpandInfo> updateDate = new ArrayList<>();
for (int i = 0; i < data.size(); i++) {
if (data.get(i).getIsUpdate()) {
updateDate.add(data.get(i));
}
}
if (updateDate.size() > 0) {
//調用接口批量修改
} else {
killMyself();
}
}
}
}
......@@ -403,12 +403,12 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
.setActionName("showTableManageActivity")
.build()
.call();
} else if(name.equals("冷鏈接單")){
} else if (name.equals("冷鏈接單") || name.equals("凍鏈接單")) {
CC.obtainBuilder("Component.ColdChain")
.setActionName("Component.ColdChain")
.build()
.call();
} else if(name.equals("二維碼")){
} else if (name.equals("二維碼")) {
launchActivity(new Intent(mContext, RestaurantQrCodeActivity.class));
} else if (name.equals("配置列表")) {
launchActivity(new Intent(mContext, ExpandListActivity.class));
......
......@@ -138,7 +138,7 @@ public class SettlementActivity extends BaseActivity<SettlementPresenter> implem
this.mSettlementReportBean = datasBean;
if(mSettlementReportBean.getRestaurantOperation() != null) {
String lastSettlementText = LanguageUtils.get_language_system(this, "", "上次清機時間:");
setLastTime(lastSettlementText + TimeUtils.getStringByFormat(mSettlementReportBean.getRestaurantOperation().getOperationTime(), TimeUtils.dateFormatYMDHMS) );
setLastTime(lastSettlementText + TimeUtils.getStringByFormat(mSettlementReportBean.getRestaurantOperation().getOperationTime(), TimeUtils.DEFAULT_DATE_FORMAT) );
}
}
......
......@@ -27,7 +27,6 @@ import com.gingersoft.gsa.cloud.base.utils.LanguageUtils;
import com.gingersoft.gsa.cloud.base.utils.MoneyUtil;
import com.gingersoft.gsa.cloud.base.utils.PrintTransitUtils;
import com.gingersoft.gsa.cloud.base.utils.other.SPUtils;
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtil;
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils;
import com.gingersoft.gsa.cloud.constans.PrintConstans;
import com.gingersoft.gsa.cloud.main.R;
......@@ -333,7 +332,7 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
SettlementReport.DataBean.RestaurantOperationBean restaurantOperationBean = datasBean.getRestaurantOperation();
if (restaurantOperationBean != null) {
tv_business_area_title.setText(dailyBusinessReportText);
tv_last_time.setText(lastSettlementText + TimeUtils.getStringByFormat(restaurantOperationBean.getOperationTime(), TimeUtils.dateFormatYMDHMS));
tv_last_time.setText(lastSettlementText + TimeUtils.getStringByFormat(restaurantOperationBean.getOperationTime(), TimeUtils.DEFAULT_DATE_FORMAT));
}
tv_start_time.setText(byBusinessDateText + datasBean.getStartTime());
......@@ -541,8 +540,8 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
/**本月累計營業額*/
if (analysisBeanMap.containsKey(cumulativeTurnoverMonthText)) {
SettlementReport.DataBean.AnalysisBean analysisBean = analysisBeanMap.get(cumulativeTurnoverMonthText);
String firstDayOfMonth = TimeUtil.getFirstDayOfMonth(TimeUtil.dateFormatYMD) + " 00:00:00";
String currentDate = TimeUtil.getCurrentDate(TimeUtil.dateFormatYMDHMS);
String firstDayOfMonth = TimeUtils.getFirstDayOfMonth(TimeUtils.DATE_FORMAT_DATE) + " 00:00:00";
String currentDate = TimeUtils.getCurrentDate(TimeUtils.DEFAULT_DATE_FORMAT);
settlementReportItem5s.add(new SectionTextItem5(null, null, null, null, null));
settlementReportItem5s.add(new SectionTextItem5("==============================================================", null, null, null, null));
settlementReportItem5s.add(new SectionTextItem5(cumulativeTurnoverMonthText, null, null, null, null));
......@@ -553,7 +552,7 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
/**報表完結*/
String memberName = GsaCloudApplication.getMemberName();
String currentDate = TimeUtils.getCurrentDate(TimeUtils.dateFormatYMDHMS);
String currentDate = TimeUtils.getCurrentDate(TimeUtils.DEFAULT_DATE_FORMAT);
settlementReportItem5s.add(new SectionTextItem5(null, null, null, null, null));
settlementReportItem5s.add(new SectionTextItem5("==============================================================", null, null, null, null));
settlementReportItem5s.add(new SectionTextItem5("報表完結", null, null, null, null));
......@@ -633,7 +632,7 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
for (int i = 0; i < dateNum.size(); i++) {
SendSettlement.DataBean.DateNumBean dateNumBean = dateNum.get(i);
Map<String, Object> map = new HashMap<>();
map.put("date", TimeUtil.formatDate(dateNumBean.getDate(),TimeUtil.dateFormatYMD ,TimeUtil.dateFormatM_D));
map.put("date", TimeUtils.formatDate(dateNumBean.getDate(),TimeUtils.DATE_FORMAT_DATE ,TimeUtils.DEFAULT_DATE_MD));
map.put("num", dateNumBean.getNum());
lists.add(map);
}
......
package com.gingersoft.gsa.cloud.main.mvp.ui.adapter;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.Switch;
import android.widget.TextView;
import com.bigkoo.pickerview.TimePickerView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.base.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils;
import com.gingersoft.gsa.cloud.database.bean.ExpandInfo;
import com.gingersoft.gsa.cloud.main.R;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.Calendar;
import java.util.List;
public class ExpandListAdapter extends BaseQuickAdapter<ExpandInfo, BaseViewHolder> {
public ExpandListAdapter(@Nullable List<ExpandInfo> data) {
super(R.layout.main_expand_item, data);
for (int i = 0; i < data.size(); i++) {
data.get(i).setDataType(i);
}
}
@Override
protected void convert(@NotNull BaseViewHolder baseViewHolder, ExpandInfo function) {
baseViewHolder.setText(R.id.tv_expand_name, function.getRemark());
EditText editText = baseViewHolder.getView(R.id.ed_expand_edit);
Switch btn = baseViewHolder.getView(R.id.switch_expand_boolean);
TextView tvTime = baseViewHolder.getView(R.id.tv_expand_time);
if (function.getDataType() == 1) {
//整形
btn.setVisibility(View.GONE);
tvTime.setVisibility(View.GONE);
editText.setVisibility(View.VISIBLE);
editText.setInputType(EditorInfo.TYPE_CLASS_NUMBER | EditorInfo.TYPE_NUMBER_VARIATION_NORMAL);
editText.setText(function.getValueInt() + "");
} else if (function.getDataType() == 2) {
//字符
btn.setVisibility(View.GONE);
tvTime.setVisibility(View.GONE);
editText.setVisibility(View.VISIBLE);
editText.setInputType(EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_NORMAL);
editText.setText(function.getValueChar());
} else if (function.getDataType() == 3) {
//布爾
editText.setVisibility(View.GONE);
tvTime.setVisibility(View.GONE);
btn.setVisibility(View.VISIBLE);
btn.setChecked(function.getValueInt() == 0);
btn.setOnCheckedChangeListener((buttonView, isChecked) -> {
function.setValueInt(isChecked ? 0 : 1);
function.setUpdate(true);
});
} else if (function.getDataType() == 4) {
//日期
editText.setVisibility(View.GONE);
btn.setVisibility(View.GONE);
tvTime.setVisibility(View.VISIBLE);
Calendar calendar = Calendar.getInstance();
try {
calendar.setTime(DateFormat.getDateTimeInstance().parse(function.getValueDatetime()));
} catch (ParseException e) {
e.printStackTrace();
}
tvTime.setText(TimeUtils.getStringByFormat(calendar.getTime(), TimeUtils.DATE_FORMAT_DATE));
//Sep 11, 2020 6:10:42 PM
tvTime.setOnClickListener(v -> {
//时间选择器
new TimePickerView.Builder(getContext(), (date, view) -> {
tvTime.setText(TimeUtils.parseDateToString(date, TimeUtils.DATE_FORMAT_DATE));
function.setUpdate(true);
})
.setDate(calendar)
.setType(TimePickerView.Type.YEAR_MONTH_DAY)
.setContentSize(24)
.setLabel("", "", "", "", "", "")
.build()
.show();
});
} else {
btn.setVisibility(View.GONE);
tvTime.setVisibility(View.GONE);
editText.setVisibility(View.GONE);
}
editText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
Log.e("eee", "beforeTextChanged——" + s);
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
Log.e("eee", "onTextChanged——" + s);
}
@Override
public void afterTextChanged(Editable s) {
Log.e("eee", "afterTextChanged—" + function.getDataType() + "—" + s);
if (function.getDataType() == 1) {
if (TextUtil.isNotEmptyOrNullOrUndefined(s.toString())) {
function.setValueInt(Integer.parseInt(s.toString()));
function.setUpdate(true);
}
} else if (function.getDataType() == 2) {
if (TextUtil.isNotEmptyOrNullOrUndefined(s.toString())) {
function.setValueChar(s.toString());
function.setUpdate(true);
}
}
}
});
}
}
......@@ -17,7 +17,6 @@ import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.utils.MoneyUtil;
import com.gingersoft.gsa.cloud.base.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils;
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.main.R;
import com.gingersoft.gsa.cloud.main.R2;
import com.gingersoft.gsa.cloud.main.di.component.DaggerMainTopComponent;
......@@ -121,7 +120,7 @@ public class MainTopFragment extends BaseFragment<MainTopPresenter> implements M
@Override
public void initData(@Nullable Bundle savedInstanceState) {
// getInfo();
time.setText(TimeUtils.getCurrentTimeInString(TimeUtils.dateFormatYMDE));
time.setText(TimeUtils.getCurrentTimeInString(TimeUtils.DATE_FORMAT_YMDE));
}
private void getInfo() {
......
......@@ -17,9 +17,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.utils.time.TimePickerUtils;
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtil;
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils;
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.main.R;
import com.gingersoft.gsa.cloud.main.R2;
import com.gingersoft.gsa.cloud.main.di.component.DaggerPaymentMethodReportComponent;
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/white"
android:orientation="vertical">
<com.qmuiteam.qmui.widget.QMUITopBar
android:id="@+id/topbar_expand_list"
android:layout_width="match_parent"
app:qmui_topbar_title_color="@color/theme_white_color"
android:layout_height="@dimen/head_height" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_expand_list"
android:layout_below="@id/topbar_expand_list"
android:layout_width="match_parent"
android:layout_above="@id/btn_expand_save"
android:layout_height="match_parent" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_expand_save"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="@dimen/dp_20"
android:layout_alignParentBottom="true"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_10"
android:background="@drawable/shape_app_btn"
android:gravity="center"
android:text="保存"
android:textColor="@color/white"
android:textSize="@dimen/dp_16" />
</LinearLayout>
\ No newline at end of file
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10">
<TextView
android:id="@+id/tv_expand_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
tools:text="配置名稱" />
<FrameLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:focusable="true"
android:focusableInTouchMode="true"
android:paddingRight="@dimen/dp_10">
<EditText
android:id="@+id/ed_expand_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:visibility="gone" />
<TextView
android:id="@+id/tv_expand_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:visibility="visible"
tools:text="當前時間" />
<Switch
android:id="@+id/switch_expand_boolean"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:thumb="@drawable/shape_thumb_on"
android:track="@drawable/selector_switch_track"
android:visibility="gone" />
</FrameLayout>
</LinearLayout>
<include
layout="@layout/include_horizontal_color_e8_dividing_line"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0_5"
android:layout_gravity="bottom" />
</FrameLayout>
\ No newline at end of file
......@@ -121,7 +121,8 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
| WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH);
return 0; //R.layout.print_bitmap如果你不需要框架帮你设置 setContentView(id) 需要 自行设置,请返回 0
}
// ImageView bitmapIv;
// ImageView bitmapIv;
@Override
public void initData(@Nullable Bundle savedInstanceState) {
// bitmapIv = findViewById(R.id.iv_bitmap);
......@@ -225,6 +226,11 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
if (isShowDialog) {
initDialog();
}
// if (defaultPrint.getPrinterDeviceType() == 2 && PrintConstans.PRINT_MODEL_WISEPOS.contains(Build.MODEL)) {
// //本機打印並且是BBPOS
//
// }
//獲得對應的圖片
Map<String, List<Bitmap>> listMap = printerInIt.getPrintBitmapByCount(mContext, defaultPrint);
if (listMap != null) {
......
package com.joe.print.mvp.ui.adapter;
import android.graphics.Typeface;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
......@@ -23,9 +24,26 @@ public class KitChenPrjPrintFoodAdapter extends BaseQuickAdapter<PrjBean.DataBea
private int indentation = 0;
private PrinterDeviceBean printerDeviceBean;
private int foodFontSize = 24;
private int modifierFontSize = 24;
private int foodIsBold;
private int modifierIsBold;
private int foodIsItalic;
private int modifierIsItalic;
public KitChenPrjPrintFoodAdapter(@Nullable List<PrjBean.DataBean.Bean> data, PrinterDeviceBean printerDeviceBean) {
super(R.layout.print_kitchen_item_parent, data);
this.printerDeviceBean = printerDeviceBean;
try {
this.foodFontSize = Integer.parseInt(printerDeviceBean.getFoodFont()) * 2;
this.modifierFontSize = Integer.parseInt(printerDeviceBean.getModifierFont()) * 2;
} catch (NumberFormatException e) {
e.printStackTrace();
}
this.foodIsBold = printerDeviceBean.getFoodIsBold();
this.modifierIsBold = printerDeviceBean.getModifierIsBold();
this.foodIsItalic = printerDeviceBean.getFoodIsItalic();
this.modifierIsItalic = printerDeviceBean.getModifierIsItalic();
}
@Override
......@@ -60,19 +78,50 @@ public class KitChenPrjPrintFoodAdapter extends BaseQuickAdapter<PrjBean.DataBea
indentation = new BigDecimal(tvFoodName.getPaint().measureText("哈")).setScale(0, BigDecimal.ROUND_HALF_UP).intValue();
}
boolean isBold, isItalic;
int paddingLeft;
if (itemType == 2) {
//細項,縮進
paddingLeft = indentation;
tvFoodName.setTextSize(modifierFontSize);
tvFoodNum.setTextSize(modifierFontSize);
isBold = modifierIsBold == 1;
isItalic = modifierIsItalic == 1;
} else if (itemType == 3) {
//細項,縮進
paddingLeft = indentation * 2;
tvFoodName.setTextSize(modifierFontSize);
tvFoodNum.setTextSize(modifierFontSize);
isBold = modifierIsBold == 1;
isItalic = modifierIsItalic == 1;
} else {
paddingLeft = 0;
tvFoodName.setTextSize(foodFontSize);
tvFoodNum.setTextSize(foodFontSize);
isBold = foodIsBold == 1;
isItalic = foodIsItalic == 1;
}
tvFoodName.setPadding(paddingLeft, tvFoodName.getPaddingTop(), tvFoodName.getPaddingRight(), tvFoodName.getPaddingBottom());
tvFoodNum.setText(String.valueOf(foodNumber));
tvFoodName.setText(foodName);
if (isBold && isItalic) {
tvFoodName.setTypeface(null, Typeface.BOLD_ITALIC);
tvFoodNum.setTypeface(null, Typeface.BOLD_ITALIC);
} else if (isBold) {
tvFoodName.setTypeface(null, Typeface.BOLD);
tvFoodNum.setTypeface(null, Typeface.BOLD);
} else if (isItalic) {
tvFoodName.setTypeface(null, Typeface.ITALIC);
tvFoodNum.setTypeface(null, Typeface.ITALIC);
} else {
tvFoodName.setTypeface(null, Typeface.NORMAL);
tvFoodNum.setTypeface(null, Typeface.NORMAL);
}
return view;
}
}
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