diff --git a/app/src/main/java/com/example/bpa/app/Main.java b/app/src/main/java/com/example/bpa/app/Main.java index d3b09e0..f636d88 100644 --- a/app/src/main/java/com/example/bpa/app/Main.java +++ b/app/src/main/java/com/example/bpa/app/Main.java @@ -36,12 +36,11 @@ public class Main { * 初始化 */ public void Init() { + //1.加载系统设置 LoadSystem(); - - //1.加载配置 - //LoadingPZ(); - //2.初始化PLC -// PLC.getInstance().InitMobus(); + //2.加载配置 + LoadingDPPZ(); + LoadingPZ(); //3.初始化业务 //4.初始化日志上报adad } @@ -56,8 +55,8 @@ public class Main { { for (int i = 0; i <10;i++){ BPA_SYSTEMSET set=new BPA_SYSTEMSET(); - set.type=i; - switch (i) + set.type=i+1; + switch (i+1) { case 1: set.value=String.valueOf(ConfigName.getInstance().OrderPushTime); @@ -137,14 +136,21 @@ public class Main { } } - + /** + * 加载店铺配置 + */ + public void LoadingDPPZ() { + //ConfigName.getInstance().AutKey + ConfigName.getInstance().Shop_Name="黑菠萝奶茶机"; + ConfigName.getInstance().DeviceId="20020415-test"; + } /** * 加载配置 */ public void LoadingPZ() { //1.店铺配置 - ConfigName.getInstance().Shop_Name = ConfigUtil.read(ConfigName.getInstance().dishesCon, "Shop_Name", ConfigName.getInstance().Shop_Name); - ConfigName.getInstance().AutKey = ConfigUtil.read(ConfigName.getInstance().dishesCon, "AutKey", ConfigName.getInstance().AutKey); +// ConfigName.getInstance().Shop_Name = ConfigUtil.read(ConfigName.getInstance().dishesCon, "Shop_Name", ConfigName.getInstance().Shop_Name); +// ConfigName.getInstance().AutKey = ConfigUtil.read(ConfigName.getInstance().dishesCon, "AutKey", ConfigName.getInstance().AutKey); //2.用户名称 ConfigName.getInstance().user.account = ConfigUtil.read(ConfigName.getInstance().dishesCon, "username", ConfigName.getInstance().user.account); ConfigName.getInstance().user.pass = ConfigUtil.read(ConfigName.getInstance().dishesCon, "password", ConfigName.getInstance().user.pass); @@ -156,8 +162,8 @@ public class Main { public void SavePZ() { //1.店铺配置 - ConfigUtil.write(ConfigName.getInstance().dishesCon,"Shop_Name", ConfigName.getInstance().Shop_Name); - ConfigUtil.write(ConfigName.getInstance().dishesCon,"AutKey", ConfigName.getInstance().AutKey); +// ConfigUtil.write(ConfigName.getInstance().dishesCon,"Shop_Name", ConfigName.getInstance().Shop_Name); +// ConfigUtil.write(ConfigName.getInstance().dishesCon,"AutKey", ConfigName.getInstance().AutKey); //2.用户信息 ConfigUtil.write(ConfigName.getInstance().dishesCon,"username", ConfigName.getInstance().user.account); ConfigUtil.write(ConfigName.getInstance().dishesCon,"password", ConfigName.getInstance().user.pass); diff --git a/app/src/main/java/com/example/bpa/view/fragment/setting/systemparameter.java b/app/src/main/java/com/example/bpa/view/fragment/setting/systemparameter.java index 4be0d39..01bca59 100644 --- a/app/src/main/java/com/example/bpa/view/fragment/setting/systemparameter.java +++ b/app/src/main/java/com/example/bpa/view/fragment/setting/systemparameter.java @@ -20,6 +20,7 @@ import com.example.bpa.config.ConfigName; import com.example.bpa.db.QueryDB; import com.example.bpa.db.mode.BPA_GOODS; import com.example.bpa.db.mode.BPA_SYSTEMSET; +import com.example.bpa.helper.T; import java.util.ArrayList; import java.util.Arrays; @@ -163,18 +164,21 @@ public class systemparameter extends Fragment implements View.OnClickListener{ ConfigName.getInstance().SiloAlarmThreshold=Integer.parseInt(passwayText_7.getText().toString()); ConfigName.getInstance().AICleanTime=Integer.parseInt(passwayText_8.getText().toString()); ConfigName.getInstance().AutKey=passwayText_9.getText().toString(); + for (BPA_SYSTEMSET item:bpa_systemsets) { QueryDB.DeleteSystemset(item.id); } for (int i = 0; i