| | |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.google.common.collect.Lists; |
| | | import com.mes.base.entity.vo.BigStorageVO; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.entity.dto.*; |
| | |
| | | |
| | | if (temperingGlassInfoList.size() == 0) { |
| | | List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, JoinWrappers.lambda(GlassInfo.class) |
| | | .selectAll(GlassInfo.class) |
| | | .select("-1 as state") |
| | | .selectAs(BigStorageCageDetails::getSlot, TemperingGlassInfo::getSlot) |
| | | .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) |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<BigStorageCageDetails> queryRealGlassInfo(BigStorageQueryVO bigStorageQueryVO) { |
| | | return this.list(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getEngineerId, bigStorageQueryVO.getEngineerId()) |
| | | .eq(BigStorageCageDetails::getTemperingLayoutId, bigStorageQueryVO.getTemperingLayoutId()) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL).orderByAsc(BigStorageCageDetails::getTemperingFeedSequence)); |
| | | } |
| | | |
| | | @Override |
| | | public Map<Integer, List<BigStorageVO>> querybigStorageCageDetail() { |
| | | List<BigStorageVO> bigStorageCages = baseMapper.querybigStorageCageDetail(); |
| | | return bigStorageCages.stream().collect(Collectors.groupingBy(item -> item.getDeviceId())); |
| | | } |
| | | |
| | | @Override |
| | | public boolean cancelTemperingTask() { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public String temperingSwitch(Boolean flag) { |
| | | redisUtil.setCacheObject("temperingSwitch", flag); |
| | | return "success"; |
| | |
| | | |
| | | if (temperingGlassInfoList.size() == 0) { |
| | | List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, JoinWrappers.lambda(GlassInfo.class) |
| | | .selectAll(GlassInfo.class) |
| | | .select("-1 as state") |
| | | .selectAs(BigStorageCageDetails::getSlot, TemperingGlassInfo::getSlot) |
| | | .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(GlassInfo::getTemperingLayoutId) |
| | | .orderByAsc(GlassInfo::getTemperingFeedSequence) |
| | | .orderByAsc(BigStorageCageDetails::getTemperingLayoutId) |
| | | .orderByAsc(BigStorageCageDetails::getTemperingFeedSequence) |
| | | ); |
| | | if (CollectionUtils.isNotEmpty(temperingGlassInfos)) { |
| | | temperingGlassInfoService.saveBatch(temperingGlassInfos); |
| | | //避免大量数据插入导致sqlserver数据库异常,分批次每调存储依次 |
| | | List<List<TemperingGlassInfo>> temperingGlassInfoLists = Lists.partition(temperingGlassInfos, 50); |
| | | for (List<TemperingGlassInfo> item : temperingGlassInfoLists) { |
| | | temperingGlassInfoService.saveBatch(item); |
| | | } |
| | | return true; |
| | | } |
| | | } |