Quellcode durchsuchen

上传商品管理23232

tags/old_version_1
fyf vor 1 Jahr
Ursprung
Commit
e0a5aa59b0
12 geänderte Dateien mit 796 neuen und 347 gelöschten Zeilen
  1. +427
    -263
      app/src/main/java/com/bonait/bnframework/business/ConfigData.java
  2. +2
    -63
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
  3. +5
    -5
      app/src/main/java/com/bonait/bnframework/common/model/mode/BomTechnologyActionInfo.java
  4. +15
    -14
      app/src/main/java/com/bonait/bnframework/common/model/mode/CloudGood.java
  5. +11
    -0
      app/src/main/java/com/bonait/bnframework/common/model/mode/UpdateBomInfo.java
  6. +30
    -0
      app/src/main/java/com/bonait/bnframework/common/model/mode/UpdateCloudGood.java
  7. +193
    -0
      app/src/main/java/com/bonait/bnframework/common/view/EditDialog.java
  8. +4
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigation2Activity.java
  9. +1
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CpActivity.java
  10. +1
    -1
      app/src/main/java/com/bonait/bnframework/modules/welcome/activity/LoginActivity.java
  11. +93
    -0
      app/src/main/res/layout/item/layout/dialog_edit.xml
  12. +14
    -0
      app/src/main/res/values/styles.xml

+ 427
- 263
app/src/main/java/com/bonait/bnframework/business/ConfigData.java Datei anzeigen

@@ -19,6 +19,7 @@ import com.bonait.bnframework.common.db.mode.BPA_PROCESS;
import com.bonait.bnframework.common.db.mode.BPA_PROCESSModel;
import com.bonait.bnframework.common.db.mode.BPA_SYSTEMSET;
import com.bonait.bnframework.common.db.mode.Res_PLCADDRESS;
import com.bonait.bnframework.common.db.res.ResGoodsRecipe;
import com.bonait.bnframework.common.helper.ConfigUtil;
import com.bonait.bnframework.common.helper.Json;
import com.bonait.bnframework.common.http.callback.json.JsonDialogCallback;
@@ -42,6 +43,8 @@ import com.bonait.bnframework.common.model.mode.GoodsUintInfo;
import com.bonait.bnframework.common.model.mode.OrganizeMode;
import com.bonait.bnframework.common.model.mode.ResALLData;
import com.bonait.bnframework.common.model.mode.TechnologyAction;
import com.bonait.bnframework.common.model.mode.UpdateBomInfo;
import com.bonait.bnframework.common.model.mode.UpdateCloudGood;
import com.bonait.bnframework.common.utils.NetworkUtils;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.google.gson.Gson;
@@ -55,10 +58,14 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;

import okhttp3.MediaType;
import okhttp3.RequestBody;


/**
* 主函数进程
@@ -224,28 +231,21 @@ public class ConfigData {
ConfigName.getInstance().cloudData = new ResALLData();
for (BPA_CLOUDDATA item : data) {
if (item.name.equals("物料集合")) {
ConfigName.getInstance().cloudData.batchingInfo =
new Json<BatchingInfo>().jsonToListobject(BatchingInfo.class, item.text);
ConfigName.getInstance().cloudData.batchingInfo = new Json<BatchingInfo>().jsonToListobject(BatchingInfo.class, item.text);
} else if (item.name.equals("工艺模型")) {
ConfigName.getInstance().cloudData.goodsTechnology =
new Json<GoodsTechnology>().jsonToListobject(GoodsTechnology.class, item.text);
ConfigName.getInstance().cloudData.goodsTechnology = new Json<GoodsTechnology>().jsonToListobject(GoodsTechnology.class, item.text);
} else if (item.name.equals("工艺模型详细信息")) {
ConfigName.getInstance().cloudData.technologyAction =
new Json<TechnologyAction>().jsonToListobject(TechnologyAction.class, item.text);
ConfigName.getInstance().cloudData.technologyAction = new Json<TechnologyAction>().jsonToListobject(TechnologyAction.class, item.text);
} else if (item.name.equals("菜谱信息")) {
ConfigName.getInstance().cloudData.foodMenuInfo =
new Json<FoodMenuInfo>().jsonToListobject(FoodMenuInfo.class, item.text);
ConfigName.getInstance().cloudData.foodMenuInfo = new Json<FoodMenuInfo>().jsonToListobject(FoodMenuInfo.class, item.text);
} else if (item.name.equals("商品小类")) {
ConfigName.getInstance().cloudData.goodsTypeInfo =
new Json<GoodsTypeInfo>().jsonToListobject(GoodsTypeInfo.class, item.text);
ConfigName.getInstance().cloudData.goodsTypeInfo = new Json<GoodsTypeInfo>().jsonToListobject(GoodsTypeInfo.class, item.text);

} else if (item.name.equals("商品大类")) {
ConfigName.getInstance().cloudData.goodsParentTypeInfo =
new Json<GoodsParentTypeInfo>().jsonToListobject(GoodsParentTypeInfo.class, item.text);
ConfigName.getInstance().cloudData.goodsParentTypeInfo = new Json<GoodsParentTypeInfo>().jsonToListobject(GoodsParentTypeInfo.class, item.text);

} else if (item.name.equals("商品单位")) {
ConfigName.getInstance().cloudData.goodsUintInfo =
new Json<GoodsUintInfo>().jsonToListobject(GoodsUintInfo.class, item.text);
ConfigName.getInstance().cloudData.goodsUintInfo = new Json<GoodsUintInfo>().jsonToListobject(GoodsUintInfo.class, item.text);

}
}
@@ -261,35 +261,28 @@ public class ConfigData {
if (NetworkUtils.isNetworkConnected(context)) {

//获取店铺信息
OkGo.<ResAPI<OrganizeMode>>get(ConfigName.getInstance().SaasAddress + ConfigName.getInstance().GetStore + ConfigName.getInstance().ClientAutoKey)
.tag(context)
.execute(new JsonDialogCallback<ResAPI<OrganizeMode>>(context) {
@Override
public void onSuccess(Response<ResAPI<OrganizeMode>> response) {
ResAPI<OrganizeMode> organize = response.body();
if (organize.isSuccess) {
ConfigName.getInstance().organizeMode = organize.data;


OkGo.<ResAPI<DeviceInformation>>get(
String.format(ConfigName.getInstance().SaasAddress + ConfigName.getInstance().GetDeviceInformation,
ConfigName.getInstance().organizeMode.id, ConfigName.getInstance().DeviceAutoKey))
.tag(context)
.execute(new JsonDialogCallback<ResAPI<DeviceInformation>>(context) {
@Override
public void onSuccess(Response<ResAPI<DeviceInformation>> response) {
ResAPI<DeviceInformation> deviceInformation = response.body();
if (deviceInformation.succeeded) {
ConfigName.getInstance().deviceInformation = deviceInformation.data;
if (ConfigName.getInstance().deviceInformation != null) {
ConfigName.getInstance().DeviceId = ConfigName.getInstance().deviceInformation.id;
}
}
}
});
OkGo.<ResAPI<OrganizeMode>>get(ConfigName.getInstance().SaasAddress + ConfigName.getInstance().GetStore + ConfigName.getInstance().ClientAutoKey).tag(context).execute(new JsonDialogCallback<ResAPI<OrganizeMode>>(context) {
@Override
public void onSuccess(Response<ResAPI<OrganizeMode>> response) {
ResAPI<OrganizeMode> organize = response.body();
if (organize.isSuccess) {
ConfigName.getInstance().organizeMode = organize.data;

OkGo.<ResAPI<DeviceInformation>>get(String.format(ConfigName.getInstance().SaasAddress + ConfigName.getInstance().GetDeviceInformation, ConfigName.getInstance().organizeMode.id, ConfigName.getInstance().DeviceAutoKey)).tag(context).headers(new HttpHeaders("TenantId", ConfigName.getInstance().organizeMode.companyId)).execute(new JsonDialogCallback<ResAPI<DeviceInformation>>(context) {
@Override
public void onSuccess(Response<ResAPI<DeviceInformation>> response) {
ResAPI<DeviceInformation> deviceInformation = response.body();
if (deviceInformation.succeeded) {
ConfigName.getInstance().deviceInformation = deviceInformation.data;
if (ConfigName.getInstance().deviceInformation != null) {
ConfigName.getInstance().DeviceId = ConfigName.getInstance().deviceInformation.id;
}
}
}
}
});
});
}
}
});


}
@@ -301,151 +294,150 @@ public class ConfigData {
public void SyncDataInTheCloud(Context context, Handler mHandler) {
if (NetworkUtils.isNetworkConnected(context)) {
//region 拉取物料数据
OkGo.<ResAPI<ResALLData>>get(String.format(ConfigName.getInstance().SaasAddress + ConfigName.getInstance().GetBaseDataModel,
ConfigName.getInstance().organizeMode.id, ConfigName.getInstance().DeviceAutoKey))
.tag(context)
.headers(new HttpHeaders("TenantId", ConfigName.getInstance().organizeMode.companyId))
.execute(new JsonDialogCallback<ResAPI<ResALLData>>(context) {
@Override
public void onSuccess(Response<ResAPI<ResALLData>> response) {
ResAPI<ResALLData> allDataResAPI = response.body();
if (allDataResAPI.succeeded && allDataResAPI.data != null) {
BPA_CLOUDDATA data = new BPA_CLOUDDATA();
ConfigName.getInstance().cloudData = allDataResAPI.data;
ArrayList<BPA_CLOUDDATA> arrayList = QueryDB.GetClouddataALL();
for (BPA_CLOUDDATA item : arrayList) {
QueryDB.DeleteClouddata(item);
}
if (ConfigName.getInstance().organizeMode == null) {
return;
}
OkGo.<ResAPI<ResALLData>>get(String.format(ConfigName.getInstance().SaasAddress + ConfigName.getInstance().GetBaseDataModel, ConfigName.getInstance().organizeMode.id, ConfigName.getInstance().DeviceAutoKey)).tag(context).headers(new HttpHeaders("TenantId", ConfigName.getInstance().organizeMode.companyId)).execute(new JsonDialogCallback<ResAPI<ResALLData>>(context) {
@Override
public void onSuccess(Response<ResAPI<ResALLData>> response) {
ResAPI<ResALLData> allDataResAPI = response.body();
if (allDataResAPI.succeeded && allDataResAPI.data != null) {
BPA_CLOUDDATA data = new BPA_CLOUDDATA();
ConfigName.getInstance().cloudData = allDataResAPI.data;
ArrayList<BPA_CLOUDDATA> arrayList = QueryDB.GetClouddataALL();
for (BPA_CLOUDDATA item : arrayList) {
QueryDB.DeleteClouddata(item);
}

//region 物料管理
List<BatchingInfo> bayc = allDataResAPI.data.batchingInfo;
if (allDataResAPI.data.batchingInfo != null) {
data = new BPA_CLOUDDATA();
data.id = java.util.UUID.randomUUID().toString();
data.name = "物料集合";
data.text = new Gson().toJson(bayc);
QueryDB.AddClouddata(data);
ArrayList<BPA_MATERIAL> materials = QueryDB.GetMaterialALL();
for (BPA_MATERIAL wl : materials) {
QueryDB.DeleteMaterial(wl);
}
//region 物料管理
List<BatchingInfo> bayc = allDataResAPI.data.batchingInfo;
if (allDataResAPI.data.batchingInfo != null) {
data = new BPA_CLOUDDATA();
data.id = java.util.UUID.randomUUID().toString();
data.name = "物料集合";
data.text = new Gson().toJson(bayc);
QueryDB.AddClouddata(data);
ArrayList<BPA_MATERIAL> materials = QueryDB.GetMaterialALL();
for (BPA_MATERIAL wl : materials) {
QueryDB.DeleteMaterial(wl);
}

Integer I = 0;
for (BatchingInfo item : bayc) {
BPA_MATERIAL bpa_material = new BPA_MATERIAL();
bpa_material.id = item.id;
bpa_material.name = item.batching_Name;
bpa_material.imgUrl = "";
bpa_material.createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(new Date().getTime() + I * 1000));
;
bpa_material.deviceID = ConfigName.getInstance().DeviceId;
bpa_material.userID = ConfigName.getInstance().user.userID;
QueryDB.AddMaterial(bpa_material);
I++;
}
}
//endregion

//region 工艺模型
if (allDataResAPI.data.goodsTechnology != null) {
data = new BPA_CLOUDDATA();
data.id = java.util.UUID.randomUUID().toString();
data.name = "工艺模型";
data.text = new Gson().toJson(allDataResAPI.data.goodsTechnology);
QueryDB.AddClouddata(data);

ArrayList<BPA_PROCESS> processes = QueryDB.GetProcessALL();
for (BPA_PROCESS pro : processes) {
QueryDB.DeleteProcess(pro);
}
Integer I = 0;
for (GoodsTechnology item : allDataResAPI.data.goodsTechnology) {
BPA_PROCESS bpa_process = new BPA_PROCESS();
bpa_process.id = item.id;
bpa_process.name = item.name;
bpa_process.createTime = item.createAt;
bpa_process.sort = I;
QueryDB.AddProcess(bpa_process);
I++;
}
}
//endregion

//region 工艺模型详细信息
if (allDataResAPI.data.technologyAction != null) {
data = new BPA_CLOUDDATA();
data.id = java.util.UUID.randomUUID().toString();
data.name = "工艺模型详细信息";
data.text = new Gson().toJson(allDataResAPI.data.technologyAction);
QueryDB.AddClouddata(data);

ArrayList<BPA_PROCESSModel> processes = QueryDB.GetProcessModelALL();
for (BPA_PROCESSModel pro : processes) {
QueryDB.DeleteProcessModel(pro);
}
for (TechnologyAction item : allDataResAPI.data.technologyAction) {
BPA_PROCESSModel bpa_process = new BPA_PROCESSModel();
bpa_process.id = item.id;
bpa_process.processid = item.goodstechnologyId;
bpa_process.name = item.actionName;
bpa_process.createTime = item.createAt;
bpa_process.sort = item.sort;
bpa_process.datatype = (item.actionType.equals("digit") ? 0 : ((item.actionType.equals("text") || item.actionType.equals("textarea") || item.actionType.equals("switch")) ? 1 : 2));
bpa_process.data = "";
if (item.actionType.equals("select") && !item.actionValue.isEmpty()) {
List<TechnologyValueMode> val = new Json<TechnologyValueMode>().jsonToListobject(TechnologyValueMode.class, item.actionValue);
for (int i = 0; i < val.size(); i++) {
if (i < val.size() - 1) {
bpa_process.data += val.get(i).actionValueName + "、";
} else {
bpa_process.data += val.get(i).actionValueName;
}
}
Integer I = 0;
for (BatchingInfo item : bayc) {
BPA_MATERIAL bpa_material = new BPA_MATERIAL();
bpa_material.id = item.id;
bpa_material.name = item.batching_Name;
bpa_material.imgUrl = "";
bpa_material.createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(new Date().getTime() + I * 1000));
;
bpa_material.deviceID = ConfigName.getInstance().DeviceId;
bpa_material.userID = ConfigName.getInstance().user.userID;
QueryDB.AddMaterial(bpa_material);
I++;
}
}
//endregion

//region 工艺模型
if (allDataResAPI.data.goodsTechnology != null) {
data = new BPA_CLOUDDATA();
data.id = java.util.UUID.randomUUID().toString();
data.name = "工艺模型";
data.text = new Gson().toJson(allDataResAPI.data.goodsTechnology);
QueryDB.AddClouddata(data);

ArrayList<BPA_PROCESS> processes = QueryDB.GetProcessALL();
for (BPA_PROCESS pro : processes) {
QueryDB.DeleteProcess(pro);
}
Integer I = 0;
for (GoodsTechnology item : allDataResAPI.data.goodsTechnology) {
BPA_PROCESS bpa_process = new BPA_PROCESS();
bpa_process.id = item.id;
bpa_process.name = item.name;
bpa_process.createTime = item.createAt;
bpa_process.sort = I;
QueryDB.AddProcess(bpa_process);
I++;
}
}
//endregion

//region 工艺模型详细信息
if (allDataResAPI.data.technologyAction != null) {
data = new BPA_CLOUDDATA();
data.id = java.util.UUID.randomUUID().toString();
data.name = "工艺模型详细信息";
data.text = new Gson().toJson(allDataResAPI.data.technologyAction);
QueryDB.AddClouddata(data);

ArrayList<BPA_PROCESSModel> processes = QueryDB.GetProcessModelALL();
for (BPA_PROCESSModel pro : processes) {
QueryDB.DeleteProcessModel(pro);
}
for (TechnologyAction item : allDataResAPI.data.technologyAction) {
BPA_PROCESSModel bpa_process = new BPA_PROCESSModel();
bpa_process.id = item.id;
bpa_process.processid = item.goodstechnologyId;
bpa_process.name = item.actionName;
bpa_process.createTime = item.createAt;
bpa_process.sort = item.sort;
bpa_process.datatype = (item.actionType.equals("digit") ? 0 : ((item.actionType.equals("text") || item.actionType.equals("textarea") || item.actionType.equals("switch")) ? 1 : 2));
bpa_process.data = "";
if (item.actionType.equals("select") && !item.actionValue.isEmpty()) {
List<TechnologyValueMode> val = new Json<TechnologyValueMode>().jsonToListobject(TechnologyValueMode.class, item.actionValue);
for (int i = 0; i < val.size(); i++) {
if (i < val.size() - 1) {
bpa_process.data += val.get(i).actionValueName + "、";
} else {
bpa_process.data += val.get(i).actionValueName;
}
QueryDB.AddProcessModel(bpa_process);
}
}
//endegion
QueryDB.AddProcessModel(bpa_process);
}
}
//endegion


if (allDataResAPI.data.foodMenuInfo != null) {
data = new BPA_CLOUDDATA();
data.id = java.util.UUID.randomUUID().toString();
data.name = "菜谱信息";
data.text = new Gson().toJson(allDataResAPI.data.foodMenuInfo);
QueryDB.AddClouddata(data);
}
if (allDataResAPI.data.foodMenuInfo != null) {
data = new BPA_CLOUDDATA();
data.id = java.util.UUID.randomUUID().toString();
data.name = "菜谱信息";
data.text = new Gson().toJson(allDataResAPI.data.foodMenuInfo);
QueryDB.AddClouddata(data);
}

if (allDataResAPI.data.goodsTypeInfo != null) {
data = new BPA_CLOUDDATA();
data.id = java.util.UUID.randomUUID().toString();
data.name = "商品小类";
data.text = new Gson().toJson(allDataResAPI.data.goodsTypeInfo);
QueryDB.AddClouddata(data);
}
if (allDataResAPI.data.goodsTypeInfo != null) {
data = new BPA_CLOUDDATA();
data.id = java.util.UUID.randomUUID().toString();
data.name = "商品小类";
data.text = new Gson().toJson(allDataResAPI.data.goodsTypeInfo);
QueryDB.AddClouddata(data);
}

if (allDataResAPI.data.goodsParentTypeInfo != null) {
data = new BPA_CLOUDDATA();
data.id = java.util.UUID.randomUUID().toString();
data.name = "商品大类";
data.text = new Gson().toJson(allDataResAPI.data.goodsParentTypeInfo);
QueryDB.AddClouddata(data);
}
if (allDataResAPI.data.goodsParentTypeInfo != null) {
data = new BPA_CLOUDDATA();
data.id = java.util.UUID.randomUUID().toString();
data.name = "商品大类";
data.text = new Gson().toJson(allDataResAPI.data.goodsParentTypeInfo);
QueryDB.AddClouddata(data);
}

if (allDataResAPI.data.goodsUintInfo != null) {
data = new BPA_CLOUDDATA();
data.id = java.util.UUID.randomUUID().toString();
data.name = "商品单位";
data.text = new Gson().toJson(allDataResAPI.data.goodsUintInfo);
QueryDB.AddClouddata(data);
}
Message msg = new Message();
msg.obj = "MSG_REFRESH";
mHandler.sendMessage(msg);
}
if (allDataResAPI.data.goodsUintInfo != null) {
data = new BPA_CLOUDDATA();
data.id = java.util.UUID.randomUUID().toString();
data.name = "商品单位";
data.text = new Gson().toJson(allDataResAPI.data.goodsUintInfo);
QueryDB.AddClouddata(data);
}
});
Message msg = new Message();
msg.obj = "MSG_REFRESH";
mHandler.sendMessage(msg);
}
}
});
//endregion
} else {
ToastUtils.warning("无网络,请先连接网络!!!");
@@ -459,22 +451,21 @@ public class ConfigData {
*/
public void GetGevGood(Context context, Handler mHandler) {
if (NetworkUtils.isNetworkConnected(context)) {
OkGo.<ResAPI<List<CloudGood>>>get(String.format(ConfigName.getInstance().SaasAddress + ConfigName.getInstance().GetGoods,
ConfigName.getInstance().organizeMode.id, ConfigName.getInstance().DeviceId))
.tag(context)
.headers(new HttpHeaders("TenantId", ConfigName.getInstance().organizeMode.companyId))
.execute(new JsonDialogCallback<ResAPI<List<CloudGood>>>(context) {
@Override
public void onSuccess(Response<ResAPI<List<CloudGood>>> response) {
ResAPI<List<CloudGood>> allDataResAPI = response.body();
if (allDataResAPI.succeeded && allDataResAPI.data != null && allDataResAPI.data.size() > 0) {
ConfigName.getInstance().cloudGoods = allDataResAPI.data;
Message msg = new Message();
msg.obj = "MSG_REFRESH";
mHandler.sendMessage(msg);
}
}
});
if (ConfigName.getInstance().organizeMode == null) {
return;
}
OkGo.<ResAPI<List<CloudGood>>>get(String.format(ConfigName.getInstance().SaasAddress + ConfigName.getInstance().GetGoods, ConfigName.getInstance().organizeMode.id, ConfigName.getInstance().DeviceId)).tag(context).headers(new HttpHeaders("TenantId", ConfigName.getInstance().organizeMode.companyId)).execute(new JsonDialogCallback<ResAPI<List<CloudGood>>>(context) {
@Override
public void onSuccess(Response<ResAPI<List<CloudGood>>> response) {
ResAPI<List<CloudGood>> allDataResAPI = response.body();
if (allDataResAPI.succeeded && allDataResAPI.data != null && allDataResAPI.data.size() > 0) {
ConfigName.getInstance().cloudGoods = allDataResAPI.data;
Message msg = new Message();
msg.obj = "MSG_REFRESH";
mHandler.sendMessage(msg);
}
}
});
} else {
ToastUtils.warning("无网络,请先连接网络!!!");
}
@@ -487,95 +478,268 @@ public class ConfigData {
* @param context
*/
public void GetGoodProcess(Context context, String goodid) {
Boolean IsXZ= QueryDB.GetGoodsIDIs(goodid);
if(IsXZ)
{
Boolean IsXZ = QueryDB.GetGoodsIDIs(goodid);
if (IsXZ) {
ToastUtils.warning("请勿重复下载,本地商品已存在!!!");
return;
}

if (NetworkUtils.isNetworkConnected(context)) {
OkGo.<ResAPI<ResGoodProcess>>get(String.format(ConfigName.getInstance().SaasAddress + ConfigName.getInstance().GetGoodsBom,
goodid))
.tag(context)
.headers(new HttpHeaders("TenantId", ConfigName.getInstance().organizeMode.companyId))
.execute(new JsonDialogCallback<ResAPI<ResGoodProcess>>(context) {
@Override
public void onSuccess(Response<ResAPI<ResGoodProcess>> response) {
ResAPI<ResGoodProcess> allDataResAPI = response.body();
if (allDataResAPI.succeeded && allDataResAPI.data != null) {

CloudGood cloudGood = null;
for (CloudGood item : ConfigName.getInstance().cloudGoods) {
if (item.id.equals(goodid)) {
cloudGood = item;
break;
}
}
if (ConfigName.getInstance().organizeMode == null) {
return;
}
OkGo.<ResAPI<ResGoodProcess>>get(String.format(ConfigName.getInstance().SaasAddress + ConfigName.getInstance().GetGoodsBom, goodid)).tag(context).headers(new HttpHeaders("TenantId", ConfigName.getInstance().organizeMode.companyId)).execute(new JsonDialogCallback<ResAPI<ResGoodProcess>>(context) {
@Override
public void onSuccess(Response<ResAPI<ResGoodProcess>> response) {
ResAPI<ResGoodProcess> allDataResAPI = response.body();
if (allDataResAPI.succeeded && allDataResAPI.data != null) {

CloudGood cloudGood = null;
for (CloudGood item : ConfigName.getInstance().cloudGoods) {
if (item.id.equals(goodid)) {
cloudGood = item;
break;
}
}

if (cloudGood != null) {
//1.增加商品
BPA_GOODS good = new BPA_GOODS();
good.id = cloudGood.id;
good.name = cloudGood.goods_Name;
good.status = 1;
good.sort = QueryDB.GetGoodsALL().size() + 1;
good.maketime = 180;
good.issc = 0;
good.url = cloudGood.goods_ImgUrl;
good.exp="云端商品";
QueryDB.AddGoods(good);
//2.增加配方
if (allDataResAPI.data.bomTechnologyActionInfo != null && allDataResAPI.data.bomTechnologyActionInfo.size() > 0) {
List<BomTechnologyActionInfo> bayc = allDataResAPI.data.bomTechnologyActionInfo;
Collections.sort(bayc, new Comparator<BomTechnologyActionInfo>() {
@Override
public int compare(BomTechnologyActionInfo o1, BomTechnologyActionInfo o2) {

return Double.valueOf(o1.sort).compareTo(Double.valueOf(o2.sort));
}
});
for (BomTechnologyActionInfo k : allDataResAPI.data.bomTechnologyActionInfo) {
BPA_GOODSRECIPE item = new BPA_GOODSRECIPE();
item.goodsID = good.id;
item.sort = k.sort;
item.processname = k.stepName;
if (!k.actionJson.isEmpty()) {
String data = "";
String desc = "";
boolean iswl=false;
List<ActionJsonMode> gyActions = new Json<List<ActionJsonMode>>().jsonToListobject(ActionJsonMode.class, ((String) k.actionJson));
for (ActionJsonMode m : gyActions) {
data += m.ActionName + "," + m.ActionValue + "|";
desc += m.ActionValue + ",";
if(!m.BatchingId.isEmpty())
{
iswl=true;
}
}
if (data.contains("|")) {
item.processvalue = data.substring(0, data.length() - 1);
}
if (desc.contains(",")) {
item.processms = k.stepName + "(" + desc.substring(0, desc.length() - 1) + ")";
}
item.materialType=iswl?0:1;
if (cloudGood != null) {
//1.增加商品
BPA_GOODS good = new BPA_GOODS();
good.id = cloudGood.id;
good.name = cloudGood.goods_Name;
good.status = 1;
good.sort = QueryDB.GetGoodsALL().size() + 1;
good.maketime = 180;
good.issc = 0;
good.url = cloudGood.goods_ImgUrl;
good.exp = "云端商品";
QueryDB.AddGoods(good);
//2.增加配方
if (allDataResAPI.data.bomTechnologyActionInfo != null && allDataResAPI.data.bomTechnologyActionInfo.size() > 0) {
List<BomTechnologyActionInfo> bayc = allDataResAPI.data.bomTechnologyActionInfo;
Collections.sort(bayc, new Comparator<BomTechnologyActionInfo>() {
@Override
public int compare(BomTechnologyActionInfo o1, BomTechnologyActionInfo o2) {

return Double.valueOf(o1.sort).compareTo(Double.valueOf(o2.sort));
}
});
for (BomTechnologyActionInfo k : allDataResAPI.data.bomTechnologyActionInfo) {
BPA_GOODSRECIPE item = new BPA_GOODSRECIPE();
item.goodsID = good.id;
item.sort = k.sort;
item.processname = k.stepName;
if (!k.actionJson.isEmpty()) {
String data = "";
String desc = "";
boolean iswl = false;
List<ActionJsonMode> gyActions = new Json<List<ActionJsonMode>>().jsonToListobject(ActionJsonMode.class, ((String) k.actionJson));
for (ActionJsonMode m : gyActions) {
data += m.ActionName + "," + m.ActionValue + "|";
desc += m.ActionValue + ",";
if (!m.BatchingId.isEmpty()) {
iswl = true;
}
QueryDB.AddGoodsSrecipe(item);
}
if (data.contains("|")) {
item.processvalue = data.substring(0, data.length() - 1);
}
if (desc.contains(",")) {
item.processms = k.stepName + "(" + desc.substring(0, desc.length() - 1) + ")";
}
item.materialType = iswl ? 0 : 1;
}
ToastUtils.info("下载菜品成功!!!");
MessageManager.getInstance().sendMessage(MessageName.ScGood,"Good");
QueryDB.AddGoodsSrecipe(item);
}
}
ToastUtils.info("下载菜品成功!!!");
MessageManager.getInstance().sendMessage(MessageName.ScGood, "Good");
}
});
}
}
});
} else {
ToastUtils.warning("无网络,请先连接网络!!!");
}

}

/**
* 上传商品信息
*
* @param context
* @param goodid
*/
public void UploadGoods(Context context, String goodid) {
try {
if (NetworkUtils.isNetworkConnected(context)) {
if (ConfigName.getInstance().organizeMode == null && ConfigName.getInstance().cloudData!=null) {
ToastUtils.warning("无组织信息不能上传,请设置当前店铺信息!!!");
return;
}

Boolean isSuceess = false;
BPA_GOODS good = QueryDB.GetGoodsId(goodid);
UpdateCloudGood update = new UpdateCloudGood();
update.storeId=ConfigName.getInstance().organizeMode.id;
update.goodsInfo=new CloudGood();
update.goodsInfo.id=good.id;
update.goodsInfo.createAt=good.createTime;
update.goodsInfo.isDeleted=0;
update.goodsInfo.status=0;
update.goodsInfo.groupId=ConfigName.getInstance().organizeMode.companyId;
update.goodsInfo.autoKey=0;
update.goodsInfo.isWeigh=false;
update.goodsInfo.vipPrice=0;
update.goodsInfo.price=0;
update.goodsInfo.code=good.id;
update.goodsInfo.goods_Sort=good.sort;
update.goodsInfo.goods_Descritption="设备上传商品";
update.goodsInfo.goods_Name=good.name;

//选择菜谱 大类id 小类id 单位id
update.foodMenuId="";
update.goodsInfo.goods_ImgUrl="设备上传商品";//图片地址
update.goodsInfo.parentTypeID="";//大类
update.goodsInfo.goods_TypeID="";//小类
update.goodsInfo.goodsUintId="";//单位

UpdateBomInfo bom=new UpdateBomInfo();
bom.bomType="";
bom.name=good.name;
bom.code=java.util.UUID.randomUUID().toString();;
bom.isMain=true;
bom.sort=0;
update.bomInfo=bom;

ArrayList<BPA_GOODSRECIPE> goodsrecipes=QueryDB.GetGoodsSrecipeID(good.id);
for (BPA_GOODSRECIPE item:goodsrecipes)
{
GoodsTechnology goodsTechnology=null;
for (GoodsTechnology _find:ConfigName.getInstance().cloudData.goodsTechnology)
{
if (_find.name.equals(item.processname))
{
goodsTechnology=_find;
break;
}
}

if(goodsTechnology!=null)
{
//2.根据工序变量集合-获取变量名称和值
List<String> names=new ArrayList<>();
final HashMap<String,String> formulation=new HashMap<>();
//region 获取变量名称和值
String text=item.processvalue;
List<String> data=new ArrayList<>();
if(text.contains("|"))
{
String[] res= text.split("[|]");
for (int i=0;i<res.length;i++)
{
data.add(res[i]);
}
}else
{
data.add(text);
}
for(String item1:data)
{
if(!item1.isEmpty() && item1.contains(","))
{
String[] wl= item1.split("[,]");
if (wl != null && wl.length == 2)
{
String name=wl[0];
String val=wl[1];
names.add(name);
formulation.put(name,val);
}
}
}
//endregion

List<ActionJsonMode> actionJsonModes=new ArrayList<>();
//region 获取工艺集合
if (item.materialType==0)//物料
{
for (String f:names)
{
BatchingInfo batchingInfo=null;
for (BatchingInfo _find:ConfigName.getInstance().cloudData.batchingInfo)
{
if (_find.batching_Name.equals(f))
{
batchingInfo=_find;
break;
}
}
ActionJsonMode m=new ActionJsonMode();
m.TechnologyactionId="";//模型id
m.BatchingId=batchingInfo!=null?batchingInfo.id:"";//物料id
m.ActionName=f;
m.ActionValue=formulation.get(f);
actionJsonModes.add(m);
}
}else//模型
{
for (String f:names)
{
TechnologyAction technologyAction=null;
for (TechnologyAction _find:ConfigName.getInstance().cloudData.technologyAction)
{
if (_find.actionName.equals(f) && _find.goodstechnologyId.equals(goodsTechnology.id))
{
technologyAction=_find;
break;
}
}
ActionJsonMode m=new ActionJsonMode();
m.TechnologyactionId=technologyAction!=null?technologyAction.id:"";//模型id
m.BatchingId="";//物料id
m.ActionName=f;
m.ActionValue=formulation.get(f);
actionJsonModes.add(m);
}
}
//endregion

BomTechnologyActionInfo info=new BomTechnologyActionInfo();
info.stepName=item.processname;
info.actionJson=new Gson().toJson(actionJsonModes);
info.isBatch=(item.materialType==0?true:false);
info.chnologyId=goodsTechnology.id;//工艺名称id
info.createAt=item.createTime;
info.groupId=ConfigName.getInstance().organizeMode.companyId;
info.id=item.id;
info.isDeleted=0;
info.sort=item.sort;
update.bomTechnologyActionInfo.add(info);
}
}

if (isSuceess) {
OkGo.<ResAPI<Boolean>>post(ConfigName.getInstance().SaasAddress + ConfigName.getInstance().UpdateGoods).tag(context).upRequestBody(RequestBody.create(MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(update))).headers(new HttpHeaders("TenantId", ConfigName.getInstance().organizeMode.companyId)).execute(new JsonDialogCallback<ResAPI<Boolean>>(context) {
@Override
public void onSuccess(Response<ResAPI<Boolean>> response) {
ResAPI<Boolean> allDataResAPI = response.body();
if (allDataResAPI.data) {
ToastUtils.info("上传菜品成功!!!");
MessageManager.getInstance().sendMessage(MessageName.ScGood, "Good");
} else {
ToastUtils.warning("上传菜品失败!!!");
}
}
});
}
} else {
ToastUtils.warning("无网络,请先连接网络!!!");
}
} catch (Exception ex) {
}
}

/**
* 增加本地图片
*/


+ 2
- 63
app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java Datei anzeigen

@@ -74,7 +74,7 @@ public class ConfigName {
/**
* 设备id
*/
public String DeviceId="29318217-838a-4572-982d-51773bef6249";
public String DeviceId="未知";
//endregion

//region MQTT配置中心
@@ -199,7 +199,7 @@ public class ConfigName {
//获取店铺详细信息 Get
public String GetStore="kitchen/api/StoreHelper/GetStoreInfoById?storeId=";
//获取设备信息分页 Get
public String GetDeviceInformation="kitchen/api/Device/GetDeviceInfo?storeId=%s&autoKey=%s";
public String GetDeviceInformation="kitchen/api/CommInteface/GetDeviceInfo?storeId=%s&autoKey=%s";
//获取 获取基础信息(所有物料信息、设备工序模型、菜谱列表、商品小类、商品大类、单位数据
public String GetBaseDataModel="kitchen/api/CommInteface/GetBaseDataModel?storeId=%s&autoKey=%s";
//获取 商品
@@ -438,67 +438,6 @@ public class ConfigName {
//endregion
}



//配方信息
//{
// "statusCode": 200,
// "data": {
// "bomInfo": [
// {
// "name": "爆炒肥肠",
// "code": "10005",
// "isMain": true,
// "autoKey": 1099,
// "bomInfo": null,
// "sort": 2,
// "groupId": "4cc8935c-9519-4a3c-a2fd-b49ca54f6f0d",
// "status": 0,
// "isDeleted": 0,
// "deleteAt": null,
// "deleteBy": null,
// "updateAt": null,
// "updateBy": null,
// "createAt": "2023-07-10 16:11:41",
// "createBy": "af27ebbd-5c1a-441f-8e26-cf6cc1352349",
// "id": "5c4f80d9-13f3-4dcf-9cca-db4d37ffc9d0"
// }
// ],
// "bomTechnologyActionInfo": [
// {
// "stepName": "热油",
// "actionJson": "[{\"TechnologyactionId\":\"a82d2621-7016-4240-b5d5-7d5e41fb4d22\",\"ActionName\":\"加热功率\",\"ActionValue\":\"三档\",\"BatchingId\":\"\"},{\"TechnologyactionId\":\"df17c307-8f15-4d20-b497-61caf5668270\",\"ActionName\":\"热油(克)\",\"ActionValue\":333,\"BatchingId\":\"\"}]",
// "bomId": "5c4f80d9-13f3-4dcf-9cca-db4d37ffc9d0",
// "isBatch": false,
// "chnologyId": "f9ca0cff-ba94-4036-88f4-a5d05f8165e6",
// "createAt": "2023-07-11 17:47:28",
// "groupId": "4cc8935c-9519-4a3c-a2fd-b49ca54f6f0d",
// "isDeleted": 0,
// "sort": 6,
// "id": "7c3a5fe9-f1c6-4578-b6a8-a09006740d69"
// },
// {
// "stepName": "液体料",
// "actionJson": "[{\"TechnologyactionId\":\"10915b41-268e-4d04-b259-8e4c5f65bbda\",\"ActionName\":\"酱油\",\"ActionValue\":\"10\",\"BatchingId\":\"210f346d-8b79-4059-a991-b22391e5193f\"},{\"TechnologyactionId\":\"897bc239-ba70-4cde-bd99-c4bb14219b04\",\"ActionName\":\"盐水\",\"ActionValue\":\"20\",\"BatchingId\":\"33a529a3-de63-49c0-aed0-ea83e852050b\"}]",
// "bomId": "5c4f80d9-13f3-4dcf-9cca-db4d37ffc9d0",
// "isBatch": true,
// "chnologyId": "315b149d-53bd-4fa0-9694-bf1d47ef9ba3",
// "createAt": "2023-07-11 17:36:46",
// "groupId": "4cc8935c-9519-4a3c-a2fd-b49ca54f6f0d",
// "isDeleted": 0,
// "sort": 5,
// "id": "a9e95580-89ba-400c-a91f-53fefbabb627"
// }
// ]
// },
// "succeeded": true,
// "errors": null,
// "extras": null,
// "timestamp": 1689070602181
// }



//
//{
// "goodsInfo": {


+ 5
- 5
app/src/main/java/com/bonait/bnframework/common/model/mode/BomTechnologyActionInfo.java Datei anzeigen

@@ -4,11 +4,11 @@ public class BomTechnologyActionInfo {
public String id;
public String stepName;
public String actionJson;
public String bomId;
public boolean isBatch;
public String chnologyId;
public String createAt;
public String groupId;
public String bomId; //基础信息id
public boolean isBatch;//是否物料
public String chnologyId; //
public String createAt; //
public String groupId; //加盟商id
public int isDeleted;
public int sort;
}

+ 15
- 14
app/src/main/java/com/bonait/bnframework/common/model/mode/CloudGood.java Datei anzeigen

@@ -4,22 +4,23 @@ package com.bonait.bnframework.common.model.mode;
* 云端商品
*/
public class CloudGood {
public String goods_Name;
public String goods_TypeID;
public String goods_ImgUrl;
public int goods_Sort;
public String code;
public double price;
public String goods_Name;//商品名称
public String goods_TypeID;//商品小类id
public String goods_ImgUrl;//商品图片
public String goods_Descritption;//商品描述
public int goods_Sort;//商品排序
public String code;//编码
public double price;//0
public String tasteID;
public String parentTypeID;
public double vipPrice;
public String goodsUintId;
public boolean isWeigh;
public int autoKey;
public String parentTypeID;//商品大类id
public double vipPrice;// 0
public String goodsUintId;//单位id
public boolean isWeigh;//false
public int autoKey;//0

public String groupId;
public int status;
public int isDeleted;
public String groupId; //加盟商id
public int status;//状态0
public int isDeleted;//0
public String createAt;
public String id;
}

+ 11
- 0
app/src/main/java/com/bonait/bnframework/common/model/mode/UpdateBomInfo.java Datei anzeigen

@@ -0,0 +1,11 @@
package com.bonait.bnframework.common.model.mode;

public class UpdateBomInfo {
public String bomType;//配方分类
public String name;//名称
public String code;//编码
public boolean isMain;//配方分类
public int autoKey;//配方分类
public String bomInfo;
public int sort;//排序
}

+ 30
- 0
app/src/main/java/com/bonait/bnframework/common/model/mode/UpdateCloudGood.java Datei anzeigen

@@ -0,0 +1,30 @@
package com.bonait.bnframework.common.model.mode;

import java.util.List;

public class UpdateCloudGood {
/**
* 商品信息
*/
public CloudGood goodsInfo;

/**
* 配方基础信息
*/
public UpdateBomInfo bomInfo;

/**
* 配方详细信息
*/
public List<BomTechnologyActionInfo> bomTechnologyActionInfo;

/**
* 菜谱
*/
public String foodMenuId;

/**
* 店铺id
*/
public String storeId;
}

+ 193
- 0
app/src/main/java/com/bonait/bnframework/common/view/EditDialog.java Datei anzeigen

@@ -0,0 +1,193 @@
package com.bonait.bnframework.common.view;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.bonait.bnframework.R;

public class EditDialog extends Dialog {
private Button yes, no;//确定按钮
private TextView titleTv;//消息标题文本
private EditText et_phone;//输入电话
private String titleStr;//从外界设置的title文本
private String messageStr;//从外界设置的消息文本
//确定文本和取消文本的显示内容
private String yesStr, noStr;

private onNoOnclickListener noOnclickListener;//取消按钮被点击了的监听器
private onYesOnclickListener yesOnclickListener;//确定按钮被点击了的监听器

/**
* 设置取消按钮的显示内容和监听
*
* @param str
* @param onNoOnclickListener
*/
public void setNoOnclickListener(String str, onNoOnclickListener onNoOnclickListener) {
if (str != null) {
noStr = str;
}
this.noOnclickListener = onNoOnclickListener;
}

/**
* 设置确定按钮的显示内容和监听
*
* @param str
* @param onYesOnclickListener
*/
public void setYesOnclickListener(String str, onYesOnclickListener onYesOnclickListener) {
if (str != null) {
yesStr = str;
}
this.yesOnclickListener = onYesOnclickListener;
}

public EditDialog(Context context) {
super(context, R.style.Dialog_Msg);
}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dialog_edit);
//按空白处不能取消动画
setCanceledOnTouchOutside(false);

//初始化界面控件
initView();
//初始化界面数据
initData();
//初始化界面控件的事件
initEvent();

}

/**
* 初始化界面的确定和取消监听器
*/
private void initEvent() {
//设置确定按钮被点击后,向外界提供监听
yes.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (yesOnclickListener != null) {
yesOnclickListener.onYesClick(et_phone.getText().toString());
}
}
});

no.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (noOnclickListener != null) {
noOnclickListener.onNoClick();
}
}
});
}

/**
* 初始化界面控件的显示数据
*/
private void initData() {
//如果用户自定了title和message
if (titleStr != null) {
titleTv.setText(titleStr);
}
if (messageStr != null) {
// messageTv.setText(messageStr);
}
//如果设置按钮的文字
if (yesStr != null) {
yes.setText(yesStr);
}
}

/**
* 初始化界面控件
*/
private void initView() {
yes = (Button) findViewById(R.id.yes);
no = (Button) findViewById(R.id.no);
titleTv = (TextView) findViewById(R.id.title);
et_phone = (EditText) findViewById(R.id.et_phone);
}

/**
* 从外界Activity为Dialog设置标题
*
* @param title
*/
public void setTitle(String title) {
titleStr = title;
}

/**
* 从外界Activity为Dialog设置dialog的message
*
* @param message
*/
public void setMessage(String message) {
messageStr = message;
}

/**
* 设置确定按钮和取消被点击的接口
*/
public interface onYesOnclickListener {
public void onYesClick(String phone);
}

public interface onNoOnclickListener {
public void onNoClick();
}

@Override
public void show() {
super.show();
/**
* 设置宽度全屏,要设置在show的后面
*/
WindowManager.LayoutParams layoutParams = getWindow().getAttributes();
layoutParams.width= ViewGroup.LayoutParams.MATCH_PARENT;
layoutParams.height= ViewGroup.LayoutParams.MATCH_PARENT;
getWindow().getDecorView().setPadding(0, 0, 0, 0);
getWindow().setAttributes(layoutParams);
}
}



//点击弹出对话框
// final EditDialog editDialog = new EditDialog(getActivity());
// editDialog.setTitle("请输入电话号码");
// editDialog.setYesOnclickListener("确定", new EditDialog.onYesOnclickListener() {
//@Override
//public void onYesClick(String phone) {
// if (TextUtils.isEmpty(phone)) {
// ToastUtils.showShort(getActivity(), "请输入电话号码");
// } else {
// editors.putString("phone", phone);
// editors.commit();
// editDialog.dismiss();
// //让软键盘隐藏
// InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
// imm.hideSoftInputFromWindow(getView().getApplicationWindowToken(), 0);
// }
// }
// });
// editDialog.setNoOnclickListener("取消", new EditDialog.onNoOnclickListener() {
//@Override
//public void onNoClick() {
// editDialog.dismiss();
// }
// });
// editDialog.show();

+ 4
- 1
app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigation2Activity.java Datei anzeigen

@@ -153,9 +153,12 @@ public class BottomNavigation2Activity extends BaseActivity {
*/
public void Init()
{
//主持
ConfigData.getInstance().GetOrganize(this);
//判断连接环境
ConfigData.getInstance().ToggleEnvironment();
//2.初始化PLC
ConfigData.getInstance().ConnectPLC();
//ConfigData.getInstance().ConnectPLC();
//3.
}
}

+ 1
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/CpActivity.java Datei anzeigen

@@ -120,6 +120,7 @@ public class CpActivity extends BaseActivity {
if (msg != null) {
SectionItem item = (SectionItem) msg;
QueryDB.DeleteGoodsid(item.getAccount());
QueryDB.DeleteGoodsSrecipeList(item.getAccount());
mAdapter.setData(getList());
}
}


+ 1
- 1
app/src/main/java/com/bonait/bnframework/modules/welcome/activity/LoginActivity.java Datei anzeigen

@@ -116,7 +116,7 @@ public class LoginActivity extends BaseActivity implements Validator.ValidationL
*/
public void initData()
{
ConfigData.getInstance().GetOrganize(this);
}

@OnClick({R.id.iv_clean_account, R.id.clean_password, R.id.iv_show_pwd,R.id.forget_password, R.id.btn_login})


+ 93
- 0
app/src/main/res/layout/item/layout/dialog_edit.xml Datei anzeigen

@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#A5000000">

<LinearLayout
android:layout_width="260dp"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@drawable/common_bg_with_radius_and_border"
android:orientation="vertical">

<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="15dp"
android:gravity="center"
android:text="标题"
android:textColor="@color/black" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>

</LinearLayout>
<Spinner
android:id="@+id/editsp_PF"
style="@style/commonSpinnerStyle"
android:layout_width="match_parent"
android:layout_height="24dp"
android:layout_centerVertical="true"/>
<EditText
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:id="@+id/et_phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:background="@drawable/input_bj"
android:hint="请输入物料名称"
android:inputType="text"
android:maxLines="1"
android:padding="3dp"
android:textSize="12dp" />

<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginTop="15dp"
android:background="#E4E4E4" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:orientation="horizontal">

<Button
android:id="@+id/no"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@null"
android:gravity="center"
android:singleLine="true"
android:text="取消"
android:textColor="@color/colorPrimary"
/>

<View
android:layout_width="1px"
android:layout_height="match_parent"
android:background="#E4E4E4" />

<Button
android:id="@+id/yes"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@null"
android:gravity="center"
android:singleLine="true"
android:text="确 定"
android:textColor="@color/red_primary"
/>

</LinearLayout>
</LinearLayout>

</RelativeLayout>

+ 14
- 0
app/src/main/res/values/styles.xml Datei anzeigen

@@ -2,6 +2,7 @@

<!-- Base application theme. -->
<style name="AppTheme" parent="QMUI.Compat.NoActionBar">
<!--自定义dialog背景全透明无边框theme -->

<!-- <style name="MyEditText1" parent="Theme.AppCompat.Light">-->
<!-- <item name="colorControlNormal">@color/borderBrush</item>-->
@@ -212,4 +213,17 @@
<item name="android:layout_marginLeft">5dp</item>
<item name="android:textColor">@color/black</item>
</style>

<style name="Dialog_Msg" parent="android:style/Theme.Dialog">
<!--背景颜色及和透明程度-->
<item name="android:windowBackground">@android:color/transparent</item>
<!--是否去除标题 -->
<item name="android:windowNoTitle">true</item>
<!--是否去除边框-->
<item name="android:windowFrame">@null</item>
<!--是否浮现在activity之上-->
<item name="android:windowIsFloating">true</item>
<!--是否模糊-->
<item name="android:backgroundDimEnabled">false</item>
</style>
</resources>

Laden…
Abbrechen
Speichern