| | |
| | | export default { |
| | | serverUrl: "10.153.19.150:88/api", |
| | | serverUrl: "localhost:88/api", |
| | | //serverUrl: "localhost:88/api/", |
| | | serverUrl2: "10.153.19.150:88" |
| | | //serverUrl:"res.abeim.cn" |
| | |
| | | :width="rack.width" |
| | | :height="rack.height" |
| | | :fill="rack.fillColor" |
| | | :data-index="index" |
| | | class="rack-rect" |
| | | @click="showRectInfo(rack)" |
| | | :data-index="index" |
| | | class="rack-rect" |
| | | @click="showRectInfo(rack)" |
| | | /> |
| | | <rect |
| | | :x="calculateItemXPosition(rack, rack.item, index)" |
| | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | <script setup> |
| | | import Swal from 'sweetalert2' |
| | | export default { |
| | | data() { |
| | | return { |
| | | racks: [ |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456' } }, |
| | | { x: 50, y: 270, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 20, width: 10, fillColor: 'yellow', content: 'NG1234567' } }, |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 30, width: 20, fillColor: 'yellow', content: 'NG12345678' } }, |
| | | { x: 280, y: 270, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 35, width: 23, fillColor: 'yellow', content: 'NG123456910' } }, |
| | | { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 30, width: 100, fillColor: 'yellow', content: 'NG1234561454' } } |
| | | ] |
| | | }; |
| | | }, |
| | | methods: { |
| | | // 计算内部物品的 x 坐标位置 |
| | | calculateItemXPosition(rack, item, index) { |
| | | if (index === 0 || index === 1) { // 如果是第一或第二个物品 |
| | | return rack.x; // 返回左边界 x 坐标 |
| | | } else if (index === 2 || index === 3) { // 如果是第三或第四个物品 |
| | | return rack.x + rack.width - item.width; // 返回右边界 x 坐标 |
| | | } else { |
| | | return rack.x + (rack.width - item.width) / 2; // 返回水平居中的 x 坐标 |
| | | } |
| | | }, |
| | | // 计算内部物品的 y 坐标位置 |
| | | calculateItemYPosition(rack, item, index) { |
| | | if (index === 0 || index === 1) { // 如果是第一或第二个物品 |
| | | return rack.y + (rack.height - item.height) / 2; // 返回垂直居中的 y 坐标 |
| | | } else if (index === 2 || index === 3) { // 如果是第三或第四个物品 |
| | | return rack.y + (rack.height - item.height) / 2; // 返回垂直居中的 y 坐标 |
| | | } else { |
| | | return rack.y + rack.height - item.height; // 返回底部对齐的 y 坐标 |
| | | } |
| | | }, |
| | | showCustomAlert(content) { |
| | | var str="架号 : 111\n" + |
| | | "长 : 111\n" + |
| | | "宽 : 111\n" + |
| | | "厚 : 111\n"+ |
| | | "玻璃ID : 111\n"+ |
| | | "膜系 : 111\n"; |
| | | |
| | | Swal.fire({ |
| | | title: '玻璃信息', |
| | | html: '<pre>' + str + '</pre>', |
| | | customClass: { |
| | | popup: 'format-pre' |
| | | } |
| | | }); |
| | | const racks = [ |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456' } }, |
| | | { x: 50, y: 270, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 20, width: 10, fillColor: 'yellow', content: 'NG1234567' } }, |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 30, width: 20, fillColor: 'yellow', content: 'NG12345678' } }, |
| | | { x: 280, y: 270, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 35, width: 23, fillColor: 'yellow', content: 'NG123456910' } }, |
| | | { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 30, width: 100, fillColor: 'yellow', content: 'NG1234561454' } } |
| | | ]; |
| | | |
| | | }, |
| | | showRectInfo( rectInfo) { |
| | | const content = rectInfo.item.content; |
| | | this.$nextTick(() => { |
| | | this.showCustomAlert(content); |
| | | }); |
| | | }, |
| | | const calculateItemXPosition = (rack, item, index) => { |
| | | if (index === 0 || index === 1) { |
| | | return rack.x; |
| | | } else if (index === 2 || index === 3) { |
| | | return rack.x + rack.width - item.width; |
| | | } else { |
| | | return rack.x + (rack.width - item.width) / 2; |
| | | } |
| | | }; |
| | | |
| | | const calculateItemYPosition = (rack, item, index) => { |
| | | if (index === 0 || index === 1) { |
| | | return rack.y + (rack.height - item.height) / 2; |
| | | } else if (index === 2 || index === 3) { |
| | | return rack.y + (rack.height - item.height) / 2; |
| | | } else { |
| | | return rack.y + rack.height - item.height; |
| | | } |
| | | }; |
| | | |
| | | const showCustomAlert = (content) => { |
| | | var str="架号 : 111\n" + |
| | | "长 : 111\n" + |
| | | "宽 : 111\n" + |
| | | "厚 : 111\n"+ |
| | | "玻璃ID : 111\n"+ |
| | | "膜系 : 111\n"; |
| | | |
| | | Swal.fire({ |
| | | title: '玻璃信息', |
| | | html: '<pre>' + str + '</pre>', |
| | | customClass: { |
| | | popup: 'format-pre' |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const showRectInfo = (rectInfo) => { |
| | | const content = rectInfo.item.content; |
| | | showCustomAlert(content); |
| | | }; |
| | | |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | margin-left: 20px; |
| | | width: 500px; |
| | | margin-top: 10px; |
| | | /* background-color: antiquewhite; */ |
| | | } |
| | | .rack-rect:hover { |
| | | cursor: pointer; |
| | |
| | | padding: 10px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | </style> |
| | | </style> |
| | |
| | | <template> |
| | | <div class="glass-rack"> |
| | | <div> |
| | | <div > |
| | | <svg width="500" height="500" xmlns="http://www.w3.org/2000/svg"> |
| | | <g stroke="null" id="Layer_1"> |
| | | <!-- 使用 v-for 循环渲染数据 --> |
| | |
| | | :width="rack.width" |
| | | :height="rack.height" |
| | | :fill="rack.fillColor" |
| | | :data-index="index" |
| | | class="rack-rect" |
| | | @click="showRectInfo(rack)" |
| | | :data-index="index" |
| | | class="rack-rect" |
| | | @click="showRectInfo(rack)" |
| | | /> |
| | | <rect |
| | | :x="calculateItemXPosition(rack, rack.item, index)" |
| | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | <script setup> |
| | | import Swal from 'sweetalert2' |
| | | export default { |
| | | data() { |
| | | return { |
| | | racks: [ |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456' } }, |
| | | { x: 50, y: 270, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 20, width: 10, fillColor: 'yellow', content: 'NG1234567' } }, |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 30, width: 20, fillColor: 'yellow', content: 'NG12345678' } }, |
| | | { x: 280, y: 270, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 35, width: 23, fillColor: 'yellow', content: 'NG123456910' } }, |
| | | { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 30, width: 100, fillColor: 'yellow', content: 'NG1234561454' } } |
| | | ] |
| | | }; |
| | | }, |
| | | methods: { |
| | | calculateItemXPosition(rack, item, index) { |
| | | if (index === 0 || index === 1) { |
| | | return rack.x; |
| | | } else if (index === 2 || index === 3) { |
| | | return rack.x + rack.width - item.width; |
| | | } else { |
| | | return rack.x + (rack.width - item.width) / 2; |
| | | } |
| | | }, |
| | | calculateItemYPosition(rack, item, index) { |
| | | if (index === 0 || index === 1) { |
| | | return rack.y + (rack.height - item.height) / 2; |
| | | } else if (index === 2 || index === 3) { |
| | | return rack.y + (rack.height - item.height) / 2; |
| | | } else { |
| | | return rack.y + rack.height - item.height; |
| | | } |
| | | }, |
| | | showCustomAlert(content) { |
| | | var str="架号 : 111\n" + |
| | | "长 : 111\n" + |
| | | "宽 : 111\n" + |
| | | "厚 : 111\n"+ |
| | | "玻璃ID : 111\n"+ |
| | | "膜系 : 111\n"; |
| | | |
| | | Swal.fire({ |
| | | title: '玻璃信息', |
| | | html: '<pre>' + str + '</pre>', |
| | | customClass: { |
| | | popup: 'format-pre' |
| | | } |
| | | }); |
| | | const racks = [ |
| | | { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456' } }, |
| | | { x: 50, y: 270, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 20, width: 10, fillColor: 'yellow', content: 'NG1234567' } }, |
| | | { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 30, width: 20, fillColor: 'yellow', content: 'NG12345678' } }, |
| | | { x: 280, y: 270, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 35, width: 23, fillColor: 'yellow', content: 'NG123456910' } }, |
| | | { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 30, width: 100, fillColor: 'yellow', content: 'NG1234561454' } } |
| | | ]; |
| | | |
| | | }, |
| | | showRectInfo( rectInfo) { |
| | | const content = rectInfo.item.content; |
| | | this.$nextTick(() => { |
| | | this.showCustomAlert(content); |
| | | }); |
| | | }, |
| | | const calculateItemXPosition = (rack, item, index) => { |
| | | if (index === 0 || index === 1) { |
| | | return rack.x; |
| | | } else if (index === 2 || index === 3) { |
| | | return rack.x + rack.width - item.width; |
| | | } else { |
| | | return rack.x + (rack.width - item.width) / 2; |
| | | } |
| | | }; |
| | | |
| | | const calculateItemYPosition = (rack, item, index) => { |
| | | if (index === 0 || index === 1) { |
| | | return rack.y + (rack.height - item.height) / 2; |
| | | } else if (index === 2 || index === 3) { |
| | | return rack.y + (rack.height - item.height) / 2; |
| | | } else { |
| | | return rack.y + rack.height - item.height; |
| | | } |
| | | }; |
| | | |
| | | const showCustomAlert = (content) => { |
| | | var str="架号 : 111\n" + |
| | | "长 : 111\n" + |
| | | "宽 : 111\n" + |
| | | "厚 : 111\n"+ |
| | | "玻璃ID : 111\n"+ |
| | | "膜系 : 111\n"; |
| | | |
| | | Swal.fire({ |
| | | title: '玻璃信息', |
| | | html: '<pre>' + str + '</pre>', |
| | | customClass: { |
| | | popup: 'format-pre' |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const showRectInfo = (rectInfo) => { |
| | | const content = rectInfo.item.content; |
| | | showCustomAlert(content); |
| | | }; |
| | | |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .glass-rack { |
| | | margin-left: 20px; |
| | | width: 500px; |
| | | margin-top: 10px; |
| | | } |
| | | .rack-rect:hover { |
| | | cursor: pointer; |
| | |
| | | padding: 10px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | </style> |
| | | </style> |
| | |
| | | if (typeof WebSocket === "undefined") { |
| | | console.log("您的浏览器不支持WebSocket"); |
| | | } else { |
| | | let socketUrl = "ws://" + "localhost"+":88" + "/api/unLoadGlass/api/talk/" + viewname; |
| | | let socketUrl = "ws://" + "localhost"+":88" + "/api/talk/" + viewname; |
| | | if (socket != null) { |
| | | socket.close(); |
| | | socket = null; |
| | |
| | | if (!msg.data) { |
| | | return; // 如果收到空数据,则直接返回,不执行后续逻辑 |
| | | } |
| | | |
| | | |
| | | |
| | | let obj = JSON.parse(msg.data); |
| | | |
| | |
| | | https: false, |
| | | proxy: { |
| | | '/api': { |
| | | target: 'http://10.153.19.150:88/', |
| | | target: 'localhost:88/', |
| | | changeOrigin: true, |
| | | rewrite: (path) => path.replace(/^\/api/, '/'), |
| | | }, |
| | |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.tools.WebSocketServer; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.function.Supplier; |
| | | |
| | | @Component |
| | | public class Plchome extends Thread { |
| | | private int i = 1; |
| | | private static final Logger log = LogManager.getLogger(Plchome.class); |
| | | @Autowired |
| | | private DownWorkstationService downWorkstationService; |
| | | |
| | | // private final Supplier<DownGlassLogic> plcServiceSupplier; |
| | | |
| | |
| | | while (!Thread.currentThread().isInterrupted()) { |
| | | try { |
| | | i++; |
| | | Thread.sleep(100); |
| | | |
| | | Thread.sleep(1000); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | System.out.println(77); |
| | | downWorkstationService = WebSocketServer.applicationContext.getBean(DownWorkstationService.class); |
| | | List<Map<String, Object>> yy= downWorkstationService.getTotalGlassDimensionsByWorkstation(); |
| | | jsonObject.append("data", yy); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unloadglass"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | log.info("准备向 WebSocket 服务器发送消息: {}", jsonObject.toString()); |
| | | } |
| | | } |
| | | |
| | | |
| | | } catch (InterruptedException e) { |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | // System.out.println(arraylist6); |
| | | jsonObject.append("data", 1); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unloadglass"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | log.info("准备向 WebSocket 服务器发送消息: {}", jsonObject.toString()); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | // new PLCAutoMes().start(); |
| | | // |
| | | // new Plchome().start(); |
| | | // new Plchome().start(); |
| | | |
| | | } |
| | | } |
| | |
| | | DownGlassTask selectLastOutCacheInfo(String endCell); |
| | | |
| | | Integer insertCacheTask(DownGlassTask downGlassTask); |
| | | |
| | | List<DownGlassTask> selectInputTaskCache(); |
| | | |
| | | /** |
| | | * 查询出片任务 |
| | | * @return |
| | | */ |
| | | List<DownGlassTask> selectOutTaskCache(); |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<DownGlassTask> selectInputTaskCache(){ |
| | | return baseMapper.selectList(new QueryWrapper<DownGlassTask>().eq("task_status",0).eq("task_type",1)); |
| | | } |
| | | |
| | | /** |
| | | * 查询待出片任务 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DownGlassTask> selectOutTaskCache(){ |
| | | return baseMapper.selectList(new QueryWrapper<DownGlassTask>().eq("task_status",0).eq("task_type",2)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | private Integer glassId; |
| | | private String glassId; |
| | | |
| | | /** |
| | | * 小片在格内的顺序 |
| | |
| | | package com.mes.downstorage.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | |
| | | * @since 2024-03-27 |
| | | */ |
| | | @Mapper |
| | | public interface DownStorageCageDetailsMapper extends BaseMapper<DownStorageCageDetails> { |
| | | public interface DownStorageCageDetailsMapper extends MPJBaseMapper<DownStorageCageDetails> { |
| | | |
| | | } |
| | |
| | | //修改理片笼内信息 |
| | | boolean updatedownStorageCageDetails(DownStorageCageDetails details); |
| | | |
| | | |
| | | List<DownStorageCageDetails> CacheOut(int start, int end); |
| | | } |
| | |
| | | List<DownStorageCageDetails> getIsExistIntoCacheByLayout(Integer tempering_layout_id, double width); |
| | | List<DownStorageCageDetails> getIsExistIntoCacheByflowcardid(String flowcardid, double width); |
| | | List<DownStorageCageDetails> IsExistIntoCacheByflowcardid(String flowcardid, double width); |
| | | |
| | | List<Map> selectCacheEmpty(); |
| | | boolean processInto(String Number); |
| | | boolean processOut(); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.wrapper.MPJAbstractLambdaWrapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.mapper.DownStorageCageDetailsMapper; |
| | | import com.mes.downstorage.mapper.DownStorageCageMapper; |
| | | |
| | | import com.mes.downstorage.service.DownStorageCageDetailsService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class DownStorageCageDetailsServiceImpl extends ServiceImpl<DownStorageCageDetailsMapper, DownStorageCageDetails> implements DownStorageCageDetailsService { |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private DownStorageCageDetailsMapper downStorageCageDetailsMapper; |
| | | @Override |
| | | public void addDownStorageCageDetails(DownStorageCageDetails details) { |
| | | this.save(details); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> CacheOut(int start, int end) { |
| | | log.info("单片情况根据传入的工位查询符合按照大小出片的小片"); |
| | | return downStorageCageDetailsMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("t.*") |
| | | .leftJoin("(SELECT t1.* FROM down_storage_cage_details t1 " |
| | | + "JOIN (SELECT flow_card_id, MAX(width) AS max_width FROM glass_info GROUP BY flow_card_id) t " |
| | | + "ON t1.flow_card_id = t.flow_card_id WHERE t1.width = t.max_width) t3" |
| | | + " ON t.glass_id = t3.glass_id") |
| | | .leftJoin("down_workstation t4 ON t3.flow_card_id = t4.flow_card_id") |
| | | .isNull(Boolean.parseBoolean("t.glass_id"), "SELECT glass_id FROM down_glass_info") |
| | | .between("t4.workstation_id", start, end) |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.mapper.DownStorageCageDetailsMapper; |
| | | import com.mes.downstorage.mapper.DownStorageCageMapper; |
| | | import com.mes.downstorage.service.DownStorageCageDetailsService; |
| | | import com.mes.downstorage.service.DownStorageCageService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | |
| | | |
| | | @Autowired |
| | | private GlassInfoService glassInfoService; |
| | | @Autowired |
| | | private DownStorageCageService downStorageCageService; |
| | | |
| | | @Autowired |
| | | private DownGlassTaskService downGlassTaskService; |
| | | @Autowired |
| | | private DownStorageCageDetailsService downStorageCageDetailsService; |
| | | @Override |
| | | public List<Map> gettask(){ |
| | | downStorageCageMapper.selectList(null); |
| | |
| | | } |
| | | |
| | | |
| | | // @Override |
| | | // public List<Map> getCacheOut(int start, int end) { |
| | | // log.info(" 根据传入的工位查询符合按照顺序和大小出片的小片"); |
| | | // List<Map> map = downStorageCageMapper.selectJoinList( |
| | | // Map.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | // .select("escd.*") |
| | | // .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | // .leftJoin("down_workstation dw on escd.flow_card_id = dw.flow_card_id") |
| | | // .isNotNull("escd.slot") |
| | | // .between("dw.workstation_id", start, end) |
| | | // .orderByAsc("escd.tempering_layout_id, escd.tempering_feed_sequence") |
| | | // ); |
| | | // return map; |
| | | // } |
| | | @Override |
| | | public List<Map> selectCacheEmpty(){ |
| | | return baseMapper.selectJoinList( |
| | | Map.class,new MPJQueryWrapper<DownStorageCage>().selectAll(DownStorageCage.class) |
| | | .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height") |
| | | .leftJoin("down_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot") |
| | | .isNull("escd.slot") |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | // @Override |
| | | // public List<DownStorageCageDetails> Out() { |
| | | // log.info("单片情况 根据传入的工位查询符合按照大小出片的小片"); |
| | | // |
| | | // |
| | | // return downStorageCageMapper.selectJoinList( |
| | | // DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | // .select("escd.*") |
| | | // .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | // .leftJoin("down_workstation dw on escd.flow_card_id = dw.flow_card_id") |
| | | // .isNotNull("escd.slot") |
| | | // |
| | | // .orderByDesc("escd.width") |
| | | // .orderByDesc("escd.height") |
| | | // ); |
| | | // } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | public DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, String startCell, String endCell,String taskType ) { |
| | | DownGlassTask downGlassTask = new DownGlassTask(); |
| | | downGlassTask.setId(glassInfo.getId()); |
| | | downGlassTask.setStartCell(startCell); |
| | | downGlassTask.setTaskType(taskType); |
| | | downGlassTask.setEndCell(endCell); |
| | | downGlassTask.setWidth(glassInfo.getWidth()); |
| | | downGlassTask.setHeight(glassInfo.getHeight()); |
| | | downGlassTask.setFilmsid(String.valueOf(glassInfo.getFilmsid())); |
| | | downGlassTask.setThickness(glassInfo.getThickness()); |
| | | downGlassTask.setFlowCardId(glassInfo.getFlowCardId()); |
| | | |
| | | return downGlassTask; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public boolean processInto(String Number) { |
| | |
| | | if (GlassInfo != null) { |
| | | //同找到同流程卡附近空格 |
| | | List<DownStorageCageDetails> list = getIsExistIntoCacheByflowcardid(GlassInfo.getFlowcardId(), GlassInfo.getWidth()); |
| | | if (list.size() > 0) { |
| | | |
| | | List<Map> selectCacheEmpty=selectCacheEmpty(); |
| | | |
| | | // list<Map> list=selectCacheEmpty(); |
| | | // list<Map> = downStorageCageService.selectCacheEmpty(); |
| | | if (selectCacheEmpty.size() > 0) { |
| | | //存在空格 |
| | | //1.生成任务: 起始位置0 结束位置this.slot 任务类型 1 (进片任务) |
| | | //2.回复 1进片 |
| | |
| | | |
| | | PlcParameterObject plcmes = PLCAutoMes.PlcMesObject; |
| | | |
| | | List<DownStorageCageDetails> list = getCacheOut(1, 5); |
| | | List<DownStorageCageDetails> list2 = getCacheOut(6, 10); |
| | | List<DownStorageCageDetails> list3 = getCacheOut(1, 10); |
| | | List<DownStorageCageDetails> list = downStorageCageDetailsService.CacheOut(1, 5); |
| | | List<DownStorageCageDetails> list2 = downStorageCageDetailsService.CacheOut(6, 10); |
| | | List<DownStorageCageDetails> list3 = downStorageCageDetailsService.CacheOut(1, 10); |
| | | //自动绑定架子 |
| | | |
| | | |
| | | |
| | | |
| | |
| | | |
| | | // selectInfo.insertCacheTask(item3.getGlassId() + "", "0", endcell, "2", item3.getWidth(), item3.getHeight(), item3.getFilmsid(), item3.getThickness(), item3.getFlowCardId()); |
| | | |
| | | DownGlassTask downGlassTask = new DownGlassTask(); |
| | | downGlassTask.setId(item3.getId()); // 设置玻璃ID |
| | | downGlassTask.setStartCell("0"); |
| | | downGlassTask.setEndCell(endcell); |
| | | downGlassTask.setTaskType("2"); |
| | | downGlassTask.setWidth(item3.getWidth()); // 设置玻璃宽度 |
| | | downGlassTask.setHeight(item3.getHeight()); // 设置玻璃高度 |
| | | downGlassTask.setFilmsid(item3.getFilmsid()+""); // 设置膜ID |
| | | downGlassTask.setThickness(item3.getThickness()); // 设置玻璃厚度 |
| | | downGlassTask.setFlowCardId(item3.getFlowCardId()); // 设置流程卡号 |
| | | DownGlassTask downGlassTask =createDownGlassTask(item3,"0",endcell,"2"); |
| | | |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), SendEndcell); |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); |
| | |
| | | } |
| | | |
| | | |
| | | //同时请求 优先后端出片 |
| | | else if (!list3.isEmpty()) { |
| | | DownStorageCageDetails item3 = list3.get(0); |
| | | //如果同时前后端都空闲 优先后端出片并且优先满架 |
| | | else if (!list2.isEmpty()) { |
| | | |
| | | DownStorageCageDetails item3 = list2.get(0); |
| | | String endcell = "11"; |
| | | String SendEndcell = "1"; |
| | | // selectInfo.insertCacheTask(item3.getGlassId() + "", "0", endcell, "2", item3.getWidth(), item3.getHeight(), item3.getFilmsid(), item3.getThickness(), item3.getFlowCardId()); |
| | | DownGlassTask downGlassTask = new DownGlassTask(); |
| | | downGlassTask.setId(item3.getId()); // 设置玻璃ID |
| | | downGlassTask.setStartCell("0"); |
| | | downGlassTask.setEndCell(endcell); |
| | | downGlassTask.setTaskType("2"); |
| | | downGlassTask.setWidth(item3.getWidth()); // 设置玻璃宽度 |
| | | downGlassTask.setHeight(item3.getHeight()); // 设置玻璃高度 |
| | | downGlassTask.setFilmsid(item3.getFilmsid()+""); // 设置膜ID |
| | | downGlassTask.setThickness(item3.getThickness()); // 设置玻璃厚度 |
| | | downGlassTask.setFlowCardId(item3.getFlowCardId()); // 设置流程卡号 |
| | | DownGlassTask downGlassTask =createDownGlassTask(item3,"0",endcell,"2"); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), SendEndcell); |
| | |
| | | |
| | | // 出到 G06 |
| | | //selectInfo.insertCacheTask(item.getGlassId() + "", "0", "06", "2", item.getWidth(), item.getHeight(), item.getFilmsid(), item.getThickness(), item.getFlowCardId()); |
| | | DownGlassTask downGlassTask = new DownGlassTask(); |
| | | downGlassTask.setId(item.getId()); // 设置玻璃ID |
| | | downGlassTask.setStartCell("0"); |
| | | downGlassTask.setEndCell("06"); |
| | | downGlassTask.setTaskType("2"); |
| | | downGlassTask.setWidth(item.getWidth()); // 设置玻璃宽度 |
| | | downGlassTask.setHeight(item.getHeight()); // 设置玻璃高度 |
| | | downGlassTask.setFilmsid(item.getFilmsid()+""); // 设置膜ID |
| | | downGlassTask.setThickness(item.getThickness()); // 设置玻璃厚度 |
| | | downGlassTask.setFlowCardId(item.getFlowCardId()); // 设置流程卡号 |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | |
| | | DownGlassTask downGlassTask =createDownGlassTask(item,"0","06","2"); |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), "1"); |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); |
| | | return true; |
| | | |
| | | // 按照顺序符合后端出片 |
| | | // 按照大小符合后端出片 |
| | | } else if (!list2.isEmpty()) { |
| | | DownStorageCageDetails item2 = list2.get(0); |
| | | |
| | | // 出到 G11 |
| | | // selectInfo.insertCacheTask(item2.getGlassId() + "", "0", "11", "2", item2.getWidth(), item2.getHeight(), item2.getFilmsid(), item2.getThickness(), item2.getFlowCardId()); |
| | | DownGlassTask downGlassTask = new DownGlassTask(); |
| | | downGlassTask.setId(item2.getId()); // 设置玻璃ID |
| | | downGlassTask.setStartCell("0"); |
| | | downGlassTask.setEndCell("11"); |
| | | downGlassTask.setTaskType("2"); |
| | | downGlassTask.setWidth(item2.getWidth()); // 设置玻璃宽度 |
| | | downGlassTask.setHeight(item2.getHeight()); // 设置玻璃高度 |
| | | downGlassTask.setFilmsid(item2.getFilmsid()+""); // 设置膜ID |
| | | downGlassTask.setThickness(item2.getThickness()); // 设置玻璃厚度 |
| | | downGlassTask.setFlowCardId(item2.getFlowCardId()); // 设置流程卡号 |
| | | DownGlassTask downGlassTask =createDownGlassTask(item2,"0","11","2"); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), "2"); |
| | |
| | | |
| | | |
| | | |
| | | @ApiOperation("获取工位显示图") |
| | | @GetMapping("/getwo") |
| | | public ResponseEntity<Map<String, Object>> getwo() { |
| | | Map<String, Object> responseData = new HashMap<>(); |
| | | try { |
| | | List<Map<String, Object>> data = downWorkstationService.getTotalGlassDimensionsByWorkstation(); |
| | | responseData.put("code", 200); |
| | | responseData.put("msg", "成功"); |
| | | responseData.put("data", data); |
| | | return ResponseEntity.ok(responseData); |
| | | } catch (Exception e) { |
| | | responseData.put("code", 500); |
| | | responseData.put("msg", "失败"); |
| | | responseData.put("data", null); |
| | | return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(responseData); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.mes.downworkstation.entity;
|
| | |
|
| | | import com.baomidou.mybatisplus.annotation.IdType;
|
| | | import com.baomidou.mybatisplus.annotation.TableField;
|
| | | import com.baomidou.mybatisplus.annotation.TableId;
|
| | | import lombok.Data;
|
| | | import lombok.EqualsAndHashCode;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | /**
|
| | | * <p>
|
| | | *
|
| | | * </p>
|
| | | *
|
| | | * @author zhoush
|
| | | * @since 2024-03-27
|
| | | */
|
| | | @Data
|
| | | @EqualsAndHashCode(callSuper = false)
|
| | |
|
| | | public class DownWorkstionAndDownGlassinfo
|
| | | {
|
| | | /**
|
| | | * 下片工位表id
|
| | | */
|
| | | @TableId(value = "id", type = IdType.AUTO)
|
| | | private Integer id;
|
| | |
|
| | | /**
|
| | | * 工位id
|
| | | */
|
| | | private Integer workstationId;
|
| | |
|
| | | /**
|
| | | * 流程卡号
|
| | | */
|
| | | private String flowCardId;
|
| | |
|
| | | /**
|
| | | * 设备id
|
| | | */
|
| | | private Integer deviceId;
|
| | |
|
| | | /**
|
| | | * 启用状态
|
| | | */
|
| | | private Integer enableState;
|
| | |
|
| | | /**
|
| | | * 工作状态
|
| | | */
|
| | | private Integer workState;
|
| | |
|
| | |
|
| | | @TableField("total_quantity")
|
| | | private Integer totalquantity;
|
| | |
|
| | | @TableField("racks_number")
|
| | | private Integer Racksnumber;
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | | * 顺序
|
| | | */
|
| | | private Integer sequence;
|
| | |
|
| | | /**
|
| | | * 宽
|
| | | */
|
| | | private Double width;
|
| | |
|
| | | /**
|
| | | * 高
|
| | | */
|
| | | private Double height;
|
| | | private Double totalwidth;
|
| | |
|
| | | private Double totalheight;
|
| | | /**
|
| | | * 厚度
|
| | | */
|
| | | private Double thickness;
|
| | |
|
| | |
|
| | | private String Filmsid;
|
| | | }
|
| | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.annotation.InterceptorIgnore; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | |
| | | @InterceptorIgnore(tenantLine = "true") |
| | | @DS("hangzhoumes") // 指定使用 hangzhoumes 数据源 |
| | | |
| | | public interface DownWorkstationMapper extends BaseMapper<DownWorkstation> { |
| | | public interface DownWorkstationMapper extends MPJBaseMapper<DownWorkstation> { |
| | | |
| | | |
| | | } |
| | |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | int updateFlowCardIdAndCount(String flowCardId, int glassInfoCount, int workstationId); |
| | | void insertdownglassinfo(); |
| | | |
| | | List<Map<String, Object>> getTotalGlassDimensionsByWorkstation(); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.entity.DownGlassTask; |
| | | import com.mes.downglassinfo.mapper.DownGlassInfoMapper; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.downglassinfo.service.DownGlassTaskService; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.entity.DownWorkstationTask; |
| | | import com.mes.downworkstation.entity.DownWorkstionAndDownGlassinfo; |
| | | import com.mes.downworkstation.mapper.DownWorkstationMapper; |
| | | import com.mes.downworkstation.mapper.DownWorkstationTaskMapper; |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.downworkstation.service.DownWorkstationTaskService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class DownWorkstationServiceImpl extends ServiceImpl<DownWorkstationMapper, DownWorkstation> implements DownWorkstationService { |
| | | |
| | |
| | | private DownWorkstationTaskMapper downWorkstationTaskMapper; |
| | | @Autowired |
| | | private DownGlassInfoService downGlassInfoService; |
| | | @Autowired |
| | | private DownGlassInfoMapper downGlassInfoMapper; |
| | | @Autowired |
| | | private DownGlassTaskService downGlassTaskService; |
| | | |
| | |
| | | DownWorkstation result = baseMapper.selectOne(queryWrapper); |
| | | return result != null ? result.getTotalquantity() : 0; |
| | | } |
| | | //工位显示 |
| | | @Override |
| | | public List<Map<String, Object>> getTotalGlassDimensionsByWorkstation() { |
| | | MPJQueryWrapper<DownWorkstionAndDownGlassinfo> queryWrapper = new MPJQueryWrapper<>(); |
| | | queryWrapper.select("t.workstation_id", "t.flow_card_id", "COALESCE(SUM(b.width), 0) AS totalwidth", "COALESCE(SUM(b.height), 0) AS totalheight") |
| | | .leftJoin("down_glass_info b on t.flow_card_id = b.flow_card_id") |
| | | .groupBy("t.workstation_id", "t.flow_card_id"); |
| | | |
| | | List<DownWorkstionAndDownGlassinfo> workstationList = downWorkstationMapper.selectJoinList(DownWorkstionAndDownGlassinfo.class, queryWrapper); |
| | | |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (DownWorkstionAndDownGlassinfo downWorkstionAndDownGlassinfo : workstationList) { |
| | | Map<String, Object> rack = new HashMap<>(); |
| | | |
| | | // 创建子项(item)对象 |
| | | Map<String, Object> item = new HashMap<>(); |
| | | item.put("height", downWorkstionAndDownGlassinfo.getTotalheight()); // 设置子项高度,根据实际情况设置 |
| | | item.put("width", downWorkstionAndDownGlassinfo.getTotalwidth()); // 设置子项宽度,根据实际情况设置 |
| | | item.put("fillColor", "yellow"); // 设置子项颜色 |
| | | item.put("content", downWorkstionAndDownGlassinfo.getFlowCardId()); // 使用流程卡号作为子项内容 |
| | | |
| | | rack.put("item", item); // 将子项对象放入货架对象中 |
| | | |
| | | result.add(rack); // 将货架对象添加到结果列表中 |
| | | //log.info("货架对象: {}", rack); |
| | | } |
| | | |
| | | return result; // 返回最终结果 |
| | | } |
| | | |
| | | |
| | | |
| | | // @Override |
| | | // public int getTotalQuantity(int workstationId) { |
| | |
| | | * 生产规则id |
| | | */ |
| | | private Integer ruleId; |
| | | |
| | | |
| | | /** |
| | | * 玻璃id |
| | | */ |
| | | private String glassId; |
| | | } |
| | |
| | | @Override |
| | | public int getGlassInfoCountByFlowCardId(String flowCardId) { |
| | | QueryWrapper<GlassInfo> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("flowcard_id", flowCardId); |
| | | queryWrapper.eq("flow_card_id", flowCardId); |
| | | |
| | | return baseMapper.selectCount(queryWrapper); |
| | | } |
| | |
| | | |
| | | import com.mes.UnLoadGlassApplication; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.service.DownStorageCageDetailsService; |
| | | import com.mes.downstorage.service.impl.DownStorageCageServiceImpl; |
| | | |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | |
| | | |
| | | @Autowired |
| | | DownStorageCageServiceImpl downStorageCageServiceImpl; |
| | | @Autowired |
| | | DownStorageCageDetailsService downStorageCageDetailsService; |
| | | @Autowired |
| | | DownWorkstationServiceImpl downWorkstationServiceImpl; |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | @Test |
| | | public void testin() { |
| | | log.info("测试进片"); |
| | | downStorageCageServiceImpl.getIsExistIntoCacheByflowcardid("NG2023005",500); |
| | | |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void selectCacheEmpty() { |
| | | log.info("测试进片"); |
| | | downStorageCageServiceImpl.selectCacheEmpty(); |
| | | |
| | | } |
| | | |
| | | @Test |
| | | public void CacheEmpty() { |
| | | log.info("测试出片"); |
| | | downStorageCageDetailsService.CacheOut(1,5); |
| | | |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void getTotalGlassDimensionsByWorkstation() { |
| | | log.info("工位显示"); |
| | | downWorkstationServiceImpl.getTotalGlassDimensionsByWorkstation(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |