hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/common/PLCAutoMes.java
@@ -22,12 +22,7 @@ private static String PlcMes = PLCAutoMes.class.getResource("/JsonFile/PlcMes.json").getPath(); private static String PlcRead = PLCAutoMes.class.getResource("/JsonFile/PlcRead.json").getPath(); private static String Plcframe = PLCAutoMes.class.getResource("/JsonFile/Plcframe.json").getPath(); // private static String PlcParameter = PLCAutomaticParameterSettingReview2.class // .getResource("/JsonFile/PlcParameter.json").getPath(); // private static String PlcSign = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcSign.json") // .getPath(); // private static String PlcState = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcState.json") // .getPath(); private static String PlcAlarm = PLCAutoMes.class.getResource("/JsonFile/PlcAlarm.json").getPath(); // private static String PlcTest = PLCAutoMes.class.getResource("/JsonFile/PlcTest.json").getPath(); @@ -67,19 +62,11 @@ // readAndUpdateWordValues(PlcReadObject); readAndUpdateWordValues(PlcMesObject); // readAndUpdateWordValues(PlcframeObject); // readAndUpdateWordValues(PlcframeObject); // readAndUpdateWordValues(plcStateObject); // int index = PlcMesObject.getPlcParameter("AddStart").getAddressIndex(); // System.out.println(index); // PlcMesObject.getPlcParameter("AddStart").getAddress(index); // System.out.println(PlcMesObject.getPlcParameter("AddStart").getAddress(index)); List<String> addresses = new ArrayList<>(); addresses.add("FeedID"); addresses.add("AddStart"); // System.out.println(addresses); // System.out.println(PlcMesObject.getPlcParameterValues(addresses)); List<String> addresses2 = new ArrayList<>(); addresses2.add("FeedID"); addresses2.add("FeedCarStatus"); hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/common/Plchome.java
@@ -29,8 +29,7 @@ i++; Thread.sleep(100); DownGlassLogic plcService = plcServiceSupplier.get(); // plcService.performPlcActions(); //plcService.unloadpush(); //当下片任务表状态为1时候将数据插入到下片玻璃信息表 plcService.insertdownglassinfo(); hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/controller/DownStorageCageDetailsController.java
@@ -30,7 +30,7 @@ //查询磨边缓存理片笼内详情 @ApiOperation("查询磨边缓存理片笼内详情") @ApiOperation("查询缓存理片笼内详情") @GetMapping("/selectStorageCage") @ResponseBody public Result selectEdgStorageCage () { @@ -40,6 +40,30 @@ @ApiOperation("添加缓存理片笼信息 功能:笼内绑定玻璃 参数(DownStorageCageDetails downStorageCageDetails)") @PostMapping("/insertEdgStorageCage") @ResponseBody public Result insertEdgStorageCage(@RequestBody DownStorageCageDetails downStorageCageDetails) { boolean isSucess=downStorageCageDetailsService.updatedownStorageCageDetails(downStorageCageDetails); return Result.build(200,"添加成功",1); } @ApiOperation("修改缓存理片笼信息 功能:对笼内栅格进行【启用/禁用】/ 【更换】笼内栅格玻璃信息") @PostMapping("/updateEdgStorageCage") @ResponseBody public Result updateEdgStorageCage(@RequestBody DownStorageCageDetails downStorageCageDetails) { boolean isSucess=downStorageCageDetailsService.updatedownStorageCageDetails(downStorageCageDetails); return Result.build(200,"更换成功",1); } @ApiOperation("删除缓存理片笼信息 功能:对笼内栅格玻璃进行【清除】") @PostMapping("/deleteEdgStorageCage") @ResponseBody public Result deleteEdgStorageCage(@RequestBody DownStorageCageDetails downStorageCageDetails) { boolean isSucess=downStorageCageDetailsService.updatedownStorageCageDetails(downStorageCageDetails); return Result.build(200,"删除成功",1); } // hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/entity/DownStorageCage.java
@@ -2,6 +2,8 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -15,36 +17,43 @@ * @author zhoush * @since 2024-03-27 */ @ApiModel(description = "<p> 缓存</p>") @Data @EqualsAndHashCode(callSuper = false) public class DownStorageCage implements Serializable { @ApiModelProperty(hidden = true) private static final long serialVersionUID = 1L; /** * 下片前理片笼表id */ @ApiModelProperty(value = "下片前理片笼表id", position = 2) @TableId(value = "id", type = IdType.AUTO) private Integer id; /** * 设备id */ @ApiModelProperty(value = "设备id", position = 3) private Integer deviceId; /** * 栅格号 */ @ApiModelProperty(value = "栅格号", position = 4) private Integer slot; /** * 启用状态 */ @ApiModelProperty(value = "启用状态", position = 5) private String enableState; /** * 剩余 */ @ApiModelProperty(value = "剩余", position = 6) private Integer remainWidth; hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownGlassCacheLogic.java
@@ -29,8 +29,11 @@ public static final String RESULT_IN_OUT = "3"; @Autowired private DownStorageCageDetailsMapper selectInfo; private GlassInfoService GlassInfoService; @Autowired private GlassInfoService glassInfoService; @Autowired private DownStorageCageService downStorageCageService; @Autowired private DownGlassTaskService downGlassTaskService; @@ -65,11 +68,11 @@ */ public boolean processInto(String Number) { GlassInfoService = WebSocketServer.applicationContext.getBean(GlassInfoService.class); glassInfoService = WebSocketServer.applicationContext.getBean(GlassInfoService.class); downStorageCageService = WebSocketServer.applicationContext.getBean(DownStorageCageService.class); //按id查询玻璃信息表里的玻璃 GlassInfo GlassInfo = GlassInfoService.selectGlassId(Number); GlassInfo GlassInfo = glassInfoService.selectGlassId(Number); PlcParameterObject plcmes = PLCAutoMes.PlcMesObject; //存在此玻璃编号 if (GlassInfo != null) { @@ -92,6 +95,7 @@ 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; } @@ -111,9 +115,12 @@ String G13 = S7control.getinstance().ReadWord("DB14.58", 1).get(0) + ""; PlcParameterObject plcmes = PLCAutoMes.PlcMesObject; List<DownStorageCageDetails> list = downStorageCageService.getCacheOut(1, 5); List<DownStorageCageDetails> list2 = downStorageCageService.getCacheOut(6, 10); List<DownStorageCageDetails> list3 = downStorageCageService.getCacheOut(1, 10); GlassInfo Maxglass=glassInfoService.selectGlassId("2");; // 优先 超出尺寸优先人工出片 人工处理 if (!list3.isEmpty()) { DownStorageCageDetails item3 = list3.get(0); @@ -130,20 +137,18 @@ } //同时请求 优先后端出片 else if (!list3.isEmpty()) { else if (!list3.isEmpty()&&Maxglass.equals(list3.get(0))) { DownStorageCageDetails item3 = list3.get(0); if (G06.equals("0") && G11.equals("0")) { String endcell = "11"; String SendEndcell = "1"; 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; } } // 按照顺序符合前端出片 // 按照大小符合前端出片 else if (!list.isEmpty()) { DownStorageCageDetails item = list.get(0); if (G06.equals("0") && G11.equals("1")) { @@ -185,7 +190,7 @@ public boolean selectMessageId(String Number) { //查询是否存在 GlassInfo GlassInfo = GlassInfoService.selectGlassId(Number); GlassInfo GlassInfo = glassInfoService.selectGlassId(Number); if (GlassInfo == null) { //返回 不存在 return false; @@ -202,7 +207,7 @@ public boolean deleteMessageId(String Number) { //查询是否存在 GlassInfo GlassInfo = GlassInfoService.selectGlassId(Number); GlassInfo GlassInfo = glassInfoService.selectGlassId(Number); if (GlassInfo == null) { //返回 不存在 return false; @@ -218,7 +223,7 @@ */ public boolean isExist(String Number) { //查询是否存在 GlassInfo GlassInfo = GlassInfoService.selectGlassId(Number); GlassInfo GlassInfo = glassInfoService.selectGlassId(Number); if (GlassInfo == null) { //返回 不存在 return false; hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownStorageCageDetailsService.java
@@ -9,5 +9,6 @@ void addDownStorageCageDetails(DownStorageCageDetails details); //修改理片笼内信息 boolean updatedownStorageCageDetails(DownStorageCageDetails details); } hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownStorageCageService.java
@@ -24,5 +24,6 @@ List<Map> getCacheInfo(); List<DownStorageCageDetails> getIsExistIntoCacheByLayoutAndSequence(Integer tempering_layout_id, Integer tempering_feed_sequence, double width); List<DownStorageCageDetails> getIsExistIntoCacheByLayout(Integer tempering_layout_id, double width); List<DownStorageCageDetails> getIsExistIntoCacheByflowcardid(String flowcardid, double width); List<DownStorageCageDetails> IsExistIntoCacheByflowcardid(String flowcardid, double width); } hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageDetailsServiceImpl.java
@@ -33,7 +33,12 @@ @Override //修改理片笼内信息 功能:对笼内栅格玻璃 【添加/删除/更换】 public boolean updatedownStorageCageDetails(DownStorageCageDetails details){ baseMapper.updateById(details); return true; } hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageServiceImpl.java
@@ -119,6 +119,41 @@ } @Override public List<DownStorageCageDetails> getIsExistIntoCacheByflowcardid(String flowcardid, double width) { log.info(" 查询可进此片玻璃的栅格号 找到相同流程卡号的空格"); List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList( DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() .select("escd.*") .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") .isNotNull("escd.slot") .eq("escd.flow_card_id", flowcardid) .gt("t.remain_width", width) .orderByAsc("escd.tempering_feed_sequence") ); return list; } @Override public List<DownStorageCageDetails> IsExistIntoCacheByflowcardid(String flowcardid, double width) { log.info(" 查询可进此片玻璃的栅格号"); List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList( DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() .select("escd.*") .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") .isNotNull("escd.slot") .lt("escd.flow_card_id", flowcardid) // 条件 t.remain_width - width > 0 .apply("t.remain_width - " + width + " > 0") .orderByDesc("escd.tempering_layout_id, escd.tempering_feed_sequence") ); return list; } @Override public List<DownStorageCageDetails> getIsExistIntoCacheByLayout(Integer tempering_layout_id, double width) { log.info(" 查询可进此片玻璃的栅格号"); List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList( @@ -139,4 +174,5 @@ } hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/glassinfo/service/GlassInfoService.java
@@ -21,4 +21,5 @@ List<Map<String, Object>> getFlowCardId(); GlassInfo selectGlassId(String id); // List<GlassInfo> getmaxglass(GlassInfo glassInfo); } hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java
@@ -42,6 +42,8 @@ return baseMapper.selectMaps(new QueryWrapper<GlassInfo>().select("DISTINCT flowcard_id")); } @Override public GlassInfo selectGlassId(String id) { QueryWrapper<GlassInfo> queryWrapper = new QueryWrapper<>();