@@ -4,10 +4,10 @@ | |||
<selectionStates> | |||
<SelectionState runConfigName="app"> | |||
<option name="selectionMode" value="DROPDOWN" /> | |||
<DropdownSelection timestamp="2024-05-22T07:59:43.045904500Z"> | |||
<DropdownSelection timestamp="2024-05-23T08:15:27.830482400Z"> | |||
<Target type="DEFAULT_BOOT"> | |||
<handle> | |||
<DeviceId pluginId="Default" identifier="serial=10.24.61.124:5555;connection=6b1ed6f6" /> | |||
<DeviceId pluginId="Default" identifier="serial=127.0.0.1:7555;connection=b7a867da" /> | |||
</handle> | |||
</Target> | |||
</DropdownSelection> | |||
@@ -63,7 +63,7 @@ android { | |||
} | |||
applicationVariants.all { variant -> | |||
variant.outputs.all { | |||
outputFileName = "boluobatai-v${defaultConfig.versionCode}-${releaseTime()}"+"-unsigned-${variant.name}.apk" | |||
outputFileName = "boluo-peiliaobatai-v${defaultConfig.versionCode}-${releaseTime()}"+"-unsigned-${variant.name}.apk" | |||
} | |||
} | |||
} | |||
@@ -89,7 +89,7 @@ public class Unity { | |||
{ | |||
MessageLog.ShowInfo("AnalogConvert measureCookTime InputValue="+InputValue+" InputMax="+InputMax+";InputMin="+InputMin+";OutMax="+OutMax+";OutMin="+OutMin); | |||
if(InputValue<=0|| InputMax<=0||InputMin<=0){ | |||
if(InputValue<=0|| InputMax<=0){ | |||
return 0; | |||
} | |||
if(((InputMax - InputMin) + OutMin)==0){ | |||
@@ -164,7 +164,7 @@ public class APIService { | |||
bpa_goods.status=1; | |||
bpa_goods.issc=1; | |||
bpa_goods.maketime=180; | |||
bpa_goods.url=""; | |||
bpa_goods.url=item.goodsInfoList.get(i).imgUrl==null?"":item.goodsInfoList.get(i).imgUrl; | |||
bpa_goods.sort= i+1; | |||
bpa_goods.foreignKeyRe=""; | |||
QueryDB.AddGoods(bpa_goods); | |||
@@ -14,6 +14,11 @@ public class GoodsInfoList { | |||
*/ | |||
public String goodsName; | |||
/** | |||
* 商品图片 | |||
*/ | |||
public String imgUrl; | |||
/** | |||
* 商品工艺列表 | |||
*/ | |||
@@ -1,6 +1,7 @@ | |||
package com.bonait.bnframework.business; | |||
import android.content.Context; | |||
import android.content.SharedPreferences; | |||
import android.graphics.Bitmap; | |||
import android.graphics.BitmapFactory; | |||
import android.os.Handler; | |||
@@ -879,17 +880,22 @@ public class ConfigData { | |||
* 增加本地图片 | |||
*/ | |||
public void AddImage(Context context) { | |||
BitmapFactory.Options options = new BitmapFactory.Options(); | |||
//options.inSampleSize = 2;//宽高压缩为原来的1/2 | |||
//options.inPreferredConfig=Bitmap.Config.ARGB_4444; | |||
Bitmap bitmap1 = BitmapFactory.decodeResource(context.getResources(), R.mipmap.image1, options); | |||
Bitmap bitmap2 = BitmapFactory.decodeResource(context.getResources(), R.mipmap.image2, options); | |||
Bitmap bitmap3 = BitmapFactory.decodeResource(context.getResources(), R.mipmap.image3, options); | |||
Bitmap bitmap4 = BitmapFactory.decodeResource(context.getResources(), R.mipmap.image4, options); | |||
LocalCacheUtils.Get().setBitmapToLocal("image1.png", bitmap1); | |||
LocalCacheUtils.Get().setBitmapToLocal("image2.png", bitmap2); | |||
LocalCacheUtils.Get().setBitmapToLocal("image3.png", bitmap3); | |||
LocalCacheUtils.Get().setBitmapToLocal("image4.png", bitmap4); | |||
if(ConfigUtil.read(context,"fisrtLoadPic",true)){ | |||
BitmapFactory.Options options = new BitmapFactory.Options(); | |||
//options.inSampleSize = 2;//宽高压缩为原来的1/2 | |||
//options.inPreferredConfig=Bitmap.Config.ARGB_4444; | |||
Bitmap bitmap1 = BitmapFactory.decodeResource(context.getResources(), R.mipmap.image1, options); | |||
Bitmap bitmap2 = BitmapFactory.decodeResource(context.getResources(), R.mipmap.image2, options); | |||
Bitmap bitmap3 = BitmapFactory.decodeResource(context.getResources(), R.mipmap.image3, options); | |||
Bitmap bitmap4 = BitmapFactory.decodeResource(context.getResources(), R.mipmap.image4, options); | |||
Bitmap bitmap5 = BitmapFactory.decodeResource(context.getResources(), R.mipmap.image5, options); | |||
LocalCacheUtils.Get().setBitmapToLocal("image1.png", bitmap1); | |||
LocalCacheUtils.Get().setBitmapToLocal("image2.png", bitmap2); | |||
LocalCacheUtils.Get().setBitmapToLocal("image3.png", bitmap3); | |||
LocalCacheUtils.Get().setBitmapToLocal("image4.png", bitmap4); | |||
LocalCacheUtils.Get().setBitmapToLocal("image5.png", bitmap5); | |||
} | |||
ConfigUtil.write(context,"fisrtLoadPic",false); | |||
} | |||
/** | |||
@@ -408,6 +408,7 @@ public class ExecuteTheRecipe { | |||
int count = 0; | |||
boolean isError = false; | |||
MainInit.initToastString(); | |||
for (LinkedHashMap.Entry<Integer, List<ResGoodsRecipe>> entry : rgrs.entrySet()) { | |||
WritePLC("配料完成", false,null); | |||
@@ -424,7 +425,7 @@ public class ExecuteTheRecipe { | |||
DataBus.getInstance().UpdateGoodsMake(GoodMake.subOrder.id, "步骤【" + key + "】准备下发物料:" + RecipesNames, count, key, false); | |||
//等待配料完成,一直等待 | |||
final boolean[] IsComplete = {false}; | |||
float outValue=0; | |||
float outValue; | |||
for (int m = 0; m < goodsRecipes.size(); m++) { | |||
ResGoodsRecipe recipe = goodsRecipes.get(m); | |||
LogUtils.d("商品制作线程 recipe = "+recipe); | |||
@@ -440,7 +441,7 @@ public class ExecuteTheRecipe { | |||
} | |||
//等待配料完成,一直等待 | |||
if (silos == null) { | |||
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, message + "下发失败!物料没有管理料仓!"); | |||
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, message + "下发失败!物料没有绑定料仓!"); | |||
Thread.sleep(2000); | |||
IsComplete[0] = true; | |||
isError = true; | |||
@@ -487,17 +488,17 @@ public class ExecuteTheRecipe { | |||
}; | |||
//启动配料 | |||
float finalOutValue = outValue; | |||
// float finalOutValue = outValue; | |||
WritePLC("配料启动",true,new IWriteCallBack() { | |||
@Override | |||
public void onSuccess() { | |||
MessageLog.ShowInfo("[" + GoodMake.good.name + "]步骤【" + key + "】启动配料成功!"); | |||
try { | |||
Thread.sleep((long) (finalOutValue *1000L)); | |||
} catch (InterruptedException e) { | |||
throw new RuntimeException(e); | |||
} | |||
IsComplete[0] = true; | |||
// try { | |||
// Thread.sleep((long) (finalOutValue *1000L)); | |||
// } catch (InterruptedException e) { | |||
// throw new RuntimeException(e); | |||
// } | |||
// IsComplete[0] = true; | |||
} | |||
@Override | |||
@@ -532,6 +533,7 @@ public class ExecuteTheRecipe { | |||
GoodMake=null; | |||
IsMakeGood=false; | |||
MainInit.initToastString(); | |||
} | |||
} catch (Exception ex) { | |||
ToastUtils.error("异常信息:" + ex.getMessage()); | |||
@@ -997,8 +999,15 @@ public class ExecuteTheRecipe { | |||
// } | |||
if(ListeningValue.containsKey(name)){ | |||
boolean res = Boolean.parseBoolean(ListeningValue.get(name).toString()); | |||
RTrig.get(name).Start(res,()->{if(callback!=null)callback.Run();}); | |||
if(name.equals("配料完成")){ | |||
boolean res = Boolean.parseBoolean(ListeningValue.get(name).toString()); | |||
RTrig.get(name).Start(res,()->{if(callback!=null)callback.Run();}); | |||
}else { | |||
boolean res = Boolean.parseBoolean(ListeningValue.get(name).toString()); | |||
if(res){ | |||
if(callback!=null)callback.Run(); | |||
} | |||
} | |||
} | |||
} | |||
@@ -3,6 +3,7 @@ package com.bonait.bnframework.business; | |||
import android.app.Activity; | |||
import android.app.Application; | |||
import android.util.Log; | |||
import android.widget.Toast; | |||
import com.bonait.bnframework.BuildConfig; | |||
import com.bonait.bnframework.HttpModel.APIService; | |||
@@ -200,10 +201,17 @@ public class MainInit { | |||
// DBHelper.getInstance(this).DeleteCreateTables(BPA_PLCADDRESS.class,null); | |||
} | |||
public static StringBuffer toastString = new StringBuffer(); | |||
public static void initToastString(){ | |||
toastString.setLength(0); | |||
} | |||
/** | |||
* 初始化消息日志接收打印 | |||
*/ | |||
public static void InitMsgLog(){ | |||
initToastString(); | |||
MessageLog.MsgNotify = new IMessageLogNotify() { | |||
@Override | |||
public void ErrorMsg(String msg) { | |||
@@ -232,7 +240,8 @@ public class MainInit { | |||
public void UserMsg(UserLogEnum type, String msg) { | |||
BPA_LOG log = new BPA_LOG(); | |||
log.userID = ConfigName.getInstance().user.userID; | |||
ToastUtils.info(msg); | |||
toastString.append(msg).append("|"); | |||
ToastUtils.info(toastString.subSequence(0,toastString.length()-1).toString(), Toast.LENGTH_LONG); | |||
switch (type.toString()) | |||
{ | |||
case "登录日志":log.type=1; | |||
@@ -47,7 +47,7 @@ import java.util.concurrent.ConcurrentHashMap; | |||
*/ | |||
public class ConfigName { | |||
public static final boolean TEST = true; | |||
public static final boolean TEST2 = false; | |||
public static final boolean TEST2 = true; | |||
//region 单例模式 | |||
private static ConfigName mInstance; //实例变量设置私有,防止直接通过类名访问 | |||
@@ -64,6 +64,17 @@ public class DataBus { | |||
//endregion | |||
//region 数据中心 | |||
public long lastTimeClick; | |||
public boolean doubleClick(){ | |||
long currentTime = System.currentTimeMillis(); | |||
if(currentTime - lastTimeClick < 350){ | |||
return true; | |||
} | |||
lastTimeClick = currentTime; | |||
return false; | |||
} | |||
/** | |||
* 料仓数据 | |||
*/ | |||
@@ -2,12 +2,14 @@ package com.bonait.bnframework.common.glide; | |||
import android.content.Context; | |||
import android.graphics.drawable.Drawable; | |||
import android.os.Environment; | |||
import android.view.View; | |||
import android.widget.ImageView; | |||
import androidx.annotation.Nullable; | |||
import com.bonait.bnframework.common.glide.transform.FitXYRoundRadiusTransform; | |||
import com.bonait.bnframework.modules.home.fragment.from.ImageSourceActivity; | |||
import com.bumptech.glide.load.DataSource; | |||
import com.bumptech.glide.load.engine.GlideException; | |||
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions; | |||
@@ -53,6 +55,9 @@ public class GlideUtil { | |||
if (context == null||path==null) { | |||
return; | |||
} | |||
if(!path.startsWith("http")){ | |||
path = Environment.getExternalStorageDirectory().getAbsolutePath()+"/hblchayingdb/WebImage/" + path; | |||
} | |||
GlideApp.with(context) | |||
.load(path) | |||
.addListener(new RequestListener<Drawable>() { | |||
@@ -41,7 +41,7 @@ public class MyBitmapUtils { | |||
//本地缓存 | |||
if(url!=null && !url.isEmpty()) | |||
{ | |||
if(LocalCacheUtils.Get().SetBitmapFile(ivPic,name)){ | |||
if(LocalCacheUtils.Get().SetBitmapFile(ivPic,name,url)){ | |||
return; | |||
} | |||
@@ -12,9 +12,13 @@ import android.view.View; | |||
import android.widget.ImageView; | |||
import android.os.Process; | |||
import com.apkfuns.logutils.LogUtils; | |||
import com.bonait.bnframework.HBL.NetworkUtils; | |||
import com.bonait.bnframework.MainApplication; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.OrderServer; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.glide.transform.FitXYRoundRadiusTransform; | |||
import com.bumptech.glide.Glide; | |||
import com.bumptech.glide.load.engine.DiskCacheStrategy; | |||
import com.bumptech.glide.request.RequestOptions; | |||
@@ -54,23 +58,31 @@ public class LocalCacheUtils { | |||
* 设置Image图片 | |||
* | |||
* @param ivPic | |||
* @param name | |||
* @param url | |||
* @return | |||
*/ | |||
public boolean SetBitmapFile(ImageView ivPic, String url) { | |||
File file = new File(CACHE_PATH, url); | |||
public boolean SetBitmapFile(ImageView ivPic, String name,String url) { | |||
File file = new File(CACHE_PATH, name); | |||
String imgUrl = null; | |||
if(url!=null && url.startsWith("http")){ | |||
if(NetworkUtils.isNetworkConnected(MainApplication.getContext())){ | |||
imgUrl = url; | |||
} | |||
} | |||
if (null != file && file.exists()) { | |||
try { | |||
Glide.with(ivPic.getContext()).load(file) | |||
LogUtils.d("加载图片"); | |||
Glide.with(ivPic.getContext()).load(imgUrl==null?file:imgUrl) | |||
//.override(width, height) | |||
// .thumbnail(0.1f) // 加载原始图片的10%作为缩略图 | |||
//.fitCenter() // 缩放图片以适应ImageView的尺寸 | |||
.override(150, 75) // 设置目标图片的宽度和高度 | |||
.fitCenter() // 缩放图片以适应ImageView的尺寸 | |||
// .override(150, 75) // 设置目标图片的宽度和高度 | |||
.placeholder(R.mipmap.loading2) | |||
// .error(R.mipmap.loadingerror) | |||
.skipMemoryCache(true) // 禁用内存缓存 | |||
.diskCacheStrategy(DiskCacheStrategy.NONE) | |||
.apply(new RequestOptions().transform(new FitXYRoundRadiusTransform(10))) | |||
//.diskCacheStrategy(DiskCacheStrategy.ALL) // 缓存所有版本的图片 | |||
.into(ivPic); | |||
System.out.println("从本地获取图片啦....."); | |||
@@ -79,7 +79,7 @@ public class NetCacheUtils { | |||
String filename= LocalCacheUtils.Get().setBitmapToLocal(url, result); | |||
//设置图片显示,用新版的获取更小的资源 | |||
LocalCacheUtils.Get().SetBitmapFile(ivPic,filename); | |||
LocalCacheUtils.Get().SetBitmapFile(ivPic,filename,null); | |||
} | |||
} | |||
} | |||
@@ -225,6 +225,28 @@ public class ToastUtils { | |||
@CheckResult | |||
public static Toast custom(@NonNull Context context, @NonNull String message, Drawable icon, @ColorInt int textColor, @ColorInt int tintColor, int duration, boolean withIcon, boolean shouldTint) { | |||
StringBuilder toastMes = new StringBuilder(); | |||
if(message.contains("|")){ | |||
String[] res = message.split("\\|"); | |||
if(res.length>0 && res.length<3){ | |||
for (int i = 0;i < res.length;i++){ | |||
toastMes.append(res[i]); | |||
if(i!=res.length-1){ | |||
toastMes.append("\n"); | |||
} | |||
} | |||
}else if(res.length>=3){ | |||
for (int i = res.length-3;i < res.length;i++){ | |||
toastMes.append(res[i]); | |||
if(i!=res.length-1){ | |||
toastMes.append("\n"); | |||
} | |||
} | |||
} | |||
} | |||
if(toastMes.length()==0){ | |||
toastMes.append(message); | |||
} | |||
if (Looper.myLooper() == Looper.getMainLooper()) { | |||
if (currentToast == null) { | |||
currentToast = new Toast(context); | |||
@@ -251,7 +273,7 @@ public class ToastUtils { | |||
} | |||
toastTextView.setTextColor(textColor); | |||
toastTextView.setText(message); | |||
toastTextView.setText(toastMes.toString()); | |||
toastTextView.setTypeface(Typeface.create(TOAST_TYPEFACE, Typeface.NORMAL)); | |||
currentToast.setView(toastLayout); | |||
@@ -292,7 +314,7 @@ public class ToastUtils { | |||
} | |||
toastTextView.setTextColor(textColor); | |||
toastTextView.setText(message); | |||
toastTextView.setText(toastMes.toString()); | |||
toastTextView.setTypeface(Typeface.create(TOAST_TYPEFACE, Typeface.NORMAL)); | |||
currentToastThread.setView(toastLayout); | |||
@@ -8,6 +8,7 @@ import android.os.Message; | |||
import androidx.core.content.FileProvider; | |||
import com.apkfuns.logutils.LogUtils; | |||
import com.bonait.bnframework.business.ConfigData; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.constant.Constants; | |||
@@ -93,21 +94,19 @@ public class UpdateAppUtils { | |||
if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台")) | |||
{ | |||
mode.productCode="1679307017135329280"; | |||
mode.moduleCode="newncapp"; | |||
mode.serverCode="1680767784879656960";//服务器 | |||
mode.branchCode="1712279450412756993"; | |||
}else | |||
{ | |||
// mode.productCode="1679307017135329280"; | |||
// mode.moduleCode="newtwbt"; | |||
// mode.moduleCode="newncapp"; | |||
// mode.serverCode="1680767784879656960";//服务器 | |||
// mode.branchCode="1712279534630187009"; | |||
// mode.branchCode="1712279450412756993"; | |||
mode.productCode="1769564215952125952"; | |||
mode.moduleCode="desktopplbt"; | |||
mode.serverCode="1769564338190921728";//服务器 | |||
mode.branchCode="1789857238682284033"; | |||
}else { | |||
mode.productCode = "1679307017135329280"; | |||
mode.moduleCode = "newtwbt"; | |||
mode.serverCode = "1680767784879656960";//服务器 | |||
mode.branchCode = "1712279534630187009"; | |||
} | |||
//调味吧台 | |||
@@ -115,6 +114,7 @@ public class UpdateAppUtils { | |||
String getNewVersionUrl =ConfigName.getInstance().UpdateVersion; | |||
MediaType JSON = MediaType.parse("application/json; charset=utf-8"); | |||
RequestBody body = RequestBody.create(JSON, String.valueOf(msg)); | |||
LogUtils.d("版本更新 UpdateVersion="+getNewVersionUrl+" ;msg = "+msg); | |||
OkGo.<ResVersion>post(getNewVersionUrl) | |||
.tag(context) | |||
.upRequestBody(body) | |||
@@ -1,5 +1,6 @@ | |||
package com.bonait.bnframework.modules.home.adapter; | |||
import android.annotation.SuppressLint; | |||
import android.app.Activity; | |||
import android.content.Context; | |||
import android.content.ContextWrapper; | |||
@@ -12,6 +13,7 @@ import android.widget.RelativeLayout; | |||
import androidx.annotation.NonNull; | |||
import androidx.recyclerview.widget.RecyclerView; | |||
import com.apkfuns.logutils.LogUtils; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.constant.DataBus; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODS; | |||
@@ -66,13 +68,14 @@ public class image_sp_adapter extends RecyclerView.Adapter<RecyclerView.ViewHold | |||
((MyLCViewHolder1)holder).img.setImageDrawable(null); | |||
} | |||
@Override | |||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { | |||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, @SuppressLint("RecyclerView") int position) { | |||
try { | |||
if (holder instanceof MyLCViewHolder1) { | |||
MyLCViewHolder1 myViewHolder = (MyLCViewHolder1) holder; | |||
//设置图片 | |||
// new MyBitmapUtils().disPlay(myViewHolder.img,goods.get(position).url); | |||
GlideUtil.showImage(myViewHolder.img.getContext(),goods.get(position).url,myViewHolder.img,R.mipmap.loading3); | |||
new MyBitmapUtils().disPlay(myViewHolder.img,goods.get(position).url); | |||
// GlideUtil.showImageWithRadius(myViewHolder.img.getContext(),goods.get(position).url,myViewHolder.img,R.mipmap.loading3,10); | |||
LogUtils.d(" 图片地址 goods.get(position).url="+goods.get(position).url); | |||
myViewHolder.img.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
@@ -110,24 +110,27 @@ public class loadinggood_adapter extends RecyclerView.Adapter<RecyclerView.ViewH | |||
myViewHolder.loading_main.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
if(mListener!=null) mListener.clickListener(view,goodsMake); | |||
if(!DataBus.getInstance().doubleClick()){ | |||
if(mListener!=null) mListener.clickListener(view,goodsMake); | |||
} | |||
} | |||
}); | |||
myViewHolder.quxiaozhizuo.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
String title = "温馨提示!"; | |||
String message = "客官确定要取消制作【"+goodsMake.good.name+"】吗?"; | |||
AlertDialogUtils.showDialog( myViewHolder.quxiaozhizuo.getContext(), title, message, new QMUIDialogAction.ActionListener() { | |||
@Override | |||
public void onClick(QMUIDialog dialog, int index) { | |||
DataBus.getInstance().cancelGoodsMake(goodsMake.subOrder.id); | |||
ToastUtils.info("取消订单制作成功!"); | |||
dialog.dismiss(); | |||
} | |||
}); | |||
if(!DataBus.getInstance().doubleClick()){ | |||
String title = "温馨提示!"; | |||
String message = "客官确定要取消制作【"+goodsMake.good.name+"】吗?"; | |||
AlertDialogUtils.showDialog( myViewHolder.quxiaozhizuo.getContext(), title, message, new QMUIDialogAction.ActionListener() { | |||
@Override | |||
public void onClick(QMUIDialog dialog, int index) { | |||
DataBus.getInstance().cancelGoodsMake(goodsMake.subOrder.id); | |||
ToastUtils.info("取消订单制作成功!"); | |||
dialog.dismiss(); | |||
} | |||
}); | |||
} | |||
} | |||
}); | |||
} | |||
@@ -80,8 +80,8 @@ public class newgood_adapter extends RecyclerView.Adapter<RecyclerView.ViewHolde | |||
myViewHolder.Tag_text.setText(goods.name); | |||
//设置图片 | |||
if (!goods.url.equals("未知") && !goods.url.isEmpty() && !goods.url.equals("")) { | |||
// myBitmapUtils.disPlay(myViewHolder.ImageUrl, goods.url); | |||
GlideUtil.showImage(myViewHolder.ImageUrl.getContext(),goods.url,myViewHolder.ImageUrl,R.mipmap.loading3); | |||
myBitmapUtils.disPlay(myViewHolder.ImageUrl, goods.url); | |||
// GlideUtil.showImageWithRadius(myViewHolder.ImageUrl.getContext(),goods.url,myViewHolder.ImageUrl,R.mipmap.loading3,10); | |||
} | |||
/** | |||
@@ -14,6 +14,7 @@ import androidx.recyclerview.widget.RecyclerView; | |||
import com.apkfuns.logutils.LogUtils; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.constant.DataBus; | |||
import com.bonait.bnframework.common.constant.MessageName; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODS; | |||
@@ -70,9 +71,9 @@ public class newmakegood_adapter extends RecyclerView.Adapter<RecyclerView.View | |||
myViewHolder.Tag_text.setText(goods.name); | |||
//设置图片 | |||
if (goods.url!=null && !goods.url.equals("未知") && !goods.url.isEmpty()) { | |||
// myBitmapUtils.disPlay(myViewHolder.ImageUrl, goods.url); | |||
myBitmapUtils.disPlay(myViewHolder.ImageUrl, goods.url); | |||
LogUtils.d(" ImageUrl == "+goods.url); | |||
GlideUtil.showImage(myViewHolder.ImageUrl.getContext(),goods.url,myViewHolder.ImageUrl,R.mipmap.loading3); | |||
// GlideUtil.showImageWithRadius(myViewHolder.ImageUrl.getContext(),goods.url,myViewHolder.ImageUrl,R.mipmap.loading3,10); | |||
} | |||
/** | |||
@@ -81,11 +82,13 @@ public class newmakegood_adapter extends RecyclerView.Adapter<RecyclerView.View | |||
myViewHolder.ImageUrl.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
LogUtils.d(" MessageName.ClickMakeGoodNew sendMessage"); | |||
if(goods!=null){ | |||
LogUtils.d(" goods="+goods.toString()); | |||
if(!DataBus.getInstance().doubleClick()){ | |||
LogUtils.d(" MessageName.ClickMakeGoodNew sendMessage"); | |||
if(goods!=null){ | |||
LogUtils.d(" goods="+goods.toString()); | |||
} | |||
MessageManager.getInstance().sendMessage(MessageName.ClickMakeGoodNew,goods); | |||
} | |||
MessageManager.getInstance().sendMessage(MessageName.ClickMakeGoodNew,goods); | |||
} | |||
}); | |||
@@ -465,9 +465,9 @@ public class MakeGoodFragment extends BaseFragment { | |||
ExecuteTheRecipe.WritePLC("手自切换", true, null); | |||
} | |||
}).start(); | |||
ToastUtils.warning("商品:" + makegood.good.name + ",开始制作",Toast.LENGTH_SHORT); | |||
ExecuteTheRecipe.Execute(makegood); | |||
LogUtils.d(" 商品开始制作 makegood = "+makegood.toString()); | |||
ToastUtils.warning("商品:" + makegood.good.name + ",开始制作"); | |||
} | |||
/** | |||
@@ -492,7 +492,6 @@ public class MakeGoodFragment extends BaseFragment { | |||
LogUtils.d(" MessageName.ClickMakeGoodNew onMessage"); | |||
if (msg != null) { | |||
BPA_GOODS goods = (BPA_GOODS) msg; | |||
add_makegood.SetData(goods); | |||
add_makegood.setVisibility(View.VISIBLE); | |||
} | |||
@@ -2,6 +2,7 @@ package com.bonait.bnframework.modules.home.fragment.from; | |||
import androidx.appcompat.app.AppCompatActivity; | |||
import androidx.appcompat.widget.SearchView; | |||
import androidx.recyclerview.widget.GridLayoutManager; | |||
import androidx.recyclerview.widget.RecyclerView; | |||
import android.os.Bundle; | |||
@@ -39,7 +40,7 @@ public class ImageChooseActivity extends BaseActivity { | |||
QMUITopBarLayout mTopBar;//顶部标题 | |||
@BindView(R.id.recycler_view) | |||
RecyclerView recyclerView;//image列表 | |||
private static final String CACHE_PATH= Environment.getExternalStorageDirectory().getAbsolutePath()+"/hblchayingdb/WebImage"; | |||
public static final String CACHE_PATH= Environment.getExternalStorageDirectory().getAbsolutePath()+"/hblchayingdb/WebImage"; | |||
List<image_sp> data =new ArrayList<>(); | |||
@Override | |||
protected void onCreate(Bundle savedInstanceState) { | |||
@@ -71,9 +72,9 @@ public class ImageChooseActivity extends BaseActivity { | |||
s.url=fileName; | |||
data.add(s); | |||
} | |||
MyLayoutManager layout = new MyLayoutManager(); | |||
layout.setAutoMeasureEnabled(true); | |||
recyclerView.setLayoutManager(layout); | |||
// GridLayoutManager layout = new GridLayoutManager(); | |||
// layout.setAutoMeasureEnabled(true); | |||
// recyclerView.setLayoutManager(layout); | |||
image_sp_adapter spadapter = new image_sp_adapter(this,data); | |||
recyclerView.setAdapter(spadapter); | |||
spadapter.mListener=new MyClickListener() { | |||
@@ -18,6 +18,7 @@ import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.Button; | |||
import com.apkfuns.logutils.LogUtils; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseActivity; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
@@ -35,6 +36,7 @@ import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import java.io.File; | |||
import java.io.FileInputStream; | |||
import java.text.DecimalFormat; | |||
import java.util.ArrayList; | |||
import butterknife.BindView; | |||
@@ -53,6 +55,8 @@ public class ImageSourceActivity extends BaseActivity { | |||
RecyclerView rl_yx_file; | |||
@BindView(R.id.baocunbendi) | |||
Button baocunbendi; | |||
@BindView(R.id.delete_all) | |||
Button delete_all; | |||
@Override | |||
protected void onCreate(Bundle savedInstanceState) { | |||
super.onCreate(savedInstanceState); | |||
@@ -69,8 +73,13 @@ public class ImageSourceActivity extends BaseActivity { | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
finish(); } | |||
finish(); | |||
} | |||
}); | |||
String cacheSize = getCacheSize(); | |||
if(!cacheSize.isEmpty()){ | |||
delete_all.setText("已缓存:"+getCacheSize()+"\n删除所有缓存图片"); | |||
} | |||
} | |||
/** | |||
* viewPager里添加fragment | |||
@@ -79,13 +88,29 @@ public class ImageSourceActivity extends BaseActivity { | |||
} | |||
@OnClick({R.id.xuanzhewenjian, R.id.baocunbendi}) | |||
@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(context, FileActivity.class); | |||
startActivityForResult(intent, Constants.REQ_CODE); | |||
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(rl_yx_file!=null&& rl_yx_file.getAdapter()!=null){ | |||
rl_yx_file.getAdapter().notifyDataSetChanged(); | |||
} | |||
} | |||
break; | |||
case R.id.baocunbendi://保存按钮 | |||
for (FileEntity item : PickerManager.getInstance().files) { | |||
File file = item.getFile(); | |||
@@ -102,7 +127,7 @@ public class ImageSourceActivity extends BaseActivity { | |||
} | |||
ArrayList<FileEntity> yx_files = new ArrayList<>(); | |||
private static final String CACHE_PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + "/hblchayingdb/WebImage"; | |||
public static final String CACHE_PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + "/hblchayingdb/WebImage"; | |||
public void FlushedImage() { | |||
File path = new File(CACHE_PATH);// 获得路径 | |||
@@ -178,6 +203,41 @@ public class ImageSourceActivity extends BaseActivity { | |||
//-------------------------配置viewPager与fragment关联----------------------------// | |||
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]; | |||
} | |||
@Override | |||
public void onDestroy() { | |||
super.onDestroy(); | |||
@@ -336,8 +336,8 @@ public class add_good_control extends LinearLayout { | |||
{ | |||
edittext.setText(Data.name); | |||
edittext1.setText(Data.foreignKeyRe); | |||
// new MyBitmapUtils().disPlay(cpfm,Data.url); | |||
GlideUtil.showImage(cpfm.getContext(),url,cpfm,R.mipmap.loading3); | |||
new MyBitmapUtils().disPlay(cpfm,Data.url); | |||
// GlideUtil.showImageWithRadius(cpfm.getContext(),url,cpfm,R.mipmap.loading3,10); | |||
url=Data.url; | |||
int index=0; | |||
for (Map.Entry<String, String> entry : map_fl.entrySet()) { | |||
@@ -353,8 +353,8 @@ public class add_good_control extends LinearLayout { | |||
{ | |||
edittext.setText(""); | |||
edittext1.setText(""); | |||
// new MyBitmapUtils().disPlay(cpfm,""); | |||
GlideUtil.showImage(cpfm.getContext(),"",cpfm,R.mipmap.loading3); | |||
new MyBitmapUtils().disPlay(cpfm,""); | |||
// GlideUtil.showImageWithRadius(cpfm.getContext(),"",cpfm,R.mipmap.loading3,10); | |||
url=""; | |||
} | |||
@@ -148,9 +148,10 @@ public class add_makegood_control extends LinearLayout{ | |||
quzhizuo.setOnClickListener(new OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
if (mListener != null && SaveData()) { | |||
mListener.clickListenerNew(view, 1, null); | |||
if(!DataBus.getInstance().doubleClick()) { | |||
if (mListener != null && SaveData()) { | |||
mListener.clickListenerNew(view, 1, null); | |||
} | |||
} | |||
} | |||
}); | |||
@@ -98,6 +98,7 @@ public class UserActivity extends BaseActivity implements MyClickListener { | |||
bpa_user.name = text.toString(); | |||
bpa_user.account = text.toString(); | |||
bpa_user.pass = "123456"; | |||
bpa_user.exp = ""; | |||
bpa_user.deviceID = ConfigName.getInstance().DeviceId; | |||
bpa_user.userID = ConfigName.getInstance().user.userID;//更改为,用户权限 // 一般用户 研发用户 超级管理员 | |||
QueryDB.AddUser(bpa_user); | |||
@@ -24,6 +24,7 @@ import android.widget.RelativeLayout; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ConfigData; | |||
import com.bonait.bnframework.business.MainInit; | |||
import com.bonait.bnframework.common.base.BaseActivity; | |||
import com.bonait.bnframework.common.bg.SnowView; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
@@ -213,6 +214,7 @@ public class LoginActivity extends BaseActivity implements Validator.ValidationL | |||
BPA_USER user= QueryDB.UserLogin(userAccount,password); | |||
if(user!=null) | |||
{ | |||
MainInit.initToastString(); | |||
MessageLog.ShowUserMessage(UserLogEnum.登录日志,user.name+"-登录成功"); | |||
ConfigName.getInstance().user=user; | |||
ConfigData.getInstance().SavePZ(); | |||
@@ -41,7 +41,12 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="设备编号:" /> | |||
android:text="设备编号:" | |||
android:focusable="true" | |||
android:focusableInTouchMode="true" | |||
> | |||
<requestFocus/> | |||
</com.qmuiteam.qmui.widget.textview.QMUILinkTextView> | |||
<EditText | |||
android:id="@+id/edittext1" | |||
@@ -25,7 +25,11 @@ | |||
android:id="@+id/miaoshu" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/main_background"> | |||
android:background="@color/main_background" | |||
android:focusableInTouchMode="true" | |||
android:focusable="true" | |||
> | |||
<requestFocus/> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
@@ -8,21 +8,21 @@ | |||
android:orientation="vertical" | |||
android:background="@color/app_color_blue" | |||
android:fitsSystemWindows="true"> | |||
<ScrollView | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginTop="?attr/qmui_topbar_height" | |||
android:background="@color/activity_background"> | |||
<RelativeLayout | |||
android:background="@color/activity_background" | |||
android:layout_height="match_parent"> | |||
<androidx.recyclerview.widget.RecyclerView | |||
android:id="@+id/recycler_view" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<androidx.recyclerview.widget.RecyclerView | |||
android:id="@+id/recycler_view" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"/> | |||
</RelativeLayout> | |||
</ScrollView> | |||
android:layout_height="wrap_content" | |||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" | |||
android:orientation="vertical" | |||
app:spanCount="3" | |||
/> | |||
</RelativeLayout> | |||
<com.qmuiteam.qmui.widget.QMUITopBarLayout | |||
android:id="@+id/topbar" | |||
@@ -36,15 +36,27 @@ | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
android:layout_height="70dp"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_height="50dp" | |||
android:text="已有图片列表" | |||
android:textSize="@dimen/text_size_16" | |||
android:gravity="center_vertical" | |||
/> | |||
<Button | |||
android:id="@+id/delete_all" | |||
android:layout_width="300dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_height="70dp" | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="删除所有缓存图片" | |||
android:textColor="@color/white" | |||
android:textSize="22sp" | |||
/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
@@ -69,14 +81,17 @@ | |||
android:layout_weight="1" | |||
android:orientation="vertical" | |||
android:paddingLeft="@dimen/dp_10" | |||
android:paddingRight="@dimen/dp_10"> | |||
android:paddingTop="@dimen/dp_10" | |||
android:paddingRight="@dimen/dp_10" | |||
android:layout_marginBottom="@dimen/dp_10"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_height="50dp" | |||
android:textSize="@dimen/text_size_16" | |||
android:gravity="center_vertical" | |||
android:text="选择图片列表"/> | |||
</RelativeLayout> | |||
@@ -101,7 +116,7 @@ | |||
<LinearLayout | |||
android:layout_margin="@dimen/dp_10" | |||
android:layout_width="match_parent" | |||
android:layout_height="34dp" | |||
android:layout_height="50dp" | |||
android:gravity="center_vertical" | |||
android:orientation="horizontal"> | |||
<Button | |||
@@ -111,6 +126,7 @@ | |||
android:background="@drawable/bg_btn_login_selected" | |||
android:text="选择文件" | |||
android:layout_weight="1" | |||
android:textSize="22sp" | |||
/> | |||
<Button | |||
android:id="@+id/baocunbendi" | |||
@@ -119,6 +135,7 @@ | |||
android:background="@drawable/button1" | |||
android:text="保存本地" | |||
android:layout_weight="1" | |||
android:textSize="22sp" | |||
/> | |||
</LinearLayout> | |||
@@ -37,7 +37,11 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:gravity="right" | |||
android:text="PLC连接地址:" /> | |||
android:focusable="true" | |||
android:focusableInTouchMode="true" | |||
android:text="PLC连接地址:" > | |||
<requestFocus/> | |||
</com.qmuiteam.qmui.widget.textview.QMUILinkTextView> | |||
<EditText | |||
android:id="@+id/edittext1" | |||
android:layout_width="120dp" | |||
@@ -20,8 +20,9 @@ | |||
android:layout_height="match_parent"> | |||
<ImageView | |||
android:id="@+id/iv_type" | |||
android:layout_width="50dp" | |||
android:layout_height="50dp" | |||
android:layout_width="70dp" | |||
android:layout_height="70dp" | |||
android:scaleType="fitXY" | |||
android:layout_centerVertical="true"/> | |||
</RelativeLayout> | |||
@@ -18,52 +18,59 @@ | |||
android:id="@+id/ImageUrl" | |||
android:layout_margin="5dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="90dp" | |||
android:layout_height="match_parent" | |||
android:src="@mipmap/loading3" | |||
android:scaleType="fitXY" | |||
/> | |||
<TextView | |||
android:background="#99ffffff" | |||
android:id="@+id/Tag_text" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:paddingLeft="5dp" | |||
android:paddingRight="5dp" | |||
android:text="清炒三月瓜" | |||
android:layout_marginLeft="5dp" | |||
android:layout_marginRight="5dp" | |||
android:textAlignment="center" | |||
android:textColor="@color/gray_deep" | |||
android:textColor="@color/black" | |||
tools:ignore="MissingConstraints" | |||
android:layout_above="@id/rl_btn" | |||
android:maxLines="2" | |||
android:textSize="20dp"/> | |||
android:textSize="22sp"/> | |||
<RelativeLayout | |||
android:id="@+id/rl_btn" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_alignParentBottom="true" | |||
android:layout_marginTop="5dp"> | |||
android:layout_marginLeft="5dp" | |||
android:layout_marginRight="5dp" | |||
android:layout_marginBottom="5dp" | |||
android:background="#ffffff" | |||
> | |||
<TextView | |||
android:id="@+id/Sc_text" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="10dp" | |||
android:paddingLeft="10dp" | |||
android:paddingRight="30dp" | |||
android:textSize="16dp" | |||
android:textColor="@color/light_blue_primary" | |||
android:paddingTop="3dp" | |||
android:paddingBottom="3dp" | |||
android:textSize="22sp" | |||
android:textColor="@color/app_color_blue" | |||
android:paddingBottom="2dp" | |||
android:paddingTop="2dp" | |||
android:text="修改"/> | |||
<TextView | |||
android:id="@+id/delete_text" | |||
android:layout_marginRight="20dp" | |||
android:paddingRight="10dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:textSize="16dp" | |||
android:textSize="22sp" | |||
android:layout_alignParentRight="true" | |||
android:textColor="@color/red_primary_dark" | |||
android:paddingLeft="30dp" | |||
android:paddingTop="3dp" | |||
android:paddingBottom="3dp" | |||
android:paddingBottom="2dp" | |||
android:paddingTop="2dp" | |||
android:text="删除"/> | |||
</RelativeLayout> | |||
@@ -18,14 +18,17 @@ | |||
android:id="@+id/ImageUrl" | |||
android:layout_margin="5dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="115dp" | |||
android:layout_height="match_parent" | |||
android:src="@mipmap/loading3" | |||
android:scaleType="fitXY" | |||
tools:src="@mipmap/image1" | |||
/> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_alignParentBottom="true" | |||
android:layout_margin="5dp" | |||
android:background="#99ffffff" | |||
> | |||
<TextView | |||
@@ -39,7 +42,7 @@ | |||
android:maxLines="2" | |||
android:ellipsize="end" | |||
android:textColor="@color/black" | |||
android:textSize="20sp" | |||
android:textSize="22sp" | |||
tools:ignore="MissingConstraints" /> | |||
</RelativeLayout> | |||
@@ -1,5 +1,6 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
android:id="@+id/toast_root" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
@@ -14,6 +15,9 @@ | |||
<TextView xmlns:android="http://schemas.android.com/apk/res/android" | |||
android:id="@+id/toast_text" | |||
android:textSize="32sp" | |||
tools:text="1信息信息信息信息信息信息信息信息\n信息信息信息信息信息信息信息信息\n信息信息信息信息信息信息信息信息\n信息信息信息信息信息信息信息信息\n信息信息信息信息信息信息信息信息\n信息信息信息信息信息信息信息信息\n5信息信息信息信息信息信息信息信息\n" | |||
android:ellipsize="start" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" /> | |||