| | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.mapper.TemperingGlassInfoMapper; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | * @since 2024-04-07 |
| | | */ |
| | | @Service |
| | | @DS("salve_hangzhoumes") |
| | | @DS("salve_northGlassMes") |
| | | public class TemperingGlassInfoServiceImpl extends MPJBaseServiceImpl<TemperingGlassInfoMapper, TemperingGlassInfo> implements TemperingGlassInfoService { |
| | | @Resource |
| | | TemperingGlassInfoMapper temperingMapper; |
| | | @Autowired |
| | | private GlassInfoMapper glassInfoMapper; |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectWaitingGlass() { |
| | |
| | | public List<TemperingGlassInfo> selectOutGlass() { |
| | | //获取出炉中的玻璃信息 |
| | | QueryWrapper<TemperingGlassInfo> wrap = new QueryWrapper<>(); |
| | | wrap.select("Top 1 *").eq("state", 3); |
| | | wrap.select("Top 1 *").eq("state", 4) |
| | | .orderByDesc("id"); |
| | | TemperingGlassInfo glass = temperingMapper.selectOne(wrap); |
| | | //根据工程号和版图获取数据 |
| | | if (glass != null) { |
| | |
| | | //获取过旋转台最大的钢化版图id |
| | | QueryWrapper<TemperingGlassInfo> wapper = new QueryWrapper<>(); |
| | | wapper.select("Top 1 *").eq("state", 4) |
| | | .orderByDesc("tempering_layout_id,engineer_id"); |
| | | .orderByDesc("id"); |
| | | //根据最大的版图id显示钢化后的版图信息 |
| | | TemperingGlassInfo glassinfo = temperingMapper.selectOne(wapper); |
| | | if (glassinfo == null) { |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public GlassInfo selectTempering(GlassInfo glassInfo) { |
| | | |
| | | QueryWrapper<GlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("max(tempering_layout_id)as id") |
| | | .eq("engineer_id", glassInfo.getEngineerId()); |
| | | |
| | | return glassInfoMapper.selectOne(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<GlassInfo> selectTemperingGlass(GlassInfo glassInfo) { |
| | | List<GlassInfo> glassInfos = null; |
| | | glassInfos = glassInfoMapper.selectJoinList(GlassInfo.class, new MPJQueryWrapper<GlassInfo>() |
| | | .select("IFNULL(b.status, 0) AS status,engineer_id,tempering_layout_id,width,height,tempering_feed_sequence,x_coordinate,y_coordinate,angle,t.glass_id,t.flow_card_id") |
| | | .leftJoin("(SELECT glass_id, MAX(status) AS status FROM damage GROUP BY glass_id) b\n" + |
| | | "ON t.glass_id = b.glass_id") |
| | | .eq("engineer_id", glassInfo.getEngineerId()) |
| | | .eq("tempering_layout_id", glassInfo.getTemperingLayoutId())); |
| | | return glassInfos; |
| | | // QueryWrapper<GlassInfo> wrapper = new QueryWrapper<>(); |
| | | // wrapper.eq("engineer_id", glassInfo.getEngineerId()) |
| | | // .eq("tempering_layout_id", glassInfo.getTemperingLayoutId()) |
| | | // .select("engineer_id,tempering_layout_id,width,height,tempering_feed_sequence,x_coordinate,y_coordinate,angle,glass_id"); |
| | | // return glassInfoMapper.selectList(wrapper); |
| | | } |
| | | } |