CacheGlassModule/src/main/java/com/mes/service/hangzhoumes/hangzhoumesService.java
File was deleted UI-Project/vite.config.js
@@ -22,7 +22,7 @@ https: false, proxy: { '/api': { target: 'http://localhost:8081/', target: 'http://localhost:8080/mesModuleTools', changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, '/'), }, hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/controller/DownGlassInfoController.java
@@ -11,8 +11,7 @@ @RequestMapping("/downGlassInfo") public class DownGlassInfoController { @Autowired private DownGlassInfoService downGlassInfoService; hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/service/impl/DownGlassInfoServiceImpl.java
@@ -14,13 +14,15 @@ public Integer getMaxSequenceByFlowCardId(String flowCardId) { QueryWrapper<DownGlassInfo> queryWrapper = new QueryWrapper<>(); queryWrapper.eq("flow_card_id", flowCardId); queryWrapper.select("MAX(sequence)"); // 选择最大序号 queryWrapper.orderByDesc("sequence"); // 按照序号倒序排序 queryWrapper.select("sequence").last("LIMIT 1"); // 选择最大序号并限制结果为1条记录 DownGlassInfo downGlassInfo = baseMapper.selectOne(queryWrapper); if (downGlassInfo != null) { return downGlassInfo.getSequence(); // 返回最大序号 return downGlassInfo.getSequence(); } return 0; // 如果没有找到记录,返回0或者其他适当的值 return 0; } @Override public void insertDownGlassInfo(DownGlassInfo downGlassInfo) { baseMapper.insert(downGlassInfo); hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/controller/DownStorageCageController.java
@@ -17,5 +17,6 @@ @RequestMapping("/downStorageCage") public class DownStorageCageController { } hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/mapper/DownStorageCageDetailsMapper.java
@@ -25,16 +25,16 @@ @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot where escd.slot is null order by escd.slot") List<DownStorageCageDetails> SelectCacheLeisure(); // 查询笼子内出片任务 @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot WHERE escd.slot IS NOT NULL order by escd.tempering_layout_id,escd.tempering_feed_sequence") List<DownStorageCageDetails> SelectCacheOut(); // 查询符合工位的出片玻璃 @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot left join down_workstation as dw on escd.flow_card_id=dw.flow_card_id WHERE escd.slot IS NOT NULL and dw.workstation_id BETWEEN #{start} and #{end} order by escd.tempering_layout_id,escd.tempering_feed_sequence") List<DownStorageCageDetails> SelectCacheOut(int start,int end); // 查询笼子内信息 @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot order by esc.slot") List<DownStorageCageDetails> SelectCachInfo(); // 查询可进此片玻璃的栅格号 @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot where escd.slot is not null escd.tempering_layout_id=#{tempering_layout_id} and escd.tempering_feed_sequence<#{tempering_feed_sequence} and esc.remain_width-#{width}>0 order by escd.tempering_feed_sequence") @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot where escd.slot is not null and escd.tempering_layout_id=#{tempering_layout_id} and escd.tempering_feed_sequence<#{tempering_feed_sequence} and esc.remain_width-#{width}>0 order by escd.tempering_feed_sequence") List<DownStorageCageDetails> SelectIsExistIntoCache(Integer tempering_layout_id, Integer tempering_feed_sequence, double width); @@ -55,8 +55,8 @@ // List<DownGlassTask> SelectOutCacheInfo(); // 查询 A06 或 A11 最新的一片 出片任务 @Select("select * from down_glass_task where task_type='2' and task_stauts='2' and end_cell=#{EndCell} limit 1") GlassInfo SelectLastOutCacheInfo(String EndCell); // @Select("select * from down_glass_task where task_type='2' and task_stauts='2' and end_cell=#{EndCell} limit 1") // GlassInfo SelectLastOutCacheInfo(String EndCell); // 修改笼子内信息 // @Update("update") hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownGlassCacheLogic.java
@@ -4,6 +4,8 @@ import com.mes.common.S7control; import com.mes.device.PlcParameterObject; import com.mes.downglassinfo.entity.DownGlassTask; import com.mes.downglassinfo.service.DownGlassTaskService; import com.mes.downstorage.entity.DownStorageCageDetails; import com.mes.downstorage.mapper.DownStorageCageDetailsMapper; import com.mes.downworkstation.mapper.DownWorkstationMapper; @@ -23,6 +25,7 @@ private DownStorageCageDetailsMapper selectInfo; private GlassInfoService GlassInfoService; private DownStorageCageDetailsService downStorageCageDetailsService; private DownGlassTaskService downGlassTaskService; /** * @param Number @@ -99,6 +102,7 @@ //2.回复 1进片 DownStorageCageDetails item=list.get(0); selectInfo.insertCacheTask(GlassInfo.getId()+"","0",item.getSlot()+"","1",GlassInfo.getWidth(),GlassInfo.getHeight(),GlassInfo.getFilmsid(),GlassInfo.getThickness(),GlassInfo.getFlowcardId()); S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 1); return true; } @@ -116,51 +120,49 @@ String G11=S7control.getinstance().ReadWord("DB14.58", 1).get(0)+""; String G13=S7control.getinstance().ReadWord("DB14.58", 1).get(0)+""; PlcParameterObject plcmes=PLCAutoMes.PlcMesObject; List<DownStorageCageDetails> list=selectInfo.SelectCacheOut(); //其他情况条件 如:后续设备故障禁止理片出片 等 boolean isOut=true; if (list.size()>0&&isOut) { DownStorageCageDetails item=list.get(0); // if(G06=="0"&&G11=="1"){ //出到 G06 List<DownStorageCageDetails> list = selectInfo.SelectCacheOut(1, 5); List<DownStorageCageDetails> list2 = selectInfo.SelectCacheOut(6, 10); List<DownStorageCageDetails> list3 = selectInfo.SelectCacheOut(1, 10); // 按照顺序符合前端出片 if (!list.isEmpty()) { DownStorageCageDetails item = list.get(0); if (G06.equals("0") && G11.equals("1")) { // 出到 G06 selectInfo.insertCacheTask(item.getGlassId()+"","0","06","2",item.getWidth(),item.getHeight(),item.getFilmsid(),item.getThickness(),item.getFlowCardId()); S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), "1"); S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); return true; }else if(G06=="1"&&G11=="0"){ } // 按照顺序符合后端出片 } else if (!list2.isEmpty()) { DownStorageCageDetails item2 = list2.get(0); if (G06.equals("1") && G11.equals("0")) { //出到 G11 selectInfo.insertCacheTask(item.getGlassId()+"","0","11","2",item.getWidth(),item.getHeight(),item.getFilmsid(),item.getThickness(),item.getFlowCardId()); selectInfo.insertCacheTask(item2.getGlassId() + "", "0", "11", "2", item2.getWidth(), item2.getHeight(), item2.getFilmsid(), item2.getThickness(), item2.getFlowCardId()); S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), "2"); S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); return true; }else if(G06=="0"&&G11=="0"){ //都允许 G04/G05 上一片是否和此片玻璃尺寸尺寸相同 } // 超出尺寸优先人工出片 人工处理 } else if (!list3.isEmpty()) { DownStorageCageDetails item3 = list3.get(0); if (item3.getHeight() >= 3440 && item3.getWidth() >= 1440) { String endcell="06"; String SendEndcell="1"; boolean If_=false; GlassInfo glassInfo06= selectInfo.SelectLastOutCacheInfo("06"); GlassInfo glassInfo11= selectInfo.SelectLastOutCacheInfo("11"); GlassInfo glassInfo13= selectInfo.SelectLastOutCacheInfo("13"); if(glassInfo06!=null&& glassInfo11.getWidth().equals(item.getWidth()) && glassInfo06.getHeight().equals(item.getHeight())){ endcell="11"; SendEndcell="2"; }else if(item.getHeight()>=3440&&item.getWidth()>=1440){ //其他条件人工处理 } selectInfo.insertCacheTask(item.getGlassId()+"","0",endcell,"2",item.getWidth(),item.getHeight(),item.getFilmsid(),item.getThickness(),item.getFlowCardId()); selectInfo.insertCacheTask(item3.getGlassId() + "", "0", endcell, "2", item3.getWidth(), item3.getHeight(), item3.getFilmsid(), item3.getThickness(), item3.getFlowCardId()); S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), SendEndcell); S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); return true; } } //返回结果 return false; } //查询是否绑定架子 // public boolean selectFlowCardId(String FlowCardId){ // hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downworkstation/mapper/DownWorkstationMapper.java
@@ -21,9 +21,11 @@ * @since 2024-03-27 */ @Mapper @Repository @InterceptorIgnore(tenantLine = "true") // 指定使用 hangzhoumes 数据源 @DS("hangzhoumes") // 指定使用 hangzhoumes 数据源 public interface DownWorkstationMapper extends BaseMapper<DownWorkstation> { @@ -32,8 +34,8 @@ List<DownWorkstation> selectdownWorkstationstate(); @Select("SELECT flow_card_id,filmsid,width,height,thickness FROM down_glass_task WHERE task_stauts = 1;") List<DownGlassTask> selectunloadingtaskstate(); // @Select("SELECT flow_card_id,filmsid,width,height,thickness FROM down_glass_task WHERE task_stauts = 1;") // List<DownGlassTask> selectunloadingtaskstate(); //更新落架数量 // @Update("UPDATE down_workstation SET racks_number = #{racksNumber} " + // "WHERE flow_card_id = #{flowCardId}") hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downworkstation/service/DownGlassLogic.java
@@ -70,7 +70,7 @@ downGlassInfoService = WebSocketServer.applicationContext.getBean(DownGlassInfoService.class); downGlassInfoMapper = WebSocketServer.applicationContext.getBean(DownGlassInfoMapper.class); downGlassTaskService = WebSocketServer.applicationContext.getBean(DownGlassTaskService.class); List<DownGlassTask> taskdownGlassInf = downWorkstationMapper.selectunloadingtaskstate(); List<DownGlassTask> taskdownGlassInf = downGlassTaskService.getUnloadingTaskState(); // @@ -123,10 +123,8 @@ if (taskdownWorkstation != null && !taskdownWorkstation.isEmpty()) { //,如果已经绑定则更新已落架数量,并且删除下片任务表中的记录 for (DownWorkstation downWorkstation : taskdownWorkstation) { //更新下片工位表中已落架数量 downWorkstationService.updateracksnumber(downWorkstation.getFlowCardId(), downWorkstation.getRacksnumber() + 1); //更新机械任务表中状态为0 downWorkstationTaskService.updateTaskStateToZero(downWorkstation.getFlowCardId()); //删除下片任务表中的记录 hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application.yml
@@ -13,11 +13,7 @@ password: beibo.123/ driver-class-name: com.mysql.cj.jdbc.Driver # sqlserver: # url: jdbc:sqlserver://localhost:1433;databaseName=hangzhoumes # username: sa # password: beibo.123/ # driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver cloud: nacos: discovery: