| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.mes.taskcache.mapper.TaskCacheMapper; |
| | | import com.mes.taskcache.service.TaskCacheService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class TaskCacheServiceImpl extends ServiceImpl<TaskCacheMapper, TaskCache> implements TaskCacheService { |
| | | |
| | | @Autowired |
| | | EdgStorageCageDetailsMapper edgStorageCageDetailsMapper; |
| | | |
| | | @Autowired |
| | | GlassInfoMapper glassInfoMapper; |
| | | |
| | | |
| | | /** |
| | | * 添加理片笼任务 |
| | | * @param taskCache |
| | |
| | | public List<Map<String,Object>> selectEdgInfo(String line) { |
| | | List<TaskCache> taskCache=baseMapper.selectList(new MPJLambdaWrapper<TaskCache>() |
| | | .selectAll(TaskCache.class) |
| | | .eq(TaskCache::getEndCell,line) |
| | | .eq(TaskCache::getTaskStatus,1)); |
| | | .eq(TaskCache::getEndCell, line) |
| | | .eq(TaskCache::getTaskStatus,1) |
| | | .orderByAsc(TaskCache::getCreateTime)); |
| | | List<Map<String,Object>> result=new ArrayList<>(); |
| | | int serialNumber=1; |
| | | for(TaskCache taskCache1:taskCache){ |
| | | Map<String,Object> map=new HashMap<>(); |
| | | EdgStorageCageDetails edgStorageCageDetails=edgStorageCageDetailsMapper.selectOne(new MPJLambdaWrapper<EdgStorageCageDetails>() |
| | | .selectAll(EdgStorageCageDetails.class) |
| | | .eq(EdgStorageCageDetails::getGlassId,taskCache1.getGlassId())); |
| | | if(edgStorageCageDetails!=null){ |
| | | map.put("Line",line); |
| | | map.put("Width",edgStorageCageDetails.getWidth()); |
| | | map.put("Height",edgStorageCageDetails.getHeight()); |
| | | map.put("Thickness",edgStorageCageDetails.getThickness()); |
| | | map.put("GlassId",edgStorageCageDetails.getGlassId()); |
| | | map.put("FlowCardId",edgStorageCageDetails.getFlowCardId()); |
| | | map.put("TemperingLayoutId",edgStorageCageDetails.getTemperingLayoutId()); |
| | | map.put("TemperingFeedSequence",edgStorageCageDetails.getTemperingFeedSequence()); |
| | | // GlassInfo glassInfo=glassInfoMapper.selectOne(new MPJLambdaWrapper<GlassInfo>() |
| | | // .selectAll(GlassInfo.class) |
| | | // .eq(GlassInfo::getGlassId,taskCache1.getGlassId())); |
| | | List<GlassInfo> glassInfos=glassInfoMapper.selectJoinList(GlassInfo.class, new MPJLambdaWrapper<GlassInfo>() |
| | | .selectAll(GlassInfo.class) |
| | | .innerJoin(EdgStorageCageDetails.class, on -> on |
| | | .eq(EdgStorageCageDetails::getGlassId, GlassInfo::getGlassId) |
| | | .eq(EdgStorageCageDetails::getEngineerId, GlassInfo::getEngineerId)) |
| | | .eq(GlassInfo::getGlassId,taskCache1.getGlassId()) |
| | | .eq(EdgStorageCageDetails::getState,Const.GLASS_STATE_IN) |
| | | ); |
| | | if(glassInfos.size()==1){ |
| | | GlassInfo glassInfo=glassInfos.get(0); |
| | | map.put("Line",line);//线路 2001 1线, 2002 2线 |
| | | map.put("Width",glassInfo.getWidth());//宽 |
| | | map.put("Height",glassInfo.getHeight());//高 |
| | | map.put("Thickness",glassInfo.getThickness());//厚 |
| | | map.put("GlassId",glassInfo.getGlassId());//玻璃ID |
| | | map.put("FlowCardId",glassInfo.getFlowCardId());//流程卡号 |
| | | map.put("TemperingLayoutId",glassInfo.getTemperingLayoutId());// 暂不显示 钢化版图ID |
| | | map.put("TemperingFeedSequence",glassInfo.getTemperingFeedSequence());// 暂不显示 钢化版图ID内的序号 |
| | | map.put("FilmsId",glassInfo.getFilmsid());//膜系 |
| | | map.put("SerialNumber",serialNumber);//出片顺序 |
| | | result.add(map); |
| | | }else if(glassInfos.size()>1){ |
| | | log.info("数据不符合逻辑--磨边队列glassId重复:",glassInfos); |
| | | return new ArrayList<>(); |
| | | } |
| | | serialNumber++; |
| | | } |
| | | |
| | | return result; |
| | | // return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("end_cell",line)); |
| | | } |
| | | |
| | | @Override |
| | | public TaskCache queryGlassByTaskCache(int line, List<Integer> taskTypes) { |
| | | return baseMapper.queryGlassByTaskCache(line, taskTypes); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | } |