| | |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.mapper.TemperingGlassInfoMapper; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | |
| | | public List<TemperingGlassInfo> selectWaitingGlass() { |
| | | //获取等待进炉中的玻璃信息 |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | //wrapper.eq("state",1); |
| | | wrapper.in("state",1,0,-1); |
| | | return temperingMapper.selectList(wrapper); |
| | | wrapper.select("Top 1 *").eq("state",1); |
| | | TemperingGlassInfo glass=temperingMapper.selectOne(wrapper); |
| | | QueryWrapper<TemperingGlassInfo> glassinfo = new QueryWrapper<>(); |
| | | glassinfo.eq("engineer_id",glass.getEngineerId()) |
| | | .eq("tempering_layout_id", glass.getTemperingLayoutId()); |
| | | return temperingMapper.selectList(glassinfo); |
| | | } |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectIntoGlass(int layoutId) { |
| | | public List<TemperingGlassInfo> selectIntoGlass(TemperingGlassInfo temperingGlassInfo) { |
| | | //获取进炉中的玻璃信息 |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("state",2) |
| | | .eq("tempering_layout_id", layoutId) |
| | | wrapper.eq("tempering_layout_id", temperingGlassInfo.getTemperingLayoutId()) |
| | | .eq("engineer_id", temperingGlassInfo.getEngineerId()) |
| | | .orderByAsc("tempering_layout_id","tempering_feed_sequence"); |
| | | return temperingMapper.selectList(wrapper); |
| | | } |
| | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectOutGlass() { |
| | | //获取出炉中的玻璃信息 |
| | | QueryWrapper<TemperingGlassInfo> wrap = new QueryWrapper<>(); |
| | | wrap.select("Top 1 *").eq("state",3); |
| | | TemperingGlassInfo glass=temperingMapper.selectOne(wrap); |
| | | //根据工程号和版图获取数据 |
| | | QueryWrapper<TemperingGlassInfo> wapper = new QueryWrapper<>(); |
| | | wapper.eq("state", 3) |
| | | wapper.eq("engineer_id",glass.getEngineerId()) |
| | | .eq("tempering_layout_id", glass.getTemperingLayoutId()) |
| | | .orderByAsc("tempering_layout_id","tempering_feed_sequence"); |
| | | return temperingMapper.selectList(wapper); |
| | | } |
| | |
| | | //获取过旋转台最大的钢化版图id |
| | | QueryWrapper<TemperingGlassInfo> wapper = new QueryWrapper<>(); |
| | | wapper.select("Top 1 *").eq("state", 4) |
| | | .orderByDesc("tempering_layout_id"); |
| | | .orderByDesc("tempering_layout_id,engineer_id"); |
| | | //根据最大的版图id显示钢化后的版图信息 |
| | | TemperingGlassInfo glassinfo= temperingMapper.selectOne(wapper); |
| | | if (glassinfo == null) { |
| | | return null; // 直接返回null,表示没有找到符合条件的记录 |
| | | } |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("tempering_layout_id",glassinfo.getTemperingLayoutId()); |
| | | wrapper.eq("tempering_layout_id",glassinfo.getTemperingLayoutId()) |
| | | .eq("engineer_id",glassinfo.getEngineerId()); |
| | | |
| | | return temperingMapper.selectList(wrapper); |
| | | } |
| | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectLayoutId() { |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("distinct tempering_layout_id") |
| | | wrapper.select("distinct tempering_layout_id,engineer_id") |
| | | .eq("state",2) |
| | | .orderByAsc("tempering_layout_id"); |
| | | return temperingMapper.selectList(wrapper); |
| | |
| | | |
| | | @Override |
| | | public Integer updateTemperingState(TemperingGlassInfo temperingGlassInfo) { |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | UpdateWrapper<TemperingGlassInfo> wrapper = new UpdateWrapper<>(); |
| | | wrapper.eq("glass_id",temperingGlassInfo.getGlassId()) |
| | | .lt("state",5); |
| | | if (temperingMapper.update(temperingGlassInfo,wrapper) > 0) { |
| | | .lt("state",5) |
| | | .set("state", temperingGlassInfo.getState());; |
| | | if (temperingMapper.update(null,wrapper) > 0) { |
| | | return 200; |
| | | }else { |
| | | return 100; |