zhoushihao
2024-07-03 41adb5c262b8e43c4adc2b79d34146ac989d1920
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcStorageCageTask.java
@@ -72,13 +72,16 @@
    @Value("${mes.slotWidth}")
    private Integer slotWidth;
    @Value("${mes.carMaxSize}")
    private Integer carMaxSize;
    @Value("${mes.inCarMaxSize}")
    private Integer inCarMaxSize;
    @Value("${mes.outCarMaxSize}")
    private Integer outCarMaxSize;
    @Value("${mes.galssGap}")
    private Integer galssGap;
    //    @Scheduled(fixedDelay = 5000)
    @Scheduled(fixedDelay = 5000)
    public void plcToHomeEdgScan() {
        PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
        String d01Id = plcParameterObject.getPlcParameter("D01ID").getValue();
@@ -309,7 +312,7 @@
            Integer widthSecond = edgGlassTaskInfoList.get(1).getWidth();
            if (remainWidth >= widthFirst) {
                if (remainWidth - widthFirst - galssGap >= widthSecond) {
                    if (glassCount <= carMaxSize - 1) {
                    if (glassCount <= inCarMaxSize - 1) {
                        addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst);
                    } else {
                        addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst);
@@ -398,7 +401,7 @@
            //2、获取目标格子信息
            BigStorageDTO bigStorageDTO = bigStorageCageDetailsService.queryTargetSlotByTempering(info);
            //3、更新大理片笼表剩余宽度
            bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>().set(BigStorageCage::getRemainWidth, bigStorageDTO.getWidth())
            bigStorageCageService.update(new LambdaUpdateWrapper<BigStorageCage>().set(BigStorageCage::getRemainWidth, bigStorageDTO.getWidth() - info.getWidth())
                    .eq(BigStorageCage::getSlot, bigStorageDTO.getSlot()));
            //4、更新进片任务表,目标格子及状态(状态改为2 电气扫到自行处理)  遇到问题:无法批量更新,批量更新无法走指定从库
            e.setTargetSlot(bigStorageDTO.getSlot());
@@ -433,7 +436,7 @@
        //打车剩余尺寸
        Integer remainWidth = carWidth;
        for (T e : list) {
            if (bigStorageCageOutTaskList.size() > carMaxSize || e.getWidth() > remainWidth) {
            if (bigStorageCageOutTaskList.size() > outCarMaxSize || e.getWidth() > remainWidth) {
                break;
            }
            remainWidth = remainWidth - (int) e.getWidth() - galssGap;