| | |
| | | package com.mes.workstation.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.uppattenusage.mapper.UpPattenUsageMapper; |
| | | import com.mes.workstation.entity.UpWorkSequence; |
| | |
| | | public class UpWorkstationServiceImpl extends ServiceImpl<UpWorkstationMapper, UpWorkstation> implements UpWorkstationService { |
| | | @Resource |
| | | UpPattenUsageMapper upPattenUsageMapper; |
| | | public static final String DB_100_10 = "DB_100_10"; |
| | | |
| | | //判断是否可以吸片进行任务 |
| | | public boolean isCanLoadGlass() { |
| | | String loadstart = "吸片信号";//plcmes.getPlcParameter("吸片信号").getValue(); |
| | | return "1".equals(loadstart); |
| | | |
| | | } |
| | | //显示正在进行任务的工程信息 |
| | | @Resource |
| | | UpWorkstationMapper upWorkstationMapper; |
| | | |
| | | |
| | | //判断优先吸片位置后发送出片任务 |
| | | |
| | | public UpWorkSequence selectPriority() { |
| | | UpWorkSequence upwork= this.baseMapper.selectPriority(1); |
| | | String start = "1";//plcmes.getPlcParameter("吸片信号").getValue(); |
| | | UpPattenUsage uplist=new UpPattenUsage(); |
| | | if(start.equals("1")){ |
| | | //发送出片任务 |
| | | UpdateWrapper<UpPattenUsage> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("state",1).last("LIMIT 1"); |
| | | uplist= upPattenUsageMapper.selectOne(updateWrapper); |
| | | log.info("查询出本次出片的玻璃信息[]",uplist); |
| | | } |
| | | return upwork; |
| | | public UpPattenUsage selectPriority(Engineering engineering) { |
| | | QueryWrapper<UpPattenUsage> wrapper=new QueryWrapper<>(); |
| | | wrapper.eq("state", 0) |
| | | .eq("engineering_id",engineering.getEngineerId()) |
| | | .orderByAsc("layout_sequence") |
| | | .last("limit 1"); |
| | | return upPattenUsageMapper.selectOne(wrapper); |
| | | } |
| | | |
| | | //判断工位是否有符合条件的玻璃 |
| | | @Override |
| | | public UpWorkstation selectWorkstation(UpPattenUsage upPattenUsage) { |
| | | QueryWrapper<UpWorkstation> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("pattern_width", upPattenUsage.getWidth()) |
| | | .eq("pattern_height", upPattenUsage.getHeight()) |
| | | .eq("pattern_thickness", upPattenUsage.getThickness()) |
| | | .eq("films_id", upPattenUsage.getFilmsId()) |
| | | .gt("number", 0) |
| | | .orderByAsc("number") |
| | | .last("limit 1"); |
| | | return this.baseMapper.selectOne(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void reduceWorkstationNumber(Integer upworkId) { |
| | | UpdateWrapper<UpWorkstation> wrapper = new UpdateWrapper<>(); |
| | | wrapper.eq("id", upworkId) |
| | | .setSql("number = number - 1"); |
| | | boolean updateResult = upWorkstationMapper.update(null, wrapper) > 0; |
| | | log.info("减少工位数量{}",updateResult); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 增加人工输入的工位玻璃信息/删除人工搬走的玻璃信息 |
| | | * @param upwork |
| | | */ |
| | | @Override |
| | | public void updateGlassMessage(UpWorkstation upwork) { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | } |