liukangdong
2024-10-11 eaf4587b47701f3df0559e64362d6ea413d782f3
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java
@@ -1035,47 +1035,67 @@
        );
        //广播 led通知
        this.broadcastAndLEed(platformJob,Constants.PlatformBroadcastContent.CALLING.getInfo().replace("{param2}",platform.getName()));
        platformJob.setPlatformName(platform.getName());
        this.broadcastAndLEed(platformJob,Constants.PlatformLedContent.CALLING.getInfo(),
                Constants.PlatformBroadcastContent.CALLING.getInfo()
        );
        return platformJob;
    }
    public void broadcastAndLEed(PlatformJob model,String content){
    public void broadcastAndLEed(PlatformJob model,String ledContent,String broadcastContent){
        int speed = 13;
        try {
            speed = Integer.parseInt(systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.LED_CONTENT_SPEED).getCode());
        }catch (Exception e){
        }
        log.error("查询LED与广播数据------------------------------------------------------------------------------------------");
        List<PlatformDevice> deviceList = platformDeviceMapper.selectList(new QueryWrapper<PlatformDevice>().lambda()
                .eq(PlatformDevice::getPlatformId,model.getPlatformId())
                .eq(PlatformDevice::getIsdeleted,Constants.ZERO));
        if(deviceList ==null || deviceList.size() == 0){
            return;
        }
        content = content.replace("${param}",model.getPlatformName());
        content = content.replace("${param2}",model.getCarCodeFront());
        Boolean sendLed = StringUtils.isBlank(ledContent)?false:true;
        Boolean sendBroadcast = StringUtils.isBlank(broadcastContent)?false:true;
        if (sendLed) {
            //广播  param2 = 车牌号   param = 月台
            ledContent = ledContent.replace("${param}",model.getPlatformName());
            ledContent = ledContent.replace("${param2}",model.getCarCodeFront());
        }
        if(sendBroadcast){
            //广播  param2 = 月台     param = 车牌号
            broadcastContent = broadcastContent.replace("${param2}",model.getPlatformName());
            broadcastContent = broadcastContent.replace("${param}",model.getCarCodeFront());
        }
        List<String> broadcastList = new ArrayList<>();
        List<String> ledList = new ArrayList<>();
        String bNames = "";
        List<PlatformBroadcastLog> logList = new ArrayList<>();
        log.error("循环调起led与广播------------------------------------------------------------------------------------------");
        for(PlatformDevice device : deviceList){
            if(StringUtils.isNotBlank(device.getHkId())){
            if(StringUtils.isBlank(device.getHkId())){
                continue;
            }
            if(Constants.equalsInteger(device.getType(),Constants.ZERO)){
            if(Constants.equalsInteger(device.getType(),Constants.ZERO)&&sendLed){
                log.error("调起led------------------------------------------------------------------------------------------");
                //如果是LED
                PlatformBroadcastLog log = HkSyncPushServiceImpl.dealLedContentBiz(device.getHkNo(),device.getName(),content,speed,1);
                PlatformBroadcastLog log = HkSyncPushServiceImpl.dealLedContentBiz(device.getHkNo(),device.getName(),ledContent,speed,1);
                logList.add(log);
                ledList.add(device.getHkId());
            }else  if(Constants.equalsInteger(device.getType(),Constants.ZERO)){
            }else  if(Constants.equalsInteger(device.getType(),Constants.TWO)&&sendBroadcast){
                log.error("调起广播------------------------------------------------------------------------------------------");
                //如果是广播点
                bNames += device.getName()+";";
                broadcastList.add(device.getHkId());
            }
        }
        if(broadcastList.size()>0){
            PlatformBroadcastLog log = HkSyncPushServiceImpl.dealBroadcastBiz(model,broadcastList,bNames,Constants.PlatformBroadcastContent.WRONG_IN.getInfo());
            PlatformBroadcastLog log = HkSyncPushServiceImpl.dealBroadcastBiz(model,broadcastList,bNames,broadcastContent);
            logList.add(log);
        }
        if(logList.size()>0){
@@ -1262,6 +1282,12 @@
                SmsConstants.platformJobContent.platformJobWorking,platform.getName(),null
        );
        
        //广播 led通知
        platformJob.setPlatformName(platform.getName());
        this.broadcastAndLEed(platformJob,Constants.PlatformLedContent.WORKING.getInfo(),
                null
        );
        return platformJob;
    }
@@ -1317,7 +1343,9 @@
        );
        //广播 led通知
        this.broadcastAndLEed(platformJob,Constants.PlatformBroadcastContent.DONE.getInfo());
        platformJob.setPlatformName(platform.getName());
        this.broadcastAndLEed(platformJob,null,
                Constants.PlatformBroadcastContent.DONE.getInfo());
        return platformJob;
    }
@@ -1875,6 +1903,8 @@
        );
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platformJobList)){
            for (PlatformJob platformJob:platformJobList) {
                //车牌号脱敏
                platformJob.setCarCodeFront(Constants.carCodeTuominStr(platformJob.getCarCodeFront()));
                if(Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WORKING.getKey())){
                    //计算已作业时长 根据月台工作效率 计算任务量需要时间
                    if(Objects.isNull(platformJob.getWorkNum()) || Objects.isNull(platformJob.getWorkRate())){