| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.common.api.dto.message.MessageDTO; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.constant.enums.MessageSplitTypeEnum; |
| | | import org.jeecg.common.system.api.ISysBaseAPI; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.mdc.dto.MdcEquDepDto; |
| | |
| | | } else if ("ZUOLAN".equals(mdcEquipment.getDriveType()) && "spindlespeed".equals(englishName) && oporation == 3) { |
| | | // ZUOLAN设备主轴转速字段spindlespeed |
| | | value = String.valueOf(((new Random().nextInt(35)) + 1) * 100); |
| | | mdcEquipmentDto.setSpindlespeed(value); |
| | | } else if ("ZUOLAN".equals(mdcEquipment.getDriveType()) && "spindleload".equals(englishName) && oporation == 3) { |
| | | // ZUOLAN设备主轴负荷字段spindleload |
| | | value = String.valueOf(Integer.valueOf(new Random().nextInt(21))); |
| | | mdcEquipmentDto.setSpindleload(value); |
| | | } else if ("ZUOLAN".equals(mdcEquipment.getDriveType()) && "spindlebeilv".equals(englishName) && oporation == 3) { |
| | | // ZUOLAN设备主轴倍率字段spindlebeilv |
| | | value = String.valueOf((new Random().nextInt(13)) * 10); |
| | | mdcEquipmentDto.setSpindlebeilv(value); |
| | | } else if ("ZUOLAN".equals(mdcEquipment.getDriveType()) && "feedbeilv".equals(englishName) && oporation == 3) { |
| | | // ZUOLAN设备进给倍率字段feedbeilv |
| | | value = String.valueOf((new Random().nextInt(13)) * 10); |
| | | mdcEquipmentDto.setFeedbeilv(value); |
| | | } else if ("spindle_current".equals(englishName)) { |
| | | // 其他设备电流字段 |
| | | String devicePower = mdcEquipment.getDevicePower(); |
| | |
| | | MessageDTO messageDTO = new MessageDTO(); |
| | | messageDTO.setTitle("【设备异常提醒】" + productionName + "车间设备编号为 [" + mdcEquipment.getEquipmentId() + "] 的设备" + mdcEquipmentThreshold.getChineseName() + "报警!"); |
| | | messageDTO.setCategory(CommonConstant.MSG_CATEGORY_2); |
| | | messageDTO.setMessageType(MessageSplitTypeEnum.deviceRunError.getType()); |
| | | messageDTO.setFromUser("admin"); |
| | | messageDTO.setToUser("admin"); |
| | | MdcOverrunAlarm mdcOverrunAlarm = new MdcOverrunAlarm(); |