| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.mes.common.S7object; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.common.config.ConstSysConfig; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.sysconfig.service.SysConfigService; |
| | | import com.mes.sysdict.entity.SysDictData; |
| | | import com.mes.sysdict.service.SysDictDataService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Comparator; |
| | |
| | | @Autowired |
| | | private SysDictDataService sysDictDataService; |
| | | |
| | | @Autowired |
| | | private SysConfigService sysConfigService; |
| | | |
| | | private static final String ALONE_STATE = "0"; |
| | | |
| | | @Value("${mes.width}") |
| | | private Integer temperingWidth; |
| | | @Value("${mes.height}") |
| | | private Integer temperingHeight; |
| | | |
| | | // @Scheduled(fixedDelay = 1000) |
| | | public void temperingGlassBefore() { |
| | |
| | | double maxArea = temperingGlassList.stream().mapToDouble(e -> e.getWidth() * e.getHeight()).max().orElse(0.0); |
| | | double minArea = temperingGlassList.stream().mapToDouble(e -> e.getWidth() * e.getHeight()).min().orElse(0.0); |
| | | double areaDifference = (10000 * (maxArea - minArea) / maxArea); |
| | | Integer temperingHeight = sysConfigService.queryConfigValue(ConstSysConfig.TEMPERING_HEIGHT); |
| | | Integer temperingWidth = sysConfigService.queryConfigValue(ConstSysConfig.TEMPERING_HEIGHT); |
| | | double loadingRate = (int) (10000 * sumArea / (temperingHeight * temperingWidth)); |
| | | TemperingRecord temperingRecord = new TemperingRecord(); |
| | | temperingRecord.setEngineerId(maxGlassInfo.getEngineerId()); |