| | |
| | | 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.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 |
| | | GlassInfoMapper glassInfoMapper; |
| | | |
| | | |
| | | /** |
| | | * 添加理片笼任务 |
| | | * @param taskCache |
| | |
| | | int serialNumber=1; |
| | | for(TaskCache taskCache1:taskCache){ |
| | | Map<String,Object> map=new HashMap<>(); |
| | | GlassInfo glassInfo=glassInfoMapper.selectOne(new MPJLambdaWrapper<GlassInfo>() |
| | | // 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) |
| | | .eq(GlassInfo::getGlassId,taskCache1.getGlassId())); |
| | | if(glassInfo!=null){ |
| | | .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_OUT) |
| | | ); |
| | | 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("FilmsId",glassInfo.getFilmsid());//膜系 |
| | | map.put("SerialNumber",serialNumber);//出片顺序 |
| | | result.add(map); |
| | | }else if(glassInfos.size()>1){ |
| | | log.info("数据不符合逻辑--磨边队列glassId重复:",glassInfos); |
| | | return new ArrayList<>(); |
| | | } |
| | | serialNumber++; |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | } |