@@ -4,6 +4,14 @@ | |||||
<selectionStates> | <selectionStates> | ||||
<SelectionState runConfigName="app"> | <SelectionState runConfigName="app"> | ||||
<option name="selectionMode" value="DROPDOWN" /> | <option name="selectionMode" value="DROPDOWN" /> | ||||
<DropdownSelection timestamp="2024-05-20T08:34:01.979512500Z"> | |||||
<Target type="DEFAULT_BOOT"> | |||||
<handle> | |||||
<DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\YFB\.android\avd\1208Height.avd" /> | |||||
</handle> | |||||
</Target> | |||||
</DropdownSelection> | |||||
<DialogSelection /> | |||||
</SelectionState> | </SelectionState> | ||||
</selectionStates> | </selectionStates> | ||||
</component> | </component> |
@@ -133,7 +133,7 @@ dependencies { | |||||
//leak 内存泄漏检测 | //leak 内存泄漏检测 | ||||
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-alpha-3' | |||||
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-alpha-3' | |||||
//Modbus | //Modbus | ||||
implementation 'com.github.licheedev:Modbus4Android:2.0.2' | implementation 'com.github.licheedev:Modbus4Android:2.0.2' | ||||
@@ -588,6 +588,42 @@ public class APIHelper { | |||||
}).start(); | }).start(); | ||||
} | } | ||||
public static <T> OperateResultT<T> GetT(String path, Map<String,String> params, TypeReference<APIResultT<T>> defaultValue) { | |||||
try { | |||||
String ResponseAdd = BuildUrlWithParams(path,params);//请求地址和参数 | |||||
URL url = new URL(ResponseAdd); | |||||
HttpURLConnection Connection = (HttpURLConnection) url.openConnection(); | |||||
Connection.setRequestMethod("GET"); | |||||
Connection.setConnectTimeout(3000); | |||||
Connection.setReadTimeout(3000); | |||||
int responseCode = Connection.getResponseCode(); | |||||
if (responseCode == Connection.HTTP_OK) { | |||||
InputStream inputStream = Connection.getInputStream(); | |||||
ByteArrayOutputStream arrayOutputStream = new ByteArrayOutputStream(); | |||||
byte[] bytes = new byte[1024]; | |||||
int length = 0; | |||||
while ((length = inputStream.read(bytes)) != -1) { | |||||
arrayOutputStream.write(bytes, 0, length); | |||||
arrayOutputStream.flush();//强制释放缓冲区 | |||||
} | |||||
String s = arrayOutputStream.toString(); | |||||
APIResultT<T> res = JSON.parseObject(s,defaultValue); | |||||
if(res!=null && res.succeeded.toUpperCase().equals("TRUE")){ | |||||
return OperateResultT.CreateSuccess(res.data); | |||||
}else { | |||||
return OperateResultT.CreateFailed("内容解析失败"); | |||||
} | |||||
} else { | |||||
MessageLog.ShowError("get 请求失败"); | |||||
return OperateResultT.CreateFailed("get 请求失败"); | |||||
} | |||||
} catch (Exception e) { | |||||
MessageLog.ShowError(e); | |||||
return OperateResultT.CreateFailed("POST 请求异常"); | |||||
} | |||||
} | |||||
/** | /** | ||||
* 请求参数拼接 | * 请求参数拼接 | ||||
* @param Url 请求地址 | * @param Url 请求地址 | ||||
@@ -12,7 +12,10 @@ import com.bonait.bnframework.common.db.mode.BPA_GOODSTYPE; | |||||
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | ||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.HashMap; | |||||
import java.util.LinkedHashMap; | |||||
import java.util.List; | import java.util.List; | ||||
import java.util.Map; | |||||
import java.util.Optional; | import java.util.Optional; | ||||
import java.util.concurrent.ConcurrentHashMap; | import java.util.concurrent.ConcurrentHashMap; | ||||
import java.util.concurrent.atomic.AtomicReference; | import java.util.concurrent.atomic.AtomicReference; | ||||
@@ -33,16 +36,20 @@ public class APIService { | |||||
} | } | ||||
private static void GetGoodsInfo(){ | private static void GetGoodsInfo(){ | ||||
String url = "http://192.168.1.50:5007/api/goods/Getdevicegoods?deviceId=1a2a1d72-752f-44cf-87f8-ec9fe4ea15b8"; | |||||
APIHelper.PostT(url,null,null,new TypeReference<APIResultT<List<DeviceGoodInfo>>>(){}).OnSource(s->{ | |||||
String url = "https://cfv.black-pa.com/api/goods/getbyidgoods?deviceId=03192d70-bd37-40b2-8c03-2721c236e8f2"; | |||||
// String url = "http://192.168.1.50:5007/api/goods/Getdevicegoods?deviceId=1a2a1d72-752f-44cf-87f8-ec9fe4ea15b8"; | |||||
APIHelper.GetT(url,null,new TypeReference<APIResultT<List<DeviceGoodInfo>>>(){}).OnSource(s->{ | |||||
deviceGoodInfo=s.Content; | deviceGoodInfo=s.Content; | ||||
UpdateLocalGoodsInfo(); | UpdateLocalGoodsInfo(); | ||||
}); | }); | ||||
} | } | ||||
private static void GetMaterialInfo(){ | private static void GetMaterialInfo(){ | ||||
String url = "http://192.168.1.50:5006/api/ExternalPlatform/Material/GetMaterialPageList"; | |||||
String key ="962a5892-0f7f-47b4-a1ec-925bd7914a6d"; | |||||
String url = "https://cfv.black-pa.com/api/ExternalPlatform/Material/GetMaterialPageList"; | |||||
// String url = "http://192.168.1.50:5006/api/ExternalPlatform/Material/GetMaterialPageList"; | |||||
String key ="2c39bc05-25c2-46c4-b5c6-dba349058492"; | |||||
// String key ="962a5892-0f7f-47b4-a1ec-925bd7914a6d"; | |||||
APIHelper.PostT(url,new MaterialRequestPar(1,100),key,new TypeReference<APIResultT<MaterialData>>(){}).OnSource(s->{ | APIHelper.PostT(url,new MaterialRequestPar(1,100),key,new TypeReference<APIResultT<MaterialData>>(){}).OnSource(s->{ | ||||
materialModels=s.Content; | materialModels=s.Content; | ||||
UpdateLocalMaterial(); | UpdateLocalMaterial(); | ||||
@@ -12,6 +12,7 @@ import android.util.Log; | |||||
import androidx.core.content.ContextCompat; | import androidx.core.content.ContextCompat; | ||||
import com.apkfuns.logutils.LogUtils; | |||||
import com.bonait.bnframework.business.ConfigData; | import com.bonait.bnframework.business.ConfigData; | ||||
import com.bonait.bnframework.common.constant.ConfigName; | import com.bonait.bnframework.common.constant.ConfigName; | ||||
import com.bonait.bnframework.common.constant.DataBus; | import com.bonait.bnframework.common.constant.DataBus; | ||||
@@ -29,6 +30,7 @@ import com.bonait.bnframework.common.db.mode.BPA_SILOSANDMATERIAL; | |||||
import com.bonait.bnframework.common.db.mode.BPA_USER; | import com.bonait.bnframework.common.db.mode.BPA_USER; | ||||
import com.bonait.bnframework.common.db.res.AlertLogEnum; | import com.bonait.bnframework.common.db.res.AlertLogEnum; | ||||
import com.bonait.bnframework.common.db.res.UserLogEnum; | import com.bonait.bnframework.common.db.res.UserLogEnum; | ||||
import com.bonait.bnframework.common.glide.GlideApp; | |||||
import com.bonait.bnframework.common.helper.CrashHandler; | import com.bonait.bnframework.common.helper.CrashHandler; | ||||
import com.bonait.bnframework.common.helper.I.IMessageLogNotify; | import com.bonait.bnframework.common.helper.I.IMessageLogNotify; | ||||
import com.bonait.bnframework.common.helper.MessageLog; | import com.bonait.bnframework.common.helper.MessageLog; | ||||
@@ -92,6 +94,13 @@ public class MainApplication extends Application { | |||||
} | } | ||||
} | } | ||||
@Override | |||||
public void onLowMemory() { | |||||
LogUtils.d("MainApplication onLowMemory"); | |||||
super.onLowMemory(); | |||||
GlideApp.get(this).clearMemory(); | |||||
} | |||||
/** | /** | ||||
* 腾讯bugly 异常检测上班 | * 腾讯bugly 异常检测上班 | ||||
*/ | */ | ||||
@@ -136,4 +145,10 @@ public class MainApplication extends Application { | |||||
} | } | ||||
return null; | return null; | ||||
} | } | ||||
@Override | |||||
protected void attachBaseContext(Context base) { | |||||
super.attachBaseContext(base); | |||||
// MultiDex.install(this); | |||||
} | |||||
} | } |
@@ -3583,10 +3583,10 @@ public class QueryDB { | |||||
data = new BPA_SILOS_CALIBRATE(); | data = new BPA_SILOS_CALIBRATE(); | ||||
//私有 | //私有 | ||||
((BPA_SILOS_CALIBRATE) data).name = cursor.getString((int) cursor.getColumnIndex("name")); | ((BPA_SILOS_CALIBRATE) data).name = cursor.getString((int) cursor.getColumnIndex("name")); | ||||
((BPA_SILOS_CALIBRATE) data).inputWightMin = cursor.getInt((int) cursor.getColumnIndex("inputWightMin")); | |||||
((BPA_SILOS_CALIBRATE) data).inputWightMax = cursor.getInt((int) cursor.getColumnIndex("inputWightMax")); | |||||
((BPA_SILOS_CALIBRATE) data).outputTimeMin = cursor.getInt((int) cursor.getColumnIndex("outputTimeMin")); | |||||
((BPA_SILOS_CALIBRATE) data).outputTimeMax = cursor.getInt((int) cursor.getColumnIndex("outputTimeMax")); | |||||
((BPA_SILOS_CALIBRATE) data).inputWightMin = cursor.getFloat((int) cursor.getColumnIndex("inputWightMin")); | |||||
((BPA_SILOS_CALIBRATE) data).inputWightMax = cursor.getFloat((int) cursor.getColumnIndex("inputWightMax")); | |||||
((BPA_SILOS_CALIBRATE) data).outputTimeMin = cursor.getFloat((int) cursor.getColumnIndex("outputTimeMin")); | |||||
((BPA_SILOS_CALIBRATE) data).outputTimeMax = cursor.getFloat((int) cursor.getColumnIndex("outputTimeMax")); | |||||
((BPA_SILOS_CALIBRATE) data).num = cursor.getInt((int) cursor.getColumnIndex("num")); | ((BPA_SILOS_CALIBRATE) data).num = cursor.getInt((int) cursor.getColumnIndex("num")); | ||||
break; | break; | ||||
} | } | ||||
@@ -25,4 +25,20 @@ public class BPA_GOODS extends ModeBase { | |||||
public String materialids; | public String materialids; | ||||
//外键集合 | //外键集合 | ||||
public String foreignKeyRe;//商品外键id | public String foreignKeyRe;//商品外键id | ||||
@Override | |||||
public String toString() { | |||||
return "BPA_GOODS{" + | |||||
"name='" + name + '\'' + | |||||
", url='" + url + '\'' + | |||||
", sort=" + sort + | |||||
", status=" + status + | |||||
", maketime=" + maketime + | |||||
", issc=" + issc + | |||||
", gyid='" + gyid + '\'' + | |||||
", goodtype='" + goodtype + '\'' + | |||||
", materialids='" + materialids + '\'' + | |||||
", foreignKeyRe='" + foreignKeyRe + '\'' + | |||||
'}'; | |||||
} | |||||
} | } |
@@ -32,7 +32,6 @@ import java.util.ArrayList; | |||||
public class FilePickerShowAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { | public class FilePickerShowAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { | ||||
private final LayoutInflater mLayoutInflater; | private final LayoutInflater mLayoutInflater; | ||||
private Context mContext; | |||||
private ArrayList<FileEntity> mDataList; | private ArrayList<FileEntity> mDataList; | ||||
private OnDeleteListener mOnDeleteListener; | private OnDeleteListener mOnDeleteListener; | ||||
private OnFileItemClickListener mOnItemClickListener; | private OnFileItemClickListener mOnItemClickListener; | ||||
@@ -46,7 +45,6 @@ public class FilePickerShowAdapter extends RecyclerView.Adapter<RecyclerView.Vie | |||||
} | } | ||||
public FilePickerShowAdapter(Context context, ArrayList<FileEntity> dataList) { | public FilePickerShowAdapter(Context context, ArrayList<FileEntity> dataList) { | ||||
mContext = context; | |||||
mLayoutInflater = LayoutInflater.from(context); | mLayoutInflater = LayoutInflater.from(context); | ||||
mDataList = dataList; | mDataList = dataList; | ||||
} | } | ||||
@@ -67,7 +65,7 @@ public class FilePickerShowAdapter extends RecyclerView.Adapter<RecyclerView.Vie | |||||
if (fileEntity.getFileType() != null) { | if (fileEntity.getFileType() != null) { | ||||
String title = fileEntity.getFileType().getTitle(); | String title = fileEntity.getFileType().getTitle(); | ||||
if (title.equals("IMG")) { | if (title.equals("IMG")) { | ||||
Glide.with(mContext).load(new File(fileEntity.getPath())).into(holder.mIvType); | |||||
Glide.with(holder.mIvType.getContext()).load(new File(fileEntity.getPath())).into(holder.mIvType); | |||||
} else { | } else { | ||||
holder.mIvType.setImageResource(fileEntity.getFileType().getIconStyle()); | holder.mIvType.setImageResource(fileEntity.getFileType().getIconStyle()); | ||||
} | } | ||||
@@ -27,12 +27,14 @@ public class GoodLeftAdapter extends BaseQuickAdapter<LinkMode, BaseViewHolder> | |||||
public List<LinkMode> Fdata; | public List<LinkMode> Fdata; | ||||
public Resources resources; | public Resources resources; | ||||
public LinearLayoutManager Manager; | public LinearLayoutManager Manager; | ||||
private CallBack callBack; | |||||
public GoodLeftAdapter(@LayoutRes int layoutResId, @Nullable List<LinkMode> data, Resources _resources, LinearLayoutManager _manager) { | |||||
public GoodLeftAdapter(@LayoutRes int layoutResId, @Nullable List<LinkMode> data, Resources _resources, LinearLayoutManager _manager,CallBack callBack) { | |||||
super(layoutResId, data); | super(layoutResId, data); | ||||
resources = _resources; | resources = _resources; | ||||
Fdata = data; | Fdata = data; | ||||
Manager = _manager; | Manager = _manager; | ||||
this.callBack =callBack; | |||||
} | } | ||||
@Override | @Override | ||||
@@ -117,6 +119,9 @@ public class GoodLeftAdapter extends BaseQuickAdapter<LinkMode, BaseViewHolder> | |||||
public void onClick(QMUIDialog dialog, int index) { | public void onClick(QMUIDialog dialog, int index) { | ||||
Detele(index_d); | Detele(index_d); | ||||
dialog.dismiss(); | dialog.dismiss(); | ||||
if(callBack!=null){ | |||||
callBack.delete(); | |||||
} | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
@@ -146,4 +151,8 @@ public class GoodLeftAdapter extends BaseQuickAdapter<LinkMode, BaseViewHolder> | |||||
Fdata.get(position).isChoose = true; | Fdata.get(position).isChoose = true; | ||||
notifyDataSetChanged(); | notifyDataSetChanged(); | ||||
} | } | ||||
public interface CallBack{ | |||||
void delete(); | |||||
} | |||||
} | } |
@@ -56,6 +56,15 @@ public class loadinggood_adapter extends RecyclerView.Adapter<RecyclerView.ViewH | |||||
private final LayoutInflater mLayoutInflater; | private final LayoutInflater mLayoutInflater; | ||||
Handler handler = new Handler(); | Handler handler = new Handler(); | ||||
public void destroy(){ | |||||
if(handler!=null){ | |||||
handler.removeCallbacksAndMessages(null); | |||||
handler = null; | |||||
} | |||||
datas.clear(); | |||||
datas = null; | |||||
mListener = null; | |||||
} | |||||
public loadinggood_adapter(Context context,MyClickListener myClickListener) { | public loadinggood_adapter(Context context,MyClickListener myClickListener) { | ||||
// this.conmain = context; | // this.conmain = context; | ||||
@@ -12,6 +12,7 @@ import android.widget.TextView; | |||||
import androidx.annotation.NonNull; | import androidx.annotation.NonNull; | ||||
import androidx.recyclerview.widget.RecyclerView; | import androidx.recyclerview.widget.RecyclerView; | ||||
import com.apkfuns.logutils.LogUtils; | |||||
import com.bonait.bnframework.R; | import com.bonait.bnframework.R; | ||||
import com.bonait.bnframework.common.constant.MessageName; | import com.bonait.bnframework.common.constant.MessageName; | ||||
import com.bonait.bnframework.common.db.QueryDB; | import com.bonait.bnframework.common.db.QueryDB; | ||||
@@ -48,7 +49,7 @@ public class newmakegood_adapter extends RecyclerView.Adapter<RecyclerView.View | |||||
@Override | @Override | ||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { | public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { | ||||
View inflate = mLayoutInflater.inflate(R.layout.newmakegood, parent, false); | View inflate = mLayoutInflater.inflate(R.layout.newmakegood, parent, false); | ||||
return new newgood_adapter.MyLCViewHolder1(inflate); | |||||
return new MyLCViewHolder1(inflate); | |||||
} | } | ||||
@Override | @Override | ||||
@@ -61,14 +62,14 @@ public class newmakegood_adapter extends RecyclerView.Adapter<RecyclerView.View | |||||
@Override | @Override | ||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { | public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { | ||||
try { | try { | ||||
if (holder instanceof newgood_adapter.MyLCViewHolder1) { | |||||
if (holder instanceof MyLCViewHolder1) { | |||||
BPA_GOODS goods = (BPA_GOODS) Data.get(position); | BPA_GOODS goods = (BPA_GOODS) Data.get(position); | ||||
newgood_adapter.MyLCViewHolder1 myViewHolder = (newgood_adapter.MyLCViewHolder1) holder; | |||||
MyLCViewHolder1 myViewHolder = (MyLCViewHolder1) holder; | |||||
myViewHolder.Tag_text.setText(goods.name); | myViewHolder.Tag_text.setText(goods.name); | ||||
//设置图片 | //设置图片 | ||||
if (!goods.url.equals("未知") && !goods.url.isEmpty() && !goods.url.equals("")) { | |||||
if (goods.url!=null && !goods.url.equals("未知") && !goods.url.isEmpty()) { | |||||
// myBitmapUtils.disPlay(myViewHolder.ImageUrl, goods.url); | // myBitmapUtils.disPlay(myViewHolder.ImageUrl, goods.url); | ||||
GlideUtil.showImage(myViewHolder.ImageUrl.getContext(),goods.url,myViewHolder.ImageUrl,R.mipmap.loading3); | GlideUtil.showImage(myViewHolder.ImageUrl.getContext(),goods.url,myViewHolder.ImageUrl,R.mipmap.loading3); | ||||
} | } | ||||
@@ -79,6 +80,10 @@ public class newmakegood_adapter extends RecyclerView.Adapter<RecyclerView.View | |||||
myViewHolder.ImageUrl.setOnClickListener(new View.OnClickListener() { | myViewHolder.ImageUrl.setOnClickListener(new View.OnClickListener() { | ||||
@Override | @Override | ||||
public void onClick(View view) { | public void onClick(View view) { | ||||
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); | ||||
} | } | ||||
}); | }); | ||||
@@ -10,6 +10,7 @@ import androidx.core.content.ContextCompat; | |||||
import androidx.recyclerview.widget.LinearLayoutManager; | import androidx.recyclerview.widget.LinearLayoutManager; | ||||
import androidx.recyclerview.widget.RecyclerView; | import androidx.recyclerview.widget.RecyclerView; | ||||
import android.annotation.SuppressLint; | |||||
import android.app.Activity; | import android.app.Activity; | ||||
import android.content.Context; | import android.content.Context; | ||||
import android.content.res.Resources; | import android.content.res.Resources; | ||||
@@ -38,6 +39,7 @@ import android.widget.RelativeLayout; | |||||
import android.widget.TextView; | import android.widget.TextView; | ||||
import android.widget.Toast; | import android.widget.Toast; | ||||
import com.apkfuns.logutils.LogUtils; | |||||
import com.bonait.bnframework.R; | import com.bonait.bnframework.R; | ||||
import com.bonait.bnframework.business.ConfigData; | import com.bonait.bnframework.business.ConfigData; | ||||
import com.bonait.bnframework.business.ExecuteTheRecipe; | import com.bonait.bnframework.business.ExecuteTheRecipe; | ||||
@@ -199,7 +201,6 @@ public class MakeGoodFragment extends BaseFragment { | |||||
initTopBar(); | initTopBar(); | ||||
Initdata(); | Initdata(); | ||||
Run(); | Run(); | ||||
/*ShaomaTest.Getinstance().Open(activity,this.context);*/ | /*ShaomaTest.Getinstance().Open(activity,this.context);*/ | ||||
/* SerialManage.GetInstance().init(new SerialInter() { | /* SerialManage.GetInstance().init(new SerialInter() { | ||||
@Override | @Override | ||||
@@ -233,6 +234,8 @@ public class MakeGoodFragment extends BaseFragment { | |||||
} | } | ||||
public List<LinkMode> Fdata = new ArrayList<>(); | public List<LinkMode> Fdata = new ArrayList<>(); | ||||
private boolean isResume = false; | |||||
private boolean destroy = false; | |||||
/** | /** | ||||
* 初始化数据 | * 初始化数据 | ||||
@@ -424,18 +427,19 @@ public class MakeGoodFragment extends BaseFragment { | |||||
mTopBar.setTitle("智慧菠萝点餐系统" + ConfigName.getInstance().Version); | mTopBar.setTitle("智慧菠萝点餐系统" + ConfigName.getInstance().Version); | ||||
mTopBar.addLeftImageButton(R.mipmap.silos1, 1).setOnClickListener(new View.OnClickListener() { | |||||
@Override | |||||
public void onClick(View v) { | |||||
add_manguan.SetData(); | |||||
add_manguan.setVisibility(View.VISIBLE); | |||||
} | |||||
}); | |||||
// mTopBar.addLeftImageButton(R.mipmap.silos1, 1).setOnClickListener(new View.OnClickListener() { | |||||
// @Override | |||||
// public void onClick(View v) { | |||||
// add_manguan.SetData(); | |||||
// add_manguan.setVisibility(View.VISIBLE); | |||||
// } | |||||
// }); | |||||
//打开 | //打开 | ||||
MessageManager.getInstance().registerMessageReceiver(getActivity(), MessageName.ClickMakeGoodNew, new MessageLooper.OnMessageListener() { | MessageManager.getInstance().registerMessageReceiver(getActivity(), MessageName.ClickMakeGoodNew, new MessageLooper.OnMessageListener() { | ||||
@Override | @Override | ||||
public void onMessage(Object msg) { | public void onMessage(Object msg) { | ||||
LogUtils.d(" MessageName.ClickMakeGoodNew onMessage"); | |||||
if (msg != null) { | if (msg != null) { | ||||
BPA_GOODS goods = (BPA_GOODS) msg; | BPA_GOODS goods = (BPA_GOODS) msg; | ||||
@@ -506,27 +510,40 @@ public class MakeGoodFragment extends BaseFragment { | |||||
String message = ""; | String message = ""; | ||||
@SuppressLint("HandlerLeak") | |||||
private Handler mHandler = new Handler() { | private Handler mHandler = new Handler() { | ||||
public void handleMessage(Message msg) { | public void handleMessage(Message msg) { | ||||
switch (msg.what) { | |||||
case 0: | |||||
plc_status.setText(ConfigName.getInstance().PlcIsConnect ? "正常" : "异常"); | |||||
plc_status.setTextColor(ConfigName.getInstance().PlcIsConnect ? Color.parseColor("#4CAF50") : Color.parseColor("#D32F2F")); | |||||
if(isResume){ | |||||
switch (msg.what) { | |||||
case 0: | |||||
plc_status.setText(ConfigName.getInstance().PlcIsConnect ? "正常" : "异常"); | |||||
plc_status.setTextColor(ConfigName.getInstance().PlcIsConnect ? Color.parseColor("#4CAF50") : Color.parseColor("#D32F2F")); | |||||
// wendu1.setText(ExecuteTheRecipe.WaterTemp + "°C"); | // wendu1.setText(ExecuteTheRecipe.WaterTemp + "°C"); | ||||
MessageLog.ShowInfo("重量 ExecuteTheRecipe.OutletWeigh="+ExecuteTheRecipe.OutletWeigh); | |||||
dianzichen.setText(String.valueOf((int) ExecuteTheRecipe.OutletWeigh / 10.0) + " g"); | |||||
break; | |||||
case 1: | |||||
ToastUtils.warning(message); | |||||
break; | |||||
case 2: | |||||
ToastUtils.info(message); | |||||
break; | |||||
MessageLog.ShowInfo("重量 ExecuteTheRecipe.OutletWeigh="+ExecuteTheRecipe.OutletWeigh); | |||||
dianzichen.setText(String.valueOf((int) ExecuteTheRecipe.OutletWeigh / 10.0) + " g"); | |||||
break; | |||||
case 1: | |||||
ToastUtils.warning(message); | |||||
break; | |||||
case 2: | |||||
ToastUtils.info(message); | |||||
break; | |||||
} | |||||
} | } | ||||
} | } | ||||
}; | }; | ||||
@Override | |||||
public void onResume() { | |||||
super.onResume(); | |||||
isResume = true; | |||||
} | |||||
int time=0; | int time=0; | ||||
@@ -632,41 +649,43 @@ public class MakeGoodFragment extends BaseFragment { | |||||
new Thread(new Runnable() { | new Thread(new Runnable() { | ||||
@Override | @Override | ||||
public void run() { | public void run() { | ||||
while (true) { | |||||
try { | |||||
mHandler.sendEmptyMessage(0); | |||||
if(time>=60) //12秒执行一次 | |||||
{ | |||||
ArrayList<lcMode> lcModes = DataBus.getInstance().ResGetLc(); | |||||
String title=""; | |||||
for (lcMode item:lcModes) | |||||
while (true && !destroy) { | |||||
if(mHandler!=null){ | |||||
try { | |||||
mHandler.sendEmptyMessage(0); | |||||
if(time>=60) //12秒执行一次 | |||||
{ | { | ||||
//lcMode.warningValue >= lcMode.silosmargin | |||||
//总量大于0 绑定了物料 告警值设置了 告警大于余量 告警 | |||||
if(item.siloszl>0 && !item.materialId.isEmpty() && item.warningValue>0 && item.warningValue >= item.silosmargin) | |||||
ArrayList<lcMode> lcModes = DataBus.getInstance().ResGetLc(); | |||||
String title=""; | |||||
for (lcMode item:lcModes) | |||||
{ | { | ||||
title+="料仓"+item.num+"-"+item.materialName+"|"; | |||||
//lcMode.warningValue >= lcMode.silosmargin | |||||
//总量大于0 绑定了物料 告警值设置了 告警大于余量 告警 | |||||
if(item.siloszl>0 && !item.materialId.isEmpty() && item.warningValue>0 && item.warningValue >= item.silosmargin) | |||||
{ | |||||
title+="料仓"+item.num+"-"+item.materialName+"|"; | |||||
} | |||||
} | } | ||||
} | |||||
if(!title.isEmpty()) | |||||
{ | |||||
String finalTitle = title; | |||||
activity.runOnUiThread(new Runnable() { | |||||
@Override | |||||
public void run() { | |||||
//0.6 --- 0.9 | |||||
CookieHelper.Show(activity, finalTitle +"-余量提示","料仓余量不足,请及时补料!若程序预警错误,请及时手动补充原料后,在料仓界面点击《补充原料》"); | |||||
} | |||||
}); | |||||
} | |||||
if(!title.isEmpty()) | |||||
{ | |||||
String finalTitle = title; | |||||
activity.runOnUiThread(new Runnable() { | |||||
@Override | |||||
public void run() { | |||||
//0.6 --- 0.9 | |||||
CookieHelper.Show(activity, finalTitle +"-余量提示","料仓余量不足,请及时补料!若程序预警错误,请及时手动补充原料后,在料仓界面点击《补充原料》"); | |||||
} | |||||
}); | |||||
} | |||||
time=0; | |||||
time=0; | |||||
} | |||||
Thread.sleep(200); | |||||
time++; | |||||
} catch (Exception ex) { | |||||
ToastUtils.error("异常信息:" + ex.getMessage()); | |||||
} | } | ||||
Thread.sleep(200); | |||||
time++; | |||||
} catch (Exception ex) { | |||||
ToastUtils.error("异常信息:" + ex.getMessage()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -676,106 +695,106 @@ public class MakeGoodFragment extends BaseFragment { | |||||
ExecuteTheRecipe.OnScanTheCodeInformationT = new IRunT<String>() { | ExecuteTheRecipe.OnScanTheCodeInformationT = new IRunT<String>() { | ||||
@Override | @Override | ||||
public void Run(String msg2) { | public void Run(String msg2) { | ||||
activity.runOnUiThread(new Runnable() { | |||||
@Override | |||||
public void run() { | |||||
String msg = msg2; | |||||
if(activity!=null){ | |||||
activity.runOnUiThread(new Runnable() { | |||||
@Override | |||||
public void run() { | |||||
String msg = msg2; | |||||
// if(ConfigName.TEST){ | // if(ConfigName.TEST){ | ||||
// msg = " |03cb1364-8b85-446a-b00b-d3657de1a19f| | "; | // msg = " |03cb1364-8b85-446a-b00b-d3657de1a19f| | "; | ||||
// } | // } | ||||
if ((msg != null) && (((String) msg).length() > 2) && ((String) msg).contains("|")) { | |||||
//拿到扫码数据 | |||||
//例如 ORD001|P0003|A001,M002,T001|2 | |||||
// OR001|A001|2,22|1 | |||||
String[] res = ((String) msg).split("[|]"); | |||||
if (res.length >= 4) { | |||||
String orderid = res[0];//ORD001 | |||||
String goodid = res[1];//P0003 商品id | |||||
String ggid = res[2];//A001,M002,T001 配方ids | |||||
String ggids = "";//规格id集合 | |||||
String names = ""; | |||||
if (QueryDB.GetOrderthirdPartyIDIs(orderid)) { | |||||
message = "已有订单,重复扫码!"; | |||||
mHandler.sendEmptyMessage(1); | |||||
return; | |||||
} | |||||
int num = 1; | |||||
try { | |||||
num = Integer.parseInt(res[3]); | |||||
for (String item : ggid.split("[,]")) { | |||||
for (ResGoodProperty k : DataBus.getInstance().bpa_goodproperties) { | |||||
if (k.child != null && k.child.size() > 0) { | |||||
for (ResGoodProperty chd : k.child) { | |||||
if (chd.foreignKeyRe != null && !chd.foreignKeyRe.isEmpty() && chd.foreignKeyRe.equals(item)) { | |||||
ggids += chd.id + ","; | |||||
names += "/" + chd.name; | |||||
if ((msg != null) && (((String) msg).length() > 2) && ((String) msg).contains("|")) { | |||||
//拿到扫码数据 | |||||
//例如 ORD001|P0003|A001,M002,T001|2 | |||||
// OR001|A001|2,22|1 | |||||
String[] res = ((String) msg).split("[|]"); | |||||
if (res.length >= 4) { | |||||
String orderid = res[0];//ORD001 | |||||
String goodid = res[1];//P0003 商品id | |||||
String ggid = res[2];//A001,M002,T001 配方ids | |||||
String ggids = "";//规格id集合 | |||||
String names = ""; | |||||
if (QueryDB.GetOrderthirdPartyIDIs(orderid)) { | |||||
message = "已有订单,重复扫码!"; | |||||
mHandler.sendEmptyMessage(1); | |||||
return; | |||||
} | |||||
int num = 1; | |||||
try { | |||||
num = Integer.parseInt(res[3]); | |||||
for (String item : ggid.split("[,]")) { | |||||
for (ResGoodProperty k : DataBus.getInstance().bpa_goodproperties) { | |||||
if (k.child != null && k.child.size() > 0) { | |||||
for (ResGoodProperty chd : k.child) { | |||||
if (chd.foreignKeyRe != null && !chd.foreignKeyRe.isEmpty() && chd.foreignKeyRe.equals(item)) { | |||||
ggids += chd.id + ","; | |||||
names += "/" + chd.name; | |||||
} | |||||
} | } | ||||
} | } | ||||
} | |||||
} | |||||
} | } | ||||
} | |||||
if (!ggids.isEmpty()) { | |||||
ggids = ggids.substring(0, ggids.length() - 1); | |||||
if (!ggids.isEmpty()) { | |||||
ggids = ggids.substring(0, ggids.length() - 1); | |||||
} | |||||
} catch (Exception ex) { | |||||
} | } | ||||
} catch (Exception ex) { | |||||
} | |||||
BPA_GOODS good = QueryDB.GetGoodsforeignKeyId(goodid); | |||||
ConfigName.getInstance(); | |||||
BPA_GOODS good = QueryDB.GetGoodsforeignKeyId(goodid); | |||||
ConfigName.getInstance(); | |||||
// if(ConfigName.TEST){ | // if(ConfigName.TEST){ | ||||
// good = QueryDB.GetGoodsId(goodid); | // good = QueryDB.GetGoodsId(goodid); | ||||
// } | // } | ||||
if (good == null) { | |||||
message = "没有查询到该商品!"; | |||||
mHandler.sendEmptyMessage(1); | |||||
} else { | |||||
BPA_GOODSRECIPENAME goodsrecipename = QueryDB.GetGoodsRecipeNameDesignId(ggids, good.id); | |||||
if (goodsrecipename != null) { | |||||
BPA_ORDER order = new BPA_ORDER(); | |||||
order.thirdPartyID = orderid; | |||||
order.status = 0; | |||||
order.deviceID = ConfigName.getInstance().DeviceId; | |||||
order.userID = ConfigName.getInstance().user.userID; | |||||
QueryDB.AddOrder(order); | |||||
for (int mm = 0; mm < num; mm++) { | |||||
BPA_SUBORDER suborder = new BPA_SUBORDER(); | |||||
suborder.deviceID = ConfigName.getInstance().DeviceId; | |||||
suborder.userID = ConfigName.getInstance().user.userID; | |||||
suborder.orderID = order.id; | |||||
suborder.goodsID = good.id; | |||||
suborder.recipeID = goodsrecipename.id; | |||||
suborder.number = 1; | |||||
suborder.status = 0; | |||||
suborder.exp = names; | |||||
QueryDB.AddSubOrder(suborder); | |||||
DataBus.getInstance().AddGoodsMake(suborder); | |||||
} | |||||
message = "加入订单队列成功!"; | |||||
mHandler.sendEmptyMessage(2); | |||||
} else { | |||||
message = "没有查询到该商品配方信息!"; | |||||
if (good == null) { | |||||
message = "没有查询到该商品!"; | |||||
mHandler.sendEmptyMessage(1); | mHandler.sendEmptyMessage(1); | ||||
} else { | |||||
BPA_GOODSRECIPENAME goodsrecipename = QueryDB.GetGoodsRecipeNameDesignId(ggids, good.id); | |||||
if (goodsrecipename != null) { | |||||
BPA_ORDER order = new BPA_ORDER(); | |||||
order.thirdPartyID = orderid; | |||||
order.status = 0; | |||||
order.deviceID = ConfigName.getInstance().DeviceId; | |||||
order.userID = ConfigName.getInstance().user.userID; | |||||
QueryDB.AddOrder(order); | |||||
for (int mm = 0; mm < num; mm++) { | |||||
BPA_SUBORDER suborder = new BPA_SUBORDER(); | |||||
suborder.deviceID = ConfigName.getInstance().DeviceId; | |||||
suborder.userID = ConfigName.getInstance().user.userID; | |||||
suborder.orderID = order.id; | |||||
suborder.goodsID = good.id; | |||||
suborder.recipeID = goodsrecipename.id; | |||||
suborder.number = 1; | |||||
suborder.status = 0; | |||||
suborder.exp = names; | |||||
QueryDB.AddSubOrder(suborder); | |||||
DataBus.getInstance().AddGoodsMake(suborder); | |||||
} | |||||
message = "加入订单队列成功!"; | |||||
mHandler.sendEmptyMessage(2); | |||||
} else { | |||||
message = "没有查询到该商品配方信息!"; | |||||
mHandler.sendEmptyMessage(1); | |||||
} | |||||
} | } | ||||
} | |||||
} else { | |||||
message = "没有查询到该商品!"; | |||||
mHandler.sendEmptyMessage(1); | |||||
} | |||||
} else { | } else { | ||||
message = "没有查询到该商品!"; | |||||
message = "服务器异常,请稍后重试!"; | |||||
mHandler.sendEmptyMessage(1); | mHandler.sendEmptyMessage(1); | ||||
} | } | ||||
} else { | |||||
message = "服务器异常,请稍后重试!"; | |||||
mHandler.sendEmptyMessage(1); | |||||
} | } | ||||
} | |||||
}); | |||||
}); | |||||
} | |||||
} | } | ||||
}; | }; | ||||
@@ -830,10 +849,24 @@ public class MakeGoodFragment extends BaseFragment { | |||||
public void onDestroy() { | public void onDestroy() { | ||||
super.onDestroy(); | super.onDestroy(); | ||||
Logger.d("第一页销毁"); | Logger.d("第一页销毁"); | ||||
destroy = true; | |||||
isResume = false; | |||||
myClickListener = null; | |||||
Fdata.clear(); | |||||
Fdata = null; | |||||
datatab_paiduishangping.setAdapter(null); | |||||
rv_right.setAdapter(null); | rv_right.setAdapter(null); | ||||
if(DataBus.getInstance().loadinggoodAdapter!=null){ | |||||
DataBus.getInstance().loadinggoodAdapter.destroy(); | |||||
} | |||||
Glide.get(getContext()).clearMemory(); | Glide.get(getContext()).clearMemory(); | ||||
ExecuteTheRecipe.OnScanTheCodeInformationT = null; | |||||
MessageManager.getInstance().unRegisterMessageReceiver(getActivity()); | MessageManager.getInstance().unRegisterMessageReceiver(getActivity()); | ||||
if(mHandler!=null){ | |||||
mHandler.removeCallbacksAndMessages(null); | |||||
mHandler = null; | |||||
} | |||||
activity = null; | |||||
} | } | ||||
/** | /** | ||||
@@ -293,6 +293,8 @@ public class GoodPeiFangActivity extends BaseActivity { | |||||
*/ | */ | ||||
ArrayList<ResGoodProperty> bpa_goodproperties = new ArrayList<>(); | ArrayList<ResGoodProperty> bpa_goodproperties = new ArrayList<>(); | ||||
public List<LinkMode> Fdata = new ArrayList<>(); | public List<LinkMode> Fdata = new ArrayList<>(); | ||||
private GoodLeftAdapter leftAdapter; | |||||
private GoodRightAdapter rightAdapter; | |||||
/** | /** | ||||
* 初始化数据 | * 初始化数据 | ||||
@@ -338,8 +340,15 @@ public class GoodPeiFangActivity extends BaseActivity { | |||||
} | } | ||||
LinearLayoutManager manager = (LinearLayoutManager) rv_right.getLayoutManager(); | LinearLayoutManager manager = (LinearLayoutManager) rv_right.getLayoutManager(); | ||||
GoodLeftAdapter leftAdapter = new GoodLeftAdapter(R.layout.item_left_good, Fdata, getResources(), manager); | |||||
GoodRightAdapter rightAdapter = new GoodRightAdapter(R.layout.item_right_lc, Fdata, getResources()); | |||||
leftAdapter = new GoodLeftAdapter(R.layout.item_left_good, Fdata, getResources(), manager, new GoodLeftAdapter.CallBack() { | |||||
@Override | |||||
public void delete() { | |||||
if(rightAdapter!=null){ | |||||
rightAdapter.notifyDataSetChanged(); | |||||
} | |||||
} | |||||
}); | |||||
rightAdapter = new GoodRightAdapter(R.layout.item_right_lc, Fdata, getResources()); | |||||
rv_left.setAdapter(leftAdapter); | rv_left.setAdapter(leftAdapter); | ||||
rv_right.setAdapter(rightAdapter); | rv_right.setAdapter(rightAdapter); | ||||
@@ -422,10 +431,20 @@ public class GoodPeiFangActivity extends BaseActivity { | |||||
public void onDestroy() { | public void onDestroy() { | ||||
add_pf.destroy(); | add_pf.destroy(); | ||||
add_good.destroy(); | add_good.destroy(); | ||||
add_pf_home.destroy(); | |||||
super.onDestroy(); | super.onDestroy(); | ||||
add_good.mListener = null; | |||||
add_pf_home.mListener = null; | |||||
add_pf.mListener = null; | |||||
goodstypes.clear(); | |||||
goodstypes = null; | |||||
rv_right.setAdapter(null); | rv_right.setAdapter(null); | ||||
rv_left.setAdapter(null); | |||||
Glide.get(this).clearMemory(); | Glide.get(this).clearMemory(); | ||||
MessageManager.getInstance().unRegisterMessageReceiver(this); | MessageManager.getInstance().unRegisterMessageReceiver(this); | ||||
context = null; | |||||
activity = null; | |||||
} | } | ||||
@Override | @Override | ||||
@@ -181,6 +181,10 @@ public class ImageSourceActivity extends BaseActivity { | |||||
@Override | @Override | ||||
public void onDestroy() { | public void onDestroy() { | ||||
super.onDestroy(); | super.onDestroy(); | ||||
yx_files.clear(); | |||||
yx_files = null; | |||||
mRecyclerView.setAdapter(null); | |||||
rl_yx_file.setAdapter(null); | |||||
} | } | ||||
@Override | @Override | ||||
@@ -109,6 +109,7 @@ public class JcsjglActivity extends BaseActivity { | |||||
@Override | @Override | ||||
public void onDestroy() { | public void onDestroy() { | ||||
super.onDestroy(); | super.onDestroy(); | ||||
viewpager_wl.setAdapter(null); | |||||
} | } | ||||
@Override | @Override | ||||
@@ -238,6 +238,19 @@ public class LogActivity extends BaseActivity { | |||||
@Override | @Override | ||||
public void onDestroy() { | public void onDestroy() { | ||||
super.onDestroy(); | super.onDestroy(); | ||||
bpa_logs.clear(); | |||||
bpa_logs = null; | |||||
if(adapter!=null){ | |||||
adapter.clear(); | |||||
adapter = null; | |||||
} | |||||
datatab.setAdapter(null); | |||||
rzlx.setAdapter(null); | |||||
datatab = null; | |||||
lx_map.clear(); | |||||
lx_map = null; | |||||
context = null; | |||||
} | } | ||||
@Override | @Override | ||||
@@ -95,7 +95,8 @@ public class OrderListActivity extends BaseActivity { | |||||
Spinner rzlx; | Spinner rzlx; | ||||
Map<String,Integer> lx_map = new LinkedHashMap<>(); | Map<String,Integer> lx_map = new LinkedHashMap<>(); | ||||
//endregion | //endregion | ||||
private Context context;private ViewGroup view; | |||||
private Context context; | |||||
private ViewGroup view; | |||||
@Override | @Override | ||||
protected void onCreate(Bundle savedInstanceState) { | protected void onCreate(Bundle savedInstanceState) { | ||||
super.onCreate(savedInstanceState); | super.onCreate(savedInstanceState); | ||||
@@ -234,6 +235,17 @@ public class OrderListActivity extends BaseActivity { | |||||
@Override | @Override | ||||
public void onDestroy() { | public void onDestroy() { | ||||
super.onDestroy(); | super.onDestroy(); | ||||
if(adapter!=null){ | |||||
adapter.clear(); | |||||
adapter = null; | |||||
} | |||||
subOrders.clear(); | |||||
subOrders = null; | |||||
lx_map.clear(); | |||||
lx_map = null; | |||||
context = null; | |||||
} | } | ||||
@Override | @Override | ||||
@@ -96,6 +96,7 @@ public class PlcControlActivity extends BaseActivity { | |||||
@Override | @Override | ||||
public void onDestroy() { | public void onDestroy() { | ||||
super.onDestroy(); | super.onDestroy(); | ||||
viewpager_wl.setAdapter(null); | |||||
} | } | ||||
@Override | @Override | ||||
@@ -42,14 +42,12 @@ public class RealTimeActivity extends BaseActivity { | |||||
QMUITopBarLayout mTopBar; | QMUITopBarLayout mTopBar; | ||||
@BindView(R.id.recycler_view) | @BindView(R.id.recycler_view) | ||||
RecyclerView recycler_view; | RecyclerView recycler_view; | ||||
private Context context; | |||||
Activity activity=null; | Activity activity=null; | ||||
@Override | @Override | ||||
protected void onCreate(Bundle savedInstanceState) { | protected void onCreate(Bundle savedInstanceState) { | ||||
super.onCreate(savedInstanceState); | super.onCreate(savedInstanceState); | ||||
setContentView(R.layout.activity_realtime); | setContentView(R.layout.activity_realtime); | ||||
ButterKnife.bind(this); | ButterKnife.bind(this); | ||||
context=getContext(); | |||||
activity=this; | activity=this; | ||||
initTopBar(); | initTopBar(); | ||||
initFragment(); | initFragment(); | ||||
@@ -250,6 +248,14 @@ public class RealTimeActivity extends BaseActivity { | |||||
@Override | @Override | ||||
public void onDestroy() { | public void onDestroy() { | ||||
super.onDestroy(); | super.onDestroy(); | ||||
if(adapter != null){ | |||||
adapter.statusModes.clear(); | |||||
adapter.statusModes = null; | |||||
adapter.activity = null; | |||||
adapter = null; | |||||
} | |||||
recycler_view.setAdapter(null); | |||||
activity = null; | |||||
} | } | ||||
@Override | @Override | ||||
@@ -236,6 +236,16 @@ public class SalesStatisticsActivity extends BaseActivity { | |||||
@Override | @Override | ||||
public void onDestroy() { | public void onDestroy() { | ||||
super.onDestroy(); | super.onDestroy(); | ||||
subOrders.clear(); | |||||
subOrders = null; | |||||
subOrdersStatic.clear(); | |||||
subOrdersStatic = null; | |||||
if(adapter!=null){ | |||||
adapter.clear(); | |||||
adapter = null; | |||||
} | |||||
context = null; | |||||
} | } | ||||
@Override | @Override | ||||
@@ -162,7 +162,7 @@ public class SilosNewActivity extends BaseActivity { | |||||
@Override | @Override | ||||
public void clickListenerNew(View v, int k, Object data) { | public void clickListenerNew(View v, int k, Object data) { | ||||
if (k == 0) { | if (k == 0) { | ||||
silos_jz.close(); | |||||
silos_jz.destroy(); | |||||
} | } | ||||
} | } | ||||
}; | }; | ||||
@@ -228,8 +228,14 @@ public class SilosNewActivity extends BaseActivity { | |||||
@Override | @Override | ||||
public void onDestroy() { | public void onDestroy() { | ||||
super.onDestroy(); | super.onDestroy(); | ||||
silos_jz.close(); | |||||
MessageManager.getInstance().unRegisterMessageReceiver(this); | MessageManager.getInstance().unRegisterMessageReceiver(this); | ||||
silos_jz.destroy(); | |||||
add_yijian.destroy(); | |||||
add_yijian.mListener = null; | |||||
add_silos.mListener = null; | |||||
silos_jz.mListener = null; | |||||
activity = null; | |||||
context = null; | |||||
} | } | ||||
@Override | @Override | ||||
@@ -213,6 +213,17 @@ public class SystemParameterActivity extends BaseActivity { | |||||
@Override | @Override | ||||
public void onDestroy() { | public void onDestroy() { | ||||
super.onDestroy(); | super.onDestroy(); | ||||
environment.setAdapter(null); | |||||
versionselection.setAdapter(null); | |||||
editTextLists.clear(); | |||||
editTextLists = null; | |||||
material_map.clear(); | |||||
material_map = null; | |||||
material_map_vis.clear(); | |||||
material_map_vis = null; | |||||
bpa_systemsets.clear(); | |||||
bpa_systemsets = null; | |||||
context= null; | |||||
} | } | ||||
@Override | @Override | ||||
@@ -36,7 +36,7 @@ import butterknife.BindView; | |||||
import butterknife.ButterKnife; | import butterknife.ButterKnife; | ||||
import butterknife.OnClick; | import butterknife.OnClick; | ||||
public class Jcsjgl_sxgl_fragment extends BaseFragment implements MyClickListener { | |||||
public class Jcsjgl_sxgl_fragment extends BaseFragment {// implements MyClickListener | |||||
@BindView(R.id.datatab_sx) | @BindView(R.id.datatab_sx) | ||||
ListView datatab_sx; | ListView datatab_sx; | ||||
@@ -126,194 +126,206 @@ public class Jcsjgl_sxgl_fragment extends BaseFragment implements MyClickListene | |||||
} | } | ||||
} | } | ||||
/** | |||||
* 点击事件 | |||||
* | |||||
* @param v | |||||
* @param data | |||||
*/ | |||||
@Override | |||||
public void clickListener(View v, Object data) { | |||||
switch (v.getId()) { | |||||
case R.id.name://修改属性名称按钮 | |||||
final QMUIDialog.EditTextDialogBuilder builder = new QMUIDialog.EditTextDialogBuilder(context); | |||||
builder.setTitle("属性名称") | |||||
.setPlaceholder("在此输入属性名称") | |||||
.setDefaultText(((BPA_GOODPROPERTY) data).name) | |||||
.setInputType(InputType.TYPE_CLASS_TEXT) | |||||
.addAction("取消", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
dialog.dismiss(); | |||||
} | |||||
}) | |||||
.addAction("确定", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
CharSequence text = builder.getEditText().getText(); | |||||
if (text != null && text.length() > 0) { | |||||
if (QueryDB.GetGoodsPropertyIs(text.toString())) { | |||||
ToastUtils.info("属性名称重复,请重新输入后重试!"); | |||||
return; | |||||
} | |||||
QueryDB.UpdateGoodsPropertyName(((BPA_GOODPROPERTY) data).id, text.toString()); | |||||
Initdata_sx(); | |||||
private MyClickListener listener = new MyClickListener() { | |||||
@Override | |||||
public void clickListener(View v, Object data) { | |||||
switch (v.getId()) { | |||||
case R.id.name://修改属性名称按钮 | |||||
final QMUIDialog.EditTextDialogBuilder builder = new QMUIDialog.EditTextDialogBuilder(context); | |||||
builder.setTitle("属性名称") | |||||
.setPlaceholder("在此输入属性名称") | |||||
.setDefaultText(((BPA_GOODPROPERTY) data).name) | |||||
.setInputType(InputType.TYPE_CLASS_TEXT) | |||||
.addAction("取消", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
dialog.dismiss(); | dialog.dismiss(); | ||||
} else { | |||||
//请填入昵称 | |||||
ToastUtils.info("属性名称不能为空!"); | |||||
} | } | ||||
} | |||||
}) | |||||
.show(); | |||||
break; | |||||
case R.id.sort: | |||||
final QMUIDialog.EditTextDialogBuilder builder1 = new QMUIDialog.EditTextDialogBuilder(context); | |||||
builder1.setTitle("排序") | |||||
.setPlaceholder("在此输入排序") | |||||
.setDefaultText(((BPA_GOODPROPERTY) data).sort+"") | |||||
.setInputType(InputType.TYPE_CLASS_NUMBER) | |||||
.addAction("取消", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
dialog.dismiss(); | |||||
} | |||||
}) | |||||
.addAction("确定", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
CharSequence text = builder1.getEditText().getText(); | |||||
if (text != null && text.length() > 0) { | |||||
QueryDB.UpdateGoodsPropertySort(((BPA_GOODPROPERTY) data).id, Integer.parseInt(text.toString())); | |||||
Initdata_sx(); | |||||
}) | |||||
.addAction("确定", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
CharSequence text = builder.getEditText().getText(); | |||||
if (text != null && text.length() > 0) { | |||||
if (QueryDB.GetGoodsPropertyIs(text.toString())) { | |||||
ToastUtils.info("属性名称重复,请重新输入后重试!"); | |||||
return; | |||||
} | |||||
QueryDB.UpdateGoodsPropertyName(((BPA_GOODPROPERTY) data).id, text.toString()); | |||||
Initdata_sx(); | |||||
dialog.dismiss(); | |||||
} else { | |||||
//请填入昵称 | |||||
ToastUtils.info("属性名称不能为空!"); | |||||
} | |||||
} | |||||
}) | |||||
.show(); | |||||
break; | |||||
case R.id.sort: | |||||
final QMUIDialog.EditTextDialogBuilder builder1 = new QMUIDialog.EditTextDialogBuilder(context); | |||||
builder1.setTitle("排序") | |||||
.setPlaceholder("在此输入排序") | |||||
.setDefaultText(((BPA_GOODPROPERTY) data).sort+"") | |||||
.setInputType(InputType.TYPE_CLASS_NUMBER) | |||||
.addAction("取消", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
dialog.dismiss(); | dialog.dismiss(); | ||||
} else { | |||||
//请填入昵称 | |||||
ToastUtils.info("排序不能为空!"); | |||||
} | } | ||||
} | |||||
}) | |||||
.show(); | |||||
break; | |||||
case R.id.typeS: | |||||
ArrayList<Integer> keys=new ArrayList<Integer>(); | |||||
String[] items = itemstypes.keySet().toArray(new String[itemstypes.keySet().size()]); | |||||
}) | |||||
.addAction("确定", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
CharSequence text = builder1.getEditText().getText(); | |||||
if (text != null && text.length() > 0) { | |||||
QueryDB.UpdateGoodsPropertySort(((BPA_GOODPROPERTY) data).id, Integer.parseInt(text.toString())); | |||||
Initdata_sx(); | |||||
dialog.dismiss(); | |||||
} else { | |||||
//请填入昵称 | |||||
ToastUtils.info("排序不能为空!"); | |||||
} | |||||
} | |||||
}) | |||||
.show(); | |||||
break; | |||||
case R.id.typeS: | |||||
ArrayList<Integer> keys=new ArrayList<Integer>(); | |||||
String[] items = itemstypes.keySet().toArray(new String[itemstypes.keySet().size()]); | |||||
if(((BPA_GOODPROPERTY) data).GoodsTypeId!=null && !((BPA_GOODPROPERTY) data).GoodsTypeId.isEmpty()) | |||||
{ | |||||
for (int i=0;i<items.length;i++) | |||||
if(((BPA_GOODPROPERTY) data).GoodsTypeId!=null && !((BPA_GOODPROPERTY) data).GoodsTypeId.isEmpty()) | |||||
{ | { | ||||
if(((BPA_GOODPROPERTY) data).GoodsTypeId.contains(itemstypes.get(items[i]))) | |||||
for (int i=0;i<items.length;i++) | |||||
{ | { | ||||
keys.add(i); | |||||
if(((BPA_GOODPROPERTY) data).GoodsTypeId.contains(itemstypes.get(items[i]))) | |||||
{ | |||||
keys.add(i); | |||||
} | |||||
} | } | ||||
} | } | ||||
} | |||||
int []intarrs=new int[keys.size()]; | |||||
for(int i=0;i<intarrs.length;i++){ | |||||
intarrs[i]=keys.get(i); | |||||
} | |||||
int []intarrs=new int[keys.size()]; | |||||
for(int i=0;i<intarrs.length;i++){ | |||||
intarrs[i]=keys.get(i); | |||||
} | |||||
final QMUIDialog.MultiCheckableDialogBuilder builder3 = new QMUIDialog.MultiCheckableDialogBuilder(context) | |||||
.addItems(items, new DialogInterface.OnClickListener() { | |||||
@Override | |||||
public void onClick(DialogInterface dialog, int which) { | |||||
final QMUIDialog.MultiCheckableDialogBuilder builder3 = new QMUIDialog.MultiCheckableDialogBuilder(context) | |||||
.addItems(items, new DialogInterface.OnClickListener() { | |||||
@Override | |||||
public void onClick(DialogInterface dialog, int which) { | |||||
} | |||||
}) | |||||
.setCheckedItems(intarrs); | |||||
builder3.addAction("取消", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
dialog.dismiss(); | |||||
} | |||||
}); | |||||
builder3.addAction("确定", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
String result=""; | |||||
for(int i=0;i<builder3.getCheckedItemIndexes().length;i++){ | |||||
result+=""+itemstypes.get(items[builder3.getCheckedItemIndexes()[i]])+","; | |||||
} | |||||
}) | |||||
.setCheckedItems(intarrs); | |||||
builder3.addAction("取消", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
dialog.dismiss(); | |||||
} | } | ||||
}); | |||||
builder3.addAction("确定", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
String result=""; | |||||
for(int i=0;i<builder3.getCheckedItemIndexes().length;i++){ | |||||
result+=""+itemstypes.get(items[builder3.getCheckedItemIndexes()[i]])+","; | |||||
} | |||||
if(result.isEmpty()) | |||||
{ | |||||
ToastUtils.info("必须选择一个类型!"); | |||||
return; | |||||
} | |||||
if(result.isEmpty()) | |||||
{ | |||||
ToastUtils.info("必须选择一个类型!"); | |||||
return; | |||||
} | |||||
if(!result.isEmpty()) | |||||
{ | |||||
result=result.substring(0, result.length() - 1); | |||||
} | |||||
QueryDB.UpdateGoodsPropertyType(((BPA_GOODPROPERTY) data).id, result); | |||||
Initdata_sx(); | |||||
if(!result.isEmpty()) | |||||
{ | |||||
result=result.substring(0, result.length() - 1); | |||||
} | |||||
QueryDB.UpdateGoodsPropertyType(((BPA_GOODPROPERTY) data).id, result); | |||||
Initdata_sx(); | |||||
dialog.dismiss(); | |||||
} | |||||
}); | |||||
builder3.show(); | |||||
break; | |||||
case R.id.button_item://删除按钮 | |||||
String title = "温馨提示!"; | |||||
String message = "客官确定要删除属性【"+((BPA_GOODPROPERTY) data).name+"】吗?"; | |||||
AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
ArrayList<BPA_GOODPROPERTY> ddd=QueryDB.GetGoodsPropertyALL(((BPA_GOODPROPERTY) data).id); | |||||
for (BPA_GOODPROPERTY item:ddd) | |||||
{ | |||||
QueryDB.DeleteGoodsProperty(item); | |||||
dialog.dismiss(); | |||||
} | } | ||||
QueryDB.DeleteGoodsProperty((BPA_GOODPROPERTY) data); | |||||
Initdata_sx(); | |||||
ToastUtils.info("删除成功"); | |||||
dialog.dismiss(); | |||||
} | |||||
}); | |||||
}); | |||||
builder3.show(); | |||||
break; | |||||
case R.id.button_item://删除按钮 | |||||
String title = "温馨提示!"; | |||||
String message = "客官确定要删除属性【"+((BPA_GOODPROPERTY) data).name+"】吗?"; | |||||
AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
ArrayList<BPA_GOODPROPERTY> ddd=QueryDB.GetGoodsPropertyALL(((BPA_GOODPROPERTY) data).id); | |||||
for (BPA_GOODPROPERTY item:ddd) | |||||
{ | |||||
QueryDB.DeleteGoodsProperty(item); | |||||
} | |||||
QueryDB.DeleteGoodsProperty((BPA_GOODPROPERTY) data); | |||||
Initdata_sx(); | |||||
ToastUtils.info("删除成功"); | |||||
dialog.dismiss(); | |||||
} | |||||
}); | |||||
break; | |||||
case R.id.button_add://增加子属性 | |||||
BPA_GOODPROPERTY sx=(BPA_GOODPROPERTY) data; | |||||
BPA_GOODPROPERTY bpa_goodproperty = new BPA_GOODPROPERTY(); | |||||
bpa_goodproperty.name = "子属性示例"; | |||||
bpa_goodproperty.foreignKeyRe = ""; | |||||
bpa_goodproperty.parentid = sx.id; | |||||
bpa_goodproperty.sort=0; | |||||
bpa_goodproperty.deviceID = ConfigName.getInstance().DeviceId; | |||||
bpa_goodproperty.userID = ConfigName.getInstance().user.userID; | |||||
QueryDB.AddGoodsProperty(bpa_goodproperty); | |||||
ToastUtils.info("新增成功"); | |||||
Initdata_sx(); | |||||
break; | |||||
break; | |||||
case R.id.button_add://增加子属性 | |||||
BPA_GOODPROPERTY sx=(BPA_GOODPROPERTY) data; | |||||
BPA_GOODPROPERTY bpa_goodproperty = new BPA_GOODPROPERTY(); | |||||
bpa_goodproperty.name = "子属性示例"; | |||||
bpa_goodproperty.foreignKeyRe = ""; | |||||
bpa_goodproperty.parentid = sx.id; | |||||
bpa_goodproperty.sort=0; | |||||
bpa_goodproperty.deviceID = ConfigName.getInstance().DeviceId; | |||||
bpa_goodproperty.userID = ConfigName.getInstance().user.userID; | |||||
QueryDB.AddGoodsProperty(bpa_goodproperty); | |||||
ToastUtils.info("新增成功"); | |||||
Initdata_sx(); | |||||
break; | |||||
case R.id.save_text://保存属性 | |||||
QueryDB.UpdateGoodsProperty((BPA_GOODPROPERTY) data); | |||||
ToastUtils.info("保存成功"); | |||||
Initdata_sx(); | |||||
break; | |||||
case R.id.delete_text://删除 | |||||
String title1 = "温馨提示!"; | |||||
String message1 = "客官确定要删除属性【"+((BPA_GOODPROPERTY) data).name+"】吗?"; | |||||
AlertDialogUtils.showDialog(context, title1, message1, new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
QueryDB.DeleteGoodsProperty((BPA_GOODPROPERTY) data); | |||||
Initdata_sx(); | |||||
ToastUtils.info("删除成功"); | |||||
dialog.dismiss(); | |||||
} | |||||
}); | |||||
break; | |||||
case R.id.save_text://保存属性 | |||||
QueryDB.UpdateGoodsProperty((BPA_GOODPROPERTY) data); | |||||
ToastUtils.info("保存成功"); | |||||
Initdata_sx(); | |||||
break; | |||||
case R.id.delete_text://删除 | |||||
String title1 = "温馨提示!"; | |||||
String message1 = "客官确定要删除属性【"+((BPA_GOODPROPERTY) data).name+"】吗?"; | |||||
AlertDialogUtils.showDialog(context, title1, message1, new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
QueryDB.DeleteGoodsProperty((BPA_GOODPROPERTY) data); | |||||
Initdata_sx(); | |||||
ToastUtils.info("删除成功"); | |||||
dialog.dismiss(); | |||||
} | |||||
}); | |||||
break; | |||||
} | |||||
} | } | ||||
} | |||||
@Override | |||||
public void clickListenerNew(View v, int k, Object data) { | |||||
@Override | |||||
public void clickListenerNew(View v, int k, Object data) { | |||||
} | |||||
} | |||||
}; | |||||
// /** | |||||
// * 点击事件 | |||||
// * | |||||
// * @param v | |||||
// * @param data | |||||
// */ | |||||
// @Override | |||||
// public void clickListener(View v, Object data) { | |||||
// | |||||
// } | |||||
// | |||||
// @Override | |||||
// public void clickListenerNew(View v, int k, Object data) { | |||||
// | |||||
// } | |||||
//region 数据加载 | //region 数据加载 | ||||
/** | /** | ||||
* 初始化数据加载 | * 初始化数据加载 | ||||
@@ -322,7 +334,7 @@ public class Jcsjgl_sxgl_fragment extends BaseFragment implements MyClickListene | |||||
try { | try { | ||||
bpa_goodproperties = QueryDB.GetGoodsPropertyALL("0"); | bpa_goodproperties = QueryDB.GetGoodsPropertyALL("0"); | ||||
sx_adapter adapter = new sx_adapter(context, R.layout.sx_item, bpa_goodproperties, bpa_goodstypes,this); | |||||
sx_adapter adapter = new sx_adapter(context, R.layout.sx_item, bpa_goodproperties, bpa_goodstypes,listener); | |||||
datatab_sx.setAdapter(adapter); | datatab_sx.setAdapter(adapter); | ||||
} catch (Exception e) { | } catch (Exception e) { | ||||
@@ -334,6 +346,15 @@ public class Jcsjgl_sxgl_fragment extends BaseFragment implements MyClickListene | |||||
public void onDestroy() { | public void onDestroy() { | ||||
super.onDestroy(); | super.onDestroy(); | ||||
Logger.d("我的fragment销毁"); | Logger.d("我的fragment销毁"); | ||||
bpa_goodproperties.clear(); | |||||
bpa_goodproperties = null; | |||||
bpa_goodstypes.clear(); | |||||
bpa_goodstypes = null; | |||||
itemstypes.clear(); | |||||
itemstypes = null; | |||||
listener = null; | |||||
datatab_sx.setAdapter(null); | |||||
context = null; | |||||
} | } | ||||
/** | /** | ||||
@@ -30,6 +30,7 @@ import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | |||||
import com.bonait.bnframework.common.db.mode.BPA_SILOSANDMATERIAL; | import com.bonait.bnframework.common.db.mode.BPA_SILOSANDMATERIAL; | ||||
import com.bonait.bnframework.common.db.res.lcMode; | import com.bonait.bnframework.common.db.res.lcMode; | ||||
import com.bonait.bnframework.common.helper.I.MyClickListener; | import com.bonait.bnframework.common.helper.I.MyClickListener; | ||||
import com.bonait.bnframework.common.helper.MY; | |||||
import com.bonait.bnframework.common.utils.AlertDialogUtils; | import com.bonait.bnframework.common.utils.AlertDialogUtils; | ||||
import com.bonait.bnframework.common.utils.NetworkUtils; | import com.bonait.bnframework.common.utils.NetworkUtils; | ||||
import com.bonait.bnframework.common.utils.ToastUtils; | import com.bonait.bnframework.common.utils.ToastUtils; | ||||
@@ -47,7 +48,7 @@ import butterknife.BindView; | |||||
import butterknife.ButterKnife; | import butterknife.ButterKnife; | ||||
import butterknife.OnClick; | import butterknife.OnClick; | ||||
public class Jcsjgl_wl_fragment extends BaseFragment implements MyClickListener { | |||||
public class Jcsjgl_wl_fragment extends BaseFragment {// implements MyClickListener | |||||
@BindView(R.id.add_wl) | @BindView(R.id.add_wl) | ||||
Button add_wl; | Button add_wl; | ||||
@BindView(R.id.datatab_wl) | @BindView(R.id.datatab_wl) | ||||
@@ -175,7 +176,7 @@ public class Jcsjgl_wl_fragment extends BaseFragment implements MyClickListener | |||||
public void Initdata_wl() { | public void Initdata_wl() { | ||||
try { | try { | ||||
bpa_materials = QueryDB.GetMaterialALL(); | bpa_materials = QueryDB.GetMaterialALL(); | ||||
wl_adapter adapter = new wl_adapter(context, R.layout.wl_item, bpa_materials, this); | |||||
wl_adapter adapter = new wl_adapter(context, R.layout.wl_item, bpa_materials, listener); | |||||
datatab_wl.setAdapter(adapter); | datatab_wl.setAdapter(adapter); | ||||
} catch (Exception e) { | } catch (Exception e) { | ||||
@@ -190,6 +191,9 @@ public class Jcsjgl_wl_fragment extends BaseFragment implements MyClickListener | |||||
// DataBus.getInstance().mListener.clickListenerNew(this.getView(), 0, ""); | // DataBus.getInstance().mListener.clickListenerNew(this.getView(), 0, ""); | ||||
// } | // } | ||||
Logger.d("我的fragment销毁"); | Logger.d("我的fragment销毁"); | ||||
listener = null; | |||||
datatab_wl.setAdapter(null); | |||||
context = null; | |||||
} | } | ||||
/** | /** | ||||
@@ -206,68 +210,79 @@ public class Jcsjgl_wl_fragment extends BaseFragment implements MyClickListener | |||||
return false; | return false; | ||||
} | } | ||||
/** | |||||
* 点击事件 | |||||
* | |||||
* @param v | |||||
* @param data | |||||
*/ | |||||
@Override | |||||
public void clickListener(View v, Object data) { | |||||
switch (v.getId()) { | |||||
case R.id.name://修改物料名称按钮 | |||||
case R.id.button_update://修改物料名称按钮 | |||||
final QMUIDialog.EditTextDialogBuilder builder = new QMUIDialog.EditTextDialogBuilder(context); | |||||
builder.setTitle("物料名称") | |||||
.setPlaceholder("在此输入物料名称") | |||||
.setDefaultText(((BPA_MATERIAL) data).name) | |||||
.setInputType(InputType.TYPE_CLASS_TEXT) | |||||
.addAction("取消", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
dialog.dismiss(); | |||||
} | |||||
}) | |||||
.addAction("确定", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
CharSequence text = builder.getEditText().getText(); | |||||
if (text != null && text.length() > 0) { | |||||
if (QueryDB.GetMaterialIs(text.toString())) { | |||||
ToastUtils.info("物料名称重复,请重新输入后重试!"); | |||||
return; | |||||
} | |||||
QueryDB.UpdateMaterialName(((BPA_MATERIAL) data).id, text.toString()); | |||||
Initdata_wl(); | |||||
ToastUtils.info("修改成功"); | |||||
private MyClickListener listener = new MyClickListener() { | |||||
@Override | |||||
public void clickListener(View v, Object data) { | |||||
switch (v.getId()) { | |||||
case R.id.name://修改物料名称按钮 | |||||
case R.id.button_update://修改物料名称按钮 | |||||
final QMUIDialog.EditTextDialogBuilder builder = new QMUIDialog.EditTextDialogBuilder(context); | |||||
builder.setTitle("物料名称") | |||||
.setPlaceholder("在此输入物料名称") | |||||
.setDefaultText(((BPA_MATERIAL) data).name) | |||||
.setInputType(InputType.TYPE_CLASS_TEXT) | |||||
.addAction("取消", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
dialog.dismiss(); | dialog.dismiss(); | ||||
} else { | |||||
//请填入昵称 | |||||
ToastUtils.info("物料名称不能为空!"); | |||||
} | } | ||||
} | |||||
}) | |||||
.show(); | |||||
break; | |||||
case R.id.button_item://删除按钮 | |||||
String title = "温馨提示!"; | |||||
String message = "客官确定要删除物料【"+((BPA_MATERIAL) data).name+"】吗?"; | |||||
AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
QueryDB.DeleteMaterial((BPA_MATERIAL) data); | |||||
Initdata_wl(); | |||||
ToastUtils.info("删除成功"); | |||||
dialog.dismiss(); | |||||
} | |||||
}); | |||||
break; | |||||
}) | |||||
.addAction("确定", new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
CharSequence text = builder.getEditText().getText(); | |||||
if (text != null && text.length() > 0) { | |||||
if (QueryDB.GetMaterialIs(text.toString())) { | |||||
ToastUtils.info("物料名称重复,请重新输入后重试!"); | |||||
return; | |||||
} | |||||
QueryDB.UpdateMaterialName(((BPA_MATERIAL) data).id, text.toString()); | |||||
Initdata_wl(); | |||||
ToastUtils.info("修改成功"); | |||||
dialog.dismiss(); | |||||
} else { | |||||
//请填入昵称 | |||||
ToastUtils.info("物料名称不能为空!"); | |||||
} | |||||
} | |||||
}) | |||||
.show(); | |||||
break; | |||||
case R.id.button_item://删除按钮 | |||||
String title = "温馨提示!"; | |||||
String message = "客官确定要删除物料【"+((BPA_MATERIAL) data).name+"】吗?"; | |||||
AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() { | |||||
@Override | |||||
public void onClick(QMUIDialog dialog, int index) { | |||||
QueryDB.DeleteMaterial((BPA_MATERIAL) data); | |||||
Initdata_wl(); | |||||
ToastUtils.info("删除成功"); | |||||
dialog.dismiss(); | |||||
} | |||||
}); | |||||
break; | |||||
} | |||||
} | } | ||||
} | |||||
@Override | |||||
public void clickListenerNew(View v, int k, Object data) { | |||||
@Override | |||||
public void clickListenerNew(View v, int k, Object data) { | |||||
} | |||||
} | |||||
}; | |||||
// /** | |||||
// * 点击事件 | |||||
// * | |||||
// * @param v | |||||
// * @param data | |||||
// */ | |||||
// @Override | |||||
// public void clickListener(View v, Object data) { | |||||
// | |||||
// } | |||||
// | |||||
// @Override | |||||
// public void clickListenerNew(View v, int k, Object data) { | |||||
// | |||||
// } | |||||
} | } |
@@ -231,6 +231,20 @@ public class add_good_control extends LinearLayout { | |||||
public void destroy(){ | public void destroy(){ | ||||
MessageManager.getInstance().unRegisterMessageReceiver(activity_ma); | MessageManager.getInstance().unRegisterMessageReceiver(activity_ma); | ||||
Data = null; | |||||
mListener = null; | |||||
Types.clear(); | |||||
Types = null; | |||||
resMaterilas.clear(); | |||||
resMaterilas = null; | |||||
map_fl.clear(); | |||||
map_fl = null; | |||||
yesStr = null; | |||||
url = null; | |||||
if(recycler_view_wl!=null){ | |||||
recycler_view_wl.setAdapter(null); | |||||
} | |||||
activity_ma = null; | |||||
} | } | ||||
public String ids=""; | public String ids=""; | ||||
@@ -47,7 +47,7 @@ import java.util.ArrayList; | |||||
import butterknife.BindView; | import butterknife.BindView; | ||||
import butterknife.ButterKnife; | import butterknife.ButterKnife; | ||||
public class add_pf_control extends LinearLayout implements MyClickListener { | |||||
public class add_pf_control extends LinearLayout {// implements MyClickListener | |||||
@BindView(R.id.peifang_queren) | @BindView(R.id.peifang_queren) | ||||
@@ -202,7 +202,7 @@ public class add_pf_control extends LinearLayout implements MyClickListener { | |||||
{ | { | ||||
DataBus.getInstance().Recipe=new ArrayList<>(); | DataBus.getInstance().Recipe=new ArrayList<>(); | ||||
} | } | ||||
adapter4= new xxpf_adapter(getContext(), R.layout.xxpf_item, DataBus.getInstance().Recipe,this); | |||||
adapter4= new xxpf_adapter(getContext(), R.layout.xxpf_item, DataBus.getInstance().Recipe,listener); | |||||
datatab_pf.setAdapter(adapter4); | datatab_pf.setAdapter(adapter4); | ||||
} | } | ||||
@@ -322,6 +322,25 @@ public class add_pf_control extends LinearLayout implements MyClickListener { | |||||
if (activity != null) { | if (activity != null) { | ||||
MessageManager.getInstance().unRegisterMessageReceiver(activity); | MessageManager.getInstance().unRegisterMessageReceiver(activity); | ||||
} | } | ||||
listener = null; | |||||
resMaterilas.clear(); | |||||
bpa_goodproperties.clear(); | |||||
resMaterilas = null; | |||||
bpa_goodproperties = null; | |||||
if(adapter4!=null){ | |||||
adapter4.clear(); | |||||
adapter4 = null; | |||||
} | |||||
mListener = null; | |||||
if(datatab_sx!=null){ | |||||
datatab_sx.setAdapter(null); | |||||
datatab_pf.setAdapter(null); | |||||
} | |||||
acontext = null; | |||||
pfname = null; | |||||
ggids = null; | |||||
} | } | ||||
/** | /** | ||||
@@ -453,27 +472,39 @@ public class add_pf_control extends LinearLayout implements MyClickListener { | |||||
return true; | return true; | ||||
} | } | ||||
private MyClickListener listener = new MyClickListener() { | |||||
@Override | |||||
public void clickListener(View v, Object data) { | |||||
switch (v.getId()) { | |||||
case R.id.name://点击 修改 | |||||
/** | |||||
* 点击事件 | |||||
* | |||||
* @param v | |||||
* @param data | |||||
*/ | |||||
@Override | |||||
public void clickListener(View v, Object data) { | |||||
switch (v.getId()) { | |||||
case R.id.name://点击 修改 | |||||
break; | |||||
case R.id.button_item://删除按钮 | |||||
break; | |||||
case R.id.button_item://删除按钮 | |||||
break; | |||||
break; | |||||
} | |||||
} | } | ||||
} | |||||
@Override | |||||
public void clickListenerNew(View v, int k, Object data) { | |||||
@Override | |||||
public void clickListenerNew(View v, int k, Object data) { | |||||
} | |||||
} | |||||
}; | |||||
// /** | |||||
// * 点击事件 | |||||
// * | |||||
// * @param v | |||||
// * @param data | |||||
// */ | |||||
// @Override | |||||
// public void clickListener(View v, Object data) { | |||||
// | |||||
// } | |||||
// | |||||
// @Override | |||||
// public void clickListenerNew(View v, int k, Object data) { | |||||
// | |||||
// } | |||||
} | } |
@@ -32,7 +32,7 @@ import java.util.ArrayList; | |||||
import butterknife.BindView; | import butterknife.BindView; | ||||
import butterknife.ButterKnife; | import butterknife.ButterKnife; | ||||
public class add_pf_home_control extends LinearLayout implements MyClickListener { | |||||
public class add_pf_home_control extends LinearLayout {//implements MyClickListener | |||||
@BindView(R.id.title) | @BindView(R.id.title) | ||||
TextView title; | TextView title; | ||||
@@ -120,46 +120,65 @@ public class add_pf_home_control extends LinearLayout implements MyClickListene | |||||
{ | { | ||||
//根据商品查询配方 | //根据商品查询配方 | ||||
ArrayList<BPA_GOODSRECIPENAME> goodsrecipenames=QueryDB.GetGoodsRecipeNameGoodId(good.id); | ArrayList<BPA_GOODSRECIPENAME> goodsrecipenames=QueryDB.GetGoodsRecipeNameGoodId(good.id); | ||||
goodpf_apapter adapter = new goodpf_apapter(getContext(), R.layout.wl_item, goodsrecipenames, this); | |||||
goodpf_apapter adapter = new goodpf_apapter(getContext(), R.layout.wl_item, goodsrecipenames, listener); | |||||
datatab_pf.setAdapter(adapter); | datatab_pf.setAdapter(adapter); | ||||
} | } | ||||
} | } | ||||
private MyClickListener listener = new MyClickListener() { | |||||
@Override | |||||
public void clickListener(View v, Object data) { | |||||
switch (v.getId()) { | |||||
case R.id.button_update://点击 修改 | |||||
SelectData =(BPA_GOODSRECIPENAME)data; | |||||
if (mListener != null) { | |||||
mListener.clickListenerNew(v,2,good); | |||||
} | |||||
break; | |||||
case R.id.button_item://删除按钮 | |||||
ArrayList<ResGoodsRecipe> re= QueryDB.GetGoodsSreciperecipeList(((BPA_GOODSRECIPENAME) data).id); | |||||
for(ResGoodsRecipe item:re) | |||||
{ | |||||
QueryDB.DeleteGoodsSrecipe(item); | |||||
} | |||||
QueryDB.DeleteGoodsRecipeName((BPA_GOODSRECIPENAME) data); | |||||
Initdata_pf(); | |||||
ToastUtils.info("删除成功"); | |||||
break; | |||||
} | |||||
} | |||||
@Override | |||||
public void clickListenerNew(View v, int k, Object data) { | |||||
public BPA_GOODSRECIPENAME SelectData; | |||||
/** | |||||
* 点击事件 | |||||
* | |||||
* @param v | |||||
* @param data | |||||
*/ | |||||
@Override | |||||
public void clickListener(View v, Object data) { | |||||
switch (v.getId()) { | |||||
case R.id.button_update://点击 修改 | |||||
SelectData =(BPA_GOODSRECIPENAME)data; | |||||
if (mListener != null) { | |||||
mListener.clickListenerNew(v,2,good); | |||||
} | |||||
break; | |||||
case R.id.button_item://删除按钮 | |||||
ArrayList<ResGoodsRecipe> re= QueryDB.GetGoodsSreciperecipeList(((BPA_GOODSRECIPENAME) data).id); | |||||
for(ResGoodsRecipe item:re) | |||||
{ | |||||
QueryDB.DeleteGoodsSrecipe(item); | |||||
} | |||||
QueryDB.DeleteGoodsRecipeName((BPA_GOODSRECIPENAME) data); | |||||
Initdata_pf(); | |||||
ToastUtils.info("删除成功"); | |||||
break; | |||||
} | } | ||||
} | |||||
@Override | |||||
public void clickListenerNew(View v, int k, Object data) { | |||||
}; | |||||
public BPA_GOODSRECIPENAME SelectData; | |||||
// /** | |||||
// * 点击事件 | |||||
// * | |||||
// * @param v | |||||
// * @param data | |||||
// */ | |||||
// @Override | |||||
// public void clickListener(View v, Object data) { | |||||
// | |||||
// } | |||||
// | |||||
// @Override | |||||
// public void clickListenerNew(View v, int k, Object data) { | |||||
// | |||||
// } | |||||
public void destroy(){ | |||||
datatab_pf.setAdapter(null); | |||||
datatab_pf = null; | |||||
good = null; | |||||
SelectData = null; | |||||
mListener = null; | |||||
listener = null; | |||||
} | } | ||||
} | } |
@@ -393,4 +393,16 @@ public class add_yijian_controlextends extends LinearLayout { | |||||
} | } | ||||
//endregion | //endregion | ||||
public void destroy(){ | |||||
if(mHandler!=null){ | |||||
mHandler.removeCallbacksAndMessages(null); | |||||
mHandler = null; | |||||
} | |||||
siloslist.clear(); | |||||
siloslist = null; | |||||
mListener = null; | |||||
map_fl.clear(); | |||||
map_fl = null; | |||||
editsp_fl = null; | |||||
} | |||||
} | } |
@@ -16,6 +16,7 @@ import android.widget.TextView; | |||||
import androidx.annotation.Nullable; | import androidx.annotation.Nullable; | ||||
import androidx.fragment.app.FragmentManager; | import androidx.fragment.app.FragmentManager; | ||||
import com.apkfuns.logutils.LogUtils; | |||||
import com.bonait.bnframework.HBL.Dialog.AlertDialogButton; | import com.bonait.bnframework.HBL.Dialog.AlertDialogButton; | ||||
import com.bonait.bnframework.HBL.Dialog.DialogManager; | import com.bonait.bnframework.HBL.Dialog.DialogManager; | ||||
import com.bonait.bnframework.HBL.Dialog.WaitDialog; | import com.bonait.bnframework.HBL.Dialog.WaitDialog; | ||||
@@ -141,8 +142,9 @@ public class silos_jiaoyan extends LinearLayout { | |||||
BPA_SILOS_CALIBRATE res = QueryDB.GetSilosCalibrateByNum(lcMode.num); | BPA_SILOS_CALIBRATE res = QueryDB.GetSilosCalibrateByNum(lcMode.num); | ||||
if(res!=null){ | if(res!=null){ | ||||
min_time.setText(String.valueOf(res.outputTimeMin)); | |||||
max_time.setText(String.valueOf(res.outputTimeMax)); | |||||
LogUtils.d(" BPA_SILOS_CALIBRATE res.outputTimeMin="+res.toString()); | |||||
min_time.setText(res.outputTimeMin+""); | |||||
max_time.setText(res.outputTimeMax+""); | |||||
min_weight.setText(res.inputWightMin+""); | min_weight.setText(res.inputWightMin+""); | ||||
max_weight.setText(res.inputWightMax+""); | max_weight.setText(res.inputWightMax+""); | ||||
}else{ | }else{ | ||||
@@ -241,7 +243,14 @@ public class silos_jiaoyan extends LinearLayout { | |||||
private TimerTask timerTask; | private TimerTask timerTask; | ||||
public void show(){ | public void show(){ | ||||
close(); | |||||
if(timer!=null){ | |||||
timer.cancel(); | |||||
timer = null; | |||||
} | |||||
if(timerTask!=null){ | |||||
timerTask.cancel(); | |||||
timerTask = null; | |||||
} | |||||
setVisibility(VISIBLE); | setVisibility(VISIBLE); | ||||
timer = new Timer(); | timer = new Timer(); | ||||
timerTask = new TimerTask() { | timerTask = new TimerTask() { | ||||
@@ -256,7 +265,7 @@ public class silos_jiaoyan extends LinearLayout { | |||||
timer.schedule(timerTask,500,500); | timer.schedule(timerTask,500,500); | ||||
} | } | ||||
public void close(){ | |||||
public void destroy(){ | |||||
setVisibility(GONE); | setVisibility(GONE); | ||||
if(mHandler!=null){ | if(mHandler!=null){ | ||||
mHandler.removeCallbacksAndMessages(null); | mHandler.removeCallbacksAndMessages(null); | ||||
@@ -16,6 +16,7 @@ import com.bonait.bnframework.business.MainInit; | |||||
import com.bonait.bnframework.common.base.BaseActivity; | import com.bonait.bnframework.common.base.BaseActivity; | ||||
import com.bonait.bnframework.common.constant.ConfigName; | import com.bonait.bnframework.common.constant.ConfigName; | ||||
import com.bonait.bnframework.common.constant.Constants; | import com.bonait.bnframework.common.constant.Constants; | ||||
import com.bonait.bnframework.common.utils.DisplayManager; | |||||
import com.bonait.bnframework.common.utils.ScreenUtils; | import com.bonait.bnframework.common.utils.ScreenUtils; | ||||
import com.bonait.bnframework.manager.ActivityLifecycleManager; | import com.bonait.bnframework.manager.ActivityLifecycleManager; | ||||
import com.lzy.okgo.OkGo; | import com.lzy.okgo.OkGo; | ||||
@@ -40,6 +41,8 @@ public class WelcomeActivity extends BaseActivity { | |||||
super.onCreate(savedInstanceState); | super.onCreate(savedInstanceState); | ||||
setContentView(R.layout.activity_welcome); | setContentView(R.layout.activity_welcome); | ||||
initWelcome(); | initWelcome(); | ||||
DisplayManager.setReferenceMaxWidthHeight(800, 1208); | |||||
DisplayManager.updateDisplayInfo(this); | |||||
} | } | ||||
private void initWelcome() { | private void initWelcome() { | ||||
@@ -118,6 +118,7 @@ | |||||
android:layout_height="100dp" | android:layout_height="100dp" | ||||
app:imagesrc="@mipmap/silos1" | app:imagesrc="@mipmap/silos1" | ||||
android:tag="一键满管" | android:tag="一键满管" | ||||
android:visibility="gone" | |||||
/> | /> | ||||
<com.bonait.bnframework.modules.home.fragment.mode.ImageButtonControl | <com.bonait.bnframework.modules.home.fragment.mode.ImageButtonControl | ||||
@@ -134,6 +135,7 @@ | |||||
android:layout_height="100dp" | android:layout_height="100dp" | ||||
app:imagesrc="@mipmap/silos3" | app:imagesrc="@mipmap/silos3" | ||||
android:tag="一键清洗" | android:tag="一键清洗" | ||||
android:visibility="gone" | |||||
android:layout_marginTop="20dp"/> | android:layout_marginTop="20dp"/> | ||||
<com.bonait.bnframework.modules.home.fragment.mode.ImageButtonControl | <com.bonait.bnframework.modules.home.fragment.mode.ImageButtonControl | ||||
@@ -32,7 +32,7 @@ | |||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:layout_centerInParent="true" | android:layout_centerInParent="true" | ||||
android:layout_marginLeft="5dp" | android:layout_marginLeft="5dp" | ||||
android:text="清炒三月瓜" | |||||
tools:text="清炒三月瓜" | |||||
android:textColor="@color/black" | android:textColor="@color/black" | ||||
android:textSize="20sp" | android:textSize="20sp" | ||||
tools:ignore="MissingConstraints" /> | tools:ignore="MissingConstraints" /> | ||||