| | |
| | | |
| | | import cn.hutool.core.lang.Assert; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.service.OptimizeProjectService; |
| | | import com.mes.sysconfig.entity.SysConfig; |
| | | import com.mes.sysconfig.service.SysConfigService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | |
| | | private BigStorageCageService bigStorageCageService; |
| | | @Resource |
| | | private GlassInfoMapper glassInfoMapper; |
| | | @Resource |
| | | private OptimizeProjectService optimizeProjectService; |
| | | |
| | | @Resource |
| | | private GlassInfoService glassInfoService; |
| | |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot) |
| | | .inSql(BigStorageCage::getDeviceId, |
| | | "select distinct device_id from big_storage_cage_details where engineer_id = '" + EngineerId + "'") |
| | | "select distinct device_id from big_storage_cage_details where engineer_id = '" + EngineerId + "' and device_id not in (5,6)") |
| | | .last("limit 1")); |
| | | if (null != bigStorageCage) { |
| | | log.info("根据版图id找到笼子内的目标格子:{},玻璃id:{}", bigStorageCage.getSlot(), glassId); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<BigStorageRelationDTO> queryIsAllNeedDispatchVirtualSlot() { |
| | | return baseMapper.queryIsAllNeedDispatchVirtualSlot(); |
| | | public List<BigStorageRelationDTO> queryIsAllNeedDispatchVirtualSlot(List<Integer> deviceIdList) { |
| | | return baseMapper.queryIsAllNeedDispatchVirtualSlot(deviceIdList); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public void updateDeviceIdBySlot(List<Integer> slotList) { |
| | | baseMapper.updateDeviceIdBySlot(slotList); |
| | | } |
| | | |
| | | @Override |
| | | public List<BigStorageCageDetails> queryEngineer() { |
| | | QueryWrapper<BigStorageCageDetails> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("distinct engineer_id") |
| | | .eq("state", 100); |
| | | return this.list(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<BigStorageCageDetails> queryNeedDispatch() { |
| | | return baseMapper.queryNeedDispatch(); |
| | | } |
| | | |
| | | @Override |
| | | public BigStorageSlotDTO queryNeedDispatchSlotBySequence() { |
| | | return baseMapper.queryNeedDispatchSlotBySequence(); |
| | | } |
| | | |
| | | @Override |
| | | public List<OptimizeProject> queryTemperingOrder() { |
| | | String temperingengineerId = redisUtil.getCacheObject("temperingEngineerId"); |
| | | List<TemperingGlassCountDTO> temperingGlassCountDTOS = baseMapper.queryTemperingGlassCountSummary(1); |
| | | List<OptimizeProject> projectList = optimizeProjectService.engineerScheduling(new OptimizeProject() {{ |
| | | setType(3); |
| | | }}); |
| | | Set<String> projectNoSet = projectList.stream() |
| | | .map(OptimizeProject::getProjectNo) |
| | | .collect(Collectors.toSet()); |
| | | List<OptimizeProject> resultList= new ArrayList<>(); |
| | | for (TemperingGlassCountDTO dto : temperingGlassCountDTOS) { |
| | | if (projectNoSet.contains(dto.getEngineerId())) { |
| | | OptimizeProject project = new OptimizeProject(); |
| | | if (Objects.equals(dto.getEngineerId(), temperingengineerId)) { |
| | | project.setState(1); |
| | | } |
| | | project.setProjectNo(dto.getEngineerId()); |
| | | project.setGlassType(dto.getFilmsId()); |
| | | project.setGlassThickness(dto.getThickness().intValue()); |
| | | project.setGlassTotal(dto.getTotalCount()); |
| | | project.setGlassTotalArea(dto.getRealCount()); |
| | | resultList.add(project); |
| | | } |
| | | } |
| | | return resultList; |
| | | } |
| | | } |