| | |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.entity.BigStorageDTO; |
| | | import com.mes.bigstorage.entity.dto.SlotSequenceDTO; |
| | | import com.mes.bigstorage.entity.dto.TemperingLayoutDTO; |
| | | import com.mes.bigstorage.entity.dto.*; |
| | | import com.mes.bigstorage.entity.vo.BigStorageQueryVO; |
| | | import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | |
| | | } |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot) |
| | | // .notInSql(BigStorageCage::getSlot, "select distinct slot from big_storage_cage_details where state = 0") |
| | | .inSql(BigStorageCage::getDeviceId, |
| | | "select distinct device_id from big_storage_cage_details where engineer_id = '" + glassInfo.getEngineerId() + "' and tempering_layout_id = " + glassInfo.getTemperingLayoutId()) |
| | |
| | | } |
| | | 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")); |
| | |
| | | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selectTemperingGlass() { |
| | | List<Map<String, Object>> temperingGlass = baseMapper.selectTemperingGlassCount(); |
| | | return temperingGlass; |
| | | public List<TemperingGlassCountDTO> selectTemperingGlass(int isTempering) { |
| | | return baseMapper.selectTemperingGlassCount(isTempering); |
| | | } |
| | | |
| | | @Override |
| | | public void updateBySlot(List<UpdateBigStorageCageDTO> glassList, int state) { |
| | | baseMapper.updateBySlot(glassList, state); |
| | | } |
| | | |
| | | @Override |
| | | public String dispatchSwitch(Boolean flag) { |
| | | redisUtil.setCacheObject("dispatchSwitch", flag); |
| | | return "success"; |
| | | } |
| | | |
| | | @Override |
| | | public List<GlassInfoLackDTO> queryLackGlassInfo(BigStorageQueryVO bigStorageQueryVO) { |
| | | return baseMapper.queryLackGlassInfo(bigStorageQueryVO); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void appointEngineerId(String engineerId) { |
| | | redisUtil.setCacheObject("temperingengineerId", engineerId); |
| | | public boolean appointTemperingEngineerId(String engineerId) { |
| | | LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | temperingGlassInfoLambdaQueryWrapper |
| | | .eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW); |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoMapper.selectList(temperingGlassInfoLambdaQueryWrapper); |
| | | |
| | | 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) |
| | | .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) |
| | | ); |
| | | if (CollectionUtils.isNotEmpty(temperingGlassInfos)) { |
| | | temperingGlassInfoService.saveBatch(temperingGlassInfos); |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public List<BigStorageRelationDTO> queryIsAllNeedDispatchVirtualSlot() { |
| | | return baseMapper.queryIsAllNeedDispatchVirtualSlot(); |
| | | } |
| | | |
| | | @Override |
| | | public List<BigStorageSequenceDTO> dispatchBigStorageGlassInfo(BigStorageRelationDTO bigStorageRelationDTO) { |
| | | return baseMapper.queryNeedDispatchSlot(bigStorageRelationDTO); |
| | | } |
| | | |
| | | @Override |
| | | public String bigStorageGlassDamageByGlassId(String glassId) { |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId(glassId); |
| | | damage.setType(Const.GLASS_STATE_DAMAGE); |
| | | damageService.insertDamage(damage); |
| | | return "success"; |
| | | } |
| | | |
| | | @Override |
| | | public void updateDeviceIdBySlot(List<Integer> slotList) { |
| | | baseMapper.updateDeviceIdBySlot(slotList); |
| | | } |
| | | } |