jiangping
2025-04-08 4f8b83178eabea113df2ea48b64a56cb7f721107
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
@@ -19,21 +19,28 @@
import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.*;
import com.doumee.dao.business.dao.MemberMapper;
import com.doumee.dao.business.join.VisitsJoinMapper;
import com.doumee.dao.business.model.*;
import com.doumee.dao.business.model.Member;
import com.doumee.dao.web.reqeust.SavePlatformWarnEventDTO;
import com.doumee.service.business.impl.PlatformWarnEventServiceImpl;
import com.doumee.service.business.third.TmsService;
import com.doumee.service.business.third.model.request.TmsOrderInfoRequest;
import com.doumee.service.business.third.model.response.TmsOrderInfoResponse;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.net.ftp.FTP;
import org.checkerframework.checker.units.qual.C;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
 * 访客权限组信息表Service实现
@@ -79,6 +86,8 @@
    @Autowired
    private PlatformJobMapper platformJobMapper;
    @Autowired
    private TmsService tmsService;
    @Autowired
    private PlatformWmsDetailMapper platformWmsDetailMapper;
    @Autowired
    private PlatformEventMapper platformEventMapper;
@@ -86,6 +95,13 @@
    private PlatformLogMapper platformLogMapper;
    @Autowired
    private PlatformWarnEventServiceImpl platformWarnEventService;
    /**
     * 海康门禁事件推送
     * @param param
@@ -199,27 +215,31 @@
                    .eq(Device::getDoorId,request.getSrcIndex())
                    .eq(Device::getIsdeleted,Constants.ZERO)
                    .last("limit 1" ));
            if(d!=null && !(Constants.equalsInteger(d.getIsEntrance(),Constants.ONE) && Constants.formatIntegerNum(request.getData().getExtEventInOut()) != Constants.ONE)){
                //如果是进门,录入人员的在场数据记录
                inoutDayCount.setInMemberNum(Constants.formatIntegerNum(inoutDayCount.getInMemberNum())+1);//入场人次
            }else{
                inoutDayCount.setOutMemberNum(Constants.formatIntegerNum(inoutDayCount.getOutMemberNum())+1);//离场人次
            if(d!=null && Constants.equalsInteger(d.getIsEntrance(),Constants.ONE)){
                if(Constants.formatIntegerNum(request.getData().getExtEventInOut()) != Constants.ONE){
                    //如果是进门,录入人员的在场数据记录
                    inoutDayCount.setInMemberNum(Constants.formatIntegerNum(inoutDayCount.getInMemberNum())+1);//入场人次
                }else{
                    inoutDayCount.setOutMemberNum(Constants.formatIntegerNum(inoutDayCount.getOutMemberNum())+1);//离场人次
                }
            }
            if(member !=null){
                delRetentionLis.add(member.getId());
                if(d!=null && !(Constants.equalsInteger(d.getIsEntrance(),Constants.ONE) && Constants.formatIntegerNum(request.getData().getExtEventInOut()) != Constants.ONE)){
                    //如果是进门,录入人员的在场数据记录
                    retentionList.add(getRetentionModelByRequest(member,request));
                    if(Constants.equalsInteger(member.getCompanyType(),Constants.ONE)){
                        inoutDayCount.setInSelfMemberNum(Constants.formatIntegerNum(inoutDayCount.getInSelfMemberNum())+1);//内部人员入场人次
                if(d!=null && Constants.equalsInteger(d.getIsEntrance(),Constants.ONE)){
                    delRetentionLis.add(member.getId());
                    if( Constants.formatIntegerNum(request.getData().getExtEventInOut()) == Constants.ONE){
                        //如果是进门,录入人员的在场数据记录
                        retentionList.add(getRetentionModelByRequest(member,request));
                        if(Constants.equalsInteger(member.getCompanyType(),Constants.ONE)){
                            inoutDayCount.setInSelfMemberNum(Constants.formatIntegerNum(inoutDayCount.getInSelfMemberNum())+1);//内部人员入场人次
                        }else{
                            inoutDayCount.setInOtherMemberNum(Constants.formatIntegerNum(inoutDayCount.getInOtherMemberNum())+1);//相关方入场人次
                        }
                    }else{
                        inoutDayCount.setInOtherMemberNum(Constants.formatIntegerNum(inoutDayCount.getInOtherMemberNum())+1);//相关方入场人次
                    }
                }else{
                    if(Constants.equalsInteger(member.getCompanyType(),Constants.ONE)){
                        inoutDayCount.setOutSelfMemberNum(Constants.formatIntegerNum(inoutDayCount.getOutSelfMemberNum())+1);//内部人员出场人次
                    }else{
                        inoutDayCount.setOutOtherMemberNum(Constants.formatIntegerNum(inoutDayCount.getOutOtherMemberNum())+1);//相关方出场人次
                        if(Constants.equalsInteger(member.getCompanyType(),Constants.ONE)){
                            inoutDayCount.setOutSelfMemberNum(Constants.formatIntegerNum(inoutDayCount.getOutSelfMemberNum())+1);//内部人员出场人次
                        }else{
                            inoutDayCount.setOutOtherMemberNum(Constants.formatIntegerNum(inoutDayCount.getOutOtherMemberNum())+1);//相关方出场人次
                        }
                    }
                }
            }
@@ -447,7 +467,6 @@
     *  根据访客推送访客记录编码,处理访客记录、在场人员等信息
     */
    private void dealVisitDataByRequstIccm(EventVisitIccmInfoRequest request, List<Integer> delRetentionLis, List<Retention> retentionList,  InoutDayCount inoutDayCount) {
        EventVisitIccmDataRequest model = request.getData();
        EventVisitIccmInvoiceParamRequest data =  request.getData().getVisitorInvoices();
        MPJLambdaWrapper<Visits> queryWrapper = new MPJLambdaWrapper<>();
@@ -466,12 +485,14 @@
            updateVistis.setId(visits.getId());
            if (Constants.formatIntegerNum(request.getEventType()) == HKConstants.EventTypes.VISIT_SIGN_ICCM_IN.getKey()) {
                //如果是访客登记,录入人员的在场数据记录
//                retentionList.add(getRetentionModelByVisitRequest(visits, request.getHappenTime(),request.getSrcType()));
                //retentionList.add(getRetentionModelByVisitRequest(visits, request.getHappenTime(),request.getSrcType()));
                //来访时间
                inoutDayCount.setSigninVisitorNum(Constants.formatIntegerNum(inoutDayCount.getSigninVisitorNum())+1);
                updateVistis.setStatus(Constants.VisitStatus.signin);
                updateVistis.setInDate(DateUtil.getISO8601DateByStr(data.getBeginTime()));
                updateVistis.setOutDate(DateUtil.getISO8601DateByStr(data.getFinishTime()));
                if(Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.xfSuccess)){
                    inoutDayCount.setSigninVisitorNum(Constants.formatIntegerNum(inoutDayCount.getSigninVisitorNum())+1);
                    updateVistis.setStatus(Constants.VisitStatus.signin);
                    updateVistis.setInDate(DateUtil.getISO8601DateByStr(data.getBeginTime()));
                    updateVistis.setOutDate(DateUtil.getISO8601DateByStr(data.getFinishTime()));
                }
                //更新最新来访时间
                Member member = new Member();
                member.setLastVisitDate(updateVistis.getInDate());
@@ -479,18 +500,21 @@
                memberMapper.updateById(member);
            }else if (Constants.formatIntegerNum(request.getEventType()) == HKConstants.EventTypes.VISIT_SIGN_ICCM_OUT.getKey())  {
                //如果是访客签离事件
                inoutDayCount.setLeaveVisitorNum(Constants.formatIntegerNum(inoutDayCount.getLeaveVisitorNum())+1);
                updateVistis.setStatus(Constants.VisitStatus.signout);
                updateVistis.setInDate(DateUtil.getISO8601DateByStr(data.getBeginTime()));
                updateVistis.setOutDate(DateUtil.getISO8601DateByStr(data.getFinishTime()));
                updateVistis.setOutType(Constants.ZERO);
                updateVistis.setOutInfo("访客正常签离");
                if(Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.signin)){
                    inoutDayCount.setLeaveVisitorNum(Constants.formatIntegerNum(inoutDayCount.getLeaveVisitorNum())+1);
                    updateVistis.setStatus(Constants.VisitStatus.signout);
                    updateVistis.setInDate(DateUtil.getISO8601DateByStr(data.getBeginTime()));
                    updateVistis.setOutDate(DateUtil.getISO8601DateByStr(data.getFinishTime()));
                    updateVistis.setOutType(Constants.ZERO);
                    updateVistis.setOutInfo("访客正常签离");
                }
                delRetentionLis.add(visits.getMemberId());
            }else{
                //如果人员信息存在,切是访客通行,则删除之前的所有进场数据(无论此次推送是进厂还是出场推送事件)
                delRetentionLis.add(visits.getMemberId());
                //如果是访客通行
                if(request.getData()!=null&&request.getData().getParamValues()!=null &&
                        StringUtils.equals(request.getData().getParamValues().getInOrOut(),"1")){
                        StringUtils.equals(request.getData().getParamValues().getInOrOut(),"0")){
                    //如果是访客登记,录入人员的在场数据记录
                    Retention r = getRetentionModelByVisitRequest(visits, request.getHappenTime(),request.getSrcType());
                    r.setCarNo(request.getData().getParamValues().getPlateNos());
@@ -501,7 +525,7 @@
                    inoutDayCount.setInVisitorNum(Constants.formatIntegerNum(inoutDayCount.getInVisitorNum())+1);
                }
                if(request.getData()!=null&&request.getData().getParamValues()!=null &&
                         StringUtils.equals(request.getData().getParamValues().getInOrOut(),"2")){
                         !StringUtils.equals(request.getData().getParamValues().getInOrOut(),"0")){
                    inoutDayCount.setOutVisitorNum(Constants.formatIntegerNum(inoutDayCount.getOutVisitorNum())+1);
                }
            }
@@ -513,7 +537,8 @@
    private Retention getRetentionModelByVisitRequest(Visits visits, String happentTime,String srcType) {
        Retention retention = new Retention();
        retention.setIsdeleted(Constants.ZERO);
        retention.setCreateDate(DateUtil.getISO8601DateByStr(happentTime));
        retention.setCreateDate(DateUtil.getISO8601DateByStr2(happentTime));
        retention.setCreateDate(retention.getCreateDate() == null?new Date():retention.getCreateDate());
        retention.setClasses(visits.getClasses());
        retention.setCode(visits.getCode());
        retention.setIdcardNo(visits.getIdcardNo());
@@ -544,6 +569,15 @@
        if(event.getCreateDate() == null){
            event.setCreateDate(new Date());
        }
        if (Constants.formatIntegerNum(request.getEventType()) == HKConstants.EventTypes.VISIT_SIGN_ICCM_PASS.getKey())  {
            //如果是访客通行事件,进入进出事件
            if(request.getData()!=null&&request.getData().getParamValues()!=null &&
                    StringUtils.equals(request.getData().getParamValues().getInOrOut(),"0")){
                event.setInOrOut("0");//进
            }else{
                event.setInOrOut("1");//出
            }
        }
        event.setVisitorWorkUint(detail.getUnit());
        event.setVisitorId(detail.getVisitorId());
        event.setVisitorCode(detail.getAppointmentCode());
@@ -555,7 +589,8 @@
        event.setStartTime(request.getData().getVisitorInvoices().getBeginTime());
        event.setSrcType(request.getSrcType());
        event.setSrcParentIndex(request.getSrcParentIndex());
        event.setSrcName(request.getSrcName());
        event.setSrcName((request.getData()!=null &&request.getData().getParamValues()!=null)?
                request.getData().getParamValues().getSrcName():request.getSrcName());
        event.setSrcIndex(request.getSrcIndex());
        event.setSex(detail.getSex());
        event.setPurpose(request.getData().getVisitorInvoices().getVisitReason());
@@ -567,6 +602,7 @@
        event.setPhotoUrl(getHkImgUrl(detail.getFacePic()));
        event.setPersonName(detail.getVisitorName());
        event.setCarNo(detail.getPlateNo());
        event.setRemark(JSONObject.toJSONString(request));
        event.setInvoicesNo(request.getData().getVisitorInvoices().getInvoicesNo());//访客单号
        event.setIdType(detail.getCertType());
        String idnum = detail.getCertNo();
@@ -796,7 +832,7 @@
        event.setEventCmd(request.getData().getEventCmd());
        event.setCardNo(request.getData().getCardNo());
        event.setCarAttributeName(request.getData().getCarAttributeName());
        event.setCarType(Constants.RetentionCarType.unknown);//默认未登记车辆
        if(request.getData().getInResult()!=null && request.getData().getInResult().getRlsResult() !=null ){
            //放行方式
            event.setReleaseWay(request.getData().getInResult().getRlsResult().getReleaseWay());
@@ -811,12 +847,90 @@
            event.setPlatePicUrl(getHkImgUrl(request.getData().getPicUrl().getPlatePicUrl()));
        }
        if(StringUtils.isNotBlank(event.getPlateNos())){
            Cars carModel = carsMapper.selectJoinOne(Cars.class,new MPJLambdaWrapper<Cars>()
                            .selectAll(Cars.class )
                            .selectAs(Company::getType,Cars::getCompanyType)
                            .leftJoin(Company.class,Company::getId,Cars::getGroupId)
                            .eq(Cars::getCode,event.getPlateNos())
                            .eq(Cars::getIsdeleted,Constants.ZERO)
                            .last(" limit 1"));
            if(carModel!=null){
                //0安泰公务车 1安泰自有物流车 2其它
                event.setMemberId(carModel.getMemberId());
                event.setCompanyId(carModel.getGroupId());
                if(Constants.equalsInteger(carModel.getType(),Constants.ONE)){
                    event.setCarType(Constants.RetentionCarType.selfTruck);
                }else {
                    if(Constants.equalsInteger(carModel.getCompanyType(),Constants.ONE)){
                        event.setCarType(Constants.RetentionCarType.internal);//内部车辆
                    }else{
                        event.setCarType(Constants.RetentionCarType.relation);//相关方车辆
                    }
                }
            }
            PlatformJob carTypeJob = platformJobMapper.selectOne(new QueryWrapper<PlatformJob>().lambda()
                            .eq(PlatformJob::getCarCodeFront,event.getPlateNos())
                            .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                            .orderByAsc(PlatformJob::getCreateDate)
                            .last(" limit 1"));
            if(carTypeJob!=null){
                //作业类型 0自有车卸货 1自有车装货 2外协车卸货 3外协车装货 4市公司外协车卸货
                if(Constants.equalsInteger(carTypeJob.getType(),Constants.FOUR)){
                    event.setCarType(Constants.RetentionCarType.cityComTruck);//市公司车辆
                }else if(Constants.equalsInteger(carTypeJob.getType(),Constants.TWO)
                        || Constants.equalsInteger(carTypeJob.getType(),Constants.THREE)){
                    event.setCarType(Constants.RetentionCarType.outTruck);//外协车
                }else{
                    event.setCarType(Constants.RetentionCarType.selfTruck);//自有车
                }
            }
            ParkBook cars = parkBookMapper.selectOne(new QueryWrapper<ParkBook>().lambda()
                    .eq(ParkBook::getCarCode,event.getPlateNos())
                            .eq(ParkBook::getIsdeleted,Constants.ZERO )
                    .last("limit 1" ));
            if(cars!=null){
                event.setMemberId(cars.getMemberId());
                //自有车  查询当前是否有待签到的任务
                if(carsMapper.selectCount(new QueryWrapper<Cars>()
                        .lambda().eq(Cars::getCode,event.getPlateNos())
                        .eq(Cars::getType,Constants.ONE)
                        .eq(Cars::getIsdeleted,Constants.ZERO)
                )>Constants.ZERO){
                    //查询车辆当前是否存在进行中的任务
                    if( platformJobMapper.selectCount(new QueryWrapper<PlatformJob>().lambda()
                            .eq(PlatformJob::getCarCodeFront,event.getPlateNos())
                            .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                            .in(PlatformJob::getStatus,
                                    Constants.PlatformJobStatus.IN_WAIT.getKey(),
                                    Constants.PlatformJobStatus.CALLED.getKey(),
                                    Constants.PlatformJobStatus.WORKING.getKey(),
                                    Constants.PlatformJobStatus.TRANSFERING.getKey(),
                                    Constants.PlatformJobStatus.EXCEPTION.getKey()
                            )
                    )==Constants.ZERO){//如果没进行中任务
                        PlatformJob platformJob = platformJobMapper.selectOne(new QueryWrapper<PlatformJob>().lambda()
                                .eq(PlatformJob::getCarCodeFront,event.getPlateNos())
                                .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                                .in(PlatformJob::getStatus,
                                        Constants.PlatformJobStatus.WAIT_CONFIRM.getKey(),
                                        Constants.PlatformJobStatus.WART_SIGN_IN.getKey()
                                )
                                .orderByAsc(PlatformJob::getCreateDate)
                                .last(" limit 1")
                        );
                        if(Objects.nonNull(platformJob)){
                            if(Constants.equalsInteger(platformJob.getType(),Constants.ONE)){
                                //如果是自有车装货自动签到
                                jobAutoSignBiz(platformJob);
                            }else  if(Constants.equalsInteger(platformJob.getType(),Constants.ZERO)){
                                //如果是自有车卸货 查询TMS合同状态,决定是否自动签到
                                checkTmsContractStatusBiz(platformJob);
                            }
                        }
                    }
                };
            }else{
                Visits visits =  visitsMapper.selectOne(new QueryWrapper<Visits>().lambda()
                        .eq(Visits::getCarNos,event.getPlateNos())
@@ -828,12 +942,13 @@
                if(visits!=null){
                    //最近使用该车的申请人(已到达)
                    event.setMemberId(visits.getMemberId());
                    event.setCarType(Constants.RetentionCarType.visitor);
                }
            }
            if(Constants.formatIntegerNum(request.getEventType()) == HKConstants.EventTypes.PARK_PASS_IN.getKey()){
                //如果是入厂放行
                delRetentionList.add(event.getPlateNos());
                retentionList.add(getRetentionModelByParkRequest(request));
                retentionList.add(getRetentionModelByParkRequest(request,event));
                inoutDayCount.setInCarNum(Constants.formatIntegerNum(inoutDayCount.getInCarNum())+1);
            }else if(Constants.formatIntegerNum(request.getEventType()) == HKConstants.EventTypes.PARK_PASS_OUT.getKey()){
                //如果是出场放行
@@ -844,12 +959,57 @@
        return event;
    }
    private Retention getRetentionModelByParkRequest(EventParkInfoRequest request) {
    /**
     * ;如果是卸货任务,需要通过TMS提供的“2.2合同列表接口”接口查询车辆对应的合同状态是否为在途状态(对应orderStatus值为3/4/5/6),
     * 如果是自动签到,否则不自动签到;如果一个车辆对应多个合同号,则取运单下任一合同查询对应在途信息
     * @param platformJob
     */
    private void checkTmsContractStatusBiz(PlatformJob platformJob) {
        PlatformWmsDetail detail = platformWmsDetailMapper.selectOne(new QueryWrapper<PlatformWmsDetail>().lambda()
                .eq(PlatformWmsDetail::getIsdeleted, Constants.ZERO)
                .eq(PlatformWmsDetail::getJobId, platformJob.getId())
                .isNotNull(PlatformWmsDetail::getContractNum)
                .last("limit 1")
        );
        if(detail!=null && StringUtils.isNotBlank(detail.getContractNum())){
            TmsOrderInfoRequest param = new TmsOrderInfoRequest();
            param.setContractNumber(detail.getContractNum());
            TmsOrderInfoResponse response = tmsService.orderInfo(param);
            if(response!=null &&( StringUtils.equals(response.getOrderStatus(),"3")  )
                ||StringUtils.equals(response.getOrderStatus(),"4")
                ||StringUtils.equals(response.getOrderStatus(),"5")
                ||StringUtils.equals(response.getOrderStatus(),"6")){
                //如果合同在途,则自动签到
                jobAutoSignBiz(platformJob);
            }
        }
    }
    private void jobAutoSignBiz(PlatformJob platformJob) {
        platformJob.setStatus(Constants.PlatformJobStatus.WAIT_CALL.getKey());
        platformJob.setArriveDate(new Date());
        platformJob.setSingType(Constants.TWO);
        platformJob.setSignDate(new Date());
        List<PlatformJob> signList = platformJobMapper.selectList(new QueryWrapper<PlatformJob>().lambda().apply(" DATE(SIGN_DATE) = DATE(NOW()) and sign_date is not null  "));
        if(CollectionUtils.isEmpty(signList)){
            platformJob.setSignNum(Constants.ONE);
        } else{
            int maxNumber = Collections.max(signList.stream().map(i->i.getSignNum()).collect(Collectors.toList()));
            platformJob.setSignNum(maxNumber + Constants.ONE);
        }
        platformJobMapper.updateById(platformJob);
    }
    private Retention getRetentionModelByParkRequest(EventParkInfoRequest request,CarEvent event) {
        Retention retention = new Retention();
        retention.setIsdeleted(Constants.ZERO);
        retention.setCreateDate(DateUtil.getISO8601DateByStr(request.getHappenTime()));
        retention.setCarNo(request.getData().getPlateNo());
        retention.setType(Constants.THREE);
        retention.setMemberId(event.getMemberId());
        retention.setCarType(event.getCarType());
        retention.setCompanyId(event.getCompanyId());
//        retention.setDeviceName(request.getSrcName());
//        retention.setDeviceIndex(request.getSrcIndex());
        return retention;
@@ -968,14 +1128,26 @@
                PlatformJob job = platformJobMapper.selectJoinOne(PlatformJob.class, new MPJLambdaWrapper<PlatformJob>()
                        .selectAll(PlatformJob.class)
                        .selectAs(Platform::getName,PlatformJob::getPlatformName)
                        .selectAs(Platform::getLedContent,PlatformJob::getLedContent)
                        .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId)
//                        .eq(StringUtils.equals(status.getStockStatus(),"front"),PlatformJob::getCarCodeFront,status.getPlateNo() )//前车牌号
//                        .eq(!StringUtils.equals(status.getStockStatus(),"front"),PlatformJob::getCarCodeBack,status.getPlateNo() )//后车牌号
//                        .eq(StringUtils.equals(status.getStockStatus(),"front"),PlatformJob::getCarCodeFront,status.getPlateNo() )//前车牌号
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO )
                        .eq(PlatformJob::getPlatformId,model.getPlatformId() )
                        .orderByDesc(PlatformJob::getCallDate)
                        .last("limit 1 "));
                if(job == null){
                    if(StringUtils.equals(status.getMotionStatus(),"enter")){
                        //如果月台当前没作业,直接提示车辆停错
                        Platform platform = platformMapper.selectJoinOne(Platform.class, new MPJLambdaWrapper<Platform>()
                                .selectAll(Platform.class)
                                .eq(Platform::getIsdeleted,Constants.ZERO )
                                .eq(PlatformJob::getId,model.getPlatformId() )
                                .last("limit 1 "));
                        if(platform!=null){
                            dealCarsAndPlatformErrorBiz(platform,status);
                        }
                    }
                    continue;//如果作业为空,跳过处理
                }
                PlatformJob update = new PlatformJob();
@@ -999,15 +1171,21 @@
                    update.setStatus(Constants.PlatformJobStatus.DONE.getKey());//作业已完成
                    update.setDoneDate(update.getEditDate());*/
                    if(Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.DONE.getKey()) ||
                            Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.TRANSFERING.getKey()) ||
                            Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.EXCEPTION.getKey()) ||
                            Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey())){
                        if(((StringUtils.equals(status.getStockStatus(),"front") && StringUtils.equals(job.getCarCodeFront(),status.getPlateNo()))
                                ||(!StringUtils.equals(status.getStockStatus(),"front") && StringUtils.equals(job.getCarCodeBack(),status.getPlateNo()))
                        )){
                            //说明车辆进错月台 或者还未叫号状态,发起警告
//                          dealCarsInErrorPlatformBiz(job,status);
                            update.setInOut(Constants.ZERO);//车辆已经离开
                            platformJobMapper.updateById(update);
                        }
                            if(Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.DONE.getKey())  ||
                                    Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey())){
                                update.setInOut(Constants.ZERO);//车辆已经离开
                                platformJobMapper.updateById(update);
                            }
                            dealPlatformContentForLeave(job);
                         }
                    }
                }else  if(StringUtils.equals(status.getMotionStatus(),"enter")){
                    //如果是车辆进入
@@ -1023,7 +1201,8 @@
                            platformJobMapper.updateById(update);
                        }
                    }
                    /*if(job.getStartDate() == null){
                    /*
                    if(job.getStartDate() == null){
                        update.setStartDate(update.getEditDate());
                    }
                    update.setStatus(Constants.PlatformJobStatus.WORKING.getKey());//开始作业
@@ -1047,6 +1226,37 @@
            saveInterfaceLog(param,"/business/hksync/push/platform/workstatus",result,false);//不计日志
        }
        return  null;
    }
    /**
     * 月台车辆离开 设置月台文案为“空闲中 文案”
     * @param model
     */
    private void dealPlatformContentForLeave(PlatformJob model) {
        List<PlatformDevice> deviceList = platformDeviceMapper.selectList(new QueryWrapper<PlatformDevice>().lambda()
                .eq(PlatformDevice::getType, Constants.ZERO)
                .eq(PlatformDevice::getPlatformId,model.getPlatformId())
                .eq(PlatformDevice::getIsdeleted,Constants.ZERO));
        if(deviceList ==null || deviceList.size() == 0){
            return;
        }
        int speed = 13;
        try {
            speed = Integer.parseInt(systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.LED_CONTENT_SPEED).getCode());
        }catch (Exception e){
        }
        String content = StringUtils.defaultString(model.getLedContent(), Constants.PlatformLedContent.IDEL_CONTNET.getInfo());
        List<PlatformBroadcastLog> logList = new ArrayList<>();
        for(PlatformDevice device : deviceList){
            if(StringUtils.isBlank(device.getHkId())){
                continue;
            }
            PlatformBroadcastLog log = dealLedContentBiz(model.getId(),device.getHkNo(),device.getName(),content,speed,1);
            logList.add(log);
        }
        if(logList.size()>0){
            platformBroadcastLogMapper.insert(logList);
        }
    }
    private PlatformEvent initPlatformEventModel(EventPlatformCarsInfoRequest request, EventPlatformCarsDataRequest data, EventPlatformCarsStatusInfoRequest status) {
@@ -1166,12 +1376,12 @@
            if(StringUtils.isBlank(device.getHkId())){
                continue;
            }
            if(Constants.equalsInteger(device.getType(),Constants.ZERO)){
            /*if(Constants.equalsInteger(device.getType(),Constants.ZERO)){
                //如果是LED
                PlatformBroadcastLog log = dealLedContentBiz(model.getId(),device.getHkNo(),device.getName(),content,speed,1);
                logList.add(log);
                ledList.add(device.getHkId());
            }else  if(Constants.equalsInteger(device.getType(),Constants.TWO)){
            }else  */if(Constants.equalsInteger(device.getType(),Constants.TWO)){
                //如果是广播点
                bNames += device.getName()+";";
                broadcastList.add(device.getHkId());
@@ -1185,6 +1395,56 @@
            platformBroadcastLogMapper.insert(logList);
        }
    }
    private void dealCarsAndPlatformErrorBiz( Platform model, EventPlatformCarsStatusInfoRequest status) {
        //处理车辆进入错误月台业务逻辑
        SavePlatformWarnEventDTO savePlatformWarnEventDTO = new SavePlatformWarnEventDTO();
        savePlatformWarnEventDTO.setPlatformJobId(model.getId());
        savePlatformWarnEventDTO.setPlatformId(model.getId());
        savePlatformWarnEventDTO.setCarCode(status.getPlateNo());
        savePlatformWarnEventDTO.setEventType(Constants.PlatformWarnEvent.STOP_ERROR.getKey());
        platformWarnEventService.savePlatformWarnEvent(savePlatformWarnEventDTO);
        int speed = 13;
        try {
            speed = Integer.parseInt(systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.LED_CONTENT_SPEED).getCode());
        }catch (Exception e){
        }
        List<PlatformDevice> deviceList = platformDeviceMapper.selectList(new QueryWrapper<PlatformDevice>().lambda()
                .eq(PlatformDevice::getPlatformId,model.getId())
                .eq(PlatformDevice::getIsdeleted,Constants.ZERO));
        if(deviceList ==null || deviceList.size() == 0){
            return;
        }
        String content =Constants.PlatformLedContent.WRONG_IN.getInfo();
        content = content.replace("${param2}",model.getName());
        content = content.replace("${param}",status.getPlateNo());
        List<String> broadcastList = new ArrayList<>();
        List<String> ledList = new ArrayList<>();
        String bNames = "";
        List<PlatformBroadcastLog> logList = new ArrayList<>();
        for(PlatformDevice device : deviceList){
            if(StringUtils.isBlank(device.getHkId())){
                continue;
            }
            if(Constants.equalsInteger(device.getType(),Constants.TWO)){
                //如果是广播点
                bNames += device.getName()+";";
                broadcastList.add(device.getHkId());
            }
        }
        if(broadcastList.size()>0){
            PlatformJob job = new PlatformJob();
            job.setId(-1);
            job.setCarCodeFront(status.getPlateNo());
            job.setPlatformId(model.getId());
            PlatformBroadcastLog log = dealBroadcastBiz(job,broadcastList,bNames,Constants.PlatformBroadcastContent.WRONG_IN.getInfo().replace("${param}",status.getPlateNo()));
            logList.add(log);
        }
        if(logList.size()>0){
            platformBroadcastLogMapper.insert(logList);
        }
    }
    /**
     * 广播通知