wangfei
2024-12-09 9f03850e058066a7c7bb3a3320c5010bb9d162d2
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
@@ -12,12 +12,14 @@
import com.mes.hollow.service.HollowGlassOutRelationInfoService;
import com.mes.hollowqueue.entity.HollowGlassQueueInfo;
import com.mes.hollowqueue.service.HollowGlassQueueInfoService;
import com.mes.utils.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@@ -38,6 +40,9 @@
    @Resource
    HollowGlassQueueInfoService hollowGlassQueueInfoService;
    @Resource
    RedisUtil redisUtil;
    @Override
    public HollowGlassOutRelationInfo receiveTask(String flowCardId, int cell, int totalPairQuantity) {
        return childrenTask(flowCardId,cell,totalPairQuantity,0);
@@ -46,6 +51,12 @@
    @Override
    public HollowGlassOutRelationInfo forceOutGlass(String flowCardId, int cell, int totalPairQuantity) {
        return childrenTask(flowCardId,cell,totalPairQuantity,1);
    }
    @Override
    public Boolean dispatchHollowSwitch(Boolean flag) {
        redisUtil.setCacheObject("dispatchHollowSwitch", flag);
        return  redisUtil.getCacheObject("dispatchHollowSwitch");
    }
@@ -62,7 +73,6 @@
        info.setTotalLayer(glassInfo.getTotalLayer());
        info.setState(Const.HOLLOW_FLOW_CARD_START);
        info.setTotalPairQuantity(totalPairQuantity);
        this.save(info);
        List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService.queryOutGlassList(flowCardId, cell);
        int isPairCount = glassInfo.getTotalLayer() * totalPairQuantity;
        List<HollowGlassQueueInfo> hollowQueues = new ArrayList<>();
@@ -72,6 +82,8 @@
            BeanUtils.copyProperties(queue, queueInfo);
            queueInfo.setState(Const.TEMPERING_NEW);
            queueInfo.setCell(cell);
            queueInfo.setCreateTime(new Date());
            queueInfo.setUpdateTime(new Date());
            hollowQueues.add(queueInfo);
            if (queue.getIsPair() == 1){
                isPairCount -=1;
@@ -81,6 +93,7 @@
            }
        }
        hollowGlassQueueInfoService.saveBatch(hollowQueues);
        this.save(info);
        return info;
    }
}