| | |
| | | |
| | | 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; |
| | |
| | | QueryWrapper<TemperingGlassInfo> glassinfo = new QueryWrapper<>(); |
| | | glassinfo.eq("engineer_id", glass.getEngineerId()) |
| | | .eq("tempering_layout_id", glass.getTemperingLayoutId()); |
| | | return temperingMapper.selectList(glassinfo); |
| | | //return temperingMapper.selectList(glassinfo); |
| | | return temperingMapper.selectByEngineerIdAndLayoutId(glass.getEngineerId(),glass.getTemperingLayoutId()); |
| | | }else { |
| | | return null; |
| | | } |
| | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectIntoGlass(TemperingGlassInfo temperingGlassInfo) { |
| | | //获取进炉中的玻璃信息 |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("tempering_layout_id", temperingGlassInfo.getTemperingLayoutId()) |
| | | .eq("engineer_id", temperingGlassInfo.getEngineerId()) |
| | | .orderByAsc("tempering_layout_id","tempering_feed_sequence"); |
| | | return temperingMapper.selectList(wrapper); |
| | | // QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | // wrapper.eq("tempering_layout_id", temperingGlassInfo.getTemperingLayoutId()) |
| | | // .eq("engineer_id", temperingGlassInfo.getEngineerId()) |
| | | // .orderByAsc("tempering_layout_id","tempering_feed_sequence"); |
| | | // return temperingMapper.selectList(wrapper); |
| | | return temperingMapper.selectByEngineerIdAndLayoutId(temperingGlassInfo.getEngineerId(),temperingGlassInfo.getTemperingLayoutId()); |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | TemperingGlassInfo glass=temperingMapper.selectOne(wrap); |
| | | //根据工程号和版图获取数据 |
| | | if(glass != null) { |
| | | QueryWrapper<TemperingGlassInfo> wapper = new QueryWrapper<>(); |
| | | wapper.eq("engineer_id", glass.getEngineerId()) |
| | | .eq("tempering_layout_id", glass.getTemperingLayoutId()) |
| | | .orderByAsc("tempering_layout_id", "tempering_feed_sequence"); |
| | | return temperingMapper.selectList(wapper); |
| | | return temperingMapper.selectByEngineerIdAndLayoutId(glass.getEngineerId(),glass.getTemperingLayoutId()); |
| | | } |
| | | return null; |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (glassinfo == null) { |
| | | return null; // 直接返回null,表示没有找到符合条件的记录 |
| | | } |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("tempering_layout_id",glassinfo.getTemperingLayoutId()) |
| | | .eq("engineer_id",glassinfo.getEngineerId()); |
| | | return temperingMapper.selectByEngineerIdAndLayoutId(glassinfo.getEngineerId(),glassinfo.getTemperingLayoutId()); |
| | | |
| | | return temperingMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectLayoutId() { |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("distinct tempering_layout_id,engineer_id") |
| | | wrapper.select("tempering_layout_id,engineer_id,max(id) as id") |
| | | .eq("state",2) |
| | | .orderByAsc("tempering_layout_id"); |
| | | .groupBy("tempering_layout_id,engineer_id") |
| | | .orderByDesc("id"); |
| | | return temperingMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectTaskType() { |
| | | public List<TemperingGlassInfo> selectTaskType() { |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("state") |
| | | .groupBy("state"); |
| | |
| | | |
| | | @Override |
| | | public Integer updateTemperingState(TemperingGlassInfo temperingGlassInfo) { |
| | | UpdateWrapper<TemperingGlassInfo> wrapper = new UpdateWrapper<>(); |
| | | wrapper.eq("glass_id",temperingGlassInfo.getGlassId()) |
| | | .lt("state",6) |
| | | .set("state", temperingGlassInfo.getState());; |
| | | if (temperingMapper.update(null,wrapper) > 0) { |
| | | if (temperingMapper.updateTemperingGlassInfo(temperingGlassInfo) > 0) { |
| | | return 200; |
| | | }else { |
| | | return 100; |