| | |
| | | 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.common.S7object; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.uppattenusage.mapper.UpPattenUsageMapper; |
| | | import com.mes.workstation.entity.UpWorkSequence; |
| | | import com.mes.workstation.entity.UpWorkstation; |
| | | import com.mes.workstation.mapper.UpWorkstationMapper; |
| | | import com.mes.workstation.service.UpWorkstationService; |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | |
| | | //判断优先吸片位置后发送出片任务 |
| | | |
| | | @Override |
| | | public UpPattenUsage selectPriority(Engineering engineering) { |
| | | QueryWrapper<UpPattenUsage> wrapper=new QueryWrapper<>(); |
| | | QueryWrapper<UpPattenUsage> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("state", 0) |
| | | .eq("engineering_id",engineering.getEngineerId()) |
| | | .eq("engineering_id", engineering.getEngineerId()) |
| | | .orderByAsc("layout_sequence") |
| | | .last("limit 1"); |
| | | return upPattenUsageMapper.selectOne(wrapper); |
| | |
| | | wrapper.eq("id", upworkId) |
| | | .setSql("number = number - 1"); |
| | | boolean updateResult = upWorkstationMapper.update(null, wrapper) > 0; |
| | | log.info("减少工位数量{}",updateResult); |
| | | log.info("减少工位数量{}", updateResult); |
| | | |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void updateGlassMessage(UpWorkstation upwork) { |
| | | UpdateWrapper<UpWorkstation> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("workstation_id", upwork.getWorkstationId()); |
| | | int update = this.baseMapper.update(upwork, updateWrapper); |
| | | if (upwork.getWorkstationId() == 1 || upwork.getWorkstationId() == 3) { |
| | | updateWrapper.eq("workstation_id", upwork.getWorkstationId()); |
| | | int update = this.baseMapper.update(upwork, updateWrapper); |
| | | } else { |
| | | if (upwork.getPatternHeight() > 2700 || upwork.getPatternHeight() == 0) { |
| | | updateWrapper.eq("workstation_id", upwork.getWorkstationId()); |
| | | int update = this.baseMapper.update(upwork, updateWrapper); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public String updateMesInkageLoad(short inKageWord) { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | log.info("修改设备两栋请求为{}:0联线;1联动", inKageWord); |
| | | S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("InkageStatus").getAddress(), inKageWord); |
| | | return "success"; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |