|  |  |  | 
|---|
|  |  |  | package com.zy.core.model.protocol; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.core.common.Cools; | 
|---|
|  |  |  | import com.core.common.SpringUtils; | 
|---|
|  |  |  | import com.zy.asrs.entity.BasSte; | 
|---|
|  |  |  | import com.zy.asrs.service.BasSteService; | 
|---|
|  |  |  | import com.zy.core.enums.SteHisTaskStatusType; | 
|---|
|  |  |  | import com.zy.core.enums.SteLocaType; | 
|---|
|  |  |  | import com.zy.core.enums.SteStatusType; | 
|---|
|  |  |  | import lombok.Data; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * Created by vincent on 2020/8/7 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Slf4j | 
|---|
|  |  |  | @Data | 
|---|
|  |  |  | public class SteProtocol { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | basSte.setSteErr(alarm.longValue()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | basSte.setWrkNo(taskNo.intValue()); | 
|---|
|  |  |  | if (!Cools.isEmpty(row)) { | 
|---|
|  |  |  | basSte.setRow(row.intValue()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (!Cools.isEmpty(bay)) { | 
|---|
|  |  |  | basSte.setBay(bay.intValue()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (!Cools.isEmpty(lev)) { | 
|---|
|  |  |  | basSte.setLev(lev.intValue()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //        if (basSte.getPakMk().equals("N")) { | 
|---|
|  |  |  | //            if (!Cools.isEmpty(row)) { | 
|---|
|  |  |  | //                basSte.setRow(row.intValue()); | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | //            if (!Cools.isEmpty(bay)) { | 
|---|
|  |  |  | //                basSte.setBay(bay.intValue()); | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | //            if (!Cools.isEmpty(lev)) { | 
|---|
|  |  |  | //                basSte.setLev(lev.intValue()); | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  | return basSte; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 是否处于空闲待命状态 | 
|---|
|  |  |  | public Boolean isIdle() { | 
|---|
|  |  |  | return this.statusType.equals(SteStatusType.IDLE) | 
|---|
|  |  |  | boolean res = this.statusType.equals(SteStatusType.IDLE) | 
|---|
|  |  |  | && this.pakMk.equals("N") | 
|---|
|  |  |  | && !isAlarm(); | 
|---|
|  |  |  | if (!res) { | 
|---|
|  |  |  | return res; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | // 电量 | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | String chargeLine = SpringUtils.getBean(BasSteService.class).selectById(this.steNo).getChargeLine(); | 
|---|
|  |  |  | return charge > Float.parseFloat(chargeLine); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | log.error("fail", e); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 是否处于报警状态 | 
|---|