| | |
| | | package com.mes.temperingglass.service.impl; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | 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.kangaroohy.milo.model.ReadWriteEntity; |
| | | import com.kangaroohy.milo.service.MiloService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.entity.LoadGlassInfo; |
| | | 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 lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Service |
| | | @DS("north_glass_mes") |
| | | @Slf4j |
| | | public class TemperingGlassInfoServiceImpl extends MPJBaseServiceImpl<TemperingGlassInfoMapper, TemperingGlassInfo> implements TemperingGlassInfoService { |
| | | @Resource |
| | | TemperingGlassInfoMapper temperingMapper; |
| | | @Autowired |
| | | |
| | | @Resource |
| | | private GlassInfoMapper glassInfoMapper; |
| | | |
| | | @Autowired(required = false) |
| | | MiloService miloService; |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectWaitingGlassByOpc() { |
| | | //获取等待进炉中的玻璃信息 |
| | | try { |
| | | ReadWriteEntity engineerEntity = miloService.readFromOpcUa("GH2S7.GH2S7.F09_ENGINEER_ID"); |
| | | ReadWriteEntity temperingLayoutIdEntity = miloService.readFromOpcUa("GH2S7.GH2S7.F09_TEMPERING_LAYOUT_ID"); |
| | | |
| | | if (null == engineerEntity || null == temperingLayoutIdEntity) { |
| | | engineerEntity = miloService.readFromOpcUa("GH2S7.GH2S7.F08_ENGINEER_ID"); |
| | | temperingLayoutIdEntity = miloService.readFromOpcUa("GH2S7.GH2S7.F08_TEMPERING_LAYOUT_ID"); |
| | | if (null == engineerEntity || null == temperingLayoutIdEntity) { |
| | | log.info("获取参数异常,结束本次任务"); |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | return this.list(new LambdaQueryWrapper<TemperingGlassInfo>() |
| | | .eq(TemperingGlassInfo::getEngineerId, engineerEntity.getValue() + "") |
| | | .eq(TemperingGlassInfo::getTemperingLayoutId, temperingLayoutIdEntity.getValue() + "")); |
| | | } catch (Exception e) { |
| | | log.info("获取钢化参数异常:{}", e); |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> selectWaitingGlass() { |
| | | //获取等待进炉中的玻璃信息 |