wuyouming666
2024-07-05 4dff7869e7373f96ca415f7e1d172dadc1ec32f3
原片仓储 下片测试
4个文件已修改
171 ■■■■ 已修改文件
UI-Project/src/views/GlassStorage/MaterialRackManagement.vue 134 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application.yml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/test/java/mes/UnloadGlassModuleApplicationTest.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/GlassStorage/MaterialRackManagement.vue
@@ -5,6 +5,7 @@
<!-- 左侧按钮组 -->
<div >
  <el-button type="success" size="mini"  @click="storage()">原片仓储详情</el-button>
  <el-button type="success" size="mini" @click="handleInbound()">入库</el-button>
  <el-button type="success" size="mini" >吊装位入库</el-button>
 
@@ -20,9 +21,9 @@
</el-form-item>
</div>
<el-dialog v-model="Hidden" top="10vh" width="80%"  >
      <el-table
        :data="tableData"
        :data="tableData" v-model="dialogVisible3"
       
        style="width: 98%; height: 200px"
        @selection-change="handleSelectionChange"
@@ -64,6 +65,7 @@
          </template>
        </el-table-column>
      </el-table>
      <el-table
    :data="tasktableData"
@@ -109,11 +111,21 @@
      </template>
    </el-table-column>
  </el-table>
  </el-dialog>
    </el-card>
    <div ref="chart" id="chart" style="width: 100%; height: 250px;"></div>
    <!-- <div ref="chart" id="chart" style="width: 100%; height: 250px;"></div> -->
    <div class="img-ypcc" >
      <div class="img-car1" :style="'z-index:999;left:297px;top:158px;position:absolute;'">
      <div v-show="cellshow1" style="margin-top:10px;width:200px;height:5px;background-color:#409EFF;"></div>
    </div>
    </div>
   
    <!-- 入库对话框 -->
    <el-dialog
@@ -214,7 +226,6 @@
    </el-dialog>
    <!-- <div ref="chart" id="chart" style="width: 100%; height: 400px;"></div> -->
  </div>
</template>
@@ -286,6 +297,8 @@
      }
      // Add more data as needed
    ]);
    const Hidden = ref(false)
   const getTagType2 =(status) => {
      switch (status) {
@@ -385,6 +398,12 @@
      // 打开入库对话框
      dialogVisible.value = true;
    };
    const storage = () => {
      // 打开入库对话框
      Hidden.value = true;
    };
    const handleCloseDialog = () => {
      // 关闭对话框时重置表单数据
@@ -561,85 +580,8 @@
    let chartInstance = null;
onMounted(() => {
  // Initialize the chart
  chartInstance = echarts.init(document.getElementById('chart'));
  // Simulated data for demonstration
  const chartData = {
    labels: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
    datasets: [
      { name: '使用情况统计', data: [{ remaining: 4, total: 5 }, { remaining: 9, total: 10 }, { remaining: 0, total: 30 }, { remaining: 0, total: 10 },{ remaining: 4, total: 5 }] }
    ]
  };
  const options = {
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'shadow'
      }
    },
    legend: {
      data: ['使用情况统计']
    },
    xAxis: {
      type: 'category',
      data: chartData.labels
    },
    yAxis: {
      type: 'value'
    },
    series: chartData.datasets.map(item => ({
      name: item.name,
      type: 'bar',
      stack: '总量',
      label: {
        show: true,
        position: 'inside',
        formatter: '{c}%'
      },
      data: item.data.map(dataItem => ({
        value: (dataItem.remaining / dataItem.total * 100).toFixed(2), // 计算剩余量占比,保留两位小数
        remaining: dataItem.remaining,
        total: dataItem.total,
        itemStyle: {
          color: getColorByRemaining(dataItem.remaining, dataItem.total)
        }
      }))
    }))
  };
  function getColorByRemaining(remaining, total) {
    // 根据剩余量与总量的比例,设置不同的颜色逻辑
    const percentage = remaining / total;
    if (percentage >= 0.8) {
      return '#FF6666'; // Red
    } else if (percentage >= 0.5) {
      return '#FFCC66'; // Yellow
    } else {
      return '#66CC66'; // Green
    }
  }
  // Set options and render chart
  if (chartInstance) {
    chartInstance.setOption(options);
  }
});
onBeforeUnmount(() => {
  if (chartInstance) {
    chartInstance.dispose();
    chartInstance = null;
  }
});
const handleSelectionChange = (selection) => {
  console.log('Selection changed:', selection);
};
</script>
@@ -659,7 +601,31 @@
.img-ypcc{
  margin-left: 80px;
  background-image:url('../../assets/ypcc.png');
  background-repeat: no-repeat;
    background-attachment: local;
    min-height: 800px;
    width: 1600px;
    max-width: 100%;
    background-size: 1400px 800px;
    overflow: hidden;
    position:relative
}
.img-car1{
  background-image:url('../../assets/ypccche.png');
  position: absolute;
  background-repeat: no-repeat;
    background-attachment: local;
    min-height: 200px;
    width: 200px;
    max-width: 100%;
    background-size: 200px 70px;
    overflow: hidden;
    position:relative
}
.custom-dialog {
  max-height: 90vh; /* 最大高度为视口高度的90% */
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java
@@ -72,10 +72,16 @@
    @Value("${mes.maxHeight}")
    private Integer maxHeight;
    @Value("${mes.minWidth}")
    private Integer minWidth;
    @Scheduled(fixedDelay = 1000)
    @Value("${mes.minHeight}")
    private Integer minHeight;
    @Scheduled(fixedDelay = 3000)
    public void plcHomeEdgTask() {
        PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
       PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
        String requestWord = plcParameterObject.getPlcParameter("requestWord").getValue();
        String glassIdeValue = plcParameterObject.getPlcParameter("requestID").getValue();
        //A08  A09表示线路相同  可做等价  无数据转int异常
@@ -86,6 +92,8 @@
        String confirmationWrodValue = plcParameterObject.getPlcParameter("confirmationWord").getValue();
        String confirmationWrodAddress = plcParameterObject.getPlcParameter("confirmationWord").getAddress();
        String currentSlot = plcParameterObject.getPlcParameter("currentCell").getValue();
        log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态分别为:g06:{}、g08:{}、g11:{}、g13:{},当前格子号为:{}",
                requestWord, glassIdeValue, confirmationWrodValue, out06Glassstate, out08Glassstate, out11Glassstate, out13Glassstate, currentSlot);
@@ -108,7 +116,7 @@
            inTo(glassIdeValue, requestWord, currentSlot);
        } else if ("2".equals(requestWord)) {
            //09空闲 :1      10空闲 :2        都空闲:3    其他0
            log.info("2、出片请求,且确认字为0,执行进片任务");
            log.info("2、出片请求,且确认字为0,执行出片任务");
            outTo(out06Glassstate, out08Glassstate, out11Glassstate, out13Glassstate, glassIdeValue, currentSlot);
        } else if ("3".equals(requestWord)) {
            log.info("2、进片和出片都空闲,执行出片任务");
@@ -135,9 +143,10 @@
        }
        Boolean checkFlag = Boolean.FALSE;
        //玻璃尺寸是否走人工下片
        if (glassInfo.getWidth() > maxWidth || glassInfo.getHeight() > maxHeight) {
            log.info("该玻璃尺寸走人工下片,直接进片");
        } else {
        if (glassInfo.getWidth() > maxWidth || glassInfo.getHeight() > maxHeight || glassInfo.getWidth() < minWidth || glassInfo.getHeight() < minHeight) {
            log.info("该玻璃尺寸不符合要求,需要走人工下片直接进片");
        }
        else {
            log.info("该玻璃尺寸非人工下片");
            //获取该玻璃的流程卡是否已绑定架子
            DownWorkstation one = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>()
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application.yml
@@ -14,8 +14,11 @@
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mes:
  maxWidth: 1000    #下片的最大宽度
  maxHeight: 1000   #下片的最大高度
  maxWidth: 2500    #下片的最大宽度 2500*2000
  maxHeight: 2000   #下片的最大高度
  minWidth: 400 #下片的最小宽度
  minHeight: 400   #下片的最小高度
  throughWidth: 3000
  throughHeight: 3000
  throughHeight: 2500
  threshold: 5      #下片的最大阈值
hangzhoumesParent/moduleService/UnLoadGlassModule/src/test/java/mes/UnloadGlassModuleApplicationTest.java
@@ -15,6 +15,7 @@
import com.mes.downworkstation.service.DownWorkstationService;
import com.mes.downworkstation.service.impl.DownWorkstationServiceImpl;
import com.mes.glassinfo.service.impl.GlassInfoServiceImpl;
import com.mes.job.DownLoadCacheGlassTask;
import com.mes.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
@@ -194,11 +195,15 @@
        DownStorageCage downStorageCage=  new DownStorageCage();
        downStorageCage.setEnableState("0");
        downStorageCage.setEnableState(0);
        downStorageCage.setId(1);
        downStorageCageService.updateDownStorageCage(downStorageCage);
    }
}