rk
2 天以前 4ed09be8e23b555ee43dfc471020cb4619da20a0
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java
@@ -2581,6 +2581,7 @@
    @Override
    public void autoPlatformCallCar(WmsService wmsService){
        log.error("定时自动分配月台 - 月台开始自动分配分配任务:{}"+DateUtil.getCurrDateTime());
        //查询当前开启的月台数据
        List<PlatformGroup> allPlatformGroup = platformGroupMapper.selectList(new QueryWrapper<PlatformGroup>().lambda().eq(PlatformGroup::getStatus,Constants.ZERO)
                .eq(PlatformGroup::getIsdeleted,Constants.ZERO).eq(PlatformGroup::getAutoCall,Constants.ONE)
@@ -2630,7 +2631,7 @@
                }
            }
            for (Platform platform:platforms) {
                log.error("定时自动分配月台 - 月台开始自动分配分配任务:{}"+JSONObject.toJSONString(platform));
                //月台 叫号入园数量
                Integer workingNum = platform.getWorkingNum();
                //查询当前月台是否存在月台叫号数据 如果大于等于可叫号数量 则跳过
@@ -2663,6 +2664,7 @@
                }
                for (int i = 0; i < workingNum - workNum ; i++) {
                    PlatformJob platformJob  = this.getAutoCallJob(platformJobList,platform,isDefaul,platformGroup);
                    log.error("定时自动分配月台 - 月台自动分配分配任务:{}"+JSONObject.toJSONString(platformJob));
                    if(Objects.isNull(platformJob)){
                        continue;
                    }
@@ -2797,6 +2799,7 @@
     * @return
     */
    public PlatformJob getAutoCallJob(List<PlatformJob> platformJobList, Platform platform,Boolean isDefaul,PlatformGroup platformGroup){
        log.error("定时自动分配月台 - 月台自动分配任务:{}"+DateUtil.getCurrDateTime());
        if(isDefaul){
            //月台下只有一类月台 直接返回第一个任务
            return platformJobList.get(Constants.ZERO);
@@ -2852,7 +2855,7 @@
                    }
                }else{
                    //物流车预约的任务 直接分配 散托盘月台
                    if(Constants.equalsInteger(platform.getType(),Constants.TWO)){
                    if(Constants.equalsInteger(platform.getType(),Constants.ONE)){
                        return platformJob;
                    }
                }
@@ -2870,7 +2873,7 @@
                    if(Objects.isNull(platformWmsJob)){
                        continue;
                    }
                    SystemDictData systemDictData = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.IN_REPERTOTY_CODE);
                    SystemDictData systemDictData = systemDictDataBiz.queryByCode(Constants.WMS_PARAM,Constants.IN_REPERTOTY_CODE);
                    if(Objects.nonNull(systemDictData)){
                        //判断放置位置
                        if(platformWmsDetailMapper.selectCount(new QueryWrapper<PlatformWmsDetail>().lambda().eq(PlatformWmsDetail::getIsdeleted,Constants.ZERO)
@@ -2896,4 +2899,31 @@
        return null;
    }
    @Override
    public void jobUrge(Integer jobId,LoginUserInfo loginUserInfo){
        if(Objects.isNull(jobId)){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        PlatformJob platformJob = platformJobMapper.selectById(jobId);
        if(Objects.isNull(platformJob)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(!(Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WAIT_CALL.getKey())
                        || Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.IN_WAIT.getKey())
                || Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.TRANSFERING.getKey()))){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,状态已流转");
        }
        platformJobMapper.update(null,new UpdateWrapper<PlatformJob>().lambda()
                .set(PlatformJob::getUrgeUser,loginUserInfo.getId())
                .set(PlatformJob::getUrgeTime,DateUtil.getCurrDateTime())
                .set(PlatformJob::getEditDate,DateUtil.getCurrDateTime())
                .eq(PlatformJob::getId,platformJob.getId())
        );
    }
}