UI-Project/src/views/UnLoadGlass/PrintFlow.vue
@@ -47,6 +47,8 @@ for (let i = 0; i < produceList.value.length; i++) { //数量 let totalQuantity = 0; //落架数量 let totalQuantity1 = 0; //面积 let totalArea = 0; //重量 @@ -54,6 +56,7 @@ // 对每个集合中的 detailList 进行计算 produceList.value[i].detailList.forEach(collection => { totalQuantity += collection.quantity * 1; totalQuantity1 += collection.quantity1 * 1; //每个序号面积 collection.total_area = parseFloat((collection.width * collection.height * collection.quantity / 1000000).toFixed(2)) totalArea += collection.total_area * 1; @@ -63,6 +66,7 @@ }); // 输出每个集合中的总数量 produceList.value[i].detail[0].quantity = totalQuantity produceList.value[i].detail[0].quantity1 = totalQuantity produceList.value[i].detail[0].gross_area = totalArea produceList.value[i].detail[0].weight = totalWeight } @@ -160,10 +164,11 @@ </tr> <tr> <td rowspan='2'>序号</td> <td rowspan='2'>编号</td> <!-- <td rowspan='2'>编号</td> --> <td rowspan="2">小片顺序</td> <td rowspan='2' style="width: 90px">宽*高</td> <td rowspan='2'>数量</td> <td rowspan='2'>落架</td> <td rowspan='2'>面积</td> <td rowspan='2'>周长</td> <td rowspan='2'>半径</td> @@ -198,12 +203,14 @@ <tr v-for="(itemDatile,index) in item.detailList" :key="index"> <td>{{ itemDatile.order_number }}</td> <td>{{ itemDatile.s01Value }}</td> <!-- <td>{{ itemDatile.s01Value }}</td> --> <td>{{ itemDatile.technology_number }}</td> <td>{{ itemDatile.child_width }}</td> <td class="item" style="width: 5%;height: 100%;"> <input v-model="itemDatile.quantity" style="width: 100%;height: 100%" @keyup="handleSummary()"/> {{ itemDatile.quantity }} <!-- <input v-model="itemDatile.quantity" style="width: 100%;height: 100%" @keyup="handleSummary()"/> --> </td> <td>{{ itemDatile.quantity1 }}</td> <td>{{ itemDatile.total_area }}</td> <td>{{ itemDatile.perimeter }}</td> <td>{{ itemDatile.bend_radius }}</td> @@ -235,6 +242,8 @@ <td v-for="(itemsum,index) in item.detail" :key="index" colspan="29"> 数量: <label>{{ itemsum.quantity }}</label> 落加数量: <label>{{ itemsum.quantity1 }}</label> 面积: <label>{{ parseFloat(itemsum.gross_area.toFixed(2)) }}</label> 重量: UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
@@ -42,6 +42,7 @@ const printLayer = ref('') const now = new Date(); const timeRange = ref([]) const browser=ref(false) const handleChange = async () => { console.log("触发开关") @@ -64,7 +65,15 @@ console.error(error); } } const confirmBrowser = () =>{ if (/chrome|chromium/i.test(navigator.userAgent) && !/edg/i.test(navigator.userAgent)) { browser.value=true } else if (/edg/i.test(navigator.userAgent)) { browser.value=false } else { browser.value=false } } const handleInputChangea = (value, rowId) => { // 更新对应行的 select 值 @@ -201,8 +210,8 @@ autoPrint.value = data.autoPrint[0]; } if (fullFlowCard.value == ""&&autoPrint.value==true) { //自动打印 if (fullFlowCard.value == ""&&autoPrint.value==true&&browser.value==true) { for (let i = 0; i < tableData.length; i++) { if (tableData[i].totalQuantity != 0) { if (tableData[i].totalQuantity == tableData[i].racksNumber + tableData[i].otherNumber && fullFlowCard.value != tableData[i].flowCardId) { @@ -224,6 +233,7 @@ }; // 初始化 WebSocket,并传递消息处理函数 onMounted(() => { confirmBrowser();//获取浏览器 fetchFlowCardId(); fetchTableData(); // 获取数据 socket = initializeWebSocket(socketUrl, handleMessage); @@ -294,9 +304,9 @@ printLayer.value = row.layer dialogTableVisible.value = true; setTimeout(() => { printFlowCard(); // 替换成你要执行的函数名 //dialogTableVisible.value = false; }, 1000); printFlowCard(); dialogTableVisible.value = false; }, 2000); } const open1 = async (row) => { @@ -304,7 +314,7 @@ printLayer.value = row.layer dialogTableVisible1.value = true; setTimeout(() => { printFlowCard1(); // 替换成你要执行的函数名 printFlowCard1(); //dialogTableVisible1.value = false; }, 1000); } @@ -320,7 +330,7 @@ let content = doc.createElement("div"); content.id = printId; alert(/Chrome/.test(userAgent) && !/Edge/.test(userAgent)); // alert(/Chrome/.test(userAgent) && !/Edge/.test(userAgent)); // 样式控制与打印无关的元素隐藏 let style = doc.createElement("style"); hangzhoumesParent/common/servicebase/src/main/java/com/mes/damage/entity/DamagePrint.java
New file @@ -0,0 +1,69 @@ package com.mes.damage.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serializable; import java.sql.Timestamp; /** * <p> * * </p> * * @author wu * @since 2024-06-25 */ @Data @EqualsAndHashCode(callSuper = false) public class DamagePrint implements Serializable { /** * 流程卡 */ private String flowCardId; /** * 工程号 */ private String engineerId; /** * 层号 */ private String layer; /** * 版图id */ private String temperingLayoutId; /** * 片序 */ private String temperingFeedSequence; /** * 玻璃id */ private String glassId; /** * 宽度 */ private double width; /** * 高度 */ private double height; /** * 厚度 */ private Integer thickness; } hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcStorageCageTask.java
@@ -3,6 +3,7 @@ import cn.hutool.core.lang.Assert; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.github.yulichang.toolkit.JoinWrappers; import com.github.yulichang.wrapper.MPJLambdaWrapper; @@ -542,10 +543,19 @@ */ public Boolean judgeGlassTypeStatus(String glassId, Integer line, String mesAddress) { //1、获取任务表中相邻玻璃 List<EdgGlassTaskInfo> edgGlassTaskInfoList = edgGlassTaskInfoService.list(new LambdaQueryWrapper<EdgGlassTaskInfo>() List<EdgGlassTaskInfo> edgGlassTaskInfoList ; edgGlassTaskInfoList= edgGlassTaskInfoService.list(new LambdaQueryWrapper<EdgGlassTaskInfo>() .eq(EdgGlassTaskInfo::getLine, line) .apply("time >= (select time from edg_glass_task_info where line='" + line + "' and glass_id = '" + glassId + "' and deleted = 0)") .orderByAsc(EdgGlassTaskInfo::getTime)); if(edgGlassTaskInfoList==null){ log.info("线路:{}识别玻璃信息未出现在尺寸表中,获取相邻两块玻璃失败",line); }else{ edgGlassTaskInfoList= edgGlassTaskInfoService.list(new LambdaQueryWrapper<EdgGlassTaskInfo>() .eq(EdgGlassTaskInfo::getGlassId, glassId) .last("limit 1")); log.info("在尺寸表中获取玻璃信息{}",edgGlassTaskInfoList); } Assert.isFalse(CollectionUtils.isEmpty(edgGlassTaskInfoList), "识别玻璃信息未出现在尺寸表中,获取相邻两块玻璃失败"); //2、获取卧转立剩余宽度 BigStorageDTO sitToUpRemainWidth = bigStorageCageFeedTaskService.querySitToUpRemainWidth(line); hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml
@@ -8,15 +8,15 @@ name: cacheVerticalGlass mybatis-plus: mapper-locations: classpath*:mapper/*.xml # configuration: # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl mes: sequence: order: false minCount: 20 carWidth: 5000 #大车宽度 slotWidth: 5000 #大车宽度 inCarMaxSize: 3 #进片大车最大存放玻璃数量 inCarMaxSize: 1 #进片大车最大存放玻璃数量 outCarMaxSize: 2 #出片大车最大存放玻璃数量 glassGap: 350 #玻璃间距 xMaxSize: 2850 xMaxSize: 2800 hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcScreenTask.java
@@ -52,7 +52,7 @@ String startOfPeriodStr = startOfPeriod.format(formatter); String endOfPeriodStr = endOfPeriod.format(formatter); // 设置为最近七天的时间范围 reportingdamage.setReportingWorkTime(startOfPeriodStr + " to " + endOfPeriodStr); reportingdamage.setReportingWorkTime("2024-05-11" + " to " + endOfPeriodStr); //reportingdamage.setReportingWorkTime(startOfPeriodStr + " to " + endOfPeriodStr); //扇形图各设备的加工破损数量 List<Reportingdamage> device = reportingWorkService.selectDamage(reportingdamage); hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/service/impl/DownGlassInfoServiceImpl.java
@@ -168,44 +168,44 @@ log.info("流程卡头部数据:{}", projectInfo); List<Map<String, Object>> flowCardInfo = flowCardService.selectFlowCard(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); log.info("流程卡玻璃数据:{}", flowCardInfo); for (Map<String, Object> row : resultList) { int glass_type = (int) row.get("glass_type"); int layer = (int) row.get("layer"); Long quantity1 = (Long) row.get("quantity"); for (Map<String, Object> row1 : flowCardInfo) { int order_number = (int) row1.get("order_number"); int technology_number = (int) row1.get("technology_number"); String child_width = (String) row1.get("child_width"); Long quantity = (Long) row1.get("quantity"); BigDecimal total_area = (BigDecimal) row1.get("total_area"); String separation = (String) row1.get("separation"); String perimeter = (String) row1.get("perimeter"); BigDecimal width = (BigDecimal) row1.get("width"); String other_columns = (String) row1.get("other_columns"); String remarks = (String) row1.get("remarks"); BigDecimal height = (BigDecimal) row1.get("height"); for (Map<String, Object> row : flowCardInfo) { int order_number = (int) row.get("order_number"); int technology_number = (int) row.get("technology_number"); int quantity1 = 0; for (Map<String, Object> row1 : resultList) { int glass_type = (int) row1.get("glass_type"); int layer = (int) row1.get("layer"); // String child_width = (String) row1.get("child_width"); // Long quantity = (Long) row1.get("quantity"); // BigDecimal total_area = (BigDecimal) row1.get("total_area"); // String separation = (String) row1.get("separation"); // String perimeter = (String) row1.get("perimeter"); // BigDecimal width = (BigDecimal) row1.get("width"); // String other_columns = (String) row1.get("other_columns"); // String remarks = (String) row1.get("remarks"); // BigDecimal height = (BigDecimal) row1.get("height"); if (order_number == glass_type && technology_number == layer) { // row.put("quantity1", quantity1); quantity1+=1; // row.put("quantity", quantity); row.put("order_number", order_number); row.put("technology_number", technology_number); row.put("child_width", child_width); row.put("total_area", total_area); row.put("separation", separation); row.put("perimeter", perimeter); row.put("width", width); row.put("other_columns", other_columns); row.put("remarks", remarks); row.put("height", height); // row.put("order_number", order_number); // row.put("technology_number", technology_number); // row.put("child_width", child_width); // row.put("total_area", total_area); // row.put("separation", separation); // row.put("perimeter", perimeter); // row.put("width", width); // row.put("other_columns", other_columns); // row.put("remarks", remarks); // row.put("height", height); } } row.put("quantity1", quantity1); } log.info("流程卡玻璃数据2:{}", flowCardInfo); List<Map<String, List<Map<String, Object>>>> listMap = new ArrayList<>(); Map<String, List<Map<String, Object>>> result = new HashMap<>(); result.put("detail", projectInfo); result.put("detailList", resultList); result.put("detailList", flowCardInfo); for (Map<String, Object> row : projectInfo) { String order_number = (String) row.get("process"); String[] processes = order_number.split("->"); hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/Downpush.java
@@ -6,8 +6,10 @@ import com.mes.common.config.Const; import com.mes.common.utils.RedisUtil; import com.mes.downglassinfo.entity.DownGlassInfo; import com.mes.downglassinfo.entity.DownGlassTask; import com.mes.downglassinfo.entity.request.DownGlassInfoRequest; import com.mes.downglassinfo.service.DownGlassInfoService; import com.mes.downglassinfo.service.DownGlassTaskService; import com.mes.downstorage.service.DownStorageCageService; import com.mes.downworkstation.entity.DownWorkstation; import com.mes.downworkstation.service.DownWorkstationService; @@ -34,6 +36,9 @@ private DownStorageCageService downStorageCageService; @Autowired private DownGlassInfoService downGlassInfoService; @Autowired private DownGlassTaskService downGlassTaskService; @Autowired private RedisUtil redisUtil; @@ -160,6 +165,8 @@ //正在进行的任务 List<DownWorkstation> downWorkstation = downWorkstationService.getoneDownWorkstations(1, 6); jsonObject.append("downWorkstation", downWorkstation); List<DownGlassTask> downGlassTask = downGlassTaskService.selectOutTaskCache(); jsonObject.append("downGlassTask", downGlassTask); ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unLoadGlassIsRun"); if (sendwServer != null) { for (WebSocketServer webserver : sendwServer) { hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application.yml
@@ -3,7 +3,7 @@ spring: profiles: active: prod active: dev application: name: unLoadGlass