Commit 1190a2a6 by Wyh

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

Signed-off-by: Wyh <1239658231>
parent 1019d223
...@@ -45,7 +45,7 @@ android { ...@@ -45,7 +45,7 @@ android {
/** /**
* 版本号 * 版本号
*/ */
schemaVersion 15 schemaVersion 16
/** /**
* greendao输出dao的数据库操作实体类文件夹(相对路径 包名+自定义路径名称,包将创建于包名的直接路径下) * greendao输出dao的数据库操作实体类文件夹(相对路径 包名+自定义路径名称,包将创建于包名的直接路径下)
*/ */
......
...@@ -4,7 +4,7 @@ import android.util.Log; ...@@ -4,7 +4,7 @@ import android.util.Log;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication; import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.utils.encryption.Aes; 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.AppConstans;
import com.gingersoft.gsa.cloud.constans.HttpsConstans; import com.gingersoft.gsa.cloud.constans.HttpsConstans;
import com.gingersoft.gsa.cloud.globalconfig.applyOptions.intercept.LoggingInterceptor; import com.gingersoft.gsa.cloud.globalconfig.applyOptions.intercept.LoggingInterceptor;
...@@ -260,7 +260,7 @@ public class OkHttp3Utils { ...@@ -260,7 +260,7 @@ public class OkHttp3Utils {
public static void noticePersonnel(String errCode, String pushContent) { public static void noticePersonnel(String errCode, String pushContent) {
String restaurantInfo = String restaurantInfo =
"版本號:" + DeviceUtils.getVersionName(GsaCloudApplication.getAppContext()) + "|" + DeviceUtils.getVersionCode(GsaCloudApplication.getAppContext()) + "版本號:" + DeviceUtils.getVersionName(GsaCloudApplication.getAppContext()) + "|" + DeviceUtils.getVersionCode(GsaCloudApplication.getAppContext()) +
"時間:" + TimeUtil.getCurrentDate(TimeUtil.dateFormatYMDHMS) + "時間:" + TimeUtils.getCurrentDate(TimeUtils.DEFAULT_DATE_FORMAT) +
"報錯CODE:" + errCode + "報錯CODE:" + errCode +
"品牌名:" + GsaCloudApplication.getBrandName() + "品牌名:" + GsaCloudApplication.getBrandName() +
"餐廳名:" + GsaCloudApplication.getRestaurantName() + "餐廳名:" + GsaCloudApplication.getRestaurantName() +
......
package com.gingersoft.gsa.cloud.database.bean; package com.gingersoft.gsa.cloud.database.bean;
import org.greenrobot.greendao.annotation.Entity; import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id; import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property; import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.Generated; import org.greenrobot.greendao.annotation.Transient;
import java.util.Date;
/** /**
* 作者:ELEGANT_BIN * 作者:ELEGANT_BIN
...@@ -37,10 +36,15 @@ public class ExpandInfo { ...@@ -37,10 +36,15 @@ public class ExpandInfo {
*/ */
private String remark; 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) @Generated(hash = 136088095)
public ExpandInfo(Long id, int restaurantId, String settingName, Integer valueInt, public ExpandInfo(Long id, int restaurantId, String settingName, Integer valueInt, String valueChar,
String valueChar, String valueDatetime, String remark) { String valueDatetime, String remark, int dataType, String sort, int valueBoolean) {
this.id = id; this.id = id;
this.restaurantId = restaurantId; this.restaurantId = restaurantId;
this.settingName = settingName; this.settingName = settingName;
...@@ -48,6 +52,9 @@ public class ExpandInfo { ...@@ -48,6 +52,9 @@ public class ExpandInfo {
this.valueChar = valueChar; this.valueChar = valueChar;
this.valueDatetime = valueDatetime; this.valueDatetime = valueDatetime;
this.remark = remark; this.remark = remark;
this.dataType = dataType;
this.sort = sort;
this.valueBoolean = valueBoolean;
} }
@Generated(hash = 9429432) @Generated(hash = 9429432)
...@@ -110,4 +117,44 @@ public class ExpandInfo { ...@@ -110,4 +117,44 @@ public class ExpandInfo {
public void setValueDatetime(String valueDatetime) { public void setValueDatetime(String valueDatetime) {
this.valueDatetime = 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; ...@@ -14,10 +14,10 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/** /**
* Master of DAO (schema version 15): knows all DAOs. * Master of DAO (schema version 16): knows all DAOs.
*/ */
public class DaoMaster extends AbstractDaoMaster { 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. */ /** Creates underlying database table using DAOs. */
public static void createAllTables(Database db, boolean ifNotExists) { public static void createAllTables(Database db, boolean ifNotExists) {
......
...@@ -3,13 +3,13 @@ package com.gingersoft.gsa.cloud.database.greendao; ...@@ -3,13 +3,13 @@ package com.gingersoft.gsa.cloud.database.greendao;
import android.database.Cursor; import android.database.Cursor;
import android.database.sqlite.SQLiteStatement; import android.database.sqlite.SQLiteStatement;
import com.gingersoft.gsa.cloud.database.bean.ExpandInfo;
import org.greenrobot.greendao.AbstractDao; import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property; import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.internal.DaoConfig;
import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement; import org.greenrobot.greendao.database.DatabaseStatement;
import org.greenrobot.greendao.internal.DaoConfig;
import com.gingersoft.gsa.cloud.database.bean.ExpandInfo;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/** /**
...@@ -31,6 +31,9 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> { ...@@ -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 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 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 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> { ...@@ -52,7 +55,10 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
"\"VALUE_INT\" INTEGER," + // 3: valueInt "\"VALUE_INT\" INTEGER," + // 3: valueInt
"\"VALUE_CHAR\" TEXT," + // 4: valueChar "\"VALUE_CHAR\" TEXT," + // 4: valueChar
"\"VALUE_DATETIME\" TEXT," + // 5: valueDatetime "\"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. */ /** Drops the underlying database table. */
...@@ -95,6 +101,13 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> { ...@@ -95,6 +101,13 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
if (remark != null) { if (remark != null) {
stmt.bindString(7, remark); 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 @Override
...@@ -131,6 +144,13 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> { ...@@ -131,6 +144,13 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
if (remark != null) { if (remark != null) {
stmt.bindString(7, remark); 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 @Override
...@@ -147,7 +167,10 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> { ...@@ -147,7 +167,10 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
cursor.isNull(offset + 3) ? null : cursor.getInt(offset + 3), // valueInt cursor.isNull(offset + 3) ? null : cursor.getInt(offset + 3), // valueInt
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // valueChar cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // valueChar
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // valueDatetime 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; return entity;
} }
...@@ -161,6 +184,9 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> { ...@@ -161,6 +184,9 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
entity.setValueChar(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setValueChar(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setValueDatetime(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); entity.setValueDatetime(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setRemark(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); 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 @Override
......
...@@ -133,6 +133,4 @@ public class ExpandInfoDaoUtils { ...@@ -133,6 +133,4 @@ public class ExpandInfoDaoUtils {
return mManager.getDaoSession().queryRaw(ExpandInfo.class, sql, conditions); return mManager.getDaoSession().queryRaw(ExpandInfo.class, sql, conditions);
} }
} }
...@@ -15,16 +15,14 @@ import android.os.Build ...@@ -15,16 +15,14 @@ import android.os.Build
import android.os.IBinder import android.os.IBinder
import android.os.PowerManager import android.os.PowerManager
import android.util.Log import android.util.Log
import android.view.WindowManager
import android.widget.RemoteViews import android.widget.RemoteViews
import androidx.annotation.RequiresApi import androidx.annotation.RequiresApi
import androidx.core.app.NotificationCompat import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import com.gingersoft.gsa.cloud.base.R import com.gingersoft.gsa.cloud.base.R
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
import com.gingersoft.gsa.cloud.base.utils.SoundPoolUtils import com.gingersoft.gsa.cloud.base.utils.SoundPoolUtils
import com.gingersoft.gsa.cloud.base.utils.okhttpUtils.OkHttp3Utils 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.AppConstans
import com.gingersoft.gsa.cloud.constans.HttpsConstans import com.gingersoft.gsa.cloud.constans.HttpsConstans
import com.google.gson.Gson import com.google.gson.Gson
...@@ -356,7 +354,7 @@ class GetInfoUpdateService : Service() { ...@@ -356,7 +354,7 @@ class GetInfoUpdateService : Service() {
* 向日誌添加數據 * 向日誌添加數據
*/ */
private fun putTimeLog(content: String) { private fun putTimeLog(content: String) {
loginfo.append(TimeUtil.getCurrentDate(TimeUtil.dateFormatYMDHMS)) loginfo.append(TimeUtils.getCurrentDate(TimeUtils.DEFAULT_DATE_FORMAT))
loginfo.append(":") loginfo.append(":")
loginfo.append(content) loginfo.append(content)
loginfo.append("\n") loginfo.append("\n")
......
...@@ -157,9 +157,7 @@ public class ColdChainMainActivity extends BaseFragmentActivity<ColdChainMainPre ...@@ -157,9 +157,7 @@ public class ColdChainMainActivity extends BaseFragmentActivity<ColdChainMainPre
autoReceivingOrders.setChecked(RestaurantExpandInfoUtils.getValue(ExpandConstant.FrozenChainAutoOrder, false)); autoReceivingOrders.setChecked(RestaurantExpandInfoUtils.getValue(ExpandConstant.FrozenChainAutoOrder, false));
autoReceivingOrders.setOnCheckedChangeListener((buttonView, isChecked) -> { autoReceivingOrders.setOnCheckedChangeListener((buttonView, isChecked) -> {
RestaurantExpandInfoUtils.setValue(ExpandConstant.FrozenChainAutoOrder, isChecked); RestaurantExpandInfoUtils.setValue(ExpandConstant.FrozenChainAutoOrder, isChecked);
if (autoOrderDisposable != null && !autoOrderDisposable.isDisposed()) { if (autoOrderDisposable != null && !autoOrderDisposable.isDisposed()) {
autoOrderDisposable.dispose(); autoOrderDisposable.dispose();
} }
...@@ -192,7 +190,6 @@ public class ColdChainMainActivity extends BaseFragmentActivity<ColdChainMainPre ...@@ -192,7 +190,6 @@ public class ColdChainMainActivity extends BaseFragmentActivity<ColdChainMainPre
}); });
} }
public void getNumByOrderTypeInvoke(String functionName) { public void getNumByOrderTypeInvoke(String functionName) {
Class[] parameterTypes = {SupplementInfoBean.class}; Class[] parameterTypes = {SupplementInfoBean.class};
try { try {
...@@ -274,13 +271,13 @@ public class ColdChainMainActivity extends BaseFragmentActivity<ColdChainMainPre ...@@ -274,13 +271,13 @@ public class ColdChainMainActivity extends BaseFragmentActivity<ColdChainMainPre
|| type == 6 || type == 7) {//ColdChainConstants.orderType || type == 6 || type == 7) {//ColdChainConstants.orderType
fragments.get(viewPager.getCurrentItem()).onRefreshData(); fragments.get(viewPager.getCurrentItem()).onRefreshData();
mPresenter.getBalance(); mPresenter.getBalance();
if(autoReceivingOrders.isChecked()){
mPresenter.startToBeConfirmedOrderList(restaurantId);
}
} }
if (type == 3 || type == 6 || type == 7) { if (type == 3 || type == 6 || type == 7) {
getNumByOrderTypeInvoke("loadNumber"); getNumByOrderTypeInvoke("loadNumber");
} }
if (autoReceivingOrders.isChecked()) {
mPresenter.startToBeConfirmedOrderList(restaurantId);
}
}); });
bind.execute(aBoolean -> null); bind.execute(aBoolean -> null);
bind.setJumpActivity(ColdChainMainActivity.class); bind.setJumpActivity(ColdChainMainActivity.class);
......
...@@ -50,7 +50,7 @@ ext { ...@@ -50,7 +50,7 @@ ext {
"autosize" : 'me.jessyan:autosize:1.1.2', "autosize" : 'me.jessyan:autosize:1.1.2',
"butterknife" : "com.jakewharton:butterknife:${version["butterknifeSdkVersion"]}", "butterknife" : "com.jakewharton:butterknife:${version["butterknifeSdkVersion"]}",
"butterknife-compiler" : "com.jakewharton:butterknife-compiler:${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", "photoview" : "com.github.chrisbanes.photoview:library:1.2.3",
"numberprogressbar" : "com.daimajia.numberprogressbar:library:1.2@aar", "numberprogressbar" : "com.daimajia.numberprogressbar:library:1.2@aar",
"nineoldandroids" : "com.nineoldandroids:library:2.4.0", "nineoldandroids" : "com.nineoldandroids:library:2.4.0",
......
...@@ -340,7 +340,7 @@ ...@@ -340,7 +340,7 @@
// * 向日誌添加數據 // * 向日誌添加數據
// */ // */
// private fun putTimeLog(content: String) { // private fun putTimeLog(content: String) {
// loginfo.append(TimeUtil.getCurrentDate(TimeUtil.dateFormatYMDHMS)) // loginfo.append(TimeUtils.getCurrentDate(TimeUtil.dateFormatYMDHMS))
// loginfo.append(":") // loginfo.append(":")
// loginfo.append(content) // loginfo.append(content)
// loginfo.append("\n") // loginfo.append("\n")
......
...@@ -2,7 +2,7 @@ package com.gingersoft.gsa.delivery_pick_mode.ui.adapter ...@@ -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.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder 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.R
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.ServiceChargeRecordBean import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.ServiceChargeRecordBean
...@@ -15,7 +15,7 @@ class ThirdExpensesAdapter(data: MutableList<ServiceChargeRecordBean.DataX>?) : ...@@ -15,7 +15,7 @@ class ThirdExpensesAdapter(data: MutableList<ServiceChargeRecordBean.DataX>?) :
holder.setText(R.id.tv_third_expenses_amount, "金額") holder.setText(R.id.tv_third_expenses_amount, "金額")
} else { } else {
holder.setText(R.id.tv_third_expenses_user, "" + item.updateName) 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) holder.setText(R.id.tv_third_expenses_amount, "+$" + item.paymentValue)
} }
} }
......
...@@ -2,7 +2,7 @@ package com.gingersoft.gsa.cloud.login.mvp.ui.adapter; ...@@ -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.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder; 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.R;
import com.gingersoft.gsa.cloud.login.mvp.bean.LoginLimitBean; import com.gingersoft.gsa.cloud.login.mvp.bean.LoginLimitBean;
...@@ -21,6 +21,6 @@ public class LoginLimitAdapter extends BaseQuickAdapter<LoginLimitBean, BaseView ...@@ -21,6 +21,6 @@ public class LoginLimitAdapter extends BaseQuickAdapter<LoginLimitBean, BaseView
@Override @Override
protected void convert(@NotNull BaseViewHolder baseViewHolder,LoginLimitBean loginLimitBean) { 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_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 @@ ...@@ -7,6 +7,7 @@
<activity <activity
android:name=".mvp.ui.activity.NewMainActivity" android:name=".mvp.ui.activity.NewMainActivity"
android:launchMode="singleTask" /> android:launchMode="singleTask" />
<activity android:name=".mvp.ui.activity.ExpandListActivity"/>
<activity android:name=".mvp.ui.activity.MainActivity" /> <activity android:name=".mvp.ui.activity.MainActivity" />
<activity android:name=".mvp.ui.activity.ReportActivity" /> <activity android:name=".mvp.ui.activity.ReportActivity" />
<activity android:name=".mvp.ui.activity.SettlementActivity" /> <activity android:name=".mvp.ui.activity.SettlementActivity" />
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
android:networkSecurityConfig="@xml/network_android" android:networkSecurityConfig="@xml/network_android"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme"> 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.RestaurantQrCodeActivity" />
<activity android:name=".mvp.ui.activity.LanguageActivity" /> <activity android:name=".mvp.ui.activity.LanguageActivity" />
<activity android:name=".mvp.ui.activity.ReportActivity" /> <activity android:name=".mvp.ui.activity.ReportActivity" />
......
package com.gingersoft.gsa.cloud.main.mvp.contract; package com.gingersoft.gsa.cloud.main.mvp.contract;
import com.gingersoft.gsa.cloud.database.bean.Function; import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.FunctionBean; import com.gingersoft.gsa.cloud.database.bean.ExpandInfo;
import com.jess.arms.mvp.IView;
import com.jess.arms.mvp.IModel; import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
import java.util.List; import java.util.List;
...@@ -13,11 +13,11 @@ import io.reactivex.Observable; ...@@ -13,11 +13,11 @@ import io.reactivex.Observable;
public interface ExpandListContract { public interface ExpandListContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息 //对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView { interface View extends IView {
void loadExpandList(List<Function> data); void loadExpandList(List<ExpandInfo> data);
} }
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存 //Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel { 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; ...@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.main.mvp.model;
import android.app.Application; 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.contract.ExpandListContract;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.FunctionBean; import com.gingersoft.gsa.cloud.main.mvp.model.bean.FunctionBean;
import com.gingersoft.gsa.cloud.main.mvp.model.service.ExpandListService; import com.gingersoft.gsa.cloud.main.mvp.model.service.ExpandListService;
...@@ -36,7 +37,7 @@ public class ExpandListModel extends BaseModel implements ExpandListContract.Mod ...@@ -36,7 +37,7 @@ public class ExpandListModel extends BaseModel implements ExpandListContract.Mod
@Override @Override
public Observable<FunctionBean> getExpandList(long userId) { public Observable<BaseResult> getExpandList(int restaurantId) {
return mRepositoryManager.obtainRetrofitService(ExpandListService.class).getExpandList(userId); return mRepositoryManager.obtainRetrofitService(ExpandListService.class).getExpandList(restaurantId);
} }
} }
\ No newline at end of file
package com.gingersoft.gsa.cloud.main.mvp.model.service; 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 io.reactivex.Observable;
import me.jessyan.retrofiturlmanager.RetrofitUrlManager; import me.jessyan.retrofiturlmanager.RetrofitUrlManager;
...@@ -9,6 +9,6 @@ import retrofit2.http.Query; ...@@ -9,6 +9,6 @@ import retrofit2.http.Query;
public interface ExpandListService { public interface ExpandListService {
@GET("user/resource/list" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2) @GET("restaurant/ext/list" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<FunctionBean> getExpandList(@Query("userId") long userId); Observable<BaseResult> getExpandList(@Query("restaurantId") int restaurantId);
} }
...@@ -3,14 +3,18 @@ package com.gingersoft.gsa.cloud.main.mvp.presenter; ...@@ -3,14 +3,18 @@ package com.gingersoft.gsa.cloud.main.mvp.presenter;
import android.app.Application; import android.app.Application;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication; import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.base.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.contract.ExpandListContract;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.FunctionBean;
import com.jess.arms.di.scope.ActivityScope; import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.http.imageloader.ImageLoader; 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.RxLifecycleUtils; import com.jess.arms.utils.RxLifecycleUtils;
import java.util.List;
import javax.inject.Inject; import javax.inject.Inject;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
...@@ -45,17 +49,24 @@ public class ExpandListPresenter extends BasePresenter<ExpandListContract.Model, ...@@ -45,17 +49,24 @@ public class ExpandListPresenter extends BasePresenter<ExpandListContract.Model,
} }
public void getExpandInfoList() { public void getExpandInfoList() {
mModel.getExpandList(GsaCloudApplication.getMemberId()) mModel.getExpandList(GsaCloudApplication.getRestaurantId())
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading("")) .doOnSubscribe(disposable -> mRootView.showLoading(""))
.subscribeOn(AndroidSchedulers.mainThread()) .subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading()) .doAfterTerminate(() -> mRootView.hideLoading())
.compose(RxLifecycleUtils.bindToLifecycle(mRootView)) .compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<FunctionBean>(mErrorHandler) { .subscribe(new ErrorHandleSubscriber<BaseResult>(mErrorHandler) {
@Override @Override
public void onNext(FunctionBean functionBean) { public void onNext(BaseResult result) {
mRootView.loadExpandList(functionBean.getData()); 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; ...@@ -2,32 +2,45 @@ package com.gingersoft.gsa.cloud.main.mvp.ui.activity;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; 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.R;
import com.gingersoft.gsa.cloud.main.R2; import com.gingersoft.gsa.cloud.main.R2;
import com.gingersoft.gsa.cloud.main.di.component.DaggerExpandListComponent; import com.gingersoft.gsa.cloud.main.di.component.DaggerExpandListComponent;
import com.gingersoft.gsa.cloud.main.di.module.ExpandListModule; 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.contract.ExpandListContract;
import com.gingersoft.gsa.cloud.main.mvp.presenter.ExpandListPresenter; 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.base.BaseActivity;
import com.jess.arms.di.component.AppComponent; import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils; 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 java.util.List;
import butterknife.BindView; import butterknife.BindView;
import butterknife.OnClick;
import static com.jess.arms.utils.Preconditions.checkNotNull; 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) @BindView(R2.id.rv_expand_list)
RecyclerView rvExpandList; RecyclerView rvExpandList;
private ExpandListAdapter expandListAdapter;
@BindView(R2.id.topbar_expand_list)
QMUITopBar topBar;
@BindView(R2.id.btn_expand_save)
QMUIAlphaButton btnSave;
@Override @Override
public void setupActivityComponent(@NonNull AppComponent appComponent) { public void setupActivityComponent(@NonNull AppComponent appComponent) {
...@@ -56,7 +69,9 @@ public class ExpandListActivity extends BaseActivity<ExpandListPresenter> implem ...@@ -56,7 +69,9 @@ public class ExpandListActivity extends BaseActivity<ExpandListPresenter> implem
@Override @Override
public void initTopBar() { public void initTopBar() {
topBar.setBackgroundColor(ContextCompat.getColor(this, R.color.theme_color));
topBar.addLeftBackImageButton().setOnClickListener(v -> killMyself());
topBar.setTitle("配置列表");
} }
@Override @Override
...@@ -102,7 +117,31 @@ public class ExpandListActivity extends BaseActivity<ExpandListPresenter> implem ...@@ -102,7 +117,31 @@ public class ExpandListActivity extends BaseActivity<ExpandListPresenter> implem
} }
@Override @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 ...@@ -403,12 +403,12 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
.setActionName("showTableManageActivity") .setActionName("showTableManageActivity")
.build() .build()
.call(); .call();
} else if(name.equals("冷鏈接單")){ } else if (name.equals("冷鏈接單") || name.equals("凍鏈接單")) {
CC.obtainBuilder("Component.ColdChain") CC.obtainBuilder("Component.ColdChain")
.setActionName("Component.ColdChain") .setActionName("Component.ColdChain")
.build() .build()
.call(); .call();
} else if(name.equals("二維碼")){ } else if (name.equals("二維碼")) {
launchActivity(new Intent(mContext, RestaurantQrCodeActivity.class)); launchActivity(new Intent(mContext, RestaurantQrCodeActivity.class));
} else if (name.equals("配置列表")) { } else if (name.equals("配置列表")) {
launchActivity(new Intent(mContext, ExpandListActivity.class)); launchActivity(new Intent(mContext, ExpandListActivity.class));
......
...@@ -138,7 +138,7 @@ public class SettlementActivity extends BaseActivity<SettlementPresenter> implem ...@@ -138,7 +138,7 @@ public class SettlementActivity extends BaseActivity<SettlementPresenter> implem
this.mSettlementReportBean = datasBean; this.mSettlementReportBean = datasBean;
if(mSettlementReportBean.getRestaurantOperation() != null) { if(mSettlementReportBean.getRestaurantOperation() != null) {
String lastSettlementText = LanguageUtils.get_language_system(this, "", "上次清機時間:"); 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; ...@@ -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.MoneyUtil;
import com.gingersoft.gsa.cloud.base.utils.PrintTransitUtils; import com.gingersoft.gsa.cloud.base.utils.PrintTransitUtils;
import com.gingersoft.gsa.cloud.base.utils.other.SPUtils; 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.base.utils.time.TimeUtils;
import com.gingersoft.gsa.cloud.constans.PrintConstans; import com.gingersoft.gsa.cloud.constans.PrintConstans;
import com.gingersoft.gsa.cloud.main.R; import com.gingersoft.gsa.cloud.main.R;
...@@ -333,7 +332,7 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese ...@@ -333,7 +332,7 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
SettlementReport.DataBean.RestaurantOperationBean restaurantOperationBean = datasBean.getRestaurantOperation(); SettlementReport.DataBean.RestaurantOperationBean restaurantOperationBean = datasBean.getRestaurantOperation();
if (restaurantOperationBean != null) { if (restaurantOperationBean != null) {
tv_business_area_title.setText(dailyBusinessReportText); 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()); tv_start_time.setText(byBusinessDateText + datasBean.getStartTime());
...@@ -541,8 +540,8 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese ...@@ -541,8 +540,8 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
/**本月累計營業額*/ /**本月累計營業額*/
if (analysisBeanMap.containsKey(cumulativeTurnoverMonthText)) { if (analysisBeanMap.containsKey(cumulativeTurnoverMonthText)) {
SettlementReport.DataBean.AnalysisBean analysisBean = analysisBeanMap.get(cumulativeTurnoverMonthText); SettlementReport.DataBean.AnalysisBean analysisBean = analysisBeanMap.get(cumulativeTurnoverMonthText);
String firstDayOfMonth = TimeUtil.getFirstDayOfMonth(TimeUtil.dateFormatYMD) + " 00:00:00"; String firstDayOfMonth = TimeUtils.getFirstDayOfMonth(TimeUtils.DATE_FORMAT_DATE) + " 00:00:00";
String currentDate = TimeUtil.getCurrentDate(TimeUtil.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, null));
settlementReportItem5s.add(new SectionTextItem5("==============================================================", null, null, null, null)); settlementReportItem5s.add(new SectionTextItem5("==============================================================", null, null, null, null));
settlementReportItem5s.add(new SectionTextItem5(cumulativeTurnoverMonthText, null, null, null, null)); settlementReportItem5s.add(new SectionTextItem5(cumulativeTurnoverMonthText, null, null, null, null));
...@@ -553,7 +552,7 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese ...@@ -553,7 +552,7 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
/**報表完結*/ /**報表完結*/
String memberName = GsaCloudApplication.getMemberName(); 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, null));
settlementReportItem5s.add(new SectionTextItem5("==============================================================", null, null, null, null)); settlementReportItem5s.add(new SectionTextItem5("==============================================================", 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 ...@@ -633,7 +632,7 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
for (int i = 0; i < dateNum.size(); i++) { for (int i = 0; i < dateNum.size(); i++) {
SendSettlement.DataBean.DateNumBean dateNumBean = dateNum.get(i); SendSettlement.DataBean.DateNumBean dateNumBean = dateNum.get(i);
Map<String, Object> map = new HashMap<>(); 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()); map.put("num", dateNumBean.getNum());
lists.add(map); 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; ...@@ -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.MoneyUtil;
import com.gingersoft.gsa.cloud.base.utils.other.TextUtil; 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.time.TimeUtils;
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.main.R; import com.gingersoft.gsa.cloud.main.R;
import com.gingersoft.gsa.cloud.main.R2; import com.gingersoft.gsa.cloud.main.R2;
import com.gingersoft.gsa.cloud.main.di.component.DaggerMainTopComponent; import com.gingersoft.gsa.cloud.main.di.component.DaggerMainTopComponent;
...@@ -121,7 +120,7 @@ public class MainTopFragment extends BaseFragment<MainTopPresenter> implements M ...@@ -121,7 +120,7 @@ public class MainTopFragment extends BaseFragment<MainTopPresenter> implements M
@Override @Override
public void initData(@Nullable Bundle savedInstanceState) { public void initData(@Nullable Bundle savedInstanceState) {
// getInfo(); // getInfo();
time.setText(TimeUtils.getCurrentTimeInString(TimeUtils.dateFormatYMDE)); time.setText(TimeUtils.getCurrentTimeInString(TimeUtils.DATE_FORMAT_YMDE));
} }
private void getInfo() { private void getInfo() {
......
...@@ -17,9 +17,7 @@ import androidx.recyclerview.widget.RecyclerView; ...@@ -17,9 +17,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication; 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.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.time.TimeUtils;
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.main.R; import com.gingersoft.gsa.cloud.main.R;
import com.gingersoft.gsa.cloud.main.R2; import com.gingersoft.gsa.cloud.main.R2;
import com.gingersoft.gsa.cloud.main.di.component.DaggerPaymentMethodReportComponent; import com.gingersoft.gsa.cloud.main.di.component.DaggerPaymentMethodReportComponent;
......
<?xml version="1.0" encoding="utf-8"?> <?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_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/white" android:background="@color/white"
android:orientation="vertical"> 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 <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_expand_list" android:id="@+id/rv_expand_list"
android:layout_below="@id/topbar_expand_list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_above="@id/btn_expand_save"
android:layout_height="match_parent" /> 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> </RelativeLayout>
\ No newline at end of file \ 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 ...@@ -121,7 +121,8 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
| WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH); | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH);
return 0; //R.layout.print_bitmap如果你不需要框架帮你设置 setContentView(id) 需要 自行设置,请返回 0 return 0; //R.layout.print_bitmap如果你不需要框架帮你设置 setContentView(id) 需要 自行设置,请返回 0
} }
// ImageView bitmapIv;
// ImageView bitmapIv;
@Override @Override
public void initData(@Nullable Bundle savedInstanceState) { public void initData(@Nullable Bundle savedInstanceState) {
// bitmapIv = findViewById(R.id.iv_bitmap); // bitmapIv = findViewById(R.id.iv_bitmap);
...@@ -225,6 +226,11 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print ...@@ -225,6 +226,11 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
if (isShowDialog) { if (isShowDialog) {
initDialog(); initDialog();
} }
// if (defaultPrint.getPrinterDeviceType() == 2 && PrintConstans.PRINT_MODEL_WISEPOS.contains(Build.MODEL)) {
// //本機打印並且是BBPOS
//
// }
//獲得對應的圖片 //獲得對應的圖片
Map<String, List<Bitmap>> listMap = printerInIt.getPrintBitmapByCount(mContext, defaultPrint); Map<String, List<Bitmap>> listMap = printerInIt.getPrintBitmapByCount(mContext, defaultPrint);
if (listMap != null) { if (listMap != null) {
......
package com.joe.print.mvp.ui.adapter; package com.joe.print.mvp.ui.adapter;
import android.graphics.Typeface;
import android.view.View; import android.view.View;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
...@@ -23,9 +24,26 @@ public class KitChenPrjPrintFoodAdapter extends BaseQuickAdapter<PrjBean.DataBea ...@@ -23,9 +24,26 @@ public class KitChenPrjPrintFoodAdapter extends BaseQuickAdapter<PrjBean.DataBea
private int indentation = 0; private int indentation = 0;
private PrinterDeviceBean printerDeviceBean; 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) { public KitChenPrjPrintFoodAdapter(@Nullable List<PrjBean.DataBean.Bean> data, PrinterDeviceBean printerDeviceBean) {
super(R.layout.print_kitchen_item_parent, data); super(R.layout.print_kitchen_item_parent, data);
this.printerDeviceBean = printerDeviceBean; 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 @Override
...@@ -60,19 +78,50 @@ public class KitChenPrjPrintFoodAdapter extends BaseQuickAdapter<PrjBean.DataBea ...@@ -60,19 +78,50 @@ public class KitChenPrjPrintFoodAdapter extends BaseQuickAdapter<PrjBean.DataBea
indentation = new BigDecimal(tvFoodName.getPaint().measureText("哈")).setScale(0, BigDecimal.ROUND_HALF_UP).intValue(); indentation = new BigDecimal(tvFoodName.getPaint().measureText("哈")).setScale(0, BigDecimal.ROUND_HALF_UP).intValue();
} }
boolean isBold, isItalic;
int paddingLeft; int paddingLeft;
if (itemType == 2) { if (itemType == 2) {
//細項,縮進 //細項,縮進
paddingLeft = indentation; paddingLeft = indentation;
tvFoodName.setTextSize(modifierFontSize);
tvFoodNum.setTextSize(modifierFontSize);
isBold = modifierIsBold == 1;
isItalic = modifierIsItalic == 1;
} else if (itemType == 3) { } else if (itemType == 3) {
//細項,縮進 //細項,縮進
paddingLeft = indentation * 2; paddingLeft = indentation * 2;
tvFoodName.setTextSize(modifierFontSize);
tvFoodNum.setTextSize(modifierFontSize);
isBold = modifierIsBold == 1;
isItalic = modifierIsItalic == 1;
} else { } else {
paddingLeft = 0; paddingLeft = 0;
tvFoodName.setTextSize(foodFontSize);
tvFoodNum.setTextSize(foodFontSize);
isBold = foodIsBold == 1;
isItalic = foodIsItalic == 1;
} }
tvFoodName.setPadding(paddingLeft, tvFoodName.getPaddingTop(), tvFoodName.getPaddingRight(), tvFoodName.getPaddingBottom()); tvFoodName.setPadding(paddingLeft, tvFoodName.getPaddingTop(), tvFoodName.getPaddingRight(), tvFoodName.getPaddingBottom());
tvFoodNum.setText(String.valueOf(foodNumber)); tvFoodNum.setText(String.valueOf(foodNumber));
tvFoodName.setText(foodName); 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; 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