Merge remote-tracking branch 'origin/master'

This commit is contained in:
2025-08-08 08:57:44 +08:00
2 changed files with 20 additions and 2 deletions

View File

@@ -120,8 +120,9 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService {
// TODO 这里需要查一下数据库查看是否有正在轧或者说是未轧的情况 state=0,1,3,4
List<IndustryMaterialVo> industryMaterialVos1 = industryMaterialMapper.selectIndustryMaterialListAndNotFinish();
System.out.println("触发四辊数据写入");
// 这个大小等于0 表示四辊没有东西再轧制了可以进行放行
if (industryMaterialVos1.size()<=0){
if (industryMaterialVos1.isEmpty()){
IndustryBatch industryBatch = new IndustryBatch();
industryBatch.setBatchSize((long) industryMaterialVos.size());
industryBatchService.insertIndustryBatch(industryBatch);

View File

@@ -340,6 +340,13 @@ public class IndustryStepServiceImpl implements IIndustryStepService {
s7PLC.writeBoolean("DB15.0.3", false);
}
s7PLC.writeInt32("DB16.0", Math.toIntExact(smallStep.getStep()));
//以及剩余道次
Long num = industryStepMapper.selectMaxStepNum(smallStep.getBatchId());
s7PLC.writeInt32("M854", Math.toIntExact(num - smallStep.getStep()));
// 将此批次所有的进行中全部更新成 operation = 0
IndustryStep newStep = new IndustryStep();
newStep.setBatchId(industryMaterial.getBatchId());
@@ -592,11 +599,21 @@ public class IndustryStepServiceImpl implements IIndustryStepService {
public void start(IndustryStep industryStep) {
List<IndustryStepVo> industryStepVos = industryStepMapper.selectIndustryStepList(industryStep);
if (!industryStepVos.isEmpty()) {
s7PLC.writeFloat32("DB15.118", industryStepVos.get(0).getSetValue().floatValue());
IndustryStepVo firstStep = industryStepVos.get(0);
s7PLC.writeFloat32("DB15.118", firstStep.getSetValue().floatValue());
s7PLC.writeBoolean("DB15.0.3", true);
while (s7PLC.readBoolean("DB15.0.3")) {
s7PLC.writeBoolean("DB15.0.3", false);
}
// TODO 加入写入道次对齐
s7PLC.writeInt32("DB16.0", Math.toIntExact(firstStep.getStep()));
//以及剩余道次
Long num = industryStepMapper.selectMaxStepNum(firstStep.getBatchId());
s7PLC.writeInt32("M854", Math.toIntExact(num - firstStep.getStep()));
}
industryStep.setOperation(1L);
industryStepMapper.start(industryStep);