CacheGlassModule/src/main/java/com/mes/service/hangzhoumes/hangzhoumesService.java
File was deleted UI-Project/config.js
@@ -1,5 +1,5 @@ export default { serverUrl: "localhost:8081", serverUrl: "localhost:8080/mesModuleTools", serverUrl2: "localhost:8081/mesModuleTools" //serverUrl:"res.abeim.cn" } 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/common/servicebase/src/main/java/com/mes/common/config/MybatisPlusConfig.java
@@ -9,6 +9,7 @@ import org.mybatis.spring.annotation.MapperScan; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -35,27 +36,12 @@ return interceptor; } @Resource private DataSourceProperties dataSourceProperties; @ConfigurationProperties(prefix="spring.datasource.dynamic.datasource.hangzhoumes") @Bean(name = "dataSource") public DataSource dataSource() { DruidDataSource dataSource = new DruidDataSource(); dataSource.setUrl(dataSourceProperties.getUrl()); dataSource.setDriverClassName(dataSourceProperties.getDriverClassName()); dataSource.setUsername(dataSourceProperties.getUsername()); dataSource.setPassword(dataSourceProperties.getPassword()); return dataSource; } public SqlSessionFactory sqlSessionFactory() throws Exception { SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean(); sqlSessionFactoryBean.setDataSource(dataSource()); return sqlSessionFactoryBean.getObject(); } } hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/InitUtil.java
File was deleted hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PLCAutoMes.java
File was deleted hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PlcBitInfo.java
File was deleted hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PlcBitObject.java
File was deleted hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PlcParameterInfo.java
File was deleted hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/PlcParameterObject.java
File was deleted hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/S7object.java
File was deleted hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/UnLoadGlassApplication.java
@@ -9,7 +9,7 @@ /** * @Author : zhoush * @Date: 2024/4/7 14:36 * @Date: 2024/4/7 14:36RRRR * @Description: */ @SpringBootApplication 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
@@ -3,7 +3,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.mes.downglassinfo.entity.DownGlassTask; import com.mes.downstorage.entity.DownStorageCageDetails; import com.mes.uppattenusage.entity.GlassInfo; import com.mes.glassinfo.entity.GlassInfo; import org.apache.ibatis.annotations.*; import java.util.List; @@ -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,12 +4,14 @@ 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; import com.mes.tools.WebSocketServer; import com.mes.uppattenusage.entity.GlassInfo; import com.mes.uppattenusage.service.GlassInfoService; import com.mes.glassinfo.entity.GlassInfo; import com.mes.glassinfo.service.GlassInfoService; import lombok.Data; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -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; } @@ -110,57 +114,55 @@ return false; } //理片 出 public boolean processOut(){ //查询任务 String G06=S7control.getinstance().ReadWord("DB14.56", 1).get(0)+""; 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 public boolean processOut() { // 查询任务 String G06 = S7control.getinstance().ReadWord("DB14.56", 1).get(0) + ""; 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(1, 5); List<DownStorageCageDetails> list2 = selectInfo.SelectCacheOut(6, 10); List<DownStorageCageDetails> list3 = selectInfo.SelectCacheOut(1, 10); selectInfo.insertCacheTask(item.getGlassId()+"","0","06","2",item.getWidth(),item.getHeight(),item.getFilmsid(),item.getThickness(),item.getFlowCardId()); // 按照顺序符合前端出片 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"){ //出到 G11 selectInfo.insertCacheTask(item.getGlassId()+"","0","11","2",item.getWidth(),item.getHeight(),item.getFilmsid(),item.getThickness(),item.getFlowCardId()); } // 按照顺序符合后端出片 } else if (!list2.isEmpty()) { DownStorageCageDetails item2 = list2.get(0); if (G06.equals("1") && G11.equals("0")) { // 出到 G11 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 上一片是否和此片玻璃尺寸尺寸相同 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){ //其他条件人工处理 } // 超出尺寸优先人工出片 人工处理 } else if (!list3.isEmpty()) { DownStorageCageDetails item3 = list3.get(0); if (item3.getHeight() >= 3440 && item3.getWidth() >= 1440) { } String endcell = "06"; String SendEndcell = "1"; 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") @DS("salve_1") // 指定使用 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/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java
@@ -4,9 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.mes.downworkstation.entity.DownWorkstation; import com.mes.uppattenusage.entity.GlassInfo; import com.mes.uppattenusage.mapper.GlassInfoMapper; import com.mes.uppattenusage.service.GlassInfoService; import com.mes.glassinfo.entity.GlassInfo; import com.mes.glassinfo.mapper.GlassInfoMapper; import com.mes.glassinfo.service.GlassInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; 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: