zhang
7 天以前 e5950739d6df283c02fe3160b8b8f739a902f415
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/AgvServiceImpl.java
@@ -2,7 +2,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.xingshuangs.iot.protocol.modbus.service.ModbusRtuOverTcp;
import com.ghgande.j2mod.modbus.facade.ModbusTCPMaster;
import com.zy.acs.charge.ChargeCoreService;
import com.zy.acs.common.constant.RedisConstant;
import com.zy.acs.common.enums.AgvStatusType;
@@ -343,18 +343,18 @@
    @Override
    public Boolean judgeAutoStopCharge(AgvModel agvModel, AgvDetail agvDetail, Agv agv ) {
        if (redis.getMap(RedisConstant.AGV_CHARGE_FLAG, agv.getUuid()) != null){
            return  false;
            return true;
        }
        // 手动充电模式,跳过
        if (agvModel.getNeedUndocking() != null && agvModel.getNeedUndockingBool()) {
            FuncSta funcSta = funcStaService.getByCodeAndType(agvDetail.getCode(), FuncStaType.CHARGE.toString());
            ModbusRtuOverTcp modbusTcp = chargeService.get(funcSta.getUuid());
            // 手动充电模式,跳过
            if (chargeCoreService.getChargeMode(modbusTcp) != 1) {
                return  false;
            }
        }
        return true;
//        if (agvModel.getNeedUndocking() != null && agvModel.getNeedUndockingBool()) {
//            FuncSta funcSta = funcStaService.getByCodeAndType(agvDetail.getCode(), FuncStaType.CHARGE.toString());
//            ModbusTCPMaster modbusTCPMaster = chargeService.get(funcSta.getUuid());
//            // 手动充电模式,跳过
//            if (modbusTCPMaster != null && chargeCoreService.getChargeMode(modbusTCPMaster) == 1) {
//                return true;
//            }
//        }
        return false;
    }
}