hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
@@ -77,8 +77,6 @@
    @Resource
    private SysConfigService sysConfigService;
//    @Resource
//    private PlcStorageCageTask plcStorageCageTask;
    @Resource
    private DamageService damageService;
@@ -407,16 +405,26 @@
                .eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW);
        List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoMapper.selectList(temperingGlassInfoLambdaQueryWrapper);
        int dispatchCount = bigStorageCageHistoryTaskService.count(new LambdaQueryWrapper<BigStorageCageHistoryTask>()
                .eq(BigStorageCageHistoryTask::getTaskState, Const.GLASS_STATE_NEW)
                .eq(BigStorageCageHistoryTask::getTaskType, Const.BIG_STORAGE_BEFORE_DISPATCH));
        if (temperingGlassInfoList.size() == 0) {
            List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, JoinWrappers.lambda(GlassInfo.class)
            MPJLambdaWrapper<GlassInfo> wrapper = JoinWrappers.lambda(GlassInfo.class)
                    .select("-1 as state,t.filmsid as films_id,t.glass_id,t.flow_card_id,t.glass_type,t.width,t.height" +
                            ",t.thickness,t.ishorizontal,t.tempering_layout_id,t.tempering_feed_sequence,t.x_coordinate,t.y_coordinate," +
                            "t.angle,t1.slot,t.engineer_id")
                    .innerJoin(BigStorageCageDetails.class, BigStorageCageDetails::getGlassId, GlassInfo::getGlassId)
                    .eq(GlassInfo::getTemperingLayoutId, temperingLayoutId)
                    .eq(GlassInfo::getEngineerId, engineerId)
                    .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN)
                    .orderBy(Boolean.TRUE, sequenceOrder, GlassInfo::getTemperingFeedSequence));
                    .orderBy(Boolean.TRUE, sequenceOrder, GlassInfo::getTemperingFeedSequence);
            if (dispatchCount > 0) {
                wrapper.in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL);
            } else {
                wrapper.in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN);
            }
            List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, wrapper);
            if (CollectionUtils.isNotEmpty(temperingGlassInfos)) {
                if ("0".equals(temperingFeedSequence)) {
                    if (CollectionUtils.isNotEmpty(temperingGlassInfos)) {
@@ -504,18 +512,27 @@
                .eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW);
        List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoMapper.selectList(temperingGlassInfoLambdaQueryWrapper);
        int dispatchCount = bigStorageCageHistoryTaskService.count(new LambdaQueryWrapper<BigStorageCageHistoryTask>()
                .eq(BigStorageCageHistoryTask::getTaskState, Const.GLASS_STATE_NEW)
                .eq(BigStorageCageHistoryTask::getTaskType, Const.BIG_STORAGE_BEFORE_DISPATCH));
        if (temperingGlassInfoList.size() == 0) {
            List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, JoinWrappers.lambda(GlassInfo.class)
            MPJLambdaWrapper<GlassInfo> wrapper = JoinWrappers.lambda(GlassInfo.class)
                    .select("-1 as state,t.filmsid as films_id,t.glass_id,t.flow_card_id,t.glass_type,t.width,t.height" +
                            ",t.thickness,t.ishorizontal,t.tempering_layout_id,t.tempering_feed_sequence,t.x_coordinate,t.y_coordinate," +
                            "t.angle,t1.slot,t.engineer_id")
                    .innerJoin(BigStorageCageDetails.class, BigStorageCageDetails::getGlassId, GlassInfo::getGlassId)
                    .eq(GlassInfo::getEngineerId, engineerId)
                    .ne(GlassInfo::getTemperingLayoutId, 0)
                    .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN)
                    .orderByAsc(BigStorageCageDetails::getTemperingLayoutId)
                    .orderByAsc(BigStorageCageDetails::getTemperingFeedSequence)
            );
                    .orderByAsc(BigStorageCageDetails::getTemperingFeedSequence);
            if (dispatchCount > 0) {
                wrapper.in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL);
            } else {
                wrapper.in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN);
            }
            List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, wrapper);
            if (CollectionUtils.isNotEmpty(temperingGlassInfos)) {
                //避免大量数据插入导致sqlserver数据库异常,分批次每调存储依次
                List<List<TemperingGlassInfo>> temperingGlassInfoLists = Lists.partition(temperingGlassInfos, 50);