@@ -4,10 +4,10 @@ | |||||
<selectionStates> | <selectionStates> | ||||
<SelectionState runConfigName="app"> | <SelectionState runConfigName="app"> | ||||
<option name="selectionMode" value="DROPDOWN" /> | <option name="selectionMode" value="DROPDOWN" /> | ||||
<DropdownSelection timestamp="2024-05-30T07:26:51.182873700Z"> | |||||
<DropdownSelection timestamp="2024-05-31T01:56:05.992353200Z"> | |||||
<Target type="DEFAULT_BOOT"> | <Target type="DEFAULT_BOOT"> | ||||
<handle> | <handle> | ||||
<DeviceId pluginId="Default" identifier="serial=127.0.0.1:7555;connection=c8bf86d2" /> | |||||
<DeviceId pluginId="Default" identifier="serial=10.24.61.116:5555;connection=ddfc653b" /> | |||||
</handle> | </handle> | ||||
</Target> | </Target> | ||||
</DropdownSelection> | </DropdownSelection> | ||||
@@ -38,6 +38,30 @@ public class ProcessValueUtil { | |||||
return stringBuffer.toString(); | return stringBuffer.toString(); | ||||
} | } | ||||
public static String dealProcessSms(String value){ | |||||
StringBuilder stringBuffer = new StringBuilder(); | |||||
stringBuffer.append("("); | |||||
if(value.contains("|")){ | |||||
String[] res = value.split("\\|"); | |||||
for(String s:res){ | |||||
if(s.contains(",")){ | |||||
String[] res2 = s.split(","); | |||||
stringBuffer.append(res2[1]).append(","); | |||||
}else { | |||||
stringBuffer.append(s).append(","); | |||||
} | |||||
} | |||||
}else { | |||||
if(value.contains(",")){ | |||||
String[] res2 = value.split(","); | |||||
stringBuffer.append(res2[1]).append(","); | |||||
}else { | |||||
stringBuffer.append(value).append(","); | |||||
} | |||||
} | |||||
return stringBuffer.toString().substring(0,stringBuffer.length()-1)+")"; | |||||
} | |||||
public static HashMap<String,String> dealProcessValueToJson(String value){ | public static HashMap<String,String> dealProcessValueToJson(String value){ | ||||
HashMap<String,String> map = new HashMap<>(); | HashMap<String,String> map = new HashMap<>(); | ||||
if (value.contains("|")) { | if (value.contains("|")) { | ||||
@@ -11,6 +11,7 @@ import com.bonait.bnframework.HBL.Logs.MessageLog; | |||||
import com.bonait.bnframework.HBL.Result.OperateResultT; | import com.bonait.bnframework.HBL.Result.OperateResultT; | ||||
import com.bonait.bnframework.HBL.Thread.ThreadManager; | import com.bonait.bnframework.HBL.Thread.ThreadManager; | ||||
import com.bonait.bnframework.business.ExecuteTheRecipe; | import com.bonait.bnframework.business.ExecuteTheRecipe; | ||||
import com.bonait.bnframework.business.NewExecuteTheRecipe; | |||||
import com.bonait.bnframework.common.constant.ConfigName; | import com.bonait.bnframework.common.constant.ConfigName; | ||||
import com.bonait.bnframework.common.db.mode.BPA_SILOS_CALIBRATE; | import com.bonait.bnframework.common.db.mode.BPA_SILOS_CALIBRATE; | ||||
import com.bonait.bnframework.ui.widget.NewToastUtil; | import com.bonait.bnframework.ui.widget.NewToastUtil; | ||||
@@ -382,14 +383,14 @@ public class ModbusHelper extends ModbusMaster { | |||||
*/ | */ | ||||
public boolean readUpdDownStop(int status){ | public boolean readUpdDownStop(int status){ | ||||
if(status == 2){ | if(status == 2){ | ||||
NewToastUtil.getInstance().showToast("工序: 搅拌爪正在下降"); | |||||
// NewToastUtil.getInstance().showToast("工序: 搅拌爪正在下降"); | |||||
OperateResultT<Boolean> resultT = ReadBool(getPLC(ControlAdress.下降).PlcAddress); | OperateResultT<Boolean> resultT = ReadBool(getPLC(ControlAdress.下降).PlcAddress); | ||||
if(resultT == null){ | if(resultT == null){ | ||||
return false; | return false; | ||||
} | } | ||||
return resultT.Content != null && resultT.Content; | return resultT.Content != null && resultT.Content; | ||||
}else { | }else { | ||||
NewToastUtil.getInstance().showToast("工序: 搅拌爪正在上升"); | |||||
// NewToastUtil.getInstance().showToast("工序: 搅拌爪正在上升"); | |||||
OperateResultT<Boolean> resultT = ReadBool(getPLC(ControlAdress.上升).PlcAddress); | OperateResultT<Boolean> resultT = ReadBool(getPLC(ControlAdress.上升).PlcAddress); | ||||
if(resultT == null){ | if(resultT == null){ | ||||
return false; | return false; | ||||
@@ -439,11 +440,10 @@ public class ModbusHelper extends ModbusMaster { | |||||
* 搅拌停止 | * 搅拌停止 | ||||
*/ | */ | ||||
public boolean setStirStop(){ | public boolean setStirStop(){ | ||||
OperateResultT<Boolean> resultT = ReadBool(getPLC(ControlAdress.搅拌模式).PlcAddress); | |||||
OperateResultT<Boolean> resultT = ReadBool(getPLC(ControlAdress.搅拌停止).PlcAddress); | |||||
if(resultT == null){ | if(resultT == null){ | ||||
return false; | return false; | ||||
} | } | ||||
// LogUtils.d(TAG+"搅拌模式 setStirStop "); | |||||
return resultT.Content != null && resultT.Content; | return resultT.Content != null && resultT.Content; | ||||
} | } | ||||
@@ -514,19 +514,30 @@ public class ModbusHelper extends ModbusMaster { | |||||
public void reset(){ | public void reset(){ | ||||
try { | try { | ||||
NewToastUtil.getInstance().showToast("正在复位"); | |||||
Heating(0,false); | Heating(0,false); | ||||
setStirMotor(0,2); | setStirMotor(0,2); | ||||
Thread.sleep(50); | |||||
boolean isStop = true; | |||||
boolean stirStop = true; | |||||
long lastTime = System.currentTimeMillis(); | long lastTime = System.currentTimeMillis(); | ||||
while (isStop){ | |||||
while (stirStop){ | |||||
if(System.currentTimeMillis() - lastTime > 30*1000){ | if(System.currentTimeMillis() - lastTime > 30*1000){ | ||||
break; | break; | ||||
} | } | ||||
isStop = ConfigName.TEST?false:setStirStop(); | |||||
stirStop = ConfigName.TEST?false:setStirStop(); | |||||
Thread.sleep(10); | |||||
} | } | ||||
setUpdDownMotor(1); | setUpdDownMotor(1); | ||||
long t = System.currentTimeMillis(); | |||||
boolean upStop = true; | |||||
while (upStop && !hasErrorInfo()){ | |||||
if(System.currentTimeMillis() - t > 30*1000){ | |||||
break; | |||||
} | |||||
upStop = ConfigName.TEST?false: ModbusHelper.get().readUpdDownStop(1); | |||||
Thread.sleep(10); | |||||
} | |||||
setCookStatus(false); | setCookStatus(false); | ||||
NewToastUtil.getInstance().showToast("完成复位"); | |||||
} catch (InterruptedException e) { | } catch (InterruptedException e) { | ||||
throw new RuntimeException(e); | throw new RuntimeException(e); | ||||
} | } | ||||
@@ -654,6 +665,9 @@ public class ModbusHelper extends ModbusMaster { | |||||
upDownError = ModbusHelper.get().getUpDownError(); | upDownError = ModbusHelper.get().getUpDownError(); | ||||
downError = ModbusHelper.get().getDownError(); | downError = ModbusHelper.get().getDownError(); | ||||
stirError = ModbusHelper.get().getStirError(); | stirError = ModbusHelper.get().getStirError(); | ||||
if(isBtnStop||upError||upDownError||downError||stirError){ | |||||
NewExecuteTheRecipe.IsStart =false; | |||||
} | |||||
Thread.sleep(ConfigName.TEST?500:200); | Thread.sleep(ConfigName.TEST?500:200); | ||||
}); | }); | ||||
} | } | ||||
@@ -167,7 +167,7 @@ public class NewExecuteTheRecipe { | |||||
} | } | ||||
} | } | ||||
isCHeckSilosEnd = isEnd; | isCHeckSilosEnd = isEnd; | ||||
Thread.sleep(50); | |||||
Thread.sleep(10); | |||||
} | } | ||||
} | } | ||||
if(isTest&& IsStart){ | if(isTest&& IsStart){ | ||||
@@ -334,7 +334,6 @@ public class NewExecuteTheRecipe { | |||||
if(!isTest){ | if(!isTest){ | ||||
ModbusHelper.get().setStirMotor(0,2); | ModbusHelper.get().setStirMotor(0,2); | ||||
} | } | ||||
Thread.sleep(50); | |||||
boolean isStop = true; | boolean isStop = true; | ||||
long lastTime = System.currentTimeMillis(); | long lastTime = System.currentTimeMillis(); | ||||
while (IsStart&&isStop && !isTest){ | while (IsStart&&isStop && !isTest){ | ||||
@@ -342,7 +341,7 @@ public class NewExecuteTheRecipe { | |||||
break; | break; | ||||
} | } | ||||
isStop = ConfigName.TEST?false:ModbusHelper.get().setStirStop(); | isStop = ConfigName.TEST?false:ModbusHelper.get().setStirStop(); | ||||
Thread.sleep(50); | |||||
Thread.sleep(10); | |||||
} | } | ||||
if(isTest && IsStart){ | if(isTest && IsStart){ | ||||
Thread.sleep(1000); | Thread.sleep(1000); | ||||
@@ -414,7 +413,6 @@ public class NewExecuteTheRecipe { | |||||
if(!isTest){ | if(!isTest){ | ||||
ModbusHelper.get().setStirMotor(0,2); | ModbusHelper.get().setStirMotor(0,2); | ||||
} | } | ||||
Thread.sleep(50); | |||||
boolean isStop = true; | boolean isStop = true; | ||||
long lastTime = System.currentTimeMillis(); | long lastTime = System.currentTimeMillis(); | ||||
while (IsStart&&isStop &&!isTest){ | while (IsStart&&isStop &&!isTest){ | ||||
@@ -422,7 +420,7 @@ public class NewExecuteTheRecipe { | |||||
break; | break; | ||||
} | } | ||||
isStop = ConfigName.TEST?false:ModbusHelper.get().setStirStop(); | isStop = ConfigName.TEST?false:ModbusHelper.get().setStirStop(); | ||||
Thread.sleep(50); | |||||
Thread.sleep(10); | |||||
} | } | ||||
if(IsStart && isTest){ | if(IsStart && isTest){ | ||||
Thread.sleep(1000); | Thread.sleep(1000); | ||||
@@ -482,7 +480,7 @@ public class NewExecuteTheRecipe { | |||||
break; | break; | ||||
}else { | }else { | ||||
isCHeckSilosEnd= ConfigName.TEST?true:Read_MainFood(position); | isCHeckSilosEnd= ConfigName.TEST?true:Read_MainFood(position); | ||||
Thread.sleep(50); | |||||
Thread.sleep(10); | |||||
} | } | ||||
} | } | ||||
if(IsStart && isTest){ | if(IsStart && isTest){ | ||||
@@ -601,7 +599,7 @@ public class NewExecuteTheRecipe { | |||||
break; | break; | ||||
}else { | }else { | ||||
isCHeckSilosEnd = !Read_Water(); | isCHeckSilosEnd = !Read_Water(); | ||||
Thread.sleep(100); | |||||
Thread.sleep(10); | |||||
} | } | ||||
} | } | ||||
if(IsStart && isTest){ | if(IsStart && isTest){ | ||||
@@ -680,7 +678,6 @@ public class NewExecuteTheRecipe { | |||||
} | } | ||||
ModbusHelper.get().Heating(0,false); | ModbusHelper.get().Heating(0,false); | ||||
ModbusHelper.get().setStirMotor(0,2); | ModbusHelper.get().setStirMotor(0,2); | ||||
Thread.sleep(50); | |||||
boolean isStop = true; | boolean isStop = true; | ||||
long lastTime = System.currentTimeMillis(); | long lastTime = System.currentTimeMillis(); | ||||
while (IsStart && isStop){ | while (IsStart && isStop){ | ||||
@@ -688,7 +685,7 @@ public class NewExecuteTheRecipe { | |||||
break; | break; | ||||
} | } | ||||
isStop = ConfigName.TEST?false: ModbusHelper.get().setStirStop(); | isStop = ConfigName.TEST?false: ModbusHelper.get().setStirStop(); | ||||
Thread.sleep(100); | |||||
Thread.sleep(10); | |||||
} | } | ||||
ModbusHelper.get().setUpdDownMotor(1); | ModbusHelper.get().setUpdDownMotor(1); | ||||
ModbusHelper.get().setCookStatus(false); | ModbusHelper.get().setCookStatus(false); | ||||
@@ -727,7 +724,7 @@ public class NewExecuteTheRecipe { | |||||
break; | break; | ||||
}else { | }else { | ||||
isCHeckSilosEnd = !Read_ThickenWater(); | isCHeckSilosEnd = !Read_ThickenWater(); | ||||
Thread.sleep(100); | |||||
Thread.sleep(10); | |||||
} | } | ||||
} | } | ||||
if(IsStart && isTest){ | if(IsStart && isTest){ | ||||
@@ -780,7 +777,18 @@ public class NewExecuteTheRecipe { | |||||
if(!isTest){ | if(!isTest){ | ||||
ModbusHelper.get().setUpdDownMotor(1); | ModbusHelper.get().setUpdDownMotor(1); | ||||
} | } | ||||
Thread.sleep(50); | |||||
ModbusHelper.get().setStirMotor(0,2); | |||||
boolean stirStop = true; | |||||
long t = System.currentTimeMillis(); | |||||
while (stirStop){ | |||||
if(System.currentTimeMillis() - t > 30*1000){ | |||||
break; | |||||
} | |||||
stirStop = ConfigName.TEST?false:ModbusHelper.get().setStirStop(); | |||||
Thread.sleep(10); | |||||
} | |||||
EventBus.getDefault().post(new ProcessMakingEvent(4,"停止搅拌")); | |||||
boolean isStop = true; | boolean isStop = true; | ||||
long lastTime = System.currentTimeMillis(); | long lastTime = System.currentTimeMillis(); | ||||
while (IsStart && isStop&&!isTest){ | while (IsStart && isStop&&!isTest){ | ||||
@@ -788,10 +796,10 @@ public class NewExecuteTheRecipe { | |||||
break; | break; | ||||
} | } | ||||
isStop = ConfigName.TEST?false: ModbusHelper.get().readUpdDownStop(1); | isStop = ConfigName.TEST?false: ModbusHelper.get().readUpdDownStop(1); | ||||
Thread.sleep(100); | |||||
Thread.sleep(10); | |||||
} | } | ||||
if(IsStart && isTest){ | if(IsStart && isTest){ | ||||
for(int i = 0;i<16 ;i++){ | |||||
for(int i = 0;i<8 ;i++){ | |||||
if(!IsStart){ | if(!IsStart){ | ||||
break; | break; | ||||
} | } | ||||
@@ -804,7 +812,6 @@ public class NewExecuteTheRecipe { | |||||
if(!isTest){ | if(!isTest){ | ||||
ModbusHelper.get().setUpdDownMotor(2); | ModbusHelper.get().setUpdDownMotor(2); | ||||
} | } | ||||
Thread.sleep(50); | |||||
boolean isStop = true; | boolean isStop = true; | ||||
long lastTime = System.currentTimeMillis(); | long lastTime = System.currentTimeMillis(); | ||||
while (IsStart && isStop && !isTest){ | while (IsStart && isStop && !isTest){ | ||||
@@ -812,10 +819,10 @@ public class NewExecuteTheRecipe { | |||||
break; | break; | ||||
} | } | ||||
isStop = ConfigName.TEST?false: ModbusHelper.get().readUpdDownStop(2); | isStop = ConfigName.TEST?false: ModbusHelper.get().readUpdDownStop(2); | ||||
Thread.sleep(100); | |||||
Thread.sleep(10); | |||||
} | } | ||||
if(IsStart && isTest){ | if(IsStart && isTest){ | ||||
for(int i = 0;i<16 ;i++){ | |||||
for(int i = 0;i<8 ;i++){ | |||||
if(!IsStart){ | if(!IsStart){ | ||||
break; | break; | ||||
} | } | ||||
@@ -27,7 +27,7 @@ import java.util.concurrent.ConcurrentHashMap; | |||||
*/ | */ | ||||
public class ConfigName { | public class ConfigName { | ||||
//是否是测试模式 | //是否是测试模式 | ||||
public final static boolean TEST = true; | |||||
public final static boolean TEST = false; | |||||
//日志打印 | //日志打印 | ||||
public final static boolean LOG_TEST = false; | public final static boolean LOG_TEST = false; | ||||
//region 单例模式 | //region 单例模式 | ||||
@@ -104,6 +104,7 @@ public class GlideUtil { | |||||
return false; | return false; | ||||
} | } | ||||
}) | }) | ||||
.placeholder(placeId) | |||||
.transition(DrawableTransitionOptions.withCrossFade(CROSS_FADE_DURATION)) | .transition(DrawableTransitionOptions.withCrossFade(CROSS_FADE_DURATION)) | ||||
// .apply(RequestOptions.bitmapTransform(new RoundedCorners(RADIUS))) | // .apply(RequestOptions.bitmapTransform(new RoundedCorners(RADIUS))) | ||||
.apply(new RequestOptions().transform(new FitXYRoundRadiusTransform(DimensUtil.getDimens(radius)))) | .apply(new RequestOptions().transform(new FitXYRoundRadiusTransform(DimensUtil.getDimens(radius)))) | ||||
@@ -181,11 +181,6 @@ public class CookingActivity extends BaseActivity { | |||||
* 复位 | * 复位 | ||||
*/ | */ | ||||
private void setReset() { | private void setReset() { | ||||
if(!isTest){ | |||||
ThreadManager.get().execute(new Thread(()->{ | |||||
ModbusHelper.get().reset(); | |||||
})); | |||||
} | |||||
stepAdapter.setCurrentPosition(-1); | stepAdapter.setCurrentPosition(-1); | ||||
stepAdapter.notifyDataSetChanged(); | stepAdapter.notifyDataSetChanged(); | ||||
@@ -236,6 +231,7 @@ public class CookingActivity extends BaseActivity { | |||||
private void startMakingThread(){ | private void startMakingThread(){ | ||||
ThreadManager.get().execute(new Thread(()->{ | ThreadManager.get().execute(new Thread(()->{ | ||||
if (NewExecuteTheRecipe.IsStart && goodsSubattributeGroup != null) { | if (NewExecuteTheRecipe.IsStart && goodsSubattributeGroup != null) { | ||||
ModbusHelper.get().reset(); | |||||
long startTime= System.currentTimeMillis(); //起始时间 | long startTime= System.currentTimeMillis(); //起始时间 | ||||
boolean isError = false; | boolean isError = false; | ||||
try { | try { | ||||
@@ -286,14 +282,16 @@ public class CookingActivity extends BaseActivity { | |||||
NewToastUtil.getInstance().showToastError("异常信息:" + ex.getMessage()); | NewToastUtil.getInstance().showToastError("异常信息:" + ex.getMessage()); | ||||
} finally { | } finally { | ||||
isMaking = false; | isMaking = false; | ||||
NewExecuteTheRecipe.IsStart = false; | |||||
if (!NewExecuteTheRecipe.IsForcedEnd && !isError && !isTest){ | |||||
if (!NewExecuteTheRecipe.IsForcedEnd && !ModbusHelper.get().hasErrorInfo() && NewExecuteTheRecipe.IsStart && !isTest){ | |||||
long endTime = System.currentTimeMillis(); //结束时间 | long endTime = System.currentTimeMillis(); //结束时间 | ||||
int time=(int) ((endTime-startTime)/1000); | int time=(int) ((endTime-startTime)/1000); | ||||
LogUtils.d("运行时长 "+String.format("方法使用时间 %d s",time)); | LogUtils.d("运行时长 "+String.format("方法使用时间 %d s",time)); | ||||
SubAttributeGroupDBUtil.updateMakeTime(goodsSubattributeGroup.id,time); | SubAttributeGroupDBUtil.updateMakeTime(goodsSubattributeGroup.id,time); | ||||
goodsSubattributeGroup.maketime = time; | goodsSubattributeGroup.maketime = time; | ||||
} | } | ||||
NewExecuteTheRecipe.IsStart = false; | |||||
ModbusHelper.get().reset(); | |||||
boolean finalIsError = isError; | boolean finalIsError = isError; | ||||
if(handler!=null){ | if(handler!=null){ | ||||
handler.post(new Runnable() { | handler.post(new Runnable() { | ||||
@@ -246,6 +246,9 @@ public class DiyProcessActivity extends BaseActivity { | |||||
viewBinding.btnInsertDown.setOnClickListener(view -> { | viewBinding.btnInsertDown.setOnClickListener(view -> { | ||||
insertDownProcess(); | insertDownProcess(); | ||||
}); | }); | ||||
/** | |||||
*导入工序 | |||||
*/ | |||||
viewBinding.btnCopyProcess.setOnClickListener(view -> { | viewBinding.btnCopyProcess.setOnClickListener(view -> { | ||||
if(attributeSelectDialog == null){ | if(attributeSelectDialog == null){ | ||||
attributeSelectDialog = new AttributeSelectDialog(); | attributeSelectDialog = new AttributeSelectDialog(); | ||||
@@ -259,6 +262,7 @@ public class DiyProcessActivity extends BaseActivity { | |||||
public void submit() { | public void submit() { | ||||
processDetails.clear(); | processDetails.clear(); | ||||
processDetails = GoodsProcessDetailDBUtil.getByGroupId(subAttributeGroupId); | processDetails = GoodsProcessDetailDBUtil.getByGroupId(subAttributeGroupId); | ||||
changeMainFoods(); | |||||
stepAdapter.setCurrentPosition(0); | stepAdapter.setCurrentPosition(0); | ||||
stepAdapter.setNewData(processDetails); | stepAdapter.setNewData(processDetails); | ||||
if(!processDetails.isEmpty()){ | if(!processDetails.isEmpty()){ | ||||
@@ -610,6 +614,68 @@ public class DiyProcessActivity extends BaseActivity { | |||||
} | } | ||||
} | } | ||||
private void changeMainFoods(){ | |||||
mainFoods.clear(); | |||||
String main1 = ""; | |||||
String main2 = ""; | |||||
String main3 = ""; | |||||
String main4 = ""; | |||||
String main5 = ""; | |||||
String main6 = ""; | |||||
if(!processDetails.isEmpty()){ | |||||
for(BPA_GOODS_PROCESS_DETAIL bean:processDetails ){ | |||||
String processname = bean.processname; | |||||
if(processname.contains("主料")){ | |||||
String processvalue = bean.processvalue; | |||||
if(!processvalue.isEmpty()){ | |||||
HashMap<String,String> params = ProcessValueUtil.dealProcessValue(processvalue); | |||||
if(!params.isEmpty()){ | |||||
int position = -1;//几号位 | |||||
String name = "";//主料名称 | |||||
for (HashMap.Entry<String, String> entry : params.entrySet()) { | |||||
String key = entry.getKey(); | |||||
String value = entry.getValue(); | |||||
if(key.contains("名称")){ | |||||
name = value; | |||||
}else if(key.contains("位置")){ | |||||
position = Integer.parseInt(value.replace("号位","")); | |||||
} | |||||
} | |||||
if(position>=0){ | |||||
switch (position){ | |||||
case 1: | |||||
main1 = name; | |||||
break; | |||||
case 2: | |||||
main2 = name; | |||||
break; | |||||
case 3: | |||||
main3 = name; | |||||
break; | |||||
case 4: | |||||
main4 = name; | |||||
break; | |||||
case 5: | |||||
main5 = name; | |||||
break; | |||||
case 6: | |||||
main6 = name; | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
mainFoods.add(main1); | |||||
mainFoods.add(main2); | |||||
mainFoods.add(main3); | |||||
mainFoods.add(main4); | |||||
mainFoods.add(main5); | |||||
mainFoods.add(main6); | |||||
} | |||||
private boolean isFirst = true; | private boolean isFirst = true; | ||||
@Override | @Override | ||||
protected void onResume() { | protected void onResume() { | ||||
@@ -617,6 +683,7 @@ public class DiyProcessActivity extends BaseActivity { | |||||
if(!isFirst){ | if(!isFirst){ | ||||
processDetails.clear(); | processDetails.clear(); | ||||
processDetails.addAll(GoodsProcessDetailDBUtil.getByGroupId(subAttributeGroupId)); | processDetails.addAll(GoodsProcessDetailDBUtil.getByGroupId(subAttributeGroupId)); | ||||
changeMainFoods(); | |||||
stepAdapter.setCurrentPosition(0); | stepAdapter.setCurrentPosition(0); | ||||
stepAdapter.notifyDataSetChanged(); | stepAdapter.notifyDataSetChanged(); | ||||
if(!processDetails.isEmpty()){ | if(!processDetails.isEmpty()){ | ||||
@@ -4,7 +4,7 @@ import android.content.Context; | |||||
import android.graphics.Color; | import android.graphics.Color; | ||||
import android.os.Bundle; | import android.os.Bundle; | ||||
import android.view.View; | import android.view.View; | ||||
import android.widget.FrameLayout; | |||||
import android.widget.RelativeLayout; | |||||
import androidx.annotation.Nullable; | import androidx.annotation.Nullable; | ||||
import androidx.core.content.ContextCompat; | import androidx.core.content.ContextCompat; | ||||
@@ -64,7 +64,7 @@ public class EditGoodsActivity extends BaseActivity { | |||||
* 初始化TopBar | * 初始化TopBar | ||||
*/ | */ | ||||
private void initTopBar() { | private void initTopBar() { | ||||
FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) viewBinding.frame.getLayoutParams(); | |||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) viewBinding.frame.getLayoutParams(); | |||||
params.bottomMargin = 0; | params.bottomMargin = 0; | ||||
viewBinding.frame.setLayoutParams(params); | viewBinding.frame.setLayoutParams(params); | ||||
viewBinding.topbar.setBackgroundColor(ContextCompat.getColor(this, R.color.topbj1)); | viewBinding.topbar.setBackgroundColor(ContextCompat.getColor(this, R.color.topbj1)); | ||||
@@ -349,6 +349,7 @@ public class RecProcessActivity extends BaseActivity { | |||||
isUp=false; | isUp=false; | ||||
break; | break; | ||||
case "上升": | case "上升": | ||||
viewBinding.device.btnStir.setBackgroundResource(R.drawable.bg_device_position_btn); | |||||
ConstraintLayout.LayoutParams params2 = (ConstraintLayout.LayoutParams) viewBinding.device.btnUpDown.getLayoutParams(); | ConstraintLayout.LayoutParams params2 = (ConstraintLayout.LayoutParams) viewBinding.device.btnUpDown.getLayoutParams(); | ||||
params2.topMargin = DimensUtil.getDimens(150); | params2.topMargin = DimensUtil.getDimens(150); | ||||
viewBinding.device.btnUpDown.setLayoutParams(params2); | viewBinding.device.btnUpDown.setLayoutParams(params2); | ||||
@@ -65,10 +65,10 @@ public class SelectAttributeListAdapter extends ArrayAdapter<BPA_ATTRIBUTE> { | |||||
if(recyclerView.getAdapter()==null && position == subAttributeAdapters.size()){ | if(recyclerView.getAdapter()==null && position == subAttributeAdapters.size()){ | ||||
List<BPA_SUBATTRIBUTE> subattributeList = SubAttributeDBUtil.getByParentAttributeId(bean.id); | List<BPA_SUBATTRIBUTE> subattributeList = SubAttributeDBUtil.getByParentAttributeId(bean.id); | ||||
SelectSubAttributeAdapter adapter = new SelectSubAttributeAdapter(); | SelectSubAttributeAdapter adapter = new SelectSubAttributeAdapter(); | ||||
adapter.setCurrentPosition(-1); | |||||
adapter.setGroupIdList(groupIdList); | adapter.setGroupIdList(groupIdList); | ||||
adapter.setNewData(subattributeList); | adapter.setNewData(subattributeList); | ||||
adapter.setListener(listener); | adapter.setListener(listener); | ||||
adapter.setCurrentPosition(-1); | |||||
recyclerView.setAdapter(adapter); | recyclerView.setAdapter(adapter); | ||||
LogUtils.d(" SelectAttributeListAdapter getView position="+position); | LogUtils.d(" SelectAttributeListAdapter getView position="+position); | ||||
if(position == subAttributeAdapters.size()){ | if(position == subAttributeAdapters.size()){ | ||||
@@ -8,6 +8,7 @@ import android.view.ViewGroup; | |||||
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.common.base.BaseAdapter; | import com.bonait.bnframework.common.base.BaseAdapter; | ||||
import com.bonait.bnframework.common.db.mode.BPA_SUBATTRIBUTE; | import com.bonait.bnframework.common.db.mode.BPA_SUBATTRIBUTE; | ||||
import com.bonait.bnframework.common.utils.DisplayManager; | import com.bonait.bnframework.common.utils.DisplayManager; | ||||
@@ -45,18 +46,22 @@ public class SelectSubAttributeAdapter extends BaseAdapter<BPA_SUBATTRIBUTE,Sele | |||||
DisplayManager.scaleViewGroup(holder.binding.getRoot()); | DisplayManager.scaleViewGroup(holder.binding.getRoot()); | ||||
} | } | ||||
BPA_SUBATTRIBUTE subattribute = mData.get(position); | BPA_SUBATTRIBUTE subattribute = mData.get(position); | ||||
if(groupIdList.contains("-")){ | |||||
String[] res = groupIdList.split("-"); | |||||
for(String s : res){ | |||||
if(s.equals(subattribute.name)){ | |||||
if(mCurrentPosition<0){ | |||||
if(groupIdList.contains("-")){ | |||||
String[] res = groupIdList.split("-"); | |||||
for(String s : res){ | |||||
if(s.equals(subattribute.name)){ | |||||
mCurrentPosition = position; | |||||
} | |||||
} | |||||
}else { | |||||
if(subattribute.name.equals(groupIdList)){ | |||||
mCurrentPosition = position; | mCurrentPosition = position; | ||||
} | } | ||||
} | } | ||||
}else { | |||||
if(subattribute.name.equals(groupIdList)){ | |||||
mCurrentPosition = position; | |||||
} | |||||
} | } | ||||
LogUtils.d(" groupIdList="+groupIdList +" subattribute="+subattribute.name +" mCurrentPosition="+mCurrentPosition); | |||||
holder.binding.name.setText(subattribute.name+""); | holder.binding.name.setText(subattribute.name+""); | ||||
holder.binding.name.setSelected(mCurrentPosition == position); | holder.binding.name.setSelected(mCurrentPosition == position); | ||||
@@ -36,7 +36,7 @@ public abstract class CloudGoodsAdapter extends BaseAdapter<BPA_GOODS,CloudGoods | |||||
@Override | @Override | ||||
public void onBindViewHolder(@NonNull GoodsViewHolder holder, @SuppressLint("RecyclerView") int position) { | public void onBindViewHolder(@NonNull GoodsViewHolder holder, @SuppressLint("RecyclerView") int position) { | ||||
try { | try { | ||||
if(holder.binding.name.getTextSize()>28||holder.binding.name.getTextSize()<24){ | |||||
if(holder.binding.name.getTextSize()>34||holder.binding.name.getTextSize()<30){ | |||||
DisplayManager.scaleViewGroup(holder.binding.getRoot()); | DisplayManager.scaleViewGroup(holder.binding.getRoot()); | ||||
} | } | ||||
holder.binding.add.setVisibility(View.GONE); | holder.binding.add.setVisibility(View.GONE); | ||||
@@ -129,29 +129,23 @@ public class AttributeSelectDialog extends DialogFragment { | |||||
dismiss(); | dismiss(); | ||||
}); | }); | ||||
viewBinding.btnSubmit.setOnClickListener(view -> { | viewBinding.btnSubmit.setOnClickListener(view -> { | ||||
// if(hasGroup().isEmpty()){ | |||||
// NewToastUtil.getInstance().showToast("请选择每行对应的子属性"); | |||||
// } | |||||
// if(!selectAttributeListAdapter.isAllSelected()){ | |||||
// if(getContext()!=null){ | |||||
// NewToastUtil.getInstance().showToast("请选择每行对应的子属性"); | |||||
// } | |||||
// return; | |||||
// } | |||||
BPA_GOODS_SUBATTRIBUTE_GROUP currentGroupBean = SubAttributeGroupDBUtil.getById(groupId); | |||||
if(currentGroupBean!=null){ | |||||
if(selectAttributeListAdapter.getSubAttributeIdList().equals(currentGroupBean.subAttributeIdList)){ | |||||
NewToastUtil.getInstance().showToast("当前正在编辑此组合,无法导入"); | |||||
return; | |||||
} | |||||
String hasId = hasGroup(); | |||||
if(hasId.isEmpty()){ | |||||
NewToastUtil.getInstance().showToast("未找到选中分组,无法导入"); | |||||
return; | |||||
} | |||||
if(groupId.equals(hasId)){ | |||||
NewToastUtil.getInstance().showToast("当前正在编辑此组合,无法导入"); | |||||
return; | |||||
} | } | ||||
BPA_GOODS_SUBATTRIBUTE_GROUP group = SubAttributeGroupDBUtil.getByGoodIdAndListId(goodId,selectAttributeListAdapter.getSubAttributeIdList()); | |||||
BPA_GOODS_SUBATTRIBUTE_GROUP group = SubAttributeGroupDBUtil.getById(hasId); | |||||
if(group == null){ | if(group == null){ | ||||
NewToastUtil.getInstance().showToast("还未创建该组合,无法导入"); | NewToastUtil.getInstance().showToast("还未创建该组合,无法导入"); | ||||
return; | return; | ||||
} | } | ||||
List<BPA_GOODS_PROCESS_DETAIL> list = GoodsProcessDetailDBUtil.getByGroupId(group.id); | |||||
List<BPA_GOODS_PROCESS_DETAIL> list = new ArrayList<>(GoodsProcessDetailDBUtil.getByGroupId(group.id)); | |||||
if(!list.isEmpty()){ | if(!list.isEmpty()){ | ||||
AlertDialogUtils.showCancelAndConfirmDialog((AppCompatActivity) getActivity(), R.layout.dialog_delete_classify, (layoutView, xCom) -> { | AlertDialogUtils.showCancelAndConfirmDialog((AppCompatActivity) getActivity(), R.layout.dialog_delete_classify, (layoutView, xCom) -> { | ||||
DialogDeleteClassifyBinding binding = DialogDeleteClassifyBinding.bind(layoutView); | DialogDeleteClassifyBinding binding = DialogDeleteClassifyBinding.bind(layoutView); | ||||
@@ -164,6 +158,7 @@ public class AttributeSelectDialog extends DialogFragment { | |||||
binding.submit.setOnClickListener(view1 -> { | binding.submit.setOnClickListener(view1 -> { | ||||
GoodsProcessDetailDBUtil.removeList(GoodsProcessDetailDBUtil.getByGroupId(groupId)); | GoodsProcessDetailDBUtil.removeList(GoodsProcessDetailDBUtil.getByGroupId(groupId)); | ||||
for (int i=0;i<list.size();i++){ | for (int i=0;i<list.size();i++){ | ||||
list.get(i).id = java.util.UUID.randomUUID().toString(); | |||||
list.get(i).goodsSubAttributeGroupId = groupId; | list.get(i).goodsSubAttributeGroupId = groupId; | ||||
list.get(i).sort = i+1; | list.get(i).sort = i+1; | ||||
} | } | ||||
@@ -510,17 +510,34 @@ public class DeviceControlDialog extends DialogFragment { | |||||
detail.materialType = 1; | detail.materialType = 1; | ||||
detail.processvalue = "升降控制,下降|延迟(秒),0"; | detail.processvalue = "升降控制,下降|延迟(秒),0"; | ||||
detail.processms = "升降(下降,0)"; | detail.processms = "升降(下降,0)"; | ||||
deviceCallBack.onClickEvent(type,"下降",8000,detail); | |||||
deviceCallBack.onClickEvent(type,"下降",5000,detail); | |||||
}); | }); | ||||
viewBinding.layoutStir.btnStirUp.setOnClickListener(v->{ | viewBinding.layoutStir.btnStirUp.setOnClickListener(v->{ | ||||
NewToastUtil.getInstance().showToast("电机上升"); | |||||
ThreadManager.get().execute(new Thread(() -> ModbusHelper.get().setUpdDownMotor(1))); | |||||
ThreadManager.get().execute(new Thread(() -> { | |||||
try { | |||||
NewToastUtil.getInstance().showToast("等待搅拌停止"); | |||||
ModbusHelper.get().setStirMotor(0,2); | |||||
boolean stirStop = true; | |||||
long lastTime = System.currentTimeMillis(); | |||||
while (stirStop){ | |||||
if(System.currentTimeMillis() - lastTime > 30*1000){ | |||||
break; | |||||
} | |||||
stirStop = ConfigName.TEST?false:ModbusHelper.get().setStirStop(); | |||||
Thread.sleep(50); | |||||
} | |||||
NewToastUtil.getInstance().showToast("电机上升"); | |||||
ModbusHelper.get().setUpdDownMotor(1); | |||||
}catch (Exception e){ | |||||
e.printStackTrace(); | |||||
} | |||||
})); | |||||
BPA_GOODS_PROCESS_DETAIL detail = new BPA_GOODS_PROCESS_DETAIL(); | BPA_GOODS_PROCESS_DETAIL detail = new BPA_GOODS_PROCESS_DETAIL(); | ||||
detail.processname = "升降"; | detail.processname = "升降"; | ||||
detail.materialType = 1; | detail.materialType = 1; | ||||
detail.processvalue = "升降控制,上升|延迟(秒),0"; | detail.processvalue = "升降控制,上升|延迟(秒),0"; | ||||
detail.processms = "升降(上升,0)"; | detail.processms = "升降(上升,0)"; | ||||
deviceCallBack.onClickEvent(type,"上升",8000,detail); | |||||
deviceCallBack.onClickEvent(type,"上升",5000,detail); | |||||
}); | }); | ||||
} | } | ||||
@@ -236,6 +236,7 @@ public class EditGoodsDialog extends DialogFragment { | |||||
} | } | ||||
} | } | ||||
if (xx) { | if (xx) { | ||||
subattributeGroup = bean; | |||||
groupId = bean.id; | groupId = bean.id; | ||||
break; | break; | ||||
} | } | ||||
@@ -288,16 +289,10 @@ public class EditGoodsDialog extends DialogFragment { | |||||
* 添加属性组 | * 添加属性组 | ||||
*/ | */ | ||||
private void addAttributeGroup(){ | private void addAttributeGroup(){ | ||||
boolean isExist = false; | |||||
for(BPA_GOODS_SUBATTRIBUTE_GROUP bean : SubAttributeGroupDBUtil.getByGoodsId(goods.id)){ | |||||
if(bean.name.equals(selectAttributeListAdapter.getSubAttributeNameList())){ | |||||
isExist = true; | |||||
subattributeGroup = bean; | |||||
break; | |||||
} | |||||
if(!isEdit){ | |||||
return; | |||||
} | } | ||||
LogUtils.d(TAG+" addAttributeGroup isExist="+isExist); | |||||
if(!isExist){ | |||||
if(subattributeGroup==null){ | |||||
subattributeGroup = new BPA_GOODS_SUBATTRIBUTE_GROUP(); | subattributeGroup = new BPA_GOODS_SUBATTRIBUTE_GROUP(); | ||||
subattributeGroup.goodsId = goods.id; | subattributeGroup.goodsId = goods.id; | ||||
subattributeGroup.maketime = 0; | subattributeGroup.maketime = 0; | ||||
@@ -415,7 +410,7 @@ public class EditGoodsDialog extends DialogFragment { | |||||
intent.putStringArrayListExtra("mainFoods",mainFoods); | intent.putStringArrayListExtra("mainFoods",mainFoods); | ||||
intent.putExtra("goodId",goods.id); | intent.putExtra("goodId",goods.id); | ||||
intent.putExtra("subAttributeGroupId",subattributeGroup.id); | intent.putExtra("subAttributeGroupId",subattributeGroup.id); | ||||
intent.putExtra("subAttributeGroupName",selectAttributeListAdapter.getSubAttributeNameList()); | |||||
intent.putExtra("subAttributeGroupName",subattributeGroup.name); | |||||
startActivity(intent); | startActivity(intent); | ||||
dismiss(); | dismiss(); | ||||
} | } | ||||
@@ -425,6 +420,7 @@ public class EditGoodsDialog extends DialogFragment { | |||||
*/ | */ | ||||
private void initView(){ | private void initView(){ | ||||
if(goods!=null){ | if(goods!=null){ | ||||
picUrl = goods.url; | |||||
updateImage(picUrl); | updateImage(picUrl); | ||||
} | } | ||||
viewBinding.layoutName.editName.setText(Objects.requireNonNull(GoodsDBUtil.getById(goodId)).name); | viewBinding.layoutName.editName.setText(Objects.requireNonNull(GoodsDBUtil.getById(goodId)).name); | ||||
@@ -468,13 +464,31 @@ public class EditGoodsDialog extends DialogFragment { | |||||
viewBinding.layoutAttribute.groupDesc.setText("存在选中组合"); | viewBinding.layoutAttribute.groupDesc.setText("存在选中组合"); | ||||
viewBinding.layoutAttribute.btnNext2.setBackgroundResource(R.drawable.bg_round25_yellow_btn); | viewBinding.layoutAttribute.btnNext2.setBackgroundResource(R.drawable.bg_round25_yellow_btn); | ||||
int pos = 0; | int pos = 0; | ||||
String nameList = selectAttributeListAdapter.getSubAttributeNameList(); | |||||
for(int i =0;i<groupList.size();i++){ | for(int i =0;i<groupList.size();i++){ | ||||
if(groupList.get(i).equals(selectAttributeListAdapter.getSubAttributeNameList())){ | |||||
if(groupList.get(i).equals(nameList)){ | |||||
pos = i; | pos = i; | ||||
break; | |||||
}else if(nameList.contains("-")&&groupList.get(i).contains("-")){ | |||||
String[] res1 = nameList.split("-"); | |||||
String[] res2 = groupList.get(i).split("-"); | |||||
if(res1.length == res2.length){ | |||||
boolean same = true; | |||||
for(String s : res1){ | |||||
if(!groupList.get(i).contains(s)){ | |||||
same = false; | |||||
} | |||||
} | |||||
if(same){ | |||||
pos = i; | |||||
break; | |||||
} | |||||
} | |||||
} | } | ||||
} | } | ||||
viewBinding.layoutAttribute.spinnerList.setSelection(pos); | viewBinding.layoutAttribute.spinnerList.setSelection(pos); | ||||
}else{ | }else{ | ||||
viewBinding.layoutAttribute.spinnerList.setSelection(0); | |||||
viewBinding.layoutAttribute.groupDesc.setText("不存在选中组合"); | viewBinding.layoutAttribute.groupDesc.setText("不存在选中组合"); | ||||
if(!isEdit){ | if(!isEdit){ | ||||
viewBinding.layoutAttribute.btnNext2.setBackgroundResource(R.drawable.bg_round25_gray_btn); | viewBinding.layoutAttribute.btnNext2.setBackgroundResource(R.drawable.bg_round25_gray_btn); | ||||
@@ -525,7 +539,7 @@ public class EditGoodsDialog extends DialogFragment { | |||||
if(!isEdit){ | if(!isEdit){ | ||||
viewBinding.layoutAttribute.btnNext2.setBackgroundResource(R.drawable.bg_round25_gray_btn); | viewBinding.layoutAttribute.btnNext2.setBackgroundResource(R.drawable.bg_round25_gray_btn); | ||||
} | } | ||||
updateAttributeData(viewBinding.layoutAttribute.spinnerList.getSelectedItem().toString()); | |||||
updateAttributeData(""); | |||||
}else { | }else { | ||||
updateAttributeData(viewBinding.layoutAttribute.spinnerList.getSelectedItem().toString()); | updateAttributeData(viewBinding.layoutAttribute.spinnerList.getSelectedItem().toString()); | ||||
viewBinding.layoutAttribute.groupDesc.setText("存在选中组合"); | viewBinding.layoutAttribute.groupDesc.setText("存在选中组合"); | ||||
@@ -548,8 +562,12 @@ public class EditGoodsDialog extends DialogFragment { | |||||
public void updateImage(String url){ | public void updateImage(String url){ | ||||
picUrl = url; | picUrl = url; | ||||
LogUtils.d(TAG+" updateCircleImage url="+url); | LogUtils.d(TAG+" updateCircleImage url="+url); | ||||
GlideUtil.showImageWithRadius(getContext(),url,viewBinding.layoutName.goodImage, | |||||
R.mipmap.loading123, DimensUtil.getDimens(0)); | |||||
if(picUrl.isEmpty()){ | |||||
viewBinding.layoutName.goodImage.setImageResource(R.mipmap.loading123); | |||||
}else { | |||||
GlideUtil.showImageWithRadius(getContext(),url,viewBinding.layoutName.goodImage, | |||||
R.mipmap.loading123, DimensUtil.getDimens(0)); | |||||
} | |||||
} | } | ||||
@Override | @Override | ||||
@@ -69,7 +69,16 @@ public class HomeDevicesFragment extends BaseFragment { | |||||
} | } | ||||
changeTextDeviceStatus(2,ModbusHelper.get().getConnected()?"在线":"掉线"); | changeTextDeviceStatus(2,ModbusHelper.get().getConnected()?"在线":"掉线"); | ||||
if(ModbusHelper.get().isBtnStop()){ | if(ModbusHelper.get().isBtnStop()){ | ||||
clear(); | |||||
viewBinding.device.btnMainFood.setBackgroundResource(R.drawable.bg_device_position_btn); | |||||
viewBinding.device.btnSilos.setBackgroundResource(R.drawable.bg_device_position_btn); | |||||
viewBinding.device.btnFire.setBackgroundResource(R.drawable.bg_device_position_btn); | |||||
viewBinding.device.btnUpDown.setBackgroundResource(R.drawable.bg_device_position_btn); | |||||
viewBinding.device.btnStir.setBackgroundResource(R.drawable.bg_device_position_btn); | |||||
viewBinding.device.fireView.SetLevel(0); | |||||
isFire = false; | |||||
isUp = true; | |||||
isStir = false; | |||||
changeDevicePic(); | |||||
} | } | ||||
break; | break; | ||||
case MSG_STOP_FOOD: | case MSG_STOP_FOOD: | ||||
@@ -79,7 +88,7 @@ public class HomeDevicesFragment extends BaseFragment { | |||||
viewBinding.device.btnSilos.setBackgroundResource(R.drawable.bg_device_position_btn); | viewBinding.device.btnSilos.setBackgroundResource(R.drawable.bg_device_position_btn); | ||||
break; | break; | ||||
case MSG_STOP_STIR: | case MSG_STOP_STIR: | ||||
viewBinding.device.btnFire.setBackgroundResource(R.drawable.bg_device_position_btn); | |||||
viewBinding.device.btnStir.setBackgroundResource(R.drawable.bg_device_position_btn); | |||||
break; | break; | ||||
case MSG_STOP_UPDOWN: | case MSG_STOP_UPDOWN: | ||||
viewBinding.device.btnUpDown.setBackgroundResource(R.drawable.bg_device_position_btn); | viewBinding.device.btnUpDown.setBackgroundResource(R.drawable.bg_device_position_btn); | ||||
@@ -219,6 +228,7 @@ public class HomeDevicesFragment extends BaseFragment { | |||||
isUp=false; | isUp=false; | ||||
break; | break; | ||||
case "上升": | case "上升": | ||||
viewBinding.device.btnStir.setBackgroundResource(R.drawable.bg_device_position_btn); | |||||
ConstraintLayout.LayoutParams params2 = (ConstraintLayout.LayoutParams) viewBinding.device.btnUpDown.getLayoutParams(); | ConstraintLayout.LayoutParams params2 = (ConstraintLayout.LayoutParams) viewBinding.device.btnUpDown.getLayoutParams(); | ||||
params2.topMargin = DimensUtil.getDimens(150); | params2.topMargin = DimensUtil.getDimens(150); | ||||
viewBinding.device.btnUpDown.setLayoutParams(params2); | viewBinding.device.btnUpDown.setLayoutParams(params2); | ||||
@@ -57,9 +57,9 @@ public class HomeFoodsFragment extends BaseFragment { | |||||
switch (msg.what){ | switch (msg.what){ | ||||
case 1: | case 1: | ||||
if(ModbusHelper.get().getConnected()){ | if(ModbusHelper.get().getConnected()){ | ||||
viewBinding.tvConnect.setText("设备状态:未连接"); | |||||
}else { | |||||
viewBinding.tvConnect.setText("设备状态:已连接"); | viewBinding.tvConnect.setText("设备状态:已连接"); | ||||
}else { | |||||
viewBinding.tvConnect.setText("设备状态:未连接"); | |||||
} | } | ||||
if(hasMessages(1)){ | if(hasMessages(1)){ | ||||
removeMessages(1); | removeMessages(1); | ||||
@@ -334,7 +334,7 @@ public class HomeGoodsViewModel extends ViewModel { | |||||
BPA_SUBATTRIBUTE bpa_goodpropertySub = new BPA_SUBATTRIBUTE(); | BPA_SUBATTRIBUTE bpa_goodpropertySub = new BPA_SUBATTRIBUTE(); | ||||
bpa_goodpropertySub.name = item.getGoodsAttributeList().get(n).getGoodsAttributeValueList().get(i).getAttributeValue(); | bpa_goodpropertySub.name = item.getGoodsAttributeList().get(n).getGoodsAttributeValueList().get(i).getAttributeValue(); | ||||
bpa_goodpropertySub.parentAttributeId = item.getGoodsAttributeList().get(n).getGoodsAttributeId(); | bpa_goodpropertySub.parentAttributeId = item.getGoodsAttributeList().get(n).getGoodsAttributeId(); | ||||
bpa_goodpropertySub.id = item.getGoodsAttributeList().get(n).getGoodsAttributeValueList().get(i).getGoodsAttributeId(); | |||||
bpa_goodpropertySub.id = item.getGoodsAttributeList().get(n).getGoodsAttributeValueList().get(i).getGoodsAttributeValueId(); | |||||
bpa_goodpropertySub.sort = i+1; | bpa_goodpropertySub.sort = i+1; | ||||
bpa_goodpropertySub.userID="超级管理员"; | bpa_goodpropertySub.userID="超级管理员"; | ||||
dataSub.add(bpa_goodpropertySub); | dataSub.add(bpa_goodpropertySub); | ||||
@@ -392,7 +392,9 @@ public class HomeGoodsViewModel extends ViewModel { | |||||
item.getGoodsInfoList().forEach(goodinfo->{ | item.getGoodsInfoList().forEach(goodinfo->{ | ||||
try { | try { | ||||
List<String> groupList = new ArrayList<>(); | List<String> groupList = new ArrayList<>(); | ||||
for (GoodsClassifyBean.GoodsInfoListBean.GoodsTechnologyActionListBean goodsTechnologyActionListBean:goodinfo.getGoodsTechnologyActionList()){ | |||||
int pos1 = 0; | |||||
for (GoodsClassifyBean.GoodsInfoListBean.GoodsTechnologyActionListBean goodsTechnologyActionListBean: | |||||
goodinfo.getGoodsTechnologyActionList()){ | |||||
//添加子属性组合 | //添加子属性组合 | ||||
if(!groupList.contains(goodsTechnologyActionListBean.getGoodsAttributeId())){ | if(!groupList.contains(goodsTechnologyActionListBean.getGoodsAttributeId())){ | ||||
BPA_GOODS_SUBATTRIBUTE_GROUP group = new BPA_GOODS_SUBATTRIBUTE_GROUP(); | BPA_GOODS_SUBATTRIBUTE_GROUP group = new BPA_GOODS_SUBATTRIBUTE_GROUP(); | ||||
@@ -408,7 +410,9 @@ public class HomeGoodsViewModel extends ViewModel { | |||||
processDetail.goodsSubAttributeGroupId = goodsTechnologyActionListBean.getGoodsAttributeId()==null?"xxxxx123":goodsTechnologyActionListBean.getGoodsAttributeId(); | processDetail.goodsSubAttributeGroupId = goodsTechnologyActionListBean.getGoodsAttributeId()==null?"xxxxx123":goodsTechnologyActionListBean.getGoodsAttributeId(); | ||||
processDetail.materialType = goodsTechnologyActionListBean.getStepName().contains("液体")?0:1; | processDetail.materialType = goodsTechnologyActionListBean.getStepName().contains("液体")?0:1; | ||||
String value = ProcessValueUtil.dealProcessJsonToValue(goodsTechnologyActionListBean.getActionJson()); | String value = ProcessValueUtil.dealProcessJsonToValue(goodsTechnologyActionListBean.getActionJson()); | ||||
processDetail.processms = ""; | |||||
processDetail.processms = ProcessValueUtil.dealProcessSms(value); | |||||
pos1++; | |||||
processDetail.sort = pos1; | |||||
processDetail.processname = goodsTechnologyActionListBean.getStepName(); | processDetail.processname = goodsTechnologyActionListBean.getStepName(); | ||||
processDetail.processvalue = value; | processDetail.processvalue = value; | ||||
datas1.add(processDetail); | datas1.add(processDetail); | ||||
@@ -437,7 +441,7 @@ public class HomeGoodsViewModel extends ViewModel { | |||||
String id = props[i]; | String id = props[i]; | ||||
for(GoodsClassifyBean.GoodsAttributeListBean bean : attributes){ | for(GoodsClassifyBean.GoodsAttributeListBean bean : attributes){ | ||||
for(GoodsClassifyBean.GoodsAttributeListBean.GoodsAttributeValueListBean sub:bean.getGoodsAttributeValueList()){ | for(GoodsClassifyBean.GoodsAttributeListBean.GoodsAttributeValueListBean sub:bean.getGoodsAttributeValueList()){ | ||||
if(sub!=null && sub.getGoodsAttributeId().equals(id)){ | |||||
if(sub!=null && sub.getGoodsAttributeValueId().equals(id)){ | |||||
recpipeNameTemp.append(sub.getAttributeValue()).append("-"); | recpipeNameTemp.append(sub.getAttributeValue()).append("-"); | ||||
} | } | ||||
} | } | ||||
@@ -82,7 +82,7 @@ | |||||
android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
android:layout_height="match_parent" | android:layout_height="match_parent" | ||||
android:layout_below="@id/tab" | android:layout_below="@id/tab" | ||||
android:paddingBottom="@dimen/dp_95" | |||||
android:layout_marginBottom="@dimen/dp_95" | |||||
/> | /> | ||||
</RelativeLayout> | </RelativeLayout> | ||||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> | </com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -32,7 +32,7 @@ | |||||
tools:text="三月瓜" | tools:text="三月瓜" | ||||
android:textAlignment="center" | android:textAlignment="center" | ||||
android:textColor="@color/black" | android:textColor="@color/black" | ||||
android:textSize="@dimen/sp_26" | |||||
android:textSize="@dimen/sp_32" | |||||
android:textStyle="bold" | android:textStyle="bold" | ||||
android:background="#99FFFFFF" | android:background="#99FFFFFF" | ||||
app:layout_constraintLeft_toLeftOf="parent" | app:layout_constraintLeft_toLeftOf="parent" | ||||