| | |
| | | import com.mes.base.entity.BigStorageCageBaseInfo; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.entity.BigStorageDTO; |
| | | import com.mes.bigstorage.entity.dto.BigStorageDTO; |
| | | import com.mes.bigstorage.entity.dto.SlotSequenceDTO; |
| | | import com.mes.bigstorage.entity.dto.TemperingLayoutDTO; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | } |
| | | |
| | | |
| | | @Scheduled(fixedDelay = 10000) |
| | | // @Scheduled(fixedDelay = 10000) |
| | | public void plcToHomeEdgOutTask() { |
| | | String mesToPLCAddress = ""; |
| | | List<BigStorageCageOutTask> outingList = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>() |
| | |
| | | /** |
| | | * 确认字清空 |
| | | */ |
| | | @Scheduled(fixedDelay = 300) |
| | | // @Scheduled(fixedDelay = 300) |
| | | public void confirmClear() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String d01ToMES = plcParameterObject.getPlcParameter("D01ToMES").getValue(); |
| | |
| | | /** |
| | | * 进片状态修改 |
| | | */ |
| | | @Scheduled(fixedDelay = 300) |
| | | // @Scheduled(fixedDelay = 300) |
| | | public void feedStatusUpdate() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | List<String> glassIds1 = new ArrayList<>(); |
| | |
| | | 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)); |
| | | .orderByAsc(EdgGlassTaskInfo::getCreateTime)); |
| | | if (edgGlassTaskInfoList.size() == 0) { |
| | | edgGlassTaskInfoList = edgGlassTaskInfoService.list(new QueryWrapper<EdgGlassTaskInfo>() |
| | | .select("Top 1 *") |
| | |
| | | if (maxX + minLength <= xMaxSize) { |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION, |
| | | e.getWidth() * 10, e.getHeight() * 10, 0, 0, 1, new Date())); |
| | | maxX = Math.max(maxX, e.getXCoordinate()); |
| | | // maxX = Math.max(maxX, e.getXCoordinate()); |
| | | } else { |
| | | break; |
| | | } |
| | |
| | | if (maxX + minLength <= xMaxSize) { |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION, |
| | | e.getWidth() * 10, e.getHeight() * 10, trainNumber, serialNumber++, 1, new Date())); |
| | | maxX = Math.max(maxX, e.getXCoordinate()); |
| | | // maxX = Math.max(maxX, e.getXCoordinate()); |
| | | } else { |
| | | remainWidth = carWidth - maxLength - glassGap; |
| | | trainNumber = trainNumber + 1; |
| | | serialNumber = 1; |
| | | maxX = e.getXCoordinate(); |
| | | // maxX = e.getXCoordinate(); |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION, |
| | | e.getWidth() * 10, e.getHeight(), trainNumber, serialNumber++, 1, new Date())); |
| | | } |
| | |
| | | return null; |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | // @Scheduled(fixedDelay = 300) |
| | | public void querySizeByEngineerTask() { |
| | | log.info("查询结果:{}", querySizeByEngineer("P24072402", 1, 10, 8)); |
| | | log.info("查询结果:{}", querySizeByEngineer("P24072402", 1, 5, 8)); |
| | |
| | | |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot) |
| | | .inSql(BigStorageCage::getDeviceId, |
| | | "select distinct device_id from big_storage_cage_details where engineer_id = '" + engineerId + "' and tempering_layout_id = " + temperingLayoutId) |
| | | .last("limit 1")); |
| | |
| | | List<Integer> deviceUsedList = bigStorageCageService.queryFreeDeviceByUsed(thickness); |
| | | for (Integer item : deviceUsedList) { |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot) |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .eq(BigStorageCage::getDeviceId, item) |
| | | .last("limit 1")); |