jiangping
2024-10-21 291baf8ad5bd225c426b5cbfff38168ffda251cd
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
@@ -17,22 +17,25 @@
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DESUtil;
import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.*;
import com.doumee.dao.business.join.VisitsJoinMapper;
import com.doumee.dao.business.model.*;
import com.doumee.dao.web.reqeust.SavePlatformWarnEventDTO;
import com.doumee.service.business.PlatformJobService;
import com.doumee.service.business.impl.PlatformWarnEventServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
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实现
@@ -43,6 +46,8 @@
@Slf4j
public class HkSyncPushServiceImpl extends HkSyncBaseServiceImpl {
    @Autowired
    private InoutDayCountMapper inoutDayCountMapper;
    @Autowired
    private InterfaceLogMapper interfaceLogMapper;
    @Autowired
@@ -102,13 +107,14 @@
            List<DeviceEvent> list = new ArrayList<>();
            List<Integer> delRetentionLis = new ArrayList<>();
            List<Retention> retentionList = new ArrayList<>();
            InoutDayCount inoutDayCount = new InoutDayCount();
            for(EventAcsInfoRequest request : events){
                EventDeviceDataRequest model = request.getData();
                if(model ==null){
                    continue;
                }
                //根据推送人员编码,处理在场、离场人员数据记录
                dealMemberDataByRequest(request,delRetentionLis,retentionList);
                dealMemberDataByRequest(request,delRetentionLis,retentionList,inoutDayCount);
                //封装门禁事件信息表对象
                list.add(getDeviceEventModelByRequest(request));
            }
@@ -126,8 +132,10 @@
                //再插入最新的在厂人员
                retentionMapper.insert(retentionList);
            }
            dealInoutDayCountBiz(inoutDayCount);
            log.info("【海康门禁事件推送】========成功=======");
        }catch (Exception e) {
            e.printStackTrace();
            log.error("【海康门禁事件推送】========失败=======:\n" + e.getMessage());
        }finally {
            saveInterfaceLog(param,"/business/hksync/push/acs",result,false);//不计日志
@@ -136,27 +144,89 @@
    }
    private void dealInoutDayCountBiz(InoutDayCount param) {
        if(param == null){
            param = new InoutDayCount();
        }
        param.setTimeInfo(Utils.Date.getStart(new Date()));
        InoutDayCount model = inoutDayCountMapper.selectOne(new QueryWrapper<InoutDayCount>().lambda()
                .eq(InoutDayCount::getTimeInfo,param.getTimeInfo())
                .eq(InoutDayCount::getIsdeleted,Constants.ZERO)
                .last("limit 1"));
        log.error("============================inoutDayCountMapper:"+JSONObject.toJSONString(param));
        if(model == null){
            param.setIsdeleted(Constants.ZERO);
            param.setCreateDate(new Date());
            param.setEditDate(new Date());
            inoutDayCountMapper.insert(param);
        }else{
            inoutDayCountMapper.update(null,new UpdateWrapper<InoutDayCount>().lambda()
                    .eq(InoutDayCount::getId,model.getId() )
                    .set(InoutDayCount::getEditDate,new Date() )
                    .setSql(param.getInCarNum()!=null,"IN_CAR_NUM = ifnull(IN_CAR_NUM,0)+"+param.getInCarNum() )
                    .setSql(param.getOutCarNum()!=null,"OUT_CAR_NUM = ifnull(OUT_CAR_NUM,0)+"+param.getOutCarNum() )
                    .setSql(param.getInMemberNum()!=null,"IN_MEMBER_NUM = ifnull(IN_MEMBER_NUM,0)+"+param.getInMemberNum() )
                    .setSql(param.getOutMemberNum()!=null,"OUT_MEMBER_NUM = ifnull(OUT_MEMBER_NUM,0)+"+param.getOutMemberNum() )
                    .setSql(param.getInVisitorNum()!=null,"IN_VISITOR_NUM = ifnull(IN_VISITOR_NUM,0)+"+param.getInVisitorNum() )
                    .setSql(param.getOutVisitorNum()!=null,"OUT_VISITOR_NUM = ifnull(OUT_VISITOR_NUM,0)+"+param.getOutVisitorNum() )
                    .setSql(param.getSigninVisitorNum()!=null,"SIGNIN_VISITOR_NUM = ifnull(SIGNIN_VISITOR_NUM,0)+"+param.getSigninVisitorNum() )
                    .setSql(param.getLeaveVisitorNum()!=null,"LEAVE_VISITOR_NUM = ifnull(LEAVE_VISITOR_NUM,0)+"+param.getLeaveVisitorNum() )
                    .setSql(param.getInOtherMemberNum()!=null,"IN_OTHER_MEMBER_NUM = ifnull(IN_OTHER_MEMBER_NUM,0)+"+param.getInOtherMemberNum() )
                    .setSql(param.getOutOtherMemberNum()!=null,"OUT_OTHER_MEMBER_NUM = ifnull(OUT_OTHER_MEMBER_NUM,0)+"+param.getOutOtherMemberNum() )
                    .setSql(param.getInSelfMemberNum()!=null,"IN_SELF_MEMBER_NUM = ifnull(IN_SELF_MEMBER_NUM,0)+"+param.getInSelfMemberNum() )
                    .setSql(param.getOutSelfMemberNum()!=null,"OUT_SELF_MEMBER_NUM = ifnull(OUT_SELF_MEMBER_NUM,0)+"+param.getOutSelfMemberNum() )
            );
        }
    }
    /**
     * 根据推送人员编码,处理在场、离场人员数据记录
     * @param request
     * @param delRetentionLis
     * @param retentionList
     */
    private void dealMemberDataByRequest(EventAcsInfoRequest request, List<Integer> delRetentionLis, List<Retention> retentionList) {
    private void dealMemberDataByRequest(EventAcsInfoRequest request, List<Integer> delRetentionLis, List<Retention> retentionList,InoutDayCount inoutDayCount) {
        //海康人员编码
        String userNo = request.getData().getExtEventPersonNo();
        if(StringUtils.isNotBlank(userNo)){
            Member member = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getHkId,userNo).last("limit 1"));
            if(member !=null){
                //如果人员信息存在,则删除之前的所有进场数据(无论此次推送是进厂还是出场推送事件)
                Device d = deviceMapper.selectOne(new QueryWrapper<Device>().lambda()
                        .eq(Device::getDoorId,request.getSrcIndex())
                        .eq(Device::getIsdeleted,Constants.ZERO)
                        .last("limit 1" ));
                delRetentionLis.add(member.getId());
                if(d!=null && !(Constants.equalsInteger(d.getIsEntrance(),Constants.ONE) && Constants.formatIntegerNum(request.getData().getExtEventInOut()) != Constants.ONE)){
            Member member = memberMapper.selectJoinOne(Member.class,new MPJLambdaWrapper<Member>()
                    .selectAll(Member.class)
                    .selectAs(Company::getType,Member::getCompanyType)
                    .leftJoin(Company.class,Company::getId,Member::getCompanyId)
                    .eq(Member::getHkId,userNo)
                    .eq(Member::getIsdeleted,Constants.ZERO)
                    .last("limit 1"));
            //如果人员信息存在,则删除之前的所有进场数据(无论此次推送是进厂还是出场推送事件)
            Device d = deviceMapper.selectOne(new QueryWrapper<Device>().lambda()
                    .eq(Device::getDoorId,request.getSrcIndex())
                    .eq(Device::getIsdeleted,Constants.ZERO)
                    .last("limit 1" ));
            if(d!=null && Constants.equalsInteger(d.getIsEntrance(),Constants.ONE)){
                if(Constants.formatIntegerNum(request.getData().getExtEventInOut()) != Constants.ONE){
                    //如果是进门,录入人员的在场数据记录
                    retentionList.add(getRetentionModelByRequest(member,request));
                    inoutDayCount.setInMemberNum(Constants.formatIntegerNum(inoutDayCount.getInMemberNum())+1);//入场人次
                }else{
                    inoutDayCount.setOutMemberNum(Constants.formatIntegerNum(inoutDayCount.getOutMemberNum())+1);//离场人次
                }
            }
            if(member !=null){
                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{
                        if(Constants.equalsInteger(member.getCompanyType(),Constants.ONE)){
                            inoutDayCount.setOutSelfMemberNum(Constants.formatIntegerNum(inoutDayCount.getOutSelfMemberNum())+1);//内部人员出场人次
                        }else{
                            inoutDayCount.setOutOtherMemberNum(Constants.formatIntegerNum(inoutDayCount.getOutOtherMemberNum())+1);//相关方出场人次
                        }
                    }
                }
            }
        }
@@ -267,7 +337,6 @@
        retention.setMemberId(member.getId());
        retention.setDeviceName(request.getSrcName());
        retention.setDeviceIndex(request.getSrcIndex());
        return retention;
    }
@@ -345,6 +414,7 @@
            List<VisitEvent> list = new ArrayList<>();
            List<Integer> delRetentionLis = new ArrayList<>();
            List<Retention> retentionList = new ArrayList<>();
            InoutDayCount inoutDayCount = new InoutDayCount();
            for(EventVisitIccmInfoRequest request : events){
                if(request.getData() ==null || request.getData().getVisitorInvoices() ==null){
                    continue;
@@ -353,7 +423,7 @@
                    continue;
                }
                //海康访客记录编码
                dealVisitDataByRequstIccm(request,delRetentionLis,retentionList);
                dealVisitDataByRequstIccm(request,delRetentionLis,retentionList,inoutDayCount);
                list.add(getVisitEventModelByRequestIccm(request,request.getData().getVisitorInformationList().get(0)));
            }
            if(list.size()>0){
@@ -370,19 +440,19 @@
                //再插入最新的在厂人员
                retentionMapper.insert(retentionList);
            }
            dealInoutDayCountBiz(inoutDayCount);
            log.info("【海康访客事件推送】========成功=======");
        }catch (Exception e){
            log.error("【海康访客事件推送】========失败=======:\n"+e.getMessage());
        }
        saveInterfaceLog(param,"/business/hksync/push/visitIccm",result,true);
        return  null;
    }
    /**
     *  根据访客推送访客记录编码,处理访客记录、在场人员等信息
     */
    private void dealVisitDataByRequstIccm(EventVisitIccmInfoRequest request, List<Integer> delRetentionLis, List<Retention> retentionList ) {
    private void dealVisitDataByRequstIccm(EventVisitIccmInfoRequest request, List<Integer> delRetentionLis, List<Retention> retentionList,  InoutDayCount inoutDayCount) {
        EventVisitIccmDataRequest model = request.getData();
        EventVisitIccmInvoiceParamRequest data =  request.getData().getVisitorInvoices();
@@ -394,8 +464,6 @@
        queryWrapper.last("limit 1");
        Visits visits = visitsMapper.selectJoinOne(Visits.class,queryWrapper);
        if(visits !=null){
            //如果人员信息存在,则删除之前的所有进场数据(无论此次推送是进厂还是出场推送事件)
            delRetentionLis.add(visits.getMemberId());
            if(dataSyncConfig.getOrgUserDataOrigin() == DataSyncConfig.origin.hk){
                //如果是伊利大屏项目,不做处理
                return;
@@ -404,8 +472,9 @@
            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()));
@@ -416,13 +485,31 @@
                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("访客正常签离");
            }else{
                //如果人员信息存在,切是访客通行,则删除之前的所有进场数据(无论此次推送是进厂还是出场推送事件)
                delRetentionLis.add(visits.getMemberId());
                //如果是访客通行
                if(request.getData()!=null&&request.getData().getParamValues()!=null &&
                        StringUtils.equals(request.getData().getParamValues().getInOrOut(),"0")){
                    //如果是访客登记,录入人员的在场数据记录
                    Retention r = getRetentionModelByVisitRequest(visits, request.getHappenTime(),request.getSrcType());
                    r.setCarNo(request.getData().getParamValues().getPlateNos());
                    r.setAccessType(request.getData().getParamValues().getAccessType());
                    r.setDeviceName(request.getData().getParamValues().getSrcName());
                    r.setDeviceIndex(request.getData().getParamValues().getSrcIndex());
                    retentionList.add(r);
                    inoutDayCount.setInVisitorNum(Constants.formatIntegerNum(inoutDayCount.getInVisitorNum())+1);
                }
                if(request.getData()!=null&&request.getData().getParamValues()!=null &&
                         !StringUtils.equals(request.getData().getParamValues().getInOrOut(),"0")){
                    inoutDayCount.setOutVisitorNum(Constants.formatIntegerNum(inoutDayCount.getOutVisitorNum())+1);
                }
            }
            updateVistis.setEditDate(new Date());
            //更新访客来访或者签离时间信息
@@ -448,9 +535,6 @@
        retention.setImgurl(visits.getImgurl());
        retention.setPhone(visits.getPhone());
        retention.setMemberId(visits.getMemberId());
//        retention.setDeviceName(request.getSrcName());
//        retention.setDeviceIndex(request.getSrcIndex());
        return retention;
    }
    private VisitEvent getVisitEventModelByRequestIccm(EventVisitIccmInfoRequest request,EventVisitIccmDetailParamRequest detail) {
@@ -489,6 +573,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();
@@ -643,12 +728,13 @@
            List<CarEvent> list = new ArrayList<>();
            List<Retention> retentionList = new ArrayList<>();
            List<String> delRetentionList = new ArrayList<>();
            InoutDayCount inoutDayCount = new InoutDayCount();
            for(EventParkInfoRequest request : events){
                if(request.getData() ==null ||StringUtils.isBlank(request.getData().getPlateNo())){
                    continue;
                }
                //封装事件信息表对象
                list.add(getParkEventModelByRequest(request,delRetentionList,retentionList));
                list.add(getParkEventModelByRequest(request,delRetentionList,retentionList,inoutDayCount));
            }
            if(list.size()>0){
                //插入门禁记录
@@ -664,9 +750,10 @@
                //再插入最新的在厂人员
                retentionMapper.insert(retentionList);
            }
            dealInoutDayCountBiz(inoutDayCount);
            log.info("【海康停车场事件推送】========成功=======");
        }catch (Exception e){
            e.printStackTrace();
            log.error("【海康停车场事件推送】========失败=======:\n"+e.getMessage());
        }
        saveInterfaceLog(param,"/business/hksync/push/parks",result,false);
@@ -678,7 +765,7 @@
     * @param request
     * @return
     */
    private CarEvent getParkEventModelByRequest(EventParkInfoRequest request, List<String> delRetentionList , List<Retention> retentionList ) {
    private CarEvent getParkEventModelByRequest(EventParkInfoRequest request, List<String> delRetentionList , List<Retention> retentionList,InoutDayCount inoutDayCount ) {
        CarEvent event = new CarEvent();
        event.setIsdeleted(Constants.ZERO);
        event.setCreateDate(DateUtil.getISO8601DateByStr(request.getHappenTime()));
@@ -737,6 +824,55 @@
                    .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.DONE.getKey(),
                                    Constants.PlatformJobStatus.TRANSFERING.getKey(),
                                    Constants.PlatformJobStatus.EXCEPTION.getKey(),
                                    Constants.PlatformJobStatus.AUTHED_LEAVE.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)){
                            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);
                        }
                    }
                };
            }else{
                Visits visits =  visitsMapper.selectOne(new QueryWrapper<Visits>().lambda()
                        .eq(Visits::getCarNos,event.getPlateNos())
@@ -754,9 +890,11 @@
                //如果是入厂放行
                delRetentionList.add(event.getPlateNos());
                retentionList.add(getRetentionModelByParkRequest(request));
                inoutDayCount.setInCarNum(Constants.formatIntegerNum(inoutDayCount.getInCarNum())+1);
            }else if(Constants.formatIntegerNum(request.getEventType()) == HKConstants.EventTypes.PARK_PASS_OUT.getKey()){
                //如果是出场放行
                delRetentionList.add(event.getPlateNos());
                inoutDayCount.setOutCarNum(Constants.formatIntegerNum(inoutDayCount.getOutCarNum())+1);
            }
        }
        return event;
@@ -886,6 +1024,7 @@
                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() )//后车牌号
@@ -917,15 +1056,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")){
                    //如果是车辆进入
@@ -941,7 +1086,8 @@
                            platformJobMapper.updateById(update);
                        }
                    }
                    /*if(job.getStartDate() == null){
                    /*
                    if(job.getStartDate() == null){
                        update.setStartDate(update.getEditDate());
                    }
                    update.setStatus(Constants.PlatformJobStatus.WORKING.getKey());//开始作业
@@ -965,6 +1111,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) {
@@ -1086,7 +1263,7 @@
            }
            if(Constants.equalsInteger(device.getType(),Constants.ZERO)){
                //如果是LED
                PlatformBroadcastLog log = dealLedContentBiz(device.getHkNo(),device.getName(),content,speed,1);
                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)){
@@ -1115,7 +1292,7 @@
    public static PlatformBroadcastLog dealBroadcastBiz(PlatformJob model, List<String> broadcastList,String bNames , String content1) {
        PlatformBroadcastLog log = new PlatformBroadcastLog();
        content1 = content1.replace("${param}",model.getCarCodeFront());
        log.setObjId(model.getId().toString());
        log.setCreateDate(new Date());
        log.setBizType(Constants.ONE);
        log.setHkDate(new Date());
@@ -1139,12 +1316,12 @@
            log.setHkInfo("请求成功");
            log.setHkStatus(Constants.TWO);
        }
        log.setDeviceType(Constants.ONE);
        log.setDeviceType(Constants.ZERO);
        log.setName("发送广播播报内容");
        return  log;
    }
    public static PlatformBroadcastLog dealLedContentBiz(String hkNo,String hkName, String content,int speed,int color) {
    public static PlatformBroadcastLog dealLedContentBiz(Integer platformId,String hkNo,String hkName, String content,int speed,int color) {
        PlatformBroadcastLog log = new PlatformBroadcastLog();
        log.setCreateDate(new Date());
        log.setBizType(Constants.ONE);
@@ -1154,6 +1331,7 @@
        log.setRemark(hkName);
        log.setInfo(content);
        log.setNum(Constants.ONE);
        log.setObjId(platformId.toString());
        TransparentChannelBodyRequest body = new TransparentChannelBodyRequest();
        TransparentChannelHeadRequest head = new TransparentChannelHeadRequest();