| | |
| | | package com.mes.temperingglass.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.mapper.TemperingGlassInfoMapper; |
| | | import com.mes.temperingglass.mapper.TemperingMapper; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @since 2024-04-07 |
| | | */ |
| | | @Service |
| | | @DS("salve_hangzhoumes") |
| | | public class TemperingAgoServiceImpl extends MPJBaseServiceImpl<TemperingGlassInfoMapper, TemperingGlassInfo> implements TemperingAgoService { |
| | | @Autowired |
| | | TemperingMapper temperingMapper; |
| | |
| | | public List<TemperingGlassInfo> selectWaitingGlass() { |
| | | //获取等待进炉中的玻璃信息 |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.inSql("flowcard_id", "select flowcard_id from tempering_glass_info GROUP BY flowcard_id,state having count(state) = 2"); |
| | | //wrapper.eq("state",1); |
| | | wrapper.in("state",1,0); |
| | | return temperingMapper.selectList(wrapper); |
| | | } |
| | | |
| | |
| | | public List<TemperingGlassInfo> selectIntoGlass() { |
| | | //获取进炉中的玻璃信息 |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.inSql("flowcard_id", "select flowcard_id from tempering_glass_info where state=1 GROUP BY flowcard_id,state having count(state) = 1"); |
| | | |
| | | wrapper.eq("state",2) |
| | | .orderByAsc("tempering_layout_id","tempering_feed_sequence"); |
| | | return temperingMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> SelectOutGlass() { |
| | | public List<TemperingGlassInfo> selectOutGlass() { |
| | | //获取出炉中的玻璃信息 |
| | | QueryWrapper<TemperingGlassInfo> wapper = new QueryWrapper<>(); |
| | | wapper.eq("state", 3); |
| | | wapper.eq("state", 3) |
| | | .orderByAsc("tempering_layout_id","tempering_feed_sequence"); |
| | | return temperingMapper.selectList(wapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectOverGlass() { |
| | | //获取过旋转台最大的钢化版图id |
| | | QueryWrapper<TemperingGlassInfo> wapper = new QueryWrapper<>(); |
| | | wapper.select("top 1 *").eq("state", 4) |
| | | .orderByDesc("tempering_layout_id"); |
| | | //根据最大的版图id显示钢化后的版图信息 |
| | | TemperingGlassInfo glassinfo= temperingMapper.selectOne(wapper); |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("tempering_layout_id",glassinfo.getTemperingLayoutId()); |
| | | return temperingMapper.selectList(wrapper); |
| | | } |
| | | } |