Browse Source

添加日志描述弹窗;修改订单统计

桌面小炒机
liup 6 months ago
parent
commit
cf7121e7ee
37 changed files with 1204 additions and 220 deletions
  1. +5
    -0
      app/src/main/AndroidManifest.xml
  2. +5
    -0
      app/src/main/java/com/bonait/bnframework/CrashHandler.java
  3. +9
    -5
      app/src/main/java/com/bonait/bnframework/business/MainInit.java
  4. +12
    -71
      app/src/main/java/com/bonait/bnframework/business/RecordManager.java
  5. +12
    -0
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
  6. +10
    -0
      app/src/main/java/com/bonait/bnframework/common/db/QueryDB.java
  7. +27
    -0
      app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_ORDER_LIST.java
  8. +13
    -0
      app/src/main/java/com/bonait/bnframework/common/db/util/GoodsDBUtil.java
  9. +101
    -0
      app/src/main/java/com/bonait/bnframework/common/db/util/OrderListUtil.java
  10. +1
    -1
      app/src/main/java/com/bonait/bnframework/common/utils/AlertDialogUtils.java
  11. +12
    -18
      app/src/main/java/com/bonait/bnframework/ui/activity/CookingActivity.java
  12. +1
    -1
      app/src/main/java/com/bonait/bnframework/ui/activity/DeviceRecordActivity.java
  13. +1
    -1
      app/src/main/java/com/bonait/bnframework/ui/activity/DiyProcessActivity.java
  14. +20
    -1
      app/src/main/java/com/bonait/bnframework/ui/activity/LogRecordActivity.java
  15. +36
    -3
      app/src/main/java/com/bonait/bnframework/ui/activity/OrderRecordActivity.java
  16. +1
    -1
      app/src/main/java/com/bonait/bnframework/ui/activity/RecProcessActivity.java
  17. +10
    -11
      app/src/main/java/com/bonait/bnframework/ui/activity/SystemSetActivity.java
  18. +1
    -1
      app/src/main/java/com/bonait/bnframework/ui/adapter/record/DeviceRecordAdapter.java
  19. +16
    -1
      app/src/main/java/com/bonait/bnframework/ui/adapter/record/LocalLogAdapter.java
  20. +1
    -3
      app/src/main/java/com/bonait/bnframework/ui/adapter/record/OrderAdapter.java
  21. +1
    -1
      app/src/main/java/com/bonait/bnframework/ui/adapter/record/SubOrderAdapter.java
  22. +1
    -1
      app/src/main/java/com/bonait/bnframework/ui/adapter/step/DiyStepAdapter.java
  23. +1
    -1
      app/src/main/java/com/bonait/bnframework/ui/adapter/step/RecProcessAdapter.java
  24. +1
    -1
      app/src/main/java/com/bonait/bnframework/ui/adapter/step/StepAdapter.java
  25. +47
    -11
      app/src/main/java/com/bonait/bnframework/ui/dialog/SubOrderDialog.java
  26. +7
    -0
      app/src/main/java/com/bonait/bnframework/ui/fragment/HomeMainFragment.java
  27. +60
    -0
      app/src/main/java/com/bonait/bnframework/ui/fragment/setting/DeviceSetFragment.java
  28. +237
    -0
      app/src/main/java/com/bonait/bnframework/ui/fragment/setting/PicManagerFragment.java
  29. +71
    -0
      app/src/main/java/com/bonait/bnframework/ui/fragment/setting/SceneSetFragment.java
  30. +92
    -84
      app/src/main/res/layout/activity_system_set.xml
  31. +57
    -0
      app/src/main/res/layout/dialog/layout/dialog_log_desc.xml
  32. +0
    -1
      app/src/main/res/layout/fragment_home4.xml
  33. +16
    -1
      app/src/main/res/layout/fragment_home_main.xml
  34. +107
    -0
      app/src/main/res/layout/fragment_scene_set.xml
  35. +207
    -0
      app/src/main/res/layout/fragment_system_device.xml
  36. +2
    -0
      app/src/main/res/layout/fragment_system_systemset.xml
  37. +3
    -1
      app/src/main/res/layout/item/layout/item_log.xml

+ 5
- 0
app/src/main/AndroidManifest.xml View File

@@ -201,6 +201,11 @@
android:windowSoftInputMode="adjustPan"
android:screenOrientation="portrait"
android:exported="false" />
<activity
android:name=".ui.activity.SystemSetActivity"
android:windowSoftInputMode="adjustPan"
android:screenOrientation="portrait"
android:exported="false" />
<activity
android:name=".ui.activity.EditGoodsActivity"
android:windowSoftInputMode="adjustPan"


+ 5
- 0
app/src/main/java/com/bonait/bnframework/CrashHandler.java View File

@@ -216,6 +216,11 @@ public class CrashHandler implements UncaughtExceptionHandler {
fos.flush();
fos.close();
}
try{
RecordManager.getInstance().addLogRecord("设备异常日志","设备崩溃了,写入文件:"+fileName+" 内容:"+sb);
}catch (Exception e){
return fileName;
}
return fileName;
}



+ 9
- 5
app/src/main/java/com/bonait/bnframework/business/MainInit.java View File

@@ -21,6 +21,7 @@ import com.bonait.bnframework.common.db.mode.BPA_GOODS_PROCESS_DETAIL;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_SUBATTRIBUTE_GROUP;
import com.bonait.bnframework.common.db.mode.BPA_LOG_RECORD;
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_LIST;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_RECORD;
import com.bonait.bnframework.common.db.mode.BPA_SILOS;
import com.bonait.bnframework.common.db.mode.BPA_SILOSANDMATERIAL;
@@ -239,11 +240,11 @@ public class MainInit {
ConfigData.getInstance().RevertPLCProcess();
// }

if(PreferenceUtils.getInt("reset",1)<3){
DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_ORDER_RECORD.class,null);
DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_SUBORDER_RECORD.class,null);
PreferenceUtils.setInt("reset",3);
}
// if(PreferenceUtils.getInt("reset",1)<3){
// DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_ORDER_RECORD.class,null);
// DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_SUBORDER_RECORD.class,null);
// PreferenceUtils.setInt("reset",3);
// }
if(!DBHelper.getInstance(MainApplication.getContext()).doesTableExist(BPA_SUBORDER_RECORD.class)){
DBHelper.getInstance(MainApplication.getContext()).CreateTablesAll(BPA_SUBORDER_RECORD.class,null);
}
@@ -253,6 +254,9 @@ public class MainInit {
if(!DBHelper.getInstance(MainApplication.getContext()).doesTableExist(BPA_LOG_RECORD.class)){
DBHelper.getInstance(MainApplication.getContext()).CreateTablesAll(BPA_LOG_RECORD.class,null);
}
if(!DBHelper.getInstance(MainApplication.getContext()).doesTableExist(BPA_ORDER_LIST.class)){
DBHelper.getInstance(MainApplication.getContext()).CreateTablesAll(BPA_ORDER_LIST.class,null);
}

//11个料仓 1-9个液体 10水阀 11勾芡
// DBHelper.getInstance(MainApplication.getContext()).DeleteCreateTables(BPA_SILOS_CALIBRATE.class,null);


+ 12
- 71
app/src/main/java/com/bonait/bnframework/business/RecordManager.java View File

@@ -5,12 +5,10 @@ import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.mode.BPA_GOODS;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_SUBATTRIBUTE_GROUP;
import com.bonait.bnframework.common.db.mode.BPA_LOG_RECORD;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_RECORD;
import com.bonait.bnframework.common.db.mode.BPA_SUBORDER_RECORD;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_LIST;
import com.bonait.bnframework.common.db.util.GoodsDBUtil;
import com.bonait.bnframework.common.db.util.LogRecordUtil;
import com.bonait.bnframework.common.db.util.OrderRecordUtil;
import com.bonait.bnframework.common.db.util.SubOrderRecordUtil;
import com.bonait.bnframework.common.db.util.OrderListUtil;

import java.text.ParseException;
import java.text.SimpleDateFormat;
@@ -83,91 +81,34 @@ public class RecordManager {
}
ThreadManager.get().execute(new Thread(()->{
try{
BPA_ORDER_RECORD bean = OrderRecordUtil.getByGoodsId(group.goodsId);
bean.Count = bean.Count+1;

BPA_GOODS goods = GoodsDBUtil.getById(group.goodsId);
if(goods==null){
return;
}
bean.goodsName = goods.name;
bean.goodsId = goods.id;
bean.classifyId = goods.classifyId;
switch (type){
case "完成":
bean.completeCount = bean.completeCount+1;
break;
case "取消":
bean.cancelCount = bean.cancelCount+1;
break;
case "异常":
bean.errorCount = bean.errorCount+1;
break;
}
if(bean.Count == 1){
OrderRecordUtil.add(bean);
}else {
if(compareTime(bean.createTime)){
OrderRecordUtil.update(bean);
}else {
OrderRecordUtil.add(bean);
}
}
}catch (Exception e){
e.printStackTrace();
}
}));
}

/**
* 添加订单记录
* @param group
* @param type 1完成 2取消 3异常
*/
public void addSubOrderRecord(BPA_GOODS_SUBATTRIBUTE_GROUP group, String type){
if(group==null||type==null||type.isEmpty()){
return;
}
ThreadManager.get().execute(new Thread(()->{
try{
BPA_SUBORDER_RECORD bean = SubOrderRecordUtil.getByGoodsId(group.goodsId,group.id);
bean.subCount = bean.subCount+1;
BPA_ORDER_LIST order = new BPA_ORDER_LIST();
BPA_GOODS goods = GoodsDBUtil.getById(group.goodsId);
if(goods==null){
return;
}
bean.goodsName = goods.name;
bean.subNames = group.name;
bean.subGoodsId = group.id;
bean.goodsId = goods.id;
bean.classifyId = goods.classifyId;
order.groupName = group.name;
order.groupId = group.id;
order.goodsName = goods.name;
order.classifyId = goods.classifyId;
order.goodsId = goods.id;
switch (type){
case "完成":
bean.subCompleteCount = bean.subCompleteCount+1;
order.status = 1;
break;
case "取消":
bean.subCancelCount = bean.subCancelCount+1;
order.status = 2;
break;
case "异常":
bean.subErrorCount = bean.subErrorCount+1;
order.status = 3;
break;
}
if(bean.subCount == 1){
SubOrderRecordUtil.add(bean);
}else {
if(compareTime(bean.createTime)){
SubOrderRecordUtil.update(bean);
}else {
SubOrderRecordUtil.add(bean);
}
}
OrderListUtil.add(order);
}catch (Exception e){
e.printStackTrace();
}
}));
}


private boolean compareTime(String createTime) {
try {
// 使用 SimpleDateFormat 解析字符串为 Date 对象


+ 12
- 0
app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java View File

@@ -50,6 +50,18 @@ public class ConfigName {
}
//endregion

//sharepreference 存值
public final static String environment="environment";
public final static String shopNumber="shopNumber";
public final static String deviceNumber="deviceNumber";
public final static String deviceLocation="deviceLocation";
public final static String deviceName="deviceName";
public final static String deviceNum="deviceNum";
public final static String devicePhone="devicePhone";
public final static String storesName="storesName";
public final static String deviceLocationDetail="deviceLocationDetail";
public final static String storesNum="storesNum";

/**
* 判断重复点击
*/


+ 10
- 0
app/src/main/java/com/bonait/bnframework/common/db/QueryDB.java View File

@@ -28,6 +28,7 @@ import com.bonait.bnframework.common.db.mode.BPA_MENUANDUSER;
import com.bonait.bnframework.common.db.mode.BPA_ORDER;
import com.bonait.bnframework.common.db.mode.BPA_ORDERLOG;
import com.bonait.bnframework.common.db.mode.BPA_ORDERLOGDESC;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_LIST;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_RECORD;
import com.bonait.bnframework.common.db.mode.BPA_PLCADDRESS;
import com.bonait.bnframework.common.db.mode.BPA_PROCESS;
@@ -2916,6 +2917,15 @@ public class QueryDB {
((BPA_GOODS_PROCESS_DETAIL) data).processvalue = cursor.getString((int) cursor.getColumnIndex("processvalue"));
((BPA_GOODS_PROCESS_DETAIL) data).processms = cursor.getString((int) cursor.getColumnIndex("processms"));
break;
case "BPA_ORDER_LIST":
data = new BPA_ORDER_LIST();
((BPA_ORDER_LIST) data).goodsName = cursor.getString((int) cursor.getColumnIndex("goodsName"));
((BPA_ORDER_LIST) data).groupName = cursor.getString((int) cursor.getColumnIndex("groupName"));
((BPA_ORDER_LIST) data).groupId = cursor.getString((int) cursor.getColumnIndex("groupId"));
((BPA_ORDER_LIST) data).goodsId = cursor.getString((int) cursor.getColumnIndex("goodsId"));
((BPA_ORDER_LIST) data).classifyId = cursor.getString((int) cursor.getColumnIndex("classifyId"));
((BPA_ORDER_LIST) data).status = cursor.getInt((int) cursor.getColumnIndex("status"));
break;
case "BPA_ORDER":
data = new BPA_ORDER();
//私有


+ 27
- 0
app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_ORDER_LIST.java View File

@@ -0,0 +1,27 @@
package com.bonait.bnframework.common.db.mode;

/**
* @author: liup
* @description: 订单记录
* @date: 2024/6/3 17:36.
*/
public class BPA_ORDER_LIST extends ModeBase{
public String goodsName;
public String groupName;
public String groupId;
public String goodsId;
public String classifyId;
public int status=1;//1完成 2取消 3异常

@Override
public String toString() {
return "BPA_ORDER_LIST{" +
"goodsName='" + goodsName + '\'' +
", groupName='" + groupName + '\'' +
", groupId='" + groupId + '\'' +
", goodsId='" + goodsId + '\'' +
", classifyId='" + classifyId + '\'' +
", status=" + status +
'}';
}
}

+ 13
- 0
app/src/main/java/com/bonait/bnframework/common/db/util/GoodsDBUtil.java View File

@@ -217,5 +217,18 @@ public class GoodsDBUtil {
return data;
}

public static ArrayList<BPA_GOODS> getAll() {
String orderby = QueryDB.Desc_Sort_Up;
String where = "isDelete=?";
String[] args = new String[]{"0"};
ArrayList<BPA_GOODS> data = new ArrayList<>();
ArrayList<Object> obj = QueryDB.Get(BPA_GOODS.class, where, args, orderby);
for (Object k : obj) {
data.add((BPA_GOODS) k);
}
LogUtils.d("getByGoodsId 根据商品Id获取商品列表 data=" + data.toString());
return data;
}


}

+ 101
- 0
app/src/main/java/com/bonait/bnframework/common/db/util/OrderListUtil.java View File

@@ -0,0 +1,101 @@
package com.bonait.bnframework.common.db.util;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_LIST;

import java.util.ArrayList;

/**
* @author: liup
* @description: 订单
* @date: 2024/6/3 17:46.
*/
public class OrderListUtil {
/**
* 新增订单数据
* @param data 订单数据
* @return 是否成功
*/
public static boolean add(BPA_ORDER_LIST data) {

return QueryDB.Add(BPA_ORDER_LIST.class, data);
}

/**
* 修改订单数据
* @param data
*/
public static void update(BPA_ORDER_LIST data) {
QueryDB.Update(BPA_ORDER_LIST.class, data);
}

/**
* 删除订单数据
* @param data 订单数据
* @return 是否成功
*/
public static boolean delete(BPA_ORDER_LIST data) {
return QueryDB.Delete(BPA_ORDER_LIST.class, data.id);
}

/**
* 获取订单数据
*/
public static BPA_ORDER_LIST getByGoodsId(String goodsId){
String orderby = QueryDB.Desc_Time_Up;
String where = "goodsId=?";
String[] args = new String[]{goodsId};
ArrayList<Object> obj = QueryDB.Get(BPA_ORDER_LIST.class, where, args, orderby);

return obj.size() > 0 ? (BPA_ORDER_LIST) obj.get(0) : new BPA_ORDER_LIST();
}

/**
* 获取所有订单数据
*
* @return ArrayList<BPA_GOODS_CLASSIFY>
*/
public static ArrayList<BPA_ORDER_LIST> getAll(String startTime,String stopTime,String text) {
String orderby = QueryDB.Desc_Time_Down;
LogUtils.d("getAll 获取所有订单数据 startTime=" +startTime+";stopTime="+stopTime+";text="+text);
String where = "isDelete=? and createTime>=? and createTime<=?";
String[] args = new String[]{"0",startTime,stopTime};
if (!text.isEmpty()) {
where = "isDelete=? and createTime>=? and createTime<=? and goodsName like ?";
args = new String[]{"0", startTime, stopTime, "%" + text + "%"};
}

ArrayList<BPA_ORDER_LIST> data = new ArrayList<>();
ArrayList<Object> obj = QueryDB.Get(BPA_ORDER_LIST.class, where, args, orderby);
for (Object k : obj) {
data.add((BPA_ORDER_LIST) k);
}
LogUtils.d("getAll 获取所有订单数据 data=" + data.toString());
return data;
}

/**
* 获取所有订单数据
*
* @return ArrayList<BPA_GOODS_CLASSIFY>
*/
public static ArrayList<BPA_ORDER_LIST> getAllByGoodsId(String goodsId,String startTime,String stopTime,String text) {
String orderby = QueryDB.Desc_Time_Down;
LogUtils.d("getAll 获取所有订单数据 startTime=" +startTime+";stopTime="+stopTime+";text="+text);
String where = "goodsId=? and isDelete=? and createTime>=? and createTime<=?";
String[] args = new String[]{goodsId,"0",startTime,stopTime};
if (!text.isEmpty()) {
where = "goodsId=? and isDelete=? and createTime>=? and createTime<=? and goodsName like ?";
args = new String[]{goodsId,"0", startTime, stopTime, "%" + text + "%"};
}

ArrayList<BPA_ORDER_LIST> data = new ArrayList<>();
ArrayList<Object> obj = QueryDB.Get(BPA_ORDER_LIST.class, where, args, orderby);
for (Object k : obj) {
data.add((BPA_ORDER_LIST) k);
}
LogUtils.d("getAll 获取所有订单数据 data=" + data.toString());
return data;
}
}

+ 1
- 1
app/src/main/java/com/bonait/bnframework/common/utils/AlertDialogUtils.java View File

@@ -82,7 +82,7 @@ public class AlertDialogUtils {
}

/**
* 对话框,外界可关闭
* 对话框,外界可关闭
* */
public static void showDialogNoBack(AppCompatActivity activity,int inflateId, XComDialog.OnDialogListener onClickListener) {
new XComDialog(activity, inflateId)


+ 12
- 18
app/src/main/java/com/bonait/bnframework/ui/activity/CookingActivity.java View File

@@ -34,7 +34,7 @@ import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.databinding.ActivityCookBinding;
import com.bonait.bnframework.event.ProcessMakingEvent;
import com.bonait.bnframework.ui.adapter.StepAdapter;
import com.bonait.bnframework.ui.adapter.step.StepAdapter;
import com.bonait.bnframework.ui.dialog.WaiteProgressDialog;
import com.bonait.bnframework.ui.widget.NewToastUtil;

@@ -122,8 +122,9 @@ public class CookingActivity extends BaseActivity {
stepList.addAll(GoodsProcessDetailDBUtil.getByGroupId(subAttributeGroupId));
}

private BPA_GOODS goods;
private void initView(){
BPA_GOODS goods = GoodsDBUtil.getById(goodId);
goods = GoodsDBUtil.getById(goodId);
LogUtils.d(TAG+"initView goodId= "+goodId +" goods="+goods);
if(goods!=null){
String name = (subAttributeGroupName.isEmpty()||subAttributeGroupName.equals(goods.name))?goods.name:(goods.name+"-"+subAttributeGroupName);
@@ -244,7 +245,7 @@ public class CookingActivity extends BaseActivity {
boolean hasError = false;//设备有异常报警
boolean isError = false;//执行异常
try {
RecordManager.getInstance().addLogRecord("订单处理日志",goodsSubattributeGroup.name+"-开始制作");
RecordManager.getInstance().addLogRecord("订单处理日志","("+goods.name+"-"+goodsSubattributeGroup.name+")-开始制作");
LogUtils.d("制作线程 MakeThread 启动 ==》 菜品配方 goodsrecipes="+stepList.toString());
int position = 0;
if(!isTest){
@@ -257,14 +258,14 @@ public class CookingActivity extends BaseActivity {
}
if(!isTest){
if(ModbusHelper.get().isBtnStop()){
RecordManager.getInstance().addLogRecord("订单处理日志",goodsSubattributeGroup.name+"-制作异常-急停按下");
RecordManager.getInstance().addLogRecord("订单处理日志","("+goods.name+"-"+goodsSubattributeGroup.name+")-制作异常-急停按下");
NewToastUtil.getInstance().showToastError("设备已急停,请关闭急停按钮再调试!");
Thread.sleep(2000);
hasError = true;
break;
}
if(ModbusHelper.get().hasErrorInfo()){
RecordManager.getInstance().addLogRecord("订单处理日志",goodsSubattributeGroup.name+"-制作异常-传感器报警");
RecordManager.getInstance().addLogRecord("订单处理日志","("+goods.name+"-"+goodsSubattributeGroup.name+")-制作异常-传感器报警");
String tip = ModbusHelper.get().isBtnStop()?"设备已急停,请关闭急停按钮再调试!":"设备有报警,请前往设备故障页检查!";
Thread.sleep(2000);
NewToastUtil.getInstance().showToastError(tip);
@@ -294,36 +295,29 @@ public class CookingActivity extends BaseActivity {
LogUtils.d("异常信息:" + ex.getMessage());
NewToastUtil.getInstance().showToastError("异常信息:" + ex.getMessage());
if(!isTest){
RecordManager.getInstance().addLogRecord("订单处理日志",goodsSubattributeGroup.name+"-制作异常");
RecordManager.getInstance().addLogRecord("订单处理日志","("+goods.name+"-"+goodsSubattributeGroup.name+")-制作异常");
RecordManager.getInstance().addOrderRecord(goodsSubattributeGroup,"异常");
RecordManager.getInstance().addSubOrderRecord(goodsSubattributeGroup,"异常");
}else {
RecordManager.getInstance().addLogRecord("订单处理日志",goodsSubattributeGroup.name+"-模拟制作异常");
RecordManager.getInstance().addLogRecord("订单处理日志","("+goods.name+"-"+goodsSubattributeGroup.name+")-模拟制作异常");
RecordManager.getInstance().addOrderRecord(goodsSubattributeGroup,"异常");
RecordManager.getInstance().addSubOrderRecord(goodsSubattributeGroup,"异常");
}
} finally {
isMaking = false;
if(!isTest){
if(!isError){
if(NewExecuteTheRecipe.IsForcedEnd){
RecordManager.getInstance().addLogRecord("订单处理日志",goodsSubattributeGroup.name+"-制作强行停止");
RecordManager.getInstance().addLogRecord("订单处理日志","("+goods.name+"-"+goodsSubattributeGroup.name+")-制作强行停止");
RecordManager.getInstance().addOrderRecord(goodsSubattributeGroup,"取消");
RecordManager.getInstance().addSubOrderRecord(goodsSubattributeGroup,"取消");
}else {
RecordManager.getInstance().addLogRecord("订单处理日志",goodsSubattributeGroup.name+"-制作完成");
RecordManager.getInstance().addLogRecord("订单处理日志","("+goods.name+"-"+goodsSubattributeGroup.name+")-制作完成");
RecordManager.getInstance().addOrderRecord(goodsSubattributeGroup,"完成");
RecordManager.getInstance().addSubOrderRecord(goodsSubattributeGroup,"完成");
}
}else {
RecordManager.getInstance().addLogRecord("订单处理日志",goodsSubattributeGroup.name+"-制作异常");
RecordManager.getInstance().addLogRecord("订单处理日志","("+goods.name+"-"+goodsSubattributeGroup.name+")-制作异常");
RecordManager.getInstance().addOrderRecord(goodsSubattributeGroup,"异常");
RecordManager.getInstance().addSubOrderRecord(goodsSubattributeGroup,"异常");
}
}else {
RecordManager.getInstance().addLogRecord("订单处理日志",goodsSubattributeGroup.name+"-模拟制作完成");
RecordManager.getInstance().addOrderRecord(goodsSubattributeGroup,"完成");
RecordManager.getInstance().addSubOrderRecord(goodsSubattributeGroup,"完成");
RecordManager.getInstance().addLogRecord("订单处理日志","("+goods.name+"-"+goodsSubattributeGroup.name+")-模拟制作完成");
}

if (!NewExecuteTheRecipe.IsForcedEnd && !ModbusHelper.get().hasErrorInfo() && NewExecuteTheRecipe.IsStart && !isTest){


+ 1
- 1
app/src/main/java/com/bonait/bnframework/ui/activity/DeviceRecordActivity.java View File

@@ -16,7 +16,7 @@ import com.bonait.bnframework.Service.ModbusHelper;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.databinding.ActivityDeviceRecordBinding;
import com.bonait.bnframework.ui.adapter.DeviceRecordAdapter;
import com.bonait.bnframework.ui.adapter.record.DeviceRecordAdapter;
import com.bonait.bnframework.ui.widget.NewToastUtil;

import java.util.ArrayList;


+ 1
- 1
app/src/main/java/com/bonait/bnframework/ui/activity/DiyProcessActivity.java View File

@@ -39,7 +39,7 @@ import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.common.utils.ProcessValueUtil;
import com.bonait.bnframework.databinding.ActivityEditProcessBinding;
import com.bonait.bnframework.databinding.DialogWithCancelConfirmBinding;
import com.bonait.bnframework.ui.adapter.DiyStepAdapter;
import com.bonait.bnframework.ui.adapter.step.DiyStepAdapter;
import com.bonait.bnframework.ui.dialog.AttributeSelectDialog;
import com.bonait.bnframework.ui.dialog.WaiteProgressDialog;
import com.bonait.bnframework.ui.widget.NewToastUtil;


+ 20
- 1
app/src/main/java/com/bonait/bnframework/ui/activity/LogRecordActivity.java View File

@@ -10,15 +10,18 @@ import android.widget.TextView;

import com.bigkoo.pickerview.TimePickerView;
import com.bonait.bnframework.R;
import com.bonait.bnframework.ViewModel.CustomView.XComDialog;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.mode.BPA_LOG_RECORD;
import com.bonait.bnframework.common.db.util.LogRecordUtil;
import com.bonait.bnframework.common.helper.DateUtils;
import com.bonait.bnframework.common.utils.AlertDialogUtils;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.databinding.ActivityLogBinding;
import com.bonait.bnframework.ui.adapter.LocalLogAdapter;
import com.bonait.bnframework.databinding.DialogLogDescBinding;
import com.bonait.bnframework.ui.adapter.record.LocalLogAdapter;
import com.bonait.bnframework.ui.widget.NewToastUtil;

import java.text.SimpleDateFormat;
@@ -117,6 +120,22 @@ public class LogRecordActivity extends BaseActivity {
});

adapter = new LocalLogAdapter();
adapter.setCallBack(new LocalLogAdapter.ClickCallBack() {
@Override
public void onDescClick(View v, int position) {
AlertDialogUtils.showCancelAndConfirmDialog(LogRecordActivity.this, R.layout.dialog_log_desc, new XComDialog.OnDialogListener() {
@Override
public void onDialogClick(View layoutView, XComDialog xCom) {
DialogLogDescBinding binding = DialogLogDescBinding.bind(layoutView);
DisplayManager.scaleViewGroup(binding.getRoot());
binding.btnClose1.setOnClickListener(v->{
xCom.dismissX();
});
binding.logDesc.setText(adapter.getData().get(position).describe+"");
}
});
}
});
adapter.setNewData(dataLogs);
viewBinding.recycleView.setAdapter(adapter);



+ 36
- 3
app/src/main/java/com/bonait/bnframework/ui/activity/OrderRecordActivity.java View File

@@ -9,13 +9,16 @@ import android.widget.TextView;
import com.bigkoo.pickerview.TimePickerView;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.mode.BPA_GOODS;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_LIST;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_RECORD;
import com.bonait.bnframework.common.db.util.OrderRecordUtil;
import com.bonait.bnframework.common.db.util.GoodsDBUtil;
import com.bonait.bnframework.common.db.util.OrderListUtil;
import com.bonait.bnframework.common.helper.DateUtils;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.databinding.ActivityOrderBinding;
import com.bonait.bnframework.ui.adapter.OrderAdapter;
import com.bonait.bnframework.ui.adapter.record.OrderAdapter;
import com.bonait.bnframework.ui.dialog.SubOrderDialog;
import com.bonait.bnframework.ui.widget.NewToastUtil;

@@ -23,6 +26,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

public class OrderRecordActivity extends BaseActivity {
private ActivityOrderBinding viewBinding;
@@ -102,6 +106,7 @@ public class OrderRecordActivity extends BaseActivity {
}
Bundle bundle = new Bundle();
bundle.putString("goodsId",orderList.get(position).goodsId);
bundle.putString("goodsName",orderList.get(position).goodsName);
bundle.putString("startTime",startTime);
bundle.putString("stopTime",stopTime);
bundle.putString("desc",desc);
@@ -166,7 +171,35 @@ public class OrderRecordActivity extends BaseActivity {

orderList.clear();
desc = viewBinding.edittext.getText().toString();
orderList.addAll(OrderRecordUtil.getAll(startTime,stopTime,viewBinding.edittext.getText().toString()));
List<BPA_ORDER_LIST> orderLists = OrderListUtil.getAll(startTime,stopTime,viewBinding.edittext.getText().toString());
ArrayList<BPA_GOODS> goods= GoodsDBUtil.getAll();
for (BPA_GOODS item :goods)
{
BPA_ORDER_RECORD orderRecord=new BPA_ORDER_RECORD();
orderRecord.goodsName=item.name;
orderRecord.goodsId=item.id;
int count=0;
int countCancel=0;
int countError=0;
for (BPA_ORDER_LIST order:orderLists)
{
if(order.goodsId.equals(item.id))
{
count++;
if(order.status==2)
{
countCancel++;
}else if(order.status == 3){
countError++;
}
}
}
orderRecord.Count=count;
orderRecord.cancelCount=countCancel;
orderRecord.errorCount=countError;
orderRecord.completeCount=count-countCancel-countError;
orderList.add(orderRecord);
}
adapter.notifyDataSetChanged();

} catch (Exception e) {


+ 1
- 1
app/src/main/java/com/bonait/bnframework/ui/activity/RecProcessActivity.java View File

@@ -37,7 +37,7 @@ import com.bonait.bnframework.common.utils.AlertDialogUtils;
import com.bonait.bnframework.common.utils.DimensUtil;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.databinding.ActivityRecProcessBinding;
import com.bonait.bnframework.ui.adapter.StepAdapter;
import com.bonait.bnframework.ui.adapter.step.StepAdapter;
import com.bonait.bnframework.ui.dialog.DeviceControlDialog;
import com.bonait.bnframework.ui.widget.NewToastUtil;



+ 10
- 11
app/src/main/java/com/bonait/bnframework/ui/activity/SystemSetActivity.java View File

@@ -10,15 +10,14 @@ import androidx.viewpager.widget.ViewPager;

import com.bonait.bnframework.R;
import com.bonait.bnframework.ViewModel.Adapter.FragmentAdapter;
import com.bonait.bnframework.ViewModel.FragmentViewModel.SystemDeviceinFragment;
import com.bonait.bnframework.ViewModel.FragmentViewModel.SystemSeasoningsetFragment;
import com.bonait.bnframework.ViewModel.FragmentViewModel.SystemSystemsetFragment;
import com.bonait.bnframework.ViewModel.FragmentViewModel.systeminternetfragment;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.databinding.ActivitySystemSetBinding;
import com.bonait.bnframework.ui.fragment.setting.DeviceSetFragment;
import com.bonait.bnframework.ui.fragment.setting.PicManagerFragment;
import com.bonait.bnframework.ui.fragment.setting.SceneSetFragment;
import com.google.android.material.bottomnavigation.BottomNavigationView;

/**
@@ -34,7 +33,8 @@ public class SystemSetActivity extends BaseActivity {
super.onCreate(savedInstanceState);
viewBinding = ActivitySystemSetBinding.inflate(getLayoutInflater());
setContentView(viewBinding.getRoot());
DisplayManager.scaleViewGroup(viewBinding.getRoot());
DisplayManager.scaleViewGroup(viewBinding.rlQuanxian);
DisplayManager.scaleViewGroup(viewBinding.topbar);
initTopBar();
initView();
}
@@ -48,7 +48,7 @@ public class SystemSetActivity extends BaseActivity {
}

private void initTopBar(){
viewBinding.topbar.setTitle("系统设置");
// viewBinding.topbar.setTitle("系统设置");
viewBinding.back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@@ -59,7 +59,7 @@ public class SystemSetActivity extends BaseActivity {
@Override
public void onClick(View view) {
String s=viewBinding.edittextQuanxian.getText().toString();
if (s==null ||s.isEmpty())
if (s.isEmpty())
{
ToastUtils.warning("权限密码不能为空!");
}else
@@ -82,10 +82,9 @@ public class SystemSetActivity extends BaseActivity {
*/
private void initFragment() {
FragmentAdapter fragmentAdapter = new FragmentAdapter(getSupportFragmentManager());
fragmentAdapter.addFragment(new systeminternetfragment());
fragmentAdapter.addFragment(new SystemDeviceinFragment());
fragmentAdapter.addFragment(new SystemSystemsetFragment());
fragmentAdapter.addFragment(new SystemSeasoningsetFragment());
fragmentAdapter.addFragment(new PicManagerFragment());
fragmentAdapter.addFragment(new DeviceSetFragment());
fragmentAdapter.addFragment(new SceneSetFragment());

viewBinding.viewpager.setAdapter(fragmentAdapter);
}


app/src/main/java/com/bonait/bnframework/ui/adapter/DeviceRecordAdapter.java → app/src/main/java/com/bonait/bnframework/ui/adapter/record/DeviceRecordAdapter.java View File

@@ -1,4 +1,4 @@
package com.bonait.bnframework.ui.adapter;
package com.bonait.bnframework.ui.adapter.record;

import android.view.LayoutInflater;
import android.view.View;

app/src/main/java/com/bonait/bnframework/ui/adapter/LocalLogAdapter.java → app/src/main/java/com/bonait/bnframework/ui/adapter/record/LocalLogAdapter.java View File

@@ -1,4 +1,4 @@
package com.bonait.bnframework.ui.adapter;
package com.bonait.bnframework.ui.adapter.record;

import android.annotation.SuppressLint;
import android.view.LayoutInflater;
@@ -34,11 +34,17 @@ public class LocalLogAdapter extends BaseAdapter<BPA_LOG_RECORD, LocalLogAdapter
}
holder.binding.type.setText(log.typeName+"");
holder.binding.time.setText(log.createTime+"");

if(log.userName!=null){
holder.binding.desc.setText(log.userName+"-"+log.describe+"");
}else {
holder.binding.desc.setText(log.describe+"");
}
holder.binding.desc.setOnClickListener(v->{
if(callBack!=null){
callBack.onDescClick(v,position);
}
});
}

@Override
@@ -55,5 +61,14 @@ public class LocalLogAdapter extends BaseAdapter<BPA_LOG_RECORD, LocalLogAdapter
binding = view;
}
}
private ClickCallBack callBack;

public void setCallBack(ClickCallBack callBack) {
this.callBack = callBack;
}

public interface ClickCallBack{
void onDescClick(View v,int position);
}
}


app/src/main/java/com/bonait/bnframework/ui/adapter/OrderAdapter.java → app/src/main/java/com/bonait/bnframework/ui/adapter/record/OrderAdapter.java View File

@@ -1,4 +1,4 @@
package com.bonait.bnframework.ui.adapter;
package com.bonait.bnframework.ui.adapter.record;

import android.annotation.SuppressLint;
import android.view.LayoutInflater;
@@ -8,11 +8,9 @@ import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.bonait.bnframework.common.base.BaseAdapter;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_RECORD;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.databinding.ItemOrderBinding;
import com.bonait.bnframework.ui.widget.NewToastUtil;

/**
* @author: liup

app/src/main/java/com/bonait/bnframework/ui/adapter/SubOrderAdapter.java → app/src/main/java/com/bonait/bnframework/ui/adapter/record/SubOrderAdapter.java View File

@@ -1,4 +1,4 @@
package com.bonait.bnframework.ui.adapter;
package com.bonait.bnframework.ui.adapter.record;

import android.annotation.SuppressLint;
import android.view.LayoutInflater;

app/src/main/java/com/bonait/bnframework/ui/adapter/DiyStepAdapter.java → app/src/main/java/com/bonait/bnframework/ui/adapter/step/DiyStepAdapter.java View File

@@ -1,4 +1,4 @@
package com.bonait.bnframework.ui.adapter;
package com.bonait.bnframework.ui.adapter.step;

import android.annotation.SuppressLint;
import android.view.LayoutInflater;

app/src/main/java/com/bonait/bnframework/ui/adapter/RecProcessAdapter.java → app/src/main/java/com/bonait/bnframework/ui/adapter/step/RecProcessAdapter.java View File

@@ -1,4 +1,4 @@
package com.bonait.bnframework.ui.adapter;
package com.bonait.bnframework.ui.adapter.step;

import android.annotation.SuppressLint;
import android.view.LayoutInflater;

app/src/main/java/com/bonait/bnframework/ui/adapter/StepAdapter.java → app/src/main/java/com/bonait/bnframework/ui/adapter/step/StepAdapter.java View File

@@ -1,4 +1,4 @@
package com.bonait.bnframework.ui.adapter;
package com.bonait.bnframework.ui.adapter.step;

import android.annotation.SuppressLint;
import android.view.LayoutInflater;

+ 47
- 11
app/src/main/java/com/bonait/bnframework/ui/dialog/SubOrderDialog.java View File

@@ -17,14 +17,18 @@ import androidx.fragment.app.DialogFragment;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.R;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_SUBATTRIBUTE_GROUP;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_LIST;
import com.bonait.bnframework.common.db.mode.BPA_SUBORDER_RECORD;
import com.bonait.bnframework.common.db.util.SubOrderRecordUtil;
import com.bonait.bnframework.common.db.util.OrderListUtil;
import com.bonait.bnframework.common.db.util.SubAttributeGroupDBUtil;
import com.bonait.bnframework.common.utils.AdbCommandUtil;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.databinding.DialogSubOrderBinding;
import com.bonait.bnframework.ui.adapter.SubOrderAdapter;
import com.bonait.bnframework.ui.adapter.record.SubOrderAdapter;

import java.util.ArrayList;
import java.util.List;

/**
* @author: liup
@@ -35,6 +39,7 @@ public class SubOrderDialog extends DialogFragment {
private String TAG = " SubOrderDialog =>";
private DialogSubOrderBinding viewBinding;
private String goodsId;
private String goodsName;
private String startTime;
private String stopTime;
private String desc;
@@ -47,14 +52,6 @@ public class SubOrderDialog extends DialogFragment {
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(STYLE_NORMAL, R.style.DialogScale);
if (getArguments() != null) {
goodsId = getArguments().getString("goodsId");
startTime = getArguments().getString("startTime");
stopTime = getArguments().getString("stopTime");
desc = getArguments().getString("desc");
LogUtils.d(TAG + ";goodsId="+goodsId+";startTime="+startTime+";stopTime="+stopTime);
}
orderList = SubOrderRecordUtil.getByGoodsId(goodsId,startTime,stopTime,desc);
}

@Nullable
@@ -100,11 +97,50 @@ public class SubOrderDialog extends DialogFragment {
window.setAttributes(params);
}
AdbCommandUtil.hideStatusBar(true);
if (getArguments() != null) {
goodsId = getArguments().getString("goodsId");
goodsName = getArguments().getString("goodsName");
startTime = getArguments().getString("startTime");
stopTime = getArguments().getString("stopTime");
desc = getArguments().getString("desc");
LogUtils.d(TAG + ";goodsId="+goodsId+";startTime="+startTime+";stopTime="+stopTime);
}
orderList.clear();
List<BPA_ORDER_LIST> orderLists = OrderListUtil.getAllByGoodsId(goodsId,startTime,stopTime,desc);
ArrayList<BPA_GOODS_SUBATTRIBUTE_GROUP> groups= SubAttributeGroupDBUtil.getByGoodsId(goodsId);
for (BPA_GOODS_SUBATTRIBUTE_GROUP item :groups)
{
BPA_SUBORDER_RECORD orderRecord=new BPA_SUBORDER_RECORD();
int count=0;
int countCancel=0;
int countError=0;
orderRecord.goodsName=goodsName;
orderRecord.subNames=item.name;
orderRecord.subGoodsId=item.id;
for (BPA_ORDER_LIST order:orderLists)
{
if(order.groupId.equals(item.id))
{
count++;
if(order.status==2)
{
countCancel++;
}else if(order.status == 3){
countError++;
}
}
}
orderRecord.subCount=count;
orderRecord.subCancelCount=countCancel;
orderRecord.subErrorCount=countError;
orderRecord.subCompleteCount=count-countCancel-countError;
orderList.add(orderRecord);
}
initView();

}

private void initView(){

viewBinding.btnClose.setOnClickListener(v->{
dismiss();
});


+ 7
- 0
app/src/main/java/com/bonait/bnframework/ui/fragment/HomeMainFragment.java View File

@@ -27,6 +27,7 @@ import com.bonait.bnframework.ui.activity.LogRecordActivity;
import com.bonait.bnframework.ui.activity.MainActivity;
import com.bonait.bnframework.ui.activity.OrderRecordActivity;
import com.bonait.bnframework.ui.activity.SetSeasoningActivity;
import com.bonait.bnframework.ui.activity.SystemSetActivity;
import com.bonait.bnframework.ui.widget.NewToastUtil;
import com.orhanobut.logger.Logger;

@@ -67,6 +68,12 @@ public class HomeMainFragment extends BaseFragment {
* 初始化
*/
private void initView() {
binding.systemSet.setOnClickListener(v->{
if(ConfigName.getInstance().isFastClick()){
return;
}
OpenActivity(SystemSetActivity.class);
});
binding.llClassify.setOnClickListener(v->{
if(ConfigName.getInstance().isFastClick()){
return;


+ 60
- 0
app/src/main/java/com/bonait/bnframework/ui/fragment/setting/DeviceSetFragment.java View File

@@ -0,0 +1,60 @@
package com.bonait.bnframework.ui.fragment.setting;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bonait.bnframework.R;
import com.bonait.bnframework.common.base.BaseFragment;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.common.utils.PreferenceUtils;
import com.bonait.bnframework.databinding.FragmentSystemDeviceBinding;

/**
* @author: liup
* @description: 设备信息设置
* @date: 2024/6/13 11:05.
*/
public class DeviceSetFragment extends BaseFragment {
private FragmentSystemDeviceBinding viewBinding;

@Override
protected View onCreateView() {
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_system_device, null);
viewBinding = FragmentSystemDeviceBinding .bind(root);
DisplayManager.scaleViewGroup(viewBinding.getRoot());
return root;
}

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
initView();
}

private void initView(){
viewBinding.editDeviceLocation.setText(PreferenceUtils.getString(ConfigName.deviceLocation,""));
viewBinding.editDeviceName.setText(PreferenceUtils.getString(ConfigName.deviceName,""));
viewBinding.editDeviceNum.setText(PreferenceUtils.getString(ConfigName.deviceNum,""));
viewBinding.editDevicePhone.setText(PreferenceUtils.getString(ConfigName.devicePhone,""));
viewBinding.editStoresName.setText(PreferenceUtils.getString(ConfigName.storesName,""));
viewBinding.editDeviceLocationDetail.setText(PreferenceUtils.getString(ConfigName.deviceLocationDetail,""));
viewBinding.editStoresNum.setText(PreferenceUtils.getString(ConfigName.storesNum,""));

viewBinding.btnSave.setOnClickListener(v->{
PreferenceUtils.setString(ConfigName.deviceLocation,viewBinding.editDeviceLocation.getText().toString());
PreferenceUtils.setString(ConfigName.deviceName,viewBinding.editDeviceName.getText().toString());
PreferenceUtils.setString(ConfigName.deviceNum,viewBinding.editDeviceNum.getText().toString());
PreferenceUtils.setString(ConfigName.devicePhone,viewBinding.editDevicePhone.getText().toString());
PreferenceUtils.setString(ConfigName.storesName,viewBinding.editStoresName.getText().toString());
PreferenceUtils.setString(ConfigName.deviceLocationDetail,viewBinding.editDeviceLocationDetail.getText().toString());
PreferenceUtils.setString(ConfigName.storesNum,viewBinding.editStoresNum.getText().toString());

});
}

}

+ 237
- 0
app/src/main/java/com/bonait/bnframework/ui/fragment/setting/PicManagerFragment.java View File

@@ -0,0 +1,237 @@
package com.bonait.bnframework.ui.fragment.setting;

import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Environment;
import android.view.LayoutInflater;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.R;
import com.bonait.bnframework.ViewModel.ActivityViewModel.FileActivity;
import com.bonait.bnframework.common.base.BaseFragment;
import com.bonait.bnframework.common.constant.Constants;
import com.bonait.bnframework.common.filepicker.PickerManager;
import com.bonait.bnframework.common.filepicker.adapter.FilePickerShowAdapter;
import com.bonait.bnframework.common.filepicker.adapter.OnFileItemClickListener;
import com.bonait.bnframework.common.filepicker.model.FileEntity;
import com.bonait.bnframework.common.filepicker.model.FileType;
import com.bonait.bnframework.common.image.utils.LocalCacheUtils;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.databinding.FragmentSystemInternetBinding;
import com.bonait.bnframework.ui.widget.NewToastUtil;
import com.orhanobut.logger.Logger;

import java.io.File;
import java.io.FileInputStream;
import java.text.DecimalFormat;
import java.util.ArrayList;

import butterknife.ButterKnife;
import butterknife.OnClick;

/**
* @author: liup
* @description: 图片管理
* @date: 2024/6/13 11:51.
*/
public class PicManagerFragment extends BaseFragment {
private FragmentSystemInternetBinding viewBinding;

@Override
protected View onCreateView() {
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_system_internet, null);
viewBinding = FragmentSystemInternetBinding .bind(root);
ButterKnife.bind(this, root);
DisplayManager.scaleViewGroup(viewBinding.getRoot());
return root;
}

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
initView();
}

private void initView(){
flushedImage();
}


@OnClick({R.id.xuanzhewenjian, R.id.baocunbendi,R.id.delete_all})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.xuanzhewenjian:
Intent intent = new Intent(getContext(), FileActivity.class);
startActivityForResult(intent, Constants.REQ_CODE);
break;
case R.id.baocunbendi://保存按钮
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 2;//宽高压缩为原来的1/2
for (FileEntity item : PickerManager.getInstance().files) {
File file = item.getFile();
try {
Bitmap bitmap1 = BitmapFactory.decodeStream(new FileInputStream(file));
new LocalCacheUtils().setBitmapToLocal(file.getName(), bitmap1);
} catch (Exception e) {
}
}
NewToastUtil.getInstance().showToast("添加成功!");
flushedImage();
break;
case R.id.delete_all:
LogUtils.d(" yx_files="+yx_files.toString());
if(!yx_files.isEmpty()){
for (int i =0;i<yx_files.size();i++){
File file= yx_files.get(i).getFile();
if (file.exists() && file.isFile())
{
file.delete();
}
}
yx_files.clear();
if(viewBinding.rlYxFile.getAdapter()!=null){
viewBinding.rlYxFile.getAdapter().notifyDataSetChanged();
}
}
viewBinding.deleteAll.setText("删除所有缓存图片");
break;
}
}


ArrayList<FileEntity> yx_files = new ArrayList<>();
private static final String CACHE_PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + "/hblxiaochaodb/WebImage";

private void flushedImage() {
File path = new File(CACHE_PATH);// 获得路径
File[] files = path.listFiles();// 读取文件
yx_files.clear();
for (File f : files) {
String absolutePath = f.getAbsolutePath();
FileEntity e;
if (checkExits(absolutePath)) {
e = new FileEntity(absolutePath, f, true);
} else {
e = new FileEntity(absolutePath, f, false);
}
if (f.isFile()) {
String[] imgs = {"png", "jpg", "jpeg", "gif"};
e.setFileType(new FileType("IMG", imgs, 0));
yx_files.add(e);
}
}
viewBinding.rlYxFile.setLayoutManager(new LinearLayoutManager(getContext()));
FilePickerShowAdapter adapter = new FilePickerShowAdapter(getContext(), yx_files);
viewBinding.rlYxFile.setAdapter(adapter);
adapter.setOnItemClickListener(new OnFileItemClickListener() {
@Override
public void click(int position) {

// String path=yx_files.get(position).getPath();
// Bitmap bitmap =BitmapFactory.decodeFile("file://" + path);
// MyImageDialog myImageDialog = new MyImageDialog(getActivity(),R.style.dialogWindowAnim,0,0,bitmap);
// myImageDialog.show();

//打开系统相册浏览照片
// Intent intent = new Intent();
// intent.setAction(Intent.ACTION_VIEW);
// intent.setDataAndType(Uri.parse("file://" + path), "image/*");
// startActivity(intent);
}
});
viewBinding.deleteAll.setText("已缓存:"+getCacheSize()+"\n删除所有缓存图片");
}

private String getCacheSize(){
String sizeString = "";
try {
File folder = new File(CACHE_PATH); // 替换为你的文件夹路径
long folderSize = getFolderSize(folder);
sizeString = formatSize(folderSize); // 将大小转换为可读的格式(可选)
}catch (Exception e){
e.printStackTrace();
}
return sizeString;
}
private long getFolderSize(File dir) {
long size = 0;
if (dir != null && dir.isDirectory()) {
File[] files = dir.listFiles();
for (File file : files) {
if (file.isFile()) {
size += file.length();
} else if (file.isDirectory()) {
size += getFolderSize(file); // 递归调用以获取子文件夹的大小
}
}
}
return size;
}

private String formatSize(long size) {
if (size <= 0) return "0 Bytes";
final String[] units = {"Bytes", "KB", "MB", "GB", "TB"};
int digitGroups = (int) (Math.log10(size) / Math.log10(1024));
return new DecimalFormat("#,##0.#").format(size / Math.pow(1024, digitGroups)) + " " + units[digitGroups];
}

private static boolean checkExits(String path) {
for (FileEntity entity : PickerManager.getInstance().files) {
if (entity.getPath().equals(path)) {
return true;
}
}
return false;
}

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == Constants.REQ_CODE) {
viewBinding.rlFile.setLayoutManager(new LinearLayoutManager(getContext()));
FilePickerShowAdapter adapter = new FilePickerShowAdapter(getContext(), PickerManager.getInstance().files);
viewBinding.rlFile.setAdapter(adapter);

String res = "(" + PickerManager.getInstance().files.size() + "/" + PickerManager.getInstance().maxCount + ")";
viewBinding.baocunbendi.setText(getString(R.string.file_select_res1, res));
adapter.setOnItemClickListener(new OnFileItemClickListener() {
@Override
public void click(int position) {

// String path=PickerManager.getInstance().files.get(position).getPath();
// Intent intent = new Intent();
// intent.setAction(Intent.ACTION_VIEW);
// intent.setDataAndType(Uri.parse("file://" + path), "image/*");
// startActivity(intent);
}
});
}
}

@Override
public void onDestroy() {
super.onDestroy();
Logger.d("我的fragment销毁");
}

/**
* 当在activity设置viewPager + BottomNavigation + fragment时,
* 为防止viewPager左滑动切换界面,与fragment左滑返回上一界面冲突引起闪退问题,
* 必须加上此方法,禁止fragment左滑返回上一界面。
* <p>
* 切记!切记!切记!否则会闪退!
* <p>
* 当在fragment设置viewPager + BottomNavigation + fragment时,则不会出现这个问题。
*/
@Override
protected boolean canDragBack() {
return false;
}
}

+ 71
- 0
app/src/main/java/com/bonait/bnframework/ui/fragment/setting/SceneSetFragment.java View File

@@ -0,0 +1,71 @@
package com.bonait.bnframework.ui.fragment.setting;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ArrayAdapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bonait.bnframework.R;
import com.bonait.bnframework.common.base.BaseFragment;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.common.utils.PreferenceUtils;
import com.bonait.bnframework.databinding.FragmentSceneSetBinding;

import java.util.ArrayList;
import java.util.List;

/**
* @author: liup
* @description: 环境选择,店铺设置
* @date: 2024/6/13 11:05.
*/
public class SceneSetFragment extends BaseFragment {
private FragmentSceneSetBinding viewBinding;
private List<String> environmentList = new ArrayList<>();

@Override
protected View onCreateView() {
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_scene_set, null);
viewBinding = FragmentSceneSetBinding .bind(root);
DisplayManager.scaleViewGroup(viewBinding.getRoot());
return root;
}

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
initData();
initView();
}

private void initView(){
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(getContext(), R.layout.spinner_text_item, environmentList);
spinnerAdapter.setDropDownViewResource(R.layout.spinner_dropdown_item);
viewBinding.spinnerEnvironment.setAdapter(spinnerAdapter);
for(int i=0;i<environmentList.size();i++){
if(environmentList.get(i).equals(PreferenceUtils.getString(ConfigName.environment,"正式环境"))){
viewBinding.spinnerEnvironment.setSelection(i);
}
}
viewBinding.editShopNumber.setText(PreferenceUtils.getString(ConfigName.shopNumber,""));
viewBinding.editDeviceNumber.setText(PreferenceUtils.getString(ConfigName.deviceNumber,""));

viewBinding.btnSave.setOnClickListener(v->{
PreferenceUtils.setString(ConfigName.environment,viewBinding.spinnerEnvironment.getSelectedItem().toString());
PreferenceUtils.setString(ConfigName.shopNumber,viewBinding.editShopNumber.getText().toString());
PreferenceUtils.setString(ConfigName.deviceNumber,viewBinding.editDeviceNumber.getText().toString());

});
}

private void initData(){
environmentList.clear();
environmentList.add("开发环境");
environmentList.add("测试环境");
environmentList.add("正式环境");
}
}

+ 92
- 84
app/src/main/res/layout/activity_system_set.xml View File

@@ -1,10 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout 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/app_color_blue"
android:background="@color/white"
xmlns:tools="http://schemas.android.com/tools">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_marginTop="@dimen/home_tab_height"
android:layout_height="match_parent">

<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_56"
android:layout_gravity="top"
app:layout_constraintTop_toTopOf="parent"
android:background="@drawable/qmui_list_item_bg_with_border_bottom"
app:itemHorizontalTranslationEnabled="false"
app:labelVisibilityMode="labeled"
style="@style/BottomNavigationTextStyle"
app:menu="@menu/system"
android:fitsSystemWindows="true"/>

<com.qmuiteam.qmui.widget.QMUIViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/navigation"
app:layout_constraintBottom_toBottomOf="parent"
android:visibility="gone"
android:background="?attr/app_content_bg_color" />

<TextView
android:layout_width="1dp"
android:focusableInTouchMode="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="@dimen/dp_80"
android:layout_height="1dp">
<requestFocus/>
</TextView>
<RelativeLayout
android:id="@+id/rl_quanxian"
android:layout_gravity="top"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:focusableInTouchMode="true"
android:background="#90BEAA6A">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:orientation="vertical">
<EditText
android:id="@+id/edittext_quanxian"
android:layout_width="@dimen/dp_400"
android:layout_marginTop="@dimen/dp_300"
android:layout_height="@dimen/dp_90"
android:background="@drawable/input_bj"
android:hint="请输入权限密码"
android:inputType="text"
android:maxLines="1"
android:padding="@dimen/dp_3"
android:textSize="@dimen/sp_32" />
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:visibility="gone"
android:layout_height="wrap_content"
android:text="密码提示:12****"
android:textColor="@color/colorAccent"
android:textSize="8dp"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/dp_10"
android:layout_alignParentRight="true"/>
<Button
android:id="@+id/btn_submit"
android:layout_width="@dimen/dp_150"
android:layout_height="@dimen/dp_70"
android:layout_marginTop="20dp"
android:layout_alignParentRight="true"
android:background="@drawable/button1"
android:text="确认"
android:textColor="@color/black"
android:layout_gravity="right"
android:textSize="@dimen/sp_32" />
</LinearLayout>

</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<com.qmuiteam.qmui.widget.QMUITopBarLayout
android:id="@+id/topbar"
app:layout_constraintTop_toTopOf="parent"
@@ -35,86 +124,5 @@
/>
</com.qmuiteam.qmui.widget.QMUITopBarLayout>

<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_56"
android:layout_gravity="top"
app:layout_constraintTop_toBottomOf="@id/topbar"
android:background="@drawable/qmui_list_item_bg_with_border_bottom"
app:itemHorizontalTranslationEnabled="false"
app:labelVisibilityMode="labeled"
style="@style/BottomNavigationTextStyle"
app:menu="@menu/system"
android:fitsSystemWindows="true"/>

<com.qmuiteam.qmui.widget.QMUIViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/navigation"
app:layout_constraintBottom_toBottomOf="parent"
android:visibility="gone"
android:background="?attr/app_content_bg_color" />

<TextView
android:layout_width="1dp"
android:focusableInTouchMode="true"
android:focusable="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="@dimen/dp_80"
android:layout_height="1dp">
<requestFocus/>
</TextView>
<RelativeLayout
android:id="@+id/rl_quanxian"
android:layout_gravity="top"
app:layout_constraintTop_toBottomOf="@id/topbar"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
android:focusableInTouchMode="true"
android:background="#65000000">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:orientation="vertical">
<EditText
android:id="@+id/edittext_quanxian"
android:layout_width="@dimen/dp_400"
android:layout_marginTop="@dimen/dp_300"
android:layout_height="@dimen/dp_90"
android:background="@drawable/input_bj"
android:hint="请输入权限密码"
android:inputType="text"
android:maxLines="1"
android:padding="@dimen/dp_3"
android:textSize="@dimen/sp_32" />
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView
android:layout_width="wrap_content"
android:visibility="gone"
android:layout_height="wrap_content"
android:text="密码提示:12****"
android:textColor="@color/colorAccent"
android:textSize="8dp"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/dp_10"
android:layout_alignParentRight="true"/>
<Button
android:id="@+id/btn_submit"
android:layout_width="@dimen/dp_150"
android:layout_height="@dimen/dp_70"
android:layout_marginTop="20dp"
android:layout_alignParentRight="true"
android:background="@drawable/button1"
android:text="确认"
android:textColor="@color/black"
android:layout_gravity="right"
android:textSize="@dimen/sp_32" />
</LinearLayout>

</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>

+ 57
- 0
app/src/main/res/layout/dialog/layout/dialog_log_desc.xml View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_gravity="center"
android:gravity="center"
android:layout_height="wrap_content">

<RelativeLayout
android:layout_width="700dp"
android:background="@drawable/bg_round25_white"
android:layout_gravity="center"
android:gravity="center"
android:layout_height="1000dp">
<TextView
android:id="@+id/title1"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_80"
android:background="@drawable/bg_round25_top_yellow"
style="@style/TextView_btn_dialog"
android:text="日志详情"
/>

<ImageView
android:id="@+id/btn_close1"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
style="@style/TextView_btn_dialog"
android:layout_alignParentEnd="true"
android:background="@mipmap/ic_clear_white_48dp"
/>

<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="80dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/log_desc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="24sp"
android:padding="20dp"
android:layout_gravity="center"
android:textColor="@color/black"
/>
</LinearLayout>
</ScrollView>


</RelativeLayout>

</LinearLayout>

+ 0
- 1
app/src/main/res/layout/fragment_home4.xml View File

@@ -157,7 +157,6 @@
android:background="@drawable/bg_home_title_yellow"/>



<TextView
android:id="@+id/zhuxiaodenglu"
android:layout_width="@dimen/dp_250"


+ 16
- 1
app/src/main/res/layout/fragment_home_main.xml View File

@@ -217,7 +217,7 @@
android:layout_height="@dimen/dp_60"
android:layout_alignParentRight="true"
android:layout_marginEnd="@dimen/_dp_40"
android:layout_marginBottom="@dimen/dp_145"
android:layout_marginBottom="@dimen/dp_145"
android:layout_alignParentBottom="true"
android:text="注销登录"
android:textSize="@dimen/sp_32"
@@ -228,6 +228,21 @@
android:drawablePadding="@dimen/dp_5"
/>

<TextView
android:id="@+id/systemSet"
android:layout_width="@dimen/dp_85"
android:layout_height="@dimen/dp_60"
android:layout_alignParentRight="true"
android:layout_marginBottom="@dimen/dp_215"
android:layout_alignParentBottom="true"
android:text="设置"
android:textSize="@dimen/sp_26"
android:textColor="@color/white"
android:gravity="center_vertical"
android:paddingLeft="@dimen/dp_20"
android:background="@drawable/bg_round50_left_green_btn"
/>

<ImageView
android:layout_width="@dimen/dp_50"
android:layout_height="@dimen/dp_50"


+ 107
- 0
app/src/main/res/layout/fragment_scene_set.xml View File

@@ -0,0 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/main_background"
tools:context=".ViewModel.FragmentViewModel.SystemSystemsetFragment">

<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:padding="40dp"
android:layout_marginTop="40dp"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_marginBottom="40dp"
android:layout_height="wrap_content">
<TextView
android:layout_width="250dp"
android:layout_height="70dp"
android:textColor="@color/black"
android:textSize="32sp"
android:text="商家店铺号:"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
/>

<EditText
android:id="@+id/edit_shop_number"
android:layout_width="420dp"
android:layout_height="70dp"
android:layout_marginLeft="5dp"
android:background="@drawable/input_bj"
android:hint="请输入商家店铺号"
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
android:textSize="32sp" />

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_marginBottom="40dp"
android:layout_height="wrap_content">
<TextView
android:layout_width="250dp"
android:layout_height="70dp"
android:textColor="@color/black"
android:textSize="32sp"
android:text="商家设备号:"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
/>

<EditText
android:id="@+id/edit_device_number"
android:layout_width="420dp"
android:layout_height="70dp"
android:layout_marginLeft="5dp"
android:background="@drawable/input_bj"
android:hint="请输入商家设备号"
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
android:textSize="32sp" />

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_marginBottom="40dp"
android:layout_height="wrap_content">
<TextView
android:layout_width="250dp"
android:layout_height="70dp"
android:textColor="@color/black"
android:textSize="32sp"
android:text="选择环境:"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
/>

<Spinner
android:id="@+id/spinner_environment"
style="@style/commonSpinnerStyle"
android:layout_width="420dp"
android:layout_height="@dimen/dp_70"
android:layout_centerVertical="true" />

</LinearLayout>

<Button
android:id="@+id/btn_save"
android:layout_width="match_parent"
android:layout_height="70dp"
android:background="@drawable/bg_btn_login_selected"
android:text="保存参数"
android:textColor="@color/white"
android:textSize="32sp"/>
</LinearLayout>
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>

+ 207
- 0
app/src/main/res/layout/fragment_system_device.xml View File

@@ -0,0 +1,207 @@
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/main_background"
tools:context=".ViewModel.FragmentViewModel.SystemDeviceinFragment">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingEnd="20dp"
android:layout_marginTop="40dp"
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_marginBottom="20dp"
android:layout_height="70dp">
<TextView
android:layout_width="250dp"
android:layout_height="match_parent"
android:gravity="right|center_vertical"
android:textSize="32sp"
android:textColor="@color/black"
android:text="设备编号:" />

<EditText
android:id="@+id/edit_device_num"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/input_bj"
android:hint=""
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
android:textSize="32sp" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_marginBottom="20dp"
android:layout_height="70dp">
<TextView
android:layout_width="250dp"
android:layout_height="match_parent"
android:gravity="right|center_vertical"
android:textSize="32sp"
android:textColor="@color/black"
android:text="设备名称:" />

<EditText
android:id="@+id/edit_device_name"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/input_bj"
android:hint=""
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
android:textSize="32sp" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_marginBottom="20dp"
android:layout_height="70dp">
<TextView
android:layout_width="250dp"
android:layout_height="match_parent"
android:gravity="right|center_vertical"
android:textSize="32sp"
android:textColor="@color/black"
android:text="设备位置:" />

<EditText
android:id="@+id/edit_device_location"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/input_bj"
android:hint=""
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
android:textSize="32sp" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_marginBottom="20dp"
android:layout_height="70dp">
<TextView
android:layout_width="250dp"
android:layout_height="match_parent"
android:gravity="right|center_vertical"
android:textSize="32sp"
android:textColor="@color/black"
android:text="联系电话:" />

<EditText
android:id="@+id/edit_device_phone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/input_bj"
android:hint=""
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
android:textSize="32sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_marginBottom="20dp"
android:layout_height="70dp">
<TextView
android:layout_width="250dp"
android:layout_height="match_parent"
android:gravity="right|center_vertical"
android:textSize="32sp"
android:textColor="@color/black"
android:text="设备详细地址:" />

<EditText
android:id="@+id/edit_device_location_detail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/input_bj"
android:hint=""
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
android:textSize="32sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_marginBottom="20dp"
android:layout_height="70dp">
<TextView
android:layout_width="250dp"
android:layout_height="match_parent"
android:gravity="right|center_vertical"
android:textSize="32sp"
android:textColor="@color/black"
android:text="门店编号:" />

<EditText
android:id="@+id/edit_stores_num"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/input_bj"
android:hint=""
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
android:textSize="32sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_marginBottom="20dp"
android:layout_height="70dp">
<TextView
android:layout_width="250dp"
android:layout_height="match_parent"
android:gravity="right|center_vertical"
android:textSize="32sp"
android:textColor="@color/black"
android:text="门店名称:" />

<EditText
android:id="@+id/edit_stores_name"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/input_bj"
android:hint=""
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
android:textSize="32sp" />
</LinearLayout>

<Button
android:id="@+id/btn_save"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_marginTop="@dimen/dp_40"
android:layout_marginStart="20dp"
android:background="@drawable/bg_btn_login_selected"
android:text="保存参数"
android:textColor="@color/white"
android:textSize="32sp"/>
</LinearLayout>
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>

+ 2
- 0
app/src/main/res/layout/fragment_system_systemset.xml View File

@@ -21,6 +21,7 @@
android:layout_height="wrap_content">
<!-- Table1-->
<TableRow
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@@ -136,6 +137,7 @@

<!-- Table3-->
<TableRow
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"


+ 3
- 1
app/src/main/res/layout/item/layout/item_log.xml View File

@@ -45,7 +45,9 @@
android:layout_height="match_parent"
android:gravity="center"
android:textSize="@dimen/sp_26"
android:ellipsize="start"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:layout_alignParentLeft="true"
tools:text="日志描述"
android:textColor="@color/black"/>


Loading…
Cancel
Save